Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into CRTP
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 7 Oct 2019 08:04:41 +0000 (10:04 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 7 Oct 2019 08:04:41 +0000 (10:04 +0200)
1089 files changed:
.appveyor.yml
.gitignore
.gitlab-ci.yml
.mailmap
.travis.yml
CMakeLists.txt
COPYING
ChangeLog
MANIFEST.in [new file with mode: 0644]
MANIFEST.in.in [new file with mode: 0644]
NEWS
README.coding
README.md
doc/Doxyfile.in
doc/doxygen/FAQ.doc
doc/doxygen/deployment.doc [deleted file]
doc/doxygen/inside.doc
doc/doxygen/inside_extending.doc
doc/doxygen/inside_release.doc
doc/doxygen/inside_tests.doc
doc/doxygen/ns3.doc [deleted file]
doc/doxygen/outcomes_logs.doc
doc/doxygen/platform.doc
doc/doxygen/uhood_switch.doc
docs/Build.sh
docs/ignored_symbols
docs/manpages/smpirun.1
docs/requirements.txt
docs/source/Configuring_SimGrid.rst
docs/source/Deploying_your_Application.rst [new file with mode: 0644]
docs/source/Doxyfile
docs/source/Experimental_Setup.rst [new file with mode: 0644]
docs/source/Installing_SimGrid.rst
docs/source/Introduction.rst [moved from docs/source/intro_concepts.rst with 84% similarity]
docs/source/Platform_Examples.rst [new file with mode: 0644]
docs/source/Plugins.rst [new file with mode: 0644]
docs/source/Start_Your_Own_Project.rst
docs/source/Tutorial_Algorithms.rst
docs/source/Tutorial_MPI_Applications.rst
docs/source/XML_Reference.rst [moved from docs/source/platform_reference.rst with 80% similarity]
docs/source/_templates/breadcrumbs.html [new file with mode: 0644]
docs/source/app_java.rst [deleted file]
docs/source/app_msg.rst
docs/source/app_s4u.rst
docs/source/app_smpi.rst
docs/source/application.rst
docs/source/community.rst
docs/source/conf.py
docs/source/img/graphical-toc.svg
docs/source/index.rst
docs/source/introduction.rst [deleted file]
docs/source/ns3.rst [new file with mode: 0644]
docs/source/outcomes.rst [moved from doc/doxygen/outcomes.doc with 61% similarity]
docs/source/platform.rst
docs/source/platform_howtos.rst
docs/source/scenario.rst [deleted file]
examples/deprecated/java/CMakeLists.txt
examples/deprecated/java/dht/chord/Node.java
examples/deprecated/java/dht/kademlia/RoutingTable.java
examples/deprecated/java/energy/consumption/EnergyConsumer.java
examples/deprecated/java/energy/consumption/energy-consumption.tesh
examples/deprecated/java/io/file/Node.java
examples/deprecated/java/io/file/io-file.tesh
examples/deprecated/java/io/storage/io-storage.tesh
examples/deprecated/java/process/migration/Emigrant.java
examples/deprecated/java/process/migration/Main.java
examples/deprecated/msg/CMakeLists.txt
examples/deprecated/msg/README.doc
examples/deprecated/msg/app-masterworker/app-masterworker-multicore.tesh
examples/deprecated/msg/app-masterworker/app-masterworker-vivaldi.tesh
examples/deprecated/msg/app-masterworker/app-masterworker.tesh
examples/deprecated/msg/cloud-masterworker/cloud-masterworker.c
examples/deprecated/msg/cloud-masterworker/cloud-masterworker.tesh
examples/deprecated/msg/dht-kademlia/answer.c
examples/deprecated/msg/dht-kademlia/answer.h
examples/deprecated/msg/dht-kademlia/dht-kademlia.tesh
examples/deprecated/msg/dht-pastry/dht-pastry.c
examples/deprecated/msg/dht-pastry/dht-pastry.tesh
examples/deprecated/msg/energy-vm/energy-vm.c
examples/deprecated/msg/energy-vm/energy-vm.tesh
examples/deprecated/msg/mc/CMakeLists.txt
examples/deprecated/msg/mc/bugged1.c
examples/deprecated/msg/mc/bugged1.tesh
examples/deprecated/msg/mc/bugged1_liveness.c
examples/deprecated/msg/mc/bugged1_liveness_sparse.tesh [deleted file]
examples/deprecated/msg/mc/bugged1_liveness_visited_sparse.tesh [deleted file]
examples/deprecated/msg/mc/bugged2.c
examples/deprecated/msg/mc/bugged2.tesh
examples/deprecated/msg/mc/bugged2_liveness.c
examples/deprecated/msg/mc/bugged3.c
examples/deprecated/msg/mc/centralized_mutex.c
examples/deprecated/msg/mc/electric_fence.c
examples/deprecated/msg/network-ns3/network-ns3.tesh
examples/deprecated/msg/platform-failures/platform-failures.c
examples/deprecated/msg/platform-failures/platform-failures.tesh
examples/deprecated/msg/process-create/process-create.c
examples/deprecated/msg/process-create/process-create.tesh
examples/deprecated/msg/synchro-semaphore/synchro-semaphore.tesh
examples/deprecated/msg/trace-categories/trace-categories.c
examples/deprecated/msg/trace-categories/trace-categories.tesh
examples/deprecated/msg/trace-host-user-variables/trace-host-user-variables.c
examples/deprecated/msg/trace-host-user-variables/trace-host-user-variables.tesh
examples/deprecated/msg/trace-link-user-variables/trace-link-user-variables.c
examples/deprecated/msg/trace-link-user-variables/trace-link-user-variables.tesh
examples/deprecated/msg/trace-masterworker/trace-masterworker.c
examples/deprecated/msg/trace-masterworker/trace-masterworker.tesh
examples/deprecated/msg/trace-process-migration/trace-process-migration.c
examples/deprecated/msg/trace-process-migration/trace-process-migration.tesh
examples/deprecated/msg/trace-route-user-variables/trace-route-user-variables.c
examples/deprecated/msg/trace-route-user-variables/trace-route-user-variables.tesh
examples/deprecated/simdag/dag-dotload/sd_dag-dotload.tesh
examples/deprecated/simdag/daxload/sd_daxload.tesh
examples/deprecated/simdag/fail/sd_fail.tesh
examples/deprecated/simdag/properties/sd_properties.tesh
examples/deprecated/simdag/ptg-dotload/sd_ptg-dotload.tesh
examples/deprecated/simdag/schedule-dotload/sd_schedule-dotload.tesh
examples/deprecated/simdag/scheduling/sd_scheduling.c
examples/deprecated/simdag/scheduling/sd_scheduling.tesh
examples/deprecated/simdag/test/sd_test.cpp
examples/deprecated/simdag/test/sd_test.tesh
examples/deprecated/simdag/throttling/sd_throttling.tesh
examples/deprecated/simdag/typed_tasks/sd_typed_tasks.tesh
examples/platforms/cluster_multi.xml
examples/platforms/dogbone.xml
examples/platforms/energy_cluster.xml
examples/platforms/energy_platform.xml
examples/platforms/hosts_with_disks.xml [new file with mode: 0644]
examples/platforms/ns3-big-cluster.xml [new file with mode: 0644]
examples/platforms/prop.xml
examples/platforms/small_platform_one_link_routes.xml
examples/platforms/storage/content/win_storage_content.txt [deleted file]
examples/platforms/storage/remote_io.xml
examples/platforms/storage/storage.xml
examples/platforms/wifi.xml [new file with mode: 0755]
examples/python/CMakeLists.txt
examples/s4u/CMakeLists.txt
examples/s4u/README.rst
examples/s4u/actor-create/s4u-actor-create.tesh
examples/s4u/actor-daemon/s4u-actor-daemon.cpp
examples/s4u/actor-daemon/s4u-actor-daemon.tesh
examples/s4u/actor-exiting/s4u-actor-exiting.cpp
examples/s4u/actor-exiting/s4u-actor-exiting.tesh
examples/s4u/actor-join/s4u-actor-join.cpp
examples/s4u/actor-join/s4u-actor-join.tesh
examples/s4u/actor-kill/s4u-actor-kill.cpp
examples/s4u/actor-kill/s4u-actor-kill.tesh
examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp
examples/s4u/actor-lifetime/s4u-actor-lifetime.tesh
examples/s4u/actor-migrate/s4u-actor-migrate.cpp
examples/s4u/actor-migrate/s4u-actor-migrate.tesh
examples/s4u/actor-suspend/s4u-actor-suspend.cpp
examples/s4u/actor-suspend/s4u-actor-suspend.tesh
examples/s4u/actor-yield/s4u-actor-yield.tesh
examples/s4u/app-bittorrent/s4u-app-bittorrent.tesh
examples/s4u/app-bittorrent/s4u-bittorrent.hpp
examples/s4u/app-bittorrent/s4u-peer.cpp
examples/s4u/app-bittorrent/s4u-peer.hpp
examples/s4u/app-bittorrent/s4u-tracker.cpp
examples/s4u/app-bittorrent/s4u-tracker.hpp
examples/s4u/app-chainsend/s4u-app-chainsend.tesh
examples/s4u/app-masterworkers/s4u-app-masterworkers.tesh
examples/s4u/app-pingpong/s4u-app-pingpong.tesh
examples/s4u/app-pingpong/simix-breakpoint.tesh
examples/s4u/app-token-ring/s4u-app-token-ring.tesh
examples/s4u/async-ready/s4u-async-ready.cpp
examples/s4u/async-ready/s4u-async-ready.tesh
examples/s4u/async-wait/s4u-async-wait.cpp
examples/s4u/async-wait/s4u-async-wait.tesh
examples/s4u/async-waitall/s4u-async-waitall.cpp
examples/s4u/async-waitall/s4u-async-waitall.tesh
examples/s4u/async-waitany/s4u-async-waitany.cpp
examples/s4u/async-waitany/s4u-async-waitany.tesh
examples/s4u/async-waituntil/s4u-async-waituntil.cpp
examples/s4u/async-waituntil/s4u-async-waituntil.tesh
examples/s4u/cloud-capping/s4u-cloud-capping.tesh
examples/s4u/cloud-migration/s4u-cloud-migration.tesh
examples/s4u/cloud-simple/s4u-cloud-simple.tesh
examples/s4u/dht-chord/s4u-dht-chord-node.cpp
examples/s4u/dht-chord/s4u-dht-chord.cpp
examples/s4u/dht-chord/s4u-dht-chord.hpp
examples/s4u/dht-chord/s4u-dht-chord.tesh
examples/s4u/dht-kademlia/s4u-dht-kademlia.tesh
examples/s4u/energy-boot/platform_boot.xml
examples/s4u/energy-boot/s4u-energy-boot.tesh
examples/s4u/energy-exec-ptask/s4u-energy-exec-ptask.cpp [new file with mode: 0644]
examples/s4u/energy-exec-ptask/s4u-energy-exec-ptask.tesh [new file with mode: 0644]
examples/s4u/energy-exec/s4u-energy-exec.cpp
examples/s4u/energy-exec/s4u-energy-exec.tesh
examples/s4u/energy-link/s4u-energy-link.tesh
examples/s4u/energy-vm/s4u-energy-vm.cpp
examples/s4u/energy-vm/s4u-energy-vm.tesh
examples/s4u/engine-filtering/s4u-engine-filtering.cpp
examples/s4u/engine-filtering/s4u-engine-filtering.tesh
examples/s4u/exec-async/s4u-exec-async.tesh
examples/s4u/exec-basic/s4u-exec-basic.cpp
examples/s4u/exec-basic/s4u-exec-basic.tesh
examples/s4u/exec-dvfs/s4u-exec-dvfs.cpp
examples/s4u/exec-dvfs/s4u-exec-dvfs.tesh
examples/s4u/exec-ptask/s4u-exec-ptask.cpp
examples/s4u/exec-ptask/s4u-exec-ptask.tesh
examples/s4u/exec-remote/s4u-exec-remote.tesh
examples/s4u/exec-waitany/s4u-exec-waitany.cpp [new file with mode: 0644]
examples/s4u/exec-waitany/s4u-exec-waitany.tesh [new file with mode: 0644]
examples/s4u/io-async/s4u-io-async.cpp
examples/s4u/io-async/s4u-io-async.tesh
examples/s4u/io-disk-raw/s4u-io-disk-raw.cpp [new file with mode: 0644]
examples/s4u/io-disk-raw/s4u-io-disk-raw.tesh [new file with mode: 0644]
examples/s4u/io-file-remote/s4u-io-file-remote.cpp
examples/s4u/io-file-remote/s4u-io-file-remote.tesh
examples/s4u/io-file-remote/s4u-io-file-remote_d.xml
examples/s4u/io-file-system/s4u-io-file-system.cpp
examples/s4u/io-file-system/s4u-io-file-system.tesh
examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp [deleted file]
examples/s4u/io-storage-raw/s4u-io-storage-raw.tesh [deleted file]
examples/s4u/maestro-set/s4u-maestro-set.cpp
examples/s4u/maestro-set/s4u-maestro-set.tesh
examples/s4u/mc-failing-assert/s4u-mc-failing-assert.cpp [new file with mode: 0644]
examples/s4u/mc-failing-assert/s4u-mc-failing-assert.tesh [new file with mode: 0644]
examples/s4u/platform-failures/s4u-platform-failures.cpp
examples/s4u/platform-failures/s4u-platform-failures.tesh
examples/s4u/platform-profile/s4u-platform-profile.tesh
examples/s4u/platform-properties/s4u-platform-properties.cpp
examples/s4u/platform-properties/s4u-platform-properties.tesh
examples/s4u/plugin-hostload/s4u-plugin-hostload.cpp
examples/s4u/plugin-hostload/s4u-plugin-hostload.tesh
examples/s4u/replay-comm/s4u-replay-comm.cpp
examples/s4u/replay-io/s4u-replay-io.cpp [moved from examples/s4u/replay-storage/s4u-replay-storage.cpp with 85% similarity]
examples/s4u/replay-io/s4u-replay-io.tesh [new file with mode: 0644]
examples/s4u/replay-io/s4u-replay-io.txt [new file with mode: 0644]
examples/s4u/replay-io/s4u-replay-io_d.xml [moved from examples/s4u/replay-storage/s4u-replay-storage_d.xml with 75% similarity]
examples/s4u/replay-storage/s4u-replay-storage.tesh [deleted file]
examples/s4u/replay-storage/s4u-replay-storage.txt [deleted file]
examples/s4u/routing-get-clusters/s4u-routing-get-clusters.tesh
examples/s4u/synchro-barrier/s4u-synchro-barrier.cpp
examples/s4u/synchro-barrier/s4u-synchro-barrier.tesh
examples/s4u/synchro-mutex/s4u-synchro-mutex.tesh
examples/s4u/synchro-semaphore/s4u-synchro-semaphore.tesh
examples/s4u/trace-platform/s4u-trace-platform.tesh
examples/smpi/CMakeLists.txt
examples/smpi/ampi_test/ampi_test.tesh
examples/smpi/energy/f77/CMakeLists.txt [deleted file]
examples/smpi/energy/f77/energy.tesh [deleted file]
examples/smpi/energy/f77/sef.f [deleted file]
examples/smpi/energy/f90/CMakeLists.txt [deleted file]
examples/smpi/energy/f90/energy.tesh [deleted file]
examples/smpi/energy/f90/sef90.f90 [deleted file]
examples/smpi/mc/only_send_deterministic.tesh
examples/smpi/mc/sendsend.c [new file with mode: 0644]
examples/smpi/mc/sendsend.tesh [new file with mode: 0644]
examples/smpi/replay/replay-override-replayer.tesh
examples/smpi/replay/replay.tesh
examples/smpi/replay_multiple/replay_multiple.tesh
examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_coll1.tesh
examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_coll2_st_sr_noise.tesh
examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed1.tesh
examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2.tesh
examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st.tesh
examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_noise.tesh
examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_sr.tesh
examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_sr_noise.tesh
examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c
examples/smpi/smpi_msg_masterslave/msg_smpi.tesh
examples/smpi/trace/trace.tesh
examples/smpi/trace_call_location/adjust [new file with mode: 0644]
examples/smpi/trace_call_location/trace_call_location.c
examples/smpi/trace_call_location/trace_call_location.tesh
include/simgrid/Exception.hpp
include/simgrid/actor.h
include/simgrid/barrier.h
include/simgrid/cond.h [new file with mode: 0644]
include/simgrid/config.h.in
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/kernel/resource/Action.hpp
include/simgrid/kernel/resource/Model.hpp
include/simgrid/kernel/routing/DragonflyZone.hpp
include/simgrid/kernel/routing/NetZoneImpl.hpp
include/simgrid/kernel/routing/RoutedZone.hpp
include/simgrid/kernel/routing/VivaldiZone.hpp
include/simgrid/modelchecker.h
include/simgrid/msg.h
include/simgrid/mutex.h [new file with mode: 0644]
include/simgrid/plugins/energy.h
include/simgrid/plugins/file_system.h
include/simgrid/plugins/live_migration.h
include/simgrid/s4u.hpp
include/simgrid/s4u/Activity.hpp
include/simgrid/s4u/Actor.hpp
include/simgrid/s4u/Barrier.hpp
include/simgrid/s4u/Comm.hpp
include/simgrid/s4u/ConditionVariable.hpp
include/simgrid/s4u/Disk.hpp [new file with mode: 0644]
include/simgrid/s4u/Engine.hpp
include/simgrid/s4u/Exec.hpp
include/simgrid/s4u/Host.hpp
include/simgrid/s4u/Io.hpp
include/simgrid/s4u/Link.hpp
include/simgrid/s4u/Mailbox.hpp
include/simgrid/s4u/Mutex.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/simgrid/smpi/replay.hpp
include/smpi/forward.hpp
include/smpi/mpif.h.in
include/smpi/sampi.h
include/smpi/smpi.h
include/smpi/smpi_extended_traces.h
include/smpi/smpi_extended_traces_fortran.h
include/smpi/smpi_helpers.h
include/smpi/smpi_helpers_internal.h
include/xbt/Extendable.hpp
include/xbt/asserts.h
include/xbt/base.h
include/xbt/config.h
include/xbt/config.hpp
include/xbt/dict.h
include/xbt/dynar.h
include/xbt/ex.h
include/xbt/functional.hpp
include/xbt/future.hpp
include/xbt/graph.h
include/xbt/log.h
include/xbt/log.hpp
include/xbt/range.hpp
include/xbt/signal.hpp
include/xbt/string.hpp
include/xbt/synchro.h
include/xbt/sysdep.h
include/xbt/utility.hpp
setup.py [new file with mode: 0755]
sonar-project.properties
src/bindings/java/JavaContext.cpp
src/bindings/java/JavaContext.hpp
src/bindings/java/jmsg_comm.cpp
src/bindings/java/jmsg_process.cpp
src/bindings/java/jmsg_process.h
src/bindings/java/jmsg_synchro.cpp
src/bindings/java/jmsg_task.cpp
src/bindings/java/jtrace.h
src/bindings/java/jxbt_utilities.hpp
src/bindings/java/org/simgrid/NativeLib.java
src/bindings/java/org/simgrid/msg/Comm.java
src/bindings/java/org/simgrid/msg/Mutex.java
src/bindings/java/org/simgrid/msg/ProcessKilledError.java
src/bindings/java/org/simgrid/msg/RngStream.java
src/bindings/java/org/simgrid/msg/Semaphore.java
src/bindings/java/org/simgrid/msg/Task.java
src/bindings/java/org/simgrid/msg/VM.java
src/bindings/java/org/simgrid/trace/Trace.java
src/bindings/lua/lua_host.cpp
src/bindings/lua/lua_platf.cpp
src/bindings/lua/lua_private.hpp
src/bindings/lua/simgrid_lua.hpp
src/bindings/python/simgrid_python.cpp
src/include/mc/datatypes.h
src/include/mc/mc.h
src/include/simgrid/sg_config.hpp
src/include/surf/surf.hpp
src/include/xxhash.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_events.cpp
src/instr/instr_paje_events.hpp
src/instr/instr_paje_trace.cpp
src/instr/instr_paje_types.cpp
src/instr/instr_paje_types.hpp
src/instr/instr_paje_values.hpp
src/instr/instr_platform.cpp
src/instr/instr_private.hpp
src/instr/instr_smpi.hpp
src/instr/jedule/jedule.cpp
src/instr/jedule/jedule_events.cpp
src/instr/jedule/jedule_platform.cpp
src/instr/jedule/jedule_sd_binding.cpp
src/internal_config.h.in
src/kernel/EngineImpl.cpp
src/kernel/activity/ActivityImpl.cpp
src/kernel/activity/ActivityImpl.hpp
src/kernel/activity/CommImpl.cpp
src/kernel/activity/CommImpl.hpp
src/kernel/activity/ConditionVariableImpl.cpp
src/kernel/activity/ConditionVariableImpl.hpp
src/kernel/activity/ExecImpl.cpp
src/kernel/activity/ExecImpl.hpp
src/kernel/activity/IoImpl.cpp
src/kernel/activity/IoImpl.hpp
src/kernel/activity/MailboxImpl.cpp
src/kernel/activity/MailboxImpl.hpp
src/kernel/activity/MutexImpl.cpp
src/kernel/activity/MutexImpl.hpp
src/kernel/activity/SemaphoreImpl.cpp
src/kernel/activity/SemaphoreImpl.hpp
src/kernel/activity/SleepImpl.cpp
src/kernel/activity/SleepImpl.hpp
src/kernel/activity/SynchroRaw.cpp
src/kernel/activity/SynchroRaw.hpp
src/kernel/actor/ActorImpl.cpp
src/kernel/actor/ActorImpl.hpp
src/kernel/context/Context.cpp
src/kernel/context/Context.hpp
src/kernel/context/ContextBoost.cpp
src/kernel/context/ContextRaw.cpp
src/kernel/context/ContextSwapped.cpp
src/kernel/context/ContextSwapped.hpp
src/kernel/context/ContextThread.cpp
src/kernel/context/ContextUnix.cpp
src/kernel/lmm/fair_bottleneck.cpp
src/kernel/lmm/lagrange.cpp [deleted file]
src/kernel/lmm/maxmin.cpp
src/kernel/lmm/maxmin.hpp
src/kernel/lmm/maxmin_test.cpp [new file with mode: 0644]
src/kernel/resource/Action.cpp
src/kernel/resource/DiskImpl.cpp [new file with mode: 0644]
src/kernel/resource/DiskImpl.hpp [new file with mode: 0644]
src/kernel/resource/Model.cpp
src/kernel/resource/Resource.cpp
src/kernel/resource/profile/DatedValue.cpp [new file with mode: 0644]
src/kernel/resource/profile/DatedValue.hpp [new file with mode: 0644]
src/kernel/resource/profile/Event.hpp [new file with mode: 0644]
src/kernel/resource/profile/FutureEvtSet.cpp [new file with mode: 0644]
src/kernel/resource/profile/FutureEvtSet.hpp [new file with mode: 0644]
src/kernel/resource/profile/Profile.cpp [moved from src/kernel/resource/profile/trace_mgr.cpp with 74% similarity]
src/kernel/resource/profile/Profile.hpp [new file with mode: 0644]
src/kernel/resource/profile/Profile_test.cpp [moved from src/kernel/resource/profile/trace_mgr_test.cpp with 97% similarity]
src/kernel/resource/profile/trace_mgr.hpp [deleted file]
src/kernel/routing/ClusterZone.cpp
src/kernel/routing/DijkstraZone.cpp
src/kernel/routing/DragonflyZone.cpp
src/kernel/routing/FatTreeZone.cpp
src/kernel/routing/FloydZone.cpp
src/kernel/routing/NetZoneImpl.cpp
src/kernel/routing/TorusZone.cpp
src/kernel/routing/VivaldiZone.cpp
src/mc/AddressSpace.hpp
src/mc/DwarfExpression.cpp [deleted file]
src/mc/ModelChecker.cpp
src/mc/ModelChecker.hpp
src/mc/ObjectInformation.cpp [deleted file]
src/mc/Session.cpp
src/mc/Session.hpp
src/mc/Transition.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/CommunicationDeterminismChecker.hpp
src/mc/checker/LivenessChecker.cpp
src/mc/checker/LivenessChecker.hpp
src/mc/checker/SafetyChecker.cpp
src/mc/checker/SafetyChecker.hpp
src/mc/checker/SimcallInspector.hpp [new file with mode: 0644]
src/mc/checker/simgrid_mc.cpp
src/mc/compare.cpp
src/mc/inspect/DwarfExpression.cpp [new file with mode: 0644]
src/mc/inspect/DwarfExpression.hpp [moved from src/mc/DwarfExpression.hpp with 83% similarity]
src/mc/inspect/Frame.cpp [moved from src/mc/Frame.cpp with 74% similarity]
src/mc/inspect/Frame.hpp [moved from src/mc/Frame.hpp with 84% similarity]
src/mc/inspect/LocationList.cpp [moved from src/mc/LocationList.cpp with 54% similarity]
src/mc/inspect/LocationList.hpp [moved from src/mc/LocationList.hpp with 59% similarity]
src/mc/inspect/ObjectInformation.cpp [new file with mode: 0644]
src/mc/inspect/ObjectInformation.hpp [moved from src/mc/ObjectInformation.hpp with 77% similarity]
src/mc/inspect/Type.hpp [moved from src/mc/Type.hpp with 58% similarity]
src/mc/inspect/Variable.hpp [moved from src/mc/Variable.hpp with 86% similarity]
src/mc/inspect/mc_dwarf.cpp [moved from src/mc/mc_dwarf.cpp with 57% similarity]
src/mc/inspect/mc_dwarf.hpp [moved from src/mc/mc_dwarf.hpp with 66% similarity]
src/mc/inspect/mc_dwarf_attrnames.cpp [moved from src/mc/mc_dwarf_attrnames.cpp with 95% similarity]
src/mc/inspect/mc_dwarf_tagnames.cpp [moved from src/mc/mc_dwarf_tagnames.cpp with 94% similarity]
src/mc/inspect/mc_member.cpp [moved from src/mc/mc_member.cpp with 64% similarity]
src/mc/inspect/mc_unw.cpp [new file with mode: 0644]
src/mc/inspect/mc_unw.hpp [moved from src/mc/mc_unw.hpp with 84% similarity]
src/mc/inspect/mc_unw_vmread.cpp [moved from src/mc/mc_unw_vmread.cpp with 63% similarity]
src/mc/mc_base.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_config.hpp
src/mc/mc_exit.hpp
src/mc/mc_global.cpp
src/mc/mc_hash.cpp
src/mc/mc_ignore.hpp
src/mc/mc_mmu.hpp
src/mc/mc_private.hpp
src/mc/mc_record.cpp
src/mc/mc_record.hpp
src/mc/mc_request.cpp
src/mc/mc_smx.cpp
src/mc/mc_smx.hpp
src/mc/mc_state.cpp
src/mc/mc_state.hpp
src/mc/mc_unw.cpp [deleted file]
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.h
src/mc/sosp/ChunkedData.cpp
src/mc/sosp/ChunkedData.hpp
src/mc/sosp/PageStore.cpp
src/mc/sosp/PageStore.hpp
src/mc/sosp/PageStore_test.cpp
src/mc/sosp/Region.cpp [new file with mode: 0644]
src/mc/sosp/Region.hpp [new file with mode: 0644]
src/mc/sosp/RegionSnapshot.cpp [deleted file]
src/mc/sosp/RegionSnapshot.hpp [deleted file]
src/mc/sosp/Snapshot.cpp [new file with mode: 0644]
src/mc/sosp/Snapshot.hpp [new file with mode: 0644]
src/mc/sosp/Snapshot_test.cpp [moved from src/mc/sosp/mc_snapshot_test.cpp with 75% similarity]
src/mc/sosp/mc_checkpoint.cpp [deleted file]
src/mc/sosp/mc_page_snapshot.cpp [deleted file]
src/mc/sosp/mc_snapshot.cpp [deleted file]
src/mc/sosp/mc_snapshot.hpp [deleted file]
src/msg/msg_comm.cpp
src/msg/msg_global.cpp
src/msg/msg_legacy.cpp
src/msg/msg_process.cpp
src/msg/msg_task.cpp
src/plugins/dirty_page_tracking.cpp
src/plugins/file_system/s4u_FileSystem.cpp
src/plugins/host_dvfs.cpp
src/plugins/host_energy.cpp
src/plugins/host_load.cpp
src/plugins/link_energy.cpp
src/plugins/vm/VirtualMachineImpl.cpp
src/plugins/vm/VmLiveMigration.cpp
src/plugins/vm/s4u_VirtualMachine.cpp
src/s4u/s4u_Actor.cpp
src/s4u/s4u_Barrier.cpp
src/s4u/s4u_Comm.cpp
src/s4u/s4u_ConditionVariable.cpp
src/s4u/s4u_Disk.cpp [new file with mode: 0644]
src/s4u/s4u_Engine.cpp
src/s4u/s4u_Exec.cpp
src/s4u/s4u_Host.cpp
src/s4u/s4u_Io.cpp
src/s4u/s4u_Link.cpp
src/s4u/s4u_Mailbox.cpp
src/s4u/s4u_Mutex.cpp
src/s4u/s4u_Netzone.cpp
src/s4u/s4u_Semaphore.cpp
src/s4u/s4u_Storage.cpp
src/simdag/dax_dtd.c
src/simdag/dax_dtd.h
src/simdag/sd_daxloader.cpp
src/simdag/sd_global.cpp
src/simdag/sd_task.cpp
src/simdag/simdag_private.hpp
src/simgrid/Exception.cpp
src/simgrid/sg_config.cpp
src/simix/libsmx.cpp
src/simix/popping.cpp
src/simix/popping_accessors.hpp
src/simix/popping_bodies.cpp
src/simix/popping_enum.h
src/simix/popping_generated.cpp
src/simix/popping_private.hpp
src/simix/simcalls.in
src/simix/simcalls.py
src/simix/smx_deployment.cpp
src/simix/smx_environment.cpp [deleted file]
src/simix/smx_global.cpp
src/simix/smx_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_file.cpp [new file with mode: 0644]
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-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-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-flattree-pipeline.cpp
src/smpi/colls/bcast/bcast-flattree.cpp
src/smpi/colls/bcast/bcast-mvapich-smp.cpp
src/smpi/colls/bcast/bcast-scatter-LR-allgather.cpp
src/smpi/colls/bcast/bcast-scatter-rdb-allgather.cpp
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.hpp
src/smpi/colls/smpi_nbc_impl.cpp
src/smpi/colls/smpi_openmpi_selector.cpp
src/smpi/include/private.hpp
src/smpi/include/smpi_actor.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_errhandler.hpp [new file with mode: 0644]
src/smpi/include/smpi_f2c.hpp
src/smpi/include/smpi_file.hpp [new file with mode: 0644]
src/smpi/include/smpi_group.hpp
src/smpi/include/smpi_info.hpp
src/smpi/include/smpi_keyvals.hpp
src/smpi/include/smpi_op.hpp
src/smpi/include/smpi_request.hpp
src/smpi/include/smpi_status.hpp
src/smpi/include/smpi_topo.hpp
src/smpi/include/smpi_win.hpp
src/smpi/internals/instr_smpi.cpp
src/smpi/internals/smpi_actor.cpp
src/smpi/internals/smpi_bench.cpp
src/smpi/internals/smpi_deployment.cpp
src/smpi/internals/smpi_dvfs.cpp [deleted file]
src/smpi/internals/smpi_global.cpp
src/smpi/internals/smpi_memory.cpp
src/smpi/internals/smpi_replay.cpp
src/smpi/internals/smpi_shared.cpp
src/smpi/internals/smpi_static_variables.cpp [deleted file]
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_errhandler.cpp [new file with mode: 0644]
src/smpi/mpi/smpi_f2c.cpp
src/smpi/mpi/smpi_file.cpp [new file with mode: 0644]
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/plugins/ampi/ampi.cpp
src/smpi/plugins/load_balancer/LoadBalancer.cpp
src/smpi/plugins/load_balancer/load_balancer.hpp
src/smpi/plugins/sampi_loadbalancer.cpp
src/smpi/smpi_replay_main.cpp
src/smpi/smpicc.in
src/smpi/smpicxx.in
src/smpi/smpif90.in
src/smpi/smpiff.in
src/smpi/smpirun.in
src/smpi/smpitools.sh
src/surf/HostImpl.cpp
src/surf/HostImpl.hpp
src/surf/PropertyHolder.cpp
src/surf/PropertyHolder.hpp
src/surf/StorageImpl.cpp
src/surf/StorageImpl.hpp
src/surf/cpu_cas01.cpp
src/surf/cpu_cas01.hpp
src/surf/cpu_interface.cpp
src/surf/cpu_interface.hpp
src/surf/cpu_ti.cpp
src/surf/cpu_ti.hpp
src/surf/disk_s19.cpp [new file with mode: 0644]
src/surf/disk_s19.hpp [new file with mode: 0644]
src/surf/host_clm03.cpp
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_simulator.cpp
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/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/OsSemaphore.hpp
src/xbt/automaton/automatonparse_promela.c
src/xbt/automaton/parserPromela.tab.cacc
src/xbt/automaton/parserPromela.tab.hacc
src/xbt/automaton/parserPromela.yacc
src/xbt/backtrace.cpp
src/xbt/config.cpp
src/xbt/config_test.cpp
src/xbt/dict.cpp
src/xbt/dict_test.cpp
src/xbt/dynar.cpp
src/xbt/exception.cpp
src/xbt/log.cpp
src/xbt/memory_map.cpp
src/xbt/memory_map.hpp
src/xbt/mmalloc/mfree.c
src/xbt/mmalloc/mm_module.c
src/xbt/mmalloc/mmalloc.c
src/xbt/mmalloc/mmorecore.c
src/xbt/mmalloc/mmprivate.h
src/xbt/mmalloc/mrealloc.c
src/xbt/snprintf.c
src/xbt/xbt_log_appender_file.cpp
src/xbt/xbt_log_layout_format.cpp
src/xbt/xbt_main.cpp
src/xbt/xbt_os_time.c
src/xbt/xbt_replay.cpp
src/xbt/xbt_str.cpp
src/xbt/xbt_str_test.cpp
src/xbt/xbt_virtu.c
teshsuite/java/CMakeLists.txt
teshsuite/java/sleephostoff/SleepHostOff.java
teshsuite/java/sleephostoff/sleephostoff.tesh
teshsuite/lua/lua_platforms.tesh
teshsuite/mc/CMakeLists.txt
teshsuite/mc/dwarf-expression/dwarf-expression.cpp
teshsuite/mc/dwarf-expression/dwarf-expression.tesh
teshsuite/mc/dwarf/dwarf.cpp
teshsuite/mc/dwarf/dwarf.tesh
teshsuite/mc/mutex-handling/mutex-handling.c
teshsuite/mc/random-bug/random-bug-nocrash.tesh [new file with mode: 0644]
teshsuite/mc/random-bug/random-bug-replay.tesh [new file with mode: 0644]
teshsuite/mc/random-bug/random-bug-report.tesh [deleted file]
teshsuite/mc/random-bug/random-bug.c [deleted file]
teshsuite/mc/random-bug/random-bug.cpp [new file with mode: 0644]
teshsuite/mc/random-bug/random-bug.tesh
teshsuite/msg/app-bittorrent/bittorrent-peer.c
teshsuite/msg/app-chainsend/app-chainsend.tesh
teshsuite/msg/app-pingpong/app-pingpong.tesh
teshsuite/msg/app-token-ring/app-token-ring.c
teshsuite/msg/app-token-ring/app-token-ring.tesh
teshsuite/msg/async-wait/async-wait.tesh
teshsuite/msg/async-waitall/async-waitall.tesh
teshsuite/msg/async-waitany/async-waitany.tesh
teshsuite/msg/cloud-capping/cloud-capping.c
teshsuite/msg/cloud-capping/cloud-capping.tesh
teshsuite/msg/cloud-migration/cloud-migration.c
teshsuite/msg/cloud-migration/cloud-migration.tesh
teshsuite/msg/cloud-simple/cloud-simple.c
teshsuite/msg/cloud-simple/cloud-simple.tesh
teshsuite/msg/cloud-two-tasks/cloud-two-tasks.tesh
teshsuite/msg/energy-consumption/energy-consumption.c
teshsuite/msg/energy-consumption/energy-consumption.tesh
teshsuite/msg/energy-pstate/energy-pstate.c
teshsuite/msg/energy-pstate/energy-pstate.tesh
teshsuite/msg/energy-ptask/energy-ptask.c
teshsuite/msg/energy-ptask/energy-ptask.tesh
teshsuite/msg/get_sender/get_sender.c
teshsuite/msg/get_sender/get_sender.tesh
teshsuite/msg/host_on_off/host_on_off.c
teshsuite/msg/host_on_off_processes/host_on_off_processes.cpp
teshsuite/msg/host_on_off_processes/host_on_off_processes.tesh
teshsuite/msg/host_on_off_recv/host_on_off_recv.c
teshsuite/msg/io-file-remote/io-file-remote.tesh
teshsuite/msg/io-file-remote/io-file-remote_d.xml
teshsuite/msg/io-file/io-file.c
teshsuite/msg/io-file/io-file.tesh
teshsuite/msg/io-raw-storage/io-raw-storage.tesh
teshsuite/msg/platform-properties/platform-properties.tesh
teshsuite/msg/plugin-hostload/plugin-hostload.c
teshsuite/msg/plugin-hostload/plugin-hostload.tesh
teshsuite/msg/process-daemon/process-daemon.c
teshsuite/msg/process-daemon/process-daemon.tesh
teshsuite/msg/process-join/process-join.c
teshsuite/msg/process-join/process-join.tesh
teshsuite/msg/process-kill/process-kill.tesh
teshsuite/msg/process-lifetime/process-lifetime.c
teshsuite/msg/process-lifetime/process-lifetime.tesh
teshsuite/msg/process-migration/process-migration.c
teshsuite/msg/process-migration/process-migration.tesh
teshsuite/msg/process-suspend/process-suspend.c
teshsuite/msg/process-suspend/process-suspend.tesh
teshsuite/msg/process-yield/process-yield.tesh
teshsuite/msg/task-priority/task-priority.c
teshsuite/msg/task-priority/task-priority.tesh
teshsuite/msg/task_listen_from/task_listen_from.cpp
teshsuite/s4u/CMakeLists.txt
teshsuite/s4u/activity-lifecycle/activity-lifecycle.cpp
teshsuite/s4u/actor-autorestart/actor-autorestart.cpp
teshsuite/s4u/actor-autorestart/actor-autorestart.tesh
teshsuite/s4u/actor-migration/actor-migration.tesh
teshsuite/s4u/actor/actor.cpp
teshsuite/s4u/cloud-interrupt-migration/cloud-interrupt-migration.tesh
teshsuite/s4u/cloud-sharing/cloud-sharing.cpp
teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp
teshsuite/s4u/concurrent_rw/concurrent_rw.cpp
teshsuite/s4u/concurrent_rw/concurrent_rw.tesh
teshsuite/s4u/ns3-simultaneous-send-rcv/ns3-simultaneous-send-rcv.cpp [new file with mode: 0644]
teshsuite/s4u/ns3-simultaneous-send-rcv/ns3-simultaneous-send-rcv.tesh [new file with mode: 0644]
teshsuite/s4u/storage_client_server/storage_client_server.cpp
teshsuite/s4u/storage_client_server/storage_client_server.tesh
teshsuite/s4u/wait-any-for/wait-any-for.cpp [new file with mode: 0644]
teshsuite/s4u/wait-any-for/wait-any-for.tesh [new file with mode: 0644]
teshsuite/simdag/CMakeLists.txt
teshsuite/simdag/basic-parsing-test/basic-parsing-test.tesh
teshsuite/simdag/flatifier/bogus_disk_attachment.tesh
teshsuite/simdag/flatifier/bogus_missing_gateway.tesh
teshsuite/simdag/flatifier/bogus_two_hosts_asymetric.tesh
teshsuite/simdag/flatifier/flatifier.cpp
teshsuite/simdag/flatifier/flatifier.tesh
teshsuite/simdag/is-router/is-router.cpp
teshsuite/simdag/platforms/properties.xml
teshsuite/simix/CMakeLists.txt
teshsuite/simix/generic-simcalls/generic-simcalls.cpp
teshsuite/simix/stack-overflow/stack-overflow.tesh
teshsuite/smpi/CMakeLists.txt
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.c
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.c
teshsuite/smpi/coll-gather/coll-gather.tesh
teshsuite/smpi/coll-reduce-scatter/coll-reduce-scatter.c
teshsuite/smpi/coll-reduce-scatter/coll-reduce-scatter.tesh
teshsuite/smpi/coll-reduce/coll-reduce.c
teshsuite/smpi/coll-reduce/coll-reduce.tesh
teshsuite/smpi/coll-scatter/coll-scatter.c
teshsuite/smpi/coll-scatter/coll-scatter.tesh
teshsuite/smpi/fort_args/fort_args.f90
teshsuite/smpi/hostfile_io [new file with mode: 0644]
teshsuite/smpi/hostfile_mpich [new file with mode: 0644]
teshsuite/smpi/io-all-at/io-all-at.c [new file with mode: 0644]
teshsuite/smpi/io-all-at/io-all-at.tesh [new file with mode: 0644]
teshsuite/smpi/io-all/io-all.c [new file with mode: 0644]
teshsuite/smpi/io-all/io-all.tesh [new file with mode: 0644]
teshsuite/smpi/io-ordered/io-ordered.c [new file with mode: 0644]
teshsuite/smpi/io-ordered/io-ordered.tesh [new file with mode: 0644]
teshsuite/smpi/io-shared/io-shared.c [new file with mode: 0644]
teshsuite/smpi/io-shared/io-shared.tesh [new file with mode: 0644]
teshsuite/smpi/io-simple-at/io-simple-at.c [new file with mode: 0644]
teshsuite/smpi/io-simple-at/io-simple-at.tesh [new file with mode: 0644]
teshsuite/smpi/io-simple/io-simple.c [new file with mode: 0644]
teshsuite/smpi/io-simple/io-simple.tesh [new file with mode: 0644]
teshsuite/smpi/isp/umpire/CMakeLists.txt
teshsuite/smpi/macro-shared/macro-shared.tesh
teshsuite/smpi/mpich3-test/CMakeLists.txt
teshsuite/smpi/mpich3-test/coll/CMakeLists.txt
teshsuite/smpi/mpich3-test/coll/allgatherv4_manual.c [deleted file]
teshsuite/smpi/mpich3-test/coll/allred.c
teshsuite/smpi/mpich3-test/coll/allred_manual.c [deleted file]
teshsuite/smpi/mpich3-test/coll/nonblocking3.c
teshsuite/smpi/mpich3-test/coll/testlist
teshsuite/smpi/mpich3-test/coll/uoplong.c
teshsuite/smpi/mpich3-test/comm/CMakeLists.txt
teshsuite/smpi/mpich3-test/comm/comm_info.c
teshsuite/smpi/mpich3-test/comm/ctxalloc.c
teshsuite/smpi/mpich3-test/comm/ctxsplit.c
teshsuite/smpi/mpich3-test/comm/testlist
teshsuite/smpi/mpich3-test/datatype/testlist
teshsuite/smpi/mpich3-test/errhan/CMakeLists.txt [new file with mode: 0644]
teshsuite/smpi/mpich3-test/errhan/adderr.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/errhan/commcall.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/errhan/dynamic_errcode_predefined_errclass.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/errhan/errfatal.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/errhan/errstring2.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/errhan/predef_eh.c [new file with mode: 0644]
teshsuite/smpi/mpich3-test/errhan/testlist [new file with mode: 0644]
teshsuite/smpi/mpich3-test/f77/coll/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/coll/nonblockingf.f
teshsuite/smpi/mpich3-test/f77/coll/testlist
teshsuite/smpi/mpich3-test/f77/comm/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/comm/testlist
teshsuite/smpi/mpich3-test/f77/datatype/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/datatype/testlist
teshsuite/smpi/mpich3-test/f77/ext/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/ext/c2f2c.c
teshsuite/smpi/mpich3-test/f77/ext/c2f2cf.f
teshsuite/smpi/mpich3-test/f77/ext/testlist
teshsuite/smpi/mpich3-test/f77/pt2pt/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/pt2pt/allpairf.f
teshsuite/smpi/mpich3-test/f77/pt2pt/testlist
teshsuite/smpi/mpich3-test/f77/rma/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/rma/attraints.h
teshsuite/smpi/mpich3-test/f77/rma/testlist
teshsuite/smpi/mpich3-test/f77/testlist
teshsuite/smpi/mpich3-test/f90/coll/CMakeLists.txt
teshsuite/smpi/mpich3-test/f90/coll/testlist
teshsuite/smpi/mpich3-test/f90/datatype/CMakeLists.txt
teshsuite/smpi/mpich3-test/f90/datatype/structf.f90
teshsuite/smpi/mpich3-test/f90/datatype/testlist
teshsuite/smpi/mpich3-test/f90/pt2pt/CMakeLists.txt
teshsuite/smpi/mpich3-test/f90/pt2pt/allpairf90.f90
teshsuite/smpi/mpich3-test/f90/pt2pt/testlist
teshsuite/smpi/mpich3-test/f90/rma/CMakeLists.txt
teshsuite/smpi/mpich3-test/f90/rma/testlist
teshsuite/smpi/mpich3-test/include/mpitest.h
teshsuite/smpi/mpich3-test/info/CMakeLists.txt
teshsuite/smpi/mpich3-test/info/infoenv.c
teshsuite/smpi/mpich3-test/init/testlist
teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt
teshsuite/smpi/mpich3-test/pt2pt/bsendpending.c
teshsuite/smpi/mpich3-test/pt2pt/rqfreeb.c
teshsuite/smpi/mpich3-test/pt2pt/testlist
teshsuite/smpi/mpich3-test/rma/CMakeLists.txt
teshsuite/smpi/mpich3-test/rma/badrma.c
teshsuite/smpi/mpich3-test/rma/lockcontention3.c
teshsuite/smpi/mpich3-test/rma/manyrma2.c
teshsuite/smpi/mpich3-test/rma/manyrma3.c
teshsuite/smpi/mpich3-test/rma/racc_local_comp.c
teshsuite/smpi/mpich3-test/rma/testlist
teshsuite/smpi/mpich3-test/rma/win_shared_put_flush_get.c
teshsuite/smpi/mpich3-test/runtests
teshsuite/smpi/mpich3-test/util/dtypes_manual.c [deleted file]
teshsuite/smpi/mpich3-test/util/mtest.c
teshsuite/smpi/mpich3-test/util/mtest_datatype_gen.c
teshsuite/smpi/mpich3-test/util/mtest_datatype_gen_manual.c [deleted file]
teshsuite/smpi/mpich3-test/util/mtest_manual.c [deleted file]
teshsuite/smpi/privatization/privatization.c
teshsuite/smpi/privatization/privatization.tesh
teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.c
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.c
teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.tesh
teshsuite/surf/CMakeLists.txt
teshsuite/surf/lmm_usage/lmm_usage.cpp
teshsuite/surf/lmm_usage/lmm_usage.tesh
teshsuite/surf/maxmin_bench/maxmin_bench_large.tesh
teshsuite/surf/maxmin_bench/maxmin_bench_medium.tesh
teshsuite/surf/maxmin_bench/maxmin_bench_small.tesh
teshsuite/surf/surf_usage/surf_usage.tesh
teshsuite/surf/surf_usage2/surf_usage2.tesh
teshsuite/surf/wifi_usage/wifi_usage.cpp [new file with mode: 0644]
teshsuite/surf/wifi_usage/wifi_usage.tesh [new file with mode: 0644]
teshsuite/xbt/CMakeLists.txt
teshsuite/xbt/log_usage/log_usage.tesh
teshsuite/xbt/log_usage/log_usage_ndebug.tesh
teshsuite/xbt/mmalloc/mmalloc_32.tesh
teshsuite/xbt/mmalloc/mmalloc_64.tesh
teshsuite/xbt/mmalloc/mmalloc_test.cpp
teshsuite/xbt/parmap_bench/parmap_bench.tesh
teshsuite/xbt/signals/signals.cpp [new file with mode: 0644]
teshsuite/xbt/signals/signals.tesh [new file with mode: 0644]
tools/CMakeLists.txt
tools/cmake/CTestConfig.cmake
tools/cmake/DefinePackages.cmake
tools/cmake/Distrib.cmake
tools/cmake/Flags.cmake
tools/cmake/Java.cmake
tools/cmake/MaintainerMode.cmake
tools/cmake/MakeLib.cmake
tools/cmake/MakeLibWin.cmake
tools/cmake/Modules/FindNS3.cmake
tools/cmake/Modules/pybind11Config.cmake [new file with mode: 0644]
tools/cmake/Option.cmake
tools/cmake/Tests.cmake
tools/cmake/scripts/my_valgrind.pl
tools/cmake/scripts/update_tesh.pl
tools/docker/Dockerfile.build-deps
tools/docker/Dockerfile.stable
tools/docker/Dockerfile.tuto-mc [new file with mode: 0644]
tools/docker/Dockerfile.tuto-s4u
tools/docker/Dockerfile.tuto-smpi
tools/docker/Dockerfile.unstable
tools/docker/Makefile
tools/graphicator/CMakeLists.txt
tools/jenkins/Coverage.sh
tools/jenkins/build.sh
tools/jenkins/project_description.sh
tools/sg_xml_energy_ponecore_to_pepsilon.py [new file with mode: 0755]
tools/simgrid_update_xml.pl
tools/smpi/generate_smpi_defines.pl
tools/tesh/CMakeLists.txt
tools/tesh/catch-all-bg-output.tesh [new file with mode: 0644]
tools/tesh/catch-timeout-output.tesh [new file with mode: 0644]
tools/tesh/catch-timeout.tesh
tools/tesh/tesh.py

index 7ef6a30..4b0611a 100644 (file)
@@ -40,14 +40,14 @@ install:
 # Work around a bug on appveyor where the default sh is not the one I expect
 - rename "C:\Program Files\Git\usr\bin\sh.exe" "sh-ignored.exe"
 # We need pybind11. SimGrid will pick it automatically if the subdir is here
-- cmd: git clone --depth=1 https://github.com/pybind/pybind11.git
+#- cmd: git clone --depth=1 https://github.com/pybind/pybind11.git
 
 build_script:
 - cmake -G "MinGW Makefiles" -Denable_lua=OFF -Denable_documentation=OFF -Denable_java=ON -Denable_smpi=OFF -Denable_mallocators=OFF -Denable_lto=OFF .
-- mingw32-make.exe VERBOSE=1 java-all python-bindings # Only the Java and Python parts
+- mingw32-make.exe VERBOSE=1 java-all python-bindings # Only the Java and Python parts
 - ctest --output-on-failure -R java
 # Don't test python, as pybind11 seems too complex for mingw for now (mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1)
-# The observed failure is around the ForcefulKill exception, that seems badly catched somehow.
+# The observed failure is around the ForcefulKill exception, that seems badly caught somehow.
 # - ctest --output-on-failure -R python
 
 artifacts:
index 59e3d9a..c0c4ce0 100644 (file)
@@ -146,6 +146,7 @@ examples/deprecated/msg/*.pcap
 examples/deprecated/msg/*.tr
 examples/s4u/actor-create/s4u-actor-create
 examples/s4u/actor-daemon/s4u-actor-daemon
+examples/s4u/actor-exiting/s4u-actor-exiting
 examples/s4u/actor-join/s4u-actor-join
 examples/s4u/actor-kill/s4u-actor-kill
 examples/s4u/actor-lifetime/s4u-actor-lifetime
@@ -179,12 +180,14 @@ examples/s4u/exec-dvfs/s4u-exec-dvfs
 examples/s4u/exec-monitor/s4u-exec-monitor
 examples/s4u/exec-ptask/s4u-exec-ptask
 examples/s4u/exec-remote/s4u-exec-remote
+examples/s4u/exec-waitany/s4u-exec-waitany
 examples/s4u/io-async/s4u-io-async
 examples/s4u/io-file-remote/s4u-io-file-remote
 examples/s4u/io-file-system/s4u-io-file-system
 examples/s4u/io-storage-raw/s4u-io-storage-raw
 examples/s4u/maestro-set/s4u-maestro-set
 examples/s4u/platform-failures/s4u-platform-failures
+examples/s4u/platform-profile/s4u-platform-profile
 examples/s4u/platform-properties/s4u-platform-properties
 examples/s4u/plugin-hostload/s4u-plugin-hostload
 examples/s4u/replay-comm/s4u-replay-comm
@@ -205,13 +208,12 @@ examples/deprecated/simdag/test/sd_test
 examples/deprecated/simdag/throttling/sd_throttling
 examples/deprecated/simdag/typed_tasks/sd_typed_tasks
 examples/smpi/ampi/smpi_ampi
-examples/smpi/energy/f77/sef
-examples/smpi/energy/f90/sef90
 examples/smpi/energy/smpi_energy
 examples/smpi/mc/smpi_bugged1
 examples/smpi/mc/smpi_bugged1_liveness
 examples/smpi/mc/smpi_bugged2
 examples/smpi/mc/smpi_mutual_exclusion
+examples/smpi/mc/smpi_sendsend
 examples/smpi/NAS/dt
 examples/smpi/NAS/ep
 examples/smpi/NAS/is
index 6f054f5..a4a26c9 100644 (file)
@@ -1,13 +1,25 @@
 image: simgrid/build-deps
 
+stages:
+ - build
+ - test
+
 pages:
+  stage: test
   script:
+  - cmake -Denable_model-checking=OFF -Denable_documentation=ON -Denable_compile_optimizations=OFF -Denable_smpi=OFF -Dpython=ON .
+  - make -j4
   - pip3 install --requirement docs/requirements.txt
-  - cmake -Denable_model-checking=OFF -Denable_documentation=OFF -Denable_coverage=OFF -Denable_java=OFF -Denable_lua=OFF -Denable_compile_optimizations=OFF -Denable_smpi=OFF .
-  - make -j4 python-bindings
   - cd docs
   - LC_ALL=C.UTF-8 ./Build.sh
   - mv build/html ../public
+  # - The CSS contains a reference to a font or something, not something we gonna fix on our side
+  # - The javasphinx output does not exist in the git, so the "edit on FramaGit" link is broken.
+  #   I'd like to report this as a bug, but javasphinx seems abandonned upstream.
+  - linkchecker --ignore-url='.*\.css$' --ignore-url=public/java/org ../public
+  # From time to time, we should check external links with the
+  # following, but it has a lot of false positive
+  # - linkchecker --ignore-url='.*\.css$' --ignore-url=public/java/org --check-extern ../public
   artifacts:
     paths:
     - public
@@ -15,6 +27,43 @@ pages:
   - master
 
 ctest:
+  stage: build
+  except:
+  - stable
   script:
   - 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=ON -Denable_compile_warnings=ON .
   - make VERBOSE=1 all tests && ctest --output-on-failure
+
+pip:
+  image: debian:testing
+  stage: build
+  except:
+  - stable
+  script:
+  - apt-get --allow-releaseinfo-change update && apt install -y python3-pip cmake libboost-dev g++ gcc pybind11-dev
+  - python3 setup.py sdist
+  - cd dist && tar xfz simgrid*.tar.gz && cd simgrid-*/ && python3 setup.py build
+
+release:
+  stage: build
+  only:
+  - stable
+  script:
+  - apt-get --allow-releaseinfo-change update && apt install -y binutils-x86-64-linux-gnu wget unzip zip
+  # Build the linux version of the jarfile without the boost dependency
+  - cmake -Denable_documentation=OFF -Denable_java=ON -Denable_lib_in_jar=ON -Dminimal-bindings=ON -Denable_compile_optimizations=ON -Denable_smpi=OFF .
+  - make VERBOSE=1 dist simgrid simgrid-java_jar
+  # Get the foreign architectures
+  - wget https://ci.appveyor.com/api/projects/mquinson/simgrid/artifacts/simgrid.jar -O simgrid-windows.jar
+  - export SGVER=`printf '#include "simgrid/config.h"\n#if SIMGRID_VERSION_PATCH\nSIMGRID_VERSION_MAJOR.SIMGRID_VERSION_MINOR.SIMGRID_VERSION_PATCH\n#else\nSIMGRID_VERSION_MAJOR.SIMGRID_VERSION_MINOR\n#endif'|gcc -E - -Iinclude|tail -1|sed 's/ //g'`
+  - wget https://ci.inria.fr/simgrid/job/SimGrid/build_mode=Debug,node=osx/lastSuccessfulBuild/artifact/build/SimGrid-${SGVER}/build/simgrid.jar -O simgrid-mac.jar
+  # Open all jar files, and strip them
+  - mkdir content ; cd content
+  - for j in  ../simgrid.jar ../simgrid-windows.jar ../simgrid-mac.jar ; do unzip -n $j ; done
+  - strip NATIVE/*/*/*.so
+  - x86_64-linux-gnu-strip NATIVE/*/*/lib*dll
+  - zip -r ../SimGrid-${SGVER}.jar *
+  artifacts:
+    paths:
+    - SimGrid-*.jar
+    - SimGrid-*.tar.gz
index 9c21520..78ddb54 100644 (file)
--- a/.mailmap
+++ b/.mailmap
@@ -31,6 +31,7 @@ Tom Cornebize <tom.cornebize@ensimag.grenoble-inp.fr> <Ezibenroc@users.noreply.g
 Gabriel Corona <gabriel.corona@loria.fr> <coron00b@barbecue.loria.fr>
 Gabriel Corona <gabriel.corona@loria.fr> <gabriel.corona@enst-bretagne.fr>
 Augustin Degomme <adegomme@gmail.com>
+Augustin Degomme <adegomme@gmail.com> <13270544+adegomme@users.noreply.github.com>
 Augustin Degomme <adegomme@gmail.com> <ad254919@cardamome.intra.cea.fr>
 Augustin Degomme <adegomme@gmail.com> <adegomme@users.noreply.github.com>
 Augustin Degomme <adegomme@gmail.com> <augustin.degomme@imag.fr>
@@ -59,6 +60,7 @@ Arnaud Giersch <arnaud.giersch@univ-fcomte.fr> <agiersch@48e7efb5-ca39-0410-a469
 Arnaud Giersch <arnaud.giersch@univ-fcomte.fr> <arnaud.giersch@free.fr>
 Arnaud Giersch <arnaud.giersch@univ-fcomte.fr> <arnaud.giersch@iut-bm.univ-fcomte.fr>
 Julien Gossa <julien.gossa@unistra.fr> <gossa@unistra.fr>
+Loic Guegan <manzerbredes@mailbox.org> <manzerberdes@gmx.com>
 Marion Guthmuller <marion.guthmuller@inria.fr> <marion.guthmuller@loria.fr>
 Ahmed Harbaoui <amad206@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
 Christian Heinrich <franz-christian.heinrich@inria.fr> <christian.heinrich@livando.com>
index 4368a85..7d4dd04 100644 (file)
@@ -5,7 +5,7 @@
 #   apt-get libns3-dev ns3
 #
 #
-dist: xenial
+dist: bionic
 language: cpp
 compiler:
    - gcc
@@ -14,8 +14,6 @@ jdk:
    - openjdk11
 addons:
   apt:
-    update: true
-    allow_unauthenticated: yes
     packages:
     - cmake
     - valgrind
@@ -25,7 +23,7 @@ addons:
     - libdw-dev
     - libevent-dev
     - libunwind8-dev
-#    - pybind11-dev # Not available in Xenial
+    - pybind11-dev
   homebrew:
     packages:
     - python
@@ -38,21 +36,32 @@ addons:
     build_command:   "make VERBOSE=1"
     branch_pattern: coverity
 
-# Don't install lua from Debian as we need 5.3 and don't have a backport.
-#   Installing lua from the source does not make any dynamic library.
-#   - curl http://www.lua.org/ftp/lua-5.3.1.tar.gz | tar xz
-#   - cd lua-5.3.1 
-#   -   if [ ${TRAVIS_OS_NAME} = 'linux' ] ; then make linux ; else make macosx ; fi
-#   -   make INSTALL_TOP=$TRAVIS_BUILD_DIR/LuaInstall install
-#   - cd ..
-#   - ls -lR $TRAVIS_BUILD_DIR/LuaInstall
-
-script:
-   - 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=ON -Denable_compile_warnings=ON . || (echo XXX CMakeOutput.log; cat /home/travis/build/simgrid/simgrid/CMakeFiles/CMakeOutput.log; echo XXX CMakeError.log;cat /home/travis/build/simgrid/simgrid/CMakeFiles/CMakeError.log; exit 1) ; fi
-   # run make and ctest in the sonar wrapper on master/linux; run it directly in PR or OSX
-   # - if [[ -e Makefile ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "${TRAVIS_PULL_REQUEST}" == "false" ]]; then ./tools/internal/travis-sonarqube.sh make -j2 VERBOSE=1; else make -j2 VERBOSE=1 && ctest -j2 --output-on-failure ; fi
-   - make -j2 VERBOSE=1 all tests && ctest -j2 --output-on-failure
+jobs:
+  include:
+    - os: linux
+      script:
+      - sudo apt-get update -qq
+      - sudo apt-get install cmake valgrind gfortran libboost-dev libboost-all-dev libdw-dev libevent-dev libunwind8-dev pybind11-dev
+      - (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 . || (echo XXX CMakeOutput.log; cat /home/travis/build/simgrid/simgrid/CMakeFiles/CMakeOutput.log; echo XXX CMakeError.log;cat /home/travis/build/simgrid/simgrid/CMakeFiles/CMakeError.log; exit 1))
+      - make -j2 VERBOSE=1 all tests && ctest -j2 --output-on-failure
+    - os: windows
+      script:
+      - mv "C:/Program Files/Git/usr/bin/sh.exe" "sh-ignored.exe"
+      -  choco install boost-msvc-12 python jdk8
+      -  export CC=gcc
+      -  export CXX=g++
+      -  export PATH='C:\Python37':'C:\local\boost_1_58_0':$PATH
+      -  export BOOST_LIBRARYDIR='C:/local/boost_1_58_0/lib64-msvc-12.0'
+      -  export BOOST_INCLUDEDIR='C:/local/boost_1_58_0/include'
+      -  export JAVA_HOME='C:/Program Files/Java/jdk1.8.0_211'
+      -  cmake -G "MinGW Makefiles" -Denable_lua=OFF -Denable_documentation=OFF -Denable_java=ON -Denable_smpi=OFF -Denable_mallocators=OFF -Denable_lto=OFF .
+      -  mingw32-make.exe VERBOSE=1 java-all && ctest --output-on-failure -R java
+    - os: osx
+      osx_image: xcode11
+      script:
+      - export LIBRARY_PATH=/usr/local/lib/gcc/9
+      - 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 .
+      - make -j2 VERBOSE=1 all tests && ctest -j2 --output-on-failure
 notifications:
   recipients:
     - martin.quinson@ens-rennes.fr
@@ -66,6 +75,3 @@ notifications:
       - "irc.debian.org#simgrid"
   template:
     - "%{repository}/%{branch} (%{commit} - %{author}): %{message}"
-os:
-  - linux
-  - osx
index ad1dd5b..94a78f4 100644 (file)
@@ -4,15 +4,15 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_HOME_DIRECTORY}/tools/cmake/M
 
 project(SimGrid C CXX)
 
+## Save compiler flags preset with environment variables CFLAGS or CXXFLAGS;
+## they will used within smpicc, smpicxx.
+## Do it early so that we get their genuine values. The same will be done later for Fortran.
+set(SMPI_C_FLAGS "${CMAKE_C_FLAGS}")
+set(SMPI_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+
 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
 #     Check for the compiler        #
 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
-
-### Need to set rc ccompiler before enable language
-if(WIN32)
-  SET(CMAKE_RC_COMPILER "windres")
-endif()
-
 ## 
 ## Check the C/C++ standard that we need
 ##   See also tools/cmake/Flags.cmake that sets our paranoid warning flags
@@ -22,7 +22,6 @@ CHECK_C_COMPILER_FLAG(-fstack-cleaner HAVE_C_STACK_CLEANER)
 ## Request full debugging flags
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g3")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
-set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g")
 
 if (CMAKE_COMPILER_IS_GNUCC)    
   if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7")
@@ -80,6 +79,10 @@ if ((NOT DEFINED enable_smpi) OR enable_smpi)
       set(SMPI_Fortran_LIBS "")
       set(SMPI_FLANG 1)
     endif()
+    set(SMPI_Fortran_FLAGS "${SMPI_Fortran_FLAGS} ${CMAKE_Fortran_FLAGS}")
+
+    ## Request debugging flags for Fortran too
+    set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g")
 
     set(SMPI_FORTRAN 1)
   endif(CMAKE_Fortran_COMPILER)
@@ -91,9 +94,8 @@ endif()
 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
 
 set(SIMGRID_VERSION_MAJOR "3")
-set(SIMGRID_VERSION_MINOR "22")
-set(SIMGRID_VERSION_PATCH "90")
-set(SIMGRID_VERSION_EXTRA "-DEVEL") # Extra words to add to version string (e.g. -rc1)
+set(SIMGRID_VERSION_MINOR "23")
+set(SIMGRID_VERSION_PATCH "3") # odd => git branch; even => stable release or released snapshot
 
 set(SIMGRID_VERSION_DATE  "2019") # Year for copyright information
 
@@ -205,11 +207,14 @@ include(CheckLibraryExists)
 include(CheckSymbolExists)
 
 set(HAVE_GRAPHVIZ 0)
-include(FindGraphviz)
-
 set(SIMGRID_HAVE_LUA 0)
-if(enable_lua)
-  include(FindLuaSimgrid)
+if(minimal-bindings)
+  message(STATUS "Don't even look for graphviz nor lua, as we build minimal binding libraries.")
+else()
+  include(FindGraphviz)
+  if(enable_lua)
+    include(FindLuaSimgrid)
+  endif()
 endif()
 
 set(SIMGRID_HAVE_NS3 0)
@@ -221,7 +226,7 @@ if(enable_ns3)
       set(SIMGRID_DEP "${SIMGRID_DEP} -lns${NS3_VERSION}-${lib}${NS3_SUFFIX}")
     endforeach()
   else()
-    message(FATAL_ERROR "Cannot find NS3. Please install it (apt-get install ns3 libns3-dev) or disable that cmake option")
+    message(FATAL_ERROR "Cannot find ns-3. Please install it (apt-get install ns3 libns3-dev) or disable that cmake option")
   endif()
 endif()
 
@@ -238,44 +243,60 @@ if(enable_smpi_papi)
 endif()
 
 # But we do need the core of Boost
-find_package(Boost 1.48)
-if(Boost_FOUND)
-  include_directories(${Boost_INCLUDE_DIRS})
-else()
-  if(APPLE)
-    message(FATAL_ERROR "Boost libraries not found. Try to install them with 'sudo fink install boost1.53.nopython' (check the exact name with 'fink list boost') or 'sudo brew install boost'")
-  else()
-    message(FATAL_ERROR "Boost libraries not found. Install libboost-dev (>= 1.48.0).")
-  endif()
-endif()
-
 # cmake before 3.13.1 does not know about stacktrace components. Fix it.
 # Usable components: https://www.boost.org/doc/libs/1_65_1/doc/html/stacktrace/configuration_and_build.html
 set(_Boost_STACKTRACE_HEADERS           "boost/stacktrace.hpp")
 set(_Boost_STACKTRACE_BACKTRACE_HEADERS "boost/stacktrace.hpp")
+set(_Boost_STACKTRACE_ADDR2LINE_HEADERS "boost/stacktrace.hpp")
 
-find_package(Boost 1.59 COMPONENTS context stacktrace_backtrace)
-set(Boost_FOUND 1) # These components are optionals
-message(STATUS "Mandatory components found. SimGrid is compilable.")
-message(STATUS "Looking for optional Boost components:")
-
-if (Boost_STACKTRACE_BACKTRACE_FOUND)
-  message (STATUS "  stacktrace: found. Activating human-readable stack traces.")
-  set(HAVE_BOOST_STACKTRACE 1)
-  set(SIMGRID_DEP "${SIMGRID_DEP} -lboost_stacktrace_backtrace")
-else()
-  message (STATUS "  stacktrace: MISSING. Install libboost-stacktrace-dev to display the stacktraces.")
-  set(HAVE_BOOST_STACKTRACE 0)
-endif()
-
-if(Boost_CONTEXT_FOUND)
-  message (STATUS "  context: found. Activating Boost contexts.")
-  set(HAVE_BOOST_CONTEXTS 1)
-else()
-  message (STATUS "  context: MISSING. Install libboost-context-dev for this optional feature.")
-  set(HAVE_BOOST_CONTEXTS 0)
-endif()
-
+  if(minimal-bindings) # When we want a minimal jarfile, don't even search for boost optional components
+    message(STATUS "Don't even look for boost optional components, as we build minimal binding libraries.")
+    find_package(Boost 1.48)
+  else()
+    find_package(Boost 1.59 OPTIONAL_COMPONENTS context stacktrace_backtrace stacktrace_addr2line)
+  endif()
+  if(Boost_FOUND)
+    include_directories(${Boost_INCLUDE_DIRS})
+    message(STATUS "Mandatory components found. SimGrid is compilable.")
+    if (NOT minimal-bindings)
+      message(STATUS "Looking for optional Boost components:")
+      set(Boost_FOUND 1) # These components are optionals
+      CHECK_INCLUDE_FILE("backtrace.h" HAVE_BACKTRACE_H) # check that backtrace is actually possible
+      if (Boost_STACKTRACE_BACKTRACE_FOUND AND HAVE_BACKTRACE_H)
+        message (STATUS "  stacktrace: found the fast 'backtrace' implementation. Activating human-readable stack traces.")
+        set(HAVE_BOOST_STACKTRACE_BACKTRACE 1)
+      else()
+        set(HAVE_BOOST_STACKTRACE_BACKTRACE 0)
+        if (Boost_STACKTRACE_ADDR2LINE_FOUND)
+          message (STATUS "  stacktrace: found the slow 'addr2line' implementation. Activating human-readable stack traces.")
+          set(HAVE_BOOST_STACKTRACE_ADDR2LINE 1)
+        else()
+          message (STATUS "  stacktrace: MISSING. Install libboost-stacktrace-dev to display the stacktraces.")
+          set(HAVE_BOOST_STACKTRACE_ADDR2LINE 0)
+        endif()
+      endif()
+
+      if(Boost_CONTEXT_FOUND)
+        message (STATUS "  context: found. Activating Boost contexts.")
+        set(HAVE_BOOST_CONTEXTS 1)
+      else()
+        message (STATUS "  context: MISSING. Install libboost-context-dev for this optional feature.")
+        set(HAVE_BOOST_CONTEXTS 0)
+      endif()
+    endif()
+  else()
+    if(APPLE)
+      message(FATAL_ERROR "Boost libraries not found. Try to install them with 'sudo fink install boost1.53.nopython' (check the exact name with 'fink list boost') or 'sudo brew install boost'")
+    else()
+      find_package(Boost 1.48) #try without optional libraries
+      if(NOT Boost_FOUND)
+        message(FATAL_ERROR "Boost libraries not found. Install libboost-dev (>= 1.48.0).")
+      else()
+        include_directories(${Boost_INCLUDE_DIRS})
+        message(STATUS "Mandatory components found. SimGrid is compilable.")
+      endif()
+    endif()
+  endif() 
 
 # Checks for header libraries functions.
 CHECK_LIBRARY_EXISTS(rt      clock_gettime           "" HAVE_POSIX_GETTIME)
@@ -352,12 +373,19 @@ else()
   SET(SIMGRID_HAVE_MALLOCATOR 0)
 endif()
 
-include(FindLibunwind)
-if(HAVE_LIBUNWIND)
-  SET(SIMGRID_DEP "${SIMGRID_DEP} ${LIBUNWIND_LIBRARIES}")
-else()
+if (minimal-bindings)
+  message(STATUS "Don't look for libunwind as we build minimal binding libraries.")
   if(enable_model-checking)
-    message(FATAL_ERROR "Please install libunwind-dev libdw-dev libelf-dev libevent-dev if you want to compile the SimGrid model checker.")
+    message(FATAL_ERROR "You cannot enable model-checking and minimal-bindings at the same time.")
+  endif()
+else()
+  include(FindLibunwind)
+  if(HAVE_LIBUNWIND)
+    SET(SIMGRID_DEP "${SIMGRID_DEP} ${LIBUNWIND_LIBRARIES}")
+  else()
+    if(enable_model-checking)
+      message(FATAL_ERROR "Please install libunwind-dev libdw-dev libelf-dev libevent-dev if you want to compile the SimGrid model checker.")
+    endif()
   endif()
 endif()
 
@@ -369,7 +397,7 @@ if(enable_model-checking)
   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")
+    message(WARNING "FreeBSD + Model-Checking + Java = too much for now. Disabling the Java bindings.")
     set(enable_java FALSE)
   endif()
 else()
@@ -380,12 +408,14 @@ mark_as_advanced(PATH_LIBDW_H)
 mark_as_advanced(PATH_LIBDW_LIB)
 
 if (enable_model-checking AND enable_ns3)
-  message(FATAL_ERROR "Cannot activate both model-checking and NS3 bindings: NS3 pull too much dependencies for the MC to work")
+  message(FATAL_ERROR "Cannot activate both model-checking and ns-3 bindings: ns-3 pull too much dependencies for the MC to work")
 endif()
 
+get_property(known_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES)
+
 if(enable_smpi)
   SET(HAVE_SMPI 1)
-  if("${CMAKE_SYSTEM}" MATCHES "Darwin|FreeBSD|Linux")
+  if(NOT WIN32)
     SET(HAVE_PRIVATIZATION 1)
   else()
     message (STATUS "Warning:  no support for SMPI automatic privatization on this platform")
@@ -515,7 +545,7 @@ set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=\"${CMAKE_INSTALL_PREFIX}/lib")
 if(NS3_LIBRARY_PATH)
   set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${NS3_LIBRARY_PATH}")
 endif()
-set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"")
+set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"")
 set(SMPIMAIN ${libdir}/simgrid/smpimain)
 set(SMPIREPLAYMAIN ${libdir}/simgrid/smpireplaymain)
 
@@ -544,7 +574,7 @@ set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=\"${CMAKE_BINARY_DIR}/lib")
 if(NS3_LIBRARY_PATH)
   set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${NS3_LIBRARY_PATH}")
 endif()
-set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"")
+set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}\"")
 set(SMPIMAIN ${CMAKE_BINARY_DIR}/lib/simgrid/smpimain)
 set(SMPIREPLAYMAIN ${CMAKE_BINARY_DIR}/lib/simgrid/smpireplaymain)
 
@@ -745,49 +775,64 @@ if(enable_java)
   include(${CMAKE_HOME_DIRECTORY}/tools/cmake/Java.cmake)
 endif()
 
+if (enable_model-checking AND (NOT ("cxx_std_14" IN_LIST known_features)))
+  message(WARNING "C++14 not found. The model-checker will use a slow hash function. You should upgrade your compiler")
+  set(SG_HAVE_CPP14 0)
+else()
+  set(SG_HAVE_CPP14 1)
+  set_property(TARGET simgrid PROPERTY CXX_STANDARD 14)    
+endif()
+
 # Python binding (with pybind11)
 ################
 # Our usage of pybind11::overload_cast mandates C++14
-get_property(known_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES)
+if((NOT DEFINED enable_python) OR enable_python)
+  if("cxx_std_14" IN_LIST known_features)
+
+    if(EXISTS ${CMAKE_HOME_DIRECTORY}/pybind11) # Try to use a local copy of pybind11, if any
+      message(STATUS "Use the internal copy of pybind11 (using C++14).")
+      add_subdirectory(${CMAKE_HOME_DIRECTORY}/pybind11)
+      set(pybind11_FOUND ON)
+
+      set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_HOME_DIRECTORY}/pybind11/tools/)
+      set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4)
+      find_package(PythonLibsNew ${PYBIND11_PYTHON_VERSION} REQUIRED)
+
+    else()
+      find_package(pybind11 CONFIG)
+      if (pybind11_VERSION VERSION_LESS 2.2)
+        message(STATUS "SimGrid needs at least v2.2 of pybind11. Disabling the Python bindings (found version: ${pybind11_VERSION}).")
+        set(pybind11_FOUND OFF)
+      endif()
+    endif()
 
-if("cxx_std_14" IN_LIST known_features)
-
-  if(EXISTS ${CMAKE_HOME_DIRECTORY}/pybind11) # Try to use a local copy of pybind11, if any
-    message(STATUS "Use the internal copy of pybind11 (using C++14).")
-    add_subdirectory(${CMAKE_HOME_DIRECTORY}/pybind11)
-    set(pybind11_FOUND ON)
-    
-    set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_HOME_DIRECTORY}/pybind11/tools/)
-    set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4)
-    find_package(PythonLibsNew ${PYBIND11_PYTHON_VERSION} REQUIRED)
-    
-  else()
-    find_package(pybind11 2.2.0)
-  endif()
-  
-  if(NOT PYTHONLIBS_FOUND)
-    message(STATUS "Python libs not found. Turn pybind11 off.")
+    if(NOT PYTHONLIBS_FOUND)
+      message(STATUS "Python libs not found. Turn pybind11 off.")
 
+      set(pybind11_FOUND OFF)
+    endif()
+
+  else()
+    message(STATUS "No support for C++14 detected, don't even search for pybind11.")
     set(pybind11_FOUND OFF)
   endif()
-  
-else()
-  message(STATUS "No support for C++14 detected, don't even search for pybind11.")
-  set(pybind11_FOUND OFF)
+  unset(known_features)
 endif()
-unset(known_features)
 
 option(enable_python "Whether the Python bindings are activated." ${pybind11_FOUND}) # ON by default if dependencies are met
 
 if("${CMAKE_SYSTEM}" MATCHES "FreeBSD" AND enable_model-checking AND enable_python)
-  message(WARNING "FreeBSD + Model-Checking + Python = too much for now. Disabling python.")
+  message(WARNING "FreeBSD + Model-Checking + Python = too much for now. Disabling the Python bindings.")
   set(enable_python FALSE)
 endif()
 
 if(enable_python)
   if(pybind11_FOUND)
     message(STATUS "Found pybind11, with C++14.")
-    pybind11_add_module(python-bindings src/bindings/python/simgrid_python.cpp)
+    if(NOT enable_lto)
+      set(pybind11_options NO_EXTRAS)
+    endif()
+    pybind11_add_module(python-bindings src/bindings/python/simgrid_python.cpp ${pybind11_options})
     target_compile_features(python-bindings PRIVATE cxx_std_14)
     target_link_libraries(python-bindings PUBLIC simgrid)
     set_target_properties(python-bindings PROPERTIES
@@ -884,9 +929,9 @@ message("        with LTO ....................: ${enable_lto}")
 message("")
 
 if (SIMGRID_HAVE_NS3)
-  message("        Compile NS-3 ................: yes (path: ${NS3_PATH})")
+  message("        Compile ns-3 ................: yes (path: ${NS3_PATH})")
 else()
-  message("        Compile NS-3 ................: NO  (hint: ${NS3_HINT})")
+  message("        Compile ns-3 ................: NO  (hint: ${NS3_HINT})")
 endif()
 
 if (${Java_FOUND})
diff --git a/COPYING b/COPYING
index a879a3e..ca84049 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -3,7 +3,7 @@ Upstream-Name: SimGrid
 Source: https://simgrid.org/
 
 Files: *
-Copyright: 2003-2019. The SimGrid Team. All rights reserved.
+Copyright: 2003-2019. The SimGrid team. All rights reserved.
 License: LGPL-2.1
 
 Files: src/xbt/snprintf.c
@@ -14,7 +14,7 @@ Comment: Heavily adapted by the SimGrid team but remains under the original lice
 Files: src/xbt/mmalloc/* src/include/xbt/mmalloc.h
 Copyright: 
   Copyright (C) 1991, 1992 Free Software Foundation, Inc.
-  Copyright (C) 2003-2019. The SimGrid Team.
+  Copyright (C) 2003-2019. The SimGrid team.
 License: LGPL-2.1
 Comment: these files used to be part of gdb, but were removed there
 
index 0fa7201..0a92673 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
-SimGrid (3.23) NOT RELEASED (Release Target: June 21. 2019, 15:54 UTC)
+----------------------------------------------------------------------------
+
+SimGrid (3.23.3) NOT RELEASED YET (v3.24 expected September 23. 7:50 UTC)
+
+S4U:
+ - Introduce a s4u::Disk interface to manage the newly introduced <disk>
+   tag. s4u::Disk is called to supplant s4u::Storage in a near future. It
+   thus becomes the default resource to execute I/O operations. Examples
+   and the file system plugin have been modified to use disks instead of
+   storage elements. Storage can still be used but is doomed to disappear.
+   Users are thus adviced to update their simulators accordingly.
+ - Barrier::wait returns SG_BARRIER_SERIAL_THREAD for (only) one actor
+   for consistency with pthread_barrier_wait()
+ - Host::get_englobing_zone() returns the englobing netzone
+ - Actor::on_destruction is now called in the destructor
+   Actor::on_termination new signal called when the actor terminates
+   its code.
+ - Global signals are now part of the Engine:
+   - on_platform_creation: after config settings, before the XML parsing
+   - on_platform_created: right after the XML parsing
+   - on_time_advance: each time the clock advances
+   - on_simulation_end: after simulation, before cleanups
+   - on_deadlock: as the name implies.
+ - C bindings:
+   - sg_{actor,host,link}_{data,data_set}() now all exist.
+     Use them to attach user data to the object and retrieve it.
+
+Models:
+ - Introduce an experimental Wifi model. It sounds reasonable
+   according to the state of the art, but it still has to be properly
+   validated, at least against ns-3 if not against reality.
+ - Improved the usability of ns-3. Several bugs were ironed out.
+ - host_energy: Wattage was expressed as 'idle:oneCore:allCores'.
+   It is now expressed as 'idle:epsilon:allCores' to properly model the
+   consumption of non-whole tasks on mono-core hosts. More info in the doc.
+
+MSG:
+ - convert a new set of functions to the S4U C interface and move the old MSG
+   versions to legacy (MSG_process_self*, MSG_process_{un}ref, ...)
+
+SMPI:
+ - Fortran bindings for DVFS have been removed.
+ - Add support for MPI_Irsend, MPI_Rsend, MPI_Rsend_init, MPI_Bsend,
+   MPI_Ibsend, MPI_Bsend_init, MPI_Buffer_attach, MPI_Buffer_detach
+ - SMPI can now be selected by cmake's find_module(MPI) with
+   MPI_C_COMPILER, MPI_CXX_COMPILER, MPI_Fortran_COMPILER variables.
+ - Add support for MPI Errhandlers in Comm, File or Win. Default errhandler is now
+   MPI_ERRORS_ARE_FATAL, so codes which were sending warnings may start failing.
+ - trace-call-location can now be used with TI traces, and replayed.
+ - Default for trace-call-location is now to use file names and not full paths.
+   To revert to previous behaviour (in case of collision of filenames), option
+   "smpi/trace-call-use-absolute-path" can be set to yes.
+
+Model-Checker:
+ - Use the included xxHash as an hash implem when C++14 is usable.
+ - Option model-checker/hash was removed. This is always activated now.
+ - New option smpi/buffering controls the MPI buffering in MC mode.
+ - MPI calls now MC_assert() that no MPI_ERR_* code is returned.
+   This is useful to check for MPI compliance.
+
+Documentation:
+ - New section on plugins: how to define a new one, and existing ones.
+
+XBT:
+ - xbt_mutex_t and xbt_cond_t are now marked as deprecated, a new C interface
+   on S4U is already available to replace them by sg_mutex_t and sg_cond_t.
+
+XML:
+ - Introduce the <disk> tag as a replacement of the <storage>, <storage_type>,
+   and <mount> tags. The rationale is finish to decouple what should be handle
+   by SimGrid kernel (i.e., resources and activities) from plugins built in
+   user space (e.g., the file system plugin). This new tag currently accepts
+   only three attributes (id, read_bw, and write_bw). All the other information
+   that was declared with the storage related tags now has to be expressed as
+   properties. An example of platform using this new tag is available at
+   examples/platforms/hostsè_with_disks.xml
+
+Fixed bugs (FG#.. -> framagit bugs; FG!.. -> framagit merge requests):
+ - FG#28: add sg_actor_self (and other wrappers on this_actor methods)
+ - FG#29 and FG#33: provide a new C API to mutexes and condition variables
+ - FG#30: convert MSG_process_{un}ref to sg_actor_{un}ref
+ - FG#31: per-actor data
+ - FG#34: SG_BARRIER_SERIAL_THREAD?
+ - FG#35: model-checker does not like buster-produced binaries
+ - FG!13: MC: complete workaround in the error msg seen on modern systems
+ - FG!15: execute_flops now logs compute
+ - FG!16: Fix the ns-3 bindings when several flows are simultaneously finishing
+ - FG!17: ns-3: unblock the right number of communications + others issues
+ - FG!18: Improving the performance of the ns-3 bindings
+ - GH#219: Error in the throughput of TCP transfer
+ - GH!330: Minor polishing of English: Configuring_Simgrid
+ - GH!331: Fix a doc error about actors (Tutorial_algorithms)
+ - GH!332: Add '-O0' flag for: cmake -DCMAKE_BUILD_TYPE=Debug
+
+----------------------------------------------------------------------------
+
+SimGrid (3.23.2) July 8. 2019
+
+Documentation:
+ - Nicer introduction page.
+ - Migrate the "Deploy your application" page to the new doc.
+ - Move Java as a subtree of MSG.
+
+General:
+ - Rename simgrid::TimeoutError to simgrid::TimeoutException.
+
+XBT:
+ - Drop xbt_dynar_sort_strings().
+
+Bugs:
+ - Really fix FG#26: Turning off a link should raise NetworkFailureException
+ - FG#27: Wrong exception thrown to wait_any when link is turned off
+ - GH#328: Java: Canceling multiple tasks in a single vm/host
+
+----------------------------------------------------------------------------
+
+SimGrid (3.23) June 25. 2019
+
+The Exotic Solstice Release.
+
+General:
+ - SunOS and Haiku OS support. Because exotic platforms are fun.
+ - Stop setting random seed with srand48() at initialization.
+ - Use addr2line as a fallback for stacktraces when backtrace is not available.
+ - Build option -Denable_documentation is now OFF by default.
+ - Network model 'NS3' was renamed into 'ns-3'.
+
+Python:
+ - Simgrid can now hopefully be installed with pip.
+
+S4U:
+ - wait_any can now be used for asynchronous executions too.
+
+XBT:
+ - New log appenders: stdout and stderr. Use stdout for xbt_help.
+ - Drop xbt_dict_dump.
+
+SMPI:
+ - SMPI now reports support of MPI3.1. This does not mean SMPI supports all MPI 3 calls, but it was already the case with 2.2
+ - MPI/IO is now supported over the Storage API (no files are written or read, storage is simulated). Supported calls are all synchronous ones.
+ - MPI interface is now const correct for input parameters
+ - MPI_Ireduce, MPI_Iallreduce, MPI_Iscan, MPI_Iexscan, MPI_Ireduce_scatter, MPI_Ireduce_scatter_block support
+ - Fortran bindings for async collectives.
+ - MPI_Comm_get_name, MPI_Comm_set_name, MPI_Count support.
+
+Model-checker:
+ - Remove option 'model-check/record': Paths are recorded in any cases now.
+ - Remove option 'model-check/sparse-checkpoint': Checkpoints are now
+   always sparse. That's an immense gain in memory, and can even be
+   faster because of cache effects. So there is no need to clutter the
+   code to allow the user to go for the unefficient mode.
+
+Network models:
+ - Remove the lagrange-based models (Reno/Reno2/Vegas). The regular
+   models proved to be more accurate than these old experiments.
+
+Fixed bugs (FG=FramaGit; GH=GitHub -- Please prefer framagit for new bugs)
+ - FG#1: Broken link in error messages
+ - FG#2: missing installation documentation
+ - FG#3: missing documentation in smpirun
+ - FG#6: Python bindings not available on PyPI
+ - FG#7: simple cmake call requires doxygen
+ - FG#8: make python bindings an optional dependency
+ - FG#10: Can not use MSG_process_set_data from SMPI any more
+ - FG#11: Auto-restart actors forget their on_exit behavior
+ - FG#12: -Denable_lto=OFF doesn't disable LTO
+ - FG#13: Installs unstripped file 'bin/graphicator'
+ - FG#14: Installs the empty directory 'doc/simgrid/html'
+ - FG#15: Setting -Denable_python=OFF doesn't disable the search for pybind11
+ - FG#17: Dead link in doc (pls_ns3)
+ - FG#20: 'tesh --help' should return 0
+ - FG#21: Documentation link on http://simgrid.org/ broken
+ - FG#22: Debian installation instruction are broken
+ - FG#26: Turning off a link should raise NetworkFailureException exceptions
+ - GH#133: Java: a process can run on a VM even if its host is off
+ - GH#320: Stacktrace: Avoid the backtrace variant of Boost.Stacktrace?
+ - GH#326: Valgrind-detected error for join() when energy plugin is activated
 
 ----------------------------------------------------------------------------
 
 SimGrid (3.22) April 1. 2019
 
-The Easter Chrismas Release (this one is somewhat late).
+The Easter Christmas Release (this one is somewhat late).
 
 Python:
  - We are excited to introduce the SimGrid/S4U interface to your neighborhood
@@ -3031,7 +3207,7 @@ SimGrid (3.0.1) stable; urgency=low
     the pthread backend. It caused some weird deadlock or behavior
     depending on the pthread implementation. [AL]
   * Bugfix: get the exceptions raised in the simulator repport where
-    and why they come from when they are not catched in time [AL, MQ]
+    and why they come from when they are not caught in time [AL, MQ]
 
   SURF:
   * Bugfix: Do repport the error when two non-connected hosts try to
@@ -3123,7 +3299,7 @@ SimGrid (2.96) unstable; urgency=low
   * New! Exception handling with setjmp or such (code from OSSP ex) [MQ]
     This deprecates the xbt_error_t mechanisms.
     It modifies (simplifies) all XBT and GRAS API.
-    MSG API keeps unchanged (exceptions raised by XBT are catched from
+    MSG API keeps unchanged (exceptions raised by XBT are caught from
      within MSG and masked with existing error handling facilities)
 
   SURF:
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644 (file)
index 0000000..a7c7aad
--- /dev/null
@@ -0,0 +1,2697 @@
+# This file lists the content of the python source package
+# Prepared in tools/cmake/Distrib.cmake
+include MANIFEST.in
+include doc/shared/fig/simgrid_modules.fig
+include doc/shared/fig/simgrid_modules2.fig
+include doc/webcruft/Paje_MSG_screenshot.jpg
+include doc/webcruft/Paje_MSG_screenshot_thn.jpg
+include doc/webcruft/SGicon.gif
+include doc/webcruft/SGicon.icns
+include doc/webcruft/SGicon.ico
+include doc/webcruft/awstats_logo3.png
+include doc/webcruft/eclipseScreenShot.png
+include doc/webcruft/output.goal.pdf
+include doc/webcruft/poster_thumbnail.png
+include doc/webcruft/simgrid_logo_2011.gif
+include doc/webcruft/simgrid_logo_2011.png
+include doc/webcruft/simgrid_logo_2011_small.png
+include doc/webcruft/storage_sample_scenario.png
+include examples/deprecated/java/app/bittorrent/Common.java
+include examples/deprecated/java/app/bittorrent/Connection.java
+include examples/deprecated/java/app/bittorrent/Main.java
+include examples/deprecated/java/app/bittorrent/MessageTask.java
+include examples/deprecated/java/app/bittorrent/Peer.java
+include examples/deprecated/java/app/bittorrent/Tracker.java
+include examples/deprecated/java/app/bittorrent/TrackerTask.java
+include examples/deprecated/java/app/bittorrent/app-bittorrent.tesh
+include examples/deprecated/java/app/bittorrent/bittorrent.xml
+include examples/deprecated/java/app/bittorrent/generate.py
+include examples/deprecated/java/app/centralizedmutex/Coordinator.java
+include examples/deprecated/java/app/centralizedmutex/GrantTask.java
+include examples/deprecated/java/app/centralizedmutex/Main.java
+include examples/deprecated/java/app/centralizedmutex/Node.java
+include examples/deprecated/java/app/centralizedmutex/ReleaseTask.java
+include examples/deprecated/java/app/centralizedmutex/RequestTask.java
+include examples/deprecated/java/app/centralizedmutex/app-centralizedmutex.tesh
+include examples/deprecated/java/app/centralizedmutex/centralizedmutex.xml
+include examples/deprecated/java/app/masterworker/Main.java
+include examples/deprecated/java/app/masterworker/Master.java
+include examples/deprecated/java/app/masterworker/README
+include examples/deprecated/java/app/masterworker/Worker.java
+include examples/deprecated/java/app/masterworker/app-masterworker.tesh
+include examples/deprecated/java/app/masterworker/masterworker.xml
+include examples/deprecated/java/app/pingpong/Main.java
+include examples/deprecated/java/app/pingpong/PingPongTask.java
+include examples/deprecated/java/app/pingpong/Receiver.java
+include examples/deprecated/java/app/pingpong/Sender.java
+include examples/deprecated/java/app/pingpong/app-pingpong.tesh
+include examples/deprecated/java/app/tokenring/Main.java
+include examples/deprecated/java/app/tokenring/RelayRunner.java
+include examples/deprecated/java/app/tokenring/app-tokenring.tesh
+include examples/deprecated/java/async/dsend/Main.java
+include examples/deprecated/java/async/dsend/Receiver.java
+include examples/deprecated/java/async/dsend/Sender.java
+include examples/deprecated/java/async/dsend/async-dsend.tesh
+include examples/deprecated/java/async/waitall/Main.java
+include examples/deprecated/java/async/waitall/Receiver.java
+include examples/deprecated/java/async/waitall/Sender.java
+include examples/deprecated/java/async/waitall/async-waitall.tesh
+include examples/deprecated/java/async/yield/Main.java
+include examples/deprecated/java/async/yield/Yielder.java
+include examples/deprecated/java/async/yield/async-yield.tesh
+include examples/deprecated/java/cloud/masterworker/Main.java
+include examples/deprecated/java/cloud/masterworker/Master.java
+include examples/deprecated/java/cloud/masterworker/Worker.java
+include examples/deprecated/java/cloud/masterworker/cloud-masterworker.tesh
+include examples/deprecated/java/cloud/migration/Daemon.java
+include examples/deprecated/java/cloud/migration/Main.java
+include examples/deprecated/java/cloud/migration/README
+include examples/deprecated/java/cloud/migration/Test.java
+include examples/deprecated/java/cloud/migration/XVM.java
+include examples/deprecated/java/cloud/migration/cloud-migration.tesh
+include examples/deprecated/java/dht/chord/ChordTask.java
+include examples/deprecated/java/dht/chord/Common.java
+include examples/deprecated/java/dht/chord/FindSuccessorAnswerTask.java
+include examples/deprecated/java/dht/chord/FindSuccessorTask.java
+include examples/deprecated/java/dht/chord/GetPredecessorAnswerTask.java
+include examples/deprecated/java/dht/chord/GetPredecessorTask.java
+include examples/deprecated/java/dht/chord/Main.java
+include examples/deprecated/java/dht/chord/Node.java
+include examples/deprecated/java/dht/chord/NotifyTask.java
+include examples/deprecated/java/dht/chord/chord.xml
+include examples/deprecated/java/dht/chord/dht-chord.tesh
+include examples/deprecated/java/dht/kademlia/Answer.java
+include examples/deprecated/java/dht/kademlia/Bucket.java
+include examples/deprecated/java/dht/kademlia/Common.java
+include examples/deprecated/java/dht/kademlia/Contact.java
+include examples/deprecated/java/dht/kademlia/FindNodeAnswerTask.java
+include examples/deprecated/java/dht/kademlia/FindNodeTask.java
+include examples/deprecated/java/dht/kademlia/KademliaTask.java
+include examples/deprecated/java/dht/kademlia/Main.java
+include examples/deprecated/java/dht/kademlia/Node.java
+include examples/deprecated/java/dht/kademlia/RoutingTable.java
+include examples/deprecated/java/dht/kademlia/dht-kademlia.tesh
+include examples/deprecated/java/dht/kademlia/kademlia.xml
+include examples/deprecated/java/energy/consumption/EnergyConsumer.java
+include examples/deprecated/java/energy/consumption/Main.java
+include examples/deprecated/java/energy/consumption/energy-consumption.tesh
+include examples/deprecated/java/energy/pstate/Main.java
+include examples/deprecated/java/energy/pstate/PstateRunner.java
+include examples/deprecated/java/energy/pstate/energy-pstate.tesh
+include examples/deprecated/java/energy/vm/EnergyVMRunner.java
+include examples/deprecated/java/energy/vm/Main.java
+include examples/deprecated/java/energy/vm/energy-vm.tesh
+include examples/deprecated/java/hostload/LoadRunner.java
+include examples/deprecated/java/hostload/Main.java
+include examples/deprecated/java/hostload/hostload.tesh
+include examples/deprecated/java/io/file/Main.java
+include examples/deprecated/java/io/file/Node.java
+include examples/deprecated/java/io/file/io-file.tesh
+include examples/deprecated/java/io/storage/Client.java
+include examples/deprecated/java/io/storage/Main.java
+include examples/deprecated/java/io/storage/io-storage.tesh
+include examples/deprecated/java/process/kill/Killer.java
+include examples/deprecated/java/process/kill/Main.java
+include examples/deprecated/java/process/kill/Victim.java
+include examples/deprecated/java/process/kill/process-kill.tesh
+include examples/deprecated/java/process/migration/Emigrant.java
+include examples/deprecated/java/process/migration/Main.java
+include examples/deprecated/java/process/migration/Policeman.java
+include examples/deprecated/java/process/migration/process-migration.tesh
+include examples/deprecated/java/process/startkilltime/Main.java
+include examples/deprecated/java/process/startkilltime/Sleeper.java
+include examples/deprecated/java/process/startkilltime/process-startkilltime.tesh
+include examples/deprecated/java/process/startkilltime/startkilltime.xml
+include examples/deprecated/java/process/suspend/DreamMaster.java
+include examples/deprecated/java/process/suspend/LazyGuy.java
+include examples/deprecated/java/process/suspend/Main.java
+include examples/deprecated/java/process/suspend/process-suspend.tesh
+include examples/deprecated/java/task/priority/Main.java
+include examples/deprecated/java/task/priority/Test.java
+include examples/deprecated/java/task/priority/priority.xml
+include examples/deprecated/java/task/priority/task-priority.tesh
+include examples/deprecated/java/trace/pingpong/Main.java
+include examples/deprecated/java/trace/pingpong/PingPongTask.java
+include examples/deprecated/java/trace/pingpong/Receiver.java
+include examples/deprecated/java/trace/pingpong/Sender.java
+include examples/deprecated/java/trace/pingpong/trace-pingpong.tesh
+include examples/deprecated/msg/README.doc
+include examples/deprecated/msg/app-masterworker/app-masterworker-multicore.tesh
+include examples/deprecated/msg/app-masterworker/app-masterworker-multicore_d.xml
+include examples/deprecated/msg/app-masterworker/app-masterworker-vivaldi.tesh
+include examples/deprecated/msg/app-masterworker/app-masterworker-vivaldi_d.xml
+include examples/deprecated/msg/app-masterworker/app-masterworker.c
+include examples/deprecated/msg/app-masterworker/app-masterworker.tesh
+include examples/deprecated/msg/app-masterworker/app-masterworker_d.xml
+include examples/deprecated/msg/cloud-masterworker/cloud-masterworker.c
+include examples/deprecated/msg/cloud-masterworker/cloud-masterworker.tesh
+include examples/deprecated/msg/dht-kademlia/answer.c
+include examples/deprecated/msg/dht-kademlia/answer.h
+include examples/deprecated/msg/dht-kademlia/common.h
+include examples/deprecated/msg/dht-kademlia/dht-kademlia.c
+include examples/deprecated/msg/dht-kademlia/dht-kademlia.h
+include examples/deprecated/msg/dht-kademlia/dht-kademlia.tesh
+include examples/deprecated/msg/dht-kademlia/dht-kademlia_d.xml
+include examples/deprecated/msg/dht-kademlia/generate.py
+include examples/deprecated/msg/dht-kademlia/node.c
+include examples/deprecated/msg/dht-kademlia/node.h
+include examples/deprecated/msg/dht-kademlia/routing_table.c
+include examples/deprecated/msg/dht-kademlia/routing_table.h
+include examples/deprecated/msg/dht-kademlia/task.c
+include examples/deprecated/msg/dht-kademlia/task.h
+include examples/deprecated/msg/dht-pastry/dht-pastry.c
+include examples/deprecated/msg/dht-pastry/dht-pastry.tesh
+include examples/deprecated/msg/dht-pastry/dht-pastry_d.xml
+include examples/deprecated/msg/dht-pastry/generate.py
+include examples/deprecated/msg/energy-vm/energy-vm.c
+include examples/deprecated/msg/energy-vm/energy-vm.tesh
+include examples/deprecated/msg/mc/bugged1.c
+include examples/deprecated/msg/mc/bugged1.tesh
+include examples/deprecated/msg/mc/bugged1_liveness.c
+include examples/deprecated/msg/mc/bugged1_liveness.tesh
+include examples/deprecated/msg/mc/bugged1_liveness_stack_cleaner
+include examples/deprecated/msg/mc/bugged1_liveness_visited.tesh
+include examples/deprecated/msg/mc/bugged2.c
+include examples/deprecated/msg/mc/bugged2.tesh
+include examples/deprecated/msg/mc/bugged2_liveness.c
+include examples/deprecated/msg/mc/bugged3.c
+include examples/deprecated/msg/mc/centralized_mutex.c
+include examples/deprecated/msg/mc/centralized_mutex.tesh
+include examples/deprecated/msg/mc/deploy_bugged1.xml
+include examples/deprecated/msg/mc/deploy_bugged1_liveness.xml
+include examples/deprecated/msg/mc/deploy_bugged1_liveness_visited.xml
+include examples/deprecated/msg/mc/deploy_bugged2.xml
+include examples/deprecated/msg/mc/deploy_bugged2_liveness.xml
+include examples/deprecated/msg/mc/deploy_bugged3.xml
+include examples/deprecated/msg/mc/deploy_centralized_mutex.xml
+include examples/deprecated/msg/mc/deploy_electric_fence.xml
+include examples/deprecated/msg/mc/electric_fence.c
+include examples/deprecated/msg/mc/platform.xml
+include examples/deprecated/msg/mc/promela_bugged1_liveness
+include examples/deprecated/msg/mc/promela_bugged2_liveness
+include examples/deprecated/msg/network-ns3/3hosts_2links_d.xml
+include examples/deprecated/msg/network-ns3/3links-timer_d.xml
+include examples/deprecated/msg/network-ns3/3links_d.xml
+include examples/deprecated/msg/network-ns3/crosstraffic_d.xml
+include examples/deprecated/msg/network-ns3/dogbone_d.xml
+include examples/deprecated/msg/network-ns3/network-ns3.c
+include examples/deprecated/msg/network-ns3/network-ns3.tesh
+include examples/deprecated/msg/network-ns3/one_cluster_d.xml
+include examples/deprecated/msg/network-ns3/onelink_d.xml
+include examples/deprecated/msg/platform-failures/platform-failures.c
+include examples/deprecated/msg/platform-failures/platform-failures.tesh
+include examples/deprecated/msg/process-create/process-create.c
+include examples/deprecated/msg/process-create/process-create.tesh
+include examples/deprecated/msg/synchro-semaphore/synchro-semaphore.c
+include examples/deprecated/msg/synchro-semaphore/synchro-semaphore.tesh
+include examples/deprecated/msg/trace-categories/trace-categories.c
+include examples/deprecated/msg/trace-categories/trace-categories.tesh
+include examples/deprecated/msg/trace-host-user-variables/trace-host-user-variables.c
+include examples/deprecated/msg/trace-host-user-variables/trace-host-user-variables.tesh
+include examples/deprecated/msg/trace-link-user-variables/trace-link-user-variables.c
+include examples/deprecated/msg/trace-link-user-variables/trace-link-user-variables.tesh
+include examples/deprecated/msg/trace-masterworker/trace-masterworker.c
+include examples/deprecated/msg/trace-masterworker/trace-masterworker.tesh
+include examples/deprecated/msg/trace-process-migration/trace-process-migration.c
+include examples/deprecated/msg/trace-process-migration/trace-process-migration.tesh
+include examples/deprecated/msg/trace-route-user-variables/trace-route-user-variables.c
+include examples/deprecated/msg/trace-route-user-variables/trace-route-user-variables.tesh
+include examples/deprecated/simdag/dag-dotload/dag.dot
+include examples/deprecated/simdag/dag-dotload/dag_with_cycle.dot
+include examples/deprecated/simdag/dag-dotload/sd_dag-dotload.c
+include examples/deprecated/simdag/dag-dotload/sd_dag-dotload.tesh
+include examples/deprecated/simdag/daxload/sd_daxload.c
+include examples/deprecated/simdag/daxload/sd_daxload.tesh
+include examples/deprecated/simdag/daxload/simple_dax_with_cycle.xml
+include examples/deprecated/simdag/daxload/smalldax.xml
+include examples/deprecated/simdag/fail/sd_fail.c
+include examples/deprecated/simdag/fail/sd_fail.tesh
+include examples/deprecated/simdag/properties/sd_properties.c
+include examples/deprecated/simdag/properties/sd_properties.tesh
+include examples/deprecated/simdag/ptg-dotload/ptg.dot
+include examples/deprecated/simdag/ptg-dotload/sd_ptg-dotload.c
+include examples/deprecated/simdag/ptg-dotload/sd_ptg-dotload.tesh
+include examples/deprecated/simdag/schedule-dotload/dag_with_bad_schedule.dot
+include examples/deprecated/simdag/schedule-dotload/dag_with_good_schedule.dot
+include examples/deprecated/simdag/schedule-dotload/sd_schedule-dotload.c
+include examples/deprecated/simdag/schedule-dotload/sd_schedule-dotload.tesh
+include examples/deprecated/simdag/scheduling/Montage_25.xml
+include examples/deprecated/simdag/scheduling/expected_output.jed
+include examples/deprecated/simdag/scheduling/sd_scheduling.c
+include examples/deprecated/simdag/scheduling/sd_scheduling.tesh
+include examples/deprecated/simdag/test/sd_test.cpp
+include examples/deprecated/simdag/test/sd_test.tesh
+include examples/deprecated/simdag/throttling/sd_throttling.c
+include examples/deprecated/simdag/throttling/sd_throttling.tesh
+include examples/deprecated/simdag/typed_tasks/sd_typed_tasks.c
+include examples/deprecated/simdag/typed_tasks/sd_typed_tasks.tesh
+include examples/python/actor-create/actor-create.py
+include examples/python/actor-create/actor-create.tesh
+include examples/python/actor-daemon/actor-daemon.py
+include examples/python/actor-daemon/actor-daemon.tesh
+include examples/python/actor-join/actor-join.py
+include examples/python/actor-join/actor-join.tesh
+include examples/python/actor-kill/actor-kill.py
+include examples/python/actor-kill/actor-kill.tesh
+include examples/python/actor-migrate/actor-migrate.py
+include examples/python/actor-migrate/actor-migrate.tesh
+include examples/python/actor-suspend/actor-suspend.py
+include examples/python/actor-suspend/actor-suspend.tesh
+include examples/python/actor-yield/actor-yield.py
+include examples/python/actor-yield/actor-yield.tesh
+include examples/python/async-wait/async-wait.py
+include examples/python/async-wait/async-wait.tesh
+include examples/python/async-waitall/async-waitall.py
+include examples/python/async-waitall/async-waitall.tesh
+include examples/python/async-waitany/async-waitany.py
+include examples/python/async-waitany/async-waitany.tesh
+include examples/python/exec-async/exec-async.py
+include examples/python/exec-async/exec-async.tesh
+include examples/python/exec-basic/exec-basic.py
+include examples/python/exec-basic/exec-basic.tesh
+include examples/python/exec-dvfs/exec-dvfs.py
+include examples/python/exec-dvfs/exec-dvfs.tesh
+include examples/python/exec-remote/exec-remote.py
+include examples/python/exec-remote/exec-remote.tesh
+include examples/s4u/README.rst
+include examples/s4u/actor-create/s4u-actor-create.cpp
+include examples/s4u/actor-create/s4u-actor-create.tesh
+include examples/s4u/actor-create/s4u-actor-create_d.xml
+include examples/s4u/actor-daemon/s4u-actor-daemon.cpp
+include examples/s4u/actor-daemon/s4u-actor-daemon.tesh
+include examples/s4u/actor-exiting/s4u-actor-exiting.cpp
+include examples/s4u/actor-exiting/s4u-actor-exiting.tesh
+include examples/s4u/actor-join/s4u-actor-join.cpp
+include examples/s4u/actor-join/s4u-actor-join.tesh
+include examples/s4u/actor-kill/s4u-actor-kill.cpp
+include examples/s4u/actor-kill/s4u-actor-kill.tesh
+include examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp
+include examples/s4u/actor-lifetime/s4u-actor-lifetime.tesh
+include examples/s4u/actor-lifetime/s4u-actor-lifetime_d.xml
+include examples/s4u/actor-migrate/s4u-actor-migrate.cpp
+include examples/s4u/actor-migrate/s4u-actor-migrate.tesh
+include examples/s4u/actor-suspend/s4u-actor-suspend.cpp
+include examples/s4u/actor-suspend/s4u-actor-suspend.tesh
+include examples/s4u/actor-yield/s4u-actor-yield.cpp
+include examples/s4u/actor-yield/s4u-actor-yield.tesh
+include examples/s4u/actor-yield/s4u-actor-yield_d.xml
+include examples/s4u/app-bittorrent/s4u-app-bittorrent.tesh
+include examples/s4u/app-bittorrent/s4u-app-bittorrent_d.xml
+include examples/s4u/app-bittorrent/s4u-bittorrent.cpp
+include examples/s4u/app-bittorrent/s4u-bittorrent.hpp
+include examples/s4u/app-bittorrent/s4u-peer.cpp
+include examples/s4u/app-bittorrent/s4u-peer.hpp
+include examples/s4u/app-bittorrent/s4u-tracker.cpp
+include examples/s4u/app-bittorrent/s4u-tracker.hpp
+include examples/s4u/app-chainsend/s4u-app-chainsend.cpp
+include examples/s4u/app-chainsend/s4u-app-chainsend.tesh
+include examples/s4u/app-masterworkers/s4u-app-masterworkers-class.cpp
+include examples/s4u/app-masterworkers/s4u-app-masterworkers-fun.cpp
+include examples/s4u/app-masterworkers/s4u-app-masterworkers.tesh
+include examples/s4u/app-masterworkers/s4u-app-masterworkers_d.xml
+include examples/s4u/app-pingpong/s4u-app-pingpong.cpp
+include examples/s4u/app-pingpong/s4u-app-pingpong.tesh
+include examples/s4u/app-pingpong/simix-breakpoint.tesh
+include examples/s4u/app-token-ring/s4u-app-token-ring.cpp
+include examples/s4u/app-token-ring/s4u-app-token-ring.tesh
+include examples/s4u/async-ready/s4u-async-ready.cpp
+include examples/s4u/async-ready/s4u-async-ready.tesh
+include examples/s4u/async-ready/s4u-async-ready_d.xml
+include examples/s4u/async-wait/s4u-async-wait.cpp
+include examples/s4u/async-wait/s4u-async-wait.tesh
+include examples/s4u/async-wait/s4u-async-wait_d.xml
+include examples/s4u/async-waitall/s4u-async-waitall.cpp
+include examples/s4u/async-waitall/s4u-async-waitall.tesh
+include examples/s4u/async-waitall/s4u-async-waitall_d.xml
+include examples/s4u/async-waitany/s4u-async-waitany.cpp
+include examples/s4u/async-waitany/s4u-async-waitany.tesh
+include examples/s4u/async-waitany/s4u-async-waitany_d.xml
+include examples/s4u/async-waituntil/s4u-async-waituntil.cpp
+include examples/s4u/async-waituntil/s4u-async-waituntil.tesh
+include examples/s4u/async-waituntil/s4u-async-waituntil_d.xml
+include examples/s4u/cloud-capping/s4u-cloud-capping.cpp
+include examples/s4u/cloud-capping/s4u-cloud-capping.tesh
+include examples/s4u/cloud-migration/s4u-cloud-migration.cpp
+include examples/s4u/cloud-migration/s4u-cloud-migration.tesh
+include examples/s4u/cloud-simple/s4u-cloud-simple.cpp
+include examples/s4u/cloud-simple/s4u-cloud-simple.tesh
+include examples/s4u/dht-chord/s4u-dht-chord-node.cpp
+include examples/s4u/dht-chord/s4u-dht-chord.cpp
+include examples/s4u/dht-chord/s4u-dht-chord.hpp
+include examples/s4u/dht-chord/s4u-dht-chord.tesh
+include examples/s4u/dht-chord/s4u-dht-chord_d.xml
+include examples/s4u/dht-kademlia/answer.cpp
+include examples/s4u/dht-kademlia/answer.hpp
+include examples/s4u/dht-kademlia/generate.py
+include examples/s4u/dht-kademlia/message.hpp
+include examples/s4u/dht-kademlia/node.cpp
+include examples/s4u/dht-kademlia/node.hpp
+include examples/s4u/dht-kademlia/routing_table.cpp
+include examples/s4u/dht-kademlia/routing_table.hpp
+include examples/s4u/dht-kademlia/s4u-dht-kademlia.cpp
+include examples/s4u/dht-kademlia/s4u-dht-kademlia.hpp
+include examples/s4u/dht-kademlia/s4u-dht-kademlia.tesh
+include examples/s4u/dht-kademlia/s4u-dht-kademlia_d.xml
+include examples/s4u/energy-boot/platform_boot.xml
+include examples/s4u/energy-boot/s4u-energy-boot.cpp
+include examples/s4u/energy-boot/s4u-energy-boot.tesh
+include examples/s4u/energy-exec-ptask/s4u-energy-exec-ptask.cpp
+include examples/s4u/energy-exec-ptask/s4u-energy-exec-ptask.tesh
+include examples/s4u/energy-exec/s4u-energy-exec.cpp
+include examples/s4u/energy-exec/s4u-energy-exec.tesh
+include examples/s4u/energy-link/s4u-energy-link.cpp
+include examples/s4u/energy-link/s4u-energy-link.tesh
+include examples/s4u/energy-vm/s4u-energy-vm.cpp
+include examples/s4u/energy-vm/s4u-energy-vm.tesh
+include examples/s4u/engine-filtering/s4u-engine-filtering.cpp
+include examples/s4u/engine-filtering/s4u-engine-filtering.tesh
+include examples/s4u/exec-async/s4u-exec-async.cpp
+include examples/s4u/exec-async/s4u-exec-async.tesh
+include examples/s4u/exec-basic/s4u-exec-basic.cpp
+include examples/s4u/exec-basic/s4u-exec-basic.tesh
+include examples/s4u/exec-dvfs/s4u-exec-dvfs.cpp
+include examples/s4u/exec-dvfs/s4u-exec-dvfs.tesh
+include examples/s4u/exec-ptask/s4u-exec-ptask.cpp
+include examples/s4u/exec-ptask/s4u-exec-ptask.tesh
+include examples/s4u/exec-remote/s4u-exec-remote.cpp
+include examples/s4u/exec-remote/s4u-exec-remote.tesh
+include examples/s4u/exec-waitany/s4u-exec-waitany.cpp
+include examples/s4u/exec-waitany/s4u-exec-waitany.tesh
+include examples/s4u/io-async/s4u-io-async.cpp
+include examples/s4u/io-async/s4u-io-async.tesh
+include examples/s4u/io-disk-raw/s4u-io-disk-raw.cpp
+include examples/s4u/io-disk-raw/s4u-io-disk-raw.tesh
+include examples/s4u/io-file-remote/s4u-io-file-remote.cpp
+include examples/s4u/io-file-remote/s4u-io-file-remote.tesh
+include examples/s4u/io-file-remote/s4u-io-file-remote_d.xml
+include examples/s4u/io-file-system/s4u-io-file-system.cpp
+include examples/s4u/io-file-system/s4u-io-file-system.tesh
+include examples/s4u/maestro-set/s4u-maestro-set.cpp
+include examples/s4u/maestro-set/s4u-maestro-set.tesh
+include examples/s4u/mc-failing-assert/s4u-mc-failing-assert.cpp
+include examples/s4u/mc-failing-assert/s4u-mc-failing-assert.tesh
+include examples/s4u/platform-failures/s4u-platform-failures.cpp
+include examples/s4u/platform-failures/s4u-platform-failures.tesh
+include examples/s4u/platform-failures/s4u-platform-failures_d.xml
+include examples/s4u/platform-profile/s4u-platform-profile.cpp
+include examples/s4u/platform-profile/s4u-platform-profile.tesh
+include examples/s4u/platform-properties/s4u-platform-properties.cpp
+include examples/s4u/platform-properties/s4u-platform-properties.tesh
+include examples/s4u/platform-properties/s4u-platform-properties_d.xml
+include examples/s4u/plugin-hostload/s4u-plugin-hostload.cpp
+include examples/s4u/plugin-hostload/s4u-plugin-hostload.tesh
+include examples/s4u/replay-comm/s4u-replay-comm-split-p0.txt
+include examples/s4u/replay-comm/s4u-replay-comm-split-p1.txt
+include examples/s4u/replay-comm/s4u-replay-comm-split_d.xml
+include examples/s4u/replay-comm/s4u-replay-comm.cpp
+include examples/s4u/replay-comm/s4u-replay-comm.tesh
+include examples/s4u/replay-comm/s4u-replay-comm.txt
+include examples/s4u/replay-comm/s4u-replay-comm_d.xml
+include examples/s4u/replay-io/s4u-replay-io.cpp
+include examples/s4u/replay-io/s4u-replay-io.tesh
+include examples/s4u/replay-io/s4u-replay-io.txt
+include examples/s4u/replay-io/s4u-replay-io_d.xml
+include examples/s4u/routing-get-clusters/s4u-routing-get-clusters.cpp
+include examples/s4u/routing-get-clusters/s4u-routing-get-clusters.tesh
+include examples/s4u/synchro-barrier/s4u-synchro-barrier.cpp
+include examples/s4u/synchro-barrier/s4u-synchro-barrier.tesh
+include examples/s4u/synchro-mutex/s4u-synchro-mutex.cpp
+include examples/s4u/synchro-mutex/s4u-synchro-mutex.tesh
+include examples/s4u/synchro-semaphore/s4u-synchro-semaphore.cpp
+include examples/s4u/synchro-semaphore/s4u-synchro-semaphore.tesh
+include examples/s4u/trace-platform/s4u-trace-platform.cpp
+include examples/s4u/trace-platform/s4u-trace-platform.tesh
+include examples/smpi/NAS/DGraph.c
+include examples/smpi/NAS/DGraph.h
+include examples/smpi/NAS/README.install
+include examples/smpi/NAS/dt.c
+include examples/smpi/NAS/ep.c
+include examples/smpi/NAS/is.c
+include examples/smpi/NAS/nas_common.c
+include examples/smpi/NAS/nas_common.h
+include examples/smpi/ampi_test/ampi_test.cpp
+include examples/smpi/ampi_test/ampi_test.tesh
+include examples/smpi/energy/energy.c
+include examples/smpi/energy/energy.tesh
+include examples/smpi/energy/hostfile
+include examples/smpi/gemm/gemm.c
+include examples/smpi/gemm/gemm.tesh
+include examples/smpi/hostfile
+include examples/smpi/mc/bugged1.c
+include examples/smpi/mc/bugged1_liveness.c
+include examples/smpi/mc/bugged2.c
+include examples/smpi/mc/hostfile_bugged1
+include examples/smpi/mc/hostfile_bugged1_liveness
+include examples/smpi/mc/hostfile_bugged2
+include examples/smpi/mc/hostfile_mutual_exclusion
+include examples/smpi/mc/hostfile_non_termination
+include examples/smpi/mc/hostfile_only_send_deterministic
+include examples/smpi/mc/mutual_exclusion.c
+include examples/smpi/mc/non_termination1.c
+include examples/smpi/mc/non_termination2.c
+include examples/smpi/mc/non_termination3.c
+include examples/smpi/mc/non_termination4.c
+include examples/smpi/mc/only_send_deterministic.c
+include examples/smpi/mc/promela_bugged1_liveness
+include examples/smpi/mc/sendsend.c
+include examples/smpi/mc/sendsend.tesh
+include examples/smpi/replay/actions0.txt
+include examples/smpi/replay/actions1.txt
+include examples/smpi/replay/actions_allgatherv.txt
+include examples/smpi/replay/actions_allreduce.txt
+include examples/smpi/replay/actions_alltoall.txt
+include examples/smpi/replay/actions_alltoallv.txt
+include examples/smpi/replay/actions_barrier.txt
+include examples/smpi/replay/actions_bcast.txt
+include examples/smpi/replay/actions_bcast_reduce_datatypes.txt
+include examples/smpi/replay/actions_gather.txt
+include examples/smpi/replay/actions_reducescatter.txt
+include examples/smpi/replay/actions_waitall.txt
+include examples/smpi/replay/actions_with_isend.txt
+include examples/smpi/replay/replay-override-replayer.tesh
+include examples/smpi/replay/replay.cpp
+include examples/smpi/replay/replay.tesh
+include examples/smpi/replay/split_traces
+include examples/smpi/replay_multiple/README
+include examples/smpi/replay_multiple/description_file
+include examples/smpi/replay_multiple/generate_multiple_deployment.sh
+include examples/smpi/replay_multiple/replay_multiple.c
+include examples/smpi/replay_multiple/replay_multiple.tesh
+include examples/smpi/replay_multiple/smpi_replay.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace0.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace1.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace10.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace11.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace12.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace13.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace14.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace15.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace16.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace17.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace18.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace19.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace2.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace20.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace21.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace22.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace23.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace24.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace25.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace26.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace27.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace28.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace29.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace3.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace30.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace31.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace4.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace5.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace6.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace7.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace8.txt
+include examples/smpi/replay_multiple/ti_traces_32_1/ti_trace9.txt
+include examples/smpi/replay_multiple_manual_deploy/coll.txt
+include examples/smpi/replay_multiple_manual_deploy/coll/actions0.txt
+include examples/smpi/replay_multiple_manual_deploy/coll/actions1.txt
+include examples/smpi/replay_multiple_manual_deploy/compute_only.txt
+include examples/smpi/replay_multiple_manual_deploy/compute_only/actions0.txt
+include examples/smpi/replay_multiple_manual_deploy/compute_only/actions1.txt
+include examples/smpi/replay_multiple_manual_deploy/empty.txt
+include examples/smpi/replay_multiple_manual_deploy/empty/actions0.txt
+include examples/smpi/replay_multiple_manual_deploy/empty/actions1.txt
+include examples/smpi/replay_multiple_manual_deploy/mixed.txt
+include examples/smpi/replay_multiple_manual_deploy/mixed/actions0.txt
+include examples/smpi/replay_multiple_manual_deploy/mixed/actions1.txt
+include examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual.cpp
+include examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_coll1.tesh
+include examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_coll2_st_sr_noise.tesh
+include examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_empty1.tesh
+include examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_empty2.tesh
+include examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed1.tesh
+include examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2.tesh
+include examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st.tesh
+include examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_noise.tesh
+include examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_sr.tesh
+include examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_sr_noise.tesh
+include examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_nojob.tesh
+include examples/smpi/replay_multiple_manual_deploy/workload_compute
+include examples/smpi/replay_multiple_manual_deploy/workload_compute_consecutive
+include examples/smpi/replay_multiple_manual_deploy/workload_compute_consecutive2
+include examples/smpi/replay_multiple_manual_deploy/workload_compute_simple
+include examples/smpi/replay_multiple_manual_deploy/workload_mixed2_same_time
+include examples/smpi/replay_multiple_manual_deploy/workload_mixed2_same_time_and_resources
+include examples/smpi/smpi_msg_masterslave/deployment_masterslave_mailbox_smpi.xml
+include examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c
+include examples/smpi/smpi_msg_masterslave/msg_smpi.tesh
+include examples/smpi/trace/trace.c
+include examples/smpi/trace/trace.tesh
+include examples/smpi/trace_call_location/trace_call_location.c
+include examples/smpi/trace_call_location/trace_call_location.tesh
+include examples/smpi/trace_simple/trace_simple.c
+include examples/smpi/trace_simple/trace_simple.tesh
+include teshsuite/java/semaphoregc/SemaphoreGC.java
+include teshsuite/java/semaphoregc/semaphoregc.tesh
+include teshsuite/java/sleephostoff/SleepHostOff.java
+include teshsuite/java/sleephostoff/sleephostoff.tesh
+include teshsuite/mc/dwarf-expression/dwarf-expression.cpp
+include teshsuite/mc/dwarf-expression/dwarf-expression.tesh
+include teshsuite/mc/dwarf/dwarf.cpp
+include teshsuite/mc/dwarf/dwarf.tesh
+include teshsuite/mc/mutex-handling/mutex-handling.c
+include teshsuite/mc/mutex-handling/mutex-handling.tesh
+include teshsuite/mc/mutex-handling/mutex-handling_d.xml
+include teshsuite/mc/mutex-handling/without-mutex-handling.tesh
+include teshsuite/mc/random-bug/random-bug-nocrash.tesh
+include teshsuite/mc/random-bug/random-bug-replay.tesh
+include teshsuite/mc/random-bug/random-bug.cpp
+include teshsuite/mc/random-bug/random-bug.tesh
+include teshsuite/msg/app-bittorrent/app-bittorrent.tesh
+include teshsuite/msg/app-bittorrent/app-bittorrent_d.xml
+include teshsuite/msg/app-bittorrent/bittorrent-messages.c
+include teshsuite/msg/app-bittorrent/bittorrent-messages.h
+include teshsuite/msg/app-bittorrent/bittorrent-peer.c
+include teshsuite/msg/app-bittorrent/bittorrent-peer.h
+include teshsuite/msg/app-bittorrent/bittorrent.c
+include teshsuite/msg/app-bittorrent/bittorrent.h
+include teshsuite/msg/app-bittorrent/connection.c
+include teshsuite/msg/app-bittorrent/connection.h
+include teshsuite/msg/app-bittorrent/generate.py
+include teshsuite/msg/app-bittorrent/tracker.c
+include teshsuite/msg/app-bittorrent/tracker.h
+include teshsuite/msg/app-chainsend/app-chainsend.tesh
+include teshsuite/msg/app-chainsend/app-chainsend_d.xml
+include teshsuite/msg/app-chainsend/broadcaster.c
+include teshsuite/msg/app-chainsend/broadcaster.h
+include teshsuite/msg/app-chainsend/chainsend.c
+include teshsuite/msg/app-chainsend/common.c
+include teshsuite/msg/app-chainsend/common.h
+include teshsuite/msg/app-chainsend/iterator.c
+include teshsuite/msg/app-chainsend/iterator.h
+include teshsuite/msg/app-chainsend/messages.c
+include teshsuite/msg/app-chainsend/messages.h
+include teshsuite/msg/app-chainsend/peer.c
+include teshsuite/msg/app-chainsend/peer.h
+include teshsuite/msg/app-pingpong/app-pingpong.c
+include teshsuite/msg/app-pingpong/app-pingpong.tesh
+include teshsuite/msg/app-pingpong/app-pingpong_d.xml
+include teshsuite/msg/app-token-ring/app-token-ring.c
+include teshsuite/msg/app-token-ring/app-token-ring.tesh
+include teshsuite/msg/async-wait/async-wait.c
+include teshsuite/msg/async-wait/async-wait.tesh
+include teshsuite/msg/async-wait/async-wait2_d.xml
+include teshsuite/msg/async-wait/async-wait3_d.xml
+include teshsuite/msg/async-wait/async-wait4_d.xml
+include teshsuite/msg/async-wait/async-wait_d.xml
+include teshsuite/msg/async-waitall/async-waitall.c
+include teshsuite/msg/async-waitall/async-waitall.tesh
+include teshsuite/msg/async-waitall/async-waitall_d.xml
+include teshsuite/msg/async-waitany/async-waitany.c
+include teshsuite/msg/async-waitany/async-waitany.tesh
+include teshsuite/msg/async-waitany/async-waitany_d.xml
+include teshsuite/msg/cloud-capping/cloud-capping.c
+include teshsuite/msg/cloud-capping/cloud-capping.tesh
+include teshsuite/msg/cloud-migration/cloud-migration.c
+include teshsuite/msg/cloud-migration/cloud-migration.tesh
+include teshsuite/msg/cloud-simple/cloud-simple.c
+include teshsuite/msg/cloud-simple/cloud-simple.tesh
+include teshsuite/msg/cloud-two-tasks/cloud-two-tasks.c
+include teshsuite/msg/cloud-two-tasks/cloud-two-tasks.tesh
+include teshsuite/msg/energy-consumption/energy-consumption.c
+include teshsuite/msg/energy-consumption/energy-consumption.tesh
+include teshsuite/msg/energy-pstate/energy-pstate.c
+include teshsuite/msg/energy-pstate/energy-pstate.tesh
+include teshsuite/msg/energy-ptask/energy-ptask.c
+include teshsuite/msg/energy-ptask/energy-ptask.tesh
+include teshsuite/msg/get_sender/get_sender.c
+include teshsuite/msg/get_sender/get_sender.tesh
+include teshsuite/msg/host_on_off/host_on_off.c
+include teshsuite/msg/host_on_off/host_on_off.tesh
+include teshsuite/msg/host_on_off_processes/host_on_off_processes.cpp
+include teshsuite/msg/host_on_off_processes/host_on_off_processes.tesh
+include teshsuite/msg/host_on_off_recv/host_on_off_recv.c
+include teshsuite/msg/host_on_off_recv/host_on_off_recv.tesh
+include teshsuite/msg/io-file-remote/io-file-remote.c
+include teshsuite/msg/io-file-remote/io-file-remote.tesh
+include teshsuite/msg/io-file-remote/io-file-remote_d.xml
+include teshsuite/msg/io-file/io-file.c
+include teshsuite/msg/io-file/io-file.tesh
+include teshsuite/msg/io-raw-storage/io-raw-storage.c
+include teshsuite/msg/io-raw-storage/io-raw-storage.tesh
+include teshsuite/msg/platform-properties/platform-properties.c
+include teshsuite/msg/platform-properties/platform-properties.tesh
+include teshsuite/msg/platform-properties/platform-properties_d.xml
+include teshsuite/msg/plugin-hostload/plugin-hostload.c
+include teshsuite/msg/plugin-hostload/plugin-hostload.tesh
+include teshsuite/msg/process-daemon/process-daemon.c
+include teshsuite/msg/process-daemon/process-daemon.tesh
+include teshsuite/msg/process-join/process-join.c
+include teshsuite/msg/process-join/process-join.tesh
+include teshsuite/msg/process-kill/process-kill.c
+include teshsuite/msg/process-kill/process-kill.tesh
+include teshsuite/msg/process-lifetime/baseline_d.xml
+include teshsuite/msg/process-lifetime/kill_d.xml
+include teshsuite/msg/process-lifetime/process-lifetime.c
+include teshsuite/msg/process-lifetime/process-lifetime.tesh
+include teshsuite/msg/process-lifetime/start_d.xml
+include teshsuite/msg/process-lifetime/start_kill_d.xml
+include teshsuite/msg/process-migration/process-migration.c
+include teshsuite/msg/process-migration/process-migration.tesh
+include teshsuite/msg/process-suspend/process-suspend.c
+include teshsuite/msg/process-suspend/process-suspend.tesh
+include teshsuite/msg/process-yield/process-yield.c
+include teshsuite/msg/process-yield/process-yield.tesh
+include teshsuite/msg/process-yield/process-yield_d.xml
+include teshsuite/msg/task-priority/task-priority.c
+include teshsuite/msg/task-priority/task-priority.tesh
+include teshsuite/msg/task-priority/task-priority_d.xml
+include teshsuite/msg/task_destroy_cancel/task_destroy_cancel.cpp
+include teshsuite/msg/task_destroy_cancel/task_destroy_cancel.tesh
+include teshsuite/msg/task_listen_from/task_listen_from.cpp
+include teshsuite/msg/task_listen_from/task_listen_from.tesh
+include teshsuite/msg/task_progress/task_progress.cpp
+include teshsuite/msg/task_progress/task_progress.tesh
+include teshsuite/msg/trace_integration/test-hbp1-c0s0-c0s1.xml
+include teshsuite/msg/trace_integration/test-hbp1-c0s0-c1s0.xml
+include teshsuite/msg/trace_integration/test-hbp1-c0s1-c0s2.xml
+include teshsuite/msg/trace_integration/test-hbp1-c0s1-c2s2.xml
+include teshsuite/msg/trace_integration/test-hbp1-c0s2-c1s0.xml
+include teshsuite/msg/trace_integration/test-hbp1-c0s2-c1s1.xml
+include teshsuite/msg/trace_integration/test-hbp1-c1s1-c1s2.xml
+include teshsuite/msg/trace_integration/test-hbp1-c1s1-c3s2.xml
+include teshsuite/msg/trace_integration/test-hbp1.0-hbp1.0-hbp1.0.xml
+include teshsuite/msg/trace_integration/test-hbp1.0-hbp3.0-hbp4.0.xml
+include teshsuite/msg/trace_integration/test-hbp1.5-hbp1.5.xml
+include teshsuite/msg/trace_integration/test-hbp2.5-hbp1.5.xml
+include teshsuite/msg/trace_integration/trace_integration.c
+include teshsuite/msg/trace_integration/trace_integration.tesh
+include teshsuite/s4u/activity-lifecycle/activity-lifecycle.cpp
+include teshsuite/s4u/activity-lifecycle/activity-lifecycle.tesh
+include teshsuite/s4u/activity-lifecycle/testing_platform.xml
+include teshsuite/s4u/actor-autorestart/actor-autorestart.cpp
+include teshsuite/s4u/actor-autorestart/actor-autorestart.tesh
+include teshsuite/s4u/actor-migration/actor-migration.cpp
+include teshsuite/s4u/actor-migration/actor-migration.tesh
+include teshsuite/s4u/actor/actor.cpp
+include teshsuite/s4u/actor/actor.tesh
+include teshsuite/s4u/cloud-interrupt-migration/cloud-interrupt-migration.cpp
+include teshsuite/s4u/cloud-interrupt-migration/cloud-interrupt-migration.tesh
+include teshsuite/s4u/cloud-sharing/cloud-sharing.cpp
+include teshsuite/s4u/cloud-sharing/cloud-sharing.tesh
+include teshsuite/s4u/comm-pt2pt/comm-pt2pt.cpp
+include teshsuite/s4u/concurrent_rw/concurrent_rw.cpp
+include teshsuite/s4u/concurrent_rw/concurrent_rw.tesh
+include teshsuite/s4u/listen_async/listen_async.cpp
+include teshsuite/s4u/listen_async/listen_async.tesh
+include teshsuite/s4u/ns3-simultaneous-send-rcv/ns3-simultaneous-send-rcv.cpp
+include teshsuite/s4u/ns3-simultaneous-send-rcv/ns3-simultaneous-send-rcv.tesh
+include teshsuite/s4u/pid/pid.cpp
+include teshsuite/s4u/pid/pid.tesh
+include teshsuite/s4u/storage_client_server/storage_client_server.cpp
+include teshsuite/s4u/storage_client_server/storage_client_server.tesh
+include teshsuite/s4u/wait-any-for/wait-any-for.cpp
+include teshsuite/s4u/wait-any-for/wait-any-for.tesh
+include teshsuite/simdag/availability/availability.c
+include teshsuite/simdag/availability/availability.tesh
+include teshsuite/simdag/basic-link-test/basic-link-test.c
+include teshsuite/simdag/basic-link-test/basic-link-test.tesh
+include teshsuite/simdag/basic-parsing-test/basic-parsing-test-bypass.tesh
+include teshsuite/simdag/basic-parsing-test/basic-parsing-test-sym-full.tesh
+include teshsuite/simdag/basic-parsing-test/basic-parsing-test.c
+include teshsuite/simdag/basic-parsing-test/basic-parsing-test.tesh
+include teshsuite/simdag/basic0/basic0.c
+include teshsuite/simdag/basic0/basic0.tesh
+include teshsuite/simdag/basic1/basic1.c
+include teshsuite/simdag/basic1/basic1.tesh
+include teshsuite/simdag/basic3/basic3.c
+include teshsuite/simdag/basic3/basic3.tesh
+include teshsuite/simdag/basic4/basic4.c
+include teshsuite/simdag/basic4/basic4.tesh
+include teshsuite/simdag/basic5/basic5.c
+include teshsuite/simdag/basic5/basic5.tesh
+include teshsuite/simdag/basic6/basic6.c
+include teshsuite/simdag/basic6/basic6.tesh
+include teshsuite/simdag/comm-mxn-all2all/comm-mxn-all2all.c
+include teshsuite/simdag/comm-mxn-all2all/comm-mxn-all2all.tesh
+include teshsuite/simdag/comm-mxn-independent/comm-mxn-independent.c
+include teshsuite/simdag/comm-mxn-independent/comm-mxn-independent.tesh
+include teshsuite/simdag/comm-mxn-scatter/comm-mxn-scatter.c
+include teshsuite/simdag/comm-mxn-scatter/comm-mxn-scatter.tesh
+include teshsuite/simdag/comm-p2p-latency-1/comm-p2p-latency-1.c
+include teshsuite/simdag/comm-p2p-latency-1/comm-p2p-latency-1.tesh
+include teshsuite/simdag/comm-p2p-latency-2/comm-p2p-latency-2.c
+include teshsuite/simdag/comm-p2p-latency-2/comm-p2p-latency-2.tesh
+include teshsuite/simdag/comm-p2p-latency-3/comm-p2p-latency-3.c
+include teshsuite/simdag/comm-p2p-latency-3/comm-p2p-latency-3.tesh
+include teshsuite/simdag/comm-p2p-latency-bound/comm-p2p-latency-bound.c
+include teshsuite/simdag/comm-p2p-latency-bound/comm-p2p-latency-bound.tesh
+include teshsuite/simdag/comp-only-par/comp-only-par.c
+include teshsuite/simdag/comp-only-par/comp-only-par.tesh
+include teshsuite/simdag/comp-only-seq/comp-only-seq.c
+include teshsuite/simdag/comp-only-seq/comp-only-seq.tesh
+include teshsuite/simdag/evaluate-get-route-time/evaluate-get-route-time.c
+include teshsuite/simdag/evaluate-parse-time/evaluate-parse-time.c
+include teshsuite/simdag/flatifier/bogus_disk_attachment.tesh
+include teshsuite/simdag/flatifier/bogus_missing_gateway.tesh
+include teshsuite/simdag/flatifier/bogus_two_hosts_asymetric.tesh
+include teshsuite/simdag/flatifier/flatifier.cpp
+include teshsuite/simdag/flatifier/flatifier.tesh
+include teshsuite/simdag/incomplete/incomplete.c
+include teshsuite/simdag/incomplete/incomplete.tesh
+include teshsuite/simdag/is-router/is-router.cpp
+include teshsuite/simdag/is-router/is-router.tesh
+include teshsuite/simdag/platforms/Dijkstra.xml
+include teshsuite/simdag/platforms/bob.trace
+include teshsuite/simdag/platforms/bogus_disk_attachment.xml
+include teshsuite/simdag/platforms/bogus_missing_dst_gateway.xml
+include teshsuite/simdag/platforms/bogus_missing_src_gateway.xml
+include teshsuite/simdag/platforms/bogus_two_hosts_asymetric.xml
+include teshsuite/simdag/platforms/carol.fail
+include teshsuite/simdag/platforms/erin.avail
+include teshsuite/simdag/platforms/four_hosts_floyd.xml
+include teshsuite/simdag/platforms/host_attributes.xml
+include teshsuite/simdag/platforms/link.bw
+include teshsuite/simdag/platforms/link.fail
+include teshsuite/simdag/platforms/link.lat
+include teshsuite/simdag/platforms/link_attributes.xml
+include teshsuite/simdag/platforms/one_cluster.xml
+include teshsuite/simdag/platforms/one_cluster_multicore.xml
+include teshsuite/simdag/platforms/one_cluster_router_id.xml
+include teshsuite/simdag/platforms/one_cluster_splitduplex.xml
+include teshsuite/simdag/platforms/platform_2p_1bb.xml
+include teshsuite/simdag/platforms/platform_2p_1fl.xml
+include teshsuite/simdag/platforms/platform_2p_1sl.xml
+include teshsuite/simdag/platforms/platform_2p_1sl_hetero.xml
+include teshsuite/simdag/platforms/platform_2p_1switch.xml
+include teshsuite/simdag/platforms/platform_4p_1switch.xml
+include teshsuite/simdag/platforms/properties.xml
+include teshsuite/simdag/platforms/test_of_is_router.xml
+include teshsuite/simdag/platforms/three_hosts_non_symmetric_route.xml
+include teshsuite/simdag/platforms/two_clusters.xml
+include teshsuite/simdag/platforms/two_clusters_one_name.xml
+include teshsuite/simdag/platforms/two_clusters_router_id.xml
+include teshsuite/simdag/platforms/two_hosts_multi_hop.xml
+include teshsuite/simdag/platforms/two_hosts_one_link.xml
+include teshsuite/simdag/platforms/two_hosts_one_link_splitduplex.xml
+include teshsuite/simix/check-defaults/check-defaults.cpp
+include teshsuite/simix/check-defaults/factory_boost.tesh
+include teshsuite/simix/check-defaults/factory_raw.tesh
+include teshsuite/simix/check-defaults/factory_thread.tesh
+include teshsuite/simix/check-defaults/factory_ucontext.tesh
+include teshsuite/simix/generic-simcalls/generic-simcalls.cpp
+include teshsuite/simix/generic-simcalls/generic-simcalls.tesh
+include teshsuite/simix/stack-overflow/stack-overflow.cpp
+include teshsuite/simix/stack-overflow/stack-overflow.tesh
+include teshsuite/smpi/bug-17132/bug-17132.c
+include teshsuite/smpi/bug-17132/bug-17132.tesh
+include teshsuite/smpi/coll-allgather/coll-allgather.c
+include teshsuite/smpi/coll-allgather/coll-allgather.tesh
+include teshsuite/smpi/coll-allgatherv/coll-allgatherv.c
+include teshsuite/smpi/coll-allgatherv/coll-allgatherv.tesh
+include teshsuite/smpi/coll-allreduce/coll-allreduce-automatic.tesh
+include teshsuite/smpi/coll-allreduce/coll-allreduce-large.tesh
+include teshsuite/smpi/coll-allreduce/coll-allreduce.c
+include teshsuite/smpi/coll-allreduce/coll-allreduce.tesh
+include teshsuite/smpi/coll-alltoall/clusters.tesh
+include teshsuite/smpi/coll-alltoall/coll-alltoall.c
+include teshsuite/smpi/coll-alltoall/coll-alltoall.tesh
+include teshsuite/smpi/coll-alltoallv/coll-alltoallv.c
+include teshsuite/smpi/coll-alltoallv/coll-alltoallv.tesh
+include teshsuite/smpi/coll-barrier/coll-barrier.c
+include teshsuite/smpi/coll-barrier/coll-barrier.tesh
+include teshsuite/smpi/coll-bcast/coll-bcast.c
+include teshsuite/smpi/coll-bcast/coll-bcast.tesh
+include teshsuite/smpi/coll-gather/coll-gather.c
+include teshsuite/smpi/coll-gather/coll-gather.tesh
+include teshsuite/smpi/coll-reduce-scatter/coll-reduce-scatter.c
+include teshsuite/smpi/coll-reduce-scatter/coll-reduce-scatter.tesh
+include teshsuite/smpi/coll-reduce/coll-reduce.c
+include teshsuite/smpi/coll-reduce/coll-reduce.tesh
+include teshsuite/smpi/coll-scatter/coll-scatter.c
+include teshsuite/smpi/coll-scatter/coll-scatter.tesh
+include teshsuite/smpi/fort_args/fort_args.f90
+include teshsuite/smpi/fort_args/fort_args.tesh
+include teshsuite/smpi/hostfile
+include teshsuite/smpi/hostfile_cluster
+include teshsuite/smpi/hostfile_coll
+include teshsuite/smpi/hostfile_empty
+include teshsuite/smpi/hostfile_io
+include teshsuite/smpi/hostfile_mpich
+include teshsuite/smpi/io-all-at/io-all-at.c
+include teshsuite/smpi/io-all-at/io-all-at.tesh
+include teshsuite/smpi/io-all/io-all.c
+include teshsuite/smpi/io-all/io-all.tesh
+include teshsuite/smpi/io-ordered/io-ordered.c
+include teshsuite/smpi/io-ordered/io-ordered.tesh
+include teshsuite/smpi/io-shared/io-shared.c
+include teshsuite/smpi/io-shared/io-shared.tesh
+include teshsuite/smpi/io-simple-at/io-simple-at.c
+include teshsuite/smpi/io-simple-at/io-simple-at.tesh
+include teshsuite/smpi/io-simple/io-simple.c
+include teshsuite/smpi/io-simple/io-simple.tesh
+include teshsuite/smpi/isp/umpire/README
+include teshsuite/smpi/isp/umpire/abort.c
+include teshsuite/smpi/isp/umpire/abort1.c
+include teshsuite/smpi/isp/umpire/abort2.c
+include teshsuite/smpi/isp/umpire/abort3.c
+include teshsuite/smpi/isp/umpire/any_src-can-deadlock.c
+include teshsuite/smpi/isp/umpire/any_src-can-deadlock10.c
+include teshsuite/smpi/isp/umpire/any_src-can-deadlock10_mod.c
+include teshsuite/smpi/isp/umpire/any_src-can-deadlock11.c
+include teshsuite/smpi/isp/umpire/any_src-can-deadlock2.c
+include teshsuite/smpi/isp/umpire/any_src-can-deadlock3.c
+include teshsuite/smpi/isp/umpire/any_src-can-deadlock4.c
+include teshsuite/smpi/isp/umpire/any_src-can-deadlock4_mod.c
+include teshsuite/smpi/isp/umpire/any_src-can-deadlock5.c
+include teshsuite/smpi/isp/umpire/any_src-can-deadlock5_mod.c
+include teshsuite/smpi/isp/umpire/any_src-can-deadlock6.c
+include teshsuite/smpi/isp/umpire/any_src-can-deadlock6_mod.c
+include teshsuite/smpi/isp/umpire/any_src-can-deadlock7.c
+include teshsuite/smpi/isp/umpire/any_src-can-deadlock8.c
+include teshsuite/smpi/isp/umpire/any_src-can-deadlock9.c
+include teshsuite/smpi/isp/umpire/any_src-deadlock.c
+include teshsuite/smpi/isp/umpire/any_src-wait-deadlock.c
+include teshsuite/smpi/isp/umpire/any_src-wait-deadlock2.c
+include teshsuite/smpi/isp/umpire/any_src-waitall-deadlock.c
+include teshsuite/smpi/isp/umpire/any_src-waitall-deadlock2.c
+include teshsuite/smpi/isp/umpire/any_src-waitall-deadlock3.c
+include teshsuite/smpi/isp/umpire/any_src-waitany-deadlock.c
+include teshsuite/smpi/isp/umpire/any_src-waitany-deadlock2.c
+include teshsuite/smpi/isp/umpire/basic-deadlock-cart_create.c
+include teshsuite/smpi/isp/umpire/basic-deadlock-cart_sub.c
+include teshsuite/smpi/isp/umpire/basic-deadlock-comm_create.c
+include teshsuite/smpi/isp/umpire/basic-deadlock-comm_dup.c
+include teshsuite/smpi/isp/umpire/basic-deadlock-comm_split.c
+include teshsuite/smpi/isp/umpire/basic-deadlock-graph_create.c
+include teshsuite/smpi/isp/umpire/basic-deadlock-intercomm_create.c
+include teshsuite/smpi/isp/umpire/basic-deadlock-intercomm_merge.c
+include teshsuite/smpi/isp/umpire/basic-deadlock.c
+include teshsuite/smpi/isp/umpire/bcast-deadlock.c
+include teshsuite/smpi/isp/umpire/change-send-buffer-exhaustive.c
+include teshsuite/smpi/isp/umpire/change-send-buffer-type-exhaustive.c
+include teshsuite/smpi/isp/umpire/change-send-buffer.c
+include teshsuite/smpi/isp/umpire/collective-exhaustive-byte-int-mismatch.c
+include teshsuite/smpi/isp/umpire/collective-exhaustive-no-error.c
+include teshsuite/smpi/isp/umpire/collective-misorder-allreduce.c
+include teshsuite/smpi/isp/umpire/collective-misorder.c
+include teshsuite/smpi/isp/umpire/collective-misorder2.c
+include teshsuite/smpi/isp/umpire/comm-bcast-deadlock.c
+include teshsuite/smpi/isp/umpire/comm-deadlock.c
+include teshsuite/smpi/isp/umpire/comm-dup-no-error.c
+include teshsuite/smpi/isp/umpire/comm-dup-no-free.c
+include teshsuite/smpi/isp/umpire/comm-dup-no-free2.c
+include teshsuite/smpi/isp/umpire/comm-simple.c
+include teshsuite/smpi/isp/umpire/comm-split-no-free.c
+include teshsuite/smpi/isp/umpire/comm-translate-ranks.c
+include teshsuite/smpi/isp/umpire/complex-deadlock.c
+include teshsuite/smpi/isp/umpire/deadlock-config.c
+include teshsuite/smpi/isp/umpire/deadlock-config_blocking.c
+include teshsuite/smpi/isp/umpire/dropped-req.c
+include teshsuite/smpi/isp/umpire/errhandler-no-error.c
+include teshsuite/smpi/isp/umpire/errhandler-no-free.c
+include teshsuite/smpi/isp/umpire/finalize-deadlock.c
+include teshsuite/smpi/isp/umpire/group-no-error-exhaustive.c
+include teshsuite/smpi/isp/umpire/group-no-error.c
+include teshsuite/smpi/isp/umpire/group-no-error2.c
+include teshsuite/smpi/isp/umpire/group-no-error3.c
+include teshsuite/smpi/isp/umpire/group-no-free-exhaustive.c
+include teshsuite/smpi/isp/umpire/group-no-free.c
+include teshsuite/smpi/isp/umpire/group-no-free2.c
+include teshsuite/smpi/isp/umpire/group-no-free3.c
+include teshsuite/smpi/isp/umpire/hello.c
+include teshsuite/smpi/isp/umpire/intercomm_create-deadlock.c
+include teshsuite/smpi/isp/umpire/intercomm_create-deadlock2.c
+include teshsuite/smpi/isp/umpire/intercomm_create-deadlock3.c
+include teshsuite/smpi/isp/umpire/intercomm_create-deadlock4.c
+include teshsuite/smpi/isp/umpire/intercomm_create-no-error.c
+include teshsuite/smpi/isp/umpire/intercomm_merge-deadlock.c
+include teshsuite/smpi/isp/umpire/irecv-deadlock.c
+include teshsuite/smpi/isp/umpire/irecv-isend-ok.c
+include teshsuite/smpi/isp/umpire/irecv-isend-ok2.c
+include teshsuite/smpi/isp/umpire/lost-request-waitall.c
+include teshsuite/smpi/isp/umpire/lost-request.c
+include teshsuite/smpi/isp/umpire/lost-request2.c
+include teshsuite/smpi/isp/umpire/lost-request3.c
+include teshsuite/smpi/isp/umpire/no-error-any_src.c
+include teshsuite/smpi/isp/umpire/no-error-derived-comms.c
+include teshsuite/smpi/isp/umpire/no-error-interleaved-isend.c
+include teshsuite/smpi/isp/umpire/no-error-persistent-all-completions.c
+include teshsuite/smpi/isp/umpire/no-error-persistent-test.c
+include teshsuite/smpi/isp/umpire/no-error-persistent-testpartial.c
+include teshsuite/smpi/isp/umpire/no-error-persistent-waitpartial.c
+include teshsuite/smpi/isp/umpire/no-error-persistent.c
+include teshsuite/smpi/isp/umpire/no-error-probe-any_src.c
+include teshsuite/smpi/isp/umpire/no-error-probe-any_tag.c
+include teshsuite/smpi/isp/umpire/no-error-probe.c
+include teshsuite/smpi/isp/umpire/no-error-test.c
+include teshsuite/smpi/isp/umpire/no-error-testall.c
+include teshsuite/smpi/isp/umpire/no-error-testany.c
+include teshsuite/smpi/isp/umpire/no-error-vector-isend.c
+include teshsuite/smpi/isp/umpire/no-error-wait-any_src.c
+include teshsuite/smpi/isp/umpire/no-error-wait-any_src2.c
+include teshsuite/smpi/isp/umpire/no-error-wait-any_src3.c
+include teshsuite/smpi/isp/umpire/no-error-wait-any_src4.c
+include teshsuite/smpi/isp/umpire/no-error-wait.c
+include teshsuite/smpi/isp/umpire/no-error-wait2.c
+include teshsuite/smpi/isp/umpire/no-error-waitall-any_src.c
+include teshsuite/smpi/isp/umpire/no-error-waitall-any_src2.c
+include teshsuite/smpi/isp/umpire/no-error-waitall-any_src3.c
+include teshsuite/smpi/isp/umpire/no-error-waitall.c
+include teshsuite/smpi/isp/umpire/no-error-waitany-any_src.c
+include teshsuite/smpi/isp/umpire/no-error-waitany-any_src2.c
+include teshsuite/smpi/isp/umpire/no-error-waitany-any_src3.c
+include teshsuite/smpi/isp/umpire/no-error-waitany.c
+include teshsuite/smpi/isp/umpire/no-error-waitany2.c
+include teshsuite/smpi/isp/umpire/no-error.c
+include teshsuite/smpi/isp/umpire/no-error2.c
+include teshsuite/smpi/isp/umpire/no-error3-any_src.c
+include teshsuite/smpi/isp/umpire/no-error3.c
+include teshsuite/smpi/isp/umpire/no-error4-any_src.c
+include teshsuite/smpi/isp/umpire/no-error4.c
+include teshsuite/smpi/isp/umpire/op-no-error.c
+include teshsuite/smpi/isp/umpire/op-no-free.c
+include teshsuite/smpi/isp/umpire/partial-recv-exhaustive.c
+include teshsuite/smpi/isp/umpire/partial-recv-persistent.c
+include teshsuite/smpi/isp/umpire/partial-recv-persistent2.c
+include teshsuite/smpi/isp/umpire/partial-recv-persistent3.c
+include teshsuite/smpi/isp/umpire/partial-recv-persistent4.c
+include teshsuite/smpi/isp/umpire/partial-recv.c
+include teshsuite/smpi/isp/umpire/persistent.c
+include teshsuite/smpi/isp/umpire/persistent2.c
+include teshsuite/smpi/isp/umpire/persistent3.c
+include teshsuite/smpi/isp/umpire/persistent4.c
+include teshsuite/smpi/isp/umpire/probe-any_src-types-can-mismatch.c
+include teshsuite/smpi/isp/umpire/probe-any_tag-types-can-mismatch.c
+include teshsuite/smpi/isp/umpire/probe-deadlock.c
+include teshsuite/smpi/isp/umpire/pt2pt-byte-int-mismatch.c
+include teshsuite/smpi/isp/umpire/remote_group-no-error.c
+include teshsuite/smpi/isp/umpire/send-recv-ok.c
+include teshsuite/smpi/isp/umpire/sendrecv-deadlock.c
+include teshsuite/smpi/isp/umpire/type-commit-twice.c
+include teshsuite/smpi/isp/umpire/type-no-error-exhaustive-with-isends.c
+include teshsuite/smpi/isp/umpire/type-no-error-exhaustive.c
+include teshsuite/smpi/isp/umpire/type-no-error.c
+include teshsuite/smpi/isp/umpire/type-no-free-exhaustive.c
+include teshsuite/smpi/isp/umpire/type-no-free.c
+include teshsuite/smpi/isp/umpire/type-no-free2.c
+include teshsuite/smpi/isp/umpire/type-no-free3.c
+include teshsuite/smpi/isp/umpire/wait-deadlock.c
+include teshsuite/smpi/isp/umpire/waitall-deadlock.c
+include teshsuite/smpi/isp/umpire/waitany-deadlock.c
+include teshsuite/smpi/macro-partial-shared-communication/macro-partial-shared-communication.c
+include teshsuite/smpi/macro-partial-shared-communication/macro-partial-shared-communication.tesh
+include teshsuite/smpi/macro-partial-shared/macro-partial-shared.c
+include teshsuite/smpi/macro-partial-shared/macro-partial-shared.tesh
+include teshsuite/smpi/macro-sample/macro-sample.c
+include teshsuite/smpi/macro-sample/macro-sample.tesh
+include teshsuite/smpi/macro-shared/macro-shared.c
+include teshsuite/smpi/macro-shared/macro-shared.tesh
+include teshsuite/smpi/mpich3-test/README
+include teshsuite/smpi/mpich3-test/attr/attr2type.c
+include teshsuite/smpi/mpich3-test/attr/attrdeleteget.c
+include teshsuite/smpi/mpich3-test/attr/attrend.c
+include teshsuite/smpi/mpich3-test/attr/attrend2.c
+include teshsuite/smpi/mpich3-test/attr/attrerr.c
+include teshsuite/smpi/mpich3-test/attr/attrerrcomm.c
+include teshsuite/smpi/mpich3-test/attr/attrerrtype.c
+include teshsuite/smpi/mpich3-test/attr/attric.c
+include teshsuite/smpi/mpich3-test/attr/attrorder.c
+include teshsuite/smpi/mpich3-test/attr/attrordercomm.c
+include teshsuite/smpi/mpich3-test/attr/attrordertype.c
+include teshsuite/smpi/mpich3-test/attr/attrt.c
+include teshsuite/smpi/mpich3-test/attr/baseattr2.c
+include teshsuite/smpi/mpich3-test/attr/baseattrcomm.c
+include teshsuite/smpi/mpich3-test/attr/fkeyval.c
+include teshsuite/smpi/mpich3-test/attr/fkeyvalcomm.c
+include teshsuite/smpi/mpich3-test/attr/fkeyvaltype.c
+include teshsuite/smpi/mpich3-test/attr/keyval_double_free.c
+include teshsuite/smpi/mpich3-test/attr/keyval_double_free_comm.c
+include teshsuite/smpi/mpich3-test/attr/keyval_double_free_type.c
+include teshsuite/smpi/mpich3-test/attr/keyval_double_free_win.c
+include teshsuite/smpi/mpich3-test/attr/testlist
+include teshsuite/smpi/mpich3-test/checktests
+include teshsuite/smpi/mpich3-test/coll/allgather2.c
+include teshsuite/smpi/mpich3-test/coll/allgather3.c
+include teshsuite/smpi/mpich3-test/coll/allgather_struct.c
+include teshsuite/smpi/mpich3-test/coll/allgatherv2.c
+include teshsuite/smpi/mpich3-test/coll/allgatherv3.c
+include teshsuite/smpi/mpich3-test/coll/allgatherv4.c
+include teshsuite/smpi/mpich3-test/coll/allred.c
+include teshsuite/smpi/mpich3-test/coll/allred2.c
+include teshsuite/smpi/mpich3-test/coll/allred3.c
+include teshsuite/smpi/mpich3-test/coll/allred4.c
+include teshsuite/smpi/mpich3-test/coll/allred5.c
+include teshsuite/smpi/mpich3-test/coll/allred6.c
+include teshsuite/smpi/mpich3-test/coll/allredmany.c
+include teshsuite/smpi/mpich3-test/coll/alltoall1.c
+include teshsuite/smpi/mpich3-test/coll/alltoallv.c
+include teshsuite/smpi/mpich3-test/coll/alltoallv0.c
+include teshsuite/smpi/mpich3-test/coll/alltoallw1.c
+include teshsuite/smpi/mpich3-test/coll/alltoallw2.c
+include teshsuite/smpi/mpich3-test/coll/alltoallw_zeros.c
+include teshsuite/smpi/mpich3-test/coll/bcast.c
+include teshsuite/smpi/mpich3-test/coll/bcasttest.c
+include teshsuite/smpi/mpich3-test/coll/bcastzerotype.c
+include teshsuite/smpi/mpich3-test/coll/coll10.c
+include teshsuite/smpi/mpich3-test/coll/coll11.c
+include teshsuite/smpi/mpich3-test/coll/coll12.c
+include teshsuite/smpi/mpich3-test/coll/coll13.c
+include teshsuite/smpi/mpich3-test/coll/coll2.c
+include teshsuite/smpi/mpich3-test/coll/coll3.c
+include teshsuite/smpi/mpich3-test/coll/coll4.c
+include teshsuite/smpi/mpich3-test/coll/coll5.c
+include teshsuite/smpi/mpich3-test/coll/coll6.c
+include teshsuite/smpi/mpich3-test/coll/coll7.c
+include teshsuite/smpi/mpich3-test/coll/coll8.c
+include teshsuite/smpi/mpich3-test/coll/coll9.c
+include teshsuite/smpi/mpich3-test/coll/exscan.c
+include teshsuite/smpi/mpich3-test/coll/exscan2.c
+include teshsuite/smpi/mpich3-test/coll/gather.c
+include teshsuite/smpi/mpich3-test/coll/gather2.c
+include teshsuite/smpi/mpich3-test/coll/gather_big.c
+include teshsuite/smpi/mpich3-test/coll/iallred.c
+include teshsuite/smpi/mpich3-test/coll/ibarrier.c
+include teshsuite/smpi/mpich3-test/coll/icallgather.c
+include teshsuite/smpi/mpich3-test/coll/icallgatherv.c
+include teshsuite/smpi/mpich3-test/coll/icallreduce.c
+include teshsuite/smpi/mpich3-test/coll/icalltoall.c
+include teshsuite/smpi/mpich3-test/coll/icalltoallv.c
+include teshsuite/smpi/mpich3-test/coll/icalltoallw.c
+include teshsuite/smpi/mpich3-test/coll/icbarrier.c
+include teshsuite/smpi/mpich3-test/coll/icbcast.c
+include teshsuite/smpi/mpich3-test/coll/icgather.c
+include teshsuite/smpi/mpich3-test/coll/icgatherv.c
+include teshsuite/smpi/mpich3-test/coll/icreduce.c
+include teshsuite/smpi/mpich3-test/coll/icscatter.c
+include teshsuite/smpi/mpich3-test/coll/icscatterv.c
+include teshsuite/smpi/mpich3-test/coll/longuser.c
+include teshsuite/smpi/mpich3-test/coll/nonblocking.c
+include teshsuite/smpi/mpich3-test/coll/nonblocking2.c
+include teshsuite/smpi/mpich3-test/coll/nonblocking3.c
+include teshsuite/smpi/mpich3-test/coll/op_commutative.c
+include teshsuite/smpi/mpich3-test/coll/opband.c
+include teshsuite/smpi/mpich3-test/coll/opbor.c
+include teshsuite/smpi/mpich3-test/coll/opbxor.c
+include teshsuite/smpi/mpich3-test/coll/opland.c
+include teshsuite/smpi/mpich3-test/coll/oplor.c
+include teshsuite/smpi/mpich3-test/coll/oplxor.c
+include teshsuite/smpi/mpich3-test/coll/opmax.c
+include teshsuite/smpi/mpich3-test/coll/opmaxloc.c
+include teshsuite/smpi/mpich3-test/coll/opmin.c
+include teshsuite/smpi/mpich3-test/coll/opminloc.c
+include teshsuite/smpi/mpich3-test/coll/opprod.c
+include teshsuite/smpi/mpich3-test/coll/opsum.c
+include teshsuite/smpi/mpich3-test/coll/red3.c
+include teshsuite/smpi/mpich3-test/coll/red4.c
+include teshsuite/smpi/mpich3-test/coll/red_scat_block.c
+include teshsuite/smpi/mpich3-test/coll/red_scat_block2.c
+include teshsuite/smpi/mpich3-test/coll/redscat.c
+include teshsuite/smpi/mpich3-test/coll/redscat2.c
+include teshsuite/smpi/mpich3-test/coll/redscat3.c
+include teshsuite/smpi/mpich3-test/coll/redscatbkinter.c
+include teshsuite/smpi/mpich3-test/coll/redscatblk3.c
+include teshsuite/smpi/mpich3-test/coll/redscatinter.c
+include teshsuite/smpi/mpich3-test/coll/reduce.c
+include teshsuite/smpi/mpich3-test/coll/reduce_local.c
+include teshsuite/smpi/mpich3-test/coll/scantst.c
+include teshsuite/smpi/mpich3-test/coll/scatter2.c
+include teshsuite/smpi/mpich3-test/coll/scatter3.c
+include teshsuite/smpi/mpich3-test/coll/scattern.c
+include teshsuite/smpi/mpich3-test/coll/scatterv.c
+include teshsuite/smpi/mpich3-test/coll/testlist
+include teshsuite/smpi/mpich3-test/coll/uoplong.c
+include teshsuite/smpi/mpich3-test/comm/cmfree.c
+include teshsuite/smpi/mpich3-test/comm/cmsplit.c
+include teshsuite/smpi/mpich3-test/comm/cmsplit2.c
+include teshsuite/smpi/mpich3-test/comm/cmsplit_type.c
+include teshsuite/smpi/mpich3-test/comm/comm_create_group.c
+include teshsuite/smpi/mpich3-test/comm/comm_create_group_idup.c
+include teshsuite/smpi/mpich3-test/comm/comm_group_half.c
+include teshsuite/smpi/mpich3-test/comm/comm_group_rand.c
+include teshsuite/smpi/mpich3-test/comm/comm_idup.c
+include teshsuite/smpi/mpich3-test/comm/comm_idup_comm.c
+include teshsuite/smpi/mpich3-test/comm/comm_idup_comm2.c
+include teshsuite/smpi/mpich3-test/comm/comm_idup_iallreduce.c
+include teshsuite/smpi/mpich3-test/comm/comm_idup_isend.c
+include teshsuite/smpi/mpich3-test/comm/comm_idup_mul.c
+include teshsuite/smpi/mpich3-test/comm/comm_idup_nb.c
+include teshsuite/smpi/mpich3-test/comm/comm_idup_overlap.c
+include teshsuite/smpi/mpich3-test/comm/comm_info.c
+include teshsuite/smpi/mpich3-test/comm/commcreate1.c
+include teshsuite/smpi/mpich3-test/comm/commname.c
+include teshsuite/smpi/mpich3-test/comm/ctxalloc.c
+include teshsuite/smpi/mpich3-test/comm/ctxsplit.c
+include teshsuite/smpi/mpich3-test/comm/dup.c
+include teshsuite/smpi/mpich3-test/comm/dup_with_info.c
+include teshsuite/smpi/mpich3-test/comm/dupic.c
+include teshsuite/smpi/mpich3-test/comm/ic1.c
+include teshsuite/smpi/mpich3-test/comm/ic2.c
+include teshsuite/smpi/mpich3-test/comm/iccreate.c
+include teshsuite/smpi/mpich3-test/comm/icgroup.c
+include teshsuite/smpi/mpich3-test/comm/icm.c
+include teshsuite/smpi/mpich3-test/comm/icsplit.c
+include teshsuite/smpi/mpich3-test/comm/probe-intercomm.c
+include teshsuite/smpi/mpich3-test/comm/testlist
+include teshsuite/smpi/mpich3-test/datatype/blockindexed-misc.c
+include teshsuite/smpi/mpich3-test/datatype/blockindexed-zero-count.c
+include teshsuite/smpi/mpich3-test/datatype/contents.c
+include teshsuite/smpi/mpich3-test/datatype/contig-zero-count.c
+include teshsuite/smpi/mpich3-test/datatype/contigstruct.c
+include teshsuite/smpi/mpich3-test/datatype/cxx-types.c
+include teshsuite/smpi/mpich3-test/datatype/darray-cyclic.c
+include teshsuite/smpi/mpich3-test/datatype/darray-pack.c
+include teshsuite/smpi/mpich3-test/datatype/dataalign.c
+include teshsuite/smpi/mpich3-test/datatype/gaddress.c
+include teshsuite/smpi/mpich3-test/datatype/get-elements-pairtype.c
+include teshsuite/smpi/mpich3-test/datatype/get-elements.c
+include teshsuite/smpi/mpich3-test/datatype/getpartelm.c
+include teshsuite/smpi/mpich3-test/datatype/hindexed-zeros.c
+include teshsuite/smpi/mpich3-test/datatype/hindexed_block.c
+include teshsuite/smpi/mpich3-test/datatype/hindexed_block_contents.c
+include teshsuite/smpi/mpich3-test/datatype/hvecblklen.c
+include teshsuite/smpi/mpich3-test/datatype/indexed-misc.c
+include teshsuite/smpi/mpich3-test/datatype/large-count.c
+include teshsuite/smpi/mpich3-test/datatype/large_type.c
+include teshsuite/smpi/mpich3-test/datatype/large_type_sendrec.c
+include teshsuite/smpi/mpich3-test/datatype/large_vec.c
+include teshsuite/smpi/mpich3-test/datatype/lbub.c
+include teshsuite/smpi/mpich3-test/datatype/localpack.c
+include teshsuite/smpi/mpich3-test/datatype/longdouble.c
+include teshsuite/smpi/mpich3-test/datatype/lots-of-types.c
+include teshsuite/smpi/mpich3-test/datatype/pairtype-pack.c
+include teshsuite/smpi/mpich3-test/datatype/pairtype-size-extent.c
+include teshsuite/smpi/mpich3-test/datatype/segtest.c
+include teshsuite/smpi/mpich3-test/datatype/sendrecvt2.c
+include teshsuite/smpi/mpich3-test/datatype/sendrecvt4.c
+include teshsuite/smpi/mpich3-test/datatype/simple-commit.c
+include teshsuite/smpi/mpich3-test/datatype/simple-pack-external.c
+include teshsuite/smpi/mpich3-test/datatype/simple-pack-external2.c
+include teshsuite/smpi/mpich3-test/datatype/simple-pack.c
+include teshsuite/smpi/mpich3-test/datatype/simple-resized.c
+include teshsuite/smpi/mpich3-test/datatype/simple-size-extent.c
+include teshsuite/smpi/mpich3-test/datatype/sizedtypes.c
+include teshsuite/smpi/mpich3-test/datatype/slice-pack-external.c
+include teshsuite/smpi/mpich3-test/datatype/slice-pack.c
+include teshsuite/smpi/mpich3-test/datatype/struct-derived-zeros.c
+include teshsuite/smpi/mpich3-test/datatype/struct-empty-el.c
+include teshsuite/smpi/mpich3-test/datatype/struct-ezhov.c
+include teshsuite/smpi/mpich3-test/datatype/struct-no-real-types.c
+include teshsuite/smpi/mpich3-test/datatype/struct-pack.c
+include teshsuite/smpi/mpich3-test/datatype/struct-verydeep.c
+include teshsuite/smpi/mpich3-test/datatype/struct-zero-count.c
+include teshsuite/smpi/mpich3-test/datatype/structpack2.c
+include teshsuite/smpi/mpich3-test/datatype/subarray-pack.c
+include teshsuite/smpi/mpich3-test/datatype/subarray.c
+include teshsuite/smpi/mpich3-test/datatype/testlist
+include teshsuite/smpi/mpich3-test/datatype/tfree.c
+include teshsuite/smpi/mpich3-test/datatype/tmatchsize.c
+include teshsuite/smpi/mpich3-test/datatype/transpose-pack.c
+include teshsuite/smpi/mpich3-test/datatype/tresized.c
+include teshsuite/smpi/mpich3-test/datatype/tresized2.c
+include teshsuite/smpi/mpich3-test/datatype/triangular-pack.c
+include teshsuite/smpi/mpich3-test/datatype/typecommit.c
+include teshsuite/smpi/mpich3-test/datatype/typefree.c
+include teshsuite/smpi/mpich3-test/datatype/typelb.c
+include teshsuite/smpi/mpich3-test/datatype/typename.c
+include teshsuite/smpi/mpich3-test/datatype/unpack.c
+include teshsuite/smpi/mpich3-test/datatype/unusual-noncontigs.c
+include teshsuite/smpi/mpich3-test/datatype/vecblklen.c
+include teshsuite/smpi/mpich3-test/datatype/zero-blklen-vector.c
+include teshsuite/smpi/mpich3-test/datatype/zeroblks.c
+include teshsuite/smpi/mpich3-test/datatype/zeroparms.c
+include teshsuite/smpi/mpich3-test/errhan/adderr.c
+include teshsuite/smpi/mpich3-test/errhan/commcall.c
+include teshsuite/smpi/mpich3-test/errhan/dynamic_errcode_predefined_errclass.c
+include teshsuite/smpi/mpich3-test/errhan/errfatal.c
+include teshsuite/smpi/mpich3-test/errhan/errstring2.c
+include teshsuite/smpi/mpich3-test/errhan/predef_eh.c
+include teshsuite/smpi/mpich3-test/errhan/testlist
+include teshsuite/smpi/mpich3-test/f77/attr/attraints.h
+include teshsuite/smpi/mpich3-test/f77/attr/attrmpi1f.f
+include teshsuite/smpi/mpich3-test/f77/attr/baseattr2f.f
+include teshsuite/smpi/mpich3-test/f77/attr/baseattrf.f
+include teshsuite/smpi/mpich3-test/f77/attr/commattr2f.f
+include teshsuite/smpi/mpich3-test/f77/attr/commattr3f.f
+include teshsuite/smpi/mpich3-test/f77/attr/commattrf.f
+include teshsuite/smpi/mpich3-test/f77/attr/testlist
+include teshsuite/smpi/mpich3-test/f77/attr/typeattr2f.f
+include teshsuite/smpi/mpich3-test/f77/attr/typeattr3f.f
+include teshsuite/smpi/mpich3-test/f77/attr/typeattrf.f
+include teshsuite/smpi/mpich3-test/f77/coll/allredint8f.f
+include teshsuite/smpi/mpich3-test/f77/coll/allredopttf.f
+include teshsuite/smpi/mpich3-test/f77/coll/alltoallvf.f
+include teshsuite/smpi/mpich3-test/f77/coll/alltoallwf.f
+include teshsuite/smpi/mpich3-test/f77/coll/exscanf.f
+include teshsuite/smpi/mpich3-test/f77/coll/inplacef.f
+include teshsuite/smpi/mpich3-test/f77/coll/nonblocking_inpf.f
+include teshsuite/smpi/mpich3-test/f77/coll/nonblockingf.f
+include teshsuite/smpi/mpich3-test/f77/coll/red_scat_blockf.f
+include teshsuite/smpi/mpich3-test/f77/coll/redscatf.f
+include teshsuite/smpi/mpich3-test/f77/coll/reducelocalf.f
+include teshsuite/smpi/mpich3-test/f77/coll/split_typef.f
+include teshsuite/smpi/mpich3-test/f77/coll/testlist
+include teshsuite/smpi/mpich3-test/f77/coll/uallreducef.f
+include teshsuite/smpi/mpich3-test/f77/coll/vw_inplacef.f
+include teshsuite/smpi/mpich3-test/f77/comm/commerrf.f
+include teshsuite/smpi/mpich3-test/f77/comm/commnamef.f
+include teshsuite/smpi/mpich3-test/f77/comm/testlist
+include teshsuite/smpi/mpich3-test/f77/datatype/allctypesf.f
+include teshsuite/smpi/mpich3-test/f77/datatype/gaddressf.f
+include teshsuite/smpi/mpich3-test/f77/datatype/hindex1f.f
+include teshsuite/smpi/mpich3-test/f77/datatype/hindexed_blockf.f
+include teshsuite/smpi/mpich3-test/f77/datatype/packef.f
+include teshsuite/smpi/mpich3-test/f77/datatype/testlist
+include teshsuite/smpi/mpich3-test/f77/datatype/typeaints.h.in
+include teshsuite/smpi/mpich3-test/f77/datatype/typecntsf.f
+include teshsuite/smpi/mpich3-test/f77/datatype/typem2f.f
+include teshsuite/smpi/mpich3-test/f77/datatype/typename3f.f
+include teshsuite/smpi/mpich3-test/f77/datatype/typenamef.f
+include teshsuite/smpi/mpich3-test/f77/datatype/typesnamef.f
+include teshsuite/smpi/mpich3-test/f77/datatype/typesubf.f
+include teshsuite/smpi/mpich3-test/f77/ext/add1size.h
+include teshsuite/smpi/mpich3-test/f77/ext/allocmemf.f
+include teshsuite/smpi/mpich3-test/f77/ext/c2f2c.c
+include teshsuite/smpi/mpich3-test/f77/ext/c2f2cf.f
+include teshsuite/smpi/mpich3-test/f77/ext/c2fmult.c
+include teshsuite/smpi/mpich3-test/f77/ext/ctypesfromc.c
+include teshsuite/smpi/mpich3-test/f77/ext/ctypesinf.f
+include teshsuite/smpi/mpich3-test/f77/ext/testlist
+include teshsuite/smpi/mpich3-test/f77/info/infotest2f.f
+include teshsuite/smpi/mpich3-test/f77/info/infotestf.f
+include teshsuite/smpi/mpich3-test/f77/info/testlist
+include teshsuite/smpi/mpich3-test/f77/init/baseenvf.f
+include teshsuite/smpi/mpich3-test/f77/init/checksizes.c
+include teshsuite/smpi/mpich3-test/f77/init/testlist
+include teshsuite/smpi/mpich3-test/f77/pt2pt/allpairf.f
+include teshsuite/smpi/mpich3-test/f77/pt2pt/attr1aints.h
+include teshsuite/smpi/mpich3-test/f77/pt2pt/dummyf.f
+include teshsuite/smpi/mpich3-test/f77/pt2pt/greqf.f
+include teshsuite/smpi/mpich3-test/f77/pt2pt/mprobef.f
+include teshsuite/smpi/mpich3-test/f77/pt2pt/statusesf.f
+include teshsuite/smpi/mpich3-test/f77/pt2pt/testlist
+include teshsuite/smpi/mpich3-test/f77/rma/addsize.h
+include teshsuite/smpi/mpich3-test/f77/rma/attraints.h
+include teshsuite/smpi/mpich3-test/f77/rma/baseattrwinf.f
+include teshsuite/smpi/mpich3-test/f77/rma/c2f2cwin.c
+include teshsuite/smpi/mpich3-test/f77/rma/c2f2cwinf.f
+include teshsuite/smpi/mpich3-test/f77/rma/testlist
+include teshsuite/smpi/mpich3-test/f77/rma/winaccf.f
+include teshsuite/smpi/mpich3-test/f77/rma/winattr2f.f
+include teshsuite/smpi/mpich3-test/f77/rma/winattrf.f
+include teshsuite/smpi/mpich3-test/f77/rma/winerrf.f
+include teshsuite/smpi/mpich3-test/f77/rma/winfencef.f
+include teshsuite/smpi/mpich3-test/f77/rma/wingetf.f
+include teshsuite/smpi/mpich3-test/f77/rma/wingroupf.f
+include teshsuite/smpi/mpich3-test/f77/rma/winnamef.f
+include teshsuite/smpi/mpich3-test/f77/rma/winscale1f.f
+include teshsuite/smpi/mpich3-test/f77/rma/winscale2f.f
+include teshsuite/smpi/mpich3-test/f77/testlist
+include teshsuite/smpi/mpich3-test/f77/topo/cartcrf.f
+include teshsuite/smpi/mpich3-test/f77/topo/dgraph_unwgtf.f
+include teshsuite/smpi/mpich3-test/f77/topo/dgraph_wgtf.f
+include teshsuite/smpi/mpich3-test/f77/topo/testlist
+include teshsuite/smpi/mpich3-test/f77/util/../util/mtestf.f
+include teshsuite/smpi/mpich3-test/f90/coll/allredint8f90.f90
+include teshsuite/smpi/mpich3-test/f90/coll/allredopttf90.f90
+include teshsuite/smpi/mpich3-test/f90/coll/alltoallvf90.f90
+include teshsuite/smpi/mpich3-test/f90/coll/alltoallwf90.f90
+include teshsuite/smpi/mpich3-test/f90/coll/exscanf90.f90
+include teshsuite/smpi/mpich3-test/f90/coll/inplacef90.f90
+include teshsuite/smpi/mpich3-test/f90/coll/nonblocking_inpf90.f90
+include teshsuite/smpi/mpich3-test/f90/coll/nonblockingf90.f90
+include teshsuite/smpi/mpich3-test/f90/coll/red_scat_blockf90.f90
+include teshsuite/smpi/mpich3-test/f90/coll/redscatf90.f90
+include teshsuite/smpi/mpich3-test/f90/coll/reducelocalf90.f90
+include teshsuite/smpi/mpich3-test/f90/coll/split_typef90.f90
+include teshsuite/smpi/mpich3-test/f90/coll/testlist
+include teshsuite/smpi/mpich3-test/f90/coll/uallreducef90.f90
+include teshsuite/smpi/mpich3-test/f90/coll/vw_inplacef90.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/allctypesf90.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/createf90.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/gaddressf90.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/get_elem_d.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/get_elem_u.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/hindex1f90.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/hindexed_blockf90.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/indtype.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/kinds.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/packef90.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/sizeof.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/structf.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/testlist
+include teshsuite/smpi/mpich3-test/f90/datatype/trf90.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/typecntsf90.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/typem2f90.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/typename3f90.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/typenamef90.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/typesnamef90.f90
+include teshsuite/smpi/mpich3-test/f90/datatype/typesubf90.f90
+include teshsuite/smpi/mpich3-test/f90/info/infotest2f90.f90
+include teshsuite/smpi/mpich3-test/f90/info/infotestf90.f90
+include teshsuite/smpi/mpich3-test/f90/info/testlist
+include teshsuite/smpi/mpich3-test/f90/init/baseenvf90.f90
+include teshsuite/smpi/mpich3-test/f90/init/testlist
+include teshsuite/smpi/mpich3-test/f90/pt2pt/allpairf90.f90
+include teshsuite/smpi/mpich3-test/f90/pt2pt/dummyf90.f90
+include teshsuite/smpi/mpich3-test/f90/pt2pt/greqf90.f90
+include teshsuite/smpi/mpich3-test/f90/pt2pt/mprobef90.f90
+include teshsuite/smpi/mpich3-test/f90/pt2pt/statusesf90.f90
+include teshsuite/smpi/mpich3-test/f90/pt2pt/testlist
+include teshsuite/smpi/mpich3-test/f90/rma/baseattrwinf90.f90
+include teshsuite/smpi/mpich3-test/f90/rma/c2f2cwinf90.f90
+include teshsuite/smpi/mpich3-test/f90/rma/c2f902cwin.c
+include teshsuite/smpi/mpich3-test/f90/rma/testlist
+include teshsuite/smpi/mpich3-test/f90/rma/winaccf90.f90
+include teshsuite/smpi/mpich3-test/f90/rma/winattr2f90.f90
+include teshsuite/smpi/mpich3-test/f90/rma/winattrf90.f90
+include teshsuite/smpi/mpich3-test/f90/rma/winerrf90.f90
+include teshsuite/smpi/mpich3-test/f90/rma/winfencef90.f90
+include teshsuite/smpi/mpich3-test/f90/rma/wingetf90.f90
+include teshsuite/smpi/mpich3-test/f90/rma/wingroupf90.f90
+include teshsuite/smpi/mpich3-test/f90/rma/winnamef90.f90
+include teshsuite/smpi/mpich3-test/f90/rma/winscale1f90.f90
+include teshsuite/smpi/mpich3-test/f90/rma/winscale2f90.f90
+include teshsuite/smpi/mpich3-test/f90/testlist
+include teshsuite/smpi/mpich3-test/f90/util/../util/mtestf90.f90
+include teshsuite/smpi/mpich3-test/generate_report
+include teshsuite/smpi/mpich3-test/group/glpid.c
+include teshsuite/smpi/mpich3-test/group/groupcreate.c
+include teshsuite/smpi/mpich3-test/group/groupnullincl.c
+include teshsuite/smpi/mpich3-test/group/grouptest.c
+include teshsuite/smpi/mpich3-test/group/grouptest2.c
+include teshsuite/smpi/mpich3-test/group/gtranks.c
+include teshsuite/smpi/mpich3-test/group/gtranksperf.c
+include teshsuite/smpi/mpich3-test/group/testlist
+include teshsuite/smpi/mpich3-test/hostfile
+include teshsuite/smpi/mpich3-test/include/dtypes.h
+include teshsuite/smpi/mpich3-test/include/mpicolltest.h
+include teshsuite/smpi/mpich3-test/include/mpitest.h
+include teshsuite/smpi/mpich3-test/include/mpitestconf.h
+include teshsuite/smpi/mpich3-test/include/mpitestcxx.h
+include teshsuite/smpi/mpich3-test/include/mpithreadtest.h
+include teshsuite/smpi/mpich3-test/include/mtest_datatype.h
+include teshsuite/smpi/mpich3-test/info/infodel.c
+include teshsuite/smpi/mpich3-test/info/infodup.c
+include teshsuite/smpi/mpich3-test/info/infoenv.c
+include teshsuite/smpi/mpich3-test/info/infoget.c
+include teshsuite/smpi/mpich3-test/info/infomany.c
+include teshsuite/smpi/mpich3-test/info/infomany2.c
+include teshsuite/smpi/mpich3-test/info/infoorder.c
+include teshsuite/smpi/mpich3-test/info/infotest.c
+include teshsuite/smpi/mpich3-test/info/infovallen.c
+include teshsuite/smpi/mpich3-test/info/testlist
+include teshsuite/smpi/mpich3-test/init/attrself.c
+include teshsuite/smpi/mpich3-test/init/exitst1.c
+include teshsuite/smpi/mpich3-test/init/exitst2.c
+include teshsuite/smpi/mpich3-test/init/exitst3.c
+include teshsuite/smpi/mpich3-test/init/finalized.c
+include teshsuite/smpi/mpich3-test/init/initstat.c
+include teshsuite/smpi/mpich3-test/init/library_version.c
+include teshsuite/smpi/mpich3-test/init/testlist
+include teshsuite/smpi/mpich3-test/init/timeout.c
+include teshsuite/smpi/mpich3-test/init/version.c
+include teshsuite/smpi/mpich3-test/perf/README
+include teshsuite/smpi/mpich3-test/perf/allredtrace.c
+include teshsuite/smpi/mpich3-test/perf/commcreatep.c
+include teshsuite/smpi/mpich3-test/perf/dtpack.c
+include teshsuite/smpi/mpich3-test/perf/indexperf.c
+include teshsuite/smpi/mpich3-test/perf/manyrma.c
+include teshsuite/smpi/mpich3-test/perf/nestvec.c
+include teshsuite/smpi/mpich3-test/perf/nestvec2.c
+include teshsuite/smpi/mpich3-test/perf/non_zero_root.c
+include teshsuite/smpi/mpich3-test/perf/sendrecvl.c
+include teshsuite/smpi/mpich3-test/perf/testlist
+include teshsuite/smpi/mpich3-test/perf/timer.c
+include teshsuite/smpi/mpich3-test/perf/transp-datatype.c
+include teshsuite/smpi/mpich3-test/perf/twovec.c
+include teshsuite/smpi/mpich3-test/pt2pt/anyall.c
+include teshsuite/smpi/mpich3-test/pt2pt/big_count_status.c
+include teshsuite/smpi/mpich3-test/pt2pt/bottom.c
+include teshsuite/smpi/mpich3-test/pt2pt/bsend1.c
+include teshsuite/smpi/mpich3-test/pt2pt/bsend2.c
+include teshsuite/smpi/mpich3-test/pt2pt/bsend3.c
+include teshsuite/smpi/mpich3-test/pt2pt/bsend4.c
+include teshsuite/smpi/mpich3-test/pt2pt/bsend5.c
+include teshsuite/smpi/mpich3-test/pt2pt/bsendalign.c
+include teshsuite/smpi/mpich3-test/pt2pt/bsendfrag.c
+include teshsuite/smpi/mpich3-test/pt2pt/bsendpending.c
+include teshsuite/smpi/mpich3-test/pt2pt/cancelanysrc.c
+include teshsuite/smpi/mpich3-test/pt2pt/cancelrecv.c
+include teshsuite/smpi/mpich3-test/pt2pt/dtype_send.c
+include teshsuite/smpi/mpich3-test/pt2pt/eagerdt.c
+include teshsuite/smpi/mpich3-test/pt2pt/greq1.c
+include teshsuite/smpi/mpich3-test/pt2pt/huge_anysrc.c
+include teshsuite/smpi/mpich3-test/pt2pt/huge_underflow.c
+include teshsuite/smpi/mpich3-test/pt2pt/icsend.c
+include teshsuite/smpi/mpich3-test/pt2pt/inactivereq.c
+include teshsuite/smpi/mpich3-test/pt2pt/isendirecv.c
+include teshsuite/smpi/mpich3-test/pt2pt/isendself.c
+include teshsuite/smpi/mpich3-test/pt2pt/isendselfprobe.c
+include teshsuite/smpi/mpich3-test/pt2pt/issendselfcancel.c
+include teshsuite/smpi/mpich3-test/pt2pt/large_message.c
+include teshsuite/smpi/mpich3-test/pt2pt/many_isend.c
+include teshsuite/smpi/mpich3-test/pt2pt/manylmt.c
+include teshsuite/smpi/mpich3-test/pt2pt/mprobe.c
+include teshsuite/smpi/mpich3-test/pt2pt/pingping.c
+include teshsuite/smpi/mpich3-test/pt2pt/probe-unexp.c
+include teshsuite/smpi/mpich3-test/pt2pt/probenull.c
+include teshsuite/smpi/mpich3-test/pt2pt/pscancel.c
+include teshsuite/smpi/mpich3-test/pt2pt/rcancel.c
+include teshsuite/smpi/mpich3-test/pt2pt/recv_any.c
+include teshsuite/smpi/mpich3-test/pt2pt/rqfreeb.c
+include teshsuite/smpi/mpich3-test/pt2pt/rqstatus.c
+include teshsuite/smpi/mpich3-test/pt2pt/scancel.c
+include teshsuite/smpi/mpich3-test/pt2pt/scancel2.c
+include teshsuite/smpi/mpich3-test/pt2pt/scancel_unmatch.c
+include teshsuite/smpi/mpich3-test/pt2pt/sendall.c
+include teshsuite/smpi/mpich3-test/pt2pt/sendflood.c
+include teshsuite/smpi/mpich3-test/pt2pt/sendrecv1.c
+include teshsuite/smpi/mpich3-test/pt2pt/sendrecv2.c
+include teshsuite/smpi/mpich3-test/pt2pt/sendrecv3.c
+include teshsuite/smpi/mpich3-test/pt2pt/sendself.c
+include teshsuite/smpi/mpich3-test/pt2pt/testlist
+include teshsuite/smpi/mpich3-test/pt2pt/waitany-null.c
+include teshsuite/smpi/mpich3-test/pt2pt/waittestnull.c
+include teshsuite/smpi/mpich3-test/rma/acc-loc.c
+include teshsuite/smpi/mpich3-test/rma/acc-pairtype.c
+include teshsuite/smpi/mpich3-test/rma/accfence1.c
+include teshsuite/smpi/mpich3-test/rma/accfence2.c
+include teshsuite/smpi/mpich3-test/rma/accfence2_am.c
+include teshsuite/smpi/mpich3-test/rma/accpscw1.c
+include teshsuite/smpi/mpich3-test/rma/adlb_mimic1.c
+include teshsuite/smpi/mpich3-test/rma/aint.c
+include teshsuite/smpi/mpich3-test/rma/allocmem.c
+include teshsuite/smpi/mpich3-test/rma/at_complete.c
+include teshsuite/smpi/mpich3-test/rma/atomic_get.c
+include teshsuite/smpi/mpich3-test/rma/atomic_rmw_cas.c
+include teshsuite/smpi/mpich3-test/rma/atomic_rmw_fop.c
+include teshsuite/smpi/mpich3-test/rma/atomic_rmw_gacc.c
+include teshsuite/smpi/mpich3-test/rma/attrorderwin.c
+include teshsuite/smpi/mpich3-test/rma/badrma.c
+include teshsuite/smpi/mpich3-test/rma/baseattrwin.c
+include teshsuite/smpi/mpich3-test/rma/compare_and_swap.c
+include teshsuite/smpi/mpich3-test/rma/contention_put.c
+include teshsuite/smpi/mpich3-test/rma/contention_putget.c
+include teshsuite/smpi/mpich3-test/rma/contig_displ.c
+include teshsuite/smpi/mpich3-test/rma/derived-acc-flush_local.c
+include teshsuite/smpi/mpich3-test/rma/epochtest.c
+include teshsuite/smpi/mpich3-test/rma/fence_shm.c
+include teshsuite/smpi/mpich3-test/rma/fetch_and_op.c
+include teshsuite/smpi/mpich3-test/rma/fetchandadd.c
+include teshsuite/smpi/mpich3-test/rma/fetchandadd_am.c
+include teshsuite/smpi/mpich3-test/rma/fetchandadd_tree.c
+include teshsuite/smpi/mpich3-test/rma/fetchandadd_tree_am.c
+include teshsuite/smpi/mpich3-test/rma/fkeyvalwin.c
+include teshsuite/smpi/mpich3-test/rma/flush.c
+include teshsuite/smpi/mpich3-test/rma/get-struct.c
+include teshsuite/smpi/mpich3-test/rma/get_acc_local.c
+include teshsuite/smpi/mpich3-test/rma/get_accumulate.c
+include teshsuite/smpi/mpich3-test/rma/getfence1.c
+include teshsuite/smpi/mpich3-test/rma/getgroup.c
+include teshsuite/smpi/mpich3-test/rma/large-acc-flush_local.c
+include teshsuite/smpi/mpich3-test/rma/large-small-acc.c
+include teshsuite/smpi/mpich3-test/rma/linked_list.c
+include teshsuite/smpi/mpich3-test/rma/linked_list_bench_lock_all.c
+include teshsuite/smpi/mpich3-test/rma/linked_list_bench_lock_excl.c
+include teshsuite/smpi/mpich3-test/rma/linked_list_bench_lock_shr.c
+include teshsuite/smpi/mpich3-test/rma/linked_list_fop.c
+include teshsuite/smpi/mpich3-test/rma/linked_list_lockall.c
+include teshsuite/smpi/mpich3-test/rma/lock_contention_dt.c
+include teshsuite/smpi/mpich3-test/rma/lock_dt.c
+include teshsuite/smpi/mpich3-test/rma/lock_dt_flush.c
+include teshsuite/smpi/mpich3-test/rma/lock_dt_flushlocal.c
+include teshsuite/smpi/mpich3-test/rma/lock_nested.c
+include teshsuite/smpi/mpich3-test/rma/lockall_dt.c
+include teshsuite/smpi/mpich3-test/rma/lockall_dt_flush.c
+include teshsuite/smpi/mpich3-test/rma/lockall_dt_flushall.c
+include teshsuite/smpi/mpich3-test/rma/lockall_dt_flushlocal.c
+include teshsuite/smpi/mpich3-test/rma/lockall_dt_flushlocalall.c
+include teshsuite/smpi/mpich3-test/rma/lockcontention.c
+include teshsuite/smpi/mpich3-test/rma/lockcontention2.c
+include teshsuite/smpi/mpich3-test/rma/lockcontention3.c
+include teshsuite/smpi/mpich3-test/rma/locknull.c
+include teshsuite/smpi/mpich3-test/rma/lockopts.c
+include teshsuite/smpi/mpich3-test/rma/manyget.c
+include teshsuite/smpi/mpich3-test/rma/manyrma2.c
+include teshsuite/smpi/mpich3-test/rma/manyrma3.c
+include teshsuite/smpi/mpich3-test/rma/mcs-mutex.c
+include teshsuite/smpi/mpich3-test/rma/mcs-mutex.h
+include teshsuite/smpi/mpich3-test/rma/mixedsync.c
+include teshsuite/smpi/mpich3-test/rma/mutex_bench.c
+include teshsuite/smpi/mpich3-test/rma/nb_test.c
+include teshsuite/smpi/mpich3-test/rma/nullpscw.c
+include teshsuite/smpi/mpich3-test/rma/overlap_wins_rma.c
+include teshsuite/smpi/mpich3-test/rma/pscw_ordering.c
+include teshsuite/smpi/mpich3-test/rma/put_base.c
+include teshsuite/smpi/mpich3-test/rma/put_bottom.c
+include teshsuite/smpi/mpich3-test/rma/putfence1.c
+include teshsuite/smpi/mpich3-test/rma/putfidx.c
+include teshsuite/smpi/mpich3-test/rma/putpscw1.c
+include teshsuite/smpi/mpich3-test/rma/racc_local_comp.c
+include teshsuite/smpi/mpich3-test/rma/req_example.c
+include teshsuite/smpi/mpich3-test/rma/reqops.c
+include teshsuite/smpi/mpich3-test/rma/rget-testall.c
+include teshsuite/smpi/mpich3-test/rma/rget-unlock.c
+include teshsuite/smpi/mpich3-test/rma/rma-contig.c
+include teshsuite/smpi/mpich3-test/rma/rmanull.c
+include teshsuite/smpi/mpich3-test/rma/rmazero.c
+include teshsuite/smpi/mpich3-test/rma/rput_local_comp.c
+include teshsuite/smpi/mpich3-test/rma/selfrma.c
+include teshsuite/smpi/mpich3-test/rma/squelch.h
+include teshsuite/smpi/mpich3-test/rma/strided_acc_indexed.c
+include teshsuite/smpi/mpich3-test/rma/strided_acc_onelock.c
+include teshsuite/smpi/mpich3-test/rma/strided_acc_subarray.c
+include teshsuite/smpi/mpich3-test/rma/strided_get_indexed.c
+include teshsuite/smpi/mpich3-test/rma/strided_getacc_indexed.c
+include teshsuite/smpi/mpich3-test/rma/strided_getacc_indexed_shared.c
+include teshsuite/smpi/mpich3-test/rma/strided_putget_indexed.c
+include teshsuite/smpi/mpich3-test/rma/strided_putget_indexed_shared.c
+include teshsuite/smpi/mpich3-test/rma/test1.c
+include teshsuite/smpi/mpich3-test/rma/test1_am.c
+include teshsuite/smpi/mpich3-test/rma/test1_dt.c
+include teshsuite/smpi/mpich3-test/rma/test2.c
+include teshsuite/smpi/mpich3-test/rma/test2_am.c
+include teshsuite/smpi/mpich3-test/rma/test3.c
+include teshsuite/smpi/mpich3-test/rma/test3_am.c
+include teshsuite/smpi/mpich3-test/rma/test4.c
+include teshsuite/smpi/mpich3-test/rma/test4_am.c
+include teshsuite/smpi/mpich3-test/rma/test5.c
+include teshsuite/smpi/mpich3-test/rma/test5_am.c
+include teshsuite/smpi/mpich3-test/rma/testlist
+include teshsuite/smpi/mpich3-test/rma/transpose1.c
+include teshsuite/smpi/mpich3-test/rma/transpose2.c
+include teshsuite/smpi/mpich3-test/rma/transpose3.c
+include teshsuite/smpi/mpich3-test/rma/transpose4.c
+include teshsuite/smpi/mpich3-test/rma/transpose5.c
+include teshsuite/smpi/mpich3-test/rma/transpose6.c
+include teshsuite/smpi/mpich3-test/rma/transpose7.c
+include teshsuite/smpi/mpich3-test/rma/win_dynamic_acc.c
+include teshsuite/smpi/mpich3-test/rma/win_flavors.c
+include teshsuite/smpi/mpich3-test/rma/win_info.c
+include teshsuite/smpi/mpich3-test/rma/win_large_shm.c
+include teshsuite/smpi/mpich3-test/rma/win_shared.c
+include teshsuite/smpi/mpich3-test/rma/win_shared_create.c
+include teshsuite/smpi/mpich3-test/rma/win_shared_noncontig.c
+include teshsuite/smpi/mpich3-test/rma/win_shared_noncontig_put.c
+include teshsuite/smpi/mpich3-test/rma/win_shared_put_flush_get.c
+include teshsuite/smpi/mpich3-test/rma/win_shared_rma_flush_load.c
+include teshsuite/smpi/mpich3-test/rma/win_shared_zerobyte.c
+include teshsuite/smpi/mpich3-test/rma/win_zero.c
+include teshsuite/smpi/mpich3-test/rma/wincall.c
+include teshsuite/smpi/mpich3-test/rma/window_creation.c
+include teshsuite/smpi/mpich3-test/rma/winname.c
+include teshsuite/smpi/mpich3-test/rma/wintest.c
+include teshsuite/smpi/mpich3-test/rma/wrma_flush_get.c
+include teshsuite/smpi/mpich3-test/runtests
+include teshsuite/smpi/mpich3-test/testlist
+include teshsuite/smpi/mpich3-test/topo/cartcreates.c
+include teshsuite/smpi/mpich3-test/topo/cartmap1.c
+include teshsuite/smpi/mpich3-test/topo/cartshift1.c
+include teshsuite/smpi/mpich3-test/topo/cartsuball.c
+include teshsuite/smpi/mpich3-test/topo/cartzero.c
+include teshsuite/smpi/mpich3-test/topo/dgraph_unwgt.c
+include teshsuite/smpi/mpich3-test/topo/dims1.c
+include teshsuite/smpi/mpich3-test/topo/dims2.c
+include teshsuite/smpi/mpich3-test/topo/dims3.c
+include teshsuite/smpi/mpich3-test/topo/dims4.c
+include teshsuite/smpi/mpich3-test/topo/dims5.c
+include teshsuite/smpi/mpich3-test/topo/distgraph1.c
+include teshsuite/smpi/mpich3-test/topo/graphcr.c
+include teshsuite/smpi/mpich3-test/topo/graphcr2.c
+include teshsuite/smpi/mpich3-test/topo/graphmap1.c
+include teshsuite/smpi/mpich3-test/topo/neighb_coll.c
+include teshsuite/smpi/mpich3-test/topo/testlist
+include teshsuite/smpi/mpich3-test/topo/topodup.c
+include teshsuite/smpi/mpich3-test/topo/topotest.c
+include teshsuite/smpi/mpich3-test/util/dtypes.c
+include teshsuite/smpi/mpich3-test/util/mtest.c
+include teshsuite/smpi/mpich3-test/util/mtest_datatype.c
+include teshsuite/smpi/mpich3-test/util/mtest_datatype_gen.c
+include teshsuite/smpi/mpich3-test/util/mtestcheck.c
+include teshsuite/smpi/privatization/privatization.c
+include teshsuite/smpi/privatization/privatization.tesh
+include teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.c
+include teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.tesh
+include teshsuite/smpi/pt2pt-pingpong/TI_output.tesh
+include teshsuite/smpi/pt2pt-pingpong/broken_hostfiles.tesh
+include teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.c
+include teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.tesh
+include teshsuite/smpi/timers/timers.c
+include teshsuite/smpi/timers/timers.tesh
+include teshsuite/smpi/type-hvector/type-hvector.c
+include teshsuite/smpi/type-hvector/type-hvector.tesh
+include teshsuite/smpi/type-indexed/type-indexed.c
+include teshsuite/smpi/type-indexed/type-indexed.tesh
+include teshsuite/smpi/type-struct/type-struct.c
+include teshsuite/smpi/type-struct/type-struct.tesh
+include teshsuite/smpi/type-vector/type-vector.c
+include teshsuite/smpi/type-vector/type-vector.tesh
+include teshsuite/surf/lmm_usage/lmm_usage.cpp
+include teshsuite/surf/lmm_usage/lmm_usage.tesh
+include teshsuite/surf/maxmin_bench/maxmin_bench.cpp
+include teshsuite/surf/maxmin_bench/maxmin_bench_large.tesh
+include teshsuite/surf/maxmin_bench/maxmin_bench_medium.tesh
+include teshsuite/surf/maxmin_bench/maxmin_bench_small.tesh
+include teshsuite/surf/surf_usage/surf_usage.cpp
+include teshsuite/surf/surf_usage/surf_usage.tesh
+include teshsuite/surf/surf_usage2/surf_usage2.cpp
+include teshsuite/surf/surf_usage2/surf_usage2.tesh
+include teshsuite/surf/wifi_usage/wifi_usage.cpp
+include teshsuite/surf/wifi_usage/wifi_usage.tesh
+include teshsuite/xbt/cmdline/cmdline.c
+include teshsuite/xbt/cmdline/cmdline.tesh
+include teshsuite/xbt/log_large/log_large.c
+include teshsuite/xbt/log_large/log_large.tesh
+include teshsuite/xbt/log_usage/log_usage.c
+include teshsuite/xbt/log_usage/log_usage.tesh
+include teshsuite/xbt/log_usage/log_usage_ndebug.tesh
+include teshsuite/xbt/mmalloc/mmalloc_32.tesh
+include teshsuite/xbt/mmalloc/mmalloc_64.tesh
+include teshsuite/xbt/mmalloc/mmalloc_test.cpp
+include teshsuite/xbt/parallel_log_crashtest/parallel_log_crashtest.cpp
+include teshsuite/xbt/parallel_log_crashtest/parallel_log_crashtest.tesh
+include teshsuite/xbt/parmap_bench/parmap_bench.cpp
+include teshsuite/xbt/parmap_bench/parmap_bench.tesh
+include teshsuite/xbt/parmap_test/parmap_test.cpp
+include teshsuite/xbt/parmap_test/parmap_test.tesh
+include teshsuite/xbt/signals/signals.cpp
+include teshsuite/xbt/signals/signals.tesh
+include tools/MSG_visualization/colorize.pl
+include tools/MSG_visualization/trace2fig.pl
+include tools/doxygen/fig2dev_postprocessor.pl
+include tools/doxygen/xbt_log_extract_hierarchy.pl
+include tools/fix-paje-trace.sh
+include tools/generate-dwarf-functions
+include tools/graphicator/graphicator.c
+include tools/graphicator/graphicator.tesh
+include tools/normalize-pointers.py
+include tools/pkg-config/simgrid.pc.in
+include tools/sanitizers.supp
+include tools/sg_xml_energy_ponecore_to_pepsilon.py
+include tools/sg_xml_unit_converter.py
+include tools/simgrid.supp
+include tools/simgrid2vite.sed
+include tools/simgrid_convert_TI_traces.py
+include tools/simgrid_update_xml.pl
+include tools/tesh/IO-bigsize.tesh
+include tools/tesh/IO-broken-pipe.tesh
+include tools/tesh/IO-orders.tesh
+include tools/tesh/background.tesh
+include tools/tesh/basic.tesh
+include tools/tesh/bg-basic.tesh
+include tools/tesh/bg-set-signal.tesh
+include tools/tesh/catch-all-bg-output.tesh
+include tools/tesh/catch-return.tesh
+include tools/tesh/catch-signal.tesh
+include tools/tesh/catch-timeout-output.tesh
+include tools/tesh/catch-timeout.tesh
+include tools/tesh/catch-wrong-output.tesh
+include tools/tesh/cd.tesh
+include tools/tesh/color.tesh
+include tools/tesh/generate_tesh
+include tools/tesh/ignore-regexp.tesh
+include tools/tesh/set-output-ignore.tesh
+include tools/tesh/set-output-sort.tesh
+include tools/tesh/set-return.tesh
+include tools/tesh/set-timeout.tesh
+include tools/tesh/setenv.tesh
+include tools/tesh/tesh.py
+include AUTHORS
+include CITATION.bib
+include CMakeLists.txt
+include COPYING
+include ChangeLog
+include FindSimGrid.cmake
+include LICENSE-LGPL-2.1
+include MANIFEST.in
+include MANIFEST.in.in
+include NEWS
+include README.md
+include doc/Doxyfile.in
+include doc/Layout.xml
+include doc/doxygen/FAQ.doc
+include doc/doxygen/inside.doc
+include doc/doxygen/inside_cmake.doc
+include doc/doxygen/inside_extending.doc
+include doc/doxygen/inside_release.doc
+include doc/doxygen/inside_tests.doc
+include doc/doxygen/module-index.doc
+include doc/doxygen/module-sd.doc
+include doc/doxygen/module-surf.doc
+include doc/doxygen/module-trace.doc
+include doc/doxygen/module-xbt.doc
+include doc/doxygen/outcomes_logs.doc
+include doc/doxygen/outcomes_vizu.doc
+include doc/doxygen/platform.doc
+include doc/doxygen/platform_lua.doc
+include doc/doxygen/uhood.doc
+include doc/doxygen/uhood_arch.doc
+include doc/doxygen/uhood_switch.doc
+include docs/Build.sh
+include docs/ignored_symbols
+include docs/manpages/smpicc.1
+include docs/manpages/smpicxx.1
+include docs/manpages/smpif90.1
+include docs/manpages/smpiff.1
+include docs/manpages/smpirun.1
+include docs/manpages/tesh.pod
+include docs/requirements.txt
+include docs/source/Configuring_SimGrid.rst
+include docs/source/Deploying_your_Application.rst
+include docs/source/Doxyfile
+include docs/source/Experimental_Setup.rst
+include docs/source/Installing_SimGrid.rst
+include docs/source/Introduction.rst
+include docs/source/Platform_Examples.rst
+include docs/source/Start_Your_Own_Project.rst
+include docs/source/Tutorial_Algorithms.rst
+include docs/source/Tutorial_MPI_Applications.rst
+include docs/source/XML_Reference.rst
+include docs/source/_ext/hidden_code_block.py
+include docs/source/_templates/breadcrumbs.html
+include docs/source/app_msg.rst
+include docs/source/app_s4u.rst
+include docs/source/app_smpi.rst
+include docs/source/application.rst
+include docs/source/community.rst
+include docs/source/conf.py
+include docs/source/img/eclipseScreenShot.png
+include docs/source/img/extlink.png
+include docs/source/img/extlink.svg
+include docs/source/img/graphical-toc.svg
+include docs/source/img/lang_cpp.png
+include docs/source/img/lang_python.png
+include docs/source/img/smpi_simgrid_alltoall_pair_16.png
+include docs/source/img/smpi_simgrid_alltoall_ring_16.png
+include docs/source/img/zone_hierarchy.png
+include docs/source/index.rst
+include docs/source/models.rst
+include docs/source/ns3.rst
+include docs/source/outcomes.rst
+include docs/source/platform.rst
+include docs/source/platform_howtos.rst
+include docs/source/tuto_s4u/deployment1.xml
+include docs/source/tuto_s4u/deployment2.xml
+include docs/source/tuto_s4u/deployment3.xml
+include docs/source/tuto_s4u/deployment4.xml
+include docs/source/tuto_s4u/draw_gantt.R
+include docs/source/tuto_s4u/img/Rscript-screenshot.png
+include docs/source/tuto_s4u/img/intro.svg
+include docs/source/tuto_s4u/img/question.svg
+include docs/source/tuto_s4u/img/result.png
+include docs/source/tuto_s4u/img/vite-screenshot.png
+include docs/source/tuto_s4u/master-workers-lab1.cpp
+include docs/source/tuto_s4u/master-workers-lab2.cpp
+include docs/source/tuto_s4u/master-workers-lab3.cpp
+include docs/source/tuto_s4u/master-workers-lab4.cpp
+include docs/source/tuto_smpi/3hosts.png
+include docs/source/tuto_smpi/3hosts.xml
+include docs/source/tuto_smpi/gemm_mpi.cpp
+include docs/source/tuto_smpi/img/big-picture.svg
+include docs/source/tuto_smpi/img/lu.S.4.png
+include docs/source/tuto_smpi/roundtrip.c
+include examples/deprecated/java/.classpath
+include examples/deprecated/java/.project
+include examples/deprecated/java/CMakeLists.txt
+include examples/deprecated/msg/CMakeLists.txt
+include examples/deprecated/msg/mc/CMakeLists.txt
+include examples/deprecated/simdag/CMakeLists.txt
+include examples/platforms/bypassASroute.xml
+include examples/platforms/bypassRoute.xml
+include examples/platforms/cloud.xml
+include examples/platforms/cluster_and_one_host.xml
+include examples/platforms/cluster_backbone.xml
+include examples/platforms/cluster_crossbar.xml
+include examples/platforms/cluster_dragonfly.svg
+include examples/platforms/cluster_dragonfly.xml
+include examples/platforms/cluster_fat_tree.svg
+include examples/platforms/cluster_fat_tree.xml
+include examples/platforms/cluster_multi.xml
+include examples/platforms/cluster_prototype.lua
+include examples/platforms/cluster_torus.svg
+include examples/platforms/cluster_torus.xml
+include examples/platforms/config.xml
+include examples/platforms/config_tracing.xml
+include examples/platforms/crosstraffic.xml
+include examples/platforms/data_center.xml
+include examples/platforms/dogbone.xml
+include examples/platforms/energy_cluster.xml
+include examples/platforms/energy_platform.xml
+include examples/platforms/faulty_host.xml
+include examples/platforms/g5k.xml
+include examples/platforms/griffon.xml
+include examples/platforms/hosts_with_disks.xml
+include examples/platforms/meta_cluster.xml
+include examples/platforms/multicore_machine.xml
+include examples/platforms/ns3-big-cluster.xml
+include examples/platforms/onelink.xml
+include examples/platforms/optorsim/gridpp_grid_2004.conf
+include examples/platforms/optorsim/lcg_sept2004_grid.conf
+include examples/platforms/optorsim/transform_optorsim_platform.pl
+include examples/platforms/profiles/bourassa_state.profile
+include examples/platforms/profiles/fafard_state.profile
+include examples/platforms/profiles/faulty_host.profile
+include examples/platforms/profiles/ginette_state.profile
+include examples/platforms/profiles/jupiter_speed.profile
+include examples/platforms/profiles/jupiter_state.profile
+include examples/platforms/profiles/link1_bandwidth.profile
+include examples/platforms/profiles/link1_latency.profile
+include examples/platforms/profiles/link3_state.profile
+include examples/platforms/profiles/link4_state.profile
+include examples/platforms/profiles/trace_A.txt
+include examples/platforms/profiles/trace_A_failure.txt
+include examples/platforms/profiles/trace_B.txt
+include examples/platforms/prop.xml
+include examples/platforms/routing_cluster.lua
+include examples/platforms/routing_cluster.xml
+include examples/platforms/routing_none.xml
+include examples/platforms/simulacrum_7_hosts.xml
+include examples/platforms/small_platform.lua
+include examples/platforms/small_platform.xml
+include examples/platforms/small_platform_constant.xml
+include examples/platforms/small_platform_failures.xml
+include examples/platforms/small_platform_fatpipe.xml
+include examples/platforms/small_platform_one_link_routes.xml
+include examples/platforms/small_platform_profile.xml
+include examples/platforms/small_platform_with_routers.xml
+include examples/platforms/storage/content/small_content.txt
+include examples/platforms/storage/content/storage_content.txt
+include examples/platforms/storage/remote_io.xml
+include examples/platforms/storage/storage.xml
+include examples/platforms/syscoord/generate_peer_platform.pl
+include examples/platforms/syscoord/median_harvard.syscoord
+include examples/platforms/syscoord/median_meridian.syscoord
+include examples/platforms/syscoord/median_p2psim.syscoord
+include examples/platforms/three_multicore_hosts.xml
+include examples/platforms/two_hosts.xml
+include examples/platforms/two_hosts_platform_shared.xml
+include examples/platforms/two_hosts_platform_with_availability_included.xml
+include examples/platforms/two_hosts_profiles.xml
+include examples/platforms/two_peers.xml
+include examples/platforms/vivaldi.xml
+include examples/platforms/wifi.xml
+include examples/python/CMakeLists.txt
+include examples/python/actor-create/actor-create_d.xml
+include examples/python/actor-lifetime/actor-lifetime.py
+include examples/python/actor-lifetime/actor-lifetime.tesh
+include examples/python/actor-lifetime/actor-lifetime_d.xml
+include examples/python/async-wait/async-wait_d.xml
+include examples/python/async-waitall/async-waitall_d.xml
+include examples/python/async-waitany/async-waitany_d.xml
+include examples/s4u/CMakeLists.txt
+include examples/smpi/CMakeLists.txt
+include examples/smpi/NAS/CMakeLists.txt
+include examples/smpi/mc/non_deterministic.tesh
+include examples/smpi/mc/only_send_deterministic.tesh
+include examples/smpi/replay_multiple/CMakeLists.txt
+include examples/smpi/replay_multiple_manual_deploy/CMakeLists.txt
+include examples/smpi/smpi_msg_masterslave/CMakeLists.txt
+include include/simgrid/Exception.hpp
+include include/simgrid/actor.h
+include include/simgrid/barrier.h
+include include/simgrid/chrono.hpp
+include include/simgrid/cond.h
+include include/simgrid/config.h.in
+include include/simgrid/engine.h
+include include/simgrid/forward.h
+include include/simgrid/host.h
+include include/simgrid/instr.h
+include include/simgrid/jedule/jedule.hpp
+include include/simgrid/jedule/jedule_events.hpp
+include include/simgrid/jedule/jedule_platform.hpp
+include include/simgrid/jedule/jedule_sd_binding.h
+include include/simgrid/kernel/future.hpp
+include include/simgrid/kernel/resource/Action.hpp
+include include/simgrid/kernel/resource/Model.hpp
+include include/simgrid/kernel/resource/Resource.hpp
+include include/simgrid/kernel/routing/ClusterZone.hpp
+include include/simgrid/kernel/routing/DijkstraZone.hpp
+include include/simgrid/kernel/routing/DragonflyZone.hpp
+include include/simgrid/kernel/routing/EmptyZone.hpp
+include include/simgrid/kernel/routing/FatTreeZone.hpp
+include include/simgrid/kernel/routing/FloydZone.hpp
+include include/simgrid/kernel/routing/FullZone.hpp
+include include/simgrid/kernel/routing/NetPoint.hpp
+include include/simgrid/kernel/routing/NetZoneImpl.hpp
+include include/simgrid/kernel/routing/RoutedZone.hpp
+include include/simgrid/kernel/routing/TorusZone.hpp
+include include/simgrid/kernel/routing/VivaldiZone.hpp
+include include/simgrid/link.h
+include include/simgrid/mailbox.h
+include include/simgrid/modelchecker.h
+include include/simgrid/msg.h
+include include/simgrid/mutex.h
+include include/simgrid/plugins/dvfs.h
+include include/simgrid/plugins/energy.h
+include include/simgrid/plugins/file_system.h
+include include/simgrid/plugins/live_migration.h
+include include/simgrid/plugins/load.h
+include include/simgrid/plugins/load_balancer.h
+include include/simgrid/s4u.hpp
+include include/simgrid/s4u/Activity.hpp
+include include/simgrid/s4u/Actor.hpp
+include include/simgrid/s4u/Barrier.hpp
+include include/simgrid/s4u/Comm.hpp
+include include/simgrid/s4u/ConditionVariable.hpp
+include include/simgrid/s4u/Disk.hpp
+include include/simgrid/s4u/Engine.hpp
+include include/simgrid/s4u/Exec.hpp
+include include/simgrid/s4u/Host.hpp
+include include/simgrid/s4u/Io.hpp
+include include/simgrid/s4u/Link.hpp
+include include/simgrid/s4u/Mailbox.hpp
+include include/simgrid/s4u/Mutex.hpp
+include include/simgrid/s4u/NetZone.hpp
+include include/simgrid/s4u/Semaphore.hpp
+include include/simgrid/s4u/Storage.hpp
+include include/simgrid/s4u/VirtualMachine.hpp
+include include/simgrid/semaphore.h
+include include/simgrid/simdag.h
+include include/simgrid/simix.h
+include include/simgrid/simix.hpp
+include include/simgrid/simix/blocking_simcall.hpp
+include include/simgrid/smpi/replay.hpp
+include include/simgrid/storage.h
+include include/simgrid/vm.h
+include include/simgrid/zone.h
+include include/simgrid_config.h
+include include/smpi/forward.hpp
+include include/smpi/mpi.h
+include include/smpi/mpif.h.in
+include include/smpi/sampi.h
+include include/smpi/smpi.h
+include include/smpi/smpi_extended_traces.h
+include include/smpi/smpi_extended_traces_fortran.h
+include include/smpi/smpi_helpers.h
+include include/smpi/smpi_helpers_internal.h
+include include/smpi/smpi_main.h
+include include/xbt.h
+include include/xbt/Extendable.hpp
+include include/xbt/RngStream.h
+include include/xbt/asserts.h
+include include/xbt/automaton.h
+include include/xbt/automaton.hpp
+include include/xbt/backtrace.hpp
+include include/xbt/base.h
+include include/xbt/config.h
+include include/xbt/config.hpp
+include include/xbt/dict.h
+include include/xbt/dynar.h
+include include/xbt/ex.h
+include include/xbt/file.hpp
+include include/xbt/function_types.h
+include include/xbt/functional.hpp
+include include/xbt/future.hpp
+include include/xbt/graph.h
+include include/xbt/log.h
+include include/xbt/log.hpp
+include include/xbt/mallocator.h
+include include/xbt/misc.h
+include include/xbt/module.h
+include include/xbt/parmap.h
+include include/xbt/range.hpp
+include include/xbt/replay.hpp
+include include/xbt/signal.hpp
+include include/xbt/str.h
+include include/xbt/string.hpp
+include include/xbt/synchro.h
+include include/xbt/sysdep.h
+include include/xbt/system_error.hpp
+include include/xbt/utility.hpp
+include include/xbt/virtu.h
+include include/xbt/xbt_os_time.h
+include setup.py
+include src/bindings/java/JavaContext.cpp
+include src/bindings/java/JavaContext.hpp
+include src/bindings/java/MANIFEST.in
+include src/bindings/java/jmsg.cpp
+include src/bindings/java/jmsg.hpp
+include src/bindings/java/jmsg_as.cpp
+include src/bindings/java/jmsg_as.hpp
+include src/bindings/java/jmsg_comm.cpp
+include src/bindings/java/jmsg_comm.h
+include src/bindings/java/jmsg_file.cpp
+include src/bindings/java/jmsg_file.h
+include src/bindings/java/jmsg_host.cpp
+include src/bindings/java/jmsg_host.h
+include src/bindings/java/jmsg_process.cpp
+include src/bindings/java/jmsg_process.h
+include src/bindings/java/jmsg_rngstream.cpp
+include src/bindings/java/jmsg_rngstream.h
+include src/bindings/java/jmsg_storage.cpp
+include src/bindings/java/jmsg_storage.h
+include src/bindings/java/jmsg_synchro.cpp
+include src/bindings/java/jmsg_synchro.h
+include src/bindings/java/jmsg_task.cpp
+include src/bindings/java/jmsg_task.h
+include src/bindings/java/jmsg_vm.cpp
+include src/bindings/java/jmsg_vm.h
+include src/bindings/java/jtrace.cpp
+include src/bindings/java/jtrace.h
+include src/bindings/java/jxbt_utilities.cpp
+include src/bindings/java/jxbt_utilities.hpp
+include src/bindings/java/org/simgrid/NativeLib.java
+include src/bindings/java/org/simgrid/msg/As.java
+include src/bindings/java/org/simgrid/msg/Comm.java
+include src/bindings/java/org/simgrid/msg/File.java
+include src/bindings/java/org/simgrid/msg/Host.java
+include src/bindings/java/org/simgrid/msg/HostFailureException.java
+include src/bindings/java/org/simgrid/msg/HostNotFoundException.java
+include src/bindings/java/org/simgrid/msg/JniException.java
+include src/bindings/java/org/simgrid/msg/Msg.java
+include src/bindings/java/org/simgrid/msg/MsgException.java
+include src/bindings/java/org/simgrid/msg/Mutex.java
+include src/bindings/java/org/simgrid/msg/Process.java
+include src/bindings/java/org/simgrid/msg/ProcessKilledError.java
+include src/bindings/java/org/simgrid/msg/ProcessNotFoundException.java
+include src/bindings/java/org/simgrid/msg/RngStream.java
+include src/bindings/java/org/simgrid/msg/Semaphore.java
+include src/bindings/java/org/simgrid/msg/Storage.java
+include src/bindings/java/org/simgrid/msg/StorageNotFoundException.java
+include src/bindings/java/org/simgrid/msg/Task.java
+include src/bindings/java/org/simgrid/msg/TaskCancelledException.java
+include src/bindings/java/org/simgrid/msg/TimeoutException.java
+include src/bindings/java/org/simgrid/msg/TransferFailureException.java
+include src/bindings/java/org/simgrid/msg/VM.java
+include src/bindings/java/org/simgrid/trace/Trace.java
+include src/bindings/lua/lua_host.cpp
+include src/bindings/lua/lua_platf.cpp
+include src/bindings/lua/lua_private.hpp
+include src/bindings/lua/lua_utils.cpp
+include src/bindings/lua/lua_utils.hpp
+include src/bindings/lua/simgrid_lua.cpp
+include src/bindings/lua/simgrid_lua.hpp
+include src/bindings/python/simgrid_python.cpp
+include src/include/catch.hpp
+include src/include/mc/datatypes.h
+include src/include/mc/mc.h
+include src/include/simgrid/sg_config.hpp
+include src/include/surf/surf.hpp
+include src/include/xbt/coverage.h
+include src/include/xbt/mmalloc.h
+include src/include/xbt/parmap.hpp
+include src/include/xxhash.hpp
+include src/instr/instr_config.cpp
+include src/instr/instr_interface.cpp
+include src/instr/instr_paje_containers.cpp
+include src/instr/instr_paje_containers.hpp
+include src/instr/instr_paje_events.cpp
+include src/instr/instr_paje_events.hpp
+include src/instr/instr_paje_header.cpp
+include src/instr/instr_paje_trace.cpp
+include src/instr/instr_paje_types.cpp
+include src/instr/instr_paje_types.hpp
+include src/instr/instr_paje_values.cpp
+include src/instr/instr_paje_values.hpp
+include src/instr/instr_platform.cpp
+include src/instr/instr_private.hpp
+include src/instr/instr_resource_utilization.cpp
+include src/instr/instr_smpi.hpp
+include src/instr/jedule/jedule.cpp
+include src/instr/jedule/jedule_events.cpp
+include src/instr/jedule/jedule_platform.cpp
+include src/instr/jedule/jedule_sd_binding.cpp
+include src/internal_config.h.in
+include src/kernel/EngineImpl.cpp
+include src/kernel/EngineImpl.hpp
+include src/kernel/activity/ActivityImpl.cpp
+include src/kernel/activity/ActivityImpl.hpp
+include src/kernel/activity/CommImpl.cpp
+include src/kernel/activity/CommImpl.hpp
+include src/kernel/activity/ConditionVariableImpl.cpp
+include src/kernel/activity/ConditionVariableImpl.hpp
+include src/kernel/activity/ExecImpl.cpp
+include src/kernel/activity/ExecImpl.hpp
+include src/kernel/activity/IoImpl.cpp
+include src/kernel/activity/IoImpl.hpp
+include src/kernel/activity/MailboxImpl.cpp
+include src/kernel/activity/MailboxImpl.hpp
+include src/kernel/activity/MutexImpl.cpp
+include src/kernel/activity/MutexImpl.hpp
+include src/kernel/activity/SemaphoreImpl.cpp
+include src/kernel/activity/SemaphoreImpl.hpp
+include src/kernel/activity/SleepImpl.cpp
+include src/kernel/activity/SleepImpl.hpp
+include src/kernel/activity/SynchroRaw.cpp
+include src/kernel/activity/SynchroRaw.hpp
+include src/kernel/actor/ActorImpl.cpp
+include src/kernel/actor/ActorImpl.hpp
+include src/kernel/context/Context.cpp
+include src/kernel/context/Context.hpp
+include src/kernel/context/ContextBoost.cpp
+include src/kernel/context/ContextBoost.hpp
+include src/kernel/context/ContextRaw.cpp
+include src/kernel/context/ContextRaw.hpp
+include src/kernel/context/ContextSwapped.cpp
+include src/kernel/context/ContextSwapped.hpp
+include src/kernel/context/ContextThread.cpp
+include src/kernel/context/ContextThread.hpp
+include src/kernel/context/ContextUnix.cpp
+include src/kernel/context/ContextUnix.hpp
+include src/kernel/context/context_private.hpp
+include src/kernel/future.cpp
+include src/kernel/lmm/fair_bottleneck.cpp
+include src/kernel/lmm/maxmin.cpp
+include src/kernel/lmm/maxmin.hpp
+include src/kernel/lmm/maxmin_test.cpp
+include src/kernel/resource/Action.cpp
+include src/kernel/resource/DiskImpl.cpp
+include src/kernel/resource/DiskImpl.hpp
+include src/kernel/resource/Model.cpp
+include src/kernel/resource/Resource.cpp
+include src/kernel/resource/profile/DatedValue.cpp
+include src/kernel/resource/profile/DatedValue.hpp
+include src/kernel/resource/profile/Event.hpp
+include src/kernel/resource/profile/FutureEvtSet.cpp
+include src/kernel/resource/profile/FutureEvtSet.hpp
+include src/kernel/resource/profile/Profile.cpp
+include src/kernel/resource/profile/Profile.hpp
+include src/kernel/resource/profile/Profile_test.cpp
+include src/kernel/routing/ClusterZone.cpp
+include src/kernel/routing/DijkstraZone.cpp
+include src/kernel/routing/DragonflyZone.cpp
+include src/kernel/routing/EmptyZone.cpp
+include src/kernel/routing/FatTreeZone.cpp
+include src/kernel/routing/FloydZone.cpp
+include src/kernel/routing/FullZone.cpp
+include src/kernel/routing/NetPoint.cpp
+include src/kernel/routing/NetZoneImpl.cpp
+include src/kernel/routing/RoutedZone.cpp
+include src/kernel/routing/TorusZone.cpp
+include src/kernel/routing/VivaldiZone.cpp
+include src/mc/AddressSpace.hpp
+include src/mc/ModelChecker.cpp
+include src/mc/ModelChecker.hpp
+include src/mc/Session.cpp
+include src/mc/Session.hpp
+include src/mc/Transition.hpp
+include src/mc/VisitedState.cpp
+include src/mc/VisitedState.hpp
+include src/mc/checker/Checker.cpp
+include src/mc/checker/Checker.hpp
+include src/mc/checker/CommunicationDeterminismChecker.cpp
+include src/mc/checker/CommunicationDeterminismChecker.hpp
+include src/mc/checker/LivenessChecker.cpp
+include src/mc/checker/LivenessChecker.hpp
+include src/mc/checker/SafetyChecker.cpp
+include src/mc/checker/SafetyChecker.hpp
+include src/mc/checker/SimcallInspector.hpp
+include src/mc/checker/simgrid_mc.cpp
+include src/mc/compare.cpp
+include src/mc/inspect/DwarfExpression.cpp
+include src/mc/inspect/DwarfExpression.hpp
+include src/mc/inspect/Frame.cpp
+include src/mc/inspect/Frame.hpp
+include src/mc/inspect/LocationList.cpp
+include src/mc/inspect/LocationList.hpp
+include src/mc/inspect/ObjectInformation.cpp
+include src/mc/inspect/ObjectInformation.hpp
+include src/mc/inspect/Type.hpp
+include src/mc/inspect/Variable.hpp
+include src/mc/inspect/mc_dwarf.cpp
+include src/mc/inspect/mc_dwarf.hpp
+include src/mc/inspect/mc_dwarf_attrnames.cpp
+include src/mc/inspect/mc_dwarf_tagnames.cpp
+include src/mc/inspect/mc_member.cpp
+include src/mc/inspect/mc_unw.cpp
+include src/mc/inspect/mc_unw.hpp
+include src/mc/inspect/mc_unw_vmread.cpp
+include src/mc/mc_base.cpp
+include src/mc/mc_base.h
+include src/mc/mc_client_api.cpp
+include src/mc/mc_comm_pattern.cpp
+include src/mc/mc_comm_pattern.hpp
+include src/mc/mc_config.cpp
+include src/mc/mc_config.hpp
+include src/mc/mc_exit.hpp
+include src/mc/mc_forward.hpp
+include src/mc/mc_global.cpp
+include src/mc/mc_hash.cpp
+include src/mc/mc_hash.hpp
+include src/mc/mc_ignore.hpp
+include src/mc/mc_memory.cpp
+include src/mc/mc_mmu.hpp
+include src/mc/mc_private.hpp
+include src/mc/mc_record.cpp
+include src/mc/mc_record.hpp
+include src/mc/mc_replay.hpp
+include src/mc/mc_request.cpp
+include src/mc/mc_request.hpp
+include src/mc/mc_safety.hpp
+include src/mc/mc_smx.cpp
+include src/mc/mc_smx.hpp
+include src/mc/mc_state.cpp
+include src/mc/mc_state.hpp
+include src/mc/remote/Channel.cpp
+include src/mc/remote/Channel.hpp
+include src/mc/remote/Client.cpp
+include src/mc/remote/Client.hpp
+include src/mc/remote/RemoteClient.cpp
+include src/mc/remote/RemoteClient.hpp
+include src/mc/remote/RemotePtr.hpp
+include src/mc/remote/mc_protocol.cpp
+include src/mc/remote/mc_protocol.h
+include src/mc/sosp/ChunkedData.cpp
+include src/mc/sosp/ChunkedData.hpp
+include src/mc/sosp/PageStore.cpp
+include src/mc/sosp/PageStore.hpp
+include src/mc/sosp/PageStore_test.cpp
+include src/mc/sosp/Region.cpp
+include src/mc/sosp/Region.hpp
+include src/mc/sosp/Snapshot.cpp
+include src/mc/sosp/Snapshot.hpp
+include src/mc/sosp/Snapshot_test.cpp
+include src/msg/msg_comm.cpp
+include src/msg/msg_global.cpp
+include src/msg/msg_legacy.cpp
+include src/msg/msg_private.hpp
+include src/msg/msg_process.cpp
+include src/msg/msg_task.cpp
+include src/plugins/dirty_page_tracking.cpp
+include src/plugins/file_system/s4u_FileSystem.cpp
+include src/plugins/host_dvfs.cpp
+include src/plugins/host_energy.cpp
+include src/plugins/host_load.cpp
+include src/plugins/link_energy.cpp
+include src/plugins/vm/VirtualMachineImpl.cpp
+include src/plugins/vm/VirtualMachineImpl.hpp
+include src/plugins/vm/VmHostExt.cpp
+include src/plugins/vm/VmHostExt.hpp
+include src/plugins/vm/VmLiveMigration.cpp
+include src/plugins/vm/VmLiveMigration.hpp
+include src/plugins/vm/s4u_VirtualMachine.cpp
+include src/s4u/s4u_Activity.cpp
+include src/s4u/s4u_Actor.cpp
+include src/s4u/s4u_Barrier.cpp
+include src/s4u/s4u_Comm.cpp
+include src/s4u/s4u_ConditionVariable.cpp
+include src/s4u/s4u_Disk.cpp
+include src/s4u/s4u_Engine.cpp
+include src/s4u/s4u_Exec.cpp
+include src/s4u/s4u_Host.cpp
+include src/s4u/s4u_Io.cpp
+include src/s4u/s4u_Link.cpp
+include src/s4u/s4u_Mailbox.cpp
+include src/s4u/s4u_Mutex.cpp
+include src/s4u/s4u_Netzone.cpp
+include src/s4u/s4u_Semaphore.cpp
+include src/s4u/s4u_Storage.cpp
+include src/simdag/dax.dtd
+include src/simdag/dax_dtd.c
+include src/simdag/dax_dtd.h
+include src/simdag/sd_daxloader.cpp
+include src/simdag/sd_dotloader.cpp
+include src/simdag/sd_global.cpp
+include src/simdag/sd_task.cpp
+include src/simdag/simdag_private.hpp
+include src/simgrid/Exception.cpp
+include src/simgrid/sg_config.cpp
+include src/simgrid/util.hpp
+include src/simgrid/version.h.in
+include src/simix/libsmx.cpp
+include src/simix/popping.cpp
+include src/simix/popping_accessors.hpp
+include src/simix/popping_bodies.cpp
+include src/simix/popping_enum.h
+include src/simix/popping_generated.cpp
+include src/simix/popping_private.hpp
+include src/simix/simcalls.in
+include src/simix/simcalls.py
+include src/simix/smx_context.cpp
+include src/simix/smx_deployment.cpp
+include src/simix/smx_global.cpp
+include src/simix/smx_private.hpp
+include src/smpi/bindings/smpi_f77.cpp
+include src/smpi/bindings/smpi_f77_coll.cpp
+include src/smpi/bindings/smpi_f77_comm.cpp
+include src/smpi/bindings/smpi_f77_request.cpp
+include src/smpi/bindings/smpi_f77_type.cpp
+include src/smpi/bindings/smpi_mpi.cpp
+include src/smpi/bindings/smpi_pmpi.cpp
+include src/smpi/bindings/smpi_pmpi_coll.cpp
+include src/smpi/bindings/smpi_pmpi_comm.cpp
+include src/smpi/bindings/smpi_pmpi_file.cpp
+include src/smpi/bindings/smpi_pmpi_group.cpp
+include src/smpi/bindings/smpi_pmpi_info.cpp
+include src/smpi/bindings/smpi_pmpi_op.cpp
+include src/smpi/bindings/smpi_pmpi_request.cpp
+include src/smpi/bindings/smpi_pmpi_topo.cpp
+include src/smpi/bindings/smpi_pmpi_type.cpp
+include src/smpi/bindings/smpi_pmpi_win.cpp
+include src/smpi/colls/allgather/allgather-2dmesh.cpp
+include src/smpi/colls/allgather/allgather-3dmesh.cpp
+include src/smpi/colls/allgather/allgather-GB.cpp
+include src/smpi/colls/allgather/allgather-NTSLR-NB.cpp
+include src/smpi/colls/allgather/allgather-NTSLR.cpp
+include src/smpi/colls/allgather/allgather-SMP-NTS.cpp
+include src/smpi/colls/allgather/allgather-bruck.cpp
+include src/smpi/colls/allgather/allgather-loosely-lr.cpp
+include src/smpi/colls/allgather/allgather-mvapich-smp.cpp
+include src/smpi/colls/allgather/allgather-ompi-neighborexchange.cpp
+include src/smpi/colls/allgather/allgather-pair.cpp
+include src/smpi/colls/allgather/allgather-rdb.cpp
+include src/smpi/colls/allgather/allgather-rhv.cpp
+include src/smpi/colls/allgather/allgather-ring.cpp
+include src/smpi/colls/allgather/allgather-smp-simple.cpp
+include src/smpi/colls/allgather/allgather-spreading-simple.cpp
+include src/smpi/colls/allgatherv/allgatherv-GB.cpp
+include src/smpi/colls/allgatherv/allgatherv-mpich-rdb.cpp
+include src/smpi/colls/allgatherv/allgatherv-mpich-ring.cpp
+include src/smpi/colls/allgatherv/allgatherv-ompi-bruck.cpp
+include src/smpi/colls/allgatherv/allgatherv-ompi-neighborexchange.cpp
+include src/smpi/colls/allgatherv/allgatherv-pair.cpp
+include src/smpi/colls/allgatherv/allgatherv-ring.cpp
+include src/smpi/colls/allreduce/allreduce-lr.cpp
+include src/smpi/colls/allreduce/allreduce-mvapich-rs.cpp
+include src/smpi/colls/allreduce/allreduce-mvapich-two-level.cpp
+include src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp
+include src/smpi/colls/allreduce/allreduce-rab-rdb.cpp
+include src/smpi/colls/allreduce/allreduce-rab1.cpp
+include src/smpi/colls/allreduce/allreduce-rab2.cpp
+include src/smpi/colls/allreduce/allreduce-rdb.cpp
+include src/smpi/colls/allreduce/allreduce-redbcast.cpp
+include src/smpi/colls/allreduce/allreduce-smp-binomial-pipeline.cpp
+include src/smpi/colls/allreduce/allreduce-smp-binomial.cpp
+include src/smpi/colls/allreduce/allreduce-smp-rdb.cpp
+include src/smpi/colls/allreduce/allreduce-smp-rsag-lr.cpp
+include src/smpi/colls/allreduce/allreduce-smp-rsag-rab.cpp
+include src/smpi/colls/allreduce/allreduce-smp-rsag.cpp
+include src/smpi/colls/alltoall/alltoall-2dmesh.cpp
+include src/smpi/colls/alltoall/alltoall-3dmesh.cpp
+include src/smpi/colls/alltoall/alltoall-basic-linear.cpp
+include src/smpi/colls/alltoall/alltoall-bruck.cpp
+include src/smpi/colls/alltoall/alltoall-mvapich-scatter-dest.cpp
+include src/smpi/colls/alltoall/alltoall-pair-light-barrier.cpp
+include src/smpi/colls/alltoall/alltoall-pair-mpi-barrier.cpp
+include src/smpi/colls/alltoall/alltoall-pair-one-barrier.cpp
+include src/smpi/colls/alltoall/alltoall-pair.cpp
+include src/smpi/colls/alltoall/alltoall-rdb.cpp
+include src/smpi/colls/alltoall/alltoall-ring-light-barrier.cpp
+include src/smpi/colls/alltoall/alltoall-ring-mpi-barrier.cpp
+include src/smpi/colls/alltoall/alltoall-ring-one-barrier.cpp
+include src/smpi/colls/alltoall/alltoall-ring.cpp
+include src/smpi/colls/alltoallv/alltoallv-bruck.cpp
+include src/smpi/colls/alltoallv/alltoallv-ompi-basic-linear.cpp
+include src/smpi/colls/alltoallv/alltoallv-pair-light-barrier.cpp
+include src/smpi/colls/alltoallv/alltoallv-pair-mpi-barrier.cpp
+include src/smpi/colls/alltoallv/alltoallv-pair-one-barrier.cpp
+include src/smpi/colls/alltoallv/alltoallv-pair.cpp
+include src/smpi/colls/alltoallv/alltoallv-ring-light-barrier.cpp
+include src/smpi/colls/alltoallv/alltoallv-ring-mpi-barrier.cpp
+include src/smpi/colls/alltoallv/alltoallv-ring-one-barrier.cpp
+include src/smpi/colls/alltoallv/alltoallv-ring.cpp
+include src/smpi/colls/barrier/barrier-mpich-smp.cpp
+include src/smpi/colls/barrier/barrier-mvapich2-pair.cpp
+include src/smpi/colls/barrier/barrier-ompi.cpp
+include src/smpi/colls/bcast/bcast-NTSB.cpp
+include src/smpi/colls/bcast/bcast-NTSL-Isend.cpp
+include src/smpi/colls/bcast/bcast-NTSL.cpp
+include src/smpi/colls/bcast/bcast-SMP-binary.cpp
+include src/smpi/colls/bcast/bcast-SMP-binomial.cpp
+include src/smpi/colls/bcast/bcast-SMP-linear.cpp
+include src/smpi/colls/bcast/bcast-arrival-pattern-aware-wait.cpp
+include src/smpi/colls/bcast/bcast-arrival-pattern-aware.cpp
+include src/smpi/colls/bcast/bcast-arrival-scatter.cpp
+include src/smpi/colls/bcast/bcast-binomial-tree.cpp
+include src/smpi/colls/bcast/bcast-flattree-pipeline.cpp
+include src/smpi/colls/bcast/bcast-flattree.cpp
+include src/smpi/colls/bcast/bcast-mvapich-smp.cpp
+include src/smpi/colls/bcast/bcast-ompi-pipeline.cpp
+include src/smpi/colls/bcast/bcast-ompi-split-bintree.cpp
+include src/smpi/colls/bcast/bcast-scatter-LR-allgather.cpp
+include src/smpi/colls/bcast/bcast-scatter-rdb-allgather.cpp
+include src/smpi/colls/coll_tuned_topo.cpp
+include src/smpi/colls/coll_tuned_topo.hpp
+include src/smpi/colls/colls_global.cpp
+include src/smpi/colls/colls_private.hpp
+include src/smpi/colls/gather/gather-mvapich.cpp
+include src/smpi/colls/gather/gather-ompi.cpp
+include src/smpi/colls/reduce/reduce-NTSL.cpp
+include src/smpi/colls/reduce/reduce-arrival-pattern-aware.cpp
+include src/smpi/colls/reduce/reduce-binomial.cpp
+include src/smpi/colls/reduce/reduce-flat-tree.cpp
+include src/smpi/colls/reduce/reduce-mvapich-knomial.cpp
+include src/smpi/colls/reduce/reduce-mvapich-two-level.cpp
+include src/smpi/colls/reduce/reduce-ompi.cpp
+include src/smpi/colls/reduce/reduce-rab.cpp
+include src/smpi/colls/reduce/reduce-scatter-gather.cpp
+include src/smpi/colls/reduce_scatter/reduce_scatter-mpich.cpp
+include src/smpi/colls/reduce_scatter/reduce_scatter-ompi.cpp
+include src/smpi/colls/scatter/scatter-mvapich-two-level.cpp
+include src/smpi/colls/scatter/scatter-ompi.cpp
+include src/smpi/colls/smpi_automatic_selector.cpp
+include src/smpi/colls/smpi_coll.cpp
+include src/smpi/colls/smpi_default_selector.cpp
+include src/smpi/colls/smpi_intel_mpi_selector.cpp
+include src/smpi/colls/smpi_mpich_selector.cpp
+include src/smpi/colls/smpi_mvapich2_selector.cpp
+include src/smpi/colls/smpi_mvapich2_selector_stampede.hpp
+include src/smpi/colls/smpi_nbc_impl.cpp
+include src/smpi/colls/smpi_openmpi_selector.cpp
+include src/smpi/include/private.hpp
+include src/smpi/include/smpi_actor.hpp
+include src/smpi/include/smpi_coll.hpp
+include src/smpi/include/smpi_comm.hpp
+include src/smpi/include/smpi_datatype.hpp
+include src/smpi/include/smpi_datatype_derived.hpp
+include src/smpi/include/smpi_errhandler.hpp
+include src/smpi/include/smpi_f2c.hpp
+include src/smpi/include/smpi_file.hpp
+include src/smpi/include/smpi_group.hpp
+include src/smpi/include/smpi_host.hpp
+include src/smpi/include/smpi_info.hpp
+include src/smpi/include/smpi_keyvals.hpp
+include src/smpi/include/smpi_op.hpp
+include src/smpi/include/smpi_request.hpp
+include src/smpi/include/smpi_status.hpp
+include src/smpi/include/smpi_topo.hpp
+include src/smpi/include/smpi_utils.hpp
+include src/smpi/include/smpi_win.hpp
+include src/smpi/internals/instr_smpi.cpp
+include src/smpi/internals/smpi_actor.cpp
+include src/smpi/internals/smpi_bench.cpp
+include src/smpi/internals/smpi_deployment.cpp
+include src/smpi/internals/smpi_global.cpp
+include src/smpi/internals/smpi_host.cpp
+include src/smpi/internals/smpi_memory.cpp
+include src/smpi/internals/smpi_replay.cpp
+include src/smpi/internals/smpi_shared.cpp
+include src/smpi/internals/smpi_utils.cpp
+include src/smpi/mpi/smpi_comm.cpp
+include src/smpi/mpi/smpi_datatype.cpp
+include src/smpi/mpi/smpi_datatype_derived.cpp
+include src/smpi/mpi/smpi_errhandler.cpp
+include src/smpi/mpi/smpi_f2c.cpp
+include src/smpi/mpi/smpi_file.cpp
+include src/smpi/mpi/smpi_group.cpp
+include src/smpi/mpi/smpi_info.cpp
+include src/smpi/mpi/smpi_keyvals.cpp
+include src/smpi/mpi/smpi_op.cpp
+include src/smpi/mpi/smpi_request.cpp
+include src/smpi/mpi/smpi_status.cpp
+include src/smpi/mpi/smpi_topo.cpp
+include src/smpi/mpi/smpi_win.cpp
+include src/smpi/plugins/ampi/ampi.cpp
+include src/smpi/plugins/ampi/ampi.hpp
+include src/smpi/plugins/ampi/instr_ampi.cpp
+include src/smpi/plugins/ampi/instr_ampi.hpp
+include src/smpi/plugins/load_balancer/LoadBalancer.cpp
+include src/smpi/plugins/load_balancer/load_balancer.hpp
+include src/smpi/plugins/sampi_loadbalancer.cpp
+include src/smpi/smpi_main.c
+include src/smpi/smpi_replay_main.cpp
+include src/smpi/smpicc.in
+include src/smpi/smpicxx.in
+include src/smpi/smpif90.in
+include src/smpi/smpiff.in
+include src/smpi/smpirun.in
+include src/smpi/smpitools.sh
+include src/surf/HostImpl.cpp
+include src/surf/HostImpl.hpp
+include src/surf/PropertyHolder.cpp
+include src/surf/PropertyHolder.hpp
+include src/surf/StorageImpl.cpp
+include src/surf/StorageImpl.hpp
+include src/surf/cpu_cas01.cpp
+include src/surf/cpu_cas01.hpp
+include src/surf/cpu_interface.cpp
+include src/surf/cpu_interface.hpp
+include src/surf/cpu_ti.cpp
+include src/surf/cpu_ti.hpp
+include src/surf/disk_s19.cpp
+include src/surf/disk_s19.hpp
+include src/surf/host_clm03.cpp
+include src/surf/host_clm03.hpp
+include src/surf/network_cm02.cpp
+include src/surf/network_cm02.hpp
+include src/surf/network_constant.cpp
+include src/surf/network_constant.hpp
+include src/surf/network_ib.cpp
+include src/surf/network_ib.hpp
+include src/surf/network_interface.cpp
+include src/surf/network_interface.hpp
+include src/surf/network_ns3.cpp
+include src/surf/network_ns3.hpp
+include src/surf/network_smpi.cpp
+include src/surf/network_smpi.hpp
+include src/surf/ns3/ns3_simulator.cpp
+include src/surf/ns3/ns3_simulator.hpp
+include src/surf/ptask_L07.cpp
+include src/surf/ptask_L07.hpp
+include src/surf/sg_platf.cpp
+include src/surf/storage_n11.cpp
+include src/surf/storage_n11.hpp
+include src/surf/surf_c_bindings.cpp
+include src/surf/surf_interface.cpp
+include src/surf/surf_interface.hpp
+include src/surf/surf_private.hpp
+include src/surf/xml/platf.hpp
+include src/surf/xml/platf_private.hpp
+include src/surf/xml/simgrid.dtd
+include src/surf/xml/simgrid_dtd.c
+include src/surf/xml/simgrid_dtd.h
+include src/surf/xml/surfxml_parseplatf.cpp
+include src/surf/xml/surfxml_sax_cb.cpp
+include src/xbt/OsSemaphore.hpp
+include src/xbt/RngStream.c
+include src/xbt/automaton/automaton.c
+include src/xbt/automaton/automaton_lexer.yy.c
+include src/xbt/automaton/automatonparse_promela.c
+include src/xbt/automaton/parserPromela.lex
+include src/xbt/automaton/parserPromela.tab.cacc
+include src/xbt/automaton/parserPromela.tab.hacc
+include src/xbt/automaton/parserPromela.yacc
+include src/xbt/backtrace.cpp
+include src/xbt/config.cpp
+include src/xbt/config_test.cpp
+include src/xbt/dict.cpp
+include src/xbt/dict_cursor.c
+include src/xbt/dict_elm.c
+include src/xbt/dict_private.h
+include src/xbt/dict_test.cpp
+include src/xbt/dynar.cpp
+include src/xbt/dynar_test.cpp
+include src/xbt/exception.cpp
+include src/xbt/graph.c
+include src/xbt/log.cpp
+include src/xbt/log_private.hpp
+include src/xbt/mallocator.c
+include src/xbt/mallocator_private.h
+include src/xbt/memory_map.cpp
+include src/xbt/memory_map.hpp
+include src/xbt/mmalloc/mfree.c
+include src/xbt/mmalloc/mm.c
+include src/xbt/mmalloc/mm_legacy.c
+include src/xbt/mmalloc/mm_module.c
+include src/xbt/mmalloc/mmalloc.c
+include src/xbt/mmalloc/mmalloc.info
+include src/xbt/mmalloc/mmalloc.texi
+include src/xbt/mmalloc/mmorecore.c
+include src/xbt/mmalloc/mmprivate.h
+include src/xbt/mmalloc/mrealloc.c
+include src/xbt/mmalloc/swag.c
+include src/xbt/mmalloc/swag.h
+include src/xbt/parmap.cpp
+include src/xbt/snprintf.c
+include src/xbt/string.cpp
+include src/xbt/unit-tests_main.cpp
+include src/xbt/xbt_log_appender_file.cpp
+include src/xbt/xbt_log_layout_format.cpp
+include src/xbt/xbt_log_layout_simple.cpp
+include src/xbt/xbt_main.cpp
+include src/xbt/xbt_os_file.cpp
+include src/xbt/xbt_os_synchro.cpp
+include src/xbt/xbt_os_time.c
+include src/xbt/xbt_replay.cpp
+include src/xbt/xbt_str.cpp
+include src/xbt/xbt_str_test.cpp
+include src/xbt/xbt_virtu.c
+include src/xbt_modinter.h
+include teshsuite/java/CMakeLists.txt
+include teshsuite/lua/CMakeLists.txt
+include teshsuite/lua/lua_platforms.tesh
+include teshsuite/mc/CMakeLists.txt
+include teshsuite/msg/CMakeLists.txt
+include teshsuite/s4u/CMakeLists.txt
+include teshsuite/simdag/CMakeLists.txt
+include teshsuite/simix/CMakeLists.txt
+include teshsuite/smpi/CMakeLists.txt
+include teshsuite/smpi/isp/umpire/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/attr/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/coll/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/comm/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/datatype/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/errhan/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/f77/attr/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/f77/coll/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/f77/comm/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/f77/datatype/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/f77/ext/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/f77/info/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/f77/init/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/f77/pt2pt/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/f77/rma/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/f77/topo/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/f77/util/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/f90/coll/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/f90/datatype/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/f90/info/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/f90/init/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/f90/pt2pt/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/f90/rma/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/f90/util/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/group/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/info/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/init/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/perf/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/rma/CMakeLists.txt
+include teshsuite/smpi/mpich3-test/topo/CMakeLists.txt
+include teshsuite/surf/CMakeLists.txt
+include teshsuite/xbt/CMakeLists.txt
+include tools/CMakeLists.txt
+include tools/cmake/CTestConfig.cmake
+include tools/cmake/CTestCustom.cmake
+include tools/cmake/DefinePackages.cmake
+include tools/cmake/Distrib.cmake
+include tools/cmake/Documentation.cmake
+include tools/cmake/Flags.cmake
+include tools/cmake/Java.cmake
+include tools/cmake/MaintainerMode.cmake
+include tools/cmake/MakeLib.cmake
+include tools/cmake/MakeLibWin.cmake
+include tools/cmake/Modules/FindGraphviz.cmake
+include tools/cmake/Modules/FindLibdw.cmake
+include tools/cmake/Modules/FindLibelf.cmake
+include tools/cmake/Modules/FindLibevent.cmake
+include tools/cmake/Modules/FindLibunwind.cmake
+include tools/cmake/Modules/FindLuaSimgrid.cmake
+include tools/cmake/Modules/FindNS3.cmake
+include tools/cmake/Modules/FindPAPI.cmake
+include tools/cmake/Modules/FindValgrind.cmake
+include tools/cmake/Modules/pybind11Config.cmake
+include tools/cmake/Option.cmake
+include tools/cmake/Tests.cmake
+include tools/cmake/cross-mingw.cmake
+include tools/cmake/scripts/fixup_simgrid_dtd_l.pl
+include tools/cmake/scripts/my_valgrind.pl
+include tools/cmake/scripts/update_tesh.pl
+include tools/cmake/test_prog/prog_asan.cpp
+include tools/cmake/test_prog/prog_makecontext.c
+include tools/cmake/test_prog/prog_stackgrowth.c
+include tools/cmake/test_prog/prog_stacksetup.c
+include tools/doxygen/fig2dev_postprocessor.pl
+include tools/doxygen/list_routing_models_examples.sh
+include tools/doxygen/xbt_log_extract_hierarchy.pl
+include tools/graphicator/CMakeLists.txt
+include tools/lualib.patch
+include tools/smpi/generate_smpi_defines.pl
+include tools/stack-cleaner/README
+include tools/stack-cleaner/as
+include tools/stack-cleaner/c++
+include tools/stack-cleaner/cc
+include tools/stack-cleaner/clean-stack-filter
+include tools/stack-cleaner/compiler-wrapper
+include tools/stack-cleaner/fortran
+include tools/tesh/CMakeLists.txt
+include tools/tesh/generate_tesh
diff --git a/MANIFEST.in.in b/MANIFEST.in.in
new file mode 100644 (file)
index 0000000..9c36a14
--- /dev/null
@@ -0,0 +1,3 @@
+# This file lists the content of the python source package
+# Prepared in tools/cmake/Distrib.cmake
+@PYTHON_SOURCES@
diff --git a/NEWS b/NEWS
index 144460b..b10b2c2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,10 +1,29 @@
+                    _               _____  ____  _  _
+__   _____ _ __ ___(_) ___  _ __   |___ / |___ \| || |
+\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   __) | || |_
+ \ V /  __/ |  \__ \ | (_) | | | |  ___) | / __/|__   _|
+  \_/ \___|_|  |___/_|\___/|_| |_| |____(_)_____|  |_|
+               (not released yet)
+
+The Clean Disk Release.
+
+ * Introduce an experimental Wifi network model.
+ * Introduce <disk>, which is much cleaner than <storage>.
+ * SMPI: Implement Errhandlers and some more MPI3.1 calls.
+ * (+ many bug fixes and internal refactorings)
                     _               _____  ____  _____
 __   _____ _ __ ___(_) ___  _ __   |___ / |___ \|___ /
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   __) | |_ \
  \ V /  __/ |  \__ \ | (_) | | | |  ___) | / __/ ___) |
   \_/ \___|_|  |___/_|\___/|_| |_| |____(_)_____|____/
-               (not released)
+               June 25. 2019
 
+The Exotic Solstice Release.
+
+ * Support for Solaris and Haiku OSes. Just for fun :)
+ * SMPI: more of MPI3.1; some MPI/IO and async collectives.
+ * Python bindings can now be installed from pip.
+ * (+ a whole load of bug fixes and internal refactorings)
                     _               _____  ____  ____
 __   _____ _ __ ___(_) ___  _ __   |___ / |___ \|___ \
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   __) | __) |
@@ -12,7 +31,7 @@ __   _____ _ __ ___(_) ___  _ __   |___ / |___ \|___ \
   \_/ \___|_|  |___/_|\___/|_| |_| |____(_)_____|_____|
                April 1. 2019
 
-The Easter Chrismas Release (this one is somewhat late).
+The Easter Christmas Release (this one is somewhat late).
 
  * Introducing the Python bindings (still beta)
  * Doc: SMPI tutorial and platform description ported to RTD
index 6b3d048..44414b9 100644 (file)
@@ -35,6 +35,8 @@ SimGrid4 will follow the these rules:
     - Example: src/kernel/activity/Activity.cpp
                include/simgrid/activity/Activity.hpp
   C
+  - Field getters are named sg_object_field() eg sg_link_name()
+    Field setters are named sg_object_field_set() eg sg_link_data_set()
   - variables and functions are in snake_case()
   - typedefs do not hide the pointers, ie * must be explicit
     char * sg_host_get_name(sg_host_t * host);
index 938fcf4..ef6d3b1 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
 [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)
+[![Build Status](https://ci.inria.fr/simgrid/buildStatus/icon?job=SimGrid)](https://ci.inria.fr/simgrid/job/SimGrid/)
 [![Travis Status](https://img.shields.io/travis/simgrid/simgrid/master.svg?logo=travis)](https://travis-ci.org/simgrid/simgrid)
 [![AppVeyor Status](https://ci.appveyor.com/api/projects/status/gvcssh340fwtoc35?svg=true)](https://ci.appveyor.com/project/mquinson/simgrid)
-[![SonarCloud Status](https://sonarcloud.io/api/project_badges/measure?project=simgrid&metric=alert_status)](https://sonarcloud.io/dashboard/?id=simgrid)
-[![Codacy Badge](https://api.codacy.com/project/badge/Grade/bf1bdba50440485fbda2ac19f462ccc7)](https://www.codacy.com/app/mquinson/simgrid?utm_source=github.com&amp)
-[![Doc](https://readthedocs.org/projects/pip/badge/?version=stable)](http://simgrid.gforge.inria.fr/simgrid/latest/doc/)
-[![License: LGPL v3][license-badge]](COPYING)
+[![SonarCloud Status](https://sonarcloud.io/api/project_badges/measure?project=simgrid_simgrid&metric=alert_status)](https://sonarcloud.io/dashboard/?id=simgrid_simgrid)
+[![Doc](https://readthedocs.org/projects/pip/badge/?version=stable)](https://simgrid.org/doc/latest/)
+[![License: LGPL v2.1][license-badge]](COPYING)
 [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1845/badge)](https://bestpractices.coreinfrastructure.org/projects/1845)
 
 # Welcome to the SimGrid project!
@@ -14,21 +14,32 @@ large-scale distributed systems such as Grids, Clouds, HPC or P2P
 systems. It can be used to evaluate heuristics, prototype applications 
 or even assess legacy MPI applications.
 
-More documentation is included in this archive (doc/html/index.html)
-or [online](https://simgrid.org/)
+## Installation
+Documentation: [online](https://simgrid.org/doc/latest/Installing_SimGrid.html#installing-from-the-source);
+[local copy](docs/source/Installing_SimGrid.rst). TL;DR:
+```
+cmake -DCMAKE_INSTALL_PREFIX=/opt/simgrid .
+# Check the full list of options with `cmake -LH`
+make
+make install
+```
+
+## More information
+[Online documentation](https://simgrid.org/doc/latest/) or 
+[local version](docs/source).
+
+You can also ask your questions, or simply discuss with other users on 
+to the [user mailing list](http://lists.gforge.inria.fr/mailman/listinfo/simgrid-user)
+or on the #simgrid IRC channel of the oftc network.
 
-In any case, you may want to subscribe to the [user mailing list](http://lists.gforge.inria.fr/mailman/listinfo/simgrid-user). 
-There, you can find answers to your questions, or simply discuss with
-people doing the same kind of research than you do, in an active and
-friendly community.
 
 Thanks for using our software. Please do great things with it and tell
 the world about it. Tell us, too, because we love to have positive
-feedback.
+feedback. Welcome to our community.
 
 Cheers,
 Da SimGrid Team.
 
-[license-badge]: https://img.shields.io/badge/License-LGPL%20v3-blue.svg
+[license-badge]: https://img.shields.io/badge/License-LGPL%20v2.1-blue.svg
 [release-badge]: https://img.shields.io/github/release/simgrid/simgrid.svg
 [release-link]:  https://gforge.inria.fr/frs/?group_id=12
index a35a726..b641cb4 100644 (file)
@@ -1442,10 +1442,8 @@ PREDEFINED             = __cplusplus \
                         XBT_PRIVATE= \
                         XBT_ATTRIB_NORETURN= \
                         XBT_ATTRIB_UNUSED= \
-                         XBT_ATTRIB_DEPRECATED_v323(m)= \
-                         XBT_ATTRIB_DEPRECATED_v324(m)= \
                          XBT_ATTRIB_DEPRECATED_v325(m)= \
-                         XBT_ATTRIB_DEPRECATED_v326(m)=
+                         XBT_ATTRIB_DEPRECATED_v327(m)=
 
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
 # this tag can be used to specify a list of macro names that should be expanded.
index 5b902f4..3ab02af 100644 (file)
@@ -19,24 +19,6 @@ Another great source of inspiration can be found in the @ref s4u_examples.
 If you are stuck at any point and if this FAQ cannot help you, please drop us a
 mail to the user mailing list: <simgrid-user@lists.gforge.inria.fr>.
 
-@subsection faq_interfaces What is the difference between MSG and SimDag? Do they serve the same purpose?
-
-It depend on how you define "purpose", I guess ;)
-
-They all allow you to build a prototype of application which you can run
-within the simulator afterward. They all share the same simulation kernel,
-which is the core of the SimGrid project. They differ by the way you express
-your application.
-
-With SimDag, you express your code as a collection of interdependent
-parallel tasks. So, in this model, applications can be seen as a DAG of
-tasks. This is the interface of choice for people wanting to port old
-code designed for SimGrid v1 or v2 to the framework current version.
-
-With MSG, your application is seen as a set of communicating
-processes, exchanging data by the way of messages and performing
-computation on their own.
-
 @subsection faq_visualization Visualizing and analyzing the results
 
 It is sometime convenient to "see" how the agents are behaving. If you
@@ -50,19 +32,6 @@ filter (e.g. with bash):
 
 We also have a more graphical output. Have a look at section @ref options_tracing.
 
-@subsection faq_C Argh! Do I really have to code in C?
-
-We provide Java bindings of the MSG interface, which is the main
-SimGrid user API.
-
-Moreover If you use C++, you should be able to use the SimGrid library
-as a standard C library and everything should work fine (simply
-<i>link</i> against this library; recompiling SimGrid with a C++
-compiler won't work and it wouldn't help if you could).
-
-For now, we do not feel a real demand for any other language. But if
-you think there is one, please speak up!
-
 @section faq_howto Feature related questions
 
 @subsection faq_MIA "Could you please add (your favorite feature here) to SimGrid?"
@@ -231,37 +200,6 @@ their own batch schedulers. Vincent Garonne wrote one during his PhD
 and put his code in the contrib directory of our SVN so that other can
 keep working on it. You may find inspiring ideas in it.
 
-@subsubsection faq_MIA_checkpointing I need a checkpointing thing
-
-Actually, it depends on whether you want to checkpoint the simulation, or to
-simulate checkpoints.
-
-The first one could help if your simulation is a long standing process you
-want to keep running even on hardware issues. It could also help to
-<i>rewind</i> the simulation by jumping sometimes on an old checkpoint to
-cancel recent calculations.@n
-Unfortunately, such thing will probably never exist in SG. One would have to
-duplicate all data structures because doing a rewind at the simulator level
-is very very hard (not talking about the malloc free operations that might
-have been done in between). Instead, you may be interested in the Libckpt
-library (http://www.cs.utk.edu/~plank/plank/www/libckpt.html). This is the
-checkpointing solution used in the condor project, for example. It makes it
-easy to create checkpoints (at the OS level, creating something like core
-files), and rerunning them on need.
-
-If you want to simulate checkpoints instead, it means that you want the
-state of an executing task (in particular, the progress made towards
-completion) to be saved somewhere.  So if a host (and the task executing on
-it) fails (cf. #MSG_HOST_FAILURE), then the task can be restarted
-from the last checkpoint.@n
-
-Actually, such a thing does not exist in SimGrid either, but it's just
-because we don't think it is fundamental and it may be done in the user code
-at relatively low cost. You could for example use a watcher that
-periodically get the remaining amount of things to do (using
-MSG_task_get_remaining_computation()), or fragment the task in smaller
-subtasks.
-
 @subsection faq_platform Platform building and Dynamic resources
 
 @subsubsection faq_platform_example Where can I find SimGrid platform files?
@@ -299,21 +237,6 @@ assessed. Please keep this fact in mind when using it.
 
 @section faq_troubleshooting Troubleshooting
 
-@subsection faq_trouble_changelog The feature X stopped to work after my last update 
-
-I guess that you want to read the ChangeLog file, that always contains
-all the information that could be important to the users during the
-upgrade. Actually, you may want to read it (alongside with the NEWS
-file that highlights the most important changes) even before you
-upgrade your copy of SimGrid, too.
-
-We do our best to maintain the backward compatibility, but we
-sometimes have to fix the things that are too broken. If we happen to
-kill a feature that you were using, we are sorry. We think that you
-should update to the new way of doing things, but if you can't afford
-it, that's ok. Just stick to the last version that were working for
-you, and have a pleasant day.
-
 @subsection faq_trouble_compil User code compilation problems
 
 @subsubsection faq_trouble_err_logcat "gcc: _simgrid_this_log_category_does_not_exist__??? undeclared (first use in this function)"
@@ -323,18 +246,6 @@ any default category in this file. You should refer to @ref XBT_log
 for all the details, but you simply forgot to call one of
 XBT_LOG_NEW_DEFAULT_CATEGORY() or XBT_LOG_NEW_DEFAULT_SUBCATEGORY().
 
-@subsubsection faq_trouble_pthreadstatic "gcc: undefined reference to pthread_key_create"
-
-This indicates that one of the library SimGrid depends on (libpthread
-here) was missing on the linking command line. Dependencies of
-libsimgrid are expressed directly in the dynamic library, so it's
-quite impossible that you see this message when doing dynamic linking.
-
-If you compile your code statically (and if you use a pthread version
-of SimGrid), you must absolutely
-specify <tt>-lpthread</tt> on the linker command line. As usual, this should
-come after <tt>-lsimgrid</tt> on this command line.
-
 @subsection faq_trouble_errors Runtime error messages
 
 @subsubsection faq_trouble_errors_big_fat_warning I'm told that my XML files are too old.
@@ -367,20 +278,6 @@ In order to debug SMPI programs, you can use the following options:
 
 Both options are needed in order to run the SMPI process under GDB.
 
-@subsection faq_trouble_valgrind Valgrind-related and other debugger issues
-
-If you don't, you really should use valgrind to debug your code, it's
-almost magic.
-
-@subsubsection faq_trouble_backtraces Truncated backtraces
-
-When debugging SimGrid, it's easier to pass the
---disable-compiler-optimization flag to the configure if valgrind or
-gdb get fooled by the optimization done by the compiler. But you
-should remove these flag when everything works before going in
-production (before launching your 1252135 experiments), or everything
-will run only one half of the true SimGrid potential.
-
 @subsection faq_deadlock There is a deadlock in my code!!!
 
 Unfortunately, we cannot debug every code written in SimGrid.  We
@@ -443,14 +340,14 @@ still an academic project so please be patient if/when you find bugs in it.
 If you do, the best solution is to drop an email either on the simgrid-user
 or the simgrid-devel mailing list and explain us about the issue.  You can
 also decide to open a formal bug report using the
-<a href="https://gforge.inria.fr/tracker/?atid=165&group_id=12&func=browse">relevant
+<a href="https://framagit.org/simgrid/simgrid/issues">relevant
 interface</a>. You need to login on the server to get the ability to submit
 bugs.
 
-We will do our best to solve any problem repported, but you need to help us
+We will do our best to solve any problem reported, but you need to help us
 finding the issue. Just telling "it segfault" isn't enough. Telling "It
 segfaults when running the attached simulator" doesn't really help either.
-You may find the following article interesting to see how to repport
+You may find the following article interesting to see how to report
 informative bug repports:
 http://www.chiark.greenend.org.uk/~sgtatham/bugs.html (it is not SimGrid
 specific at all, but it's full of good advices).
diff --git a/doc/doxygen/deployment.doc b/doc/doxygen/deployment.doc
deleted file mode 100644 (file)
index beee64f..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*! @page deployment Deploy the simulation
-
-@tableofcontents
-
-\htmlonly
-<div align="center">
-\endhtmlonly
-\htmlinclude graphical-toc.svg
-\htmlonly
-</div>
-<script>
-document.getElementById("Deployment").style="opacity:0.93999999;fill:#ff0000;fill-opacity:0.1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1";
-</script>
-\endhtmlonly
-
-Once you've specified your @ref platform "virtual platform" and the
-@ref application "application" you want to study, you must describe
-the mapping of the application onto the platform. This page says how
-to do that if you go for online simulation (that is, the study of a
-program), you must say which code starts on which host, with which
-parameters. You can also go for offline simulation, i.e. the study of
-a trace captured from a past applicative run, as briefly explained
-@ref XBT_replay "here".
-
-There is two ways to specify the mapping of your program onto virtual
-hosts: either directly from your program (with @ref MSG_process_create
-or as in @ref s4u_ex_actors_start "this S4U example"), or using an external
-XML file.  You should really logically separate your application from
-the deployment, as it will ease your experimental campain afterward.
-How exactly you organize your work remains up to you.
-
-@section deploy_s4u Deployment with S4U
-
-The following example shows the several ways of doing so in the S4U
-interface: @ref examples/s4u/actor-create/s4u-actor-create.cpp.
-Associated XML file: @ref examples/s4u/actor-create/s4u-actor-create_d.xml
-
-@section deploy_msg Deployment with MSG
-
-If you're stuck with the MSG interface, then you should simply use one
-of the following functions to start new actors onto your virtual
-hosts: @ref MSG_process_create, @ref MSG_process_create_with_arguments
-or @ref MSG_process_create_with_environment. These functions are used
-in many of the provided example, just grep for them.
-
-@section deploy_xml Deployment with XML
-
-Deploying actors from XML is easy. This section presents a complete
-example and the reference guide of the involved tags.
-
-The deployment file looks just like a @ref platform "platform" file,
-with only 3 tags used:
-
-  - @c &lt;actor&gt; starts a new actor on a given host;
-  - @c &lt;argument&gt; passes a given argument in the argv of an actor
-    (the list of arguments is ordered);
-  - @c &lt;prop&gt; adds a property to the actor.
-
-@subsection deploy_xml_ex Examples
-
-To make them easy to find, almost all deployment files in the archive
-are named @c ***_d_xml.
-
-@verbatim
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-<platform version="4">
-  <!-- Alice, which runs on the machine named 'host1', does not take any parameter -->
-  <actor host="host1" function="alice" />
-
-  <!-- Bob, which runs on 'host2', has 2 parameters "3" and "3000" in its argv -->
-  <actor host="host2" function="bob" />
-     <argument value="3"/>
-     <argument value="3000"/>
-  </actor>
-
-  <!-- Carole runs on 'host3', has 1 parameter "42" in its argv and one property -->
-  <!-- See MSG_process_get_property_value() to retrieve this property -->
-  <actor host="host3" function="carole">
-      <argument value="42"/>
-      <prop id="SomeProp" value="SomeValue"/>
-  </actor>
-</platform>
-@endverbatim
-
-@subsection deploy_xml_actor The actor tag
-
-&lt;actor&gt; starts a new actor on a given host. It specifies which
-function (from your application) gets executed on the host. Hence, the
-@c host and @c function attributes are mandatory, but this tag accepts
-some optional attributes too.
-
-| Attribute name  | Mandatory | Values       | Description                                                                     |
-| --------------- | --------- | ------------ | -----------                                                                     |
-| host            | yes       | String       | This must match the name of an host defined in the platform file.               |
-| function        | yes       | String       | Name of the function (from your own code) that will be executed.  See @ref deploy_xml_functions. |
-| start_time      | no        | int          | The simulated time when this actor will be started (Default: ASAP).             |
-| kill_time       | no        | int          | The simulated time when this actor will be forcefully stopped (Default: never). |
-| on_failure      | no        | DIE\|RESTART | What should be done when the actor fails (Default: die).       |
-
-@subsection deploy_xml_argument The argument tag
-
-This tag (which must be enclosed in a @c &lt;actor&gt; tag) adds a
-new string to the parameter list received by your actor (either its @c
-argv array in MSG or its @c args vector in S4U).  Naturally, the
-semantic of these parameters completely depend on your program.
-
-| Attribute name  | Mandatory | Values                 | Description             |
-| --------------- | --------- | ---------------------- | -----------             |
-| value           | yes       | String                 | Value of this parameter |
-
-@subsection deploy_xml_prop The prop tag
-
-This tag (which must be enclosed in a @c &lt;actor&gt; tag) adds a new
-property to your actor. You can retrieve these properties with
-MSG_process_get_property_value() or simgrid::s4u::Actor::property().
-Naturally, the semantic of these parameters completely depend on your
-program.
-
-| Attribute name  | Mandatory | Values                 | Description                  |
-| --------------- | --------- | ---------------------- | -----------                  |
-| id              | yes       | String                 | Name of the defined property |
-| value           | yes       | String                 | Value of this property       |
-
-@subsection deploy_xml_functions Declaring startable functions
-
-You need to connect your code to the names that you use in the XML
-deployment file. Depending on the interface you use, this is done with
-MSG_process_create() or simgrid::s4u::Engine::registerFunction().
-There is nothing to do in your **Java code** since SimGrid uses
-the Java introspection abilities to retrieve the classes from their
-names. In your XML file, you must then use the full class name
-(including the package name).
-
-*/
index a5c2591..3945ed0 100644 (file)
@@ -88,7 +88,7 @@ Launching all tests can be very time consuming, so you want to build
 and run the tests in parallel. Also, you want to save the build output
 to disk, for further reference. This is exactly what the
 BuildSimGrid.sh script does. It is upper-cased so that the shell
-completion works and allow to run it in 4 key press: `./B<tab>`
+completion works and allows one to run it in 4 key press: `./B<tab>`
 
 Note that if you build out of tree (as you should, see below), the
 script builds the build/default directory. I usually copy the file in
index dc0c51e..b47395f 100644 (file)
@@ -140,13 +140,13 @@ The workflow of a simcall is the following:
   - If maestro, executes the simcall directly (and return)
   - If not, call `ActorImpl::yield` to give back the control to maestro
   - ========== KERNEL MODE ==========
-  - `SIMIX_simcall_handle` large switch (on simcall) doing for each:
+  - `ActorImpl::simcall_handle` large switch (on simcall) doing for each:
    - `simcall_HANDLER_<name>(simcall, <args>)` (the manual code handling the simcall)
    - If the simcall is not marked as "blocking" in its definition,
-     call `SIMIX_simcall_answer(simcall)` that adds back the issuer
+     call `ActorImpl::simcall_answer()` that adds back the issuer
      process to the list of processes to run in the next scheduling round.
      It is thus the responsability of the blocking simcalls to call
-     `SIMIX_simcall_answer(simcall)` themselves in their handler.
+     `ActorImpl::simcall_answer()` themselves in their handler.
 
 Note that empty HANDLERs can be omitted. These functions usually do
 some parameter checking, or retrieve some information about the
index 598384c..67005c6 100644 (file)
@@ -15,13 +15,13 @@ Please apply the following checklist before releasing.
     - CMakeLists.txt (in macros SIMGRID_VERSION_*)
     - sonar-project.properties
     - docs/source/conf.py
-  - The "make distcheck" target works (testing that every files needed
-    to build and install are included in the archive)
+    - setup.py
 - Tests
-  - All tests pass on a reasonable amount of platforms (typically,
-    everything on ci + travis/macOS + AppVeyor)
-  - You also tested to build and install the content of the source
-    archive on a reasonable amount of platforms (typically, 2 or 3).
+  - The "make distcheck" target works (tested by jenkins)
+  - All tests pass oneverything on ci + travis/macOS + AppVeyor
+  - Tutorials and derivative projects build correctly
+    https://framagit.org/simgrid/simgrid-template-s4u/pipelines
+    https://framagit.org/simgrid/external-projects-ci/pipelines
 - ChangeLog file
   - All changes are documented
   - The release date is indicated below the changes
@@ -101,30 +101,26 @@ the settings icon of the release you want to change.
 
 - Tag the git repository (don't forget to push the tags to the main repo)
 - Push the archive files (tar.gz and jar) on gforge
-- Post a news on gforge (before updating the website)
-- Update the link scm.gforge.inria.fr:/home/groups/simgrid/htdocs/simgrid/latest
-  - Create the directory of the released version and upload the doc artefact in it
-  - Remove the older releases so that people don't find them in google
+- #Post a news on gforge (before updating the website)
 - Document the tag on https://github.com/simgrid/simgrid/releases and
   on https://framagit.org/simgrid/simgrid/tags
   - Upload the files SimGrid-3.XX.tar.gz, simgrid-3_XX.jar and
-    SimGrid-doc-3_XX.zip files to the changelog.
-- Rebuild and resynchronize the website so that the file gets visible
-  from our download page.@n
+    SimGrid-doc-3_XX.zip (that is the artefact of the pages job on framagit) files to the changelog.
+- Update the website
   - Edit org/org-templates/level-0.org to change the release version, the tgz link and the jar link.
   - emacs org/site/index.org and C-c C-c the first source block to refresh the news; fake the date in the result.
   - 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
   - jed .gitlab-ci.yml
-    - Change the link to the SimGrid-doc-3_XX.zip file
-    - Change the version number
+    - Change the link to the SimGrid-doc-3_XX.zip file 
+    - Only keep 2 versions so that people don't find older ones in google
     - Change the link to latest
   - git commit -a && git push
 - Announce the release
  - Mail the simgrid-user mailing list
     - the NEWS chunk in the mail;
-    - Hall of Fame in the mail@n
+    - Hall of Fame in the mail
       git shortlog -se v3.21..
     - Link to the ChangeLog on framagit (the version of that tag)
  - Also mail some other lists (G5K users)
@@ -138,13 +134,59 @@ the settings icon of the release you want to change.
 - Update the simgrid/package.py for spack: https://gitlab.inria.fr/solverstack/spack-repo
 - Create the template for the next release in ChangeLog and NEWS files
   Release Target date: https://en.wikipedia.org/wiki/Equinox
-- Change the release number to 3.X.90 in CMakeLists.txt and sonar-project.properties docs/source/conf.py
+- Bump release number to 3.X.1 in CMakeLists.txt sonar-project.properties docs/source/conf.py setup.py
 - Deal with deprecations:
-  - Introduce the XBT_ATTRIB_DEPRECATED_v??? macro for the next release.
+  - jed include/xbt/base.h: Introduce the next XBT_ATTRIB_DEPRECATED_v??? macro 
   - Kill the one for the current release and remove all code that were
     mandated by the deprecated functions (both in source and headers).
   - Do the possible cleanups now that these features are gone.
 - Update the Docker images (after pushing to the git)
-  - cd tools/docker && make stable tuto-s4u push
+  - cd tools/docker && make stable tuto-s4u tuto-smpi push
+  - Update the simgrid-template-s4u repository to test against this new release
+    jed ~/Code/simgrid-template-s4u/.gitlab-ci.yml
+
+Release numbering semantic: 
+  - 3.X is a named release. 
+    - We have 4 named releases per year (for each equinox and solstice)
+    - The ChangeLog and NEWS are complete and informative
+    - All tests pass on all ci systems (or the workarounds are documented)
+    - We provide and store a source .tar.gz and a full jarfile on framagit
+    - Deprecated symbols remain usable for at least 3 named releases (~1 year)
+    - These releases are announced to the users
+  - 3.X.Y where Y is even: dot release of 3.X, prerelease of 3.(X+1)
+    - We provide and store a source .tar.gz and a full jarfile on framagit
+    - These releases are NOT announced publicly, nor really documented. 
+      The idea is to have something close to a rolling release.
+    - External projects can depend on dot releases to loosen their
+      release process from ours, when 4 release a year is not enough 
+  - 3.X.Y where Y is odd: git current status between two releases
+    - No expectations on such versions
+  - Example
+    - 3.22.4: unannounced/losely documented stable release
+    - 3.22.5: git status somewhere between the release of 3.22.4 and the next one
+    - 3.23: Documented and announced stable release
+    
+Doing a dot release:
+  - Update the version number in:
+      - CMakeLists.txt (in macros SIMGRID_VERSION_*)
+      - sonar-project.properties
+      - docs/source/conf.py
+      - setup.py
+  - Commit and push to both framagit and github
+  - Wait for both appveyor and jenkins/highsierra to complete the build
+  - If it's not successful, fix it and push again
+  - Once it's successful on both appveyor and jenkins:
+    - tag the release v3.X.Y and push the tag
+    - Merge 'master' into 'stable' and push it to framagit
+    - Do not merge into 'stable' before appveyor and jenkins are done,
+      or your jarfile will not contain the code you expect for win and
+      mac.
+  - Rebuild the python package
+    - rm -rf dist/ ; python3 setup.py sdist # Build a source distrib
+    - test that the built distrib recompiles:
+      rm -rf /tmp/pysimgrid && mkdir /tmp/pysimgrid && cp dist/simgrid-*.tar.gz /tmp/pysimgrid 
+      (cd /tmp/pysimgrid && tar xfz simgrid*.tar.gz && cd simgrid-*/ && python3 setup.py build)
+    - Upload it to pypi (WARNING: you cannot modify uploaded files, ever)
+      twine upload dist/simgrid-*.tar.gz
 
 */
index 89785dd..10a394a 100644 (file)
@@ -250,7 +250,7 @@ code scanners are provided as plugin. The one for C++ is not free, but
 open-source project can use it at no cost. That is what we are doing.
 
 Don't miss the great looking dashboard here: 
-https://sonarcloud.io/dashboard?id=simgrid
+https://sonarcloud.io/dashboard?id=simgrid_simgrid
 
 This tool is enriched by the script @c tools/internal/travis-sonarqube.sh 
 that is run from @c .travis.yml
diff --git a/doc/doxygen/ns3.doc b/doc/doxygen/ns3.doc
deleted file mode 100644 (file)
index b1763a7..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-/*! @page pls_ns3 ns-3 as a SimGrid model
-
-@tableofcontents
-
-You can use the well-known 
-<a href="http://www.nsnam.org/"><b>ns-3</b></a> packet-level network
-simulator as a SimGrid model, for example to investigate the validity
-of your simulation. Just install ns-3 and recompile SimGrid accordingly.
-
-@section pls_ns3_install Installing ns-3
-
-The easiest is to install it with the package manager. Under Debian/Ubuntu, simply type as root:
-
-@verbatim
-apt-get install libns3-dev ns3
-@endverbatim
-
-You can also install it from scratch with the following commands:
-
-@verbatim
-# Download the source
-wget http://www.nsnam.org/release/ns-allinone-3.26.tar.bz2
-tar -xf ns-allinone-3.26.tar.bz2
-cd ns-allinone-3.26/ns-3.26/
-# Configure, build and install
-./waf configure --prefix="/opt/ns3" # or give another path if you prefer
-./waf
-./waf install
-@endverbatim
-
-For more information, please refer to the ns-3 documentation
-<a href="http://www.nsnam.org/">(official website)</a>.
-
-@section pls_ns3_config Enabling SimGrid's support for ns-3
-
-Normally, you just have to enable ns-3 in ccmake or cmake as
-follows. If you installed ns-3 in a regular path, just drop the
-NS3_HINT configuration item.
-
-@verbatim
-cmake . -Denable_ns3=ON -DNS3_HINT=/opt/ns3 # or change the path if needed
-@endverbatim
-
-By the end of the configuration, cmake reports whether ns-3 was found,
-and this information is also available in <tt>include/simgrid/config.h</tt>
-If your local copy defines the variable @c SIMGRID_HAVE_NS3 to 1, then ns-3
-was correctly detected. If it's defined to 0, then something went
-wrong. Explore <tt>CMakeFiles/CMakeOutput.log</tt> and
-<tt>CMakeFiles/CMakeError.log</tt> to diagnose the problem.
-
-Afterward, you can test your installation as follows:
-
-@verbatim
-$ ctest -R ns3
-@endverbatim
-
-@section pls_ns3_use Using ns-3 from SimGrid
-
-The SimGrid-ns3 binding only contains features that are common to both
-systems: ns-3 wireless models are not available, while SimGrid routes
-cannot be longer than 1. Also, the platform built in ns-3 from the
-SimGrid description is very basic.
-
-Any route longer than one will be ignored when using ns-3. They are
-harmless, but you still need to connect your hosts using one-hop routes.
-The best solution is to add routers to split your route. Here is an
-example of invalid platform:
-
-@code{.xml}
-<platform>
-  <host id="alice" speed="1Gf" />
-  <host id="bob"   speed="1Gf" />
-  
-  <link id="l1" bw="1Mbps" />
-  <link id="l2" bw="1Mbps" />
-
-  <route src="alice" dst="bob">
-    <link_ctn id="l1"/> <!-- INVALID WITH NS-3 -->
-    <link_ctn id="l2"/> <!-- length=2 IS TOO MUCH -->
-  </route>
-</platform>
-@endcode
-  
-Here is the same platform expressed in a way that ns-3 will understand.
-There is no direct connexion from alice to bob, but that's OK because
-ns-3 will find the path from point to point.
-
-@code{.xml}
-<platform>
-  <host id="alice" speed="1Gf" />
-  <host id="bob"   speed="1Gf" />
-
-  <router id="r1" /> <!-- routers are compute-less hosts -->
-
-  <link id="l1" bw="1Mbps" />
-  <link id="l2" bw="1Mbps" />
-
-  <route src="alice" dst="r1">
-    <link_ctn id="l1"/> 
-  </route>
-  
-  <route src="r1" dst="bob">
-    <link_ctn id="l2"/> 
-  </route>
-</platform>
-@endcode
-
-
-Once your platform is OK, just change the "network/model"
-configuration option to "NS3" as follows. The rest remains unchanged.
-
-@verbatim
-./network-ns3 ../../platforms/small_platform_one_link_routes.xml 3hosts_2links_d.xml --cfg=network/model:NS3
-@endverbatim
-
-Many other files from the examples/platform directory are usable with
-the ns-3 model, such as @ref examples/platforms/dogbone.xml. Check the file
-examples/deprecated/msg/network-ns3/network-ns3.tesh to see which ones are used
-in our regression tests. You may also be interested in the
-@ref msg_ex_ns3 "ns-3/SimGrid examples".
-
-@subsection pls_ns3_shortcomings Shortcomings of the ns-3 bindings in SimGrid
-
-A ns-3 platform is automatically created from the provided SimGrid
-platform. However, there are some known caveats:
-
-<ul>
-
-  <li>The default values (e.g., TCP parameters) are the ns3 default
-      values.</li>
-
-  <li>ns-3 networks are routed using the shortest path algorithm, using
-      ns3::Ipv4GlobalRoutingHelper::PopulateRoutingTables.</li>
-
-  <li>End hosts cannot have more than one interface card. So, your
-      SimGrid hosts should be connected to the platform through only
-      one link. Otherwise, your SimGrid host will be considered as a
-      router.</li>
-
-</ul>
-
-Our goal is to keep the ns-3 plugin of SimGrid as easy (and hopefully
-readable) as possible. If the current state does not fit your needs,
-you should modify this plugin, and/or create your own plugin from the
-existing one.
-
-@section pls_trouble Troubleshooting with ns-3 and SimGrid
-
-@subsection pls_ns3_config_trouble I fail to compile ns-3 within SimGrid
-
-If you have a ns-3 version that is not known to SimGrid yet, edit @c
-tools/cmake/Modules/FindNS3.cmake in your SimGrid tree, according to
-the comments on top of this file.
-
-If the compilation fails on Debian/Ubuntu when linking the library
-because of some .a file that cannot be used dynamically, then you are
-probably using a very old (and buggy) <tt>libns3-dev</tt>
-package. Update it, or install <tt>libns3-3</tt> manually.
-
-@subsection pls_trouble_hang The simulation hangs at some point
-
-If your simulation hangs in a communication, this is probably because
-one host is sending data that is not routable in your platform. Make
-sure that you only use routes of length 1, and that any host is
-connected to the platform.
-
-Arguably, SimGrid could detect this situation and report it, but
-unfortunately, this is still to be done.
-
-@subsection pls_trouble_warning I get a warning that some routes are ignored
-
-Please read again the @ref pls_ns3_use section.
-
-
-@example examples/platforms/dogbone.xml
-*/
index 131fe36..e22541c 100644 (file)
@@ -357,7 +357,7 @@ manually.
 
 @subsubsection log_use_conf_add Category additivity
 
-The <tt>add</tt> keyword allows to specify the additivity of a
+The <tt>add</tt> keyword allows one to specify the additivity of a
 category (see @ref log_in_app). '0', '1', 'no', 'yes', 'on'
 and 'off' are all valid values, with 'yes' as default.
 
@@ -432,4 +432,4 @@ category's appender.
 
 The default appender function currently prints to stderr.
 
-*/
\ No newline at end of file
+*/
index 66e93c9..ec3781f 100644 (file)
@@ -29,7 +29,7 @@ The default inner organization of the cluster is as follow:
 Here, a set of <b>host</b>s is defined. Each of them has a <b>link</b>
 to a central backbone (backbone is a link itself, as a link can
 be used to represent a switch, see the switch / link section
-below for more details about it). A <b>router</b> allows to connect a
+below for more details about it). A <b>router</b> allows one to connect a
 <b>cluster</b> to the outside world. Internally,
 SimGrid treats a cluster as a network zone containing all hosts: the router is the default
 gateway for the cluster.
@@ -185,160 +185,6 @@ several other tags that are available only in certain contexts.
     If you want to represent an entity like a switch, you must use ``<link>`` (see section). Routers are used
     to run some routing algorithm and determine routes (see Section @ref pf_routing for details).
 
-@subsubsection pf_tag_link &lt;link&gt;
-
-Network links can represent one-hop network connections. They are
-characterized by their id and their bandwidth; links can (but may not) be subject
-to latency.
-
-#### Attributes ####
-
-Attribute name  | Mandatory | Values | Description
---------------- | --------- | ------ | -----------
-id              | yes       | string | The identifier of the link to be used when referring to it.
-bandwidth       | yes       | string | Maximum bandwidth for this link, along with its unit.
-latency         | no        | double (default: 0.0) | Latency for this link.
-sharing_policy  | no        | @ref sharing_policy_shared "SHARED"@|@ref pf_sharing_policy_fatpipe "FATPIPE"@|@ref pf_sharing_policy_splitduplex "SPLITDUPLEX" (default: SHARED) | Sharing policy for the link.
-bandwidth_file  | no        | string | Allows you to use a file as input for bandwidth.
-latency_file    | no        | string | Allows you to use a file as input for latency.
-state_file      | no        | string | Allows you to use a file as input for states.
-
-
-#### Possible shortcuts for ``latency`` ####
-
-When using the latency attribute, you can specify the latency by using the scientific
-notation or by using common abbreviations. For instance, the following three tags
-are equivalent:
-
-@verbatim
- <link id="LINK1" bandwidth="125000000" latency="5E-6"/>
- <link id="LINK1" bandwidth="125000000" latency="5us"/>
- <link id="LINK1" bandwidth="125000000" latency="0.000005"/>
-@endverbatim
-
-Here, the second tag uses "us", meaning "microseconds". Other shortcuts are:
-
-Name | Abbreviation | Time (in seconds)
----- | ------------ | -----------------
-Week | w | 7 * 24 * 60 * 60
-Day  | d | 24 * 60 * 60
-Hour | h | 60 * 60
-Minute | m | 60
-Second | s | 1
-Millisecond | ms | 0.001 = 10^(-3)
-Microsecond | us | 0.000001 = 10^(-6)
-Nanosecond  | ns | 0.000000001 = 10^(-9)
-Picosecond  | ps | 0.000000000001 = 10^(-12)
-
-#### Sharing policy ####
-
-@anchor sharing_policy_shared
-By default a network link is @b SHARED, i.e., if two or more data flows go
-through a link, the bandwidth is shared fairly among all data flows. This
-is similar to the sharing policy TCP uses.
-
-@anchor pf_sharing_policy_fatpipe
-On the other hand, if a link is defined as a @b FATPIPE,
-each flow going through this link will be provided with the complete bandwidth,
-i.e., no sharing occurs and the bandwidth is only limiting each flow individually.
-Please note that this is really on a per-flow basis, not only on a per-host basis!
-The complete bandwidth provided by this link in this mode
-is ``number_of_flows*bandwidth``, with at most ``bandwidth`` being available per flow.
-
-Using the FATPIPE mode allows to model backbones that won't affect performance
-(except latency).
-
-@anchor pf_sharing_policy_splitduplex
-The last mode available is @b SPLITDUPLEX. This means that SimGrid will
-automatically generate two links (one carrying the suffix _UP and the other the
-suffix _DOWN) for each ``<link>`` tag. This models situations when the direction
-of traffic is important.
-
-@remark
-  Transfers from one side to the other will interact similarly as
-  TCP when ACK returning packets circulate on the other direction. More
-  discussion about it is available in the description of link_ctn description.
-
-In other words: The SHARED policy defines a physical limit for the bandwidth.
-The FATPIPE mode defines a limit for each application,
-with no upper total limit.
-
-@remark
-  Tip: By using the FATPIPE mode, you can model big backbones that
-  won't affect performance (except latency).
-
-#### Example ####
-
-@verbatim
- <link id="SWITCH" bandwidth="125000000" latency="5E-5" sharing_policy="FATPIPE" />
-@endverbatim
-
-#### Expressing dynamism and failures ####
-
-Similar to hosts, it is possible to declare links whose state, bandwidth
-or latency changes over time (see Section @ref pf_host_dynamism for details).
-
-In the case of network links, the ``bandwidth`` and ``latency`` attributes are
-replaced by the ``bandwidth_file`` and ``latency_file`` attributes.
-The following XML snippet demonstrates how to use this feature in the platform
-file. The structure of the files "link1.bw" and "link1.lat" is shown below.
-
-@verbatim
-<link id="LINK1" state_file="link1.fail" bandwidth="80000000" latency=".0001" bandwidth_file="link1.bw" latency_file="link1.lat" />
-@endverbatim
-
-@note
-  Even if the syntax is the same, the semantic of bandwidth and latency
-  trace files differs from that of host availability files. For bandwidth and
-  latency, the corresponding files do not
-  express availability as a fraction of the available capacity but directly in
-  bytes per seconds for the bandwidth and in seconds for the latency. This is
-  because most tools allowing to capture traces on real platforms (such as NWS)
-  express their results this way.
-
-##### Example of "link1.bw" file #####
-
-~~~{.py}
-PERIODICITY 12.0
-4.0 40000000
-8.0 60000000
-~~~
-
-In this example, the bandwidth changes repeatedly, with all changes
-being repeated every 12 seconds.
-
-At the beginning of the the simulation, the link's bandwidth is 80,000,000
-B/s (i.e., 80 Mb/s); this value was defined in the XML snippet above.
-After four seconds, it drops to 40 Mb/s (line 2), and climbs
-back to 60 Mb/s after another 4 seconds (line 3). The value does not change any
-more until the end of the period, that is, after 12 seconds have been simulated).
-At this point, periodicity kicks in and this behavior is repeated: Seconds
-12-16 will experience 80 Mb/s, 16-20 40 Mb/s etc.).
-
-##### Example of "link1.lat" file #####
-
-~~~{.py}
-PERIODICITY 5.0
-1.0 0.001
-2.0 0.01
-3.0 0.001
-~~~
-
-In this example, the latency varies with a period of 5 seconds.
-In the xml snippet above, the latency is initialized to be 0.0001s (100µs). This
-value will be kept during the first second, since the latency_file contains
-changes to this value at second one, two and three.
-At second one, the value will be 0.001, i.e., 1ms. One second later it will
-be adjusted to 0.01 (or 10ms) and one second later it will be set again to 1ms. The
-value will not change until second 5, when the periodicity defined in line 1
-kicks in. It then loops back, starting at 100µs (the initial value) for one second.
-
-#### The ``<prop/>`` tag ####
-
-Similar to the ``<host>`` tag, a link may also contain the ``<prop/>`` tag; see the host
-documentation (Section @ref pf_tag_host) for an example.
-
-
 @subsubsection pf_backbone <backbone/>
 
 @note
@@ -459,7 +305,7 @@ these might also help you to get started.
 Attribute name  | Mandatory | Values | Description
 --------------- | --------- | ------ | -----------
 id              | yes       | string | Identifier of this storage_type; used when referring to it
-model           | no        | string | In the future, this will allow to change the performance model to use
+model           | no        | string | In the future, this will allow one to change the performance model to use
 size            | yes       | string | Specifies the amount of available storage space; you can specify storage like "500GiB" or "500GB" if you want. (TODO add a link to all the available abbreviations)
 content         | yes       | string | Path to a @ref pf_storage_content_file "Storage Content File" on your system. This file must exist.
 
@@ -921,24 +767,6 @@ it means that it must pass through router1 to get out of the zone, then
 pass through link1, and get into zone2 by being received by router2.
 router1 must belong to zone1 and router2 must belong to zone2.
 
-@subsubsection pf_tag_linkctn &lt;link_ctn&gt;
-
-This entity has only one purpose: Refer to an already existing
-@ref pf_tag_link "&lt;link/&gt;" when defining a route, i.e., it
-can only occur as a child of @ref pf_tag_route "&lt;route/&gt;"
-
-| Attribute name  | Mandatory | Values | Description                                                   |
-| --------------- | --------- | ------ | -----------                                                   |
-| id              | yes       | String | The identifier of the link that should be added to the route. |
-| direction       | maybe     | UP@|DOWN | If the link referenced by @c id has been declared as @ref pf_sharing_policy_splitduplex "SPLITDUPLEX", this indicates which direction the route traverses through this link: UP or DOWN. If you don't use SPLITDUPLEX, do not use this attribute or SimGrid will not find the right link.
-
-#### Example Files ####
-
-This is an automatically generated list of example files that use the @c &lt;link_ctn/&gt;
-entity (the path is given relative to SimGrid's source directory):
-
-@verbinclude example_filelist_xmltag_linkctn
-
 @subsubsection pf_tag_zoneroute &lt;zoneRoute&gt;
 
 The purpose of this entity is to define a route between two
@@ -1037,7 +865,7 @@ As said before, once you choose
 a model, it (most likely; the constant network model, for example, doesn't) calculates routes for you. But maybe you want to
 define some of your routes, which will be specific. You may also want
 to bypass some routes defined in lower level zone at an upper stage:
-<b>bypasszoneroute</b> is the tag you're looking for. It allows to
+<b>bypasszoneroute</b> is the tag you're looking for. It allows one to
 bypass routes defined between already defined between zone (if you want
 to bypass route for a specific host, you should just use byPassRoute).
 The principle is the same as zoneroute: <b>bypasszoneroute</b> contains
@@ -1074,7 +902,7 @@ As said before, once you choose
 a model, it (most likely; the constant network model, for example, doesn't) calculates routes for you. But maybe you want to
 define some of your routes, which will be specific. You may also want
 to bypass some routes defined in lower level zone at an upper stage:
-<b>bypassRoute</b> is the tag you're looking for. It allows to bypass
+<b>bypassRoute</b> is the tag you're looking for. It allows one to bypass
 routes defined between <b>host/router</b>. The principle is the same
 as route: <b>bypassRoute</b> contains list of links references of
 links that are in the path between src and dst.
@@ -1176,60 +1004,6 @@ directly describing the platform:
   - @ref pf_tag_config passes configuration options, e.g. to change the network model;
   - @ref pf_tag_prop gives user-defined properties to various elements
 
-@subsection pf_tag_config &lt;config&gt;
-
-Adding configuration flags into the platform file is particularly
-useful when the described platform is best used with specific
-flags. For example, you could finely tune SMPI in your platform file directly.
-
-| Attribute  | Values              | Description                                    |
-| ---------- | ------------------- | ---------------------------------------------- |
-| id         | String (optional)   | This optional identifier is ignored by SimGrid |
-
-* **Included tags:** @ref pf_tag_prop to specify a given configuration item (see @ref options).
-
-Any such configuration must be given at the very top of the platform file.
-
-* **Example**
-
-@verbatim
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-<platform version="4">
-<config>
-       <prop id="maxmin/precision" value="0.000010" />
-       <prop id="cpu/optim" value="TI" />
-       <prop id="network/model" value="SMPI" />
-       <prop id="smpi/bw-factor" value="65472:0.940694;15424:0.697866;9376:0.58729" />
-</config>
-
-<zone  id="zone0"  routing="Full">
-...
-@endverbatim
-
-@subsection pf_tag_prop &lt;prop&gt;
-
-Defines a user-defined property, identified with a name and having a
-value. You can specify such properties to most kind of resources:
-@ref pf_tag_zone, @ref pf_tag_host, @ref pf_tag_storage,
-@ref pf_tag_cluster and @ref pf_tag_link. These values can be retrieved
-at runtime with MSG_zone_property() or simgrid::s4u::NetZone::property(),
-or similar functions.
-
-| Attribute | Values                  | Description                                                                               |
-| --------- | ----------------------  | ----------------------------------------------------------------------------------------- |
-| id        | String (mandatory)      | Identifier of this property. Must be unique for a given property holder, eg host or link. |
-| value     | String (mandatory)      | Value of this property; The semantic is completely up to you.                             |
-
-* **Included tags:** none.
-
-#### Example ####
-
-@code{.xml}
-<prop id="Operating System" value="Linux" />
-@endcode
-
-
 @subsection pf_trace trace and trace_connect
 
 Both tags are an alternate way to pass files containing information on
index 123a25d..72a8605 100644 (file)
@@ -27,7 +27,7 @@ Mimicking the OS behavior may seem over-engineered here, but this is
 mandatory to the model-checker. The simcalls, representing actors'
 actions, are the transitions of the formal system. Verifying the
 system requires to manipulate these transitions explicitly. This also
-allows to run safely the actors in parallel, even if this is less
+allows one to run the actors safely in parallel, even if this is less
 commonly used by our users.
 
 So, the key ideas here are:
@@ -708,20 +708,15 @@ std::cv_status ConditionVariable::wait_for(
     simcall_cond_wait_timeout(cond_, lock.mutex()->mutex_, timeout);
     return std::cv_status::no_timeout;
   }
-  catch (xbt_ex& e) {
-
+  catch (const simgrid::TimeoutException& e) {
     // If the exception was a timeout, we have to take the lock again:
-    if (e.category == timeout_error) {
-      try {
-        lock.mutex()->lock();
-        return std::cv_status::timeout;
-      }
-      catch (...) {
-        std::terminate();
-      }
+    try {
+      lock.mutex()->lock();
+      return std::cv_status::timeout;
+    }
+    catch (...) {
+      std::terminate();
     }
-
-    std::terminate();
   }
   catch (...) {
     std::terminate();
@@ -958,4 +953,4 @@ auto makeTask(F code, Args... args)
     in the simulation which we would like to avoid.
     `std::try_lock()` should be safe to use though.
 
-*/
\ No newline at end of file
+*/
index 4096cfd..d51e6ed 100755 (executable)
@@ -2,6 +2,9 @@
 #
 # Simplistic script to rebuild our documentation with sphinx-build
 
+# Python needs to find simgrid on my machine, but not ctest -- sorry for the hack
+if [ -e /opt/simgrid ] ; then chmod +x /opt/simgrid; fi
+
 set -e
 
 if [ "x$1" != 'xdoxy' -a -e build/xml ] ; then
@@ -53,3 +56,16 @@ do
     fi
   fi
 done
+
+if [ -e /opt/simgrid ] ; then chmod -x /opt/simgrid; fi
+
+set +e # Don't fail
+if [ -e /usr/bin/linkchecker ] ; then
+  linkchecker --no-status -o csv --ignore-url='.*\.css$' --ignore-url=public/java/org build/html \
+     | grep -v '^#' \
+     | grep -v 'urlname;parentname;baseref;result;warningstring'
+  echo "done."
+else
+  echo "Install linkchecker to have it executed when you build the doc."
+fi
+
index d72c68d..f8f9244 100644 (file)
@@ -15,3 +15,4 @@ MSG_init_nocheck
 intrusive_ptr_release
 intrusive_ptr_add_ref
 get_filtered_netzones_recursive
+simgrid::s4u::Storage
\ No newline at end of file
index a3cb871..01f3636 100644 (file)
@@ -11,7 +11,11 @@ arguments. It is intended to be easy to use to regular MPI users.
 .SH MANDATORY PARAMETERS
 .TP
 \fB\-platform\fR <platform.xml>
-XML file describing the platform on which we want to deploy the program 
+XML file describing the platform on which we want to deploy the program.
+Please refer to the
+.UR https://simgrid.org/doc/latest/Tutorial_MPI_Applications.html#describing-your-platform
+online documentation.
+.UE
 .TP
 \fB\-hostfile\fR, \fB\-machinefile\fR <hostfile>
 Hostfile listing all the machines in use
@@ -21,7 +25,7 @@ be mixed with the configuration options described in the next section.
 
 .TP
 \fB\-help\fR
-Print the usage and a résumé of the available options
+Print the usage and a summary of the available options.
 .TP
 \fB\-keep-temps\fR
 Do not remove the generated files after execution.
@@ -66,12 +70,15 @@ Trace resource utilization.
 .TP
 \fB\-trace-file\fR <tracefile>
 Name of the tracefile
+.TP
+\fB\-quiet\fR 
+Reduce output verbosity. This is useful to make tests reproducible.
 
 .SH SIMULATION OPTIONS
 You can change many simulation parameter on the command line by passing
 \fB--cfg\fR=\fIparameter\fR:\fIvalue\fR after the program name. 
 A full list of existing parameters and their meaning can be found at
-http://simgrid.gforge.inria.fr/simgrid/latest/doc/options.html 
+https://simgrid.org/doc/latest/Configuring_SimGrid.html
 
 Here are some options commonly used with SMPI:
 .TP
index 2c64af2..0e10180 100644 (file)
@@ -1,5 +1,4 @@
 breathe
-javasphinx
 sphinx>=1.8.0
 sphinx_rtd_theme
-
+javasphinx
index 1aa55d8..4414983 100644 (file)
@@ -33,7 +33,7 @@ example, to set the item ``Item`` to the value ``Value``, simply
 type the following on the command-line:
 
 .. code-block:: shell
-               
+
    my_simulator --cfg=Item:Value (other arguments)
 
 Several ``--cfg`` command line arguments can naturally be used. If you
@@ -42,7 +42,7 @@ argument. You can even escape the included quotes (write @' for ' if
 you have your argument between ').
 
 Another solution is to use the ``<config>`` tag in the platform file. The
-only restriction is that this tag must occure before the first
+only restriction is that this tag must occur before the first
 platform element (be it ``<zone>``, ``<cluster>``, ``<peer>`` or whatever).
 The ``<config>`` tag takes an ``id`` attribute, but it is currently
 ignored so you don't really need to pass it. The important part is that
@@ -52,7 +52,7 @@ can be done by adding the following to the beginning of your platform
 file:
 
 .. code-block:: xml
-               
+
   <config>
     <prop id="Item" value="Value"/>
   </config>
@@ -61,27 +61,28 @@ A last solution is to pass your configuration directly in your program
 with :cpp:func:`simgrid::s4u::Engine::set_config` or :cpp:func:`MSG_config`.
 
 .. code-block:: cpp
-               
+
    #include <simgrid/s4u.hpp>
 
    int main(int argc, char *argv[]) {
      simgrid::s4u::Engine e(&argc, argv);
-     
+
      e->set_config("Item:Value");
-     
+
      // Rest of your code
    }
 
 .. _options_list:
-   
+
 Existing Configuration Items
 ----------------------------
 
 .. note::
   The full list can be retrieved by passing ``--help`` and
-  ``--help-cfg`` to an executable that uses SimGrid.
-
-- **clean-atexit:** :ref:`cfg=clean-atexit`
+  ``--help-cfg`` to an executable that uses SimGrid. Try passing
+  ``help`` as a value to get the list of values accepted by a given
+  option. For example, ``--cfg=plugin:help`` will give you the list
+  of plugins available in your installation of SimGrid.
 
 - **contexts/factory:** :ref:`cfg=contexts/factory`
 - **contexts/guard-size:** :ref:`cfg=contexts/guard-size`
@@ -94,6 +95,10 @@ Existing Configuration Items
 - **cpu/model:** :ref:`options_model_select`
 - **cpu/optim:** :ref:`Cpu Optimization Level <options_model_optim>`
 
+- **debug/breakpoint:** :ref:`cfg=debug/breakpoint`
+- **debug/clean-atexit:** :ref:`cfg=debug/clean-atexit`
+- **debug/verbose-exit:** :ref:`cfg=debug/verbose-exit`
+
 - **exception/cutpath:** :ref:`cfg=exception/cutpath`
 
 - **host/model:** :ref:`options_model_select`
@@ -107,14 +112,11 @@ Existing Configuration Items
 - **model-check/checkpoint:** :ref:`cfg=model-check/checkpoint`
 - **model-check/communications-determinism:** :ref:`cfg=model-check/communications-determinism`
 - **model-check/dot-output:** :ref:`cfg=model-check/dot-output`
-- **model-check/hash:** :ref:`cfg=model-checker/hash`
 - **model-check/max-depth:** :ref:`cfg=model-check/max-depth`
 - **model-check/property:** :ref:`cfg=model-check/property`
-- **model-check/record:** :ref:`cfg=model-check/record`
 - **model-check/reduction:** :ref:`cfg=model-check/reduction`
 - **model-check/replay:** :ref:`cfg=model-check/replay`
 - **model-check/send-determinism:** :ref:`cfg=model-check/send-determinism`
-- **model-check/sparse-checkpoint:** :ref:`cfg=model-check/sparse-checkpoint`
 - **model-check/termination:** :ref:`cfg=model-check/termination`
 - **model-check/timeout:** :ref:`cfg=model-check/timeout`
 - **model-check/visited:** :ref:`cfg=model-check/visited`
@@ -132,14 +134,13 @@ Existing Configuration Items
 - **path:** :ref:`cfg=path`
 - **plugin:** :ref:`cfg=plugin`
 
-- **simix/breakpoint:** :ref:`cfg=simix/breakpoint`
-
 - **storage/max_file_descriptors:** :ref:`cfg=storage/max_file_descriptors`
 
 - **surf/precision:** :ref:`cfg=surf/precision`
 
 - **For collective operations of SMPI,** please refer to Section :ref:`cfg=smpi/coll-selector`
 - **smpi/async-small-thresh:** :ref:`cfg=smpi/async-small-thresh`
+- **smpi/buffering:** :ref:`cfg=smpi/buffering`
 - **smpi/bw-factor:** :ref:`cfg=smpi/bw-factor`
 - **smpi/coll-selector:** :ref:`cfg=smpi/coll-selector`
 - **smpi/comp-adjustment-file:** :ref:`cfg=smpi/comp-adjustment-file`
@@ -169,7 +170,6 @@ Existing Configuration Items
 - **Tracing configuration options** can be found in Section :ref:`tracing_tracing_options`
 
 - **storage/model:** :ref:`options_model_select`
-- **verbose-exit:** :ref:`cfg=verbose-exit`
 
 - **vm/model:** :ref:`options_model_select`
 
@@ -183,7 +183,7 @@ Configuring the Platform Models
 Choosing the Platform Models
 ............................
 
-SimGrid comes with several network, CPU and storage models built in,
+SimGrid comes with several network, CPU and disk models built in,
 and you can change the used model at runtime by changing the passed
 configuration. The three main configuration items are given below.
 For each of these items, passing the special ``help`` value gives you
@@ -193,13 +193,13 @@ models). Also, ``--help-models`` should provide information about all
 models for all existing resources.
 
 - ``network/model``: specify the used network model. Possible values:
-  
+
   - **LV08 (default one):** Realistic network analytic model
     (slow-start modeled by multiplying latency by 13.01, bandwidth by
     .97; bottleneck sharing uses a payload of S=20537 for evaluating
     RTT). Described in `Accuracy Study and Improvement of Network
     Simulation in the SimGrid Framework
-    <http://mescal.imag.fr/membres/arnaud.legrand/articles/simutools09.pdf>`_.     
+    <http://mescal.imag.fr/membres/arnaud.legrand/articles/simutools09.pdf>`_.
   - **Constant:** Simplistic network model where all communication
     take a constant time (one second). This model provides the lowest
     realism, but is (marginally) faster.
@@ -216,14 +216,12 @@ models for all existing resources.
     without corrective factors. The timings of small messages are thus
     poorly modeled. This model is described in `A Network Model for
     Simulation of Grid Application
-    <ftp://ftp.ens-lyon.fr/pub/LIP/Rapports/RR/RR2002/RR2002-40.ps.gz>`_.
-  - **Reno/Reno2/Vegas:** Models from Steven H. Low using lagrange_solve instead of
-    lmm_solve (experts only; check the code for more info).
-  - **NS3** (only available if you compiled SimGrid accordingly): 
+    <https://hal.inria.fr/inria-00071989/document>`_.
+  - **ns-3** (only available if you compiled SimGrid accordingly):
     Use the packet-level network
-    simulators as network models (see :ref:`pls_ns3`).
+    simulators as network models (see :ref:`model_ns3`).
     This model can be :ref:`further configured <options_pls>`.
-    
+
 - ``cpu/model``: specify the used CPU model.  We have only one model
   for now:
 
@@ -233,12 +231,12 @@ models for all existing resources.
   network card. Three models exists, but actually, only 2 of them are
   interesting. The "compound" one is simply due to the way our
   internal code is organized, and can easily be ignored. So at the
-  end, you have two host models: The default one allows to aggregate
+  end, you have two host models: The default one allows aggregation of
   an existing CPU model with an existing network model, but does not
   allow parallel tasks because these beasts need some collaboration
   between the network and CPU model. That is why, ptask_07 is used by
   default when using SimDag.
-  
+
   - **default:** Default host model. Currently, CPU:Cas01 and
     network:LV08 (with cross traffic enabled)
   - **compound:** Host model that is automatically chosen if
@@ -264,7 +262,7 @@ is, all our analytical models) accept specific optimization
 configurations.
 
   - items ``network/optim`` and ``cpu/optim`` (both default to 'Lazy'):
-    
+
     - **Lazy:** Lazy action management (partial invalidation in lmm +
       heap in action remaining).
     - **TI:** Trace integration. Highly optimized mode when using
@@ -272,7 +270,7 @@ configurations.
       now).
     - **Full:** Full update of remaining and variables. Slow but may be
       useful when debugging.
-      
+
   - items ``network/maxmin-selective-update`` and
     ``cpu/maxmin-selective-update``: configure whether the underlying
     should be lazily updated or not. It should have no impact on the
@@ -340,7 +338,7 @@ be retrieved using the following commands. Both give a set of values,
 and you should use the last one, which is the maximal size.
 
 .. code-block:: shell
-               
+
    cat /proc/sys/net/ipv4/tcp_rmem # gives the sender window
    cat /proc/sys/net/ipv4/tcp_wmem # gives the receiver window
 
@@ -348,7 +346,7 @@ and you should use the last one, which is the maximal size.
 .. _cfg=network/bandwidth-factor:
 .. _cfg=network/latency-factor:
 .. _cfg=network/weight-S:
-   
+
 Correcting Important Network Parameters
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -399,10 +397,10 @@ Note that with the default host model this option is activated by default.
 
 .. _cfg=smpi/async-small-thresh:
 
-Simulating Asyncronous Send
-^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Simulating Asynchronous Send
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-(this configuration item is experimental and may change or disapear)
+(this configuration item is experimental and may change or disappear)
 
 It is possible to specify that messages below a certain size will be
 sent as soon as the call to MPI_Send is issued, without waiting for
@@ -414,20 +412,20 @@ receiving mode of the mailbox with a call to
 this mailbox will have this behavior regardless of the message size.
 
 This value needs to be smaller than or equals to the threshold set at
-@ref options_model_smpi_detached , because asynchronous messages are
-meant to be detached as well.
+:ref:`cfg=smpi/send-is-detached-thresh`, because asynchronous messages
+are meant to be detached as well.
 
 .. _options_pls:
 
-Configuring NS3
-^^^^^^^^^^^^^^^
+Configuring ns-3
+^^^^^^^^^^^^^^^^
 
-**Option** ``ns3/TcpModel`` **Default:** "default" (NS3 default)
+**Option** ``ns3/TcpModel`` **Default:** "default" (ns-3 default)
 
-When using NS3, there is an extra item ``ns3/TcpModel``, corresponding
+When using ns-3, there is an extra item ``ns3/TcpModel``, corresponding
 to the ``ns3::TcpL4Protocol::SocketType`` configuration item in
-NS3. The only valid values (enforced on the SimGrid side) are
-'default' (no change to the NS3 configuration), 'NewReno' or 'Reno' or
+ns-3. The only valid values (enforced on the SimGrid side) are
+'default' (no change to the ns-3 configuration), 'NewReno' or 'Reno' or
 'Tahoe'.
 
 Configuring the Storage model
@@ -449,7 +447,7 @@ application requires it or to reduce it to save memory space.
 Activating Plugins
 ------------------
 
-SimGrid plugins allow to extend the framework without changing its
+SimGrid plugins allow one to extend the framework without changing its
 source code directly. Read the source code of the existing plugins to
 learn how to do so (in ``src/plugins``), and ask your questions to the
 usual channels (Stack Overflow, Mailing list, IRC). The basic idea is
@@ -469,26 +467,52 @@ Here is the full list of plugins that can be activated this way:
    computations. More details in @ref plugin_energy.
  - **link_energy:** keeps track of the energy dissipated by
    communications. More details in @ref SURF_plugin_energy.
- - **host_load:** keeps track of the computational load. 
+ - **host_load:** keeps track of the computational load.
    More details in @ref plugin_load.
 
 .. _options_modelchecking:
-   
+
 Configuring the Model-Checking
 ------------------------------
 
-To enable the SimGrid model-checking support the program should
+To enable SimGrid's model-checking support, the program should
 be executed using the simgrid-mc wrapper:
 
 .. code-block:: shell
-               
+
    simgrid-mc ./my_program
 
 Safety properties are expressed as assertions using the function
 :cpp:func:`void MC_assert(int prop)`.
 
+.. _cfg=smpi/buffering:
+
+Specifying the MPI buffering behavior
+.....................................
+
+**Option** ``smpi/buffering`` **Default:** infty
+
+Buffering in MPI has a huge impact on the communication semantic. For example,
+standard blocking sends are synchronous calls when the system buffers are full
+while these calls can complete immediately without even requiring a matching
+receive call for small messages sent when the system buffers are empty.
+
+In SMPI, this depends on the message size, that is compared against two thresholds:
+
+- if (size < :ref:`smpi/async-small-thresh <cfg=smpi/async-small-thresh>`) then
+  MPI_Send returns immediately, even if the corresponding receive has not be issued yet.
+- if (:ref:`smpi/async-small-thresh <cfg=smpi/async-small-thresh>` < size < :ref:`smpi/send-is-detached-thresh <cfg=smpi/send-is-detached-thresh>`) then
+  MPI_Send returns as soon as the corresponding receive has been issued. This is known as the eager mode.
+- if (:ref:`smpi/send-is-detached-thresh <cfg=smpi/send-is-detached-thresh>` < size) then
+  MPI_Send returns only when the message has actually been sent over the network. This is known as the rendez-vous mode.
+
+The ``smpi/buffering`` option gives an easier interface to choose between these semantics. It can take two values:
+
+- **zero:** means that buffering should be disabled. Blocking communications are actually blocking.
+- **infty:** means that buffering should be made infinite. Blocking communications are non-blocking.
+
 .. _cfg=model-check/property:
-     
+
 Specifying a liveness property
 ..............................
 
@@ -496,20 +520,20 @@ Specifying a liveness property
 
 If you want to specify liveness properties, you have to pass them on
 the command line, specifying the name of the file containing the
-property, as formatted by the ltl2ba program.
-
+property, as formatted by the ltl2ba program. Note that ltl2ba is not
+part of SimGrid and must be installed separatly.
 
 .. code-block:: shell
-               
+
    simgrid-mc ./my_program --cfg=model-check/property:<filename>
 
 .. _cfg=model-check/checkpoint:
-   
+
 Going for Stateful Verification
 ...............................
 
 By default, the system is backtracked to its initial state to explore
-another path instead of backtracking to the exact step before the fork
+another path, instead of backtracking to the exact step before the fork
 that we want to explore (this is called stateless verification). This
 is done this way because saving intermediate states can rapidly
 exhaust the available memory. If you want, you can change the value of
@@ -525,42 +549,51 @@ Specifying the kind of reduction
 ................................
 
 The main issue when using the model-checking is the state space
-explosion. To counter that problem, you can chose a exploration
-reduction techniques with
+explosion. You can activate some reduction technique with
 ``--cfg=model-check/reduction:<technique>``. For now, this
 configuration variable can take 2 values:
 
- - **none:** Do not apply any kind of reduction (mandatory for now for
-   liveness properties)
+ - **none:** Do not apply any kind of reduction (mandatory for
+   liveness properties, as our current DPOR algorithm breaks cycles)
  - **dpor:** Apply Dynamic Partial Ordering Reduction. Only valid if
    you verify local safety properties (default value for safety
    checks).
 
-There is unfortunately no silver bullet here, and the most efficient
-reduction techniques cannot be applied to any properties. In
-particular, the DPOR method cannot be applied on liveness properties
-since our implementation of DPOR may break some cycles, while cycles
-are very important to the soundness of the exploration for liveness
-properties.
+Another way to mitigate the state space explosion is to search for
+cycles in the exploration with the :ref:`cfg=model-check/visited`
+configuration. Note that DPOR and state-equality reduction may not
+play well together. You should choose between them.
+
+Our current DPOR implementation could be improved in may ways. We are
+currently improving its efficiency (both in term of reduction ability
+and computational speed), and future work could make it compatible
+with liveness properties.
 
 .. _cfg=model-check/visited:
 
-Size of Cycle Detection Set
-...........................
+Size of Cycle Detection Set (state equality reduction)
+......................................................
 
-In order to detect cycles, the model-checker needs to check if a new
-explored state is in fact the same state than a previous one. For
-that, the model-checker can take a snapshot of each visited state:
-this snapshot is then used to compare it with subsequent states in the
-exploration graph.
+Mc SimGrid can be asked to search for cycles during the exploration,
+i.e. situations where a new explored state is in fact the same state
+than a previous one.. This can prove useful to mitigate the state
+space explosion with safety properties, and this is the crux when
+searching for counter-examples to the liveness properties.
 
-The ``model-check/visited`` item is the maximum number of states which
+Note that this feature may break the current implementation of the
+DPOR reduction technique.
+
+The ``model-check/visited`` item is the maximum number of states, which
 are stored in memory. If the maximum number of snapshotted state is
 reached, some states will be removed from the memory and some cycles
 might be missed. Small values can lead to incorrect verifications, but
-large value can exhaust your memory, so choose carefully.
+large values can exhaust your memory and be CPU intensive as each new
+state must be compared to that amount of older saved states.
 
-By default, no state is snapshotted and cycles cannot be detected.
+The default settings depend on the kind of exploration. With safety
+checking, no state is snapshotted and cycles cannot be detected. With
+liveness checking, all states are snapshotted because missing a cycle
+could hinder the exploration soundness.
 
 .. _cfg=model-check/termination:
 
@@ -569,7 +602,7 @@ Non-Termination Detection
 
 The ``model-check/termination`` configuration item can be used to
 report if a non-termination execution path has been found. This is a
-path with a cycle which means that the program might never terminate.
+path with a cycle, which means that the program might never terminate.
 
 This only works in safety mode, not in liveness mode.
 
@@ -581,10 +614,10 @@ Dot Output
 ..........
 
 If set, the ``model-check/dot-output`` configuration item is the name
-of a file in which to write a dot file of the path leading the found
-property (safety or 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.
+of a file in which to write a dot file of the path leading to the
+property violation discovered (safety or liveness violation), as well
+as the cycle for liveness properties. This dot file can then be fed to the
+graphviz dot tool to generate an corresponding graphical representation.
 
 .. _cfg=model-check/max-depth:
 
@@ -592,19 +625,19 @@ Exploration Depth Limit
 .......................
 
 The ``model-checker/max-depth`` can set the maximum depth of the
-exploration graph of the model-checker. If this limit is reached, a
+exploration graph of the model checker. If this limit is reached, a
 logging message is sent and the results might not be exact.
 
-By default, there is not depth limit.
+By default, there is no depth limit.
 
 .. _cfg=model-check/timeout:
 
 Handling of Timeouts
 ....................
 
-By default, the model-checker does not handle timeout conditions: the `wait`
+By default, the model checker does not handle timeout conditions: the `wait`
 operations never time out. With the ``model-check/timeout`` configuration item
-set to **yes**, the model-checker will explore timeouts of `wait` operations.
+set to **yes**, the model checker will explore timeouts of `wait` operations.
 
 .. _cfg=model-check/communications-determinism:
 .. _cfg=model-check/send-determinism:
@@ -614,97 +647,41 @@ Communication Determinism
 
 The ``model-check/communications-determinism`` and
 ``model-check/send-determinism`` items can be used to select the
-communication determinism mode of the model-checker which checks
+communication determinism mode of the model checker, which checks
 determinism properties of the communications of an application.
 
-.. _cfg=model-check/sparse-checkpoint:
-
-Incremental Checkpoints
-.......................
-
-When the model-checker is configured to take a snapshot of each
-explored state (with the ``model-checker/visited`` item), the memory
-consumption can rapidly reach GiB ou Tib of memory. However, for many
-workloads, the memory does not change much between different snapshots
-and taking a complete copy of each snapshot is a waste of memory.
-
-The ``model-check/sparse-checkpoint`` option item can be set to
-**yes** to avoid making a complete copy of each snapshot. Instead,
-each snapshot will be decomposed in blocks which will be stored
-separately.  If multiple snapshots share the same block (or if the
-same block is used in the same snapshot), the same copy of the block
-will be shared leading to a reduction of the memory footprint.
-
-For many applications, this option considerably reduces the memory
-consumption.  In somes cases, the model-checker might be slightly
-slower because of the time taken to manage the metadata about the
-blocks. In other cases however, this snapshotting strategy will be
-much faster by reducing the cache consumption.  When the memory
-consumption is important, by avoiding to hit the swap or reducing the
-swap usage, this option might be much faster than the basic
-snapshotting strategy.
-
-This option is currently disabled by default.
-
 Verification Performance Considerations
 .......................................
 
 The size of the stacks can have a huge impact on the memory
 consumption when using model-checking. By default, each snapshot will
-save a copy of the whole stacks and not only of the part which is
+save a copy of the whole stacks and not only of the part that is
 really meaningful: you should expect the contribution of the memory
 consumption of the snapshots to be @f$ @mbox{number of processes}
 @times @mbox{stack size} @times @mbox{number of states} @f$.
 
-The ``model-check/sparse-checkpoint`` can be used to reduce the memory
-consumption by trying to share memory between the different snapshots.
-
 When compiled against the model checker, the stacks are not
 protected with guards: if the stack size is too small for your
-application, the stack will silently overflow on other parts of the
+application, the stack will silently overflow into other parts of the
 memory (see :ref:`contexts/guard-size <cfg=contexts/guard-size>`).
 
-.. _cfg=model-checker/hash:
-
-State Hashing
-.............
-
-Usually most of the time of the model-checker is spent comparing states. This
-process is complicated and consumes a lot of bandwidth and cache.
-In order to speedup the state comparison, the experimental ``model-checker/hash``
-configuration item enables the computation of a hash summarizing as much
-information of the state as possible into a single value. This hash can be used
-to avoid most of the comparisons: the costly comparison is then only used when
-the hashes are identical.
-
-Currently most of the state is not included in the hash because the
-implementation was found to be buggy and this options is not as useful as
-it could be. For this reason, it is currently disabled by default.
-
-.. _cfg=model-check/record:
 .. _cfg=model-check/replay:
 
-Record/Replay of Verification
-.............................
+Replaying buggy execution paths from the model checker
+......................................................
 
-As the model-checker keeps jumping at different places in the execution graph,
-it is difficult to understand what happens when trying to debug an application
-under the model-checker. Event the output of the program is difficult to
-interpret. Moreover, the model-checker does not behave nicely with advanced
-debugging tools such as valgrind. For those reason, to identify a trajectory
-in the execution graph with the model-checker and replay this trajcetory and
-without the model-checker black-magic but with more standard tools
-(such as a debugger, valgrind, etc.). For this reason, Simgrid implements an
-experimental record/replay functionnality in order to record a trajectory with
-the model-checker and replay it without the model-checker.
-
-When the model-checker finds an interesting path in the application
-execution graph (where a safety or liveness property is violated), it
-can generate an identifier for this path. To enable this behavious the
-``model-check/record`` must be set to **yes**, which is not the case
-by default.
+Debugging the problems reported by the model checker is challenging:
+First, the application under verification cannot be debugged with gdb
+because the model checker already traces it. Then, the model checker may
+explore several execution paths before encountering the issue, making it
+very difficult to understand the output. Fortunately, SimGrid provides
+the execution path leading to any reported issue so that you can replay
+this path reported by the model checker, enabling the usage of classical
+debugging tools.
 
-Here is an example of output:
+When the model checker finds an interesting path in the application
+execution graph (where a safety or liveness property is violated), it
+generates an identifier for this path. Here is an example of the output:
 
 .. code-block:: shell
 
@@ -713,21 +690,28 @@ Here is an example of output:
    [  0.000000] (0:@) *** PROPERTY NOT VALID ***
    [  0.000000] (0:@) **************************
    [  0.000000] (0:@) Counter-example execution trace:
+   [  0.000000] (0:@)   [(1)Tremblay (app)] MC_RANDOM(3)
+   [  0.000000] (0:@)   [(1)Tremblay (app)] MC_RANDOM(4)
    [  0.000000] (0:@) Path = 1/3;1/4
-   [  0.000000] (0:@) [(1)Tremblay (app)] MC_RANDOM(3)
-   [  0.000000] (0:@) [(1)Tremblay (app)] MC_RANDOM(4)
    [  0.000000] (0:@) Expanded states = 27
    [  0.000000] (0:@) Visited states = 68
    [  0.000000] (0:@) Executed transitions = 46
 
-This path can then be replayed outside of the model-checker (and even
-in non-MC build of simgrid) by setting the ``model-check/replay`` item
-to the given path. The other options should be the same (but the
-model-checker should be disabled).
-
-The format and meaning of the path may change between different
-releases so the same release of Simgrid should be used for the record
-phase and the replay phase.
+The interesting line is ``Path = 1/3;1/4``, which means that you should use
+``--cfg=model-check/replay:1/3;1/4`` to replay your application on the buggy
+execution path. All options (but the model checker related ones) must
+remain the same. In particular, if you ran your application with
+``smpirun -wrapper simgrid-mc``, then do it again. Remove all
+MC-related options, keep the other ones and add
+``--cfg=model-check/replay``.
+
+Currently, if the path is of the form ``X;Y;Z``, each number denotes
+the actor's pid that is selected at each indecision point. If it's of
+the form ``X/a;Y/b``, the X and Y are the selected pids while the a
+and b are the return values of their simcalls. In the previouse
+example, ``1/3;1/4``, you can see from the full output that the actor
+1 is doing MC_RANDOM simcalls, so the 3 and 4 simply denote the values
+that these simcall return.
 
 Configuring the User Code Virtualization
 ----------------------------------------
@@ -768,14 +752,14 @@ the slowest to the most efficient:
    raw implementation.
    |br| Install the relevant library (e.g. with the
    libboost-contexts-dev package on Debian/Ubuntu) and recompile
-   SimGrid. 
+   SimGrid.
  - **raw:** amazingly fast factory using a context switching mechanism
    of our own, directly implemented in assembly (only available for x86
    and amd64 platforms for now) and without any unneeded system call.
 
-The main reason to change this setting is when the debugging tools get
+The main reason to change this setting is when the debugging tools become
 fooled by the optimized context factories. Threads are the most
-debugging-friendly contextes, as they allow to set breakpoints
+debugging-friendly contexts, as they allow one to set breakpoints
 anywhere with gdb and visualize backtraces for all processes, in order
 to debug concurrency issues. Valgrind is also more comfortable with
 threads, but it should be usable with all factories (Exception: the
@@ -801,7 +785,7 @@ want to reduce the ``contexts/stack-size`` item. Its default value is
 as 16 KiB, for example. This *setting is ignored* when using the
 thread factory. Instead, you should compile SimGrid and your
 application with ``-fsplit-stack``. Note that this compilation flag is
-not compatible with the model-checker right now.
+not compatible with the model checker right now.
 
 The operating system should only allocate memory for the pages of the
 stack which are actually used and you might not need to use this in
@@ -832,7 +816,7 @@ application.
 .. _cfg=contexts/nthreads:
 .. _cfg=contexts/parallel-threshold:
 .. _cfg=contexts/synchro:
-  
+
 Running User Code in Parallel
 .............................
 
@@ -843,10 +827,10 @@ simulations may well fail in parallel mode. It is described in
 
 If you are using the **ucontext** or **raw** context factories, you can
 request to execute the user code in parallel. Several threads are
-launched, each of them handling as much user contexts at each run. To
-actiave this, set the ``contexts/nthreads`` item to the amount of
-cores that you have in your computer (or lower than 1 to have
-the amount of cores auto-detected).
+launched, each of them handling the same number of user contexts at each
+run. To activate this, set the ``contexts/nthreads`` item to the amount
+of cores that you have in your computer (or lower than 1 to have the
+amount of cores auto-detected).
 
 Even if you asked several worker threads using the previous option,
 you can request to start the parallel execution (and pay the
@@ -874,7 +858,6 @@ which value is either:
    your machine for no good reason. You probably prefer the other less
    eager schemas.
 
-   
 Configuring the Tracing
 -----------------------
 
@@ -915,7 +898,7 @@ you never used the tracing API.
 - SMPI simulator and traces for a space/time view:
 
   .. code-block:: shell
-     
+
      smpirun -trace ...
 
   The `-trace` parameter for the smpirun script runs the simulation
@@ -935,7 +918,7 @@ reproduce an experiment. You have two ways to do that:
 - Add the contents of a textual file on top of the trace file as comment:
 
   .. code-block:: shell
-                 
+
      --cfg=tracing/comment-file:my_file_with_additional_information.txt
 
 Please, use these two parameters (for comments) to make reproducible
@@ -961,7 +944,7 @@ Configuring SMPI
 ----------------
 
 The SMPI interface provides several specific configuration items.
-These are uneasy to see since the code is usually launched through the
+These are not easy to see, since the code is usually launched through the
 ``smiprun`` script directly.
 
 .. _cfg=smpi/host-speed:
@@ -978,28 +961,28 @@ a ``MPI_Send()``, SMPI will automatically benchmark the duration of
 this code, and create an execution task within the simulator to take
 this into account. For that, the actual duration is measured on the
 host machine and then scaled to the power of the corresponding
-simulated machine. The variable ``smpi/host-speed`` allows to specify
+simulated machine. The variable ``smpi/host-speed`` allows one to specify
 the computational speed of the host machine (in flop/s) to use when
 scaling the execution times. It defaults to 20000, but you really want
-to update it to get accurate simulation results.
+to adjust it to get accurate simulation results.
 
-When the code is constituted of numerous consecutive MPI calls, the
+When the code consists of numerous consecutive MPI calls, the
 previous mechanism feeds the simulation kernel with numerous tiny
 computations. The ``smpi/cpu-threshold`` item becomes handy when this
-impacts badly the simulation performance. It specifies a threshold (in
+impacts badly on the simulation performance. It specifies a threshold (in
 seconds) below which the execution chunks are not reported to the
 simulation kernel (default value: 1e-6).
 
 .. note:: The option ``smpi/cpu-threshold`` ignores any computation
    time spent below this threshold. SMPI does not consider the
-   `amount` of these computations; there is no offset for this. Hence,
-   a value that is too small, may lead to unreliable simulation
-   results.
+   `amount of time` of these computations; there is no offset for
+   this. Hence, a value that is too small, may lead to unreliable
+   simulation results.
 
 In some cases, however, one may wish to disable simulation of
-application computation. This is the case when SMPI is used not to
-simulate an MPI applications, but instead an MPI code that performs
-"live replay" of another MPI app (e.g., ScalaTrace's replay tool,
+the computation of an application. This is the case when SMPI is used not to
+simulate an MPI application, but instead an MPI code that performs
+"live replay" of another MPI app (e.g., ScalaTrace's replay tool, or
 various on-line simulators that run an app at scale). In this case the
 computation of the replay/simulation logic should not be simulated by
 SMPI. Instead, the replay tool or on-line simulator will issue
@@ -1007,16 +990,16 @@ SMPI. Instead, the replay tool or on-line simulator will issue
 being replayed/simulated. At the moment, these computation events can
 be simulated using SMPI by calling internal smpi_execute*() functions.
 
-To disable the benchmarking/simulation of computation in the simulated
+To disable the benchmarking/simulation of computation in the simulated
 application, the variable ``smpi/simulate-computation`` should be set
-to no.  This option just ignores the timings in your simulation; it
+to **no**.  This option just ignores the timings in your simulation; it
 still executes the computations itself. If you want to stop SMPI from
-doing that, you should check the SMPI_SAMPLE macros, documented in 
+doing that, you should check the SMPI_SAMPLE macros, documented in
 Section :ref:`SMPI_adapting_speed`.
 
 +------------------------------------+-------------------------+-----------------------------+
 |  Solution                          | Computations executed?  | Computations simulated?     |
-+====================================+=========================+=============================+   
++====================================+=========================+=============================+
 | --cfg=smpi/simulate-computation:no | Yes                     | Never                       |
 +------------------------------------+-------------------------+-----------------------------+
 | --cfg=smpi/cpu-threshold:42        | Yes, in all cases       | If it lasts over 42 seconds |
@@ -1044,7 +1027,7 @@ The first line is the header - you must include it.  The following
 line means that the code between two consecutive MPI calls on line 30
 in exchange_1.f and line 130 in exchange_1.f should receive a speedup
 of 1.18244559422142. The value for the second column is therefore a
-speedup, if it is larger than 1 and a slow-down if it is smaller
+speedup, if it is larger than 1 and a slowdown if it is smaller
 than 1. Nothing will be changed if it is equal to 1.
 
 Of course, you can set any arbitrary filenames you want (so the start
@@ -1069,15 +1052,15 @@ this option, a series of message sizes and factors are given, helping
 the simulation to be more realistic. For instance, the current default
 value means that messages with size 65472 and more will get a total of
 MAX_BANDWIDTH*0.940694, messages of size 15424 to 65471 will get
-MAX_BANDWIDTH*0.697866 and so on (where MAX_BANDWIDTH denotes the
+MAX_BANDWIDTH*0.697866, and so on (where MAX_BANDWIDTH denotes the
 bandwidth of the link).
 
 An experimental script to compute these factors is available online. See
-http://simgrid.gforge.inria.fr/contrib/smpi-calibration-doc.html
-http://simgrid.gforge.inria.fr/contrib/smpi-saturation-doc.html
+https://framagit.org/simgrid/platform-calibration/
+https://simgrid.org/contrib/smpi-saturation-doc.html
 
 .. _cfg=smpi/display-timing:
-       
+
 Reporting Simulation Time
 .........................
 
@@ -1099,9 +1082,9 @@ Keeping temporary files after simulation
 **Option** ``smpi/keep-temps`` **default:** 0 (false)
 
 SMPI usually generates a lot of temporary files that are cleaned after
-use. This option request to preserve them, for example to debug or
+use. This option requests to preserve them, for example to debug or
 profile your code. Indeed, the binary files are removed very early
-under the dlopen privatization schema, which tend to fool the
+under the dlopen privatization schema, which tends to fool the
 debuggers.
 
 .. _cfg=smpi/lat-factor:
@@ -1120,18 +1103,18 @@ actual bandwidth (i.e., values between 0 and 1 are valid), latency factors
 increase the latency, i.e., values larger than or equal to 1 are valid here.
 
 .. _cfg=smpi/papi-events:
-       
+
 Trace hardware counters with PAPI
 .................................
 
 **Option** ``smpi/papi-events`` **default:** unset
 
-When the PAPI support was compiled in SimGrid, this option takes the
+When the PAPI support is compiled into SimGrid, this option takes the
 names of PAPI counters and adds their respective values to the trace
 files (See Section :ref:`tracing_tracing_options`).
 
 .. warning::
-   
+
    This feature currently requires superuser privileges, as registers
    are queried.  Only use this feature with code you trust! Call
    smpirun for instance via ``smpirun -wrapper "sudo "
@@ -1154,14 +1137,14 @@ Automatic Privatization of Global Variables
 
 **Option** ``smpi/privatization`` **default:** "dlopen" (when using smpirun)
 
-MPI executables are usually meant to be executed in separated
+MPI executables are usually meant to be executed in separate
 processes, but SMPI is executed in only one process. Global variables
-from executables will be placed in the same memory zone and shared
+from executables will be placed in the same memory region and shared
 between processes, causing intricate bugs.  Several options are
 possible to avoid this, as described in the main `SMPI publication
 <https://hal.inria.fr/hal-01415484>`_ and in the :ref:`SMPI
 documentation <SMPI_what_globals>`. SimGrid provides two ways of
-automatically privatizing the globals, and this option allows to
+automatically privatizing the globals, and this option allows one to
 choose between them.
 
   - **no** (default when not using smpirun): Do not automatically
@@ -1192,10 +1175,10 @@ Multiple libraries can be given, semicolon separated.
 
 This configuration option can only use either full paths to libraries,
 or full names.  Check with ldd the name of the library you want to
-use.  Example:
+use.  For example:
 
 .. code-block:: shell
-                 
+
    ldd allpairf90
       ...
       libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3 (0x00007fbb4d91b000)
@@ -1214,9 +1197,9 @@ Simulating MPI detached send
 
 This threshold specifies the size in bytes under which the send will
 return immediately. This is different from the threshold detailed in
-:ref:`options_model_network_asyncsend` because the message is not
-effectively sent when the send is posted. SMPI still waits for the
-correspondant receive to be posted to perform the communication
+:ref:`cfg=smpi/async-small-thresh` because the message is not
+really sent when the send is posted. SMPI still waits for the
+corresponding receive to be posted, in order to perform the communication
 operation.
 
 .. _cfg=smpi/coll-selector:
@@ -1229,8 +1212,8 @@ Simulating MPI collective algorithms
 SMPI implements more than 100 different algorithms for MPI collective
 communication, to accurately simulate the behavior of most of the
 existing MPI libraries. The ``smpi/coll-selector`` item can be used to
-use the decision logic of either OpenMPI or MPICH libraries (by
-default SMPI uses naive version of collective operations).
+select the decision logic either of the OpenMPI or the MPICH libraries. (By
+default SMPI uses naive version of collective operations.)
 
 Each collective operation can be manually selected with a
 ``smpi/collective_name:algo_name``. Available algorithms are listed in
@@ -1258,10 +1241,10 @@ Reduce speed for iprobe calls
 **Option** ``smpi/iprobe-cpu-usage`` **default:** 1 (no change)
 
 MPI_Iprobe calls can be heavily used in applications. To account
-correctly for the energy cores spend probing, it is necessary to
+correctly for the energy that cores spend probing, it is necessary to
 reduce the load that these calls cause inside SimGrid.
 
-For instance, we measured a max power consumption of 220 W for a
+For instance, we measured a maximum power consumption of 220 W for a
 particular application but only 180 W while this application was
 probing. Hence, the correct factor that should be passed to this
 option would be 180/220 = 0.81.
@@ -1320,7 +1303,7 @@ consists of three values.
    and hence accounts also for larger messages. In the first
    section of the example above, this value is "2".
 
-Now, SMPI always checks which section it should take for a given
+Now, SMPI always checks which section it should use for a given
 message; that is, if a message of size 11 is sent with the
 configuration of the example above, only the second section will be
 used, not the first, as the first value of the second section is
@@ -1351,7 +1334,7 @@ Inject constant times for MPI_Test
 By setting this option, you can control the amount of time a process
 sleeps when MPI_Test() is called; this is important, because SimGrid
 normally only advances the time while communication is happening and
-thus, MPI_Test will not add to the time, resulting in a deadlock if
+thus, MPI_Test will not add to the time, resulting in deadlock if it is
 used as a break-condition as in the following example:
 
 .. code-block:: cpp
@@ -1361,8 +1344,8 @@ used as a break-condition as in the following example:
        ...
    }
 
-To speed up execution, we use a counter to keep track on how often we
-already checked if the handle is now valid or not. Hence, we actually
+To speed up execution, we use a counter to keep track of how often we
+checked if the handle is now valid or not. Hence, we actually
 use counter*SLEEP_TIME, that is, the time MPI_Test() causes the
 process to sleep increases linearly with the number of previously
 failed tests. This behavior can be disabled by setting
@@ -1379,28 +1362,28 @@ Factorize malloc()s
 
 If your simulation consumes too much memory, you may want to modify
 your code so that the working areas are shared by all MPI ranks. For
-example, in a bloc-cyclic matrix multiplication, you will only
-allocate one set of blocs, and every processes will share them.
+example, in a block-cyclic matrix multiplication, you will only
+allocate one set of blocks, and all processes will share them.
 Naturally, this will lead to very wrong results, but this will save a
-lot of memory so this is still desirable for some studies. For more on
+lot of memory. So this is still desirable for some studies. For more on
 the motivation for that feature, please refer to the `relevant section
 <https://simgrid.github.io/SMPI_CourseWare/topic_understanding_performance/matrixmultiplication>`_
 of the SMPI CourseWare (see Activity #2.2 of the pointed
-assignment). In practice, change the call to malloc() and free() into
+assignment). In practice, change the calls for malloc() and free() into
 SMPI_SHARED_MALLOC() and SMPI_SHARED_FREE().
 
 SMPI provides two algorithms for this feature. The first one, called 
-``local``, allocates one bloc per call to SMPI_SHARED_MALLOC() in your
-code (each call location gets its own bloc) and this bloc is shared
-amongst all MPI ranks.  This is implemented with the shm_* functions
+``local``, allocates one block per call to SMPI_SHARED_MALLOC()
+(each call site gets its own block) ,and this block is shared
+among all MPI ranks.  This is implemented with the shm_* functions
 to create a new POSIX shared memory object (kept in RAM, in /dev/shm)
-for each shared bloc.
+for each shared block.
 
 With the ``global`` algorithm, each call to SMPI_SHARED_MALLOC()
-returns a new adress, but it only points to a shadow bloc: its memory
-area is mapped on a 1MiB file on disk. If the returned bloc is of size
+returns a new address, but it only points to a shadow block: its memory
+area is mapped on a 1 MiB file on disk. If the returned block is of size
 N MiB, then the same file is mapped N times to cover the whole bloc.
-At the end, no matter how many SMPI_SHARED_MALLOC you do, this will
+At the end, no matter how many times you call SMPI_SHARED_MALLOC, this will
 only consume 1 MiB in memory.
 
 You can disable this behavior and come back to regular mallocs (for
@@ -1408,7 +1391,7 @@ example for debugging purposes) using @c "no" as a value.
 
 If you want to keep private some parts of the buffer, for instance if these
 parts are used by the application logic and should not be corrupted, you
-can use SMPI_PARTIAL_SHARED_MALLOC(size, offsets, offsets_count). Example:
+can use SMPI_PARTIAL_SHARED_MALLOC(size, offsets, offsets_count). For example:
 
 .. code-block:: cpp
 
@@ -1420,14 +1403,14 @@ mem[100..199] are shared while other area remain private.
 Then, it can be deallocated by calling SMPI_SHARED_FREE(mem).
 
 When smpi/shared-malloc:global is used, the memory consumption problem
-is solved, but it may induce too much load on the kernel's pages table. 
-In this case, you should use huge pages so that we create only one
-entry per Mb of malloced data instead of one entry per 4k.
+is solved, but it may induce too much load on the kernel's pages table.
+In this case, you should use huge pages so that the kernel creates only one
+entry per MB of malloced data instead of one entry per 4 kB.
 To activate this, you must mount a hugetlbfs on your system and allocate
 at least one huge page:
 
 .. code-block:: shell
-               
+
     mkdir /home/huge
     sudo mount none /home/huge -t hugetlbfs -o rw,mode=0777
     sudo sh -c 'echo 1 > /proc/sys/vm/nr_hugepages' # echo more if you need more
@@ -1446,39 +1429,39 @@ Inject constant times for MPI_Wtime, gettimeofday and clock_gettime
 This option controls the amount of (simulated) time spent in calls to
 MPI_Wtime(), gettimeofday() and clock_gettime(). If you set this value
 to 0, the simulated clock is not advanced in these calls, which leads
-to issue if your application contains such a loop:
+to issues if your application contains such a loop:
 
 .. code-block:: cpp
-               
+
    while(MPI_Wtime() < some_time_bound) {
         /* some tests, with no communication nor computation */
    }
 
 When the option smpi/wtime is set to 0, the time advances only on
-communications and computations, so the previous code results in an
+communications and computations. So the previous code results in an
 infinite loop: the current [simulated] time will never reach
 ``some_time_bound``.  This infinite loop is avoided when that option
-is set to a small amount, as it is by default since SimGrid v3.21.
+is set to a small value, as it is by default since SimGrid v3.21.
 
 Note that if your application does not contain any loop depending on
 the current time only, then setting this option to a non-zero value
 will slow down your simulations by a tiny bit: the simulation loop has
-to be broken and reset each time your code ask for the current time.
+to be broken out of and reset each time your code asks for the current time.
 If the simulation speed really matters to you, you can avoid this
 extra delay by setting smpi/wtime to 0.
 
 Other Configurations
 --------------------
 
-.. _cfg=clean-atexit:
+.. _cfg=debug/clean-atexit:
 
 Cleanup at Termination
 ......................
 
-**Option** ``clean-atexit`` **default:** on
+**Option** ``debug/clean-atexit`` **default:** on
 
 If your code is segfaulting during its finalization, it may help to
-disable this option to request SimGrid to not attempt any cleanups at
+disable this option to request that SimGrid not attempt any cleanups at
 the end of the simulation. Since the Unix process is ending anyway,
 the operating system will wipe it all.
 
@@ -1489,17 +1472,17 @@ Search Path
 
 **Option** ``path`` **default:** . (current dir)
 
-It is possible to specify a list of directories to search into for the
+It is possible to specify a list of directories to search in for the
 trace files (see :ref:`pf_trace`) by using this configuration
 item. To add several directory to the path, set the configuration
 item several times, as in ``--cfg=path:toto --cfg=path:tutu``
 
-.. _cfg=simix/breakpoint:
+.. _cfg=debug/breakpoint:
 
 Set a Breakpoint
 ................
 
-**Option** ``simix/breakpoint`` **default:** unset
+**Option** ``debug/breakpoint`` **default:** unset
 
 This configuration option sets a breakpoint: when the simulated clock
 reaches the given time, a SIGTRAP is raised.  This can be used to stop
@@ -1513,16 +1496,16 @@ with gdb:
 
    set variable simgrid::simix::breakpoint = 3.1416
 
-.. _cfg=verbose-exit:
-   
+.. _cfg=debug/verbose-exit:
+
 Behavior on Ctrl-C
 ..................
 
-**Option** ``verbose-exit`` **default:** on
+**Option** ``debug/verbose-exit`` **default:** on
 
 By default, when Ctrl-C is pressed, the status of all existing actors
 is displayed before exiting the simulation. This is very useful to
-debug your code, but it can reveal troublesome if you have many
+debug your code, but it can become troublesome if you have many
 actors. Set this configuration item to **off** to disable this
 feature.
 
@@ -1535,14 +1518,14 @@ Truncate local path from exception backtrace
 
 This configuration option is used to remove the path from the
 backtrace shown when an exception is thrown. This is mainly useful for
-the tests: the full file path makes the tests not reproducible because
-the path of source files depend of the build settings. That would
-break most of our tests as we keep comparing output.
+the tests: the full file path would makes the tests non-reproducible because
+the paths of source files depend of the build settings. That would
+break most of the tests since their output is continually compared.
 
 Logging Configuration
 ---------------------
 
-It can be done by using XBT. Go to :ref:`XBT_log` for more details.
+This can be done by using XBT. Go to :ref:`XBT_log` for more details.
 
 .. |br| raw:: html
 
diff --git a/docs/source/Deploying_your_Application.rst b/docs/source/Deploying_your_Application.rst
new file mode 100644 (file)
index 0000000..7c1a299
--- /dev/null
@@ -0,0 +1,116 @@
+.. _deploy:
+
+Deploying your Application
+==========================
+
+.. raw:: html
+
+   <object id="TOC" data="graphical-toc.svg" width="100%" type="image/svg+xml"></object>
+   <script>
+   window.onload=function() { // Wait for the SVG to be loaded before changing it
+     var elem=document.querySelector("#TOC").contentDocument.getElementById("DeployBox")
+     elem.style="opacity:0.93999999;fill:#ff0000;fill-opacity:0.1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1";
+   }
+   </script>
+   <br/>
+   <br/>
+
+There is several ways to deploy the :ref:`application <application>` you want to
+study on your :ref:`simulated platform <platform>`, i.e. to specify which actor
+should be started on which host. You can do so directly in your program (as
+shown in :ref:`these examples <s4u_ex_actors>`), or using an XML deployment
+file. Unless you have a good reason, you should keep your application apart
+from the deployment as it will :ref:`ease your experimental campain afterward
+<howto_science>`.
+
+Deploying actors from XML is easy: it only involves 3 tags: :ref:`pf_tag_actor`,
+:ref:`pf_tag_argument`, and :ref:`pf_tag_prop`. They must be placed in an
+encompassing :ref:`pf_tag_platform`. Here is a first example (search in the
+archive for files named ``???_d.xml`` for more):
+
+.. code-block:: xml
+
+   <?xml version='1.0'?>
+   <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
+   <platform version="4.1">
+     <!-- The following starts an actor that runs the function `alice()` on the given host.
+       -- It is not given any parameter, so its args is empty.
+       -->
+     <actor host="host1" function="alice" />
+
+     <!-- The following starts another actor that runs `bob()` on host2.
+       -- The args of this actor contains "3" and "3000" on creation.
+       -->
+     <actor host="host2" function="bob" />
+       <argument value="3"/>
+       <argument value="3000"/>
+     </actor>
+
+     <!-- Carole runs on 'host3', has 1 parameter "42" in its argv and one property. 
+       -- Use simgrid::s4u::Actor::get_property() to retrieve it.-->
+     <actor host="host3" function="carol">
+       <argument value="42"/>
+       <prop id="SomeProp" value="SomeValue"/>
+     </actor>
+   </platform>
+
+
+-------------------------------------------------------------------------------
+
+.. _pf_tag_actor:
+
+<actor>
+--------
+
+This tag starts a new actor executing the given function on a given host. 
+
+
+**Parent tags:** :ref:`pf_tag_platform` (only in deployment files) |br|
+**Children tags:** :ref:`pf_tag_argument`, :ref:`pf_tag_prop` |br|
+**Attributes:**
+
+:``host``: Host on which this actor should be started (mandatory).
+:``function``: Code to execute.
+
+   That function must be registered beforehand
+   with :cpp:func:`simgrid::s4u::Engine::register_actor` or
+   with :cpp:func:`simgrid::s4u::Engine::register_function`.
+
+   If you are stuck with MSG, use :cpp:func:`MSG_process_create`,
+   :cpp:func:`MSG_process_create_with_arguments` or
+   :cpp:func:`MSG_process_create_with_environment`.
+
+   There is nothing to do in Java, as SimGrid uses introspection abilities to
+   retrieve the classes from their names. You must then use the full class name
+   (including the package name) in your XML file.
+
+:``start_time``: Useful to delay the start of your actor.
+
+        -1 starts the actor immediately.
+:``kill_time``:  Time at which the actor should be killed.
+
+   -1 means that the actor should not be killed automatically.
+:``on_failure``: What to do when the actor's host is turned off and back on.
+
+   Either ``DIE`` (default -- don't restart the actor) or ``RESTART``
+
+-------------------------------------------------------------------------------
+
+.. _pf_tag_argument:
+
+<argument>
+----------
+
+Add a parameter to the actor, to its args vector. Naturally, the semantic of
+these parameters completely depend on your program.
+
+
+**Parent tags:** :ref:`pf_tag_actor`  |br|
+**Children tags:** none |br|
+**Attributes:**
+
+:``value``: The string to add to the actor's args vector.
+
+.. |br| raw:: html
+
+   <br />
index fa84973..22cefd9 100644 (file)
@@ -3,6 +3,7 @@ INPUT                  = ../../include/simgrid/forward.h
 INPUT                 += ../../include/simgrid/s4u
 INPUT                 += ../../include/simgrid/msg.h
 INPUT                 += ../../src/msg/
+INPUT                 += ../../src/plugins/
 RECURSIVE              = YES
 
 EXAMPLE_PATH           = ../../examples
@@ -40,7 +41,5 @@ PREDEFINED             += \
     XBT_PRIVATE= \
     XBT_ATTRIB_NORETURN= \
     XBT_ATTRIB_UNUSED= \
-    XBT_ATTRIB_DEPRECATED_v323(m)= \
-    XBT_ATTRIB_DEPRECATED_v324(m)= \
     XBT_ATTRIB_DEPRECATED_v325(m)= \
-    XBT_ATTRIB_DEPRECATED_v326(m)=
+    XBT_ATTRIB_DEPRECATED_v327(m)=
diff --git a/docs/source/Experimental_Setup.rst b/docs/source/Experimental_Setup.rst
new file mode 100644 (file)
index 0000000..280b809
--- /dev/null
@@ -0,0 +1,29 @@
+.. _scenario:
+
+.. raw:: html
+
+   <object id="TOC" data="graphical-toc.svg" width="100%" type="image/svg+xml"></object>
+   <script>
+   window.onload=function() { // Wait for the SVG to be loaded before changing it
+     var elem=document.querySelector("#TOC").contentDocument.getElementById("XPSetupBox")
+     elem.style="opacity:0.93999999;fill:#ff0000;fill-opacity:0.1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1";
+   }
+   </script>
+   <br/>
+   <br/>
+
+Describing the Experimental Setup
+*********************************
+
+.. todo::
+
+   Main concepts:
+
+   - Deployment file
+   - Availability and state profiles
+   - Reproducible random number generation
+   - Command line options, in particular on the model switching
+
+
+
+            
index 44f4bb9..0c09c08 100644 (file)
@@ -16,11 +16,14 @@ Pre-compiled Packages
 Binaries for Linux
 ^^^^^^^^^^^^^^^^^^
 
-On Debian or Ubuntu, simply type:
+To get all of SimGrid on Debian or Ubuntu, simply type one of the
+following lines, or several lines if you need several languages.
 
 .. code-block:: shell
 
-   apt install simgrid
+   apt install libsimgrid-dev  # if you want to develop in C or C++
+   apt install simgrid-java    # if you want to develop in Java
+   apt install python3-simgrid # if you want to develop in Python
 
 If you build pre-compiled packages for other distributions, drop us an
 email.
@@ -31,7 +34,7 @@ Stable Java Package
 ^^^^^^^^^^^^^^^^^^^
 
 The jar file can be retrieved from the `Release page
-<https://framagit.org/simgrid/simgrid/tags>`_. This file is
+<https://framagit.org/simgrid/simgrid/releases>`_. This file is
 self-contained, including the native components for Linux, macOS and
 Windows. Copy it to your project's classpath and you're set.
 
@@ -40,11 +43,11 @@ Nightly built Java Package
 
 For non-Windows systems (Linux, macOS, or FreeBSD), head to `Jenkins <https://ci.inria.fr/simgrid/job/SimGrid>`_.
 In the build history, pick the last green (or at least yellow) build that is not blinking (i.e., not currently under
-build). In the list, pick a system that is close to yours, and click on the ball in the Debug row. The build artefact
+build). In the list, pick a system that is close to yours, and click on the ball in the Debug row. The build artifact
 will appear at the top of the resulting page.
 
 For Windows, head to `AppVeyor <https://ci.appveyor.com/project/simgrid/simgrid>`_.
-Click on the artefact link on the right, and grab your file. If the latest build failed, there will be no artefact. Then
+Click on the artifact link on the right, and grab your file. If the latest build failed, there will be no artifact. Then
 you will need to first click on "History" at the top and look for the last successful build.
 
 Binary Java Troubleshooting
@@ -73,11 +76,11 @@ C++ compiler (either g++, clang, or icc).
   us. It seems that g++ 5.0 or higher is required nowadays (because of
   boost).  SimGrid compiles well with `clang` or `icc` too.
 Python 3.
-  SimGrid should build without Python, that is only needed by our regresion test suite.
-cmake (v2.8.8).
+  SimGrid should build without Python. That is only needed by our regression test suite.
+cmake (v3.5).
   ``ccmake`` provides a nicer graphical interface compared to ``cmake``.
   Press ``t`` in ``ccmake`` if you need to see absolutely all
-  configuration options (e.g., if your python installation is not standard).
+  configuration options (e.g., if your Python installation is not standard).
 boost (at least v1.48, v1.59 recommended)
   - On Debian / Ubuntu: ``apt install libboost-dev libboost-context-dev``
   - On macOS with homebrew: ``brew install boost``
@@ -102,7 +105,7 @@ Getting the Sources
 ^^^^^^^^^^^^^^^^^^^
 
 Grab the last **stable release** from `FramaGit
-<https://framagit.org/simgrid/simgrid/tags>`_, and compile it as follows:
+<https://framagit.org/simgrid/simgrid/releases>`_, and compile it as follows:
 
 .. code-block:: shell
 
@@ -129,7 +132,7 @@ dependencies.
 Build Configuration
 ^^^^^^^^^^^^^^^^^^^
 
-This section is about **compile-time options**, that are very
+This section is about **compile-time options**, which are very
 different from :ref:`run-time options <options>`. Compile-time options
 fall into two categories. **SimGrid-specific options** define which part
 of the framework to compile while **Generic options** are provided by
@@ -140,7 +143,7 @@ cmake itself.
    Our build system often gets mixed up if you change something on
    your machine after the build configuration.  For example, if
    SimGrid fails to detect your fortran compiler, it is not enough to
-   install a fortran compiler. You also need to clean every Cmake
+   install a fortran compiler. You also need to delete all Cmake
    files, such as ``CMakeCache.txt``. Since Cmake also generates some
    files in the tree, you may need to wipe out your complete tree and
    start with a fresh one when you install new dependencies.
@@ -151,14 +154,13 @@ cmake itself.
 Generic build-time options
 """"""""""""""""""""""""""
 
-These options specify for example the path to various system elements
-(Python path, compiler to use, etc). In most case, CMake automatically
-discovers the right value for these ones, but you can set them
-manually on need.  Notable such variables include ``CC`` and ``CXX``,
-defining respectively the paths to the C and C++ compilers, ``CFLAGS``
-and ``CXXFLAGS`` respectively specifying extra options to pass to the C
-and C++ compilers, or ``PYTHON_EXECUTABLE`` specifying the path to the
-python executable.
+These options specify, for example, the path to various system elements (Python
+path, compiler to use, etc). In most case, CMake automatically discovers the
+right value for these elements, but you can set them manually as needed.
+Notably, such variables include ``CC`` and ``CXX``, defining the paths to the C
+and C++ compilers; ``CFLAGS`` and ``CXXFLAGS`` specifying extra options to pass
+to the C and C++ compilers; and ``PYTHON_EXECUTABLE`` specifying the path to the
+Python executable.
 
 The best way to discover the exact name of the option that you need to
 change is to press ``t`` in the ``ccmake`` graphical interface, as all
@@ -169,8 +171,8 @@ build-time options. You can naturally use the ccmake graphical
 interface for that, or you can use environment variables, or you can
 prefer the ``-D`` flag of ``cmake``.
 
-For example, you can change the compilers with environment variables
-by issuing these commands before launching cmake:
+For example, you can change the compilers by issuing these commands to set some
+environment variables before launching cmake:
 
 .. code-block:: shell
 
@@ -178,7 +180,7 @@ by issuing these commands before launching cmake:
    export CXX=g++-5.1
 
 The same can be done by passing ``-D`` parameters to cmake, as follows.
-Note that the ending dot is mandatory (see :ref:`install_cmake_outsrc`).
+Note that the dot at the end is mandatory (see :ref:`install_cmake_outsrc`).
 
 .. code-block:: shell
 
@@ -188,37 +190,39 @@ SimGrid compilation options
 """""""""""""""""""""""""""
 
 Here is the list of all SimGrid-specific compile-time options (the
-default choice is in uppercase).
+default choice is in upper case).
 
 CMAKE_INSTALL_PREFIX (path)
   Where to install SimGrid (/opt/simgrid, /usr/local, or elsewhere).
 
 enable_compile_optimizations (ON/off)
-  Request the compiler to produce efficient code. You probably want to
-  activate this option, unless you plan modify SimGrid itself:
-  efficient code takes more time to compile, and appears mangled to debuggers.
+  Ask the compiler to produce efficient code. You probably want to
+  leave this option activated, unless you plan to modify SimGrid itself:
+  efficient code takes more time to compile, and appears mangled to some debuggers.
 
 enable_compile_warnings (on/OFF)
-  Request the compiler to issue error messages whenever the source
+  Ask the compiler to issue error messages whenever the source
   code is not perfectly clean. If you are a SimGrid developer, you
   have to activate this option to enforce the code quality. As a
   regular user, this option is of little use.
 
 enable_debug (ON/off)
-  Disabling this option discards all log messages of gravity
+  Disabling this option discards all log messages of severity
   debug or below at compile time (see @ref XBT_log). The resulting
   code is faster than if you discard these messages at
   runtime. However, it obviously becomes impossible to get any debug
   info from SimGrid if something goes wrong.
 
-enable_documentation (ON/off)
-  Generates the documentation pages.
+enable_documentation (on/OFF)
+  Generates the documentation pages. Building the documentation is not
+  as easy as it used to be, and you should probably use the online
+  version for now.
 
 enable_java (on/OFF)
   Generates the java bindings of SimGrid.
 
 enable_jedule (on/OFF)
-  Produces execution traces from SimDag simulations, that can then be visualized with the
+  Produces execution traces from SimDag simulations, which can then be visualized with the
   Jedule external tool.
 
 enable_lua (on/OFF)
@@ -229,7 +233,7 @@ enable_lib_in_jar (ON/off)
 
 enable_lto (ON/off)
   Enables the *Link Time Optimization* in the C++ compiler.
-  This feature really speeds up the produced code, but it is fragile
+  This feature really speeds up the code produced, but it is fragile
   with older gcc versions.
 
 enable_maintainer_mode (on/OFF)
@@ -241,21 +245,25 @@ enable_mallocators (ON/off)
 
 enable_model-checking (on/OFF)
   Activates the formal verification mode. This will **hinder
-  simulation speed** even when the model-checker is not activated at
+  simulation speed** even when the model checker is not activated at
   run time.
 
 enable_ns3 (on/OFF)
-  Activates the ns-3 bindings. See section @ref pls_ns3.
+  Activates the ns-3 bindings. See section :ref:`model_ns3`.
 
 enable_smpi (ON/off)
-  Allows to run MPI code on top of SimGrid.
+  Allows one to run MPI code on top of SimGrid.
 
 enable_smpi_ISP_testsuite (on/OFF)
-  Adds many extra tests for the model-checker module.
+  Adds many extra tests for the model checker module.
 
 enable_smpi_MPICH3_testsuite (on/OFF)
   Adds many extra tests for the MPI module.
 
+minimal-bindings (on/OFF)
+  Take as few optional dependencies as possible, to get minimal
+  library bindings in Java and Python.
+
 Reset the build configuration
 """""""""""""""""""""""""""""
 
@@ -301,7 +309,9 @@ for completion when using the ``Tab`` key. Note that some of the
 existing targets are not really for public consumption so don't worry
 if some do not work for you.
 
-- **make simgrid**: Build only the SimGrid library and not any example
+- **make**: Build the core of SimGrid that gets installed, but not any example.
+- **make tests**: Build the tests and examples.
+- **make simgrid**: Build only the SimGrid library. Not any example nor the helper tools.
 - **make s4u-app-pingpong**: Build only this example (works for any example)
 - **make java-all**: Build all Java examples and their dependencies
 - **make clean**: Clean the results of a previous compilation
@@ -325,12 +335,14 @@ Testing your build
 
 Once everything is built, you may want to test the result. SimGrid
 comes with an extensive set of regression tests (as described in the
-@ref inside_tests "insider manual"). The tests are run with ``ctest``,
-that comes with CMake.  We run them every commit and the results are
-on `our Jenkins <https://ci.inria.fr/simgrid/>`_.
+@ref inside_tests "insider manual"). The tests are not built by
+default, so you first have to build them with ``make tests``. You can
+then run them with ``ctest``, that comes with CMake.  We run them
+every commit and the results are on `our Jenkins <https://ci.inria.fr/simgrid/>`_.
 
 .. code-block:: shell
 
+  make tests                # Build the tests
   ctest                            # Launch all tests
   ctest -R s4u              # Launch only the tests whose names match the string "s4u"
   ctest -j4                 # Launch all tests in parallel, at most 4 concurrent jobs
@@ -342,8 +354,8 @@ on `our Jenkins <https://ci.inria.fr/simgrid/>`_.
 
 .. _install_cmake_mac:
 
-macOS Specifics
-^^^^^^^^^^^^^^^
+macOS-specific instructions
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 SimGrid compiles like a charm with clang (version 3.0 or higher) on macOS:
 
@@ -370,11 +382,11 @@ CMake Error: Parse error in cache file build_dir/CMakeCache.txt. Offending entry
 
 .. _install_cmake_windows:
 
-Windows Specifics
-^^^^^^^^^^^^^^^^^
+Windows-specific instructions
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 The best solution to get SimGrid working on windows is to install the
-Ubuntu subsystem of Windows 10. All of SimGrid (but the model-checker)
+Ubuntu subsystem of Windows 10. All of SimGrid (but the model checker)
 works in this setting.
 
 Native builds not very well supported. Have a look to our `appveypor
@@ -384,19 +396,36 @@ see how we manage to use mingw-64 to build the DLL that the Java file
 needs.
 
 The drawback of MinGW-64 is that the produced DLL are not compatible
-with MS Visual C. `clang-cl <http://clang.llvm.org/docs/MSVCCompatibility.html">`_
-sounds promising to fix this. If you get something working or if you
-have any other improvement, please @ref community_contact "tell us".
+with MS Visual C. Some clang-based tools seem promising to fix this,
+but this is of rather low priority for us. It it's important for you
+and if you get it working, please @ref community_contact "tell us".
+
+Python-specific instructions
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Recompiling the Python bindings from the source should be as easy as:
+
+.. code-block:: shell
 
-Java Specifics
-^^^^^^^^^^^^^^
+  # cd simgrid-source-tree
+  python setup.py build install
+  
+Starting with SimGrid 3.13, it should even be possible to install
+simgrid without downloading the source with pip:
+
+.. code-block:: shell
+
+  pip install simgrid
+
+Java-specific instructions
+^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 Once you have the `full JDK <http://www.oracle.com/technetwork/java/javase/downloads>`_ installed,
 things should be as simple as:
 
 .. code-block:: shell
 
-   cmake -Denable_java=ON .
+   cmake -Denable_java=ON -Dminimal-bindings=ON .
    make  simgrid-java_jar # Only build the jarfile
 
 After the compilation, the file ```simgrid.jar``` is produced in the
@@ -427,8 +456,8 @@ path, and relaunch cmake. If you have several versions of JNI installed
 
 Note that the filename ```jni.h``` was removed from the path.
 
-Linux Multi-Arch Specifics
-^^^^^^^^^^^^^^^^^^^^^^^^^^
+Linux Multi-Arch specific instructions
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 On a multiarch x86_64 Linux, it should be possible to compile a 32-bit
 version of SimGrid with something like:
similarity index 84%
rename from docs/source/intro_concepts.rst
rename to docs/source/Introduction.rst
index db93878..76070c9 100644 (file)
@@ -3,13 +3,18 @@
 Main Concepts
 =============
 
-Typical Study based on SimGrid
-------------------------------
 
 .. raw:: html
 
    <object data="graphical-toc.svg" width="100%" type="image/svg+xml"></object>
+   <br/>
+   <br/>
+
+Introduction
+============
 
+Typical Study based on SimGrid
+------------------------------
 
 Any SimGrid study entails the following components:
 
@@ -20,11 +25,11 @@ Any SimGrid study entails the following components:
 
  - The **Simulated Platform**. This is a description of a given
    distributed system (machines, links, disks, clusters, etc). Most of
-   the platform files are written in XML althrough a Lua interface is
+   the platform files are written in XML although a Lua interface is
    under development.  SimGrid makes it easy to augment the Simulated
    Platform with a Dynamic Scenario where for example the links are
    slowed down (because of external usage) or the machines fail. You
-   have even support to specify the applicative workload that you want
+   even have support to specify the applicative workload that you want
    to feed to your application
    :ref:`(more info) <platform>`.
 
@@ -32,7 +37,7 @@ Any SimGrid study entails the following components:
    terminology, the application is an inert set of source files and
    binaries. To make it run, you have to describe how your application
    should be deployed on the simulated platform. You need to specify
-   which process is mapped on which machine, along with their parameters
+   which process is mapped onto which machine, along with their parameters
    :ref:`(more info) <scenario>`.
 
  - The **Platform Models**. They describe how the simulated platform
@@ -101,33 +106,33 @@ testing mode, where every possible outcome of your application is
 explored. In some sense, this mode tests your application for all
 possible platforms that you could imagine (and more).
 
-You just provide the application and its deployment (amount of
-processes and parameters), and the model-checker will literally
+You just provide the application and its deployment (number of
+processes and parameters), and the model checker will literally
 explore all possible outcomes by testing all possible message
 interleavings: if at some point a given process can either receive the
 message A first or the message B depending on the platform
-characteristics, the model-checker will explore the scenario where A
+characteristics, the model checker will explore the scenario where A
 arrives first, and then rewind to the same point to explore the
 scenario where B arrives first.
 
-This is a very powerful mode, where you can evaluate the correction of
+This is a very powerful mode, where you can evaluate the correctness of
 your application. It can verify either **safety properties** (asserts)
-or **liveless properties** stating for example that if a given event
+or **liveness properties** stating for example that if a given event
 occurs, then another given event will occur in a finite amount of
 steps. This mode is not only usable with the abstract algorithms
 developed on top of the SimGrid APIs, but also with real MPI
 applications (to some extent).
 
-The main limit of Model Checking lays in the huge amount of scenarios
+The main limit of Model Checking lies in the huge amount of scenarios
 to explore. SimGrid tries to explore only non-redundant scenarios
 thanks to classical reduction techniques (such as DPOR and stateful
 exploration) but the exploration may well never finish if you don't
 carefully adapt your application to this mode.
 
 A classical trap is that the Model Checker can only verify whether
-your application fits the provided properties, which is useless if you
+your application fits the properties provided, which is useless if you
 have a bug in your property. Remember also that one way for your
-application to never violate a given assert is to not start at all
+application to never violate a given assert is to not start at all,
 because of a stupid bug.
 
 Another limit of this mode is that it does not use the performance
@@ -142,28 +147,28 @@ checker.
 
 The model checker may well miss existing issues, as it computes the
 possible outcomes *from a given initial situation*. There is no way to
-prove the correction of your application in all generality with this
+prove the correctness of your application in full generality with this
 tool.
 
 **Benchmark Recording Mode**. During debug sessions, continuous
 integration testing, and other similar use cases, you are often only
-interested in the control flow. If your application apply filters to
-huge images split in small blocks, the filtered image is probably not
+interested in the control flow. If your application applies filters to
+huge images split into small blocks, the filtered image is probably not
 what you are interested in. You are probably looking for a way to run
-each computation kernel only once, save on disk the time it takes and
-some other metadata. This code block can then be skipped in simulation
+each computational kernel only once, and record the time it takes to cache it.
+This code block can then be skipped in simulation
 and replaced by a synthetic block using the cached information. The
 simulated platform will take this block into account without requesting
-the real hosting machine to benchmark it.
+the actual hosting machine to benchmark it.
 
 SimGrid Limits
 --------------
 
-This framework is by no means the perfect holly grail able to solve
-every problem on earth.
+This framework is by no means the holly grail, able to solve
+every problem on Earth.
 
 **SimGrid scope is limited to distributed systems.** Real-time
-multi-threaded systems are out of scope. You could probably tweak
+multi-threaded systems are out of this scope. You could probably tweak
 SimGrid for such studies (or the framework could possibly be extended
 in this direction), but another framework specifically targeting such a
 use case would probably be more suited.
@@ -172,15 +177,14 @@ use case would probably be more suited.
 The framework could certainly be improved in this direction, but this
 still has to be done.
 
-**There is no perfect model, only models adapted to your study.**
-The SimGrid models target fast and large studies yet requesting
-realistic results. In particular, our models abstract away parameters
-and phenomena that are often irrelevant to the realism in our
-context.
+**There is no perfect model, only models adapted to your study.** The SimGrid
+models target fast and large studies, and yet they target realistic results. In
+particular, our models abstract away parameters and phenomena that are often
+irrelevant to reality in our context.
 
-SimGrid is simply not intended to any study that would mandate the
-abstracted phenomenon. Here are some **studies that you should not do
-with SimGrid**:
+SimGrid is obviously not intended for a study of any phenomenon that our
+abstraction removes. Here are some **studies that you should not do with
+SimGrid**:
 
  - Studying the effect of L3 vs. L2 cache effects on your application
  - Comparing kernel schedulers and policies
@@ -221,18 +225,18 @@ we determined the speedup achieved by the Tibidabo ARM-based
 cluster before its construction
 (`paper <http://hal.inria.fr/hal-00919507>`_). In this case,
 some differences between the prediction and the real timings were due to
-misconfiguration or other problems with the real platform. To some extent,
+misconfigurations with the real platform. To some extent,
 SimGrid could even be used to debug the real platform :)
 
 SimGrid is also used to debug, improve, and tune several large
 applications.
 `BigDFT <http://bigdft.org>`_ (a massively parallel code
-computing the electronic structure of chemical elements developped by
+computing the electronic structure of chemical elements developed by
 the CEA), `StarPU <http://starpu.gforge.inria.fr/>`_ (a
 Unified Runtime System for Heterogeneous Multicore Architectures
-developped by Inria Bordeaux) and
+developed by Inria Bordeaux) and
 `TomP2P <https://tomp2p.net/dev/simgrid/>`_ (a high performance
-key-value pair storage library developed at University of Zurich).
+key-value pair storage library developed at the University of Zurich).
 Some of these applications enjoy large user communities themselves.
 
 ..  LocalWords:  SimGrid
diff --git a/docs/source/Platform_Examples.rst b/docs/source/Platform_Examples.rst
new file mode 100644 (file)
index 0000000..fcfb76f
--- /dev/null
@@ -0,0 +1,25 @@
+.. raw:: html
+
+   <object id="TOC" data="graphical-toc.svg" width="100%" type="image/svg+xml"></object>
+   <script>
+   window.onload=function() { // Wait for the SVG to be loaded before changing it
+     var elem=document.querySelector("#TOC").contentDocument.getElementById("ExamplesBox")
+     elem.style="opacity:0.93999999;fill:#ff0000;fill-opacity:0.1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1";
+   }
+   </script>
+   <br/>
+   <br/>
+
+.. _platform_examples:
+   
+Platform Examples
+=================
+
+SimGrid comes with an extensive set of platforms in the
+`examples/platforms <https://framagit.org/simgrid/simgrid/tree/master/examples/platforms>`_
+directory.
+
+.. todo:: Write this page of the manual.
+
+   Gather here the examples described elsewhere in the doc (SMPI tutorial, Platform intro), and describe the other ones.
+   
diff --git a/docs/source/Plugins.rst b/docs/source/Plugins.rst
new file mode 100644 (file)
index 0000000..01c836b
--- /dev/null
@@ -0,0 +1,119 @@
+.. _plugins:
+
+.. raw:: html
+
+   <object id="TOC" data="graphical-toc.svg" width="100%" type="image/svg+xml"></object>
+   <script>
+   window.onload=function() { // Wait for the SVG to be loaded before changing it
+     var elem=document.querySelector("#TOC").contentDocument.getElementById("PluginsBox")
+     elem.style="opacity:0.93999999;fill:#ff0000;fill-opacity:0.1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1";
+   }
+   </script>
+   <br/>
+   <br/>
+
+SimGrid Plugins
+###############
+
+You can extend SimGrid without modifying it, thanks to our plugin
+mechanism. This page describes how to write your own plugin, and
+documents some of the plugins distributed with SimGrid.
+
+- :ref:`Host Energy <plugin_host_energy>`: models the energy dissipation of the compute units.
+- :ref:`Link Energy <plugin_link_energy>`: models the energy dissipation of the network.
+- :ref:`Host Load <plugin_host_load>`: monitors the load of the compute units.
+
+Defining a Plugin
+*****************
+
+A plugin can get some additional code executed within the SimGrid
+kernel, and attach the data needed by that code to the SimGrid
+objects. 
+
+The host load plugin in 
+`src/plugins/host_load.cpp <https://framagit.org/simgrid/simgrid/tree/master/src/plugins/host_load.cpp>`_
+constitutes a good introductory example. It defines a class
+```HostLoad``` that is meant to be attached to each host. This class
+contains a ```EXTENSION_ID``` field that is mandatory to our extension
+mechanism. Then, the function ```sg_host_load_plugin_init```
+initializes the plugin. It first calls
+:cpp:func:`simgrid::s4u::Host::extension_create()` to register its
+extension to the ```s4u::Host``` objects, and then attaches some
+callbacks to signals.
+
+You can attach your own extension to most kinds of s4u object:
+:cpp:class:`Actors <simgrid::s4u::Actor>`,
+:cpp:class:`Disks <simgrid::s4u::Disk>`,
+:cpp:class:`Hosts <simgrid::s4u::Host>` and
+:cpp:class:`Links <simgrid::s4u::Link>`. If you need to extend another
+kind of objects, please let us now.
+
+Partial list of existing signals in s4u:
+
+- :cpp:member:`Actor::on_creation <simgrid::s4u::Actor::on_creation>`
+  :cpp:member:`Actor::on_suspend <simgrid::s4u::Actor::on_suspend>`
+  :cpp:member:`Actor::on_resume <simgrid::s4u::Actor::on_resume>`
+  :cpp:member:`Actor::on_sleep <simgrid::s4u::Actor::on_sleep>`
+  :cpp:member:`Actor::on_wake_up <simgrid::s4u::Actor::on_wake_up>`
+  :cpp:member:`Actor::on_migration_start <simgrid::s4u::Actor::on_migration_start>`
+  :cpp:member:`Actor::on_migration_end <simgrid::s4u::Actor::on_migration_end>`
+  :cpp:member:`Actor::on_termination <simgrid::s4u::Actor::on_termination>`
+  :cpp:member:`Actor::on_destruction <simgrid::s4u::Actor::on_destruction>`
+- :cpp:member:`Comm::on_sender_start <simgrid::s4u::Comm::on_sender_start>`
+  :cpp:member:`Comm::on_receiver_start <simgrid::s4u::Comm::on_receiver_start>`
+  :cpp:member:`Comm::on_completion <simgrid::s4u::Comm::on_completion>`
+- :cpp:member:`Engine::on_platform_creation <simgrid::s4u::Engine::on_platform_creation>`
+  :cpp:member:`Engine::on_platform_created <simgrid::s4u::Engine::on_platform_created>`
+  :cpp:member:`Engine::on_time_advance <simgrid::s4u::Engine::on_time_advance>`
+  :cpp:member:`Engine::on_simulation_end <simgrid::s4u::Engine::on_simulation_end>`
+  :cpp:member:`Engine::on_deadlock <simgrid::s4u::Engine::on_deadlock>`
+- :cpp:member:`Exec::on_start <simgrid::s4u::Exec::on_start>`
+  :cpp:member:`Exec::on_completion <simgrid::s4u::Exec::on_completion>`
+- :cpp:member:`Host::on_creation <simgrid::s4u::Host::on_creation>`
+  :cpp:member:`Host::on_destruction <simgrid::s4u::Host::on_destruction>`
+  :cpp:member:`Host::on_state_change <simgrid::s4u::Host::on_state_change>`
+  :cpp:member:`Host::on_speed_change <simgrid::s4u::Host::on_speed_change>`
+- :cpp:member:`Link::on_creation <simgrid::s4u::Link::on_creation>`
+  :cpp:member:`Link::on_destruction <simgrid::s4u::Link::on_destruction>`
+  :cpp:member:`Link::on_state_change <simgrid::s4u::Link::on_state_change>`
+  :cpp:member:`Link::on_speed_change <simgrid::s4u::Link::on_bandwidth_change>`
+  :cpp:member:`Link::on_communicate <simgrid::s4u::Link::on_communicate>`
+  :cpp:member:`Link::on_communication_state_change <simgrid::s4u::Link::on_communication_state_change>`
+- :cpp:member:`Netzone::on_creation <simgrid::s4u::Netzone::on_creation>`
+  :cpp:member:`Netzone::on_seal <simgrid::s4u::Netzone::on_seal>`
+  :cpp:member:`Netzone::on_route_creation <simgrid::s4u::Netzone::on_route_creation>`
+- :cpp:member:`VirtualMachine::on_start <simgrid::s4u::VirtualMachine::on_start>`
+  :cpp:member:`VirtualMachine::on_started <simgrid::s4u::VirtualMachine::on_started>`
+  :cpp:member:`VirtualMachine::on_suspend <simgrid::s4u::VirtualMachine::on_suspend>`
+  :cpp:member:`VirtualMachine::on_resume <simgrid::s4u::VirtualMachine::on_resume>`
+  :cpp:member:`VirtualMachine::on_migration_start <simgrid::s4u::VirtualMachine::on_migration_start>`
+  :cpp:member:`VirtualMachine::on_migration_end <simgrid::s4u::VirtualMachine::on_migration_end>`
+
+Existing Plugins
+****************
+
+Only the major plugins are described here. Please check in src/plugins
+to explore the other ones.
+
+.. _plugin_host_energy:
+
+Host Energy Plugin
+==================
+
+.. doxygengroup:: Plugin_host_energy
+
+.. _plugin_link_energy:
+
+Link Energy Plugin
+==================
+
+.. doxygengroup:: Plugin_link_energy
+
+.. _plugin_host_load:
+
+Host Load Plugin
+================
+
+.. doxygengroup:: Plugin_host_load
+
+..  LocalWords:  SimGrid
index bf05453..6297e2e 100644 (file)
@@ -57,6 +57,15 @@ manually but your project will produce relevant error messages when
 trying to compile on a machine where SimGrid is not installed. Please
 also refer to the file header for more information.
 
+MPI projects should include ``find_package (MPI)`` in CMakeLists.txt. Then, the
+variables ``MPI_C_COMPILER``, ``MPI_CXX_COMPILER`` and ``MPI_Fortran_COMPILER`` should
+point to the full path of smpicc, smpicxx and smpiff respectively. Example:
+
+.. code-block:: shell
+
+   cmake -DMPI_C_COMPILER=/opt/simgrid/bin/smpicc -DMPI_CXX_COMPILER=/opt/simgrid/bin/smpicxx -DMPI_Fortran_COMPILER=/opt/simgrid/bin/smpiff .
+
+
 Building your project with Makefile
 -----------------------------------
 
index bff4f27..cbb9a8c 100644 (file)
@@ -12,7 +12,7 @@ execute user-provided functions. The actors have to explicitly use the
 S4U interface to express their computation, communication, disk usage
 and other |Activities|_, so that they get reflected within the
 simulator. These activities take place on **Resources** (|Hosts|_,
-|Links|_, |Storages|_). SimGrid predicts the time taken by each
+|Links|_, |Disks|_). SimGrid predicts the time taken by each
 activity and orchestrates accordingly the actors waiting for the
 completion of these activities.
 
@@ -22,41 +22,40 @@ actors, but posted onto a |Mailbox|_ that serve as rendez-vous point
 between communicating actors.
 
 .. |Actors| replace:: **Actors**
-.. _Actors: api/classsimgrid_1_1s4u_1_1Actor.html
+.. _Actors: app_s4u.html#s4u-actor
 
 .. |Activities| replace:: **Activities**
-.. _Activities: api/classsimgrid_1_1s4u_1_1Activity.html
+.. _Activities: app_s4u.html#s4u-activity
 
 .. |Hosts| replace:: **Hosts**
-.. _Hosts: api/classsimgrid_1_1s4u_1_1Host.html
+.. _Hosts: app_s4u.html#s4u-host
 
 .. |Links| replace:: **Links**
-.. _Links: api/classsimgrid_1_1s4u_1_1Link.html
+.. _Links: app_s4u.html#s4u-link
 
-.. |Storages| replace:: **Storages**
-.. _Storages: api/classsimgrid_1_1s4u_1_1Storage.html
+.. |Disks| replace:: **Disks**
+.. _Disks: app_s4u.html#s4u-disk
 
 .. |VirtualMachines| replace:: **VirtualMachines**
-.. _VirtualMachines: api/classsimgrid_1_1s4u_1_1VirtualMachine.html
+.. _VirtualMachines: app_s4u.html#s4u-virtualmachine
 
 .. |Host| replace:: **Host**
-.. _Host: api/classsimgrid_1_1s4u_1_1Host.html
+.. _Host: app_s4u.html#s4u-host
 
 .. |Link| replace:: **Link**
-.. _Link: api/classsimgrid_1_1s4u_1_1Link.html
+.. _Link: app_s4u.html#s4u-link
 
 .. |Mailbox| replace:: **Mailbox**
-.. _Mailbox: api/classsimgrid_1_1s4u_1_1Mailbox.html
+.. _Mailbox: app_s4u.html#s4u-mailbox
 
 .. |Barrier| replace:: **Barrier**
-.. _Barrier: api/classsimgrid_1_1s4u_1_1Barrier.html
+.. _Barrier: app_s4u.html#s4u-barrier
 
 .. |ConditionVariable| replace:: **ConditionVariable**
-.. _ConditionVariable: api/classsimgrid_1_1s4u_1_1ConditionVariable.html
+.. _ConditionVariable: app_s4u.html#s4u-conditionvariable
 
 .. |Mutex| replace:: **Mutex**
-.. _Mutex: api/classsimgrid_1_1s4u_1_1Mutex.html
-
+.. _Mutex: app_s4u.html#s4u-mutex
 
 **In the remainder of this tutorial**, you will discover a simple yet
 fully functioning example of SimGrid simulation: the Master/Workers
@@ -86,7 +85,7 @@ the opportunity to improve this scheme.
 The Actors
 ..........
 
-Let's start with the code of the worker. It is represented by the
+Let's start with the code of the master. It is represented by the
 *master* function below. This simple function takes at least 3
 parameters (the amount of tasks to dispatch, their computational size
 in flops to compute and their communication size in bytes to
@@ -174,12 +173,12 @@ examples of platforms in the archive under ``examples/platforms``.
 .. |api_s4u_NetZone| image:: /img/extlink.png
    :align: middle
    :width: 12
-.. _api_s4u_NetZone: api/classsimgrid_1_1s4u_1_1NetZone.html#class-documentation
+.. _api_s4u_NetZone: app_s4u.html#s4u-netzone
 
 .. |api_s4u_Link| image:: /img/extlink.png
    :align: middle
    :width: 12
-.. _api_s4u_Link: api/classsimgrid_1_1s4u_1_1Link.html#class-documentation
+.. _api_s4u_Link: app_s4u.html#s4u-link
 
 .. literalinclude:: ../../examples/platforms/small_platform.xml
    :language: xml
@@ -203,6 +202,8 @@ This time, we have all parts: once the program is compiled, we can
 execute it as follows. Note how the XBT_INFO() requests turned into
 informative messages.
 
+.. "WARNING: Over dedent has detected" is expected here as we remove the $ marker this way
+
 .. literalinclude:: ../../examples/s4u/app-masterworkers/s4u-app-masterworkers.tesh
    :language: shell
    :start-after: s4u-app-masterworkers-fun
@@ -262,7 +263,7 @@ This very simple setting raises many interesting questions:
     hierarchical algorithm, with some forwarders taking large pools of
     tasks from the master, each of them distributing their tasks to a
     sub-pool of workers? Or should we introduce super-peers,
-    dupplicating the master's role in a peer-to-peer manner?  Do the
+    duplicating the master's role in a peer-to-peer manner?  Do the
     algorithms require a perfect knowledge of the network?
 
 - How is such an algorithm sensitive to external workload variation?
@@ -320,9 +321,9 @@ All needed dependencies are already installed in this container
 optional in this tutorial, it is not installed to reduce the image
 size.
 
-The code template is available under ``/source/simgrid-template-s4u.git`` 
+The code template is available under ``/source/simgrid-template-s4u.git``
 in the image. You should copy it to your working directory and
-recompile it when you first log in: 
+recompile it when you first log in:
 
 .. code-block:: shell
 
@@ -334,19 +335,19 @@ recompile it when you first log in:
 Using your Computer Natively
 ............................
 
-To take the tutorial on your machine, you first need to :ref:`install
-SimGrid <install>`, a C++ compiler and also ``pajeng`` to visualize
-the traces. You may want to install `Vite
-<http://vite.gforge.inria.fr/>`_ to get a first glance at the
-traces. The provided code template requires cmake to compile. On
-Debian and Ubuntu for example, you can get them as follows:
+To take the tutorial on your machine, you first need to :ref:`install 
+a recent version of SimGrid <install>`, a C++ compiler and also
+``pajeng`` to visualize the traces. You may want to install `Vite
+<http://vite.gforge.inria.fr/>`_ to get a first glance at the traces.
+The provided code template requires cmake to compile. On Debian and
+Ubuntu for example, you can get them as follows:
 
 .. code-block:: shell
 
    sudo apt install simgrid pajeng cmake g++ vite
 
-For R analysis of the produced traces, you may want to install R, 
-and the `pajengr<https://github.com/schnorr/pajengr#installation/>`_ package.
+For R analysis of the produced traces, you may want to install R,
+and the `pajengr <https://github.com/schnorr/pajengr#installation/>`_ package.
 
 .. code-block:: shell
 
@@ -363,10 +364,10 @@ everything as follows:
 
    # (exporting SimGrid_PATH is only needed if SimGrid is installed in a non-standard path)
    export SimGrid_PATH=/where/to/simgrid
-   
+
    git clone https://framagit.org/simgrid/simgrid-template-s4u.git
    cd simgrid-template-s4u/
-   cmake . 
+   cmake .
    make
 
 If you struggle with the compilation, then you should double check
@@ -478,12 +479,11 @@ used to BSD sockets or other classical systems, but you will soon
 appreciate their power. They are only used to match the
 communications, but have no impact on the communication
 timing. ``put()`` and ``get()`` are matched regardless of their
-initiators' location and then the real communication occures between
+initiators' location and then the real communication occurs between
 the involved parties.
 
-Please refer to the full `API of Mailboxes
-<api/classsimgrid_1_1s4u_1_1Mailbox.html#class-documentation>`_ for
-more details.
+Please refer to the full `Mailboxes' documentation
+<app_s4u.html#s4u-mailbox>`_ for more details.
 
 
 Lab 2: Using the Whole Platform
@@ -562,12 +562,12 @@ simulator requests. This is both a good idea, and a dangerous
 trend. This simplification is another application of the good old DRY/SPOT
 programming principle (`Don't Repeat Yourself / Single Point Of Truth
 <https://en.wikipedia.org/wiki/Don%27t_repeat_yourself>`_), and you
-really want your programming artefacts to follow these software
+really want your programming artifacts to follow these software
 engineering principles.
 
 But at the same time, you should be careful in separating your
 scientific contribution (the master/workers algorithm) and the
-artefacts used to test it (platform, deployment and workload). This is
+artifacts used to test it (platform, deployment and workload). This is
 why SimGrid forces you to express your platform and deployment files
 in XML instead of using a programming interface: it forces a clear
 separation of concerns between things of very different nature.
@@ -667,7 +667,7 @@ round-robin is completely suboptimal: most of the workers keep waiting
 for more work. We will move to a First-Come First-Served mechanism
 instead.
 
-For that, your workers should explicitely request for work with a
+For that, your workers should explicitly request for work with a
 message sent to a channel that is specific to their master. The name
 of that private channel can be the one used to categorize the
 executions, as it is already specific to each master.
@@ -675,7 +675,7 @@ executions, as it is already specific to each master.
 The master should serve in a round-robin manner the requests it
 receives, until the time is up. Changing the communication schema can
 be a bit hairy, but once it works, you will see that such as simple
-FCFS schema allows to double the amount of tasks handled over time
+FCFS schema allows one to double the amount of tasks handled over time
 here. Things may be different with another platform file.
 
 Further Improvements
index 673d4ea..b88ddbc 100644 (file)
@@ -13,11 +13,11 @@ C/C++/F77/F90 applications should run out of the box in this
 environment. In fact, almost all proxy apps provided by the `ExaScale
 Project <https://proxyapps.exascaleproject.org/>`_ only require minor
 modifications to `run on top of SMPI
-<https://github.com/simgrid/SMPI-proxy-apps/>`_.
+<https://framagit.org/simgrid/SMPI-proxy-apps>`_.
 
-This setting permits to debug your MPI applications in a perfectly
-reproducible setup, with no Heisenbugs. Enjoy the full Clairevoyance
-provided by the simulator while running what-if analysis on platforms
+This setting permits one to debug your MPI applications in a perfectly
+reproducible setup, with no Heisenbugs. Enjoy the full Clairvoyance
+provided by the simulator while running what-if analyses on platforms
 that are still to be built! Several `production-grade MPI applications
 <https://framagit.org/simgrid/SMPI-proxy-apps#full-scale-applications>`_
 use SimGrid for their integration and performance testing.
@@ -41,7 +41,7 @@ How does it work?
 
 In SMPI, communications are simulated while computations are
 emulated. This means that while computations occur as they would in
-the real systems, communication calls are intercepted and achived by
+the real systems, communication calls are intercepted and achieved by
 the simulator.
 
 To start using SMPI, you just need to compile your application with
@@ -58,7 +58,7 @@ per MPI rank as if it was another dynamic library. Then, MPI
 communication calls are implemented using SimGrid: data is exchanged
 through memory copy, while the simulator's performance models are used
 to predict the time taken by each communications. Any computations
-occuring between two MPI calls are benchmarked, and the corresponding
+occurring between two MPI calls are benchmarked, and the corresponding
 time is reported into the simulator.
 
 .. image:: /tuto_smpi/img/big-picture.svg
@@ -89,18 +89,22 @@ interconnected as follows:
 
 This can be done with the following platform file, that considers the
 simulated platform as a graph of hosts and network links.
-          
+
 .. literalinclude:: /tuto_smpi/3hosts.xml
    :language: xml
 
 The elements basic elements (with :ref:`pf_tag_host` and
 :ref:`pf_tag_link`) are described first, and then the routes between
-any pair of hosts are explicitely given with :ref:`pf_tag_route`. Any
-host must be given a computational speed (in flops) while links must
-be given a latency (in seconds) and a bandwidth (in bytes per
-second). Note that you can write 1Gflops instead of 1000000000flops,
-and similar. Last point: :ref:`pf_tag_route`s are symmetrical by
-default (but this can be changed).
+any pair of hosts are explicitly given with :ref:`pf_tag_route`. 
+
+Any host must be given a computational speed in flops while links must
+be given a latency and a bandwidth. You can write 1Gf for
+1,000,000,000 flops (full list of units in the reference guide of 
+:ref:`pf_tag_host` and :ref:`pf_tag_link`). 
+
+Routes defined with :ref:`pf_tag_route` are symmetrical by default,
+meaning that the list of traversed links from A to B is the same as
+from B to A. Explicitly define non-symmetrical routes if you prefer.
 
 Cluster with a Crossbar
 .......................
@@ -308,8 +312,8 @@ Debian and Ubuntu for example, you can get them as follows:
 
    sudo apt install simgrid pajeng make gcc g++ gfortran vite
 
-For R analysis of the produced traces, you may want to install R, 
-and the `pajengr<https://github.com/schnorr/pajengr#installation/>`_ package.
+For R analysis of the produced traces, you may want to install R,
+and the `pajengr <https://github.com/schnorr/pajengr#installation/>`_ package.
 
 .. code-block:: shell
 
@@ -486,7 +490,7 @@ is computationally hungry.
     the documentation is up-to-date.
 
 Lab 3: Execution Sampling on Matrix Multiplication example
--------------------------------
+----------------------------------------------------------
 
 The second method to speed up simulations is to sample the computation
 parts in the code.  This means that the person doing the simulation
@@ -505,13 +509,12 @@ The computing part of this example is the matrix multiplication routine
 .. literalinclude:: /tuto_smpi/gemm_mpi.cpp
    :language: c
    :lines: 4-19
-   
 
 .. code-block:: shell
 
   $ smpicc -O3 gemm_mpi.cpp -o gemm
   $ time smpirun -np 16 -platform cluster_crossbar.xml -hostfile cluster_hostfile --cfg=smpi/display-timing:yes --cfg=smpi/running-power:1000000000 ./gemm
-  
+
 This should end quite quickly, as the size of each matrix is only 1000x1000. 
 But what happens if we want to simulate larger runs ?
 Replace the size by 2000, 3000, and try again.
@@ -585,7 +588,7 @@ so these macros cannot be used when results are critical for the application beh
 
 
 Lab 4: Memory folding on large allocations
--------------------------------
+------------------------------------------
 
 Another issue that can be encountered when simulation with SMPI is lack of memory.
 Indeed we are executing all MPI processes on a single node, which can lead to crashes.
@@ -623,8 +626,8 @@ Further Readings
 
 You may also be interested in the `SMPI reference article
 <https://hal.inria.fr/hal-01415484>`_ or these `introductory slides
-<http://simgrid.org/tutorials/simgrid-smpi-101.pdf>`_. The `SMPI
-reference documentation <SMPI_doc>`_ covers much more content than
+<http://simgrid.org/tutorials/simgrid-smpi-101.pdf>`_. The :ref:`SMPI
+reference documentation <SMPI_doc>` covers much more content than
 this short tutorial.
 
 Finally, we regularly use SimGrid in our teachings on MPI. This way,
similarity index 80%
rename from docs/source/platform_reference.rst
rename to docs/source/XML_Reference.rst
index 4e729a5..1f509f0 100644 (file)
@@ -3,7 +3,7 @@
    <object id="TOC" data="graphical-toc.svg" width="100%" type="image/svg+xml"></object>
    <script>
    window.onload=function() { // Wait for the SVG to be loaded before changing it
-     var elem=document.querySelector("#TOC").contentDocument.getElementById("PlatformBox")
+     var elem=document.querySelector("#TOC").contentDocument.getElementById("ReferenceBox")
      elem.style="opacity:0.93999999;fill:#ff0000;fill-opacity:0.1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1";
    }
    </script>
    <br/>
 
 .. _platform_reference:
-   
-DTD Reference
-*************
 
-Your platform description should follow the specification presented in the 
-`simgrid.dtd <https://simgrid.org/simgrid.dtd>`_ DTD file. The same DTD is used for both platform and deployment files. 
+Complete XML Reference
+**********************
+
+Your platform description should follow the specification presented in the
+`simgrid.dtd <https://simgrid.org/simgrid.dtd>`_ DTD file. The same DTD is used for both platform and deployment files.
+
+-------------------------------------------------------------------------------
 
 .. _pf_tag_config:
 
-------------------------------------------------------------------
 <config>
-------------------------------------------------------------------
+--------
 
-Adding configuration flags directly into the platform file becomes particularly useful when the realism of the described
-platform depends on some specific flags. For example, this could help you to finely tune SMPI. Almost all
-:ref:`command-line configuration items <options_list>` can be configured this way.
+Adding configuration flags directly into the platform file becomes particularly
+useful when the realism of the described platform depends on some specific
+flags. For example, this could help you to finely tune SMPI. Almost all
+:ref:`command-line configuration items <options_list>` can be configured this
+way.
 
-Each configuration flag is described as a :ref:`pf_tag_prop` whose 'id' is the name of the flag and 'value' is what it
-has to be set to.
+Each configuration flag is described as a :ref:`pf_tag_prop` whose ``id`` is the
+name of the flag and ``value`` is what it has to be set to.
 
 **Parent tags:** :ref:`pf_tag_platform` (must appear before any other tags) |br|
 **Children tags:** :ref:`pf_tag_prop` |br|
@@ -50,18 +53,17 @@ has to be set to.
      <!-- The rest of your platform -->
    </platform>
 
-|hr|
-   
+-------------------------------------------------------------------------------
+
 .. _pf_tag_host:
 
-------------------------------------------------------------------
 <host>
-------------------------------------------------------------------
+------
 
 A host is the computing resource on which an actor can run. See :cpp:class:`simgrid::s4u::Host`.
 
 **Parent tags:** :ref:`pf_tag_zone` (only leaf zones, i.e., zones containing neither inner zones nor clusters) |br|
-**Children tags:** :ref:`pf_tag_mount`, :ref:`pf_tag_prop`, :ref:`pf_tag_storage` |br|
+**Children tags:** :ref:`pf_tag_mount`, :ref:`pf_tag_prop`, :ref:`pf_tag_disk` |br|
 **Attributes:**
 
 :``id``: Host name.
@@ -82,14 +84,15 @@ A host is the computing resource on which an actor can run. See :cpp:class:`simg
       5 1
       LOOPAFTER 5
 
-   - At time t = 1, half of the host computational power (0.5 means 50%) is used to process some background load, hence 
-     only 50% of this initial power remains available to your own simulation. 
+   - At time t = 1, half of the host computational power (0.5 means 50%) is used to process some background load, hence
+     only 50% of this initial power remains available to your own simulation.
    - At time t = 2, the available power drops at 20% of the initial value.
    - At time t = 5, the host can compute at full speed again.
    - At time t = 10, the profile is reset (as we are 5 seconds after the last event). Then the available speed will drop
      again to 50% at time t = 11.
 
-   If your profile does not contain any LOOPAFTER line, then it will be executed only once and not in a repetitive way.
+   If your profile does not contain any LOOPAFTER line, then it will
+   be executed only once and not repeated.
 
    .. warning:: Don't get fooled: Bandwidth and Latency profiles of a :ref:`pf_tag_link` contain absolute values, while
       Availability profiles of a :ref:`pf_tag_host` contain ratios.
@@ -108,20 +111,20 @@ A host is the computing resource on which an actor can run. See :cpp:class:`simg
    - At time t = 10, the profile is reset (as we are 8 seconds after the last event). Then the host will be turned off 
      again at time t = 11.
 
-   If your profile does not contain any LOOPAFTER line, then it will be executed only once and not in a repetitive way.
+   If your profile does not contain any LOOPAFTER line, then it will
+   be executed only once and not repeated.
 
 :``coordinates``: Vivaldi coordinates (meaningful for Vivaldi zones only).
    See :ref:`pf_tag_peer`.
 :``pstate``: Initial pstate (default: 0, the first one).
    See :ref:`howto_dvfs`.
 
-|hr|
-   
+-------------------------------------------------------------------------------
+
 .. _pf_tag_link:
 
-------------------------------------------------------------------
 <link>
-------------------------------------------------------------------
+------
 
 SimGrid links usually represent one-hop network connections (see :cpp:class:`simgrid::s4u::Link`), i.e., a single wire. 
 They can also be used to abstract a larger network interconnect, e.g., the entire transcontinental network, into a 
@@ -160,25 +163,25 @@ single element.
    ==== =========== ======================
 
 :``sharing_policy``: Sharing policy for the link. Possible values are ``SHARED``, ``FATPIPE`` or ``SPLITDUPLEX``
-   (default: ``SHARED``).
-
-   If set to ``SHARED``, the available bandwidth is fairly shared among all the flows traversing this link. This tend to
-   model the bandwidth sharing behavior of the UDP or TCP protocols.
-
-   If set to ``FATPIPE``, flows have no impact on each other, hence each flow can exploit the full bandwidth of this
-   link. This aims at modeling the behavior of the Internet backbones that cannot get saturated by your application.
-   What you experience of such networks usually is their latency only.
-
-   If set to ``SPLITDUPLEX``, the link models cross-traffic
-   effects. Under the ``SHARED`` policy, two flows of reverse
-   direction share the same resource, and can only get half of the
-   bandwidth each. But TCP connections are full duplex, meaning that
-   both directions can get the full bandwidth. To model this, any
-   link under the ``SPLITDUPLEX`` policy is split in two links (whose
-   names are suffixed with "_UP" and "_DOWN"). Then you must specify
-   which direction gets actually used when referring to that link in a
-   :ref:`pf_tag_link_ctn`.
-       
+   (default: ``SPLITDUPLEX``).
+
+   If set to ``SPLITDUPLEX``, the link models the full-duplex
+   behavior, as meant in TCP or UDP. To that extend, the link is
+   actually split in two links whose names are suffixed with "_UP" and
+   "_DOWN". You should then specify the direction to use when
+   referring to that link in a :ref:`pf_tag_link_ctn`.
+
+   If set to ``FATPIPE``, flows have no impact on each other, hence
+   each flow can exploit the full bandwidth. This models Internet
+   backbones that cannot get saturated by your application. From your
+   application point of view, there is no congestion on these
+   backbones.
+
+   If set to ``SHARED``, the available bandwidth is fairly shared
+   among ALL flows traversing this link. The resulting link is not
+   full-duplex (as UDP or TCP would be): communications in both
+   directions share the same link. Prefer ``SPLITDUPLEX`` for TCP flows.
+
 :``bandwidth_file``: File containing the bandwidth profile.
    Almost every lines of such files describe timed events as ``date
    bandwidth`` (in bytes per second).
@@ -194,6 +197,9 @@ single element.
    - At time t = 8, it raises to 60MBps.
    - At time t = 24, it drops at 40 MBps again.
 
+   If your profile does not contain any LOOPAFTER line, then it will
+   be executed only once and not repeated.
+
    .. warning:: Don't get fooled: Bandwidth and Latency profiles of a :ref:`pf_tag_link` contain absolute values, while
       Availability profiles of a :ref:`pf_tag_host` contain ratios.
 
@@ -201,9 +207,9 @@ single element.
    Almost every lines of such files describe timed events as ``date
    latency`` (in seconds).
    Example:
-                  
+
    .. code-block:: python
-                  
+
       1.0 0.001
       3.0 0.1
       LOOPAFTER 5.0
@@ -213,39 +219,40 @@ single element.
    - At time t = 8 (5 seconds after the last event), the profile loops.
    - At time t = 9 (1 second after the loop reset), the latency is back at 1ms.
 
-   If your profile does not contain any LOOPAFTER line, then it will be executed only once and not in a repetitive way.
+   If your profile does not contain any LOOPAFTER line, then it will
+   be executed only once and not repeated.
 
   .. warning:: Don't get fooled: Bandwidth and Latency profiles of a :ref:`pf_tag_link` contain absolute values, while
       Availability profiles of a :ref:`pf_tag_host` contain ratios.
 
 :``state_file``: File containing the state profile. See :ref:`pf_tag_host`.
 
-|hr|
-           
+-------------------------------------------------------------------------------
+
 .. _pf_tag_link_ctn:
 
-------------------------------------------------------------------
 <link_ctn>
-------------------------------------------------------------------
+----------
 
 An element in a route, representing a previously defined link.
 
-**Parent tags:** :ref:`pf_tag_route` |br| 
+**Parent tags:** :ref:`pf_tag_route` |br|
 **Children tags:** none |br|
 **Attributes:**
 
 :``id``: Link that is to be included in this route.
-:``direction``: Whether to use the uplink (with ``UP``) or downlink
-               (with ``DOWN``) of the link. This is only valid if the
-               link has ``sharing=SPLITDUPLEX``.
+:``direction``: either ``UP`` (by default) or ``DOWN``, specifying whether to
+                use the uplink or downlink component of the link (that must
+                follow the ``SPLITDUPLEX`` sharing policy). |br|
+                Please refer to the ``sharing_policy`` attribute in
+                :ref:`pf_tag_link`.
 
-|hr|
+-------------------------------------------------------------------------------
 
 .. _pf_tag_peer:
 
-------------------------------------------------------------------
 <peer>
-------------------------------------------------------------------
+------
 
 This tag represents a peer, as in Peer-to-Peer (P2P) networks. It is
 handy to model situations where hosts have an asymmetric
@@ -260,6 +267,7 @@ and a download link.
 
 :``id``: Name of the host. Must be unique on the whole platform.
 :``speed``: Computational power (in flop/s).
+
    If you use DVFS, provide a comma-separated list of values for each pstate (see :ref:`howto_dvfs`). 
 :``bw_in``: Bandwidth of the private downstream link, along with its
            unit. See :ref:`pf_tag_link`.
@@ -269,7 +277,7 @@ and a download link.
 :``coordinates``: Coordinates of the gateway for this peer.
 
    The communication latency between a host A = (xA,yA,zA) and a host B = (xB,yB,zB) is computed as follows:
+
    latency = sqrt( (xA-xB)² + (yA-yB)² ) + zA + zB
 
    See the documentation of
@@ -281,34 +289,33 @@ and a download link.
 :``state_file``: File containing the state profile.
    See the full description in :ref:`pf_tag_host`
 
-|hr|
+-------------------------------------------------------------------------------
 
 .. _pf_tag_platform:
 
-------------------------------------------------------------------
 <platform>
-------------------------------------------------------------------
+----------
 
 **Parent tags:** none (this is the root tag of every file) |br|
 **Children tags:** :ref:`pf_tag_config` (must come first),
 :ref:`pf_tag_cluster`, :ref:`pf_tag_cabinet`, :ref:`pf_tag_peer`,
-:ref:`pf_tag_zone`, :ref:`pf_tag_trace`, :ref:`pf_tag_trace_connect` |br|
-**Attributes:** 
+:ref:`pf_tag_zone`, :ref:`pf_tag_trace`, :ref:`pf_tag_trace_connect`, or
+:ref:`pf_tag_actor` in :ref:`deployment <deploy>` files.|br|
+**Attributes:**
 
 :``version``: Version of the DTD, describing the whole XML format.
-             This versionning allow future evolutions, even if we
+             This versioning allow future evolutions, even if we
              avoid backward-incompatible changes. The current version
              is **4.1**. The ``simgrid_update_xml`` program can
              upgrade most of the past platform files to the most recent
              formalism.
 
-|hr|
-             
+-------------------------------------------------------------------------------
+
 .. _pf_tag_prop:
 
-------------------------------------------------------------------
 <prop>
-------------------------------------------------------------------
+------
 
 This tag can be used to attach user-defined properties to some
 platform elements. Both the name and the value can be any string of
@@ -322,28 +329,29 @@ following functions:
 - Cluster: this is a zone, see below.
 - Host: :cpp:func:`simgrid::s4u::Host::get_property` or :cpp:func:`MSG_host_get_property_value`
 - Link: :cpp:func:`simgrid::s4u::Link::get_property`
-- Storage: :cpp:func:`simgrid::s4u::Storage::get_property` or :cpp:func:`MSG_storage_get_property_value`
+- Disk: :cpp:func:`simgrid::s4u::Disk::get_property`
+- Storage :cpp:func:`MSG_storage_get_property_value` (deprecated)
 - Zone: :cpp:func:`simgrid::s4u::Zone::get_property` of :cpp:func:`MSG_zone_get_property_value`
 
 **Parent tags:** :ref:`pf_tag_actor`, :ref:`pf_tag_config`, :ref:`pf_tag_cluster`, :ref:`pf_tag_host`,
-:ref:`pf_tag_link`, :ref:`pf_tag_storage`, :ref:`pf_tag_zone` |br|
+:ref:`pf_tag_link`, :ref:`pf_tag_disk`,:ref:`pf_tag_storage` (deprecated), :ref:`pf_tag_zone` |br|
 **Children tags:** none |br|
 **Attributes:**
 
 :``id``: Name of the defined property.
 :``value``: Value of the defined property.
 
-|hr|
-           
+-------------------------------------------------------------------------------
+
 .. _pf_tag_route:
 
-------------------------------------------------------------------
 <route>
-------------------------------------------------------------------
+-------
 
-A path between two network locations, composed of several :ref:`pf_tag_link`s. 
+A path between two network locations, composed of several occurrences
+of :ref:`pf_tag_link` .
 
-**Parent tags:** :ref:`pf_tag_zone` |br| 
+**Parent tags:** :ref:`pf_tag_zone` |br|
 **Children tags:** :ref:`pf_tag_link_ctn` |br|
 **Attributes:**
 
@@ -353,11 +361,10 @@ A path between two network locations, composed of several :ref:`pf_tag_link`s.
                  are defining the route ``dst -> src`` at the same
                  time. Valid values: ``yes``, ``no``,``YES``, ``NO``.
 
-|hr|
+-------------------------------------------------------------------------------
 
 .. _pf_tag_router:
 
-------------------------------------------------------------------
 <router>
 ------------------------------------------------------------------
 
@@ -367,39 +374,33 @@ particular, they are useful when you want to use the NS3 bindings to
 break the routes that are longer than 1 hop.
 
 **Parent tags:** :ref:`pf_tag_zone` (only leaf zones, i.e., zones containing neither inner zones nor clusters) |br|
-**Children tags:** :ref:`pf_tag_prop`, :ref:`pf_tag_storage` |br|
 **Attributes:**
 
 :``id``: Router name.
    No other host or router may have the same name over the whole platform.
-:``coordinates``: Vivaldi coordinates. See :ref:`pf_tag_peer`.     
+:``coordinates``: Vivaldi coordinates. See :ref:`pf_tag_peer`.
 
-|hr|
+-------------------------------------------------------------------------------
 
 .. _pf_tag_zone:
 
-------------------------------------------------------------------
 <zone>
-------------------------------------------------------------------
+------
 
 A networking zone is an area in which elements are located. See :cpp:class:`simgrid::s4u::Zone`.
 
 **Parent tags:** :ref:`pf_tag_platform`, :ref:`pf_tag_zone` (only internal nodes, i.e., zones
 containing only inner zones or clusters but no basic
-elements such as host or peer) |br| 
+elements such as host or peer) |br|
 **Children tags (if internal zone):** :ref:`pf_tag_cluster`, :ref:`pf_tag_link`, :ref:`pf_tag_zone` |br|
 **Children tags (if leaf zone):** :ref:`pf_tag_host`, :ref:`pf_tag_link`, :ref:`pf_tag_peer` |br|
 **Attributes:**
 
 :``id``: Zone name.
    No other zone may have the same name over the whole platform.
-:``routing``: Routing algorithm to use. 
+:``routing``: Routing algorithm to use.
 
 
 .. |br| raw:: html
 
    <br />
-
-.. |hr| raw:: html
-
-   <hr />
diff --git a/docs/source/_templates/breadcrumbs.html b/docs/source/_templates/breadcrumbs.html
new file mode 100644 (file)
index 0000000..631fd76
--- /dev/null
@@ -0,0 +1,15 @@
+{%- extends "sphinx_rtd_theme/breadcrumbs.html" %}
+
+{# We use framagit and not gitlab, and we don't want to add a link on generated pages #}
+
+{% block breadcrumbs_aside %}
+  <li class="wy-breadcrumbs-aside">
+    {% if hasdoc(pagename) and pagename != "search" and pagename != "genindex" %}
+    {# TODO: How to rule out all java pages? 
+     #    (not re.match(pagename, "java/org/simgrid"))
+     # fails because re is not imported #}
+     
+      <a href="{{ meta['framagit_url'] }}" class="fa fa-bitbucket"> {{ _('Edit on FramaGit') }}</a>
+    {% endif %}
+  </li>                  
+{% endblock %}
diff --git a/docs/source/app_java.rst b/docs/source/app_java.rst
deleted file mode 100644 (file)
index e77587c..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-.. _Java_doc:
-
-The Java Bindings
-#################
-
-.. raw:: html
-
-   <object id="TOC" data="graphical-toc.svg" width="100%" type="image/svg+xml"></object>
-   <script>
-   window.onload=function() { // Wait for the SVG to be loaded before changing it
-     //var elem=document.querySelector("#TOC").contentDocument.getElementById("S4UBox")
-     //elem.style="opacity:0.93999999;fill:#ff0000;fill-opacity:0.1";
-   }
-   </script>
-   <br/>
-   <br/>
-
-   
-This section describes jMSG, the Java API to Simgrid. This API mimicks 
-:ref:`MSG <MSG_doc>`, which is a simple yet somehow realistic interface.
-The full reference documentation is provided at the end of this page.
-
-Most of the documentation of the :ref:`MSG API <MSG_doc>` in C applies
-directly to the Java bindings (any divergence is seen as a bug that we
-should fix). MSG structures are mapped to Java objects as expected,
-and the MSG functions are methods in these objects.
-
-Installing the Java bindings
-****************************
-
-The easiest is to use a :ref:`precompiled jarfile <install_java_precompiled>`,
-but some people may prefer to :ref:`compile it from the sources <install_src>`.
-
-
-Using the Java bindings
-***********************
-
-In most cases, you can use the SimGrid bindings as if it was a Java
-library:
-
-.. code-block:: shell
-
-   $ javac -classpath .:path/to/simgrid.jar your/java/Code.java
-   $ java -classpath .:path/to/simgrid.jar your.java.Code the/parameter/to/your/code
-
-For example:
-
-.. code-block:: shell
-
-   $ cd examples/deprecated/java
-   $ java -classpath ../../simgrid.jar:. .:../../simgrid.jar app.pingpong.Main ../platforms/platform.xml 
-
-Any SimGrid simulation (java or not) is usually constituted of several
-kind of actors or processes (classes extending @c Msg.Process) that
-are deployed over the hosts of the virtual platform. So, your code
-should declare these actors, plus a Main class in charge of deploying
-your actors on the platform. Please refer to the examples for details.
-
-Troubleshooting
-***************
-
-Actually, these bindings are not only implemented in Java. They do use
-the C implementation of SimGrid. This should be transparent as this
-library is directly included in the ``simgrid.jar`` file but things can
-still go wrong is several ways.
-
-Error: library simgrid not found
-================================
-
-This means that the JVM fails to load the native library. If you use a
-precompiled jarfile, please report this bug.
-
-If you built it yourself, you can try to use an installed version of
-the library instead of the one included in the jar. For that, add the
-path to the native library into the ``LD_LIBRARY_PATH`` variable (or in
-the ``DYLD_LIBRARY_PATH`` on macOS).
-
-pthread_create failed
-=====================
-
-You reached the amount of threads that can be run on your system. Try
-increasing the thread limits of your operating system.
-
-Other errors
-============
-
-When using jMSG, your program can crash for 3 main reasons:
-
-- Your Java part is not good: you'll have a good old java exception thrown,
-  and hence you should be able to correct it by yourself.
-- Our java part is not good: you'll also have a java exception thrown, but
-  we have real doubts this can happen, since the java part is only a JNI
-  binding. The other option is that it crashed because you used incorrectly
-  the MSG API, so this means also you should have an MSGException. It means
-  you should read carefully MSG samples and/or documentation.
-- Something has crashed in the C part. Okay, here comes the tricky
-  thing. It happens mainly for 2 reasons:
-  
-  - When something goes wrong in your simulation, sometimes the C part stops
-    because you used SimGrid incorrectly, and JNI bindings are not fond of that.
-    It means that you'll have something that looks ugly, but you should be able
-    to identify what's going wrong in your code by carefully reading the whole
-    error message
-  - It may happen that the problem comes directly from SimGrid: in this case,
-    the error should be uglier. In that case, you may submit a bug directly to
-    SimGrid.
-
-API Reference
-*************
-
-Package org.simgrid.msg
-=======================
-
-.. java:package:: org.simgrid.msg
-
-.. toctree::
-   :maxdepth: 1
-
-   Class org.simgrid.msg.As <java/org/simgrid/msg/As>
-   Class org.simgrid.msg.Comm <java/org/simgrid/msg/Comm>
-   Class org.simgrid.msg.File <java/org/simgrid/msg/File>
-   Class org.simgrid.msg.Host <java/org/simgrid/msg/Host>
-   Class org.simgrid.msg.HostFailureException <java/org/simgrid/msg/HostFailureException>
-   Class org.simgrid.msg.HostNotFoundException <java/org/simgrid/msg/HostNotFoundException>
-   Class org.simgrid.msg.JniException <java/org/simgrid/msg/JniException>
-   Class org.simgrid.msg.Msg <java/org/simgrid/msg/Msg>
-   Class org.simgrid.msg.MsgException <java/org/simgrid/msg/MsgException>
-   Class org.simgrid.msg.Mutex <java/org/simgrid/msg/Mutex>
-   Class org.simgrid.msg.Process <java/org/simgrid/msg/Process>
-   Class org.simgrid.msg.ProcessKilledError <java/org/simgrid/msg/ProcessKilledError>
-   Class org.simgrid.msg.ProcessNotFoundException <java/org/simgrid/msg/ProcessNotFoundException>
-   Class org.simgrid.msg.RngStream <java/org/simgrid/msg/RngStream>
-   Class org.simgrid.msg.Semaphore <java/org/simgrid/msg/Semaphore>
-   Class org.simgrid.msg.Storage <java/org/simgrid/msg/Storage>
-   Class org.simgrid.msg.StorageNotFoundException <java/org/simgrid/msg/StorageNotFoundException>
-   Class org.simgrid.msg.Task <java/org/simgrid/msg/Task>
-   Class org.simgrid.msg.TaskCancelledException <java/org/simgrid/msg/TaskCancelledException>
-   Class org.simgrid.msg.TimeoutException <java/org/simgrid/msg/TimeoutException>
-   Class org.simgrid.msg.TransferFailureException <java/org/simgrid/msg/TransferFailureException>
-   Class org.simgrid.msg.VM <java/org/simgrid/msg/VM>
index 04a3514..daa47e1 100644 (file)
@@ -1,20 +1,15 @@
 .. _MSG_doc:
 
-====================================
 The MSG Interface (legacy interface)
-====================================
+####################################
 
-.. raw:: html
+.. warning::
 
-   <object id="TOC" data="graphical-toc.svg" width="100%" type="image/svg+xml"></object>
-   <script>
-   window.onload=function() { // Wait for the SVG to be loaded before changing it
-     //var elem=document.querySelector("#TOC").contentDocument.getElementById("S4UBox")
-     //elem.style="opacity:0.93999999;fill:#ff0000;fill-opacity:0.1";
-   }
-   </script>
-   <br/>
-   <br/>
+   MSG used to be the main API of SimGrid 3, but we are currently in
+   the process of releasing SimGrid 4. So MSG is frozen and will
+   probably never evolve. If you are starting a new project, you
+   should consider S4U instead. Note that the support for MSG will not
+   be removed from SimGrid before 2020 at least.
 
 MSG is a simple API to write algorithms organized with Concurrent
 Sequential Processes (CSP) that interact by exchanging messages. It
@@ -23,19 +18,11 @@ systems. It can be used to build rather realistic simulations, but
 remains simple to use: most unpleasant technical elements can be
 abstracted away rather easily.
 
-This page describes the C version of this API while the :ref:`Java
-bindings of MSG <Java_doc>` are described in another section.
-
-.. warning::
-
-   MSG used to be the main API of SimGrid 3, but we are currently in
-   the process of releasing SimGrid 4. So MSG is frozen and will
-   probably never evolve. If you are starting a new project, you
-   should consider S4U instead. Note that the support for MSG will not
-   be removed from SimGrid before 2020 at least.
+C API reference
+***************
 
 Main MSG Functions
-------------------
+==================
 
 The basic workflow is the following:
 
@@ -59,8 +46,8 @@ The basic workflow is the following:
 .. doxygenfunction:: MSG_main
 .. doxygenfunction:: MSG_set_function
 
-Process Management Functions
-----------------------------
+Process Management
+==================
 
 This describes the process structure :cpp:type:`msg_process_t` and the functions for managing it.
 
@@ -70,7 +57,6 @@ This describes the process structure :cpp:type:`msg_process_t` and the functions
 .. doxygenfunction:: MSG_process_create
 .. doxygenfunction:: MSG_process_create_with_arguments
 .. doxygenfunction:: MSG_process_create_with_environment
-.. doxygenfunction:: MSG_process_create_from_stdfunc
 .. doxygenfunction:: MSG_process_daemonize
 .. doxygenfunction:: MSG_process_detach
 .. doxygenfunction:: MSG_processes_as_dynar
@@ -83,7 +69,6 @@ This describes the process structure :cpp:type:`msg_process_t` and the functions
 .. doxygenfunction:: MSG_process_get_PPID
 .. doxygenfunction:: MSG_process_get_properties
 .. doxygenfunction:: MSG_process_get_property_value
-.. doxygenfunction:: MSG_process_get_smx_ctx
 .. doxygenfunction:: MSG_process_is_suspended
 .. doxygenfunction:: MSG_process_join
 .. doxygenfunction:: MSG_process_kill
@@ -103,10 +88,11 @@ This describes the process structure :cpp:type:`msg_process_t` and the functions
 .. doxygenfunction:: MSG_process_sleep
 .. doxygenfunction:: MSG_process_suspend
 .. doxygenfunction:: MSG_process_unref
+.. doxygenfunction:: MSG_process_userdata_init
 .. doxygenfunction:: MSG_process_yield
 
-Host Management Functions
--------------------------
+Host Management
+===============
 
 .. doxygentypedef:: msg_host_t
 .. doxygenfunction:: MSG_host_by_name
@@ -118,6 +104,7 @@ Host Management Functions
 .. doxygenfunction:: MSG_host_get_mounted_storage_list
 .. doxygenfunction:: MSG_host_get_name
 .. doxygenfunction:: MSG_host_get_nb_pstates
+.. doxygenfunction:: MSG_host_get_load
 .. doxygenfunction:: MSG_host_get_power_peak_at
 .. doxygenfunction:: MSG_host_get_process_list
 .. doxygenfunction:: MSG_host_get_properties
@@ -134,8 +121,8 @@ Host Management Functions
 .. doxygenfunction:: MSG_host_set_property_value
 .. doxygenfunction:: MSG_host_set_pstate
 
-Task Management Functions
--------------------------
+Task Management
+===============
 
 Task structure of MSG :cpp:type:`msg_task_t` and associated functions.
 
@@ -172,8 +159,8 @@ Task structure of MSG :cpp:type:`msg_task_t` and associated functions.
 .. doxygenfunction:: MSG_task_receive_ext_bounded
 .. doxygenfunction:: MSG_task_receive_with_timeout
 .. doxygenfunction:: MSG_task_receive_with_timeout_bounded
-.. doxygenfunction:: MSG_task_recv
-.. doxygenfunction:: MSG_task_recv_bounded
+.. doxygendefine:: MSG_task_recv
+.. doxygendefine:: MSG_task_recv_bounded
 .. doxygenfunction:: MSG_task_send
 .. doxygenfunction:: MSG_task_send_bounded
 .. doxygenfunction:: MSG_task_send_with_timeout
@@ -188,13 +175,13 @@ Task structure of MSG :cpp:type:`msg_task_t` and associated functions.
 .. doxygenfunction:: MSG_task_set_priority
 
                   
-Mailbox Management Functions
-----------------------------
+Mailbox Management
+==================
 
 .. doxygenfunction:: MSG_mailbox_set_async
 
 Communications
---------------
+==============
 
 .. doxygentypedef:: msg_comm_t
 
@@ -207,15 +194,15 @@ Communications
 .. doxygenfunction:: MSG_comm_waitall
 .. doxygenfunction:: MSG_comm_waitany
 
-Explicit Synchronization Functions
-----------------------------------
+Explicit Synchronization
+========================
 
 Explicit synchronization mechanisms: semaphores (:cpp:type:`msg_sem_t`) and friends.
 
 In some situations, these things are very helpful to synchronize processes without message exchanges.
 
 Barriers
-........
+--------
 
 .. doxygentypedef:: msg_bar_t
 .. doxygenfunction:: MSG_barrier_destroy
@@ -223,7 +210,7 @@ Barriers
 .. doxygenfunction:: MSG_barrier_wait
 
 Semaphores
-..........
+----------
                     
 .. doxygentypedef:: msg_sem_t
 .. doxygenfunction:: MSG_sem_acquire
@@ -235,7 +222,7 @@ Semaphores
 .. doxygenfunction:: MSG_sem_would_block
 
 Virtual Machines
-----------------
+================
 
 This interface mimics IaaS clouds.
 With it, you can create virtual machines to put your processes
@@ -243,7 +230,6 @@ into, and interact directly with the VMs to manage groups of
 processes.
 
 .. doxygentypedef:: msg_vm_t
-.. doxygenfunction:: MSG_vm_create
 .. doxygenfunction:: MSG_vm_create_core
 .. doxygenfunction:: MSG_vm_create_multicore
 .. doxygenfunction:: MSG_vm_destroy
@@ -260,8 +246,8 @@ processes.
 .. doxygenfunction:: MSG_vm_start
 .. doxygenfunction:: MSG_vm_suspend
 
-Storage Management Functions
-----------------------------
+Storage Management
+==================
 Storage structure of MSG (:cpp:type:`msg_storage_t`) and associated functions, inspired from POSIX.
 
 .. doxygentypedef:: msg_storage_t
@@ -277,8 +263,8 @@ Storage structure of MSG (:cpp:type:`msg_storage_t`) and associated functions, i
 .. doxygenfunction:: MSG_storage_set_property_value
 .. doxygenfunction:: MSG_storage_write
 
-Zone Management Functions
--------------------------
+NetZone Management
+==================
 Network Zone (:cpp:class:`msg_file_t`) and associated functions.
 
 .. doxygentypedef:: msg_netzone_t
@@ -289,3 +275,129 @@ Network Zone (:cpp:class:`msg_file_t`) and associated functions.
 .. doxygenfunction:: MSG_zone_get_root
 .. doxygenfunction:: MSG_zone_get_sons
 .. doxygenfunction:: MSG_zone_set_property_value
+
+Java bindings
+*************
+
+This section describes jMSG, the Java API to Simgrid. This API mimicks 
+:ref:`MSG <MSG_doc>`, which is a simple yet somehow realistic interface.
+The full reference documentation is provided at the end of this page.
+
+Most of the documentation of the :ref:`MSG API <MSG_doc>` in C applies
+directly to the Java bindings (any divergence is seen as a bug that we
+should fix). MSG structures are mapped to Java objects as expected,
+and the MSG functions are methods in these objects.
+
+Installing the Java bindings
+============================
+
+The easiest is to use a :ref:`precompiled jarfile <install_java_precompiled>`,
+but some people may prefer to :ref:`compile it from the sources <install_src>`.
+
+
+Using the Java bindings
+=======================
+
+In most cases, you can use the SimGrid bindings as if it was a Java
+library:
+
+.. code-block:: shell
+
+   $ javac -classpath .:path/to/simgrid.jar your/java/Code.java
+   $ java -classpath .:path/to/simgrid.jar your.java.Code the/parameter/to/your/code
+
+For example:
+
+.. code-block:: shell
+
+   $ cd examples/deprecated/java
+   $ java -classpath ../../simgrid.jar:. .:../../simgrid.jar app.pingpong.Main ../platforms/platform.xml 
+
+Any SimGrid simulation (java or not) is usually constituted of several
+kind of actors or processes (classes extending @c Msg.Process) that
+are deployed over the hosts of the virtual platform. So, your code
+should declare these actors, plus a Main class in charge of deploying
+your actors on the platform. Please refer to the examples for details.
+
+Troubleshooting
+===============
+
+Actually, these bindings are not only implemented in Java. They do use
+the C implementation of SimGrid. This should be transparent as this
+library is directly included in the ``simgrid.jar`` file but things can
+still go wrong is several ways.
+
+Error: library simgrid not found
+--------------------------------
+
+This means that the JVM fails to load the native library. If you use a
+precompiled jarfile, please report this bug.
+
+If you built it yourself, you can try to use an installed version of
+the library instead of the one included in the jar. For that, add the
+path to the native library into the ``LD_LIBRARY_PATH`` variable (or in
+the ``DYLD_LIBRARY_PATH`` on macOS).
+
+pthread_create failed
+---------------------
+
+You reached the amount of threads that can be run on your system. Try
+increasing the thread limits of your operating system.
+
+Other errors
+------------
+
+When using jMSG, your program can crash for 3 main reasons:
+
+- Your Java part is not good: you'll have a good old java exception thrown,
+  and hence you should be able to correct it by yourself.
+- Our java part is not good: you'll also have a java exception thrown, but
+  we have real doubts this can happen, since the java part is only a JNI
+  binding. The other option is that it crashed because you used incorrectly
+  the MSG API, so this means also you should have an MSGException. It means
+  you should read carefully MSG samples and/or documentation.
+- Something has crashed in the C part. Okay, here comes the tricky
+  thing. It happens mainly for 2 reasons:
+  
+  - When something goes wrong in your simulation, sometimes the C part stops
+    because you used SimGrid incorrectly, and JNI bindings are not fond of that.
+    It means that you'll have something that looks ugly, but you should be able
+    to identify what's going wrong in your code by carefully reading the whole
+    error message
+  - It may happen that the problem comes directly from SimGrid: in this case,
+    the error should be uglier. In that case, you may submit a bug directly to
+    SimGrid.
+
+API Reference
+=============
+
+Package org.simgrid.msg
+-----------------------
+
+.. java:package:: org.simgrid.msg
+
+.. toctree::
+   :maxdepth: 1
+
+   Class org.simgrid.msg.As <java/org/simgrid/msg/As>
+   Class org.simgrid.msg.Comm <java/org/simgrid/msg/Comm>
+   Class org.simgrid.msg.File <java/org/simgrid/msg/File>
+   Class org.simgrid.msg.Host <java/org/simgrid/msg/Host>
+   Class org.simgrid.msg.HostFailureException <java/org/simgrid/msg/HostFailureException>
+   Class org.simgrid.msg.HostNotFoundException <java/org/simgrid/msg/HostNotFoundException>
+   Class org.simgrid.msg.JniException <java/org/simgrid/msg/JniException>
+   Class org.simgrid.msg.Msg <java/org/simgrid/msg/Msg>
+   Class org.simgrid.msg.MsgException <java/org/simgrid/msg/MsgException>
+   Class org.simgrid.msg.Mutex <java/org/simgrid/msg/Mutex>
+   Class org.simgrid.msg.Process <java/org/simgrid/msg/Process>
+   Class org.simgrid.msg.ProcessKilledError <java/org/simgrid/msg/ProcessKilledError>
+   Class org.simgrid.msg.ProcessNotFoundException <java/org/simgrid/msg/ProcessNotFoundException>
+   Class org.simgrid.msg.RngStream <java/org/simgrid/msg/RngStream>
+   Class org.simgrid.msg.Semaphore <java/org/simgrid/msg/Semaphore>
+   Class org.simgrid.msg.Storage <java/org/simgrid/msg/Storage>
+   Class org.simgrid.msg.StorageNotFoundException <java/org/simgrid/msg/StorageNotFoundException>
+   Class org.simgrid.msg.Task <java/org/simgrid/msg/Task>
+   Class org.simgrid.msg.TaskCancelledException <java/org/simgrid/msg/TaskCancelledException>
+   Class org.simgrid.msg.TimeoutException <java/org/simgrid/msg/TimeoutException>
+   Class org.simgrid.msg.TransferFailureException <java/org/simgrid/msg/TransferFailureException>
+   Class org.simgrid.msg.VM <java/org/simgrid/msg/VM>
index 3f6767b..885a6a9 100644 (file)
@@ -8,8 +8,8 @@ The S4U Interface
    <object id="TOC" data="graphical-toc.svg" width="100%" type="image/svg+xml"></object>
    <script>
    window.onload=function() { // Wait for the SVG to be loaded before changing it
-     var elem=document.querySelector("#TOC").contentDocument.getElementById("S4UBox")
-     elem.style="opacity:0.93999999;fill:#ff0000;fill-opacity:0.1";
+     var elem=document.querySelector("#TOC").contentDocument.getElementById("ActorBox")
+     elem.style="opacity:0.93999999;fill:#ff0000;fill-opacity:0.1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1";
    }
    </script>
    <br/>
@@ -39,7 +39,7 @@ S4U interface to express their :ref:`computation <API_s4u_Exec>`,
 :ref:`communication <API_s4u_Comm>`, :ref:`disk usage <API_s4u_Io>`,
 and other |API_s4u_Activities|_, so that they get reflected within the
 simulator. These activities take place on resources such as |API_s4u_Hosts|_,
-|API_s4u_Links|_ and |API_s4u_Storages|_. SimGrid predicts the time taken by each
+|API_s4u_Links|_ and |API_s4u_Disks|_. SimGrid predicts the time taken by each
 activity and orchestrates the actors accordingly, waiting for the
 completion of these activities.
 
@@ -75,14 +75,14 @@ provides many helper functions to simplify the code of actors.
 
 - **Platform Elements**
 
+  - :ref:`class s4u::Disk <API_s4u_Disk>`
+    Resource on which actors can write and read data.
   - :ref:`class s4u::Host <API_s4u_Host>`:
     Actor location, providing computational power.
   - :ref:`class s4u::Link <API_s4u_Link>`
     Interconnecting hosts.
   - :ref:`class s4u::NetZone <API_s4u_NetZone>`:
     Sub-region of the platform, containing resources (Hosts, Links, etc).
-  - :ref:`class s4u::Storage <API_s4u_Storage>`
-    Resource on which actors can write and read data.
   - :ref:`class s4u::VirtualMachine <API_s4u_VirtualMachine>`:
     Execution containers that can be moved between Hosts.
 
@@ -94,7 +94,7 @@ provides many helper functions to simplify the code of actors.
   - :ref:`class s4u::Exec <API_s4u_Exec>`
     Computation activity, started on Host and consuming CPU resources.
   - :ref:`class s4u::Io <API_s4u_Io>`
-    I/O activity, started on and consumming Storages.
+    I/O activity, started on and consumming disks.
 
 - **Synchronization Mechanisms**: Classical IPC that actors can use
 
@@ -116,8 +116,8 @@ provides many helper functions to simplify the code of actors.
 .. |API_s4u_Links| replace:: **Links**
 .. _API_s4u_Links: #s4u-link
 
-.. |API_s4u_Storages| replace:: **Storages**
-.. _API_s4u_Storages: #s4u-storage
+.. |API_s4u_Disks| replace:: **Disks**
+.. _API_s4u_Disks: #s4u-disk
 
 .. |API_s4u_VirtualMachine| replace:: **VirtualMachines**
 
@@ -146,7 +146,7 @@ Activities
 **********
 
 Activities represent the actions that consume a resource, such as a
-:ref:`s4u::Comm <API_s4u_Comm>` that consumes the *transmiting power* of
+:ref:`s4u::Comm <API_s4u_Comm>` that consumes the *transmitting power* of
 :ref:`s4u::Link <API_s4u_Link>` resources.
 
 =======================
@@ -173,14 +173,14 @@ Finally, to wait at most until a specified time limit, use
 
    wait_for and wait_until are currently not implemented for Exec and Io activities.
 
-Every kind of activities can be asynchronous:
+Every kind of activity can be asynchronous:
 
   - :ref:`s4u::CommPtr <API_s4u_Comm>` are created with 
     :cpp:func:`s4u::Mailbox::put_async() <simgrid::s4u::Mailbox::put_async>` and
     :cpp:func:`s4u::Mailbox::get_async() <simgrid::s4u::Mailbox::get_async>`.
   - :ref:`s4u::IoPtr <API_s4u_Io>` are created with 
-    :cpp:func:`s4u::Storage::read_async() <simgrid::s4u::Storage::read_async>` and
-    :cpp:func:`s4u::Storage::write_async() <simgrid::s4u::Storage::write_async>`.    
+    :cpp:func:`s4u::Disk::read_async() <simgrid::s4u::Disk::read_async>` and
+    :cpp:func:`s4u::Disk::write_async() <simgrid::s4u::Disk::write_async>`.
   - :ref:`s4u::ExecPtr <API_s4u_Exec>` are created with
     :cpp:func:`s4u::Host::exec_async() <simgrid::s4u::Host::exec_async>`.
   - In the future, it will become possible to have asynchronous IPC
@@ -319,7 +319,7 @@ The last twist is that by default in the simulator, the data starts
 to be exchanged only when both the sender and the receiver are
 announced (it waits until both :cpp:func:`put() <simgrid::s4u::Mailbox::put()>`
 and :cpp:func:`get() <simgrid::s4u::Mailbox::get()>` are posted). 
-In TCP, since you establish connexions beforehand, the data starts to
+In TCP, since you establish connections beforehand, the data starts to
 flow as soon as the sender posts it, even if the receiver did not post
 its :cpp:func:`recv() <simgrid::s4u::Mailbox::recv()>` yet. 
 
@@ -343,14 +343,13 @@ Memory Management
 
 For sake of simplicity, we use `RAII
 <https://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization>`_
-everywhere in S4U. This is an idiom where resources are automatically
+for many classes in S4U. This is an idiom where resources are automatically
 managed through the context. Provided that you never manipulate
 objects of type Foo directly but always FooPtr references (which are
 defined as `boost::intrusive_ptr
 <http://www.boost.org/doc/libs/1_61_0/libs/smart_ptr/intrusive_ptr.html>`_
-<Foo>), you will never have to explicitely release the resource that
+<Foo>), you will never have to explicitly release the resource that
 you use nor to free the memory of unused objects.
-
 Here is a little example:
 
 .. code-block:: cpp
@@ -365,6 +364,11 @@ Here is a little example:
   
    } // The mutex gets automatically freed because the only existing reference gets out of scope
 
+Note that Mailboxes, Hosts and Links are not handled thought smart
+pointers (yet?). This means that it is currently impossible to destroy a
+mailbox or a link. You can still destroy an host (but probably
+shouldn't), using :cpp:func:`simgrid::s4u::Host::destroy`.
+
 C++ API Reference
 *****************
 
@@ -440,6 +444,17 @@ s4u::ConditionVariable
    :protected-members:
    :undoc-members:
 
+.. _API_s4u_Disk:
+
+============
+s4u::Disk
+============
+
+.. doxygenclass:: simgrid::s4u::Disk
+   :members:
+   :protected-members:
+   :undoc-members:
+
 .. _API_s4u_Engine:
 
 ===========
@@ -464,6 +479,32 @@ s4u::Exec
    :protected-members:
    :undoc-members:
 
+.. _API_s4u_ExecSeq:
+
+============
+s4u::ExecSeq
+============
+
+.. doxygentypedef:: ExecSeqPtr
+
+.. doxygenclass:: simgrid::s4u::ExecSeq
+   :members:
+   :protected-members:
+   :undoc-members:
+
+.. _API_s4u_ExecPar:
+
+============
+s4u::ExecPar
+============
+
+.. doxygentypedef:: ExecParPtr
+
+.. doxygenclass:: simgrid::s4u::ExecPar
+   :members:
+   :protected-members:
+   :undoc-members:
+
 .. _API_s4u_Host:
 
 =========
@@ -549,17 +590,6 @@ s4u::Semaphore
    :protected-members:
    :undoc-members:
 
-.. _API_s4u_Storage:
-
-============
-s4u::Storage
-============
-
-.. doxygenclass:: simgrid::s4u::Storage
-   :members:
-   :protected-members:
-   :undoc-members:
-
 .. _API_s4u_VirtualMachine:
 
 ===================
index 8a2f5a0..775fce9 100644 (file)
@@ -11,6 +11,7 @@ SMPI: Simulate MPI Applications
    window.onload=function() { // Wait for the SVG to be loaded before changing it
      var elem=document.querySelector("#TOC").contentDocument.getElementById("SMPIBox")
      elem.style="opacity:0.93999999;fill:#ff0000;fill-opacity:0.1";
+     elem.style="opacity:0.93999999;fill:#ff0000;fill-opacity:0.1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1";
    }
    </script>
    <br/>
@@ -20,8 +21,8 @@ SMPI enables the study of MPI application by emulating them on top of
 the SimGrid simulator. This is particularly interesting to study
 existing MPI applications within the comfort of the simulator.
 
-To get started with SMPI, you should head to `the SMPI tutorial
-<usecase_smpi>`_. You may also want to read the `SMPI reference
+To get started with SMPI, you should head to :ref:`the SMPI tutorial
+<usecase_smpi>`. You may also want to read the `SMPI reference
 article <https://hal.inria.fr/hal-01415484>`_ or these `introductory
 slides <http://simgrid.org/tutorials/simgrid-smpi-101.pdf>`_.  If you
 are new to MPI, you should first take our online `SMPI CourseWare
@@ -50,7 +51,7 @@ Using SMPI online
 In this mode, your application is actually executed. Every computation
 occurs for real while every communication is simulated. In addition,
 the executions are automatically benchmarked so that their timings can
-be applied within the simulator. 
+be applied within the simulator.
 
 SMPI can also go offline by replaying a trace. :ref:`Trace replay
 <SMPI_offline>` is usually ways faster than online simulation (because
@@ -69,6 +70,14 @@ the right compilation flags along the way. If your application is in
 C++, Fortran 77 or Fortran 90, use respectively ``smpicxx``,
 ``smpiff`` or ``smpif90``.
 
+If you use cmake, set the variables ``MPI_C_COMPILER``, ``MPI_CXX_COMPILER`` and
+``MPI_Fortran_COMPILER`` to the full path of smpicc, smpicxx and smpiff (or
+smpif90), respectively. Example:
+
+.. code-block:: shell
+
+   cmake -DMPI_C_COMPILER=/opt/simgrid/bin/smpicc -DMPI_CXX_COMPILER=/opt/simgrid/bin/smpicxx -DMPI_Fortran_COMPILER=/opt/simgrid/bin/smpiff .
+
 ....................
 Simulating your Code
 ....................
@@ -113,7 +122,7 @@ usual.
 
 .. _SMPI_use_colls:
 
-................................   
+................................
 Simulating Collective Operations
 ................................
 
@@ -140,15 +149,15 @@ You can switch the automatic selector through the
  - **ompi:** default selection logic of OpenMPI (version 3.1.2)
  - **mpich**: default selection logic of MPICH (version 3.3b)
  - **mvapich2**: selection logic of MVAPICH2 (version 1.9) tuned
-   on the Stampede cluster   
+   on the Stampede cluster
  - **impi**: preliminary version of an Intel MPI selector (version
    4.1.3, also tuned for the Stampede cluster). Due the closed source
    nature of Intel MPI, some of the algorithms described in the
-   documentation are not available, and are replaced by mvapich ones.   
+   documentation are not available, and are replaced by mvapich ones.
  - **default**: legacy algorithms used in the earlier days of
    SimGrid. Do not use for serious perform performance studies.
 
-.. todo:: default should not even exist.   
+.. todo:: default should not even exist.
 
 ....................
 Available Algorithms
@@ -169,19 +178,19 @@ means that the selected algorithm will be used
 MPI_Alltoall
 ^^^^^^^^^^^^
 
-Most of these are best described in `STAR-MPI <http://www.cs.arizona.edu/~dkl/research/papers/ics06.pdf>`_.
+Most of these are best described in `STAR-MPI's white paper <https://doi.org/10.1145/1183401.1183431>`_.
 
  - default: naive one, by default
  - ompi: use openmpi selector for the alltoall operations
  - mpich: use mpich selector for the alltoall operations
  - mvapich2: use mvapich2 selector for the alltoall operations
  - impi: use intel mpi selector for the alltoall operations
- - automatic (experimental): use an automatic self-benchmarking algorithm 
+ - automatic (experimental): use an automatic self-benchmarking algorithm
  - bruck: Described by Bruck et.al. in <a href="http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=642949">this paper</a>
- - 2dmesh: organizes the nodes as a two dimensional mesh, and perform allgather 
+ - 2dmesh: organizes the nodes as a two dimensional mesh, and perform allgather
    along the dimensions
  - 3dmesh: adds a third dimension to the previous algorithm
- - rdb: recursive doubling: extends the mesh to a nth dimension, each one 
+ - rdb: recursive doubling: extends the mesh to a nth dimension, each one
    containing two nodes
  - pair: pairwise exchange, only works for power of 2 procs, size-1 steps,
    each process sends and receives from the same process at each step
@@ -204,7 +213,7 @@ MPI_Alltoallv
  - mpich: use mpich selector for the alltoallv operations
  - mvapich2: use mvapich2 selector for the alltoallv operations
  - impi: use intel mpi selector for the alltoallv operations
- - automatic (experimental): use an automatic self-benchmarking algorithm 
+ - automatic (experimental): use an automatic self-benchmarking algorithm
  - bruck: same as alltoall
  - pair: same as alltoall
  - pair_light_barrier: same as alltoall
@@ -239,7 +248,7 @@ MPI_Barrier
  - mpich: use mpich selector for the barrier operations
  - mvapich2: use mvapich2 selector for the barrier operations
  - impi: use intel mpi selector for the barrier operations
- - automatic (experimental): use an automatic self-benchmarking algorithm 
+ - automatic (experimental): use an automatic self-benchmarking algorithm
  - ompi_basic_linear: all processes send to root
  - ompi_two_procs: special case for two processes
  - ompi_bruck: nsteps = sqrt(size), at each step, exchange data with rank-2^k and rank+2^k
@@ -257,8 +266,8 @@ MPI_Scatter
  - mpich: use mpich selector for the scatter operations
  - mvapich2: use mvapich2 selector for the scatter operations
  - impi: use intel mpi selector for the scatter operations
- - automatic (experimental): use an automatic self-benchmarking algorithm 
- - ompi_basic_linear: basic linear scatter 
+ - automatic (experimental): use an automatic self-benchmarking algorithm
+ - ompi_basic_linear: basic linear scatter
  - ompi_binomial: binomial tree scatter
  - mvapich2_two_level_direct: SMP aware algorithm, with an intra-node stage (default set to mpich selector), and then a basic linear inter node stage. Use mvapich2 selector to change these to tuned algorithms for Stampede cluster. 
  - mvapich2_two_level_binomial: SMP aware algorithm, with an intra-node stage (default set to mpich selector), and then a binomial phase. Use mvapich2 selector to change these to tuned algorithms for Stampede cluster.
@@ -271,28 +280,28 @@ MPI_Reduce
  - mpich: use mpich selector for the reduce operations
  - mvapich2: use mvapich2 selector for the reduce operations
  - impi: use intel mpi selector for the reduce operations
- - automatic (experimental): use an automatic self-benchmarking algorithm 
+ - automatic (experimental): use an automatic self-benchmarking algorithm
  - arrival_pattern_aware: root exchanges with the first process to arrive
  - binomial: uses a binomial tree
  - flat_tree: uses a flat tree
- - NTSL: Non-topology-specific pipelined linear-bcast function 
+ - NTSL: Non-topology-specific pipelined linear-bcast function
    0->1, 1->2 ,2->3, ....., ->last node: in a pipeline fashion, with segments
    of 8192 bytes
  - scatter_gather: scatter then gather
  - ompi_chain: openmpi reduce algorithms are built on the same basis, but the
    topology is generated differently for each flavor
-   chain = chain with spacing of size/2, and segment size of 64KB 
- - ompi_pipeline: same with pipeline (chain with spacing of 1), segment size 
+   chain = chain with spacing of size/2, and segment size of 64KB
+ - ompi_pipeline: same with pipeline (chain with spacing of 1), segment size
    depends on the communicator size and the message size
  - ompi_binary: same with binary tree, segment size of 32KB
- - ompi_in_order_binary: same with binary tree, enforcing order on the 
+ - ompi_in_order_binary: same with binary tree, enforcing order on the
    operations
- - ompi_binomial: same with binomial algo (redundant with default binomial 
+ - ompi_binomial: same with binomial algo (redundant with default binomial
    one in most cases)
  - ompi_basic_linear: basic algorithm, each process sends to root
  - mvapich2_knomial: k-nomial algorithm. Default factor is 4 (mvapich2 selector adapts it through tuning)
  - mvapich2_two_level: SMP-aware reduce, with default set to mpich both for intra and inter communicators. Use mvapich2 selector to change these to tuned algorithms for Stampede cluster.
- - rab: `Rabenseifner <https://fs.hlrs.de/projects/par/mpi//myreduce.html>`_'s reduce algorithm 
+ - rab: `Rabenseifner <https://fs.hlrs.de/projects/par/mpi//myreduce.html>`_'s reduce algorithm
 
 MPI_Allreduce
 ^^^^^^^^^^^^^
@@ -302,28 +311,28 @@ MPI_Allreduce
  - mpich: use mpich selector for the allreduce operations
  - mvapich2: use mvapich2 selector for the allreduce operations
  - impi: use intel mpi selector for the allreduce operations
- - automatic (experimental): use an automatic self-benchmarking algorithm 
+ - automatic (experimental): use an automatic self-benchmarking algorithm
  - lr: logical ring reduce-scatter then logical ring allgather
  - rab1: variations of the  <a href="https://fs.hlrs.de/projects/par/mpi//myreduce.html">Rabenseifner</a> algorithm: reduce_scatter then allgather
  - rab2: variations of the  <a href="https://fs.hlrs.de/projects/par/mpi//myreduce.html">Rabenseifner</a> algorithm: alltoall then allgather
- - rab_rsag: variation of the  <a href="https://fs.hlrs.de/projects/par/mpi//myreduce.html">Rabenseifner</a> algorithm: recursive doubling 
-   reduce_scatter then recursive doubling allgather 
+ - rab_rsag: variation of the  <a href="https://fs.hlrs.de/projects/par/mpi//myreduce.html">Rabenseifner</a> algorithm: recursive doubling
+   reduce_scatter then recursive doubling allgather
  - rdb: recursive doubling
- - smp_binomial: binomial tree with smp: binomial intra 
+ - smp_binomial: binomial tree with smp: binomial intra
    SMP reduce, inter reduce, inter broadcast then intra broadcast
  - smp_binomial_pipeline: same with segment size = 4096 bytes
- - smp_rdb: intra: binomial allreduce, inter: Recursive 
+ - smp_rdb: intra: binomial allreduce, inter: Recursive
    doubling allreduce, intra: binomial broadcast
- - smp_rsag: intra: binomial allreduce, inter: reduce-scatter, 
+ - smp_rsag: intra: binomial allreduce, inter: reduce-scatter,
    inter:allgather, intra: binomial broadcast
- - smp_rsag_lr: intra: binomial allreduce, inter: logical ring 
+ - smp_rsag_lr: intra: binomial allreduce, inter: logical ring
    reduce-scatter, logical ring inter:allgather, intra: binomial broadcast
  - smp_rsag_rab: intra: binomial allreduce, inter: rab
    reduce-scatter, rab inter:allgather, intra: binomial broadcast
  - redbcast: reduce then broadcast, using default or tuned algorithms if specified
  - ompi_ring_segmented: ring algorithm used by OpenMPI
  - mvapich2_rs: rdb for small messages, reduce-scatter then allgather else
- - mvapich2_two_level: SMP-aware algorithm, with mpich as intra algoritm, and rdb as inter (Change this behavior by using mvapich2 selector to use tuned values)
+ - mvapich2_two_level: SMP-aware algorithm, with mpich as intra algorithm, and rdb as inter (Change this behavior by using mvapich2 selector to use tuned values)
  - rab: default `Rabenseifner <https://fs.hlrs.de/projects/par/mpi//myreduce.html>`_ implementation
 
 MPI_Reduce_scatter
@@ -334,7 +343,7 @@ MPI_Reduce_scatter
  - mpich: use mpich selector for the reduce_scatter operations
  - mvapich2: use mvapich2 selector for the reduce_scatter operations
  - impi: use intel mpi selector for the reduce_scatter operations
- - automatic (experimental): use an automatic self-benchmarking algorithm 
+ - automatic (experimental): use an automatic self-benchmarking algorithm
  - ompi_basic_recursivehalving: recursive halving version from OpenMPI
  - ompi_ring: ring version from OpenMPI
  - mpich_pair: pairwise exchange version from MPICH
@@ -350,13 +359,13 @@ MPI_Allgather
  - mpich: use mpich selector for the allgather operations
  - mvapich2: use mvapich2 selector for the allgather operations
  - impi: use intel mpi selector for the allgather operations
- - automatic (experimental): use an automatic self-benchmarking algorithm 
+ - automatic (experimental): use an automatic self-benchmarking algorithm
  - 2dmesh: see alltoall
  - 3dmesh: see alltoall
  - bruck: Described by Bruck et.al. in <a href="http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=642949">
-   Efficient algorithms for all-to-all communications in multiport message-passing systems</a> 
+   Efficient algorithms for all-to-all communications in multiport message-passing systems</a>
  - GB: Gather - Broadcast (uses tuned version if specified)
- - loosely_lr: Logical Ring with grouping by core (hardcoded, default 
+ - loosely_lr: Logical Ring with grouping by core (hardcoded, default
    processes/node: 4)
  - NTSLR: Non Topology Specific Logical Ring
  - NTSLR_NB: Non Topology Specific Logical Ring, Non Blocking operations
@@ -364,15 +373,15 @@ MPI_Allgather
  - rdb: see alltoall
  - rhv: only power of 2 number of processes
  - ring: see alltoall
- - SMP_NTS: gather to root of each SMP, then every root of each SMP node 
-   post INTER-SMP Sendrecv, then do INTRA-SMP Bcast for each receiving message, 
+ - SMP_NTS: gather to root of each SMP, then every root of each SMP node
+   post INTER-SMP Sendrecv, then do INTRA-SMP Bcast for each receiving message,
    using logical ring algorithm (hardcoded, default processes/SMP: 8)
- - smp_simple: gather to root of each SMP, then every root of each SMP node 
-   post INTER-SMP Sendrecv, then do INTRA-SMP Bcast for each receiving message, 
+ - smp_simple: gather to root of each SMP, then every root of each SMP node
+   post INTER-SMP Sendrecv, then do INTRA-SMP Bcast for each receiving message,
    using simple algorithm (hardcoded, default processes/SMP: 8)
  - spreading_simple: from node i, order of communications is i -> i + 1, i ->
    i + 2, ..., i -> (i + p -1) % P
- - ompi_neighborexchange: Neighbor Exchange algorithm for allgather. 
+ - ompi_neighborexchange: Neighbor Exchange algorithm for allgather.
    Described by Chen et.al. in  `Performance Evaluation of Allgather
    Algorithms on Terascale Linux Cluster with Fast Ethernet <http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&arnumber=1592302>`_
  - mvapich2_smp: SMP aware algorithm, performing intra-node gather, inter-node allgather with one process/node, and bcast intra-node
@@ -385,7 +394,7 @@ MPI_Allgatherv
  - mpich: use mpich selector for the allgatherv operations
  - mvapich2: use mvapich2 selector for the allgatherv operations
  - impi: use intel mpi selector for the allgatherv operations
- - automatic (experimental): use an automatic self-benchmarking algorithm 
+ - automatic (experimental): use an automatic self-benchmarking algorithm
  - GB: Gatherv - Broadcast (uses tuned version if specified, but only for Bcast, gatherv is not tuned)
  - pair: see alltoall
  - ring: see alltoall
@@ -402,7 +411,7 @@ MPI_Bcast
  - mpich: use mpich selector for the bcast operations
  - mvapich2: use mvapich2 selector for the bcast operations
  - impi: use intel mpi selector for the bcast operations
- - automatic (experimental): use an automatic self-benchmarking algorithm 
+ - automatic (experimental): use an automatic self-benchmarking algorithm
  - arrival_pattern_aware: root exchanges with the first process to arrive
  - arrival_pattern_aware_wait: same with slight variation
  - binomial_tree: binomial tree exchange
@@ -419,7 +428,7 @@ MPI_Bcast
  - SMP_linear: linear algorithm with 8 cores/SMP
  - ompi_split_bintree: binary tree algorithm from OpenMPI, with message split in 8192 bytes pieces
  - ompi_pipeline: pipeline algorithm from OpenMPI, with message split in 128KB pieces
- - mvapich2_inter_node: Inter node default mvapich worker 
+ - mvapich2_inter_node: Inter node default mvapich worker
  - mvapich2_intra_node: Intra node default mvapich worker
  - mvapich2_knomial_intra_node:  k-nomial intra node default mvapich worker. default factor is 4.
 
@@ -428,10 +437,10 @@ Automatic Evaluation
 
 .. warning:: This is still very experimental.
 
-An automatic version is available for each collective (or even as a selector). This specific 
-version will loop over all other implemented algorithm for this particular collective, and apply 
-them while benchmarking the time taken for each process. It will then output the quickest for 
-each process, and the global quickest. This is still unstable, and a few algorithms which need 
+An automatic version is available for each collective (or even as a selector). This specific
+version will loop over all other implemented algorithm for this particular collective, and apply
+them while benchmarking the time taken for each process. It will then output the quickest for
+each process, and the global quickest. This is still unstable, and a few algorithms which need
 specific number of nodes may crash.
 
 Adding an algorithm
@@ -469,17 +478,17 @@ result in overloaded, hard to interpret traces. If you want to debug
 and compare collective algorithms, you should set the
 ``tracing/smpi/internals`` configuration item to 1 instead of 0.
 
-Here are examples of two alltoall collective algorithms runs on 16 nodes, 
+Here are examples of two alltoall collective algorithms runs on 16 nodes,
 the first one with a ring algorithm, the second with a pairwise one.
 
 .. image:: /img/smpi_simgrid_alltoall_ring_16.png
    :align: center
-          
+
 Alltoall on 16 Nodes with the Ring Algorithm.
 
 .. image:: /img/smpi_simgrid_alltoall_pair_16.png
    :align: center
-          
+
 Alltoall on 16 Nodes with the Pairwise Algorithm.
 
 -------------------------
@@ -495,7 +504,7 @@ MPI coverage of SMPI
 ....................
 
 Our coverage of the interface is very decent, but still incomplete;
-Given the size of the MPI standard, we may well never manage to 
+Given the size of the MPI standard, we may well never manage to
 implement absolutely all existing primitives. Currently, we have
 almost no support for I/O primitives, but we still pass a very large
 amount of the MPICH coverage tests.
@@ -532,14 +541,14 @@ privatized the globals through static analysis of the source code. But
 our implementation was not robust enough to be used in production, so
 it was removed at some point. Currently, SMPI comes with two
 privatization mechanisms that you can :ref:`select at runtime
-<options_smpi_privatization>`_.  The dlopen approach is used by
+<cfg=smpi/privatization>`.  The dlopen approach is used by
 default as it is much faster and still very robust.  The mmap approach
 is an older approach that proves to be slower.
 
 With the **mmap approach**, SMPI duplicates and dynamically switch the
 ``.data`` and ``.bss`` segments of the ELF process when switching the
 MPI ranks. This allows each ranks to have its own copy of the global
-variables.  No copy actually occures as this mechanism uses ``mmap()``
+variables.  No copy actually occurs as this mechanism uses ``mmap()``
 for efficiency. This mechanism is considered to be very robust on all
 systems supporting ``mmap()`` (Linux and most BSDs). Its performance
 is questionable since each context switch between MPI ranks induces
@@ -558,10 +567,10 @@ link against the SimGrid library itself.
 
 With the **dlopen approach**, SMPI loads several copies of the same
 executable in memory as if it were a library, so that the global
-variables get naturally dupplicated. It first requires the executable
+variables get naturally duplicated. It first requires the executable
 to be compiled as a relocatable binary, which is less common for
 programs than for libraries. But most distributions are now compiled
-this way for security reason as it allows to randomize the address
+this way for security reason as it allows one to randomize the address
 space layout. It should thus be safe to compile most (any?) program
 this way.  The second trick is that the dynamic linker refuses to link
 the exact same file several times, be it a library or a relocatable
@@ -569,12 +578,12 @@ executable. It makes perfectly sense in the general case, but we need
 to circumvent this rule of thumb in our case. To that extend, the
 binary is copied in a temporary file before being re-linked against.
 ``dlmopen()`` cannot be used as it only allows 256 contextes, and as it
-would also dupplicate simgrid itself.
+would also duplicate simgrid itself.
 
 This approach greatly speeds up the context switching, down to about
 40 CPU cycles with our raw contextes, instead of requesting several
 syscalls with the ``mmap()`` approach. Another advantage is that it
-permits to run the SMPI contexts in parallel, which is obviously not
+permits one to run the SMPI contexts in parallel, which is obviously not
 possible with the ``mmap()`` approach. It was tricky to implement, but
 we are not aware of any flaws, so smpirun activates it by default.
 
@@ -614,7 +623,7 @@ Reducing your memory footprint
 
 If you get short on memory (the whole app is executed on a single node when
 simulated), you should have a look at the SMPI_SHARED_MALLOC and
-SMPI_SHARED_FREE macros. It allows to share memory areas between processes: The
+SMPI_SHARED_FREE macros. It allows one to share memory areas between processes: The
 purpose of these macro is that the same line malloc on each process will point
 to the exact same memory area. So if you have a malloc of 2M and you have 16
 processes, this macro will change your memory consumption from 2M*16 to 2M
@@ -625,7 +634,7 @@ processes write and read to the same place without any kind of coordination,
 then this macro can dramatically shrink your memory consumption. For example,
 that will be very beneficial to a matrix multiplication code, as all blocks will
 be stored on the same area. Of course, the resulting computations will useless,
-but you can still study the application behavior this way. 
+but you can still study the application behavior this way.
 
 Naturally, this won't work if your code is data-dependent. For example, a Jacobi
 iterative computation depends on the result computed by the code to detect
@@ -649,7 +658,7 @@ SMPI_SAMPLE_LOCAL, and shared between all processors with
 SMPI_SAMPLE_GLOBAL. Of course, none of this will work if the execution
 time of your loop iteration are not stable.
 
-This feature is demoed by the example file 
+This feature is demoed by the example file
 `examples/smpi/NAS/ep.c <https://framagit.org/simgrid/simgrid/tree/master/examples/smpi/NAS/ep.c>`_
 
 .............................
@@ -679,7 +688,7 @@ results that you observe between both settings (visualization can be
 precious for that). Then, try to modify your model (of the platform,
 of the collective operations) to reduce the most preeminent differences.
 
-If the discrepancies come from the computing time, try adapting the 
+If the discrepancies come from the computing time, try adapting the
 ``smpi/host-speed``: reduce it if your simulation runs faster than in
 reality. If the error come from the communication, then you need to
 fiddle with your platform file.
@@ -730,10 +739,10 @@ fail without ``smpirun``.
 ..............................................
 
 In addition to the previous answers, some projects also need to be
-explicitely told what compiler to use, as follows:
+explicitly told what compiler to use, as follows:
 
 .. code-block:: shell
-               
+
    SMPI_PRETEND_CC=1 ./configure CC=smpicc # here come the other configure parameters
    make
 
@@ -765,7 +774,7 @@ Trace Replay and Offline SMPI
 
 Although SMPI is often used for :ref:`online simulation
 <SMPI_online>`, where the application is executed for real, you can
-also go for offline simulation through trace replay. 
+also go for offline simulation through trace replay.
 
 SimGrid uses time-independent traces, in which each actor is given a
 script of the actions to do sequentially. These trace files can
@@ -773,7 +782,7 @@ actually be captured with the online version of SMPI, as follows:
 
 .. code-block:: shell
 
-   $ smpirun -trace-ti --cfg=tracing/filename:LU.A.32 -np 32 -platform ../cluster_backbone.xml bin/lu.A.32 
+   $ smpirun -trace-ti --cfg=tracing/filename:LU.A.32 -np 32 -platform ../cluster_backbone.xml bin/lu.A.32
 
 The produced trace is composed of a file ``LU.A.32`` and a folder
 ``LU.A.32_files``. The file names don't match with the MPI ranks, but
index c3acda1..3711593 100644 (file)
@@ -20,7 +20,7 @@ virtually executes on the simulated platform. You can express this
 application using one of the following interfaces. It is even possible
 to mix several interfaces in the same simulation.
 
- - :ref:`Describing Algorithms with the S4U interface <S4U_doc>` (in C++)
+ - :ref:`Describing Algorithms with the S4U interface <S4U_doc>` (in C++ or Python)
  - :ref:`Simulating existing MPI programs with the SMPI toolsuite <SMPI_doc>`
    (in C, C++, or Fortran)
  - In some cases, you may want to replay an execution trace in the simulator. This
@@ -28,7 +28,7 @@ to mix several interfaces in the same simulation.
    your application is decomposed as a list of event handlers that are
    fired according to the trace. SimGrid comes with a build-in support
    for MPI traces (with solutions to import traces captured by several
-   MPI profilers). You can reuse this mecanism for any kind of trace
+   MPI profilers). You can reuse this mechanism for any kind of trace
    that you want to replay, for example to study how a P2P DHT overlay
    reacts to a given workload.
  - Simulating algorithms with one of the legacy interfaces: :ref:`MSG
@@ -44,8 +44,8 @@ to mix several interfaces in the same simulation.
  - We are currently working on the ability to modify any existing
    application so that it can run on top of SimGrid. This project,
    called `Remote-SimGrid
-   <git@framagit.org:simgrid/remote-simgrid.git>`_, is highly
-   experimental at this point.
+   <https://framagit.org/simgrid/remote-simgrid>`_, is somewhat
+   experimental but should be already usable.
 
 As you can see, SimGrid is very modular and can be used in many
 ways. We are working to improve it along two main directions. First,
index fe4dadd..2367d69 100644 (file)
@@ -22,7 +22,7 @@ to us and say hello! We love earing about how people use SimGrid.
  - For questions or remarks, drop us an email on the `user mailing
    list <mailto:simgrid-user@lists.gforge.inria.fr>`_ (to subscribe,
    visit the `web interface
-   <http://lists.gforge.inria.fr/mailman/listinfo/simgrid-user>`_);
+   <http://lists.gforge.inria.fr/mailman/listinfo/simgrid-user>`__);
    you can also check out `our archives
    <http://lists.gforge.inria.fr/pipermail/simgrid-user/>`_.  We
    prefer you to **not use private emails**. SimGrid is an open
@@ -31,7 +31,7 @@ to us and say hello! We love earing about how people use SimGrid.
    list.
  - Join us on IRC and ask your question directly on the channel \#simgrid at
    ``irc.debian.org``
-   (or use the ugly `web interface <https://webchat.oftc.net/?channels=%23simgrid>`_
+   (or use the ugly `web interface <https://webchat.oftc.net/?channels=%23simgrid>`__
    if you don't have a
    `real client <https://en.wikipedia.org/wiki/Comparison_of_Internet_Relay_Chat_clients>`_
    installed). When no non-french speaker are connected, we usually
@@ -39,7 +39,7 @@ to us and say hello! We love earing about how people use SimGrid.
    when we have a guest.
    
    Be warned that even if many people are connected to
-   the chanel, they may not be staring at their IRC windows.
+   the channel, they may not be staring at their IRC windows.
    So don't be surprised if you don't get an answer in the 
    second, and turn to the mailing lists if nobody seems to be there.
    The logs of this channel are publicly
@@ -66,8 +66,8 @@ Spread the word
 There are many ways to help the SimGrid project. The first and most
 natural one is to **use SimGrid for your research, and say so**. Cite
 the SimGrid framework in your papers and discuss of its advantages with
-your colleagues to spread the word. When we ask for new fundings to
-sustain the project, the amount of publications enabled by SimGrid is
+your colleagues to spread the word. When we ask for new funding to
+sustain the project, the number of publications enabled by SimGrid is
 always the first question we get. The more you use the framework,
 the better for us. 
 
@@ -83,7 +83,7 @@ the relevant part of the documentation on need, and help them becoming
 part of our community too. 
 
 Another easy way to help the project is to add a link to the `SimGrid
-homepage <simgrid.org>`_ on your site to improve SimGrid's ranking in
+homepage <https://simgrid.org>`_ on your site to improve SimGrid's ranking in
 search engines.
 
 Finally, if you organize a scientific event where you expect many
@@ -165,9 +165,9 @@ Futures and Promises
 """"""""""""""""""""
 
  - Some features are missing in the Maestro future implementation
-  (`simgrid::kernel::Future`, `simgrid::kernel::Promise`)
-  could be extended to support additional features:
-  `when_any`, `shared_future`, etc.
+   (`simgrid::kernel::Future`, `simgrid::kernel::Promise`)
+   could be extended to support additional features:
+   `when_any`, `shared_future`, etc.
 
  - The corresponding feature might then be implemented in the user process
    futures (`simgrid::simix::Future`).
@@ -189,7 +189,7 @@ It is in need of an overhaul:
 
   - cleanup, refactoring, usage of C++ features.
 
-  - The state comparison code works by infering types of blocks allocated on the
+  - The state comparison code works by inferring types of blocks allocated on the
     heap by following pointers from known roots (global variables, local
     variables). Usually the first type found for a given block is used even if
     a better one could be found later. By using a first pass of type inference,
@@ -199,11 +199,11 @@ It is in need of an overhaul:
   - We might benefit from adding logic for handling some known types. For
     example, both `std::string` and `std::vector` have a capacity which might
     be larger than the current size of the container. We should ignore
-    the corresponding elements when comparing the states and infering the types.
+    the corresponding elements when comparing the states and inferring the types.
 
   - Another difficulty in the state comparison code is the detection of
     dangling pointers. We cannot easily know if a pointer is dangling and
-    dangling pointers might lead us to choose the wrong type when infering
+    dangling pointers might lead us to choose the wrong type when inferring
     heap blocks. We might mitigate this problem by delaying the reallocation of
     a freed block until there is no blocks pointing to it anymore using some
     sort of basic garbage-collector.
@@ -213,7 +213,7 @@ MC: Hashing the states
 
 In order to speed up the state comparison an idea was to create a hash of the
 state. Only states with the same hash would need to be compared using the
-state comparison algorithm. Some information should not be inclueded in the
+state comparison algorithm. Some information should not be included in the
 hash in order to avoid considering different states which would otherwise
 would have been considered equal.
 
@@ -221,7 +221,7 @@ The states could be indexed by their hash. Currently they are indexed
 by the number of processes and the amount of heap currently allocated
 (see `DerefAndCompareByNbProcessesAndUsedHeap`).
 
-Good candidate informations for the state hashing:
+Good candidate information for the state hashing:
 
  - number of processes;
 
@@ -241,28 +241,28 @@ but it is currently disabled.
 Interface with the model-checked processes
 """"""""""""""""""""""""""""""""""""""""""
 
-The model-checker reads many information about the model-checked process by
+The model checker reads many information about the model-checked process by
 `process_vm_readv()`-ing brutally the data structure of the model-checked
 process leading to some inefficient code such as maintaining copies of complex
 C++ structures in XBT dynars. We need a sane way to expose the relevant
-information to the model-checker.
+information to the model checker.
 
 Generic simcalls
 """"""""""""""""
 
 We have introduced some generic simcalls which can be used to execute a
-callback in SimGrid Maestro context. It makes it a lot easier to interface
+callback in SimGrid Maestro context. It makes it a lot easier to interface
 the simulated process with the maestro. However, the callbacks for the
-model-checker which cannot decide how it should handle them. We would need a
+model checker which cannot decide how it should handle them. We would need a
 solution for this if we want to be able to replace the simcalls the
-model-checker cares about by generic simcalls.
+model checker cares about by generic simcalls.
 
 Defining an API for writing Model-Checking algorithms
 """""""""""""""""""""""""""""""""""""""""""""""""""""
 
 Currently, writing a new model-checking algorithms in SimGridMC is quite
 difficult: the logic of the model-checking algorithm is mixed with a lot of
-low-level concerns about the way the model-checker is implemented. This makes it
+low-level concerns about the way the model checker is implemented. This makes it
 difficult to write new algorithms and difficult to understand, debug, and modify
 the existing ones. We need a clean API to express the model-checking algorithms
 in a form which is closer to the text-book/paper description. This API must
index ffffe01..9b98829 100644 (file)
@@ -24,9 +24,10 @@ sys.path.append(os.path.abspath('_ext'))
 read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
 
 if read_the_docs_build:
-    subprocess.call('cd source; doxygen', shell=True)
-    subprocess.call('javasphinx-apidoc --force -o source/java/ ../src/bindings/java/org/simgrid/msg', shell=True)
-    subprocess.call('rm source/java/packages.rst', shell=True)
+    subprocess.call('pwd', shell=True) # should be in docs/source
+    subprocess.call('doxygen', shell=True)
+    subprocess.call('javasphinx-apidoc --force -o java/ ../../src/bindings/java/org/simgrid/msg', shell=True)
+    subprocess.call('rm java/packages.rst', shell=True)
 
 # -- Project information -----------------------------------------------------
 
@@ -35,10 +36,9 @@ copyright = u'2002-2019, The SimGrid Team'
 author = u'The SimGrid Team'
 
 # The short X.Y version
-version = u'alpha 3.23'
+version = u'3.23.3'
 # The full version, including alpha/beta/rc tags
-release = u'alpha 3.23'
-
+#release = u'3.23 alpha'
 
 # -- General configuration ---------------------------------------------------
 
@@ -86,7 +86,7 @@ primary_domain = 'cpp'
 
 
 # Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
+templates_path = ['_templates']
 
 # The suffix(es) of source filenames.
 # You can specify multiple suffix as a list of string: ['.rst', '.md']
index 3970ed3..97d219e 100644 (file)
@@ -15,7 +15,7 @@
    viewBox="0 0 210.6227 82.696243"
    version="1.1"
    id="SVGRoot"
-   inkscape:version="0.92.3 (2405546, 2018-03-11)"
+   inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
    sodipodi:docname="graphical-toc.svg">
   <sodipodi:namedview
      id="base"
      inkscape:pageopacity="0.0"
      inkscape:pageshadow="2"
      inkscape:zoom="1.979899"
-     inkscape:cx="196.07267"
-     inkscape:cy="183.99119"
+     inkscape:cx="460.43419"
+     inkscape:cy="220.43832"
      inkscape:document-units="mm"
      inkscape:current-layer="layer1"
      showgrid="true"
      inkscape:window-width="1920"
-     inkscape:window-height="1019"
+     inkscape:window-height="1024"
      inkscape:window-x="0"
      inkscape:window-y="32"
      inkscape:window-maximized="1"
@@ -45,7 +45,7 @@
     <inkscape:grid
        type="xygrid"
        id="grid924"
-       visible="true"
+       visible="false"
        originx="-2.3081243"
        originy="-2.3081328" />
   </sodipodi:namedview>
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
+        <dc:title />
       </cc:Work>
     </rdf:RDF>
   </metadata>
-  <g
-     inkscape:groupmode="layer"
-     id="layer2"
-     inkscape:label="underlining" />
   <g
      id="layer1"
      inkscape:groupmode="layer"
-     inkscape:label="Calque 1"
+     inkscape:label="Calque"
      transform="translate(-2.308124,-62.995623)"
      style="display:inline">
-    <text
-       xml:space="preserve"
-       style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.76111126px;line-height:7.14375019px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       x="88.616463"
-       y="116.2941"
-       id="text818"><tspan
-         sodipodi:role="line"
-         id="tspan816"
-         x="88.616463"
-         y="116.2941"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.76111126px;line-height:7.14375019px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:center;text-anchor:middle;stroke-width:0.26458332px">Experimental</tspan><tspan
-         sodipodi:role="line"
+    <a
+       xlink:href="platform.html"
+       style="fill:#ffffff;fill-opacity:1"
+       id="a2388"
+       inkscape:label="PlatformLink">
+      <rect
+         inkscape:label="PlatformBox"
+         ry="4.9609389"
+         y="63.333332"
+         x="60.854168"
+         height="39.6875"
+         width="56.88541"
+         id="PlatformBox"
+         style="display:inline;opacity:0.93999999;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.67500001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <text
+         id="text1024"
+         y="71.425667"
+         x="89.251396"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;line-height:6.61458302px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         xml:space="preserve"
+         inkscape:label="PlatformText"><tspan
+           style="font-size:7.76111126px;text-align:center;text-anchor:middle;stroke-width:0.26458332px"
+           y="71.425667"
+           x="89.251396"
+           sodipodi:role="line"
+           id="tspan2523">Platform</tspan></text>
+      <text
+         inkscape:label="PlatformText2"
+         id="text1028-1-4-3-0"
+         y="77.800346"
+         x="89.268448"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;display:inline;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         xml:space="preserve"><tspan
+           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.29166698px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:center;text-anchor:middle;stroke-width:0.26458332px"
+           y="77.800346"
+           x="89.268448"
+           id="tspan1026-2-99-6-3"
+           sodipodi:role="line">available resources</tspan></text>
+    </a>
+    <a
+       xlink:href="Experimental_Setup.html"
+       inkscape:label="XPSetupLink"
+       id="a6081">
+      <rect
+         inkscape:label="XPSetupBox"
+         ry="5.4806566"
+         y="106.98958"
+         x="60.854168"
+         height="38.364582"
+         width="56.885418"
+         id="XPSetupBox"
+         style="display:inline;opacity:0.93999999;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.67500001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <text
+         xml:space="preserve"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.76111126px;line-height:7.14375019px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
          x="88.616463"
-         y="123.43785"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.76111126px;line-height:7.14375019px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:center;text-anchor:middle;stroke-width:0.26458332px"
-         id="tspan820">Setup</tspan></text>
+         y="115.23576"
+         id="text818"
+         inkscape:label="XPSetupText"><tspan
+           sodipodi:role="line"
+           id="tspan816"
+           x="88.616463"
+           y="115.23576"
+           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.76111126px;line-height:7.14375019px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:center;text-anchor:middle;stroke-width:0.26458332px">Experimental</tspan><tspan
+           sodipodi:role="line"
+           x="88.616463"
+           y="122.37952"
+           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.76111126px;line-height:7.14375019px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:center;text-anchor:middle;stroke-width:0.26458332px"
+           id="tspan820">Setup</tspan></text>
+    </a>
+    <a
+       xlink:href="platform.html#performance-profiles-and-churn"
+       transform="translate(21.166664,43.282215)"
+       inkscape:label="ProfileLink"
+       style="fill:#ffffff;fill-opacity:1"
+       id="a6097">
+      <rect
+         inkscape:label="ProfileBox"
+         ry="0.99218708"
+         y="91.488617"
+         x="64.822922"
+         height="7.9375024"
+         width="29.104164"
+         id="ProfileBox"
+         style="display:inline;opacity:0.93999999;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.35299999;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <text
+         xml:space="preserve"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;line-height:6.61458302px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         x="68.990105"
+         y="97.56163"
+         id="ProfileText"
+         inkscape:label="ProfileText"><tspan
+           sodipodi:role="line"
+           x="68.990105"
+           y="97.56163"
+           style="font-size:5.64444447px;stroke-width:0.26458332px"
+           id="tspan6087">Profiles</tspan></text>
+    </a>
     <text
        xml:space="preserve"
        style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.76111126px;line-height:6.61458302px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="130.77637"
        y="104.49904"
-       id="text824"><tspan
+       id="text824"
+       inkscape:label="SimulationText"><tspan
          sodipodi:role="line"
          id="tspan822"
          x="130.77637"
          y="111.11362"
          style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.76111126px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
          id="tspan826" /></text>
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.67486387;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="m 120.85583,98.107143 v 7.559517 l 60.38375,1e-5 v 3.96875 l 3.96875,-7.74851 -3.96875,-8.126494 v 4.346736 z"
+       id="path885-2-0"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cccccccc"
+       inkscape:label="SimulationBox" />
     <text
        xml:space="preserve"
        style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.76111126px;line-height:6.61458302px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="122.5321"
        y="121.24089"
-       id="text830"><tspan
+       id="text830"
+       inkscape:label="ModelCheckText"><tspan
          sodipodi:role="line"
          id="tspan828"
          x="122.5321"
          y="128.03876"
          style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.05555534px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
          id="tspan832" /></text>
-    <rect
-       style="opacity:0.93999999;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.67500001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-       id="rect834-7"
-       width="56.88541"
-       height="42.333332"
-       x="60.854168"
-       y="63.333332"
-       ry="5.2916679" />
     <text
        xml:space="preserve"
        style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;line-height:6.61458302px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="122.6216"
        y="129.209"
-       id="text904"><tspan
+       id="text904"
+       inkscape:label="PropertyText"><tspan
          sodipodi:role="line"
          id="tspan902"
          x="122.6216"
        style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.46805573px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="151.19989"
        y="129.10596"
-       id="text904-3"><tspan
+       id="text904-3"
+       inkscape:label="ReductionText"><tspan
          sodipodi:role="line"
          id="tspan902-5"
          x="151.19989"
          y="129.10596"
          style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.46805573px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px">Reduction</tspan></text>
-    <path
-       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.67486387;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-       d="m 120.85583,98.107143 v 7.559517 l 60.38375,1e-5 0,3.96875 3.96875,-7.74851 -3.96875,-8.126494 0,4.346736 z"
-       id="path885-2-0"
-       inkscape:connector-curvature="0"
-       sodipodi:nodetypes="cccccccc" />
     <a
-       xlink:href="platform.html"
-       id="a6154"
-       transform="translate(-0.37797619,-16.630952)">
-      <text
-         id="text1024"
-         y="87.523804"
-         x="89.567154"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;line-height:6.61458302px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-         xml:space="preserve"
-         inkscape:label="text1024"><tspan
-           style="font-size:7.76111126px;text-align:center;text-anchor:middle;stroke-width:0.26458332px"
-           y="87.523804"
-           x="90.802567"
-           id="tspan1022"
-           sodipodi:role="line">Simulated </tspan><tspan
-           style="font-size:7.76111126px;text-align:center;text-anchor:middle;stroke-width:0.26458332px"
-           y="94.795403"
-           x="89.567154"
-           sodipodi:role="line"
-           id="tspan2523">Platform</tspan></text>
-    </a>
-    <g
-       id="g2892">
-      <rect
-         inkscape:label="#rect6249"
-         y="81.854164"
-         x="5.2916665"
-         height="7.9375029"
-         width="50.270832"
-         id="S4UBox"
-         style="display:inline;opacity:1;vector-effect:none;fill:none;fill-opacity:1;stroke:none;stroke-width:0.52899998;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+       xlink:href="application.html"
+       id="a6242"
+       inkscape:label="ApplicationLink">
       <rect
-         inkscape:label="#rect1020-7"
-         ry="2.6458309"
-         y="81.854164"
-         x="5.2916665"
-         height="26.458334"
-         width="50.270832"
+         rx="3.9687512"
+         ry="5.2916679"
+         y="63.333332"
+         x="2.6458333"
+         height="47.625"
+         width="55.5625"
          id="ApplicationBox"
-         style="opacity:0.93999999;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
-      <a
-         xlink:href="application.html"
-         id="a6238">
-        <text
-           xml:space="preserve"
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.76111126px;line-height:6.61458302px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="8.285965"
-           y="71.701172"
-           id="text814"><tspan
-             sodipodi:role="line"
-             id="tspan812"
-             x="8.285965"
-             y="71.701172"
-             style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.76111126px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px">Application</tspan></text>
-      </a>
-      <a
-         xlink:href="application.html"
-         id="a6242">
-        <rect
-           style="opacity:0.93999999;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.67541802;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-           id="rect834"
-           width="55.5625"
-           height="47.625"
-           x="2.6458333"
-           y="63.333332"
-           ry="5.2916679"
-           rx="3.9687512" />
-      </a>
-      <a
-         xlink:href="application.html"
-         id="a6245">
-        <text
-           xml:space="preserve"
-           style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;line-height:6.61458302px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#d40000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="30.003435"
-           y="78.263397"
-           id="text1018"><tspan
-             sodipodi:role="line"
-             id="tspan1016"
-             x="30.003435"
-             y="78.263397"
-             style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';text-align:center;text-anchor:middle;fill:#d40000;stroke-width:0.26458332px">(what you test)</tspan></text>
-      </a>
-      <a
-         xlink:href="app_s4u.html"
-         id="a6253">
-        <text
-           xml:space="preserve"
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="6.6014075"
-           y="87.184937"
-           id="Actors"
-           inkscape:label="#text1028-9"><tspan
-             sodipodi:role="line"
-             id="tspan1026-3"
-             x="6.6014075"
-             y="87.184937"
-             style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px">â–¸ Actors:</tspan></text>
-      </a>
-      <text
-         id="text1028-9-6"
-         y="93.328972"
-         x="6.6014075"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;opacity:0.93000034;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-         xml:space="preserve"><tspan
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
-           y="93.328972"
-           x="6.6014075"
-           id="tspan1026-3-0"
-           sodipodi:role="line">â–¸ MPI Legacy Code</tspan></text>
+         style="opacity:0.93999999;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.67541802;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+         inkscape:label="ApplicationBox" />
       <text
-         id="text1028-9-6-2"
-         y="99.473015"
-         x="6.6014075"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;opacity:0.93000034;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-         xml:space="preserve"><tspan
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
-           y="99.473015"
-           x="6.6014075"
-           id="tspan1026-3-0-6"
-           sodipodi:role="line">â–¸ Offline Traces</tspan></text>
-      <text
-         id="text1028-9-6-2-1"
-         y="105.61705"
-         x="6.6014075"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;opacity:0.93000034;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-         xml:space="preserve"><tspan
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
-           y="105.61705"
-           x="6.6014075"
-           id="tspan1026-3-0-6-0"
-           sodipodi:role="line">â–¸ Centralized Algo</tspan></text>
+         id="text1018"
+         y="78.263397"
+         x="30.003435"
+         style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;line-height:6.61458302px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#d40000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         xml:space="preserve"
+         inkscape:label="ApplicationText2"><tspan
+           style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';text-align:center;text-anchor:middle;fill:#d40000;stroke-width:0.26458332px"
+           y="78.263397"
+           x="30.003435"
+           id="tspan1016"
+           sodipodi:role="line">(what you test)</tspan></text>
       <text
-         id="text1028-9-6-8-4"
-         y="87.184937"
-         x="28.509558"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;opacity:0.93000034;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-         xml:space="preserve"><tspan
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
-           y="87.184937"
-           x="28.509558"
-           id="tspan1026-3-0-0-2"
-           sodipodi:role="line">C/C++/Java</tspan></text>
-    </g>
+         id="text814"
+         y="71.425667"
+         x="8.285965"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.76111126px;line-height:6.61458302px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         xml:space="preserve"
+         inkscape:label="ApplicationText1"><tspan
+           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.76111126px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
+           y="71.425667"
+           x="8.285965"
+           id="tspan812"
+           sodipodi:role="line">Application</tspan></text>
+    </a>
     <text
        xml:space="preserve"
        style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="122.23965"
        y="134.0621"
-       id="text1028-1"><tspan
+       id="text1028-1"
+       inkscape:label="SafetyText"><tspan
          sodipodi:role="line"
          id="tspan1026-2"
          x="122.23965"
        style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="122.23965"
        y="138.48441"
-       id="text1032-0"><tspan
+       id="text1032-0"
+       inkscape:label="LivenessText"><tspan
          sodipodi:role="line"
          id="tspan1030-6"
          x="122.23965"
        style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="122.23965"
        y="142.90675"
-       id="text1032-0-8"><tspan
+       id="text1032-0-8"
+       inkscape:label="PatternText"><tspan
          sodipodi:role="line"
          id="tspan1030-6-7"
          x="122.23965"
        height="19.843735"
        x="120.8558"
        y="124.18748"
-       ry="2.6458309" />
+       ry="2.6458309"
+       inkscape:label="PropertyBox" />
     <rect
        style="opacity:0.93999999;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
        id="rect1020-5-9-4"
        height="19.843754"
        x="150.8125"
        y="124.1875"
-       ry="2.6458309" />
+       ry="2.6458309"
+       inkscape:label="ReductionBox" />
+    <text
+       xml:space="preserve"
+       style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.52777767px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       x="188.00551"
+       y="129.28072"
+       id="text1028-1-4-3-1"
+       inkscape:label="ExhaustiveText"><tspan
+         sodipodi:role="line"
+         id="tspan1026-2-99-6-2"
+         x="188.00551"
+         y="129.28072"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222223px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px">Exhaustive test</tspan><tspan
+         sodipodi:role="line"
+         x="188.00551"
+         y="132.3744"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
+         id="tspan2707" /></text>
     <text
        xml:space="preserve"
        style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="151.79578"
        y="133.68773"
-       id="text1028-1-5"><tspan
+       id="text1028-1-5"
+       inkscape:label="DPOR"><tspan
          sodipodi:role="line"
          id="tspan1026-2-9"
          x="151.79578"
     </g>
     <g
        id="g11613"
-       transform="matrix(0.59989277,0,0,0.59989277,81.319387,49.091318)">
+       transform="matrix(0.59989277,0,0,0.59989277,81.319387,49.091318)"
+       inkscape:label="ExhaustiveImg">
       <path
          inkscape:connector-curvature="0"
          id="path3732"
     </g>
     <g
        transform="matrix(0.35277777,0,0,-0.35277777,258.78134,134.64879)"
-       id="g12312" />
+       id="g12312"
+       inkscape:label="g12312" />
     <g
        id="g15417"
-       transform="matrix(0.54868693,0,0,0.54868693,62.579767,63.933493)">
+       transform="matrix(0.54868693,0,0,0.54868693,62.579767,63.933493)"
+       inkscape:label="CounterExampleImg">
       <path
          d="m 234.15625,137.57317 h 28.83862"
          style="fill:none;stroke:#000000;stroke-width:0.14058194;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
        style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="152.1629"
        y="96.588707"
-       id="text1028-1-4-1-1"><tspan
+       id="text1028-1-4-1-1"
+       inkscape:label="text1028-1-4-1-1"><tspan
          sodipodi:role="line"
          id="tspan1026-2-99-0-8"
          x="152.1629"
          y="100.91529"
          style="font-size:4.23333311px;stroke-width:0.26458332px" /></text>
+    <g
+       id="g32724"
+       transform="matrix(0.1204976,0,0,-0.1204976,61.800118,144.45536)">
+      <text
+         transform="matrix(1,0,0,-1,108.462,27.9004)"
+         style="font-variant:normal;font-weight:bold;font-size:4.72424984px;font-family:Times;-inkscape-font-specification:Times-Bold;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
+         id="text32734">
+        <tspan
+           x="0"
+           y="0"
+           id="tspan32726" />
+      </text>
+    </g>
+    <g
+       id="g34108"
+       transform="matrix(0.0830545,0,0,-0.0830545,77.484414,170.53818)"
+       inkscape:label="g34108" />
+    <g
+       id="g34354"
+       transform="matrix(0.0830545,0,0,-0.0830545,77.484414,170.53818)">
+      <text
+         transform="matrix(1,0,0,-1,63.393,73.7527)"
+         style="font-variant:normal;font-weight:normal;font-size:23.99920082px;font-family:Helvetica;-inkscape-font-specification:Helvetica;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
+         id="text34358">
+        <tspan
+           x="0"
+           sodipodi:role="line"
+           id="tspan34356"
+           y="20.495317" />
+      </text>
+    </g>
+    <a
+       xlink:href="Plugins.html"
+       transform="translate(-1.5875,-6.6145919)"
+       id="PluginLink">
+      <rect
+         style="opacity:0.93999999;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+         id="PluginsBox"
+         width="29.104172"
+         height="30.427082"
+         x="152.13541"
+         y="72.593758"
+         ry="2.6458309" />
+      <text
+         xml:space="preserve"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.46805573px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         x="157.15215"
+         y="77.946869"
+         id="text904-3-4"><tspan
+           sodipodi:role="line"
+           id="tspan902-5-5"
+           x="157.15215"
+           y="77.946869"
+           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.46805573px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px">Plugins</tspan></text>
+      <text
+         xml:space="preserve"
+         style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.88055563px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#d40000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         x="157.55919"
+         y="83.230614"
+         id="text1028-1-4-1"><tspan
+           sodipodi:role="line"
+           x="157.55919"
+           y="83.230614"
+           style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.88055563px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';fill:#d40000;stroke-width:0.26458332px"
+           id="tspan15519">Your code</tspan></text>
+      <text
+         xml:space="preserve"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         x="153.11177"
+         y="92.569839"
+         id="text1032-0-9-0"><tspan
+           sodipodi:role="line"
+           id="tspan1030-6-4-5"
+           x="153.11177"
+           y="92.569839"
+           style="font-size:4.23333311px;stroke-width:0.26458332px">â–¸ Signals</tspan></text>
+      <text
+         xml:space="preserve"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         x="153.11177"
+         y="97.710327"
+         id="text1032-0-9-3-0"><tspan
+           sodipodi:role="line"
+           id="tspan1030-6-4-9-3"
+           x="153.11177"
+           y="97.710327"
+           style="font-size:4.23333311px;stroke-width:0.26458332px">â–¸ Extensions</tspan></text>
+      <text
+         xml:space="preserve"
+         style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.88055563px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         x="155.86807"
+         y="86.932091"
+         id="text1028-1-4-1-5"><tspan
+           sodipodi:role="line"
+           x="155.86807"
+           y="86.932091"
+           style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.88055563px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';stroke-width:0.26458332px"
+           id="tspan15519-6">deep inside</tspan></text>
+    </a>
+    <g
+       id="Models"
+       transform="translate(-1.3229068,-6.6145842)"
+       inkscape:label="Models">
+      <rect
+         ry="2.6458309"
+         y="72.59375"
+         x="122.17873"
+         height="30.427078"
+         width="28.633774"
+         id="rect1020-5-9-0"
+         style="opacity:0.93999999;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <text
+         id="text904-0"
+         y="78.04998"
+         x="125.24854"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         xml:space="preserve"><tspan
+           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
+           y="78.04998"
+           x="125.24854"
+           id="tspan902-0"
+           sodipodi:role="line">Models</tspan></text>
+      <text
+         id="text1028-1-4"
+         y="83.07312"
+         x="123.00803"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         xml:space="preserve"><tspan
+           style="font-size:4.23333311px;stroke-width:0.26458332px"
+           y="83.07312"
+           x="123.00803"
+           id="tspan1026-2-99"
+           sodipodi:role="line">â–¸ Raw Perf.</tspan></text>
+      <text
+         id="text1032-0-9"
+         y="92.446938"
+         x="123.00803"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         xml:space="preserve"><tspan
+           style="font-size:4.23333311px;stroke-width:0.26458332px"
+           y="92.446938"
+           x="123.00803"
+           id="tspan1030-6-4"
+           sodipodi:role="line">â–¸ Contention</tspan></text>
+      <text
+         id="text1032-0-9-3"
+         y="97.587425"
+         x="123.00803"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         xml:space="preserve"><tspan
+           style="font-size:4.23333311px;stroke-width:0.26458332px"
+           y="97.587425"
+           x="123.00803"
+           id="tspan1030-6-4-9"
+           sodipodi:role="line">â–¸ Collective</tspan></text>
+      <text
+         id="text1028-1-4-3"
+         y="87.287552"
+         x="126.59879"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.52777767px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         xml:space="preserve"><tspan
+           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
+           y="87.287552"
+           x="126.59879"
+           id="tspan1026-2-99-6"
+           sodipodi:role="line">Time, Energy</tspan></text>
+      <text
+         id="text1032-0-9-3-2"
+         y="101.55618"
+         x="126.7122"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         xml:space="preserve"><tspan
+           style="font-size:4.23333311px;stroke-width:0.26458332px"
+           y="101.55618"
+           x="126.7122"
+           id="tspan1030-6-4-9-9"
+           sodipodi:role="line">operations</tspan></text>
+    </g>
+    <text
+       xml:space="preserve"
+       style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.52777767px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       x="186.86519"
+       y="144.73994"
+       id="text1028-1-4-3-1-7"
+       inkscape:label="CounterExText"><tspan
+         sodipodi:role="line"
+         id="tspan1026-2-99-6-2-0"
+         x="186.86519"
+         y="144.73994"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222223px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px">Counter example</tspan><tspan
+         sodipodi:role="line"
+         x="186.86519"
+         y="147.83363"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
+         id="tspan2707-9" /></text>
     <text
        style="font-variant:normal;font-weight:normal;font-size:0.62165904px;font-family:CMTT8;-inkscape-font-specification:CMTT8;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.08914207"
        id="text17318"
        x="186.39912"
-       y="66.582924">
+       y="66.582924"
+       inkscape:label="LogsImg">
       <tspan
          x="186.39912 187.05951 187.3898 187.72009 188.05037 188.38068 188.71095 189.04124 189.37152 189.70183 190.0321 190.36238 190.69267 191.02295 191.35326 192.01363 192.67404 193.00432 193.33461 193.6649 193.99518 194.32547 194.65576 194.98604 195.31631 195.64662 195.97691 196.30717 196.6375 196.96777 197.29803 197.62834 197.95863 198.2883 198.61859 198.94887 199.27914 199.60945 199.93973 200.27002 200.60033 200.9306 201.26086 201.59117 201.92145"
          y="66.582924"
          id="tspan17316"
          style="stroke-width:0.08914207">[2.668][]Simulationtime2.66766</tspan>
     </text>
-    <g
-       id="g32724"
-       transform="matrix(0.1204976,0,0,-0.1204976,61.800118,144.45536)">
-      <text
-         transform="matrix(1,0,0,-1,108.462,27.9004)"
-         style="font-variant:normal;font-weight:bold;font-size:4.72424984px;font-family:Times;-inkscape-font-specification:Times-Bold;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
-         id="text32734">
-        <tspan
-           x="0"
-           y="0"
-           id="tspan32726" />
-      </text>
-    </g>
-    <g
-       id="g34108"
-       transform="matrix(0.0830545,0,0,-0.0830545,77.484414,170.53818)" />
-    <g
-       id="g34354"
-       transform="matrix(0.0830545,0,0,-0.0830545,77.484414,170.53818)">
-      <text
-         transform="matrix(1,0,0,-1,63.393,73.7527)"
-         style="font-variant:normal;font-weight:normal;font-size:23.99920082px;font-family:Helvetica;-inkscape-font-specification:Helvetica;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
-         id="text34358">
-        <tspan
-           x="0"
-           sodipodi:role="line"
-           id="tspan34356"
-           y="21.815273" />
-      </text>
-    </g>
-    <path
-       d="m 119.0625,174.45833 -6.67171,-3.05886"
-       style="fill:#87cfff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.01204976"
-       id="path32636"
-       inkscape:connector-curvature="0" />
-    <g
-       id="g2493"
-       transform="translate(-1.3229068,-6.6145842)">
-      <g
-         id="g2465">
-        <rect
-           style="opacity:0.93999999;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-           id="rect1020-5-9-0-3"
-           width="29.104172"
-           height="30.427082"
-           x="152.13541"
-           y="72.593758"
-           ry="2.6458309" />
-        <text
-           xml:space="preserve"
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.46805573px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="157.15215"
-           y="77.946869"
-           id="text904-3-4"><tspan
-             sodipodi:role="line"
-             id="tspan902-5-5"
-             x="157.15215"
-             y="77.946869"
-             style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.46805573px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px">Plugins</tspan></text>
-        <text
-           xml:space="preserve"
-           style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.88055563px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#d40000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="157.55919"
-           y="83.230614"
-           id="text1028-1-4-1"><tspan
-             sodipodi:role="line"
-             x="157.55919"
-             y="83.230614"
-             style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.88055563px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';fill:#d40000;stroke-width:0.26458332px"
-             id="tspan15519">Your code</tspan></text>
-        <text
-           xml:space="preserve"
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="153.11177"
-           y="92.569839"
-           id="text1032-0-9-0"><tspan
-             sodipodi:role="line"
-             id="tspan1030-6-4-5"
-             x="153.11177"
-             y="92.569839"
-             style="font-size:4.23333311px;stroke-width:0.26458332px">â–¸ Signals</tspan></text>
-        <text
-           xml:space="preserve"
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="153.11177"
-           y="97.710327"
-           id="text1032-0-9-3-0"><tspan
-             sodipodi:role="line"
-             id="tspan1030-6-4-9-3"
-             x="153.11177"
-             y="97.710327"
-             style="font-size:4.23333311px;stroke-width:0.26458332px">â–¸ Extensions</tspan></text>
-        <text
-           xml:space="preserve"
-           style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.88055563px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="155.86807"
-           y="86.932091"
-           id="text1028-1-4-1-5"><tspan
-             sodipodi:role="line"
-             x="155.86807"
-             y="86.932091"
-             style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.88055563px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';stroke-width:0.26458332px"
-             id="tspan15519-6">deep inside</tspan></text>
-      </g>
-      <g
-         id="g2452">
-        <rect
-           style="opacity:0.93999999;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-           id="rect1020-5-9-0"
-           width="28.633774"
-           height="30.427078"
-           x="122.17873"
-           y="72.59375"
-           ry="2.6458309" />
-        <text
-           xml:space="preserve"
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="125.24854"
-           y="78.04998"
-           id="text904-0"><tspan
-             sodipodi:role="line"
-             id="tspan902-0"
-             x="125.24854"
-             y="78.04998"
-             style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px">Models</tspan></text>
-        <text
-           xml:space="preserve"
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="123.00803"
-           y="83.07312"
-           id="text1028-1-4"><tspan
-             sodipodi:role="line"
-             id="tspan1026-2-99"
-             x="123.00803"
-             y="83.07312"
-             style="font-size:4.23333311px;stroke-width:0.26458332px">â–¸ Raw Perf.</tspan></text>
-        <text
-           xml:space="preserve"
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="123.00803"
-           y="92.446938"
-           id="text1032-0-9"><tspan
-             sodipodi:role="line"
-             id="tspan1030-6-4"
-             x="123.00803"
-             y="92.446938"
-             style="font-size:4.23333311px;stroke-width:0.26458332px">â–¸ Contention</tspan></text>
-        <text
-           xml:space="preserve"
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="123.00803"
-           y="97.587425"
-           id="text1032-0-9-3"><tspan
-             sodipodi:role="line"
-             id="tspan1030-6-4-9"
-             x="123.00803"
-             y="97.587425"
-             style="font-size:4.23333311px;stroke-width:0.26458332px">â–¸ Collective</tspan></text>
-        <text
-           xml:space="preserve"
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.52777767px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="126.59879"
-           y="87.287552"
-           id="text1028-1-4-3"><tspan
-             sodipodi:role="line"
-             id="tspan1026-2-99-6"
-             x="126.59879"
-             y="87.287552"
-             style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px">Time, Energy</tspan></text>
-        <text
-           xml:space="preserve"
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.23333311px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="126.7122"
-           y="101.55618"
-           id="text1032-0-9-3-2"><tspan
-             sodipodi:role="line"
-             id="tspan1030-6-4-9-9"
-             x="126.7122"
-             y="101.55618"
-             style="font-size:4.23333311px;stroke-width:0.26458332px">operations</tspan></text>
-      </g>
-    </g>
-    <text
-       xml:space="preserve"
-       style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.52777767px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       x="188.00551"
-       y="129.28072"
-       id="text1028-1-4-3-1"><tspan
-         sodipodi:role="line"
-         id="tspan1026-2-99-6-2"
-         x="188.00551"
-         y="129.28072"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222223px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px">Exhaustive test</tspan><tspan
-         sodipodi:role="line"
-         x="188.00551"
-         y="132.3744"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
-         id="tspan2707" /></text>
-    <text
-       xml:space="preserve"
-       style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.52777767px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       x="186.86519"
-       y="144.73994"
-       id="text1028-1-4-3-1-7"><tspan
-         sodipodi:role="line"
-         id="tspan1026-2-99-6-2-0"
-         x="186.86519"
-         y="144.73994"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222223px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px">Counter example</tspan><tspan
-         sodipodi:role="line"
-         x="186.86519"
-         y="147.83363"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
-         id="tspan2707-9" /></text>
-    <a
-       id="a6168"
-       xlink:href="https://simgrid.org/contrib/R_visualization.html"
-       transform="translate(3.9099913)">
+    <text
+       xml:space="preserve"
+       style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.52777767px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       x="190.76848"
+       y="87.178818"
+       id="text1028-1-4-3-1-5-3"
+       inkscape:label="LogsText"><tspan
+         sodipodi:role="line"
+         id="tspan1026-2-99-6-2-1-7"
+         x="190.76848"
+         y="87.178818"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222223px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px">Textual logs</tspan><tspan
+         sodipodi:role="line"
+         x="190.76848"
+         y="90.272514"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
+         id="tspan2707-0-8" /></text>
+    <a
+       id="a6158"
+       xlink:href="https://simgrid.org/contrib/R_visualization.html"
+       transform="translate(3.9099913)"
+       inkscape:label="VisuLink">
+      <image
+         width="27.781256"
+         height="16.668753"
+         preserveAspectRatio="none"
+         style="image-rendering:optimizeQuality"
+         xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAAJYCAIAAAB+fFtyAAAgAElEQVR4nOzdWZAkx3kg6N/jysj7 qvvq+z7Q3WADxEUAhAiSEkWRQ2k4EkezNra7Zjsy25d92JXt05rtw5pGtvsgM+08jK30sDPSzshG JzWiSIKAABBAN9BAX+ju6u6qrjsrsyrvzLgjfB8iKyq7OisrqzKrMjPi/1468ogob08Pjz/cPdwJ pRQQQgghhBBCvY3pdgIQQgghhBBCO8PAHSGEEEIIoT6AgTtCCCGEEEJ9AAN3hBBCCCGE+gC35fXf /uJvF5bmu5KU3uEvhhiy+1saloJICSEAIMuyoiiaRVgxyAv+zidxHwzKeV5Tu52KTbogqOEwABQK BYMYlNBAvD9ysoP8pRDTxt215TdYlnVeSpKkKIrBGHyA58Wt575rsBYnVgIdPCANmAzz1K9AKS0U CrpFKGHEcKKDf+sgDSp5Xu3aKV8SEgzDAoCkSaqhGILu7mLZHAHiLwXJHk52jhKxtmlZVrFY7Pdi ucWgnOM17WD+li4IOmvY25JmKLrJmRBh2QCDTZy7UIrH6687tkQiceXKlYmJia4kyWXIllll/vg/ /PHa47VupQYhhBBCCLnMd77zna985SvdToUbNGreIPTz5z478JT0kN+5/t8Vv6zudq/YxaB8rKhp GgCsr6/XNiD2GT3T+STug/+bfDz87/+fbqdi09oP//lnZ88YhrG6umq/8/mlT7ubpIO3t6LoiP42 VyqVnJdOsSxGCjNHH3UgfT3p7cC3+D+Od/CAW7IRAAzDyGQyAABAfkK/2sG/dZC6e8p/8N/8kV22 108v6n4VAPLR/JMjj7uVnu4a5UZf/cdvSgu77gAZ+UY8LSzb2+4ollscZClN//f/7fT9/2RvPzn6 Lc0XBYBjs7Nff+fdg0mAO3zwf/5hfYVpWZZzEUcd4dF+SYSQWxEgoROdHFXl8zGhUKj+He2g+u4R Qqi/iKJojxm21be+oY7AwB2h3uUb4aNMcM+787wVjUadl7lcrhOJ6nUrxvJ33vmTDh6Q/oIh1Kp/ pyKKc998u4N/AiGE3EG5Totf6s5LizfhfBeT40IYuDfABpnohV1HS0KSZ4JBv98PAPl8fh/ShTzn UO6z4T9to5v4T596tf7931AGBtpMUu+zwOIy+/ugDhfo5MOvCGlUO36lIgyv7HZH08pNZMr2doXS TKcThhDqNRi4N3BM/6KtaAkg+91fl4eHOpUehBBCLqZRLfzJtfiP/76dgxQjEfjhb3UqSQih3oSB O+pR1O8fMsd0U18FHB6HkNsEj4n+SQEAirkVXd/x6wghhAAwcEc9i8hy+ud5wzLhQreTghDqtGqw WDJLAGAQo9tpQQihvoHLCiCEEEIIIdQHMHBHCCGEEEKoD2DgjhBCCCGEUB/AwB0hhBBCCKE+gIE7 QgghhBBCfQADd4QQQgghhPoABu4IIYQQQgj1AZzHHSGEEEKogfvnXvz0ld/tdiraMjr1aYWWD+zP jXMr8MbmS0u34NMD++OegIE7QgghhFADOZnelKxup6Itb04Wv9TuHtifu6Pdrn/JG/wFuHRgf90L cKgMQgghhBBCfQADd4QQQgghhPoABu4IIYQQQgj1ARzjjhBCCKFepE5Nrf6b/+Fg/pYyPh4gr9rb DA0czB9FaLcwcEcIIYRQL/rbkekvEwf3YCXEa/+eeZDwK/zB/V2EWoZDZRBCCCGEEOoDGLgjhBBC CCHUB/pgqIyUlhbfXSYMHP/BcYYlB7avG1Cq5Jbl9SWtvG5psmXorBjkAxE+GA+OnWB9weZ7r1nm fV1fNM2iZemURhkmzjDHOf4Mz+MNn628UEl9nKIUhp8fjJ2ItbiXl4vlws8W5ayy49eiRyMjLwzv bV/hpG+Piet/aj61dvsdQsjYqz8kzM7VO57jT6EgZaTibEkraVpZZ3hGCPNiUkycjrM+tvXDePkE b0Jem8/d+4ACxI5fDY2favJNU5Ol1GM5t2wqlV/OPsjxWf+gP3Y86h/0H1hqewlVC+lq6rEhFQ25 TFieC0SEcDI8eY7hd6jr7Jy8Vbg9X5wzNYsTWW/npEv0euBOKc18vgYAvphvtzVgO/u6gFrM5Kc/ NuSn1ksz5LIhl+XscnnpfuzY88Gxkw33rVD6jiLPGEb9mznLylnWjGFc19RfE/1D7C6uZK5UXamm PklRCgAgJsUW9/JysdQreiuRNwCIia352fq+oURo1ylzB0oLMzcAgA/Fd4zaTU3+Q7g///VDDT/1 R/wnXj4eTOxwb9+OcW7ZilkAYBYN0Pbv77RKLair19JKXnXesQzLkA0pIxdnikNXhiKHw60cx8sn eBNKdjl3/0MKAABCZGD7L9LK0nRx9nNKa2seUYvqkqHPl0vz5fiJ2OCVAUI8lKt6NZ9/8JFWyW++ ZRqmJquFdDX1KHb8hcDwkW123czJ8njZME0A8HJOuklvB+4U1m9n1aIGAP7kLm8Q29m3/0np2fyD j2jdO6wvwLCcIVfsCpFaZv7RdcLyz572q6b5l7Kk0NreBCDGMAFCLICUaQJA3rL+RpZ/FAwGPHza S2lp5Zcp++LCsMQXa62V19vFsjRXavGbYnxrfra+byjZUoDlOrT45KZeLQCAEB5s/lWtnM3e+YU4 tJw1swBAGOBDAudjKaVKVqEUIA/pd1cPvT3Fivt1f/5If2hvnLHO+aHLM3iUFyqr11cto1bp8QGO 4Rm9olsmBQBTs1avp4Wo8Gyx3MrbJ/h21Hwqe+99SikAEIblQ/HG36M0d/9DaW3efkUIw/lDvMhD tfZ5/lGBFdnkucRBJLoHyGvzuQcfUcu0X7K+AMMJhly237EMPT/9MR+M8qFnMmRLTjJECAqWZhpK 7VBey0mX6d3A3dTM7N1c/mHBfikmd9H93c6+LqAWVp2onRXE6NEr4sAkw/IAQKklpR4XZ7+wTB0A ijM3/INThNm8Nhcsy4naBxn2ddE3znJs3af/n1SVKC1T61NNfd3XajOzy8hr8vIHK/ZFHQB8CZEw O9/DeLxYAoXSfK3/Z/LrE3ygWeXDBZ/+dDf7huL72E7cmyxDK83dqixP2y+FSLLJlw25vH77HcvQ AECM+wYvDfgH/U4B1iv6ws8XDcXUJSN3Pzd4eYd7ABeoLFdWPkrZ29EjkcSZuBARAIBSWnhUXLu5 Ri2gFs18vjb11kST43j9BN+GVsys333PiT6FcIKQxuOwCjM37FiT4YTI4eeCYycIYV58IXRj9bPU J6taWQeA3L1c7Fh0/+4ne4e8vpi994G9HRw+Gp46zwUiAACUVpani7M3KKWUWoXHnw5e+uaWfbfk 5MvfG71nfAkUlJziwZx0n94K3E3VVIuaVlTlNaWyXHECI2hhKEI7+7oJtYz89Ce1HslQYuDSN+yQ 3UYIExw7yQhi9sv3AcDUFb1aEMK1yzwF+Jmi2FH7MY77dX9gS/0aY5gXBd+7qgIAK6Z5IP+hnqPk 1aX3V5zGOQDwJ7a9QmOxdMhZxb5g+AfEwNDuGiN3ta9H+n8tXdWrBb1a0IoZObvkBEaw01CEwsNP 7Kg9OZmIvRjZkl18iE+cTdiDPeT1lsYmdUpcPz5Q+vWD/IsAUC0Xb7z3X8eNQ0DImSuvjEwdBQBw endGYHbqi/npOwDApNivFH9nS3bpmlotFSqlfDGbWU8tBswhp+/gReF7gVKkxWT4OEK5v+7Ef6i3 6JXc+p13nyqc4caFU87MVZYfAADDCYPPfWOzVZ6AmBTHXxub+4d5SsEyaXVVanHYUv/SpWL+wS8B gADET78cGD66+RkhoYnTlq6UFu4CgFbOAaVQVyyfzUnCLAN4NCddqYcCd0rp7N89qY+HHKzACCFh n/Z1GXltwVAqAMCwfOLsa/VRu8M/MMX5w/bwd72ScwL3VdNcNA0A8BPyTdHfsFUkydbeLlnWvvwH epta1JbeW7Z0ixNZy6CWYQGAuE2fOBbLeqX5WjQUPdJqNNORfd2J0tQnf1kfDzkYTuD8216MtVJW KaQBgOXFE18dmoYHz37HF62VTF0ynv10/6Sr9IuZg20OoDR94z29qgFA9MglST8EzyTAMA+v5m/b m4W7hVqr58buyx/+xXa/gpQOQLrV/07UR37V0PfyX+hherWwfvsdy9RZQaSmYZkGbHNXSS2jOPu5 vZ04/cqzY2mEiBAcDVZWqgCglXvgkYh9RWnu3gd2dkWOXH4qat8QGD5qB+7UMg257BRLzEkv2Bq4 M1qEQPYN5X86+KSUCzlN+XHDjwYHxq+ob+3Tvs8yYge43EOnSekn9kZo8myT67cTuFNz89r8eONp 1CmWE7dptsxvxOsR5qCnnYgy0QP+i1toFW35vRSvcaLPd+iVqdlfPAECADA8NMQzDW6Q5LwimAI0 ysjwYDjKtvDfYVzSj0ktWp4vAwDDkvDU7tp42tnXrfRqoWG8CLXAaNs+B3l90d7wxYY5QW/4VKjd uQEAzYckuYCUmbOfCuD84dDkmYbf4QLh6NEr9vaWSTz2/Ct4gSGX12//3NRVhhMSZ15du/Vz+/2G gXtl8b6hSgDgT06IyfGGBxQiAtjhZsnl4WY7xRJz0gu21ss6ZS0K//n+gTa02CxDNKaeGqpVnP1c LaQBIBJKPG6apHb2fdYbJL/zl3qSqclqPgUABCC47cPmAADObDNccHMSw+JGUO40q29BAZ5sBPdH uIO+qIeW/vUB/8V6mlyd/fgfGTng5/iTF37FWFaE0rsAwIv+ePYHkGtwkRZ19bmLlfp3lu7fKGfT AJAceS60dHHHP0qZax1KfpdVU1VTswAgNBFidjnTYDv7uhUrBoeufLv+HafGEyLNRqWbSq1AcsEY wFqDb1CortQeBgyOuflpAUqt0twtezt2/CvbDbwGIOHJsw0/2POv4HqmWl2/9TNTUxiWH7j4lqXV xlyxgp/1bX0QmVpmeemevR0+dGG7Y26e+66+IWqnWGJOekQPNagwnOCM2bCZG8Fl0yGb7e7rJnol b99kc/4IK247KZ5ezdv5QwgRNrrS5FOnqt/+ViWVAoCHg4OHLzQ47e+vrNx+8AAARJ4ffvHFVWEf B3uooyORcMAwjfTGO1+kuzY4x9TktZs/NeQKYdiBi288VBOluVulKgUAvz/5RYYCNBgPA8BvrqAN AACr6ZKhUgDQzWS6hf8OIV24hd4Ppbna+Rg5ElGySuFxUStpakljWCJEBV/MlzgV57Zp321nX7fa c41H2FpG6ZVcwy8UZ4t2NzrrY2PHutzHta+U7JI9qlAIJ8RE47bJ5vC605CpyWu3fm6oEmHY5IU3 hXDSiUQbdkQo2WXL0AFACMWF8LbznJiaM7mKS/ohG2qnWGJOekTvXu1MTbZ7fABgS+W4r/v2NTEx JibGdvgSpYVH1+0wMzh6kuFrj0j+OHrzo+fnV6/bcfLi33ML8RMxsjEPsamY63ezxXyRDgHDkok3 xv/t4Gf79L/YlATO4C7evbzvf6gpS1fXb79jyGVCmOS5133RIQDQSuv2p61foT1bLE3NrCxXAYAw kLufk9Ky85Glg6HIUlouzhST55KJ0/Etl/V29vWO1ouWEB2qrs4AgLy+uHSP0iN06zk+UwQAhiXj r466e8YJOVObLE9MTAAAUKoW0/L6oqlUASgXiPLBmH/wEGl5uJpnT/B6e6gtpUxteGdg+FiTRmBL 3Qg3BSyWjYsl5qRH9G7grpVq3bh8IMJwu2vZbWdfd6OWmbv/oVpcg9pEUU+N1ogeichrcvFJCQDW bq7n7ud9UYHhGK2s6RXdnthdiAijL43sPJ+xW1iGtn7nHb1aIIQkzr66cV9EtbJzKWq1T9yzxbKy WKEWBQBqgR15cyLLipylm4Zk2OXKMujarXUASJyJd2pf72i9aAVHjmqFdDU9CwBzX8xl72S9eY5T 05CzS/a2mBzXipn8o+v2wOKa7DIAcPN3Ysev7twaAgAePsEde6gtLUNTssv2dvN8dh694Nx7P9lO scSc9I5eDtw3TvVtZo/ap31dTK/k8g+vaeUsADCcMHDh61sXTCYw/MKQVtbsaeBM1ZQycv3ngSH/ +NfGGM4r44ypaWTvvquVcwQgfupl/8CU/b4hle0eSUKI8OziF9vonWKZtI5OKgc37971Rz8RjYy9 PTQ2efzsc6Fo3J5WzzSNhcfTs/dvGYYBAOxN9qXRf+YT/e3sGzAB4M8O7H/XC3ZTtEj81EuGXFZL a+Dhc1zJLdvPlbK8TytmijM3Go51M+Ry9s4vBi+9LUSHdjxm75zgXbG32lIrZ+01ATlfgAts/+g5 BXtZKwDwxV07kW47xRJz0jv6IXDf/WDBdvZ1JVOplBbuSqnHG6sy+QcuvsXXPZZqU7JK5uZ6k8mb pYy8dnN96PlBL0yVTS0z++V7du9E7MRTK0tvNq0F486g4R31TrFcqdDPD+oBdFOppB6sAgBh2PjJ F4vxo49SAKn6uThOyXFf9v6HAABgLX40Fxw90c6+z4+yBz0ZeLe1XrS0crY485laavRYKgB45hy3 z2sAsAy9MHMDAAKDh/wDk3wowfj8hlSSVmeqKw/th1dy0x8Pf+XXCLPDmd47J/jB23NtuZlp0eEm ozv0qm7PvUsY8Lm3L6idYok56R29GrhTajcMwx4ez29nX9cx5FJ54UspPWsvNw0AwZFj0aOXnaHt jtVHq/Mf16aKCwz5o0ejvpjAh3hTNdWCln+Ql9ZkACg8LhKWDLl9PUVKrdy9D5T8KgDEjj0fHDtZ /+lertBeLZYML46++D0AICy/tYdng3/oED9/R5eKAGBIpY7s6yEtF63qysP8o+v2ti82fPJlPhAU vXmOO4M3KLVYXyB+8qv1owuEcFIIJ/lgzM4uQy5r5ZyveaO7V09waK+21Dd+iGdnHK8nZWoPD/hi PoZ17S1lO8USc9I7ejRw16t5u8OIMOyzDcP7t6+bWLpSfHLTaWUHACGciB1/oWHtWV15+PjxDAAw PDNydTg8GXLu2BmO4YN8aCyYurZqz+9ReFRw+TwelObv/9Ieaxg5/FxoYutMuptX6JYfQfNssSQs x7LbTnDkfIsPxe3g2+7tbX9f72ixaDlRO8Py8VNf9Q9ODR15d01Lg/fOcWqZerk2qQ4hJHnu9YYn cnDsRHnpvrNQXfPA3bMneJu1pbbxQzQPN6upWrjpH9zdost9pM1iiTnpHT1aL9cNFkzCLnts29nX HSi1qsvTpbnblll7BkUIJ8JTF/wDEw170ExVKszciI0CAIy+OByaaBQqERh+fqg8X6YUqAVKXgkF doyo+lXh0XVpbR4AwhNnIofOb/mUWoZerc30v5snU71eLJtzOnxZYes0z/u6rwu0UrTsc9zejp9+ yRl//BTPnOOGUnHu8cKHLm5/+02EUMKOkJyZyLfj2RO8vdqSWnotY/ntlwukFpXStXAz4t4l2Nor lpiTHtLzgTsOcN8lvZLL3vvAWV9JCCcjhy6KybEmg97KC1/abUXRo5HGUTsAADA8w4d4+4F0S2/4 zIwbUGrZc24QALWQznz+D1u/YFnOuKPc/Q/tfBXCg7ETV5sc1uPFckemVrucNFnudz/2dYFWipZz jgdHjjWO2gHAM+e4E+4QQkLjp5p801kY9dllg7bw5gneZm1pGbrzKdlmLBwAVJZqS7AJYV5MuPZ5 ynaKJeakp/Ro4O48O7WHSrCdffudkl3K3vvAPqs5fzh65LJ/cHLH5dGU/Iq9ET0SafY9CpZRqxrc 2ocOAHo5Z2cgBdC2WaTG4XzBZ3dYbM/LxXJHlFpacQ0ACGF8iR1ysoP7ukMrRcs5xwMjx5odyxvn uNM2yfmbz9tIndZifqfJo7x5grdZWzo/BCGE2f4p/8JMbT7EyOGIi9dqaKdYYk56Si9WzZahbTYY 7/Ipn3b27XfV1KPCw2v2VTc8eTZy+LlWlg6h1HJWQedDfJNvKgXVkA0AIAzxxVw7S7HTcrYrza/W 3iyWWjm7futn9vboS7/ZZPodOTNvD+sSk+MMy7e5r6e0UrTqz/HmnRIeOcctXbU3mteQaiFjKFUA 4HwBIdLsaRZvnuDQdm1JzVrLMaWUWmbDeXuKmZK9gAMrMLHjbl7Kt51i2UpOymuyR3LS9XoxcHdm j+J8AVbY3fMT7ezb13SpWHj0KQUgDJs897XWl0qmdV1setXg/I2LBDVp+lN7UVUIjgVcvOJaaOJ0 aOJ0ky+kPv4vpiYDwMCFr+92ZRZPFUuG5S2zNumkXsltNxO2pauluZsAQACcFcHa2ddTWila9ee4 qVS2/ZpnznGnOVOXikBpwyHp1DLyDz+xt8NT55v3W3rzBIe2a8v6qaIMqdzgqUpKZz+dsTeT5xKs z7VlEtorljvmJKU0faNWSl2fk67Xi6ts1A0W3HXTRTv79jNaePiJ/VxL8uxrrUftAMDwgtOzVnhU gEbjWi2Tpj/LKDkVAAgDA+c9upo3AJiqZF+HYDd94t4slqwvQEithikt3IVGZcvSlezd9+wGpNDE GT4Yb39fT2mlaNWf45Xl6caZ6aVznA/XBhhQyywv3nv2C9Q08tOf2I3oQijhLCywHW+e4DvasbZk fX5WqI20riw/eOZzmnvwUbUgAYAQ5mMnXD5XTzvFcoecpLB6La0WVPBGTrpeb7a4b0xH2vJcex3Z t39JmXl74QZfdIgPxpxu8SZYMbhxs078g4eqqzMAUJovA0DyfEII1279TdWspqT12+u6VGv+TJ5L +mLeXbXBKWCcP9z6qubeLJaE5cTkuLy+CABKbiV3/6Po0cubT1PpqpSZKy/cMTUFAMT4aPTolY7s 6ymtFa3Nc1zKzAFA5PBFzl97oMWD5zjnjwiRATvrSnM3qWWEJ8/Zw7EsQ9OKmcLjzwylAgCsICbP v77jLDHePMF31EJtSfyDhyrL0wAgrc5wYig0dc6+Y9erheLs50puBcaBFZjx18YI4/JB2e0Vy2Y5 +eV7X5YWywBeyUnX68HAnTprEPh2/ZRPO/v2MSk9a2+oxUzq2l/v+H2WF0df/oHzMnLkkpJbtrdL 8+XSfJkTWc7PGbJhKPWrVEL8ZCx5doeHtNzN6RP37aJpzaPFEgCiRy6r+ZQ96EXKPJEyT1jBz/r8 lqGbctlp+A0MHY6f+uqW8KidfT2j1aJln+P2fY6UmZMyc6wg3swtLJQXvHmOx45fXbv5U2qZlNLS /J3ywl1WDAGAM1QdAPhAJHnuDdYX3Olg3j3Bm2ultgxPnZcz86auUIDi3K3Swl0+EDE12dyYYoXl 2LGXR4WIa5+4qNdOsWySk4HxAgAwHDP2ildy0t16bqiMLpUsQwcAQojTc3QA+/YvS1fVfGpXuwiR ZP2QTVbwD156Ozay2X1mKKaSV+uv6KzAjH51ZOjKoMcfRXcWE2m9ac2bxdLGBSIDF9/iA5sPQpma rJVzxkbkzfoC8VMvJc688uzTVO3s6xGtFy37HBfjI847pqZUclXPnuNCODlw/g12Y2QwpdSQy054 RAgJjZ0avPwtLtB0oi0A8PYJ3lwrtSUr+JMX3nSGeVDL1Cp5J2rng7FLv/pcYNgr6zO0Uyyb56Qv 5jv0zUnv5KS79dwFb7PPMRTf7fW4nX37l7w27zx51iIhvLVZiPNHzr94Tk3JhZmiVtaNqm7IBqXA 8Iw/IQbHg9EjEYbvudu8g/bUqua7HuDuqWLpECKDw1e/I68tSpknplIxlApQygh+IZQQByb9AxNN 8qSdfb1gV0WL80cGLv6KVlqvph4ZcslQqnaA7tlz3BcfHX7hN6qpx1ppzZBKhlJhOJ4Tw2JizD98 hBNbXXzK4yf4tlquLYVwcvjqd6vL02ppzagWTF1lfQE+GAuOHBMT4/7wu6AdSIJ7QzvFcrucPPu6 uDK4TDzaLelCPVfLBEeOBZvPNLw/+/av4NjJ4NjJjhxKTIojSVyUYXuEjL/227vdyZvF8mnEPzjl H9x23Z9929fl9lC0hMiAE0W9+mLsS+3uPqSrbzCcEJ482+ZB8ARvbDe1JcMJ4UMXvLh8WiPtFMuG OZmY+EVKW2k/YahHeKh9BSGEEEIIof6FgTtCCCGEEEJ9AAN3hBBCCCGE+gAG7gghhBBCCPUBDNwR QgghhBDqAxi4I4QQQggh1AcwcEcIIYQQQqgPYOCOEEIIIYRQH8DAHSGEEEIIoT6AgTtCCCGEEEJ9 AAN3hBBCCCGE+gAG7gghhBBCCPUBDNwRQgghhBDqAxi4I4QQQggh1AcwcEcIIYQQQqgPYOCOEEII IYRQH8DAHSGEEEIIoT6AgTtCCCGEEEJ9AAN3hBBCCCGE+gAG7gghhBBCCPUBDNwRQgghhBDqA9yW 14aqEKAXyeOupKZHfA7gf/ONdo5QikbsjTBI/ZKZ/Kxw2Dra7VRsxVib95b9kpMd1H5RrFcOh+2N CFRdnJmRInmvc5nWkM6xznb/5mSPnPKC5rM3oqR6Efo1M9skmPBpLCa0V241nne2+7dYbtGtUiro tcyMQrnfM7O7Z7pzETcMo1tpcBlCKa1//Qf/1x/JpVy3UoMQQgghhFxmaGjo937v97qdCjfYOlSG sEpX0oEQQgghhFypWCx2OwkusXWoDOfjAEDxyd1ITM9hCReohqhutfh9wjHgtyilTpeQyZg6r+1b AntdkAmR/F6eo2ADrMnU8tDJTI8Uyz1n2hasyFi8Vd+lZpqm/dI7xbJTmQkEmDCxrFpVQCk1TdPe 9kixrOdnAmyBh6d7a3eFiWxmpgdry84VS8KEAYtlRwSZENGJ83KzWLKmznmiWHaQj4iCKdiXG6dY siy7036oJVsDd1/IB4TeO3O3K6npNcPM8Nd+9m1pQW3x+/4xH/OKKknS+vq6pmkAUA1WHh97uJ9p 7GlvB77F/3F8DzsOvRlbD6YopZZlra6u2m96pFjuOdO2iF8JVUZz9cMKnWJZCZVnjj5q/0/0vk5l JnAQ+U22XC7brwzDyGQyAADEK8Wy3qu+10wBWGYAACAASURBVOJ/Mmlpew/co7/NlUole9splqVw 6cmR/h5M3KJOFUvGx4S+T7BYdsTbgW8Jcz7nZSaTsSvPUqT45NBM99LVly4Jl8fSY7quA4BzEWcY nA2lM7YG7gihLqMQmBLbPwwf5/x+v9MCBwCEkCbfd6vohWD7ByEs+PzEufBomlaLkBDaPUJJ6IS/ /eMwHBHFzQfV7PsftDdBEvCFNn+U9fX1LiYGoSYwcEeot6TN1W/e/5sOHOgRD4YBsNksmr90SQ2F OnDk/rFsLH3/T/9txw9bCQRmfvTbHT9sv9CpHjkToK0OIWyA48xoNGpv53Kemw5hyVz83p//QWeO 9f9ubhYjkbkf/lZnDus9VSpp/2mzxd06DdCBeyuEOg8D9x1wQZaPtjowiwsxhGV5nvdm0+azymbp 7aulPexo6ampjAYUNIDVjiertxlgBO5P78eRmdOnwWOBO9oPWWv9X/7V/8Z1KODO/LPvK8lERw6F EEKuh4F7MwpVjo0sBPItR1FVln4IxDDfTSZUgd/5+25XoqWRf/dn7RxBEUX43R91Kj0IIYQQQv0L A/dmTDDF+w/iP/773e7IfvfXYXhoP5KEEEIIIYS8CR/yRQghhBBCqA9g4I4QQgghhFAfwKEyCCGE EEKoM3jCD5gjlmkBgG7pq56bY2J/YeCOEEIIIYQ6Q6f62vsFvWgCgMWbcL7bCXIXHCqDEEIIIYRQ H8DAHSGEEEIIoT6AgTtCCCGEEEJ9AAN3hBBCCCGE+gAG7gghhBBCCPUBDNwRQgghhBDqAzgdJEII IeQqUSba7ST0GQ44Pso6Lwnb5LsIdRMG7gghhJB7EAr/y9/3dOBeuXLpb/ljJu12OuosMUR/fTNB vtVFRte6mB6EtoOBO0IIIeQq8R//uNtJaMaIxz4IHNF7KnJ/2itAwwQAIEzCJ/iT3U5OnxnihoKH RUOyAMAkRreT4zYYuCOEEEIINVAqjj2+05eB+9kB8j/+8f/clT9NyQeEWva27PPNfuubXUmGW2Hg jhBCCCHUgGbSnGF1OxV7IRssl1nrdiqAC/i7nQS3wVllEEIIIYQQ6gMYuCOEEEIIIdQH+mCojJSW Ft9dJgwc/8FxhiU7ft9QzOJMsbpS1au6qVmcyPoH/bHjUf+g5/prKKXVFamyXFGyiqGYlm7xQU4I C764L3osygd2+vUpSBmpOFvSSppW1hmeEcK8mBQTp+Osz3NzZVm6VZovy2uyXtX1im4ZlA/xQoiP HA6HxkPQtGCaqllerFSWK1pZN2WDsIQP8oGRQOxEbOdfwV0WfrYoZ5UdvxY9Ghl5YbjFY5YXKqmP U5TC8PODsROx9hLY31qvLffjh3Cf1ouWWlBL82UpLelVgxoWH+L5MB8eD4UPhwnZ+bLlZWo+tXb7 HULI2Ks/JIy36sP2mZospR7LuWVTqVi6xgqiEB0Kjp30RYe6nTS0X3r9JKGUZj5fAwBfzLdz1E4h /6iwdnOdWpvPquuSoc+XS/Pl+InY4JUB79Sh8pq8ej2tlfX6N7WyrpX1yko1/yA/eHkwdnzbKcPU grp6La3kVecdy7AM2ZAycnGmOHRlKHI4vI+p7ykUCjPFtVvrlv7USEe1oKoFtbxUEeO+sdfGGobg 1KKFR4X1u7mn9jWpqalKXs1PFwYvDcRPeiXW1Ct6K8EiAIgJscVjVleqqU9SlAIAiMlW93Kl1mvL /fgh3KfFomXIRvpGprJUrX9TLWpqUassVbP386MvjYhx336ntl9RWpi5AQB8KI5R+y7RytJ0cfZz SjcvLoYqGZk5KTMXGjtFR17sYuLQ/unt84TC+u2sWtQAwJ/cob2cUrr6cbq0ULZfEobwId7STEMx 7XfyjwqsyCbPJfY1yT2iNFdavZamdXNt8QGOcIxe0e27Gsuk6c8yDMc0jL/LC5XV66uWQZ19GZ7R K7plUgAwNWv1elqICp64GlHI3FzLTxecNxiO4YOcpVuGbNg5rOTVlQ9WJt+aYLinxp5ZhpX6aLWy UruiEwJckGdYopVrvwK1aObzNcKQJndQblKaK7X4zRaLlpSWVn6Zsi9bDEt8sS4UyGG2NxqkKSzf XuHLPM/wg4ODzVOVWlgNMcFWjjoxMBFkA1vejDIxcHsLSItFS8kqS++vmGrtKkMY4EMC52MppUpW oRS0krbywcqht6dY0XO9lC2gxSc39WoBAITwYLcT01cozd3/UFqbt18RwnD+kKVrpl67Ia+sTKce bz1zkTv0buBuamb2bi7/sBYwickdLslrN9ftqJ0VmIELyeixKGEIUFBySuqTVbvhOXcvFzsWdX0F KqUlJ2rnRHbw0kBoPMTwDABQixZnS07j8drNtfBkiDzdOFdZrqx8lLK3o0ciiTNxISIAAKW08Ki4 dnONWrWIc+qtiQP+rx28wkzRjtoJgfChcPJsQggL9sAYQzGzd7KFmSIAKHm1vFCOHt2MvymlKx+k qmnJ3jdxJhE7GeNE1v6oPF9Zu7VuyAYArN1cC40HOX/vnoydQaE0X7uvnvz6RPMxQlxw59yQ1+Tl D1asjamgfQmRMAcfTZLKox8e+B/dytS1zMyt7LwOMAgAZOzlyqOj236b0tSnf6tJSQA4cvUbvNjs 6m5lQ5Xc1lxVYgzQv+5AuntVi0VLr+hL/7RsahYAiHHf4KUB/6Df+aZe0Rd+vmgopi4Zufu5wcsY mD7F0tXC7K3K8rT9Uogku5ue/lKYuWFH7QwnRA4/Fxw7QQgDQLVyLnf/Q0MuA8DK4zsSpQG332N7 UMOrIxFJd7pHTdVUiqpaVKU1qbxUtizKkVoKYwMxgQjb7VhcKJUfVjjCsQJ7+M0pMb6RfgLigOj/ mn/mv85SALDASBvBwy01NQGAQHx917BkmXT100ytezfum/z6hB2y2+zGXU5klz9MAYChmGpBre8F 1kpa6uM0ABACIy8ORw5HNvclJH4yZipm9l4OANScQik9yKFHF4SLB/a3bKqkfnb7ht14efT5I+On x5/6WAB4Ge4odwurBQAYKgyfFE44H87fni+ul0NsWAgIZ187Ex54umfjJFSHqjd/cssyLaAwuj42 cmzE/iTJuvMCJmcV+/7ZPyAGhtp94ETJq0vvrzidQgDgT3Sj/4fCk2IX/iwAWLqqVwt6taAVM3J2 iVqm85GPGchvnyqttJ7JlwHAFxnMsMOgb/tNAGj4aYDfY5r7QqtFi8Lqp2k7ag9NBMdeGd1SGfIh PnE2YQ9ektdbGpjkejKl65aZNa370w+WSynD3Cy0QmSgiwnrL3JmrrL8AAAYThh87ht8KL7xCRHC yeT5NzKf/h0FoKY5bxhneFefrp60NXAnWoRA9kLx3xx8Uiil7//dn1umAQAiQP2tAyf4rpj/nBQb x4imaVz75G+GlVEAuHj560lmAp65aAmxd7KrywAwlrp4NH6pxSQJLAH+b3b7H+muymJZr+gAwPDM 2Cuj9VG7IzQREsK8HUXVB+6U0pWPVi3DAoCBiwP1UbsjcjhsB+6WSfWybjfGH4x3rr1xYH/LVnj0 aWVlCgACg4e04qsPrjUogeXcYHH5CwBIKROLpJZCU5VWr61QehgABi++dX1mFGYaHD+vxqvpWQDI fHwstn7VfvP5UXf2CJXma+NkokcalKtdUYva0nvLlm5xImsZ1C6x4k6j6VyF0tQnf1kfrDsYTuD8 zZ4/kdJP7I3AyPat8l7VetFScoqUlgGAE9mRF4YbNmH4orXqUZdw8UiwAP59pWxnRHVtnfIh56Md Cy1yUMsozn5ubydOv1IXtdfwgagvMabkVgAgZ/XlDPSoua2Bu0FZi8I/zDS4Huw3vZJPrzdu/BET idLstuWvPH+3uFwBAH9yQqqOQqPEF8vhcp4CwOJM/r6v1f9dxEe+rWktfrlHlOZqoxESp+N8aNtb bSEs2IG7Vbe0RHm+ohZUABDCfPxU4ycmhbAweKnWNOLuuWWoZUjpWrgdmjgN20wcY2qyvcGKmz05 laX79gNDwZHjvvjodn+CDycgPQsAhlLuVLJ7E7Voeb4MAAxLwlNtXaH1ir707pKpmqzAjL40svju sv2+OOChxyj1aqFh1A61lstt+8EotaTMHAAQhvUPHtqn5O1NXD8+UPr1LiZArpY/f/8nI8ooJ/jO X3j95oc/td9/yfcDsbS1n3bm4eeGehcAhgYPn1O+Bo2a1JdXpy31GgBEgoPPl77tvB/xEYA/26f/ Rc/K2s1yjTQvtKheZfG+oUoA4E9OiMnxht/hA1EM3F2sh4bVsmJw6Mq3698pzn6uFtIAIES2HR1I LbO8dM/eDh+6sN3XGK7W8kFcXTsYsiFtDKpuPuuLVq7dkAjRWi8wtej63ay9PXRlcNvhwgQSp7fe 4ruSVsqyvgALwAr+Jt24eqWWab6Y8zggldcX7a3g2IlGO218b+NCxnAuf8y3mqpuDCoINewFapEu GYu/WDIUk+GZidfHnYcCOT/Hu/4hgTp7qy0BQMkuW4YGAP6BSadW7BHpKv2iG21GNlOtrn3xj4Yq MSw/8Nybv3iirOcpALCCX1rxAWxNWG62JOUpAKxGI3ONk02zdxflPAWASHR0te47bu1Vay5MmB8F avc/2UuXvvC/vP7oRiuFFjl2H/AgF+qhSx3DCUL4qdG9plxrhmwSNinZZcvQAUAIxYXwtjPGmHpt WkOGd3OEpBa04GgQAIQwzwe3bW5XC6o9nIYwIG7MllBdqdpvigmffRCP88WGh69+t/l35PUFtbgG AHwg4k9O2m9aumYoFXv72X7Melqpth41K7i8tdjpCIociShZpfC4qJU0taQxLBGigi/mS5yKcztN aW/IxtK7S7pkMByZ+NqYmBTX79TumvxJ0VPXqL3VlgAgZZxxMse0cra6PK1LRUMqEZblA1EuGA9P nmV9npuMwtTktVs/N1SJMGzywptCOFmau2V/tF1jMGFrxVWv5Boes5p6LGeXAYDlfaGmN/AeIRIi srU7FiYUEgLJFgstcuw24PH320N6qBU9FLhvYWqy3R8EAFsuUfU2r0PDx5p1EBu1BmZ3B+7B0UBw dIeLLqU0fWPNfno1dizmzLHjzKQZGgvaX5MzcmW5qld1oCBEBV9UCE+GSQtrYHmBLhWrSw+qqzMA wPK+5Lk3nOeYncEzhDBNenj0Sl7J1WbvcXeoZGpmZbkKAISB3P2cPTLYZulgKLKUloszxeS5ZOJ0 fLsMM1Vz6b1lrawThoy9Mmavp6ZsTEbuqXEyz2qxtrQMTVlfAgBCSGXhrlJI1x1CNzUFCulq6lHk 0MXw1FnvtNZZurp++x1DLhPCJM+9bq9co5XW7U+3iymF6JB9+svri+XFL0PjpwnDbhxQKT25VU09 AgDCsMlzrzO8p8tnQ6baUqFF9XYb8GDg7kq9G7g7jZF8ILJdl65laEp2Y4RrYqzJ0XS59mDcAVeg UfPw1dKvHeRfbM4yzXuffZBYGQAATvB99dD3+JIPAEzDkGb/c8Q0AOD58K/SJ9b0rWtWMb8lnLRC 4ZMXX0wMN8vqeiHBVUM5S09u6lLRVCWrPk4KxeOnX+ECmw9cskLtUTZKLUMu13/koJaZe/BLZ+EM Vgw9+539wxE+yhzczPG55ZyPCkAAKFgZSyQ+TuQ4kbN0S5N0sG8iTSjfLgdJcOhsg05zUzNn339C SsTPilOvTEXHIwAAFJbyyyLxAcDQwGCw0cTkIngiYGqltgQAeW3eLnKUUjtqZ3mREURq6qZStWdR oZZZfPIFAISnzu1/wrvPMrT1O+/o1QIhJHH21Y3rCNXKTuDeeBRHcOSoVkjbD5cXZ7+oLN7jgjGG 5XSpZMplOzP5QCRx5lU+5InFQ3ZLba3QIsceAh6cC9KVejlw36g3w9t2omnlrH0d4nwBLtBkSDc1 qoWNox1oHbom0c+6N2pzC72Syz+8ppWzAMBwwsCFN366yNljN+W1hey6DgAs78vcXi3O3KAND5Ev 3V782eClt4XWllN201BOSq3y4r36NeoAwBcdHHjuG4Q8NWib4X2sL2CqEgCU5m8nzry65VCmUsk/ /ESvbi7qdMA9xaI2Obb2zQP7c9k7/xiWagUmMTI5deq5YCRud1BYppF6Mr04fds0dQCQr3MDke8L vqcm8TAN494nP+dyvjCQk1deGfQdhTUAALlSDBQ4ACCEOWr+C3atQW0WCTIAf7LP/7/ua6W2hLr5 ZADAPzAZOXSRD8XsdjtqGZXl6fL8HfsBwtL87cDIUecW1K2oaWTvvquVcwQgfupl/8CU/b4hle0B CYQQYduwm8RPvWTIZTsANXXVrO/BAPDFhgfOv+mMqEFbtFhokWMPAc8Q655LMHL0bp2yY0/lU9+J DjfpNjLkin01IoQ0H3PsVqZSKS3clVKP7XCcFfwDF9/ig5vzxtgDtQHAMnR7AerA4CH/wCQfSjA+ vyGVpNWZ6spDCkABctMfD3/l17y2PLVeyduVJiEEaG1RWrW4lr37XvLc17bkhn9g0l5YRMrMUdMI TZ7lA1FKLb2S10prlaX79fMrcGLogCOkrEw/Xzig+0lTqaRmVwGAMGz85IvG8NFMEaDo3P8QEE7L w2L2/ocAAKDnb84HRzcHBFPLzN59V8mnASB+4uo96xBspFxaTeeKFACEUPTDFfLs44MA8Py2M/q4 Siu1palU1GIGNn6IwPBTc0EShgtPnuN8QfuHoJapZJfqfwj3oZaZ/fI9u+qLnXghMHzE+WizByMY 3y7y1srZ4sxnTrPxs9RCujhzI3bihb5bDORgqC0UWlRv9wEPM8TsfSYA1LN6Nfai1G4YhqbPm+sb vZnNw3F1oyGED8W9Fm4acqm88KWUnt0INSE4cix69PKWIUNOvzClFusLxE9+tb4nTggnhXCSD8by j64DgCGXtXLO11qju2vwofj4a/+CMCwAsQxNXpsvPP6MWqaSWyk8+jR+6qX6L0ePXFayy/YjqnJ2 Sc4ubTmaLzbMsLz9vruvWwwvjr74PQAgLL/dEyb+oUP8/B1dKgKAIZWc9ym1cvc+UPKrABA79nxw 7GT9Xq1Eq57QWm3Zzg/hPm0WrerKQ7syBABfbDg4cpwPxjh/2NIVvVooL96z75EqqUfAsLHjX9nH /0l/slortKjebgOeQDTO4U2jG/VoFKtX8/YsxYRh6xuGt9DKtcf5m5djJb9ibwgRD8Walq4Un9x0 WtkBQAgnYsdfePZSRC1T38hJQkjy3OsNHxUKjp0oL92311LWK54L3AlhYGNIDMMJwdEThOFyD34J AFL6Sez41fqWOcJyAxffKjy6ruRTW4/DsJGp86HJs6uf/JX9jruvW4TlWHbHEfyED8XteHFzMBKl +fu/tO9tIoefC02c2bLP5oXf20+2tVhb7v2HcJ/2ipYTtTMsHz/1Vf/glNP8ybIhVgyJyfHc/Y/s 5wirK9PenKinuVy1ak+G27zQonq7DXhCcW9do72jRwP3utFvye37Gaml1+aU4LdfdI1SS90Inuo7 Q12MUqu6PF2au22ZtQWthHAiPHXBPzDRsH/NUCrORTp86OL2YRARQgk7cLc0XMEbnMUvKLVMTeL8 Tz2EyvnDAxe/ruRWtOKaLhUtXWV4nxAZDAwdZn0BrZgxN0pv88eMPMLpCmOFWohTeHRdWpsHgPDE mcih81u+Ty1Dr+btbXff+eyotdqyVc/+EO7TTtEyVckeTAgA8dMvOcPin0ZiJ67KmScUgFKqlbN+ DNyfli5vTATZiULrDbsOeJLjngh4PKjnA/ftO8EtQ3eGf5DtJ3lU1hftx4w4f/iAn0ztCr2Sy977 wJA3q8XIoYticqzJkDgnCieEhMZPNTm4s1ijqxuQqLYx4p8PJ5qMrSJ1wwcJ23DWfCImxsVEg8Xt nBWahHAS1/oGAFOrzdJj5wallj1fBwFQC+nM5/+w5fvUspzTP3f/Q7t0C+HB2ImrB5bmHtHZIUNb fgj3abNolRe+tKvB4MixbaJ2AACGE1h/2K6H6bYLhnpXulwGCACOc2vZHgKeYNTTXZEu1qOBu/PE T7PAXd8MN5ntn9yvrjy0NwLDR10/M7GSXcre+8C+rnD+cPTIZf/g5I7/aycnOX/zabmo0xDl4gnO LEPP3KwtdT728m81CdydQcAMx+9qBSXL0OwZoAEgOHJsryl1D0ot+2aJEMaXGAUAvZyzizEF0LZZ 4MbhfMEX88azqE9rpbZs0bM/hPu0WbSccQiBHc5c6sTrrm7m2KMMBu67tJeAB7syXKoXA3fL0DYb jLfvBKdmrfWXUkots2GApRYz9nTFDMeHnn78yH2qqUeFh9fsW/Lw5NnI4eecBUGaszZWWWv+fbWQ MZQqAHC+gBBx7a28Uz9C3cLRDclrC/aGmNgcgySvL5iKBABCdHC7QUelJ7fsZedZX2Cny38f08rZ 9Vs/s7dHX/rNJvPiyZl5e1iXmBxnWB7qWpF3xYNBQCu1ZTs/hPu0U7QotcyNRZGb90jolby9EBsh jDenMmtCobQgy8ADeH6cW+sw4EGOXgzcnam4OF+gyTR59RMjGFK5QeVIaWHjwf/IoYvuXjNVl4qF R5/S2kJ9X2s4PGM7TniqS0WgtOFtOrWM/MNP7O3w1HkX913UV4jbLZ8EAKZatSd8BIBg3Xrm1ZVH 9gOpofHTDQN3vVqopmqNItEjl1u8uepHDMs7s17qldx2c/9bulqauwkABCBy+KL9ZmjidGjidJOD pz7+L3ZgNHDh615+SKCV2rKdH8J92ilatG64gqlUtstwaplObSkmx3F1oS1SGzFo80s8qocBD3L0 4hyfdUM2m92Lsz6/Mz6hsvzgmc9p7sFH9ho3nD8cbDp0u//RwsNP7AdMk2df21XUDgD8xtB/apnl xXsNjm4a+elP7IY9IZRw9+zOrM/vXGid0HwLQy6t33nXbpv0D0zWT7DjzJCg5JadRwIcpiplv/wn +9rvH5gMDB/udPJ7COsLOEtTlRbuAjRY1MvSlezd9+yenNDEGT7YUtukqUp2aAWebGWv10ptuX8/ hPs0L1oMLzijFCrL0w1zklpG4eE1ewIQQkjkkGtvgfbMCdyxub11GPAgR2+2uG9MVrrDLG/EP3io tszN6gwnhkJT5+zrk14tFGc/V3IrAMBw/MD5N7esbekyUmbeXkbEFx3igzGnM7cJVgw6reacPyJE BuxsL83dpJYRnjxn96dbhqYVM4XHn9lTkrOCmDz/uttHzhEhnLRbzSsr00BI5NCFWusFpYZSkVZn nCVUOX94ywzuzsXekMv5Bx/FTr5o3wZQy5Az88XZz01dBQAhFI+fesnFHRcAQFhOTI7bj+EquZXc /Y+iRy87430tXZUyc+WFO6amAIAYH40evdLikZ0qgvOHPd6c2UptuX8/hPvsVLSIf/CQ/YCKlJkD gMjhi850UpauKrmV0pMvDLX2gG/40EUcJ/Os1EaLxk6XeFQPAx5U04OBO3UWA/Lt1JYWnjovZ+ZN XaEAxblbpYW7fCBiarK5MU0Kw3LJc69vN9rBNaT0rL2hFjOpa3+94/dZXhx9+Qf178SOX127+VNq mZTS0vyd8sJdVgwBgDN8FgD4QCR57g3WF+xo2ntR5NAFtbBqt4tXlh9Ulx+wYpCwvCGX6xvRhVAi ef71LVd3/8CUGBu2BxpKa/Py+gLnDwNh6vcVIgPJc1t3dKXokctqPmWP05AyT6TME1bwsz6/Zeim XHaaKwNDh+Onvtr6DaEzPsTn9Ra7VmvLffoh3GfHohU5cknJLduXGCkzJ2XmWEFkhYCpSqb+1CS5 ofFTz841iSjA6kaL+46XeFQPAx5k67nbMl0q2ZMZEUL4nWZvZAV/8sKbTv8RtUytkncKMR+MDT3/ q77YyL4muOssXVWfWeWnOSGS3NLWK4STA+ffYDdGxVFKDbnsRO2EkNDYqcHL3/JIjSBEhxKnX3H6 xCmAoVT1asGJvBmWi0ydH7z8doPbGELiZ1512t0ppbpUcvYlDBuePDf43Dc8MrKTC0QGLr7FB6LO O6Yma+WcsREssr5A/NRLiTOv7GpJY2d9HI+32LVeW+7TD+E+OxYtVvAPXnpbjG9eVkxN0So586mH 2vnE6Vdix6+6u0ttb3KWpdrPCRBmx0s8qocBD7L1XB292fMbirdyCRHCyeGr360uT6ulNaNaMHWV 9QX4YCw4ckxMjHuh6Uhem3eel2qREG7QzuGLjw6/8BvV1GOttGZIJUOpMBzPiWExMeYfPsKJO665 6Cr+ocNCdKiaeqyV102lYihVwjAML/LBmJgY8w9MNXn0hxX8Q5e/KWXm5cycIZcMpcqwPOcPi8nx wPBRr80NJ0QGh69+R15blDJPTKViKBWglBH8QighDkz6ByZ2HSk+tVi6p1vsdlVbdv6HcJ/Wihbn jwxc/BWttF5NPbJPcEuVKADD8kIkKSYmAqPH3DonT/s2B7i3dolH9TDgQdCDgXtw5NhuZ7ZmOCF8 6II7FwtpQXDsZLBDEz8xnBCePNuRQ7kA6wu0MbcGCQwdDgwd7mB6+hnxD075B7ddrWaXByPjr/12 Zw7V53ZfW3b0h3Cf3RQtITLg8fvGvTnP8+d5fu3VV78MvKmbu2tyQuD5gAdBDw6VQQghhBBCCD0L A3eEEEIIIYT6AAbuCCGEEEII9QEM3BFCCCGEEOoDGLgjhBBCCCHUBzBwRwghhBBCqA9g4I4QQggh hFAfwMAdIYQQQgihPoCBO0IIIYQQQn0AA3eEEEIIIYT6AAbuCCGEEEII9QEM3BFCCCGEEOoDGLgj hBBCCCHUBzBwRwghhBBCqA9g4I4QQgghhFAfwMAdIYQQQgihPoCBO0IIIYQQQn0AA3eEEEIIIYT6 AAbuCCGEEEII9QEM3BFCCCGEEOoDGLgjhBBCCCHUBwiltP71H/7Rv6tk0wbhupWgnkIAApZGdH23 O2o8TxkGACgQA9h9SFp/YAn4lWqbJWM6AwAAIABJREFUB1F9PntDB08Uy45kWkO6IFiEAAAFxvDG Tfs+ZSYFovkEe9sjxbIeS8CvSvD0tWPPsFh2DCGqUCuWPlXt/PE7xxIEifDdTkUzHBgEAAAsIGZ/ XsT371KyKxRA8/kAQBTF3//93+92ctxg6yXH0jVCgAejK6npQRrDwEbguAcEqKczk26G3e3zSk52 NNMaImDxYO3rn+gV+5+ZXimW9Sg4AWIHYbHsoP0+fvv65cRhgDJ9ktSt9r+Y7Yqmad1Ogks807xB PNHggRBCCCGEDgbDYHjZGVtb3IVgWCrlHtKprqSmRRMR8uY7f9HtVDTw5Nd+VVVVAKhWq6ZpAoDq U9aT691OV9ecFE4yHwX2sGPwsKgEKpZlUUrL5TIAAIHl0aUOp6/n7TkDbeIgZw5rhlFrLnKKpSIq 2YQniuWlxReUdAeaeSIn/GW26Ly0LKtSqQAAAJnu7dqy3vfJfOj6p91ORU3lhatLkQjUFUtZlHOJ bLfTdRDaPK8d4gBnjmye4JvF0pO1Zfsu6ZfVjSFGlUrFsiwAkP1SLp7rarr6T31OOhdxURS7mij3 2Bq4s5wAQJ7AWFdS06JEkH3u1u1up6KB0r/63VKpBACKotQCd0FND6W6na6ueS7wHJ+O7WHHgRPR fAgsy7Isqxa4U/BgTu45A23hmF+LlJ0OyrpiqXgkM5Nzg8V0B0Z5Dl2MU8F0XhqGsRG4Q4/XlvWO w/xwz9Sc6ReuFkIhqCuWis8rxbLN89oRDvuNWFVRFPvlZrH0ZG3ZvqTyK/YVHAAkSbIDd0X0SrHs oPqc3LyIow7x3GNVCPURBhhxaO+PcPFRjvh8hNgPWYGz4R2HjuVE/WH7x9HNsalHK85LCeBnQX/7 h0XepFrKS1fn2z+OGQzQLOGqtVvTCqWZ9g+KUNtYlo1Go/a2YRirq6vdTY/LYODeSSzLBgIBwLFc G1hgoxeCe9hRHOQigQil1OPnfNpc/ZdP/mrPu9MFFt6jhNYe+PvJpUtqKNShpPUH3+Li0J/9WccP WwkE4Ee/3fHDIo9Yt9ZH/l3ni2UxEoEf/lbHD+sdHMf5Np7mxIt4O8wvuOKXtftJizfhfHeT4zYY uHfUNG+lKADQGIGenurqgCwY89/90/+jnSMoovjod3/UqfT0HY1qgfvTnToac/o0eCxwRz3LjESG zXEAKNCCBjjdBOo+dkkUUhvdkj7ijblJUf/BwL2TTInKSxoAWAGKgTtCCG2HLZVW/ykPAPppE3DY EeoBakYvPZDtbes0xWKJehPeUSKEEEIIIdQHMHBHCCGEEEKoD2DgjhBCCCGEUB/AwB0hhBBCCKE+ gIE7QgghhBBCfQADd4QQQgghhPoABu4IIYQQQgj1AQzcEUIIIYQQ6gMYuCOEEEIIIdQHMHBHCCGE EEKoD2DgjhBCCCGEUB/AwB0hhBBCCKE+wHU7AQghhBBCvSjKxC4IF7udij7D+En0QtDeNsBIdzc1 roOBO0IIIeQqU9yhbieh//BRNjAl2tsMT+yNTHbo5vqJ7iVqF54fZf/X//1fdzsVtv/gbMkB/+Mf /U4Xk+I+GLgjhBBCrpJ9+BvdTsLOjseZf/Uf/6DbqdhE2RlimvZ29vJljQt2Nz0INYSBO0IIIeQq T4rdTkELEgESuD/d7VQ0Rs6egyAG7qgX4cOpCCGEEEII9QEM3BFCCCGEEOoD/TdUxtLVzPzSX8pS 3rIqlsUREiXMFMde5oUwg/chT6GUVlekynJFySqGYlq6xQc5ISz44r7osSgf2PbXX/jZopxVdjx+ 9Ghk5IXhjia5d1m6VZovy2uyXtX1im4ZlA/xQoiPHA6HxkNAdthdLail+bKUlvSqQQ2LD/F8mA+P h8KHw4TstLOLtFm02vwVvMYyNDkzpxYzplI1lPKfmLPj1UqMYc7w/HGOx9zaUXmhkvo4RSkMPz8Y OxFr9lUKUkYqzpa0kqaVdYZnhDAvJsXE6TjrYw8qvT2FqoV0NfXYkIqGXCYszwUiQjgZnjzH8L4m u1kATwxjxtBTplmlVKM0wjAJhhlk2Is878mr/B5zUqX0gaEvm2bRsoqWpQNECcHT3wX6KXCn1Kou T5fmbkdi5l98++yWTwlDjl45MnZqrCtpsw2x8/wbPADAHQPKXUwIAIC8Jq9eT2tlvf5NraxrZb2y Us0/yA9eHowdjz67o17RWwmtAEBMiJ1Ja4+jUJgprt1at3Sr/m21oKoFtbxUEeO+sdfGtrsRMmQj fSNTWao+tW9RU4taZamavZ8ffWlEjDerf12jraLV3q/gPbS68qg4+4VlbtYAOpjrlrVuWY8NY4jR fsPv92QY1KrqSjX1SYpSAAAx2ayuUwvq6rW0kleddyzDMmRDysjFmeLQlaHI4fB+p7an6NV8/sFH WiW/+ZZpmJqsFtLV1KPY8RcCw0ca7rhkmj9V5IL11DlesKyCZc2C8ZmmvimKF3lhXxPfU/aWkxTg jq69r6qaXXw3rFOKp78L9M1FjppG9t77Sm4FABjCZKw0F+QZlmhlnVoUAMCE1Wurw+ZQw2D0gJ2y zgQh1MUElOZKq9fS9ecsH+AIx+iVWnZZJk1/lmE45tkrSmmu1OJf8US4SSFzcy0/XXDeYDiGD3KW bhmyYeewkldXPliZfGuC4bbWg0pWWXp/xVRrMxUQBviQwPlYSqmSVSgFraStfLBy6O0pVnR/s9ze i1Z7v4L30MLjG5XlB85rhuVYMSQGNeXkSbtWmAf480Dge6dO8126eKsTk4GsCACM0Iu/l5SWVn6Z ohYAAMMSX2zbuq68UFm9vmoZtdqWD3AMz+gV3TIpAJiatXo9LUQFT9SWAAAgr83nHnxErVqlx/oC DCcYctl+xzL0/PTHfDDKhxJbdryn6z9R5Pp3QoTwhBStWiBvAvxcUXggZ3j+/2fvzqOkKu/E4X/v Wnt1VVf1vtDN2jSbCDSKIERF0TE0Kr64JGOi5gyjntE4juPJmPOL501+eScxkjNzzHhm0MkxhjEZ MIBxdBRcAihCI82+Q9P0Wl3VtW93e94/bvWlqK7eu6muqu/nD71UPXX7qaeee+/3PvdZrsMXybjR lSQB+CIe+0YQtFc4irJSlEAgSBJ3RC5F3hGNbjAauXx63pszsiRwJ8Rz4vOYtwsAKIDaWfPYed2s ngEAQkjwcqjniFuKSgDQ09xjrjCxhiz5XhMj0h3RonZWzxTd4DRXmGmOBgCiEP/FgNZs2dPcY6ky U0zSoUsgcDnxsKDqtsrB2y9ZU+6Xs++CX40XKQosUyyO+kLewqtdMqSY7Dnm8V3wA0DMGw+2Bgum XnPTKIbEti/aZUEBAL1dV3SD01BkoGhKe7d11xUpJosRqfdUb9HCouv81a63MVStsfwKeSjccU6N 2ikAQ3Gtdco81mgBoAqXfnk6RLqOdfee7wUAgFhTfWvhNHtGMslTe3R36gCg8JSTjXAAYBenOwPf zkhmUvg9ruZ9u8rkKvWfBY7iG0Nr0qZ0d145tv+zMpgCAKXV06bMnGu0FAAAIaTt4ukLxw4RogCA aV/xjbde3YNdTwFsmfCvkQlR9xXPyT3qtqlkqqV6Lmu0AgAQEmo/4794iBBCiOI7f7DohruSP9gq S1rUbqSoW3X66SzLUxQAyADHRWFPX/vx5/HYDI7L+WvPqEvyqChoUftsjlvK6+x04qoTJuTLePyY KACAS5FPS9K8/LgFyjHZUfkDl4+qUTujMzrqb50+t6xT/5n6FkVR1hqLzsa3fnJFkYkikXBnOJ+v 3IpMug66Eo937bqq2yrVkF1F0ZRtegGrZ9r3dgKAFJPjvnjyU+CoJ6b2rjE49cZiw/XO/aBmcDOv 818UIkLvkWYH4wCAmhunlNWVXfM2B3AznIyd8nf5AcDuLZzGTbv6LoGT35y0yXZgoLDSPnPFzNS+ 7Hawz3e0HGoBALPXnPbb8VTuPBQeddWSIlLP4R51u+gGp33WNYEmq2dKFheLITHcHQGAqDuWz4c/ AMjxiO/CIXW7YNoic+Vs7a0YxMJ82HKj2R/wq8XV09PD1Ga4wdtCCljgAKA7TA5fkDObGQAQQ709 zbuSuxhZTIWd6TImRvw93/xFkQkFYK9bFrFNvegCcGkpZwbMkUDrcQCg/O7Ocgn6zgCLypj7Jvpr ZIIY8XtP7wMAtUCMJVOvvkdR5so6RYypBSIEeyHpibBEyCexRCe6Ypr5f4xGPulsyQAs4HgjRb0f jQJAlBC3LJcyufyIcsQl2VdcQaJ83leSK3X6Rfw1VxATRd2h1/sVpVWWAKBDxsA9K2VB4C7HI8HW E+p24aybeauzfxqdTWeptvgvBQAg7hX6J8gfoStBMSQCAM3R5beUJUftGnOlmbdwahSVErgHLic6 MxTUWq9Lfkdg34H0jV4Tx3fuYKgjAADGoilKYPnFA2meKgZ7q/zthwGgJ1bZRa/SXhcCbtdhN0Ax w+mlmrXug2lC8Li3s6d9NwAwPYaAPc23W1TGAPx2XL5Lxo26avWe8qq9DizVZvvMdM3DFBhLjWok qvVKylvB1hPqk3Rj0RRzZV2aFFhcAxPDPvfR3YosMryeyJIiSwCQ9qIDhPSe3KMmsNYuvCa06mMs mapGV0SRpWgw0WKaq0ZeIACJw/msJPkVBQB4irrXYODT9d+YwXI2Oq52f3cpOR24j6FqHYwL6iE9 k+Vu5NNcdCiAapZRA/fotT3gUbbIgsA91HYq8bSxdLrOXjZQMp1dB5cAAIRQXgfugZZEb4TCOjtn HvBmmrfwauCuSFeHARGFBC8HAYBmKEt1fo2m6o8oUqT7grptrqyDAaYskYXE411Gf81qHVH3FXVD Zyuh2fQN51I0mPazuWfUVUuRiXpDDgD2mfaB5o2RYpK6wZnyugFpmJUWiystKRp0H90li3Ga5Qtn L+85skt9PW3gHnG1iGEfALAGi7lqdv8EAMAaLQVTb1S3B58AJAeMpUBOSYnnG4t53jbwoAs7TauB u5jTAeeoS1KRpRN9JXkjzw/Uez3SF68X4ODU7DT5A3eiBUCm8hmDpesLQPN17i0AACkqRbojAEBR MPg8BkIwcXvDF1w9e4Y7w2qHbHOlOW1TfV4RAh5GZ2QAGN6QvskNAADEkEfd0Nmumb5QjoXUDdY0 0CxyJNbbrm7pCyvGnN8RsNDWefz86/kXPW0evxwEBopqiupMs4b/QX+3X7RIAKAz8vPK5g0UuB/x H+UZHQDMrpjt5B3a67Ipk2PEr79hVtpYb2L+k8nWHS6D5HjYfeQTWYjRDOecf7siJPobMLyB0RlT EhOiBFqOqNu26YspaqCzJWWpSp0ALSeNpUBChFyWEneS9exgd5LabDPO3I04x1KSYZ+ngqKAoswU XTbwE4kuOfGcrTKHn1rktMkeuCuiIPUFQJx5sEFUUXfiPMvqJ9GXMtGm69kz2+f2UZU0AOithhrb lIGSRXwRd6QXGKAoak7RHK6vl9vZK2fV/tyzZ8xmA0zXue6oPxoNRGmGNhYYjDZj+exy3jiCXtdm OovDJp2tpGTJ2sHTRN2tcX8PAHBGq8FRlfwWxSTqoRjqTfvZcOf5qKcdABhOZx70pnTcuX2Ob75O 14liwnhO/iXaEwWAgOP2S7v4cPsZMeKXIgGKYThjAWuyW6rq+4dHCcWJ/+8+kP79qLvVc6INoJAz WoX2b0PH1ej+Aeqrcf0ek91wKm2oLaT+FryVN1Xk+KOeYZKFaM+RXVI8QtGMY963eItDC554q7P/ g4uYp029MPGWwut81z05jaVA3LI8lWUBwE7T1oEj8h5F9ioKAFAARbkbcY6lJC2Oku8P1VRxThI7 ZBkA7DQ9bdDbJDRpTaIYNy2tHwJF0dTAy6vEffFwV0TdZg2T6JD2+p1NB1Zc1z+pBj8StA8Q5QAh PUc+jvunA4C5fNaBo0vUlxVJ6Py6l5BCiqJcfy6M+boBCgCuGedHfR62Tplmqa4f6BF8ikVlDMC/ j/qrTGZixB9uOx3uugAADKdzzFkF1/bL5AuK1Xej7ivBKyfMFXUUnaiZihgLXDoS7jwHABTNOOas pLlcnhFfkYSYuw0AKIoKtR6P+bqvvieLshADX3e485x1yvzhVy3VkL8CShbxR7pPuPwXAwDA6JiK 5WV5tfjXQBQx7j66W4oGKYp2zFmpKygGACHgVt9N++Ai6rqsbugLKwEACIn7u6PuK3IsDEBYYwFn shmKpmiHfM4bS4HUsGwNO0QoogDs7htzqQ5UHc/cTyYTV7U8inJYEI6LAgDoKarRYMzZxxa5brIH 7gyfeJJLiDLQ4B4ik86vuhKzuQMM0rEbEUXuPbVXbSSmWd5ac7W/RLTnsjqWgBCihlYMp6d5PZFF ORYmfR/3XzoMAJbqOZnIfoYFLjWLEb8cjyhCVIonbhR5s91ed0v/mmkqnSr4usPdFwHAf/Fw6MpJ 1mSjGVaMBORoUC1PzmgtnL28/3zGOWZ8q9aIfgWUXFzfnD/hk/0AoLfrSm8q5a25M2fRqCmS4D62 Wwz7KIoqrF+uL1SX8CNCUAvcU+dpJbIU9bSp23pHheB3ec8dUDslJ3jaAYC9fMw2fUnfDnPZRBeI BPA/0YjaTqynqJt1OTtaYNxLcl887lbkMCFhhWiTuBfRzN0GQ2HudjfKeZM9cKc5HaMzyvEIAAQu Hy2cvTwlgRgWuw+44v6rA1L1Duy1mZ4Y6vWe/VoIegCAZnnnvNuShwdFui9p2wZnlXXKfM5sU5s/ iSKF2s8ELx9Tx7kHLh81lk7V7qnyBCFK8MpJQq5Z0k9XUORcsHqAboiUfdbNUjQYD/QAgCzG5eSW ZgCdrcQ591taj5ocNo5Va+S/Ql5LW1yGIkPVtyq09QTyGZElz/HPhGAvBWCftczgrFZflyJBRRIB gKIovt99day3XZ23h+F0gt/lv3Ao7VBJKRr0HPu06IY7+YLidO/njgktEJcs74rHuvqi9vsMRkPu NrePb0nKAAeFuHLti+UM86DRlC9PgnJUFgQNBmdVqP0MAERcLUSWzFX1YtwpUXLcG4+6o94zvuR5 UTgzx+bBCpQjJcdCgdbjkc7z6lmA4Q3O+bdzSYMm5Vgo7ncBAEUz9plLU+afomjWUjWH1Zk8p/YC AFHkmKfNVHZdu2VnnBjyqgEQRVFAEsPy4/4ez/HPHXNupejUQ0kIevwXmtSoPa24r9t/4ZBtRkNu 9+4Y36o10l8hz6UUl/pitCfavqejfHk5zeRyxRsSUWTPic/Vx4+2GdcsHS/0Hbacyd7/1lr9CAAo kqhOmW8smmJwVnHmQlpnkCKBSNeFcMdZAkAAes98VbL4r3K7Zk5QgQQU5WtBUFcLAgATRT1gNOXw sFQY75LskWU1NqIAtBuADlneEY2s1RvYnL7u5LYsOJsU1C6MedrV4RpRT1vU0/Z5G32ZvaglMBYb aI4OtYcBwODI5b7CoyBFA8HWE5Hui31BDphKpxVMXZjSqZrm9GVL1wEAxXADTVtmKJ7CXT4mRvwA IEWGu3Z9zuDM9ooVD1E0A0ApkhDtuew730QUOdbb4Tt30D7r5uTE4Y6z3nOJQQY6W4mpdDpnsrEG iyLGxLAveOWkGsuGOs8BzdimL87A97lexrdqjehXQCnFNb1kq/tAjyKRcGfEdchV2lAy9C5yFCFK 78k96rp+tmmLTOXXTCEweAd3rRcNIQqjM9pn3pTcaYG3OHiLgzPZ1DOAFA0KwV5dTje6j3uBeBXl gBA/KV6d9XEOx63Q6XO4a7tqfEuyiGH+zmxhKIoCiBFyVhI/j8UkgBZJ2h2P3aXPr2fmuSQLbl4p hnXOv12fbgZ3mqGc8xyVKytinsSwFYMTA/cERYx5z+7vPrAz3HVBjdp5S2HxwjX2WTf3HwpJMSyj NzN686CTDVPaxD4pD9/zAUXRFM2qHTxoljeVzbDPvEl9K9J9iciSllKL2mmGc9SvKFpwh7GkljPb 1ULWOyqLblhtLK7tS3xG7uuonZPGt2oN/1dA0K+4SqeXlixOBOuBlmDys8r8Qoj31D61M7G1ZkHy 4rIqtT8hAPAWR+pHFVkMJuaJoijKMWdl2q7GpvIZrCExIe9A80rlhvEtkAghn8Ri/xkOneiL2ksY 5mGj6S69Ieej9nGvWgwA2zf8XE9R8zl+dV+wfkoURVx9KWtlQYs7ALAGi3P+bbHeDsHfI0b8dqfU azbrnXprtYU1stGeqBRLzEtqKsPZzYAQJdx+JtByVFu1m7cUWqrnGZyVI5qyoz/tqRzDDzBzXz7R OxJzdRGiyEKENVjh2gXn7XU3a71mr0XZZiyJui4RAEKIEPQYBpoJMW+Mumql/RXQQMx98z8ShUhR ibfk4/hU37kDkZ7LAGCpnG2dMjflXaJIYtirbvcfmSrFQtq9pWXK/P6RfR+KNxeqK6xpU8LnpPEq EBmgWRC+EuJCX0BZwjBLed00ls3xgL3PdahaU/tm71EAQoTYc/1eKFdlR+AOAACUvrBCndZ0cR0X NZzQ3gi1JSZ6Nzj0OKWMGOr1nNyjLcnJWxzWKfP1jvIxhuwqWdDm3MzhdVWJ0NfRkLMUDtKDkErq bUkxiYqnLThvKp02QNQOAECzPGOwqD8TthNDmqo1pl8h/wy3uCBpTCrN5eNwIEIUda4nCiDu63Z9 82FqAkXROhb2ntqrnjh5S5FtxhJICpUoijJXDLaUmHoeAIABFyjICeNSIC5Z/iAW9fatr1TKMDfx utq8CdlVYyjJxOEf0jESIYN0Xk8+4HmM2rNWFgXu6cmCrK2Ibq3N98a2mKfNc3KPelSzBktB7UJD UdW4hOwAQIiinh0oitYVpum5lBsUSXQ1f6xuly97cJAYSOuNTbMcwyd6H8W8HeqGsXTaoH+HaPF6 bl/Xh6N/1Rrjr5Bvhl9cQiAx1I/haTYvF5kWg73qGZIACEN1YtES6GyJM54i9q30Z7DS7CDPK4jW bJ/b872OvUAuSNIH0Yh6NrTR9HKdbgbL5WFQOeqS1A7/U2ZKHDSq6+27NdJRVM53Pcphkzpwj7pb 5VgEAPiCooEeG3mO9cqCAgCckS3I78A93HnOd/ZrtaXIUlVvrVkwnDUahKDHfeQTdbvs5vWDzE4Y dV1W+97oHRV07jZtamdPABj07AnRnlZ1Q1+Y6INEiCL3LfQ7+EMJMeRVFxejKHrwJYGz11iq1lh+ hTw0/OLSnk+ayk35WVrawNMR0UapKmJc3Rj87Br3uaRYGABYnZG3DtTnIReMsUCOisKuvpWVFvP8 Mt1kWvn8+hp1SSYf/rpBw/FzUqK1aGqePc3IMZP6GAl3nIt5OwHAXFGXNnCP+wXfhcTaBM75TiqP ZzcTI37fuYMksRLnrcNfKplmOKWv6VcM9Q40L6wixgMtzQBAASQv25R7klsrB1rzCwDkeFidpRQA TOWJ6QuJJGoP2eVYaKD5yIkie8/uV7f1jorBI63sNZaqNZZfIQ8Ns7ji4bj3bOKEaZtWkDZNzjNX 1pkr6wZJ0PnVNvWm2jnvtv6jA7WjVYz4gZC0c7kSRdIOcEv13Ny+nxxLgURD/k9jMQBgANYajLVD rZ+a20ZdksmHv09RBlpZKagoh/vm1pzH5eZFJ09M6llltInGtVUJkkkRqWNvhzqWw1xpsk7J4V7X QyK+s/vVcS2O+hXDj9oBgNEZtZVrAq3Hk+Z7vUoRY57jn6t3+ebK2ZwpN1uIVYzOoJ1AtaAwhRQN uI99pjYSG5xV2oRcNMfTfe3KofYzaQuTKJLv7NdCsBcAKIqyTsnZu6CxVK2x/Ap5aJjFdfLzk4qo AICl0mwowsng0pDjETVqhwHmguQsiW4eRJGDV072T0BkyXtmvzp8hTcX5vx6F2MoENJy9Cu168a9 eR+1wxhKMvnwbxaE/h8EAK+i/CkaUQf+TmfZSiYfu8nljEl9qGjnTSka9J7+0jZzqVo7ZVkKXAq4 mt1yXAYAvV1XtrQ0pxs1hhBxXVYXbtAVFHMmm9ZbYxCM3pS4WWdYvaMi6r4CALHejt5TXxZMXaj1 ulbEeMTVEmw9JgsxANDbywqm3jiB32RSoHiLQ33UE+o4AxRlnTIvMZUhIVIsFOm6oK1GyRos184d ThmKpoS7LgBAxNUCANaa+do8J4oYj/V2BC4dlvrmf7RMmZ+r/WRgrFVrLL9CHhpWcRnKIwDAW7iS hvy9yRmc1pGGNVjSPgpjDVbe6lSTBVqaiSJZquao3cAUSRD8Lt/5JnXVEYbXO+auzO3l1WAMBRJx XVZ6XQBQwTBFNB1Qhp6c1ELn8nq/Y6haVw//ZlGgKVjK69T1ZRWAgKIcF8WmviVU7TR9J87gnuUm deBucFbrbSUxXzcARHouR92trMECFP356UgnlVg93uDQl68op7lJ/ehgokW6E8tRxf2uzq+3D5me 4fRlyx7Q/llQuzDu7VR7NURclyKuSwxvYHQGRRLlaFBrJjUW19hn3ZTz1yEAsE6ZF/d1qZ1eQu2n w+2nGb2JYjgpGkx+8sObCx1zV6Zc3a21N8R629VgNOJqibhaGF7P8EY5HpHFa6buMlfM6j8VXY4Z S9Uay6+Qh4ZZXHq7rnxFOcNje1t62pqpun4TQWps05f0NH9MFJkQErh8LNh6nNGbAUCbywsAOKPV MWcVo8uL6YlHVyCR7ovqWPJ2Wd4cHrqxyUBRG805/lx91FVLPfzV7W8E4RtBsNI0D+BVrumrUEwz jQaDPg8u4rltcse7FGWfvVxrdyeEiJGAGPapcQDNUIWz7VW3VbL6vL4IKWI87u0c0Ud4qyO52yVr tDrn384Zr/Z5lYWoEOyV+kIrRme0z7q5cPYtub1wt4YvKC6su0Xr9EIApFhYDPu0AIhmWGv13KKF d/a/MDO8oeiGO/X2Uu0VWYgJoV75muGDXGHdLbbpS3K78yuMrWqN5VfIQ8Mprqq5lVV3VHHGvDiK R0dbeokbcBZt4C0O59xVTN/PJDTOAAAgAElEQVSCYoQQKRrUQiuKoszls4oWrhlopEHuGUWBjOKy Vcbk/iC2UVetxOHPXp00IqAo7qSonaOopbzuIaPRMkAPeJRFJvsZnOENxQvvirguR10tUjQgxcI0 wxU4bEVTHNYaK4tXIIBoz2UywiXQeEtq303eWlSy5N5oz5WI65IcC0mxEBBC8wbeXKh3VhmclXkS smsMxTV8QXG487wQdMuxkBQLUzRNc3rOZNMXlhuc1YOsA8oarM75dwgBd7jznFpplXiEANAMx1sd +sJKY9m0HJ6WJ8VYqtZYfoU8NGRxTVmw74RwPNPZnMQIubpmaroO7hqdvaykoTHceV4I9EiRgBQL 0SzH6i36wnJDSS2rN1+X7E4iIy2QvsvWCELxsvzolj3qqmUorpk3q+zmve93KbJPUYKKwlCUkaIc NF3DsjNYzoAN7bkiK6IxylhcYyyu0f7dUMftMaQZupGfTOUzTeUzx2NPlKGo2lA04JpB+YbRGccy fw5vdQ5+7c8no69aY/wV8g0W15hQVMWKh4eZlmZ5S1X9hGYnu4yoQNTL1qIy5vnDn01orrLRqKsW rzferMO2jNyHD00QQgghhBDKAhi4I4QQQgghlAUwcEcIIYQQQigLYOCOEEIIIYRQFsDAHSGEEEII oSyAgTtCCCGEEEJZAAN3hBBCCCGEsgAG7gghhBBCCGUBDNwRQgghhBDKAhi4I4QQQgghlAUwcEcI IYQQQigLYOCOEEIIIYRQFsDAHSGEEEIITS67d+9etGhRdXX1rFmzfvGLXxBC3G53XV1d2sSDvJVj 2ExnACGEEEIIoav8fv8jjzyybdu2W265xev13nPPPbNnz7755pszna/MwxZ3hBBCCCE0ibS1tXEc t2zZMoqiCgsLf/nLX1oslqeeeqq1tfWpp55SFOWZZ54pLy+vr69/9tlnFUXR3gKAV199tba2dtas Wf/n//wfQkimv8o4wxZ3hBBCCCE0idTX11dUVCxZsuSxxx676667li9fTlHU3Llzjx49+pvf/ObY sWPnzp1raWkBgDlz5vzt3/7tb37zG/Wt3bt3v/vuu01NTRzHbdiw4fe///13vvOdTH+b8YSBO0II IYQQmkQoivryyy//9Kc/ffTRR6+//npVVdW//du/2e129d158+b97ne/++STTw4cONDV1RWLxbQP fv75516vd8OGDQDQ3t5+8OBBDNwRQgghhBCaKP/93/995cqV559/fv369QDwxz/+8Wc/+9mrr76q vvvll18++eSTjz/++F/91V999tlnyR80Go1/8zd/8+KLLwKAJEm511UG+7gjhBBCCKFJZNasWa+9 9trRo0cBwO127927V6/XA4AkSQCwa9eub3/72y+88EJJScmpU6dEUdTeuv3227ds2RIIBARBuPPO O3fs2JHR7zH+MHBHCCGEEEKTyPz583/9619/5zvfKSsrmz9/fiwW+8UvfmGz2Ww22/e+971HHnnk 8OHDN9544/PPP//000//5Cc/0d5qaGh47LHHlixZMn369BtvvPGBBx7I9FcZZ6ldZRRFBiCFEMhI boZJibIW2ZLpXAyGlhl1gwNpkhfmhOIEurO8bCx7EDiub5PKw5IcewEmE/sKM3+qpQdAGb8C1ER0 em07i0qSDtIWcdKdOWkl0X7EU1IhyZrCHIvxPa41YZOxbzM7zpYTVA7jQmIT0REPYlYUJkzW8ozz /Kg/u379erWfTLKmpiZ14+OPPx7orR/+8Ic//OEPR/13JzkqpffPP7/2r9GAJ1O5QQghhBBCOYbj uH/6p3/KdC5yQWpXGRqUjOQDIYQQQmORe+PwUM6QZTnTWcgRqV1lCM0CAAEqE5kZJQqAViZBhaAo hUpTboTCMylQQIEygkpFUUAgtdzysCRHWm5p9kCnv5bnYWHShB5LVJO2TkK2nS1Vk+GcSRimf82k FWw5GhZC02nrMtV3DcKSHKm0FRIAKEIovB0aobSFyY+hzwxKlhq46y32sM/zv2RpRnIzOotK6R/9 3ych0+epyOzZX/31d9TJRN1utyAIABCw+M9PO5vZjE0Gs7n62e8tjrvFYaa3zjHFZ/oFQVAUpaur S33x8IKmCcvgJLVMv9z52ylydPR1u+BhNhBIdNDUqqXf6rsw9dz4ZDFLOBnnt3bdG2mJj3oPpavt 3Xy7ui1JksvlAgAA6n/JTeORwetqURnzo//3+5nNw55f/VKtmVq1rGlpWf3J7szmKlt0/t0zx4qL U14URbGjowMAKEKeePM/M5GvLKZVSJXL5VKnKJl66dJtuz8b+HMolWS37/vRS6FQSP2ndhFn2ZHN P95eUTWKv17RfmUUn8ouOI87QgghlE0Iy+pPW1NepKk46NMmR0Pjed5sNmv/dLvdGcxMtmMYhuub CwF7yIw7DNwRmrwEEjfV6BVp9A9qKUrSrka9vb3jlK/so4BiKOE5yxjOeDQUFBSom4Ig9LW4I5QB TDAYOB1NeVHSCVCfkezkAvEYHb9wddQfqQTAnh2jQmha7zHTnsRNpAQiQFtms5RjMHAfPxxXEHGY wgoA+GS/AEKmM4SyXq/Se9Ou/4/v7Bz9Lv7r6ub2+xpjTufYc5WN4iQ+q/2Twu3jsxJHyGi88OjD 47KrvGWOF+hiZgDwKj7AsyXKNBIngl+6+s9JN61i1qAUJXQhFjqfuLFUOBnmZjZHuQYD9/Ejiv4j 4WiHAADiTBlMmc7PZBIl0bpFvdywW3wVg4FyyZQgCABdE5ozhFAmhM7E/CfCACDVyWDIdG4QQihL YOCOrocoiRR+/Inp4MGRfjCm18N3H52ILCGEEEIIZZfUedwRQgghhBDKUk1NTeXl5XfcccfixYvv vvvuaDT67rvvOp1OdaYgANi4ceO6dev6J2tpaVm3bl3afa5evfrRRxPNiG+88cbWrVvV/w6Zmd/+ 9rfvvvvueH01wMAdIYQQQgjlknvuuWfXrl1qaP7+++8DgMFg2LdvHwAoitLc3DxQsrQ8Hk8gEDh0 6FA8nn5O4eS5RCcaBu4IIYQQQigHMQyjKAoANDY2bt++HQAOHTq0ePHigZKltX379sbGxuXLl3/6 6acpb23evPnBBx/8u7/7O6/Xu3bt2jvvvPP73/++JEkXLlxYtWpVY2Pjli1bAODXv/71n//8ZwD4 yU9+snfv3q6urrVr165du/YnP/lJygeH/EYYuCOEEEIIodzx0UcfrVmzZsmSJZcuXVq7di0A1NXV nT59mhCyY8eOxsbGgZKltXXr1vvuu+/ee+/dtm1b/3dLSkp++9vfvv7664888sjHH388c+bMP/zh Dz/72c9eeumlHTt22Gy2/h/55S9/+YMf/GDnzp2hUOgXv/hF8geH/Go4OBUhhBBCCOWONWvWbN68 OeXFBQsWHD16tLm5+dlnnx0kWQqv1/vFF1/8+Mc/jkQiBw8efOONN1ISNDQ0AMD58+cPHz68a9cu AJg/f/7FixeXLVsGADfddM3q2mqb+pkzZ1544QUAePXVV7/3ve+dPXtW++CQXw0Dd4QQQpkXr6xy PfJIpnMxeorZRIfC1+dvxaurzaHUSTQFCh+hIzSYdevWbdq0qba2lqKo4X9q586dzz///E9/+lMA ePDBB/fu3ZuSgOd5AJgxY0ZJScmTTz65devWGTNmTJs2bf/+/XfeeefBgwcbGxtZlvV6vYSQ/fv3 r1mzpra29vDhw2VlZS+++GJhYeHy5cu1Dw6ZHwzcEUIIZV4zU/SfxlmZzsXofWvJpyeE49frrx2H 5akv6eK6OaeGbq5DKG81NDTcf//9b7/99og+tXXrVjVqB4D169dv27Ztzpw5/ZM99dRTjzzyyM6d O6urqx944IEf/ehHP/jBD/793//dbDabTKZly5b99V//9bZt26qqqnQ63Ysvvrhx48Z//dd/ra+v //GPf5z8wSHzg4E7QgghhBDKEYsXL07pAPPQQw+pGx0dHeqGOlA1JVlNTY36erLk2WY2bNiwYcOG tH/Ubrd/+OGH2j+nTZuWMpL1888/T/7nBx98oG0nf3BIGLgjhBBCCCEEXV1d77zzTvIrTz31lNFo zFR++sPAHSGEEEIIISgtLVWHjU5aGLgjhBBCuYNQ1Gv/vj7TuRhMKVN29vzCTOfiGlVWiqqzaP+U 2zpAEADg1JylB2/5bubyNWL2qr9IMPRc4BOHBrqadct3JfKgiAoczGB2chAG7gghhFBOOSeezXQW BsNT/LGeARe7yYhjPdf88xYgFgoAoDdKmiOTK6uD+1aVcB0HSad3RGjWtjmJmwc3jGInxZ/upvT6 kX1GzuQdy3WDgTtCCCGEEJpEVmy5NIpP7X9l6rjnZLLBaV8RQgghhBDKAhi4I4QQQgghlAUwcEcI IYQQQigL5EIfdyNHuR55GBSS2WxIjkKjomNMDAB49bSY2dwghBBCCKHckpWBuxjyRlyX4r4uORZW ZOn8FOtTjq8tlZaCGitFURnMmI46qm5UnKnSh0c4GnoCEELCHZFQeyjmiUkxWREVzsTyFl5n1xVM K+CMI/71g62hzq86CYGSRUW2GbaJyPOkpYhK4HIw2hMVw6IYEhWJcGaON3PWGou5wgz96h0h5Py2 C4o0svvJqffWcGZu3DI9+bR+ciXqiQ2ZrGCqtbShpP/r416lcxwhsd72qLtNCLoVIapIIqM3cUar KDk3/fpBnUmXwaxNZT3yqjgAwFEZQhnMSJ8Byooz2U3lMxidqX/69r3vEkXWXth7/pJLdg3+R3L+ AB9E8uUD0iwY32ekP0T+ifZc7j25hwDYpi8xV8xKm2aMZ9ps19TUtHbt2vr6ep/PV1RU9N577+3Y seOZZ57p6upiWRYANm7c2NXV9fLLL6ck6+7ufu655/ovngoAq1evLi4u/v3vfw8Ab7zxhtPpdLvd Tqdz/fqhp14dafrBZdl1ThaivnMHou4ryS+GA35v1Nvb5uVP8mU3l+rtGbsaxUjiOCmFskzlQRPt iXYd6BaC1zT9C0FRCIqhjrD3tLdoYZFtesHwdxjuCHfu7yQEAEDvyPxtyfVDwHfB33PErYjXTAoW 98XjvniwLaS368pXlKdEjXGfMNKondExnCmXL+piSBzOtQQA9IVpKti4V+ncFve7vGe+kqLB5Bel aFCKBlvOdF5p2Z/Z4jomJJo5ZstzDJDhVQkHKauopz3Ydso2bZGpfGbyu2LYmxy1D0fOH+CDGObl YxQ/RL6Jedp7T+1VLy281Zk2zRjPtLnhnnvu2bx5MwA88cQT77//PgAYDIZ9+/atXLlSUZTm5ubS 0tL+yRoaGtLuzePxBAKBK1euxONxne6aIHPXrl1NTU0vvfTShH+lPtkUuAtBj+fYp7IYV/9JURRr sNCcvsBBQZACQoSA0LGnY8qd1YyeyWxWMy7QEuj6upskxY2ckaVYWgyJRCEAoMiku8lFs7S1xjLg XpJEuiMd+zqJAgBAM5TOloG7o3n8/Ov/R4HAxW8u+k4HiqAIGAAAhmV0Zp0syvFIHNQSDgD1FV2/ eg7DXq14nf7OGBMf0Z+yF9vn6q5piSpiiijq6zF/h8ki0BIYZsr+t9/jXqVzW6T7ovf0l8k3jozO SDOsFA0RogAWV5Ihy4oosvfcAYrhjCW1Whoh4B7pHzI49P0fzeWDYV4+RvdD5JW4t9Nz8i+EEACg aIYz29MmG8uZNvcwDKMoCgA0NjZu37595cqVhw4dWrx4cVtbW9pkaW3fvr2xsfHixYuffvrp3Xff nfzWW2+9de7cuRUrVvz85z+nKMput7/11lvd3d1PP/00ABiNxrfffnt8v1HWBO5SNOg+uluRBADg zfaCqTfythKKogGgYRYbUo617mqVYrIYkXpP9RYtLMp0fjMp0h3RQhxWzxTd4DRXmGmOBgCiEP/F gNZ43NPcY6kyU8wQF5NoT7R9T4ciJ86oukI9RWfg+rP761XX/4+GO856z7UB1FAAhuJa65R5rNES BQoAZCEaaDkS7jwPANAOV+JTTGXTtQ8qYlypEIbcvxQJeE7+hSgyzXLhsru6v76mA9JsB91I3h3n r5QpBAKXEw1pVbdVDt6thTVd8+64V+ncFvd1aQEQw+sLpt6od1bRDAcAhCiRzvNs8IiaEotryLLy XzysyCIA+C8cMhRVU3Ti5txQNEVnv+bJ6uJFe06Lp1L2LwSEjn2dikwYnnYuSN8+mtuGefkY9Q+R PwS/y338c+05D28pVEOgVGM40+aSjz76aM2aNR6Px2azrV27dufOnXV1dR988AEhZMeOHY2Nja+/ /nr/ZC5X+t5uW7dufe21186cObNt27aUwP3xxx9vamr68MMPH3744UcfffTZZ5/94IMPysvLX3zx xWXLlm3YsKG1tXV8v1q2/GbEd3a/GrUbnFWO+lvh2r7svJkrrC90fdMDAFH3sJ4Q5SpFJl0HXYkn knZd1W2VanyjomjKNr2A1TPtezsBQIrJcV988H4vMW+87S8dyb0+DIW5f4+ukuMR34VD6nbBtEXm ytnJ7zK8wT5zqRwLxbxdACAEepIDd5rT0dwQBaWIcd+FJqLIFM04593GmXJ52EDUE1N7uRicemOx YfgfHPcqnduIInnP7E88STcXOm9YrUY/KoqiTeUz51gsF5r+AnlfXMMpK5rXe078BQBkMSaGfbzF ob7b/wDXW/SccE1PGDkuuw73KDKhWari1gpdAT/BX2jSGeblYyw/RJ4QQ73uY58l987iLenvAwPu 4OjOtDlmzZo1ah+YZAsWLDh69Ghzc/Ozzz47SLIUXq/3iy+++PGPfxyJRA4ePPjGG2/0T3P+/PnH HnsMAJYuXXr+/PmFCxe+8sorb7/99smTJwdpyB+d7AjchYAn5usGAIbT22fdDOlGoGrnRDGSF2ve DiR0JSiGRACgObr8lrLkEEdjrjTzFk49tge/bMf9Qtvn7YqosHpGkYgiKQCgd+TLuSDYekI9URqL ppgr69IloXS2MjVwV8SRdYwhiuw58bkUDVIU5ai/lbdev8dEFtp6/fsdnW+/EGcEAJgxc3opXzr8 D7ouuQLRIDDAcMzCVQsNpnTVdSocPN4UC8YAoCpcXVqWun8eeIUPpvlgzon2tEqxEADQDFdYvyI5 ANIUV1TzZ4Z1Bshtwykrg7OaNVjUXtdiqHf48SKRSfveTiEoUjSULyszOPOukId/+ZjQHyIHiGGf ++huRRYZXk9kSZElGLiDe09Los24oNZ6/bKYJdatW7dp06ba2toRTWSyc+fO559//qc//SkAPPjg g3v37k1JQAipra1tamqaMWPGwYMHb7311k2bNj366KO33Xbb6tWrCRnnOQ+zI3DXRqPqbCU0m77R QhuyNqlmljDRphncdR1Jc/LKKQfjAICquZWV9sqBkkk2xRfxAUAFVJZx6YfSxoKx4385YZNsrIGd uWLmyd0n1U7ec0rn6IZqS05hokwKk2VhE1GkSPcFddtcWQcD9E6Vhai6wehHNN0B8Z7+Mu7vAQD7 zJv0joqxZHWk3D7HN1+nvQ+ZKIQonV+6FElH0Uys+/4TnhE0PbqP7o55awDAWrPgy5PzBkzmUmK9 HQDQe2SB2TM75V0LT90v7BxN1rNNpDuxTri5qp41DNh/nbfw6jlTDafy0zDLSosXiTzsViECXV93 R3uiAFC6pMRUnndzoYghse2zNjkuMzxddnPplc/a1df16W5gJvCHyH5SNOg+uksW4zTLF85e3nNk l/p62sCdEKXnshsAaIayVOf78JX+Ghoa7r///pF2Ot+6dasatQPA+vXrt23bNmfO1dFolZWVP/rR j1599dV//ud//uMf/2ixWL797W/b7fZf/epXb7755tSpU7ds2VJSMp5T90yiGHcQciwxWxg7UF8C AuGOsLo5qU6RXr+z6cCK6/bnZCHadchNoIgCECvXXT5gHihl1/G4egaMOG6/GEgTuMvxcM/h/5Xi U2iGcy64o+mbmLtdAACGNygn1g4UxQ6kwkLR8skRfpsMEwIeRmdkABjeMFDbBgCIIY+6obON4MgM XDoS6bkMAAVTbzSWThtjVie/mKdd6+o20L13WrIQjXs7AYACMA06Ik2biWLAs0QeGH5xCcHEAAy+ IF96vqWY0KrlPu4JtAYBoOgGpzX/Gj7FiHTl0zYpJtMcXbmyQo4nOniwBpYzpEYdeIwPQo6H3Uc+ kYUYzXDO+bcrQqInMMMbGF2auZhinnY+LgGAudKc9nl7nli8eHFKB5iHHnpI3ejo6FA31DkfU5LV 1NT0nwtSnZRGtWHDhg0bNqQkOHDgAADceuut2iurVq1atWrVGL7BYLIjcKeYRD7FUG/aBL6L/lBH GAAYHWOblr/zwYkhr9p2yxqsjH7AqF0Me+VoEAAoiuLTDUuXhWjPkV1SPELRjGPet3iLI9CSGM3G W50jjdqzlM5WUrJk7eBpou5WtdWcM1oNjqph7jnSdSHQehwATCVTLVX1Y8xnVoi4Ei1qxtJpQtAT bj8jRvxSJEAxDGcsYE12S1V92uvQeFXpPDHM4gr5vWqHOooGfSZmiJoMJq5qBS4FPCd6AaCgxlJY l3e1UYpKbZ+1iRGJZqnKW8v1Dr37WKJ1I+28OniMD2QUF+KI65KVBwCw1lpjnpjvvF8ICPGAQDMU X8DrbLrCWXZ2MvVKmIS6urreeeed5FeeeuopozHDU9Ymy47fjy8oDnddAICo+0rwyglzRZ02olwR Y6cOH+9ucwEAzVAVy8vyeS5IfWG5vrB8iESE+M4dULtcmcpm0lzqg0tFjLuP7paiQYqiHXNW6gqK IWnus0HanvOKGPGH206r1ZLhdI45q9IOvehP8Lu8Z/cDAGcssM1IP2VsjlEkIeZuAwCKokKtx9Xx KgmyKAsx8HWHO89Zp8y3VNenXI3GpUrnj2EW16nD+9Vel7Zptrw9YU5Q1Yr2RLsOdgOAroAvXlw8 9nxmFzkut33eLgRFiqbKbyk3FBkAINY3p3jafjJ4jKc1igtx4kxbDhQNvad6I93RpL2BFItGuqP+ C37HHEdhnT0/2t9Go7S09IUXXsh0LgaTHYG7qXSq4OsOd18EAP/Fw6ErJ1mTjWZYMRKQo0GbgwaO 8NYMr76UFYgi957aqzYS0yxvrUkdoahIgvvYbjHsoyiqsH553/mUCEHtfJG/U20GLjWLEb8cjyhC VIpH1Bd5s91edwtrHNbTcEWMeU7uIYRQNFNYv0J7lJTboj2XE9MwE6KNMqd5PZFFORZWL8ZEkf2X DgOApXqQNRXTGLJKo2RqcVnBBSwwPO2YW5jpHE1eo6hackzu+LKLKECzVNmyMprNr74Kiqi0fdEe 9wsUDeXLSk1lRgAAArHeROBuGNUw6Dw8xkd3Ib56plVAjdpZPcPoWUWUpYik3qsrEuk54gaAwtl5 8dQiJ2VL3EDZZ90sRYPxQA8AyGJcTm60AzAWG8tvzbuz5EiJoV7v2a+FoAcAaJZ3zrstZTozIkue 458JwV4KwD5rmcFZrb4uRYKKJELiGWWeXukJUYJXTqqnRY2uoMi5YHX6yXTT7aL31F51MKt9RkNu T/6YTBt5BgAGZ5V1ynzObFNb1okihdrPBC8fU+dJCFw+aiydyvDDnbZoyCqNkl0tLifN8HTlygpG l6fN7UMaRdUihHR+1SVFJQAoWVScb5M/KpLS9peOWG+coqC0odRcmej0IgQFWVAAgKJBN/KWtTw8 xkd9IU4+05orTc65Dl2BTm1ZV2TiO+fzHO9VB6N7TnistVZ2cj9te25NnZ4bWQ6l8Z54cXLKjsBd CHr8F5rUqD2tiCvS0+wuXlQ0oil+8occCwVaj0c6z/ctb2Fwzr89JXBUZydUWzVsMxquXSMwUfKc yZ4njcT9iSGvGrVTFAV90zvF/T2e45875txK0UMXS6DliDpxpKlkaj4MSFXJsVDc7wIAimbsM5ca S6Ymv0vRrKVqDqszeU7tBQCiyDFPm6lsxnB2O2SVRpqU4tLpjVW3V+VbZDlMo65arUdbw90RACio tebbgFQik449neosOsWLipOX49X6yegKdCNqXMvPY3zUF2LtTEszdNmSEmvNNTWQZqjCOjtnZDu+ 7AIARSLh9lDB5B4QuKX7qVF8aj18MO45mWyyIAgLd5z1njugbutsJabS6ZzJxhosihgTw77glZMA bgDwnfdTDFWc32um9idFA8HWE5Hui9pMoqbSaQVTF6b0ESRE6T25Rw0rbdMWmcqvmcISO7gDAGe2 V6x4iKIZAEqRhGjPZd/5JqLIsd4O37mD9lk3D/7xWG9HsPU4AHBGa550bVfRnL5s6ToAoBhuoKYy Q/EU7vIxMeIHACkyxGLdw6zSSJW2uG66o+Hrgtczm7FJaCxVK9bbccXbBgC8lS9elF+XIaKQji87 1ZuW4oVO2/RrwsHooB3c08rbY3wsF2LtTLvkpn1nqTNp92+psugKeuN+AQCEwNALe6PJabIH7lrU TjOcfdZNhqJqbewaw5gZvVnvqCgLfN3a+RUA+M75cMS0RhFj/kvNWnMFAPCWQtv0hjTHPCHeU/ui njYAsNYsSFkfFADUx5QAkFdrXqSgKBr6usTQLG8qm0HRbO/pfQAQ6b5km75kkGcRcjzSe2qv+kPY Zt6UV08tKIZlmAFnitBScWa7GrindEZKNoIqjQYtLl6XZoGbfDbGqqUe4JYSAIDSJcV51WmTENK1 vzvUHgYA5zyHfVZqz2mtxd1QOHTYndfH+NguxNqZltNxMFBMToHOplMD9/FeFAhdP5M6gEhecN5e d7PW0+taVN0NDV93bQFCiAIxb8xsHDJKyHGEKOH2M4GWo4qcWJSKtxRaqucZnJVpJ5DynTugzilu qZxtnTI3dW+KJIa9if3k8cjU/rRVkwhRZCHCGgZ8OO47f1CdxdxUOk2dHACl0PoaMXyaWbdGWqXz HBbX8I1LWWkHeMFUq0vmkDIAACAASURBVDqPSv5wHepRZ6wvrLM76lM7XisyifsTS0oPvkAvVtrr cyGmmERhsv0m1EfZYlL/ctqC86bSaQNE7QAALMfzZi4eFABAEfP9LlIM9XpO7tEWquAtDuuU+XpH +UDnPkIUdboeCiDu63Z982FqAkXRnlf2ntqr7oa3FNlmLJmgr5BpRPD3dSW0FA7SeZ2ir7arUenW 6FZF3VfUpX9pli+YunD88plTZCExS0//dRNHWqXzHBbX8I1LWWkHOKtjrfPzoGE4CVFI4FIAACgK It2Ry5+0piaQrz5C6/yqSy1Xg8Mw59quhVhpr9uFWB08DQCcGR+7ZatJHbjHvIkFrgYfyUcI0Vbt zvN+MjFPm+fkHvVuhzVYCmoXGoqqBj/3icFeNT0BEAZY30qjJdDZ0iy2mhsUSXQ1f6xuly97cJDA XeuNTbMcw6dvTFJk0Xf+oLpdMPXGnO+jOTqEKOrNEkXRusJrqtYoqnQ+w+IavnEpq+QDvGZhjUc/ 4AwKOSnujSsyAQBCIOaND55YS2AsueapGlZauF4XYqKQqDsGABRNmUon0YpC466pqWnt2rX19fU+ n6+oqOi9997bsWPHM88809XVxbIsAGzcuLGrq+vll19OSdbd3f3cc8/1XzwVAFavXl1cXPz73/8e AN544w2n0+l2u51O5/r164fMz0jTD27yhrmEKHIspG73b4RLFvR71ZtIiqZ0tvydJyHcec539mv1 ltxSVW+tWaAtUzUIbbzLiORwj0NFjGnbNDtYdYr2JJqX9IUDPswNXGqW4xEA0FmLTGX5MpOMSgh6 3Ec+UbfLbl4/SM/+qOuy+nxc76igk55djK5K5y0sruEbr7JKPsBLp3IeMb8Cd23g6YgYkkapYqVV jeVCnHKmHSR9sDWkiAoAmMqNNJfjIzHuueeezZs3A8ATTzzx/vvvA4DBYNi3b9/KlSsVRWlubi4t Le2frKEh/dQRHo8nEAhcuXIlHo/rdNfMsrBr166mpqaXXnppwr9Sn0kcuEui9mBIjoUGmtqZKPKp b75St03lRobPx2MeAMSI33fuIAGgaMYx51Z9YcUwP2iurDNX1g2SoPOrberU4855tw29vl32S25i l6LBgVZWkuPhUHti5L6pPP30hWKoN9yXxjajId/akGiGU2dnBwAx1MsP0LlfEeOBlmYAoACSl1YZ dZXOT1hcwzdeZZV6gFOHxy+P2cE+02afOdj8jBd2XFKb1SpXViTWY0qClVYzlgtxypl2oD3Icdl9 zA0AFAXOuXk0zwTDMIqiAEBjY+P27dtXrlx56NChxYsXt7W1pU2W1vbt2xsbGy9evPjpp5/efffd yW+99dZb586dW7Fixc9//nOKoux2+1tvvdXd3f30008DgNFofPvtt5PTr1q1atu2bQ6H4+67737z zTfLy0ccVk3eWy6a4+m+JrpQ+xmANJ3XiSL5zn4d8HoAgKLzqy5ei/jO7lf7EjrqV4zj6U+OR9ST BeR0K3syRmfQGtq10DyFFA24j32mNhIbnFUDjTcNtBxRa63BUcGZ826ZOkZn1JamCrQeT3sIK2LM c/xzKRYGAHPlbM6kldJEVekchcU1fONWVnl+gA9Jikhaj2q9o/9UsFhph2vwC3HqmTbdQD85Jrfv 6RDDEgDYZ9l1thxfxAoAPvroozVr1ixZsuTSpUtr164FgLq6utOnTxNCduzY0djYOFCytLZu3Xrf fffde++927ZtS3nr8ccff+CBBz788MOHH374/ffft9vtH3zwQUdHx4svvrh9+3ZZlltbrxn7sW7d ug8//NDr9QLAKKJ2mMwt7gCUoWhKuOsCAERcLQBgrZmvTdyhiPFYb0fg0mEpHgEHDQCOOY58qItp RVyX1fUadAXFnMmmdTEaBKM3DacBWHt+xxosg/cbySEUb3HEvJ0AEOo4AxRlnTIvMQE5IVIsFOm6 oC2hyhosA83gLoa8UU+7um2urL9OeZ9MKIbVOyrUcXux3o7eU18WTF3I6BKtbooYj7hagq3HZCEG AHp7WcHUG7XPTlyVzkkjLa5ohAN9npbWeFUtPMCHpHWk4S1c/4fheIwP3+AX4pQz7ZmvQlK9pI33 k+NysDXoOdErxdSpPozOBXnRxLlmzRq1D0yyBQsWHD16tLm5+dlnnx0kWQqv1/vFF1/8+Mc/jkQi Bw8efOONN/qnOX/+/GOPPQYAS5cuPX/+/MKFC1955ZW333775MmTKQ35999//z/8wz8QQh588MHR fbXJHLiDtfaGWG+7el2PuFoirhaG1zO8UY5HZPGarnX2mWkmosofke6L6kbc7+r8Os2gihQMpy9b 9sBw9qwt1abLp4kgrVPmxX1dak+tUPvpcPtpRm+iGE6KBtXxQyreXOiYu3Kg+5lA67FEMkuhzpan U0AW1C6MezvVx7gR16WI6xLDGxidQZFEORrUGoaMxTX2WTdB0rLHE1elc9JIi+tAm5Ee6/iobDVe VQsP8CFdncE93USQeIwP35AX4uQzbc+lHtd5F2tgWQOjiIoYErUp261TLCUNJfm8wPy6des2bdpU W1s7okLYuXPn888//9Of/hQAHnzwwb1796YkIITU1tY2NTXNmDHj4MGDt95666ZNmx599NHbbrtt 9erV5No586urqz0ez/bt2998883RfYvJ21UGABjeUHTDnXp7qfaKLMSEUK98zfBBbu6S5cU3FuXl fTgAgCLG497OEX2EtzqG2W6hrfjA5dPSS3xBcWHdLVpPLQIgxcJi2KdF7TTDWqvnFi28k9GZ0u5B jPhjfUNXLZX1+dlKBACs0eqcfztnvLqSoixEhWCv1Be1MzqjfdbNhbNvSR5aMKFVOveMorisdmd+ ltZ4VS08wIdDC9z7z+AuxkU8xodvyAtx/zOtFJVivXEhmIjaOSNb2lBSdlMpzeRpGaoaGho+/vhj rZ/MMG3dulVrHV+/fn1Kb5nKyso//elPd9999zvvvHPfffd5PJ5vf/vbjY2Nauw+derULVu2pOzw zjvvBACbbbDxIYOY1C3uAMAarM75dwgBd7jznBQNSLGwEo8QAJrheKtDX1hpLJtWVm24kOl8ZlC0 5zIZ4RpovGV4vdUJubpUW350cNcYimv4guJw53kh6JZjISkWpmia5vScyaYvLDc4qxOdZwYQvHxc /UlYvclQNOX65Hly4q1FJUvujfZcibguybGQFAsBITRv4M2FemeVwVnZf8LNCazSuWgUxVXgKBq6 X0IuGq+qhQf4kAghMe+Agbun1YPH+HAN70KsnWkdVn/A7xfDIlGANTA6u85cYTZXmvMqZF+8eHFK B5iHHnpI3ejoSMwzrs75mJKspqam/1yQ6qQ0qg0bNmzYsCElwYEDBwDg1ltv1V5ZtWrVqlWrBsre iy++OKyvMYDJHrireKsz3wLH4TOVzzSVz5yQXVNUxYqHJ2TP2YDRGZMnORmRwtm3FM6+ZXzzk80o Q1G1oWjANdRSTGCVzkWjKK6pdVw7fDJB+ZnMxqtq4QE+JIqiZqyfPtC7pTNKK1fedj3zk8VGcCGm DEXVs5fOVgR56LRoAF1dXe+8807yK0899ZTROImmvc+OwB0hhBBCCKEJVVpa+sILL2Q6F4OZ1H3c EUIIIYQQQipscUcIIYQQQpPIXOc8hsrTJTUHh4E7QgghhBCaRKb8cu5oPrZjvPMx+WBXGYQQQggh hLIABu4IIYQQQghlAQzcEUIIIYQQygIYuCOEEEIIIZQFcHAqQgghhBDKEU1NTWvXrq2vr/f5fEVF Re+9996OHTueeeaZrq4ulmUBYOPGjV1dXS+//HJKsu7u7ueeey5l8dT9+/fff//99fX16j+XLl1a VVW1cePGQTLwxhtvOJ3Oy5cvm0ymwVOOAgbuCCGEEEIod9xzzz2bN28GgCeeeOL9998HAIPBsG/f vpUrVyqK0tzcXFpa2j9ZQ0PD4Hsbkb//+78f03cYAAbuCCGEEEIoBzEMoygKADQ2Nm7fvn3lypWH Dh1avHhxW1tb2mRD2rx5s9lsDoVChw8f1ul0LS0tW7Zs8Xg8Tz/9NAAYjca33347OaUkSX/+858j kciZM2f279//2GOPxWKxioqK//iP/1Cb/0cK+7gjhBBCCKHc8dFHH61Zs2bJkiWXLl1au3YtANTV 1Z0+fZoQsmPHjsbGxoGSpfU///M/d9xxxx133PHKK69oLxqNxtdee23evHl79uzp6Oh48cUXt2/f Lstya2tr8me/853vvPvuu8XFxf/yL//y+uuvP/LIIx9//PHMmTP/8Ic/jO6rYYs7QgghhBDKHWvW rOnfuWXBggVHjx5tbm5+9tlnB0nWX3JXGW1j4cKFAGCxWGRZLikpeeWVV95+++2TJ0/2b7n/3e9+ V1RUdNddd/3Xf/3X4cOHd+3aBQDz588f3VfDwB0hhBBCCOW4devWbdq0qba2lqKose+Npq92Wtm0 adOjjz562223rV69mhCSnOz06dO/+93vPvjgAwCYMWNGSUnJk08+uXXr1hkzZozu72LgjhBCCCGE clxDQ8P999+v9UEfF3q93mq1NjY2/upXv3rzzTenTp26ZcuWkpISLcE//uM/iqL4/e9/HwB+/etf f/e73925c2d1dfUDDzwwur+IgTtCCCGEEMoRixcvTukA89BDD6kbHR0d6oY652NKspqampS5IAHg pptuuummm7R/Pvnkk8nvPvPMM+rGqlWr0mZG+9OqDz/8cFjfYWAYuCOEEEIIIQRdXV3vvPNO8itP PfWU0WjMVH76w8AdIYQQQgghKC0tfeGFFzKdi8HgdJAIIYQQQghlAQzcEUIIIYQQygLYVQYhhBBC CE0iP9j2CM2OrHE5ZR7GXJUauIvxKAVkEZzKSG5GJ9ZGTWNmEJhEP5guplc3rBDKrsKcIPoofDa1 hnXYR/pBhWb6Nqk8LElzED5pWMzE4+OyN7/Vqm7Y8q9ashLsLbDya+4cl71JjHbmzLKzpSrWRk2j RzmF8LjjYzp1w0YFF5HsK0wNd4afpmSyVGlFO1vCtAuT5fdNi6P5SX7gGKjEWdcOgUme1RQZr4cp aJIIvvsvSzTEB3/KDJ3oWhQA/GQShYITJDVwl2JhAFJE+TKSm9GRI2CFgkznIj0epOwqzIkiQ6fV Cn2B4/ARQvqWSciyajk+ROgoLh73vfIg5l1hEujmeaiqGvcdZ2NJymEoAFumc5FKl+3V0s9MnlIt CE6WnAwkW35rHQhFlJDpXIzEZKqHyeLj1AKFUh9DjMNaUgghhBBCCKHxltrizugMAOAHSyYyMzIG Fip7WkGUMp2Rq6TiohDPA4AoimpfK5mR4/pYpvN1vRXQBVT3mIZPMA5KlmUAIISIoggAAJQfzOOR u4ll4qC8/WKmc5EqOKValuWr1ZKV47q8qJZmysy69aCM/eEpxThArZMAoCiKJEkAQAEUuXrGvPP8 op0nVVq11MWFAr8/c/nKSpLTEdInemZqZ0uslqOjnifVba1a6mMxayCY0XxlJa0wtWqp76uoaIxS oytObyJAf0XmZiQ3I1JfQP/N1nfYHnemM3JV9w+eaHI6AcDtdguCAABhY+j8tLOZztf1dqdxDfeX EXdnT1bwMBsIBABAUZSuri4AACBZUS0XOZi//c2vM52LVHt+9ctAIKBVy5AxeGHquUxn6nq4SXdz 8dtVcmRkfSv7o1navJAKBhPXb0mSXC6Xut24Y+cYd55vtPOkSquWZZ0dqz/Znbl8ZSXXI480VVWp IebVakkIVstRUM+T6rbL5VJvzis6Om7b/VlG85WVtMLULuIUhV06xgfOKoMQylkyyKYavSKOtcWd ZiieJ2Zz4pmPGmii0ZFttoKCq6OSent7M5gZhFDuaWpqWrt2bX19vc/nKyoqeu+993bs2PHMM890 dXWxLAsAGzdu7Orqevnll1OSdXd3P/fcc9u3b0/eW0tLS/8Xf/WrX5lMpo0bN17XLwYAGLijiRAl kVtmto1lD2JHKdfZBQACwIcmwzjlC+Udt+x+dPc/69o7xmFfSWtgh4zGlkcfHod95iXG5/N9drXF Xa4jgIf4aCk63hkuU2QCAHEl5gJXpnOUxTiO024pPR6P2uKORodlWbUwJUnqe2x+Xd1zzz2bN28G gCeeeOL9998HAIPBsG/fvpUrVyqK0tzcXFpa2j9ZQ0PDMPf/93//9wCwa9eupqaml156aaK+RjoY uI8nyWYvkSsAwE8CAuRvm1yv3Fu8Zcu47Cqm18N3Hx2XXSGEUI6h40LPXj8RCQBIOgHqM52hbCYe ov0n1CFVeD85VtI3jP9EDAAUToaM9nJlGEadibKxsXH79u0rV648dOjQ4sWL29ra0iYbyObNmw8f PqzT6VpaWrZs2fLOO++YzeadO3eeO3fugQcemDHj+k3BiSunjifW5+36yNv1kVfw4Z06mkRomjab zTSNxztCCKHc99FHH61Zs2bJkiWXLl1au3YtANTV1Z0+fZoQsmPHjsbGxoGSDcJoNL722mvz5s3b s2eP+srjjz9+naN2wBZ3hPKB0swFTwjyLALGTGcFIYQQmmBr1qxR+8AkW7BgwdGjR5ubm5999tlB kg1k4cKFAGCxWLTZhzICW+AQQgghhFCOW7du3aZNm2pra0c3xU3ap9bqnE7XEwbuCCGEEEIoxzU0 NHz88cdaP5nR0ev11r5l4Cv/f/bePDiu6kr8P2/vfdcuWZJleZF3WzbYBmzMEgOJ7YGk4nHmN5kJ CeVhqCI1Q5hUKqlvpirMmgyTyvBPcGYYvvzyg5mQYJZAgIATDHjF8oL3RZK19KLeu997/bb7++O1 2m2p1VpaUm/3U67y69f3Pt13+r53zz333HOam3/zm99cujSvUb+xqwwGg8FgMBgMpkLo7u4e4wCz Z88e/WBoKB1kTA/vOKZYW1vbmLCP408+8cQTALB582b949GjR2ez6VMAK+4YDAaDwWAwGAx4vd6X Xnop+8zjjz9uMpXQ/jCsuGMwGAwGg8FgMFBfX//UU08VuxX5wD7uGAwGg8FgMBhMGYAt7hgMBoPB YDCYUmLvm0Bz06uiFTNK47yBFXcMBoPBYDAYTCmx+P/MqNoXZrkZpQd2lcFgMBgMBoPBYMoAbHHH YDCYmaPU1hS7CWWGxhkow02b0cwyoWAwGEx1ghV3DAaDmSGIIH706D8XuxVToruBvGR4s9itAACw krxl7WDmo3pGgmQRm4PBYDDlBFbcMRgMZqYgOBPQit2IKbHYTV2m5jW93xRZpi03QgnFSMZgMJhS BivuGAwGgyk+l9c2nfnKl4vdikkwE+bha1uL3YqbuIyEdRWBEAIAJAtwox8AEEH49+4tdtOmBklo NhsZiRa7HQAAtJWydBr14yCHPbjKmOPHj+/cubOrqysSidTU1Pz6178+cODAE0884fV6aZoGgH37 9nm93u9///tjivl8vm9/+9tjkqf29vaOP1lEsOKOwWAwmOKT0BLX5SvFbsUkLGdXlOwaiwnUu0a1 zf+z5WxR2zJVGGDWxJ94SyqNKH4igDkdf3ALkNbiNgZTGA8++OD+/fsB4NFHH33jjTcAwGg0fvzx x1u3btU0raenp76+fnyxjRs35r9sLBaz2Wxz3/x8YMUdg8FgMBgMJgdia2vZLF+MgliGkOTitoFx pJcvVEIpbksoitI0DQB27dr12muvbd269cSJE93d3QMDAzmLTcT+/ft/97vfmc3mZ5999utf/7oo ik1NTc8///zIyMhjjz0GAOvWrTt48OCrr77qdrsfeOCBX/ziF42NjXNxR1hxx2AwGAwGg8nBeU/i vbb+YrdietzG/9WbV4u8LsSqQHmMAMAgaW2qCA145513duzYEQwGHQ7Hzp07X3/99aVLl7711lsI oQMHDuzateu5554bX8zv9+e5Zl1d3X/8x3/86Ec/2rt37549e/7xH//xlVde+eyzz771rW996Utf euqpp+6777633377oYceAoA50toBK+4YDAaDwWAwOVFBFZFY7FZMDw1IQS6y95EgAwACAA4QFGO/ wI4dO3QfmGxWr159+vTpnp6eJ598Mk+xidAdaa5cuXLy5Mn3338fAFatWnXx4sWnnnoKAH784x/3 9/d/5zvfQQh95StfmbU7GUeZKO4IDR56Gd2azDZlIv7d6yV5fqJKj5otdrKqM0whhJJDfGIwIQZF RVQ1WWPMNGtlOSdn77Azpny/viZrsb64EBDkpCwnZE1BjIVhLYytzWppshTlOSwumiIJ/t5U1K+K SUWMI1WhDBbaaDXVtRs9LTCZRBDADVU5K8tBVYsgjQVwkmQ9RW1gOWM1xbHuf++GEJx8FLQvtNVv rJu0GO/jb3w4SJCw6JFFJFVFYtTxn3xHio1MWsxc3+Fcsin3dwh4Px+9FpNikhSXSYZkrYzBbXAt dVIcNcvNLWGm3i2X37Ei/SHXqDQp9bftpg2WGbSwjCj8GZcTYd5/PRXxqmJSUxXaYKFNNqO72VS3 EPDbchwTSVKTU0KgTwgOKHxMlQSCJGmDlXPWW5qWUJx5DtpbBuzevfvZZ59tb2+fWfoIlmUBoLOz s66u7pvf/OavfvWrzs7O9vb2kydPNjQ0PP3003/3d38XDAZfe+21X/ziF7Pd9puUh+IuJ8PTfT8a CMJW3Vq7EBC8R31S/BZHNykuS3E5MZQMXwjXrK1xLLLnqIkgcjUaODWiybestaUiqVQkFR9IGJxc 452N+fX+ygIlhy5Hr53U1FuEqSUjcjIijNxgLS73iq15XoUBTX1HEANZfVgGSKrqgKqekeXtnGEZ w8xh80sGOSFPZRwCAIPLMGkZhJD/swAAcA6uCrV2RYhPRWsHANbqznk+FUl5j/jE8M1lbE3RFEHh /UL0arR2Xa2trSq2582sW85gVKIYjjZUuMJU4DOuSkLk8lFh5MYt1+SjMh8VRm7Eb3zuWnYHY3HN TltLm0IkqWlaYuB8rPd09piFNFVKhKREKDFwwd6xztK0dDabWyZs3Ljx4YcffvHFFwu5yOOPP753 797XX399wYIFjzzyyNNPP71v376f/exnXV1dbrf7/vvvP3LkiMPhmK02j6c8dK+c45ORhuSqlYSS +9XpdLt9q1fPcbvGIjU22BUzAEQoqrgbQ2K9Me8RH0I3zzAmmqBJOSEjDQGApiLfcT9Jk2PHZgT+ nkD4YiRzgqRJxkxrsqYIin5BMZwa+mio5Z5mkq6GqRGKXDmRGLyQ+UxSNGWwIEVSU7wuYCkRCp79 Q82a+wkqxwN1SZHfEYTM9hwLQXAEEdHSY34Kod+Jgpska6nKN3DGemNTLGlwcpOUQDByOpiKSgBg dBsLbFg5wvuuT7Ekk0txj/cnvEe9mpJ+RzAmmmRIOSFrKgIAVdK8R32snZ38hyh/ZtYtpzhryoax uiddmit3CnnGpXgweOYDVU7PJAmCoI1WkjEAQlIsgABkPhY8e7B2/YMkM/nEvtyZsSQ1RTv16YeR q2m/fAKAMlgIklKEOEIaACCkRa4cJwjS3Lh4dttcOnR3d49xgNmzZ49+MDQ0pB/o4R3HFGtraxsf 9nHMSafT+fbbb2c+trS0vPXWW5mPTz/99CzcQF7KQ3E31rRyzoYxJ+9soy/Y90tIypyRYtLQx8Oa iiiWbLmHPGr/ZH6bCQAALgCAJZeXmZNFWw/lfXxGa6cNVM0aj6XJQjIkACANRa/FMtb0QE/A2mIh sqyVkatRXWsnCLC2Wt1dLtbK6mONIqrBM8HI1SgAiOFUvD9uX5jLYF9ZJIcu61o7AWCsbbe1rqRN Vn30VSUh1nsqOXwFAKREiPf3mhsWjal+RVHeFAT9uIthNrKciyQBQAPokaQ/pEQEoAF8kBL3mCrc FAcIYn1x/bBle3P+FRvanO9bVVKDZ0PhS+nppcFd+crlOBDvTyvuNavvo7h8CYzG+2YkBhNDnwzr x/Z2m2uZk7WxAIAQilyOBnoCSAOkIf9ngQX3NM9B40uJmXbLnKPSeBQ+Fjz3R6SpJM3YF64rsLGl TgHPuCLER07/XlMkAGAtTvvCdayjjiDIzLeBnt+pkqik+Hj/5/aO9XNzAyXDTCWJEBr6aFjyDgAA AWBdsMLctIRijfp3vL83eu0zVRIAIHL1hMHTkv4Kk4XX633ppZeyzzz++OMmUwkliSsPxZ1kOJIZ OzYbzTRrYdGoVVlNqf6TAU1FJE003dXE2dl5b2ZJoKnIe8yvS8Xg5Fq2N+squw5BEo5FdtpADR4a BgBFVFORlMGdtl4ovBI4GdCPa9Z4nEuc2VemDVRdd62ckJM+HgCEEbHiFXc1xUeuntCP7R3rLc3L sr+lWKNz8W2qmBDDXgCQYoExintQ094W01r7DoOxK8sfhgRYx7I8QkelFAD4VFUDqOz1CyEo6o5b Ro/BVDvt0UJNqamoJEVTQkBMDCZ0w7BOpgNXD1JsRBHiAMDZajjH5JsBbq0rDX/qAwCCgPrb6mxt N2MSEwThXOxQRTV4LgQAqZCIEJqZM2i5MONumXNUGoMmpyJXjyNNJUjKs3I7Y57D1fNSoIBnHEUu Hda1dqOnxd111xhfdtpotS5YEblyHABSscAstrk0mbEkg2dDSR/vAaA4k7vrLtbmufkdQZjq2hmL w//ZO0hTkaaKwcHxxiZMfX29vtm0ZKkQVQGpaPDQsBSXCRIaNzcYPVU3kGdI3IjLCRkASIZs3NKQ rbVnsDRbWGtaiUxFbnq4hs6HdX3IusDiXOwcXxEIMNWn551qqjRSZswl8f7PdTdWU02rpTmnRyDB OdJWN02+JeSVBvCWwMsIAcAdHNeVy4s9c1IFiOSNIFsBxPrSK7/29mlnr0AIXXvj+o0PBnwnArH+ eLbWTrEka6m6WXrGT8ZUv3BaFRFCQ594NUUDAM8qT7bWniHjPqepSI4XORr0XFNIt8wP0tTg5wcV IU4QhLvrLtZWuXfhmAAAIABJREFUM7vXL0FmLEwpFhQjPgCgGINzyaacO1AZU9pOpIrJwppZBsxM kgqvhM6H9WPXkk23aO2jMGanqaZVP5YT4cKaiSkO5WFxnwQE3iM+ISAAQP2GOnNjpbsc5CXWm15f cy11MpYJtzyyVlaf0OtDOABoKopeT78snIudE7liKmLaW5sxV/h+SqQpvO+qfmxpXjqRc6q+7AgA 1K3bzi7K8oimAYCTJNezuS1zTpK8i0tPMis7tgzSULwvDgAkRVgXTHvLoxSVMt7YYzB6jJXuNjwW hDTe3wsABEkZR8fgKRLvS+hzddbKOJfkNgCzVrZmTXrIr+zYMgV2y/zXDl/4JBUNAIBz8e0Gd9Os XrwUKUSYmd2onKOOpHPPw/UlJhj3pq08ZizJ8KWIvoetqa0zZp7Qj4uxusB3DQAUMV5wY+eUPQDT dYOsfHsiVIbiPnI2GOuPA0DNGo9ttq0mBeLS2raJX5y3P5cS+D8M/gohIAi4s+Fhozihn/2h8GtJ JQYA3YZ73WIjAIQCXpY5DAxwRlO3+T5CzK0NHfW9Y1f8ALDGvq1OXJCzjEkBgF8WfjvFRYoFKc5E AVCsMafpQkdOBPUD3WPByhLev9qnado7R44kBAEA7li9OuDOHdYDADIexFGA6Ow1fgw0TdlXmsPF 2zOdHE6qkgYAlmZLzlWg/NAmuvX+luwzgZ4R3i9AVfrJiMHBjFPBRFpOTpCGRs6mu2vtuhqCnGDG Q4Braa4Ft4qjwG6Zh9j1U3ygDwDsC9eZ6jtm8colSyHCVMWEfkBP6E2ExNCgfmRwVfgsaIaSRBAf SIuxqX3x+YnzCCE1bX0j6ZLeHfT/fXUmERX/9JVvz3pLSo2yV9xj12PBz0MAYG+zluBg402i4+fn L9+vGBpJag0AQBtskT4DQO4/LSfD/usRBEAQRNhnI0N6MQ8sSM8xrl/IPW0VRvqDF7wAwJhs0WgD xHJff30D9aVCb6X4cI66ug0785cRRvp1oxpjshndLQDgNhJ/v+KTxEBi0DoMVjC4uOGtF+ejuZPw CQAsvdRl4otjrMosBNnabWJQjFyJSjEpFZNIimDtLOfgXEuc9MQbsCiWoly3mH51fzCoSsU9sy3V VN8hxYPJwYsyH1X4GEFRjMlOm53Wlq6c21WTQ0ldbgYXZ26ocLPlVCiwW04E770a6z8LAOa6hdaW rlludKlSiDAz8bjkRChngeTwFSE4CAAUw1kaO+eg+SXEzCSpSmrmrWh1uMA/oe1ZGt0kQLFV9/Ks DMpbcecDvPeYDwA4O1vbXVvs5hQfg6vR4Josyy5CkctHdbcDc8PiKcbVkvlocuBC0nsVACiGcy/f VlWJMMaTXyD6EhAAWBrNAIAQEvxCYjApJ2VAwNpZzs5aW6xEkaKPW0nbSnbVvP05RVKi3riJMhMk Yb5sjnijBjAawAgAoAGMAIwA3ysuWLGgpat5Kn4vkiBFUjGgAAC667tpdsL3mIN0IurEbN1IKaAp kjgyAAAEQST6z+qewWlUWZVEiPiSw5dtrausC7rG+HeVeLecZ1RJTQwmAYAgIXQ+xPuEzFeaDIoo 8D4hejXqXu52LZ3QdXA8UtQfvnQYABiT3dG5cQ4aXooUKEzWXqu/S/Vg7ZampQRJjVYXY9dPJYcv AwBBUu7lWys7FuSMJamIaU2dIIk8G8rlRFgMpSNK5Y9GhSlZylhxl1PiwOFBpAFJEw2bG6ojpnih IE0NnT+kG4lJmrW15dPeYtd7ZD6qpnhNEpRUOkMta3E6l26hTaXlkjQ/TFEgmqIlh9Lbp8wNZiEg +E4EsjcBw1ASAIKfh2rX1ZobivDqHIm4Pzsyf9k3ksOXwze86Q83AMBJMQaSNSBVVsVkxnX9Sh/Y z9VYFyyf9ILCSH9w0A8AjMkmnbw3T8klLvIR9dWCWl9iCIG+0WDMKLOfb4wwkaZGr58EgGxhqopS 4t1ynkncSOgOwUgDXT2iDRRloDVZVfh0zgpNQYFTIwDgWjal5VxNFoPnPkIIESTl6rozZ2KHiqRA YZrrF0oRX9J3DQCi104mbpyjzQ6SomU+pgpxvVczJls1ZF+asSRpQ3qqgzTEJ2IAOR5hpKmhCx/r LxAAoCo9iW+lUravFYTOHf9IERQAqFtfW7XBH6eFnAiFLx2R4kEAIGnWs3J7nnBmCGnxG+cyT7gO Z6/xrL4vE1u3qpi6QJJDvL6TkuIoYUQI9IygXPsqpbg8+MfBlu3NxpoKj6SbnSrI6Gmxta5iLA7d GIw0JTF4Md53RlMVAIj1nTbVL5w0tHAm9w1rnXDvQaUyY2GOeAdwt8wm45AAAJZms2eFm7NzuglT U1HkciR4NqTv3Q9+HrS12zKK0YQgFDp/SN+t7uzcWPHBH7MpWJiEc8kmRYjroR5VOaVmLyUBcI46 z4q7q2EiNGNJUhzFmGiZVwDg2vlTYNs05sqqmAhfOiwnb2ZXzLN3C1PKlKsGFus9FQ4MA4C93VZq G1JLEP2J9Z/4ra61U6yxZs39+R9aORHWldTsVbdUNBA8exBp8+e1XzpMXSBCML24qcma/+QIQmBb YG3cXN/+YGvnIx2t97c4Ou36JRAC71FfdnDDykMVE6moHwAIknIt3exevpWxODMuHARJW1uWOxff rn9EmioGBya95k3FvcoGnkKEGQmmHVtxtwQAOSnzAQEASIpouL2u6Y5GzsFlHA9IinAtddZvTLtf agpKDiYmvWas95Se0sFct7BKNqTqFC5MKR4MnHo3T4D2VMQXvXoCcs41K4gCJWlpTlvQvTeuB88e TEX9mpxSJUEMDcV6T/mOv6n3Tx3aYKng7EvHjx9vbGy89957u7u7H3jgAUEQXn75ZY/HoyjpwXrf vn27d+8eX6y3t3f37t1jrtbT09PQ0HDvvffeddddXV1dn3766UR/94UXXnj55Zfn8MYAoEwt7mJo KN5/ttZJslaudn3lB8ctBEWIxfs/533XMpmqzPUd9oVrJ3UTZCzOpjv3ECQFQGiKJAT6IleOI00V Q0ORy8ecS8bO5iueqQtEHBH1A6QhxkTXbajLdjwwuAwGl4Gzc77jfgCQ4nIqJFawdZNkDA237QYA gmImWuEx1rYyfWdkPgoACj9Zom+E9PknAFRDbOxsChFmNJTWinC3BACKoxZ+qQ0ASJqcKOSltcXK 2UOpqAQAUkzKWSaDPioBAGOyVY9ru06Bwhy8fsn/WVoT4hx15vpFjNlBG62aLMrJSPzGOX2ymhi+ DCTlWNQ9p/dSXAqUpGeVOzG6AV0IDgjjjCCco46kGP18xVs9Hnzwwf379wPAo48++sYbbwCA0Wj8 +OOPt27dqmlaT09PfX39+GIbN+Z+eL/whS+88MILAPDb3/72pz/96aZNxVSBys/irqb40PlDuhLa uLEeu7ZPhCaL4UuHfUdfT3qv6lo7a3XVrt3hXLJpKpt7CIIkSFo35pE0a27ozFjyeN/1TDyp6mGK AtFUVQyn/YYJEhrvaMjpLuzosGdyYGXKVyQERVMGC2Ww5E0zSTCWtLPmGGek8cjJsJ4ViyCpqvJG gAKEiTQ1FknPdnC3BACSJhkzw5iZfIHqCeAcaTnnN/Vmj0qOxbdXg0dHNoUIM3wlcqnnMACQFOPu urNm9b2munbG4tS7usHdXLPmPlNtu144OXRRHd1cVJEU2C1JmmzZ1mSuz/FoEyRlb1vtWbk9a7my WqweFEVpmgYAu3bteu211wDgxIkT3d1jZ4CZYvkhSdLj8YTD4Z07d95///1/+Zd/qSjK1atXt23b tmvXrl/+8pcA8O///u9vvvkmAPzwhz88dOiQ1+vduXPnzp07f/jDH46pOLM7Kj+tN3LlmB7DuGHB IlNN5e+gmgEIaYmB894jB5LDV/TnmrW63Mu31q57oJBJdiaHCEKaKlXy23OK5BSIkIzrW4sAwL3c bXBNMEcigHOmX76qWBU5I/JDkGldh2IneaizHNzdVR7aaCLGC1MRE2h0TMLdcupkAuzQxny6eGZU Mtd3cHYc3yw344Wp8IrvZDreuHPpJmNNa648d4Sjc4N+FmWttlUzebolY2Gatzat3XKvbcEKo6eF s9caPS32hevqN+6ytq6U40FVTi8ITx6Arsx55513duzYsWHDhuvXr+/cuRMAli5deuHCBYTQgQMH du3aNVGxnLz33ns7duy4++67H3300R/84AfPPffc3r1733333cWLF7/yyivPPPPMd7/73QMHDjgc OWxJ//qv//qtb33r9ddfTyQS//Iv/5JdcWa3VmaGAWHkhp5ijaTZhcvXXYKTxW5RySEnQsFzH2WS zLFWt611lcHdOFHiTwAkRdNr6IzVlRnyx0OQN6d5BFXBaVMLEoiUEke/BUenPd+fGfUhnkGg6Moj M/OhjZNkCqxaB/epM16YmoS75UzQ4x8AQJ4s1Nmjkn3h2nlqWRkyXpih82GkagBgru8wenKn8wMA kmYpo1Uf1KpwsXc8k3RLAjz1Tbb2HBPITIZa1uqe9E1b7uzYsUP3gclm9erVp0+f7unpefLJJ/MU G8999933wgsvKIryox/96JVXXrly5crJkyfff/99AFi1atW1a9c2b94MALfffnt2Ld2mfvHixaee egoAfvzjH//FX/zFpUuXMhVndmvlZHHXVDly5Zh+bF+4juEqOZjrzBCDA/6Tv9NfcLTR6u66q3bd DoO7aWKtHTRF9ve8q/9Daj4bW8ZflqSZCk7cUKBAMoo7a2UpduLlTgSZSHwGZ0mnr5sHENL0yRJB kJxrwkzdOpkdbFhxz0lOYWoy7pbTBmlIGBEBgCCJnO4HMG5UquwQ44WQU5hJbzo+6WR7eVFGX8eh x6fSLXOiKZIeLB8AzNW0eTqb3bt3P/vss+3t7XlC3eeBpukHH3zwwoULnZ2dDzzwwP79+3fs2NHZ 2dnR0XH48GEAOHbsmF4sHA4jhPST7e3tJ0+eBICnn37a5XJlV5zZXZSTTSV2vUf3b+NsNeaGKu12 eUgOX45cOqKby6wtXba21ZkcFnnIjOgAkD99uhDo1w8MruY8M4Fyp0CByFLGwT2fiPiAICcVAGBM 9IR+C2WOFA+OnHpPP27Y9OU8jr+Cv09TZQAwuJvIvIs5miLdXE2qGh9NKFiYmoy7ZRoxKN74cFA/ 7tjdnmeXVLw/ockaAJgbTRNlnq/yUakQYSINyUmZBBImW2eTE2E9yCZBkJn9GxVGgd0yMZDQA0Ea PYaJntzY9VO6QxfFmaoq6lE2GzdufPjhh1988cUZX6GxsfH48ePPPPPM3r17X3/99QULFjzyyCPf +973vvWtb/385z+3WCxms3nz5s1//ud//uqrr7a0tHAc9/TTT+/bt+9nP/tZV1fXD37wg+yKM2tD 2SjuciKUHEynjnd0bqxgxXFmyHw0cvkYSueWu8vgappixWxXEEWIT5RZSU0lE6PyN1d0xukCBUIz aV1fikkIoZzTek1FvmPpKMWuLlel9mWSYrRRO5mcCLET+P5qcirW2wMABED+jGCQlayb5kwVHMts PAUKMzMFxd2SZEg9DDYApMKpiSLnqCl15MwIABAEeFa4c5bBo1IhwtRkLbMRXRUTEz3OSFP1TLSg z0XzGlPKlwK7ZeRKNOnlAcC5xJFTcZeTkeTwJf3Y3r52Kka9sqa7u3uMA8yePXv0g6GhIf1A36g6 plhbW5t+Pps1a9boIWUAoLm5+ejRowDw9ttvZwp0dHR88MEH2VUOHjyY/fGtt97KHGdXnBll4yoT 6z2l25KN7qZKnXMXAIpcOqxHkHB33Tl1rR0AKM6YeRVmNNExKEJs5MyHuhlP3+9ScINLlwIFYnOO DksqCl+IjK+rKZrvqE+KywBgcHL2jorNQkBxpkxqqlj/WYAcgTk0WQyePaiISQCwNC9jzJM82lUY EkGnQGEy1nS+SdwtaROdWXYIngvlEiSoojr40ZC++OBc4swE8RgDHpUKESbFUhm7cmLwYs4ujTQl cumIFA8BAEEQttYZ+gSXPgV2y0wOyuRQEo3LwKCm+ODnf9CDyxk9Laa6ttm/gQrC6/X++FZ4vrSi cZSHxV1OhIVgehXJ0txV3MaUILy/LxUNAABnr2XMDlWcPFcIZTCP2ocI1uoWw8MAkBi6CARha12Z DjaHkCImeO/VTMZQ2mitggjuBQnEZLEZ3QYhKALAyJkRTdFcy5z6+KTJGu8X/CcDepxd2kA13tk4 M0+7soCgaIO7Sd8OJYaGQuc/sS9cm3FR1eQU7++N959RJREADM4G+8J1k14zo7gz1txG0EqlQGHS RpvdVQMxgKrvliRNmhtNiYEkACSH+eEj3ppVnsxOXDWlxvvjwc9DiqgCgLne5Fk9kbkdj0qFCZMA 6wJL4loCAHh/LwDY2lbRxvSMUZNTYmgodv2kMhr/0dq6qoJnRwV2S4PbCBABACkue4/45OUp3SyL NEXw90WvfabKKQBgLU7nkk1VuDQ0Lerr6/W9pCVLeSjusf4z+gFrdXGOSjb3zgzed00/SEX9w0fG rvKMh2IMDZtvOlfZWlemIl59Op4YvJAcvEAZzATFKEJcD5itw1pc7hVbK3WlMpsCBVK7rubGBwOa ipAGwc9DofMhxswAgG7OTNe1sU13NDCVHrjD3r42FR7WfTx4/3Xef51ijRRn1BRZFeIZu5Cpts25 5PYpxHZEUjytuHPVtzO1QGEuWb3x7Cdv4G4JADWrPLxX0D0TYr3xWG+cNtK0kdJkTU7ImdjYtlZr 3ca6ieYweFTSKUSYnpVucUgECQCA9/fy/l6KNVCsSU3xatZeIwCwNC2xta6YnzsqFoVI0tJiNtUZ eZ8AALH++B+u/48vaQKCzB6zWJvHvbwqRvCKpwxe0DIfFUd3AVqbu/BkcQyanEqFh6dVhbW5s8XI 2mtdS7eELx3WdQIEoK+2ZyAp2tK01Nq6Ik9sxEqiQIEY3IamuxqHPvGqKRUAkHaLbkSQ4OhweFa5 J9ruVknQJptn1T3hi4f1RJ4AoEqCvs9Mh+JMtrbV5vqFU3muZT6mKTIAEASR8f2oHgoUpt3lwd1S h7WxzduafMd8evpJAFAEJRNiDwAYE+1e4ba32ybqlXhUylCIMGkj3XrPAvZQA4TSbseqJKrSLSo7 STOORRtNde1zeA+lQSGSJAii4fb6oUPD+mIvQpqclTWZIClL01Jb26rycm23NXXQ0wweqM00pVF5 UQZ6WLzvrD7VpA1mY01rkVtTegiBPpQ/rd84WOtYa6Wxto211yaHr0jxEVVMKGKSIEmSMTBmh8HV aPQsyJupsQIpUCCmOtPCL7ZFrkbFEVGKS3JCJhmSsTDmBrOt1ZonJnTlwdpq6jZ8UQjc4P3XVTGh iAlAiGSNrMVl8LQYPc1Tnw3e9JOxOKtkDjmGAoWJu2UGo8fQtqM1PpCI9cWUpCInZaQBbaQ4J2dp sliaLSSVTxfHo1I2hQiTtbJr7rjvusmXHL6sCDFFTGopHgGQFMPa3AZXs6mhI3+kqUqiEEnSRnrB vS2x/ni8P24O2YlQjKQY2mg1uJtMdQvLMYzmPY6S9lcpImUw+LmWbXEt21LsVpQu5sbF5sbFhV+H 4kyTxvSoKgoUCMmQrqUV65E5TQhjzQJjzYQJVqaIub6jasMPZ1GQMHG3vAkB1haLtcUyg6p4VBpL AcIEANbmwWkZ0hQiSQJsrVZbq3WzsHv4gjx5eUx5UvmrohgMBoPBYDAYTAWAFXcMBoPBYDAYDKYM wIo7BoPBYDAYDAZTBmDFHYPBYDAYDAaDKQOw4o7BYDAYDAaDqRCOHz/e2Nh47733dnd3P/DAA4Ig vPzyyx6PRxmNF7lv377du3ePL9bb27t79+4xV1NVdd++fXffffdtt932D//wD1NvxgsvvPDyyy/P 2l2NghV3DAaDwWAwGEzl8OCDD77//vu6av7GG28AgNFo/PjjjwFA07Senp6Jio3nt7/9LQB8+OGH hw8ffu+9965evTpfN5GbMggHicFgMBgMBoPBTBeKojRNA4Bdu3a99tprW7duPXHiRHd398DAQM5i 46mrqzt+/PihQ4c2bdr04YcfAkA4HP76178uimJTU9Pzzz//wgsvnDx5kuO43t7eX/7yl4ODg48+ +qjdbhcE4Rvf+Mas3xG2uGMwGAwGg8FgKod33nlnx44dGzZsuH79+s6dOwFg6dKlFy5cQAgdOHBg 165dExUbz8aNG3/605/+93//95o1a77zne+Iovjcc8/t3bv33XffXbx48SuvvAIAJpPp3/7t31au XPnRRx8988wz3/3udw8cOOBwOObi1rDFHYPBYDAYDAZTOezYsWP//v1jTq5evfr06dM9PT1PPvlk nmJjuHbt2qpVq55//vlEIrF79+7XX3/9ypUrJ0+efP/99wFg1apVgiCsXbsWAKxWq6qq165d27x5 MwDcfvvts39j2OKOwWAwGAwGg6l4du/e/eyzz7a3txMEMfVab7zxxn/9138BgMViWbduXSqV6uzs fOCBB/bv379jx47Ozk4AIMmb6nRHR8fhw4cB4NixY7N9BwBYccdgMBgMBoPBVDwbN2589913M34y U+Sxxx47evTovffeu2XLlpGRka9+9auPP/74q6++unPnzoMHD+qKu47BYLDZbN/73vf+6Z/+6ctf /jLHcWazebZvArvKYDAYDAaDwWAqhe7u7jEOMHv27NEPhoaG9IPXXnsNAMYUa2tr089nYzQaX3rp pewzLMu+/fbbmY/f/OY39YMnnnhCP/jggw8KvIU8YMUdg8FgMBgMBoMBr9c7Rk1//PHHTSZTsdoz Hqy4YzAYDAaDwWAwUF9f/9RTTxW7FfnAPu4YDAaDwWAwGEwZgC3uGAwGg8FgMJgSgvvrjUBOI/YL AACam6aUGFhxx2AwGAwGg8GUEM+/+tLkhcbx2GOPzXpLSg3sKoPBYDAYDAaDwZQBWHHHYDAYDAaD wWDKAKy4YzAYDAaDwWAwZQBW3DEYDAaDwWAwmDKAQOiWXbj//O/P8eEAENPcyVsMCABEaMVuRW4I dFOACMpAmLMLAUBq6ixdi9AIAgAQQkCUwTyTIABB6XdLojo23wMAUEgDNMu3iwAQSY4el8cDXrI9 kwAiHQuCAFTyUSEIIBAq3V88LcpykGQGAsjZfkBnhZs/Myq392WpiVTvlgaD4bvf/e7Ua/385z+f wd/SN6ceP358586dXV1dkUikpqbm17/+9YEDB5544gmv10vTNADs27fP6/V+//vfH1PM5/N9+9vf HpM89Utf+tIPf/jD9evXP//88y+//PLvf/97AFiyZMmRI0ccDkem2E9+8hOz2bxv374ZNHtajI0q g1RFV5Pm+g/PCkQJv0AzEGUizNlFI2dZySYIojy6JQKiDDS5cnhyZgmNIObUElE2D3jp98zSbyEA lMUvXiaSHKXUX0dloWncSim2WJKk+fxzDz744P79+wHg0UcffeONNwDAaDR+/PHHW7du1TStp6en vr5+fLGNGzeOv9Qdd9xx5MiR9evXHzx40Ov1iqIoCALHcdlaOwD87d/+LQC8//77x48fn9YUZbqM 1a6IcjBqYjAYDAaDwWDKBd3UPf9QFKVpGgDs2rVLN6WfOHGiu7t7omLj0RV3hNDAwMCf/MmffPrp p8ePH9+yZcvg4ODu3bt37969d+9eRVH279//8ssv/+d//uerr756+fLlubujsXI0WB18LHQMdc3d n5x1FruIP/t//3XWV8NnQPTOuy4uWqhpWiQSURQFAHhTcrDxRrHbVTS6udvoA5YZVDRvp3ieBwBV VcPhMAAAAZc7Lsxu80qf9dwG5oCtkCtkJAkAmW5Z5/NvOH58FtpXTYQfevCix6Mfl123XMwubTnT oUnFeUlSJopqV2VZzvmt1+vVv6r3+rpPnJjfplUCp/9qX+ZtGQqFCIIgAB5667fFbleZkf2AQ9bb snFoeN3Jk8VrV/mhWCyf/9nXBEHQP2belizLzmcz3nnnnR07dgSDQYfDsXPnztdff33p0qVvvfUW QujAgQO7du167rnnxhfz+/3jL9Xd3f3Xf/3XV65c6ezs3L59+wcffGAymbZs2TI0NPT0009v3rz5 q1/9an9/v174G9/4xvHjxzs7O+fu1sYq7gRJARAhKEhXmGdklmwY9sIEU6X5hFGUXo5TVZUcdRRR KCVuiRe3VUWEMdFM3DiDiiYTrb80b86AEVShJGkjzc5IgBkykgSATLfkUmLD0HChjasyyKyBJyNS gPLolgHa/2cf/N7Q21vshuTg1w//SdDtAgCDKOBuOQOumEx6h1QUhdC9whDCkpwu5ASapRF3y2ki Ox3XjEZVTe9zm8iMPdfs2LFD94HJZvXq1adPn+7p6XnyySfzFBsDx3E2m+03v/nNtm3bNm3a9Mwz z9jt9j/90z8lSfLv//7vX3zxxXPnzs3nbeLMqRhMSWNdbCxkMYllCYslvegRCoVmp00YDAZTWShO Z53alPkYgrACSp7ymAkhSSvv4OJW/ZOCZC94i9uiDLt373722Wfb29uJaW582rJly09/+tPDhw8b jUaKonp7e1tbW//mb/7ma1/72vbt2++7777sQC9ojh1AsOKOmUMIIOwrzTOoSNOq3W4HAEVRvN5S eebnn2Fl6Eu//78kmvlUHv2eyOylC229S7x1Mw1m6mhGk8lk0o8n8vrAYOYfU8xmVK0AkFJFP+RY 6MdMBToc9p4MZz4qS1UoaLGzitG02HkhcSXtKqMxKqwoboNusnHjxocffvjFF1+cbsU77rjjf//3 f1taWgDgzjvvPHPmDEEQu3bt+slPfvKLX/xi4cKFv/zlL5uamgCgubn5e9/73iOPPLJ48eLZvwEA wIr77IKMxhq1AakoimISzOsG6tJkQLmx+7/+uZAriAbD5f/na7PVnrIDAaIDAXKW1uAIBRuQZg6Z EuV30y9RkyDbAAAgAElEQVRMhdKgtbjNwWDS8L2p6OdJAFA4CcppexoGM1d0d3ePcYDZs2ePfjA0 NKQf6BtVxxRra2sbEwtS56GHHnrooYf04x/84Af6wbZt27Zt2za+8NGjRwtp/KRgxX02IQTB//uI KmrSYgVmYmjGYDCliqZJ0fTMR6FnKU0BBoPBYEoJr9f70ksvZZ95/PHHM8utpQBW3DEYDAaDwWAw GKivr3/qqaeK3Yp84KjtGAwGg8FgMBhMGYAVdwwGg8FgMBgMpgzArjIYDAaDwWAwmBLiscceK3YT ShRsccdgMBgMBoPBYMoArLhjMBgMBoPBYDBlAFbcMRgMBoPBYDCYMgAr7hgMBoPBYDAYTBmAFXcM BoPBYDAYDKYMwIo7BoPBYDAYDAZTBuBwkBgMBoPBVA6IILx/ta/YrZg+BKExNCnJRfnjwsJ2u2LM fAxSabOm2Nrq37u3KE2aGcjAEWKqmA3gOKODBSL9USWUIjamIsGKOwaDwWAwFcVfy93FbsK0qTER HcvfvCZfLdLf/wSyZLbswgqjaASAE1TdL0ydRWrSTLj7tg8+l84WuxUnYFH6iFGYlWfXFLUxlQZ2 lcFgMBgMBoPBYMoAbHHHYKqOVGtruaykI5pSTWY6Fit2QyDV2GBXzPqxBFKguK3BYDAYTFWCFXcM puo4gxz/LS8tdiumhJuGzoVvXVOKtXp+K670/7TErDqHF38xGAwGM99gxR2DwWAwxefS0nWfbfpa sVsxbUggOtrOedXhYjWglupltrEAoAoqnCxWKzAYzDyBFXcMBoPBFJ+wACcFrditmDYkAYaWgXPS 58VuCHApbjmsKnYrMBjM3FKmijtKRXzJ4SsKH1WEOOVg/yeZrCeJDSxnJIjJa1cNCKHkEJ8YTIhB URFVTdYYM81aWc7J2TvsjCnfr19I3YpEk7VYX1wICHJSlhOypiDGwrAWxtZmtTRZYOJ+1//eDSEo Tnp9+0Jb/ca62WxxWSEE+kLnPkIAjkUbLE1LJio241+hqoj3J4Y/HUYI6tbXODod06p7SZHfFAQA 2M4Z1rDs3DSwbMjXLREaPPQy0lQC4NDlawF1SrseFn6xjbEwc9LWkmeKz7iaUuM3EonBhBSXVUEh KIIxM6Z6k6PTUW3jjv/kO1JsZNJi5voO55JNOb9SRDV6NZocSspJWZU02kAZa4yORXZjjTFneUxZ UH6PgZwMhy98IiXCN8+k1AFVGVDQGVnezhmWMVX6WhyDEBC8R31S/JaYuFJcluJyYigZvhCuWVvj WGSf9boVCILI1Wjg1Igm32IOTEVSqUgqPpAwOLnGOxtzDipyQp6K1g4ABpdhdlpbhojBwdD5QwgA AFibJ3ehAn6FqiI5lBw+PIwQAIDBPb1OdU1R3hIE/biBoma9beVF/m4pJ8NIU6d1QYqjGHOVDk9T ecaRpg1f8F7r6b3lGVeRKqXEcCp8MVKzxuNcPL2JaPmiCPGpaO0AwFrdOc4iCF+OBHpGkIYy52Re kfvisb64s9NRs85DYENneVJmg5wQ6Atd+CTzuqQ4E0mzBJnQP6YQ+p0ouEmytuqHnFhvzHvEh24+ sMCYaIIm5YSsP8aainzH/SRN2tqss1i3AkHg7wmEL0YyJ0iaZMy0JmuKoOhSEsOpoY+GWu5pJumx 8VVjvVMNh2JwcrPU4jIjFR4OnvsjQggACJJiLM4chQr7FaoH3scPfTyMNAAAkiI4xzQ6Vb+qvCHw +nNPAXiq+y06abecolKVjdFtqM5Foak840hVhk59xFJ9mqoBAEEAbWZIipDi6XEHacj/WYAgiSqx GfG+61MsyYxT3BFC3k99sf64/pEgCcbCaJKqiGndKXw5Qhko93IXYMqQclLchZEbwXMf6cfmuoXW BStokw0A1tUR2468/QdBQAAawAcpcY/JXNSWFhnex2c0b9pA1azxWJosJEMCANJQ9FosY7YM9ASs LRaCImalbkUSuRrV9UWCAGur1d3lYq3pnHCKqAbPBCNXowAghlPx/rh94a0jCoJYX/rV2bK9Ob8x mDaX08M4W0hR/8jZg5mpOGt1EUQOtbugX6FqEALC4EdDmpqec3MuA0FO9fEcVNXXeD5jQK6jqlpt n0q3NNa0cs4GACAJ6F73x4vyhdyXiklDHw9rKqJY0rN6gtWkimZKzzhCwc8PUgkvWwsEAa5lLsdi B22gAAAhFO9LBE6NKIICAIGegKXJTBsr/m2JeH9aca9ZfR/FmfIUpQ2WMWcCPSO61k6xpGel295h J0gCEIghcfiwV19LD50LOTrslKGaH/RypWx6v8xHwxc+BgACwLl0s6luYeYrkiRWNjbF47FjyQQA DBOEVFtTFJubZjaRHAkAuXSP+WqDirzH/OmFcifXsr1ZV7t1dHMFbaAGDw0DgCKqqUgqs55eSN15 YJv4N/P2t3REgf/o2G/a1A4AWLK6u62zCwAgK5k0WoFOhN8P+ocBoGlo0YrGzdnVI8FAKvw2ADjc NbfZHpjkj+XKUW1DBEH8T0H3UMLIidDImQ+z/Q1Yaw7NRuKlwMm0A3HNGo9zyS3mOtpA1XXXygk5 6eMBQBgRq1NxF8OpgT8OacrNlTKja6rmdr+q/kbgs/OSV7OfzBS7JclwJMOBvjnVamCkHD4wakr1 nwxoKiJpoumuJs5edXsGpijMWN9pMew1M8Ca2AW3t2QPKwRB2NqsnIPtf++GpiJNQcnhZMU/41Js RBHiAMDZajjH9PY+BfpGdDMHxZIt25tvLrsRYHAbmu5s7H27DyHQVJT08lWxbF5xlInijlDo3Eea qgCArX1tttYOAC1W4j9+tJWP8T1vntLP8F9cbbQVYe8FRyAXeQMA1LMSJOb/7wMAJG7E5YQMACRD Nm5pyNa8M1iaLayV0afd2cp3IXXngf85r0xeaFaJXD6V8MkAYKppjSqdR3M1IC7URkcGAeAa4s+Z lVurX06MaADgdLX1zajx6+rJLyBUkYsacjIycvr3mipTrAGpiv5053R+HTqXtiJbF1ici3M50hBg qjfpiruamp7bcWWQikoDBwc1WaMNlKYgTdEAwOCe0jtwRNN+JfASQiaCkAFkhKCKFfepd8tJQSoa PDQsxWWChMbNDUZP1W1imaIw1RQf70/H5Om4fWHQncMHiXNw1gXW6PUYAKTC0hw3vPhk/GRM9Qvz lxwD0pTek736ccPt9eOd5Vgba24wJ4aSACDFK1+SFUl5KO68v1dORgCANlotLcvGfEsSxGX5EjIg cmVaw+kjeym5mAPPErTMDGNXr+aHWG/aN8O11JknfAFrZXXlWx/jC69beSBN4X3pvD+W5qUwgXeq KqU381GGWxy0ENJ4fy8AECRlrGmdw4aWIYoQHzn9viqnSJp1LbsjcOp9/fz4QR2pSuBaeiB3LnZO 5CKsiOl5URVu/pMT8sCHA2pKpViyYVP9jQ8H9fOGKWiKEU37FZ8UETIQxING4694Xj/fQFaj4j71 bjk5CLxHfEJAAID6DXXmxqrz3py6MBMD5xHSAMDeuMheHwzKuTcPcE4OrgMASIkKVzcLGTsSN86z cgoALE3miXoda2NBV9xjFS7JSqUMFHeEtFhv2pTuWNSd0wUWAIAA19Jc1riiYiWtK9n5C6wrCVJk JGahrEDAhsXdBnbCkTslyGbKAgArPCucrKPAuhPhpnLtdi8TpFiQ4kwUAMUa84zcciKoH4xZ0BSD g5oiAYDR00LSVbdEngc1lRw59Z4qiSTFeFbdo0npqDsUaxzvyinGgqyJZQ0sbaSMEy/viKG0p5Gp trrCnMm8cuODAUVUSYZs3tqUWXCgjTQzmR9wXNP+l+d5hFiCeNho4kc3pJsJwkJW3QbfaXXLSRk5 G9SdjGvWeGzttllua8kzHWEiYeSGfmRv7gQITnRNNGonorgKn1XOeOxAmhofOOeqAwDIs/H05lp6 RS7mVgFloLiLwQFFTAAAa3UZXE3Fbs70CEZdx4+MXSKYO8TQUFJgAIA22j4+u36iYnIy7D8/gAAI ghCv7iD7DQXWnYj1DWX8huUcdXUbduYvI4z0p6IBAGBMNqO7JfurzNYiU32HFA8mBy/KfFThYwRF MSY7bXZaW7pmoBCUO6okBE69r6R4gqTcK+9mre7MtJy1ecaPJEZnXeedq64pV/NcMzGQ0E2brI01 N1WRaVMRlIEPB2ReIWmi+a5Gg9swciat90wawCSB0P8KfBxpNMBuo6meoj5JpSc/DVSlbzkfx3S7 ZX5i12PBz0MAYG+zlqA5aa6ZljA1WdLHdwDgLPmCnAgjae2fNpSB3lIIMx47xOCgpsgAYHByBueE Q7MqZeLylfEAXc2UwQMg+Pv0A4OrGQAAoVTUJ4zcUMUkAKJN9mGjG3UiwD0QwOBqNLgaJymEUOTy Ud22Zm5YTDKGwutWITIfTQ5cSHqvAgDFcO7l2yArJq6mSOLIAAAQBJHoPytGfDdrqrIqiRDxJYcv 21pXWRd0VY/dQ5NTI6d/rwhxgiDdy7dy9lrICqs3A4cEKSaFL0Wi12IAQHFU0x0N1ROZWE2pAwcH pbhMkETjlkY9o4o4mjQgv5+MgNCrfDKiaSTATqOpmaIAYHh0B2EDVQbjwiwyu91SCAjeYz4A4Oxs bXftrLe2xJmuMDOuhgRBwsQPbyqSSnrTfly0sZIH+0LGjozGb2u35RlVtNF1OYqtZElWMKX+gkaq IgQH9GODu0mK+sOXj+r+7mmCg2d5cvhqX+26GnND1dkvpwvS1ND5Q7qRmKRZW9s03HgKqVsZxK73 yHxUTfGaJCip9CjCWpzOpVv0yKQZhECf7rWJENLfvBRjIFkDUmVVTOozH6Sp0esnAcC6YPn83kdx 0BRp5Mzv5WSEIAhX1x2js0QkxTODes1UrjNyJpiKplRBVQRFHg2FYnBy9bfXs7ZqcUnSZG3gD4Op qESQ0Li5Pv3qQyCG0op7HreiFEK/FvigphEADxmNbTQNAAjAq2YU9yoazmerW+qoojr0iRdpQNJE w+aGakspMANhUmzatw0hTeZzZ71AKhr+1JtJJFTZqWdnPHZoiiQG0/tbzPX5dKFMakUax4IsT0pd cRdDg3okKYrhpKg/evUEylVMjkuDfxxs2d6ME/nmQU6EwpeOSPEgAJA061m5XQ9nNtd1KwOEtPiN c/orNQNnr/Gsvm/8vovs3BlGT4utdRVjcejWEaQpicGL8b4zeoyFWN9pU/3CzOhVqSBVCZ79UIqH CADnks1GzwL9vMLH9bVdgiDYvAvl6etoKHQ+nJ0LEACMNcaWu5umHrO83NEUbeCPQ2IoRRBQv7He 0pzeBy/FJVXSAIAggZsgn5eM0G8E3qeqALDDYOyk0zpQWNNSen4cgLqqcXCfrW6ZvhpCw5969XDj detrqy3448yESTIcxZnUFA8Awetn4Laxl5WTsu+oPxW9uY1yiuGSypQZjx1SPKgPT5yZY60T9z0E GWFyE7vTYEqZUlfcdfsuAGiKHLl6AgBMNa1GTwtjcZGcUeFjvPcqSFcAACHwHvW17mglq84/c3JU MRHrP8sPX0mnRWSNnlX3MOYp5Y4upG4lISfC+muRIAhA6X18qWggePage/ldBHnzUVLFRCrqBwCC pJyLbxsTvZQgaWvLcpozB88fAgCkqWJwwNzQOY+3Mt8gTQ1+flB/lh2dG0117ZmvpFj6AWfMTmIK HhqpcErX2gkSAIH+M+iJhxrvaKyGZx+paOijYd2nv3Z9bXYY5oyfDGfnctp6FYADgjCkqgBwr8Gw jLlpuRweNbfXkBRTHe5Gs9gtdYJnQ3pMUnu7rdo2pBYiTKOnJTF4EQDi3usX/xBQOiXWxiIEqXBK GBHCFyPZ4csYC1PBduJCxo6MP5Kt1qYQE4aLkZOyLs8803tMiVPqintmiQ0hjeJMzsW3Z/ths1Y3 a3UvYzz9Zz8FACkup0IiNrpnowixeP/nvO8ayoSMqO+wL1w7Fff0QupWHozF2XTnHoKkAAhNkYRA X+TKcaSpYmgocvmYc8mmTEmSMTTcthsACIqZaF3CWNvK9J2R+SgAKBMsEFcGCGmhcx+JYS8AODrW mxsXZ387XU9izsl1fmURSRJAgCqpiRsJ/8mApqDkMO8/4a/fOL1MJYVDADGfecE0TTt1+KA0VFOj ZwRr7gLx5rfnhg9zyiUAWGBbsky8xXRJk/Aff777/LGDYd8AALR2rX97YdfbWQV6zxzx9V0CgLrW xYMrx5k95xL7yClKnu+0F7PbLQEgOcyHzoUAgLWxteun4V1TARQoTHv7WjE4qG9RDQ+Gw/3hMQVM tUaSIRODScjrA1YBFDJ2yKPKksVpjsCEijvvTzt5cg6uGiwdFUlJK+5IU+V4SD8mCMK9fCtrzRFe sKm9k+lj9VQCYjiFFXcdTRaj13sylnIAYK0ux6KNUxmKCqlbqRAEmcmIS9KsuaGTIOnQhY8BgPdd dyzakDEmERRNUZNG8ScYi1N/+Y5xv6koEAqf/1jfpmJrW21pHhthSXe+AoCcj/Z4CPKmNZhiKXuH naDI4cNeAIj1xmvX1cyzVzFC85gXDKHQ+UN8oB8AbG2ro8riMRnB/Of8UkIDgGG348yYVqXr3tDr 9huW9g/d0uv8vQEpgQBAkF3+oXntkFsINN/JG2e7W6Z4afjTYd2+Ub+htrpc2wsWJkHRnlX3RC4f hcTwmK9IinB1uVxLndfeSDuQVHYeq0LGDmlUWTI7zBEYO/nJkBxOK+5YUypfSlpxV8REpl9aW1dN +NgThMHJ6Yq7KlZj3sQxIKQlBy/Gek9ranoPCmt1WResNHqaJw1gUkjdasPgTgcnRUhTJZ42Tm9x PONdQ7EVu6k6cvkoH+gDAGvzMlvrijHfIk2Rk+kBZlpbALOxjMZ/RBpSBCWfc2eZU4gw5+GHKCNm XRrXjl/TdxfYF9qqTR+aFWHSRqtn1XYTP+x0JpWQrKZUiqMMHoNtgZU20UJAUEZHdnNDFcV7nYhc YwfS5NGIUhOnjUca4n1pxd22YL7ny5jZoqQV90zWBoIgLE1L8pREato0TJtK+o7mATkRCp77SBHS OVBZq9vWusrgbpyK2l1I3QoCSaM7KxirK9t5fQxE1h4+gpp2oANVykQ3q8wXKEJa0ncNAAiAVMTn /+ztsQU0LeOFFTp/SO9lrLXG0bkh8ysIqckS9GbtSSWZinV+LUSYhf0QlcasS0MYuREMBwGAYsma VdW1JjmrwiTMnqaWFc2ynBrzRWIg7UlldBsqO6TMFBk/dmiKnJEzw9KQM4gHQGIgqc8wWStjcFXy 2kVlU9JqbmYGSRttefKHIYRSkfSjbqjuzRZicCB47iM9Dg9ttNrb1xprWqaodhdSt5LQFNnf865+ 3Lj5K3kU94x/IUkz1MSJZnOCkKYrpgRBcq6GmTa2pJHjIb07IQApEcpfOFOAczRA1q+QoKFrgzVP loZM1m6KJenKzSdSiDALqVt5zK40NFWOXD5m9gAA1KzxUJW7bzIn89C1VEmNXk+/aatty29Oco4d GWWJIAiKpkDOXTdyNR1K29aWL9A7psQpccU9rY4TZL63YWTEJydlAGBMdDVPIpPDlyOXjugzbWtL l61tdX65zVbdCiPzBgSA/OmmhUC/fmBwpf2IpHhw5NR7+smGTV/OE49C8PfpzkgGdxM5fWt9WZDZ lDYt9H0U2b8CxVIwsQdcxhpnbjRX8FBUiDALqVt5zK40Ytd79JQORo/B3m4vqGVlSIHCFEb6VZEH ANZeM5ErbPBMSDcSMybaXrmKe4FjBxqNCoUQ0tTcS5RCQOB9AgBQLOlYVHV9tZIoacU9ozbJfBQQ yplWDWnKuc8O68euLlcFj9z5kflo5PIxBECQlHv5XQZX0/zUrTyyTeyKEB+TWSmDmkrqIcwAwNyY DshFUoweYRcA5ESItefOm6jJqVhvDwAQABWcx8rSvNTSvDRPgeFPX9XzJnpWbh+TtTf7VxDjIkyw C0DmlfCltA3J0VHJQ1EhwiykbuUxi9KQE6Hk6Eugrru2CkefAoWZHLoshocBwNK0NKfinopKGSOx Z5WHqNwoKAWOHdkhaIS4AOM2AiCEfCfSLqDu5S6qchcnq4GS3vzOWNPJGpCmxm+cG18AqUr44mE+ EQMAg5Ozd1TsdHwyUOTSYX0jr7vrzmlq3oXUrUAozpiZMWZU8zEoQmzkzIe62cPoaeFGX7IUZ8ok Y4r1n4VcnoaaLAbPHlTEJABYmpcxZues30JZoKb4TLbz8ebM7F/Bd8kHuZDi0uAfhzRZAwBrs6Xa NgVmk1+Yc1e38piWNGK9p/Qn3NXk4hxV7aWZk0mFmckHksm0mI3CK0OHhvT4FJZms621MvcC6RQ4 dlCcMeOuOXRxaGxNBN4jPt2jmLUyjs6qS8NSYZS0xZ022libR1+Mi/X2IE2xtizXl5A0RZKi/siV 44qYADdJG+jGOxuJ6sgbMh7e36dnvuDstYzZoYqTB0WmDGbdu6OQuhUKwVrduh0oMXQRCMLWujJt z0BIERO892omhSpttGZHcCco2uBuEkZuAIAYGgqd/8S+cC3Fpc3Fmpzi/b3x/jOqJAKAwdlgX7hu 3u+uVMgsstNGay6XpJu/gveSDxByd6WtRAghJalEr8VCF9IpVFkrU7cxt4GqSphMmHNVt/KYujTk RFgYzTDftKxxEAbmvHHlxqTCzGjzihAPX/jEvTqdQEBTUaI/7u8ZUVMqABicXMNt9ZU85szC2EEY a1p1S5Pvml/jVNcyp55MOhWVAj0BPQokxZJNdzZWT5LpSqWkFXcAcCzaEOh5F2kqQijWdybef5Yy WAAgE/kEAMxWW8v2ZqaK48nwvmv6QSrqHz7y2qTlKcbQsPmRwutWKrbWlamIV9+knxi8kBy8QBnM BMUoQjzbLMRaXO4VW8cMSPb2tanwsL7oyfuv8/7rFGukOKOmyKoQz1hRTLVtziW35/T+qhIy+RS5 CYLE6b+CbnkKX4xELkVoE00ylByXNPWmOcrg5BrvbKTYql75nVSYc1S38pi6NGL9Z/QD1uqy13KD MlbcxzKpMI2eBQZHnRjxAQAf6Lv6xxvCYF8QBeWEpCnpZ9zoNjTe2UgyJe0dMCsUOHZYF6wQ/H2q LAKCkTPB0LkQa2MVQclE0iRpsnFLA2ur9sl5BVDqDwNrdXtWbKNG/bcQQooQz2jtBEFYGpdsvPvB au6LmpxKhcfmrcgPa3PrJvNC6lYwrL3WtXQLObo9CAEoYlJORjJaO0nRtgUratbeT3FjfQlpk82z 6h7GdNPfWpUEKR5SRt+8FGdyLtnkWrYlT7yaaiCTloWZYFPa2F8BgZxUUpFURmsnadK93NVyb0s1 T9p1JhXmHNWtPKYoDZmPiqN7060tXZX+RpwhkwuTIJzL7rjpRYM0ISakIildaycpwrXM2bK9ma6O WD0Fjh0Ua3SvvDvjMKOpSAynMlo75+Bav9BiqqvYnCFVRRkMeJyzoW7jruTwFSkWUPiYIiZImqEN VoOr0VjXThssNFMGdzF3CIG+TADXKcJaRzf1F1C3sjHWtrH22uTwFSk+oooJRUwSJEkyBsbsMLga jZ4FE+WjBgDWVlO34YtC4Abvv66KCUVMAEIka2QtLoOnxehprnKVHQAAoZv5FCf2JDbWttXX11rZ mByQpISs8DJBEhRHcXbO3GCyNFvwFiuAqQpz9utWHlOWRrzvrP7epA1mU00rwNW5b1y5MTVhUqyx du0XeH+f4O9llThJkjRDMRbG0mi2tdmqLTFLgWMHa3XXbdjZak8mhxNSVFJTKm2iWTtrb7ebG01V 60tceZTHU0HSrLWlq9itKFHMjYvNjYvnv27FQ3GmAkK+EMaaBcaaBbPZoEqCIJru/NOpFKQ5U/OK JkkRJy9atUxZmLNct/KYsjRcy7a4lm0ZrTWHLSpjptG1CFNtm6m2rcZEdKwgr8lVPgsqaOwgabZl RUtscXR224QpKUrdVQaDwWAwGAwGg8EAVtwxGAwGg8FgMJiyACvuGAwGg8FgMBhMGYAVdwwGg8Fg MBgMpgzAijsGg8FgMBgMBlMGYMUdg8FgMBgMBoMpA7DijsFgMBgMBoPBlAFYccdgMBgMBoPBYMoA rLhjMP9/e/cV5EiSJgb691CIgEqI1FkiS3bp7mo909Oqukc1hyN3b3d2jDzj0c7s7uEeTtg+0Nb2 hU9rRruHI1+WdiSPdscl765nd2ZnZndvdnpbi6pWWaJLZVVWZVZKAAkNhHa/h0CikFkAEplAAgjE /z1FAgHA6y8P9z88PDwQQgghhFwAE3eEEEIIIYRcABN3hBBCCCGEXAATd4QQQgghhFwAE3eEEEII IYRcABN3hBBCCCGEXAATd4QQQgghhFwAE3eEEEIIIYRcABN3hBBCCCGEXAATd4QQQgghhFwAE3eE EEIIIYRcABN3hBBCCCGEXAATd4QQQgghhFxA2PK3bZoA7BAs96Q0u2NmuLHiOOt1MWqJhuhsKKC7 K5id5S+Ry4+fa+cbLL5aRYkHI+kvk6vnzgLrTO1WFcXZCLinWgZs8K0qY3Si1wXZhLMeDnm4JZJ9 SwLT2fCD6sZgcgDCijhm976KCpa7W8ugRXyrSj9EEmqC6bpqyfdHbazibRwg7jDCNucEf/a//ms1 v96r0iCEEEIIoQEjCMKf/Mmf9LoUg2DrmRAHtCflQAghhBBCA4lSTC87Y+tUGRAkADAffd09eAKK VurJT1Ofz+Y4qKmgjDCbs3tSmH7AE543BKA7nulBRMJI5VPVYFq81cnC7RmBCJzOd2p+y04RkWOk fvuI1bIdIhEIrYx0MMaq1yrdUi37BwEigVQN4GBUSwJEsiRmd+OoJ76tl8odbq+WHBDBkqArMawg hEhQN5gDUC1FIpAu9kSNup5qtfT5fN0pycDbmqD7AkPFdPIt9kxPStMRT43z/+Jf/rOe/PTaf/vP P76VRJEAACAASURBVBsfB4BUKmUYBgAUgvk7R273pDD94JBw5Mm/fkFbM3f6wZEXh9KRNUoppXR1 ddV58crZLztdwD1xUjr11KcvULM3ibsyKmmxYt237t27p2kaAORDubuHZ7tbLtd7UX4xujjsdOeW ZSUSCQAA4ppq2T8iXOTbhTdKpcrwSrW1zIaz9w7d6WnRdk/m5D+a/2+0NaMLvyWdZqZZp1HVdX1u bs7ZdmO1HOaHvzvzY6PUvVMO3scJJ22n+m1x//79SrWMZO4dvNu1InXQC75vTH9ysjsnkwAQmlaK cu7R1y3Lmp2dBQCe57tTkoHn4pF1hPpTjuae/PjPlavXel2QrVI/+oE2PNzrUiA0gCxmTS99MPJ/ /l/d+LH/UP/lXDg89we/340C7A2Vqo8t/138r3/d1V/9P+q/nPzJj41YtKsl6bQ1e/UP//K/COl0 b4uh+pXZn/1Rb8swYDBxRwgh1D0c4aJ0OGhHnD+zLGtANwaqEUJoAGDi3klWJOL3+wGA43D9IwAA nWnHn85JieROP2iLwQOJEqHMAFjdi5IhhHqEMpr+vFC6pzl/midsUHpbIoQQcg1M3DuJaBr9WAIA FiEg9ro0fUBj2tA/vDP0/vu7/wZZhn/ysw4WCSGEEELIpTBx7yRe09RFAwCon2HijhBCCCGEOghn dCCEEEIIIeQCmLgjhBBCCCHkAjhVBiGEticQadSeYBQAwLD1BCR6XSKEEEKeg4k7Qghtz2LG2ls5 qlMAsAQTzva6QAghhLwHp8oghBBCCCHkApi4I4QQQggh5AKYuCOEEEIIIeQCmLgjhBBCCCHkApi4 I4QQQggh5AKYuCOEEEIIIeQCmLgjhBBCCCHkAriOO0II7d5Z6Vyvi+AyMsiBA7IQ5J0/MwJn9rZA CCHkHpi4I+Q5IS6M6eZOhclQ+KTCbAAAA4yk8yojb118pYelat9TE/y/+Jf/rOs/+79Xt5I//pEW j3W9AAgh5EqYuCPkOals/IuLJ3pdis4Y8pF/Nf+XsV//pps/WvT75372027+IkIIIQQ4xx0hhBBC CCFXwMQdIYQQQgghF8DEHSGEEEIIIRdw2Rz3xJd/Z+RTzfehQfL/aeq3ZaU7RepnjLHScrm4VNTW NUuzqUnFgCCFJF/UN3RkSPTv4H+/vFZ+8PYS4eDoT45yPNm7MvetdoKpMjZrmXcsK0NpkVKBkCHC HRD486IU4jx38kwtQ03c13MJWytZWoHZFi8HBSXkHzukDO8H2KZ22YZaXrmjppdsrUhNI+tXfmfO fd229/F8d8rfV9oMZq0F23qzXCYA/0MwJBDPHePUpPn5gppUzZJpFk1qMTEoSkExPB0KTgWbB5Ix VlwuvntntlQqlhgzGAtzXIzjRjj+nCh68RhvI5g6Yzctc8m2c5TmKDUBhgiJcNxJUTwqiF6rl+1E sq7blvlrVQWACz75CUnqfInR3nNT4m6phW2zdse4J7vwLdSkunppzShsWmnNKJhGwSwulzI3MyPn RyJHh1r5KsZY4oskAPgiPm9m7bsOpg0wYxgfG7rB2MMXGUswO2HYXxjGyz75vIdaT1Zans3NfUnt TZGkpaxZyqqpB1IwFj/zMu8LNPp4cfFWbu4Lxmj1JUsrzebSi+XSE6L0iix7KUVqM5ibUIC3NQ0A Rnnec1k7g+zdXPJyipq09mU9q+tZvbBYlKO+yRcnG52cO42DVbRvrBoBWvmGLKVZSufA+szQX5Xl c6JnjvF2gsngq2TySqlY21oCQIqxFKV3LGuUM36gKF45EWqvWtY1Z1m/UVVnewLTJNdyU+JeXrvX ym5+kfA/+b1EMLjX5XmUFY0FjykAkJF7vDJx/n5+9eJabesn+gUicGbRZJQBALXZ2mcJTuDC06Ft votB6sq6njMAQIl78TrGroNpMvZrTb1nWdVXhjiOB8jSSvdOAd7WNY7A457o11n2zufFpZvVvzle 4OUgswxbLzvRNYrp9WvvjjzxLcI/0jQxlr7xQTk57/xFCCcoQWoaQDXnlRnT8HPkecm39/+QftBe MLd8F8CHur5OKQBMcB7rzhkkZpKZW9nqC5zAiQGBmtRSLeeo1zL68vvL+1/bxwlbU8Zq48CRyltB QkRCchvHuA3wO00TgZwUxa78e3qqnWAyWJlZfW9e9W80tSIhYUIMBoWNE/UEtX+pqn/g94sDf27Z XrWsa8G2fqVWGgceYBgTd9dyUeLOyolK4j7y+Dd5n7/Rfq8eE//N8J+T3hzY1+AgAMBjsycDpR6c OTjKa+VqoinI/MgTw8GpICdyAMAoy83lqyfxyZlkaH+QNB5Etw17/Vo6c7vSfMhxj2RFD+06mBTg l6q6YFey9mcl33lJChDivHXLNN/TtRJjAPCuph0RxOCgd0Wl5Vkn0SQAyuih8MGzgj/kzOWwDTV/ /3Jp5Q4AGMV0OXE/MHF0y8ezdz93snZOkMLTjwcmjxHCATBZT4ffv+ecJ1/U9XOi5B/0SELbwaxl mfo7uvalYTh/eu1yZfZuzkmPCIHQwVD8VEwKSc4MBEuz16+uZ+/mAEDL6IWFwtDhTVfVNjcOwoXj x5+ZuycRAgA2wDXTeF+vXGp7R9eOiaKLutvdaSeY2bu5zO0MgB8AToric5IvynHOkVxi7CNdv2oa AJCg9k3LOjvoZ0HtRLKuJdv+Rblsb/w5xnvsOB8srmlJjHzKUgsA4AuP+CJjTfb0B8UeZe118MDL RO7mL1KbPvh0kQcBCChRefrCQSfLrBZIOab4Ff+DDxYBAHSAHMjxTSW0dVvL6XpOLyfLhcUCpUwg lXoSGY5IZAdjwz7OB8Tefr9+RW22+mnC6ZjlqG//hX21wSQciRwdEmR+6YMVALA0W8/q1WB+outO 1h4k5B8r/trrkhzASVEc5rm/KJVsAAvg3qB3RbZezt793NkeOvJUcN/J2nd5SYkef87WilpmFQCM fHJLrqkm7jt5KidII49/UwxGN94hvvDwG0eP/vLqVQCwAeYta+CHNtsMJgBQUzdLWbOUNXKJGWMp uJG1g8cuoFtlK/ll5VFaI08MRx+L1r4ryPzY06Nm0SytlQFATWm1GdKWxuHQa9PHPxuVNroeHuBx UfIT8itVBQCVsZRtD/ZJUTvBdD4rgAAAL/vkpzbPHgwQ8ros5yh1WtRle8Bby3YiWVfCtv9KLVs1 r3jqMB88rkncq/Nk/OOHe1uSHVHM/YdS3+nmLyYezAWSHwQAeEF84sT35Fy9mTAyWOSvtFIBAGL3 vzbOjlXfYYx98jf/mdoWAHAAte2BIPoe0/4r0HdwUhSUCBP+4y7/JX2g+KBgFk0A4ERu8oWJTadA G4L7glJIdKa/VxP3omVdMnRnh+8oSt1WcoTjHxPF66YJAEnbhoHuigoLXzFqA4B/5GBwX91nPxFf ZMLJNamp177BqJWb+8LZjp14oSZrr4jK8iFBcKYkpSmFQddOMAEAGFv55C+dbwCASPDhES0TEvHI BGIAAEjfyFCbAUDoQDB6fGu9AgAg4B/3OxmSrW8ag2ilcTgmiBFOz1IKAAk64Il7O8GsfJbAkWj0 yeXVeh+FAwLvJO7q5hnwg6edSD4qRembatlgzE+ICWAyBpi4u5w7EnfGaDlxHwAIxysjB3tdnB1I a+yzha4OOaeu3NFyDADC0ycvrvthvf6vp7SglssDQHZJD9YMipvFzFq6/vx8ORbTHuwsKxr1k5+Y 1vb79av8/YKzETsRFYMNE2spJDmJO7Uq8ZnJZZ2tM6J4oPEM4zGOvw4mAGTZIKebjFrltbvOdnDf iUZLndhG5a4pXt50P2XxwQ1LLwOAEt8nx6fqfjbGcc6Z/cAn7m0GEwDMUraatW8xwXvo3nNqs9y9 vLMdPR5ttECHpVVaMDGwqQVosXGIcpyTuJsDnW22E8zaz54bGyNf3aj72fJGvj400OeWbVbLLbK2 /Wa5pDEmE/KGorxZLjuve+5WlsHijsRdW1+ilgEAyvB+TvDCbXy7ZBuqnlkBAAIQGDvUZE9n3hEA CIFI7eu8HBh98ru1r+TmvtCzawAghUc6XNz+ZqlWea0MAIRA81t4jUJlpoE05AMAYHC3WHJeab6a hAGVrkjpm8lde8HIr/M+Pw/AS4oUHm60m1lcdzZq58IxahcWrzvboYNnG31W3gjgIMcRANoLpmPL MX5qjN/34a8XbRs8Ng6nrWuCXwAAQeGVeMMJjVq6csnCP/rw1vzWG4fsxpnk8ECnm+0Es/rZgOIf MxreG7ZqV842B3vh13YiuYVeMn6ezZQZkwj5seKvnvkECAkOdG0ceO5I3Ku3pfrHjxiF9dLSLbOc s8p5wvOif0gIREP7TzW5XdU7zGLGGZIUlDAvN2wBzVLGVgsAQAiRNk884ARJCsVrX7E3UvwmWcJA 0rNGYCIAAFJIbDKqoWd154o54UCO+ADAMqycaTofGGnax6xsdEWDfT+lLzI29sz3m++jphb0XBIA RH9Yie+vvq6tL1HLBAApGJVCsYYfZ544BYL2gunYcowHhvgcrUSvt+NwI/bRg9o2/7ROCgNc2Nh+ ZD6RY21pQV95BwACofAL8R8QrVK7UmtLseFbzuuP8U+DBoTA/32clv70Qu3Hy/nMtfd+zQAIIeXX f0/07e39TpylRpJf7OlPNOIfVQ69sc3F8OJiUU2qACCFpcDUwwtB1c8GSID8Xf3Pzlrmsm0DQJTj jgiDPKuwnUjWslTr+js3nrBtCeCHin+c5z/SK7XcUxfWBpILEndqGVpqEQAIIcWFa1p27eF7tmkb GmTXSiuz4YPnQgdOeWDErRk5NinHJrfZibHs7CWnow5MHOfEZn2JbajOLAUA2JLQD7zAhD8wsc3Z IGNs7fOkkzRGjkR4mQcAU6vMNeKaVsckte9vrBQZJN4d/zDLudLizdLqXQDgRV/89CtQk3w/PGkf O9IknJpnEvfmmgez/ke0cnW5vbGejmUuFdiXN/plZl01koxRXvSNHHpp+Wbt/KIxiFUuZVxuVGbG kpc/0QsMAIKTx79clwD2dh6XH+hLfVn9jbyRuZ3NzeUBgPfxU9+YaH0BiXVKvzSMa6YBADIhP1D8 3m0rW46krduL7ywFCkEO4PuK37lGsbIxQW5iu/VhUZ9zwf+fmpx3nrfCGHOydl6UOUlmtmlrJae7 ZtTO3fsSAEIHTveyrH2PUTt94wNnNI4TpPD0ueb7G/nKve2iP4yTlLZgNlv5eNUZ+eAlLn6mMh4s ypUBIQqQpTRW76KkBfA3qlrtxgd71uaj8vdmzHLO1su09swwGI2eeEHwh6u7UcvQ1pec7eZnpJmN CQmDfe2irhaD2Ugxm3KmekQ5TvZe9Gq1GclaO21pB0/q6rqe023VtlTL3FjRRI76xp8fl8LbdCUf 6nqK2iXGSpRVzypHOP67ilK3OR1sO40kNeniu0t6zggK5I2hyHSpBACsZq6Rp2bEDSQXJO61z11S hveHD54TgxFn7I1Rq7h0qzB/1VkFJT9/xT9+GGCQr6O1wyymM7cvGoV1AOAEafjsBU7cZl326qNq pZC35slsS8voic8S6roGALzE7Xt5ivdVWkPBJwQFwbkq+YmhvyFvnYOYp/S3mrZecxulp1pSxmjh wXW2+X5c39DI8OPfJJuvPBiFdWc3wecX/A1nEjOA1EYwR70USdhJMBspZion556qhI9qP5JVu2hp O+6s1MtTBUbZh7c/EuhGX8wDAIRHwudeP0u4hieHEkilpw/oE5Nvv/cupZtu5h2PDL32xHmL4+qs OLM3LMsC6P0NxYyy9I0M2xwNZUTZ/+pU3UhSiy6+t6yldULg6POHj16+BqUSAGQo1RkDAAIw5r2T nwHT74m7rRX1XAIACMdHjz/nH9u0FiThhND+04IvsH7jAwBg1NbWFwFO9aasfczWivmFa+WVO5Wn pknK8LnXxM23pdb1MHH32AT3JsySmb6eyc3lKg9eUYR9r0z5hjaNfBwJBpwbKm+apsHY05IvznEU IGnby7b9uWmYNSuaDXFcwEsjnWYx46RHhBBglUDoueT6tXfip18i3MNG6WH1GxprMk8mr+vmRp80 6rE+qfVgNlLKVoI86e3Evf1IQhstbce9dfGV7v9olVFYTzxYgs3BhCW4ucDip19sEsy/BTAKSsK6 vfWzafhPM8XW/yPa9wLMhIgKAENcpIdnQYX1Qo4UgAfCEcZY5VQiDdzHwqkXT255Ziq16VfvXw+n w2E+fPTZo48fO5f8p08Q3QCA2ysrxRs3AGA4FFp/5plu/hN0ALB6+yj5QdPviTsnyhPP/RAACC82 GrRQRg+K81fNcg4ArHK+q+Xre5aaLyx8VV6bqzaAgfEjQ4fPN5/aXsGYM2gE/bGkzDP5/7G3BSgX 8wu3r60uzAXYuHND0MTBo4dPPykRGWrqncDBZ//1j2fe/WujXASAdwD+/SNfFYyP8YKYW1sEgOjk 9IMnXuxC+UeylyWr2IUfak4MRqde/EPC8QCEWoaanM/e+YxRW0svZ2c/jT72teqeZiFV/UiTL1wu VO6fHuV5wUunQLCTYNbHWClbOcY9PuLeZiTbamkHTjvBbLdKd1pifXQmdWz7/fYGYxQOf/fRaMAS 3Hyg1EaDMZr+6j11PQIQiRx56nr65PWP4D9vvJtNXyzSHAAEA8ffMp/u5j/BB+ar5LNu/uLA6/fE nfACzzdcHaW6lxiMOok7G+j1sHeEmlru3kx17AcApFAscvTZ1sfOzVLGWe+ZcHxPBo22+M3dnj2E tVEwy+Hhu4sA8GjBiHX4Qm72kpZZ2foGx4cPnBH2n1r95K9skwGADsPFZDfq7dcI9MNtCoRwsDH3 gBOkwMQxwgnpmx8CQHntXuToM2Tj3imjkHY2mifuC/mcszHlvdSz9WDWZZYyvG0BgAAQ9/bSzruO ZPst7eBpp1q2WaUHTKvRYCxz40N1fREAwtOPb3maMgA8HIPz2CITA2lADoDq5TNewkUhgTFaWrqV v3+F2pXrU1IoFjpwVhnet6NVd2omuMe3XZtiUO06mIISGj53QUsvG7mkWc5RU+dEnxQe8Y9O8z6/ kUvYpubsuf1CQIOu+lglxqhtlAXFuRGQ0Y0QiUrjCe6ULuYLTsp5YqDXiWtRg2DWZ+RTzh0YYzzv rTlGLdg2kp1qab1gR9Wyg58dPHWjkZ29VE7OA0Bo38nwwTNbPsKoZZYyznY/XDxHbRqQxN02KisA CI07eI8wi+n16+9Xn68kheLhg+fk+OQuOhKc4N52MIkcm5JjdR72qaYeVL9zcCstM3IbqxKFYk0m p5KaiemE31iTxzKrsw5I43v7SqkHhm0pAFGO6+1qhnusrWA2Uk3cvTRPpjOR7GBL62btBHNPqrRr 7T4ajNHS2hwAEAA9u5b44m+3fjWlD28WuPGBU0Ol0EjkWFcnu6NOGYTEnTHq1HhCOF9sotfF6SVt fXH9+vvO/BZBCQ0dOq+M7N91R6JvrAXpzcS9s8GsRS3DWWkbAALjR9r/wv5ELTMx81tne/Lrv9+k K6remsIJIi9V5gRXh9sJIVzji+P5xdvOxklRHOCMqc1gNqLnk86KH95J3DsSyb1rHNylnWDuUZV2 qXaiYRbSTlVkAEYx3fyHqjv4Ip5OllytfxN3o7Ceuvz3zvbE136vybQ2NTHvXKmU41PcwJ6Ob6+0 Mpu9fdE5rQ7tPxWefpy0MWmVWsbDwSTvXVzbdTDV1IKtlQFAGhppNJswf+8ytQwA4H1+/wAn7huZ NwA0fwiAmlxwNuTYwzkGbGPVYcYYo3bdnkzPJdTMKgD4CHlc7IcJ/HulzWDW/07nGA8S8NIzWdqP ZGdbWldrJ5h7UaXdq51oVK+N74g3x+MGQ/821hwvOquzA4BZTEtDo3V3o6aevz8DAATAgw+5qDLL uezspwyAcHz89Et1p2fsSPXRS4LPz0tbVyIfbO0Es7Q869yQGpw6UTdxN0vZ0kplkHjo0PkB7vJr U21LLTR6hI2tl4pLt5ztwOTD1RtqV5GyyoU696cylp295ITveck32M9MbTOYdVWP8RDhggMdvVpt RrLjLa2rtRPMvajS7tVONIL7TgT3nWjy5Ssf/9w2VAAYPnsBb6kaAP17PxLv81cfe5FfuFb3UQjU 1NavvWNpJQAI7jspBpotPTHQWPb2J86KOvFTL3akL6mZ4O614fa2glldfkdLLzG6dbUZWy+vf/Wu M91QGd7vH5vuQHn7Fe9TqkNH1c5mC0vNp66+7VwxU4b3+2rOz3mfUr0sXly6+chHWfrmR2YpCwBD PvkJaZCH26HtYNZVPca9M08G2o1k51taV2snmHtRpd1r76Jh62UnawccZR8U/TviTnhBjk859/Bp 6eX0jY+GDp/nfZVFY6iplxP3CwtXbUMDADk6MXT4yV4Wt6fKiXnn2dq+oVExELG17dfq5uVA82uO 1U5d9NjqUW0Gs9oyWmohc/OjyPHnnOaYUUtNzOfmvrBNHZznqD/2tUG97LuBSKG4c/2huHwLCAkf PFsZR2fM0orl1bvVZ1UKSuiRFZqJMnLQ6cPKq3cFORg8cNo5mTdL2dzcF1p6GQA4QXrj6FH+/nyX /21d12Yw66ge4+NeStzbieRetLQu10617HyVdrO9ikb1MBeUUPNJOMgt+jdxB4ChQ+f1zIozYaac uFdO3OMlhfcp1DJttVAdgfePTkcfe96z6xUCQHltztnQc4mVi7/Ydn9elCe+/pOmuzBj49k3Po+d o7cZTGX4gBwZ07JrAFBOzqupBUEJAeEstVAdgJfCw/HTL3uhDQ0fPKtnV50rDMWlm6Wlm7wcILxY Gw0AkIKx+Jk6AQkdOKMm5m1TYwC5+5fzC9dEf9g2VOd0HQA4Xhg/93Ik/1HX/kU91GYwH/HwGPfU iDu0Eck9aGldr51q2ekq7W57FI3qjDif5y6eD6z+nSoDAII/PHzuNdE/VH3FNlSjkLY2snbe548+ 9rXYyRe69hjkPkRNXX/kKT/NSeF480Egs5ynlgkAhBAxFGurfK7SgWASEj35jeq4O2PMLOfNUrb6 KKvQ/tMjj3/TI7cNSEOjsRMvVNeEYQCWVqpGAwA4XggfODNy/lu8L/Dox3lJiZ99tTphhlHbKGaq WbsYiIw+9YYSHd/7f0dfaDOYW9Qc49wY19cdQcftLpJ70dIOgHaqZWertNvtUTSqj17y2sXzAdbv +a4UHhl75ntq8kE5cc/WipZWBMY4SZGCMXl4vzK8z8spu0NNzleXaG2RFNpmEP3hPJlg1FMR7kgw eUkZPf/tcmJeTdy31LyllTheFJSQHJ/yjx2uTvfyCGV0WhoaLa3cMQopWytaWolwHCfKYiAixyaV 4QNc4zXaAUAKxcee+X5p6ZaeT1qlrG3qvM8vBiKB8SNybMpr19naDGat6jHuH4oKHgsj7CqSe9HS DoZ2qmUHq/QA6Hw0GHv4zFSPXTwfYK7IyYgyckAZOdDrYvSpwOTxwOTxDn/n+JEBXl+8ic4Fk/hH p/2j0534Ktfjff52VnziBCl08OygPqRqp9oMZlX1GD81wcPbb7b/ha6z00juRUs7MNqplp2q0oOh w9EgZOrFn3bs21B/8NYVUoQQQgghhFwKE3eEEEIIIYRcABN3hBBCCCGEXAATd4QQQgghhFwAE3eE EEIIIYRcABN3hBBCCCGEXAATd4QQQgghhFwAE3eEEEIIIYRcABN3hBBCCCGEXAATd4QQQgghhFwA E3eEEEIIIYRcABN3hBBCCCGEXAATd4QQQgghhFwAE3eEEEIIIYRcABN3hBBCCCGEXAATd4QQQggh hFwAE3eEEEIIIYRcABN3hBBCCCGEXAATd4QQQgghhFwAE3eEEEIIIYRcABN3hBBCCCGEXIAwxmr/ /lf/5t8WU8tFpvSqQO0L+YhK1ntbBsnwcYwDABs4lfl6W5geEjgY0XJ8ubzrb6AcyQ8NOduurpb9 wE90DigAWMBrTOp1cTqD52DULPCFYjd/lBKSjwxItZQFGE6t9LAAhXDI5nkYrGrZExxQP9GdbbdX y57zE40DBlgt20aABYgGAH6//4//+I97XZxBIGz5mxoqAASJ2ovCdAYzQIZ+abN4oK4OZrsYFHwS +DrT6nk6kh0lgD04wWRQEASIRnr1+66PpA3Z3kWv1kBVy17DSHYKVstOsW2710UYEFunyjAgPSkH Qgi5xZYLlQghhJob2rh4jtq0dcRdVIJqPrMMwz0pTYuiMjl781NiWb0uyFZUkpJnTluWpWkapRQA TNEshPK9LtfuHUodNXJdirMyLmn81oENxpiqVl5Mx3o8A2oXuhlAhxQW7CHTqX5b1FRLoxAqdLNU HTTBT3K3u3flum61pJRqmuZsu7FatmKP4iyPSbqwKZ7VamlIRjHo1mr5qL0+9qVpzjTN2ldqq+Wx O3f37qcHT+KpJ7cEc8CqpQTSxNp+q7iHY95CgIe4/eiwerUTf/LJJ/fu1z1la+IuSDIDcoUd7Ulp WnQuxL388b/mil2d1doKKxr98PXXisViKpUyDAMAVLl8/8Bcr8u1ey8WX7frpYB7QRmStPjW/1PL smZnZ51tN0byZ/wJSV3u5i9SIQBFxpXq3FfwnuLLcBwAlBUXV8uD8oEL9xNd+zlDmZSWtqbmZYC/ DygAAMSV1bIVx/3Hxd9GO/61I9ND68HV2ksW1daypJQGKZgvqd/Uy+b2++2Wbz9z4lZlGMb9+/cB gDD2ytvv7N1PD55PfvTD6giRY2FhoVItA8UBqJYRLvICfUUne3kmGRXgkLnl/AdqOnFB2Jpwot3B OKJmjhhfjv2Hf9fDAmiyPPtPftbDArRJTCZH/+Ivel2KCuFHP4Dhvr6Y1ooUTfU8pEW/H372096W Ya+l7fV/fHyx41/LMvKhFQ1qphq9q8gGN4BTNA9ZXw2/9f/u3feztwiBTVO2coHA/ddf27tfioPv awAAHKFJREFUHGBsVqQPNg8VR8kg5Uca0w7fe2v4zZ93/6dVvzL7sz/q/u8OsAGqmAghhDpEZWp3 TpD4H/8I4rEu/FCXEVMXEslu/qIQ1rv5c4PEytvq4qbLFzTIMD9C/QnXce8oQkRR9Pl8hAzgABJC CCGEEOohPKPsJAZAZiWyxCDCgdjr0iCEEEIIoQGCI+6dRBgz0pa6aFADV4tDCCGEEEKdhIk7Qggh hBBCLoCJO0IIIYQQQi6AiTtCCCGEEEIugIk7QgghhBBCLoCJO0IIIYQQQi6AiTtCCCGEEEIugIk7 QgghhBBCLoAPYEIIIYQGByPkz/703/e6FLvh4yG271KRFrv8u9NCwn7F2vTSDIVyl0uBUEswcUcI IYQGyqVl2usi7EZcgWPja3PW3S7/7lXjypZXTtIzCihdLgZCrcCpMgghhBBCCLkAJu4IIYQQQgi5 ACbuCCGEEEIIuQAm7gghhBBCCLkAJu4IIYQQQgi5ACbuCCGEEEIIuQAm7gghhBBCCLkAJu4IIYQQ Qgi5wIA8gOm2Zf5aVQHggk9+QpJ6XZw+VV4rP3h7iXBw9CdHOZ4035kxVlouv3vrlloqlhgzGAtz XIzjRjj+nCiGOK+f8u0omDpjNy1zybZzlOYoNQGGCIlw3ElRPCqI23x40O0oknXh4V+142AyKCfK ubm8kTeMgsmJnBQS5bgcOxEFTwdy+0gyxu78/C61WKNv+PPVUrCQ3/LiPw8Eh7zXeOqZleSVtwgh k9/4A8Jtk3VYupW9lysuFY2CaasW4YkYEP3j/sixiOgfkIyldU5HXFwqauuapdnUpGJAkEKSL+ob OjK0bUAszc7dzZWWS6wM//bmykixOCXw50RpH893p/xoLwzCYTBnWb9RVWd7AqtjA4yxxBdJAPBF fNv26GpSXb20ZhTMm6sQpJUn8GUpzVI6B9Znhv6qLJ8Tvduxtx5MBnDFNN7TdYNt6uBTjKUovWNZ o5zxA0Xx7InQjqplXXj4V+00mHpWX724pmX06ivUopZqlRNq7m5u/LnJPSxrf2slknrWaJK11yUT Evbgkc5Y9u7nACAGo82zdsZoZuFW9sZMSk89fNVmtqFrGT1zKzvyxHD0eGSvy9s/qh1x7YtGwTQK ZnG5lLmZGTk/Ejk6VP/DDDKz2eRMilEGAAIRKKMFRm+a9KZpPiFKr8iy9+rigHB94r5gW79Sy07z yQMMe7vnbohB6sq6njMAQIlv8xjn/P386sW12jwzSIhISI5WUngb4HeaJgI5KYp7V+T+1XowGXx8 5849Tau+IBISJsRgUGCV06EEtX+pqn/g94vEeyPvO6mWdeHh/9AOg1lYKK5eWq2mnqJf4ETOLJrU ZgBgG3T2k9mEbY96MKStRVJb1xq91cgEv6tzU3djuXszZikLAFJopNl+trV+/T0uvxwbtQGAEBAC IscTo2A6qSejLPFFknCkYao6WB7tiEW/QATOLFYCQm229lmCE7jwdGjLZxljqx+v5RcKzp+EI76g pNT01zOm4efI85Jvz/8ZaA+4O3Ffsu1flMv2xp9jvAc7me3Zhr1+LZ25nXX+lOPNjtXyWrnaWAgy /+rJk8/dviMRAgA2wDXTeH9j8PgdXTsmiu6uQDu3o2Bm7+auLpaCAABwUhSfk3xRjnN67hJjH+n6 VdMAgAS1b1rWWY+dBe0oknXh4V+102AWl4rLH60420OHwrGTUSksAQBjLDubS84kGQVG2T/o2h/6 A3ta8n7TeiRD+4OBcX+Tr/rp1fMjt2bTlP5KLdsAPkJe9MkdLm5/o5aRv3+5uHTL+VMKxxvuytj6 V+9omVW/AISQ+KlY5HhEkHkAYIwV5ovJyylLtQAgOZMMTgUEZcB7ni0d8cgTw8GpICdyAMAoy83l k5dT1KQAkJxJhvYHyeZTwuRMysnaeYkbPhsfOjKk8Mo/Vfbbs3f/RlOzlALARV0/J0p+Dw4YuZ+L a3/Ctv9KLVs1r3j8QnktW7f1nGHkdDWpFZeKziiaQ4437DyozVY/TTiNhRz17b+w7/hXY9LGgc0D PC5KfkJ+paoAoDKWsu1xD8R8d8G0ylbyy+RJmACAl33yU5vnXgcIeV2Wc5Qu2BYALNueSNx3F8m6 8PDfdTCNvLHy8RoAEALjz42Fp8PVtwgh0eMRW7PXr6cBYM22qQdWMNhdJHkfz/uaVbmwovgIeUfX bAAB4EeKf9gD82SoqZulrFnKGrmEur7IaPXMGqTwcKNP5eevaJlVABBk/+lvnkpE1qpvEULC0yFf RFr4+wfUZtRipZXS0OFBHnR/tCN2UnaHc81BkPmlD1YAwNJsPavXVtTCQiFzKwsAvMTtv7DPF6mc fBKAcZ7/geL/j6UiANgA85bl0cvmLufKxF0RyO3vfudXX36pWZYiiiallm0DgHT8scRww6ahC5gs y0MSA8jInLn97ntWDMbmfnWv7vxLXuKkYMO56cUHBbNoAgAncpMvTNQ2FlXHBDHC6c4pe4IOfuK+ 62Cmb2ScDOC4ID5Z745JAnBA4J3EXWU7myzrRruO5KNSlL6plg3G/ISYACZj4LHEfdfBZIwtf7RK LQoAw+eGa7P2qvB0yEncbYAspbGBTjc7WC23sCn9pVrOUkoAvqf4J71QPxlb+eQva5P1Kk6QBGXr jA6HrZcLC18522OnvhYc/iJhrW3ZxxfxhQ6EcvfyAKBnjI4Wuu+00hEH9wWlkOhMf69N3KnNkjOV OwQmnh+vZu1VcY47JAj3LAsA0hs3sCF3cWXiHmLF/yX3tjFp8BK//4Wp+28vOK+vfSsp+rM9LBgB IpE7cBymbu2XSz27KmrkGt41pQwr0PjKWP5+ZUpc7ERUDDY8EY9ynJO4m4Ofbe4ymNRmTh8DAE9K UqOQlzfydS8sNLHrarmFVtDeLJc0xmRC3lCUN8tl5/UJzgOJ0YZdB7MwX9SzOgBIITH6WP37/KSQ NPLE8CFx+qXfziqDfiW9U9VyKwZv37y5ZtsA8C1ZOSy4sqvdKbOUrZu1Q2W4vX40i4s3GKMAEBg/ 6o9NNPpyX9QH9wAAjOKAJ+4tdsRSSHISd+c83JG5mTHLFgAEpwKByfrz3GIcdw8AMHF3Lfe1JrZe +vKD32m2BgJMvTSh6ZrFLAAQFMGWbZvVbzW6RmUqAIxDpfWJ0elXtO91uQwmp6svF2tfuXXls3Ry DQCOhp44op2r+yldLb+79CZjQAi8OPFjRQsCwC8PscyfvrBlz8tv/0IrFQAg9dxrvxvZ26UnOGpF 1i7u6U80J/iFg9/aX/tKciZVTqjQ9DK6tq4JfgEApvRok5HgVbtSXb2wONfuIrmFWbauvnPtccYk Qn6s+KtnPgFCgh44+anaXTAZZalr68726JMjhGuQlhKInYhOSVNPe2BtzY5Uy0elrq3fTZSCAC/5 5NOemY3Ay4HRJ79b+0pu7gs9uwYAUrjRnalMTT1wtgKTx5p8OdtIT5vPUHI7S7XKa2UAIAQeveu0 llGonMBIQ5VhdWazzK2Msx0/HWv0QXnjbHzAT8oHl8sSd9tQk5d/F1ZKnJ9MvjQhx+XU1Uo/pMTl PqyGqyX22Q1r+/06jAfYNAVwdS5n6RQA1jLRzxuUR0unSnQCAAQ5nJ2XAervZpYyidU8AyCEsHKE W97bU3YJ6IWe/rfyEs/HNvUTzkVMaNqv+0eVQ28cBIDvzTxOLn1Wd59Zy1y2bQCIctwRYfC79t1F spalWotvL0bKUQHgh4p/nOc/0itLGfZqvQ4C5BXtf+rFLwNsvjHyvezPVasEAE8HX49r9U+n15YW jOw7ADAUjT8f/UfQdFkUTmd/9qevd6iszQylLvNmcfv99kb71fJR+Xv59a/SAJOnRNELJz9VnCBJ oU13oNpqZfC40QR3ahqWVvnfF4PRJl+upir1VZBdlrfsiJ41AhMBAJBCohho2C/oWd2pqIQDeWM+ THG5ZBsUAOSoT442rL3VmZkDfz1tULnpAKCmnrrylqUWSEDY940p34gPatbkkoe9dcN+62xDtfTK dIItrWotOTYpx7YbPmcsO3vJOegDE8c50XMxt1TL3LglUo7tci2tdUq/NIxrpgEAMiE/UPweGive sNNI2rq9+M6SUTCJSL6v+J1rFCsb1+Un+N40ZYzB/9ODM/OtbENd2Vj6LZOIcOn6RUpfv1tOUQAI ByYWbljAmJ5bU1MPbK0EwAT/kBiIKCMHSXcnHb1AWLNxxe5q/wBXk+rqp2sAEA0EXvPYMjJbtNL1 2EblIQyEcKTx2Jue1Uurla8SlEEecQ9M+AMTzVYrAgDG2NrnSSf9jhyJ8HIlIIX5SiMQPhRuMo6p YeLucq5J3KllpK6+ZZayhJAzz760MPELi1nAQEtXEneljcuag83IJ50N0R/mhN0P/zBqp298oOeS AMAJUni6/pSbvXNMPN7lX3xUejWd5fMAoISVE4GT2+5vjI0n/uiPAODThfl0uVwyDNU0ixvjxPFA 4MKx45bfn9jTQm+wlD5atbd6yi2FJV7apiemJl18d0nPGYSDE994bPof7gMAq5lr5Kk7Ux/VyjHO bEtdX3S25fiUkUtkZi85C2xXrC8BgDB/NXL0me3P4QfUjqrlo2zNXv5olVHgBPL6qVPizJVOF9BN WqmWvFRZKZ8xaqkF8Ne5W5rZbOXjVWfxcgBoMu17L4RIqB+6nipq09mP7vjTfj/vFyTh/PknBFEA AMuw1tcyEu8DgLP7zyripkcQiERUj087ndH81SulQgEAtEOHExMNbyroFB1PDzrNHYk7s631a28b hTQBiD729ZHJA87tqEbBcC4MEQ580T5KSvqKka/cYy6Fdr/kjllMZ25fNArrAMAJ0vDZC5zY7YB/ eOk7Xf7FR+XmvigsUQAIWIdLl76+7f4fAoD/EGN0OfFfGNvob0QAAN/QyPDj33yLdG+0/Wvk6hD0 bE7CFup6q6fc1KKL7y1raZ0QGH92PL6/MnSXoVRnDAAIwJiXJrg/qpVjXEsvOTcO8qLPyCVydz+v e0umpRbWr/7DyBPfkoZG96SsjQ1x4bNSt4cDtriXu2/xFADGxkaPSztL1xhj197/Km7EgYfjzx9T hs6tDnX1MZ9FxsDu/fWfqlaqJSf6eJ/f1ssAkJ+/Mhb/xpYdzJK5dinhPA/LIe/qYW27lkpPzKw3 m3zfTRsdcQwg5nTEFy9XYqtlVlIPsgAg+Pz05g8fncH+DgD4jwCwZTNBxWEAuDTyLcnf7KlYHeED 81WoP18U7Y4LEndG7fWv3nEGeiPHnvWPHaq+VR0d8Q35OMHTPXcTD1vPxsvoNmFrxfzCtfLKncrz KSVl+NxrYsBDz52utbtgmsWMs2wCIQRY5TqlnkuuX3snfvql5o8B3wuhPsiQrmSviLwEAEfHj05I 4412ozb96v3r4XQ4zIePPnt04ti4n/Ov/vf/HQDcXlkp3rgBAMOh0Pozz3St5ABQphQarJ7RE61U S6cJBQBqmc4j6P0jB5Xh/WIwxvkUq5wvr94tLd9mAAwgfevjsaf/UZdrZjI98uXFx7r5i3XKMPNb PScAQMb/7IOLO0vc8/dm8gsRgEhg7LCR/Pr/nASArp78+EF9icx08xeba7G1VIb3Ow9pKifuL1+2 xkcLdsBmDPSMrqbUzK1s7aopYlAUZC9eXtu2I34Y7aGxJvedWmqR2hYAEEKa31SA+la/J+6M0fT1 951HM0SOPBWY3NSSqjjBfVuMOcPk0Oy+/vosNV9Y+Kq8Nseqa3eMHxk6fN6DU9srdhtMMRidevEP CccDEGoZanI+e+czRm0tvZyd/TT62Nf2prgNpbLxLy6e6PKPbsLY0uUVRmMAUFr49vV0/f6DMZr+ 6j11PQIQiRx56nr65PWLAAC/AgCAbPpikeYAIBg4/pb5dLeKDgAgg/YK+bKbv9hMa9XSKKQ2dqe8 zx89/nztfBgpFJdCcTEQycxeAgBLLRiFtK/rg+491kZrqaWXCwvXAED0hyPHnu182Vyn5WAOHTqv rS85t6iWkotf/e52hmZqd/CPKpzIFZdK4Mk5sS12xObGAd48HXcW+XF26/6YEeqI/v5vYyxz40Nn XmZ4+vHgvq1Tiqsj7krMcwdzi8xSxrk+Tji+9WFyamq5ezPVk3sAkEKxyNFndzdmPzB2F0wAIISD jSkxnCAFJo4RTkjf/BAAymv3IkefIT26t7JXWorkdof/w7Sg8S3XXtBKMBm1zULa2SaExE+/XDdo gcljhcUblloAALPoucR91we4rZfTNz5wWsvI8ee9djjX1XowCS8Mn3stO3tJy6xseYvjSexULHYi OvcrZ+VxULw0SLejjtjYOMCbJ+5aZrnyVWFvHd2DpK/bl+zspXJyHgBC+06GD57Z8i61mZ6r3OTX zoK7g61mlmEcWrhHhDFaWrqVv3+F2ubGB2OhA2eV4X246utOg9mEHJ9yNhijtlEWlDq3ZA2wViLZ /PBn1DJLlWG5nQ6ODphWgmlpRWeyFgCEDp5rfKpDpGDMSdyp0XS1yEG06wM8e+dTahkAEBg/4rWz nUZ2FExBCQ2fu6Cll2UtGYul9LLG+3h5WA4fCAl+QU2qllaZmeYslTjwdt4RM2pWDlixwRNqna/V N86OamcdI3fp38SdMVpamwMAAqBn1xJf/G31rU8X+QV53rKsjZ4IVj5edSqzEldGn/J0L77FjuZk m8X0+vX3rerKu6F4+OA5OT6JKbujhWAyY2MmsRiKNbkQSWpupiT84C/ivsW2kWxy+Fd2oLR64Th9 4wOnhkqhkcixrk527wetHOPVLJwQEpxqNo+8+uRL3rfNmnSDZ3d3sKipB84jhDhBGjp8fk9K5kI7 DyaRY1NxZerYmSXB2nTHWnGxcku9Epe7vKRMT+yiI6aWWW0PSeN1I7TUA2qZACAoISnU8AlNqM/1 b+JuFtJOF8IAjGK69q2CyKk+jbKHN6xomcrQu3/Mc51Nc/rGglzbtp7a+uL69fedmAtKaOjQeWVk P6bstbYNJrXMxMxvne3Jr/9+k8TdKuedDU4Qeclz14u2jWSTw/9R1R18kT1f2qwPtXKMV0fjBKX5 mrCseh1DDHquX2+9tayitpm986mzPXT4Se/e//OIXQSzLtuwc/cqrWX40OBfmdxdR1w9wAkhXOOZ WqXl286Gf+wwdu7u1b+Je/V8fUc8NQFuW9QyHp61N51OUFqZzd6+6Jywh/afCk8/3uWHsPS/VoJZ bT0BoPmS+WrSWdEU5Jjn5iC1EsndHf4evAejxWOcmpWhjebHtZ5NWFoJAASfXwp7686B1lvLWvl7 M85Shr7wSGDiyF4Vzm1aDKaaWrC1MgBIQyONpm+tX007iz6LfmFo0BP3XXfEbOOJFowxRu26Y0Z6 LqFl1wCAE8TgZB+tTI92qn8T9+C+E8F99Re+uHBM+DyUvfWLWUu1AGDfy1PbPmnMm6rPvxB8/upz Lh5llnPZ2U8ZAOH4+OmX5NhUtwroJq0Es7a5tNSCUO9hIgBg6yVn+TMACEz2ywrBXdNKJJsc/o6V j3/uPHNx+OwFzz4tCFo+xqunkWY5B4zVnXPMqJW5/YmzHTpwxmvnky1GspZZTJc2DuTIsWe9FrEm WgxmaXnWuSE1OHWibuKu54zs3cozwobPDRN+kCPcTkdc+1gVq1yoc38qY9nZS85m+OC57j+GBXWQ W9c+t8qWk7UDgBzHKlhfzSzDJgNILHv7E+fGtfipFzFrb6SVYPI+pZohVVPzLSw1n7r6tnPLkTK8 34O3srVWLZux9XL1SekeHGWv1WIwxY35rIzahQfXH92B2Vbm1ifOKKkUjAUmPHg+ueNqmb9/2Rkc VeJTuCR2rVar5cZqM9Wng9WyytbyB8vOlNjgvkD4YMN7LgdCWx0x71OqUy6LSzcf/fL0zY+cxyQL SijQ9C4X1P/6d8S9OXV9o9sOibt4MLVHVFtPsfF6eeXEvPNkFt/QqBiI2Nr2T9bk5YAHx5ZaCSYA kUJxZwypuHwLCAkfPFsZ22DM0orl1buFB9ed1llQQt1fwb0ftBbJlr5BUELNpyQNvBaDKShhKTzs 7Jy/P8OoFdp/2lm1kFqGkUtk73zmLKTNS3L8zMttLprkRjutlmYxo64vOdvBfaf2qlju1GIwq2fd llrI3Pwocvw5AAkAqM2KC4XETMrWbQCQo76J58YHu89puyMmysjBynOsVu8KcjB44DQhHACYpWxu 7gstvQwAnCAOn3mVdPFx3WgvuDdxb/V56R7Gqo9c8TUelSyvzTkbei6xcvEX234pL8oTX/9JR8rn Ki0FEwDCB8/q2VXnBv/i0s3S0k1eDhBetNRC7ZCSFIzFz7zsyaSz1Ug2Ub0Q7/P2QpA7Cmbk6DPJ md8yajPG8vNXCwvXeDkIANW5yAAg+sPx06/wPk+suLfZjqtlfuGqsyGFYr6I566bNdVqMJXhA3Jk zJl4XU7Oq6mFcjikLlxfyS9Tq7JGihKXJ1+c5MQBzzXb74hDB86oiXnb1BhA7v7l/MI10R+2DdXe WFGK44X46ZcbTeBELuLWg6E64o4ruDdilvPOwk+EELHBwk/U1PVHnnnRnBSOe3C4vZVgOqSh0diJ F6r39TMASyuZpWw1a+d4IXzgzMj5b3kyPdpBJJuoPnpp12P2g2FHwZRC8eEzr/Abc1sZY5ZaqGbt hJDg5GMj57/jzX59p9XSLOe0jfvLQ/tOebBJbGIHwSQkevIb1XF3xphRypezZSdr53gSOxndf2Gf IA/4RfWOdMS8pMTPvlqdMMOobRQz1axdDERGn3rDFxnvSIFRb7lyxJ0xpqUr1RET90YeXqxs/GRj NTlfXfy1RVLIi1OKWwlmlTI6LQ2NllbuGIWUrRUtrUQ4jhNlMRCRY5PK8AEv3xi0o0jWt+lR6l6s jVU7DaYvOjH27A9KK3eMfNIq5y2tyAmiIIfk2KQydkiQg3tc3v6100gW5q857aYgB5SRg3tZNPfZ UTB5SRk9/+1yYl5N3LfUPLFKoiwqfjk4GQhPhwW/K1OUnepURyyF4mPPfL+0dEvPJ61S1jZ13ucX A5HA+BE5NuXB+W+DypVHBSHksd8/bjGr1wXpa4HxI4HxbZYnC0weD+CyUC1oJZi1eJ8/PH1u78rj XjuNZB2ETL340w4Vx912EUxOkEL7cUL2VjuNZOzkC7GTL+xdeVxt59WS+Een/aPTABBX4NiZ38xZ d/emaH2qgx0xJ0ihg2cH+zZe5NapMgghhBBCCHkKJu4IIYQQQgi5ACbuCCGEEEIIuQAm7gghhBBC CLkAJu4IIYQQQgi5ACbuCCGEEEIIuQAm7gghhBBCCLkAJu4IIYQQQgi5ACbuCCGEEEIIuQAm7ggh hBBCCLkAJu4IIYQQQgi5ACbuCCGEEEIIuQAm7gghhBBCCLkAJu4IIYQQQgi5ACbuCCGEEEIIuQAm 7gghhBBCCLkAJu4IIYQQQgi5ACbuCCGEEEIIuQAm7gghhBBCCLkAJu4IIYQQQgi5ACbuCCGEEEII uQBhjNX+/b/9u79IP7jdq9IghBBCCKEB873vfe/pp5/udSkGwSMj7pvzeIR6jmGdRAghhBACELb8 /cYrz92/P9aTogyScrmcSCQAYHx8XJblXhfH3ZaXlw3DUBRlbAxrZluq1XJiYsLn8/W6OO62tLRk miZWy/aVSqVkMglYLTvBqZZ+v390dLTXZXG3YrGYSqUAYHJyUpKkXhdnEIyPj/e6CANi61QZhBBC CCGEUB/Cm1MRQgghhBByAUzcEUIIIYQQcgFM3BFCCCGEEHKB/x9iaPK21UfXJAAAAABJRU5ErkJg gg== "
+         id="image2454"
+         x="181.23958"
+         y="89.791664"
+         inkscape:label="VisuImg" />
       <text
          id="text1028-1-4-3-1-5"
          y="109.58816"
          x="184.07834"
          style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.52777767px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-         xml:space="preserve"><tspan
+         xml:space="preserve"
+         inkscape:label="VisuText"><tspan
            style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222223px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
            y="109.58816"
            x="184.07834"
            x="184.07834"
            sodipodi:role="line" /></text>
     </a>
-    <text
-       xml:space="preserve"
-       style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.52777767px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-       x="190.76848"
-       y="87.178818"
-       id="text1028-1-4-3-1-5-3"><tspan
-         sodipodi:role="line"
-         id="tspan1026-2-99-6-2-1-7"
-         x="190.76848"
-         y="87.178818"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222223px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px">Textual logs</tspan><tspan
-         sodipodi:role="line"
-         x="190.76848"
-         y="90.272514"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;line-height:2.91041636px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
-         id="tspan2707-0-8" /></text>
-    <g
-       id="g2521"
-       transform="translate(-2.9999912e-7,-7.9374984)">
+    <a
+       id="a6161"
+       xlink:href="https://framagit.org/simgrid/platform-calibration/"
+       style="fill:#ffffff;fill-opacity:1"
+       transform="translate(4.7625068,-32.198834)"
+       inkscape:label="CalibrLink">
       <rect
-         inkscape:label="#rect1020"
-         ry="2.6458309"
-         y="89.791664"
-         x="63.5"
-         height="21.166662"
-         width="51.59375"
-         id="PlatformBox"
-         style="opacity:0.93999999;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
-      <text
-         id="text1028"
-         y="94.176186"
-         x="69.055466"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;line-height:6.61458302px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-         xml:space="preserve"><tspan
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
-           y="94.176186"
-           x="69.055466"
-           id="tspan1026"
-           sodipodi:role="line">â–¸ Resources</tspan></text>
-      <text
-         id="text1032"
-         y="103.17203"
-         x="69.055466"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;line-height:6.61458302px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-         xml:space="preserve"><tspan
-           style="font-size:4.93888903px;stroke-width:0.26458332px"
-           y="103.17203"
-           x="69.055466"
-           id="tspan1030"
-           sodipodi:role="line">â–¸ Routing  </tspan></text>
-      <text
-         id="text1036"
-         y="108.99284"
-         x="69.055466"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;line-height:6.61458302px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-         xml:space="preserve"><tspan
-           style="font-size:4.93888903px;stroke-width:0.26458332px"
-           y="108.99284"
-           x="69.055466"
-           id="tspan1034"
-           sodipodi:role="line">â–¸ External Events</tspan></text>
-      <text
-         id="text1028-1-4-3-0"
-         y="97.87088"
-         x="73.476288"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.52777767px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-         xml:space="preserve"><tspan
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
-           y="97.87088"
-           x="73.476288"
-           id="tspan1026-2-99-6-3"
-           sodipodi:role="line">(CPU, Links, Disks)</tspan></text>
+         ry="1.7087632"
+         y="121.54166"
+         x="82.549995"
+         height="10.252593"
+         width="29.104166"
+         id="rect1020-5-6-3"
+         style="opacity:0.93999999;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+         inkscape:label="CalibrBox" />
       <text
-         id="text1028-1-4-3-0-8"
-         y="102.87907"
-         x="93.981499"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.52777767px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-         xml:space="preserve"><tspan
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.17499995px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
-           y="102.87907"
-           x="93.981499"
-           id="tspan1026-2-99-6-3-6"
-           sodipodi:role="line">(paths)</tspan></text>
-    </g>
-    <a
-       id="a6158"
-       xlink:href="https://simgrid.org/contrib/R_visualization.html"
-       transform="translate(3.9099913)">
-      <image
-         width="27.781256"
-         height="16.668753"
-         preserveAspectRatio="none"
-         style="image-rendering:optimizeQuality"
-         xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAAJYCAIAAAB+fFtyAAAgAElEQVR4nOzdWZAkx3kg6N/jysj7 qvvq+z7Q3WADxEUAhAiSEkWRQ2k4EkezNra7Zjsy25d92JXt05rtw5pGtvsgM+08jK30sDPSzshG JzWiSIKAABBAN9BAX+ju6u6qrjsrsyrvzLgjfB8iKyq7OisrqzKrMjPi/1468ogob08Pjz/cPdwJ pRQQQgghhBBCvY3pdgIQQgghhBBCO8PAHSGEEEIIoT6AgTtCCCGEEEJ9AAN3hBBCCCGE+gC35fXf /uJvF5bmu5KU3uEvhhiy+1saloJICSEAIMuyoiiaRVgxyAv+zidxHwzKeV5Tu52KTbogqOEwABQK BYMYlNBAvD9ysoP8pRDTxt215TdYlnVeSpKkKIrBGHyA58Wt575rsBYnVgIdPCANmAzz1K9AKS0U CrpFKGHEcKKDf+sgDSp5Xu3aKV8SEgzDAoCkSaqhGILu7mLZHAHiLwXJHk52jhKxtmlZVrFY7Pdi ucWgnOM17WD+li4IOmvY25JmKLrJmRBh2QCDTZy7UIrH6687tkQiceXKlYmJia4kyWXIllll/vg/ /PHa47VupQYhhBBCCLnMd77zna985SvdToUbNGreIPTz5z478JT0kN+5/t8Vv6zudq/YxaB8rKhp GgCsr6/XNiD2GT3T+STug/+bfDz87/+fbqdi09oP//lnZ88YhrG6umq/8/mlT7ubpIO3t6LoiP42 VyqVnJdOsSxGCjNHH3UgfT3p7cC3+D+Od/CAW7IRAAzDyGQyAABAfkK/2sG/dZC6e8p/8N/8kV22 108v6n4VAPLR/JMjj7uVnu4a5UZf/cdvSgu77gAZ+UY8LSzb2+4ollscZClN//f/7fT9/2RvPzn6 Lc0XBYBjs7Nff+fdg0mAO3zwf/5hfYVpWZZzEUcd4dF+SYSQWxEgoROdHFXl8zGhUKj+He2g+u4R Qqi/iKJojxm21be+oY7AwB2h3uUb4aNMcM+787wVjUadl7lcrhOJ6nUrxvJ33vmTDh6Q/oIh1Kp/ pyKKc998u4N/AiGE3EG5Totf6s5LizfhfBeT40IYuDfABpnohV1HS0KSZ4JBv98PAPl8fh/ShTzn UO6z4T9to5v4T596tf7931AGBtpMUu+zwOIy+/ugDhfo5MOvCGlUO36lIgyv7HZH08pNZMr2doXS TKcThhDqNRi4N3BM/6KtaAkg+91fl4eHOpUehBBCLqZRLfzJtfiP/76dgxQjEfjhb3UqSQih3oSB O+pR1O8fMsd0U18FHB6HkNsEj4n+SQEAirkVXd/x6wghhAAwcEc9i8hy+ud5wzLhQreTghDqtGqw WDJLAGAQo9tpQQihvoHLCiCEEEIIIdQHMHBHCCGEEEKoD2DgjhBCCCGEUB/AwB0hhBBCCKE+gIE7 QgghhBBCfQADd4QQQgghhPoABu4IIYQQQgj1AZzHHSGEEEKogfvnXvz0ld/tdiraMjr1aYWWD+zP jXMr8MbmS0u34NMD++OegIE7QgghhFADOZnelKxup6Itb04Wv9TuHtifu6Pdrn/JG/wFuHRgf90L cKgMQgghhBBCfQADd4QQQgghhPoABu4IIYQQQgj1ARzjjhBCCKFepE5Nrf6b/+Fg/pYyPh4gr9rb DA0czB9FaLcwcEcIIYRQL/rbkekvEwf3YCXEa/+eeZDwK/zB/V2EWoZDZRBCCCGEEOoDGLgjhBBC CCHUB/pgqIyUlhbfXSYMHP/BcYYlB7avG1Cq5Jbl9SWtvG5psmXorBjkAxE+GA+OnWB9weZ7r1nm fV1fNM2iZemURhkmzjDHOf4Mz+MNn628UEl9nKIUhp8fjJ2ItbiXl4vlws8W5ayy49eiRyMjLwzv bV/hpG+Piet/aj61dvsdQsjYqz8kzM7VO57jT6EgZaTibEkraVpZZ3hGCPNiUkycjrM+tvXDePkE b0Jem8/d+4ACxI5fDY2favJNU5Ol1GM5t2wqlV/OPsjxWf+gP3Y86h/0H1hqewlVC+lq6rEhFQ25 TFieC0SEcDI8eY7hd6jr7Jy8Vbg9X5wzNYsTWW/npEv0euBOKc18vgYAvphvtzVgO/u6gFrM5Kc/ NuSn1ksz5LIhl+XscnnpfuzY88Gxkw33rVD6jiLPGEb9mznLylnWjGFc19RfE/1D7C6uZK5UXamm PklRCgAgJsUW9/JysdQreiuRNwCIia352fq+oURo1ylzB0oLMzcAgA/Fd4zaTU3+Q7g///VDDT/1 R/wnXj4eTOxwb9+OcW7ZilkAYBYN0Pbv77RKLair19JKXnXesQzLkA0pIxdnikNXhiKHw60cx8sn eBNKdjl3/0MKAABCZGD7L9LK0nRx9nNKa2seUYvqkqHPl0vz5fiJ2OCVAUI8lKt6NZ9/8JFWyW++ ZRqmJquFdDX1KHb8hcDwkW123czJ8njZME0A8HJOuklvB+4U1m9n1aIGAP7kLm8Q29m3/0np2fyD j2jdO6wvwLCcIVfsCpFaZv7RdcLyz572q6b5l7Kk0NreBCDGMAFCLICUaQJA3rL+RpZ/FAwGPHza S2lp5Zcp++LCsMQXa62V19vFsjRXavGbYnxrfra+byjZUoDlOrT45KZeLQCAEB5s/lWtnM3e+YU4 tJw1swBAGOBDAudjKaVKVqEUIA/pd1cPvT3Fivt1f/5If2hvnLHO+aHLM3iUFyqr11cto1bp8QGO 4Rm9olsmBQBTs1avp4Wo8Gyx3MrbJ/h21Hwqe+99SikAEIblQ/HG36M0d/9DaW3efkUIw/lDvMhD tfZ5/lGBFdnkucRBJLoHyGvzuQcfUcu0X7K+AMMJhly237EMPT/9MR+M8qFnMmRLTjJECAqWZhpK 7VBey0mX6d3A3dTM7N1c/mHBfikmd9H93c6+LqAWVp2onRXE6NEr4sAkw/IAQKklpR4XZ7+wTB0A ijM3/INThNm8Nhcsy4naBxn2ddE3znJs3af/n1SVKC1T61NNfd3XajOzy8hr8vIHK/ZFHQB8CZEw O9/DeLxYAoXSfK3/Z/LrE3ygWeXDBZ/+dDf7huL72E7cmyxDK83dqixP2y+FSLLJlw25vH77HcvQ AECM+wYvDfgH/U4B1iv6ws8XDcXUJSN3Pzd4eYd7ABeoLFdWPkrZ29EjkcSZuBARAIBSWnhUXLu5 Ri2gFs18vjb11kST43j9BN+GVsys333PiT6FcIKQxuOwCjM37FiT4YTI4eeCYycIYV58IXRj9bPU J6taWQeA3L1c7Fh0/+4ne4e8vpi994G9HRw+Gp46zwUiAACUVpani7M3KKWUWoXHnw5e+uaWfbfk 5MvfG71nfAkUlJziwZx0n94K3E3VVIuaVlTlNaWyXHECI2hhKEI7+7oJtYz89Ce1HslQYuDSN+yQ 3UYIExw7yQhi9sv3AcDUFb1aEMK1yzwF+Jmi2FH7MY77dX9gS/0aY5gXBd+7qgIAK6Z5IP+hnqPk 1aX3V5zGOQDwJ7a9QmOxdMhZxb5g+AfEwNDuGiN3ta9H+n8tXdWrBb1a0IoZObvkBEaw01CEwsNP 7Kg9OZmIvRjZkl18iE+cTdiDPeT1lsYmdUpcPz5Q+vWD/IsAUC0Xb7z3X8eNQ0DImSuvjEwdBQBw endGYHbqi/npOwDApNivFH9nS3bpmlotFSqlfDGbWU8tBswhp+/gReF7gVKkxWT4OEK5v+7Ef6i3 6JXc+p13nyqc4caFU87MVZYfAADDCYPPfWOzVZ6AmBTHXxub+4d5SsEyaXVVanHYUv/SpWL+wS8B gADET78cGD66+RkhoYnTlq6UFu4CgFbOAaVQVyyfzUnCLAN4NCddqYcCd0rp7N89qY+HHKzACCFh n/Z1GXltwVAqAMCwfOLsa/VRu8M/MMX5w/bwd72ScwL3VdNcNA0A8BPyTdHfsFUkydbeLlnWvvwH epta1JbeW7Z0ixNZy6CWYQGAuE2fOBbLeqX5WjQUPdJqNNORfd2J0tQnf1kfDzkYTuD8216MtVJW KaQBgOXFE18dmoYHz37HF62VTF0ynv10/6Sr9IuZg20OoDR94z29qgFA9MglST8EzyTAMA+v5m/b m4W7hVqr58buyx/+xXa/gpQOQLrV/07UR37V0PfyX+hherWwfvsdy9RZQaSmYZkGbHNXSS2jOPu5 vZ04/cqzY2mEiBAcDVZWqgCglXvgkYh9RWnu3gd2dkWOXH4qat8QGD5qB+7UMg257BRLzEkv2Bq4 M1qEQPYN5X86+KSUCzlN+XHDjwYHxq+ob+3Tvs8yYge43EOnSekn9kZo8myT67cTuFNz89r8eONp 1CmWE7dptsxvxOsR5qCnnYgy0QP+i1toFW35vRSvcaLPd+iVqdlfPAECADA8NMQzDW6Q5LwimAI0 ysjwYDjKtvDfYVzSj0ktWp4vAwDDkvDU7tp42tnXrfRqoWG8CLXAaNs+B3l90d7wxYY5QW/4VKjd uQEAzYckuYCUmbOfCuD84dDkmYbf4QLh6NEr9vaWSTz2/Ct4gSGX12//3NRVhhMSZ15du/Vz+/2G gXtl8b6hSgDgT06IyfGGBxQiAtjhZsnl4WY7xRJz0gu21ss6ZS0K//n+gTa02CxDNKaeGqpVnP1c LaQBIBJKPG6apHb2fdYbJL/zl3qSqclqPgUABCC47cPmAADObDNccHMSw+JGUO40q29BAZ5sBPdH uIO+qIeW/vUB/8V6mlyd/fgfGTng5/iTF37FWFaE0rsAwIv+ePYHkGtwkRZ19bmLlfp3lu7fKGfT AJAceS60dHHHP0qZax1KfpdVU1VTswAgNBFidjnTYDv7uhUrBoeufLv+HafGEyLNRqWbSq1AcsEY wFqDb1CortQeBgyOuflpAUqt0twtezt2/CvbDbwGIOHJsw0/2POv4HqmWl2/9TNTUxiWH7j4lqXV xlyxgp/1bX0QmVpmeemevR0+dGG7Y26e+66+IWqnWGJOekQPNagwnOCM2bCZG8Fl0yGb7e7rJnol b99kc/4IK247KZ5ezdv5QwgRNrrS5FOnqt/+ViWVAoCHg4OHLzQ47e+vrNx+8AAARJ4ffvHFVWEf B3uooyORcMAwjfTGO1+kuzY4x9TktZs/NeQKYdiBi288VBOluVulKgUAvz/5RYYCNBgPA8BvrqAN AACr6ZKhUgDQzWS6hf8OIV24hd4Ppbna+Rg5ElGySuFxUStpakljWCJEBV/MlzgV57Zp321nX7fa c41H2FpG6ZVcwy8UZ4t2NzrrY2PHutzHta+U7JI9qlAIJ8RE47bJ5vC605CpyWu3fm6oEmHY5IU3 hXDSiUQbdkQo2WXL0AFACMWF8LbznJiaM7mKS/ohG2qnWGJOekTvXu1MTbZ7fABgS+W4r/v2NTEx JibGdvgSpYVH1+0wMzh6kuFrj0j+OHrzo+fnV6/bcfLi33ML8RMxsjEPsamY63ezxXyRDgHDkok3 xv/t4Gf79L/YlATO4C7evbzvf6gpS1fXb79jyGVCmOS5133RIQDQSuv2p61foT1bLE3NrCxXAYAw kLufk9Ky85Glg6HIUlouzhST55KJ0/Etl/V29vWO1ouWEB2qrs4AgLy+uHSP0iN06zk+UwQAhiXj r466e8YJOVObLE9MTAAAUKoW0/L6oqlUASgXiPLBmH/wEGl5uJpnT/B6e6gtpUxteGdg+FiTRmBL 3Qg3BSyWjYsl5qRH9G7grpVq3bh8IMJwu2vZbWdfd6OWmbv/oVpcg9pEUU+N1ogeichrcvFJCQDW bq7n7ud9UYHhGK2s6RXdnthdiAijL43sPJ+xW1iGtn7nHb1aIIQkzr66cV9EtbJzKWq1T9yzxbKy WKEWBQBqgR15cyLLipylm4Zk2OXKMujarXUASJyJd2pf72i9aAVHjmqFdDU9CwBzX8xl72S9eY5T 05CzS/a2mBzXipn8o+v2wOKa7DIAcPN3Ysev7twaAgAePsEde6gtLUNTssv2dvN8dh694Nx7P9lO scSc9I5eDtw3TvVtZo/ap31dTK/k8g+vaeUsADCcMHDh61sXTCYw/MKQVtbsaeBM1ZQycv3ngSH/ +NfGGM4r44ypaWTvvquVcwQgfupl/8CU/b4hle0eSUKI8OziF9vonWKZtI5OKgc37971Rz8RjYy9 PTQ2efzsc6Fo3J5WzzSNhcfTs/dvGYYBAOxN9qXRf+YT/e3sGzAB4M8O7H/XC3ZTtEj81EuGXFZL a+Dhc1zJLdvPlbK8TytmijM3Go51M+Ry9s4vBi+9LUSHdjxm75zgXbG32lIrZ+01ATlfgAts/+g5 BXtZKwDwxV07kW47xRJz0jv6IXDf/WDBdvZ1JVOplBbuSqnHG6sy+QcuvsXXPZZqU7JK5uZ6k8mb pYy8dnN96PlBL0yVTS0z++V7du9E7MRTK0tvNq0F486g4R31TrFcqdDPD+oBdFOppB6sAgBh2PjJ F4vxo49SAKn6uThOyXFf9v6HAABgLX40Fxw90c6+z4+yBz0ZeLe1XrS0crY485laavRYKgB45hy3 z2sAsAy9MHMDAAKDh/wDk3wowfj8hlSSVmeqKw/th1dy0x8Pf+XXCLPDmd47J/jB23NtuZlp0eEm ozv0qm7PvUsY8Lm3L6idYok56R29GrhTajcMwx4ez29nX9cx5FJ54UspPWsvNw0AwZFj0aOXnaHt jtVHq/Mf16aKCwz5o0ejvpjAh3hTNdWCln+Ql9ZkACg8LhKWDLl9PUVKrdy9D5T8KgDEjj0fHDtZ /+lertBeLZYML46++D0AICy/tYdng3/oED9/R5eKAGBIpY7s6yEtF63qysP8o+v2ti82fPJlPhAU vXmOO4M3KLVYXyB+8qv1owuEcFIIJ/lgzM4uQy5r5ZyveaO7V09waK+21Dd+iGdnHK8nZWoPD/hi PoZ17S1lO8USc9I7ejRw16t5u8OIMOyzDcP7t6+bWLpSfHLTaWUHACGciB1/oWHtWV15+PjxDAAw PDNydTg8GXLu2BmO4YN8aCyYurZqz+9ReFRw+TwelObv/9Ieaxg5/FxoYutMuptX6JYfQfNssSQs x7LbTnDkfIsPxe3g2+7tbX9f72ixaDlRO8Py8VNf9Q9ODR15d01Lg/fOcWqZerk2qQ4hJHnu9YYn cnDsRHnpvrNQXfPA3bMneJu1pbbxQzQPN6upWrjpH9zdost9pM1iiTnpHT1aL9cNFkzCLnts29nX HSi1qsvTpbnblll7BkUIJ8JTF/wDEw170ExVKszciI0CAIy+OByaaBQqERh+fqg8X6YUqAVKXgkF doyo+lXh0XVpbR4AwhNnIofOb/mUWoZerc30v5snU71eLJtzOnxZYes0z/u6rwu0UrTsc9zejp9+ yRl//BTPnOOGUnHu8cKHLm5/+02EUMKOkJyZyLfj2RO8vdqSWnotY/ntlwukFpXStXAz4t4l2Nor lpiTHtLzgTsOcN8lvZLL3vvAWV9JCCcjhy6KybEmg97KC1/abUXRo5HGUTsAADA8w4d4+4F0S2/4 zIwbUGrZc24QALWQznz+D1u/YFnOuKPc/Q/tfBXCg7ETV5sc1uPFckemVrucNFnudz/2dYFWipZz jgdHjjWO2gHAM+e4E+4QQkLjp5p801kY9dllg7bw5gneZm1pGbrzKdlmLBwAVJZqS7AJYV5MuPZ5 ynaKJeakp/Ro4O48O7WHSrCdffudkl3K3vvAPqs5fzh65LJ/cHLH5dGU/Iq9ET0SafY9CpZRqxrc 2ocOAHo5Z2cgBdC2WaTG4XzBZ3dYbM/LxXJHlFpacQ0ACGF8iR1ysoP7ukMrRcs5xwMjx5odyxvn uNM2yfmbz9tIndZifqfJo7x5grdZWzo/BCGE2f4p/8JMbT7EyOGIi9dqaKdYYk56Si9WzZahbTYY 7/Ipn3b27XfV1KPCw2v2VTc8eTZy+LlWlg6h1HJWQedDfJNvKgXVkA0AIAzxxVw7S7HTcrYrza/W 3iyWWjm7futn9vboS7/ZZPodOTNvD+sSk+MMy7e5r6e0UrTqz/HmnRIeOcctXbU3mteQaiFjKFUA 4HwBIdLsaRZvnuDQdm1JzVrLMaWUWmbDeXuKmZK9gAMrMLHjbl7Kt51i2UpOymuyR3LS9XoxcHdm j+J8AVbY3fMT7ezb13SpWHj0KQUgDJs897XWl0qmdV1setXg/I2LBDVp+lN7UVUIjgVcvOJaaOJ0 aOJ0ky+kPv4vpiYDwMCFr+92ZRZPFUuG5S2zNumkXsltNxO2pauluZsAQACcFcHa2ddTWila9ee4 qVS2/ZpnznGnOVOXikBpwyHp1DLyDz+xt8NT55v3W3rzBIe2a8v6qaIMqdzgqUpKZz+dsTeT5xKs z7VlEtorljvmJKU0faNWSl2fk67Xi6ts1A0W3HXTRTv79jNaePiJ/VxL8uxrrUftAMDwgtOzVnhU gEbjWi2Tpj/LKDkVAAgDA+c9upo3AJiqZF+HYDd94t4slqwvQEithikt3IVGZcvSlezd9+wGpNDE GT4Yb39fT2mlaNWf45Xl6caZ6aVznA/XBhhQyywv3nv2C9Q08tOf2I3oQijhLCywHW+e4DvasbZk fX5WqI20riw/eOZzmnvwUbUgAYAQ5mMnXD5XTzvFcoecpLB6La0WVPBGTrpeb7a4b0xH2vJcex3Z t39JmXl74QZfdIgPxpxu8SZYMbhxs078g4eqqzMAUJovA0DyfEII1279TdWspqT12+u6VGv+TJ5L +mLeXbXBKWCcP9z6qubeLJaE5cTkuLy+CABKbiV3/6Po0cubT1PpqpSZKy/cMTUFAMT4aPTolY7s 6ymtFa3Nc1zKzAFA5PBFzl97oMWD5zjnjwiRATvrSnM3qWWEJ8/Zw7EsQ9OKmcLjzwylAgCsICbP v77jLDHePMF31EJtSfyDhyrL0wAgrc5wYig0dc6+Y9erheLs50puBcaBFZjx18YI4/JB2e0Vy2Y5 +eV7X5YWywBeyUnX68HAnTprEPh2/ZRPO/v2MSk9a2+oxUzq2l/v+H2WF0df/oHzMnLkkpJbtrdL 8+XSfJkTWc7PGbJhKPWrVEL8ZCx5doeHtNzN6RP37aJpzaPFEgCiRy6r+ZQ96EXKPJEyT1jBz/r8 lqGbctlp+A0MHY6f+uqW8KidfT2j1aJln+P2fY6UmZMyc6wg3swtLJQXvHmOx45fXbv5U2qZlNLS /J3ywl1WDAGAM1QdAPhAJHnuDdYX3Olg3j3Bm2ultgxPnZcz86auUIDi3K3Swl0+EDE12dyYYoXl 2LGXR4WIa5+4qNdOsWySk4HxAgAwHDP2ildy0t16bqiMLpUsQwcAQojTc3QA+/YvS1fVfGpXuwiR ZP2QTVbwD156Ozay2X1mKKaSV+uv6KzAjH51ZOjKoMcfRXcWE2m9ac2bxdLGBSIDF9/iA5sPQpma rJVzxkbkzfoC8VMvJc688uzTVO3s6xGtFy37HBfjI847pqZUclXPnuNCODlw/g12Y2QwpdSQy054 RAgJjZ0avPwtLtB0oi0A8PYJ3lwrtSUr+JMX3nSGeVDL1Cp5J2rng7FLv/pcYNgr6zO0Uyyb56Qv 5jv0zUnv5KS79dwFb7PPMRTf7fW4nX37l7w27zx51iIhvLVZiPNHzr94Tk3JhZmiVtaNqm7IBqXA 8Iw/IQbHg9EjEYbvudu8g/bUqua7HuDuqWLpECKDw1e/I68tSpknplIxlApQygh+IZQQByb9AxNN 8qSdfb1gV0WL80cGLv6KVlqvph4ZcslQqnaA7tlz3BcfHX7hN6qpx1ppzZBKhlJhOJ4Tw2JizD98 hBNbXXzK4yf4tlquLYVwcvjqd6vL02ppzagWTF1lfQE+GAuOHBMT4/7wu6AdSIJ7QzvFcrucPPu6 uDK4TDzaLelCPVfLBEeOBZvPNLw/+/av4NjJ4NjJjhxKTIojSVyUYXuEjL/227vdyZvF8mnEPzjl H9x23Z9929fl9lC0hMiAE0W9+mLsS+3uPqSrbzCcEJ482+ZB8ARvbDe1JcMJ4UMXvLh8WiPtFMuG OZmY+EVKW2k/YahHeKh9BSGEEEIIof6FgTtCCCGEEEJ9AAN3hBBCCCGE+gAG7gghhBBCCPUBDNwR QgghhBDqAxi4I4QQQggh1AcwcEcIIYQQQqgPYOCOEEIIIYRQH8DAHSGEEEIIoT6AgTtCCCGEEEJ9 AAN3hBBCCCGE+gAG7gghhBBCCPUBDNwRQgghhBDqAxi4I4QQQggh1AcwcEcIIYQQQqgPYOCOEEII IYRQH8DAHSGEEEIIoT6AgTtCCCGEEEJ9AAN3hBBCCCGE+gAG7gghhBBCCPUBDNwRQgghhBDqA9yW 14aqEKAXyeOupKZHfA7gf/ONdo5QikbsjTBI/ZKZ/Kxw2Dra7VRsxVib95b9kpMd1H5RrFcOh+2N CFRdnJmRInmvc5nWkM6xznb/5mSPnPKC5rM3oqR6Efo1M9skmPBpLCa0V241nne2+7dYbtGtUiro tcyMQrnfM7O7Z7pzETcMo1tpcBlCKa1//Qf/1x/JpVy3UoMQQgghhFxmaGjo937v97qdCjfYOlSG sEpX0oEQQgghhFypWCx2OwkusXWoDOfjAEDxyd1ITM9hCReohqhutfh9wjHgtyilTpeQyZg6r+1b AntdkAmR/F6eo2ADrMnU8tDJTI8Uyz1n2hasyFi8Vd+lZpqm/dI7xbJTmQkEmDCxrFpVQCk1TdPe 9kixrOdnAmyBh6d7a3eFiWxmpgdry84VS8KEAYtlRwSZENGJ83KzWLKmznmiWHaQj4iCKdiXG6dY siy7036oJVsDd1/IB4TeO3O3K6npNcPM8Nd+9m1pQW3x+/4xH/OKKknS+vq6pmkAUA1WHh97uJ9p 7GlvB77F/3F8DzsOvRlbD6YopZZlra6u2m96pFjuOdO2iF8JVUZz9cMKnWJZCZVnjj5q/0/0vk5l JnAQ+U22XC7brwzDyGQyAADEK8Wy3qu+10wBWGYAACAASURBVOJ/Mmlpew/co7/NlUole9splqVw 6cmR/h5M3KJOFUvGx4S+T7BYdsTbgW8Jcz7nZSaTsSvPUqT45NBM99LVly4Jl8fSY7quA4BzEWcY nA2lM7YG7gihLqMQmBLbPwwf5/x+v9MCBwCEkCbfd6vohWD7ByEs+PzEufBomlaLkBDaPUJJ6IS/ /eMwHBHFzQfV7PsftDdBEvCFNn+U9fX1LiYGoSYwcEeot6TN1W/e/5sOHOgRD4YBsNksmr90SQ2F OnDk/rFsLH3/T/9txw9bCQRmfvTbHT9sv9CpHjkToK0OIWyA48xoNGpv53Kemw5hyVz83p//QWeO 9f9ubhYjkbkf/lZnDus9VSpp/2mzxd06DdCBeyuEOg8D9x1wQZaPtjowiwsxhGV5nvdm0+azymbp 7aulPexo6ampjAYUNIDVjiertxlgBO5P78eRmdOnwWOBO9oPWWv9X/7V/8Z1KODO/LPvK8lERw6F EEKuh4F7MwpVjo0sBPItR1FVln4IxDDfTSZUgd/5+25XoqWRf/dn7RxBEUX43R91Kj0IIYQQQv0L A/dmTDDF+w/iP/773e7IfvfXYXhoP5KEEEIIIYS8CR/yRQghhBBCqA9g4I4QQgghhFAfwKEyCCGE EEKoM3jCD5gjlmkBgG7pq56bY2J/YeCOEEIIIYQ6Q6f62vsFvWgCgMWbcL7bCXIXHCqDEEIIIYRQ H8DAHSGEEEIIoT6AgTtCCCGEEEJ9AAN3hBBCCCGE+gAG7gghhBBCCPUBDNwRQgghhBDqAzgdJEII IeQqUSba7ST0GQ44Pso6Lwnb5LsIdRMG7gghhJB7EAr/y9/3dOBeuXLpb/ljJu12OuosMUR/fTNB vtVFRte6mB6EtoOBO0IIIeQq8R//uNtJaMaIxz4IHNF7KnJ/2itAwwQAIEzCJ/iT3U5OnxnihoKH RUOyAMAkRreT4zYYuCOEEEIINVAqjj2+05eB+9kB8j/+8f/clT9NyQeEWva27PPNfuubXUmGW2Hg jhBCCCHUgGbSnGF1OxV7IRssl1nrdiqAC/i7nQS3wVllEEIIIYQQ6gMYuCOEEEIIIdQH+mCojJSW Ft9dJgwc/8FxhiU7ft9QzOJMsbpS1au6qVmcyPoH/bHjUf+g5/prKKXVFamyXFGyiqGYlm7xQU4I C764L3osygd2+vUpSBmpOFvSSppW1hmeEcK8mBQTp+Osz3NzZVm6VZovy2uyXtX1im4ZlA/xQoiP HA6HxkPQtGCaqllerFSWK1pZN2WDsIQP8oGRQOxEbOdfwV0WfrYoZ5UdvxY9Ghl5YbjFY5YXKqmP U5TC8PODsROx9hLY31qvLffjh3Cf1ouWWlBL82UpLelVgxoWH+L5MB8eD4UPhwnZ+bLlZWo+tXb7 HULI2Ks/JIy36sP2mZospR7LuWVTqVi6xgqiEB0Kjp30RYe6nTS0X3r9JKGUZj5fAwBfzLdz1E4h /6iwdnOdWpvPquuSoc+XS/Pl+InY4JUB79Sh8pq8ej2tlfX6N7WyrpX1yko1/yA/eHkwdnzbKcPU grp6La3kVecdy7AM2ZAycnGmOHRlKHI4vI+p7ykUCjPFtVvrlv7USEe1oKoFtbxUEeO+sdfGGobg 1KKFR4X1u7mn9jWpqalKXs1PFwYvDcRPeiXW1Ct6K8EiAIgJscVjVleqqU9SlAIAiMlW93Kl1mvL /fgh3KfFomXIRvpGprJUrX9TLWpqUassVbP386MvjYhx336ntl9RWpi5AQB8KI5R+y7RytJ0cfZz SjcvLoYqGZk5KTMXGjtFR17sYuLQ/unt84TC+u2sWtQAwJ/cob2cUrr6cbq0ULZfEobwId7STEMx 7XfyjwqsyCbPJfY1yT2iNFdavZamdXNt8QGOcIxe0e27Gsuk6c8yDMc0jL/LC5XV66uWQZ19GZ7R K7plUgAwNWv1elqICp64GlHI3FzLTxecNxiO4YOcpVuGbNg5rOTVlQ9WJt+aYLinxp5ZhpX6aLWy UruiEwJckGdYopVrvwK1aObzNcKQJndQblKaK7X4zRaLlpSWVn6Zsi9bDEt8sS4UyGG2NxqkKSzf XuHLPM/wg4ODzVOVWlgNMcFWjjoxMBFkA1vejDIxcHsLSItFS8kqS++vmGrtKkMY4EMC52MppUpW oRS0krbywcqht6dY0XO9lC2gxSc39WoBAITwYLcT01cozd3/UFqbt18RwnD+kKVrpl67Ia+sTKce bz1zkTv0buBuamb2bi7/sBYwickdLslrN9ftqJ0VmIELyeixKGEIUFBySuqTVbvhOXcvFzsWdX0F KqUlJ2rnRHbw0kBoPMTwDABQixZnS07j8drNtfBkiDzdOFdZrqx8lLK3o0ciiTNxISIAAKW08Ki4 dnONWrWIc+qtiQP+rx28wkzRjtoJgfChcPJsQggL9sAYQzGzd7KFmSIAKHm1vFCOHt2MvymlKx+k qmnJ3jdxJhE7GeNE1v6oPF9Zu7VuyAYArN1cC40HOX/vnoydQaE0X7uvnvz6RPMxQlxw59yQ1+Tl D1asjamgfQmRMAcfTZLKox8e+B/dytS1zMyt7LwOMAgAZOzlyqOj236b0tSnf6tJSQA4cvUbvNjs 6m5lQ5Xc1lxVYgzQv+5AuntVi0VLr+hL/7RsahYAiHHf4KUB/6Df+aZe0Rd+vmgopi4Zufu5wcsY mD7F0tXC7K3K8rT9Uogku5ue/lKYuWFH7QwnRA4/Fxw7QQgDQLVyLnf/Q0MuA8DK4zsSpQG332N7 UMOrIxFJd7pHTdVUiqpaVKU1qbxUtizKkVoKYwMxgQjb7VhcKJUfVjjCsQJ7+M0pMb6RfgLigOj/ mn/mv85SALDASBvBwy01NQGAQHx917BkmXT100ytezfum/z6hB2y2+zGXU5klz9MAYChmGpBre8F 1kpa6uM0ABACIy8ORw5HNvclJH4yZipm9l4OANScQik9yKFHF4SLB/a3bKqkfnb7ht14efT5I+On x5/6WAB4Ge4odwurBQAYKgyfFE44H87fni+ul0NsWAgIZ187Ex54umfjJFSHqjd/cssyLaAwuj42 cmzE/iTJuvMCJmcV+/7ZPyAGhtp94ETJq0vvrzidQgDgT3Sj/4fCk2IX/iwAWLqqVwt6taAVM3J2 iVqm85GPGchvnyqttJ7JlwHAFxnMsMOgb/tNAGj4aYDfY5r7QqtFi8Lqp2k7ag9NBMdeGd1SGfIh PnE2YQ9ektdbGpjkejKl65aZNa370w+WSynD3Cy0QmSgiwnrL3JmrrL8AAAYThh87ht8KL7xCRHC yeT5NzKf/h0FoKY5bxhneFefrp60NXAnWoRA9kLx3xx8Uiil7//dn1umAQAiQP2tAyf4rpj/nBQb x4imaVz75G+GlVEAuHj560lmAp65aAmxd7KrywAwlrp4NH6pxSQJLAH+b3b7H+muymJZr+gAwPDM 2Cuj9VG7IzQREsK8HUXVB+6U0pWPVi3DAoCBiwP1UbsjcjhsB+6WSfWybjfGH4x3rr1xYH/LVnj0 aWVlCgACg4e04qsPrjUogeXcYHH5CwBIKROLpJZCU5VWr61QehgABi++dX1mFGYaHD+vxqvpWQDI fHwstn7VfvP5UXf2CJXma+NkokcalKtdUYva0nvLlm5xImsZ1C6x4k6j6VyF0tQnf1kfrDsYTuD8 zZ4/kdJP7I3AyPat8l7VetFScoqUlgGAE9mRF4YbNmH4orXqUZdw8UiwAP59pWxnRHVtnfIh56Md Cy1yUMsozn5ubydOv1IXtdfwgagvMabkVgAgZ/XlDPSoua2Bu0FZi8I/zDS4Huw3vZJPrzdu/BET idLstuWvPH+3uFwBAH9yQqqOQqPEF8vhcp4CwOJM/r6v1f9dxEe+rWktfrlHlOZqoxESp+N8aNtb bSEs2IG7Vbe0RHm+ohZUABDCfPxU4ycmhbAweKnWNOLuuWWoZUjpWrgdmjgN20wcY2qyvcGKmz05 laX79gNDwZHjvvjodn+CDycgPQsAhlLuVLJ7E7Voeb4MAAxLwlNtXaH1ir707pKpmqzAjL40svju sv2+OOChxyj1aqFh1A61lstt+8EotaTMHAAQhvUPHtqn5O1NXD8+UPr1LiZArpY/f/8nI8ooJ/jO X3j95oc/td9/yfcDsbS1n3bm4eeGehcAhgYPn1O+Bo2a1JdXpy31GgBEgoPPl77tvB/xEYA/26f/ Rc/K2s1yjTQvtKheZfG+oUoA4E9OiMnxht/hA1EM3F2sh4bVsmJw6Mq3698pzn6uFtIAIES2HR1I LbO8dM/eDh+6sN3XGK7W8kFcXTsYsiFtDKpuPuuLVq7dkAjRWi8wtej63ay9PXRlcNvhwgQSp7fe 4ruSVsqyvgALwAr+Jt24eqWWab6Y8zggldcX7a3g2IlGO218b+NCxnAuf8y3mqpuDCoINewFapEu GYu/WDIUk+GZidfHnYcCOT/Hu/4hgTp7qy0BQMkuW4YGAP6BSadW7BHpKv2iG21GNlOtrn3xj4Yq MSw/8Nybv3iirOcpALCCX1rxAWxNWG62JOUpAKxGI3ONk02zdxflPAWASHR0te47bu1Vay5MmB8F avc/2UuXvvC/vP7oRiuFFjl2H/AgF+qhSx3DCUL4qdG9plxrhmwSNinZZcvQAUAIxYXwtjPGmHpt WkOGd3OEpBa04GgQAIQwzwe3bW5XC6o9nIYwIG7MllBdqdpvigmffRCP88WGh69+t/l35PUFtbgG AHwg4k9O2m9aumYoFXv72X7Melqpth41K7i8tdjpCIociShZpfC4qJU0taQxLBGigi/mS5yKcztN aW/IxtK7S7pkMByZ+NqYmBTX79TumvxJ0VPXqL3VlgAgZZxxMse0cra6PK1LRUMqEZblA1EuGA9P nmV9npuMwtTktVs/N1SJMGzywptCOFmau2V/tF1jMGFrxVWv5Boes5p6LGeXAYDlfaGmN/AeIRIi srU7FiYUEgLJFgstcuw24PH320N6qBU9FLhvYWqy3R8EAFsuUfU2r0PDx5p1EBu1BmZ3B+7B0UBw dIeLLqU0fWPNfno1dizmzLHjzKQZGgvaX5MzcmW5qld1oCBEBV9UCE+GSQtrYHmBLhWrSw+qqzMA wPK+5Lk3nOeYncEzhDBNenj0Sl7J1WbvcXeoZGpmZbkKAISB3P2cPTLYZulgKLKUloszxeS5ZOJ0 fLsMM1Vz6b1lrawThoy9Mmavp6ZsTEbuqXEyz2qxtrQMTVlfAgBCSGXhrlJI1x1CNzUFCulq6lHk 0MXw1FnvtNZZurp++x1DLhPCJM+9bq9co5XW7U+3iymF6JB9+svri+XFL0PjpwnDbhxQKT25VU09 AgDCsMlzrzO8p8tnQ6baUqFF9XYb8GDg7kq9G7g7jZF8ILJdl65laEp2Y4RrYqzJ0XS59mDcAVeg UfPw1dKvHeRfbM4yzXuffZBYGQAATvB99dD3+JIPAEzDkGb/c8Q0AOD58K/SJ9b0rWtWMb8lnLRC 4ZMXX0wMN8vqeiHBVUM5S09u6lLRVCWrPk4KxeOnX+ECmw9cskLtUTZKLUMu13/koJaZe/BLZ+EM Vgw9+539wxE+yhzczPG55ZyPCkAAKFgZSyQ+TuQ4kbN0S5N0sG8iTSjfLgdJcOhsg05zUzNn339C SsTPilOvTEXHIwAAFJbyyyLxAcDQwGCw0cTkIngiYGqltgQAeW3eLnKUUjtqZ3mREURq6qZStWdR oZZZfPIFAISnzu1/wrvPMrT1O+/o1QIhJHH21Y3rCNXKTuDeeBRHcOSoVkjbD5cXZ7+oLN7jgjGG 5XSpZMplOzP5QCRx5lU+5InFQ3ZLba3QIsceAh6cC9KVejlw36g3w9t2omnlrH0d4nwBLtBkSDc1 qoWNox1oHbom0c+6N2pzC72Syz+8ppWzAMBwwsCFN366yNljN+W1hey6DgAs78vcXi3O3KAND5Ev 3V782eClt4XWllN201BOSq3y4r36NeoAwBcdHHjuG4Q8NWib4X2sL2CqEgCU5m8nzry65VCmUsk/ /ESvbi7qdMA9xaI2Obb2zQP7c9k7/xiWagUmMTI5deq5YCRud1BYppF6Mr04fds0dQCQr3MDke8L vqcm8TAN494nP+dyvjCQk1deGfQdhTUAALlSDBQ4ACCEOWr+C3atQW0WCTIAf7LP/7/ua6W2hLr5 ZADAPzAZOXSRD8XsdjtqGZXl6fL8HfsBwtL87cDIUecW1K2oaWTvvquVcwQgfupl/8CU/b4hle0B CYQQYduwm8RPvWTIZTsANXXVrO/BAPDFhgfOv+mMqEFbtFhokWMPAc8Q655LMHL0bp2yY0/lU9+J DjfpNjLkin01IoQ0H3PsVqZSKS3clVKP7XCcFfwDF9/ig5vzxtgDtQHAMnR7AerA4CH/wCQfSjA+ vyGVpNWZ6spDCkABctMfD3/l17y2PLVeyduVJiEEaG1RWrW4lr37XvLc17bkhn9g0l5YRMrMUdMI TZ7lA1FKLb2S10prlaX79fMrcGLogCOkrEw/Xzig+0lTqaRmVwGAMGz85IvG8NFMEaDo3P8QEE7L w2L2/ocAAKDnb84HRzcHBFPLzN59V8mnASB+4uo96xBspFxaTeeKFACEUPTDFfLs44MA8Py2M/q4 Siu1palU1GIGNn6IwPBTc0EShgtPnuN8QfuHoJapZJfqfwj3oZaZ/fI9u+qLnXghMHzE+WizByMY 3y7y1srZ4sxnTrPxs9RCujhzI3bihb5bDORgqC0UWlRv9wEPM8TsfSYA1LN6Nfai1G4YhqbPm+sb vZnNw3F1oyGED8W9Fm4acqm88KWUnt0INSE4cix69PKWIUNOvzClFusLxE9+tb4nTggnhXCSD8by j64DgCGXtXLO11qju2vwofj4a/+CMCwAsQxNXpsvPP6MWqaSWyk8+jR+6qX6L0ePXFayy/YjqnJ2 Sc4ubTmaLzbMsLz9vruvWwwvjr74PQAgLL/dEyb+oUP8/B1dKgKAIZWc9ym1cvc+UPKrABA79nxw 7GT9Xq1Eq57QWm3Zzg/hPm0WrerKQ7syBABfbDg4cpwPxjh/2NIVvVooL96z75EqqUfAsLHjX9nH /0l/slortKjebgOeQDTO4U2jG/VoFKtX8/YsxYRh6xuGt9DKtcf5m5djJb9ibwgRD8Walq4Un9x0 WtkBQAgnYsdfePZSRC1T38hJQkjy3OsNHxUKjp0oL92311LWK54L3AlhYGNIDMMJwdEThOFyD34J AFL6Sez41fqWOcJyAxffKjy6ruRTW4/DsJGp86HJs6uf/JX9jruvW4TlWHbHEfyED8XteHFzMBKl +fu/tO9tIoefC02c2bLP5oXf20+2tVhb7v2HcJ/2ipYTtTMsHz/1Vf/glNP8ybIhVgyJyfHc/Y/s 5wirK9PenKinuVy1ak+G27zQonq7DXhCcW9do72jRwP3utFvye37Gaml1+aU4LdfdI1SS90Inuo7 Q12MUqu6PF2au22ZtQWthHAiPHXBPzDRsH/NUCrORTp86OL2YRARQgk7cLc0XMEbnMUvKLVMTeL8 Tz2EyvnDAxe/ruRWtOKaLhUtXWV4nxAZDAwdZn0BrZgxN0pv88eMPMLpCmOFWohTeHRdWpsHgPDE mcih81u+Ty1Dr+btbXff+eyotdqyVc/+EO7TTtEyVckeTAgA8dMvOcPin0ZiJ67KmScUgFKqlbN+ DNyfli5vTATZiULrDbsOeJLjngh4PKjnA/ftO8EtQ3eGf5DtJ3lU1hftx4w4f/iAn0ztCr2Sy977 wJA3q8XIoYticqzJkDgnCieEhMZPNTm4s1ijqxuQqLYx4p8PJ5qMrSJ1wwcJ23DWfCImxsVEg8Xt nBWahHAS1/oGAFOrzdJj5wallj1fBwFQC+nM5/+w5fvUspzTP3f/Q7t0C+HB2ImrB5bmHtHZIUNb fgj3abNolRe+tKvB4MixbaJ2AACGE1h/2K6H6bYLhnpXulwGCACOc2vZHgKeYNTTXZEu1qOBu/PE T7PAXd8MN5ntn9yvrjy0NwLDR10/M7GSXcre+8C+rnD+cPTIZf/g5I7/aycnOX/zabmo0xDl4gnO LEPP3KwtdT728m81CdydQcAMx+9qBSXL0OwZoAEgOHJsryl1D0ot+2aJEMaXGAUAvZyzizEF0LZZ 4MbhfMEX88azqE9rpbZs0bM/hPu0WbSccQiBHc5c6sTrrm7m2KMMBu67tJeAB7syXKoXA3fL0DYb jLfvBKdmrfWXUkots2GApRYz9nTFDMeHnn78yH2qqUeFh9fsW/Lw5NnI4eecBUGaszZWWWv+fbWQ MZQqAHC+gBBx7a28Uz9C3cLRDclrC/aGmNgcgySvL5iKBABCdHC7QUelJ7fsZedZX2Cny38f08rZ 9Vs/s7dHX/rNJvPiyZl5e1iXmBxnWB7qWpF3xYNBQCu1ZTs/hPu0U7QotcyNRZGb90jolby9EBsh jDenMmtCobQgy8ADeH6cW+sw4EGOXgzcnam4OF+gyTR59RMjGFK5QeVIaWHjwf/IoYvuXjNVl4qF R5/S2kJ9X2s4PGM7TniqS0WgtOFtOrWM/MNP7O3w1HkX913UV4jbLZ8EAKZatSd8BIBg3Xrm1ZVH 9gOpofHTDQN3vVqopmqNItEjl1u8uepHDMs7s17qldx2c/9bulqauwkABCBy+KL9ZmjidGjidJOD pz7+L3ZgNHDh615+SKCV2rKdH8J92ilatG64gqlUtstwaplObSkmx3F1oS1SGzFo80s8qocBD3L0 4hyfdUM2m92Lsz6/Mz6hsvzgmc9p7sFH9ho3nD8cbDp0u//RwsNP7AdMk2df21XUDgD8xtB/apnl xXsNjm4a+elP7IY9IZRw9+zOrM/vXGid0HwLQy6t33nXbpv0D0zWT7DjzJCg5JadRwIcpiplv/wn +9rvH5gMDB/udPJ7COsLOEtTlRbuAjRY1MvSlezd9+yenNDEGT7YUtukqUp2aAWebGWv10ptuX8/ hPs0L1oMLzijFCrL0w1zklpG4eE1ewIQQkjkkGtvgfbMCdyxub11GPAgR2+2uG9MVrrDLG/EP3io tszN6gwnhkJT5+zrk14tFGc/V3IrAMBw/MD5N7esbekyUmbeXkbEFx3igzGnM7cJVgw6reacPyJE BuxsL83dpJYRnjxn96dbhqYVM4XHn9lTkrOCmDz/uttHzhEhnLRbzSsr00BI5NCFWusFpYZSkVZn nCVUOX94ywzuzsXekMv5Bx/FTr5o3wZQy5Az88XZz01dBQAhFI+fesnFHRcAQFhOTI7bj+EquZXc /Y+iRy87430tXZUyc+WFO6amAIAYH40evdLikZ0qgvOHPd6c2UptuX8/hPvsVLSIf/CQ/YCKlJkD gMjhi850UpauKrmV0pMvDLX2gG/40EUcJ/Os1EaLxk6XeFQPAx5U04OBO3UWA/Lt1JYWnjovZ+ZN XaEAxblbpYW7fCBiarK5MU0Kw3LJc69vN9rBNaT0rL2hFjOpa3+94/dZXhx9+Qf178SOX127+VNq mZTS0vyd8sJdVgwBgDN8FgD4QCR57g3WF+xo2ntR5NAFtbBqt4tXlh9Ulx+wYpCwvCGX6xvRhVAi ef71LVd3/8CUGBu2BxpKa/Py+gLnDwNh6vcVIgPJc1t3dKXokctqPmWP05AyT6TME1bwsz6/Zeim XHaaKwNDh+Onvtr6DaEzPsTn9Ra7VmvLffoh3GfHohU5cknJLduXGCkzJ2XmWEFkhYCpSqb+1CS5 ofFTz841iSjA6kaL+46XeFQPAx5k67nbMl0q2ZMZEUL4nWZvZAV/8sKbTv8RtUytkncKMR+MDT3/ q77YyL4muOssXVWfWeWnOSGS3NLWK4STA+ffYDdGxVFKDbnsRO2EkNDYqcHL3/JIjSBEhxKnX3H6 xCmAoVT1asGJvBmWi0ydH7z8doPbGELiZ1512t0ppbpUcvYlDBuePDf43Dc8MrKTC0QGLr7FB6LO O6Yma+WcsREssr5A/NRLiTOv7GpJY2d9HI+32LVeW+7TD+E+OxYtVvAPXnpbjG9eVkxN0So586mH 2vnE6Vdix6+6u0ttb3KWpdrPCRBmx0s8qocBD7L1XB292fMbirdyCRHCyeGr360uT6ulNaNaMHWV 9QX4YCw4ckxMjHuh6Uhem3eel2qREG7QzuGLjw6/8BvV1GOttGZIJUOpMBzPiWExMeYfPsKJO665 6Cr+ocNCdKiaeqyV102lYihVwjAML/LBmJgY8w9MNXn0hxX8Q5e/KWXm5cycIZcMpcqwPOcPi8nx wPBRr80NJ0QGh69+R15blDJPTKViKBWglBH8QighDkz6ByZ2HSk+tVi6p1vsdlVbdv6HcJ/Wihbn jwxc/BWttF5NPbJPcEuVKADD8kIkKSYmAqPH3DonT/s2B7i3dolH9TDgQdCDgXtw5NhuZ7ZmOCF8 6II7FwtpQXDsZLBDEz8xnBCePNuRQ7kA6wu0MbcGCQwdDgwd7mB6+hnxD075B7ddrWaXByPjr/12 Zw7V53ZfW3b0h3Cf3RQtITLg8fvGvTnP8+d5fu3VV78MvKmbu2tyQuD5gAdBDw6VQQghhBBCCD0L A3eEEEIIIYT6AAbuCCGEEEII9QEM3BFCCCGEEOoDGLgjhBBCCCHUBzBwRwghhBBCqA9g4I4QQggh hFAfwMAdIYQQQgihPoCBO0IIIYQQQn0AA3eEEEIIIYT6AAbuCCGEEEII9QEM3BFCCCGEEOoDGLgj hBBCCCHUBzBwRwghhBBCqA9g4I4QQgghhFAfwMAdIYQQQgihPoCBO0IIIYQQQn0AA3eEEEIIIYT6 AAbuCCGEEEII9QEM3BFCCCGEEOoDGLgjhBBCCCHUBwiltP71H/7Rv6tk0wbhupWgnkIAApZGdH23 O2o8TxkGACgQA9h9SFp/YAn4lWqbJWM6AwAAIABJREFUB1F9PntDB08Uy45kWkO6IFiEAAAFxvDG Tfs+ZSYFovkEe9sjxbIeS8CvSvD0tWPPsFh2DCGqUCuWPlXt/PE7xxIEifDdTkUzHBgEAAAsIGZ/ XsT371KyKxRA8/kAQBTF3//93+92ctxg6yXH0jVCgAejK6npQRrDwEbguAcEqKczk26G3e3zSk52 NNMaImDxYO3rn+gV+5+ZXimW9Sg4AWIHYbHsoP0+fvv65cRhgDJ9ktSt9r+Y7Yqmad1Ogks807xB PNHggRBCCCGEDgbDYHjZGVtb3IVgWCrlHtKprqSmRRMR8uY7f9HtVDTw5Nd+VVVVAKhWq6ZpAoDq U9aT691OV9ecFE4yHwX2sGPwsKgEKpZlUUrL5TIAAIHl0aUOp6/n7TkDbeIgZw5rhlFrLnKKpSIq 2YQniuWlxReUdAeaeSIn/GW26Ly0LKtSqQAAAJnu7dqy3vfJfOj6p91ORU3lhatLkQjUFUtZlHOJ bLfTdRDaPK8d4gBnjmye4JvF0pO1Zfsu6ZfVjSFGlUrFsiwAkP1SLp7rarr6T31OOhdxURS7mij3 2Bq4s5wAQJ7AWFdS06JEkH3u1u1up6KB0r/63VKpBACKotQCd0FND6W6na6ueS7wHJ+O7WHHgRPR fAgsy7Isqxa4U/BgTu45A23hmF+LlJ0OyrpiqXgkM5Nzg8V0B0Z5Dl2MU8F0XhqGsRG4Q4/XlvWO w/xwz9Sc6ReuFkIhqCuWis8rxbLN89oRDvuNWFVRFPvlZrH0ZG3ZvqTyK/YVHAAkSbIDd0X0SrHs oPqc3LyIow7x3GNVCPURBhhxaO+PcPFRjvh8hNgPWYGz4R2HjuVE/WH7x9HNsalHK85LCeBnQX/7 h0XepFrKS1fn2z+OGQzQLOGqtVvTCqWZ9g+KUNtYlo1Go/a2YRirq6vdTY/LYODeSSzLBgIBwLFc G1hgoxeCe9hRHOQigQil1OPnfNpc/ZdP/mrPu9MFFt6jhNYe+PvJpUtqKNShpPUH3+Li0J/9WccP WwkE4Ee/3fHDIo9Yt9ZH/l3ni2UxEoEf/lbHD+sdHMf5Np7mxIt4O8wvuOKXtftJizfhfHeT4zYY uHfUNG+lKADQGIGenurqgCwY89/90/+jnSMoovjod3/UqfT0HY1qgfvTnToac/o0eCxwRz3LjESG zXEAKNCCBjjdBOo+dkkUUhvdkj7ijblJUf/BwL2TTInKSxoAWAGKgTtCCG2HLZVW/ykPAPppE3DY EeoBakYvPZDtbes0xWKJehPeUSKEEEIIIdQHMHBHCCGEEEKoD2DgjhBCCCGEUB/AwB0hhBBCCKE+ gIE7QgghhBBCfQADd4QQQgghhPoABu4IIYQQQgj1AQzcEUIIIYQQ6gMYuCOEEEIIIdQHMHBHCCGE EEKoD2DgjhBCCCGEUB/AwB0hhBBCCKE+wHU7AQghhBBCvSjKxC4IF7udij7D+En0QtDeNsBIdzc1 roOBO0IIIeQqU9yhbieh//BRNjAl2tsMT+yNTHbo5vqJ7iVqF54fZf/X//1fdzsVtv/gbMkB/+Mf /U4Xk+I+GLgjhBBCrpJ9+BvdTsLOjseZf/Uf/6DbqdhE2RlimvZ29vJljQt2Nz0INYSBO0IIIeQq T4rdTkELEgESuD/d7VQ0Rs6egyAG7qgX4cOpCCGEEEII9QEM3BFCCCGEEOoD/TdUxtLVzPzSX8pS 3rIqlsUREiXMFMde5oUwg/chT6GUVlekynJFySqGYlq6xQc5ISz44r7osSgf2PbXX/jZopxVdjx+ 9Ghk5IXhjia5d1m6VZovy2uyXtX1im4ZlA/xQoiPHA6HxkNAdthdLail+bKUlvSqQQ2LD/F8mA+P h8KHw4TstLOLtFm02vwVvMYyNDkzpxYzplI1lPKfmLPj1UqMYc7w/HGOx9zaUXmhkvo4RSkMPz8Y OxFr9lUKUkYqzpa0kqaVdYZnhDAvJsXE6TjrYw8qvT2FqoV0NfXYkIqGXCYszwUiQjgZnjzH8L4m u1kATwxjxtBTplmlVKM0wjAJhhlk2Is878mr/B5zUqX0gaEvm2bRsoqWpQNECcHT3wX6KXCn1Kou T5fmbkdi5l98++yWTwlDjl45MnZqrCtpsw2x8/wbPADAHQPKXUwIAIC8Jq9eT2tlvf5NraxrZb2y Us0/yA9eHowdjz67o17RWwmtAEBMiJ1Ja4+jUJgprt1at3Sr/m21oKoFtbxUEeO+sdfGtrsRMmQj fSNTWao+tW9RU4taZamavZ8ffWlEjDerf12jraLV3q/gPbS68qg4+4VlbtYAOpjrlrVuWY8NY4jR fsPv92QY1KrqSjX1SYpSAAAx2ayuUwvq6rW0kleddyzDMmRDysjFmeLQlaHI4fB+p7an6NV8/sFH WiW/+ZZpmJqsFtLV1KPY8RcCw0ca7rhkmj9V5IL11DlesKyCZc2C8ZmmvimKF3lhXxPfU/aWkxTg jq69r6qaXXw3rFOKp78L9M1FjppG9t77Sm4FABjCZKw0F+QZlmhlnVoUAMCE1Wurw+ZQw2D0gJ2y zgQh1MUElOZKq9fS9ecsH+AIx+iVWnZZJk1/lmE45tkrSmmu1OJf8US4SSFzcy0/XXDeYDiGD3KW bhmyYeewkldXPliZfGuC4bbWg0pWWXp/xVRrMxUQBviQwPlYSqmSVSgFraStfLBy6O0pVnR/s9ze i1Z7v4L30MLjG5XlB85rhuVYMSQGNeXkSbtWmAf480Dge6dO8126eKsTk4GsCACM0Iu/l5SWVn6Z ohYAAMMSX2zbuq68UFm9vmoZtdqWD3AMz+gV3TIpAJiatXo9LUQFT9SWAAAgr83nHnxErVqlx/oC DCcYctl+xzL0/PTHfDDKhxJbdryn6z9R5Pp3QoTwhBStWiBvAvxcUXggZ3j+/2fvzqOkKu/E4X/v Wnt1VVf1vtDN2jSbCDSKIERF0TE0Kr64JGOi5gyjntE4juPJmPOL501+eScxkjNzzHhm0MkxhjEZ MIBxdBRcAihCI82+Q9P0Wl3VtW93e94/bvWlqK7eu6muqu/nD71UPXX7qaeee+/3PvdZrsMXybjR lSQB+CIe+0YQtFc4irJSlEAgSBJ3RC5F3hGNbjAauXx63pszsiRwJ8Rz4vOYtwsAKIDaWfPYed2s ngEAQkjwcqjniFuKSgDQ09xjrjCxhiz5XhMj0h3RonZWzxTd4DRXmGmOBgCiEP/FgNZs2dPcY6ky U0zSoUsgcDnxsKDqtsrB2y9ZU+6Xs++CX40XKQosUyyO+kLewqtdMqSY7Dnm8V3wA0DMGw+2Bgum XnPTKIbEti/aZUEBAL1dV3SD01BkoGhKe7d11xUpJosRqfdUb9HCouv81a63MVStsfwKeSjccU6N 2ikAQ3Gtdco81mgBoAqXfnk6RLqOdfee7wUAgFhTfWvhNHtGMslTe3R36gCg8JSTjXAAYBenOwPf zkhmUvg9ruZ9u8rkKvWfBY7iG0Nr0qZ0d145tv+zMpgCAKXV06bMnGu0FAAAIaTt4ukLxw4RogCA aV/xjbde3YNdTwFsmfCvkQlR9xXPyT3qtqlkqqV6Lmu0AgAQEmo/4794iBBCiOI7f7DohruSP9gq S1rUbqSoW3X66SzLUxQAyADHRWFPX/vx5/HYDI7L+WvPqEvyqChoUftsjlvK6+x04qoTJuTLePyY KACAS5FPS9K8/LgFyjHZUfkDl4+qUTujMzrqb50+t6xT/5n6FkVR1hqLzsa3fnJFkYkikXBnOJ+v 3IpMug66Eo937bqq2yrVkF1F0ZRtegGrZ9r3dgKAFJPjvnjyU+CoJ6b2rjE49cZiw/XO/aBmcDOv 818UIkLvkWYH4wCAmhunlNWVXfM2B3AznIyd8nf5AcDuLZzGTbv6LoGT35y0yXZgoLDSPnPFzNS+ 7Hawz3e0HGoBALPXnPbb8VTuPBQeddWSIlLP4R51u+gGp33WNYEmq2dKFheLITHcHQGAqDuWz4c/ AMjxiO/CIXW7YNoic+Vs7a0YxMJ82HKj2R/wq8XV09PD1Ga4wdtCCljgAKA7TA5fkDObGQAQQ709 zbuSuxhZTIWd6TImRvw93/xFkQkFYK9bFrFNvegCcGkpZwbMkUDrcQCg/O7Ocgn6zgCLypj7Jvpr ZIIY8XtP7wMAtUCMJVOvvkdR5so6RYypBSIEeyHpibBEyCexRCe6Ypr5f4xGPulsyQAs4HgjRb0f jQJAlBC3LJcyufyIcsQl2VdcQaJ83leSK3X6Rfw1VxATRd2h1/sVpVWWAKBDxsA9K2VB4C7HI8HW E+p24aybeauzfxqdTWeptvgvBQAg7hX6J8gfoStBMSQCAM3R5beUJUftGnOlmbdwahSVErgHLic6 MxTUWq9Lfkdg34H0jV4Tx3fuYKgjAADGoilKYPnFA2meKgZ7q/zthwGgJ1bZRa/SXhcCbtdhN0Ax w+mlmrXug2lC8Li3s6d9NwAwPYaAPc23W1TGAPx2XL5Lxo26avWe8qq9DizVZvvMdM3DFBhLjWok qvVKylvB1hPqk3Rj0RRzZV2aFFhcAxPDPvfR3YosMryeyJIiSwCQ9qIDhPSe3KMmsNYuvCa06mMs mapGV0SRpWgw0WKaq0ZeIACJw/msJPkVBQB4irrXYODT9d+YwXI2Oq52f3cpOR24j6FqHYwL6iE9 k+Vu5NNcdCiAapZRA/fotT3gUbbIgsA91HYq8bSxdLrOXjZQMp1dB5cAAIRQXgfugZZEb4TCOjtn HvBmmrfwauCuSFeHARGFBC8HAYBmKEt1fo2m6o8oUqT7grptrqyDAaYskYXE411Gf81qHVH3FXVD Zyuh2fQN51I0mPazuWfUVUuRiXpDDgD2mfaB5o2RYpK6wZnyugFpmJUWiystKRp0H90li3Ga5Qtn L+85skt9PW3gHnG1iGEfALAGi7lqdv8EAMAaLQVTb1S3B58AJAeMpUBOSYnnG4t53jbwoAs7TauB u5jTAeeoS1KRpRN9JXkjzw/Uez3SF68X4ODU7DT5A3eiBUCm8hmDpesLQPN17i0AACkqRbojAEBR MPg8BkIwcXvDF1w9e4Y7w2qHbHOlOW1TfV4RAh5GZ2QAGN6QvskNAADEkEfd0Nmumb5QjoXUDdY0 0CxyJNbbrm7pCyvGnN8RsNDWefz86/kXPW0evxwEBopqiupMs4b/QX+3X7RIAKAz8vPK5g0UuB/x H+UZHQDMrpjt5B3a67Ipk2PEr79hVtpYb2L+k8nWHS6D5HjYfeQTWYjRDOecf7siJPobMLyB0RlT EhOiBFqOqNu26YspaqCzJWWpSp0ALSeNpUBChFyWEneS9exgd5LabDPO3I04x1KSYZ+ngqKAoswU XTbwE4kuOfGcrTKHn1rktMkeuCuiIPUFQJx5sEFUUXfiPMvqJ9GXMtGm69kz2+f2UZU0AOithhrb lIGSRXwRd6QXGKAoak7RHK6vl9vZK2fV/tyzZ8xmA0zXue6oPxoNRGmGNhYYjDZj+exy3jiCXtdm OovDJp2tpGTJ2sHTRN2tcX8PAHBGq8FRlfwWxSTqoRjqTfvZcOf5qKcdABhOZx70pnTcuX2Ob75O 14liwnhO/iXaEwWAgOP2S7v4cPsZMeKXIgGKYThjAWuyW6rq+4dHCcWJ/+8+kP79qLvVc6INoJAz WoX2b0PH1ej+Aeqrcf0ek91wKm2oLaT+FryVN1Xk+KOeYZKFaM+RXVI8QtGMY963eItDC554q7P/ g4uYp029MPGWwut81z05jaVA3LI8lWUBwE7T1oEj8h5F9ioKAFAARbkbcY6lJC2Oku8P1VRxThI7 ZBkA7DQ9bdDbJDRpTaIYNy2tHwJF0dTAy6vEffFwV0TdZg2T6JD2+p1NB1Zc1z+pBj8StA8Q5QAh PUc+jvunA4C5fNaBo0vUlxVJ6Py6l5BCiqJcfy6M+boBCgCuGedHfR62Tplmqa4f6BF8ikVlDMC/ j/qrTGZixB9uOx3uugAADKdzzFkF1/bL5AuK1Xej7ivBKyfMFXUUnaiZihgLXDoS7jwHABTNOOas pLlcnhFfkYSYuw0AKIoKtR6P+bqvvieLshADX3e485x1yvzhVy3VkL8CShbxR7pPuPwXAwDA6JiK 5WV5tfjXQBQx7j66W4oGKYp2zFmpKygGACHgVt9N++Ai6rqsbugLKwEACIn7u6PuK3IsDEBYYwFn shmKpmiHfM4bS4HUsGwNO0QoogDs7htzqQ5UHc/cTyYTV7U8inJYEI6LAgDoKarRYMzZxxa5brIH 7gyfeJJLiDLQ4B4ik86vuhKzuQMM0rEbEUXuPbVXbSSmWd5ac7W/RLTnsjqWgBCihlYMp6d5PZFF ORYmfR/3XzoMAJbqOZnIfoYFLjWLEb8cjyhCVIonbhR5s91ed0v/mmkqnSr4usPdFwHAf/Fw6MpJ 1mSjGVaMBORoUC1PzmgtnL28/3zGOWZ8q9aIfgWUXFzfnD/hk/0AoLfrSm8q5a25M2fRqCmS4D62 Wwz7KIoqrF+uL1SX8CNCUAvcU+dpJbIU9bSp23pHheB3ec8dUDslJ3jaAYC9fMw2fUnfDnPZRBeI BPA/0YjaTqynqJt1OTtaYNxLcl887lbkMCFhhWiTuBfRzN0GQ2HudjfKeZM9cKc5HaMzyvEIAAQu Hy2cvTwlgRgWuw+44v6rA1L1Duy1mZ4Y6vWe/VoIegCAZnnnvNuShwdFui9p2wZnlXXKfM5sU5s/ iSKF2s8ELx9Tx7kHLh81lk7V7qnyBCFK8MpJQq5Z0k9XUORcsHqAboiUfdbNUjQYD/QAgCzG5eSW ZgCdrcQ591taj5ocNo5Va+S/Ql5LW1yGIkPVtyq09QTyGZElz/HPhGAvBWCftczgrFZflyJBRRIB gKIovt99day3XZ23h+F0gt/lv3Ao7VBJKRr0HPu06IY7+YLidO/njgktEJcs74rHuvqi9vsMRkPu NrePb0nKAAeFuHLti+UM86DRlC9PgnJUFgQNBmdVqP0MAERcLUSWzFX1YtwpUXLcG4+6o94zvuR5 UTgzx+bBCpQjJcdCgdbjkc7z6lmA4Q3O+bdzSYMm5Vgo7ncBAEUz9plLU+afomjWUjWH1Zk8p/YC AFHkmKfNVHZdu2VnnBjyqgEQRVFAEsPy4/4ez/HPHXNupejUQ0kIevwXmtSoPa24r9t/4ZBtRkNu 9+4Y36o10l8hz6UUl/pitCfavqejfHk5zeRyxRsSUWTPic/Vx4+2GdcsHS/0Hbacyd7/1lr9CAAo kqhOmW8smmJwVnHmQlpnkCKBSNeFcMdZAkAAes98VbL4r3K7Zk5QgQQU5WtBUFcLAgATRT1gNOXw sFQY75LskWU1NqIAtBuADlneEY2s1RvYnL7u5LYsOJsU1C6MedrV4RpRT1vU0/Z5G32ZvaglMBYb aI4OtYcBwODI5b7CoyBFA8HWE5Hui31BDphKpxVMXZjSqZrm9GVL1wEAxXADTVtmKJ7CXT4mRvwA IEWGu3Z9zuDM9ooVD1E0A0ApkhDtuew730QUOdbb4Tt30D7r5uTE4Y6z3nOJQQY6W4mpdDpnsrEG iyLGxLAveOWkGsuGOs8BzdimL87A97lexrdqjehXQCnFNb1kq/tAjyKRcGfEdchV2lAy9C5yFCFK 78k96rp+tmmLTOXXTCEweAd3rRcNIQqjM9pn3pTcaYG3OHiLgzPZ1DOAFA0KwV5dTje6j3uBeBXl gBA/KV6d9XEOx63Q6XO4a7tqfEuyiGH+zmxhKIoCiBFyVhI/j8UkgBZJ2h2P3aXPr2fmuSQLbl4p hnXOv12fbgZ3mqGc8xyVKytinsSwFYMTA/cERYx5z+7vPrAz3HVBjdp5S2HxwjX2WTf3HwpJMSyj NzN686CTDVPaxD4pD9/zAUXRFM2qHTxoljeVzbDPvEl9K9J9iciSllKL2mmGc9SvKFpwh7GkljPb 1ULWOyqLblhtLK7tS3xG7uuonZPGt2oN/1dA0K+4SqeXlixOBOuBlmDys8r8Qoj31D61M7G1ZkHy 4rIqtT8hAPAWR+pHFVkMJuaJoijKMWdl2q7GpvIZrCExIe9A80rlhvEtkAghn8Ri/xkOneiL2ksY 5mGj6S69Ieej9nGvWgwA2zf8XE9R8zl+dV+wfkoURVx9KWtlQYs7ALAGi3P+bbHeDsHfI0b8dqfU azbrnXprtYU1stGeqBRLzEtqKsPZzYAQJdx+JtByVFu1m7cUWqrnGZyVI5qyoz/tqRzDDzBzXz7R OxJzdRGiyEKENVjh2gXn7XU3a71mr0XZZiyJui4RAEKIEPQYBpoJMW+Mumql/RXQQMx98z8ShUhR ibfk4/hU37kDkZ7LAGCpnG2dMjflXaJIYtirbvcfmSrFQtq9pWXK/P6RfR+KNxeqK6xpU8LnpPEq EBmgWRC+EuJCX0BZwjBLed00ls3xgL3PdahaU/tm71EAQoTYc/1eKFdlR+AOAACUvrBCndZ0cR0X NZzQ3gi1JSZ6Nzj0OKWMGOr1nNyjLcnJWxzWKfP1jvIxhuwqWdDm3MzhdVWJ0NfRkLMUDtKDkErq bUkxiYqnLThvKp02QNQOAECzPGOwqD8TthNDmqo1pl8h/wy3uCBpTCrN5eNwIEIUda4nCiDu63Z9 82FqAkXROhb2ntqrnjh5S5FtxhJICpUoijJXDLaUmHoeAIABFyjICeNSIC5Z/iAW9fatr1TKMDfx utq8CdlVYyjJxOEf0jESIYN0Xk8+4HmM2rNWFgXu6cmCrK2Ibq3N98a2mKfNc3KPelSzBktB7UJD UdW4hOwAQIiinh0oitYVpum5lBsUSXQ1f6xuly97cJAYSOuNTbMcwyd6H8W8HeqGsXTaoH+HaPF6 bl/Xh6N/1Rrjr5Bvhl9cQiAx1I/haTYvF5kWg73qGZIACEN1YtES6GyJM54i9q30Z7DS7CDPK4jW bJ/b872OvUAuSNIH0Yh6NrTR9HKdbgbL5WFQOeqS1A7/U2ZKHDSq6+27NdJRVM53Pcphkzpwj7pb 5VgEAPiCooEeG3mO9cqCAgCckS3I78A93HnOd/ZrtaXIUlVvrVkwnDUahKDHfeQTdbvs5vWDzE4Y dV1W+97oHRV07jZtamdPABj07AnRnlZ1Q1+Y6INEiCL3LfQ7+EMJMeRVFxejKHrwJYGz11iq1lh+ hTw0/OLSnk+ayk35WVrawNMR0UapKmJc3Rj87Br3uaRYGABYnZG3DtTnIReMsUCOisKuvpWVFvP8 Mt1kWvn8+hp1SSYf/rpBw/FzUqK1aGqePc3IMZP6GAl3nIt5OwHAXFGXNnCP+wXfhcTaBM75TiqP ZzcTI37fuYMksRLnrcNfKplmOKWv6VcM9Q40L6wixgMtzQBAASQv25R7klsrB1rzCwDkeFidpRQA TOWJ6QuJJGoP2eVYaKD5yIkie8/uV7f1jorBI63sNZaqNZZfIQ8Ns7ji4bj3bOKEaZtWkDZNzjNX 1pkr6wZJ0PnVNvWm2jnvtv6jA7WjVYz4gZC0c7kSRdIOcEv13Ny+nxxLgURD/k9jMQBgANYajLVD rZ+a20ZdksmHv09RBlpZKagoh/vm1pzH5eZFJ09M6llltInGtVUJkkkRqWNvhzqWw1xpsk7J4V7X QyK+s/vVcS2O+hXDj9oBgNEZtZVrAq3Hk+Z7vUoRY57jn6t3+ebK2ZwpN1uIVYzOoJ1AtaAwhRQN uI99pjYSG5xV2oRcNMfTfe3KofYzaQuTKJLv7NdCsBcAKIqyTsnZu6CxVK2x/Ap5aJjFdfLzk4qo AICl0mwowsng0pDjETVqhwHmguQsiW4eRJGDV072T0BkyXtmvzp8hTcX5vx6F2MoENJy9Cu168a9 eR+1wxhKMvnwbxaE/h8EAK+i/CkaUQf+TmfZSiYfu8nljEl9qGjnTSka9J7+0jZzqVo7ZVkKXAq4 mt1yXAYAvV1XtrQ0pxs1hhBxXVYXbtAVFHMmm9ZbYxCM3pS4WWdYvaMi6r4CALHejt5TXxZMXaj1 ulbEeMTVEmw9JgsxANDbywqm3jiB32RSoHiLQ33UE+o4AxRlnTIvMZUhIVIsFOm6oK1GyRos184d ThmKpoS7LgBAxNUCANaa+do8J4oYj/V2BC4dlvrmf7RMmZ+r/WRgrFVrLL9CHhpWcRnKIwDAW7iS hvy9yRmc1pGGNVjSPgpjDVbe6lSTBVqaiSJZquao3cAUSRD8Lt/5JnXVEYbXO+auzO3l1WAMBRJx XVZ6XQBQwTBFNB1Qhp6c1ELn8nq/Y6haVw//ZlGgKVjK69T1ZRWAgKIcF8WmviVU7TR9J87gnuUm deBucFbrbSUxXzcARHouR92trMECFP356UgnlVg93uDQl68op7lJ/ehgokW6E8tRxf2uzq+3D5me 4fRlyx7Q/llQuzDu7VR7NURclyKuSwxvYHQGRRLlaFBrJjUW19hn3ZTz1yEAsE6ZF/d1qZ1eQu2n w+2nGb2JYjgpGkx+8sObCx1zV6Zc3a21N8R629VgNOJqibhaGF7P8EY5HpHFa6buMlfM6j8VXY4Z S9Uay6+Qh4ZZXHq7rnxFOcNje1t62pqpun4TQWps05f0NH9MFJkQErh8LNh6nNGbAUCbywsAOKPV MWcVo8uL6YlHVyCR7ovqWPJ2Wd4cHrqxyUBRG805/lx91FVLPfzV7W8E4RtBsNI0D+BVrumrUEwz jQaDPg8u4rltcse7FGWfvVxrdyeEiJGAGPapcQDNUIWz7VW3VbL6vL4IKWI87u0c0Ud4qyO52yVr tDrn384Zr/Z5lYWoEOyV+kIrRme0z7q5cPYtub1wt4YvKC6su0Xr9EIApFhYDPu0AIhmWGv13KKF d/a/MDO8oeiGO/X2Uu0VWYgJoV75muGDXGHdLbbpS3K78yuMrWqN5VfIQ8Mprqq5lVV3VHHGvDiK R0dbeokbcBZt4C0O59xVTN/PJDTOAAAgAElEQVSCYoQQKRrUQiuKoszls4oWrhlopEHuGUWBjOKy Vcbk/iC2UVetxOHPXp00IqAo7qSonaOopbzuIaPRMkAPeJRFJvsZnOENxQvvirguR10tUjQgxcI0 wxU4bEVTHNYaK4tXIIBoz2UywiXQeEtq303eWlSy5N5oz5WI65IcC0mxEBBC8wbeXKh3VhmclXkS smsMxTV8QXG487wQdMuxkBQLUzRNc3rOZNMXlhuc1YOsA8oarM75dwgBd7jznFpplXiEANAMx1sd +sJKY9m0HJ6WJ8VYqtZYfoU8NGRxTVmw74RwPNPZnMQIubpmaroO7hqdvaykoTHceV4I9EiRgBQL 0SzH6i36wnJDSS2rN1+X7E4iIy2QvsvWCELxsvzolj3qqmUorpk3q+zmve93KbJPUYKKwlCUkaIc NF3DsjNYzoAN7bkiK6IxylhcYyyu0f7dUMftMaQZupGfTOUzTeUzx2NPlKGo2lA04JpB+YbRGccy fw5vdQ5+7c8no69aY/wV8g0W15hQVMWKh4eZlmZ5S1X9hGYnu4yoQNTL1qIy5vnDn01orrLRqKsW rzferMO2jNyHD00QQgghhBDKAhi4I4QQQgghlAUwcEcIIYQQQigLYOCOEEIIIYRQFsDAHSGEEEII oSyAgTtCCCGEEEJZAAN3hBBCCCGEsgAG7gghhBBCCGUBDNwRQgghhBDKAhi4I4QQQgghlAUwcEcI IYQQQigLYOCOEEIIIYRQFsDAHSGEEEIITS67d+9etGhRdXX1rFmzfvGLXxBC3G53XV1d2sSDvJVj 2ExnACGEEEIIoav8fv8jjzyybdu2W265xev13nPPPbNnz7755pszna/MwxZ3hBBCCCE0ibS1tXEc t2zZMoqiCgsLf/nLX1oslqeeeqq1tfWpp55SFOWZZ54pLy+vr69/9tlnFUXR3gKAV199tba2dtas Wf/n//wfQkimv8o4wxZ3hBBCCCE0idTX11dUVCxZsuSxxx676667li9fTlHU3Llzjx49+pvf/ObY sWPnzp1raWkBgDlz5vzt3/7tb37zG/Wt3bt3v/vuu01NTRzHbdiw4fe///13vvOdTH+b8YSBO0II IYQQmkQoivryyy//9Kc/ffTRR6+//npVVdW//du/2e129d158+b97ne/++STTw4cONDV1RWLxbQP fv75516vd8OGDQDQ3t5+8OBBDNwRQgghhBCaKP/93/995cqV559/fv369QDwxz/+8Wc/+9mrr76q vvvll18++eSTjz/++F/91V999tlnyR80Go1/8zd/8+KLLwKAJEm511UG+7gjhBBCCKFJZNasWa+9 9trRo0cBwO127927V6/XA4AkSQCwa9eub3/72y+88EJJScmpU6dEUdTeuv3227ds2RIIBARBuPPO O3fs2JHR7zH+MHBHCCGEEEKTyPz583/9619/5zvfKSsrmz9/fiwW+8UvfmGz2Ww22/e+971HHnnk 8OHDN9544/PPP//000//5Cc/0d5qaGh47LHHlixZMn369BtvvPGBBx7I9FcZZ6ldZRRFBiCFEMhI boZJibIW2ZLpXAyGlhl1gwNpkhfmhOIEurO8bCx7EDiub5PKw5IcewEmE/sKM3+qpQdAGb8C1ER0 em07i0qSDtIWcdKdOWkl0X7EU1IhyZrCHIvxPa41YZOxbzM7zpYTVA7jQmIT0REPYlYUJkzW8ozz /Kg/u379erWfTLKmpiZ14+OPPx7orR/+8Ic//OEPR/13JzkqpffPP7/2r9GAJ1O5QQghhBBCOYbj uH/6p3/KdC5yQWpXGRqUjOQDIYQQQmORe+PwUM6QZTnTWcgRqV1lCM0CAAEqE5kZJQqAViZBhaAo hUpTboTCMylQQIEygkpFUUAgtdzysCRHWm5p9kCnv5bnYWHShB5LVJO2TkK2nS1Vk+GcSRimf82k FWw5GhZC02nrMtV3DcKSHKm0FRIAKEIovB0aobSFyY+hzwxKlhq46y32sM/zv2RpRnIzOotK6R/9 3ych0+epyOzZX/31d9TJRN1utyAIABCw+M9PO5vZjE0Gs7n62e8tjrvFYaa3zjHFZ/oFQVAUpaur S33x8IKmCcvgJLVMv9z52ylydPR1u+BhNhBIdNDUqqXf6rsw9dz4ZDFLOBnnt3bdG2mJj3oPpavt 3Xy7ui1JksvlAgAA6n/JTeORwetqURnzo//3+5nNw55f/VKtmVq1rGlpWf3J7szmKlt0/t0zx4qL U14URbGjowMAKEKeePM/M5GvLKZVSJXL5VKnKJl66dJtuz8b+HMolWS37/vRS6FQSP2ndhFn2ZHN P95eUTWKv17RfmUUn8ouOI87QgghlE0Iy+pPW1NepKk46NMmR0Pjed5sNmv/dLvdGcxMtmMYhuub CwF7yIw7DNwRmrwEEjfV6BVp9A9qKUrSrka9vb3jlK/so4BiKOE5yxjOeDQUFBSom4Ig9LW4I5QB TDAYOB1NeVHSCVCfkezkAvEYHb9wddQfqQTAnh2jQmha7zHTnsRNpAQiQFtms5RjMHAfPxxXEHGY wgoA+GS/AEKmM4SyXq/Se9Ou/4/v7Bz9Lv7r6ub2+xpjTufYc5WN4iQ+q/2Twu3jsxJHyGi88OjD 47KrvGWOF+hiZgDwKj7AsyXKNBIngl+6+s9JN61i1qAUJXQhFjqfuLFUOBnmZjZHuQYD9/Ejiv4j 4WiHAADiTBlMmc7PZBIl0bpFvdywW3wVg4FyyZQgCABdE5ozhFAmhM7E/CfCACDVyWDIdG4QQihL YOCOrocoiRR+/Inp4MGRfjCm18N3H52ILCGEEEIIZZfUedwRQgghhBDKUk1NTeXl5XfcccfixYvv vvvuaDT67rvvOp1OdaYgANi4ceO6dev6J2tpaVm3bl3afa5evfrRRxPNiG+88cbWrVvV/w6Zmd/+ 9rfvvvvueH01wMAdIYQQQgjlknvuuWfXrl1qaP7+++8DgMFg2LdvHwAoitLc3DxQsrQ8Hk8gEDh0 6FA8nn5O4eS5RCcaBu4IIYQQQigHMQyjKAoANDY2bt++HQAOHTq0ePHigZKltX379sbGxuXLl3/6 6acpb23evPnBBx/8u7/7O6/Xu3bt2jvvvPP73/++JEkXLlxYtWpVY2Pjli1bAODXv/71n//8ZwD4 yU9+snfv3q6urrVr165du/YnP/lJygeH/EYYuCOEEEIIodzx0UcfrVmzZsmSJZcuXVq7di0A1NXV nT59mhCyY8eOxsbGgZKltXXr1vvuu+/ee+/dtm1b/3dLSkp++9vfvv7664888sjHH388c+bMP/zh Dz/72c9eeumlHTt22Gy2/h/55S9/+YMf/GDnzp2hUOgXv/hF8geH/Go4OBUhhBBCCOWONWvWbN68 OeXFBQsWHD16tLm5+dlnnx0kWQqv1/vFF1/8+Mc/jkQiBw8efOONN1ISNDQ0AMD58+cPHz68a9cu AJg/f/7FixeXLVsGADfddM3q2mqb+pkzZ1544QUAePXVV7/3ve+dPXtW++CQXw0Dd4QQQpkXr6xy PfJIpnMxeorZRIfC1+dvxaurzaHUSTQFCh+hIzSYdevWbdq0qba2lqKo4X9q586dzz///E9/+lMA ePDBB/fu3ZuSgOd5AJgxY0ZJScmTTz65devWGTNmTJs2bf/+/XfeeefBgwcbGxtZlvV6vYSQ/fv3 r1mzpra29vDhw2VlZS+++GJhYeHy5cu1Dw6ZHwzcEUIIZV4zU/SfxlmZzsXofWvJpyeE49frrx2H 5akv6eK6OaeGbq5DKG81NDTcf//9b7/99og+tXXrVjVqB4D169dv27Ztzpw5/ZM99dRTjzzyyM6d O6urqx944IEf/ehHP/jBD/793//dbDabTKZly5b99V//9bZt26qqqnQ63Ysvvrhx48Z//dd/ra+v //GPf5z8wSHzg4E7QgghhBDKEYsXL07pAPPQQw+pGx0dHeqGOlA1JVlNTY36erLk2WY2bNiwYcOG tH/Ubrd/+OGH2j+nTZuWMpL1888/T/7nBx98oG0nf3BIGLgjhBBCCCEEXV1d77zzTvIrTz31lNFo zFR++sPAHSGEEEIIISgtLVWHjU5aGLgjhBBCuYNQ1Gv/vj7TuRhMKVN29vzCTOfiGlVWiqqzaP+U 2zpAEADg1JylB2/5bubyNWL2qr9IMPRc4BOHBrqadct3JfKgiAoczGB2chAG7gghhFBOOSeezXQW BsNT/LGeARe7yYhjPdf88xYgFgoAoDdKmiOTK6uD+1aVcB0HSad3RGjWtjmJmwc3jGInxZ/upvT6 kX1GzuQdy3WDgTtCCCGEEJpEVmy5NIpP7X9l6rjnZLLBaV8RQgghhBDKAhi4I4QQQgghlAUwcEcI IYQQQigL5EIfdyNHuR55GBSS2WxIjkKjomNMDAB49bSY2dwghBBCCKHckpWBuxjyRlyX4r4uORZW ZOn8FOtTjq8tlZaCGitFURnMmI46qm5UnKnSh0c4GnoCEELCHZFQeyjmiUkxWREVzsTyFl5n1xVM K+CMI/71g62hzq86CYGSRUW2GbaJyPOkpYhK4HIw2hMVw6IYEhWJcGaON3PWGou5wgz96h0h5Py2 C4o0svvJqffWcGZu3DI9+bR+ciXqiQ2ZrGCqtbShpP/r416lcxwhsd72qLtNCLoVIapIIqM3cUar KDk3/fpBnUmXwaxNZT3yqjgAwFEZQhnMSJ8Byooz2U3lMxidqX/69r3vEkXWXth7/pJLdg3+R3L+ AB9E8uUD0iwY32ekP0T+ifZc7j25hwDYpi8xV8xKm2aMZ9ps19TUtHbt2vr6ep/PV1RU9N577+3Y seOZZ57p6upiWRYANm7c2NXV9fLLL6ck6+7ufu655/ovngoAq1evLi4u/v3vfw8Ab7zxhtPpdLvd Tqdz/fqhp14dafrBZdl1ThaivnMHou4ryS+GA35v1Nvb5uVP8mU3l+rtGbsaxUjiOCmFskzlQRPt iXYd6BaC1zT9C0FRCIqhjrD3tLdoYZFtesHwdxjuCHfu7yQEAEDvyPxtyfVDwHfB33PErYjXTAoW 98XjvniwLaS368pXlKdEjXGfMNKondExnCmXL+piSBzOtQQA9IVpKti4V+ncFve7vGe+kqLB5Bel aFCKBlvOdF5p2Z/Z4jomJJo5ZstzDJDhVQkHKauopz3Ydso2bZGpfGbyu2LYmxy1D0fOH+CDGObl YxQ/RL6Jedp7T+1VLy281Zk2zRjPtLnhnnvu2bx5MwA88cQT77//PgAYDIZ9+/atXLlSUZTm5ubS 0tL+yRoaGtLuzePxBAKBK1euxONxne6aIHPXrl1NTU0vvfTShH+lPtkUuAtBj+fYp7IYV/9JURRr sNCcvsBBQZACQoSA0LGnY8qd1YyeyWxWMy7QEuj6upskxY2ckaVYWgyJRCEAoMiku8lFs7S1xjLg XpJEuiMd+zqJAgBAM5TOloG7o3n8/Ov/R4HAxW8u+k4HiqAIGAAAhmV0Zp0syvFIHNQSDgD1FV2/ eg7DXq14nf7OGBMf0Z+yF9vn6q5piSpiiijq6zF/h8ki0BIYZsr+t9/jXqVzW6T7ovf0l8k3jozO SDOsFA0RogAWV5Ihy4oosvfcAYrhjCW1Whoh4B7pHzI49P0fzeWDYV4+RvdD5JW4t9Nz8i+EEACg aIYz29MmG8uZNvcwDKMoCgA0NjZu37595cqVhw4dWrx4cVtbW9pkaW3fvr2xsfHixYuffvrp3Xff nfzWW2+9de7cuRUrVvz85z+nKMput7/11lvd3d1PP/00ABiNxrfffnt8v1HWBO5SNOg+uluRBADg zfaCqTfythKKogGgYRYbUo617mqVYrIYkXpP9RYtLMp0fjMp0h3RQhxWzxTd4DRXmGmOBgCiEP/F gNZ43NPcY6kyU8wQF5NoT7R9T4ciJ86oukI9RWfg+rP761XX/4+GO856z7UB1FAAhuJa65R5rNES BQoAZCEaaDkS7jwPANAOV+JTTGXTtQ8qYlypEIbcvxQJeE7+hSgyzXLhsru6v76mA9JsB91I3h3n r5QpBAKXEw1pVbdVDt6thTVd8+64V+ncFvd1aQEQw+sLpt6od1bRDAcAhCiRzvNs8IiaEotryLLy XzysyCIA+C8cMhRVU3Ti5txQNEVnv+bJ6uJFe06Lp1L2LwSEjn2dikwYnnYuSN8+mtuGefkY9Q+R PwS/y338c+05D28pVEOgVGM40+aSjz76aM2aNR6Px2azrV27dufOnXV1dR988AEhZMeOHY2Nja+/ /nr/ZC5X+t5uW7dufe21186cObNt27aUwP3xxx9vamr68MMPH3744UcfffTZZ5/94IMPysvLX3zx xWXLlm3YsKG1tXV8v1q2/GbEd3a/GrUbnFWO+lvh2r7svJkrrC90fdMDAFH3sJ4Q5SpFJl0HXYkn knZd1W2VanyjomjKNr2A1TPtezsBQIrJcV988H4vMW+87S8dyb0+DIW5f4+ukuMR34VD6nbBtEXm ytnJ7zK8wT5zqRwLxbxdACAEepIDd5rT0dwQBaWIcd+FJqLIFM04593GmXJ52EDUE1N7uRicemOx YfgfHPcqnduIInnP7E88STcXOm9YrUY/KoqiTeUz51gsF5r+AnlfXMMpK5rXe078BQBkMSaGfbzF ob7b/wDXW/SccE1PGDkuuw73KDKhWari1gpdAT/BX2jSGeblYyw/RJ4QQ73uY58l987iLenvAwPu 4OjOtDlmzZo1ah+YZAsWLDh69Ghzc/Ozzz47SLIUXq/3iy+++PGPfxyJRA4ePPjGG2/0T3P+/PnH HnsMAJYuXXr+/PmFCxe+8sorb7/99smTJwdpyB+d7AjchYAn5usGAIbT22fdDOlGoGrnRDGSF2ve DiR0JSiGRACgObr8lrLkEEdjrjTzFk49tge/bMf9Qtvn7YqosHpGkYgiKQCgd+TLuSDYekI9URqL ppgr69IloXS2MjVwV8SRdYwhiuw58bkUDVIU5ai/lbdev8dEFtp6/fsdnW+/EGcEAJgxc3opXzr8 D7ouuQLRIDDAcMzCVQsNpnTVdSocPN4UC8YAoCpcXVqWun8eeIUPpvlgzon2tEqxEADQDFdYvyI5 ANIUV1TzZ4Z1Bshtwykrg7OaNVjUXtdiqHf48SKRSfveTiEoUjSULyszOPOukId/+ZjQHyIHiGGf ++huRRYZXk9kSZElGLiDe09Los24oNZ6/bKYJdatW7dp06ba2toRTWSyc+fO559//qc//SkAPPjg g3v37k1JQAipra1tamqaMWPGwYMHb7311k2bNj366KO33Xbb6tWrCRnnOQ+zI3DXRqPqbCU0m77R QhuyNqlmljDRphncdR1Jc/LKKQfjAICquZWV9sqBkkk2xRfxAUAFVJZx6YfSxoKx4385YZNsrIGd uWLmyd0n1U7ec0rn6IZqS05hokwKk2VhE1GkSPcFddtcWQcD9E6Vhai6wehHNN0B8Z7+Mu7vAQD7 zJv0joqxZHWk3D7HN1+nvQ+ZKIQonV+6FElH0Uys+/4TnhE0PbqP7o55awDAWrPgy5PzBkzmUmK9 HQDQe2SB2TM75V0LT90v7BxN1rNNpDuxTri5qp41DNh/nbfw6jlTDafy0zDLSosXiTzsViECXV93 R3uiAFC6pMRUnndzoYghse2zNjkuMzxddnPplc/a1df16W5gJvCHyH5SNOg+uksW4zTLF85e3nNk l/p62sCdEKXnshsAaIayVOf78JX+Ghoa7r///pF2Ot+6dasatQPA+vXrt23bNmfO1dFolZWVP/rR j1599dV//ud//uMf/2ixWL797W/b7fZf/epXb7755tSpU7ds2VJSMp5T90yiGHcQciwxWxg7UF8C AuGOsLo5qU6RXr+z6cCK6/bnZCHadchNoIgCECvXXT5gHihl1/G4egaMOG6/GEgTuMvxcM/h/5Xi U2iGcy64o+mbmLtdAACGNygn1g4UxQ6kwkLR8skRfpsMEwIeRmdkABjeMFDbBgCIIY+6obON4MgM XDoS6bkMAAVTbzSWThtjVie/mKdd6+o20L13WrIQjXs7AYACMA06Ik2biWLAs0QeGH5xCcHEAAy+ IF96vqWY0KrlPu4JtAYBoOgGpzX/Gj7FiHTl0zYpJtMcXbmyQo4nOniwBpYzpEYdeIwPQo6H3Uc+ kYUYzXDO+bcrQqInMMMbGF2auZhinnY+LgGAudKc9nl7nli8eHFKB5iHHnpI3ejo6FA31DkfU5LV 1NT0nwtSnZRGtWHDhg0bNqQkOHDgAADceuut2iurVq1atWrVGL7BYLIjcKeYRD7FUG/aBL6L/lBH GAAYHWOblr/zwYkhr9p2yxqsjH7AqF0Me+VoEAAoiuLTDUuXhWjPkV1SPELRjGPet3iLI9CSGM3G W50jjdqzlM5WUrJk7eBpou5WtdWcM1oNjqph7jnSdSHQehwATCVTLVX1Y8xnVoi4Ei1qxtJpQtAT bj8jRvxSJEAxDGcsYE12S1V92uvQeFXpPDHM4gr5vWqHOooGfSZmiJoMJq5qBS4FPCd6AaCgxlJY l3e1UYpKbZ+1iRGJZqnKW8v1Dr37WKJ1I+28OniMD2QUF+KI65KVBwCw1lpjnpjvvF8ICPGAQDMU X8DrbLrCWXZ2MvVKmIS6urreeeed5FeeeuopozHDU9Ymy47fjy8oDnddAICo+0rwyglzRZ02olwR Y6cOH+9ucwEAzVAVy8vyeS5IfWG5vrB8iESE+M4dULtcmcpm0lzqg0tFjLuP7paiQYqiHXNW6gqK IWnus0HanvOKGPGH206r1ZLhdI45q9IOvehP8Lu8Z/cDAGcssM1IP2VsjlEkIeZuAwCKokKtx9Xx KgmyKAsx8HWHO89Zp8y3VNenXI3GpUrnj2EW16nD+9Vel7Zptrw9YU5Q1Yr2RLsOdgOAroAvXlw8 9nxmFzkut33eLgRFiqbKbyk3FBkAINY3p3jafjJ4jKc1igtx4kxbDhQNvad6I93RpL2BFItGuqP+ C37HHEdhnT0/2t9Go7S09IUXXsh0LgaTHYG7qXSq4OsOd18EAP/Fw6ErJ1mTjWZYMRKQo0GbgwaO 8NYMr76UFYgi957aqzYS0yxvrUkdoahIgvvYbjHsoyiqsH553/mUCEHtfJG/U20GLjWLEb8cjyhC VIpH1Bd5s91edwtrHNbTcEWMeU7uIYRQNFNYv0J7lJTboj2XE9MwE6KNMqd5PZFFORZWL8ZEkf2X DgOApXqQNRXTGLJKo2RqcVnBBSwwPO2YW5jpHE1eo6hackzu+LKLKECzVNmyMprNr74Kiqi0fdEe 9wsUDeXLSk1lRgAAArHeROBuGNUw6Dw8xkd3Ib56plVAjdpZPcPoWUWUpYik3qsrEuk54gaAwtl5 8dQiJ2VL3EDZZ90sRYPxQA8AyGJcTm60AzAWG8tvzbuz5EiJoV7v2a+FoAcAaJZ3zrstZTozIkue 458JwV4KwD5rmcFZrb4uRYKKJELiGWWeXukJUYJXTqqnRY2uoMi5YHX6yXTT7aL31F51MKt9RkNu T/6YTBt5BgAGZ5V1ynzObFNb1okihdrPBC8fU+dJCFw+aiydyvDDnbZoyCqNkl0tLifN8HTlygpG l6fN7UMaRdUihHR+1SVFJQAoWVScb5M/KpLS9peOWG+coqC0odRcmej0IgQFWVAAgKJBN/KWtTw8 xkd9IU4+05orTc65Dl2BTm1ZV2TiO+fzHO9VB6N7TnistVZ2cj9te25NnZ4bWQ6l8Z54cXLKjsBd CHr8F5rUqD2tiCvS0+wuXlQ0oil+8occCwVaj0c6z/ctb2Fwzr89JXBUZydUWzVsMxquXSMwUfKc yZ4njcT9iSGvGrVTFAV90zvF/T2e45875txK0UMXS6DliDpxpKlkaj4MSFXJsVDc7wIAimbsM5ca S6Ymv0vRrKVqDqszeU7tBQCiyDFPm6lsxnB2O2SVRpqU4tLpjVW3V+VbZDlMo65arUdbw90RACio tebbgFQik449neosOsWLipOX49X6yegKdCNqXMvPY3zUF2LtTEszdNmSEmvNNTWQZqjCOjtnZDu+ 7AIARSLh9lDB5B4QuKX7qVF8aj18MO45mWyyIAgLd5z1njugbutsJabS6ZzJxhosihgTw77glZMA bgDwnfdTDFWc32um9idFA8HWE5Hui9pMoqbSaQVTF6b0ESRE6T25Rw0rbdMWmcqvmcISO7gDAGe2 V6x4iKIZAEqRhGjPZd/5JqLIsd4O37mD9lk3D/7xWG9HsPU4AHBGa550bVfRnL5s6ToAoBhuoKYy Q/EU7vIxMeIHACkyxGLdw6zSSJW2uG66o+Hrgtczm7FJaCxVK9bbccXbBgC8lS9elF+XIaKQji87 1ZuW4oVO2/RrwsHooB3c08rbY3wsF2LtTLvkpn1nqTNp92+psugKeuN+AQCEwNALe6PJabIH7lrU TjOcfdZNhqJqbewaw5gZvVnvqCgLfN3a+RUA+M75cMS0RhFj/kvNWnMFAPCWQtv0hjTHPCHeU/ui njYAsNYsSFkfFADUx5QAkFdrXqSgKBr6usTQLG8qm0HRbO/pfQAQ6b5km75kkGcRcjzSe2qv+kPY Zt6UV08tKIZlmAFnitBScWa7GrindEZKNoIqjQYtLl6XZoGbfDbGqqUe4JYSAIDSJcV51WmTENK1 vzvUHgYA5zyHfVZqz2mtxd1QOHTYndfH+NguxNqZltNxMFBMToHOplMD9/FeFAhdP5M6gEhecN5e d7PW0+taVN0NDV93bQFCiAIxb8xsHDJKyHGEKOH2M4GWo4qcWJSKtxRaqucZnJVpJ5DynTugzilu qZxtnTI3dW+KJIa9if3k8cjU/rRVkwhRZCHCGgZ8OO47f1CdxdxUOk2dHACl0PoaMXyaWbdGWqXz HBbX8I1LWWkHeMFUq0vmkDIAACAASURBVDqPSv5wHepRZ6wvrLM76lM7XisyifsTS0oPvkAvVtrr cyGmmERhsv0m1EfZYlL/ctqC86bSaQNE7QAALMfzZi4eFABAEfP9LlIM9XpO7tEWquAtDuuU+XpH +UDnPkIUdboeCiDu63Z982FqAkXRnlf2ntqr7oa3FNlmLJmgr5BpRPD3dSW0FA7SeZ2ir7arUenW 6FZF3VfUpX9pli+YunD88plTZCExS0//dRNHWqXzHBbX8I1LWWkHOKtjrfPzoGE4CVFI4FIAACgK It2Ry5+0piaQrz5C6/yqSy1Xg8Mw59quhVhpr9uFWB08DQCcGR+7ZatJHbjHvIkFrgYfyUcI0Vbt zvN+MjFPm+fkHvVuhzVYCmoXGoqqBj/3icFeNT0BEAZY30qjJdDZ0iy2mhsUSXQ1f6xuly97cJDA XeuNTbMcw6dvTFJk0Xf+oLpdMPXGnO+jOTqEKOrNEkXRusJrqtYoqnQ+w+IavnEpq+QDvGZhjUc/ 4AwKOSnujSsyAQBCIOaND55YS2AsueapGlZauF4XYqKQqDsGABRNmUon0YpC466pqWnt2rX19fU+ n6+oqOi9997bsWPHM88809XVxbIsAGzcuLGrq+vll19OSdbd3f3cc8/1XzwVAFavXl1cXPz73/8e AN544w2n0+l2u51O5/r164fMz0jTD27yhrmEKHIspG73b4RLFvR71ZtIiqZ0tvydJyHcec539mv1 ltxSVW+tWaAtUzUIbbzLiORwj0NFjGnbNDtYdYr2JJqX9IUDPswNXGqW4xEA0FmLTGX5MpOMSgh6 3Ec+UbfLbl4/SM/+qOuy+nxc76igk55djK5K5y0sruEbr7JKPsBLp3IeMb8Cd23g6YgYkkapYqVV jeVCnHKmHSR9sDWkiAoAmMqNNJfjIzHuueeezZs3A8ATTzzx/vvvA4DBYNi3b9/KlSsVRWlubi4t Le2frKEh/dQRHo8nEAhcuXIlHo/rdNfMsrBr166mpqaXXnppwr9Sn0kcuEui9mBIjoUGmtqZKPKp b75St03lRobPx2MeAMSI33fuIAGgaMYx51Z9YcUwP2iurDNX1g2SoPOrberU4855tw29vl32S25i l6LBgVZWkuPhUHti5L6pPP30hWKoN9yXxjajId/akGiGU2dnBwAx1MsP0LlfEeOBlmYAoACSl1YZ dZXOT1hcwzdeZZV6gFOHxy+P2cE+02afOdj8jBd2XFKb1SpXViTWY0qClVYzlgtxypl2oD3Icdl9 zA0AFAXOuXk0zwTDMIqiAEBjY+P27dtXrlx56NChxYsXt7W1pU2W1vbt2xsbGy9evPjpp5/efffd yW+99dZb586dW7Fixc9//nOKoux2+1tvvdXd3f30008DgNFofPvtt5PTr1q1atu2bQ6H4+67737z zTfLy0ccVk3eWy6a4+m+JrpQ+xmANJ3XiSL5zn4d8HoAgKLzqy5ei/jO7lf7EjrqV4zj6U+OR9ST BeR0K3syRmfQGtq10DyFFA24j32mNhIbnFUDjTcNtBxRa63BUcGZ826ZOkZn1JamCrQeT3sIK2LM c/xzKRYGAHPlbM6kldJEVekchcU1fONWVnl+gA9Jikhaj2q9o/9UsFhph2vwC3HqmTbdQD85Jrfv 6RDDEgDYZ9l1thxfxAoAPvroozVr1ixZsuTSpUtr164FgLq6utOnTxNCduzY0djYOFCytLZu3Xrf fffde++927ZtS3nr8ccff+CBBz788MOHH374/ffft9vtH3zwQUdHx4svvrh9+3ZZlltbrxn7sW7d ug8//NDr9QLAKKJ2mMwt7gCUoWhKuOsCAERcLQBgrZmvTdyhiPFYb0fg0mEpHgEHDQCOOY58qItp RVyX1fUadAXFnMmmdTEaBKM3DacBWHt+xxosg/cbySEUb3HEvJ0AEOo4AxRlnTIvMQE5IVIsFOm6 oC2hyhosA83gLoa8UU+7um2urL9OeZ9MKIbVOyrUcXux3o7eU18WTF3I6BKtbooYj7hagq3HZCEG AHp7WcHUG7XPTlyVzkkjLa5ohAN9npbWeFUtPMCHpHWk4S1c/4fheIwP3+AX4pQz7ZmvQlK9pI33 k+NysDXoOdErxdSpPozOBXnRxLlmzRq1D0yyBQsWHD16tLm5+dlnnx0kWQqv1/vFF1/8+Mc/jkQi Bw8efOONN/qnOX/+/GOPPQYAS5cuPX/+/MKFC1955ZW333775MmTKQ35999//z/8wz8QQh588MHR fbXJHLiDtfaGWG+7el2PuFoirhaG1zO8UY5HZPGarnX2mWkmosofke6L6kbc7+r8Os2gihQMpy9b 9sBw9qwt1abLp4kgrVPmxX1dak+tUPvpcPtpRm+iGE6KBtXxQyreXOiYu3Kg+5lA67FEMkuhzpan U0AW1C6MezvVx7gR16WI6xLDGxidQZFEORrUGoaMxTX2WTdB0rLHE1elc9JIi+tAm5Ee6/iobDVe VQsP8CFdncE93USQeIwP35AX4uQzbc+lHtd5F2tgWQOjiIoYErUp261TLCUNJfm8wPy6des2bdpU W1s7okLYuXPn888//9Of/hQAHnzwwb1796YkIITU1tY2NTXNmDHj4MGDt95666ZNmx599NHbbrtt 9erV5No586urqz0ez/bt2998883RfYvJ21UGABjeUHTDnXp7qfaKLMSEUK98zfBBbu6S5cU3FuXl fTgAgCLG497OEX2EtzqG2W6hrfjA5dPSS3xBcWHdLVpPLQIgxcJi2KdF7TTDWqvnFi28k9GZ0u5B jPhjfUNXLZX1+dlKBACs0eqcfztnvLqSoixEhWCv1Be1MzqjfdbNhbNvSR5aMKFVOveMorisdmd+ ltZ4VS08wIdDC9z7z+AuxkU8xodvyAtx/zOtFJVivXEhmIjaOSNb2lBSdlMpzeRpGaoaGho+/vhj rZ/MMG3dulVrHV+/fn1Kb5nKyso//elPd9999zvvvHPfffd5PJ5vf/vbjY2Nauw+derULVu2pOzw zjvvBACbbbDxIYOY1C3uAMAarM75dwgBd7jznBQNSLGwEo8QAJrheKtDX1hpLJtWVm24kOl8ZlC0 5zIZ4RpovGV4vdUJubpUW350cNcYimv4guJw53kh6JZjISkWpmia5vScyaYvLDc4qxOdZwYQvHxc /UlYvclQNOX65Hly4q1FJUvujfZcibguybGQFAsBITRv4M2FemeVwVnZf8LNCazSuWgUxVXgKBq6 X0IuGq+qhQf4kAghMe+Agbun1YPH+HAN70KsnWkdVn/A7xfDIlGANTA6u85cYTZXmvMqZF+8eHFK B5iHHnpI3ejoSMwzrs75mJKspqam/1yQ6qQ0qg0bNmzYsCElwYEDBwDg1ltv1V5ZtWrVqlWrBsre iy++OKyvMYDJHrireKsz3wLH4TOVzzSVz5yQXVNUxYqHJ2TP2YDRGZMnORmRwtm3FM6+ZXzzk80o Q1G1oWjANdRSTGCVzkWjKK6pdVw7fDJB+ZnMxqtq4QE+JIqiZqyfPtC7pTNKK1fedj3zk8VGcCGm DEXVs5fOVgR56LRoAF1dXe+8807yK0899ZTROImmvc+OwB0hhBBCCKEJVVpa+sILL2Q6F4OZ1H3c EUIIIYQQQipscUcIIYQQQpPIXOc8hsrTJTUHh4E7QgghhBCaRKb8cu5oPrZjvPMx+WBXGYQQQggh hLIABu4IIYQQQghlAQzcEUIIIYQQygIYuCOEEEIIIZQFcHAqQgghhBDKEU1NTWvXrq2vr/f5fEVF Re+9996OHTueeeaZrq4ulmUBYOPGjV1dXS+//HJKsu7u7ueeey5l8dT9+/fff//99fX16j+XLl1a VVW1cePGQTLwxhtvOJ3Oy5cvm0ymwVOOAgbuCCGEEEIod9xzzz2bN28GgCeeeOL9998HAIPBsG/f vpUrVyqK0tzcXFpa2j9ZQ0PD4Hsbkb//+78f03cYAAbuCCGEEEIoBzEMoygKADQ2Nm7fvn3lypWH Dh1avHhxW1tb2mRD2rx5s9lsDoVChw8f1ul0LS0tW7Zs8Xg8Tz/9NAAYjca33347OaUkSX/+858j kciZM2f279//2GOPxWKxioqK//iP/1Cb/0cK+7gjhBBCCKHc8dFHH61Zs2bJkiWXLl1au3YtANTV 1Z0+fZoQsmPHjsbGxoGSpfU///M/d9xxxx133PHKK69oLxqNxtdee23evHl79uzp6Oh48cUXt2/f Lstya2tr8me/853vvPvuu8XFxf/yL//y+uuvP/LIIx9//PHMmTP/8Ic/jO6rYYs7QgghhBDKHWvW rOnfuWXBggVHjx5tbm5+9tlnB0nWX3JXGW1j4cKFAGCxWGRZLikpeeWVV95+++2TJ0/2b7n/3e9+ V1RUdNddd/3Xf/3X4cOHd+3aBQDz588f3VfDwB0hhBBCCOW4devWbdq0qba2lqKose+Npq92Wtm0 adOjjz562223rV69mhCSnOz06dO/+93vPvjgAwCYMWNGSUnJk08+uXXr1hkzZozu72LgjhBCCCGE clxDQ8P999+v9UEfF3q93mq1NjY2/upXv3rzzTenTp26ZcuWkpISLcE//uM/iqL4/e9/HwB+/etf f/e73925c2d1dfUDDzwwur+IgTtCCCGEEMoRixcvTukA89BDD6kbHR0d6oY652NKspqampS5IAHg pptuuummm7R/Pvnkk8nvPvPMM+rGqlWr0mZG+9OqDz/8cFjfYWAYuCOEEEIIIQRdXV3vvPNO8itP PfWU0WjMVH76w8AdIYQQQgghKC0tfeGFFzKdi8HgdJAIIYQQQghlAQzcEUIIIYQQygLYVQYhhBBC CE0iP9j2CM2OrHE5ZR7GXJUauIvxKAVkEZzKSG5GJ9ZGTWNmEJhEP5guplc3rBDKrsKcIPoofDa1 hnXYR/pBhWb6Nqk8LElzED5pWMzE4+OyN7/Vqm7Y8q9ashLsLbDya+4cl71JjHbmzLKzpSrWRk2j RzmF8LjjYzp1w0YFF5HsK0wNd4afpmSyVGlFO1vCtAuT5fdNi6P5SX7gGKjEWdcOgUme1RQZr4cp aJIIvvsvSzTEB3/KDJ3oWhQA/GQShYITJDVwl2JhAFJE+TKSm9GRI2CFgkznIj0epOwqzIkiQ6fV Cn2B4/ARQvqWSciyajk+ROgoLh73vfIg5l1hEujmeaiqGvcdZ2NJymEoAFumc5FKl+3V0s9MnlIt CE6WnAwkW35rHQhFlJDpXIzEZKqHyeLj1AKFUh9DjMNaUgghhBBCCKHxltrizugMAOAHSyYyMzIG Fip7WkGUMp2Rq6TiohDPA4AoimpfK5mR4/pYpvN1vRXQBVT3mIZPMA5KlmUAIISIoggAAJQfzOOR u4ll4qC8/WKmc5EqOKValuWr1ZKV47q8qJZmysy69aCM/eEpxThArZMAoCiKJEkAQAEUuXrGvPP8 op0nVVq11MWFAr8/c/nKSpLTEdInemZqZ0uslqOjnifVba1a6mMxayCY0XxlJa0wtWqp76uoaIxS oytObyJAf0XmZiQ3I1JfQP/N1nfYHnemM3JV9w+eaHI6AcDtdguCAABhY+j8tLOZztf1dqdxDfeX EXdnT1bwMBsIBABAUZSuri4AACBZUS0XOZi//c2vM52LVHt+9ctAIKBVy5AxeGHquUxn6nq4SXdz 8dtVcmRkfSv7o1navJAKBhPXb0mSXC6Xut24Y+cYd55vtPOkSquWZZ0dqz/Znbl8ZSXXI480VVWp IebVakkIVstRUM+T6rbL5VJvzis6Om7b/VlG85WVtMLULuIUhV06xgfOKoMQylkyyKYavSKOtcWd ZiieJ2Zz4pmPGmii0ZFttoKCq6OSent7M5gZhFDuaWpqWrt2bX19vc/nKyoqeu+993bs2PHMM890 dXWxLAsAGzdu7Orqevnll1OSdXd3P/fcc9u3b0/eW0tLS/8Xf/WrX5lMpo0bN17XLwYAGLijiRAl kVtmto1lD2JHKdfZBQACwIcmwzjlC+Udt+x+dPc/69o7xmFfSWtgh4zGlkcfHod95iXG5/N9drXF Xa4jgIf4aCk63hkuU2QCAHEl5gJXpnOUxTiO024pPR6P2uKORodlWbUwJUnqe2x+Xd1zzz2bN28G gCeeeOL9998HAIPBsG/fvpUrVyqK0tzcXFpa2j9ZQ0PDMPf/93//9wCwa9eupqaml156aaK+RjoY uI8nyWYvkSsAwE8CAuRvm1yv3Fu8Zcu47Cqm18N3Hx2XXSGEUI6h40LPXj8RCQBIOgHqM52hbCYe ov0n1CFVeD85VtI3jP9EDAAUToaM9nJlGEadibKxsXH79u0rV648dOjQ4sWL29ra0iYbyObNmw8f PqzT6VpaWrZs2fLOO++YzeadO3eeO3fugQcemDHj+k3BiSunjifW5+36yNv1kVfw4Z06mkRomjab zTSNxztCCKHc99FHH61Zs2bJkiWXLl1au3YtANTV1Z0+fZoQsmPHjsbGxoGSDcJoNL722mvz5s3b s2eP+srjjz9+naN2wBZ3hPKB0swFTwjyLALGTGcFIYQQmmBr1qxR+8AkW7BgwdGjR5ubm5999tlB kg1k4cKFAGCxWLTZhzICW+AQQgghhFCOW7du3aZNm2pra0c3xU3ap9bqnE7XEwbuCCGEEEIoxzU0 NHz88cdaP5nR0ev11r5l4Cv/f/bePDiu6kr8P2/vfdcuWZJleZF3WzbYBmzMEgOJ7YGk4nHmN5kJ CeVhqCI1Q5hUKqlvpirMmgyTyvBPcGYYvvzyg5mQYJZAgIATDHjF8oL3RZK19KLeu997/bb7++O1 2m2p1VpaUm/3U67y69f3Pt13+r53zz333HOam3/zm99cujSvUb+xqwwGg8FgMBgMpkLo7u4e4wCz Z88e/WBoKB1kTA/vOKZYW1vbmLCP408+8cQTALB582b949GjR2ez6VMAK+4YDAaDwWAwGAx4vd6X Xnop+8zjjz9uMpXQ/jCsuGMwGAwGg8FgMFBfX//UU08VuxX5wD7uGAwGg8FgMBhMGYAt7hgMBoPB YDCYUmLvm0Bz06uiFTNK47yBFXcMBoPBYDAYTCmx+P/MqNoXZrkZpQd2lcFgMBgMBoPBYMoAbHHH YDCYmaPU1hS7CWWGxhkow02b0cwyoWAwGEx1ghV3DAaDmSGIIH706D8XuxVToruBvGR4s9itAACw krxl7WDmo3pGgmQRm4PBYDDlBFbcMRgMZqYgOBPQit2IKbHYTV2m5jW93xRZpi03QgnFSMZgMJhS BivuGAwGgyk+l9c2nfnKl4vdikkwE+bha1uL3YqbuIyEdRWBEAIAJAtwox8AEEH49+4tdtOmBklo NhsZiRa7HQAAtJWydBr14yCHPbjKmOPHj+/cubOrqysSidTU1Pz6178+cODAE0884fV6aZoGgH37 9nm93u9///tjivl8vm9/+9tjkqf29vaOP1lEsOKOwWAwmOKT0BLX5SvFbsUkLGdXlOwaiwnUu0a1 zf+z5WxR2zJVGGDWxJ94SyqNKH4igDkdf3ALkNbiNgZTGA8++OD+/fsB4NFHH33jjTcAwGg0fvzx x1u3btU0raenp76+fnyxjRs35r9sLBaz2Wxz3/x8YMUdg8FgMBgMJgdia2vZLF+MgliGkOTitoFx pJcvVEIpbksoitI0DQB27dr12muvbd269cSJE93d3QMDAzmLTcT+/ft/97vfmc3mZ5999utf/7oo ik1NTc8///zIyMhjjz0GAOvWrTt48OCrr77qdrsfeOCBX/ziF42NjXNxR1hxx2AwGAwGg8nBeU/i vbb+YrdietzG/9WbV4u8LsSqQHmMAMAgaW2qCA145513duzYEQwGHQ7Hzp07X3/99aVLl7711lsI oQMHDuzateu5554bX8zv9+e5Zl1d3X/8x3/86Ec/2rt37549e/7xH//xlVde+eyzz771rW996Utf euqpp+6777633377oYceAoA50toBK+4YDAaDwWAwOVFBFZFY7FZMDw1IQS6y95EgAwACAA4QFGO/ wI4dO3QfmGxWr159+vTpnp6eJ598Mk+xidAdaa5cuXLy5Mn3338fAFatWnXx4sWnnnoKAH784x/3 9/d/5zvfQQh95StfmbU7GUeZKO4IDR56Gd2azDZlIv7d6yV5fqJKj5otdrKqM0whhJJDfGIwIQZF RVQ1WWPMNGtlOSdn77Azpny/viZrsb64EBDkpCwnZE1BjIVhLYytzWppshTlOSwumiIJ/t5U1K+K SUWMI1WhDBbaaDXVtRs9LTCZRBDADVU5K8tBVYsgjQVwkmQ9RW1gOWM1xbHuf++GEJx8FLQvtNVv rJu0GO/jb3w4SJCw6JFFJFVFYtTxn3xHio1MWsxc3+Fcsin3dwh4Px+9FpNikhSXSYZkrYzBbXAt dVIcNcvNLWGm3i2X37Ei/SHXqDQp9bftpg2WGbSwjCj8GZcTYd5/PRXxqmJSUxXaYKFNNqO72VS3 EPDbchwTSVKTU0KgTwgOKHxMlQSCJGmDlXPWW5qWUJx5DtpbBuzevfvZZ59tb2+fWfoIlmUBoLOz s66u7pvf/OavfvWrzs7O9vb2kydPNjQ0PP3003/3d38XDAZfe+21X/ziF7Pd9puUh+IuJ8PTfT8a CMJW3Vq7EBC8R31S/BZHNykuS3E5MZQMXwjXrK1xLLLnqIkgcjUaODWiybestaUiqVQkFR9IGJxc 452N+fX+ygIlhy5Hr53U1FuEqSUjcjIijNxgLS73iq15XoUBTX1HEANZfVgGSKrqgKqekeXtnGEZ w8xh80sGOSFPZRwCAIPLMGkZhJD/swAAcA6uCrV2RYhPRWsHANbqznk+FUl5j/jE8M1lbE3RFEHh /UL0arR2Xa2trSq2582sW85gVKIYjjZUuMJU4DOuSkLk8lFh5MYt1+SjMh8VRm7Eb3zuWnYHY3HN TltLm0IkqWlaYuB8rPd09piFNFVKhKREKDFwwd6xztK0dDabWyZs3Ljx4YcffvHFFwu5yOOPP753 797XX399wYIFjzzyyNNPP71v376f/exnXV1dbrf7/vvvP3LkiMPhmK02j6c8dK+c45ORhuSqlYSS +9XpdLt9q1fPcbvGIjU22BUzAEQoqrgbQ2K9Me8RH0I3zzAmmqBJOSEjDQGApiLfcT9Jk2PHZgT+ nkD4YiRzgqRJxkxrsqYIin5BMZwa+mio5Z5mkq6GqRGKXDmRGLyQ+UxSNGWwIEVSU7wuYCkRCp79 Q82a+wkqxwN1SZHfEYTM9hwLQXAEEdHSY34Kod+Jgpska6nKN3DGemNTLGlwcpOUQDByOpiKSgBg dBsLbFg5wvuuT7Ekk0txj/cnvEe9mpJ+RzAmmmRIOSFrKgIAVdK8R32snZ38hyh/ZtYtpzhryoax uiddmit3CnnGpXgweOYDVU7PJAmCoI1WkjEAQlIsgABkPhY8e7B2/YMkM/nEvtyZsSQ1RTv16YeR q2m/fAKAMlgIklKEOEIaACCkRa4cJwjS3Lh4dttcOnR3d49xgNmzZ49+MDQ0pB/o4R3HFGtraxsf 9nHMSafT+fbbb2c+trS0vPXWW5mPTz/99CzcQF7KQ3E31rRyzoYxJ+9soy/Y90tIypyRYtLQx8Oa iiiWbLmHPGr/ZH6bCQAALgCAJZeXmZNFWw/lfXxGa6cNVM0aj6XJQjIkACANRa/FMtb0QE/A2mIh sqyVkatRXWsnCLC2Wt1dLtbK6mONIqrBM8HI1SgAiOFUvD9uX5jLYF9ZJIcu61o7AWCsbbe1rqRN Vn30VSUh1nsqOXwFAKREiPf3mhsWjal+RVHeFAT9uIthNrKciyQBQAPokaQ/pEQEoAF8kBL3mCrc FAcIYn1x/bBle3P+FRvanO9bVVKDZ0PhS+nppcFd+crlOBDvTyvuNavvo7h8CYzG+2YkBhNDnwzr x/Z2m2uZk7WxAIAQilyOBnoCSAOkIf9ngQX3NM9B40uJmXbLnKPSeBQ+Fjz3R6SpJM3YF64rsLGl TgHPuCLER07/XlMkAGAtTvvCdayjjiDIzLeBnt+pkqik+Hj/5/aO9XNzAyXDTCWJEBr6aFjyDgAA AWBdsMLctIRijfp3vL83eu0zVRIAIHL1hMHTkv4Kk4XX633ppZeyzzz++OMmUwkliSsPxZ1kOJIZ OzYbzTRrYdGoVVlNqf6TAU1FJE003dXE2dl5b2ZJoKnIe8yvS8Xg5Fq2N+squw5BEo5FdtpADR4a BgBFVFORlMGdtl4ovBI4GdCPa9Z4nEuc2VemDVRdd62ckJM+HgCEEbHiFXc1xUeuntCP7R3rLc3L sr+lWKNz8W2qmBDDXgCQYoExintQ094W01r7DoOxK8sfhgRYx7I8QkelFAD4VFUDqOz1CyEo6o5b Ro/BVDvt0UJNqamoJEVTQkBMDCZ0w7BOpgNXD1JsRBHiAMDZajjH5JsBbq0rDX/qAwCCgPrb6mxt N2MSEwThXOxQRTV4LgQAqZCIEJqZM2i5MONumXNUGoMmpyJXjyNNJUjKs3I7Y57D1fNSoIBnHEUu Hda1dqOnxd111xhfdtpotS5YEblyHABSscAstrk0mbEkg2dDSR/vAaA4k7vrLtbmufkdQZjq2hmL w//ZO0hTkaaKwcHxxiZMfX29vtm0ZKkQVQGpaPDQsBSXCRIaNzcYPVU3kGdI3IjLCRkASIZs3NKQ rbVnsDRbWGtaiUxFbnq4hs6HdX3IusDiXOwcXxEIMNWn551qqjRSZswl8f7PdTdWU02rpTmnRyDB OdJWN02+JeSVBvCWwMsIAcAdHNeVy4s9c1IFiOSNIFsBxPrSK7/29mlnr0AIXXvj+o0PBnwnArH+ eLbWTrEka6m6WXrGT8ZUv3BaFRFCQ594NUUDAM8qT7bWniHjPqepSI4XORr0XFNIt8wP0tTg5wcV IU4QhLvrLtZWuXfhmAAAIABJREFUM7vXL0FmLEwpFhQjPgCgGINzyaacO1AZU9pOpIrJwppZBsxM kgqvhM6H9WPXkk23aO2jMGanqaZVP5YT4cKaiSkO5WFxnwQE3iM+ISAAQP2GOnNjpbsc5CXWm15f cy11MpYJtzyyVlaf0OtDOABoKopeT78snIudE7liKmLaW5sxV/h+SqQpvO+qfmxpXjqRc6q+7AgA 1K3bzi7K8oimAYCTJNezuS1zTpK8i0tPMis7tgzSULwvDgAkRVgXTHvLoxSVMt7YYzB6jJXuNjwW hDTe3wsABEkZR8fgKRLvS+hzddbKOJfkNgCzVrZmTXrIr+zYMgV2y/zXDl/4JBUNAIBz8e0Gd9Os XrwUKUSYmd2onKOOpHPPw/UlJhj3pq08ZizJ8KWIvoetqa0zZp7Qj4uxusB3DQAUMV5wY+eUPQDT dYOsfHsiVIbiPnI2GOuPA0DNGo9ttq0mBeLS2raJX5y3P5cS+D8M/gohIAi4s+Fhozihn/2h8GtJ JQYA3YZ73WIjAIQCXpY5DAxwRlO3+T5CzK0NHfW9Y1f8ALDGvq1OXJCzjEkBgF8WfjvFRYoFKc5E AVCsMafpQkdOBPUD3WPByhLev9qnado7R44kBAEA7li9OuDOHdYDADIexFGA6Ow1fgw0TdlXmsPF 2zOdHE6qkgYAlmZLzlWg/NAmuvX+luwzgZ4R3i9AVfrJiMHBjFPBRFpOTpCGRs6mu2vtuhqCnGDG Q4Braa4Ft4qjwG6Zh9j1U3ygDwDsC9eZ6jtm8colSyHCVMWEfkBP6E2ExNCgfmRwVfgsaIaSRBAf SIuxqX3x+YnzCCE1bX0j6ZLeHfT/fXUmERX/9JVvz3pLSo2yV9xj12PBz0MAYG+zluBg402i4+fn L9+vGBpJag0AQBtskT4DQO4/LSfD/usRBEAQRNhnI0N6MQ8sSM8xrl/IPW0VRvqDF7wAwJhs0WgD xHJff30D9aVCb6X4cI66ug0785cRRvp1oxpjshndLQDgNhJ/v+KTxEBi0DoMVjC4uOGtF+ejuZPw CQAsvdRl4otjrMosBNnabWJQjFyJSjEpFZNIimDtLOfgXEuc9MQbsCiWoly3mH51fzCoSsU9sy3V VN8hxYPJwYsyH1X4GEFRjMlOm53Wlq6c21WTQ0ldbgYXZ26ocLPlVCiwW04E770a6z8LAOa6hdaW rlludKlSiDAz8bjkRChngeTwFSE4CAAUw1kaO+eg+SXEzCSpSmrmrWh1uMA/oe1ZGt0kQLFV9/Ks DMpbcecDvPeYDwA4O1vbXVvs5hQfg6vR4Josyy5CkctHdbcDc8PiKcbVkvlocuBC0nsVACiGcy/f VlWJMMaTXyD6EhAAWBrNAIAQEvxCYjApJ2VAwNpZzs5aW6xEkaKPW0nbSnbVvP05RVKi3riJMhMk Yb5sjnijBjAawAgAoAGMAIwA3ysuWLGgpat5Kn4vkiBFUjGgAAC667tpdsL3mIN0IurEbN1IKaAp kjgyAAAEQST6z+qewWlUWZVEiPiSw5dtrausC7rG+HeVeLecZ1RJTQwmAYAgIXQ+xPuEzFeaDIoo 8D4hejXqXu52LZ3QdXA8UtQfvnQYABiT3dG5cQ4aXooUKEzWXqu/S/Vg7ZampQRJjVYXY9dPJYcv AwBBUu7lWys7FuSMJamIaU2dIIk8G8rlRFgMpSNK5Y9GhSlZylhxl1PiwOFBpAFJEw2bG6ojpnih IE0NnT+kG4lJmrW15dPeYtd7ZD6qpnhNEpRUOkMta3E6l26hTaXlkjQ/TFEgmqIlh9Lbp8wNZiEg +E4EsjcBw1ASAIKfh2rX1ZobivDqHIm4Pzsyf9k3ksOXwze86Q83AMBJMQaSNSBVVsVkxnX9Sh/Y z9VYFyyf9ILCSH9w0A8AjMkmnbw3T8klLvIR9dWCWl9iCIG+0WDMKLOfb4wwkaZGr58EgGxhqopS 4t1ynkncSOgOwUgDXT2iDRRloDVZVfh0zgpNQYFTIwDgWjal5VxNFoPnPkIIESTl6rozZ2KHiqRA YZrrF0oRX9J3DQCi104mbpyjzQ6SomU+pgpxvVczJls1ZF+asSRpQ3qqgzTEJ2IAOR5hpKmhCx/r LxAAoCo9iW+lUravFYTOHf9IERQAqFtfW7XBH6eFnAiFLx2R4kEAIGnWs3J7nnBmCGnxG+cyT7gO Z6/xrL4vE1u3qpi6QJJDvL6TkuIoYUQI9IygXPsqpbg8+MfBlu3NxpoKj6SbnSrI6Gmxta5iLA7d GIw0JTF4Md53RlMVAIj1nTbVL5w0tHAm9w1rnXDvQaUyY2GOeAdwt8wm45AAAJZms2eFm7NzuglT U1HkciR4NqTv3Q9+HrS12zKK0YQgFDp/SN+t7uzcWPHBH7MpWJiEc8kmRYjroR5VOaVmLyUBcI46 z4q7q2EiNGNJUhzFmGiZVwDg2vlTYNs05sqqmAhfOiwnb2ZXzLN3C1PKlKsGFus9FQ4MA4C93VZq G1JLEP2J9Z/4ra61U6yxZs39+R9aORHWldTsVbdUNBA8exBp8+e1XzpMXSBCML24qcma/+QIQmBb YG3cXN/+YGvnIx2t97c4Ou36JRAC71FfdnDDykMVE6moHwAIknIt3exevpWxODMuHARJW1uWOxff rn9EmioGBya95k3FvcoGnkKEGQmmHVtxtwQAOSnzAQEASIpouL2u6Y5GzsFlHA9IinAtddZvTLtf agpKDiYmvWas95Se0sFct7BKNqTqFC5MKR4MnHo3T4D2VMQXvXoCcs41K4gCJWlpTlvQvTeuB88e TEX9mpxSJUEMDcV6T/mOv6n3Tx3aYKng7EvHjx9vbGy89957u7u7H3jgAUEQXn75ZY/HoyjpwXrf vn27d+8eX6y3t3f37t1jrtbT09PQ0HDvvffeddddXV1dn3766UR/94UXXnj55Zfn8MYAoEwt7mJo KN5/ttZJslaudn3lB8ctBEWIxfs/533XMpmqzPUd9oVrJ3UTZCzOpjv3ECQFQGiKJAT6IleOI00V Q0ORy8ecS8bO5iueqQtEHBH1A6QhxkTXbajLdjwwuAwGl4Gzc77jfgCQ4nIqJFawdZNkDA237QYA gmImWuEx1rYyfWdkPgoACj9Zom+E9PknAFRDbOxsChFmNJTWinC3BACKoxZ+qQ0ASJqcKOSltcXK 2UOpqAQAUkzKWSaDPioBAGOyVY9ru06Bwhy8fsn/WVoT4hx15vpFjNlBG62aLMrJSPzGOX2ymhi+ DCTlWNQ9p/dSXAqUpGeVOzG6AV0IDgjjjCCco46kGP18xVs9Hnzwwf379wPAo48++sYbbwCA0Wj8 +OOPt27dqmlaT09PfX39+GIbN+Z+eL/whS+88MILAPDb3/72pz/96aZNxVSBys/irqb40PlDuhLa uLEeu7ZPhCaL4UuHfUdfT3qv6lo7a3XVrt3hXLJpKpt7CIIkSFo35pE0a27ozFjyeN/1TDyp6mGK AtFUVQyn/YYJEhrvaMjpLuzosGdyYGXKVyQERVMGC2Ww5E0zSTCWtLPmGGek8cjJsJ4ViyCpqvJG gAKEiTQ1FknPdnC3BACSJhkzw5iZfIHqCeAcaTnnN/Vmj0qOxbdXg0dHNoUIM3wlcqnnMACQFOPu urNm9b2munbG4tS7usHdXLPmPlNtu144OXRRHd1cVJEU2C1JmmzZ1mSuz/FoEyRlb1vtWbk9a7my WqweFEVpmgYAu3bteu211wDgxIkT3d1jZ4CZYvkhSdLj8YTD4Z07d95///1/+Zd/qSjK1atXt23b tmvXrl/+8pcA8O///u9vvvkmAPzwhz88dOiQ1+vduXPnzp07f/jDH46pOLM7Kj+tN3LlmB7DuGHB IlNN5e+gmgEIaYmB894jB5LDV/TnmrW63Mu31q57oJBJdiaHCEKaKlXy23OK5BSIkIzrW4sAwL3c bXBNMEcigHOmX76qWBU5I/JDkGldh2IneaizHNzdVR7aaCLGC1MRE2h0TMLdcupkAuzQxny6eGZU Mtd3cHYc3yw344Wp8IrvZDreuHPpJmNNa648d4Sjc4N+FmWttlUzebolY2Gatzat3XKvbcEKo6eF s9caPS32hevqN+6ytq6U40FVTi8ITx6Arsx55513duzYsWHDhuvXr+/cuRMAli5deuHCBYTQgQMH du3aNVGxnLz33ns7duy4++67H3300R/84AfPPffc3r1733333cWLF7/yyivPPPPMd7/73QMHDjgc OWxJ//qv//qtb33r9ddfTyQS//Iv/5JdcWa3VmaGAWHkhp5ijaTZhcvXXYKTxW5RySEnQsFzH2WS zLFWt611lcHdOFHiTwAkRdNr6IzVlRnyx0OQN6d5BFXBaVMLEoiUEke/BUenPd+fGfUhnkGg6Moj M/OhjZNkCqxaB/epM16YmoS75UzQ4x8AQJ4s1Nmjkn3h2nlqWRkyXpih82GkagBgru8wenKn8wMA kmYpo1Uf1KpwsXc8k3RLAjz1Tbb2HBPITIZa1uqe9E1b7uzYsUP3gclm9erVp0+f7unpefLJJ/MU G8999933wgsvKIryox/96JVXXrly5crJkyfff/99AFi1atW1a9c2b94MALfffnt2Ld2mfvHixaee egoAfvzjH//FX/zFpUuXMhVndmvlZHHXVDly5Zh+bF+4juEqOZjrzBCDA/6Tv9NfcLTR6u66q3bd DoO7aWKtHTRF9ve8q/9Daj4bW8ZflqSZCk7cUKBAMoo7a2UpduLlTgSZSHwGZ0mnr5sHENL0yRJB kJxrwkzdOpkdbFhxz0lOYWoy7pbTBmlIGBEBgCCJnO4HMG5UquwQ44WQU5hJbzo+6WR7eVFGX8eh x6fSLXOiKZIeLB8AzNW0eTqb3bt3P/vss+3t7XlC3eeBpukHH3zwwoULnZ2dDzzwwP79+3fs2NHZ 2dnR0XH48GEAOHbsmF4sHA4jhPST7e3tJ0+eBICnn37a5XJlV5zZXZSTTSV2vUf3b+NsNeaGKu12 eUgOX45cOqKby6wtXba21ZkcFnnIjOgAkD99uhDo1w8MruY8M4Fyp0CByFLGwT2fiPiAICcVAGBM 9IR+C2WOFA+OnHpPP27Y9OU8jr+Cv09TZQAwuJvIvIs5miLdXE2qGh9NKFiYmoy7ZRoxKN74cFA/ 7tjdnmeXVLw/ockaAJgbTRNlnq/yUakQYSINyUmZBBImW2eTE2E9yCZBkJn9GxVGgd0yMZDQA0Ea PYaJntzY9VO6QxfFmaoq6lE2GzdufPjhh1988cUZX6GxsfH48ePPPPPM3r17X3/99QULFjzyyCPf +973vvWtb/385z+3WCxms3nz5s1//ud//uqrr7a0tHAc9/TTT+/bt+9nP/tZV1fXD37wg+yKM2tD 2SjuciKUHEynjnd0bqxgxXFmyHw0cvkYSueWu8vgappixWxXEEWIT5RZSU0lE6PyN1d0xukCBUIz aV1fikkIoZzTek1FvmPpKMWuLlel9mWSYrRRO5mcCLET+P5qcirW2wMABED+jGCQlayb5kwVHMts PAUKMzMFxd2SZEg9DDYApMKpiSLnqCl15MwIABAEeFa4c5bBo1IhwtRkLbMRXRUTEz3OSFP1TLSg z0XzGlPKlwK7ZeRKNOnlAcC5xJFTcZeTkeTwJf3Y3r52Kka9sqa7u3uMA8yePXv0g6GhIf1A36g6 plhbW5t+Pps1a9boIWUAoLm5+ejRowDw9ttvZwp0dHR88MEH2VUOHjyY/fGtt97KHGdXnBll4yoT 6z2l25KN7qZKnXMXAIpcOqxHkHB33Tl1rR0AKM6YeRVmNNExKEJs5MyHuhlP3+9ScINLlwIFYnOO DksqCl+IjK+rKZrvqE+KywBgcHL2jorNQkBxpkxqqlj/WYAcgTk0WQyePaiISQCwNC9jzJM82lUY EkGnQGEy1nS+SdwtaROdWXYIngvlEiSoojr40ZC++OBc4swE8RgDHpUKESbFUhm7cmLwYs4ujTQl cumIFA8BAEEQttYZ+gSXPgV2y0wOyuRQEo3LwKCm+ODnf9CDyxk9Laa6ttm/gQrC6/X++FZ4vrSi cZSHxV1OhIVgehXJ0txV3MaUILy/LxUNAABnr2XMDlWcPFcIZTCP2ocI1uoWw8MAkBi6CARha12Z DjaHkCImeO/VTMZQ2mitggjuBQnEZLEZ3QYhKALAyJkRTdFcy5z6+KTJGu8X/CcDepxd2kA13tk4 M0+7soCgaIO7Sd8OJYaGQuc/sS9cm3FR1eQU7++N959RJREADM4G+8J1k14zo7gz1txG0EqlQGHS RpvdVQMxgKrvliRNmhtNiYEkACSH+eEj3ppVnsxOXDWlxvvjwc9DiqgCgLne5Fk9kbkdj0qFCZMA 6wJL4loCAHh/LwDY2lbRxvSMUZNTYmgodv2kMhr/0dq6qoJnRwV2S4PbCBABACkue4/45OUp3SyL NEXw90WvfabKKQBgLU7nkk1VuDQ0Lerr6/W9pCVLeSjusf4z+gFrdXGOSjb3zgzed00/SEX9w0fG rvKMh2IMDZtvOlfZWlemIl59Op4YvJAcvEAZzATFKEJcD5itw1pc7hVbK3WlMpsCBVK7rubGBwOa ipAGwc9DofMhxswAgG7OTNe1sU13NDCVHrjD3r42FR7WfTx4/3Xef51ijRRn1BRZFeIZu5Cpts25 5PYpxHZEUjytuHPVtzO1QGEuWb3x7Cdv4G4JADWrPLxX0D0TYr3xWG+cNtK0kdJkTU7ImdjYtlZr 3ca6ieYweFTSKUSYnpVucUgECQCA9/fy/l6KNVCsSU3xatZeIwCwNC2xta6YnzsqFoVI0tJiNtUZ eZ8AALH++B+u/48vaQKCzB6zWJvHvbwqRvCKpwxe0DIfFUd3AVqbu/BkcQyanEqFh6dVhbW5s8XI 2mtdS7eELx3WdQIEoK+2ZyAp2tK01Nq6Ik9sxEqiQIEY3IamuxqHPvGqKRUAkHaLbkSQ4OhweFa5 J9ruVknQJptn1T3hi4f1RJ4AoEqCvs9Mh+JMtrbV5vqFU3muZT6mKTIAEASR8f2oHgoUpt3lwd1S h7WxzduafMd8evpJAFAEJRNiDwAYE+1e4ba32ybqlXhUylCIMGkj3XrPAvZQA4TSbseqJKrSLSo7 STOORRtNde1zeA+lQSGSJAii4fb6oUPD+mIvQpqclTWZIClL01Jb26rycm23NXXQ0wweqM00pVF5 UQZ6WLzvrD7VpA1mY01rkVtTegiBPpQ/rd84WOtYa6Wxto211yaHr0jxEVVMKGKSIEmSMTBmh8HV aPQsyJupsQIpUCCmOtPCL7ZFrkbFEVGKS3JCJhmSsTDmBrOt1ZonJnTlwdpq6jZ8UQjc4P3XVTGh iAlAiGSNrMVl8LQYPc1Tnw3e9JOxOKtkDjmGAoWJu2UGo8fQtqM1PpCI9cWUpCInZaQBbaQ4J2dp sliaLSSVTxfHo1I2hQiTtbJr7rjvusmXHL6sCDFFTGopHgGQFMPa3AZXs6mhI3+kqUqiEEnSRnrB vS2x/ni8P24O2YlQjKQY2mg1uJtMdQvLMYzmPY6S9lcpImUw+LmWbXEt21LsVpQu5sbF5sbFhV+H 4kyTxvSoKgoUCMmQrqUV65E5TQhjzQJjzYQJVqaIub6jasMPZ1GQMHG3vAkB1haLtcUyg6p4VBpL AcIEANbmwWkZ0hQiSQJsrVZbq3WzsHv4gjx5eUx5UvmrohgMBoPBYDAYTAWAFXcMBoPBYDAYDKYM wIo7BoPBYDAYDAZTBmDFHYPBYDAYDAaDKQOw4o7BYDAYDAaDqRCOHz/e2Nh47733dnd3P/DAA4Ig vPzyyx6PRxmNF7lv377du3ePL9bb27t79+4xV1NVdd++fXffffdtt932D//wD1NvxgsvvPDyyy/P 2l2NghV3DAaDwWAwGEzl8OCDD77//vu6av7GG28AgNFo/PjjjwFA07Senp6Jio3nt7/9LQB8+OGH hw8ffu+9965evTpfN5GbMggHicFgMBgMBoPBTBeKojRNA4Bdu3a99tprW7duPXHiRHd398DAQM5i 46mrqzt+/PihQ4c2bdr04YcfAkA4HP76178uimJTU9Pzzz//wgsvnDx5kuO43t7eX/7yl4ODg48+ +qjdbhcE4Rvf+Mas3xG2uGMwGAwGg8FgKod33nlnx44dGzZsuH79+s6dOwFg6dKlFy5cQAgdOHBg 165dExUbz8aNG3/605/+93//95o1a77zne+Iovjcc8/t3bv33XffXbx48SuvvAIAJpPp3/7t31au XPnRRx8988wz3/3udw8cOOBwOObi1rDFHYPBYDAYDAZTOezYsWP//v1jTq5evfr06dM9PT1PPvlk nmJjuHbt2qpVq55//vlEIrF79+7XX3/9ypUrJ0+efP/99wFg1apVgiCsXbsWAKxWq6qq165d27x5 MwDcfvvts39j2OKOwWAwGAwGg6l4du/e/eyzz7a3txMEMfVab7zxxn/9138BgMViWbduXSqV6uzs fOCBB/bv379jx47Ozk4AIMmb6nRHR8fhw4cB4NixY7N9BwBYccdgMBgMBoPBVDwbN2589913M34y U+Sxxx47evTovffeu2XLlpGRka9+9auPP/74q6++unPnzoMHD+qKu47BYLDZbN/73vf+6Z/+6ctf /jLHcWazebZvArvKYDAYDAaDwWAqhe7u7jEOMHv27NEPhoaG9IPXXnsNAMYUa2tr089nYzQaX3rp pewzLMu+/fbbmY/f/OY39YMnnnhCP/jggw8KvIU8YMUdg8FgMBgMBoMBr9c7Rk1//PHHTSZTsdoz Hqy4YzAYDAaDwWAwUF9f/9RTTxW7FfnAPu4YDAaDwWAwGEwZgC3uGAwGg8FgMJgSgvvrjUBOI/YL AACam6aUGFhxx2AwGAwGg8GUEM+/+tLkhcbx2GOPzXpLSg3sKoPBYDAYDAaDwZQBWHHHYDAYDAaD wWDKAKy4YzAYDAaDwWAwZQBW3DEYDAaDwWAwmDKAQOiWXbj//O/P8eEAENPcyVsMCABEaMVuRW4I dFOACMpAmLMLAUBq6ixdi9AIAgAQQkCUwTyTIABB6XdLojo23wMAUEgDNMu3iwAQSY4el8cDXrI9 kwAiHQuCAFTyUSEIIBAq3V88LcpykGQGAsjZfkBnhZs/Myq392WpiVTvlgaD4bvf/e7Ua/385z+f wd/SN6ceP358586dXV1dkUikpqbm17/+9YEDB5544gmv10vTNADs27fP6/V+//vfH1PM5/N9+9vf HpM89Utf+tIPf/jD9evXP//88y+//PLvf/97AFiyZMmRI0ccDkem2E9+8hOz2bxv374ZNHtajI0q g1RFV5Pm+g/PCkQJv0AzEGUizNlFI2dZySYIojy6JQKiDDS5cnhyZgmNIObUElE2D3jp98zSbyEA lMUvXiaSHKXUX0dloWncSim2WJKk+fxzDz744P79+wHg0UcffeONNwDAaDR+/PHHW7du1TStp6en vr5+fLGNGzeOv9Qdd9xx5MiR9evXHzx40Ov1iqIoCALHcdlaOwD87d/+LQC8//77x48fn9YUZbqM 1a6IcjBqYjAYDAaDwWDKBd3UPf9QFKVpGgDs2rVLN6WfOHGiu7t7omLj0RV3hNDAwMCf/MmffPrp p8ePH9+yZcvg4ODu3bt37969d+9eRVH279//8ssv/+d//uerr756+fLlubujsXI0WB18LHQMdc3d n5x1FruIP/t//3XWV8NnQPTOuy4uWqhpWiQSURQFAHhTcrDxRrHbVTS6udvoA5YZVDRvp3ieBwBV VcPhMAAAAZc7Lsxu80qf9dwG5oCtkCtkJAkAmW5Z5/NvOH58FtpXTYQfevCix6Mfl123XMwubTnT oUnFeUlSJopqV2VZzvmt1+vVv6r3+rpPnJjfplUCp/9qX+ZtGQqFCIIgAB5667fFbleZkf2AQ9bb snFoeN3Jk8VrV/mhWCyf/9nXBEHQP2belizLzmcz3nnnnR07dgSDQYfDsXPnztdff33p0qVvvfUW QujAgQO7du167rnnxhfz+/3jL9Xd3f3Xf/3XV65c6ezs3L59+wcffGAymbZs2TI0NPT0009v3rz5 q1/9an9/v174G9/4xvHjxzs7O+fu1sYq7gRJARAhKEhXmGdklmwY9sIEU6X5hFGUXo5TVZUcdRRR KCVuiRe3VUWEMdFM3DiDiiYTrb80b86AEVShJGkjzc5IgBkykgSATLfkUmLD0HChjasyyKyBJyNS gPLolgHa/2cf/N7Q21vshuTg1w//SdDtAgCDKOBuOQOumEx6h1QUhdC9whDCkpwu5ASapRF3y2ki Ox3XjEZVTe9zm8iMPdfs2LFD94HJZvXq1adPn+7p6XnyySfzFBsDx3E2m+03v/nNtm3bNm3a9Mwz z9jt9j/90z8lSfLv//7vX3zxxXPnzs3nbeLMqRhMSWNdbCxkMYllCYslvegRCoVmp00YDAZTWShO Z53alPkYgrACSp7ymAkhSSvv4OJW/ZOCZC94i9uiDLt373722Wfb29uJaW582rJly09/+tPDhw8b jUaKonp7e1tbW//mb/7ma1/72vbt2++7777sQC9ojh1AsOKOmUMIIOwrzTOoSNOq3W4HAEVRvN5S eebnn2Fl6Eu//78kmvlUHv2eyOylC229S7x1Mw1m6mhGk8lk0o8n8vrAYOYfU8xmVK0AkFJFP+RY 6MdMBToc9p4MZz4qS1UoaLGzitG02HkhcSXtKqMxKqwoboNusnHjxocffvjFF1+cbsU77rjjf//3 f1taWgDgzjvvPHPmDEEQu3bt+slPfvKLX/xi4cKFv/zlL5uamgCgubn5e9/73iOPPLJ48eLZvwEA wIr77IKMxhq1AakoimISzOsG6tJkQLmx+7/+uZAriAbD5f/na7PVnrIDAaIDAXKW1uAIBRuQZg6Z EuV30y9RkyDbAAAgAElEQVRMhdKgtbjNwWDS8L2p6OdJAFA4CcppexoGM1d0d3ePcYDZs2ePfjA0 NKQf6BtVxxRra2sbEwtS56GHHnrooYf04x/84Af6wbZt27Zt2za+8NGjRwtp/KRgxX02IQTB//uI KmrSYgVmYmjGYDCliqZJ0fTMR6FnKU0BBoPBYEoJr9f70ksvZZ95/PHHM8utpQBW3DEYDAaDwWAw GKivr3/qqaeK3Yp84KjtGAwGg8FgMBhMGYAVdwwGg8FgMBgMpgzArjIYDAaDwWAwmBLiscceK3YT ShRsccdgMBgMBoPBYMoArLhjMBgMBoPBYDBlAFbcMRgMBoPBYDCYMgAr7hgMBoPBYDAYTBmAFXcM BoPBYDAYDKYMwIo7BoPBYDAYDAZTBuBwkBgMBoPBVA6IILx/ta/YrZg+BKExNCnJRfnjwsJ2u2LM fAxSabOm2Nrq37u3KE2aGcjAEWKqmA3gOKODBSL9USWUIjamIsGKOwaDwWAwFcVfy93FbsK0qTER HcvfvCZfLdLf/wSyZLbswgqjaASAE1TdL0ydRWrSTLj7tg8+l84WuxUnYFH6iFGYlWfXFLUxlQZ2 lcFgMBgMBoPBYMoAbHHHYKqOVGtruaykI5pSTWY6Fit2QyDV2GBXzPqxBFKguK3BYDAYTFWCFXcM puo4gxz/LS8tdiumhJuGzoVvXVOKtXp+K670/7TErDqHF38xGAwGM99gxR2DwWAwxefS0nWfbfpa sVsxbUggOtrOedXhYjWglupltrEAoAoqnCxWKzAYzDyBFXcMBoPBFJ+wACcFrditmDYkAYaWgXPS 58VuCHApbjmsKnYrMBjM3FKmijtKRXzJ4SsKH1WEOOVg/yeZrCeJDSxnJIjJa1cNCKHkEJ8YTIhB URFVTdYYM81aWc7J2TvsjCnfr19I3YpEk7VYX1wICHJSlhOypiDGwrAWxtZmtTRZYOJ+1//eDSEo Tnp9+0Jb/ca62WxxWSEE+kLnPkIAjkUbLE1LJio241+hqoj3J4Y/HUYI6tbXODod06p7SZHfFAQA 2M4Z1rDs3DSwbMjXLREaPPQy0lQC4NDlawF1SrseFn6xjbEwc9LWkmeKz7iaUuM3EonBhBSXVUEh KIIxM6Z6k6PTUW3jjv/kO1JsZNJi5voO55JNOb9SRDV6NZocSspJWZU02kAZa4yORXZjjTFneUxZ UH6PgZwMhy98IiXCN8+k1AFVGVDQGVnezhmWMVX6WhyDEBC8R31S/JaYuFJcluJyYigZvhCuWVvj WGSf9boVCILI1Wjg1Igm32IOTEVSqUgqPpAwOLnGOxtzDipyQp6K1g4ABpdhdlpbhojBwdD5QwgA AFibJ3ehAn6FqiI5lBw+PIwQAIDBPb1OdU1R3hIE/biBoma9beVF/m4pJ8NIU6d1QYqjGHOVDk9T ecaRpg1f8F7r6b3lGVeRKqXEcCp8MVKzxuNcPL2JaPmiCPGpaO0AwFrdOc4iCF+OBHpGkIYy52Re kfvisb64s9NRs85DYENneVJmg5wQ6Atd+CTzuqQ4E0mzBJnQP6YQ+p0ouEmytuqHnFhvzHvEh24+ sMCYaIIm5YSsP8aainzH/SRN2tqss1i3AkHg7wmEL0YyJ0iaZMy0JmuKoOhSEsOpoY+GWu5pJumx 8VVjvVMNh2JwcrPU4jIjFR4OnvsjQggACJJiLM4chQr7FaoH3scPfTyMNAAAkiI4xzQ6Vb+qvCHw +nNPAXiq+y06abecolKVjdFtqM5Foak840hVhk59xFJ9mqoBAEEAbWZIipDi6XEHacj/WYAgiSqx GfG+61MsyYxT3BFC3k99sf64/pEgCcbCaJKqiGndKXw5Qhko93IXYMqQclLchZEbwXMf6cfmuoXW BStokw0A1tUR2468/QdBQAAawAcpcY/JXNSWFhnex2c0b9pA1azxWJosJEMCANJQ9FosY7YM9ASs LRaCImalbkUSuRrV9UWCAGur1d3lYq3pnHCKqAbPBCNXowAghlPx/rh94a0jCoJYX/rV2bK9Ob8x mDaX08M4W0hR/8jZg5mpOGt1EUQOtbugX6FqEALC4EdDmpqec3MuA0FO9fEcVNXXeD5jQK6jqlpt n0q3NNa0cs4GACAJ6F73x4vyhdyXiklDHw9rKqJY0rN6gtWkimZKzzhCwc8PUgkvWwsEAa5lLsdi B22gAAAhFO9LBE6NKIICAIGegKXJTBsr/m2JeH9aca9ZfR/FmfIUpQ2WMWcCPSO61k6xpGel295h J0gCEIghcfiwV19LD50LOTrslKGaH/RypWx6v8xHwxc+BgACwLl0s6luYeYrkiRWNjbF47FjyQQA DBOEVFtTFJubZjaRHAkAuXSP+WqDirzH/OmFcifXsr1ZV7t1dHMFbaAGDw0DgCKqqUgqs55eSN15 YJv4N/P2t3REgf/o2G/a1A4AWLK6u62zCwAgK5k0WoFOhN8P+ocBoGlo0YrGzdnVI8FAKvw2ADjc NbfZHpjkj+XKUW1DBEH8T0H3UMLIidDImQ+z/Q1Yaw7NRuKlwMm0A3HNGo9zyS3mOtpA1XXXygk5 6eMBQBgRq1NxF8OpgT8OacrNlTKja6rmdr+q/kbgs/OSV7OfzBS7JclwJMOBvjnVamCkHD4wakr1 nwxoKiJpoumuJs5edXsGpijMWN9pMew1M8Ca2AW3t2QPKwRB2NqsnIPtf++GpiJNQcnhZMU/41Js RBHiAMDZajjH9PY+BfpGdDMHxZIt25tvLrsRYHAbmu5s7H27DyHQVJT08lWxbF5xlInijlDo3Eea qgCArX1tttYOAC1W4j9+tJWP8T1vntLP8F9cbbQVYe8FRyAXeQMA1LMSJOb/7wMAJG7E5YQMACRD Nm5pyNa8M1iaLayV0afd2cp3IXXngf85r0xeaFaJXD6V8MkAYKppjSqdR3M1IC7URkcGAeAa4s+Z lVurX06MaADgdLX1zajx6+rJLyBUkYsacjIycvr3mipTrAGpiv5053R+HTqXtiJbF1ici3M50hBg qjfpiruamp7bcWWQikoDBwc1WaMNlKYgTdEAwOCe0jtwRNN+JfASQiaCkAFkhKCKFfepd8tJQSoa PDQsxWWChMbNDUZP1W1imaIw1RQf70/H5Om4fWHQncMHiXNw1gXW6PUYAKTC0hw3vPhk/GRM9Qvz lxwD0pTek736ccPt9eOd5Vgba24wJ4aSACDFK1+SFUl5KO68v1dORgCANlotLcvGfEsSxGX5EjIg cmVaw+kjeym5mAPPErTMDGNXr+aHWG/aN8O11JknfAFrZXXlWx/jC69beSBN4X3pvD+W5qUwgXeq KqU381GGWxy0ENJ4fy8AECRlrGmdw4aWIYoQHzn9viqnSJp1LbsjcOp9/fz4QR2pSuBaeiB3LnZO 5CKsiOl5URVu/pMT8sCHA2pKpViyYVP9jQ8H9fOGKWiKEU37FZ8UETIQxING4694Xj/fQFaj4j71 bjk5CLxHfEJAAID6DXXmxqrz3py6MBMD5xHSAMDeuMheHwzKuTcPcE4OrgMASIkKVzcLGTsSN86z cgoALE3miXoda2NBV9xjFS7JSqUMFHeEtFhv2pTuWNSd0wUWAIAA19Jc1riiYiWtK9n5C6wrCVJk JGahrEDAhsXdBnbCkTslyGbKAgArPCucrKPAuhPhpnLtdi8TpFiQ4kwUAMUa84zcciKoH4xZ0BSD g5oiAYDR00LSVbdEngc1lRw59Z4qiSTFeFbdo0npqDsUaxzvyinGgqyJZQ0sbaSMEy/viKG0p5Gp trrCnMm8cuODAUVUSYZs3tqUWXCgjTQzmR9wXNP+l+d5hFiCeNho4kc3pJsJwkJW3QbfaXXLSRk5 G9SdjGvWeGzttllua8kzHWEiYeSGfmRv7gQITnRNNGonorgKn1XOeOxAmhofOOeqAwDIs/H05lp6 RS7mVgFloLiLwQFFTAAAa3UZXE3Fbs70CEZdx4+MXSKYO8TQUFJgAIA22j4+u36iYnIy7D8/gAAI ghCv7iD7DQXWnYj1DWX8huUcdXUbduYvI4z0p6IBAGBMNqO7JfurzNYiU32HFA8mBy/KfFThYwRF MSY7bXZaW7pmoBCUO6okBE69r6R4gqTcK+9mre7MtJy1ecaPJEZnXeedq64pV/NcMzGQ0E2brI01 N1WRaVMRlIEPB2ReIWmi+a5Gg9swciat90wawCSB0P8KfBxpNMBuo6meoj5JpSc/DVSlbzkfx3S7 ZX5i12PBz0MAYG+zlqA5aa6ZljA1WdLHdwDgLPmCnAgjae2fNpSB3lIIMx47xOCgpsgAYHByBueE Q7MqZeLylfEAXc2UwQMg+Pv0A4OrGQAAoVTUJ4zcUMUkAKJN9mGjG3UiwD0QwOBqNLgaJymEUOTy Ud22Zm5YTDKGwutWITIfTQ5cSHqvAgDFcO7l2yArJq6mSOLIAAAQBJHoPytGfDdrqrIqiRDxJYcv 21pXWRd0VY/dQ5NTI6d/rwhxgiDdy7dy9lrICqs3A4cEKSaFL0Wi12IAQHFU0x0N1ROZWE2pAwcH pbhMkETjlkY9o4o4mjQgv5+MgNCrfDKiaSTATqOpmaIAYHh0B2EDVQbjwiwyu91SCAjeYz4A4Oxs bXftrLe2xJmuMDOuhgRBwsQPbyqSSnrTfly0sZIH+0LGjozGb2u35RlVtNF1OYqtZElWMKX+gkaq IgQH9GODu0mK+sOXj+r+7mmCg2d5cvhqX+26GnND1dkvpwvS1ND5Q7qRmKRZW9s03HgKqVsZxK73 yHxUTfGaJCip9CjCWpzOpVv0yKQZhECf7rWJENLfvBRjIFkDUmVVTOozH6Sp0esnAcC6YPn83kdx 0BRp5Mzv5WSEIAhX1x2js0QkxTODes1UrjNyJpiKplRBVQRFHg2FYnBy9bfXs7ZqcUnSZG3gD4Op qESQ0Li5Pv3qQyCG0op7HreiFEK/FvigphEADxmNbTQNAAjAq2YU9yoazmerW+qoojr0iRdpQNJE w+aGakspMANhUmzatw0hTeZzZ71AKhr+1JtJJFTZqWdnPHZoiiQG0/tbzPX5dKFMakUax4IsT0pd cRdDg3okKYrhpKg/evUEylVMjkuDfxxs2d6ME/nmQU6EwpeOSPEgAJA061m5XQ9nNtd1KwOEtPiN c/orNQNnr/Gsvm/8vovs3BlGT4utdRVjcejWEaQpicGL8b4zeoyFWN9pU/3CzOhVqSBVCZ79UIqH CADnks1GzwL9vMLH9bVdgiDYvAvl6etoKHQ+nJ0LEACMNcaWu5umHrO83NEUbeCPQ2IoRRBQv7He 0pzeBy/FJVXSAIAggZsgn5eM0G8E3qeqALDDYOyk0zpQWNNSen4cgLqqcXCfrW6ZvhpCw5969XDj detrqy3448yESTIcxZnUFA8Awetn4Laxl5WTsu+oPxW9uY1yiuGSypQZjx1SPKgPT5yZY60T9z0E GWFyE7vTYEqZUlfcdfsuAGiKHLl6AgBMNa1GTwtjcZGcUeFjvPcqSFcAACHwHvW17mglq84/c3JU MRHrP8sPX0mnRWSNnlX3MOYp5Y4upG4lISfC+muRIAhA6X18qWggePage/ldBHnzUVLFRCrqBwCC pJyLbxsTvZQgaWvLcpozB88fAgCkqWJwwNzQOY+3Mt8gTQ1+flB/lh2dG0117ZmvpFj6AWfMTmIK HhqpcErX2gkSAIH+M+iJhxrvaKyGZx+paOijYd2nv3Z9bXYY5oyfDGfnctp6FYADgjCkqgBwr8Gw jLlpuRweNbfXkBRTHe5Gs9gtdYJnQ3pMUnu7rdo2pBYiTKOnJTF4EQDi3usX/xBQOiXWxiIEqXBK GBHCFyPZ4csYC1PBduJCxo6MP5Kt1qYQE4aLkZOyLs8803tMiVPqintmiQ0hjeJMzsW3Z/ths1Y3 a3UvYzz9Zz8FACkup0IiNrpnowixeP/nvO8ayoSMqO+wL1w7Fff0QupWHozF2XTnHoKkAAhNkYRA X+TKcaSpYmgocvmYc8mmTEmSMTTcthsACIqZaF3CWNvK9J2R+SgAKBMsEFcGCGmhcx+JYS8AODrW mxsXZ387XU9izsl1fmURSRJAgCqpiRsJ/8mApqDkMO8/4a/fOL1MJYVDADGfecE0TTt1+KA0VFOj ZwRr7gLx5rfnhg9zyiUAWGBbsky8xXRJk/Aff777/LGDYd8AALR2rX97YdfbWQV6zxzx9V0CgLrW xYMrx5k95xL7yClKnu+0F7PbLQEgOcyHzoUAgLWxteun4V1TARQoTHv7WjE4qG9RDQ+Gw/3hMQVM tUaSIRODScjrA1YBFDJ2yKPKksVpjsCEijvvTzt5cg6uGiwdFUlJK+5IU+V4SD8mCMK9fCtrzRFe sKm9k+lj9VQCYjiFFXcdTRaj13sylnIAYK0ux6KNUxmKCqlbqRAEmcmIS9KsuaGTIOnQhY8BgPdd dyzakDEmERRNUZNG8ScYi1N/+Y5xv6koEAqf/1jfpmJrW21pHhthSXe+AoCcj/Z4CPKmNZhiKXuH naDI4cNeAIj1xmvX1cyzVzFC85gXDKHQ+UN8oB8AbG2ro8riMRnB/Of8UkIDgGG348yYVqXr3tDr 9huW9g/d0uv8vQEpgQBAkF3+oXntkFsINN/JG2e7W6Z4afjTYd2+Ub+htrpc2wsWJkHRnlX3RC4f hcTwmK9IinB1uVxLndfeSDuQVHYeq0LGDmlUWTI7zBEYO/nJkBxOK+5YUypfSlpxV8REpl9aW1dN +NgThMHJ6Yq7KlZj3sQxIKQlBy/Gek9ranoPCmt1WResNHqaJw1gUkjdasPgTgcnRUhTJZ42Tm9x PONdQ7EVu6k6cvkoH+gDAGvzMlvrijHfIk2Rk+kBZlpbALOxjMZ/RBpSBCWfc2eZU4gw5+GHKCNm XRrXjl/TdxfYF9qqTR+aFWHSRqtn1XYTP+x0JpWQrKZUiqMMHoNtgZU20UJAUEZHdnNDFcV7nYhc YwfS5NGIUhOnjUca4n1pxd22YL7ny5jZoqQV90zWBoIgLE1L8pREato0TJtK+o7mATkRCp77SBHS OVBZq9vWusrgbpyK2l1I3QoCSaM7KxirK9t5fQxE1h4+gpp2oANVykQ3q8wXKEJa0ncNAAiAVMTn /+ztsQU0LeOFFTp/SO9lrLXG0bkh8ysIqckS9GbtSSWZinV+LUSYhf0QlcasS0MYuREMBwGAYsma VdW1JjmrwiTMnqaWFc2ynBrzRWIg7UlldBsqO6TMFBk/dmiKnJEzw9KQM4gHQGIgqc8wWStjcFXy 2kVlU9JqbmYGSRttefKHIYRSkfSjbqjuzRZicCB47iM9Dg9ttNrb1xprWqaodhdSt5LQFNnf865+ 3Lj5K3kU94x/IUkz1MSJZnOCkKYrpgRBcq6GmTa2pJHjIb07IQApEcpfOFOAczRA1q+QoKFrgzVP loZM1m6KJenKzSdSiDALqVt5zK40NFWOXD5m9gAA1KzxUJW7bzIn89C1VEmNXk+/aatty29Oco4d GWWJIAiKpkDOXTdyNR1K29aWL9A7psQpccU9rY4TZL63YWTEJydlAGBMdDVPIpPDlyOXjugzbWtL l61tdX65zVbdCiPzBgSA/OmmhUC/fmBwpf2IpHhw5NR7+smGTV/OE49C8PfpzkgGdxM5fWt9WZDZ lDYt9H0U2b8CxVIwsQdcxhpnbjRX8FBUiDALqVt5zK40Ytd79JQORo/B3m4vqGVlSIHCFEb6VZEH ANZeM5ErbPBMSDcSMybaXrmKe4FjBxqNCoUQ0tTcS5RCQOB9AgBQLOlYVHV9tZIoacU9ozbJfBQQ yplWDWnKuc8O68euLlcFj9z5kflo5PIxBECQlHv5XQZX0/zUrTyyTeyKEB+TWSmDmkrqIcwAwNyY DshFUoweYRcA5ESItefOm6jJqVhvDwAQABWcx8rSvNTSvDRPgeFPX9XzJnpWbh+TtTf7VxDjIkyw C0DmlfCltA3J0VHJQ1EhwiykbuUxi9KQE6Hk6Eugrru2CkefAoWZHLoshocBwNK0NKfinopKGSOx Z5WHqNwoKAWOHdkhaIS4AOM2AiCEfCfSLqDu5S6qchcnq4GS3vzOWNPJGpCmxm+cG18AqUr44mE+ EQMAg5Ozd1TsdHwyUOTSYX0jr7vrzmlq3oXUrUAozpiZMWZU8zEoQmzkzIe62cPoaeFGX7IUZ8ok Y4r1n4VcnoaaLAbPHlTEJABYmpcxZues30JZoKb4TLbz8ebM7F/Bd8kHuZDi0uAfhzRZAwBrs6Xa NgVmk1+Yc1e38piWNGK9p/Qn3NXk4hxV7aWZk0mFmckHksm0mI3CK0OHhvT4FJZms621MvcC6RQ4 dlCcMeOuOXRxaGxNBN4jPt2jmLUyjs6qS8NSYZS0xZ022libR1+Mi/X2IE2xtizXl5A0RZKi/siV 44qYADdJG+jGOxuJ6sgbMh7e36dnvuDstYzZoYqTB0WmDGbdu6OQuhUKwVrduh0oMXQRCMLWujJt z0BIERO892omhSpttGZHcCco2uBuEkZuAIAYGgqd/8S+cC3Fpc3Fmpzi/b3x/jOqJAKAwdlgX7hu 3u+uVMgsstNGay6XpJu/gveSDxByd6WtRAghJalEr8VCF9IpVFkrU7cxt4GqSphMmHNVt/KYujTk RFgYzTDftKxxEAbmvHHlxqTCzGjzihAPX/jEvTqdQEBTUaI/7u8ZUVMqABicXMNt9ZU85szC2EEY a1p1S5Pvml/jVNcyp55MOhWVAj0BPQokxZJNdzZWT5LpSqWkFXcAcCzaEOh5F2kqQijWdybef5Yy WAAgE/kEAMxWW8v2ZqaK48nwvmv6QSrqHz7y2qTlKcbQsPmRwutWKrbWlamIV9+knxi8kBy8QBnM BMUoQjzbLMRaXO4VW8cMSPb2tanwsL7oyfuv8/7rFGukOKOmyKoQz1hRTLVtziW35/T+qhIy+RS5 CYLE6b+CbnkKX4xELkVoE00ylByXNPWmOcrg5BrvbKTYql75nVSYc1S38pi6NGL9Z/QD1uqy13KD MlbcxzKpMI2eBQZHnRjxAQAf6Lv6xxvCYF8QBeWEpCnpZ9zoNjTe2UgyJe0dMCsUOHZYF6wQ/H2q LAKCkTPB0LkQa2MVQclE0iRpsnFLA2ur9sl5BVDqDwNrdXtWbKNG/bcQQooQz2jtBEFYGpdsvPvB au6LmpxKhcfmrcgPa3PrJvNC6lYwrL3WtXQLObo9CAEoYlJORjJaO0nRtgUratbeT3FjfQlpk82z 6h7GdNPfWpUEKR5SRt+8FGdyLtnkWrYlT7yaaiCTloWZYFPa2F8BgZxUUpFURmsnadK93NVyb0s1 T9p1JhXmHNWtPKYoDZmPiqN7060tXZX+RpwhkwuTIJzL7rjpRYM0ISakIildaycpwrXM2bK9ma6O WD0Fjh0Ua3SvvDvjMKOpSAynMlo75+Bav9BiqqvYnCFVRRkMeJyzoW7jruTwFSkWUPiYIiZImqEN VoOr0VjXThssNFMGdzF3CIG+TADXKcJaRzf1F1C3sjHWtrH22uTwFSk+oooJRUwSJEkyBsbsMLga jZ4FE+WjBgDWVlO34YtC4Abvv66KCUVMAEIka2QtLoOnxehprnKVHQAAoZv5FCf2JDbWttXX11rZ mByQpISs8DJBEhRHcXbO3GCyNFvwFiuAqQpz9utWHlOWRrzvrP7epA1mU00rwNW5b1y5MTVhUqyx du0XeH+f4O9llThJkjRDMRbG0mi2tdmqLTFLgWMHa3XXbdjZak8mhxNSVFJTKm2iWTtrb7ebG01V 60tceZTHU0HSrLWlq9itKFHMjYvNjYvnv27FQ3GmAkK+EMaaBcaaBbPZoEqCIJru/NOpFKQ5U/OK JkkRJy9atUxZmLNct/KYsjRcy7a4lm0ZrTWHLSpjptG1CFNtm6m2rcZEdKwgr8lVPgsqaOwgabZl RUtscXR224QpKUrdVQaDwWAwGAwGg8EAVtwxGAwGg8FgMJiyACvuGAwGg8FgMBhMGYAVdwwGg8Fg MBgMpgzAijsGg8FgMBgMBlMGYMUdg8FgMBgMBoMpA7DijsFgMBgMBoPBlAFYccdgMBgMBoPBYMoA rLhjMP9/e/cV5EiSJgb691CIgEqI1FkiS3bp7mo909Oqukc1hyN3b3d2jDzj0c7s7uEeTtg+0Nb2 hU9rRruHI1+WdiSPdscl765nd2ZnZndvdnpbi6pWWaJLZVVWZVZKAAkNhHa/h0CikFkAEplAAgjE /z1FAgHA6y8P9z88PDwQQgghhFwAE3eEEEIIIYRcABN3hBBCCCGEXAATd4QQQgghhFwAE3eEEEII IYRcABN3hBBCCCGEXAATd4QQQgghhFwAE3eEEEIIIYRcABN3hBBCCCGEXAATd4QQQgghhFwAE3eE EEIIIYRcABN3hBBCCCGEXAATd4QQQgghhFxA2PK3bZoA7BAs96Q0u2NmuLHiOOt1MWqJhuhsKKC7 K5id5S+Ry4+fa+cbLL5aRYkHI+kvk6vnzgLrTO1WFcXZCLinWgZs8K0qY3Si1wXZhLMeDnm4JZJ9 SwLT2fCD6sZgcgDCijhm976KCpa7W8ugRXyrSj9EEmqC6bpqyfdHbazibRwg7jDCNucEf/a//ms1 v96r0iCEEEIIoQEjCMKf/Mmf9LoUg2DrmRAHtCflQAghhBBCA4lSTC87Y+tUGRAkADAffd09eAKK VurJT1Ofz+Y4qKmgjDCbs3tSmH7AE543BKA7nulBRMJI5VPVYFq81cnC7RmBCJzOd2p+y04RkWOk fvuI1bIdIhEIrYx0MMaq1yrdUi37BwEigVQN4GBUSwJEsiRmd+OoJ76tl8odbq+WHBDBkqArMawg hEhQN5gDUC1FIpAu9kSNup5qtfT5fN0pycDbmqD7AkPFdPIt9kxPStMRT43z/+Jf/rOe/PTaf/vP P76VRJEAACAASURBVBsfB4BUKmUYBgAUgvk7R273pDD94JBw5Mm/fkFbM3f6wZEXh9KRNUoppXR1 ddV58crZLztdwD1xUjr11KcvULM3ibsyKmmxYt237t27p2kaAORDubuHZ7tbLtd7UX4xujjsdOeW ZSUSCQAA4ppq2T8iXOTbhTdKpcrwSrW1zIaz9w7d6WnRdk/m5D+a/2+0NaMLvyWdZqZZp1HVdX1u bs7ZdmO1HOaHvzvzY6PUvVMO3scJJ22n+m1x//79SrWMZO4dvNu1InXQC75vTH9ysjsnkwAQmlaK cu7R1y3Lmp2dBQCe57tTkoHn4pF1hPpTjuae/PjPlavXel2QrVI/+oE2PNzrUiA0gCxmTS99MPJ/ /l/d+LH/UP/lXDg89we/340C7A2Vqo8t/138r3/d1V/9P+q/nPzJj41YtKsl6bQ1e/UP//K/COl0 b4uh+pXZn/1Rb8swYDBxRwgh1D0c4aJ0OGhHnD+zLGtANwaqEUJoAGDi3klWJOL3+wGA43D9IwAA nWnHn85JieROP2iLwQOJEqHMAFjdi5IhhHqEMpr+vFC6pzl/midsUHpbIoQQcg1M3DuJaBr9WAIA FiEg9ro0fUBj2tA/vDP0/vu7/wZZhn/ysw4WCSGEEELIpTBx7yRe09RFAwCon2HijhBCCCGEOghn dCCEEEIIIeQCmLgjhBBCCCHkAjhVBiGEticQadSeYBQAwLD1BCR6XSKEEEKeg4k7Qghtz2LG2ls5 qlMAsAQTzva6QAghhLwHp8oghBBCCCHkApi4I4QQQggh5AKYuCOEEEIIIeQCmLgjhBBCCCHkApi4 I4QQQggh5AKYuCOEEEIIIeQCmLgjhBBCCCHkAriOO0II7d5Z6Vyvi+AyMsiBA7IQ5J0/MwJn9rZA CCHkHpi4I+Q5IS6M6eZOhclQ+KTCbAAAA4yk8yojb118pYelat9TE/y/+Jf/rOs/+79Xt5I//pEW j3W9AAgh5EqYuCPkOals/IuLJ3pdis4Y8pF/Nf+XsV//pps/WvT75372027+IkIIIQQ4xx0hhBBC CCFXwMQdIYQQQgghF8DEHSGEEEIIIRdw2Rz3xJd/Z+RTzfehQfL/aeq3ZaU7RepnjLHScrm4VNTW NUuzqUnFgCCFJF/UN3RkSPTv4H+/vFZ+8PYS4eDoT45yPNm7MvetdoKpMjZrmXcsK0NpkVKBkCHC HRD486IU4jx38kwtQ03c13MJWytZWoHZFi8HBSXkHzukDO8H2KZ22YZaXrmjppdsrUhNI+tXfmfO fd229/F8d8rfV9oMZq0F23qzXCYA/0MwJBDPHePUpPn5gppUzZJpFk1qMTEoSkExPB0KTgWbB5Ix VlwuvntntlQqlhgzGAtzXIzjRjj+nCh68RhvI5g6Yzctc8m2c5TmKDUBhgiJcNxJUTwqiF6rl+1E sq7blvlrVQWACz75CUnqfInR3nNT4m6phW2zdse4J7vwLdSkunppzShsWmnNKJhGwSwulzI3MyPn RyJHh1r5KsZY4oskAPgiPm9m7bsOpg0wYxgfG7rB2MMXGUswO2HYXxjGyz75vIdaT1Zans3NfUnt TZGkpaxZyqqpB1IwFj/zMu8LNPp4cfFWbu4Lxmj1JUsrzebSi+XSE6L0iix7KUVqM5ibUIC3NQ0A Rnnec1k7g+zdXPJyipq09mU9q+tZvbBYlKO+yRcnG52cO42DVbRvrBoBWvmGLKVZSufA+szQX5Xl c6JnjvF2gsngq2TySqlY21oCQIqxFKV3LGuUM36gKF45EWqvWtY1Z1m/UVVnewLTJNdyU+JeXrvX ym5+kfA/+b1EMLjX5XmUFY0FjykAkJF7vDJx/n5+9eJabesn+gUicGbRZJQBALXZ2mcJTuDC06Ft votB6sq6njMAQIl78TrGroNpMvZrTb1nWdVXhjiOB8jSSvdOAd7WNY7A457o11n2zufFpZvVvzle 4OUgswxbLzvRNYrp9WvvjjzxLcI/0jQxlr7xQTk57/xFCCcoQWoaQDXnlRnT8HPkecm39/+QftBe MLd8F8CHur5OKQBMcB7rzhkkZpKZW9nqC5zAiQGBmtRSLeeo1zL68vvL+1/bxwlbU8Zq48CRyltB QkRCchvHuA3wO00TgZwUxa78e3qqnWAyWJlZfW9e9W80tSIhYUIMBoWNE/UEtX+pqn/g94sDf27Z XrWsa8G2fqVWGgceYBgTd9dyUeLOyolK4j7y+Dd5n7/Rfq8eE//N8J+T3hzY1+AgAMBjsycDpR6c OTjKa+VqoinI/MgTw8GpICdyAMAoy83lqyfxyZlkaH+QNB5Etw17/Vo6c7vSfMhxj2RFD+06mBTg l6q6YFey9mcl33lJChDivHXLNN/TtRJjAPCuph0RxOCgd0Wl5Vkn0SQAyuih8MGzgj/kzOWwDTV/ /3Jp5Q4AGMV0OXE/MHF0y8ezdz93snZOkMLTjwcmjxHCATBZT4ffv+ecJ1/U9XOi5B/0SELbwaxl mfo7uvalYTh/eu1yZfZuzkmPCIHQwVD8VEwKSc4MBEuz16+uZ+/mAEDL6IWFwtDhTVfVNjcOwoXj x5+ZuycRAgA2wDXTeF+vXGp7R9eOiaKLutvdaSeY2bu5zO0MgB8AToric5IvynHOkVxi7CNdv2oa AJCg9k3LOjvoZ0HtRLKuJdv+Rblsb/w5xnvsOB8srmlJjHzKUgsA4AuP+CJjTfb0B8UeZe118MDL RO7mL1KbPvh0kQcBCChRefrCQSfLrBZIOab4Ff+DDxYBAHSAHMjxTSW0dVvL6XpOLyfLhcUCpUwg lXoSGY5IZAdjwz7OB8Tefr9+RW22+mnC6ZjlqG//hX21wSQciRwdEmR+6YMVALA0W8/q1WB+outO 1h4k5B8r/trrkhzASVEc5rm/KJVsAAvg3qB3RbZezt793NkeOvJUcN/J2nd5SYkef87WilpmFQCM fHJLrqkm7jt5KidII49/UwxGN94hvvDwG0eP/vLqVQCwAeYta+CHNtsMJgBQUzdLWbOUNXKJGWMp uJG1g8cuoFtlK/ll5VFaI08MRx+L1r4ryPzY06Nm0SytlQFATWm1GdKWxuHQa9PHPxuVNroeHuBx UfIT8itVBQCVsZRtD/ZJUTvBdD4rgAAAL/vkpzbPHgwQ8ros5yh1WtRle8Bby3YiWVfCtv9KLVs1 r3jqMB88rkncq/Nk/OOHe1uSHVHM/YdS3+nmLyYezAWSHwQAeEF84sT35Fy9mTAyWOSvtFIBAGL3 vzbOjlXfYYx98jf/mdoWAHAAte2BIPoe0/4r0HdwUhSUCBP+4y7/JX2g+KBgFk0A4ERu8oWJTadA G4L7glJIdKa/VxP3omVdMnRnh+8oSt1WcoTjHxPF66YJAEnbhoHuigoLXzFqA4B/5GBwX91nPxFf ZMLJNamp177BqJWb+8LZjp14oSZrr4jK8iFBcKYkpSmFQddOMAEAGFv55C+dbwCASPDhES0TEvHI BGIAAEjfyFCbAUDoQDB6fGu9AgAg4B/3OxmSrW8ag2ilcTgmiBFOz1IKAAk64Il7O8GsfJbAkWj0 yeXVeh+FAwLvJO7q5hnwg6edSD4qRembatlgzE+ICWAyBpi4u5w7EnfGaDlxHwAIxysjB3tdnB1I a+yzha4OOaeu3NFyDADC0ycvrvthvf6vp7SglssDQHZJD9YMipvFzFq6/vx8ORbTHuwsKxr1k5+Y 1vb79av8/YKzETsRFYMNE2spJDmJO7Uq8ZnJZZ2tM6J4oPEM4zGOvw4mAGTZIKebjFrltbvOdnDf iUZLndhG5a4pXt50P2XxwQ1LLwOAEt8nx6fqfjbGcc6Z/cAn7m0GEwDMUraatW8xwXvo3nNqs9y9 vLMdPR5ttECHpVVaMDGwqQVosXGIcpyTuJsDnW22E8zaz54bGyNf3aj72fJGvj400OeWbVbLLbK2 /Wa5pDEmE/KGorxZLjuve+5WlsHijsRdW1+ilgEAyvB+TvDCbXy7ZBuqnlkBAAIQGDvUZE9n3hEA CIFI7eu8HBh98ru1r+TmvtCzawAghUc6XNz+ZqlWea0MAIRA81t4jUJlpoE05AMAYHC3WHJeab6a hAGVrkjpm8lde8HIr/M+Pw/AS4oUHm60m1lcdzZq58IxahcWrzvboYNnG31W3gjgIMcRANoLpmPL MX5qjN/34a8XbRs8Ng6nrWuCXwAAQeGVeMMJjVq6csnCP/rw1vzWG4fsxpnk8ECnm+0Es/rZgOIf MxreG7ZqV842B3vh13YiuYVeMn6ezZQZkwj5seKvnvkECAkOdG0ceO5I3Ku3pfrHjxiF9dLSLbOc s8p5wvOif0gIREP7TzW5XdU7zGLGGZIUlDAvN2wBzVLGVgsAQAiRNk884ARJCsVrX7E3UvwmWcJA 0rNGYCIAAFJIbDKqoWd154o54UCO+ADAMqycaTofGGnax6xsdEWDfT+lLzI29sz3m++jphb0XBIA RH9Yie+vvq6tL1HLBAApGJVCsYYfZ544BYL2gunYcowHhvgcrUSvt+NwI/bRg9o2/7ROCgNc2Nh+ ZD6RY21pQV95BwACofAL8R8QrVK7UmtLseFbzuuP8U+DBoTA/32clv70Qu3Hy/nMtfd+zQAIIeXX f0/07e39TpylRpJf7OlPNOIfVQ69sc3F8OJiUU2qACCFpcDUwwtB1c8GSID8Xf3Pzlrmsm0DQJTj jgiDPKuwnUjWslTr+js3nrBtCeCHin+c5z/SK7XcUxfWBpILEndqGVpqEQAIIcWFa1p27eF7tmkb GmTXSiuz4YPnQgdOeWDErRk5NinHJrfZibHs7CWnow5MHOfEZn2JbajOLAUA2JLQD7zAhD8wsc3Z IGNs7fOkkzRGjkR4mQcAU6vMNeKaVsckte9vrBQZJN4d/zDLudLizdLqXQDgRV/89CtQk3w/PGkf O9IknJpnEvfmmgez/ke0cnW5vbGejmUuFdiXN/plZl01koxRXvSNHHpp+Wbt/KIxiFUuZVxuVGbG kpc/0QsMAIKTx79clwD2dh6XH+hLfVn9jbyRuZ3NzeUBgPfxU9+YaH0BiXVKvzSMa6YBADIhP1D8 3m0rW46krduL7ywFCkEO4PuK37lGsbIxQW5iu/VhUZ9zwf+fmpx3nrfCGHOydl6UOUlmtmlrJae7 ZtTO3fsSAEIHTveyrH2PUTt94wNnNI4TpPD0ueb7G/nKve2iP4yTlLZgNlv5eNUZ+eAlLn6mMh4s ypUBIQqQpTRW76KkBfA3qlrtxgd71uaj8vdmzHLO1su09swwGI2eeEHwh6u7UcvQ1pec7eZnpJmN CQmDfe2irhaD2Ugxm3KmekQ5TvZe9Gq1GclaO21pB0/q6rqe023VtlTL3FjRRI76xp8fl8LbdCUf 6nqK2iXGSpRVzypHOP67ilK3OR1sO40kNeniu0t6zggK5I2hyHSpBACsZq6Rp2bEDSQXJO61z11S hveHD54TgxFn7I1Rq7h0qzB/1VkFJT9/xT9+GGCQr6O1wyymM7cvGoV1AOAEafjsBU7cZl326qNq pZC35slsS8voic8S6roGALzE7Xt5ivdVWkPBJwQFwbkq+YmhvyFvnYOYp/S3mrZecxulp1pSxmjh wXW2+X5c39DI8OPfJJuvPBiFdWc3wecX/A1nEjOA1EYwR70USdhJMBspZion556qhI9qP5JVu2hp O+6s1MtTBUbZh7c/EuhGX8wDAIRHwudeP0u4hieHEkilpw/oE5Nvv/cupZtu5h2PDL32xHmL4+qs OLM3LMsC6P0NxYyy9I0M2xwNZUTZ/+pU3UhSiy6+t6yldULg6POHj16+BqUSAGQo1RkDAAIw5r2T nwHT74m7rRX1XAIACMdHjz/nH9u0FiThhND+04IvsH7jAwBg1NbWFwFO9aasfczWivmFa+WVO5Wn pknK8LnXxM23pdb1MHH32AT3JsySmb6eyc3lKg9eUYR9r0z5hjaNfBwJBpwbKm+apsHY05IvznEU IGnby7b9uWmYNSuaDXFcwEsjnWYx46RHhBBglUDoueT6tXfip18i3MNG6WH1GxprMk8mr+vmRp80 6rE+qfVgNlLKVoI86e3Evf1IQhstbce9dfGV7v9olVFYTzxYgs3BhCW4ucDip19sEsy/BTAKSsK6 vfWzafhPM8XW/yPa9wLMhIgKAENcpIdnQYX1Qo4UgAfCEcZY5VQiDdzHwqkXT255Ziq16VfvXw+n w2E+fPTZo48fO5f8p08Q3QCA2ysrxRs3AGA4FFp/5plu/hN0ALB6+yj5QdPviTsnyhPP/RAACC82 GrRQRg+K81fNcg4ArHK+q+Xre5aaLyx8VV6bqzaAgfEjQ4fPN5/aXsGYM2gE/bGkzDP5/7G3BSgX 8wu3r60uzAXYuHND0MTBo4dPPykRGWrqncDBZ//1j2fe/WujXASAdwD+/SNfFYyP8YKYW1sEgOjk 9IMnXuxC+UeylyWr2IUfak4MRqde/EPC8QCEWoaanM/e+YxRW0svZ2c/jT72teqeZiFV/UiTL1wu VO6fHuV5wUunQLCTYNbHWClbOcY9PuLeZiTbamkHTjvBbLdKd1pifXQmdWz7/fYGYxQOf/fRaMAS 3Hyg1EaDMZr+6j11PQIQiRx56nr65PWP4D9vvJtNXyzSHAAEA8ffMp/u5j/BB+ar5LNu/uLA6/fE nfACzzdcHaW6lxiMOok7G+j1sHeEmlru3kx17AcApFAscvTZ1sfOzVLGWe+ZcHxPBo22+M3dnj2E tVEwy+Hhu4sA8GjBiHX4Qm72kpZZ2foGx4cPnBH2n1r95K9skwGADsPFZDfq7dcI9MNtCoRwsDH3 gBOkwMQxwgnpmx8CQHntXuToM2Tj3imjkHY2mifuC/mcszHlvdSz9WDWZZYyvG0BgAAQ9/bSzruO ZPst7eBpp1q2WaUHTKvRYCxz40N1fREAwtOPb3maMgA8HIPz2CITA2lADoDq5TNewkUhgTFaWrqV v3+F2pXrU1IoFjpwVhnet6NVd2omuMe3XZtiUO06mIISGj53QUsvG7mkWc5RU+dEnxQe8Y9O8z6/ kUvYpubsuf1CQIOu+lglxqhtlAXFuRGQ0Y0QiUrjCe6ULuYLTsp5YqDXiWtRg2DWZ+RTzh0YYzzv rTlGLdg2kp1qab1gR9Wyg58dPHWjkZ29VE7OA0Bo38nwwTNbPsKoZZYyznY/XDxHbRqQxN02KisA CI07eI8wi+n16+9Xn68kheLhg+fk+OQuOhKc4N52MIkcm5JjdR72qaYeVL9zcCstM3IbqxKFYk0m p5KaiemE31iTxzKrsw5I43v7SqkHhm0pAFGO6+1qhnusrWA2Uk3cvTRPpjOR7GBL62btBHNPqrRr 7T4ajNHS2hwAEAA9u5b44m+3fjWlD28WuPGBU0Ol0EjkWFcnu6NOGYTEnTHq1HhCOF9sotfF6SVt fXH9+vvO/BZBCQ0dOq+M7N91R6JvrAXpzcS9s8GsRS3DWWkbAALjR9r/wv5ELTMx81tne/Lrv9+k K6remsIJIi9V5gRXh9sJIVzji+P5xdvOxklRHOCMqc1gNqLnk86KH95J3DsSyb1rHNylnWDuUZV2 qXaiYRbSTlVkAEYx3fyHqjv4Ip5OllytfxN3o7Ceuvz3zvbE136vybQ2NTHvXKmU41PcwJ6Ob6+0 Mpu9fdE5rQ7tPxWefpy0MWmVWsbDwSTvXVzbdTDV1IKtlQFAGhppNJswf+8ytQwA4H1+/wAn7huZ NwA0fwiAmlxwNuTYwzkGbGPVYcYYo3bdnkzPJdTMKgD4CHlc7IcJ/HulzWDW/07nGA8S8NIzWdqP ZGdbWldrJ5h7UaXdq51oVK+N74g3x+MGQ/821hwvOquzA4BZTEtDo3V3o6aevz8DAATAgw+5qDLL uezspwyAcHz89Et1p2fsSPXRS4LPz0tbVyIfbO0Es7Q869yQGpw6UTdxN0vZ0kplkHjo0PkB7vJr U21LLTR6hI2tl4pLt5ztwOTD1RtqV5GyyoU696cylp295ITveck32M9MbTOYdVWP8RDhggMdvVpt RrLjLa2rtRPMvajS7tVONIL7TgT3nWjy5Ssf/9w2VAAYPnsBb6kaAP17PxLv81cfe5FfuFb3UQjU 1NavvWNpJQAI7jspBpotPTHQWPb2J86KOvFTL3akL6mZ4O614fa2glldfkdLLzG6dbUZWy+vf/Wu M91QGd7vH5vuQHn7Fe9TqkNH1c5mC0vNp66+7VwxU4b3+2rOz3mfUr0sXly6+chHWfrmR2YpCwBD PvkJaZCH26HtYNZVPca9M08G2o1k51taV2snmHtRpd1r76Jh62UnawccZR8U/TviTnhBjk859/Bp 6eX0jY+GDp/nfZVFY6iplxP3CwtXbUMDADk6MXT4yV4Wt6fKiXnn2dq+oVExELG17dfq5uVA82uO 1U5d9NjqUW0Gs9oyWmohc/OjyPHnnOaYUUtNzOfmvrBNHZznqD/2tUG97LuBSKG4c/2huHwLCAkf PFsZR2fM0orl1bvVZ1UKSuiRFZqJMnLQ6cPKq3cFORg8cNo5mTdL2dzcF1p6GQA4QXrj6FH+/nyX /21d12Yw66ge4+NeStzbieRetLQu10617HyVdrO9ikb1MBeUUPNJOMgt+jdxB4ChQ+f1zIozYaac uFdO3OMlhfcp1DJttVAdgfePTkcfe96z6xUCQHltztnQc4mVi7/Ydn9elCe+/pOmuzBj49k3Po+d o7cZTGX4gBwZ07JrAFBOzqupBUEJAeEstVAdgJfCw/HTL3uhDQ0fPKtnV50rDMWlm6Wlm7wcILxY Gw0AkIKx+Jk6AQkdOKMm5m1TYwC5+5fzC9dEf9g2VOd0HQA4Xhg/93Ik/1HX/kU91GYwH/HwGPfU iDu0Eck9aGldr51q2ekq7W57FI3qjDif5y6eD6z+nSoDAII/PHzuNdE/VH3FNlSjkLY2snbe548+ 9rXYyRe69hjkPkRNXX/kKT/NSeF480Egs5ynlgkAhBAxFGurfK7SgWASEj35jeq4O2PMLOfNUrb6 KKvQ/tMjj3/TI7cNSEOjsRMvVNeEYQCWVqpGAwA4XggfODNy/lu8L/Dox3lJiZ99tTphhlHbKGaq WbsYiIw+9YYSHd/7f0dfaDOYW9Qc49wY19cdQcftLpJ70dIOgHaqZWertNvtUTSqj17y2sXzAdbv +a4UHhl75ntq8kE5cc/WipZWBMY4SZGCMXl4vzK8z8spu0NNzleXaG2RFNpmEP3hPJlg1FMR7kgw eUkZPf/tcmJeTdy31LyllTheFJSQHJ/yjx2uTvfyCGV0WhoaLa3cMQopWytaWolwHCfKYiAixyaV 4QNc4zXaAUAKxcee+X5p6ZaeT1qlrG3qvM8vBiKB8SNybMpr19naDGat6jHuH4oKHgsj7CqSe9HS DoZ2qmUHq/QA6Hw0GHv4zFSPXTwfYK7IyYgyckAZOdDrYvSpwOTxwOTxDn/n+JEBXl+8ic4Fk/hH p/2j0534Ktfjff52VnziBCl08OygPqRqp9oMZlX1GD81wcPbb7b/ha6z00juRUs7MNqplp2q0oOh w9EgZOrFn3bs21B/8NYVUoQQQgghhFwKE3eEEEIIIYRcABN3hBBCCCGEXAATd4QQQgghhFwAE3eE EEIIIYRcABN3hBBCCCGEXAATd4QQQgghhFwAE3eEEEIIIYRcABN3hBBCCCGEXAATd4QQQgghhFwA E3eEEEIIIYRcABN3hBBCCCGEXAATd4QQQgghhFwAE3eEEEIIIYRcABN3hBBCCCGEXAATd4QQQggh hFwAE3eEEEIIIYRcABN3hBBCCCGEXAATd4QQQgghhFwAE3eEEEIIIYRcABN3hBBCCCGEXIAwxmr/ /lf/5t8WU8tFpvSqQO0L+YhK1ntbBsnwcYwDABs4lfl6W5geEjgY0XJ8ubzrb6AcyQ8NOduurpb9 wE90DigAWMBrTOp1cTqD52DULPCFYjd/lBKSjwxItZQFGE6t9LAAhXDI5nkYrGrZExxQP9GdbbdX y57zE40DBlgt20aABYgGAH6//4//+I97XZxBIGz5mxoqAASJ2ovCdAYzQIZ+abN4oK4OZrsYFHwS +DrT6nk6kh0lgD04wWRQEASIRnr1+66PpA3Z3kWv1kBVy17DSHYKVstOsW2710UYEFunyjAgPSkH Qgi5xZYLlQghhJob2rh4jtq0dcRdVIJqPrMMwz0pTYuiMjl781NiWb0uyFZUkpJnTluWpWkapRQA TNEshPK9LtfuHUodNXJdirMyLmn81oENxpiqVl5Mx3o8A2oXuhlAhxQW7CHTqX5b1FRLoxAqdLNU HTTBT3K3u3flum61pJRqmuZsu7FatmKP4iyPSbqwKZ7VamlIRjHo1mr5qL0+9qVpzjTN2ldqq+Wx O3f37qcHT+KpJ7cEc8CqpQTSxNp+q7iHY95CgIe4/eiwerUTf/LJJ/fu1z1la+IuSDIDcoUd7Ulp WnQuxL388b/mil2d1doKKxr98PXXisViKpUyDAMAVLl8/8Bcr8u1ey8WX7frpYB7QRmStPjW/1PL smZnZ51tN0byZ/wJSV3u5i9SIQBFxpXq3FfwnuLLcBwAlBUXV8uD8oEL9xNd+zlDmZSWtqbmZYC/ DygAAMSV1bIVx/3Hxd9GO/61I9ND68HV2ksW1daypJQGKZgvqd/Uy+b2++2Wbz9z4lZlGMb9+/cB gDD2ytvv7N1PD55PfvTD6giRY2FhoVItA8UBqJYRLvICfUUne3kmGRXgkLnl/AdqOnFB2Jpwot3B OKJmjhhfjv2Hf9fDAmiyPPtPftbDArRJTCZH/+Ivel2KCuFHP4Dhvr6Y1ooUTfU8pEW/H372096W Ya+l7fV/fHyx41/LMvKhFQ1qphq9q8gGN4BTNA9ZXw2/9f/u3feztwiBTVO2coHA/ddf27tfioPv awAAHKFJREFUHGBsVqQPNg8VR8kg5Uca0w7fe2v4zZ93/6dVvzL7sz/q/u8OsAGqmAghhDpEZWp3 TpD4H/8I4rEu/FCXEVMXEslu/qIQ1rv5c4PEytvq4qbLFzTIMD9C/QnXce8oQkRR9Pl8hAzgABJC CCGEEOohPKPsJAZAZiWyxCDCgdjr0iCEEEIIoQGCI+6dRBgz0pa6aFADV4tDCCGEEEKdhIk7Qggh hBBCLoCJO0IIIYQQQi6AiTtCCCGEEEIugIk7QgghhBBCLoCJO0IIIYQQQi6AiTtCCCGEEEIugIk7 QgghhBBCLoAPYEIIIYQGByPkz/703/e6FLvh4yG271KRFrv8u9NCwn7F2vTSDIVyl0uBUEswcUcI IYQGyqVl2usi7EZcgWPja3PW3S7/7lXjypZXTtIzCihdLgZCrcCpMgghhBBCCLkAJu4IIYQQQgi5 ACbuCCGEEEIIuQAm7gghhBBCCLkAJu4IIYQQQgi5ACbuCCGEEEIIuQAm7gghhBBCCLkAJu4IIYQQ Qgi5wIA8gOm2Zf5aVQHggk9+QpJ6XZw+VV4rP3h7iXBw9CdHOZ4035kxVlouv3vrlloqlhgzGAtz XIzjRjj+nCiGOK+f8u0omDpjNy1zybZzlOYoNQGGCIlw3ElRPCqI23x40O0oknXh4V+142AyKCfK ubm8kTeMgsmJnBQS5bgcOxEFTwdy+0gyxu78/C61WKNv+PPVUrCQ3/LiPw8Eh7zXeOqZleSVtwgh k9/4A8Jtk3VYupW9lysuFY2CaasW4YkYEP3j/sixiOgfkIyldU5HXFwqauuapdnUpGJAkEKSL+ob OjK0bUAszc7dzZWWS6wM//bmykixOCXw50RpH893p/xoLwzCYTBnWb9RVWd7AqtjA4yxxBdJAPBF fNv26GpSXb20ZhTMm6sQpJUn8GUpzVI6B9Znhv6qLJ8Tvduxtx5MBnDFNN7TdYNt6uBTjKUovWNZ o5zxA0Xx7InQjqplXXj4V+00mHpWX724pmX06ivUopZqlRNq7m5u/LnJPSxrf2slknrWaJK11yUT Evbgkc5Y9u7nACAGo82zdsZoZuFW9sZMSk89fNVmtqFrGT1zKzvyxHD0eGSvy9s/qh1x7YtGwTQK ZnG5lLmZGTk/Ejk6VP/DDDKz2eRMilEGAAIRKKMFRm+a9KZpPiFKr8iy9+rigHB94r5gW79Sy07z yQMMe7vnbohB6sq6njMAQIlv8xjn/P386sW12jwzSIhISI5WUngb4HeaJgI5KYp7V+T+1XowGXx8 5849Tau+IBISJsRgUGCV06EEtX+pqn/g94vEeyPvO6mWdeHh/9AOg1lYKK5eWq2mnqJf4ETOLJrU ZgBgG3T2k9mEbY96MKStRVJb1xq91cgEv6tzU3djuXszZikLAFJopNl+trV+/T0uvxwbtQGAEBAC IscTo2A6qSejLPFFknCkYao6WB7tiEW/QATOLFYCQm229lmCE7jwdGjLZxljqx+v5RcKzp+EI76g pNT01zOm4efI85Jvz/8ZaA+4O3Ffsu1flMv2xp9jvAc7me3Zhr1+LZ25nXX+lOPNjtXyWrnaWAgy /+rJk8/dviMRAgA2wDXTeH9j8PgdXTsmiu6uQDu3o2Bm7+auLpaCAABwUhSfk3xRjnN67hJjH+n6 VdMAgAS1b1rWWY+dBe0oknXh4V+102AWl4rLH60420OHwrGTUSksAQBjLDubS84kGQVG2T/o2h/6 A3ta8n7TeiRD+4OBcX+Tr/rp1fMjt2bTlP5KLdsAPkJe9MkdLm5/o5aRv3+5uHTL+VMKxxvuytj6 V+9omVW/AISQ+KlY5HhEkHkAYIwV5ovJyylLtQAgOZMMTgUEZcB7ni0d8cgTw8GpICdyAMAoy83l k5dT1KQAkJxJhvYHyeZTwuRMysnaeYkbPhsfOjKk8Mo/Vfbbs3f/RlOzlALARV0/J0p+Dw4YuZ+L a3/Ctv9KLVs1r3j8QnktW7f1nGHkdDWpFZeKziiaQ4437DyozVY/TTiNhRz17b+w7/hXY9LGgc0D PC5KfkJ+paoAoDKWsu1xD8R8d8G0ylbyy+RJmACAl33yU5vnXgcIeV2Wc5Qu2BYALNueSNx3F8m6 8PDfdTCNvLHy8RoAEALjz42Fp8PVtwgh0eMRW7PXr6cBYM22qQdWMNhdJHkfz/uaVbmwovgIeUfX bAAB4EeKf9gD82SoqZulrFnKGrmEur7IaPXMGqTwcKNP5eevaJlVABBk/+lvnkpE1qpvEULC0yFf RFr4+wfUZtRipZXS0OFBHnR/tCN2UnaHc81BkPmlD1YAwNJsPavXVtTCQiFzKwsAvMTtv7DPF6mc fBKAcZ7/geL/j6UiANgA85bl0cvmLufKxF0RyO3vfudXX36pWZYiiiallm0DgHT8scRww6ahC5gs y0MSA8jInLn97ntWDMbmfnWv7vxLXuKkYMO56cUHBbNoAgAncpMvTNQ2FlXHBDHC6c4pe4IOfuK+ 62Cmb2ScDOC4ID5Z745JAnBA4J3EXWU7myzrRruO5KNSlL6plg3G/ISYACZj4LHEfdfBZIwtf7RK LQoAw+eGa7P2qvB0yEncbYAspbGBTjc7WC23sCn9pVrOUkoAvqf4J71QPxlb+eQva5P1Kk6QBGXr jA6HrZcLC18522OnvhYc/iJhrW3ZxxfxhQ6EcvfyAKBnjI4Wuu+00hEH9wWlkOhMf69N3KnNkjOV OwQmnh+vZu1VcY47JAj3LAsA0hs3sCF3cWXiHmLF/yX3tjFp8BK//4Wp+28vOK+vfSsp+rM9LBgB IpE7cBymbu2XSz27KmrkGt41pQwr0PjKWP5+ZUpc7ERUDDY8EY9ynJO4m4Ofbe4ymNRmTh8DAE9K UqOQlzfydS8sNLHrarmFVtDeLJc0xmRC3lCUN8tl5/UJzgOJ0YZdB7MwX9SzOgBIITH6WP37/KSQ NPLE8CFx+qXfziqDfiW9U9VyKwZv37y5ZtsA8C1ZOSy4sqvdKbOUrZu1Q2W4vX40i4s3GKMAEBg/ 6o9NNPpyX9QH9wAAjOKAJ+4tdsRSSHISd+c83JG5mTHLFgAEpwKByfrz3GIcdw8AMHF3Lfe1JrZe +vKD32m2BgJMvTSh6ZrFLAAQFMGWbZvVbzW6RmUqAIxDpfWJ0elXtO91uQwmp6svF2tfuXXls3Ry DQCOhp44op2r+yldLb+79CZjQAi8OPFjRQsCwC8PscyfvrBlz8tv/0IrFQAg9dxrvxvZ26UnOGpF 1i7u6U80J/iFg9/aX/tKciZVTqjQ9DK6tq4JfgEApvRok5HgVbtSXb2wONfuIrmFWbauvnPtccYk Qn6s+KtnPgFCgh44+anaXTAZZalr68726JMjhGuQlhKInYhOSVNPe2BtzY5Uy0elrq3fTZSCAC/5 5NOemY3Ay4HRJ79b+0pu7gs9uwYAUrjRnalMTT1wtgKTx5p8OdtIT5vPUHI7S7XKa2UAIAQeveu0 llGonMBIQ5VhdWazzK2Msx0/HWv0QXnjbHzAT8oHl8sSd9tQk5d/F1ZKnJ9MvjQhx+XU1Uo/pMTl PqyGqyX22Q1r+/06jAfYNAVwdS5n6RQA1jLRzxuUR0unSnQCAAQ5nJ2XAervZpYyidU8AyCEsHKE W97bU3YJ6IWe/rfyEs/HNvUTzkVMaNqv+0eVQ28cBIDvzTxOLn1Wd59Zy1y2bQCIctwRYfC79t1F spalWotvL0bKUQHgh4p/nOc/0itLGfZqvQ4C5BXtf+rFLwNsvjHyvezPVasEAE8HX49r9U+n15YW jOw7ADAUjT8f/UfQdFkUTmd/9qevd6iszQylLvNmcfv99kb71fJR+Xv59a/SAJOnRNELJz9VnCBJ oU13oNpqZfC40QR3ahqWVvnfF4PRJl+upir1VZBdlrfsiJ41AhMBAJBCohho2C/oWd2pqIQDeWM+ THG5ZBsUAOSoT442rL3VmZkDfz1tULnpAKCmnrrylqUWSEDY940p34gPatbkkoe9dcN+62xDtfTK dIItrWotOTYpx7YbPmcsO3vJOegDE8c50XMxt1TL3LglUo7tci2tdUq/NIxrpgEAMiE/UPweGive sNNI2rq9+M6SUTCJSL6v+J1rFCsb1+Un+N40ZYzB/9ODM/OtbENd2Vj6LZOIcOn6RUpfv1tOUQAI ByYWbljAmJ5bU1MPbK0EwAT/kBiIKCMHSXcnHb1AWLNxxe5q/wBXk+rqp2sAEA0EXvPYMjJbtNL1 2EblIQyEcKTx2Jue1Uurla8SlEEecQ9M+AMTzVYrAgDG2NrnSSf9jhyJ8HIlIIX5SiMQPhRuMo6p YeLucq5J3KllpK6+ZZayhJAzz760MPELi1nAQEtXEneljcuag83IJ50N0R/mhN0P/zBqp298oOeS AMAJUni6/pSbvXNMPN7lX3xUejWd5fMAoISVE4GT2+5vjI0n/uiPAODThfl0uVwyDNU0ixvjxPFA 4MKx45bfn9jTQm+wlD5atbd6yi2FJV7apiemJl18d0nPGYSDE994bPof7gMAq5lr5Kk7Ux/VyjHO bEtdX3S25fiUkUtkZi85C2xXrC8BgDB/NXL0me3P4QfUjqrlo2zNXv5olVHgBPL6qVPizJVOF9BN WqmWvFRZKZ8xaqkF8Ne5W5rZbOXjVWfxcgBoMu17L4RIqB+6nipq09mP7vjTfj/vFyTh/PknBFEA AMuw1tcyEu8DgLP7zyripkcQiERUj087ndH81SulQgEAtEOHExMNbyroFB1PDzrNHYk7s631a28b hTQBiD729ZHJA87tqEbBcC4MEQ580T5KSvqKka/cYy6Fdr/kjllMZ25fNArrAMAJ0vDZC5zY7YB/ eOk7Xf7FR+XmvigsUQAIWIdLl76+7f4fAoD/EGN0OfFfGNvob0QAAN/QyPDj33yLdG+0/Wvk6hD0 bE7CFup6q6fc1KKL7y1raZ0QGH92PL6/MnSXoVRnDAAIwJiXJrg/qpVjXEsvOTcO8qLPyCVydz+v e0umpRbWr/7DyBPfkoZG96SsjQ1x4bNSt4cDtriXu2/xFADGxkaPSztL1xhj197/Km7EgYfjzx9T hs6tDnX1MZ9FxsDu/fWfqlaqJSf6eJ/f1ssAkJ+/Mhb/xpYdzJK5dinhPA/LIe/qYW27lkpPzKw3 m3zfTRsdcQwg5nTEFy9XYqtlVlIPsgAg+Pz05g8fncH+DgD4jwCwZTNBxWEAuDTyLcnf7KlYHeED 81WoP18U7Y4LEndG7fWv3nEGeiPHnvWPHaq+VR0d8Q35OMHTPXcTD1vPxsvoNmFrxfzCtfLKncrz KSVl+NxrYsBDz52utbtgmsWMs2wCIQRY5TqlnkuuX3snfvql5o8B3wuhPsiQrmSviLwEAEfHj05I 4412ozb96v3r4XQ4zIePPnt04ti4n/Ov/vf/HQDcXlkp3rgBAMOh0Pozz3St5ABQphQarJ7RE61U S6cJBQBqmc4j6P0jB5Xh/WIwxvkUq5wvr94tLd9mAAwgfevjsaf/UZdrZjI98uXFx7r5i3XKMPNb PScAQMb/7IOLO0vc8/dm8gsRgEhg7LCR/Pr/nASArp78+EF9icx08xeba7G1VIb3Ow9pKifuL1+2 xkcLdsBmDPSMrqbUzK1s7aopYlAUZC9eXtu2I34Y7aGxJvedWmqR2hYAEEKa31SA+la/J+6M0fT1 951HM0SOPBWY3NSSqjjBfVuMOcPk0Oy+/vosNV9Y+Kq8Nseqa3eMHxk6fN6DU9srdhtMMRidevEP CccDEGoZanI+e+czRm0tvZyd/TT62Nf2prgNpbLxLy6e6PKPbsLY0uUVRmMAUFr49vV0/f6DMZr+ 6j11PQIQiRx56nr65PWLAAC/AgCAbPpikeYAIBg4/pb5dLeKDgAgg/YK+bKbv9hMa9XSKKQ2dqe8 zx89/nztfBgpFJdCcTEQycxeAgBLLRiFtK/rg+491kZrqaWXCwvXAED0hyPHnu182Vyn5WAOHTqv rS85t6iWkotf/e52hmZqd/CPKpzIFZdK4Mk5sS12xObGAd48HXcW+XF26/6YEeqI/v5vYyxz40Nn XmZ4+vHgvq1Tiqsj7krMcwdzi8xSxrk+Tji+9WFyamq5ezPVk3sAkEKxyNFndzdmPzB2F0wAIISD jSkxnCAFJo4RTkjf/BAAymv3IkefIT26t7JXWorkdof/w7Sg8S3XXtBKMBm1zULa2SaExE+/XDdo gcljhcUblloAALPoucR91we4rZfTNz5wWsvI8ee9djjX1XowCS8Mn3stO3tJy6xseYvjSexULHYi OvcrZ+VxULw0SLejjtjYOMCbJ+5aZrnyVWFvHd2DpK/bl+zspXJyHgBC+06GD57Z8i61mZ6r3OTX zoK7g61mlmEcWrhHhDFaWrqVv3+F2ubGB2OhA2eV4X246utOg9mEHJ9yNhijtlEWlDq3ZA2wViLZ /PBn1DJLlWG5nQ6ODphWgmlpRWeyFgCEDp5rfKpDpGDMSdyp0XS1yEG06wM8e+dTahkAEBg/4rWz nUZ2FExBCQ2fu6Cll2UtGYul9LLG+3h5WA4fCAl+QU2qllaZmeYslTjwdt4RM2pWDlixwRNqna/V N86OamcdI3fp38SdMVpamwMAAqBn1xJf/G31rU8X+QV53rKsjZ4IVj5edSqzEldGn/J0L77FjuZk m8X0+vX3rerKu6F4+OA5OT6JKbujhWAyY2MmsRiKNbkQSWpupiT84C/ivsW2kWxy+Fd2oLR64Th9 4wOnhkqhkcixrk527wetHOPVLJwQEpxqNo+8+uRL3rfNmnSDZ3d3sKipB84jhDhBGjp8fk9K5kI7 DyaRY1NxZerYmSXB2nTHWnGxcku9Epe7vKRMT+yiI6aWWW0PSeN1I7TUA2qZACAoISnU8AlNqM/1 b+JuFtJOF8IAjGK69q2CyKk+jbKHN6xomcrQu3/Mc51Nc/rGglzbtp7a+uL69fedmAtKaOjQeWVk P6bstbYNJrXMxMxvne3Jr/9+k8TdKuedDU4Qeclz14u2jWSTw/9R1R18kT1f2qwPtXKMV0fjBKX5 mrCseh1DDHquX2+9tayitpm986mzPXT4Se/e//OIXQSzLtuwc/cqrWX40OBfmdxdR1w9wAkhXOOZ WqXl286Gf+wwdu7u1b+Je/V8fUc8NQFuW9QyHp61N51OUFqZzd6+6Jywh/afCk8/3uWHsPS/VoJZ bT0BoPmS+WrSWdEU5Jjn5iC1EsndHf4evAejxWOcmpWhjebHtZ5NWFoJAASfXwp7686B1lvLWvl7 M85Shr7wSGDiyF4Vzm1aDKaaWrC1MgBIQyONpm+tX007iz6LfmFo0BP3XXfEbOOJFowxRu26Y0Z6 LqFl1wCAE8TgZB+tTI92qn8T9+C+E8F99Re+uHBM+DyUvfWLWUu1AGDfy1PbPmnMm6rPvxB8/upz Lh5llnPZ2U8ZAOH4+OmX5NhUtwroJq0Es7a5tNSCUO9hIgBg6yVn+TMACEz2ywrBXdNKJJsc/o6V j3/uPHNx+OwFzz4tCFo+xqunkWY5B4zVnXPMqJW5/YmzHTpwxmvnky1GspZZTJc2DuTIsWe9FrEm WgxmaXnWuSE1OHWibuKu54zs3cozwobPDRN+kCPcTkdc+1gVq1yoc38qY9nZS85m+OC57j+GBXWQ W9c+t8qWk7UDgBzHKlhfzSzDJgNILHv7E+fGtfipFzFrb6SVYPI+pZohVVPzLSw1n7r6tnPLkTK8 34O3srVWLZux9XL1SekeHGWv1WIwxY35rIzahQfXH92B2Vbm1ifOKKkUjAUmPHg+ueNqmb9/2Rkc VeJTuCR2rVar5cZqM9Wng9WyytbyB8vOlNjgvkD4YMN7LgdCWx0x71OqUy6LSzcf/fL0zY+cxyQL SijQ9C4X1P/6d8S9OXV9o9sOibt4MLVHVFtPsfF6eeXEvPNkFt/QqBiI2Nr2T9bk5YAHx5ZaCSYA kUJxZwypuHwLCAkfPFsZ22DM0orl1buFB9ed1llQQt1fwb0ftBbJlr5BUELNpyQNvBaDKShhKTzs 7Jy/P8OoFdp/2lm1kFqGkUtk73zmLKTNS3L8zMttLprkRjutlmYxo64vOdvBfaf2qlju1GIwq2fd llrI3Pwocvw5AAkAqM2KC4XETMrWbQCQo76J58YHu89puyMmysjBynOsVu8KcjB44DQhHACYpWxu 7gstvQwAnCAOn3mVdPFx3WgvuDdxb/V56R7Gqo9c8TUelSyvzTkbei6xcvEX234pL8oTX/9JR8rn Ki0FEwDCB8/q2VXnBv/i0s3S0k1eDhBetNRC7ZCSFIzFz7zsyaSz1Ug2Ub0Q7/P2QpA7Cmbk6DPJ md8yajPG8vNXCwvXeDkIANW5yAAg+sPx06/wPk+suLfZjqtlfuGqsyGFYr6I566bNdVqMJXhA3Jk zJl4XU7Oq6mFcjikLlxfyS9Tq7JGihKXJ1+c5MQBzzXb74hDB86oiXnb1BhA7v7l/MI10R+2DdXe WFGK44X46ZcbTeBELuLWg6E64o4ruDdilvPOwk+EELHBwk/U1PVHnnnRnBSOe3C4vZVgOqSh0diJ F6r39TMASyuZpWw1a+d4IXzgzMj5b3kyPdpBJJuoPnpp12P2g2FHwZRC8eEzr/Abc1sZY5ZaqGbt hJDg5GMj57/jzX59p9XSLOe0jfvLQ/tOebBJbGIHwSQkevIb1XF3xphRypezZSdr53gSOxndf2Gf IA/4RfWOdMS8pMTPvlqdMMOobRQz1axdDERGn3rDFxnvSIFRb7lyxJ0xpqUr1RET90YeXqxs/GRj NTlfXfy1RVLIi1OKWwlmlTI6LQ2NllbuGIWUrRUtrUQ4jhNlMRCRY5PK8AEv3xi0o0jWt+lR6l6s jVU7DaYvOjH27A9KK3eMfNIq5y2tyAmiIIfk2KQydkiQg3tc3v6100gW5q857aYgB5SRg3tZNPfZ UTB5SRk9/+1yYl5N3LfUPLFKoiwqfjk4GQhPhwW/K1OUnepURyyF4mPPfL+0dEvPJ61S1jZ13ucX A5HA+BE5NuXB+W+DypVHBSHksd8/bjGr1wXpa4HxI4HxbZYnC0weD+CyUC1oJZi1eJ8/PH1u78rj XjuNZB2ETL340w4Vx912EUxOkEL7cUL2VjuNZOzkC7GTL+xdeVxt59WS+Een/aPTABBX4NiZ38xZ d/emaH2qgx0xJ0ihg2cH+zZe5NapMgghhBBCCHkKJu4IIYQQQgi5ACbuCCGEEEIIuQAm7gghhBBC CLkAJu4IIYQQQgi5ACbuCCGEEEIIuQAm7gghhBBCCLkAJu4IIYQQQgi5ACbuCCGEEEIIuQAm7ggh hBBCCLkAJu4IIYQQQgi5ACbuCCGEEEIIuQAm7gghhBBCCLkAJu4IIYQQQgi5ACbuCCGEEEIIuQAm 7gghhBBCCLkAJu4IIYQQQgi5ACbuCCGEEEIIuQAm7gghhBBCCLkAJu4IIYQQQgi5ACbuCCGEEEII uQBhjNX+/b/9u79IP7jdq9IghBBCCKEB873vfe/pp5/udSkGwSMj7pvzeIR6jmGdRAghhBACELb8 /cYrz92/P9aTogyScrmcSCQAYHx8XJblXhfH3ZaXlw3DUBRlbAxrZluq1XJiYsLn8/W6OO62tLRk miZWy/aVSqVkMglYLTvBqZZ+v390dLTXZXG3YrGYSqUAYHJyUpKkXhdnEIyPj/e6CANi61QZhBBC CCGEUB/Cm1MRQgghhBByAUzcEUIIIYQQcgFM3BFCCCGEEHKB/x9iaPK21UfXJAAAAABJRU5ErkJg gg== "
-         id="image2454"
-         x="181.23958"
-         y="89.791664" />
+         xml:space="preserve"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.29166698px;line-height:4.4979167px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         x="96.944122"
+         y="126.07596"
+         id="text1024-2-7-6"
+         inkscape:label="CalibrText"><tspan
+           sodipodi:role="line"
+           id="tspan1022-4-5-7"
+           x="96.944122"
+           y="126.07596"
+           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;line-height:4.4979167px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:center;text-anchor:middle;stroke-width:0.26458332px">Automatic</tspan><tspan
+           sodipodi:role="line"
+           x="96.944122"
+           y="130.66551"
+           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;line-height:4.4979167px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:center;text-anchor:middle;stroke-width:0.26458332px"
+           id="tspan6160">Calibration</tspan></text>
     </a>
-    <g
-       id="g2841"
-       transform="translate(-2.8431311e-6,13.229176)">
-      <a
-         style="fill:#ffffff;fill-opacity:1"
-         xlink:href="http://simgrid.gforge.inria.fr/contrib/smpi-calibration-doc/"
-         id="a6161">
-        <rect
-           style="opacity:0.93999999;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-           id="rect1020-5-6-3"
-           width="31.75"
-           height="7.9375086"
-           x="83.34375"
-           y="121.54166"
-           ry="2.6458309" />
-      </a>
-      <a
-         xlink:href="scenario.html#configuring-simgrid"
-         id="a6149"
-         transform="translate(-0.52916667)">
-        <text
-           xml:space="preserve"
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.29166698px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="64.221893"
-           y="126.93988"
-           id="text1024-2-7"><tspan
-             sodipodi:role="line"
-             id="tspan1022-4-5"
-             x="64.221893"
-             y="126.93988"
-             style="font-size:5.29166698px;stroke-width:0.26458332px">Config </tspan><tspan
-             id="tspan2827"
-             sodipodi:role="line"
-             x="64.221893"
-             y="133.55446"
-             style="font-size:5.29166698px;stroke-width:0.26458332px" /></text>
-      </a>
-      <a
-         xlink:href="http://simgrid.gforge.inria.fr/contrib/smpi-calibration-doc/"
-         id="a6164">
-        <text
-           id="text1024-2-7-6"
-           y="126.93988"
-           x="84.122337"
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.29166698px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           xml:space="preserve"><tspan
-             style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.29166698px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px"
-             y="126.93988"
-             x="84.122337"
-             id="tspan1022-4-5-7"
-             sodipodi:role="line">Calibration</tspan></text>
-      </a>
-      <a
-         xlink:href="deployment.html"
-         id="a6179">
-        <text
-           xml:space="preserve"
-           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="65.007576"
-           y="117.80719"
-           id="text1024-2"><tspan
-             sodipodi:role="line"
-             id="tspan1022-4"
-             x="65.007576"
-             y="117.80719"
-             style="fill:#000000;fill-opacity:1;stroke-width:0.26458332px">App Deployment</tspan></text>
-      </a>
+    <a
+       xlink:href="Configuring_SimGrid.html"
+       style="display:inline"
+       inkscape:label="ConfigLink"
+       id="a6149"
+       transform="translate(-0.52916951,14.28751)">
       <rect
-         inkscape:label="#rect1020-5-9-7"
-         ry="2.6458309"
-         y="121.54166"
-         x="63.5"
-         height="7.9375086"
-         width="18.520834"
+         style="display:inline;opacity:0.93999999;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
          id="ConfigBox"
-         style="display:inline;opacity:0.93999999;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+         width="21.166666"
+         height="7.748518"
+         x="64.029175"
+         y="120.67231"
+         ry="0.77487302"
+         inkscape:label="ConfigBox" />
+      <text
+         id="text1024-2-7"
+         y="126.00643"
+         x="66.213799"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.29166698px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         xml:space="preserve"
+         inkscape:label="ConfigText"><tspan
+           style="font-size:5.29166698px;stroke-width:0.26458332px"
+           y="126.00643"
+           x="66.213799"
+           id="tspan1022-4-5"
+           sodipodi:role="line">Config</tspan><tspan
+           style="font-size:5.29166698px;stroke-width:0.26458332px"
+           y="132.62102"
+           x="66.213799"
+           sodipodi:role="line"
+           id="tspan2827" /></text>
+    </a>
+    <a
+       xlink:href="Deploying_your_Application.html"
+       inkscape:label="DeployLink"
+       transform="translate(-2.8431311e-6,13.229176)"
+       id="a6179">
       <rect
-         inkscape:label="#rect1020-5-9-7"
-         ry="2.6458309"
-         y="112.28125"
-         x="63.5"
-         height="7.9374981"
+         style="display:inline;opacity:0.93999999;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+         id="DeployBox"
          width="51.59375"
-         id="Deployment"
-         style="display:inline;opacity:0.93999999;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
-    </g>
+         height="7.9374981"
+         x="63.499996"
+         y="111.75208"
+         ry="1.3229066"
+         inkscape:label="DeployBox" />
+      <text
+         id="text1024-2"
+         y="117.80719"
+         x="65.007576"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;line-height:6.61458349px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         xml:space="preserve"
+         inkscape:label="DeployText"><tspan
+           style="fill:#000000;fill-opacity:1;stroke-width:0.26458332px"
+           y="117.80719"
+           x="65.007576"
+           id="tspan1022-4"
+           sodipodi:role="line">App Deployment</tspan></text>
+    </a>
     <path
        style="display:inline;fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.67486387;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-       d="m 120.85583,114.92707 v 7.55951 l 60.38375,1e-5 0,4.34674 3.96875,-8.1265 -3.96875,-7.7485 0,3.96875 z"
-       id="path885-2-0-3"
+       d="m 120.85583,114.92707 v 7.55951 l 60.38375,1e-5 v 4.34674 l 3.96875,-8.1265 -3.96875,-7.7485 v 3.96875 z"
+       id="ModelCheckBox"
        inkscape:connector-curvature="0"
-       sodipodi:nodetypes="cccccccc" />
-    <rect
-       style="display:inline;opacity:0.93999999;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.67500001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
-       id="rect834-7-6"
-       width="56.885418"
-       height="37.041664"
-       x="60.854168"
-       y="108.3125"
-       ry="5.2916684" />
-    <g
-       id="g982"
-       transform="translate(-2.2622938,4.2333338)">
-      <circle
-         r="5.953125"
-         cy="102.47958"
-         cx="61.903095"
-         id="path977"
-         style="opacity:0.93999999;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
-      <text
-         id="text853"
-         y="106.90308"
-         x="55.99131"
-         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;line-height:6.61458302px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-         xml:space="preserve"><tspan
-           style="font-size:14.11111069px;stroke-width:0.26458332px"
-           y="106.90308"
-           x="55.99131"
-           id="tspan851"
-           sodipodi:role="line">+</tspan></text>
-    </g>
+       sodipodi:nodetypes="cccccccc"
+       inkscape:label="ModelCheckBox" />
     <g
        id="g4608"
        transform="matrix(0.42986539,0,0,0.42986539,-4.7757413,41.585473)"
-       style="stroke-width:2.32630968">
+       style="stroke-width:2.32630968"
+       inkscape:label="SimGrid Logo">
       <path
          d="m 108.47352,190.71221 c 1.50919,0 3.02225,-0.066 4.24427,-1.12571 1.15641,-0.93451 1.70215,-2.37879 1.70215,-3.82553 0,-1.79987 -0.83537,-3.60221 -2.57033,-4.37268 -1.28694,-0.6103 -2.92524,-0.5468 -4.34058,-0.5468 h -0.99625 v 9.87072 z m 8.48607,12.92331 h -1.76812 l -7.90857,-11.47763 h -0.77012 v 11.47763 h -1.5434 v -24.24113 h 3.02048 c 1.96392,0 3.89008,0.0332 5.53015,1.22238 1.73637,1.22378 2.44334,3.1503 2.44334,5.20911 0,4.2097 -2.92559,6.39657 -6.94408,6.33201 l 7.94032,11.47763"
          style="fill:#26b8d2;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.82067031"
        style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888855px;line-height:4.4979167px;font-family:sans-serif;-inkscape-font-specification:sans-serif;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#0a3455;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
        x="31.527008"
        y="135.82547"
-       id="text4612"><tspan
+       id="text4612"
+       inkscape:label="UserManual"><tspan
          sodipodi:role="line"
          id="tspan4610"
          x="31.527008"
          y="140.32338"
          style="line-height:4.4979167px;text-align:start;text-anchor:start;fill:#0a3455;fill-opacity:1;stroke-width:0.26458332px"
          id="tspan4614">Manual</tspan></text>
-  </g>
-  <g
-     inkscape:groupmode="layer"
-     id="layer3"
-     inkscape:label="caché"
-     style="display:none">
-    <g
-       style="display:inline"
-       id="g2868"
-       transform="translate(-2.308124,-15.370614)">
-      <g
-         transform="translate(0,-0.27062338)"
-         id="g3049">
-        <text
-           xml:space="preserve"
-           style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="4.823277"
-           y="132.04036"
-           id="text1032-6"><tspan
-             sodipodi:role="line"
-             id="tspan1030-0"
-             x="4.823277"
-             y="132.04036"
-             style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';stroke-width:0.26458332px">HPC</tspan></text>
-        <text
-           xml:space="preserve"
-           style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="17.162859"
-           y="132.04036"
-           id="text1028-4"><tspan
-             sodipodi:role="line"
-             id="tspan1026-38"
-             x="17.162859"
-             y="132.04036"
-             style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';stroke-width:0.26458332px">Clouds</tspan></text>
-        <text
-           xml:space="preserve"
-           style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="48.030613"
-           y="132.04036"
-           id="text1036-8-2"><tspan
-             sodipodi:role="line"
-             id="tspan1034-9-2"
-             x="48.030613"
-             y="132.04036"
-             style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';stroke-width:0.26458332px">P2P</tspan></text>
-      </g>
-      <g
-         transform="translate(0,-0.85044613)"
-         id="g3037">
-        <text
-           xml:space="preserve"
-           style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="4.9195676"
-           y="126.1971"
-           id="text1036-8-3"><tspan
-             sodipodi:role="line"
-             id="tspan1034-9-1"
-             x="4.9195676"
-             y="126.1971"
-             style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';stroke-width:0.26458332px">Scheduling</tspan></text>
-        <text
-           xml:space="preserve"
-           style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="44.552963"
-           y="126.1971"
-           id="text1028-4-7"><tspan
-             sodipodi:role="line"
-             id="tspan1026-38-6"
-             x="44.552963"
-             y="126.1971"
-             style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';stroke-width:0.26458332px">Grids</tspan></text>
-      </g>
+    <a
+       xlink:href="platform.html#defining-a-routing"
+       transform="translate(-32.808342,8.6462044)"
+       style="display:inline;fill:#ffffff;fill-opacity:1"
+       id="a6094"
+       inkscape:label="PlatfRoutingLink">
       <rect
-         rx="3.9687512"
-         ry="5.2916684"
-         y="112.65922"
-         x="2.645833"
-         height="32.694939"
-         width="55.5625"
-         id="rect834-3"
-         style="opacity:0.93999999;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.67541802;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+         inkscape:label="RoutingBox"
+         ry="1.3229153"
+         y="80.53125"
+         x="95.25"
+         height="10.58333"
+         width="22.48958"
+         id="RoutingBox"
+         style="display:inline;opacity:0.93999999;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.35277772;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
       <text
-         id="text814-5"
-         y="119.51517"
-         x="13.577628"
-         style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.76111126px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         xml:space="preserve"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;line-height:6.61458302px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         x="96.999245"
+         y="85.314552"
+         id="text1032"
+         inkscape:label="RoutingText1"><tspan
+           sodipodi:role="line"
+           id="tspan1030"
+           x="96.999245"
+           y="85.314552"
+           style="font-size:4.93888903px;stroke-width:0.26458332px">Routing</tspan></text>
+      <text
+         xml:space="preserve"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.52777767px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         x="99.986229"
+         y="89.863449"
+         id="text1028-1-4-3-0-8"
+         inkscape:label="RoutingText2"><tspan
+           sodipodi:role="line"
+           id="tspan1026-2-99-6-3-6"
+           x="99.986229"
+           y="89.863449"
+           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px">paths</tspan></text>
+    </a>
+    <a
+       xlink:href="app_s4u.html"
+       transform="translate(-56.88542,11.906248)"
+       id="a6097-3-3"
+       style="display:inline;fill:#ffffff;fill-opacity:1"
+       inkscape:label="ActorLink">
+      <rect
+         inkscape:label="ActorBox"
+         ry="0.87357658"
+         y="68.625"
+         x="62.177086"
+         height="6.9886174"
+         width="50.270832"
+         id="ActorBox"
+         style="display:inline;opacity:0.93999999;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <text
+         xml:space="preserve"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;line-height:6.61458302px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         x="68.460075"
+         y="73.960541"
+         id="ProfileText-7-6"
+         inkscape:label="ActorText"><tspan
+           sodipodi:role="line"
+           id="tspan1034-5-2"
+           x="68.460075"
+           y="73.960541"
+           style="font-size:4.93888903px;stroke-width:0.26458332px">Abstract Actors</tspan><tspan
+           sodipodi:role="line"
+           x="68.460075"
+           y="80.575127"
+           style="font-size:4.93888903px;stroke-width:0.26458332px"
+           id="tspan2316-9" /></text>
+    </a>
+    <a
+       inkscape:label="OfflineTraceLink"
+       style="display:inline;fill:#ffffff;fill-opacity:1"
+       id="a6097-3-1"
+       transform="translate(-56.885422,31.905132)"
+       xlink:href="">
+      <rect
+         inkscape:label="OfflineTraceBox"
+         ry="0.87357658"
+         y="68.625"
+         x="62.177086"
+         height="6.9886174"
+         width="50.270832"
+         id="OfflineTraceBox"
+         style="display:inline;opacity:0.93999999;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <text
+         xml:space="preserve"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;line-height:6.61458302px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         x="70.530411"
+         y="73.960541"
+         id="ProfileText-7-7"
+         inkscape:label="OfflineTraceText"><tspan
+           sodipodi:role="line"
+           id="tspan1034-5-0"
+           x="70.530411"
+           y="73.960541"
+           style="font-size:4.93888903px;stroke-width:0.26458332px">Offline Traces</tspan><tspan
+           sodipodi:role="line"
+           x="70.530411"
+           y="80.575127"
+           style="font-size:4.93888903px;stroke-width:0.26458332px"
+           id="tspan2316-93" /></text>
+    </a>
+    <a
+       xlink:href="app_smpi.html"
+       transform="translate(-56.88542,21.90569)"
+       id="a6097-3-6"
+       style="display:inline;fill:#ffffff;fill-opacity:1"
+       inkscape:label="MPI Link">
+      <rect
+         inkscape:label="SMPIBox"
+         ry="0.87357658"
+         y="68.625"
+         x="62.177086"
+         height="6.9886174"
+         width="50.270832"
+         id="SMPIBox"
+         style="display:inline;opacity:0.93999999;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <text
+         xml:space="preserve"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;line-height:6.61458302px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         x="69.626068"
+         y="73.481842"
+         id="ProfileText-7-62"
+         inkscape:label="MPI Text"><tspan
+           sodipodi:role="line"
+           id="tspan1034-5-6"
+           x="69.626068"
+           y="73.481842"
+           style="font-size:4.93888903px;stroke-width:0.26458332px">Real MPI Code</tspan><tspan
+           sodipodi:role="line"
+           x="69.626068"
+           y="80.096428"
+           style="font-size:4.93888903px;stroke-width:0.26458332px"
+           id="tspan2316-1" /></text>
+    </a>
+    <g
+       id="g982"
+       transform="translate(-2.2622938,3.1750004)"
+       inkscape:label="CenterPlus">
+      <circle
+         r="5.953125"
+         cy="102.47958"
+         cx="61.903095"
+         id="path977"
+         style="opacity:0.93999999;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
+      <text
+         id="text853"
+         y="106.90308"
+         x="55.99131"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.3499999px;line-height:6.61458302px;font-family:'Amiri Quran Colored';-inkscape-font-specification:'Amiri Quran Colored';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
          xml:space="preserve"><tspan
-           style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.76111126px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';stroke-width:0.26458332px"
-           y="119.51517"
-           x="13.577628"
-           id="tspan812-6"
-           sodipodi:role="line">Domains</tspan></text>
-      <g
-         transform="translate(0,-1.4688305)"
-         id="g3055">
-        <text
-           xml:space="preserve"
-           style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="4.5052948"
-           y="138.77264"
-           id="text1036-8"><tspan
-             sodipodi:role="line"
-             id="tspan1034-9"
-             x="4.5052948"
-             y="138.77264"
-             style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';stroke-width:0.26458332px">Workflows</tspan></text>
-        <text
-           xml:space="preserve"
-           style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="48.294853"
-           y="138.77264"
-           id="text1036-8-2-7"><tspan
-             sodipodi:role="line"
-             id="tspan1034-9-2-4"
-             x="48.294853"
-             y="138.77264"
-             style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';stroke-width:0.26458332px">Fog</tspan></text>
-      </g>
-      <g
-         id="g3061">
-        <text
-           xml:space="preserve"
-           style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="4.5881495"
-           y="143.7269"
-           id="text1036-8-7"><tspan
-             sodipodi:role="line"
-             id="tspan1034-9-8"
-             x="4.5881495"
-             y="143.7269"
-             style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';stroke-width:0.26458332px">Volunteer</tspan></text>
-        <text
-           xml:space="preserve"
-           style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
-           x="49.219688"
-           y="143.7269"
-           id="text1036-8-2-7-1"><tspan
-             sodipodi:role="line"
-             id="tspan1034-9-2-4-9"
-             x="49.219688"
-             y="143.7269"
-             style="font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.58611107px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans Oblique';stroke-width:0.26458332px">IoT</tspan></text>
-      </g>
+           style="font-size:14.11111069px;stroke-width:0.26458332px"
+           y="106.90308"
+           x="55.99131"
+           id="tspan851"
+           sodipodi:role="line">+</tspan></text>
     </g>
+    <a
+       xlink:href="Platform_Examples.html"
+       inkscape:label="ExamplesLink"
+       transform="translate(-20.902092,-41.010402)"
+       style="display:inline;fill:#ffffff;fill-opacity:1"
+       id="a6161-7">
+      <rect
+         ry="1.102428"
+         y="121.54166"
+         x="83.34375"
+         height="6.6145773"
+         width="26.157658"
+         id="ExamplesBox"
+         style="opacity:0.93999999;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+         inkscape:label="ExamplesBox" />
+      <text
+         xml:space="preserve"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.29166698px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         x="84.447563"
+         y="126.40523"
+         id="text1024-2-7-6-2"
+         inkscape:label="ExamplesText"><tspan
+           sodipodi:role="line"
+           id="tspan1022-4-5-7-0"
+           x="84.447563"
+           y="126.40523"
+           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px">Examples</tspan></text>
+    </a>
+    <a
+       xlink:href="XML_Reference.html"
+       id="a6161-7-2"
+       style="display:inline;fill:#ffffff;fill-opacity:1"
+       transform="translate(6.879166,-41.010404)"
+       inkscape:label="ReferenceLink">
+      <rect
+         ry="1.1024289"
+         y="121.54166"
+         x="83.34375"
+         height="6.6145821"
+         width="26.193752"
+         id="ReferenceBox"
+         style="opacity:0.93999999;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+         inkscape:label="ReferenceBox" />
+      <text
+         xml:space="preserve"
+         style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.29166698px;line-height:6.61458349px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+         x="84.018303"
+         y="126.69018"
+         id="text1024-2-7-6-2-7"
+         inkscape:label="ReferenceText"><tspan
+           sodipodi:role="line"
+           id="tspan1022-4-5-7-0-5"
+           x="84.018303"
+           y="126.69018"
+           style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.93888903px;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';stroke-width:0.26458332px">Reference</tspan></text>
+    </a>
   </g>
 </svg>
index 91fd582..cc183c9 100644 (file)
@@ -1,15 +1,56 @@
 .. SimGrid documentation master file
 
-Welcome to SimGrid's documentation!
-===================================
+The Modern Age of Computer Systems Simulation
+=============================================
+
+SimGrid is a framework to simulate distributed computer systems. It can be used
+to either :ref:`assess abstract algorithms <usecase_simalgo>`, or to
+:ref:`debug and profile real MPI applications <usecase_smpi>`.
+
+SimGrid is routinely used in studies on (data-)Grids,
+IaaS Clouds (:ref:`API <API_s4u_VirtualMachine>`, :ref:`examples <s4u_ex_clouds>`),
+Clusters, High Performance Computing (`🖹 <http://hal.inria.fr/hal-01415484>`_),
+Peer-to-Peer systems,
+Volunteer Computing (`🖹 <http://www.sciencedirect.com/science/article/pii/S1569190X17301028>`__)
+Fog Computing (`🖹 <http://ieeexplore.ieee.org/document/7946412/>`__),
+MapReduce (`🖹 <http://www.sciencedirect.com/science/article/pii/S0167819113000215>`__) and
+`much more <https://simgrid.org/Usages.html>`_.
+
+The simulation models are **fast** (`🖹 <http://hal.inria.fr/hal-00650233>`__) and
+**highly scalable** (`🖹 <http://hal.inria.fr/inria-00602216/>`__) while
+**theoretically sound and experimentally assessed** (`🖹 <http://doi.acm.org/10.1145/2517448>`__).
+Most of the time, SimGrid is used to predict the performance (time and energy) of a
+given IT infrastructure, and it includes a prototype model checker to formally
+assess these systems.
+
+Technically speaking, SimGrid is a library. It is neither a graphical
+interface nor a command-line simulator running user scripts. The
+interaction with SimGrid is done by writing programs with the exposed
+functions to build your own simulator. This can be done in C/C++, Python or Java,
+on Linux, Mac OSX or Windows (using the WSL).
+
+SimGrid is a Free Software distributed under the LGPL-2.1 license. You are
+welcome to use, study, share and improve it, provided that your version are as
+free as ours. SimGrid is developed since 20 years by a lively community of users
+and researchers from several groups, initially in France and in the U.S.A. It
+is steadily funded by several research bodies. We hope that you will
+come and join us!
+
+SimGrid is a powerful tool, and this documentation will help you taking the best
+of it. Check its contents on the left. Each tutorial presents a classical use
+case, in a fast and practical manner. The user manual contains more
+thorough information. In each part, the important concepts are concisely
+introduced, before the reference manual. SimGrid is also described in several
+`scientific papers <https://simgrid.org/Publications.html>`_.
+
+Please report any documentation issue, including typos or unclear elements. You
+can even propose changes by clicking on the "Edit on FramaGit" button at the top
+of every page. Bugs in the code should be reported
+`on FramaGit <https://framagit.org/simgrid/simgrid/issues>`_
 
-.. TODO
-..
-.. Change the content of this page to integrate the verbose content of the webpage. 
-.. The toctrees should be made hidden to only live as a sidebar.
-.. The webpage should be made light, graphical and nice looking.
 
 .. toctree::
+   :hidden:
    :maxdepth: 1
    :caption: Tutorials:
 
@@ -17,24 +58,27 @@ Welcome to SimGrid's documentation!
        Simulating MPI Applications <Tutorial_MPI_Applications.rst>
 
 .. toctree::
+   :hidden:
    :maxdepth: 2
    :caption: User Manual:
 
-      Introduction <introduction.rst>
-      Â Â Â Main Concepts <intro_concepts.rst>
+      Introduction <Introduction.rst>
       Â Â Â Installing SimGrid <Installing_SimGrid.rst>
       Â Â Â Start your Own Project <Start_Your_Own_Project.rst>
       Describing your Application <application.rst>
       Â Â Â The S4U Interface <app_s4u.rst>
       Â Â Â The SMPI Interface <app_smpi.rst>
       Â Â Â The MSG Interface <app_msg.rst>
-      Â Â Â The Java Bindings <app_java.rst>
       Describing the Simulated Platform <platform.rst>
+      Â Â Â Examples <Platform_Examples.rst>
       Â Â Â Modeling Hints <platform_howtos.rst>
-      Â Â Â DTD Reference <platform_reference.rst>
-      Describing the Experimental Scenario <scenario.rst>
+      Â Â Â XML Reference <XML_Reference.rst>
+      Describing the Experimental Setup <Experimental_Setup.rst>
       Â Â Â Configuring SimGrid <Configuring_SimGrid.rst>
+      Â Â Â Deploying your Application <Deploying_your_Application.rst>
       The SimGrid Models <models.rst>
+      Â Â Â ns-3 as a SimGrid model <ns3.rst>
+      SimGrid Plugins <Plugins.rst>
       Simulation Outcomes <outcomes.rst>
       Use Cases and Howto <howto.rst>
       The SimGrid Community <community.rst>
diff --git a/docs/source/introduction.rst b/docs/source/introduction.rst
deleted file mode 100644 (file)
index d6bbd68..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-What is SimGrid
-***************
-
-SimGrid is a framework to simulate distributed computer systems.
-
-It can be used to either assess abstract algorithms or to profile and
-debug real distributed applications.  SimGrid enables studies in the
-domains of (data-)Grids, IaaS Clouds, Clusters, High Performance
-Computing, Volunteer Computing, and Peer-to-Peer systems.
-
-Technically speaking, SimGrid is a library. It is neither a graphical
-interface nor a command-line simulator running user scripts. The
-interaction with SimGrid is done by writing programs with the exposed
-functions to build your own simulator.
-
-SimGrid is a Free Software distributed under the LGPLv3 license. You are
-thus welcome to use it as you wish or even to modify and distribute
-your version (provided that 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 almost 20 years of research from several
-groups, both in France and in the U.S.A. It benefited of many funding
-from various research bodies, including the ANR, Inria, CNRS,
-University of Lorraine, University of Hawai'i at Manoa, ENS Rennes, and
-many others. Many thanks to our generous sponsors!
-
-SimGrid is a powerful tool, but its learning curve can be rather
-steep. This manual will hopefully help and guide you to the features
-you want to use. Please report any issue that you see in this manual,
-including typos or unclear elements. You can even propose changes by
-clicking on the "Edit on GitLab" button at the top of every page.
-
diff --git a/docs/source/ns3.rst b/docs/source/ns3.rst
new file mode 100644 (file)
index 0000000..c4e27ea
--- /dev/null
@@ -0,0 +1,163 @@
+.. _model_ns3:
+
+ns-3 as a SimGrid model
+#######################
+
+You can use the well-known `ns-3 packet-level network simulator
+<http://www.nsnam.org>`_ as a SimGrid model, for example to investigate the
+validity of your simulation. Just install ns-3 and recompile SimGrid
+accordingly.
+
+Compiling the ns-3/SimGrid binding
+**********************************
+
+Installing ns-3
+===============
+
+SimGrid requires ns-3 version 3.26 or higher, and you probably want the most
+recent version of both SimGrid and ns-3. While the Debian package of SimGrid
+don't have the ns-3 bindings activated, you can still use the packaged version
+of ns-3 by grabbing the ``libns3-dev ns3`` packages. Alternatively, you can
+install ns-3 from scratch as follows:
+
+.. code-block:: shell
+
+  # Download the source
+  wget http://www.nsnam.org/release/ns-allinone-3.29.tar.bz2
+  tar -xf ns-allinone-3.29.tar.bz2
+  cd ns-allinone-3.29/ns-3.29/
+  # Configure, build and install
+  ./waf configure --prefix="/opt/ns3" # or give another path if you prefer
+  ./waf
+  ./waf install
+
+For more information, please refer to the ns-3 documentation
+(`official website <http://www.nsnam.org>`_).
+
+Enabling ns-3 in SimGrid
+========================
+
+SimGrid must be recompiled with the ``enable_ns3`` option activated in cmake.
+Optionally, use ``NS3_HINT`` to hint cmake about where to find ns-3.
+
+.. code-block:: shell
+
+   cmake . -Denable_ns3=ON -DNS3_HINT=/opt/ns3 # or change the path if needed
+
+By the end of the configuration, cmake reports whether ns-3 was found,
+and this information is also available in ``include/simgrid/config.h``
+If your local copy defines the variable ``SIMGRID_HAVE_NS3`` to 1, then ns-3
+was correctly detected. Otherwise, explore ``CMakeFiles/CMakeOutput.log`` and
+``CMakeFiles/CMakeError.log`` to diagnose the problem.
+
+Test your installation after compilation as follows:
+
+.. code-block:: shell
+
+   ctest -R ns3
+
+Troubleshooting
+===============
+
+If you use a version of ns-3 that is not known to SimGrid yet, edit
+``tools/cmake/Modules/FindNS3.cmake`` in your SimGrid tree, according to the
+comments on top of this file. Conversely, if something goes wrong with an old
+version of either SimGrid or ns-3, try upgrading everything.
+
+.. _ns3_use:
+
+Using ns-3 from SimGrid
+***********************
+
+The SimGrid/ns-3 binding only contains features that are common to both
+systems: ns-3 wireless models are not available, while SimGrid routes
+cannot be longer than 1. Also, the platform built in ns-3 from the
+SimGrid description is very basic.
+
+Platform files compatibility
+============================
+
+Any route longer than one will be ignored when using ns-3. They are
+harmless, but you still need to connect your hosts using one-hop routes.
+The best solution is to add routers to split your route. Here is an
+example of invalid platform:
+
+.. code-block:: shell
+
+   <platform>
+     <host id="alice" speed="1Gf" />
+     <host id="bob"   speed="1Gf" />
+  
+     <link id="l1" bw="1Mbps" />
+     <link id="l2" bw="1Mbps" />
+
+     <route src="alice" dst="bob">
+       <link_ctn id="l1"/>            <!-- !!!! INVALID WITH ns-3    !!!! -->
+       <link_ctn id="l2"/>            <!-- !!!! length=2 IS TOO MUCH !!!! -->
+     </route>
+   </platform>
+  
+This can be reformulated as follows to make it usable with the ns-3 binding.
+There is no direct connection from alice to bob, but that's OK because
+ns-3 automatically routes from point to point.
+
+.. code-block:: shell
+
+   <platform>
+     <host id="alice" speed="1Gf" />
+     <host id="bob"   speed="1Gf" />
+
+     <router id="r1" /> <!-- routers are compute-less hosts -->
+
+     <link id="l1" bw="1Mbps" />
+     <link id="l2" bw="1Mbps" />
+
+     <route src="alice" dst="r1">
+       <link_ctn id="l1"/> 
+     </route>
+  
+     <route src="r1" dst="bob">
+       <link_ctn id="l2"/> 
+     </route>
+   </platform>
+
+Once your platform is OK, just change the :ref:`network/model
+<options_model_select>` configuration option to "ns-3" as follows. The rest
+is unchanged.
+
+.. code-block:: shell
+
+   ./network-ns3 --cfg=network/model:ns-3 (other parameters)
+
+Many other files from the ``examples/platform directory`` are usable with the
+ns-3 model, such as `examples/platforms/dogbone.xml <https://framagit.org/simgrid/simgrid/tree/master/examples/platforms/dogbone.xml>`_.
+Check the file  `examples/deprecated/msg/network-ns3/network-ns3.tesh <https://framagit.org/simgrid/simgrid/tree/master/examples/deprecated/msg/network-ns3/network-ns3.tesh>`_
+to see which ones are used in our regression tests.
+
+Limitations
+===========
+
+A ns-3 platform is automatically created from the provided SimGrid
+platform. However, there are some known caveats:
+
+  * The default values (e.g., TCP parameters) are the ns-3 default values.
+  * ns-3 networks are routed using the shortest path algorithm, using
+    ``ns3::Ipv4GlobalRoutingHelper::PopulateRoutingTables``.
+  * End hosts cannot have more than one interface card. So, your
+    SimGrid hosts should be connected to the platform through only
+    one link. Otherwise, your SimGrid host will be considered as a
+    router.
+
+Our goal is to keep the ns-3 plugin of SimGrid as easy (and hopefully readable)
+as possible. If the current state does not fit your needs, you should modify
+this plugin, and/or create your own plugin from the existing one. If you come up
+with interesting improvements, please contribute them back
+
+Troubleshooting
+===============
+
+If your simulation hangs in a communication, this is probably because one host
+is sending data that is not routable in your platform. Make sure that you only
+use routes of length 1, and that any host is connected to the platform.
+Arguably, SimGrid could detect this situation and report it, but unfortunately,
+this is still to be done.
similarity index 61%
rename from doc/doxygen/outcomes.doc
rename to docs/source/outcomes.rst
index cd395e0..efa4173 100644 (file)
@@ -1,10 +1,10 @@
-/** 
-@page outcomes Simulation Outcomes
+.. _outcomes:
+
+Simulation outcomes
+###################
 
 TBD
 
  - Logs
  - Visualisation and post-mortem statistics analysis
  - Model-Checking
-
-*/
\ No newline at end of file
index 1909927..bc020e7 100644 (file)
@@ -29,7 +29,7 @@ documentation also contains some :ref:`hints and howtos <howto>`, as well
 as the full :ref:`XML reference guide <platform_reference>`.
 
 
-Any simulated platform must contain **basic elements**, such as hosts, links, storages, etc. SimGrid gives you a great
+Any simulated platform must contain **basic elements**, such as hosts, links, disks, etc. SimGrid gives you a great
 liberty when defining the **routing of your platform**, i.e., the network path taken between each pair of hosts.
 Finally, you may also describe an **experimental scenario**, with qualitative (e.g., bandwidth variations representing
 an external load) and qualitative (e.g., representing how some elements fail and restart over time) changes.
@@ -52,7 +52,7 @@ simulated platform as a graph of hosts and network links.
 
 The most important elements are the basic ones: :ref:`pf_tag_host`,
 :ref:`pf_tag_link`, and similar. Then come the routes between any pair
-of hosts, that are given explicitely with :ref:`pf_tag_route` (routes
+of hosts, that are given explicitly with :ref:`pf_tag_route` (routes
 are symmetrical by default). Any host must be given a computational
 speed (in flops) while links must be given a latency (in seconds) and
 a bandwidth (in bytes per second). Note that you can write 1Gflops
@@ -75,7 +75,7 @@ Networking zones (:ref:`pf_tag_zone`) are used to factorize the description
 to reduce the size of your platform on disk and in memory. Then, when
 a host wants to communicate with another host belonging to the same
 zone, it is the zone's duty to find the list of links that are
-involved in the communication. In the above example, since we use
+involved in the communication. In the above examples, since we use
 ``routing="Full"``, all routes must be explicitly given using the
 :ref:`pf_tag_route` and :ref:`pf_tag_link_ctn` tags (this :ref:`routing
 model <pf_rm>` is both simple and inefficient :) It is OK to not
index 1c4eaca..b0826ed 100644 (file)
@@ -13,7 +13,7 @@
    <br/>
 
 .. _howto:
-   
+
 Modeling Hints
 ##############
 
@@ -61,7 +61,7 @@ freely available, though.
 .. _howto_churn:
 
 Modeling Churn (e.g., in P2P)
-****************************
+*****************************
 
 One of the biggest challenges in P2P settings is to cope with the
 churn, meaning that resources keep appearing and disappearing. In
@@ -185,3 +185,60 @@ period and another one for the shutdown period.
 
 Of course, this is only one possible way to model these things. YMMV ;)
 
+.. _understanding_lv08
+
+Understanding the default TCP model
+***********************************
+When simulating a data transfer between two hosts, you may be surprised
+by the obtained simulation time. Lets consider the following platform:
+
+.. code-block:: xml
+
+   <host id="A" speed="1Gf"/>
+   <host id="B" speed="1Gf"/>
+
+   <link id="link1" latency="10ms" bandwidth="1Mbps"/>
+
+   <route src="A" dst="B>
+     <link_ctn id="link1/>
+   </route>
+
+If host `A` sends `100kB` (a hundred kilobytes) to host `B`, one could expect
+that this communication would take `0.81` seconds to complete according to a
+simple latency-plus-size-divided-by-bandwidth model (0.01 + 8e5/1e6 = 0.81).
+However, the default TCP model of SimGrid is a bit more complex than that. It
+accounts for three phenomena that directly impact the simulation time even
+on such a simple example:
+
+  - The size of a message at the application level (i.e., 100kB in this
+    example) is not the size that will actually be transferred over the
+    network. To mimic the fact that TCP and IP headers are added to each packet of
+    the original payload, the TCP model of SimGrid empirically considers that
+    `only 97% of the nominal bandwidth` are available. In other words, the
+    size of your message is increased by a few percents, whatever this size be.
+
+  - In the real world, the TCP protocol is not able to fully exploit the
+    bandwidth of a link from the emission of the first packet. To reflect this
+    `slow start` phenomenon, the latency declared in the platform file is
+    multiplied by `a factor of 13.01`. Here again, this is an empirically
+    determined value that may not correspond to every TCP implementations on
+    every networks. It can be tuned when more realistic simulated times for
+    short messages are needed though.
+
+  - When data is transferred from A to B, some TCP ACK messages travel in the
+    opposite direction. To reflect the impact of this `cross-traffic`, SimGrid
+    simulates a flow from B to A that represents an additional bandwidth
+    consumption of `0.05`. The route from B to A is implicity declared in the
+    platfrom file and uses the same link `link1` as if the two hosts were
+    connected through a communication bus. The bandwidth share allocated to the
+    flow from A to B is then the available bandwidth of `link1` (i.e., 97% of
+    the nominal bandwidth of 1Mb/s) divided by 1.05 (i.e., the total consumption).
+    This feature, activated by default, can be disabled by adding the
+    `--cfg=network/crosstraffic:0` flag to command line.
+
+As a consequence, the time to transfer 100kB from A to B as simulated by the
+default TCP model of SimGrid is not 0.81 seconds but
+
+.. code-block:: python
+
+    0.01 * 13.01 + 800000 / ((0.97 * 1e6) / 1.05) =  0.996079 seconds.
diff --git a/docs/source/scenario.rst b/docs/source/scenario.rst
deleted file mode 100644 (file)
index 8d4b677..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-.. _scenario:
-
-Describing the Experimental Scenario
-************************************
-
-.. todo::
-
-   Main concepts:
-
-   - Deployment file
-   - Availability and state profiles
-   - Reproducible random number generation
-   - Command line options, in particular on the model switching
-
-
-
-            
index c5a61b9..99a610f 100644 (file)
@@ -74,6 +74,6 @@ if(enable_java)
            cloud-migration cloud-masterworker dht-chord dht-kademlia energy-consumption energy-pstate energy-vm hostload 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 javacmd=${Java_JAVA_EXECUTABLE} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/java --setenv LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/deprecated/java/${example_dir} ${CMAKE_HOME_DIRECTORY}/examples/deprecated/java/${example_dir}/${example}.tesh)
+    ADD_TESH(java-${example}  --setenv javacmd=${Java_JAVA_EXECUTABLE} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/java --setenv LD_LIBRARY_PATH=${TESH_LIBRARY_PATH} --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/examples/deprecated/java/${example_dir} ${CMAKE_HOME_DIRECTORY}/examples/deprecated/java/${example_dir}/${example}.tesh)
   endforeach()
 endif()
index a9a9511..9d4ab36 100644 (file)
@@ -186,29 +186,26 @@ public class Node extends Process {
     GetPredecessorTask sendTask = new GetPredecessorTask(getHost().getName(), this.mailbox);
     try {
       sendTask.send(mailboxTo, Common.TIMEOUT);
-      try {
-        do {
-          if (commReceive == null) {
-            commReceive = Task.irecv(this.mailbox);
-          }
-          commReceive.waitCompletion(Common.TIMEOUT);
-          Task taskReceived = commReceive.getTask();
-          if (taskReceived instanceof GetPredecessorAnswerTask) {
-            predecessorId = ((GetPredecessorAnswerTask) taskReceived).getAnswerId();
-            stop = true;
-          } else {
-            handleTask(taskReceived);
-          }
-          commReceive = null;
-        } while (!stop);
-      }
-      catch (MsgException e) {
+      do {
+        if (commReceive == null) {
+          commReceive = Task.irecv(this.mailbox);
+        }
+        commReceive.waitCompletion(Common.TIMEOUT);
+        Task taskReceived = commReceive.getTask();
+        if (taskReceived instanceof GetPredecessorAnswerTask) {
+          predecessorId = ((GetPredecessorAnswerTask) taskReceived).getAnswerId();
+          stop = true;
+        } else {
+          handleTask(taskReceived);
+        }
         commReceive = null;
-      }
+      } while (!stop);
     }
     catch (MsgException e) {
       Msg.debug("Failed to send the Get Predecessor request");
     }
+    commReceive = null;
+
     return predecessorId;
   }
 
@@ -240,23 +237,17 @@ public class Node extends Process {
         if (commReceive == null) {
           commReceive = Task.irecv(this.mailbox);
         }
-        try {
-          commReceive.waitCompletion(Common.TIMEOUT);
-          Task task = commReceive.getTask();
-          if (task instanceof FindSuccessorAnswerTask) {
-            //TODO: Check if this this our answer.
-            FindSuccessorAnswerTask fTask = (FindSuccessorAnswerTask) task;
-            stop = true;
-            successor = fTask.getAnswerId();
-          } else {
-            handleTask(task);
-          }
-          commReceive = null;
-        }
-        catch (TimeoutException e) {
+        commReceive.waitCompletion(Common.TIMEOUT);
+        Task task = commReceive.getTask();
+        if (task instanceof FindSuccessorAnswerTask) {
+          //TODO: Check if this this our answer.
+          FindSuccessorAnswerTask fTask = (FindSuccessorAnswerTask) task;
           stop = true;
-          commReceive = null;
+          successor = fTask.getAnswerId();
+        } else {
+          handleTask(task);
         }
+        commReceive = null;
       } while (!stop);
     }
     catch (TimeoutException e) {
@@ -265,6 +256,7 @@ public class Node extends Process {
     catch (MsgException e) {
       Msg.debug("Failed to receive Find Successor");
     }
+    commReceive = null;
 
     return successor;
   }
@@ -313,13 +305,12 @@ public class Node extends Process {
   // It refreshes the finger table of the current node.
   private void fixFingers() {
     Msg.debug("Fixing fingers");
-    int i = this.nextFingerToFix;
-    int successorId = this.findSuccessor(this.id + (int)Math.pow(2,i)); //FIXME: SLOW
+    int successorId = findSuccessor(id + (1 << nextFingerToFix));
     if (successorId != -1) {
-      if (successorId != fingers[i]) {
-        setFinger(i, successorId);
+      if (successorId != fingers[nextFingerToFix]) {
+        setFinger(nextFingerToFix, successorId);
       }
-      nextFingerToFix = (i + 1) % Common.NB_BITS;
+      nextFingerToFix = (nextFingerToFix + 1) % Common.NB_BITS;
     }
   }
 
index 0216915..b18ee0c 100644 (file)
@@ -5,20 +5,20 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 package dht.kademlia;
+import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Vector;
 
 import org.simgrid.msg.Msg;
 
 public class RoutingTable {
   /* Bucket list */
-  private Vector<Bucket> buckets;
+  private ArrayList<Bucket> buckets;
   /* Id of the routing table owner */
   private int id;
 
   public RoutingTable(int id) {
     this.id = id;
-    buckets = new Vector<>();
+    buckets = new ArrayList<>();
     for (int i = 0; i < Common.IDENTIFIER_SIZE + 1; i++) {
       buckets.add(new Bucket(i));
     }
index 59604a5..e726ce1 100644 (file)
@@ -18,7 +18,7 @@ public class EnergyConsumer extends Process {
   }
 
   public void main(String[] args) throws MsgException {
-     Msg.info("Energetic profile: " + getHost().getProperty("watt_per_state"));
+     Msg.info("Energetic profile: " + getHost().getProperty("wattage_per_state"));
      Msg.info("Initial peak speed= " + getHost().getSpeed() + " flop/s; Energy dissipated = "
               + getHost().getConsumedEnergy() + " J");
 
index 62c75ad..eccc8fd 100644 (file)
@@ -4,7 +4,7 @@
 
 $ ${javacmd:=java} -classpath ${classpath:=.} energy/consumption/Main ${srcdir:=.}/../../platforms/energy_platform.xml
 > [0.000000] [java/INFO] Using regular java threads.
-> [MyHost1:energyConsumer:(1) 0.000000] [java/INFO] Energetic profile: 100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0
+> [MyHost1:energyConsumer:(1) 0.000000] [java/INFO] Energetic profile: 100.0:93.33333333333333:200.0, 93.0:90.0:170.0, 90.0:90.0:150.0
 > [MyHost1:energyConsumer:(1) 0.000000] [java/INFO] Initial peak speed= 1.0E8 flop/s; Energy dissipated = 0.0 J
 > [MyHost1:energyConsumer:(1) 10.000000] [java/INFO] Currently consumed energy after sleeping 10 sec: 1000.0
 > [MyHost1:energyConsumer:(1) 20.000000] [java/INFO] Currently consumed energy after executing 1E9 flops: 2200.0
index d175c6a..8e5c380 100644 (file)
@@ -25,7 +25,7 @@ import org.simgrid.msg.MsgException;
 
 public class Node extends Process {
   private static String file1 = "/doc/simgrid/examples/platforms/g5k.xml";
-  private static String file2 = "\\Windows\\setupact.log";
+  private static String file2 = "/include/surf/simgrid_dtd.h";
   private static String file3 = "/doc/simgrid/examples/platforms/g5k_cabinets.xml";
   private static String file4 = "/doc/simgrid/examples/platforms/nancy.xml";
 
@@ -44,7 +44,7 @@ public class Node extends Process {
         fileName = mount + file1;
       break;
       case 0:
-        mount = "c:";
+        mount = "/tmp";
         fileName = mount + file2;
       break;
       case 2:
index ca3957b..2ee1178 100644 (file)
@@ -3,19 +3,19 @@
 $ ${javacmd:=java} -classpath ${classpath:=.} io/file/Main ${srcdir:=.}/../../platforms/storage/storage.xml
 > [0.000000] [java/INFO] Using regular java threads.
 > [0.000000] [java/INFO] Number of hosts:4
-> [alice:0:(1) 0.000000] [java/INFO] Open file c:\Windows\setupact.log
+> [alice:0:(1) 0.000000] [java/INFO] Open file /tmp/include/surf/simgrid_dtd.h
 > [bob:1:(2) 0.000000] [java/INFO] Open file /home/doc/simgrid/examples/platforms/nancy.xml
 > [carl:2:(3) 0.000000] [java/INFO] Open file /home/doc/simgrid/examples/platforms/g5k_cabinets.xml
 > [denise:3:(4) 0.000000] [java/INFO] Open file /home/doc/simgrid/examples/platforms/g5k.xml
 > [bob:1:(2) 0.000040] [java/INFO] Having read 4028 on /home/doc/simgrid/examples/platforms/nancy.xml
-> [alice:0:(1) 0.000050] [java/INFO] Having read 10000 on c:\Windows\setupact.log
+> [alice:0:(1) 0.000050] [java/INFO] Having read 10000 on /tmp/include/surf/simgrid_dtd.h
 > [denise:3:(4) 0.000050] [java/INFO] Having read 10000 on /home/doc/simgrid/examples/platforms/g5k.xml
 > [carl:2:(3) 0.000100] [java/INFO] Having read 10000 on /home/doc/simgrid/examples/platforms/g5k_cabinets.xml
-> [alice:0:(1) 0.001717] [java/INFO] Having write 100000 on c:\Windows\setupact.log
-> [alice:0:(1) 0.001717] [java/INFO] Seek back to the beginning of c:\Windows\setupact.log
+> [alice:0:(1) 0.001717] [java/INFO] Having write 100000 on /tmp/include/surf/simgrid_dtd.h
+> [alice:0:(1) 0.001717] [java/INFO] Seek back to the beginning of /tmp/include/surf/simgrid_dtd.h
 > [denise:3:(4) 0.001717] [java/INFO] Having write 100000 on /home/doc/simgrid/examples/platforms/g5k.xml
 > [denise:3:(4) 0.001717] [java/INFO] Seek back to the beginning of /home/doc/simgrid/examples/platforms/g5k.xml
-> [alice:0:(1) 0.002267] [java/INFO] Having read 110000 on c:\Windows\setupact.log
+> [alice:0:(1) 0.002267] [java/INFO] Having read 110000 on /tmp/include/surf/simgrid_dtd.h
 > [denise:3:(4) 0.002267] [java/INFO] Having read 110000 on /home/doc/simgrid/examples/platforms/g5k.xml
 > [bob:1:(2) 0.003374] [java/INFO] Having write 100000 on /home/doc/simgrid/examples/platforms/nancy.xml
 > [bob:1:(2) 0.003374] [java/INFO] Seek back to the beginning of /home/doc/simgrid/examples/platforms/nancy.xml
index 4c3177e..9f7fc35 100644 (file)
@@ -5,8 +5,8 @@ $ ${javacmd:=java} -classpath ${classpath:=.} io/storage/Main ${srcdir:=.}/../..
 > [denise:0:(1) 0.000000] [java/INFO] ------------------------------------
 > [denise:0:(1) 0.000000] [java/INFO] Disk name: Disk2
 > [denise:0:(1) 0.000000] [java/INFO] Size: 536870912000 bytes.
-> [denise:0:(1) 0.000000] [java/INFO] Free Size: 534479374867 bytes.
-> [denise:0:(1) 0.000000] [java/INFO] Used Size: 2391537133 bytes.
+> [denise:0:(1) 0.000000] [java/INFO] Free Size: 536857690006 bytes.
+> [denise:0:(1) 0.000000] [java/INFO] Used Size: 13221994 bytes.
 > [denise:0:(1) 0.000000] [java/INFO] ------------------------------------
 > [denise:0:(1) 0.000000] [java/INFO] Disk name: Disk4
 > [denise:0:(1) 0.000000] [java/INFO] Size: 536870912000 bytes.
index aba8341..7ca62cb 100644 (file)
@@ -33,11 +33,10 @@ public class Emigrant extends Process {
     migrate(Host.getByName("Boivin"));
     waitFor(4);
 
-    Main.processToMigrate = this;
     Main.mutex.release();
     suspend();
 
     Msg.info("I've been moved on this new host:" + getHost().getName());
     Msg.info("Uh, nothing to do here. Stopping now");
   }
-}
\ No newline at end of file
+}
index 70a0afc..e7f1ae9 100644 (file)
@@ -36,6 +36,7 @@ class Main {
         policeman.start();
         Emigrant emigrant   = new Emigrant("Jacquelin","emigrant");
         emigrant.start();
+        processToMigrate = emigrant;
     } catch (HostNotFoundException e){
       Msg.error("Create processes failed!");
       e.printStackTrace();
index 0e62567..ac04e1a 100644 (file)
@@ -71,7 +71,14 @@ foreach (x trace-categories trace-route-user-variables trace-link-user-variables
                    ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/${x}/${x}.tesh)
 endforeach()
 
-ADD_TESH_FACTORIES(msg-dht-kademlia-parallel "thread;ucontext;raw;boost" --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} 
+if(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "i386" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
+  # Thread-local storage (TLS) is needed for parallel execution, but it doesn't
+  # play well with Ucontexts on 64bit SunOS (at least on x86_64).
+  set(parallel-factories "thread;raw;boost")
+else()
+  set(parallel-factories "thread;ucontext;raw;boost")
+endif()
+ADD_TESH_FACTORIES(msg-dht-kademlia-parallel "${parallel-factories}" --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO}
                                              --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/dht-kademlia
                                              --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/dht-kademlia
                                              --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
index e2ffbeb..29f3a75 100644 (file)
@@ -95,7 +95,7 @@ They have to be run with the following options:
 
 @section msg_ex_models Models-related examples
 
-@subsection msg_ex_ns3 NS3 as a SimGrid Network Model
+@subsection msg_ex_ns3 ns-3 as a SimGrid Network Model
 
 This example demonstrates how to use the bindings to the Network
 Simulator, as explained in @ref pls_ns3. The most
index 622ea9f..8042975 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing a simple master/worker example application
 
-$ $SG_TEST_EXENV ./app-masterworker/app-masterworker ${platfdir}/multicore_machine.xml ${srcdir}/app-masterworker-multicore_d.xml --cfg=cpu/model:Cas01 --cfg=cpu/optim:Full "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ./app-masterworker/app-masterworker ${platfdir}/multicore_machine.xml ${srcdir}/app-masterworker-multicore_d.xml --cfg=cpu/model:Cas01 --cfg=cpu/optim:Full "--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 'cpu/optim' to 'Full'
 > [  0.000000] (1:master@Tremblay) Got 6 workers and 20 tasks to process
index 16ac3e1..44ae31f 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing a simple master/worker example application
 
-$ $SG_TEST_EXENV ${bindir}/app-masterworker  ${platfdir}/vivaldi.xml ${srcdir}/app-masterworker-vivaldi_d.xml --cfg=network/latency-factor:1.0 --cfg=network/bandwidth-factor:1.0 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir}/app-masterworker  ${platfdir}/vivaldi.xml ${srcdir}/app-masterworker-vivaldi_d.xml --cfg=network/latency-factor:1.0 --cfg=network/bandwidth-factor:1.0 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/latency-factor' to '1.0'
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/bandwidth-factor' to '1.0'
 > [  0.000000] (1:master@100030591) Got 15 workers and 10 tasks to process
index 91e3d7a..f5343be 100644 (file)
@@ -3,7 +3,7 @@
 p Testing a simple master/worker example application (mailbox version)
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/app-masterworker$EXEEXT ${platfdir}/small_platform_with_routers.xml ${srcdir}/app-masterworker_d.xml --cfg=network/crosstraffic:0 --trace "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/app-masterworker ${platfdir}/small_platform_with_routers.xml ${srcdir}/app-masterworker_d.xml --cfg=network/crosstraffic:0 --trace "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/crosstraffic' to '0'
 > [  0.000000] (1:master@Tremblay) Got 5 workers and 20 tasks to process
 > [  0.000000] (1:master@Tremblay) Sending "Task_0" (of 20) to mailbox "worker-0"
@@ -34,7 +34,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/app-masterworker$EXEEXT ${platfdir}/small_platform
 > [  5.094868] (0:maestro@) Simulation time 5.09487
 > [  5.094868] (6:worker@Bourassa) I'm done. See you!
 
-$ $SG_TEST_EXENV ${bindir:=.}/app-masterworker$EXEEXT ${platfdir}/small_platform_with_routers.xml ${srcdir}/app-masterworker_d.xml --trace "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/app-masterworker ${platfdir}/small_platform_with_routers.xml ${srcdir}/app-masterworker_d.xml --trace "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:master@Tremblay) Got 5 workers and 20 tasks to process
 > [  0.000000] (1:master@Tremblay) Sending "Task_0" (of 20) to mailbox "worker-0"
 > [  0.002265] (1:master@Tremblay) Sending "Task_1" (of 20) to mailbox "worker-1"
index f9d1ed1..cb9bfb5 100644 (file)
@@ -37,7 +37,7 @@ static void send_tasks(int nb_workers)
   }
 }
 
-static int worker_fun(int argc, char *argv[])
+static int worker_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   const char *pr_name = MSG_process_get_name(MSG_process_self());
   char mbox[MAXMBOXLEN];
@@ -65,7 +65,7 @@ static int worker_fun(int argc, char *argv[])
   return 0;
 }
 
-static int master_fun(int argc, char *argv[])
+static int master_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_vm_t vm;
   unsigned int i;
index 24813d1..f4abd36 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing the Cloud API with a simple master/workers
 
-$ $SG_TEST_EXENV ${bindir:=.}/cloud-masterworker$EXEEXT --log=no_loc ${platfdir}/cluster_backbone.xml
+$ ${bindir:=.}/cloud-masterworker --log=no_loc ${platfdir}/cluster_backbone.xml
 > [node-0.simgrid.org:master:(1) 0.000000] [msg_test/INFO] # Launch 2 VMs
 > [node-0.simgrid.org:master:(1) 0.000000] [msg_test/INFO] create VM00 on PM(node-1.simgrid.org)
 > [node-0.simgrid.org:master:(1) 0.000000] [msg_test/INFO] put a process (WRK00) on VM00
index 1aa3b9a..d420bb9 100644 (file)
@@ -5,6 +5,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "answer.h"
+#include "node.h"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(msg_kademlia_node);
 
index 93b748a..bba5625 100644 (file)
@@ -18,8 +18,6 @@ typedef struct s_node_answer {
 
 typedef s_answer_t *answer_t;
 
-#include "node.h"
-
 answer_t answer_init(unsigned int destination_id);
 void answer_free(answer_t answer);
 void answer_print(answer_t answer);
index 577c299..7825b34 100644 (file)
@@ -3,7 +3,7 @@
 p Testing the Kademlia implementation with MSG
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/dht-kademlia ${platfdir}/cluster_backbone.xml ${srcdir}/dht-kademlia_d.xml "--log=root.fmt:[%10.6r]%e(%02i:%P@%h)%e%m%n"
+$ ${bindir:=.}/dht-kademlia ${platfdir}/cluster_backbone.xml ${srcdir}/dht-kademlia_d.xml "--log=root.fmt:[%10.6r]%e(%02i:%P@%h)%e%m%n"
 > [  0.000000] ( 1:node@node-0.simgrid.org) Hi, I'm going to create the network with id 0
 > [  0.000000] ( 2:node@node-1.simgrid.org) Hi, I'm going to join the network with id 1
 > [  0.000000] ( 3:node@node-2.simgrid.org) Hi, I'm going to join the network with id 3
index a5ef7b6..ba71a21 100644 (file)
@@ -511,7 +511,6 @@ static int node(int argc, char *argv[])
       if (node.comm_receive == NULL) {
         task_received = NULL;
         node.comm_receive = MSG_task_irecv(&task_received, node.mailbox);
-        // FIXME: do not make MSG_task_irecv() calls from several functions
       }
       if (!MSG_comm_test(node.comm_receive)) {
         MSG_process_sleep(5);
index fc66316..c2aedae 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing the Pastry implementation with MSG
 
-$ $SG_TEST_EXENV ${bindir:=.}/dht-pastry$EXEEXT -nb_bits=6 ${platfdir}/cluster_backbone.xml ${srcdir}/dht-pastry_d.xml --log=msg_pastry.thres:verbose "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/dht-pastry -nb_bits=6 ${platfdir}/cluster_backbone.xml ${srcdir}/dht-pastry_d.xml --log=msg_pastry.thres:verbose "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [ 25.007806] (1:node@node-0.simgrid.org) Task update from 366680 !!!
 > [ 25.007806] (1:node@node-0.simgrid.org) Node:
 > [ 25.007806] (1:node@node-0.simgrid.org)  Id: 42 '0000002a' 
index e4c8ce9..1f35d8b 100644 (file)
@@ -9,7 +9,8 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(energy_vm, "Messages of this example");
 
-static int worker_func(int argc, char *argv[]) {
+static int worker_func(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
+{
   msg_task_t task1 = MSG_task_create("t1", 300E6, 0, NULL);
   MSG_task_execute (task1);
   MSG_task_destroy(task1);
@@ -17,7 +18,7 @@ static int worker_func(int argc, char *argv[]) {
   return 0;
 }
 
-static int dvfs(int argc, char *argv[])
+static int dvfs(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_host_t host1 = MSG_host_by_name("MyHost1");
   msg_host_t host2 = MSG_host_by_name("MyHost2");
index b8ab020..ba4dbdf 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing the mechanism for computing host energy consumption in case of VMs
 
-$ ${bindir:=.}/energy-vm$EXEEXT ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/energy-vm ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:dvfs@MyHost1) Creating and starting two VMs
 > [  0.000000] (1:dvfs@MyHost1) Create two tasks on Host1: both inside a VM
 > [  0.000000] (1:dvfs@MyHost1) Create two tasks on Host2: one inside a VM, the other directly on the host
index c9cc7ed..0d4d3ed 100644 (file)
@@ -25,9 +25,7 @@ if(SIMGRID_HAVE_MC)
   ADD_TESH_FACTORIES(mc-bugged2                "ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/mc bugged2.tesh)
   IF(HAVE_UCONTEXT_CONTEXTS AND SIMGRID_PROCESSOR_x86_64) # liveness model-checking works only on 64bits (for now ...)
     ADD_TESH(mc-bugged1-liveness-ucontext         --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/mc bugged1_liveness.tesh)
-    ADD_TESH(mc-bugged1-liveness-ucontext-sparse  --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/mc bugged1_liveness_sparse.tesh)
     ADD_TESH(mc-bugged1-liveness-visited-ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/mc bugged1_liveness_visited.tesh)
-    ADD_TESH(mc-bugged1-liveness-visited-ucontext-sparse --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/mc bugged1_liveness_visited_sparse.tesh)
     IF(HAVE_C_STACK_CLEANER)
       # This test checks if the stack cleaner is making a difference:
       ADD_TEST(mc-bugged1-liveness-stack-cleaner ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/mc/bugged1_liveness_stack_cleaner ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/mc/ ${CMAKE_BINARY_DIR}/examples/deprecated/msg/mc/)
@@ -43,8 +41,6 @@ set(tesh_files   ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/bugged1.tesh
                                   ${CMAKE_CURRENT_SOURCE_DIR}/bugged2.tesh
                                   ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness.tesh
                                   ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness_visited.tesh
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness_sparse.tesh
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness_visited_sparse.tesh
                                   ${CMAKE_CURRENT_SOURCE_DIR}/centralized_mutex.tesh                PARENT_SCOPE)
 set(xml_files    ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/deploy_bugged1_liveness_visited.xml
                                   ${CMAKE_CURRENT_SOURCE_DIR}/platform.xml                          PARENT_SCOPE)
index b4454fe..0390959 100644 (file)
@@ -15,7 +15,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example");
 
-static int server(int argc, char *argv[])
+static int server(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task = NULL;
   int count = 0;
@@ -36,6 +36,7 @@ static int server(int argc, char *argv[])
 
 static int client(int argc, char *argv[])
 {
+  xbt_assert(argc == 2);
   msg_task_t task =  MSG_task_create(argv[1], 0 /*comp cost */ , 10000 /*comm size */ , NULL /*arbitrary data */ );
 
   MSG_task_send(task, "mymailbox");
index 88d37e7..2aea478 100644 (file)
@@ -21,16 +21,17 @@ $ ${bindir:=.}/../../../../bin/simgrid-mc ${bindir:=.}/bugged1 "--log=root.fmt:[
 > [  0.000000] (0:maestro@) *** PROPERTY NOT VALID ***
 > [  0.000000] (0:maestro@) **************************
 > [  0.000000] (0:maestro@) Counter-example execution trace:
-> [  0.000000] (0:maestro@) [(1)HostA (server)] iRecv(dst=(1)HostA (server), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(2)HostB (client)] iSend(src=(2)HostB (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)HostA (server)] Wait(comm=(verbose only) [(2)HostB (client)-> (1)HostA (server)])
-> [  0.000000] (0:maestro@) [(1)HostA (server)] iRecv(dst=(1)HostA (server), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(2)HostB (client)] Wait(comm=(verbose only) [(2)HostB (client)-> (1)HostA (server)])
-> [  0.000000] (0:maestro@) [(4)HostD (client)] iSend(src=(4)HostD (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)HostA (server)] Wait(comm=(verbose only) [(4)HostD (client)-> (1)HostA (server)])
-> [  0.000000] (0:maestro@) [(1)HostA (server)] iRecv(dst=(1)HostA (server), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(3)HostC (client)] iSend(src=(3)HostC (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)HostA (server)] Wait(comm=(verbose only) [(3)HostC (client)-> (1)HostA (server)])
+> [  0.000000] (0:maestro@)   [(1)HostA (server)] iRecv(dst=(1)HostA (server), buff=(verbose only), size=(verbose only))
+> [  0.000000] (0:maestro@)   [(2)HostB (client)] iSend(src=(2)HostB (client), buff=(verbose only), size=(verbose only))
+> [  0.000000] (0:maestro@)   [(1)HostA (server)] Wait(comm=(verbose only) [(2)HostB (client)-> (1)HostA (server)])
+> [  0.000000] (0:maestro@)   [(1)HostA (server)] iRecv(dst=(1)HostA (server), buff=(verbose only), size=(verbose only))
+> [  0.000000] (0:maestro@)   [(2)HostB (client)] Wait(comm=(verbose only) [(2)HostB (client)-> (1)HostA (server)])
+> [  0.000000] (0:maestro@)   [(4)HostD (client)] iSend(src=(4)HostD (client), buff=(verbose only), size=(verbose only))
+> [  0.000000] (0:maestro@)   [(1)HostA (server)] Wait(comm=(verbose only) [(4)HostD (client)-> (1)HostA (server)])
+> [  0.000000] (0:maestro@)   [(1)HostA (server)] iRecv(dst=(1)HostA (server), buff=(verbose only), size=(verbose only))
+> [  0.000000] (0:maestro@)   [(3)HostC (client)] iSend(src=(3)HostC (client), buff=(verbose only), size=(verbose only))
+> [  0.000000] (0:maestro@)   [(1)HostA (server)] Wait(comm=(verbose only) [(3)HostC (client)-> (1)HostA (server)])
+> [  0.000000] (0:maestro@) Path = 1;2;1;1;2;4;1;1;3;1
 > [  0.000000] (0:maestro@) Expanded states = 22
 > [  0.000000] (0:maestro@) Visited states = 56
 > [  0.000000] (0:maestro@) Executed transitions = 52
index 95880eb..8fd8490 100644 (file)
@@ -34,7 +34,7 @@ static void garbage_stack(void) {
 }
 #endif
 
-static int coordinator(int argc, char *argv[])
+static int coordinator(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   int CS_used          = 0;
   msg_task_t task      = NULL;
@@ -84,6 +84,7 @@ static int coordinator(int argc, char *argv[])
 
 static int client(int argc, char *argv[])
 {
+  xbt_assert(argc == 2);
   int my_pid = MSG_process_get_PID(MSG_process_self());
 
   char *my_mailbox = xbt_strdup(argv[1]);
diff --git a/examples/deprecated/msg/mc/bugged1_liveness_sparse.tesh b/examples/deprecated/msg/mc/bugged1_liveness_sparse.tesh
deleted file mode 100644 (file)
index 7422ab8..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env tesh
-
-! 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
-> [  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
-> [  0.000000] (2:client@Boivin) Propositions changed : r=1, cs=0
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (3:client@Fafard) 2 got the answer. Sleep a bit and release it
-> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
-> [  0.000000] (3:client@Fafard) Ask the request
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (0:maestro@) Pair 22 already reached (equal to pair 10) !
-> [  0.000000] (0:maestro@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-> [  0.000000] (0:maestro@) |             ACCEPTANCE CYCLE            |
-> [  0.000000] (0:maestro@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-> [  0.000000] (0:maestro@) Counter-example that violates formula :
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] iRecv(dst=(2)Boivin (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(3)Fafard (client)] iSend(src=(3)Fafard (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] iSend(src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(3)Fafard (client)] Wait(comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(3)Fafard (client)] iRecv(dst=(3)Fafard (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (3)Fafard (client)])
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(3)Fafard (client)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (3)Fafard (client)])
-> [  0.000000] (0:maestro@) [(3)Fafard (client)] iSend(src=(3)Fafard (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(3)Fafard (client)] Wait(comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(3)Fafard (client)] iSend(src=(3)Fafard (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) Expanded pairs = 22
-> [  0.000000] (0:maestro@) Visited pairs = 20
-> [  0.000000] (0:maestro@) Executed transitions = 20
-> [  0.000000] (0:maestro@) Counter-example depth : 21
diff --git a/examples/deprecated/msg/mc/bugged1_liveness_visited_sparse.tesh b/examples/deprecated/msg/mc/bugged1_liveness_visited_sparse.tesh
deleted file mode 100644 (file)
index 47623e4..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/usr/bin/env tesh
-
-! 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
-> [  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
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
-> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
-> [  0.000000] (2:client@Boivin) Ask the request
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
-> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
-> [  0.000000] (2:client@Boivin) Ask the request
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
-> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
-> [  0.000000] (2:client@Boivin) Ask the request
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
-> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
-> [  0.000000] (2:client@Boivin) Ask the request
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (1:coordinator@Tremblay) CS already used. Queue the request.
-> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
-> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
-> [  0.000000] (2:client@Boivin) Ask the request
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
-> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
-> [  0.000000] (2:client@Boivin) Ask the request
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (1:coordinator@Tremblay) CS already used. Queue the request.
-> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
-> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
-> [  0.000000] (2:client@Boivin) Ask the request
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
-> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
-> [  0.000000] (2:client@Boivin) Ask the request
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (1:coordinator@Tremblay) CS already used. Queue the request.
-> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
-> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
-> [  0.000000] (2:client@Boivin) Ask the request
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
-> [  0.000000] (1:coordinator@Tremblay) CS release. resource now idle
-> [  0.000000] (2:client@Boivin) Ask the request
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (1:coordinator@Tremblay) CS already used. Queue the request.
-> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
-> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
-> [  0.000000] (2:client@Boivin) Ask the request
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
-> [  0.000000] (3:client@Fafard) Propositions changed : r=1, cs=0
-> [  0.000000] (1:coordinator@Tremblay) CS release. Grant to queued requests (queue size: 1)
-> [  0.000000] (2:client@Boivin) Ask the request
-> [  0.000000] (1:coordinator@Tremblay) CS idle. Grant immediatly
-> [  0.000000] (2:client@Boivin) 2 got the answer. Sleep a bit and release it
-> [  0.000000] (0:maestro@) Pair 58 already reached (equal to pair 46) !
-> [  0.000000] (0:maestro@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-> [  0.000000] (0:maestro@) |             ACCEPTANCE CYCLE            |
-> [  0.000000] (0:maestro@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-> [  0.000000] (0:maestro@) Counter-example that violates formula :
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] iSend(src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] iRecv(dst=(2)Boivin (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)])
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)])
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] iRecv(dst=(2)Boivin (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(3)Fafard (client)] iSend(src=(3)Fafard (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] iSend(src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)])
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)])
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] iSend(src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] iRecv(dst=(2)Boivin (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)])
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)])
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(3)Fafard (client)] Wait(comm=(verbose only) [(3)Fafard (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] iSend(src=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] Wait(comm=(verbose only) [(2)Boivin (client)-> (1)Tremblay (coordinator)])
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] iRecv(dst=(2)Boivin (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)])
-> [  0.000000] (0:maestro@) [(1)Tremblay (coordinator)] iRecv(dst=(1)Tremblay (coordinator), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] Wait(comm=(verbose only) [(1)Tremblay (coordinator)-> (2)Boivin (client)])
-> [  0.000000] (0:maestro@) [(2)Boivin (client)] iSend(src=(2)Boivin (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) Expanded pairs = 58
-> [  0.000000] (0:maestro@) Visited pairs = 202
-> [  0.000000] (0:maestro@) Executed transitions = 208
-> [  0.000000] (0:maestro@) Counter-example depth : 51
\ No newline at end of file
index c659568..aaf1dc1 100644 (file)
@@ -14,7 +14,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example");
 
-static int server(int argc, char *argv[])
+static int server(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task1 = NULL;
   msg_task_t task2 = NULL;
@@ -49,6 +49,7 @@ static int server(int argc, char *argv[])
 
 static int client(int argc, char *argv[])
 {
+  xbt_assert(argc == 2);
   msg_task_t task1 = MSG_task_create(argv[1], 0, 10000, NULL);
   msg_task_t task2 = MSG_task_create(argv[1], 0, 10000, NULL);
 
index 1633a7f..719ffe2 100644 (file)
@@ -2092,13 +2092,14 @@ $ ${bindir:=.}/../../../../bin/simgrid-mc ${bindir:=.}/bugged2 "--log=root.fmt:[
 > [  0.000000] (0:maestro@) *** PROPERTY NOT VALID ***
 > [  0.000000] (0:maestro@) **************************
 > [  0.000000] (0:maestro@) Counter-example execution trace:
-> [  0.000000] (0:maestro@) [(1)HostA (server)] iRecv(dst=(1)HostA (server), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(3)HostC (client)] iSend(src=(3)HostC (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)HostA (server)] Wait(comm=(verbose only) [(3)HostC (client)-> (1)HostA (server)])
-> [  0.000000] (0:maestro@) [(3)HostC (client)] Wait(comm=(verbose only) [(3)HostC (client)-> (1)HostA (server)])
-> [  0.000000] (0:maestro@) [(1)HostA (server)] iRecv(dst=(1)HostA (server), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(3)HostC (client)] iSend(src=(3)HostC (client), buff=(verbose only), size=(verbose only))
-> [  0.000000] (0:maestro@) [(1)HostA (server)] Wait(comm=(verbose only) [(3)HostC (client)-> (1)HostA (server)])
+> [  0.000000] (0:maestro@)   [(1)HostA (server)] iRecv(dst=(1)HostA (server), buff=(verbose only), size=(verbose only))
+> [  0.000000] (0:maestro@)   [(3)HostC (client)] iSend(src=(3)HostC (client), buff=(verbose only), size=(verbose only))
+> [  0.000000] (0:maestro@)   [(1)HostA (server)] Wait(comm=(verbose only) [(3)HostC (client)-> (1)HostA (server)])
+> [  0.000000] (0:maestro@)   [(3)HostC (client)] Wait(comm=(verbose only) [(3)HostC (client)-> (1)HostA (server)])
+> [  0.000000] (0:maestro@)   [(1)HostA (server)] iRecv(dst=(1)HostA (server), buff=(verbose only), size=(verbose only))
+> [  0.000000] (0:maestro@)   [(3)HostC (client)] iSend(src=(3)HostC (client), buff=(verbose only), size=(verbose only))
+> [  0.000000] (0:maestro@)   [(1)HostA (server)] Wait(comm=(verbose only) [(3)HostC (client)-> (1)HostA (server)])
+> [  0.000000] (0:maestro@) Path = 1;3;1;3;1;3;1
 > [  0.000000] (0:maestro@) Expanded states = 1006
 > [  0.000000] (0:maestro@) Visited states = 5319
 > [  0.000000] (0:maestro@) Executed transitions = 4969
\ No newline at end of file
index 19c5740..2b68854 100644 (file)
@@ -16,7 +16,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(bugged3, "my log messages");
 
 int cs = 0;
 
-static int coordinator(int argc, char *argv[])
+static int coordinator(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   int CS_used = 0;              // initially the CS is idle
 
@@ -49,6 +49,7 @@ static int coordinator(int argc, char *argv[])
 
 static int client(int argc, char *argv[])
 {
+  xbt_assert(argc == 2);
   int my_pid = MSG_process_get_PID(MSG_process_self());
   char *my_mailbox = xbt_strdup(argv[1]);
 
index 3546021..c223704 100644 (file)
@@ -17,8 +17,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(bugged3, "this example");
 
-
-static int server(int argc, char *argv[])
+static int server(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task1 = NULL;
   msg_task_t task2 = NULL;
@@ -39,6 +38,7 @@ static int server(int argc, char *argv[])
 
 static int client(int argc, char *argv[])
 {
+  xbt_assert(argc == 2);
   msg_task_t task1 = MSG_task_create(argv[1], 0, 10000, NULL);
 
   char *mbox = bprintf("mymailbox%s", argv[1]);
index 771cd46..bf21be1 100644 (file)
@@ -16,7 +16,7 @@
 #define CS_PER_PROCESS 2
 XBT_LOG_NEW_DEFAULT_CATEGORY(centralized, "my log messages");
 
-static int coordinator(int argc, char *argv[])
+static int coordinator(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   xbt_dynar_t requests = xbt_dynar_new(sizeof(char *), NULL);   // dynamic vector storing requests (which are char*)
   int CS_used = 0;              // initially the CS is idle
@@ -55,7 +55,7 @@ static int coordinator(int argc, char *argv[])
   return 0;
 }
 
-static int client(int argc, char *argv[])
+static int client(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   int my_pid = MSG_process_get_PID(MSG_process_self());
   // use my pid as name of mailbox to contact me
index 4527b0e..57c72f0 100644 (file)
@@ -17,8 +17,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(electric_fence, "Example to check the soundness of DPOR");
 
-
-static int server(int argc, char *argv[])
+static int server(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task1 = NULL;
   msg_task_t task2 = NULL;
@@ -35,6 +34,7 @@ static int server(int argc, char *argv[])
 
 static int client(int argc, char *argv[])
 {
+  xbt_assert(argc == 2);
   msg_task_t task = MSG_task_create(argv[1], 0, 10000, NULL);
 
   MSG_task_send(task, "mymailbox");
index 812d1b1..61400ac 100644 (file)
@@ -1,24 +1,24 @@
 #!/usr/bin/env tesh
 
-p In the NS3 tests, the timings are not shown because the exact values may vary with your NS3 version. 
-p We just want to check that the NS3 bindings of SimGrid are working correctly, we don't want to thoroughly test NS3.
+p In the ns-3 tests, the timings are not shown because the exact values may vary with your ns-3 version. 
+p We just want to check that the ns-3 bindings of SimGrid are working correctly, we don't want to thoroughly test ns-3.
 
 p 3hosts 2links
 
-$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/small_platform_one_link_routes.xml ${srcdir}/network-ns3/3hosts_2links_d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
-> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
+$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/small_platform_one_link_routes.xml ${srcdir}/network-ns3/3hosts_2links_d.xml --cfg=network/model:ns-3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
+> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'ns-3'
 > [Jupiter:worker(2)] [msg_test/INFO] FLOW[1] : Receive 100 bytes from Tremblay to Jupiter
 
 p 6hosts 3links
 
-$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/small_platform_one_link_routes.xml ${srcdir}/network-ns3/3links_d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
-> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
+$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/small_platform_one_link_routes.xml ${srcdir}/network-ns3/3links_d.xml --cfg=network/model:ns-3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
+> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'ns-3'
 > [Jupiter:worker(2)] [msg_test/INFO] FLOW[1] : Receive 10000 bytes from Tremblay to Jupiter
 > [Ginette:worker(4)] [msg_test/INFO] FLOW[2] : Receive 10000 bytes from Fafard to Ginette
 > [Lovelace:worker(6)] [msg_test/INFO] FLOW[3] : Receive 10000 bytes from Bourassa to Lovelace
 
-$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/small_platform_one_link_routes.xml ${srcdir}/network-ns3/3links-timer_d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
-> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
+$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/small_platform_one_link_routes.xml ${srcdir}/network-ns3/3links-timer_d.xml --cfg=network/model:ns-3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
+> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'ns-3'
 > [Jupiter:worker(2)] [msg_test/INFO] FLOW[1] : Receive 10000 bytes from Tremblay to Jupiter
 > [Ginette:worker(4)] [msg_test/INFO] FLOW[2] : Receive 10000 bytes from Fafard to Ginette
 > [Lovelace:worker(6)] [msg_test/INFO] FLOW[3] : Receive 10000 bytes from Bourassa to Lovelace
@@ -26,16 +26,16 @@ $ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/small_platform_one_link_route
 
 p One cluster
 
-$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/cluster_backbone.xml ${srcdir}/network-ns3/one_cluster_d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
-> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
+$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/cluster_backbone.xml ${srcdir}/network-ns3/one_cluster_d.xml --cfg=network/model:ns-3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
+> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'ns-3'
 > [node-6.simgrid.org:worker(2)] [msg_test/INFO] FLOW[1] : Receive 100 bytes from node-2.simgrid.org to node-6.simgrid.org
 
 p Dogbone
 
 ! timeout 10
-$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/dogbone.xml ${srcdir}/network-ns3/dogbone_d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
-> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
-> [:maestro(0)] [ns3/WARNING] Ignoring a route between S1 and C1 of length 3: Only routes of length 1 are considered with NS3.
+$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/dogbone.xml ${srcdir}/network-ns3/dogbone_d.xml --cfg=network/model:ns-3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
+> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'ns-3'
+> [:maestro(0)] [ns3/WARNING] Ignoring a route between S1 and C1 of length 3: Only routes of length 1 are considered with ns-3.
 > WARNING: You can ignore this warning if your hosts can still communicate when only considering routes of length 1.
 > WARNING: Remove long routes to avoid this harmless message; subsequent long routes will be silently ignored.
 > [C1:worker(3)] [msg_test/INFO] FLOW[0] : Receive 10000 bytes from S1 to C1
@@ -43,14 +43,14 @@ $ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/dogbone.xml ${srcdir}/network
 
 p 2hosts 1link
 
-$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/onelink.xml ${srcdir}/network-ns3/onelink_d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
-> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
+$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/onelink.xml ${srcdir}/network-ns3/onelink_d.xml --cfg=network/model:ns-3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
+> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'ns-3'
 > [C1:worker(2)] [msg_test/INFO] FLOW[1] : Receive 10000 bytes from S1 to C1
 
 p Crosstraffic TCP option DISABLED
 ! output ignore 
-$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/crosstraffic.xml ${srcdir}/network-ns3/crosstraffic_d.xml --cfg=network/model:NS3 --cfg=network/crosstraffic:0 
+$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/crosstraffic.xml ${srcdir}/network-ns3/crosstraffic_d.xml --cfg=network/model:ns-3 --cfg=network/crosstraffic:0 
 
 p Crosstraffic TCP option ENABLED
 ! output ignore
-$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/crosstraffic.xml ${srcdir}/network-ns3/crosstraffic_d.xml --cfg=network/model:NS3 --cfg=network/crosstraffic:1
+$ ${bindir:=.}/network-ns3/network-ns3 ${platfdir}/crosstraffic.xml ${srcdir}/network-ns3/crosstraffic_d.xml --cfg=network/model:ns-3 --cfg=network/crosstraffic:1
index f575ea8..c199e82 100644 (file)
@@ -11,8 +11,15 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example")
 
 #define FINALIZE ((void*)221297)        /* a magic number to tell people to stop working */
 
+static void task_cleanup_handler(void* task)
+{
+  if (task)
+    MSG_task_destroy(task);
+}
+
 static int master(int argc, char *argv[])
 {
+  xbt_assert(argc == 5);
   long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
   double task_comp_size = xbt_str_parse_double(argv[2], "Invalid computational size: %s");
   double task_comm_size = xbt_str_parse_double(argv[3], "Invalid communication size: %s");
@@ -31,13 +38,8 @@ static int master(int argc, char *argv[])
       XBT_INFO("Send to %s completed", mailbox);
       break;
 
-    case MSG_HOST_FAILURE:
-      XBT_INFO("Gloups. The cpu on which I'm running just turned off!. See you!");
-      MSG_task_destroy(task);
-      return 0;
-
     case MSG_TRANSFER_FAILURE:
-      XBT_INFO("Mmh. Something went wrong with '%s'. Nevermind. Let's keep going!", mailbox);
+      XBT_INFO("Mmh. The communication with '%s' failed. Nevermind. Let's keep going!", mailbox);
       MSG_task_destroy(task);
       break;
 
@@ -58,10 +60,6 @@ static int master(int argc, char *argv[])
     msg_task_t task = MSG_task_create("finalize", 0, 0, FINALIZE);
 
     switch (MSG_task_send_with_timeout(task,mailbox,1.0)) {
-    case MSG_HOST_FAILURE:
-      XBT_INFO("Gloups. The cpu on which I'm running just turned off!. See you!");
-      MSG_task_destroy(task);
-      break;
 
     case MSG_TRANSFER_FAILURE:
       XBT_INFO("Mmh. Can't reach '%s'! Nevermind. Let's keep going!", mailbox);
@@ -88,6 +86,7 @@ static int master(int argc, char *argv[])
 
 static int worker(int argc, char *argv[])
 {
+  xbt_assert(argc == 2);
   char mailbox[80];
 
   long id= xbt_str_parse_int(argv[1], "Invalid argument %s");
@@ -104,21 +103,16 @@ static int worker(int argc, char *argv[])
         break;
       }
       XBT_INFO("Start execution...");
+      MSG_process_set_data(MSG_process_self(), task);
       retcode = MSG_task_execute(task);
+      MSG_process_set_data(MSG_process_self(), NULL);
       if (retcode == MSG_OK) {
         XBT_INFO("Execution complete.");
         MSG_task_destroy(task);
-      } else if (retcode == MSG_HOST_FAILURE) {
-        XBT_INFO("Gloups. The cpu on which I'm running just turned off!. See you!");
-        MSG_task_destroy(task);
-        return 0;
       } else {
         XBT_INFO("Hey ?! What's up ? ");
         xbt_die("Unexpected behavior");
       }
-    } else if (retcode == MSG_HOST_FAILURE) {
-      XBT_INFO("Gloups. The cpu on which I'm running just turned off!. See you!");
-      return 0;
     } else if (retcode == MSG_TRANSFER_FAILURE) {
       XBT_INFO("Mmh. Something went wrong. Nevermind. Let's keep going!");
     } else {
@@ -139,6 +133,7 @@ int main(int argc, char *argv[])
 
   MSG_function_register("master", master);
   MSG_function_register("worker", worker);
+  MSG_process_set_data_cleanup(task_cleanup_handler);
   MSG_launch_application(argv[2]);
 
   msg_error_t res = MSG_main();
index b903537..79947c5 100644 (file)
@@ -3,7 +3,7 @@
 p Testing a simple master/worker example application handling failures TCP crosstraffic DISABLED
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml --cfg=path:${srcdir} --cfg=network/crosstraffic:0 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=surf_cpu.t:verbose
+$ ${bindir:=.}/platform-failures --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml --cfg=path:${srcdir} --cfg=network/crosstraffic:0 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=surf_cpu.t:verbose
 > [  0.000000] (0:maestro@) Cannot launch actor 'worker' on failed host 'Fafard'
 > [  0.000000] (0:maestro@) Deployment includes some initially turned off Hosts ... nevermind.
 > [  0.000000] (1:master@Tremblay) Got 5 workers and 20 tasks to process
@@ -17,9 +17,9 @@ $ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:criti
 > [  0.010309] (1:master@Tremblay) Send a message to worker-1
 > [  1.000000] (0:maestro@) Restart processes on host Fafard
 > [  1.000000] (7:worker@Fafard) Waiting a message on worker-2
-> [  1.000000] (1:master@Tremblay) Mmh. Something went wrong with 'worker-1'. Nevermind. Let's keep going!
+> [  1.000000] (1:master@Tremblay) Mmh. The communication with 'worker-1' failed. Nevermind. Let's keep going!
 > [  1.000000] (1:master@Tremblay) Send a message to worker-2
-> [  2.000000] (1:master@Tremblay) Mmh. Something went wrong with 'worker-2'. Nevermind. Let's keep going!
+> [  2.000000] (1:master@Tremblay) Mmh. The communication with 'worker-2' failed. Nevermind. Let's keep going!
 > [  2.000000] (0:maestro@) Restart processes on host Jupiter
 > [  2.000000] (1:master@Tremblay) Send a message to worker-3
 > [  2.000000] (8:worker@Jupiter) Waiting a message on worker-1
@@ -47,7 +47,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:criti
 > [  7.103093] (8:worker@Jupiter) Waiting a message on worker-1
 > [ 15.103093] (1:master@Tremblay) Mmh. Got timeouted while speaking to 'worker-2'. Nevermind. Let's keep going!
 > [ 15.103093] (1:master@Tremblay) Send a message to worker-3
-> [ 15.103093] (1:master@Tremblay) Mmh. Something went wrong with 'worker-3'. Nevermind. Let's keep going!
+> [ 15.103093] (1:master@Tremblay) Mmh. The communication with 'worker-3' failed. Nevermind. Let's keep going!
 > [ 15.103093] (1:master@Tremblay) Send a message to worker-4
 > [ 15.103093] (5:worker@Ginette) Mmh. Something went wrong. Nevermind. Let's keep going!
 > [ 15.103093] (5:worker@Ginette) Waiting a message on worker-3
@@ -70,7 +70,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:criti
 > [ 27.175258] (1:master@Tremblay) Send a message to worker-3
 > [ 28.206186] (1:master@Tremblay) Send to worker-3 completed
 > [ 28.206186] (1:master@Tremblay) Send a message to worker-4
-> [ 28.206186] (1:master@Tremblay) Mmh. Something went wrong with 'worker-4'. Nevermind. Let's keep going!
+> [ 28.206186] (1:master@Tremblay) Mmh. The communication with 'worker-4' failed. Nevermind. Let's keep going!
 > [ 28.206186] (1:master@Tremblay) Send a message to worker-0
 > [ 28.206186] (5:worker@Ginette) Start execution...
 > [ 28.206186] (6:worker@Bourassa) Mmh. Something went wrong. Nevermind. Let's keep going!
@@ -108,7 +108,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:criti
 p Testing a simple master/worker example application handling failures. TCP crosstraffic ENABLED
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml --cfg=path:${srcdir} "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=surf_cpu.t:verbose
+$ ${bindir:=.}/platform-failures --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml --cfg=path:${srcdir} "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=surf_cpu.t:verbose
 > [  0.000000] (0:maestro@) Cannot launch actor 'worker' on failed host 'Fafard'
 > [  0.000000] (0:maestro@) Deployment includes some initially turned off Hosts ... nevermind.
 > [  0.000000] (1:master@Tremblay) Got 5 workers and 20 tasks to process
@@ -122,11 +122,11 @@ $ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:criti
 > [  0.010825] (1:master@Tremblay) Send a message to worker-1
 > [  1.000000] (0:maestro@) Restart processes on host Fafard
 > [  1.000000] (7:worker@Fafard) Waiting a message on worker-2
-> [  1.000000] (1:master@Tremblay) Mmh. Something went wrong with 'worker-1'. Nevermind. Let's keep going!
+> [  1.000000] (1:master@Tremblay) Mmh. The communication with 'worker-1' failed. Nevermind. Let's keep going!
 > [  1.000000] (1:master@Tremblay) Send a message to worker-2
 > [  2.000000] (0:maestro@) Restart processes on host Jupiter
 > [  2.000000] (8:worker@Jupiter) Waiting a message on worker-1
-> [  2.000000] (1:master@Tremblay) Mmh. Something went wrong with 'worker-2'. Nevermind. Let's keep going!
+> [  2.000000] (1:master@Tremblay) Mmh. The communication with 'worker-2' failed. Nevermind. Let's keep going!
 > [  2.000000] (1:master@Tremblay) Send a message to worker-3
 > [  2.010825] (2:worker@Tremblay) Execution complete.
 > [  2.010825] (2:worker@Tremblay) Waiting a message on worker-0
@@ -154,7 +154,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:criti
 > [ 15.258247] (1:master@Tremblay) Send a message to worker-3
 > [ 15.258247] (5:worker@Ginette) Mmh. Something went wrong. Nevermind. Let's keep going!
 > [ 15.258247] (5:worker@Ginette) Waiting a message on worker-3
-> [ 15.258247] (1:master@Tremblay) Mmh. Something went wrong with 'worker-3'. Nevermind. Let's keep going!
+> [ 15.258247] (1:master@Tremblay) Mmh. The communication with 'worker-3' failed. Nevermind. Let's keep going!
 > [ 15.258247] (1:master@Tremblay) Send a message to worker-4
 > [ 16.340722] (6:worker@Bourassa) Start execution...
 > [ 16.340722] (1:master@Tremblay) Send to worker-4 completed
@@ -178,7 +178,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:criti
 > [ 28.516495] (1:master@Tremblay) Send a message to worker-4
 > [ 28.516495] (6:worker@Bourassa) Mmh. Something went wrong. Nevermind. Let's keep going!
 > [ 28.516495] (6:worker@Bourassa) Waiting a message on worker-4
-> [ 28.516495] (1:master@Tremblay) Mmh. Something went wrong with 'worker-4'. Nevermind. Let's keep going!
+> [ 28.516495] (1:master@Tremblay) Mmh. The communication with 'worker-4' failed. Nevermind. Let's keep going!
 > [ 28.516495] (1:master@Tremblay) Send a message to worker-0
 > [ 28.527320] (2:worker@Tremblay) Start execution...
 > [ 28.527320] (1:master@Tremblay) Send to worker-0 completed
@@ -217,4 +217,4 @@ p   complex with such an integration test. One day, we will setup a set of
 p   unit tests for the surf solver, and such issues will be addressable again.
 p For the time being, I just give up, sorry.
 
-p $ $SG_TEST_EXENV ${bindir:=.}/platform-failures$EXEEXT --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml --cfg=path:${srcdir} --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=surf_cpu.t:verbose
+p $ ${bindir:=.}/platform-failures --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml --cfg=path:${srcdir} --cfg=cpu/optim:TI "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=surf_cpu.t:verbose
index 97b3676..8e4e386 100644 (file)
@@ -6,7 +6,7 @@
 #include "simgrid/msg.h"
 
 /* Main function of the process I want to start manually */
-static int process_function(int argc, char *argv[])
+static int process_function(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task = MSG_task_create("task", 100, 0, NULL);
   MSG_task_execute (task);
index 01f5c97..fbcf897 100644 (file)
@@ -1,4 +1,4 @@
 #!/usr/bin/env tesh
 
 p Start remote processes 
-$ $SG_TEST_EXENV ${bindir:=.}/process-create$EXEEXT ${platfdir}/small_platform.xml
+$ ${bindir:=.}/process-create ${platfdir}/small_platform.xml
index 5a55609..75a9068 100644 (file)
@@ -3,7 +3,7 @@
 p Testing synchronization with semaphores
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/synchro-semaphore ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/synchro-semaphore ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:Alice@Fafard) Trying to acquire 1
 > [  0.000000] (1:Alice@Fafard) Acquired 1
 > [  0.900000] (2:Bob@Fafard) Trying to acquire 1
index a7e2513..f4f7421 100644 (file)
@@ -7,6 +7,7 @@
 
 static int master(int argc, char *argv[])
 {
+  xbt_assert(argc == 5);
   long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
   long workers_count = xbt_str_parse_int(argv[4], "Invalid amount of workers: %s");
 
@@ -36,7 +37,7 @@ static int master(int argc, char *argv[])
   return 0;
 }
 
-static int worker(int argc, char *argv[])
+static int worker(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task = NULL;
 
index 418f449..b0687c9 100644 (file)
@@ -2,7 +2,7 @@
 
 p Tracing multiple categories master/worker application
 
-$ $SG_TEST_EXENV ${bindir:=.}/trace-categories$EXEEXT --cfg=tracing:yes --cfg=tracing/filename:categories.trace --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes ${platfdir}/small_platform.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml
+$ ${bindir:=.}/trace-categories --cfg=tracing:yes --cfg=tracing/filename:categories.trace --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes ${platfdir}/small_platform.xml ${srcdir}/../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/filename' to 'categories.trace'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/categorized' to 'yes'
index 2f01fa0..ae8a333 100644 (file)
@@ -8,7 +8,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
-static int trace_fun(int argc, char *argv[])
+static int trace_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   const char *hostname = MSG_host_get_name(MSG_host_self());
 
index 562364f..6124de2 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env tesh
 
 p Tracing user variables for hosts
-$ $SG_TEST_EXENV ${bindir:=.}/trace-host-user-variables$EXEEXT --cfg=tracing:yes --cfg=tracing/platform:yes ${platfdir}/small_platform.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml
+$ ${bindir:=.}/trace-host-user-variables --cfg=tracing:yes --cfg=tracing/platform:yes ${platfdir}/small_platform.xml ${srcdir}/../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/platform' to 'yes'
 > [0.004078] [msg_test/INFO] Declared host variables:
@@ -19,4 +19,4 @@ $ $SG_TEST_EXENV ${bindir:=.}/trace-host-user-variables$EXEEXT --cfg=tracing:yes
 $ rm -f simgrid.trace
 
 p Not tracing user variables
-$ $SG_TEST_EXENV ${bindir:=.}/trace-host-user-variables$EXEEXT ${platfdir}/small_platform.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml
+$ ${bindir:=.}/trace-host-user-variables ${platfdir}/small_platform.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml
index 08dc58b..3c90c28 100644 (file)
@@ -13,7 +13,7 @@ static void create_and_execute_task (void)
   MSG_task_destroy (task);
 }
 
-static int trace_fun(int argc, char *argv[])
+static int trace_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   //set initial values for the link user variables this example only shows for links identified by "6" and "3" in the
   //platform file
index f143566..c79c433 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env tesh
 
 p Trace user variables associated to links of the platform file
-$ $SG_TEST_EXENV ${bindir:=.}/trace-link-user-variables$EXEEXT --cfg=tracing:yes --cfg=tracing/platform:yes ${platfdir}/small_platform.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml
+$ ${bindir:=.}/trace-link-user-variables --cfg=tracing:yes --cfg=tracing/platform:yes ${platfdir}/small_platform.xml ${srcdir}/../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/platform' to 'yes'
 
index af7a222..906fd19 100644 (file)
@@ -9,6 +9,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_trace_masterworker, "Messages specific for this
 
 static int master(int argc, char *argv[])
 {
+  xbt_assert(argc == 5);
   long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
   double task_comp_size = xbt_str_parse_double(argv[2], "Invalid computational size: %s");
   double task_comm_size = xbt_str_parse_double(argv[3], "Invalid communication size: %s");
@@ -40,7 +41,7 @@ static int master(int argc, char *argv[])
   return 0;
 }
 
-static int worker(int argc, char *argv[])
+static int worker(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task = NULL;
 
index 89e41f0..b46083d 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env tesh
 
 p Tracing master/worker application
-$ $SG_TEST_EXENV ${bindir:=.}/trace-masterworker$EXEEXT --cfg=tracing:yes --cfg=tracing/filename:trace-masterworker.trace --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes ${platfdir}/small_platform.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml
+$ ${bindir:=.}/trace-masterworker --cfg=tracing:yes --cfg=tracing/filename:trace-masterworker.trace --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes ${platfdir}/small_platform.xml ${srcdir}/../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/filename' to 'trace-masterworker.trace'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/categorized' to 'yes'
@@ -15,7 +15,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/trace-masterworker$EXEEXT --cfg=tracing:yes --cfg=
 > [4.214821] [msg_trace_masterworker/INFO] msmark
 
 p Tracing master/worker application with xml config
-$ $SG_TEST_EXENV ${bindir:=.}/trace-masterworker$EXEEXT ${platfdir}/config_tracing.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml
+$ ${bindir:=.}/trace-masterworker ${platfdir}/config_tracing.xml ${srcdir}/../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/categorized' to 'yes'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'trace-masterworker.trace'
@@ -29,10 +29,10 @@ $ $SG_TEST_EXENV ${bindir:=.}/trace-masterworker$EXEEXT ${platfdir}/config_traci
 > [4.214821] [msg_trace_masterworker/INFO] msmark
 
 p Not tracing master/worker application
-$ $SG_TEST_EXENV ${bindir:=.}/trace-masterworker$EXEEXT ${platfdir}/small_platform.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml
+$ ${bindir:=.}/trace-masterworker ${platfdir}/small_platform.xml ${srcdir}/../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/filename:trace-masterworker.trace --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes ${platfdir}/small_platform.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml
+$ ${bindir:=.}/trace-masterworker --cfg=tracing:yes --cfg=tracing/msg/process:yes --cfg=tracing/filename:trace-masterworker.trace --cfg=tracing/categorized:yes --cfg=tracing/uncategorized:yes ${platfdir}/small_platform.xml ${srcdir}/../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/filename' to 'trace-masterworker.trace'
index 2a7b21b..065ba52 100644 (file)
@@ -6,7 +6,7 @@
 #include "simgrid/msg.h"
 
 /* The guy we will move from host to host. It move alone and then is moved by policeman back  */
-static int emigrant(int argc, char *argv[])
+static int emigrant(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task = NULL;
   char *destination = NULL;
@@ -27,7 +27,7 @@ static int emigrant(int argc, char *argv[])
   return 0;
 }
 
-static int policeman(int argc, char *argv[])
+static int policeman(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   // I am the master of emigrant process,
   // I tell it where it must emigrate to.
index 0c3ab46..319a3e6 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env tesh
 
 p Tracing processes
-$ $SG_TEST_EXENV ${bindir:=.}/trace-process-migration$EXEEXT --cfg=tracing:yes --cfg=tracing/filename:procmig.trace --cfg=tracing/msg/process:yes ${platfdir}/small_platform.xml
+$ ${bindir:=.}/trace-process-migration --cfg=tracing:yes --cfg=tracing/filename:procmig.trace --cfg=tracing/msg/process:yes ${platfdir}/small_platform.xml
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'procmig.trace'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/msg/process' to 'yes'
index 6e4c729..b3722e0 100644 (file)
@@ -13,7 +13,7 @@ static void create_and_execute_task (void)
   MSG_task_destroy (task);
 }
 
-static int trace_fun(int argc, char *argv[])
+static int trace_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   //Set initial values for the link user variables
   //This example uses source and destination where source and destination are the name of hosts inthe platform file.
index d372bca..54a1ed3 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env tesh
 
 p Trace user variables associated to links of the platform file
-$ $SG_TEST_EXENV ${bindir:=.}/trace-route-user-variables$EXEEXT --cfg=tracing:yes --cfg=tracing/platform:yes ${platfdir}/small_platform.xml ${srcdir}/../app-masterworker/app-masterworker_d.xml
+$ ${bindir:=.}/trace-route-user-variables --cfg=tracing:yes --cfg=tracing/platform:yes ${platfdir}/small_platform.xml ${srcdir}/../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/platform' to 'yes'
 
index 929c084..bf07071 100644 (file)
@@ -4,7 +4,7 @@ p Test the loader of DAG written in the DOT format
 # The order differ when executed with gcc's thread sanitizer
 ! output sort
 
-$ $SG_TEST_EXENV ${bindir:=.}/dag-dotload/sd_dag-dotload --log=no_loc ${srcdir:=.}/../../platforms/cluster_backbone.xml ${srcdir:=.}/dag-dotload/dag.dot
+$ ${bindir:=.}/dag-dotload/sd_dag-dotload --log=no_loc ${srcdir:=.}/../../platforms/cluster_backbone.xml ${srcdir:=.}/dag-dotload/dag.dot
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [0.000000] [test/INFO] ------------------- Display all tasks of the loaded DAG ---------------------------
 > [0.000000] [sd_task/INFO] Displaying task root
@@ -217,7 +217,7 @@ $ cat ${srcdir:=.}/dag-dotload/dag.trace
 $ rm -f ${srcdir:=.}/dag-dotload/dag.trace ${srcdir:=.}/dot.dot
 
 ! expect return 2
-$ $SG_TEST_EXENV ${bindir:=.}/dag-dotload/sd_dag-dotload --log=no_loc ${srcdir:=.}/../../platforms/cluster_backbone.xml ${srcdir:=.}/dag-dotload/dag_with_cycle.dot
+$ ${bindir:=.}/dag-dotload/sd_dag-dotload --log=no_loc ${srcdir:=.}/../../platforms/cluster_backbone.xml ${srcdir:=.}/dag-dotload/dag_with_cycle.dot
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [0.000000] [sd_daxparse/WARNING] the task root is not marked
 > [0.000000] [sd_daxparse/WARNING] the task 1 is in a cycle
index 6294772..44fe501 100644 (file)
@@ -2,7 +2,7 @@
 p Test the DAX loader on a small DAX instance
 
 ! output sort
-$ $SG_TEST_EXENV ${bindir:=.}/daxload/sd_daxload --log=no_loc ${srcdir:=.}/../../platforms/cluster_backbone.xml ${srcdir:=.}/daxload/smalldax.xml
+$ ${bindir:=.}/daxload/sd_daxload --log=no_loc ${srcdir:=.}/../../platforms/cluster_backbone.xml ${srcdir:=.}/daxload/smalldax.xml
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [0.000000] [sd_daxparse/WARNING] Ignore file o1 size redefinition from 1000000 to 304
 > [0.000000] [sd_daxparse/WARNING] Ignore file o2 size redefinition from 1000000 to 304
@@ -127,7 +127,7 @@ $ cmake -E remove -f ${srcdir:=.}/dax.dot ${srcdir:=.}/daxload/smalldax.trace
 p Test the DAX loader with a DAX comprising a cycle.
 
 ! expect return 255
-$ $SG_TEST_EXENV ${bindir:=.}/daxload/sd_daxload --log=no_loc ${srcdir:=.}/../../platforms/cluster_backbone.xml ${srcdir:=.}/daxload/simple_dax_with_cycle.xml
+$ ${bindir:=.}/daxload/sd_daxload --log=no_loc ${srcdir:=.}/../../platforms/cluster_backbone.xml ${srcdir:=.}/daxload/simple_dax_with_cycle.xml
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [0.000000] [sd_daxparse/WARNING] the task root is not marked
 > [0.000000] [sd_daxparse/WARNING] the task 1@task1 is in a cycle
index 4586cf8..965cace 100644 (file)
@@ -2,7 +2,7 @@
 
 p Test of the management of failed tasks simdag
 
-$ $SG_TEST_EXENV ${bindir:=.}/fail/sd_fail ${srcdir:=.}/../../platforms/faulty_host.xml
+$ ${bindir:=.}/fail/sd_fail ${srcdir:=.}/../../platforms/faulty_host.xml
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [0.000000] [sd_fail/INFO] First test: COMP_SEQ task
 > [0.000000] [sd_fail/INFO] Schedule task 'Poor task' on 'Faulty Host'
index 80abf86..cf3d6a4 100644 (file)
@@ -2,7 +2,7 @@
 
 p Simple test of simdag with properties
 
-$ $SG_TEST_EXENV properties/sd_properties ${srcdir:=.}/../../platforms/prop.xml
+$ properties/sd_properties ${srcdir:=.}/../../platforms/prop.xml
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [0.000000] [test/INFO] Property list for host host1
 > [0.000000] [test/INFO]       Property: mem has value: 4
index 8861c46..b11294f 100644 (file)
@@ -4,7 +4,7 @@ p Test the loader of PTG (Parallel Task Graph) written in the DOT format
 # The order differ when executed with gcc's thread sanitizer
 ! output sort
 
-$ $SG_TEST_EXENV ${bindir:=.}/ptg-dotload/sd_ptg-dotload  ${srcdir:=.}/../../platforms/cluster_backbone.xml ${srcdir:=.}/ptg-dotload/ptg.dot
+$ ${bindir:=.}/ptg-dotload/sd_ptg-dotload  ${srcdir:=.}/../../platforms/cluster_backbone.xml ${srcdir:=.}/ptg-dotload/ptg.dot
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [0.000000] [test/INFO] ------------------- Display all tasks of the loaded DAG ---------------------------
 > [0.000000] [sd_task/INFO] Displaying task root
index b679780..b89f946 100644 (file)
@@ -2,7 +2,7 @@
 p Test the loader of DAG written in the DOT format
 
 ! expect return 2
-$ $SG_TEST_EXENV ${bindir:=.}/schedule-dotload/sd_schedule-dotload --log=no_loc  "--log=sd_dotparse.thres:verbose" ${srcdir:=.}/../../platforms/cluster_backbone.xml ${srcdir:=.}/schedule-dotload/dag_with_bad_schedule.dot
+$ ${bindir:=.}/schedule-dotload/sd_schedule-dotload --log=no_loc  "--log=sd_dotparse.thres:verbose" ${srcdir:=.}/../../platforms/cluster_backbone.xml ${srcdir:=.}/schedule-dotload/dag_with_bad_schedule.dot
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [0.000000] [sd_dotparse/VERBOSE] The schedule is ignored, task 'end' can not be scheduled on -1 hosts
 > [0.000000] [sd_dotparse/VERBOSE] The schedule is ignored, task '1' can not be scheduled on 0 hosts
@@ -15,7 +15,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/schedule-dotload/sd_schedule-dotload --log=no_loc
 # The order differ when executed with gcc's thread sanitizer
 ! output sort
 
-$ $SG_TEST_EXENV ${bindir:=.}/schedule-dotload/sd_schedule-dotload --log=no_loc ${srcdir:=.}/../../platforms/cluster_backbone.xml ${srcdir:=.}/schedule-dotload/dag_with_good_schedule.dot
+$ ${bindir:=.}/schedule-dotload/sd_schedule-dotload --log=no_loc ${srcdir:=.}/../../platforms/cluster_backbone.xml ${srcdir:=.}/schedule-dotload/dag_with_good_schedule.dot
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [0.000000] [test/INFO] ------------------- Display all tasks of the loaded DAG ---------------------------
 > [0.000000] [sd_task/INFO] Displaying task root
index fb39c8a..17972b6 100644 (file)
@@ -24,26 +24,26 @@ struct _HostAttribute {
 
 static double sg_host_get_available_at(sg_host_t host)
 {
-  HostAttribute attr = (HostAttribute) sg_host_user(host);
+  HostAttribute attr = (HostAttribute)sg_host_data(host);
   return attr->available_at;
 }
 
 static void sg_host_set_available_at(sg_host_t host, double time)
 {
-  HostAttribute attr = (HostAttribute) sg_host_user(host);
+  HostAttribute attr = (HostAttribute)sg_host_data(host);
   attr->available_at = time;
-  sg_host_user_set(host, attr);
+  sg_host_data_set(host, attr);
 }
 
 static SD_task_t sg_host_get_last_scheduled_task( sg_host_t host){
-  HostAttribute attr = (HostAttribute) sg_host_user(host);
+  HostAttribute attr = (HostAttribute)sg_host_data(host);
   return attr->last_scheduled_task;
 }
 
 static void sg_host_set_last_scheduled_task(sg_host_t host, SD_task_t task){
-  HostAttribute attr = (HostAttribute) sg_host_user(host);
+  HostAttribute attr       = (HostAttribute)sg_host_data(host);
   attr->last_scheduled_task=task;
-  sg_host_user_set(host, attr);
+  sg_host_data_set(host, attr);
 }
 
 static xbt_dynar_t get_ready_tasks(xbt_dynar_t dax)
@@ -155,11 +155,11 @@ int main(int argc, char **argv)
   SD_create_environment(argv[1]);
 
   /*  Allocating the host attribute */
-  int total_nhosts = sg_host_count();
+  unsigned int total_nhosts = sg_host_count();
   sg_host_t *hosts = sg_host_list();
 
   for (cursor = 0; cursor < total_nhosts; cursor++)
-    sg_host_user_set(hosts[cursor], xbt_new0(struct _HostAttribute, 1));
+    sg_host_data_set(hosts[cursor], xbt_new0(struct _HostAttribute, 1));
 
   /* load the DAX file */
   xbt_dynar_t dax = SD_daxload(argv[2]);
@@ -246,8 +246,8 @@ int main(int argc, char **argv)
   xbt_dynar_free_container(&dax);
 
   for (cursor = 0; cursor < total_nhosts; cursor++) {
-    free(sg_host_user(hosts[cursor]));
-    sg_host_user_set(hosts[cursor], NULL);
+    free(sg_host_data(hosts[cursor]));
+    sg_host_data_set(hosts[cursor], NULL);
   }
 
   xbt_free(hosts);
index 82069b3..54c637c 100644 (file)
@@ -2,7 +2,7 @@
 
 p Simple test of simdag
 
-$ $SG_TEST_EXENV ${bindir:=.}/scheduling/sd_scheduling --log=sd_daxparse.thresh:critical ${srcdir:=.}/../../platforms/simulacrum_7_hosts.xml ${srcdir:=.}/scheduling/Montage_25.xml
+$ ${bindir:=.}/scheduling/sd_scheduling --log=sd_daxparse.thresh:critical ${srcdir:=.}/../../platforms/simulacrum_7_hosts.xml ${srcdir:=.}/scheduling/Montage_25.xml
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [0.000000] [test/INFO] Schedule ID00002@mProjectPP on Host 27
 > [0.000105] [test/INFO] Schedule ID00000@mProjectPP on Host 26
index 2112647..59fead5 100644 (file)
@@ -69,33 +69,29 @@ int main(int argc, char **argv)
   try {
     SD_task_dependency_add(taskA, taskA); /* shouldn't work and must raise an exception */
     xbt_die("Hey, I can add a dependency between Task A and Task A!");
-  } catch (xbt_ex& ex) {
-    if (ex.category != arg_error)
-      throw;                  /* this is a serious error */
+  } catch (const std::invalid_argument& e) {
+    XBT_DEBUG("Caught invalid_argument: %s", e.what());
   }
 
   try {
     SD_task_dependency_add(taskB, taskA); /* shouldn't work and must raise an exception */
     xbt_die("Oh oh, I can add an already existing dependency!");
-  } catch (xbt_ex& ex) {
-    if (ex.category != arg_error)
-      throw;
+  } catch (const std::invalid_argument& e) {
+    XBT_DEBUG("Caught invalid_argument: %s", e.what());
   }
 
   try {
     SD_task_dependency_remove(taskA, taskC);    /* shouldn't work and must raise an exception */
     xbt_die("Dude, I can remove an unknown dependency!");
-  } catch (xbt_ex& ex) {
-    if (ex.category != arg_error)
-      throw;
+  } catch (const std::invalid_argument& e) {
+    XBT_DEBUG("Caught invalid_argument: %s", e.what());
   }
 
   try {
     SD_task_dependency_remove(taskC, taskC);    /* shouldn't work and must raise an exception */
     xbt_die("Wow, I can remove a dependency between Task C and itself!");
-  } catch (xbt_ex& ex) {
-    if (ex.category != arg_error)
-      throw;
+  } catch (const std::invalid_argument& e) {
+    XBT_DEBUG("Caught invalid_argument: %s", e.what());
   }
 
   /* if everything is ok, no exception is forwarded or rethrown by main() */
index 7f03ba0..13cd10f 100644 (file)
@@ -3,7 +3,7 @@
 p Simple test of simdag
 
 ! output sort
-$ $SG_TEST_EXENV ./test/sd_test ${srcdir:=.}/../../platforms/small_platform.xml
+$ ./test/sd_test ${srcdir:=.}/../../platforms/small_platform.xml
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [0.000000] [sd_test/INFO] Computation time for 2000000.000000 flops on Jacquelin: 0.014563
 > [0.000000] [sd_test/INFO] Computation time for 1000000.000000 flops on Fafard: 0.013107
index e52369a..a389778 100644 (file)
@@ -4,7 +4,7 @@ p Modify the rate of communication tasks even when they are auto-scheduled
 # We need to sort this out because the order changes with the sanitizers (at least)
 ! output sort
 
-$ $SG_TEST_EXENV ./throttling/sd_throttling ${srcdir:=.}/../../platforms/cluster_backbone.xml
+$ ./throttling/sd_throttling ${srcdir:=.}/../../platforms/cluster_backbone.xml
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [5.000000] [sd_comm_throttling/INFO] Simulation stopped after 5.0000 seconds
 > [5.000000] [sd_comm_throttling/INFO] Task 'Task A' start time: 0.000000, finish time: 5.000000
index 3d2c6e1..f719abf 100644 (file)
@@ -2,7 +2,7 @@
 p Usage test of simdag's typed tasks
 
 ! output sort
-$ $SG_TEST_EXENV ./typed_tasks/sd_typed_tasks ${srcdir:=.}/../../platforms/cluster_backbone.xml
+$ ./typed_tasks/sd_typed_tasks ${srcdir:=.}/../../platforms/cluster_backbone.xml
 > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
 > [2.080600] [sd_typed_tasks_test/INFO] Task 'Par. Comp. 3' start time: 0.000000, finish time: 0.400000
 > [2.080600] [sd_typed_tasks_test/INFO] Task 'Par. Comp. 1' start time: 0.000000, finish time: 0.400000
index 110efda..efaf30b 100644 (file)
@@ -1,13 +1,13 @@
-<?xml version='1.0'?>
+<?xml version='1.0' encoding='utf-8'?>
 <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
 <platform version="4.1">
   <zone id="world" routing="Full">
   <!-- this platform models 3 clusters, interconnected over the Internet
-    --
-    -- This example intends to be somewhat exhaustive, your platform should probably be simpler.
-    --
-    -- In particular, the clusters are modeled in very different ways,
-    -- but you should pick the way you prefer, and stick to it.
+    -
+    -  This example intends to be somewhat exhaustive, your platform should probably be simpler.
+    - 
+    -  In particular, the clusters are modeled in very different ways,
+    -  but you should pick the way you prefer, and stick to it.
     -->
 
   <!-- Here comes the first cluster, the simplest one.
        Every nodes are connected through a private link to a router
        (ie a machine that cannot host computations).
   
-       node-0.1core.org --[l0]--
+       node-0.1core.org __[l0]__
                                 \
-       node-1.1core.org --[l1]-- router -- (outer world)
+       node-1.1core.org __[l1]__router___(outer world)
                 ...             /
-       node-7.1core.org --[l9]--
+       node-7.1core.org __[l9]_/
  
        So the route from node-0 to node-1 is {l0.UP, l1.DOWN}
     -->
-  <cluster id="simple" prefix="node-" radical="0-7" suffix=".1core.org" speed="1Gf" bw="125MBps" lat="50us">
-    <prop id="watt_per_state" value="0.0:1.0" />
-    <prop id="watt_off" value="0.0" />
+  <cluster bw="125MBps" id="simple" lat="50us" prefix="node-" radical="0-7" speed="1Gf" suffix=".1core.org">
+    <prop id="wattage_per_state" value="0.0:1.0:1.0" />
+    <prop id="wattage_off" value="0.0" />
   </cluster>
 
 
   <!-- This second cluster has a backbone link, connecting all private links:
-       node-0.2cores.org --[l0]-------+
+       node-0.2cores.org __[l0]______+
                                      |
-       node-1.2cores.org --[l1]--[backbone]-- router -- (outer world)
+       node-1.2cores.org __[l1]__[backbone]__ router __ (outer world)
                 ...                  |
-       node-7.2cores.org --[l7]-------+
+       node-7.2cores.org __[l7]______+
     The route from node-0 to node-1 is: l0.UP ; backbone ; l1.DOWN
     
     The route from node-0 to the outer world begins with: l0.UP ; backbone
   -->    
-  <cluster id="backboned" prefix="node-" radical="0-7" suffix=".2cores.org"
-              speed="1Gf"       core="2" 
-             bw="125MBps"      lat="50us"
-           bb_bw="2.25GBps"  bb_lat="500us">
-    <prop id="watt_per_state" value="0.0:1.0:2.0" />
-    <prop id="watt_off" value="0.0" />
+  <cluster bb_bw="2.25GBps" bb_lat="500us" bw="125MBps" core="2" id="backboned" lat="50us" prefix="node-" radical="0-7" speed="1Gf" suffix=".2cores.org">
+    <prop id="wattage_per_state" value="0.0:0.0:2.0" />
+    <prop id="wattage_off" value="0.0" />
   </cluster>
           
 
   <!-- This cluster has a backbone link, but no links are splitduplex.
-    -- It means that up and down communications compete as if they
-    -- were using exactly the same resource. If you send and receive
-    -- at the same time, then each get half of the bandwidth.
-    --
-    -- Also, the hosts have 4 cores.
+    -  It means that up and down communications compete as if they
+    -  were using exactly the same resource. If you send and receive
+    -  at the same time, then each get half of the bandwidth.
+    - 
+    -  Also, the hosts have 4 cores.
     -->
-  <cluster id="halfduplex" prefix="node-" radical="0-7" suffix=".4cores.org" speed="1Gf" core="4"
-              bw="125MBps"      lat="50us"     sharing_policy="SHARED"
-          bb_bw="2.25GBps"  bb_lat="500us" bb_sharing_policy="SHARED">
-    <prop id="watt_per_state" value="0.0:1.0:4.0" />
-    <prop id="watt_off" value="0.0" />
+  <cluster bb_bw="2.25GBps" bb_lat="500us" bb_sharing_policy="SHARED" bw="125MBps" core="4" id="halfduplex" lat="50us" prefix="node-" radical="0-7" sharing_policy="SHARED" speed="1Gf" suffix=".4cores.org">
+    <prop id="wattage_per_state" value="0.0:0.0:4.0" />
+    <prop id="wattage_off" value="0.0" />
   </cluster>
 
   <!-- And now, we create the routes between the clusters, ie inter-zone routes -->
   
   <!-- We have only one outer link, representing the internet 
-    -- Its sharing is FATPIPE, meaning that communications have no impact on each others.
-    -- Any given comm can use the full provided bandwidth. 
-    --
-    -- This models the big links constituting the backbone of the internet, 
-    -- that users cannot saturate. 
-    -- Users' bandwidth is mostly limited by their outgoing connexion,
-    -- not by the network backbone. -->
+    -  Its sharing is FATPIPE, meaning that communications have no impact on each others.
+    -  Any given comm can use the full provided bandwidth. 
+    - 
+    -  This models the big links constituting the backbone of the internet, 
+    -  that users cannot saturate. 
+    -  Users' bandwidth is mostly limited by their outgoing connexion,
+    -  not by the network backbone.
+    -->
 
-    <link id="backbone" bandwidth="1.25GBps" latency="500us" sharing_policy="FATPIPE"/>
+    <link bandwidth="1.25GBps" id="backbone" latency="500us" sharing_policy="FATPIPE" />
 
-    <zoneRoute src="simple" dst="backboned" 
-               gw_src="node-simple_router.1core.org"
-               gw_dst="node-backboned_router.2cores.org">
+    <zoneRoute dst="backboned" gw_dst="node-backboned_router.2cores.org" gw_src="node-simple_router.1core.org" src="simple">
       <link_ctn id="backbone" />
     </zoneRoute>
 
-    <zoneRoute src="simple" dst="halfduplex" 
-               gw_src="node-simple_router.1core.org"
-               gw_dst="node-halfduplex_router.4cores.org">
+    <zoneRoute dst="halfduplex" gw_dst="node-halfduplex_router.4cores.org" gw_src="node-simple_router.1core.org" src="simple">
       <link_ctn id="backbone" />
     </zoneRoute>
     
-    <zoneRoute src="backboned" dst="halfduplex" 
-               gw_src="node-backboned_router.2cores.org"
-               gw_dst="node-halfduplex_router.4cores.org">
+    <zoneRoute dst="halfduplex" gw_dst="node-halfduplex_router.4cores.org" gw_src="node-backboned_router.2cores.org" src="backboned">
       <link_ctn id="backbone" />
     </zoneRoute>
 </zone>
index f8f7361..554f4c8 100644 (file)
   -- S2 ---[ 4 ]---                 ---[ 5 ]--- C2
   --
   --
-  -- This platform is a valid NS3 platform, even if it exhibits routes of length >1,
+  -- This platform is a valid ns-3 platform, even if it exhibits routes of length >1,
   -- because when you only keep the routes of length 1,
   -- you get a graph where every host can speak to any other host.
   --
   -- For example, S1--C1 is (l1,l2,l3) of length >1
   -- But it's also S1--C1 = S1--R1, R1--R2, R2--C1 which are all of length 1
   --
-  -- http://simgrid.gforge.inria.fr/simgrid/latest/doc/pls_ns3.html
+  -- https://simgrid.org/doc/latest/ns3.html
   -->
 
 <platform version="4.1">
index f703ff3..06948d0 100644 (file)
@@ -1,12 +1,10 @@
-<?xml version='1.0'?>
+<?xml version='1.0' encoding='utf-8'?>
 <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
 <platform version="4.1">
-  <cluster id="cluster" prefix="MyHost" radical="1-2" suffix="" 
-           speed="100.0Mf,50.0Mf,20.0Mf" core="4"
-           bw="125MBps" lat="50us" bb_bw="2.25GBps"  bb_lat="500us">
-    <!--  List of idle_power:min_power:max_power pairs (in Watts) -->
-    <!--  The list must contain one speed tupple for each previously defined pstate-->
-    <prop id="watt_per_state" value="100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0" />
-    <prop id="watt_off" value="10" />
+  <cluster bb_bw="2.25GBps" bb_lat="500us" bw="125MBps" core="4" id="cluster" lat="50us" prefix="MyHost" radical="1-2" speed="100.0Mf,50.0Mf,20.0Mf" suffix="">
+    <!--  List of idle_power:epsilon_power:max_power pairs (in Watts) -->
+    <!--  The list must contain one speed tuple for each previously defined pstate-->
+    <prop id="wattage_per_state" value="100.0:93.33333333333333:200.0, 93.0:90.0:170.0, 90.0:90.0:150.0" />
+    <prop id="wattage_off" value="10" />
   </cluster>
 </platform>
index 6cf6d72..2da6ba5 100644 (file)
@@ -1,42 +1,42 @@
-<?xml version='1.0'?>
+<?xml version='1.0' encoding='utf-8'?>
 <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
 <platform version="4.1">
   <zone id="AS0" routing="Full">
     <!-- Multiple pstate processor capacities can be defined as a list of powers specified for a given host -->
     <!-- Attribute 'pstate' specifies the initialy selected pstate (here, the lowest pstate corresponds to the highest
          processor speed) -->
-    <host id="MyHost1" speed="100.0Mf,50.0Mf,20.0Mf" pstate="0" core="4" >
-      <!--  List of Idle:OneCore:AllCores (in Watts) corresponding to the speed consumed when the processor is idle
-            and when one core is at full speed, and when all cores are fully loaded -->
+    <host core="4" id="MyHost1" pstate="0" speed="100.0Mf,50.0Mf,20.0Mf">
+      <!--  List of Idle:Epsilon:AllCores (in Watts) corresponding to the speed consumed when the processor is idle,
+            when all cores have a tiny epsilon load, and when all cores are fully loaded -->
       <!--  The list must contain one energetic profile for each previously defined pstate-->
-      <prop id="watt_per_state" value="100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0" />
-      <prop id="watt_off" value="10" />
+      <prop id="wattage_per_state" value="100.0:93.33333333333333:200.0, 93.0:90.0:170.0, 90.0:90.0:150.0" />
+      <prop id="wattage_off" value="10" />
     </host>
     
-    <host id="MyHost2" speed="100.0Mf,50.0Mf,20.0Mf" pstate="0" core="1" >
-      <!-- This host is mono-core, so AllCores=OneCore and is omitted -->
-      <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 core="1" id="MyHost2" pstate="0" speed="100.0Mf,50.0Mf,20.0Mf">
+      <!-- This host is mono-core and its consumption is either idle or full load (Epsilon=AllCores) -->
+      <prop id="wattage_per_state" value="100.0:200.0:200.0, 93.0:170.0:170.0, 90.0:150.0:150.0" />
+      <prop id="wattage_off" value="10" />
     </host>
     
-    <host id="MyHost3" speed="100.0Mf,50.0Mf,20.0Mf" pstate="0" core="1" >
-      <!-- This host is mono-core, so AllCores=OneCore and is omitted -->
-      <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 core="1" id="MyHost3" pstate="0" speed="100.0Mf,50.0Mf,20.0Mf">
+      <!-- This host is mono-core and its consumption is either idle or full load (Epsilon=AllCores) -->
+      <prop id="wattage_per_state" value="100.0:200.0:200.0, 93.0:170.0:170.0, 90.0:150.0:150.0" />
+      <prop id="wattage_off" value="10" />
     </host>
  
-    <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 bandwidth="100kBps" id="bus" latency="0" sharing_policy="SHARED">
+<!--   REALISTIC VALUES                    <prop id="wattage_range" value="10.3581:10.7479" /> -->
+<!--  IREALISTIC VALUES FOR THE TEST -->   <prop id="wattage_range" value="1:3" /> 
     </link>
-    <route src="MyHost1" dst="MyHost2">
-      <link_ctn id="bus"/>
+    <route dst="MyHost2" src="MyHost1">
+      <link_ctn id="bus" />
     </route>
-    <route src="MyHost1" dst="MyHost3">
-      <link_ctn id="bus"/>
+    <route dst="MyHost3" src="MyHost1">
+      <link_ctn id="bus" />
     </route>
-    <route src="MyHost2" dst="MyHost3">
-      <link_ctn id="bus"/>
+    <route dst="MyHost3" src="MyHost2">
+      <link_ctn id="bus" />
     </route>
   </zone>
 </platform>
diff --git a/examples/platforms/hosts_with_disks.xml b/examples/platforms/hosts_with_disks.xml
new file mode 100644 (file)
index 0000000..cb22063
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
+<platform version="4.1">
+  <zone id="AS0" routing="Full">
+    <host id="bob" speed="1Gf">
+      <disk id="Disk1" read_bw="100MBps" write_bw="40MBps">
+        <prop id="size" value="500GiB"/>
+        <prop id="mount" value="/scratch"/>
+        <prop id="content" value="storage/content/storage_content.txt"/>
+      </disk>
+      <disk id="Disk2" read_bw="200MBps" write_bw="80MBps"/>
+    </host>
+
+    <host id="alice" speed="1Gf">
+      <disk id="Disk1" read_bw="200MBps" write_bw="80MBps">
+        <prop id="content" value="storage/content/small_content.txt"/>
+      </disk>
+    </host>
+
+    <host id="carl" speed="1Gf">
+      <prop id="remote_disk" value="/scratch:Disk1:bob"/>
+    </host>
+
+    <link id="link1" bandwidth="125MBps" latency="150us" />
+    <link id="link2" bandwidth="125MBps" latency="150us" />
+    <link id="link3" bandwidth="125MBps" latency="150us" />
+
+    <route src="bob" dst="alice">
+      <link_ctn id="link1" />
+    </route>
+    <route src="bob" dst="carl">
+      <link_ctn id="link2" />
+    </route>
+    <route src="alice" dst="carl">
+      <link_ctn id="link3" />
+    </route>
+  </zone>
+</platform>
diff --git a/examples/platforms/ns3-big-cluster.xml b/examples/platforms/ns3-big-cluster.xml
new file mode 100644 (file)
index 0000000..8d63663
--- /dev/null
@@ -0,0 +1,182 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
+<platform version="4.1">
+  <zone id="AS0" routing="Floyd"> 
+
+    <host id="c-01.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-02.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-03.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-04.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-05.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-06.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-07.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-08.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-09.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-10.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-11.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-12.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-13.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-14.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-15.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-16.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-17.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-18.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-19.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-20.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-21.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-22.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-23.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-24.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-25.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-26.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-27.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-28.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-29.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-30.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-31.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-32.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-33.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-34.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-35.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-36.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-37.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-38.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-39.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-40.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-41.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-42.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-43.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-44.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-45.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-46.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-47.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-48.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-49.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-50.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-51.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-52.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-53.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-54.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-55.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-56.rennes" core="6" speed="21.496E9f"/>
+    <host id="c-57.rennes" core="6" speed="21.496E9f"/>
+  
+    <router id="router1"/>
+
+    <link id="link01" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link02" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link03" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link04" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link05" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link06" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link07" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link08" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link09" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link10" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link11" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link12" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link13" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link14" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link15" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link16" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link17" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link18" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link19" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link20" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link21" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link22" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link23" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link24" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link25" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link26" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link27" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link28" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link29" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link30" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link31" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link32" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link33" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link34" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link35" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link36" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link37" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link38" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link39" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link40" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link41" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link42" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link43" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link44" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link45" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link46" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link47" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link48" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link49" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link50" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link51" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link52" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link53" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link54" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link55" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link56" bandwidth="1.25GBps" latency="2.5ms"/>
+    <link id="link57" bandwidth="1.25GBps" latency="2.5ms"/>
+
+    <route src="router1" dst="c-01.rennes"><link_ctn id="link01"/></route>
+    <route src="router1" dst="c-02.rennes"><link_ctn id="link02"/></route>
+    <route src="router1" dst="c-03.rennes"><link_ctn id="link03"/></route>
+    <route src="router1" dst="c-04.rennes"><link_ctn id="link04"/></route>
+    <route src="router1" dst="c-05.rennes"><link_ctn id="link05"/></route>
+    <route src="router1" dst="c-06.rennes"><link_ctn id="link06"/></route>
+    <route src="router1" dst="c-07.rennes"><link_ctn id="link07"/></route>
+    <route src="router1" dst="c-08.rennes"><link_ctn id="link08"/></route>
+    <route src="router1" dst="c-09.rennes"><link_ctn id="link09"/></route>
+    <route src="router1" dst="c-10.rennes"><link_ctn id="link10"/></route>
+    <route src="router1" dst="c-11.rennes"><link_ctn id="link11"/></route>
+    <route src="router1" dst="c-12.rennes"><link_ctn id="link12"/></route>
+    <route src="router1" dst="c-13.rennes"><link_ctn id="link13"/></route>
+    <route src="router1" dst="c-14.rennes"><link_ctn id="link14"/></route>
+    <route src="router1" dst="c-15.rennes"><link_ctn id="link15"/></route>
+    <route src="router1" dst="c-16.rennes"><link_ctn id="link16"/></route>
+    <route src="router1" dst="c-17.rennes"><link_ctn id="link17"/></route>
+    <route src="router1" dst="c-18.rennes"><link_ctn id="link18"/></route>
+    <route src="router1" dst="c-19.rennes"><link_ctn id="link19"/></route>
+    <route src="router1" dst="c-20.rennes"><link_ctn id="link20"/></route>
+    <route src="router1" dst="c-21.rennes"><link_ctn id="link21"/></route>
+    <route src="router1" dst="c-22.rennes"><link_ctn id="link22"/></route>
+    <route src="router1" dst="c-23.rennes"><link_ctn id="link23"/></route>
+    <route src="router1" dst="c-24.rennes"><link_ctn id="link24"/></route>
+    <route src="router1" dst="c-25.rennes"><link_ctn id="link25"/></route>
+    <route src="router1" dst="c-26.rennes"><link_ctn id="link26"/></route>
+    <route src="router1" dst="c-27.rennes"><link_ctn id="link27"/></route>
+    <route src="router1" dst="c-28.rennes"><link_ctn id="link28"/></route>
+    <route src="router1" dst="c-29.rennes"><link_ctn id="link29"/></route>
+    <route src="router1" dst="c-30.rennes"><link_ctn id="link30"/></route>
+    <route src="router1" dst="c-31.rennes"><link_ctn id="link31"/></route>
+    <route src="router1" dst="c-32.rennes"><link_ctn id="link32"/></route>
+    <route src="router1" dst="c-33.rennes"><link_ctn id="link33"/></route>
+    <route src="router1" dst="c-34.rennes"><link_ctn id="link34"/></route>
+    <route src="router1" dst="c-35.rennes"><link_ctn id="link35"/></route>
+    <route src="router1" dst="c-36.rennes"><link_ctn id="link36"/></route>
+    <route src="router1" dst="c-37.rennes"><link_ctn id="link37"/></route>
+    <route src="router1" dst="c-38.rennes"><link_ctn id="link38"/></route>
+    <route src="router1" dst="c-39.rennes"><link_ctn id="link39"/></route>
+    <route src="router1" dst="c-40.rennes"><link_ctn id="link40"/></route>
+    <route src="router1" dst="c-41.rennes"><link_ctn id="link41"/></route>
+    <route src="router1" dst="c-42.rennes"><link_ctn id="link42"/></route>
+    <route src="router1" dst="c-43.rennes"><link_ctn id="link43"/></route>
+    <route src="router1" dst="c-44.rennes"><link_ctn id="link44"/></route>
+    <route src="router1" dst="c-45.rennes"><link_ctn id="link45"/></route>
+    <route src="router1" dst="c-46.rennes"><link_ctn id="link46"/></route>
+    <route src="router1" dst="c-47.rennes"><link_ctn id="link47"/></route>
+    <route src="router1" dst="c-48.rennes"><link_ctn id="link48"/></route>
+    <route src="router1" dst="c-49.rennes"><link_ctn id="link49"/></route>
+    <route src="router1" dst="c-50.rennes"><link_ctn id="link50"/></route>
+    <route src="router1" dst="c-51.rennes"><link_ctn id="link51"/></route>
+    <route src="router1" dst="c-52.rennes"><link_ctn id="link52"/></route>
+    <route src="router1" dst="c-53.rennes"><link_ctn id="link53"/></route>
+    <route src="router1" dst="c-54.rennes"><link_ctn id="link54"/></route>
+    <route src="router1" dst="c-55.rennes"><link_ctn id="link55"/></route>
+    <route src="router1" dst="c-56.rennes"><link_ctn id="link56"/></route>
+    <route src="router1" dst="c-57.rennes"><link_ctn id="link57"/></route>
+  </zone>
+</platform>
index 6a0ac5c..b476efb 100644 (file)
@@ -26,6 +26,7 @@
     </cluster>
 
     <zone  id="AS4"  routing="Full">
+      <prop id="bla" value="bli"/>
       <host id="host1" speed="1Gf">
         <prop id="Hdd" value="180"/>
         <prop id="mem" value="4"/>
index a7490b0..c0c79d9 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version='1.0'?>
 <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
 
-<!-- All routes of this platform are of length 1, so you can use it with the NS3 model
-     http://simgrid.gforge.inria.fr/simgrid/latest/doc/pls_ns3.html -->
+<!-- All routes of this platform are of length 1, so you can use it with the ns-3 model.
+     https://simgrid.org/doc/latest/ns3.html -->
 
 <platform version="4.1">
   <zone  id="AS0"  routing="Full">
diff --git a/examples/platforms/storage/content/win_storage_content.txt b/examples/platforms/storage/content/win_storage_content.txt
deleted file mode 100644 (file)
index 48972ca..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-\Windows\avastSS.scr 41664\r
-\Windows\bfsvc.exe 75264\r
-\Windows\bootstat.dat 67584\r
-\Windows\CoreSingleLanguage.xml 31497\r
-\Windows\csup.txt 12\r
-\Windows\dchcfg64.exe 335464\r
-\Windows\dcmdev64.exe 93288\r
-\Windows\DirectX.log 10486\r
-\Windows\DPINST.LOG 18944\r
-\Windows\DtcInstall.log 1955\r
-\Windows\explorer.exe 2380944\r
-\Windows\font1.sii 4907\r
-\Windows\font2.sii 8698\r
-\Windows\hapint.exe 382056\r
-\Windows\HelpPane.exe 883712\r
-\Windows\hh.exe 17408\r
-\Windows\MEMORY.DMP 2384027342\r
-\Windows\mib.bin 43131\r
-\Windows\notepad.exe 243712\r
-\Windows\PFRO.log 6770\r
-\Windows\Professional.xml 31881\r
-\Windows\regedit.exe 159232\r
-\Windows\setupact.log 101663\r
-\Windows\setuperr.log 0\r
-\Windows\splwow64.exe 126464\r
-\Windows\Starter.xml 31537\r
-\Windows\system.ini 219\r
-\Windows\twain_32.dll 50176\r
-\Windows\vmgcoinstall.log 1585\r
-\Windows\win.ini 92\r
-\Windows\WindowsUpdate.log 1518934\r
-\Windows\winhlp32.exe 10752\r
-\Windows\WLXPGSS.SCR 322048\r
-\Windows\WMSysPr9.prx 316640\r
-\Windows\write.exe 10752\r
-\Windows\_isusr32.dll 180320
\ No newline at end of file
index c19c354..da1a035 100644 (file)
     <storage id="Disk1" typeId="SATA-II_HDD" attach="carl"/>
 
     <storage id="Disk2" typeId="SATA-II_HDD" attach="dave"
-             content="content/win_storage_content.txt" />
+             content="content/storage_content.txt" />
 
     <host id="alice" speed="1Gf">
-      <mount storageId="Disk2" name="c:"/>
+      <mount storageId="Disk2" name="/tmp"/>
     </host>
     <host id="bob" speed="1Gf">
       <mount storageId="Disk1" name="/scratch"/>
@@ -26,7 +26,7 @@
       <mount storageId="Disk1" name="/scratch"/>
     </host>
     <host id="dave" speed="1Gf">
-      <mount storageId="Disk2" name="c:"/>
+      <mount storageId="Disk2" name="/tmp"/>
     </host>
 
     <link id="link1" bandwidth="125MBps" latency="50us"/>
index 8d99f5c..ca64a72 100644 (file)
@@ -18,7 +18,7 @@
 
     <storage id="Disk1" typeId="single_HDD" attach="bob" />
     <storage id="Disk2" typeId="single_SSD" attach="alice"
-             content="content/win_storage_content.txt"/>
+             content="content/small_content.txt"/>
     <storage id="Disk3" typeId="single_HDD" attach="carl" />
     <storage id="Disk4" typeId="single_SSD" attach="denise"
              content="content/small_content.txt" />
       <mount storageId="Disk1" name="/home"/>
     </host>
     <host id="alice" speed="1Gf">
-      <mount storageId="Disk2" name="c:"/>
+      <mount storageId="Disk2" name="/tmp"/>
     </host>
     <host id="carl" speed="1Gf">
       <mount storageId="Disk3" name="/home"/>
     </host>
     <host id="denise" speed="1Gf">
-      <mount storageId="Disk2" name="c:"/>
+      <mount storageId="Disk2" name="/tmp"/>
       <mount storageId="Disk4" name="/home"/>
     </host>
 
diff --git a/examples/platforms/wifi.xml b/examples/platforms/wifi.xml
new file mode 100755 (executable)
index 0000000..fed5614
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version='1.0'?>
+
+<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
+<platform version="4.1">
+  <zone id="world" routing="Full">
+
+    <zone id="WIFI zone" routing="Cluster">
+        <!-- First declare the Access Point (ie, the wifi media) -->
+        <link id="AP1" sharing_policy="WIFI" bandwidth="54Mbps" latency="0ms" />
+
+        <!-- Two stations in the wifi zone -->
+        <host id="Station 1" speed="100.0Mf,50.0Mf,20.0Mf" />
+        <host id="Station 2" speed="100.0Mf,50.0Mf,20.0Mf" />
+
+        <!-- Specify that stations use the WIFI link for every communication (incoming or outgoing) -->
+        <host_link id="Station 1" up="AP1" down="AP1"/>
+        <host_link id="Station 2" up="AP1" down="AP1"/>
+
+        <router id="WIFI router"/>
+    </zone>
+
+
+    <!-- NODE1 AS -->
+    <zone id="Wired zone" routing="Full">
+      <host id="NODE1" speed="100.0Mf,50.0Mf,20.0Mf" />
+    </zone>
+    
+
+    <!-- AS Routing -->
+    <link id="Collector" sharing_policy="SHARED" bandwidth="100Mbps" latency="0ms" />
+    <zoneRoute src="WIFI zone" dst="Wired zone" gw_src="WIFI router" gw_dst="NODE1">
+      <link_ctn id="Collector" />
+    </zoneRoute>
+    
+  </zone>
+</platform>
index 3077640..d2ef8a1 100644 (file)
@@ -8,7 +8,7 @@ foreach(example actor-create actor-daemon actor-join actor-kill actor-migrate ac
     ADD_TESH(python-${example} --setenv srcdir=${CMAKE_CURRENT_SOURCE_DIR}/${example}
                                --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
                                --setenv pythoncmd=${PYTHON_EXECUTABLE}
-                              --setenv LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib
+                              --setenv LD_LIBRARY_PATH=${TESH_LIBRARY_PATH}
                               --setenv PYTHONPATH=${CMAKE_BINARY_DIR}/lib
                               --cd ${CMAKE_CURRENT_SOURCE_DIR}/${example}
                                ${CMAKE_HOME_DIRECTORY}/examples/python/${example}/${example}.tesh)
index 9596c01..034f340 100644 (file)
@@ -7,13 +7,13 @@ foreach (example actor-create actor-daemon actor-exiting actor-join actor-kill
                  app-chainsend app-pingpong app-token-ring
                  async-ready async-wait async-waitany async-waitall async-waituntil
                  cloud-capping cloud-migration cloud-simple
-                 energy-exec energy-boot energy-link energy-vm
+                 energy-exec energy-boot energy-link energy-vm energy-exec-ptask
                  engine-filtering
-                 exec-async exec-basic exec-dvfs exec-ptask exec-remote
-                 io-async io-file-system io-file-remote io-storage-raw
+                 exec-async exec-basic exec-dvfs exec-ptask exec-remote exec-waitany
+                 io-async io-file-system io-file-remote io-disk-raw
                  platform-failures platform-profile platform-properties
                  plugin-hostload
-                 replay-comm replay-storage
+                 replay-comm replay-io
                  routing-get-clusters
                  synchro-barrier synchro-mutex synchro-semaphore)
   add_executable       (s4u-${example} EXCLUDE_FROM_ALL ${example}/s4u-${example}.cpp)
@@ -31,6 +31,30 @@ foreach (example actor-create actor-daemon actor-exiting actor-join actor-kill
                                    ${CMAKE_HOME_DIRECTORY}/examples/s4u/${example}/s4u-${example}.tesh)
 endforeach()
 
+
+# Model-checking examples: with only one source and tested with all factories but thread
+######################################################################
+
+foreach (example mc-failing-assert)
+  if(SIMGRID_HAVE_MC)
+    add_executable       (s4u-${example} EXCLUDE_FROM_ALL ${example}/s4u-${example}.cpp)
+    add_dependencies     (tests s4u-${example})
+    target_link_libraries(s4u-${example} simgrid)
+    set_target_properties(s4u-${example} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${example})
+
+  
+    ADD_TESH_FACTORIES(s4u-${example} "ucontext;raw;boost"
+                                      --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/${example} 
+                                   --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms 
+                                   --cd ${CMAKE_CURRENT_SOURCE_DIR}/${example} 
+                                   ${CMAKE_HOME_DIRECTORY}/examples/s4u/${example}/s4u-${example}.tesh)
+  endif()
+  
+  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()
+
+
 # Multi-files examples
 ######################
 
@@ -147,7 +171,6 @@ set(xml_files     ${xml_files}    ${CMAKE_CURRENT_SOURCE_DIR}/actor-create/s4u-a
                                   ${CMAKE_CURRENT_SOURCE_DIR}/async-wait/s4u-async-wait_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}/async-ready/s4u-async-ready_d.xml
                                   ${CMAKE_CURRENT_SOURCE_DIR}/async-waituntil/s4u-async-waituntil_d.xml
                                   ${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/s4u-dht-chord_d.xml
@@ -158,12 +181,12 @@ set(xml_files     ${xml_files}    ${CMAKE_CURRENT_SOURCE_DIR}/actor-create/s4u-a
                                   ${CMAKE_CURRENT_SOURCE_DIR}/platform-failures/s4u-platform-failures_d.xml
                                   ${CMAKE_CURRENT_SOURCE_DIR}/replay-comm/s4u-replay-comm-split_d.xml
                                   ${CMAKE_CURRENT_SOURCE_DIR}/replay-comm/s4u-replay-comm_d.xml
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/replay-storage/s4u-replay-storage_d.xml
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/replay-io/s4u-replay-io_d.xml
                   PARENT_SCOPE)
 set(bin_files     ${bin_files}    ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/generate.py                     PARENT_SCOPE)
 set(txt_files     ${txt_files}    ${CMAKE_CURRENT_SOURCE_DIR}/replay-comm/s4u-replay-comm-split-p0.txt
                                   ${CMAKE_CURRENT_SOURCE_DIR}/replay-comm/s4u-replay-comm-split-p1.txt
                                   ${CMAKE_CURRENT_SOURCE_DIR}/replay-comm/s4u-replay-comm.txt
-                                  ${CMAKE_CURRENT_SOURCE_DIR}/replay-storage/s4u-replay-storage.txt
+                                  ${CMAKE_CURRENT_SOURCE_DIR}/replay-io/s4u-replay-io.txt
                                   ${CMAKE_CURRENT_SOURCE_DIR}/README.rst                                   PARENT_SCOPE)
 
index 8fce725..027d3b8 100644 (file)
@@ -31,6 +31,7 @@ to simulate.
 Actors: the Active Entities
 ===========================
 
+.. _s4u_ex_actors:
 
 Starting and Stoping Actors
 ---------------------------
@@ -48,6 +49,7 @@ Starting and Stoping Actors
     of doing so, depending of whether you want your callback to be
     executed when a specific actor ends (with ```this_actor::on_exit()```)
     or whether it should be executed when any actor ends (with
+    ```Actor::on_termination()```) or when it gets destroyed (with
     ```Actor::on_destruction()```)
 
     - |cpp| `examples/s4u/actor-exiting/s4u-actor-exiting.cpp <https://framagit.org/simgrid/simgrid/tree/master/examples/s4u/actor-exiting/s4u-actor-exiting.cpp>`_
@@ -80,6 +82,10 @@ Starting and Stoping Actors
 Inter-Actors Interactions
 -------------------------
 
+See also the examples on :ref:`inter-actors communications
+<s4u_ex_communication>` and the ones on :ref:`classical
+synchronization objects <s4u_ex_IPC>`.
+
   - **Suspend and Resume actors:**    
     Actors can be suspended and resumed during their executions.
     
@@ -143,12 +149,14 @@ also the tesh files in the example directories for details.
   - **I/O replay:**
     Presents a set of event handlers reproducing classical I/O
     primitives (open, read, close).
-    |br| `examples/s4u/replay-storage/s4u-replay-storage.cpp  <https://framagit.org/simgrid/simgrid/tree/master/examples/s4u/replay-storage/s4u-replay-storage.cpp>`_
+    |br| `examples/s4u/replay-io/s4u-replay-io.cpp <https://framagit.org/simgrid/simgrid/tree/master/examples/s4u/replay-io/s4u-replay-io.cpp>`_
 
 ==========================
 Activities: what Actors do
 ==========================
 
+.. _s4u_ex_communication:
+
 Communications on the Network
 -----------------------------
 
@@ -233,13 +241,13 @@ I/O on Disks and Files
 ----------------------
 
 SimGrid provides two levels of abstraction to interact with the
-simulated storages. At the simplest level, you simply create read and
-write actions on the storage resources.
+simulated disks. At the simplest level, you simply create read and
+write actions on the disk resources.
 
-  - **Access to raw storage devices:**
+  - **Access to raw disk devices:**
     This example illustrates how to simply read and write data on a
-    simulated storage resource.
-    |br| `examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp  <https://framagit.org/simgrid/simgrid/tree/master/examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp>`_
+    simulated disk resource.
+    |br| `examples/s4u/io-disk-raw/s4u-io-disk-raw.cpp  <https://framagit.org/simgrid/simgrid/tree/master/examples/s4u/io-disk-raw/s4u-io-disk-raw.cpp>`_
 
 The FileSystem plugin provides a more detailed view, with the
 classical operations over files: open, move, unlink, and of course
@@ -256,6 +264,8 @@ result in short reads and short write, as in reality.
     i.e. when the accessed disk is not mounted on the caller's host.
     |br| `examples/s4u/io-file-remote/s4u-io-file-remote.cpp  <https://framagit.org/simgrid/simgrid/tree/master/examples/s4u/io-file-remote/s4u-io-file-remote.cpp>`_
 
+.. _s4u_ex_IPC:
+
 Classical synchronization objects
 ---------------------------------
 
@@ -299,7 +309,7 @@ Interacting with the Platform
    resources must be turned off and on again, and how to react to such
    failures in your code.
    
-   |br| `examples/platforms/small_platform_with_failure.xml <https://framagit.org/simgrid/simgrid/tree/master/examples/platforms/small_platform_with_failure.xml>`_
+   |br| `examples/platforms/small_platform_failures.xml <https://framagit.org/simgrid/simgrid/tree/master/examples/platforms/small_platform_failures.xml>`_
    |br| The state profiles in `examples/platforms/profiles <https://framagit.org/simgrid/simgrid/tree/master/examples/platforms/profiles>`_
 
  - **Specifying speed profiles:** shows how to specify an external
@@ -398,7 +408,34 @@ Distributed Hash Tables (DHT)
     One of the most famous DHT protocol.
     |br| `examples/s4u/dht-chord/s4u-dht-chord.cpp <https://framagit.org/simgrid/simgrid/tree/master/examples/s4u/dht-chord/s4u-dht-chord.cpp>`_
 
-.. TODO:: document here the examples about plugins
+.. _s4u_ex_clouds:
+
+Simulating Clouds
+-----------------
+
+  - **Cloud basics**
+    This example starts some computations both on PMs and VMs, and
+    migrates some VMs around.
+    |br| `examples/s4u/cloud-simple/s4u-cloud-simple.cpp <https://framagit.org/simgrid/simgrid/tree/master/examples/s4u/cloud-simple/s4u-cloud-simple.cpp>`_
+
+.. TODO:: document here the examples about clouds and plugins
+
+=======================
+Model-Checking Examples
+=======================
+
+The model-checker can be used to exhaustively search for issues in the
+tested application. It must be activated at compile time, but this
+mode is rather experimental in SimGrid (as of v3.22). You should not
+enable it unless you really want to formally verify your applications:
+SimGrid is slower and maybe less robust when MC is enabled.
+
+  - **Failing assert**
+    In this example, two actors send some data to a central server,
+    which asserts that the messages are always received in the same order.
+    This is obviously wrong, and the model-checker correctly finds a
+    counter-example to that assertion.
+    |br| `examples/s4u/mc-failing-assert/s4u-mc-failing-assert.cpp <https://framagit.org/simgrid/simgrid/tree/master/examples/s4u/mc-failing-assert/s4u-mc-failing-assert.cpp>`_
 
 .. |br| raw:: html
 
index 58a2574..994a3f9 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-create
+$ ${bindir:=.}/s4u-actor-create
 > [Tremblay:sender1:(2) 0.000000] [s4u_actor_create/INFO] Hello s4u, I have something to send
 > [Jupiter:sender2:(3) 0.000000] [s4u_actor_create/INFO] Hello s4u, I have something to send
 > [Fafard:sender:(4) 0.000000] [s4u_actor_create/INFO] Hello s4u, I have something to send
index 54037a6..4372bd4 100644 (file)
@@ -21,7 +21,7 @@ static void my_daemon()
 {
   simgrid::s4u::Actor::self()->daemonize();
 
-  while (1) {
+  while (simgrid::s4u::this_actor::get_host()->is_on()) {
     XBT_INFO("Hello from the infinite loop");
     simgrid::s4u::this_actor::sleep_for(3.0);
   }
index 5f7cb69..82593d2 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing the process daemonization feature
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-daemon ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-actor-daemon ${platfdir}/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
index 9895d9f..554ebd2 100644 (file)
@@ -5,7 +5,7 @@
 
 /* There is two very different ways of being informed when an actor exits.
  *
- * The this_actor::on_exit() function allows to register a function to be
+ * The this_actor::on_exit() function allows one to register a function to be
  * executed when this very actor exits. The registered function will run
  * when this actor terminates (either because its main function returns, or
  * because it's killed in any way). No simcall are allowed here: your actor
  * Usually, the functions registered in this_actor::on_exit() are in charge
  * of releasing any memory allocated by the actor during its execution.
  *
- * The other way of getting informed when an actor dies is to connect a
- * function in the Actor::on_destruction signal, that is shared between
+ * The other way of getting informed when an actor terminates is to connect a
+ * function in the Actor::on_termination signal, that is shared between
  * all actors. Callbacks to this signal are executed for each terminating
  * actors, no matter what. This is useful in many cases, in particular
  * when developping SimGrid plugins.
  *
+ * Finally, you can attach callbacks to the Actor::on_destruction signal.
+ * It is also shared between all actors, and gets fired when the actors
+ * are destroyed. A delay is possible between the termination of an actor
+ * (ie, when it terminates executing its code) and its destruction (ie,
+ * when it is not referenced anywhere in the simulation and can be collected).
+ *
  * In both cases, you can stack more than one callback in the signal.
  * They will all be executed in the registration order.
  */
@@ -45,13 +51,16 @@ static void actor_b()
 int main(int argc, char* 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]);
+  xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s ../platforms/small_platform.xml\n", argv[0], argv[0]);
 
   e.load_platform(argv[1]); /* - Load the platform description */
 
-  /* Register a callback in the Actor::on_destruction signal. It will be called for every terminated actors */
+  /* Register a callback in the Actor::on_termination signal. It will be called for every terminated actors */
+  simgrid::s4u::Actor::on_termination.connect(
+      [](simgrid::s4u::Actor const& actor) { XBT_INFO("Actor %s terminates now", actor.get_cname()); });
+  /* Register a callback in the Actor::on_destruction signal. It will be called for every destructed actors */
   simgrid::s4u::Actor::on_destruction.connect(
-      [](simgrid::s4u::Actor const& actor) { XBT_INFO("Actor %s stops now", actor.get_cname()); });
+      [](simgrid::s4u::Actor const& actor) { XBT_INFO("Actor %s gets destroyed now", actor.get_cname()); });
 
   /* Create some actors */
   simgrid::s4u::Actor::create("A", simgrid::s4u::Host::by_name("Tremblay"), actor_a);
index d5a15ed..e59ceb8 100644 (file)
@@ -1,6 +1,8 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-exiting ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-actor-exiting ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [ 10.194200] (A@Tremblay) I stop now
-> [ 10.194200] (maestro@) Actor A stops now
-> [ 26.213694] (maestro@) Actor B stops now
+> [ 10.194200] (maestro@) Actor A terminates now
+> [ 26.213694] (maestro@) Actor A gets destroyed now
+> [ 26.213694] (maestro@) Actor B terminates now
+> [ 26.213694] (maestro@) Actor B gets destroyed now
index d39512b..2be0244 100644 (file)
@@ -50,7 +50,7 @@ static void master()
 int main(int argc, char* 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]);
+  xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s ../platforms/small_platform.xml\n", argv[0], argv[0]);
 
   e.load_platform(argv[1]);
 
index b03b3e2..bf1b153 100644 (file)
@@ -1,4 +1,4 @@
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-join$EXEEXT ${platfdir}/small_platform.xml
+$ ${bindir:=.}/s4u-actor-join ${platfdir}/small_platform.xml
 > [Tremblay:master:(1) 0.000000] [s4u_test/INFO] Start sleeper
 > [Tremblay:sleeper from master:(2) 0.000000] [s4u_test/INFO] Sleeper started
 > [Tremblay:master:(1) 0.000000] [s4u_test/INFO] Join the sleeper (timeout 2)
index 3226e94..34ec395 100644 (file)
@@ -65,7 +65,7 @@ static void killer()
 int main(int argc, char* 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]);
+  xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s ../platforms/small_platform.xml\n", argv[0], argv[0]);
 
   e.load_platform(argv[1]); /* - Load the platform description */
   /* - Create and deploy killer process, that will create the victim actors  */
index ba2afdc..603cd8d 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-kill ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-actor-kill ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [  0.000000] (killer@Tremblay) Hello!
 > [  0.000000] (victim A@Fafard) Hello!
 > [  0.000000] (victim A@Fafard) Suspending myself
index fb2990f..d73b509 100644 (file)
@@ -33,8 +33,9 @@ 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",
+  xbt_assert(argc > 2,
+             "Usage: %s platform_file deployment_file\n"
+             "\tExample: %s ../platforms/cluster_backbone.xml ./s4u_actor_lifetime_d.xml\n",
              argv[0], argv[0]);
 
   e.load_platform(argv[1]); /* Load the platform description */
index 2a70e45..c3d3b15 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-lifetime ${platfdir}/cluster_backbone.xml s4u-actor-lifetime_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-actor-lifetime ${platfdir}/cluster_backbone.xml s4u-actor-lifetime_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sleeper@node-0.simgrid.org) Hello! I go to sleep.
 > [  0.000000] (2:sleeper@node-1.simgrid.org) Hello! I go to sleep.
 > [  2.000000] (3:sleeper@node-0.simgrid.org) Hello! I go to sleep.
index 4faa4d6..c1b3608 100644 (file)
@@ -61,7 +61,7 @@ static void monitor()
 int main(int argc, char* 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]);
+  xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s ../platforms/small_platform.xml\n", argv[0], argv[0]);
   e.load_platform(argv[1]);
 
   simgrid::s4u::Actor::create("monitor", simgrid::s4u::Host::by_name("Boivin"), monitor);
index ef8867a..6b05f06 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing the actor migration feature 
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-migrate ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-actor-migrate ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [  0.000000] (worker@Fafard) Let's move to Boivin to execute 1177.14 Mflops (5sec on Boivin and 5sec on Jacquelin)
 > [  5.000000] (monitor@Boivin) After 5 seconds, move the process to Jacquelin
 > [ 10.000000] (worker@Jacquelin) I wake up on Jacquelin. Let's suspend a bit
index 3a29577..3e1a93e 100644 (file)
@@ -70,7 +70,7 @@ static void dream_master()
 int main(int argc, char* 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]);
+  xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s ../platforms/small_platform.xml\n", argv[0], argv[0]);
 
   e.load_platform(argv[1]); /* - Load the platform description */
   std::vector<simgrid::s4u::Host*> list = e.get_all_hosts();
index 840b482..a443c7f 100644 (file)
@@ -3,7 +3,7 @@
 p Testing the suspend/resume feature of S4U
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-suspend ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-actor-suspend ${platfdir}/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...
index b61c4f2..69503ff 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-actor-yield ${platfdir}/small_platform_fatpipe.xml s4u-actor-yield_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-actor-yield ${platfdir}/small_platform_fatpipe.xml s4u-actor-yield_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:yielder@Tremblay) I yielded 10 times. Goodbye now!
 > [  0.000000] (2:yielder@Ruby) I yielded 15 times. Goodbye now!
index a72f286..c4790e7 100644 (file)
@@ -4,7 +4,7 @@ p Testing the Bittorrent implementation with S4U
 
 ! timeout 10
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-bittorrent ${platfdir}/cluster_backbone.xml s4u-app-bittorrent_d.xml "--log=root.fmt:[%12.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-bittorrent ${platfdir}/cluster_backbone.xml s4u-app-bittorrent_d.xml "--log=root.fmt:[%12.6r]%e(%i:%P@%h)%e%m%n"
 > [    0.000000] (1:tracker@node-0.simgrid.org) Tracker launched.
 > [    0.000000] (2:peer@node-1.simgrid.org) Hi, I'm joining the network with id 2
 > [    0.000000] (3:peer@node-2.simgrid.org) Hi, I'm joining the network with id 3
index 19551d0..b2113ca 100644 (file)
@@ -75,11 +75,11 @@ public:
       , block_length(block_length){};
   Message(e_message_type type, int peer_id, simgrid::s4u::Mailbox* return_mailbox, int piece)
       : type(type), peer_id(peer_id), return_mailbox(return_mailbox), piece(piece){};
-  ~Message() = default;
 };
 
 class HostBittorrent {
-  RngStream stream_;
+  std::unique_ptr<std::remove_pointer<RngStream>::type, std::function<void(RngStream)>> stream_ = {
+      nullptr, [](RngStream stream) { RngStream_DeleteStream(&stream); }};
   simgrid::s4u::Host* host = nullptr;
 
 public:
@@ -88,14 +88,12 @@ public:
   explicit HostBittorrent(simgrid::s4u::Host* ptr) : host(ptr)
   {
     std::string descr = std::string("RngSream<") + host->get_cname() + ">";
-    stream_           = RngStream_CreateStream(descr.c_str());
+    stream_.reset(RngStream_CreateStream(descr.c_str()));
   }
   HostBittorrent(const HostBittorrent&) = delete;
   HostBittorrent& operator=(const HostBittorrent&) = delete;
 
-  ~HostBittorrent() { RngStream_DeleteStream(&stream_); };
-
-  RngStream getStream() { return stream_; };
+  RngStream getStream() { return stream_.get(); };
 };
 
 #endif /* BITTORRENT_BITTORRENT_HPP_ */
index f28d40b..ff9a094 100644 (file)
@@ -33,14 +33,14 @@ Peer::Peer(std::vector<std::string> args)
   try {
     id       = std::stoi(args[1]);
     mailbox_ = simgrid::s4u::Mailbox::by_name(std::to_string(id));
-  } catch (std::invalid_argument& ia) {
-    throw std::invalid_argument(std::string("Invalid ID:") + args[1].c_str());
+  } catch (const std::invalid_argument&) {
+    throw std::invalid_argument("Invalid ID:" + args[1]);
   }
 
   try {
     deadline = std::stod(args[2]);
-  } catch (std::invalid_argument& ia) {
-    throw std::invalid_argument(std::string("Invalid deadline:") + args[2].c_str());
+  } catch (const std::invalid_argument&) {
+    throw std::invalid_argument("Invalid deadline:" + args[2]);
   }
   xbt_assert(deadline > 0, "Wrong deadline supplied");
 
@@ -50,18 +50,11 @@ Peer::Peer(std::vector<std::string> args)
     bitfield_       = (1U << FILE_PIECES) - 1U;
     bitfield_blocks = (1ULL << (FILE_PIECES * PIECES_BLOCKS)) - 1ULL;
   }
-  pieces_count = new short[FILE_PIECES]{0};
+  pieces_count.resize(FILE_PIECES);
 
   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()()
 {
@@ -91,7 +84,7 @@ bool Peer::getPeersFromTracker()
   try {
     XBT_DEBUG("Sending a peer request to the tracker.");
     tracker_mailbox->put(peer_request, TRACKER_COMM_SIZE, GET_PEERS_TIMEOUT);
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutException&) {
     XBT_DEBUG("Timeout expired when requesting peers to tracker");
     delete peer_request;
     return false;
@@ -100,11 +93,11 @@ bool Peer::getPeersFromTracker()
   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())
+    for (auto const& peer_id : answer->getPeers())
       if (id != peer_id)
-        connected_peers[peer_id] = new Connection(peer_id);
+        connected_peers.emplace(peer_id, Connection(peer_id));
     delete answer;
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutException&) {
     XBT_DEBUG("Timeout expired when requesting peers to tracker");
     return false;
   }
@@ -114,10 +107,10 @@ bool Peer::getPeersFromTracker()
 void Peer::sendHandshakeToAllPeers()
 {
   for (auto const& kv : connected_peers) {
-    Connection* remote_peer = kv.second;
+    const 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);
+    remote_peer.mailbox_->put_init(handshake, MESSAGE_HANDSHAKE_SIZE)->detach();
+    XBT_DEBUG("Sending a HANDSHAKE to %d", remote_peer.id);
   }
 }
 
@@ -148,8 +141,8 @@ 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();
+    const Connection& remote_peer = kv.second;
+    remote_peer.mailbox_->put_init(new Message(MESSAGE_HAVE, id, mailbox_, piece), MESSAGE_HAVE_SIZE)->detach();
   }
 }
 
@@ -217,7 +210,7 @@ int Peer::nbInterestedPeers()
 {
   int nb = 0;
   for (auto const& kv : connected_peers)
-    if (kv.second->interested)
+    if (kv.second.interested)
       nb++;
   return nb;
 }
@@ -298,7 +291,7 @@ void Peer::handleMessage()
   XBT_DEBUG("Received a %s message from %s", type_names[message->type], message->return_mailbox->get_cname());
 
   auto known_peer         = connected_peers.find(message->peer_id);
-  Connection* remote_peer = (known_peer == connected_peers.end()) ? nullptr : known_peer->second;
+  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.");
 
@@ -307,7 +300,7 @@ void Peer::handleMessage()
       // 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);
+        connected_peers.emplace(message->peer_id, Connection(message->peer_id));
         sendMessage(message->return_mailbox, MESSAGE_HANDSHAKE, MESSAGE_HANDSHAKE_SIZE);
       }
       // Send our bitfield to the peer
@@ -551,13 +544,12 @@ void Peer::updateChokedPeers()
 
   /**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::get_clock() + 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;
+    for (auto& kv : connected_peers) {
+      Connection& 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 {
@@ -566,12 +558,10 @@ void Peer::updateChokedPeers()
       int j = 0;
       do {
         // We choose a random peer to unchoke.
-        std::unordered_map<int, Connection*>::iterator chosen_peer_it = connected_peers.begin();
+        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 = &chosen_peer_it->second;
+        if (not chosen_peer->interested || not chosen_peer->choked_upload)
           chosen_peer = nullptr;
         else
           XBT_DEBUG("Nothing to do, keep going");
@@ -580,11 +570,11 @@ void Peer::updateChokedPeers()
     } 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;
+      for (auto& kv : connected_peers) {
+        Connection& remote_peer = kv.second;
+        if (remote_peer.peer_speed > fastest_speed && remote_peer.choked_upload && remote_peer.interested) {
+          fastest_speed = remote_peer.peer_speed;
+          chosen_peer   = &remote_peer;
         }
       }
     }
@@ -617,20 +607,20 @@ void Peer::updateChokedPeers()
 /** @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) {
+  for (auto& 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)) {
+        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);
+        remote_peer.am_interested = false;
+        sendMessage(remote_peer.mailbox_, MESSAGE_NOTINTERESTED, MESSAGE_NOTINTERESTED_SIZE);
       }
     }
   }
index 2d9eb6a..fa0418d 100644 (file)
@@ -15,7 +15,6 @@ public:
   int id; // Peer id
   simgrid::s4u::Mailbox* mailbox_;
   unsigned int bitfield = 0U; // Fields
-  //  int messages_count;
   double peer_speed    = 0;
   double last_unchoke  = 0;
   int current_piece    = -1;
@@ -25,7 +24,6 @@ public:
   bool choked_download = true;  // Indicates if the peer has choked the current peer
 
   explicit Connection(int id) : id(id), mailbox_(simgrid::s4u::Mailbox::by_name(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; }
 };
@@ -35,12 +33,12 @@ class Peer {
   double deadline;
   RngStream stream;
   simgrid::s4u::Mailbox* mailbox_;
-  std::unordered_map<int, Connection*> connected_peers;
+  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.
+  std::vector<short> pieces_count;              // 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.
@@ -51,7 +49,6 @@ public:
   explicit Peer(std::vector<std::string> args);
   Peer(const Peer&) = delete;
   Peer& operator=(const Peer&) = delete;
-  ~Peer();
   void operator()();
 
   std::string getStatus();
index 4e41ae8..a8a3446 100644 (file)
@@ -17,8 +17,8 @@ Tracker::Tracker(std::vector<std::string> args)
   // 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());
+  } catch (const std::invalid_argument&) {
+    throw std::invalid_argument("Invalid deadline:" + args[1]);
   }
   xbt_assert(deadline > 0, "Wrong deadline supplied");
 
@@ -56,7 +56,7 @@ void Tracker::operator()()
         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());
+        } while (ta->getPeers().find(*next_peer) != ta->getPeers().end());
         ta->addPeer(*next_peer);
         tried++;
       }
index 4755919..d4af5d6 100644 (file)
@@ -17,21 +17,17 @@ class TrackerQuery {
 public:
   explicit TrackerQuery(int peer_id, simgrid::s4u::Mailbox* return_mailbox)
       : peer_id(peer_id), return_mailbox(return_mailbox){};
-  ~TrackerQuery() = default;
   int getPeerId() { return peer_id; }
   simgrid::s4u::Mailbox* 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.
+  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& operator=(const TrackerAnswer&) = delete;
-  ~TrackerAnswer() { delete peers; };
-  void addPeer(int peer) { peers->insert(peer); }
-  std::set<int>* getPeers() { return peers; }
+  explicit TrackerAnswer(int /*interval*/) /*: interval(interval)*/ {}
+  void addPeer(int peer) { peers.insert(peer); }
+  const std::set<int>& getPeers() { return peers; }
 };
 
 class Tracker {
index db14255..c025625 100644 (file)
@@ -4,7 +4,7 @@ p Testing the chainsend S4U implementation
 
 ! timeout 60
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-chainsend ${platfdir}/cluster_backbone.xml "--log=root.fmt:[%12.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-app-chainsend ${platfdir}/cluster_backbone.xml "--log=root.fmt:[%12.6r]%e(%i:%P@%h)%e%m%n"
 > [    2.214423] (2:peer@node-1.simgrid.org) ### 2.214423 16777216 bytes (Avg 7.225360 MB/s); copy finished (simulated).
 > [    2.222796] (3:peer@node-2.simgrid.org) ### 2.222796 16777216 bytes (Avg 7.198141 MB/s); copy finished (simulated).
 > [    2.231170] (4:peer@node-3.simgrid.org) ### 2.231170 16777216 bytes (Avg 7.171127 MB/s); copy finished (simulated).
index 4abff13..a1e38ca 100644 (file)
@@ -3,7 +3,7 @@
 p Testing a simple master/workers example application
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-masterworkers-class$EXEEXT ${platfdir}/small_platform.xml s4u-app-masterworkers_d.xml --trace "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-app-masterworkers-class ${platfdir}/small_platform.xml s4u-app-masterworkers_d.xml --trace "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [  0.000000] (master@Tremblay) Got 5 workers and 20 tasks to process
 > [  0.000000] (master@Tremblay) Sending task 0 of 20 to mailbox 'Tremblay'
 > [  0.002265] (master@Tremblay) Sending task 1 of 20 to mailbox 'Jupiter'
@@ -34,7 +34,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-app-masterworkers-class$EXEEXT ${platfdir}/sma
 > [  5.133855] (worker@Bourassa) Exiting now.
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-masterworkers-fun$EXEEXT ${platfdir}/small_platform.xml s4u-app-masterworkers_d.xml --trace "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-app-masterworkers-fun ${platfdir}/small_platform.xml s4u-app-masterworkers_d.xml --trace "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [  0.000000] (master@Tremblay) Got 5 workers and 20 tasks to process
 > [  0.000000] (master@Tremblay) Sending task 0 of 20 to mailbox 'Tremblay'
 > [  0.002265] (master@Tremblay) Sending task 1 of 20 to mailbox 'Jupiter'
index 8140c69..8a4042a 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing with default compound
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-app-pingpong ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:pinger@Tremblay) Ping from mailbox Mailbox 1 to mailbox Mailbox 2
 > [  0.000000] (2:ponger@Jupiter) Pong from mailbox Mailbox 2 to mailbox Mailbox 1
 > [  0.019014] (2:ponger@Jupiter) Task received : small communication (latency bound)
@@ -14,7 +14,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${platfdir}/small_platform
 
 p Testing with default compound Full network optimization
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${platfdir}/small_platform.xml "--cfg=network/optim:Full" "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-app-pingpong ${platfdir}/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 from mailbox Mailbox 1 to mailbox Mailbox 2
 > [  0.000000] (2:ponger@Jupiter) Pong from mailbox Mailbox 2 to mailbox Mailbox 1
@@ -27,7 +27,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${platfdir}/small_platform
 
 p Testing the deprecated CM02 network model
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${platfdir}/small_platform.xml --cfg=cpu/model:Cas01 --cfg=network/model:CM02 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-app-pingpong ${platfdir}/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 from mailbox Mailbox 1 to mailbox Mailbox 2
@@ -39,54 +39,9 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${platfdir}/small_platform
 > [145.639041] (1:pinger@Tremblay) Pong time (bandwidth bound): 145.638
 > [145.639041] (0:maestro@) Total simulation time: 145.639
 
-p Testing the surf network Reno fairness model using lagrangian approach
-
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${platfdir}/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'
-> [  0.000000] (1:pinger@Tremblay) Ping from mailbox Mailbox 1 to mailbox Mailbox 2
-> [  0.000000] (2:ponger@Jupiter) Pong from mailbox Mailbox 2 to mailbox Mailbox 1
-> [  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 Reno2 fairness model using lagrangian approach
-
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${platfdir}/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 from mailbox Mailbox 1 to mailbox Mailbox 2
-> [  0.000000] (2:ponger@Jupiter) Pong from mailbox Mailbox 2 to mailbox Mailbox 1
-> [  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 ${platfdir}/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'
-> [  0.000000] (1:pinger@Tremblay) Ping from mailbox Mailbox 1 to mailbox Mailbox 2
-> [  0.000000] (2:ponger@Jupiter) Pong from mailbox Mailbox 2 to mailbox Mailbox 1
-> [  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 constant model
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${platfdir}/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"
+$ ${bindir:=.}/s4u-app-pingpong ${platfdir}/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'
index 7ba0907..e77786d 100644 (file)
@@ -1,10 +1,10 @@
 #!/usr/bin/env tesh
 
-p Testing option --cfg=simix/breakpoint
+p Testing option --cfg=debug/breakpoint
 
 ! expect signal SIGTRAP
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-pingpong$EXEEXT ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=simix/breakpoint:3.1416
-> [  0.000000] (0:maestro@) Configuration change: Set 'simix/breakpoint' to '3.1416'
+$ ${bindir:=.}/s4u-app-pingpong ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=debug/breakpoint:3.1416
+> [  0.000000] (0:maestro@) Configuration change: Set 'debug/breakpoint' to '3.1416'
 > [  0.000000] (1:pinger@Tremblay) Ping from mailbox Mailbox 1 to mailbox Mailbox 2
 > [  0.000000] (2:ponger@Jupiter) Pong from mailbox Mailbox 2 to mailbox Mailbox 1
 > [  0.019014] (2:ponger@Jupiter) Task received : small communication (latency bound)
index a22c51b..6429883 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-token-ring ${platfdir}/routing_cluster.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-app-token-ring ${platfdir}/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 ${platfdir}/routing_cluster.xml
 > [  0.131796] (0@host1) Host "0" received "Token"
 > [  0.131796] (maestro@) Simulation time 0.131796
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-token-ring ${platfdir}/two_peers.xml "--log=root.fmt:[%12.6r]%e(%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-app-token-ring ${platfdir}/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 ${platfdir}/two_peers.xml "--lo
 > [    1.248846] (0@100030591) Host "0" received "Token"
 > [    1.248846] (maestro@) Simulation time 1.24885
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-app-token-ring ${platfdir}/meta_cluster.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-app-token-ring ${platfdir}/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"
index 1736753..d73f2ce 100644 (file)
@@ -23,7 +23,7 @@
 #include <iostream>
 #include <string>
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_async_ready, "Messages specific for this s4u example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_async_ready, "Messages specific for this s4u example");
 
 static int peer(int argc, char** argv)
 {
index 008c23c..d5d2591 100644 (file)
@@ -2,7 +2,7 @@
 
 p Test1 Peer sending and receiving
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-async-ready ${platfdir}/small_platform_fatpipe.xml s4u-async-ready_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-async-ready ${platfdir}/small_platform_fatpipe.xml s4u-async-ready_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:peer@Tremblay) Send 'Message 0 from peer 0' to 'peer-1'
 > [  0.000000] (2:peer@Ruby) Send 'Message 0 from peer 1' to 'peer-0'
 > [  0.000000] (1:peer@Tremblay) Send 'Message 0 from peer 0' to 'peer-2'
index 2898edb..009c9fa 100644 (file)
@@ -16,7 +16,7 @@
 #include <iostream>
 #include <string>
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_async_wait, "Messages specific for this s4u example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_async_wait, "Messages specific for this s4u example");
 
 static int sender(int argc, char** argv)
 {
index 8f9f795..dcdaac0 100644 (file)
@@ -2,7 +2,7 @@
 
 p Test1 Sleep_sender > Sleep_receiver
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-async-wait ${platfdir}/small_platform_fatpipe.xml s4u-async-wait_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-async-wait ${platfdir}/small_platform_fatpipe.xml 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'
index 0b6f83f..f23e55c 100644 (file)
@@ -17,7 +17,7 @@
 #include <iostream>
 #include <string>
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_async_waitall, "Messages specific for this s4u example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_async_waitall, "Messages specific for this s4u example");
 
 class Sender {
   long messages_count;  /* - number of tasks */
index bdec4c9..04168e4 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-async-waitall ${platfdir}/small_platform_fatpipe.xml s4u-async-waitall_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-async-waitall ${platfdir}/small_platform_fatpipe.xml 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
index ca5c085..407b4e5 100644 (file)
@@ -22,7 +22,7 @@
 #include <iostream>
 #include <string>
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_async_waitall, "Messages specific for this msg example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_async_waitall, "Messages specific for this s4u example");
 
 class Sender {
   long messages_count;  /* - number of tasks */
index 27eec6b..5f3dee8 100644 (file)
@@ -3,7 +3,7 @@
 p Testing this_actor->wait_any()
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-async-waitany ${platfdir}/small_platform.xml s4u-async-waitany_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-async-waitany ${platfdir}/small_platform.xml 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
index f741f5a..3397408 100644 (file)
@@ -15,7 +15,7 @@
 #include <iostream>
 #include <string>
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_async_wait, "Messages specific for this s4u example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_async_waituntil, "Messages specific for this s4u example");
 
 static int sender(int argc, char** argv)
 {
index 6d77ade..c3f2bc5 100644 (file)
@@ -2,7 +2,7 @@
 
 p Test1 Sleep_sender > Sleep_receiver
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-async-waituntil ${platfdir}/small_platform_fatpipe.xml s4u-async-waituntil_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-async-waituntil ${platfdir}/small_platform_fatpipe.xml s4u-async-waituntil_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'
index 0911d20..31ddb72 100644 (file)
@@ -1,5 +1,5 @@
 ! output sort
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-cloud-capping ${platfdir}/small_platform.xml --log=no_loc "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-cloud-capping ${platfdir}/small_platform.xml --log=no_loc "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:master_@Fafard) # 1. Put a single task on a PM. 
 > [  0.000000] (1:master_@Fafard) ### Test: with/without task set_bound
 > [  0.000000] (1:master_@Fafard) ### Test: no bound for Task1@Fafard
index f18aa46..02628ea 100644 (file)
@@ -1,4 +1,4 @@
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-cloud-migration ${platfdir}/small_platform.xml --log=no_loc "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-cloud-migration ${platfdir}/small_platform.xml --log=no_loc "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:master_@Fafard) Test: Migrate a VM with 1000 Mbytes RAM
 > [132.765801] (1:master_@Fafard) VM0 migrated: Fafard->Tremblay in 132.766 s
 > [132.765801] (1:master_@Fafard) Test: Migrate a VM with 100 Mbytes RAM
index 87e6c25..6b21017 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing a vm with two successive tasks
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-cloud-simple$EXEEXT --log=no_loc ${platfdir:=.}/small_platform.xml
+$ ${bindir:=.}/s4u-cloud-simple --log=no_loc ${platfdir:=.}/small_platform.xml
 > [Fafard:master_:(1) 0.000000] [s4u_test/INFO] ## Test 1 (started): check computation on normal PMs
 > [Fafard:master_:(1) 0.000000] [s4u_test/INFO] ### Put a task on a PM
 > [Fafard:compute:(2) 0.013107] [s4u_test/INFO] Fafard:compute task executed 0.0131068
index f69461b..9ad0c03 100644 (file)
@@ -55,11 +55,7 @@ Node::Node(std::vector<std::string> args)
   stream             = simgrid::s4u::this_actor::get_host()->extension<HostChord>()->getStream();
   mailbox_           = simgrid::s4u::Mailbox::by_name(std::to_string(id_));
   next_finger_to_fix = 0;
-  fingers_           = new int[nb_bits];
-
-  for (int i = 0; i < nb_bits; i++) {
-    fingers_[i] = id_;
-  }
+  fingers_.resize(nb_bits, id_);
 
   if (args.size() == 3) { // first ring
     deadline_   = std::stod(args[2]);
@@ -74,10 +70,6 @@ Node::Node(std::vector<std::string> args)
   }
 }
 
-Node::~Node()
-{
-  delete[] fingers_;
-}
 /* Makes the current node join the ring, knowing the id of a node already in the ring
  *
  * @param known_id id of a node already in the ring
@@ -118,7 +110,7 @@ void Node::notifyAndQuit()
   XBT_DEBUG("Sending a 'PREDECESSOR_LEAVING' to my successor %d", fingers_[0]);
   try {
     simgrid::s4u::Mailbox::by_name(std::to_string(fingers_[0]))->put(pred_msg, 10, timeout);
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutException&) {
     XBT_DEBUG("Timeout expired when sending a 'PREDECESSOR_LEAVING' to my successor %d", fingers_[0]);
     delete pred_msg;
   }
@@ -132,7 +124,7 @@ void Node::notifyAndQuit()
 
     try {
       simgrid::s4u::Mailbox::by_name(std::to_string(pred_id_))->put(succ_msg, 10, timeout);
-    } catch (simgrid::TimeoutError& e) {
+    } catch (const simgrid::TimeoutException&) {
       XBT_DEBUG("Timeout expired when sending a 'SUCCESSOR_LEAVING' to my predecessor %d", pred_id_);
       delete succ_msg;
     }
@@ -222,7 +214,7 @@ void Node::checkPredecessor()
   XBT_DEBUG("Sending a 'Predecessor Alive' request to my predecessor %d", pred_id_);
   try {
     mailbox->put(message, 10, timeout);
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutException&) {
     XBT_DEBUG("Failed to send the 'Predecessor Alive' request to %d", pred_id_);
     delete message;
     return;
@@ -237,7 +229,7 @@ void Node::checkPredecessor()
     comm->wait_for(timeout);
     XBT_DEBUG("Received the answer to my 'Predecessor Alive': my predecessor %d is alive", pred_id_);
     delete static_cast<ChordMessage*>(data);
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutException&) {
     XBT_DEBUG("Failed to receive the answer to my 'Predecessor Alive' request");
     pred_id_ = -1;
   }
@@ -263,7 +255,7 @@ int Node::remoteGetPredecessor(int ask_to)
   XBT_DEBUG("Sending a 'Get Predecessor' request to %d", ask_to);
   try {
     mailbox->put(message, 10, timeout);
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutException&) {
     XBT_DEBUG("Failed to send the 'Get Predecessor' request to %d", ask_to);
     delete message;
     return predecessor_id;
@@ -281,7 +273,7 @@ int Node::remoteGetPredecessor(int ask_to)
               answer->answer_id);
     predecessor_id = answer->answer_id;
     delete answer;
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutException&) {
     XBT_DEBUG("Failed to receive the answer to my 'Get Predecessor' request");
     delete static_cast<ChordMessage*>(data);
   }
@@ -335,7 +327,7 @@ int Node::remoteFindSuccessor(int ask_to, int id)
   XBT_DEBUG("Sending a 'Find Successor' request to %d for id %d", ask_to, id);
   try {
     mailbox->put(message, 10, timeout);
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutException&) {
     XBT_DEBUG("Failed to send the 'Find Successor' request to %d for id %d", ask_to, id_);
     delete message;
     return successor;
@@ -351,7 +343,7 @@ int Node::remoteFindSuccessor(int ask_to, int id)
               answer->request_id, id_, answer->answer_id);
     successor = answer->answer_id;
     delete answer;
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutException&) {
     XBT_DEBUG("Failed to receive the answer to my 'Find Successor' request");
     delete static_cast<ChordMessage*>(data);
   }
index 0b01f29..ca06eb4 100644 (file)
@@ -15,8 +15,9 @@ int timeout  = 50;
 int main(int argc, char* 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",
+  xbt_assert(argc > 2,
+             "Usage: %s [-nb_bits=n] [-timeout=t] platform_file deployment_file\n"
+             "\tExample: %s ../platforms/cluster_backbone.xml ./s4u-dht-chord_d.xml\n",
              argv[0], argv[0]);
   char** options = &argv[1];
   while (not strncmp(options[0], "-", 1)) {
index ba0ac1f..12b6921 100644 (file)
@@ -22,7 +22,8 @@ extern int nb_keys;
 extern int timeout;
 
 class HostChord {
-  RngStream stream_;
+  std::unique_ptr<std::remove_pointer<RngStream>::type, std::function<void(RngStream)>> stream_ = {
+      nullptr, [](RngStream stream) { RngStream_DeleteStream(&stream); }};
   simgrid::s4u::Host* host = nullptr;
 
 public:
@@ -31,14 +32,12 @@ public:
   explicit HostChord(simgrid::s4u::Host* ptr) : host(ptr)
   {
     std::string descr = std::string("RngSream<") + host->get_cname() + ">";
-    stream_           = RngStream_CreateStream(descr.c_str());
+    stream_.reset(RngStream_CreateStream(descr.c_str()));
   }
   HostChord(const HostChord&) = delete;
   HostChord& operator=(const HostChord&) = delete;
 
-  ~HostChord() { RngStream_DeleteStream(&stream_); };
-
-  RngStream getStream() { return stream_; };
+  RngStream getStream() { return stream_.get(); };
 };
 
 /* Types of tasks exchanged between nodes. */
@@ -68,8 +67,6 @@ public:
   {
   }
 
-  ~ChordMessage() = default;
-
   static void destroy(void* message);
 };
 
@@ -81,7 +78,7 @@ class Node {
   int id_;                           // my id
   int pred_id_ = -1;                 // predecessor id
   simgrid::s4u::Mailbox* mailbox_;   // my mailbox
-  int* fingers_;                     // finger table,(fingers[0] is my successor)
+  std::vector<int> fingers_;         // finger table,(fingers[0] is my successor)
   int next_finger_to_fix;            // index of the next finger to fix in fix_fingers()
   RngStream stream;
 
@@ -89,7 +86,6 @@ public:
   explicit Node(std::vector<std::string> args);
   Node(const Node&) = delete;
   Node& operator=(const Node&) = delete;
-  ~Node();
   void join(int known_id);
   void leave();
   void notifyAndQuit();
index dab06c1..9e8fe7c 100644 (file)
@@ -3,7 +3,7 @@
 p Testing the Chord implementation with S4U
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-dht-chord$EXEEXT -nb_bits=3 ${platfdir}/cluster_backbone.xml s4u-dht-chord_d.xml --log=s4u_chord.thres:verbose "--log=root.fmt:[%10.5r]%e(%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-dht-chord -nb_bits=3 ${platfdir}/cluster_backbone.xml 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.simgrid.org) My finger table:
 > [   0.00000] (node@node-0.simgrid.org) Start | Succ
 > [   0.00000] (node@node-0.simgrid.org)    3  |  42
index 4370d15..b92c7a6 100644 (file)
@@ -3,7 +3,7 @@
 p Testing the Kademlia implementation with S4U
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-dht-kademlia ${platfdir}/cluster_backbone.xml ${srcdir:=.}/s4u-dht-kademlia_d.xml "--log=root.fmt:[%10.6r]%e(%02i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-dht-kademlia ${platfdir}/cluster_backbone.xml ${srcdir:=.}/s4u-dht-kademlia_d.xml "--log=root.fmt:[%10.6r]%e(%02i:%P@%h)%e%m%n"
 > [  0.000000] ( 1:node@node-0.simgrid.org) Hi, I'm going to create the network with id 0
 > [  0.000000] ( 2:node@node-1.simgrid.org) Hi, I'm going to join the network with id 1
 > [  0.000000] ( 3:node@node-2.simgrid.org) Hi, I'm going to join the network with id 3
index dfa05d2..91a453d 100644 (file)
       If you want a realistic simulation, you must use values coming from a real benchmark of your platform. 
       -->
 
-    <host id="MyHost1"          speed="100.0Mf,50.0Mf,20.0Mf,                    0f,0f" pstate="0" >
-      <prop id="watt_per_state" value="95.0:200.0,93.0:170.0,90.0:150.0,         120:120,110:110" />
-      <prop id="watt_off"       value="10" />
+    <host id="MyHost1"             speed="100.0Mf,50.0Mf,20.0Mf,                    0f,0f" pstate="0" >
+      <prop id="wattage_per_state" value="95.0:200.0,93.0:170.0,90.0:150.0,         120:120,110:110" />
+      <prop id="wattage_off"       value="10" />
     </host>
-    <host id="MyHost2" speed="100.0Mf" >
-      <prop id="watt_per_state" value="100.0:200.0" />
-      <prop id="watt_off"       value="10" />
+    <host id="MyHost2"             speed="100.0Mf" >
+      <prop id="wattage_per_state" value="100.0:200.0" />
+      <prop id="wattage_off"       value="10" />
     </host>
 
     <link id="link1" bandwidth="100kBps" latency="0"/>
index 9c6a7ad..7a1c301 100644 (file)
@@ -2,7 +2,7 @@
 
 p Modeling the host energy consumption during boot and shutdown
 
-$ ${bindir:=.}/s4u-energy-boot$EXEEXT ${srcdir:=.}/platform_boot.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-energy-boot ${srcdir:=.}/platform_boot.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:Boot Monitor@MyHost2) Initial pstate: 0; Energy dissipated so far:0E+00 J
 > [  0.000000] (1:Boot Monitor@MyHost2) Sleep for 10 seconds
 > [ 10.000000] (1:Boot Monitor@MyHost2) Done sleeping. Current pstate: 0; Energy dissipated so far: 950.00 J
@@ -23,7 +23,7 @@ $ ${bindir:=.}/s4u-energy-boot$EXEEXT ${srcdir:=.}/platform_boot.xml "--log=root
 > [177.000000] (0:maestro@) Energy consumption of host MyHost1: 19820.000000 Joules
 > [177.000000] (0:maestro@) Energy consumption of host MyHost2: 17700.000000 Joules
 
-$ ${bindir:=.}/s4u-energy-boot$EXEEXT ${srcdir:=.}/platform_boot.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=host/model:ptask_L07
+$ ${bindir:=.}/s4u-energy-boot ${srcdir:=.}/platform_boot.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=host/model:ptask_L07
 > [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'ptask_L07'
 > [  0.000000] (0:maestro@) Switching to the L07 model to handle parallel tasks.
 > [  0.000000] (1:Boot Monitor@MyHost2) Initial pstate: 0; Energy dissipated so far:0E+00 J
diff --git a/examples/s4u/energy-exec-ptask/s4u-energy-exec-ptask.cpp b/examples/s4u/energy-exec-ptask/s4u-energy-exec-ptask.cpp
new file mode 100644 (file)
index 0000000..dfba87a
--- /dev/null
@@ -0,0 +1,148 @@
+/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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 "simgrid/plugins/energy.h"
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example");
+
+static void runner()
+{
+  simgrid::s4u::Host* host1 = simgrid::s4u::Host::by_name("MyHost1");
+  simgrid::s4u::Host* host2 = simgrid::s4u::Host::by_name("MyHost2");
+  std::vector<simgrid::s4u::Host*> hosts{host1, host2};
+
+  double old_energy_host1 = sg_host_get_consumed_energy(host1);
+  double old_energy_host2 = sg_host_get_consumed_energy(host2);
+
+  XBT_INFO("[%s] Energetic profile: %s", host1->get_cname(), host1->get_property("wattage_per_state"));
+  XBT_INFO("[%s] Initial peak speed=%.0E flop/s; Total energy dissipated =%.0E J", host1->get_cname(), host1->get_speed(),
+           old_energy_host1);
+  XBT_INFO("[%s] Energetic profile: %s", host2->get_cname(), host2->get_property("wattage_per_state"));
+  XBT_INFO("[%s] Initial peak speed=%.0E flop/s; Total energy dissipated =%.0E J", host2->get_cname(), host2->get_speed(),
+           old_energy_host2);
+
+  double start = simgrid::s4u::Engine::get_clock();
+  XBT_INFO("Sleep for 10 seconds");
+  simgrid::s4u::this_actor::sleep_for(10);
+
+  double new_energy_host1 = sg_host_get_consumed_energy(host1);
+  double new_energy_host2 = sg_host_get_consumed_energy(host2);
+  XBT_INFO("Done sleeping (duration: %.2f s).\n"
+           "[%s] Current peak speed=%.0E; Energy dissipated during this step=%.2f J; Total energy dissipated=%.2f J\n"
+           "[%s] Current peak speed=%.0E; Energy dissipated during this step=%.2f J; Total energy dissipated=%.2f J\n",
+           simgrid::s4u::Engine::get_clock() - start,
+           host1->get_cname(), host1->get_speed(), (new_energy_host1 - old_energy_host1), sg_host_get_consumed_energy(host1),
+           host2->get_cname(), host2->get_speed(), (new_energy_host2 - old_energy_host2), sg_host_get_consumed_energy(host2));
+
+  old_energy_host1 = new_energy_host1;
+  old_energy_host2 = new_energy_host2;
+
+
+  // ========= Execute something =========
+  start             = simgrid::s4u::Engine::get_clock();
+  double flopAmount = 1E9;
+  std::vector<double> cpu_amounts{flopAmount, flopAmount};
+  std::vector<double> com_amounts{0, 0, 0, 0};
+  XBT_INFO("Run a task of %.0E flops on two hosts", flopAmount);
+  simgrid::s4u::this_actor::parallel_execute(hosts, cpu_amounts, com_amounts);
+
+  new_energy_host1 = sg_host_get_consumed_energy(host1);
+  new_energy_host2 = sg_host_get_consumed_energy(host2);
+  XBT_INFO("Task done (duration: %.2f s).\n"
+           "[%s] Current peak speed=%.0E flop/s; Energy dissipated during this step=%.2f J; Total energy dissipated=%.0f J\n"
+           "[%s] Current peak speed=%.0E flop/s; Energy dissipated during this step=%.2f J; Total energy dissipated=%.0f J\n",
+           simgrid::s4u::Engine::get_clock() - start,
+           host1->get_cname(), host1->get_speed(), (new_energy_host1 - old_energy_host1), sg_host_get_consumed_energy(host1),
+           host2->get_cname(), host2->get_speed(), (new_energy_host2 - old_energy_host2), sg_host_get_consumed_energy(host2));
+
+  old_energy_host1 = new_energy_host1;
+  old_energy_host2 = new_energy_host2;
+
+
+  // ========= Change power peak =========
+  int pstate = 2;
+  host1->set_pstate(pstate);
+  host2->set_pstate(pstate);
+  XBT_INFO("========= Requesting pstate %d for both hosts (speed should be of %.0E flop/s and is of %.0E flop/s)", pstate,
+           host1->get_pstate_speed(pstate), host1->get_speed());
+
+
+  // ========= Run another ptask =========
+  start             = simgrid::s4u::Engine::get_clock();
+  std::vector<double> cpu_amounts2{flopAmount, flopAmount};
+  std::vector<double> com_amounts2{0, 0, 0, 0};
+  XBT_INFO("Run a task of %.0E flops on %s and %.0E flops on %s.", flopAmount, host1->get_cname(), flopAmount, host2->get_cname());
+  simgrid::s4u::this_actor::parallel_execute(hosts, cpu_amounts2, com_amounts2);
+
+  new_energy_host1 = sg_host_get_consumed_energy(host1);
+  new_energy_host2 = sg_host_get_consumed_energy(host2);
+  XBT_INFO("Task done (duration: %.2f s).\n"
+           "[%s] Current peak speed=%.0E flop/s; Energy dissipated during this step=%.2f J; Total energy dissipated=%.0f J\n"
+           "[%s] Current peak speed=%.0E flop/s; Energy dissipated during this step=%.2f J; Total energy dissipated=%.0f J\n",
+           simgrid::s4u::Engine::get_clock() - start,
+           host1->get_cname(), host1->get_speed(), (new_energy_host1 - old_energy_host1), sg_host_get_consumed_energy(host1),
+           host2->get_cname(), host2->get_speed(), (new_energy_host2 - old_energy_host2), sg_host_get_consumed_energy(host2));
+
+  old_energy_host1 = new_energy_host1;
+  old_energy_host2 = new_energy_host2;
+
+
+  // ========= A new ptask with computation and communication =========
+  start             = simgrid::s4u::Engine::get_clock();
+  double comAmount = 1E7;
+  std::vector<double> cpu_amounts3{flopAmount, flopAmount};
+  std::vector<double> com_amounts3{0, comAmount, comAmount, 0};
+  XBT_INFO("Run a task with computation and communication on two hosts.");
+  simgrid::s4u::this_actor::parallel_execute(hosts, cpu_amounts3, com_amounts3);
+
+  new_energy_host1 = sg_host_get_consumed_energy(host1);
+  new_energy_host2 = sg_host_get_consumed_energy(host2);
+  XBT_INFO("Task done (duration: %.2f s).\n"
+           "[%s] Current peak speed=%.0E flop/s; Energy dissipated during this step=%.2f J; Total energy dissipated=%.0f J\n"
+           "[%s] Current peak speed=%.0E flop/s; Energy dissipated during this step=%.2f J; Total energy dissipated=%.0f J\n",
+           simgrid::s4u::Engine::get_clock() - start,
+           host1->get_cname(), host1->get_speed(), (new_energy_host1 - old_energy_host1), sg_host_get_consumed_energy(host1),
+           host2->get_cname(), host2->get_speed(), (new_energy_host2 - old_energy_host2), sg_host_get_consumed_energy(host2));
+
+  old_energy_host1 = new_energy_host1;
+  old_energy_host2 = new_energy_host2;
+
+
+  // ========= A new ptask with communication only =========
+  start             = simgrid::s4u::Engine::get_clock();
+  std::vector<double> cpu_amounts4{0, 0};
+  std::vector<double> com_amounts4{0, comAmount, comAmount, 0};
+  XBT_INFO("Run a task with only communication on two hosts.");
+  simgrid::s4u::this_actor::parallel_execute(hosts, cpu_amounts4, com_amounts4);
+
+  new_energy_host1 = sg_host_get_consumed_energy(host1);
+  new_energy_host2 = sg_host_get_consumed_energy(host2);
+  XBT_INFO("Task done (duration: %.2f s).\n"
+           "[%s] Current peak speed=%.0E flop/s; Energy dissipated during this step=%.2f J; Total energy dissipated=%.0f J\n"
+           "[%s] Current peak speed=%.0E flop/s; Energy dissipated during this step=%.2f J; Total energy dissipated=%.0f J\n",
+           simgrid::s4u::Engine::get_clock() - start,
+           host1->get_cname(), host1->get_speed(), (new_energy_host1 - old_energy_host1), sg_host_get_consumed_energy(host1),
+           host2->get_cname(), host2->get_speed(), (new_energy_host2 - old_energy_host2), sg_host_get_consumed_energy(host2));
+
+  XBT_INFO("Now is time to quit!");
+}
+
+int main(int argc, char* argv[])
+{
+  sg_host_energy_plugin_init();
+  simgrid::s4u::Engine e(&argc, argv);
+  e.set_config("host/model:ptask_L07");
+  //xbt_log_control_set("surf_energy.thresh:debug");
+
+  xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s ../platforms/energy_platform.xml\n", argv[0], argv[0]);
+
+  e.load_platform(argv[1]);
+  simgrid::s4u::Actor::create("energy_ptask_test", simgrid::s4u::Host::by_name("MyHost1"), runner);
+
+  e.run();
+  XBT_INFO("End of simulation.");
+  return 0;
+}
diff --git a/examples/s4u/energy-exec-ptask/s4u-energy-exec-ptask.tesh b/examples/s4u/energy-exec-ptask/s4u-energy-exec-ptask.tesh
new file mode 100644 (file)
index 0000000..376b3e8
--- /dev/null
@@ -0,0 +1,83 @@
+#!/usr/bin/env tesh
+
+p Testing the mechanism for computing host energy consumption
+
+$ ${bindir:=.}/s4u-energy-exec-ptask ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'ptask_L07'
+> [  0.000000] (0:maestro@) Switching to the L07 model to handle parallel tasks.
+> [  0.000000] (1:energy_ptask_test@MyHost1) [MyHost1] Energetic profile: 100.0:93.33333333333333:200.0, 93.0:90.0:170.0, 90.0:90.0:150.0
+> [  0.000000] (1:energy_ptask_test@MyHost1) [MyHost1] Initial peak speed=1E+08 flop/s; Total energy dissipated =0E+00 J
+> [  0.000000] (1:energy_ptask_test@MyHost1) [MyHost2] Energetic profile: 100.0:200.0:200.0, 93.0:170.0:170.0, 90.0:150.0:150.0
+> [  0.000000] (1:energy_ptask_test@MyHost1) [MyHost2] Initial peak speed=1E+08 flop/s; Total energy dissipated =0E+00 J
+> [  0.000000] (1:energy_ptask_test@MyHost1) Sleep for 10 seconds
+> [ 10.000000] (1:energy_ptask_test@MyHost1) Done sleeping (duration: 10.00 s).
+> [MyHost1] Current peak speed=1E+08; Energy dissipated during this step=1000.00 J; Total energy dissipated=1000.00 J
+> [MyHost2] Current peak speed=1E+08; Energy dissipated during this step=1000.00 J; Total energy dissipated=1000.00 J
+>
+> [ 10.000000] (1:energy_ptask_test@MyHost1) Run a task of 1E+09 flops on two hosts
+> [ 20.000000] (1:energy_ptask_test@MyHost1) Task done (duration: 10.00 s).
+> [MyHost1] Current peak speed=1E+08 flop/s; Energy dissipated during this step=1200.00 J; Total energy dissipated=2200 J
+> [MyHost2] Current peak speed=1E+08 flop/s; Energy dissipated during this step=2000.00 J; Total energy dissipated=3000 J
+>
+> [ 20.000000] (1:energy_ptask_test@MyHost1) ========= Requesting pstate 2 for both hosts (speed should be of 2E+07 flop/s and is of 2E+07 flop/s)
+> [ 20.000000] (1:energy_ptask_test@MyHost1) Run a task of 1E+09 flops on MyHost1 and 1E+09 flops on MyHost2.
+> [ 70.000000] (1:energy_ptask_test@MyHost1) Task done (duration: 50.00 s).
+> [MyHost1] Current peak speed=2E+07 flop/s; Energy dissipated during this step=5250.00 J; Total energy dissipated=7450 J
+> [MyHost2] Current peak speed=2E+07 flop/s; Energy dissipated during this step=7500.00 J; Total energy dissipated=10500 J
+>
+> [ 70.000000] (1:energy_ptask_test@MyHost1) Run a task with computation and communication on two hosts.
+> [270.000000] (1:energy_ptask_test@MyHost1) Task done (duration: 200.00 s).
+> [MyHost1] Current peak speed=2E+07 flop/s; Energy dissipated during this step=18750.00 J; Total energy dissipated=26200 J
+> [MyHost2] Current peak speed=2E+07 flop/s; Energy dissipated during this step=30000.00 J; Total energy dissipated=40500 J
+>
+> [270.000000] (1:energy_ptask_test@MyHost1) Run a task with only communication on two hosts.
+> [470.000000] (1:energy_ptask_test@MyHost1) Task done (duration: 200.00 s).
+> [MyHost1] Current peak speed=2E+07 flop/s; Energy dissipated during this step=18000.00 J; Total energy dissipated=44200 J
+> [MyHost2] Current peak speed=2E+07 flop/s; Energy dissipated during this step=18000.00 J; Total energy dissipated=58500 J
+>
+> [470.000000] (1:energy_ptask_test@MyHost1) Now is time to quit!
+> [470.000000] (0:maestro@) Total energy consumption: 149700.000000 Joules (used hosts: 102700.000000 Joules; unused/idle hosts: 47000.000000)
+> [470.000000] (0:maestro@) End of simulation.
+> [470.000000] (0:maestro@) Energy consumption of host MyHost1: 44200.000000 Joules
+> [470.000000] (0:maestro@) Energy consumption of host MyHost2: 58500.000000 Joules
+> [470.000000] (0:maestro@) Energy consumption of host MyHost3: 47000.000000 Joules
+
+
+$ ${bindir:=.}/s4u-energy-exec-ptask ${platfdir}/energy_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'ptask_L07'
+> [  0.000000] (0:maestro@) Switching to the L07 model to handle parallel tasks.
+> [  0.000000] (1:energy_ptask_test@MyHost1) [MyHost1] Energetic profile: 100.0:93.33333333333333:200.0, 93.0:90.0:170.0, 90.0:90.0:150.0
+> [  0.000000] (1:energy_ptask_test@MyHost1) [MyHost1] Initial peak speed=1E+08 flop/s; Total energy dissipated =0E+00 J
+> [  0.000000] (1:energy_ptask_test@MyHost1) [MyHost2] Energetic profile: 100.0:93.33333333333333:200.0, 93.0:90.0:170.0, 90.0:90.0:150.0
+> [  0.000000] (1:energy_ptask_test@MyHost1) [MyHost2] Initial peak speed=1E+08 flop/s; Total energy dissipated =0E+00 J
+> [  0.000000] (1:energy_ptask_test@MyHost1) Sleep for 10 seconds
+> [ 10.000000] (1:energy_ptask_test@MyHost1) Done sleeping (duration: 10.00 s).
+> [MyHost1] Current peak speed=1E+08; Energy dissipated during this step=1000.00 J; Total energy dissipated=1000.00 J
+> [MyHost2] Current peak speed=1E+08; Energy dissipated during this step=1000.00 J; Total energy dissipated=1000.00 J
+>
+> [ 10.000000] (1:energy_ptask_test@MyHost1) Run a task of 1E+09 flops on two hosts
+> [ 20.000000] (1:energy_ptask_test@MyHost1) Task done (duration: 10.00 s).
+> [MyHost1] Current peak speed=1E+08 flop/s; Energy dissipated during this step=1200.00 J; Total energy dissipated=2200 J
+> [MyHost2] Current peak speed=1E+08 flop/s; Energy dissipated during this step=1200.00 J; Total energy dissipated=2200 J
+>
+> [ 20.000000] (1:energy_ptask_test@MyHost1) ========= Requesting pstate 2 for both hosts (speed should be of 2E+07 flop/s and is of 2E+07 flop/s)
+> [ 20.000000] (1:energy_ptask_test@MyHost1) Run a task of 1E+09 flops on MyHost1 and 1E+09 flops on MyHost2.
+> [ 70.000000] (1:energy_ptask_test@MyHost1) Task done (duration: 50.00 s).
+> [MyHost1] Current peak speed=2E+07 flop/s; Energy dissipated during this step=5250.00 J; Total energy dissipated=7450 J
+> [MyHost2] Current peak speed=2E+07 flop/s; Energy dissipated during this step=5250.00 J; Total energy dissipated=7450 J
+>
+> [ 70.000000] (1:energy_ptask_test@MyHost1) Run a task with computation and communication on two hosts.
+> [120.000600] (1:energy_ptask_test@MyHost1) Task done (duration: 50.00 s).
+> [MyHost1] Current peak speed=2E+07 flop/s; Energy dissipated during this step=5250.06 J; Total energy dissipated=12700 J
+> [MyHost2] Current peak speed=2E+07 flop/s; Energy dissipated during this step=5250.06 J; Total energy dissipated=12700 J
+>
+> [120.000600] (1:energy_ptask_test@MyHost1) Run a task with only communication on two hosts.
+> [120.081200] (1:energy_ptask_test@MyHost1) Task done (duration: 0.08 s).
+> [MyHost1] Current peak speed=2E+07 flop/s; Energy dissipated during this step=7.25 J; Total energy dissipated=12707 J
+> [MyHost2] Current peak speed=2E+07 flop/s; Energy dissipated during this step=7.25 J; Total energy dissipated=12707 J
+>
+> [120.081200] (1:energy_ptask_test@MyHost1) Now is time to quit!
+> [120.081200] (0:maestro@) Total energy consumption: 25414.634000 Joules (used hosts: 25414.634000 Joules; unused/idle hosts: 0.000000)
+> [120.081200] (0:maestro@) End of simulation.
+> [120.081200] (0:maestro@) Energy consumption of host MyHost1: 12707.317000 Joules
+> [120.081200] (0:maestro@) Energy consumption of host MyHost2: 12707.317000 Joules
index aae8e41..8f79846 100644 (file)
@@ -13,7 +13,7 @@ static void dvfs()
   simgrid::s4u::Host* host1 = simgrid::s4u::Host::by_name("MyHost1");
   simgrid::s4u::Host* host2 = simgrid::s4u::Host::by_name("MyHost2");
 
-  XBT_INFO("Energetic profile: %s", host1->get_property("watt_per_state"));
+  XBT_INFO("Energetic profile: %s", host1->get_property("wattage_per_state"));
   XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J", host1->get_speed(),
            sg_host_get_consumed_energy(host1));
 
@@ -68,7 +68,7 @@ int main(int argc, char* argv[])
   sg_host_energy_plugin_init();
   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]);
+  xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s ../platforms/energy_platform.xml\n", argv[0], argv[0]);
 
   e.load_platform(argv[1]);
   simgrid::s4u::Actor::create("dvfs_test", simgrid::s4u::Host::by_name("MyHost1"), dvfs);
index ab583ae..7568254 100644 (file)
@@ -2,13 +2,13 @@
 
 p Testing the mechanism for computing host energy consumption
 
-$ ${bindir:=.}/s4u-energy-exec$EXEEXT ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (1:dvfs_test@MyHost1) Energetic profile: 100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0
+$ ${bindir:=.}/s4u-energy-exec ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (1:dvfs_test@MyHost1) Energetic profile: 100.0:93.33333333333333:200.0, 93.0:90.0:170.0, 90.0:90.0:150.0
 > [  0.000000] (1:dvfs_test@MyHost1) Initial peak speed=1E+08 flop/s; Energy dissipated =0E+00 J
 > [  0.000000] (1:dvfs_test@MyHost1) Sleep for 10 seconds
 > [ 10.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=1E+08; Energy dissipated=1000.00 J
 > [ 10.000000] (1:dvfs_test@MyHost1) Run a task of 1E+08 flops
-> [ 11.000000] (1:dvfs_test@MyHost1) Task done (duration: 1.00 s). Current peak speed=1E+08 flop/s; Current consumption: from 120W to 200W depending on load; Energy dissipated=1120 J
+> [ 11.000000] (1:dvfs_test@MyHost1) Task done (duration: 1.00 s). Current peak speed=1E+08 flop/s; Current consumption: from 93W to 200W depending on load; Energy dissipated=1120 J
 > [ 11.000000] (1:dvfs_test@MyHost1) ========= Requesting pstate 2 (speed should be of 2E+07 flop/s and is of 2E+07 flop/s)
 > [ 11.000000] (1:dvfs_test@MyHost1) Run a task of 1E+08 flops
 > [ 16.000000] (1:dvfs_test@MyHost1) Task done (duration: 5.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=1645 J
@@ -22,15 +22,15 @@ $ ${bindir:=.}/s4u-energy-exec$EXEEXT ${platfdir}/energy_platform.xml "--log=roo
 > [ 30.000000] (0:maestro@) Energy consumption of host MyHost2: 2100.000000 Joules
 > [ 30.000000] (0:maestro@) Energy consumption of host MyHost3: 3000.000000 Joules
 
-$ ${bindir:=.}/s4u-energy-exec$EXEEXT ${platfdir}/energy_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=host/model:ptask_L07
+$ ${bindir:=.}/s4u-energy-exec ${platfdir}/energy_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=host/model:ptask_L07
 > [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'ptask_L07'
 > [  0.000000] (0:maestro@) Switching to the L07 model to handle parallel tasks.
-> [  0.000000] (1:dvfs_test@MyHost1) Energetic profile: 100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0
+> [  0.000000] (1:dvfs_test@MyHost1) Energetic profile: 100.0:93.33333333333333:200.0, 93.0:90.0:170.0, 90.0:90.0:150.0
 > [  0.000000] (1:dvfs_test@MyHost1) Initial peak speed=1E+08 flop/s; Energy dissipated =0E+00 J
 > [  0.000000] (1:dvfs_test@MyHost1) Sleep for 10 seconds
 > [ 10.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=1E+08; Energy dissipated=1000.00 J
 > [ 10.000000] (1:dvfs_test@MyHost1) Run a task of 1E+08 flops
-> [ 11.000000] (1:dvfs_test@MyHost1) Task done (duration: 1.00 s). Current peak speed=1E+08 flop/s; Current consumption: from 120W to 200W depending on load; Energy dissipated=1120 J
+> [ 11.000000] (1:dvfs_test@MyHost1) Task done (duration: 1.00 s). Current peak speed=1E+08 flop/s; Current consumption: from 93W to 200W depending on load; Energy dissipated=1120 J
 > [ 11.000000] (1:dvfs_test@MyHost1) ========= Requesting pstate 2 (speed should be of 2E+07 flop/s and is of 2E+07 flop/s)
 > [ 11.000000] (1:dvfs_test@MyHost1) Run a task of 1E+08 flops
 > [ 16.000000] (1:dvfs_test@MyHost1) Task done (duration: 5.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=1645 J
index 1e1c65d..c3b63c9 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing the mechanism for computing link energy consumption (using CM02 as a network model)
 
-$ ${bindir:=.}/s4u-energy-link$EXEEXT ${platfdir}/energy_platform.xml  "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=network/model:CM02 --cfg=network/crosstraffic:no
+$ ${bindir:=.}/s4u-energy-link ${platfdir}/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
@@ -15,7 +15,7 @@ $ ${bindir:=.}/s4u-energy-link$EXEEXT ${platfdir}/energy_platform.xml  "--log=ro
 
 p And now test with 500000 bytes
 
-$ ${bindir:=.}/s4u-energy-link$EXEEXT ${platfdir}/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
+$ ${bindir:=.}/s4u-energy-link ${platfdir}/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
index 580a88b..81a8c19 100644 (file)
@@ -55,7 +55,7 @@ int main(int argc, char* argv[])
   sg_host_energy_plugin_init();
   simgrid::s4u::Engine e(&argc, argv);
 
-  xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
+  xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s ../platforms/energy_platform.xml\n", argv[0], argv[0]);
 
   e.load_platform(argv[1]);
 
index 3b8b7ac..10f5dbf 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing the mechanism for computing host energy consumption in case of VMs
 
-$ ${bindir:=.}/s4u-energy-vm$EXEEXT ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-energy-vm ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:dvfs@MyHost1) Creating and starting two VMs
 > [  0.000000] (1:dvfs@MyHost1) Create two tasks on Host1: both inside a VM
 > [  0.000000] (1:dvfs@MyHost1) Create two tasks on Host2: one inside a VM, the other directly on the host
index f798b6c..d03ea86 100644 (file)
@@ -33,7 +33,7 @@ public:
 };
 
 /* This functor is a bit more complex, as it saves the current state when created.
- * Then, it allows to easily retrieve the hosts which frequency changed since the functor creation.
+ * Then, it allows one to easily retrieve the hosts which frequency changed since the functor creation.
  */
 class FrequencyChanged {
   std::map<simgrid::s4u::Host*, int> host_list;
index 07f0d99..157a40d 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env tesh
 
 p Let's filter some hosts...
-$ ${bindir:=.}/s4u-engine-filtering$EXEEXT ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=network/model:CM02 --cfg=network/crosstraffic:no
+$ ${bindir:=.}/s4u-engine-filtering ${platfdir}/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@) Hosts currently registered with this engine: 3
index 7b58519..989c786 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-exec-async$EXEEXT ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-exec-async ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:wait@Fafard) Execute 7.6296e+07 flops, should take 1 second.
 > [  0.000000] (2:monitor@Ginette) Execute 4.8492e+07 flops, should take 1 second.
 > [  0.000000] (3:cancel@Boivin) Execute 9.8095e+07 flops, should take 1 second.
index caee370..ba018ef 100644 (file)
@@ -38,7 +38,7 @@ static void privileged()
 int main(int argc, char* argv[])
 {
   simgrid::s4u::Engine e(&argc, argv);
-  xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
+  xbt_assert(argc > 1, "Usage: %s platform_file\n\tExample: %s ../platforms/small_platform.xml\n", argv[0], argv[0]);
 
   e.load_platform(argv[1]);
 
index 4a45344..b4bed5d 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
 p Start remote processes 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-exec-basic$EXEEXT ${platfdir}/small_platform.xml 
+$ ${bindir:=.}/s4u-exec-basic ${platfdir}/small_platform.xml 
 > [Tremblay:privileged:(2) 0.001500] [s4u_test/INFO] Done.
 > [Tremblay:executor:(1) 0.002000] [s4u_test/INFO] Done.
index 5fde1fd..8ae88ea 100644 (file)
@@ -50,7 +50,7 @@ int main(int argc, char* 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]);
+  xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s ../platforms/energy_platform.xml\n", argv[0], argv[0]);
 
   e.load_platform(argv[1]);
 
index 3b8a702..bbc7cb5 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing the DVFS-related functions
 
-$ ${bindir:=.}/s4u-exec-dvfs$EXEEXT ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-exec-dvfs ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:dvfs_test@MyHost1) Count of Processor states=3
 > [  0.000000] (1:dvfs_test@MyHost1) Current power peak=100000000.000000
 > [  0.000000] (2:dvfs_test@MyHost2) Count of Processor states=3
@@ -21,7 +21,7 @@ $ ${bindir:=.}/s4u-exec-dvfs$EXEEXT ${platfdir}/energy_platform.xml "--log=root.
 > [  6.000000] (2:dvfs_test@MyHost2) Current power peak=20000000.000000
 > [  6.000000] (0:maestro@) Total simulation time: 6.000000e+00
 
-$ ${bindir:=.}/s4u-exec-dvfs$EXEEXT ${platfdir}/energy_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-exec-dvfs ${platfdir}/energy_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:dvfs_test@MyHost1) Count of Processor states=3
 > [  0.000000] (1:dvfs_test@MyHost1) Current power peak=100000000.000000
 > [  0.000000] (2:dvfs_test@MyHost2) Count of Processor states=3
index c3f804b..146753e 100644 (file)
@@ -55,7 +55,7 @@ static void runner()
     simgrid::s4u::this_actor::parallel_execute(hosts, computation_amounts, communication_amounts,
                                                10.0 /* timeout (in seconds)*/);
     xbt_die("Woops, this did not timeout as expected... Please report that bug.");
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutException&) {
     XBT_INFO("Caught the expected timeout exception.");
   }
 
index e8dde98..d7cb538 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ ${bindir:=.}/s4u-exec-ptask$EXEEXT ${platfdir}/energy_platform.xml --cfg=host/model:ptask_L07 --cfg=tracing:yes --cfg=tracing/uncategorized:yes --log=instr_resource.t:debug --log=no_loc "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-exec-ptask ${platfdir}/energy_platform.xml --cfg=host/model:ptask_L07 --cfg=tracing:yes --cfg=tracing/uncategorized:yes --log=instr_resource.t:debug --log=no_loc "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'ptask_L07'
 > [  0.000000] (0:maestro@) Configuration change: Set 'tracing' to 'yes'
 > [  0.000000] (0:maestro@) Configuration change: Set 'tracing/uncategorized' to 'yes'
index 9164daa..6819e40 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env tesh
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-exec-remote$EXEEXT ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-exec-remote ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:test@Fafard) I'm a wizard! I can run a task on the Ginette host from the Fafard one! Look!
 > [  0.000000] (1:test@Fafard) It started. Running 48.492Mf takes exactly one second on Ginette (but not on Fafard).
 > [  0.100000] (1:test@Fafard) Loads in flops/s: Boivin=0; Fafard=0; Ginette=48492000
diff --git a/examples/s4u/exec-waitany/s4u-exec-waitany.cpp b/examples/s4u/exec-waitany/s4u-exec-waitany.cpp
new file mode 100644 (file)
index 0000000..2771a2f
--- /dev/null
@@ -0,0 +1,62 @@
+/* Copyright (c) 2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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>
+#include <string>
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_exec_waitany, "Messages specific for this s4u example");
+
+static void worker(bool with_timeout)
+{
+  /* Vector in which we store all pending executions*/
+  std::vector<simgrid::s4u::ExecPtr> pending_executions;
+
+  for (int i = 0; i < 3; i++) {
+    std::string name = std::string("Exec-") + std::to_string(i);
+    double amount    = (6 * (i % 2) + i + 1) * simgrid::s4u::this_actor::get_host()->get_speed();
+
+    simgrid::s4u::ExecPtr exec = simgrid::s4u::this_actor::exec_init(amount)->set_name(name);
+    pending_executions.push_back(exec);
+    exec->start();
+
+    XBT_INFO("Activity %s has started for %.0f seconds", name.c_str(),
+             amount / simgrid::s4u::this_actor::get_host()->get_speed());
+  }
+
+  /* Now that executions were initiated, wait for their completion, in order of termination.
+   *
+   * This loop waits for first terminating execution with wait_any() and remove it with erase(), until all execs are
+   * terminated.
+   */
+  while (not pending_executions.empty()) {
+    int pos;
+    if (with_timeout)
+      pos = simgrid::s4u::Exec::wait_any_for(&pending_executions, 4);
+    else
+      pos = simgrid::s4u::Exec::wait_any(&pending_executions);
+
+    if (pos < 0) {
+      XBT_INFO("Do not wait any longer for an activity");
+      pending_executions.clear();
+    } else {
+      XBT_INFO("Activity '%s' (at position %d) is complete", pending_executions[pos]->get_cname(), pos);
+      pending_executions.erase(pending_executions.begin() + pos);
+    }
+    XBT_INFO("%zu activities remain pending", pending_executions.size());
+  }
+}
+
+int main(int argc, char* argv[])
+{
+  simgrid::s4u::Engine e(&argc, argv);
+  e.load_platform(argv[1]);
+  simgrid::s4u::Actor::create("worker", simgrid::s4u::Host::by_name("Tremblay"), worker, false);
+  simgrid::s4u::Actor::create("worker_timeout", simgrid::s4u::Host::by_name("Tremblay"), worker, true);
+  e.run();
+
+  return 0;
+}
diff --git a/examples/s4u/exec-waitany/s4u-exec-waitany.tesh b/examples/s4u/exec-waitany/s4u-exec-waitany.tesh
new file mode 100644 (file)
index 0000000..072cab5
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/env tesh
+
+! output sort 19
+$ ${bindir:=.}/s4u-exec-waitany ${platfdir}/multicore_machine.xml "--log=root.fmt:[%10.6r]%e[%14P]%e%m%n"
+> [  0.000000] [        worker] Activity Exec-0 has started for 1 seconds
+> [  0.000000] [worker_timeout] Activity Exec-0 has started for 1 seconds
+> [  0.000000] [        worker] Activity Exec-1 has started for 8 seconds
+> [  0.000000] [worker_timeout] Activity Exec-1 has started for 8 seconds
+> [  0.000000] [        worker] Activity Exec-2 has started for 3 seconds
+> [  0.000000] [worker_timeout] Activity Exec-2 has started for 3 seconds
+> [  1.000000] [worker_timeout] Activity 'Exec-0' (at position 0) is complete
+> [  1.000000] [worker_timeout] 2 activities remain pending
+> [  1.000000] [        worker] Activity 'Exec-0' (at position 0) is complete
+> [  1.000000] [        worker] 2 activities remain pending
+> [  3.000000] [worker_timeout] Activity 'Exec-2' (at position 1) is complete
+> [  3.000000] [worker_timeout] 1 activities remain pending
+> [  3.000000] [        worker] Activity 'Exec-2' (at position 1) is complete
+> [  3.000000] [        worker] 1 activities remain pending
+> [  7.000000] [worker_timeout] Do not wait any longer for an activity
+> [  7.000000] [worker_timeout] 0 activities remain pending
+> [  8.000000] [        worker] Activity 'Exec-1' (at position 0) is complete
+> [  8.000000] [        worker] 0 activities remain pending
index 13304cc..597284f 100644 (file)
@@ -9,10 +9,10 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example")
 
 static void test(sg_size_t size)
 {
-  simgrid::s4u::Storage* storage = simgrid::s4u::Storage::by_name("Disk1");
-  XBT_INFO("Hello! read %llu bytes from Storage %s", size, storage->get_cname());
+  simgrid::s4u::Disk* disk = simgrid::s4u::Host::current()->get_disks().front();
+  XBT_INFO("Hello! read %llu bytes from %s", size, disk->get_cname());
 
-  simgrid::s4u::IoPtr activity = storage->io_init(size, simgrid::s4u::Io::OpType::READ);
+  simgrid::s4u::IoPtr activity = disk->io_init(size, simgrid::s4u::Io::OpType::READ);
   activity->start();
   activity->wait();
 
@@ -21,10 +21,10 @@ static void test(sg_size_t size)
 
 static void test_cancel(sg_size_t size)
 {
-  simgrid::s4u::Storage* storage = simgrid::s4u::Storage::by_name("Disk2");
-  XBT_INFO("Hello! write %llu bytes from Storage %s", size, storage->get_cname());
+  simgrid::s4u::Disk* disk = simgrid::s4u::Host::current()->get_disks().front();
+  XBT_INFO("Hello! write %llu bytes from %s", size, disk->get_cname());
 
-  simgrid::s4u::IoPtr activity = storage->write_async(size);
+  simgrid::s4u::IoPtr activity = disk->write_async(size);
   simgrid::s4u::this_actor::sleep_for(0.5);
   XBT_INFO("I changed my mind, cancel!");
   activity->cancel();
index 3a32add..0ff50eb 100644 (file)
@@ -1,8 +1,8 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-io-async$EXEEXT ${platfdir}/storage/storage.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (1:test@bob) Hello! read 20000000 bytes from Storage Disk1
-> [  0.000000] (2:test_cancel@alice) Hello! write 50000000 bytes from Storage Disk2
+$ ${bindir:=.}/s4u-io-async ${platfdir}/hosts_with_disks.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (1:test@bob) Hello! read 20000000 bytes from Disk1
+> [  0.000000] (2:test_cancel@alice) Hello! write 50000000 bytes from Disk1
 > [  0.200000] (1:test@bob) Goodbye now!
 > [  0.500000] (2:test_cancel@alice) I changed my mind, cancel!
 > [  0.500000] (2:test_cancel@alice) Goodbye now!
diff --git a/examples/s4u/io-disk-raw/s4u-io-disk-raw.cpp b/examples/s4u/io-disk-raw/s4u-io-disk-raw.cpp
new file mode 100644 (file)
index 0000000..2152a10
--- /dev/null
@@ -0,0 +1,57 @@
+/* Copyright (c) 2017-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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 <string>
+#include <unordered_map>
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(disk, "Messages specific for this simulation");
+
+static void host()
+{
+  /* - Display information on the disks mounted by the current host */
+  XBT_INFO("*** Storage info on %s ***", simgrid::s4u::Host::current()->get_cname());
+
+  /* - Retrieve all disks from current host */
+  std::vector<simgrid::s4u::Disk*> const& disk_list = simgrid::s4u::Host::current()->get_disks();
+
+  /* - For each disk mounted on host, display disk name and mount point */
+  for (auto disk : disk_list)
+    XBT_INFO("Disk name: %s", disk->get_cname());
+
+  /* - Write 400,000 bytes on Disk1 */
+  simgrid::s4u::Disk* disk = disk_list.front();
+  sg_size_t write          = disk->write(400000);
+  XBT_INFO("Wrote %llu bytes on '%s'", write, disk->get_cname());
+
+  /*  - Now read 200,000 bytes */
+  sg_size_t read = disk->read(200000);
+  XBT_INFO("Read %llu bytes on '%s'", read, disk->get_cname());
+
+  /* - Attach some user data to disk1 */
+  XBT_INFO("*** Get/set data for storage element: Disk1 ***");
+
+  std::string* data = static_cast<std::string*>(disk->get_data());
+
+  XBT_INFO("Get storage data: '%s'", data ? data->c_str() : "No user data");
+
+  disk->set_data(new std::string("Some user data"));
+  data = static_cast<std::string*>(disk->get_data());
+  XBT_INFO("Set and get data: '%s'", data->c_str());
+  delete data;
+}
+
+int main(int argc, char** argv)
+{
+  simgrid::s4u::Engine e(&argc, argv);
+  e.load_platform(argv[1]);
+
+  simgrid::s4u::Actor::create("", simgrid::s4u::Host::by_name("bob"), host);
+
+  e.run();
+  XBT_INFO("Simulated time: %g", simgrid::s4u::Engine::get_clock());
+
+  return 0;
+}
diff --git a/examples/s4u/io-disk-raw/s4u-io-disk-raw.tesh b/examples/s4u/io-disk-raw/s4u-io-disk-raw.tesh
new file mode 100644 (file)
index 0000000..f1906a8
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/env tesh
+
+$ ${bindir}/s4u-io-disk-raw ${platfdir}/hosts_with_disks.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (1:@bob) *** Storage info on bob ***
+> [  0.000000] (1:@bob) Disk name: Disk1
+> [  0.000000] (1:@bob) Disk name: Disk2
+> [  0.010000] (1:@bob) Wrote 400000 bytes on 'Disk1'
+> [  0.012000] (1:@bob) Read 200000 bytes on 'Disk1'
+> [  0.012000] (1:@bob) *** Get/set data for storage element: Disk1 ***
+> [  0.012000] (1:@bob) Get storage data: 'No user data'
+> [  0.012000] (1:@bob) Set and get data: 'Some user data'
+> [  0.012000] (0:maestro@) Simulated time: 0.012
index b4e6350..3579324 100644 (file)
@@ -17,33 +17,21 @@ static int host(int argc, char* argv[])
   const char* filename = file.get_path();
   XBT_INFO("Opened file '%s'", filename);
   file.dump();
-
-  XBT_INFO("Try to read %llu from '%s'", file.size(), filename);
-  sg_size_t read = file.read(file.size());
-  XBT_INFO("Have read %llu from '%s'. Offset is now at: %llu", read, filename, file.tell());
-  XBT_INFO("Seek back to the beginning of the stream...");
-  file.seek(0, SEEK_SET);
-  XBT_INFO("Offset is now at: %llu", file.tell());
-
-  if (argc > 5) {
-    simgrid::s4u::File remoteFile(argv[2], nullptr);
-    filename = remoteFile.get_path();
-    XBT_INFO("Opened file '%s'", filename);
-    XBT_INFO("Try to write %llu MiB to '%s'", remoteFile.size() / 1024, filename);
-    sg_size_t write = remoteFile.write(remoteFile.size() * 1024);
-    XBT_INFO("Have written %llu bytes to '%s'.", write, filename);
-
-    if (std::stoi(argv[5]) != 0) {
-      XBT_INFO("Move '%s' (of size %llu) from '%s' to '%s'", filename, remoteFile.size(),
-               simgrid::s4u::Host::current()->get_cname(), argv[3]);
-      remoteFile.remote_move(simgrid::s4u::Host::by_name(argv[3]), argv[4]);
+  XBT_INFO("Try to write %llu MiB to '%s'", file.size() / 1024, filename);
+  sg_size_t write = file.write(file.size() * 1024);
+  XBT_INFO("Have written %llu MiB to '%s'.", write / (1024 * 1024), filename);
+
+  if (argc > 4) {
+    if (std::stoi(argv[4]) != 0) {
+      XBT_INFO("Move '%s' (of size %llu) from '%s' to '%s'", filename, file.size(),
+               simgrid::s4u::Host::current()->get_cname(), argv[2]);
+      file.remote_move(simgrid::s4u::Host::by_name(argv[2]), argv[3]);
     } else {
-      XBT_INFO("Copy '%s' (of size %llu) from '%s' to '%s'", filename, remoteFile.size(),
-               simgrid::s4u::Host::current()->get_cname(), argv[3]);
-      remoteFile.remote_copy(simgrid::s4u::Host::by_name(argv[3]), argv[4]);
+      XBT_INFO("Copy '%s' (of size %llu) from '%s' to '%s'", filename, file.size(),
+               simgrid::s4u::Host::current()->get_cname(), argv[2]);
+      file.remote_copy(simgrid::s4u::Host::by_name(argv[2]), argv[3]);
     }
   }
-
   return 0;
 }
 
@@ -54,18 +42,20 @@ int main(int argc, char** argv)
   e.load_platform(argv[1]);
   e.register_function("host", host);
   e.load_deployment(argv[2]);
-  std::vector<simgrid::s4u::Storage*> allStorages = e.get_all_storages();
+  std::vector<simgrid::s4u::Host*> all_hosts = e.get_all_hosts();
 
-  for (auto const& s : allStorages) {
-    XBT_INFO("Init: %llu/%llu MiB used/free on '%s'", sg_storage_get_size_used(s) / INMEGA,
-             sg_storage_get_size_free(s) / INMEGA, s->get_cname());
+  for (auto const& h : all_hosts) {
+    for (auto const& d : h->get_disks())
+      XBT_INFO("Init: %s: %llu/%llu MiB used/free on '%s@%s'", h->get_cname(), sg_disk_get_size_used(d) / INMEGA,
+               sg_disk_get_size_free(d) / INMEGA, d->get_cname(), d->get_host()->get_cname());
   }
 
   e.run();
 
-  for (auto const& s : allStorages) {
-    XBT_INFO("End: %llu/%llu MiB used/free on '%s'", sg_storage_get_size_used(s) / INMEGA,
-             sg_storage_get_size_free(s) / INMEGA, s->get_cname());
+  for (auto const& h : all_hosts) {
+    for (auto const& d : h->get_disks())
+      XBT_INFO("End: %llu/%llu MiB used/free on '%s@%s'", sg_disk_get_size_used(d) / INMEGA,
+               sg_disk_get_size_free(d) / INMEGA, d->get_cname(), h->get_cname());
   }
 
   XBT_INFO("Simulation time %g", simgrid::s4u::Engine::get_clock());
index 6781b50..180ba09 100644 (file)
@@ -1,64 +1,43 @@
 #!/usr/bin/env tesh
 
-$ ${bindir:=.}/s4u-io-file-remote$EXEEXT ${platfdir}/storage/remote_io.xml s4u-io-file-remote_d.xml "--log=root.fmt:[%10.6r]%e(%i@%5h)%e%m%n"
-> [  0.000000] (0@     ) Init: 12/476824 MiB used/free on 'Disk1'
-> [  0.000000] (0@     ) Init: 2280/474556 MiB used/free on 'Disk2'
-> [  0.000000] (1@alice) Opened file 'c:\Windows\setupact.log'
+$ ${bindir:=.}/s4u-io-file-remote ${platfdir}/hosts_with_disks.xml s4u-io-file-remote_d.xml "--log=root.fmt:[%10.6r]%e(%i@%5h)%e%m%n"
+> [  0.000000] (0@     ) Init: alice: 12/511987 MiB used/free on 'Disk1@alice'
+> [  0.000000] (0@     ) Init: bob: 35/511964 MiB used/free on 'Disk1@bob'
+> [  0.000000] (0@     ) Init: bob: 0/512000 MiB used/free on 'Disk2@bob'
+> [  0.000000] (0@     ) Init: carl: 35/511964 MiB used/free on 'Disk1@bob'
+> [  0.000000] (1@alice) Opened file '/include/surf/simgrid_dtd.h'
 > [  0.000000] (1@alice) File Descriptor information:
->              Full path: 'c:\Windows\setupact.log'
->              Size: 101663
->              Mount point: 'c:'
->              Storage Id: 'Disk2'
->              Storage Type: 'SATA-II_HDD'
+>              Full path: '/include/surf/simgrid_dtd.h'
+>              Size: 23583
+>              Mount point: '/'
+>              Disk Id: 'Disk1'
+>              Host Id: 'alice'
 >              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] (1@alice) Try to write 23 MiB to '/include/surf/simgrid_dtd.h'
+> [  0.000000] (2@  bob) Opened file '/scratch/doc/simgrid/examples/platforms/g5k.xml'
 > [  0.000000] (2@  bob) File Descriptor information:
->              Full path: '/scratch/lib/libsimgrid.so.3.6.2'
->              Size: 12710497
+>              Full path: '/scratch/doc/simgrid/examples/platforms/g5k.xml'
+>              Size: 17028
 >              Mount point: '/scratch'
->              Storage Id: 'Disk1'
->              Storage Type: 'SATA-II_HDD'
+>              Disk Id: 'Disk1'
+>              Host Id: 'bob'
 >              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] (2@  bob) Try to write 16 MiB to '/scratch/doc/simgrid/examples/platforms/g5k.xml'
+> [  0.000000] (3@ carl) Opened file '/scratch/include/surf/simgrid_dtd.h'
 > [  0.000000] (3@ carl) File Descriptor information:
->              Full path: '/scratch/lib/libsimgrid.so.3.6.2'
->              Size: 12710497
+>              Full path: '/scratch/include/surf/simgrid_dtd.h'
+>              Size: 23583
 >              Mount point: '/scratch'
->              Storage Id: 'Disk1'
->              Storage Type: 'SATA-II_HDD'
+>              Disk Id: 'Disk1'
+>              Host Id: 'bob'
 >              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
->              Mount point: 'c:'
->              Storage Id: 'Disk2'
->              Storage Type: 'SATA-II_HDD'
->              File Descriptor Id: 0
-> [  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 beginning of the stream...
-> [  0.001469] (4@ dave) Offset is now at: 0
-> [  0.001469] (4@ dave) Opened file 'c:\Windows\Professional.xml'
-> [  0.001469] (4@ dave) Try to write 31 MiB to 'c:\Windows\Professional.xml'
-> [  0.003741] (1@alice) Have read 101663 from 'c:\Windows\setupact.log'. Offset is now at: 101663
-> [  0.003741] (1@alice) Seek back to the beginning of the stream...
-> [  0.003741] (1@alice) Offset is now at: 0
-> [  0.276315] (3@ carl) Have read 12710497 from '/scratch/lib/libsimgrid.so.3.6.2'. Offset is now at: 12710497
-> [  0.276315] (3@ carl) Seek back to the beginning of the stream...
-> [  0.276315] (3@ carl) Offset is now at: 0
-> [  0.387036] (2@  bob) Have read 12710497 from '/scratch/lib/libsimgrid.so.3.6.2'. Offset is now at: 12710497
-> [  0.387036] (2@  bob) Seek back to the beginning of the stream...
-> [  0.387036] (2@  bob) Offset is now at: 0
-> [  0.387036] (2@  bob) Opened file '/scratch/doc/simgrid/examples/platforms/g5k.xml'
-> [  0.387036] (2@  bob) Try to write 16 MiB to '/scratch/doc/simgrid/examples/platforms/g5k.xml'
-> [  0.528211] (4@ dave) Have written 32646144 bytes to 'c:\Windows\Professional.xml'.
-> [  0.528211] (4@ dave) Move 'c:\Windows\Professional.xml' (of size 32646144) from 'dave' to 'carl'
-> [  0.819921] (2@  bob) Have written 17436672 bytes to '/scratch/doc/simgrid/examples/platforms/g5k.xml'.
-> [  0.819921] (2@  bob) Copy '/scratch/doc/simgrid/examples/platforms/g5k.xml' (of size 17436672) from 'bob' to 'alice'
-> [  1.843969] (0@     ) End: 60/476776 MiB used/free on 'Disk1'
-> [  1.843969] (0@     ) End: 2297/474539 MiB used/free on 'Disk2'
-> [  1.843969] (0@     ) Simulation time 1.84397
+> [  0.000000] (3@ carl) Try to write 23 MiB to '/scratch/include/surf/simgrid_dtd.h'
+> [  0.301862] (1@alice) Have written 23 MiB to '/include/surf/simgrid_dtd.h'.
+> [  0.301862] (1@alice) Move '/include/surf/simgrid_dtd.h' (of size 24148992) from 'alice' to 'bob'
+> [  0.660757] (2@  bob) Have written 16 MiB to '/scratch/doc/simgrid/examples/platforms/g5k.xml'.
+> [  0.660757] (2@  bob) Copy '/scratch/doc/simgrid/examples/platforms/g5k.xml' (of size 17436672) from 'bob' to 'alice'
+> [  1.234522] (3@ carl) Have written 23 MiB to '/scratch/include/surf/simgrid_dtd.h'.
+> [  1.643366] (0@     ) End: 29/511970 MiB used/free on 'Disk1@alice'
+> [  1.643366] (0@     ) End: 97/511902 MiB used/free on 'Disk1@bob'
+> [  1.643366] (0@     ) End: 0/512000 MiB used/free on 'Disk2@bob'
+> [  1.643366] (0@     ) Simulation time 1.64337
index 3b3f1ab..d14901b 100644 (file)
@@ -2,23 +2,18 @@
 <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
 <platform version="4.1">
   <actor host="alice" function="host">
-    <argument value = "c:\Windows\setupact.log"/>
+    <argument value = "/include/surf/simgrid_dtd.h"/>
+    <argument value = "bob"/>
+    <argument value = "/scratch/include/surf/simgrid_dtd.h"/>
+    <argument value = "1"/>
   </actor>
   <actor host="bob" function="host">
-    <argument value = "/scratch/lib/libsimgrid.so.3.6.2"/>
     <argument value = "/scratch/doc/simgrid/examples/platforms/g5k.xml"/>
     <argument value = "alice"/>
-    <argument value = "c:\Windows\Platforms\g5k.xml"/>
+    <argument value = "/tmp/platforms/g5k.xml"/>
     <argument value = "0"/>
   </actor>
   <actor host="carl" function="host">
-    <argument value = "/scratch/lib/libsimgrid.so.3.6.2"/>
-  </actor>
-  <actor host="dave" function="host">
-    <argument value = "c:\Windows\bootstat.dat"/>
-    <argument value = "c:\Windows\Professional.xml"/>
-    <argument value = "carl"/>
-    <argument value = "/scratch/mailbox/Professional.xml"/>
-    <argument value = "1"/>
+    <argument value = "/scratch/include/surf/simgrid_dtd.h"/>
   </actor>
 </platform>
index c706b97..4c91e69 100644 (file)
@@ -4,7 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include <string>
-#include <unordered_map>
+#include <vector>
 
 #include "simgrid/plugins/file_system.h"
 #include "simgrid/s4u.hpp"
@@ -13,36 +13,32 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "a sample log category");
 
 class MyHost {
 public:
-  void show_info(std::unordered_map<std::string, simgrid::s4u::Storage*> const& mounts)
+  void show_info(std::vector<simgrid::s4u::Disk*> const& disks)
   {
     XBT_INFO("Storage info on %s:", simgrid::s4u::Host::current()->get_cname());
 
-    for (auto const& kv : mounts) {
-      std::string mountpoint         = kv.first;
-      simgrid::s4u::Storage* storage = kv.second;
-
+    for (auto const& d : disks) {
       // Retrieve disk's information
-      XBT_INFO("    %s (%s) Used: %llu; Free: %llu; Total: %llu.", storage->get_cname(), mountpoint.c_str(),
-               sg_storage_get_size_used(storage), sg_storage_get_size_free(storage), sg_storage_get_size(storage));
+      XBT_INFO("    %s (%s) Used: %llu; Free: %llu; Total: %llu.", d->get_cname(), sg_disk_get_mount_point(d),
+               sg_disk_get_size_used(d), sg_disk_get_size_free(d), sg_disk_get_size(d));
     }
   }
 
   void operator()()
   {
-    std::unordered_map<std::string, simgrid::s4u::Storage*> const& mounts =
-        simgrid::s4u::Host::current()->get_mounted_storages();
+    std::vector<simgrid::s4u::Disk*> const& disks = simgrid::s4u::Host::current()->get_disks();
 
-    show_info(mounts);
+    show_info(disks);
 
     // Open an non-existing file to create it
-    std::string filename     = "/home/tmp/data.txt";
+    std::string filename     = "/scratch/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.c_str());
+    XBT_INFO("Create a %llu bytes file named '%s' on /scratch", write, filename.c_str());
 
     // check that sizes have changed
-    show_info(mounts);
+    show_info(disks);
 
     // Now retrieve the size of created file and read it completely
     const sg_size_t file_size = file->size();
@@ -54,10 +50,8 @@ public:
     write = file->write(100000); // Write 100,000 bytes
     XBT_INFO("Write %llu bytes on %s", write, filename.c_str());
 
-    simgrid::s4u::Storage* storage = simgrid::s4u::Storage::by_name("Disk4");
-
     // Now rename file from ./tmp/data.txt to ./tmp/simgrid.readme
-    std::string newpath = "/home/tmp/simgrid.readme";
+    std::string newpath = "/scratch/tmp/simgrid.readme";
     XBT_INFO("Move '%s' to '%s'", file->get_path(), newpath.c_str());
     file->move(newpath);
 
@@ -70,23 +64,15 @@ public:
     // Close the file
     delete file;
 
-    // Now attach some user data to disk1
-    XBT_INFO("Get/set data for storage element: %s", storage->get_cname());
-    XBT_INFO("    Uninitialized storage data: '%s'", static_cast<char*>(storage->get_data()));
-
-    storage->set_data(new std::string("Some user data"));
-    std::string* storage_data = static_cast<std::string*>(storage->get_data());
-    XBT_INFO("    Set and get data: '%s'", storage_data->c_str());
-
-    delete storage_data;
+    show_info(disks);
 
     // Reopen the file and then unlink it
-    file = new simgrid::s4u::File("/home/tmp/simgrid.readme", nullptr);
+    file = new simgrid::s4u::File("/scratch/tmp/simgrid.readme", nullptr);
     XBT_INFO("Unlink file: '%s'", file->get_path());
     file->unlink();
     delete file; // Unlinking the file on "disk" does not free the object
 
-    show_info(mounts);
+    show_info(disks);
   }
 };
 
@@ -95,7 +81,7 @@ int main(int argc, char** argv)
   simgrid::s4u::Engine e(&argc, argv);
   sg_storage_file_system_init();
   e.load_platform(argv[1]);
-  simgrid::s4u::Actor::create("host", simgrid::s4u::Host::by_name("denise"), MyHost());
+  simgrid::s4u::Actor::create("host", simgrid::s4u::Host::by_name("bob"), MyHost());
   e.run();
 
   return 0;
index 303cbb3..b2ad152 100644 (file)
@@ -1,21 +1,21 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-io-file-system ${platfdir}/storage/storage.xml
-> [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.
-> [denise:host:(1) 0.003333] [s4u_test/INFO] Create a 200000 bytes file named '/home/tmp/data.txt' on /sd1
-> [denise:host:(1) 0.003333] [s4u_test/INFO] Storage info on denise:
-> [denise:host:(1) 0.003333] [s4u_test/INFO]     Disk2 (c:) Used: 2391537133; Free: 534479374867; Total: 536870912000.
-> [denise:host:(1) 0.003333] [s4u_test/INFO]     Disk4 (/home) Used: 13421994; Free: 536857490006; Total: 536870912000.
-> [denise:host:(1) 0.004333] [s4u_test/INFO] Read 200000 bytes on /home/tmp/data.txt
-> [denise:host:(1) 0.006000] [s4u_test/INFO] Write 100000 bytes on /home/tmp/data.txt
-> [denise:host:(1) 0.006000] [s4u_test/INFO] Move '/home/tmp/data.txt' to '/home/tmp/simgrid.readme'
-> [denise:host:(1) 0.006000] [s4u_test/INFO] User data attached to the file: 777
-> [denise:host:(1) 0.006000] [s4u_test/INFO] Get/set data for storage element: Disk4
-> [denise:host:(1) 0.006000] [s4u_test/INFO]     Uninitialized storage data: '(null)'
-> [denise:host:(1) 0.006000] [s4u_test/INFO]     Set and get data: 'Some user data'
-> [denise:host:(1) 0.006000] [s4u_test/INFO] Unlink file: '/home/tmp/simgrid.readme'
-> [denise:host:(1) 0.006000] [s4u_test/INFO] Storage info on denise:
-> [denise:host:(1) 0.006000] [s4u_test/INFO]     Disk2 (c:) Used: 2391537133; Free: 534479374867; Total: 536870912000.
-> [denise:host:(1) 0.006000] [s4u_test/INFO]     Disk4 (/home) Used: 13221994; Free: 536857690006; Total: 536870912000.
+$ ${bindir:=.}/s4u-io-file-system ${platfdir}/hosts_with_disks.xml
+> [bob:host:(1) 0.000000] [s4u_test/INFO] Storage info on bob:
+> [bob:host:(1) 0.000000] [s4u_test/INFO]     Disk1 (/scratch) Used: 36933331; Free: 536833978669; Total: 536870912000.
+> [bob:host:(1) 0.000000] [s4u_test/INFO]     Disk2 (/) Used: 0; Free: 536870912000; Total: 536870912000.
+> [bob:host:(1) 0.005000] [s4u_test/INFO] Create a 200000 bytes file named '/scratch/tmp/data.txt' on /scratch
+> [bob:host:(1) 0.005000] [s4u_test/INFO] Storage info on bob:
+> [bob:host:(1) 0.005000] [s4u_test/INFO]     Disk1 (/scratch) Used: 37133331; Free: 536833778669; Total: 536870912000.
+> [bob:host:(1) 0.005000] [s4u_test/INFO]     Disk2 (/) Used: 0; Free: 536870912000; Total: 536870912000.
+> [bob:host:(1) 0.007000] [s4u_test/INFO] Read 200000 bytes on /scratch/tmp/data.txt
+> [bob:host:(1) 0.009500] [s4u_test/INFO] Write 100000 bytes on /scratch/tmp/data.txt
+> [bob:host:(1) 0.009500] [s4u_test/INFO] Move '/scratch/tmp/data.txt' to '/scratch/tmp/simgrid.readme'
+> [bob:host:(1) 0.009500] [s4u_test/INFO] User data attached to the file: 777
+> [bob:host:(1) 0.009500] [s4u_test/INFO] Storage info on bob:
+> [bob:host:(1) 0.009500] [s4u_test/INFO]     Disk1 (/scratch) Used: 37233331; Free: 536833678669; Total: 536870912000.
+> [bob:host:(1) 0.009500] [s4u_test/INFO]     Disk2 (/) Used: 0; Free: 536870912000; Total: 536870912000.
+> [bob:host:(1) 0.009500] [s4u_test/INFO] Unlink file: '/scratch/tmp/simgrid.readme'
+> [bob:host:(1) 0.009500] [s4u_test/INFO] Storage info on bob:
+> [bob:host:(1) 0.009500] [s4u_test/INFO]     Disk1 (/scratch) Used: 36933331; Free: 536833978669; Total: 536870912000.
+> [bob:host:(1) 0.009500] [s4u_test/INFO]     Disk2 (/) Used: 0; Free: 536870912000; Total: 536870912000.
diff --git a/examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp b/examples/s4u/io-storage-raw/s4u-io-storage-raw.cpp
deleted file mode 100644 (file)
index d076f87..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright (c) 2017-2019. The SimGrid Team. All rights reserved.          */
-
-/* This program is 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 <string>
-#include <unordered_map>
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(storage, "Messages specific for this simulation");
-
-static void host()
-{
-  /* - Display information on the disks mounted by the current host */
-  XBT_INFO("*** Storage info on %s ***", simgrid::s4u::Host::current()->get_cname());
-
-  /* - Retrieve all mount points of current host */
-  std::unordered_map<std::string, simgrid::s4u::Storage*> const& storage_list =
-      simgrid::s4u::Host::current()->get_mounted_storages();
-
-  /* - For each disk mounted on host, display disk name and mount point */
-  for (auto const& kv : storage_list)
-    XBT_INFO("Storage name: %s, mount name: %s", kv.second->get_cname(), kv.first.c_str());
-
-  /* - Write 200,000 bytes on Disk4 */
-  simgrid::s4u::Storage* storage = simgrid::s4u::Storage::by_name("Disk4");
-  sg_size_t write                = storage->write(200000);
-  XBT_INFO("Wrote %llu bytes on 'Disk4'", write);
-
-  /*  - Now read 200,000 bytes */
-  sg_size_t read = storage->read(200000);
-  XBT_INFO("Read %llu bytes on 'Disk4'", read);
-
-  /* - Attach some user data to disk1 */
-  XBT_INFO("*** Get/set data for storage element: Disk4 ***");
-
-  std::string* data = static_cast<std::string*>(storage->get_data());
-
-  XBT_INFO("Get storage data: '%s'", data ? data->c_str() : "No user data");
-
-  storage->set_data(new std::string("Some user data"));
-  data = static_cast<std::string*>(storage->get_data());
-  XBT_INFO("Set and get data: '%s'", data->c_str());
-  delete data;
-}
-
-int main(int argc, char** argv)
-{
-  simgrid::s4u::Engine e(&argc, argv);
-  e.load_platform(argv[1]);
-
-  simgrid::s4u::Actor::create("", simgrid::s4u::Host::by_name("denise"), host);
-
-  e.run();
-  XBT_INFO("Simulated time: %g", simgrid::s4u::Engine::get_clock());
-
-  return 0;
-}
diff --git a/examples/s4u/io-storage-raw/s4u-io-storage-raw.tesh b/examples/s4u/io-storage-raw/s4u-io-storage-raw.tesh
deleted file mode 100644 (file)
index 65b09de..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env tesh
-
-$ ${bindir}/s4u-io-storage-raw$EXEEXT ${platfdir}/storage/storage.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (1:@denise) *** Storage info on denise ***
-> [  0.000000] (1:@denise) Storage name: Disk2, mount name: c:
-> [  0.000000] (1:@denise) Storage name: Disk4, mount name: /home
-> [  0.003333] (1:@denise) Wrote 200000 bytes on 'Disk4'
-> [  0.004333] (1:@denise) Read 200000 bytes on 'Disk4'
-> [  0.004333] (1:@denise) *** Get/set data for storage element: Disk4 ***
-> [  0.004333] (1:@denise) Get storage data: 'No user data'
-> [  0.004333] (1:@denise) Set and get data: 'Some user data'
-> [  0.004333] (0:maestro@) Simulated time: 0.00433333
index 3a9f24e..1088559 100644 (file)
@@ -70,7 +70,7 @@ int main(int argc, char* argv[])
 
   if (argc != 2) {
     XBT_CRITICAL("Usage: %s platform_file\n", argv[0]);
-    xbt_die("example: %s msg_platform.xml\n", argv[0]);
+    xbt_die("example: %s ../platforms/small_platform.xml\n", argv[0]);
   }
 
   e.load_platform(argv[1]);
index cf21b21..fb1fc88 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-maestro-set$EXEEXT ${platfdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-maestro-set ${platfdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (0:maestro@) I am not the main thread, as expected
 > [  0.000000] (2:receiver@Jupiter) I am not the main thread, as expected
 > [  0.000000] (1:sender@Tremblay) I am the main thread, as expected
diff --git a/examples/s4u/mc-failing-assert/s4u-mc-failing-assert.cpp b/examples/s4u/mc-failing-assert/s4u-mc-failing-assert.cpp
new file mode 100644 (file)
index 0000000..b87e6f4
--- /dev/null
@@ -0,0 +1,62 @@
+/* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+/******************** Non-deterministic message ordering  *********************/
+/* Server assumes a fixed order in the reception of messages from its clients */
+/* which is incorrect because the message ordering is non-deterministic       */
+/******************************************************************************/
+
+#include <simgrid/modelchecker.h>
+#include <simgrid/s4u.hpp>
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(mc_assert_example, "Logging channel used in this example");
+
+static int server(int worker_amount)
+{
+  int value_got             = -1;
+  simgrid::s4u::Mailbox* mb = simgrid::s4u::Mailbox::by_name("server");
+  for (int count = 0; count < worker_amount; count++) {
+    int* msg  = static_cast<int*>(mb->get());
+    value_got = *msg;
+    delete msg;
+  }
+  /*
+   * We assert here that the last message we got (which overwrite any previously received message) is the one from the
+   * last worker This will obviously fail when the messages are received out of order.
+   */
+  MC_assert(value_got == 2);
+
+  XBT_INFO("OK");
+  return 0;
+}
+
+static int client(int rank)
+{
+  /* I just send my rank onto the mailbox. It must be passed as a stable memory block (thus the new) so that that
+   * memory survives even after the end of the client */
+
+  simgrid::s4u::Mailbox* mailbox = simgrid::s4u::Mailbox::by_name("server");
+  mailbox->put(new int(rank), 1 /* communication cost is not really relevant in MC mode */);
+
+  XBT_INFO("Sent!");
+  return 0;
+}
+
+int main(int argc, char* argv[])
+{
+  simgrid::s4u::Engine e(&argc, argv);
+  xbt_assert(argc > 1, "Usage: %s platform_file\n", argv[0]);
+
+  e.load_platform(argv[1]);
+  auto hosts = e.get_all_hosts();
+  xbt_assert(hosts.size() >= 3, "This example requires at least 3 hosts");
+
+  simgrid::s4u::Actor::create("server", hosts[0], &server, 2);
+  simgrid::s4u::Actor::create("client1", hosts[1], &client, 1);
+  simgrid::s4u::Actor::create("client2", hosts[2], &client, 2);
+
+  e.run();
+  return 0;
+}
diff --git a/examples/s4u/mc-failing-assert/s4u-mc-failing-assert.tesh b/examples/s4u/mc-failing-assert/s4u-mc-failing-assert.tesh
new file mode 100644 (file)
index 0000000..24e5927
--- /dev/null
@@ -0,0 +1,28 @@
+#!/usr/bin/env tesh
+
+! expect return 1
+! timeout 20
+$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/s4u-mc-failing-assert ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=xbt_cfg.thresh:warning
+> [  0.000000] (0:maestro@) Check a safety property. Reduction is: dpor.
+> [  0.000000] (2:client1@Bourassa) Sent!
+> [  0.000000] (1:server@Boivin) OK
+> [  0.000000] (3:client2@Fafard) Sent!
+> [  0.000000] (2:client1@Bourassa) Sent!
+> [  0.000000] (2:client1@Bourassa) Sent!
+> [  0.000000] (1:server@Boivin) OK
+> [  0.000000] (3:client2@Fafard) Sent!
+> [  0.000000] (2:client1@Bourassa) Sent!
+> [  0.000000] (0:maestro@) **************************
+> [  0.000000] (0:maestro@) *** PROPERTY NOT VALID ***
+> [  0.000000] (0:maestro@) **************************
+> [  0.000000] (0:maestro@) Counter-example execution trace:
+> [  0.000000] (0:maestro@)   [(1)Boivin (server)] iRecv(dst=(1)Boivin (server), buff=(verbose only), size=(verbose only))
+> [  0.000000] (0:maestro@)   [(3)Fafard (client2)] iSend(src=(3)Fafard (client2), buff=(verbose only), size=(verbose only))
+> [  0.000000] (0:maestro@)   [(1)Boivin (server)] Wait(comm=(verbose only) [(3)Fafard (client2)-> (1)Boivin (server)])
+> [  0.000000] (0:maestro@)   [(1)Boivin (server)] iRecv(dst=(1)Boivin (server), buff=(verbose only), size=(verbose only))
+> [  0.000000] (0:maestro@)   [(2)Bourassa (client1)] iSend(src=(2)Bourassa (client1), buff=(verbose only), size=(verbose only))
+> [  0.000000] (0:maestro@)   [(1)Boivin (server)] Wait(comm=(verbose only) [(2)Bourassa (client1)-> (1)Boivin (server)])
+> [  0.000000] (0:maestro@) Path = 1;3;1;1;2;1
+> [  0.000000] (0:maestro@) Expanded states = 18
+> [  0.000000] (0:maestro@) Visited states = 36
+> [  0.000000] (0:maestro@) Executed transitions = 32
index 75669f5..0c5bf2d 100644 (file)
@@ -9,9 +9,10 @@
  * To set such a profile, the first way is to use a file in the XML, while the second is to use the programmatic
  * interface. Once this profile is in place, the resource will automatically be turned on and off.
  *
- * The actors running on an host that is turned off will receive a simgrid::HostFailureException. Since we specified
- * on_failure="RESTART" for each actors in the XML file, they will be automatically restarted when the host starts
- * again.
+ * The actors running on an host that is turned off are forcefully killed
+ * once their on_exit callbacks are executed. They cannot avoid this fate.
+ * Since we specified on_failure="RESTART" for each actors in the XML file,
+ * they will be automatically restarted when the host starts again.
  *
  * Communications using failed links will .. fail.
  */
@@ -40,14 +41,12 @@ static int master(int argc, char* argv[])
       XBT_INFO("Send a message to %s", mailbox->get_cname());
       mailbox->put(payload, comm_size, 10.0);
       XBT_INFO("Send to %s completed", mailbox->get_cname());
-    } catch (simgrid::TimeoutError& e) {
+    } catch (const simgrid::TimeoutException&) {
       delete payload;
       XBT_INFO("Mmh. Got timeouted while speaking to '%s'. Nevermind. Let's keep going!", mailbox->get_cname());
-    } catch (xbt_ex& e) {
-      if (e.category != network_error)
-        xbt_die("Unexpected behavior");
-      XBT_INFO("Mmh. The communication with '%s' failed. Nevermind. Let's keep going!", mailbox->get_cname());
+    } catch (const simgrid::NetworkFailureException&) {
       delete payload;
+      XBT_INFO("Mmh. The communication with '%s' failed. Nevermind. Let's keep going!", mailbox->get_cname());
     }
   }
 
@@ -58,17 +57,11 @@ static int master(int argc, char* argv[])
     double* payload = new double(-1.0);
     try {
       mailbox->put(payload, 0, 1.0);
-    } catch (simgrid::HostFailureException& e) {
-      delete payload;
-      XBT_INFO("Gloups. The cpu on which I'm running just turned off!. See you!");
-      return -1;
-    } catch (simgrid::TimeoutError& e) {
+    } catch (const simgrid::TimeoutException&) {
       delete payload;
       XBT_INFO("Mmh. Got timeouted while speaking to '%s'. Nevermind. Let's keep going!", mailbox->get_cname());
-    } catch (xbt_ex& e) {
+    } catch (const simgrid::NetworkFailureException&) {
       delete payload;
-      if (e.category != network_error)
-        xbt_die("Unexpected behavior");
       XBT_INFO("Mmh. Something went wrong with '%s'. Nevermind. Let's keep going!", mailbox->get_cname());
     }
   }
@@ -99,13 +92,7 @@ static int worker(int argc, char* argv[])
       XBT_INFO("Start execution...");
       simgrid::s4u::this_actor::execute(comp_size);
       XBT_INFO("Execution complete.");
-    } catch (simgrid::HostFailureException& e) {
-      XBT_INFO("Gloups. The cpu on which I'm running just turned off!. See you!");
-      delete payload;
-      return -1;
-    } catch (xbt_ex& e) {
-      if (e.category != network_error)
-        xbt_die("Unexpected behavior. Category: %s", xbt_ex_catname(e.category));
+    } catch (const simgrid::NetworkFailureException&) {
       XBT_INFO("Mmh. Something went wrong. Nevermind. Let's keep going!");
     }
   }
index b1acb0b..c6be682 100644 (file)
@@ -3,7 +3,7 @@
 p Testing a simple master/worker example application handling failures TCP crosstraffic DISABLED
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-platform-failures$EXEEXT --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir:=.}/s4u-platform-failures_d.xml --cfg=path:${srcdir} --cfg=network/crosstraffic:0 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=surf_cpu.t:verbose
+$ ${bindir:=.}/s4u-platform-failures --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir:=.}/s4u-platform-failures_d.xml --cfg=path:${srcdir} --cfg=network/crosstraffic:0 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=surf_cpu.t:verbose
 > [  0.000000] (0:maestro@) Cannot launch actor 'worker' on failed host 'Fafard'
 > [  0.000000] (0:maestro@) Deployment includes some initially turned off Hosts ... nevermind.
 > [  0.000000] (1:master@Tremblay) Got 5 workers and 20 tasks to process
@@ -108,7 +108,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-platform-failures$EXEEXT --log=xbt_cfg.thres:c
 p Testing a simple master/worker example application handling failures. TCP crosstraffic ENABLED
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-platform-failures$EXEEXT --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir:=.}/s4u-platform-failures_d.xml --cfg=path:${srcdir} "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=surf_cpu.t:verbose
+$ ${bindir:=.}/s4u-platform-failures --log=xbt_cfg.thres:critical --log=no_loc ${platfdir}/small_platform_failures.xml ${srcdir:=.}/s4u-platform-failures_d.xml --cfg=path:${srcdir} "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=surf_cpu.t:verbose
 > [  0.000000] (0:maestro@) Cannot launch actor 'worker' on failed host 'Fafard'
 > [  0.000000] (0:maestro@) Deployment includes some initially turned off Hosts ... nevermind.
 > [  0.000000] (1:master@Tremblay) Got 5 workers and 20 tasks to process
index 11b0d00..1d27cf5 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-platform-profile ${platfdir}/small_platform_profile.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-platform-profile ${platfdir}/small_platform_profile.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:watcher@Tremblay) Fafard: 25Gflops, Jupiter:  12Gflops, Link1: (1000.00MB/s 10ms), Link2: (1000.00MB/s 10ms)
 > [  1.000000] (1:watcher@Tremblay) Fafard: 25Gflops, Jupiter:  12Gflops, Link1: (1000.00MB/s 3ms), Link2: (1000.00MB/s 10ms)
 > [  2.000000] (1:watcher@Tremblay) Fafard: 25Gflops, Jupiter:  25Gflops, Link1: (2000.00MB/s 3ms), Link2: (1000.00MB/s 10ms)
index fe49596..12e793d 100644 (file)
@@ -14,7 +14,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Property test");
 static void test_host(const std::string& hostname)
 {
   simgrid::s4u::Host* thehost = simgrid::s4u::Host::by_name(hostname);
-  std::unordered_map<std::string, std::string>* props = thehost->get_properties();
+  const std::unordered_map<std::string, std::string>* hostprops = thehost->get_properties();
   const char* noexist = "Unknown";
   const char* exist   = "Hdd";
   const char* value;
@@ -22,11 +22,11 @@ static void test_host(const std::string& hostname)
   XBT_INFO("== Print the properties of the host '%s'", hostname.c_str());
   // Sort the properties before displaying them, so that the tests are perfectly reproducible
   std::vector<std::string> keys;
-  for (auto const& kv : *props)
+  for (auto const& kv : *hostprops)
     keys.push_back(kv.first);
   std::sort(keys.begin(), keys.end());
   for (std::string key : keys)
-    XBT_INFO("  Host property: '%s' -> '%s'", key.c_str(), props->at(key).c_str());
+    XBT_INFO("  Host property: '%s' -> '%s'", key.c_str(), hostprops->at(key).c_str());
 
   XBT_INFO("== Try to get a host property that does not exist");
   value = thehost->get_property(noexist);
@@ -49,6 +49,16 @@ static void test_host(const std::string& hostname)
 
   /* Restore the value for the next test */
   thehost->set_property(exist, "180");
+
+  auto thezone = thehost->get_englobing_zone();
+  XBT_INFO("== Print the properties of the zone '%s' that contains '%s'", thezone->get_cname(), hostname.c_str());
+  const std::unordered_map<std::string, std::string>* zoneprops = thezone->get_properties();
+  keys.clear();
+  for (auto const& kv : *zoneprops)
+    keys.push_back(kv.first);
+  std::sort(keys.begin(), keys.end());
+  for (std::string key : keys)
+    XBT_INFO("  Zone property: '%s' -> '%s'", key.c_str(), zoneprops->at(key).c_str());
 }
 
 static void alice(std::vector<std::string> /*args*/)
@@ -75,13 +85,13 @@ static void bob(std::vector<std::string> /*args*/)
 {
   /* this host also tests the properties of the AS*/
   simgrid::s4u::NetZone* root = simgrid::s4u::Engine::get_instance()->get_netzone_root();
-  XBT_INFO("== Print the properties of the zone");
+  XBT_INFO("== Print the properties of the root zone");
   XBT_INFO("   Zone property: filename -> %s", root->get_property("filename"));
   XBT_INFO("   Zone property: date -> %s", root->get_property("date"));
   XBT_INFO("   Zone property: author -> %s", root->get_property("author"));
 
   /* Get the property list of current bob process */
-  std::unordered_map<std::string, std::string>* props = simgrid::s4u::Actor::self()->get_properties();
+  const std::unordered_map<std::string, std::string>* props = simgrid::s4u::Actor::self()->get_properties();
   const char* noexist = "UnknownProcessProp";
   XBT_ATTRIB_UNUSED const char* value;
 
index b3f7e54..f9a14b8 100644 (file)
@@ -3,7 +3,7 @@
 p Testing a S4U application with properties in the XML for Hosts, Links and Actors
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-platform-properties$EXEEXT ${platfdir}/prop.xml s4u-platform-properties_d.xml  "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-platform-properties ${platfdir}/prop.xml s4u-platform-properties_d.xml  "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (0:maestro@) There are 7 hosts in the environment
 > [  0.000000] (0:maestro@) Host 'host1' runs at 1000000000 flops/s
 > [  0.000000] (0:maestro@) Host 'host2' runs at 1000000000 flops/s
@@ -12,7 +12,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-platform-properties$EXEEXT ${platfdir}/prop.xm
 > [  0.000000] (0:maestro@) Host 'node-2.simgrid.org' runs at 1000000000 flops/s
 > [  0.000000] (0:maestro@) Host 'node-3.simgrid.org' runs at 1000000000 flops/s
 > [  0.000000] (0:maestro@) Host 'node-4.simgrid.org' runs at 1000000000 flops/s
-> [  0.000000] (2:bob@host1) == Print the properties of the zone
+> [  0.000000] (2:bob@host1) == Print the properties of the root zone
 > [  0.000000] (2:bob@host1)    Zone property: filename -> prop.xml
 > [  0.000000] (2:bob@host1)    Zone property: date -> 31-08-12
 > [  0.000000] (2:bob@host1)    Zone property: author -> pnavarro
@@ -27,6 +27,8 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-platform-properties$EXEEXT ${platfdir}/prop.xm
 > [  0.000000] (1:alice@host1)    Property: Hdd old value: 180
 > [  0.000000] (1:alice@host1) == Trying to modify a host property
 > [  0.000000] (1:alice@host1)    Property: Hdd old value: 250
+> [  0.000000] (1:alice@host1) == Print the properties of the zone 'AS4' that contains 'host1'
+> [  0.000000] (1:alice@host1)   Zone property: 'bla' -> 'bli'
 > [  1.000000] (3:carole@host2) == Print the properties of the host 'host1'
 > [  1.000000] (3:carole@host2)   Host property: 'Hdd' -> '180'
 > [  1.000000] (3:carole@host2)   Host property: 'mem' -> '4'
@@ -35,6 +37,8 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-platform-properties$EXEEXT ${platfdir}/prop.xm
 > [  1.000000] (3:carole@host2)    Property: Hdd old value: 180
 > [  1.000000] (3:carole@host2) == Trying to modify a host property
 > [  1.000000] (3:carole@host2)    Property: Hdd old value: 250
+> [  1.000000] (3:carole@host2) == Print the properties of the zone 'AS4' that contains 'host1'
+> [  1.000000] (3:carole@host2)   Zone property: 'bla' -> 'bli'
 > [  2.000000] (4:david@host2) == Print the properties of the host 'node-0.simgrid.org'
 > [  2.000000] (4:david@host2)   Host property: 'Hdd' -> '180'
 > [  2.000000] (4:david@host2)   Host property: 'bla' -> 'acme cluster'
@@ -44,3 +48,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-platform-properties$EXEEXT ${platfdir}/prop.xm
 > [  2.000000] (4:david@host2)    Property: Hdd old value: 180
 > [  2.000000] (4:david@host2) == Trying to modify a host property
 > [  2.000000] (4:david@host2)    Property: Hdd old value: 250
+> [  2.000000] (4:david@host2) == Print the properties of the zone 'acme' that contains 'node-0.simgrid.org'
+> [  2.000000] (4:david@host2)   Zone property: 'Hdd' -> '180'
+> [  2.000000] (4:david@host2)   Zone property: 'bla' -> 'acme cluster'
+> [  2.000000] (4:david@host2)   Zone property: 'mem' -> '42'
index b78cfbf..27ecdda 100644 (file)
@@ -35,9 +35,8 @@ static void execute_load_test()
            "far: %.2E, average load as reported by the HostLoad plugin: %.5f (should be %.5f)",
            simgrid::s4u::Engine::get_clock() - start, host->get_speed(), speed, sg_host_get_computed_flops(host),
            sg_host_get_avg_load(host),
-           static_cast<double>(200E6) /
-               (10.5 * speed * host->get_core_count() +
-                (simgrid::s4u::Engine::get_clock() - start - 0.5) * host->get_speed() * host->get_core_count()));
+           200E6 / (10.5 * speed * host->get_core_count() +
+                    (simgrid::s4u::Engine::get_clock() - start - 0.5) * host->get_speed() * host->get_core_count()));
 
   // ========= Change power peak =========
   int pstate = 1;
@@ -88,7 +87,7 @@ int main(int argc, char* argv[])
   sg_host_load_plugin_init();
   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]);
+  xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s ../platforms/energy_platform.xml\n", argv[0], argv[0]);
   e.load_platform(argv[1]);
 
   simgrid::s4u::Actor::create("load_test", simgrid::s4u::Host::by_name("MyHost1"), execute_load_test);
index f10e2f0..0e7319b 100644 (file)
@@ -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 ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-plugin-hostload ${platfdir}/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) and current average load: 0.00000 (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 2b73587..95affd0 100644 (file)
@@ -81,11 +81,12 @@ int main(int argc, char* 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"
-                       "\tExample: %s msg_platform.xml msg_deployment.xml actions\n"
-                       "\t# if actions are in separate files, specified in deployment\n"
-                       "\tExample: %s msg_platform.xml msg_deployment.xml ",
+  xbt_assert(argc > 2,
+             "Usage: %s platform_file deployment_file [action_files]\n"
+             "\t# if all actions are in the same file\n"
+             "\tExample: %s platform.xml deployment.xml actions\n"
+             "\t# if actions are in separate files, specified in deployment\n"
+             "\tExample: %s platform.xml deployment.xml ",
              argv[0], argv[0], argv[0]);
 
   e.load_platform(argv[1]);
 
 #include <boost/algorithm/string/join.hpp>
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(replay_storage, "Messages specific for this example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(replay_io, "Messages specific for this example");
 
 static std::unordered_map<std::string, simgrid::s4u::File*> opened_files;
 
 #define ACT_DEBUG(...)                                                                                                 \
-  if (XBT_LOG_ISENABLED(replay_storage, xbt_log_priority_verbose)) {                                                   \
+  if (XBT_LOG_ISENABLED(replay_io, xbt_log_priority_verbose)) {                                                        \
     std::string NAME = boost::algorithm::join(action, " ");                                                            \
     XBT_DEBUG(__VA_ARGS__);                                                                                            \
   } else                                                                                                               \
-  ((void)0)
+    ((void)0)
 
 static void log_action(simgrid::xbt::ReplayAction& action, double date)
 {
-  if (XBT_LOG_ISENABLED(replay_storage, xbt_log_priority_verbose)) {
+  if (XBT_LOG_ISENABLED(replay_io, xbt_log_priority_verbose)) {
     std::string s = boost::algorithm::join(action, " ");
     XBT_VERB("%s %f", s.c_str(), date);
   }
@@ -97,10 +97,11 @@ int main(int argc, char* 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"
-                       "\t# if actions are in separate files, specified in deployment\n"
-                       "\texample: %s platform.xml deployment.xml",
+  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"
+             "\t# if actions are in separate files, specified in deployment\n"
+             "\texample: %s platform.xml deployment.xml",
              argv[0], argv[0], argv[0]);
 
   e.load_platform(argv[1]);
diff --git a/examples/s4u/replay-io/s4u-replay-io.tesh b/examples/s4u/replay-io/s4u-replay-io.tesh
new file mode 100644 (file)
index 0000000..31b4f0e
--- /dev/null
@@ -0,0 +1,6 @@
+! output sort 19
+$ ${bindir:=.}/s4u-replay-io --log=replay_io.thres=verbose ${platfdir}/hosts_with_disks.xml s4u-replay-io_d.xml s4u-replay-io.txt "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+> [  0.000000] (p0@alice) p0 open /lib/libsimgrid.so.3.6.2 0.000000
+> [  0.063552] (p0@alice) p0 read /lib/libsimgrid.so.3.6.2 12710497 0.063552
+> [  0.063552] (p0@alice) p0 close /lib/libsimgrid.so.3.6.2 0.000000
+> [  0.063552] (maestro@) Simulation time 0.0635525
diff --git a/examples/s4u/replay-io/s4u-replay-io.txt b/examples/s4u/replay-io/s4u-replay-io.txt
new file mode 100644 (file)
index 0000000..0748847
--- /dev/null
@@ -0,0 +1,3 @@
+p0 open /lib/libsimgrid.so.3.6.2
+p0 read /lib/libsimgrid.so.3.6.2 12710497
+p0 close /lib/libsimgrid.so.3.6.2
@@ -1,5 +1,5 @@
 <?xml version='1.0'?>
 <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
 <platform version="4.1">
-  <actor host="denise" function="p0"/>
+  <actor host="alice" function="p0"/>
 </platform>
diff --git a/examples/s4u/replay-storage/s4u-replay-storage.tesh b/examples/s4u/replay-storage/s4u-replay-storage.tesh
deleted file mode 100644 (file)
index a7a63a1..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-! output sort 19
-$ ${bindir:=.}/s4u-replay-storage --log=replay_storage.thres=verbose ${platfdir}/storage/storage.xml s4u-replay-storage_d.xml s4u-replay-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
-> [  0.063552] (maestro@) Simulation time 0.0635525
diff --git a/examples/s4u/replay-storage/s4u-replay-storage.txt b/examples/s4u/replay-storage/s4u-replay-storage.txt
deleted file mode 100644 (file)
index cc9142a..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-p0 open /home/lib/libsimgrid.so.3.6.2  
-p0 read /home/lib/libsimgrid.so.3.6.2 12710497
-p0 close /home/lib/libsimgrid.so.3.6.2
index 7cdeeab..8dc83c8 100644 (file)
@@ -1,4 +1,4 @@
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-routing-get-clusters$EXEEXT ${platfdir}/cluster_multi.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-routing-get-clusters ${platfdir}/cluster_multi.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [  0.000000] (maestro@) simple
 > [  0.000000] (maestro@)    node-0.1core.org
 > [  0.000000] (maestro@)    node-1.1core.org
@@ -27,7 +27,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-routing-get-clusters$EXEEXT ${platfdir}/cluste
 > [  0.000000] (maestro@)    node-6.4cores.org
 > [  0.000000] (maestro@)    node-7.4cores.org
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-routing-get-clusters$EXEEXT ${platfdir}/cluster_dragonfly.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ ${bindir:=.}/s4u-routing-get-clusters ${platfdir}/cluster_dragonfly.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [  0.000000] (maestro@) bob_cluster
 > [  0.000000] (maestro@)    node-0.simgrid.org
 > [  0.000000] (maestro@)    node-1.simgrid.org
index e131c30..3e5e1ec 100644 (file)
@@ -35,12 +35,13 @@ static void master(int process_count)
 
 int main(int argc, char **argv)
 {
+  simgrid::s4u::Engine e(&argc, argv);
+
   // Parameter: Number of processes in the barrier
   xbt_assert(argc >= 2, "Usage: %s <process-count>\n", argv[0]);
   int process_count = std::stoi(argv[1]);
   xbt_assert(process_count > 0, "<process-count> must be greater than 0");
 
-  simgrid::s4u::Engine e(&argc, argv);
   e.load_platform("../../platforms/two_hosts.xml");
   simgrid::s4u::Actor::create("master", simgrid::s4u::Host::by_name("Tremblay"), master, process_count);
   e.run();
index 56dd082..a1e7709 100644 (file)
@@ -1,18 +1,18 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-synchro-barrier 1
+$ ${bindir:=.}/s4u-synchro-barrier 1
 > [Tremblay:master:(1) 0.000000] [s4u_test/INFO] Spawning 0 workers
 > [Tremblay:master:(1) 0.000000] [s4u_test/INFO] Waiting on the barrier
 > [Tremblay:master:(1) 0.000000] [s4u_test/INFO] Bye
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-synchro-barrier 2
+$ ${bindir:=.}/s4u-synchro-barrier 2
 > [Tremblay:master:(1) 0.000000] [s4u_test/INFO] Spawning 1 workers
 > [Jupiter:worker:(2) 0.000000] [s4u_test/INFO] Waiting on the barrier
 > [Tremblay:master:(1) 0.000000] [s4u_test/INFO] Waiting on the barrier
 > [Tremblay:master:(1) 0.000000] [s4u_test/INFO] Bye
 > [Jupiter:worker:(2) 0.000000] [s4u_test/INFO] Bye
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-synchro-barrier 3
+$ ${bindir:=.}/s4u-synchro-barrier 3
 > [Tremblay:master:(1) 0.000000] [s4u_test/INFO] Spawning 2 workers
 > [Jupiter:worker:(2) 0.000000] [s4u_test/INFO] Waiting on the barrier
 > [Jupiter:worker:(3) 0.000000] [s4u_test/INFO] Waiting on the barrier
@@ -21,7 +21,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/s4u-synchro-barrier 3
 > [Jupiter:worker:(2) 0.000000] [s4u_test/INFO] Bye
 > [Jupiter:worker:(3) 0.000000] [s4u_test/INFO] Bye
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-synchro-barrier 10
+$ ${bindir:=.}/s4u-synchro-barrier 10
 > [Tremblay:master:(1) 0.000000] [s4u_test/INFO] Spawning 9 workers
 > [Jupiter:worker:(2) 0.000000] [s4u_test/INFO] Waiting on the barrier
 > [Jupiter:worker:(3) 0.000000] [s4u_test/INFO] Waiting on the barrier
index 94bf0ec..4d1c5e9 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-synchro-mutex
+$ ${bindir:=.}/s4u-synchro-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
index d740170..ea805b1 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-synchro-semaphore
+$ ${bindir:=.}/s4u-synchro-semaphore
 > [Tremblay:producer:(1) 0.000000] [s4u_test/INFO] Pushing 'one'
 > [Jupiter:consumer:(2) 0.000000] [s4u_test/INFO] Receiving 'one'
 > [Tremblay:producer:(1) 0.000000] [s4u_test/INFO] Pushing 'two'
index b4a9ed0..9a50297 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env tesh
 
 p Tracing platform only
-$ $SG_TEST_EXENV ${bindir:=.}/s4u-trace-platform$EXEEXT --cfg=tracing:yes --cfg=tracing/filename:trace_platform.trace --cfg=tracing/categorized:yes ${platfdir}/small_platform.xml
+$ ${bindir:=.}/s4u-trace-platform --cfg=tracing:yes --cfg=tracing/filename:trace_platform.trace --cfg=tracing/categorized:yes ${platfdir}/small_platform.xml
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'trace_platform.trace'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/categorized' to 'yes'
index f528907..b72db9a 100644 (file)
@@ -14,8 +14,8 @@ if(enable_smpi)
 
   set_target_properties(smpi_trace_call_location PROPERTIES COMPILE_FLAGS "-trace-call-location")
 
-  foreach(x bugged1 bugged2 bugged1_liveness only_send_deterministic mutual_exclusion non_termination1 
-            non_termination2 non_termination3 non_termination4)
+  foreach(x bugged1 bugged2 bugged1_liveness only_send_deterministic mutual_exclusion non_termination1
+            non_termination2 non_termination3 non_termination4 sendsend)
     if(SIMGRID_HAVE_MC)
       add_executable       (smpi_${x} EXCLUDE_FROM_ALL ${CMAKE_CURRENT_SOURCE_DIR}/mc/${x}.c)
       target_link_libraries(smpi_${x} simgrid)
@@ -32,7 +32,7 @@ foreach(x trace trace_simple trace_call_location energy gemm)
   set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c)
 endforeach()
 foreach(x bugged1 bugged2 bugged1_liveness only_send_deterministic mutual_exclusion non_termination1
-    non_termination2 non_termination3 non_termination4)
+    non_termination2 non_termination3 non_termination4 sendsend)
   set(examples_src  ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/mc/${x}.c)
 endforeach()
 
@@ -43,6 +43,7 @@ set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/energy/energy.tes
                                    ${CMAKE_CURRENT_SOURCE_DIR}/trace_simple/trace_simple.tesh
                                    ${CMAKE_CURRENT_SOURCE_DIR}/trace_call_location/trace_call_location.tesh
                                    ${CMAKE_CURRENT_SOURCE_DIR}/ampi_test/ampi_test.tesh
+                                   ${CMAKE_CURRENT_SOURCE_DIR}/mc/sendsend.tesh
                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/replay-override-replayer.tesh
                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/replay.tesh                          PARENT_SCOPE)
 set(bin_files     ${bin_files}     ${CMAKE_CURRENT_SOURCE_DIR}/hostfile
@@ -67,11 +68,14 @@ set(txt_files     ${txt_files}     ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions0.t
                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_reducescatter.txt
                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_waitall.txt
                                    ${CMAKE_CURRENT_SOURCE_DIR}/replay/actions_with_isend.txt
-                                   ${CMAKE_CURRENT_SOURCE_DIR}/replay/split_traces                         PARENT_SCOPE)
+                                   ${CMAKE_CURRENT_SOURCE_DIR}/replay/split_traces
+                                   ${CMAKE_CURRENT_SOURCE_DIR}/trace_call_location/adjust                  PARENT_SCOPE)
 
 if(enable_smpi)
+  # MC is currently broken with threads (deadlock => timeout)
   if(SIMGRID_HAVE_MC)
     ADD_TESH(smpi-mc-only-send-determinism --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/mc --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/examples/smpi/mc ${CMAKE_HOME_DIRECTORY}/examples/smpi/mc/only_send_deterministic.tesh)
+    ADD_TESH_FACTORIES(smpi-mc-sendsend "ucontext;raw;boost" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/mc --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/examples/smpi/mc ${CMAKE_HOME_DIRECTORY}/examples/smpi/mc/sendsend.tesh)
   endif()
 
   ADD_TESH(smpi-tracing        --setenv bindir=${CMAKE_BINARY_DIR}/examples/smpi/trace --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/trace --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/examples/smpi/trace ${CMAKE_HOME_DIRECTORY}/examples/smpi/trace/trace.tesh)
index 8e4a51a..79f55d9 100644 (file)
@@ -1,15 +1,10 @@
-# use the tested library, not the installed one
-# (since we want to pass it to the child, it has to be redefined before each command)
-# Go for the first test
-
 p Test if the load balancing code gets traced correctly
-! timeout 60
 
 $ rm -rf ${bindir:=.}/smpi_trace.trace ${bindir:=.}/smpi_trace.trace_files
 
 $ ../../smpi_script/bin/smpirun -trace-ti --cfg=tracing/filename:${bindir:=.}/smpi_trace.trace --cfg=tracing/smpi/format/ti-one-file:yes -no-privatize -replay ${srcdir:=.}/replay/actions_bcast.txt --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./ampi_test/smpi_ampi_test --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/wtime:0
 
-$ bash -c "cat ${bindir:=.}/smpi_trace.trace_files/*"
+$ sh -c "cat ${bindir:=.}/smpi_trace.trace_files/*"
 > 0 init
 > 0 iteration_in
 > 0 iteration_out
diff --git a/examples/smpi/energy/f77/CMakeLists.txt b/examples/smpi/energy/f77/CMakeLists.txt
deleted file mode 100644 (file)
index 1f95dc7..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-if(enable_smpi AND SMPI_FORTRAN)
-  set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
-  add_executable       (sef EXCLUDE_FROM_ALL sef.f)
-  target_link_libraries(sef simgrid)
-  add_dependencies(tests sef)
-  ADD_TESH_FACTORIES(smpi-energy-f77 "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/f77/energy.tesh)
-endif()
-
-set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/energy.tesh  PARENT_SCOPE)
-set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/sef.f        PARENT_SCOPE)
diff --git a/examples/smpi/energy/f77/energy.tesh b/examples/smpi/energy/f77/energy.tesh
deleted file mode 100644 (file)
index 3b4e9e1..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-p Test smpi bindings for dvfs functions (Fortran 77 example)
-
-$ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile  -platform ${srcdir:=.}/../../platforms/energy_platform.xml --cfg=smpi/simulate-computation:no ${bindir:=.}/f77/sef --cfg=plugin:host_energy --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/wtime:0
-> [     0.00000000] [rank  0]  3 pstates available
-> [     0.00000000] [rank  0] Power:  100000000.0000
-> [     0.00000000] [rank  0] Power:   50000000.0000
-> [     0.00000000] [rank  0] Power:   20000000.0000
-> [     0.00000000] [rank  1]  3 pstates available
-> [     0.00000000] [rank  1] Power:  100000000.0000
-> [     0.00000000] [rank  1] Power:   50000000.0000
-> [     0.00000000] [rank  1] Power:   20000000.0000
-> [     0.00000000] [rank  0] Current pstate:  0; Current power:  100000000.0000
-> [     0.00000000] [rank  1] Current pstate:  0; Current power:  100000000.0000
-> [    10.00000000] [rank  0] Energy consumed (Joules):       1200.0000
-> [    10.00000000] [rank  1] Energy consumed (Joules):       2000.0000
-> [    10.00000000] [rank  0] Current pstate:  1; Current power:   50000000.0000
-> [    10.00000000] [rank  1] Current pstate:  1; Current power:   50000000.0000
-> [    30.00000000] [rank  0] Energy consumed (Joules):       3400.0000
-> [    30.00000000] [rank  1] Energy consumed (Joules):       5400.0000
-> [    30.00000000] [rank  0] Current pstate:  2; Current power:   20000000.0000
-> [    30.00000000] [rank  1] Current pstate:  2; Current power:   20000000.0000
-> [    80.00000000] [rank  0] Energy consumed (Joules):       8650.0000
-> [    80.00000000] [rank  1] Energy consumed (Joules):      12900.0000
-> [80.000000] [surf_energy/INFO] Total energy consumption: 29550.000000 Joules (used hosts: 21550.000000 Joules; unused/idle hosts: 8000.000000)
-> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost1: 8650.000000 Joules
-> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost2: 12900.000000 Joules
-> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost3: 8000.000000 Joules
diff --git a/examples/smpi/energy/f77/sef.f b/examples/smpi/energy/f77/sef.f
deleted file mode 100644 (file)
index f8d96c3..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-! Copyright (c) 2013-2019. The SimGrid Team.
-! All rights reserved.
-
-! This program is free software; you can redistribute it and/or modify it
-! under the terms of the license (GNU LGPL) which comes with this package.
-
-      program main
-      include 'mpif.h'
-
-      integer ierr
-      integer rank, pstates
-      integer i
-      double precision p, t, e
-
-      call MPI_Init(ierr)
-      if (ierr .ne. MPI_SUCCESS) then
-         print *, 'MPI_Init failed:', ierr
-         stop 1
-      endif
-      call MPI_Comm_rank(MPI_COMM_WORLD, rank, ierr)
-      if (ierr .ne. MPI_SUCCESS) then
-         print *, 'MPI_Comm_rank failed:', ierr
-         call MPI_Abort(MPI_COMM_WORLD, 1, ierr)
-         stop 1
-      endif
-
-      pstates = smpi_get_host_nb_pstates()
-
-      t = MPI_Wtime()
-
-      print '(1a,F15.8,1a,i2,1a,i2,1a)', '[', t, '] [rank ', rank, '] ',
-     &     pstates, ' pstates available'
-
-      do i = 0, pstates - 1
-         p = smpi_get_host_power_peak_at(i)
-         print '(1a,F15.8,1a,i2,1a,F15.4)', '[', t, '] [rank ',
-     &     rank, '] Power: ', p
-      end do
-
-      do i = 0, pstates - 1
-         call smpi_set_host_pstate(i)
-         t = MPI_Wtime()
-         p = smpi_get_host_current_power_peak()
-         print '(1a,F15.8,1a,i2,1a,i2,1a,F15.4)', '[', t, '] [rank ',
-     &         rank,'] Current pstate: ', i,'; Current power: ', p
-
-         e = 1e9
-         call smpi_execute_flops(e)
-
-         t = MPI_Wtime()
-         e = smpi_get_host_consumed_energy()
-         print '(1a,F15.8,1a,i2,1a,1a,F15.4)', '[', t, '] [rank ',
-     &         rank, ']',' Energy consumed (Joules): ', e
-      end do
-
-      flush(6)
-
-      call MPI_Finalize(ierr)
-      if (ierr .ne. MPI_SUCCESS) then
-         print *, 'MPI_Finalize failed:', ierr
-         call MPI_Abort(MPI_COMM_WORLD, 1, ierr)
-         stop 1
-      endif
-
-      end program main
diff --git a/examples/smpi/energy/f90/CMakeLists.txt b/examples/smpi/energy/f90/CMakeLists.txt
deleted file mode 100644 (file)
index 9a107d5..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-if(enable_smpi AND SMPI_FORTRAN)
-  set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
-  add_executable       (sef90 EXCLUDE_FROM_ALL sef90.f90)
-  target_link_libraries(sef90 simgrid mpi)
-  add_dependencies(tests sef90)
-  ADD_TESH_FACTORIES(smpi-energy-f90 "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/f90/energy.tesh)
-endif()
-
-set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/energy.tesh  PARENT_SCOPE)
-set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/sef90.f90    PARENT_SCOPE)
diff --git a/examples/smpi/energy/f90/energy.tesh b/examples/smpi/energy/f90/energy.tesh
deleted file mode 100644 (file)
index 1b759d4..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-p Test smpi bindings for dvfs functions (Fortran 90 example)
-
-$ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile  -platform ${srcdir:=.}/../../platforms/energy_platform.xml --cfg=smpi/simulate-computation:no ${bindir:=.}/f90/sef90 --cfg=plugin:host_energy --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/wtime:0
-> [     0.00000000] [rank  0]  3 pstates available
-> [     0.00000000] [rank  0] Power:  100000000.0000
-> [     0.00000000] [rank  0] Power:   50000000.0000
-> [     0.00000000] [rank  0] Power:   20000000.0000
-> [     0.00000000] [rank  1]  3 pstates available
-> [     0.00000000] [rank  1] Power:  100000000.0000
-> [     0.00000000] [rank  1] Power:   50000000.0000
-> [     0.00000000] [rank  1] Power:   20000000.0000
-> [     0.00000000] [rank  0] Current pstate:  0; Current power:  100000000.0000
-> [     0.00000000] [rank  1] Current pstate:  0; Current power:  100000000.0000
-> [    10.00000000] [rank  0] Energy consumed (Joules):       1200.0000
-> [    10.00000000] [rank  1] Energy consumed (Joules):       2000.0000
-> [    10.00000000] [rank  0] Current pstate:  1; Current power:   50000000.0000
-> [    10.00000000] [rank  1] Current pstate:  1; Current power:   50000000.0000
-> [    30.00000000] [rank  0] Energy consumed (Joules):       3400.0000
-> [    30.00000000] [rank  1] Energy consumed (Joules):       5400.0000
-> [    30.00000000] [rank  0] Current pstate:  2; Current power:   20000000.0000
-> [    30.00000000] [rank  1] Current pstate:  2; Current power:   20000000.0000
-> [    80.00000000] [rank  0] Energy consumed (Joules):       8650.0000
-> [    80.00000000] [rank  1] Energy consumed (Joules):      12900.0000
-> [80.000000] [surf_energy/INFO] Total energy consumption: 29550.000000 Joules (used hosts: 21550.000000 Joules; unused/idle hosts: 8000.000000)
-> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost1: 8650.000000 Joules
-> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost2: 12900.000000 Joules
-> [80.000000] [surf_energy/INFO] Energy consumption of host MyHost3: 8000.000000 Joules
diff --git a/examples/smpi/energy/f90/sef90.f90 b/examples/smpi/energy/f90/sef90.f90
deleted file mode 100644 (file)
index 245dfa9..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-! Copyright (c) 2013-2019. The SimGrid Team.
-! All rights reserved.
-
-! This program is free software; you can redistribute it and/or modify it
-! under the terms of the license (GNU LGPL) which comes with this package.
-
-program main
-  use mpi
-
-  integer ierr
-  integer rank, pstates
-  integer i
-  double precision p, t, e
-
-  call MPI_Init(ierr)
-  if (ierr .ne. MPI_SUCCESS) then
-     print *, 'MPI_Init failed:', ierr
-     stop 1
-  endif
-  call MPI_Comm_rank(MPI_COMM_WORLD, rank, ierr)
-  if (ierr .ne. MPI_SUCCESS) then
-     print *, 'MPI_Comm_rank failed:', ierr
-     call MPI_Abort(MPI_COMM_WORLD, 1, ierr)
-     stop 1
-  endif
-
-  pstates = smpi_get_host_nb_pstates()
-
-  t = MPI_Wtime()
-
-  print '(1a,F15.8,1a,i2,1a,i2,1a)', '[', t, '] [rank ', rank, '] ',&
-    pstates, ' pstates available'
-  do i = 0, pstates - 1
-     p = smpi_get_host_power_peak_at(i)
-     print '(1a,F15.8,1a,i2,1a,F15.4)', '[', t, '] [rank ', rank, &
-    '] Power: ', p
-  end do
-
-  do i = 0, pstates - 1
-     call smpi_set_host_pstate(i)
-     t = MPI_Wtime()
-     p = smpi_get_host_current_power_peak()
-     print '(1a,F15.8,1a,i2,1a,i2,1a,F15.4)', '[', t, '] [rank ', &
-    rank, '] Current pstate: ', i, '; Current power: ', p
-
-     e = 1e9
-     call smpi_execute_flops(e)
-
-     t = MPI_Wtime()
-     e = smpi_get_host_consumed_energy()
-     print '(1a,F15.8,1a,i2,1a,F15.4)', '[', t, '] [rank ', &
-    rank, '] Energy consumed (Joules): ', e
-  end do
-
-  flush(6)
-
-  call MPI_Finalize(ierr)
-  if (ierr .ne. MPI_SUCCESS) then
-     print *, 'MPI_Finalize failed:', ierr
-     call MPI_Abort(MPI_COMM_WORLD, 1, ierr)
-     stop 1
-  endif
-
-end program main
index 8b6147f..22ff676 100644 (file)
@@ -1,11 +1,11 @@
 #!/usr/bin/env 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_backbone.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_backbone.xml --cfg=model-check/communications-determinism:1 --cfg=smpi/buffering:zero --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] *******************************************************
 > [0.000000] [mc_comm_determinism/INFO] **** Only-send-deterministic communication pattern ****
-> [0.000000] [mc_comm_determinism/INFO] ******************************************************
+> [0.000000] [mc_comm_determinism/INFO] *******************************************************
 > [0.000000] [mc_comm_determinism/INFO] The recv communications pattern of the process 0 is different! Different source for communication #2
 > [0.000000] [mc_comm_determinism/INFO] Expanded states = 520
 > [0.000000] [mc_comm_determinism/INFO] Visited states = 1476
diff --git a/examples/smpi/mc/sendsend.c b/examples/smpi/mc/sendsend.c
new file mode 100644 (file)
index 0000000..cf83ee3
--- /dev/null
@@ -0,0 +1,48 @@
+/* A simple bugged MPI_Send and MPI_Recv test: it deadlocks when MPI_Send are blocking */
+
+/* Copyright (c) 2009-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include <mpi.h>
+#include <stdio.h>
+
+int main(int argc, char** argv)
+{
+  int size;
+  int rank;
+  MPI_Status status;
+
+  /* Initialize MPI */
+  int err = MPI_Init(&argc, &argv);
+  if (err != MPI_SUCCESS) {
+    printf("MPI initialization failed!\n");
+    exit(1);
+  }
+
+  MPI_Comm_size(MPI_COMM_WORLD, &size); /* Get nr of tasks */
+  MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* Get id of this process */
+  if (size < 2) {
+    printf("run this program with exactly 2 processes (-np 2)\n");
+    MPI_Finalize();
+    exit(0);
+  }
+
+  int recv_buff;
+  if (rank == 0) {
+    MPI_Send(&rank, 1, MPI_INT, 1, 42, MPI_COMM_WORLD);
+    printf("Sent %d to rank 1\n", rank);
+    MPI_Recv(&recv_buff, 1, MPI_INT, 1, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+    printf("rank 0 recv the data\n");
+  } else {
+    MPI_Send(&rank, 1, MPI_INT, 0, 42, MPI_COMM_WORLD);
+    printf("Sent %d to rank 0\n", rank);
+    MPI_Recv(&recv_buff, 1, MPI_INT, 0, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+    printf("rank 1 recv the data\n");
+  }
+
+  MPI_Finalize();
+
+  return 0;
+}
diff --git a/examples/smpi/mc/sendsend.tesh b/examples/smpi/mc/sendsend.tesh
new file mode 100644 (file)
index 0000000..7bb8a48
--- /dev/null
@@ -0,0 +1,27 @@
+#! ./tesh
+
+p Testing the permissive model
+! timeout 60
+$ ../../../smpi_script/bin/smpirun -quiet -wrapper "${bindir:=.}/../../../bin/simgrid-mc" -np 2 -platform ${platfdir:=.}/cluster_backbone.xml --cfg=smpi/buffering:infty --log=xbt_cfg.thresh:warning ./smpi_sendsend
+> [0.000000] [mc_safety/INFO] Check a safety property. Reduction is: dpor.
+> [0.000000] [mc_safety/INFO] No property violation found.
+> [0.000000] [mc_safety/INFO] Expanded states = 7
+> [0.000000] [mc_safety/INFO] Visited states = 10
+> [0.000000] [mc_safety/INFO] Executed transitions = 8
+
+p Testing the paranoid model
+! timeout 60
+! expect return 3
+$ ../../../smpi_script/bin/smpirun -quiet -wrapper "${bindir:=.}/../../../bin/simgrid-mc" -np 2 -platform ${platfdir:=.}/cluster_backbone.xml --cfg=smpi/buffering:zero --log=xbt_cfg.thresh:warning ./smpi_sendsend
+> [0.000000] [mc_safety/INFO] Check a safety property. Reduction is: dpor.
+> [0.000000] [mc_global/INFO] **************************
+> [0.000000] [mc_global/INFO] *** DEADLOCK DETECTED ***
+> [0.000000] [mc_global/INFO] **************************
+> [0.000000] [mc_global/INFO] Counter-example execution trace:
+> [0.000000] [mc_global/INFO]   [(1)node-0.simgrid.org (0)] iSend(src=(1)node-0.simgrid.org (0), buff=(verbose only), size=(verbose only))
+> [0.000000] [mc_global/INFO]   [(2)node-1.simgrid.org (1)] iSend(src=(2)node-1.simgrid.org (1), buff=(verbose only), size=(verbose only))
+> [0.000000] [mc_record/INFO] Path = 1;2
+> [0.000000] [mc_safety/INFO] Expanded states = 3
+> [0.000000] [mc_safety/INFO] Visited states = 3
+> [0.000000] [mc_safety/INFO] Executed transitions = 2
+> Execution failed with code 3.
index 745104f..1d143a7 100644 (file)
@@ -8,7 +8,7 @@ p Test of trace replay with SMPI (one trace for all processes)
 $ mkfile replay/one_trace_override
 ! timeout 60
 
-$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Tremblay:0:(1) 0.000000] [smpi_replay/VERBOSE] 0 bcast 5e4 0.000000
 > [Jupiter:1:(2) 0.015036] [smpi_replay/VERBOSE] 1 bcast 5e4 0.015036
 > [Fafard:2:(3) 0.015676] [smpi_replay/VERBOSE] 2 bcast 5e4 0.015676
@@ -33,7 +33,7 @@ p The same with tracing activated
 < replay/actions_bcast.txt
 $ mkfile replay/one_trace_override
 
-$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=no_loc  --cfg=tracing:yes --cfg=tracing/smpi:yes --cfg=tracing/smpi/computing:yes --cfg=tracing/filename:./simgrid_override.trace --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile  --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=no_loc  --cfg=tracing:yes --cfg=tracing/smpi:yes --cfg=tracing/smpi/computing:yes --cfg=tracing/filename:./simgrid_override.trace  -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile  --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Fafard:2:(3) 19.691622] [smpi_replay/INFO] Simulation time 19.691622
 
 # $ rm -f replay/one_trace_override
@@ -153,10 +153,10 @@ $ tail -n +3 ./simgrid_override.trace
 > 4 4 0 1 1 MIGRATE_LINK
 > 2 5 1 MIGRATE_STATE
 > 6 0.000000 1 1 0 "rank-0"
-> 5 6 2 computing "0 1 1"
-> 5 7 2 smpi_replay_run_init "0 1 0"
 > 6 0.000000 2 1 0 "rank-1"
 > 6 0.000000 3 1 0 "rank-2"
+> 5 6 2 computing "0 1 1"
+> 5 7 2 smpi_replay_run_init "0 1 0"
 > 5 8 2 action_bcast "0 0.78 0.39"
 > 12 0.000000 2 1 7
 > 13 0.000000 2 1
@@ -195,16 +195,16 @@ $ tail -n +3 ./simgrid_override.trace
 > 12 13.138198 2 3 9
 > 13 14.286929 2 2
 > 12 14.286929 2 2 10
+> 13 14.286929 2 2
+> 7 14.286929 1 2
 > 13 18.250974 2 1
 > 12 18.250974 2 1 10
+> 13 18.250974 2 1
+> 7 18.250974 1 1
 > 13 19.691622 2 3
 > 12 19.691622 2 3 10
 > 13 19.691622 2 3
 > 7 19.691622 1 3
-> 13 19.691622 2 2
-> 7 19.691622 1 2
-> 13 19.691622 2 1
-> 7 19.691622 1 1
 
 $ rm -f ./simgrid_override.trace
 
@@ -214,9 +214,9 @@ p Another test of trace replay with SMPI (one trace per process)
 < replay/actions1.txt
 $ mkfile ./split_traces_tesh_override
 
-$ ../../smpi_script/bin/smpirun -no-privatize -replay ./split_traces_tesh_override --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 2 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
-> [Jupiter:1:(2) 0.167158] [smpi_replay/VERBOSE] 1 recv 0 0 1e6 0.167158
+$ ../../smpi_script/bin/smpirun -no-privatize -replay ./split_traces_tesh_override --log=smpi_replay.thresh:verbose --log=no_loc  -np 2 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Tremblay:0:(1) 0.167158] [smpi_replay/VERBOSE] 0 send 1 0 1e6 0.167158
+> [Jupiter:1:(2) 0.167158] [smpi_replay/VERBOSE] 1 recv 0 0 1e6 0.167158
 > [Jupiter:1:(2) 13.274005] [smpi_replay/VERBOSE] 1 compute 1e9 13.106847
 > [Jupiter:1:(2) 13.274005] [smpi_replay/VERBOSE] 1 isend 0 1 1e6 0.000000
 > [Jupiter:1:(2) 13.274005] [smpi_replay/VERBOSE] 1 irecv 0 2 1e6 0.000000
@@ -232,9 +232,9 @@ p Test of barrier replay with SMPI (one trace for all processes)
 < replay/actions_barrier.txt
 $ mkfile replay/one_trace_override
 
-$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
-> [Jupiter:1:(2) 1.518421] [smpi_replay/VERBOSE] 1 recv 0 0 1e7 1.518421
+$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc  -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Tremblay:0:(1) 1.518421] [smpi_replay/VERBOSE] 0 send 1 0 1e7 1.518421
+> [Jupiter:1:(2) 1.518421] [smpi_replay/VERBOSE] 1 recv 0 0 1e7 1.518421
 > [Tremblay:0:(1) 1.520397] [smpi_replay/VERBOSE] 0 barrier 0.001976
 > [Jupiter:1:(2) 1.521858] [smpi_replay/VERBOSE] 1 barrier 0.003438
 > [Fafard:2:(3) 1.522373] [smpi_replay/VERBOSE] 2 barrier 1.522373
@@ -250,7 +250,7 @@ p Test of isend replay with SMPI (one trace for all processes)
 < replay/actions_with_isend.txt
 $ mkfile replay/one_trace_override
 
-$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc  -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Jupiter:1:(2) 0.000000] [smpi_replay/VERBOSE] 1 irecv 0 0 1e6 0.000000
 > [Jupiter:1:(2) 6.553424] [smpi_replay/VERBOSE] 1 compute 5e8 6.553424
 > [Jupiter:1:(2) 6.553524] [smpi_replay/VERBOSE] 1 test 0 1 0 0.000100
@@ -278,7 +278,7 @@ p Test of AllReduce replay with SMPI (one trace for all processes)
 < replay/actions_allreduce.txt
 $ mkfile replay/one_trace_override
 
-$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc  -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Tremblay:0:(1) 5.112775] [smpi_replay/VERBOSE] 0 allreduce 5e4 5e8 5.112775
 > [Jupiter:1:(2) 6.584135] [smpi_replay/VERBOSE] 1 allreduce 5e4 5e8 6.584135
 > [Fafard:2:(3) 6.584775] [smpi_replay/VERBOSE] 2 allreduce 5e4 5e8 6.584775
@@ -294,7 +294,7 @@ p Test of AllToAll replay with SMPI (one trace for all processes)
 < replay/actions_alltoall.txt
 $ mkfile replay/one_trace_override
 
-$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc  -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Tremblay:0:(1) 0.004041] [smpi_replay/VERBOSE] 0 alltoall 500 500 0.004041
 > [Fafard:2:(3) 0.006920] [smpi_replay/VERBOSE] 2 alltoall 500 500 0.006920
 > [Jupiter:1:(2) 0.006920] [smpi_replay/VERBOSE] 1 alltoall 500 500 0.006920
@@ -309,7 +309,7 @@ p Test of AllToAllv replay with SMPI (one trace for all processes)
 < replay/actions_alltoallv.txt
 $ mkfile replay/one_trace_override
 
-$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc  -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Tremblay:0:(1) 0.004000] [smpi_replay/VERBOSE] 0 alltoallv 100 1 40 30 1000 1 80 100 0.004000
 > [Jupiter:1:(2) 0.006935] [smpi_replay/VERBOSE] 1 alltoallv 1000 80 1 40 1000 40 1 30 0.006935
 > [Fafard:2:(3) 0.006936] [smpi_replay/VERBOSE] 2 alltoallv 1000 100 30 1 1000 30 40 1 0.006936
@@ -322,7 +322,7 @@ p Test of AllGatherv replay with SMPI (one trace for all processes)
 < replay/actions_allgatherv.txt
 $ mkfile replay/one_trace_override
 
-$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 4 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc  -np 4 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Tremblay:0:(1) 1.397261] [smpi_replay/VERBOSE] 0 allgatherv 275427 275427 275427 275427 204020 0 0 1.397261
 > [Ginette:3:(4) 1.760421] [smpi_replay/VERBOSE] 3 allgatherv 204020 275427 275427 275427 204020 0 0 1.760421
 > [Fafard:2:(3) 1.941986] [smpi_replay/VERBOSE] 2 allgatherv 275427 275427 275427 275427 204020 0 0 1.941986
@@ -337,7 +337,7 @@ p Test of waitall replay with SMPI (one trace for all processes)
 $ mkfile replay/one_trace_override
 
 ! output sort 19
-$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc  -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Fafard:2:(3) 0.000000] [smpi_replay/VERBOSE] 2 irecv 1 1 3000 0.000000
 > [Fafard:2:(3) 0.000000] [smpi_replay/VERBOSE] 2 isend 0 2 3000 0.000000
 > [Jupiter:1:(2) 0.000000] [smpi_replay/VERBOSE] 1 isend 0 0 2000 0.000000
index 92ab687..0f3dbac 100644 (file)
@@ -8,7 +8,7 @@ p Test of trace replay with SMPI (one trace for all processes)
 $ mkfile replay/one_trace
 ! timeout 60
 
-$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc  -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Tremblay:0:(1) 0.000000] [smpi_replay/VERBOSE] 0 bcast 5e4 0.000000
 > [Jupiter:1:(2) 0.015036] [smpi_replay/VERBOSE] 1 bcast 5e4 0.015036
 > [Fafard:2:(3) 0.015676] [smpi_replay/VERBOSE] 2 bcast 5e4 0.015676
@@ -33,7 +33,7 @@ p The same with tracing activated
 < replay/actions_bcast.txt
 $ mkfile replay/one_trace
 
-$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=no_loc  --cfg=tracing:yes --cfg=tracing/smpi:yes --cfg=tracing/smpi/computing:yes --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay  --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=no_loc  --cfg=tracing:yes --cfg=tracing/smpi:yes --cfg=tracing/smpi/computing:yes  -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay  --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Fafard:2:(3) 19.691622] [smpi_replay/INFO] Simulation time 19.691622
 
 $ rm -f replay/one_trace
@@ -153,10 +153,10 @@ $ tail -n +3 ./simgrid.trace
 > 4 4 0 1 1 MIGRATE_LINK
 > 2 5 1 MIGRATE_STATE
 > 6 0.000000 1 1 0 "rank-0"
-> 5 6 2 computing "0 1 1"
-> 5 7 2 smpi_replay_run_init "0 1 0"
 > 6 0.000000 2 1 0 "rank-1"
 > 6 0.000000 3 1 0 "rank-2"
+> 5 6 2 computing "0 1 1"
+> 5 7 2 smpi_replay_run_init "0 1 0"
 > 5 8 2 action_bcast "0 0.78 0.39"
 > 12 0.000000 2 1 7
 > 13 0.000000 2 1
@@ -195,16 +195,16 @@ $ tail -n +3 ./simgrid.trace
 > 12 13.138198 2 3 9
 > 13 14.286929 2 2
 > 12 14.286929 2 2 10
+> 13 14.286929 2 2
+> 7 14.286929 1 2
 > 13 18.250974 2 1
 > 12 18.250974 2 1 10
+> 13 18.250974 2 1
+> 7 18.250974 1 1
 > 13 19.691622 2 3
 > 12 19.691622 2 3 10
 > 13 19.691622 2 3
 > 7 19.691622 1 3
-> 13 19.691622 2 2
-> 7 19.691622 1 2
-> 13 19.691622 2 1
-> 7 19.691622 1 1
 
 $ rm -f ./simgrid.trace
 
@@ -214,9 +214,9 @@ p Another test of trace replay with SMPI (one trace per process)
 < replay/actions1.txt
 $ mkfile ./split_traces_tesh
 
-$ ../../smpi_script/bin/smpirun -no-privatize -replay ./split_traces_tesh --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 2 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
-> [Jupiter:1:(2) 0.167158] [smpi_replay/VERBOSE] 1 recv 0 0 1e6 0.167158
+$ ../../smpi_script/bin/smpirun -no-privatize -replay ./split_traces_tesh --log=smpi_replay.thresh:verbose --log=no_loc  -np 2 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Tremblay:0:(1) 0.167158] [smpi_replay/VERBOSE] 0 send 1 0 1e6 0.167158
+> [Jupiter:1:(2) 0.167158] [smpi_replay/VERBOSE] 1 recv 0 0 1e6 0.167158
 > [Jupiter:1:(2) 13.274005] [smpi_replay/VERBOSE] 1 compute 1e9 13.106847
 > [Jupiter:1:(2) 13.274005] [smpi_replay/VERBOSE] 1 isend 0 1 1e6 0.000000
 > [Jupiter:1:(2) 13.274005] [smpi_replay/VERBOSE] 1 irecv 0 2 1e6 0.000000
@@ -232,9 +232,9 @@ p Test of barrier replay with SMPI (one trace for all processes)
 < replay/actions_barrier.txt
 $ mkfile replay/one_trace
 
-$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
-> [Jupiter:1:(2) 1.518421] [smpi_replay/VERBOSE] 1 recv 0 0 1e7 1.518421
+$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc  -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Tremblay:0:(1) 1.518421] [smpi_replay/VERBOSE] 0 send 1 0 1e7 1.518421
+> [Jupiter:1:(2) 1.518421] [smpi_replay/VERBOSE] 1 recv 0 0 1e7 1.518421
 > [Tremblay:0:(1) 1.520397] [smpi_replay/VERBOSE] 0 barrier 0.001976
 > [Jupiter:1:(2) 1.521858] [smpi_replay/VERBOSE] 1 barrier 0.003438
 > [Fafard:2:(3) 1.522373] [smpi_replay/VERBOSE] 2 barrier 1.522373
@@ -250,7 +250,7 @@ p Test of isend replay with SMPI (one trace for all processes)
 < replay/actions_with_isend.txt
 $ mkfile replay/one_trace
 
-$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc  -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Jupiter:1:(2) 0.000000] [smpi_replay/VERBOSE] 1 irecv 0 0 1e6 0.000000
 > [Jupiter:1:(2) 6.553424] [smpi_replay/VERBOSE] 1 compute 5e8 6.553424
 > [Jupiter:1:(2) 6.553524] [smpi_replay/VERBOSE] 1 test 0 1 0 0.000100
@@ -278,7 +278,7 @@ p Test of AllReduce replay with SMPI (one trace for all processes)
 < replay/actions_allreduce.txt
 $ mkfile replay/one_trace
 
-$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc  -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Tremblay:0:(1) 5.112775] [smpi_replay/VERBOSE] 0 allreduce 5e4 5e8 5.112775
 > [Jupiter:1:(2) 6.584135] [smpi_replay/VERBOSE] 1 allreduce 5e4 5e8 6.584135
 > [Fafard:2:(3) 6.584775] [smpi_replay/VERBOSE] 2 allreduce 5e4 5e8 6.584775
@@ -294,7 +294,7 @@ p Test of AllToAll replay with SMPI (one trace for all processes)
 < replay/actions_alltoall.txt
 $ mkfile replay/one_trace
 
-$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc  -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Tremblay:0:(1) 0.004041] [smpi_replay/VERBOSE] 0 alltoall 500 500 0.004041
 > [Fafard:2:(3) 0.006920] [smpi_replay/VERBOSE] 2 alltoall 500 500 0.006920
 > [Jupiter:1:(2) 0.006920] [smpi_replay/VERBOSE] 1 alltoall 500 500 0.006920
@@ -309,7 +309,7 @@ p Test of AllToAllv replay with SMPI (one trace for all processes)
 < replay/actions_alltoallv.txt
 $ mkfile replay/one_trace
 
-$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc  -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Tremblay:0:(1) 0.004000] [smpi_replay/VERBOSE] 0 alltoallv 100 1 40 30 1000 1 80 100 0.004000
 > [Jupiter:1:(2) 0.006935] [smpi_replay/VERBOSE] 1 alltoallv 1000 80 1 40 1000 40 1 30 0.006935
 > [Fafard:2:(3) 0.006936] [smpi_replay/VERBOSE] 2 alltoallv 1000 100 30 1 1000 30 40 1 0.006936
@@ -322,7 +322,7 @@ p Test of AllGatherv replay with SMPI (one trace for all processes)
 < replay/actions_allgatherv.txt
 $ mkfile replay/one_trace
 
-$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 4 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc  -np 4 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Tremblay:0:(1) 1.397261] [smpi_replay/VERBOSE] 0 allgatherv 275427 275427 275427 275427 204020 0 0 1.397261
 > [Ginette:3:(4) 1.760421] [smpi_replay/VERBOSE] 3 allgatherv 204020 275427 275427 275427 204020 0 0 1.760421
 > [Fafard:2:(3) 1.941986] [smpi_replay/VERBOSE] 2 allgatherv 275427 275427 275427 275427 204020 0 0 1.941986
@@ -337,7 +337,7 @@ p Test of waitall replay with SMPI (one trace for all processes)
 $ mkfile replay/one_trace
 
 ! output sort 19
-$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc  -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [Fafard:2:(3) 0.000000] [smpi_replay/VERBOSE] 2 irecv 1 1 3000 0.000000
 > [Fafard:2:(3) 0.000000] [smpi_replay/VERBOSE] 2 isend 0 2 3000 0.000000
 > [Jupiter:1:(2) 0.000000] [smpi_replay/VERBOSE] 1 isend 0 0 2000 0.000000
index 9ca0587..c1376d7 100644 (file)
@@ -7,7 +7,7 @@ p This test needs maxmin/concurrency-limit=100 because it starts 64 hosts on 5 m
 ! timeout 120
 $ ./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] [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.
+> [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 https://simgrid.org/doc/latest/Configuring_SimGrid.html#automatic-benchmarking-of-smpi-code for more information.
 > [0.000000] [msg_test/INFO] Initializing instance 1 of size 32
 > [0.000000] [msg_test/INFO] Initializing instance 2 of size 32
 > [Ginette:2:(34) 37298.251477] [smpi_replay/INFO] Simulation time 10442.494756
index 13f842d..1a865a0 100644 (file)
@@ -13,9 +13,9 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml  ${srcdir
 > [   0.000000] (job_0000@Bourassa) Executing job 0 (smpi_app 'alone')
 > [   0.000000] (rank_0_0@Bourassa) Replaying rank 0 of job 0 (smpi_app 'alone')
 > [   0.000000] (rank_0_1@Fafard) Replaying rank 1 of job 0 (smpi_app 'alone')
+> [  77.638391] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'alone')
 > [  77.645196] (rank_0_0@Bourassa) Simulation time 77.645196
 > [  77.645196] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'alone')
-> [  77.645196] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'alone')
 > [  78.645196] (job_0000@Bourassa) Finished job 0 (smpi_app 'alone')
 > [  78.645196] (maestro@) Simulation finished! Final time: 78.6452
 
@@ -29,9 +29,9 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml  ${srcdir
 > [   0.000000] (job_0000@Bourassa) Executing job 0 (smpi_app 'alone')
 > [   0.000000] (rank_0_0@Bourassa) Replaying rank 0 of job 0 (smpi_app 'alone')
 > [   0.000000] (rank_0_1@Fafard) Replaying rank 1 of job 0 (smpi_app 'alone')
+> [  77.638391] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'alone')
 > [  77.645196] (rank_0_0@Bourassa) Simulation time 77.645196
 > [  77.645196] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'alone')
-> [  77.645196] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'alone')
 > [  78.645196] (job_0000@Bourassa) Finished job 0 (smpi_app 'alone')
 > [  78.645196] (maestro@) Simulation finished! Final time: 78.6452
 
index 6ae0a9f..8d539ec 100644 (file)
@@ -19,11 +19,11 @@ $ ./replay_multiple_manual ${srcdir:=.}/../../platforms/small_platform_with_rout
 > [   0.000000] (job_0001@Bourassa) Executing job 1 (smpi_app 'job1')
 > [   0.000000] (rank_1_0@Bourassa) Replaying rank 0 of job 1 (smpi_app 'job1')
 > [   0.000000] (rank_1_1@Fafard) Replaying rank 1 of job 1 (smpi_app 'job1')
+> [ 155.249699] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'job0')
+> [ 155.249699] (rank_1_1@Fafard) Finished replaying rank 1 of job 1 (smpi_app 'job1')
 > [ 155.256538] (rank_0_0@Bourassa) Simulation time 155.256538
 > [ 155.256538] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'job0')
-> [ 155.256538] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'job0')
 > [ 155.256538] (rank_1_0@Bourassa) Finished replaying rank 0 of job 1 (smpi_app 'job1')
-> [ 155.256538] (rank_1_1@Fafard) Finished replaying rank 1 of job 1 (smpi_app 'job1')
 > [ 156.256538] (job_0000@Bourassa) Finished job 0 (smpi_app 'job0')
 > [ 156.256538] (job_0001@Bourassa) Finished job 1 (smpi_app 'job1')
 > [ 156.256538] (maestro@) Simulation finished! Final time: 156.257
index 2c75648..793eaf6 100644 (file)
@@ -13,7 +13,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml  ${srcdir
 > [   0.000000] (job_0000@Bourassa) Executing job 0 (smpi_app 'alone')
 > [   0.000000] (rank_0_0@Bourassa) Replaying rank 0 of job 0 (smpi_app 'alone')
 > [   0.000000] (rank_0_1@Fafard) Replaying rank 1 of job 0 (smpi_app 'alone')
-> [ 737.001374] (rank_0_1@Fafard) Simulation time 737.001374
+> [ 737.001374] (rank_0_0@Bourassa) Simulation time 737.001374
 > [ 737.001374] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'alone')
 > [ 737.001374] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'alone')
 > [ 738.001374] (job_0000@Bourassa) Finished job 0 (smpi_app 'alone')
@@ -29,7 +29,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml  ${srcdir
 > [   0.000000] (job_0000@Bourassa) Executing job 0 (smpi_app 'alone')
 > [   0.000000] (rank_0_0@Bourassa) Replaying rank 0 of job 0 (smpi_app 'alone')
 > [   0.000000] (rank_0_1@Fafard) Replaying rank 1 of job 0 (smpi_app 'alone')
-> [ 737.001374] (rank_0_1@Fafard) Simulation time 737.001374
+> [ 737.001374] (rank_0_0@Bourassa) Simulation time 737.001374
 > [ 737.001374] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'alone')
 > [ 737.001374] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'alone')
 > [ 738.001374] (job_0000@Bourassa) Finished job 0 (smpi_app 'alone')
index 8f3de7e..3e1221e 100644 (file)
@@ -15,7 +15,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:
 > [   0.000000] (workload@Bourassa) Sleeping 1000 seconds (waiting for job 1000, app 'job1')
 > [   0.000000] (rank_0_0@Bourassa) Replaying rank 0 of job 0 (smpi_app 'job0')
 > [   0.000000] (rank_0_1@Fafard) Replaying rank 1 of job 0 (smpi_app 'job0')
-> [ 737.001374] (rank_0_1@Fafard) Simulation time 737.001374
+> [ 737.001374] (rank_0_0@Bourassa) Simulation time 737.001374
 > [ 737.001374] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'job0')
 > [ 737.001374] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'job0')
 > [ 738.001374] (job_0000@Bourassa) Finished job 0 (smpi_app 'job0')
@@ -23,7 +23,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:
 > [1000.000000] (job_0001@Ginette) Executing job 1 (smpi_app 'job1')
 > [1000.000000] (rank_1_0@Ginette) Replaying rank 0 of job 1 (smpi_app 'job1')
 > [1000.000000] (rank_1_1@Jupiter) Replaying rank 1 of job 1 (smpi_app 'job1')
-> [1806.923160] (rank_1_1@Jupiter) Simulation time 806.923160
+> [1806.923160] (rank_1_0@Ginette) Simulation time 806.923160
 > [1806.923160] (rank_1_0@Ginette) Finished replaying rank 0 of job 1 (smpi_app 'job1')
 > [1806.923160] (rank_1_1@Jupiter) Finished replaying rank 1 of job 1 (smpi_app 'job1')
 > [1807.923160] (job_0001@Ginette) Finished job 1 (smpi_app 'job1')
@@ -41,7 +41,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:
 > [   0.000000] (workload@Bourassa) Sleeping 1000 seconds (waiting for job 1000, app 'job1')
 > [   0.000000] (rank_0_0@Bourassa) Replaying rank 0 of job 0 (smpi_app 'job0')
 > [   0.000000] (rank_0_1@Fafard) Replaying rank 1 of job 0 (smpi_app 'job0')
-> [ 737.001374] (rank_0_1@Fafard) Simulation time 737.001374
+> [ 737.001374] (rank_0_0@Bourassa) Simulation time 737.001374
 > [ 737.001374] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'job0')
 > [ 737.001374] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'job0')
 > [ 738.001374] (job_0000@Bourassa) Finished job 0 (smpi_app 'job0')
@@ -49,7 +49,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:
 > [1000.000000] (job_0001@Ginette) Executing job 1 (smpi_app 'job1')
 > [1000.000000] (rank_1_0@Ginette) Replaying rank 0 of job 1 (smpi_app 'job1')
 > [1000.000000] (rank_1_1@Jupiter) Replaying rank 1 of job 1 (smpi_app 'job1')
-> [1806.923160] (rank_1_1@Jupiter) Simulation time 806.923160
+> [1806.923160] (rank_1_0@Ginette) Simulation time 806.923160
 > [1806.923160] (rank_1_0@Ginette) Finished replaying rank 0 of job 1 (smpi_app 'job1')
 > [1806.923160] (rank_1_1@Jupiter) Finished replaying rank 1 of job 1 (smpi_app 'job1')
 > [1807.923160] (job_0001@Ginette) Finished job 1 (smpi_app 'job1')
@@ -75,7 +75,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:
 > [   0.000000] (workload@Bourassa) Sleeping 1000 seconds (waiting for job 1000, app 'job1')
 > [   0.000000] (rank_0_0@Bourassa) Replaying rank 0 of job 0 (smpi_app 'job0')
 > [   0.000000] (rank_0_1@Fafard) Replaying rank 1 of job 0 (smpi_app 'job0')
-> [ 737.001374] (rank_0_1@Fafard) Simulation time 737.001374
+> [ 737.001374] (rank_0_0@Bourassa) Simulation time 737.001374
 > [ 737.001374] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'job0')
 > [ 737.001374] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'job0')
 > [ 738.001374] (job_0000@Bourassa) Finished job 0 (smpi_app 'job0')
@@ -83,7 +83,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:
 > [1000.000000] (job_0001@Bourassa) Executing job 1 (smpi_app 'job1')
 > [1000.000000] (rank_1_0@Bourassa) Replaying rank 0 of job 1 (smpi_app 'job1')
 > [1000.000000] (rank_1_1@Fafard) Replaying rank 1 of job 1 (smpi_app 'job1')
-> [1737.001374] (rank_1_1@Fafard) Simulation time 737.001374
+> [1737.001374] (rank_1_0@Bourassa) Simulation time 737.001374
 > [1737.001374] (rank_1_0@Bourassa) Finished replaying rank 0 of job 1 (smpi_app 'job1')
 > [1737.001374] (rank_1_1@Fafard) Finished replaying rank 1 of job 1 (smpi_app 'job1')
 > [1738.001374] (job_0001@Bourassa) Finished job 1 (smpi_app 'job1')
@@ -101,7 +101,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:
 > [   0.000000] (workload@Bourassa) Sleeping 1000 seconds (waiting for job 1000, app 'job1')
 > [   0.000000] (rank_0_0@Bourassa) Replaying rank 0 of job 0 (smpi_app 'job0')
 > [   0.000000] (rank_0_1@Fafard) Replaying rank 1 of job 0 (smpi_app 'job0')
-> [ 737.001374] (rank_0_1@Fafard) Simulation time 737.001374
+> [ 737.001374] (rank_0_0@Bourassa) Simulation time 737.001374
 > [ 737.001374] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'job0')
 > [ 737.001374] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'job0')
 > [ 738.001374] (job_0000@Bourassa) Finished job 0 (smpi_app 'job0')
@@ -109,7 +109,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir:
 > [1000.000000] (job_0001@Bourassa) Executing job 1 (smpi_app 'job1')
 > [1000.000000] (rank_1_0@Bourassa) Replaying rank 0 of job 1 (smpi_app 'job1')
 > [1000.000000] (rank_1_1@Fafard) Replaying rank 1 of job 1 (smpi_app 'job1')
-> [1737.001374] (rank_1_1@Fafard) Simulation time 737.001374
+> [1737.001374] (rank_1_0@Bourassa) Simulation time 737.001374
 > [1737.001374] (rank_1_0@Bourassa) Finished replaying rank 0 of job 1 (smpi_app 'job1')
 > [1737.001374] (rank_1_1@Fafard) Finished replaying rank 1 of job 1 (smpi_app 'job1')
 > [1738.001374] (job_0001@Bourassa) Finished job 1 (smpi_app 'job1')
index b70b166..d67b84f 100644 (file)
@@ -16,8 +16,8 @@ $ ./replay_multiple_manual ${srcdir:=.}/../../platforms/small_platform_with_rout
 > [ 737.001374] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'job0')
 > [ 737.001374] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'job0')
 > [ 738.001374] (job_0000@Bourassa) Finished job 0 (smpi_app 'job0')
+> [ 806.923160] (rank_1_0@Ginette) Simulation time 806.923160
 > [ 806.923160] (rank_1_0@Ginette) Finished replaying rank 0 of job 1 (smpi_app 'job1')
-> [ 806.923160] (rank_1_1@Jupiter) Simulation time 806.923160
 > [ 806.923160] (rank_1_1@Jupiter) Finished replaying rank 1 of job 1 (smpi_app 'job1')
 > [ 807.923160] (job_0001@Ginette) Finished job 1 (smpi_app 'job1')
 > [ 807.923160] (maestro@) Simulation finished! Final time: 807.923
index 5a94862..100b277 100644 (file)
@@ -16,7 +16,7 @@ $ ./replay_multiple_manual ${srcdir:=.}/../../platforms/small_platform_with_rout
 > [ 737.001374] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'job0')
 > [ 737.001374] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'job0')
 > [ 738.001374] (job_0000@Bourassa) Finished job 0 (smpi_app 'job0')
-> [ 806.923160] (rank_1_1@Jupiter) Simulation time 806.923160
+> [ 806.923160] (rank_1_0@Ginette) Simulation time 806.923160
 > [ 806.923160] (rank_1_0@Ginette) Finished replaying rank 0 of job 1 (smpi_app 'job1')
 > [ 806.923160] (rank_1_1@Jupiter) Finished replaying rank 1 of job 1 (smpi_app 'job1')
 > [ 807.923160] (job_0001@Ginette) Finished job 1 (smpi_app 'job1')
index 36484ff..8eaaa2e 100644 (file)
@@ -13,7 +13,7 @@ $ ./replay_multiple_manual ${srcdir:=.}/../../platforms/small_platform_with_rout
 > [   0.000000] (job_0001@Bourassa) Executing job 1 (smpi_app 'job1')
 > [   0.000000] (rank_1_0@Bourassa) Replaying rank 0 of job 1 (smpi_app 'job1')
 > [   0.000000] (rank_1_1@Fafard) Replaying rank 1 of job 1 (smpi_app 'job1')
-> [1473.975664] (rank_0_1@Fafard) Simulation time 1473.975664
+> [1473.975664] (rank_0_0@Bourassa) Simulation time 1473.975664
 > [1473.975664] (rank_1_0@Bourassa) Finished replaying rank 0 of job 1 (smpi_app 'job1')
 > [1473.975664] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'job0')
 > [1473.975664] (rank_1_1@Fafard) Finished replaying rank 1 of job 1 (smpi_app 'job1')
index ed71229..d72130b 100644 (file)
@@ -13,7 +13,7 @@ $ ./replay_multiple_manual ${srcdir:=.}/../../platforms/small_platform_with_rout
 > [   0.000000] (job_0001@Bourassa) Executing job 1 (smpi_app 'job1')
 > [   0.000000] (rank_1_0@Bourassa) Replaying rank 0 of job 1 (smpi_app 'job1')
 > [   0.000000] (rank_1_1@Fafard) Replaying rank 1 of job 1 (smpi_app 'job1')
-> [1473.975664] (rank_0_1@Fafard) Simulation time 1473.975664
+> [1473.975664] (rank_0_0@Bourassa) Simulation time 1473.975664
 > [1473.975664] (rank_1_0@Bourassa) Finished replaying rank 0 of job 1 (smpi_app 'job1')
 > [1473.975664] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'job0')
 > [1473.975664] (rank_1_1@Fafard) Finished replaying rank 1 of job 1 (smpi_app 'job1')
index 1fe801a..5fe9cc1 100644 (file)
@@ -12,6 +12,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example")
 
 static int master(int argc, char *argv[])
 {
+  xbt_assert(argc == 5);
   long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
   double task_comp_size = xbt_str_parse_double(argv[2], "Invalid computational size: %s");
   double task_comm_size = xbt_str_parse_double(argv[3], "Invalid communication size: %s");
@@ -86,6 +87,7 @@ static int alltoall_mpi(int argc, char *argv[])
 
 static int slave(int argc, char *argv[])
 {
+  xbt_assert(argc == 2);
   msg_task_t task = NULL;
   XBT_ATTRIB_UNUSED int res;
   int id = -1;
index 37644ee..1fa33fa 100644 (file)
@@ -1,7 +1,7 @@
 p Test the use of SMPI+MSG in the same file, as well as several different SMPI instances at the same time
 $ ./masterslave_mailbox_smpi ${srcdir:=.}/../../platforms/small_platform_with_routers.xml ${srcdir:=.}/deployment_masterslave_mailbox_smpi.xml --log=smpi.:info --cfg=smpi/simulate-computation:no
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/simulate-computation' to 'no'
-> [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.
+> [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 https://simgrid.org/doc/latest/Configuring_SimGrid.html#automatic-benchmarking-of-smpi-code for more information.
 > [Tremblay:master:(1) 0.000000] [msg_test/INFO] Got 1 slaves and 20 tasks to process
 > [Tremblay:master:(1) 0.000000] [msg_test/INFO] Sending "Task_0" (of 20) to mailbox "slave-0"
 > [Ginette:master_mpi:(3) 0.000000] [msg_test/INFO] here for rank 0
@@ -11,10 +11,10 @@ $ ./masterslave_mailbox_smpi ${srcdir:=.}/../../platforms/small_platform_with_ro
 > [Jupiter:alltoall_mpi:(7) 0.000000] [msg_test/INFO] alltoall for rank 2
 > [Fafard:alltoall_mpi:(8) 0.000000] [msg_test/INFO] alltoall for rank 3
 > [Ginette:master_mpi:(3) 0.000000] [msg_test/INFO] After comm 0
+> [Ginette:master_mpi:(3) 0.000000] [msg_test/INFO] After finalize 0 0
 > [Tremblay:master:(1) 0.002265] [msg_test/INFO] Sending "Task_1" (of 20) to mailbox "slave-0"
 > [Bourassa:master_mpi:(4) 0.016868] [msg_test/INFO] After comm 1
 > [Bourassa:master_mpi:(4) 0.016868] [msg_test/INFO] After finalize 1 0
-> [Ginette:master_mpi:(3) 0.016868] [msg_test/INFO] After finalize 0 0
 > [Ginette:alltoall_mpi:(5) 0.098642] [msg_test/INFO] after alltoall 0
 > [Fafard:alltoall_mpi:(8) 0.099069] [msg_test/INFO] after alltoall 3
 > [Bourassa:alltoall_mpi:(6) 0.127526] [msg_test/INFO] after alltoall 1
index 58dea5b..a527b6e 100644 (file)
@@ -1332,16 +1332,16 @@ $ tail -n +3 ${bindir:=.}/smpi_trace.trace
 > 12 11.902080 2 2 12
 > 13 11.904056 2 1
 > 12 11.904056 2 1 18
+> 13 11.904056 2 1
+> 13 11.905518 2 2
 > 13 11.905518 2 2
 > 12 11.905518 2 2 18
 > 13 11.906032 2 3
 > 12 11.906032 2 3 18
 > 13 11.906032 2 3
+> 7 11.904056 1 1
+> 7 11.905518 1 2
 > 7 11.906032 1 3
-> 13 11.906032 2 1
-> 7 11.906032 1 1
-> 13 11.906032 2 2
-> 7 11.906032 1 2
 $ rm -f ${bindir:=.}/smpi_trace.trace
 
 $ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace -trace-resource -trace-file ${bindir:=.}/smpi_trace.trace -hostfile ${srcdir:=.}/../hostfile -platform ${platfdir:=.}/small_platform.xml --cfg=path:${srcdir:=.}/../msg --cfg=smpi/host-speed:1 -np 3 ${bindir:=.}/smpi_trace --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
diff --git a/examples/smpi/trace_call_location/adjust b/examples/smpi/trace_call_location/adjust
new file mode 100644 (file)
index 0000000..03b309f
--- /dev/null
@@ -0,0 +1,2 @@
+"start:stop","ratio"
+"trace_call_location.c:15:trace_call_location.c:15","1000"
index 4397aaf..f2c5081 100644 (file)
@@ -12,6 +12,7 @@ int main(int argc, char *argv[])
 {
   MPI_Init(&argc, &argv);
   MPI_Barrier (MPI_COMM_WORLD);
+  sleep(1000);
   MPI_Finalize();
   return 0;
 }
index dc392a2..ee161dd 100644 (file)
@@ -4,8 +4,23 @@
 
 p Test SMPI with call-location tracing. This means that the binary must have
 p already been compiled with the -trace-call-location switch.
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace -trace-file ${bindir:=.}/smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/small_platform.xml --cfg=smpi/trace-call-location:1 -np 3 ${bindir:=.}/smpi_trace_call_location --cfg=smpi/host-speed:1 --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace -trace-file ${bindir:=.}/smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/small_platform.xml --cfg=smpi/trace-call-location:1 -np 3 ${bindir:=.}/smpi_trace_call_location --cfg=smpi/trace-call-use-absolute-path:1 --cfg=smpi/host-speed:1 --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 
-$ grep --quiet "12 0.* 2 1 7 .*trace_call_location\.c\" 14$" ${bindir:=.}/smpi_trace.trace 
+$ grep -q "12 0.* 2 1 7 .*trace_call_location\.c\" 14$" ${bindir:=.}/smpi_trace.trace 
 
 $ rm -f ${bindir:=.}/smpi_trace.trace 
+
+#the same, but with trace-ti
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace-ti -trace-file ${bindir:=.}/smpi_trace.txt --cfg=tracing/smpi/sleeping:1 -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/small_platform.xml --cfg=smpi/trace-call-location:1 -np 3 ${bindir:=.}/smpi_trace_call_location --cfg=smpi/host-speed:1 --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/cpu-threshold:0
+
+#Test replaying the trace, without altering the time.
+#We disable computation, but leave the sleep.
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/small_platform.xml -np 3 -replay ${bindir:=.}/smpi_trace.txt ${bindir:=.}/../replay/smpi_replay --cfg=smpi/host-speed:1 --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/simulate-computation:no
+> [Fafard:2:(3) 1000.003952] [smpi_replay/INFO] Simulation time 1000.003952
+
+#Test replaying the trace, altering the time to have the sleep much faster (1 instead of 1000).
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${platfdir}/small_platform.xml --cfg=smpi/comp-adjustment-file:${srcdir:=.}/trace_call_location/adjust -np 3 -replay ${bindir:=.}/smpi_trace.txt ${bindir:=.}/../replay/smpi_replay  --cfg=smpi/host-speed:1 --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/simulate-computation:no
+> [Fafard:2:(3) 1.003952] [smpi_replay/INFO] Simulation time 1.003952
+
+$ rm -f ${bindir:=.}/smpi_trace.tx*
+
index 08ccf09..e0dc7b4 100644 (file)
@@ -56,6 +56,19 @@ public:
 /** Create a ThrowPoint with (__FILE__, __LINE__, __func__) */
 #define XBT_THROW_POINT                                                                                                \
   ::simgrid::xbt::ThrowPoint(__FILE__, __LINE__, __func__, simgrid::xbt::Backtrace(), xbt_procname(), xbt_getpid())
+
+class XBT_PUBLIC ImpossibleError : public std::logic_error {
+public:
+  explicit ImpossibleError(const std::string& arg) : std::logic_error(arg) {}
+  ~ImpossibleError();
+};
+
+class XBT_PUBLIC UnimplementedError : public std::logic_error {
+public:
+  explicit UnimplementedError(const std::string& arg) : std::logic_error(arg) {}
+  ~UnimplementedError();
+};
+
 } // namespace xbt
 
 /** Ancestor class of all SimGrid exception */
@@ -65,103 +78,82 @@ public:
       : std::runtime_error(std::move(message)), throwpoint_(std::move(throwpoint))
   {
   }
+  ~Exception(); // DO NOT define it here -- see Exception.cpp for a rationale
 
   /** Return the information about where the exception was thrown */
   xbt::ThrowPoint const& throw_point() const { return throwpoint_; }
 
   std::string const resolve_backtrace() const { return throwpoint_.backtrace_.resolve(); }
 
+  /** Allow to carry a value (used by waitall/waitany) */
+  int value = 0;
+
 private:
   xbt::ThrowPoint throwpoint_;
 };
 
-} // namespace simgrid
-
-/** A legacy exception
- *
- *  It is defined by a category and a value within that category (as well as
- *  an optional error message).
- *
- *  This used to be a structure for C exceptions but it has been retrofitted
- *  as a C++ exception and some of its data has been moved in the
- *  @ref WithContextException base class. We should deprecate it and replace it
- *  with either C++ different exceptions or `std::system_error` which already
- *  provides this (category + error code) logic.
- *
- *  @ingroup XBT_ex_c
- */
-class XBT_PUBLIC xbt_ex : public simgrid::Exception {
-public:
-  /**
-   *
-   * @param throwpoint Throw point (use XBT_THROW_POINT)
-   * @param message    Exception message
-   */
-  xbt_ex(simgrid::xbt::ThrowPoint&& throwpoint, std::string&& message)
-      : simgrid::Exception(std::move(throwpoint), std::move(message))
-  {
-  }
-
-  xbt_ex(const xbt_ex&) = default;
-
-  ~xbt_ex(); // DO NOT define it here -- see ex.cpp for a rationale
-
-  /** Category (what went wrong) */
-  xbt_errcat_t category = unknown_error;
-
-  /** Why did it went wrong */
-  int value = 0;
-};
-
-namespace simgrid {
-
 /** Exception raised when a timeout elapsed */
-class TimeoutError : public xbt_ex {
+class TimeoutException : public Exception {
 public:
-  TimeoutError(simgrid::xbt::ThrowPoint&& throwpoint, std::string&& message)
-      : xbt_ex(std::move(throwpoint), std::move(message))
+  TimeoutException(simgrid::xbt::ThrowPoint&& throwpoint, std::string&& message)
+      : Exception(std::move(throwpoint), std::move(message))
   {
-    category = timeout_error;
   }
 };
 
+XBT_ATTRIB_DEPRECATED_v327("Please use simgrid::TimeoutException") typedef TimeoutException TimeoutError;
+
 /** Exception raised when a host fails */
-class HostFailureException : public xbt_ex {
+class HostFailureException : public Exception {
 public:
   HostFailureException(simgrid::xbt::ThrowPoint&& throwpoint, std::string&& message)
-      : xbt_ex(std::move(throwpoint), std::move(message))
+      : Exception(std::move(throwpoint), std::move(message))
   {
-    category = host_error;
   }
 };
 
 /** Exception raised when a communication fails because of the network or because of the remote host */
-class NetworkFailureException : public xbt_ex {
+class NetworkFailureException : public Exception {
 public:
   NetworkFailureException(simgrid::xbt::ThrowPoint&& throwpoint, std::string&& message)
-      : xbt_ex(std::move(throwpoint), std::move(message))
+      : Exception(std::move(throwpoint), std::move(message))
   {
-    category = network_error;
   }
 };
 
 /** Exception raised when a storage fails */
-class StorageFailureException : public xbt_ex {
+class StorageFailureException : public Exception {
 public:
   StorageFailureException(simgrid::xbt::ThrowPoint&& throwpoint, std::string&& message)
-      : xbt_ex(std::move(throwpoint), std::move(message))
+      : Exception(std::move(throwpoint), std::move(message))
+  {
+  }
+};
+
+/** Exception raised when a VM fails */
+class VmFailureException : public Exception {
+public:
+  VmFailureException(simgrid::xbt::ThrowPoint&& throwpoint, std::string&& message)
+      : Exception(std::move(throwpoint), std::move(message))
   {
-    category = io_error;
   }
 };
 
 /** Exception raised when something got canceled before completion */
-class CancelException : public xbt_ex {
+class CancelException : public Exception {
 public:
   CancelException(simgrid::xbt::ThrowPoint&& throwpoint, std::string&& message)
-      : xbt_ex(std::move(throwpoint), std::move(message))
+      : Exception(std::move(throwpoint), std::move(message))
+  {
+  }
+};
+
+/** Exception raised when something is going wrong during the simulation tracing */
+class TracingError : public Exception {
+public:
+  TracingError(simgrid::xbt::ThrowPoint&& throwpoint, std::string&& message)
+      : Exception(std::move(throwpoint), std::move(message))
   {
-    category = cancel_error;
   }
 };
 
@@ -196,7 +188,7 @@ public:
   ~ForcefulKillException();
   const char* what() const noexcept { return msg_.c_str(); }
 
-  static void do_throw();
+  XBT_ATTRIB_NORETURN static void do_throw();
   static bool try_n_catch(const std::function<void()>& try_block);
 
 private:
@@ -205,4 +197,6 @@ private:
 
 } // namespace simgrid
 
+XBT_ATTRIB_DEPRECATED_v327("Please use simgrid::Exception") typedef simgrid::Exception xbt_ex;
+
 #endif
index 4dddd46..9b38ab5 100644 (file)
@@ -42,6 +42,16 @@ XBT_PUBLIC void sg_actor_yield();
 XBT_PUBLIC void sg_actor_sleep_for(double duration);
 XBT_PUBLIC sg_actor_t sg_actor_attach(const char* name, void* data, sg_host_t host, xbt_dict_t properties);
 XBT_PUBLIC void sg_actor_detach();
+XBT_PUBLIC sg_actor_t sg_actor_self();
+XBT_PUBLIC aid_t sg_actor_self_get_pid();
+XBT_PUBLIC aid_t sg_actor_self_get_ppid();
+XBT_PUBLIC const char* sg_actor_self_get_name();
+XBT_PUBLIC void sg_actor_self_execute(double flops);
+XBT_PUBLIC void sg_actor_ref(sg_actor_t actor);
+XBT_PUBLIC void sg_actor_unref(sg_actor_t actor);
+XBT_PUBLIC void* sg_actor_data(sg_actor_t actor);
+XBT_PUBLIC void sg_actor_data_set(sg_actor_t actor, void* userdata);
+
 SG_END_DECL()
 
 #endif /* INCLUDE_SIMGRID_ACTOR_H_ */
index 9c068be..2837633 100644 (file)
 
 #include <simgrid/forward.h>
 
+#ifdef __cplusplus
+constexpr int SG_BARRIER_SERIAL_THREAD = -1;
+#else
+#define SG_BARRIER_SERIAL_THREAD -1
+#endif
+
 /* C interface */
 SG_BEGIN_DECL()
 
diff --git a/include/simgrid/cond.h b/include/simgrid/cond.h
new file mode 100644 (file)
index 0000000..08c3318
--- /dev/null
@@ -0,0 +1,30 @@
+/* Copyright (c) 2019. The SimGrid Team. All rights reserved.          */
+
+/* This program 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 INCLUDE_SIMGRID_COND_H_
+#define INCLUDE_SIMGRID_COND_H_
+
+#include <simgrid/forward.h>
+
+/* C interface */
+SG_BEGIN_DECL()
+/** @brief Creates a condition variable */
+XBT_PUBLIC sg_cond_t sg_cond_init();
+
+/** @brief Blocks onto the given condition variable */
+XBT_PUBLIC void sg_cond_wait(sg_cond_t cond, sg_mutex_t mutex);
+/** @brief Blocks onto the given condition variable, but only for the given amount of time.
+ *  @return 0 on success, 1 on timeout */
+XBT_PUBLIC int sg_cond_wait_for(sg_cond_t cond, sg_mutex_t mutex, double delay);
+/** @brief Signals the given mutex variable */
+XBT_PUBLIC void sg_cond_notify_one(sg_cond_t cond);
+/** @brief Broadcasts the given mutex variable */
+XBT_PUBLIC void sg_cond_notify_all(sg_cond_t cond);
+/** @brief Destroys the given mutex variable */
+XBT_PUBLIC void sg_cond_destroy(sg_cond_t cond);
+
+SG_END_DECL()
+
+#endif /* INCLUDE_SIMGRID_COND_H_ */
index bbb7aa0..37ce363 100644 (file)
@@ -39,7 +39,7 @@ SG_END_DECL()
 #cmakedefine01 SIMGRID_HAVE_MALLOCATOR
 /* Was the model-checking compiled in? */
 #cmakedefine01 SIMGRID_HAVE_MC
-/* Was the NS3 support compiled in? */
+/* Was the ns-3 support compiled in? */
 #cmakedefine01 SIMGRID_HAVE_NS3
 
 #endif /* SIMGRID_PUBLIC_CONFIG_H */
index 9facab2..8ce7d7b 100644 (file)
@@ -81,6 +81,7 @@ typedef boost::intrusive_ptr<Semaphore> SemaphorePtr;
 XBT_PUBLIC void intrusive_ptr_release(Semaphore* m);
 XBT_PUBLIC void intrusive_ptr_add_ref(Semaphore* m);
 
+class Disk;
 class Storage;
 } // namespace s4u
 
@@ -133,11 +134,15 @@ class System;
 }
 namespace resource {
 class Action;
+class Cpu;
 class Model;
 class Resource;
+class CpuModel;
 class NetworkModel;
 class LinkImpl;
 class NetworkAction;
+class DiskImpl;
+class DiskModel;
 class StorageImpl;
 class StorageType;
 class StorageModel;
@@ -160,13 +165,12 @@ namespace simix {
   class Timer;
 }
 namespace surf {
-  class Cpu;
-  class CpuModel;
   class HostImpl;
   class HostModel;
 }
 namespace mc {
 class CommunicationDeterminismChecker;
+class SimcallInspector;
 }
 namespace vm {
 class VMModel;
@@ -179,14 +183,16 @@ typedef simgrid::s4u::Barrier s4u_Barrier;
 typedef simgrid::s4u::Host s4u_Host;
 typedef simgrid::s4u::Link s4u_Link;
 typedef simgrid::s4u::File s4u_File;
+typedef simgrid::s4u::ConditionVariable s4u_ConditionVariable;
+typedef simgrid::s4u::Mutex s4u_Mutex;
 typedef simgrid::s4u::Semaphore s4u_Semaphore;
+typedef simgrid::s4u::Disk s4u_Disk;
 typedef simgrid::s4u::Storage s4u_Storage;
 typedef simgrid::s4u::NetZone s4u_NetZone;
 typedef simgrid::s4u::VirtualMachine s4u_VM;
 typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
 
 typedef simgrid::simix::Timer* smx_timer_t;
-typedef simgrid::kernel::context::Context* smx_context_t;
 typedef simgrid::kernel::actor::ActorImpl* smx_actor_t;
 typedef simgrid::kernel::activity::ConditionVariableImpl* smx_cond_t;
 typedef simgrid::kernel::activity::MailboxImpl* smx_mailbox_t;
@@ -200,7 +206,10 @@ typedef struct s4u_Barrier s4u_Barrier;
 typedef struct s4u_Host s4u_Host;
 typedef struct s4u_Link s4u_Link;
 typedef struct s4u_File s4u_File;
+typedef struct s4u_ConditionVariable s4u_ConditionVariable;
+typedef struct s4u_Mutex s4u_Mutex;
 typedef struct s4u_Semaphore s4u_Semaphore;
+typedef struct s4u_Disk s4u_Disk;
 typedef struct s4u_Storage s4u_Storage;
 typedef struct s4u_NetZone s4u_NetZone;
 typedef struct s4u_VM s4u_VM;
@@ -209,7 +218,6 @@ typedef struct kernel_Activity* smx_activity_t;
 typedef struct s_smx_timer* smx_timer_t;
 typedef struct s_smx_actor* smx_actor_t;
 typedef struct s_smx_cond_t* smx_cond_t;
-typedef struct s_smx_context* smx_context_t;
 typedef struct s_smx_mailbox* smx_mailbox_t;
 typedef struct s_smx_mutex* smx_mutex_t;
 typedef struct s_smx_sem* smx_sem_t;
@@ -217,10 +225,13 @@ typedef struct s_smx_sem* smx_sem_t;
 #endif
 
 typedef s4u_Barrier* sg_bar_t;
+typedef s4u_ConditionVariable* sg_cond_t;
+typedef s4u_Mutex* sg_mutex_t;
 typedef s4u_Semaphore* sg_sem_t;
 typedef s4u_NetZone* sg_netzone_t;
 typedef s4u_Host* sg_host_t;
 typedef s4u_Link* sg_link_t;
+typedef s4u_Disk* sg_disk_t;
 typedef s4u_Storage* sg_storage_t;
 typedef s4u_File* sg_file_t;
 typedef s4u_VM* sg_vm_t;
index 0289c05..fad40cd 100644 (file)
@@ -47,15 +47,18 @@ XBT_PUBLIC const char* sg_host_get_name(sg_host_t host);
 // ========== User Data ==============
 /** @brief Return the user data of a #sg_host_t.
  *
- * This functions returns the user data associated to @a host if it is possible.
+ * This functions returns the user data associated to @a host if any.
  */
-XBT_PUBLIC void* sg_host_user(sg_host_t host);
+XBT_PUBLIC void* sg_host_data(sg_host_t host);
+XBT_ATTRIB_DEPRECATED_v327("Please use sg_host_data()") XBT_PUBLIC void* sg_host_user(sg_host_t host);
 /** @brief Set the user data of a #sg_host_t.
  *
- * This functions attach @a data to @a host if it is possible.
+ * This functions attach @a data to @a host.
  */
-XBT_PUBLIC void sg_host_user_set(sg_host_t host, void* userdata);
-XBT_PUBLIC void sg_host_user_destroy(sg_host_t host);
+XBT_PUBLIC void sg_host_data_set(sg_host_t host, void* userdata);
+XBT_ATTRIB_DEPRECATED_v327("Please use sg_host_data_set()") XBT_PUBLIC
+    void sg_host_user_set(sg_host_t host, void* userdata);
+XBT_ATTRIB_DEPRECATED_v327("Please use sg_host_data_set(h, NULL)") XBT_PUBLIC void sg_host_user_destroy(sg_host_t host);
 
 // ========= storage related functions ============
 /** @brief Return the list of mount point names on an host.
@@ -132,6 +135,8 @@ XBT_PUBLIC void sg_host_set_property_value(sg_host_t host, const char* name, con
 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);
+void sg_host_send_to(sg_host_t from, sg_host_t to, double byte_amount);
+
 XBT_PUBLIC void sg_host_dump(sg_host_t ws);
 
 XBT_PUBLIC void sg_host_get_actor_list(sg_host_t host, xbt_dynar_t whereto);
index fd39db5..007c970 100644 (file)
@@ -16,24 +16,13 @@ namespace jedule{
 
 class XBT_PUBLIC Jedule {
 public:
-  Jedule()=default;
-  Jedule(const Jedule&) = delete;
-  Jedule& operator=(const Jedule&) = delete;
-  ~Jedule();
-  std::vector<Event*> event_set_;
-  Container* root_container_ = nullptr;
+  explicit Jedule(const std::string& name) : root_container_(name) {}
+  std::vector<Event> event_set_;
+  Container root_container_;
   void add_meta_info(char* key, char* value);
   void cleanup_output();
   void write_output(FILE* file);
 
-  // deprecated
-  XBT_ATTRIB_DEPRECATED_v323("Please use Jedule::add_meta_info()") void addMetaInfo(char* key, char* value)
-  {
-    add_meta_info(key, value);
-  }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Jedule::cleanup_output()") void cleanupOutput() { cleanup_output(); }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Jedule::write_output()") void writeOutput(FILE* file) { write_output(file); }
-
 private:
   std::unordered_map<char*, char*> meta_info_;
 };
index 3e96e66..5af7f4e 100644 (file)
@@ -19,38 +19,23 @@ namespace jedule{
 
 class XBT_PUBLIC Event {
 public:
-  Event(const std::string& name, double start_time, double end_time, const std::string& type);
-  Event(const Event&) = delete;
-  Event& operator=(const Event&) = delete;
-  ~Event();
-  void add_characteristic(char* characteristic);
-  void add_resources(std::vector<sg_host_t>* host_selection);
-  void add_info(char* key, char* value);
-  void print(FILE* file);
-
-  // deprecated
-  XBT_ATTRIB_DEPRECATED_v323("Please use Event::add_characteristic()") void addCharacteristic(char* characteristic)
-  {
-    add_characteristic(characteristic);
-  }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Event::add_resources()") void addResources(
-      std::vector<sg_host_t>* host_selection)
+  Event(const std::string& name, double start_time, double end_time, const std::string& type)
+      : name_(name), start_time_(start_time), end_time_(end_time), type_(type)
   {
-    add_resources(host_selection);
-  }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Event::add_info()") void addInfo(char* key, char* value)
-  {
-    add_info(key, value);
   }
+  void add_characteristic(char* characteristic);
+  void add_resources(const std::vector<sg_host_t>& host_selection);
+  void add_info(char* key, char* value);
+  void print(FILE* file) const;
 
 private:
   std::string name_;
   double start_time_;
   double end_time_;
   std::string type_;
-  std::vector<jed_subset_t>* resource_subsets_;
-  std::vector<char*> characteristics_list_;   /* just a list of names */
-  std::unordered_map<char*, char*> info_map_; /* key/value pairs */
+  std::vector<Subset> resource_subsets_;
+  std::vector<std::string> characteristics_list_;         /* just a list of names */
+  std::unordered_map<std::string, std::string> info_map_; /* key/value pairs */
 };
 }
 }
index 1c026df..cf5b0e0 100644 (file)
@@ -9,9 +9,10 @@
 #include <simgrid/forward.h>
 #include <xbt/dynar.h>
 
+#include <memory>
+#include <string>
 #include <unordered_map>
 #include <vector>
-#include <string>
 
 namespace simgrid {
 namespace jedule{
@@ -20,7 +21,7 @@ public:
   explicit Container(const std::string& name);
   Container(const Container&) = delete;
   Container& operator=(const Container&) = delete;
-  virtual ~Container();
+
 private:
   int last_id_;
   int is_lowest_ = 0;
@@ -29,7 +30,7 @@ public:
   std::string name;
   std::unordered_map<const char*, unsigned int> name2id;
   Container *parent = nullptr;
-  std::vector<Container*> children;
+  std::vector<std::unique_ptr<Container>> children;
   std::vector<sg_host_t> resource_list;
   void add_child(Container* child);
   void add_resources(std::vector<sg_host_t> hosts);
@@ -38,35 +39,11 @@ public:
   std::string get_hierarchy_as_string();
   void print(FILE *file);
   void print_resources(FILE* file);
-
-  // deprecated
-  XBT_ATTRIB_DEPRECATED_v323("Please use Container::add_child()") void addChild(Container* child) { add_child(child); }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Container::add_resources()") void addResources(std::vector<sg_host_t> hosts)
-  {
-    add_resources(hosts);
-  }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Container::create_hierarchy()") void createHierarchy(sg_netzone_t from_as)
-  {
-    create_hierarchy(from_as);
-  }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Container::get_hierarchy()") std::vector<int> getHierarchy()
-  {
-    return get_hierarchy();
-  }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Container::get_hierarchy_as_string()") std::string getHierarchyAsString()
-  {
-    return get_hierarchy_as_string();
-  }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Container::print_resources()") void printResources(FILE* file)
-  {
-    print_resources(file);
-  }
 };
 
 class XBT_PUBLIC Subset {
 public:
   Subset(int s, int n, Container* p);
-  virtual ~Subset()=default;
   int start_idx; // start idx in resource_list of container
   int nres;      // number of resources spanning starting at start_idx
   Container *parent;
@@ -75,7 +52,7 @@ public:
 }
 }
 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);
+void get_resource_selection_by_hosts(std::vector<simgrid::jedule::Subset>& subset_list,
+                                     const std::vector<sg_host_t>& host_list);
 
 #endif /* JED_SIMGRID_PLATFORM_H_ */
index 374d0ee..e5873bd 100644 (file)
@@ -74,7 +74,7 @@ public:
       schedule(std::move(continuation));
       break;
     case FutureStatus::not_ready:
-      // The future is not ready so we mast keep the continuation for
+      // The future is not ready so we must keep the continuation for
       // executing it later:
       continuation_ = std::move(continuation);
       break;
@@ -219,17 +219,6 @@ template <class T> void bind_promise(Promise<T>&& promise, Future<T> future)
 
 template <class T> Future<T> unwrap_future(Future<Future<T>> future);
 
-template <class T>
-XBT_ATTRIB_DEPRECATED_v323("Please use bind_promise") void bindPromise(Promise<T> promise, Future<T> future)
-{
-  bind_promise(promise, future);
-}
-template <class T>
-XBT_ATTRIB_DEPRECATED_v323("Please use unwrap_future") Future<T> unwrapFuture(Future<Future<T>> future)
-{
-  unwrap_future(future);
-}
-
 /** Result of some (probably) asynchronous operation in the SimGrid kernel
  *
  * @ref simgrid::simix::Future and @ref simgrid::simix::Future provide an
@@ -363,13 +352,6 @@ public:
     return future;
   }
 
-  template <class F>
-  XBT_ATTRIB_DEPRECATED_v323("Please use then_no_unwrap") auto thenNoUnwrap(F continuation)
-      -> Future<decltype(continuation(std::move(*this)))>
-  {
-    then_no_unwrap(continuation);
-  }
-
   /** Attach a continuation to this future
    *
    *  The future must be valid in order to make this call.
index ca85918..2821e7f 100644 (file)
@@ -75,9 +75,9 @@ public:
   };
 
   enum class SuspendStates {
-    not_suspended = 0, /**< Action currently not suspended **/
-    suspended,
-    sleeping
+    RUNNING = 0, /**< Action currently not suspended **/
+    SUSPENDED,
+    SLEEPING
   };
 
   /**
@@ -130,6 +130,11 @@ public:
   /** @brief Set the user data associated to the current action */
   void set_data(void* data) { data_ = data; }
 
+  /** @brief Get the user data associated to the current action */
+  activity::ActivityImpl* get_activity() const { return activity_; }
+  /** @brief Set the user data associated to the current action */
+  void set_activity(activity::ActivityImpl* activity) { activity_ = activity; }
+
   /** @brief Get the cost of the current action */
   double get_cost() const { return cost_; }
   /** @brief Set the cost of the current action */
@@ -171,8 +176,10 @@ public:
   /** @brief Resume the current Action */
   virtual void resume();
 
+  /** @brief Returns true if the current action is suspended */
+  bool is_suspended() const { return suspended_ == SuspendStates::SUSPENDED; }
   /** @brief Returns true if the current action is running */
-  bool is_suspended();
+  bool is_running() const { return suspended_ == SuspendStates::RUNNING; }
 
   /** @brief Get the maximum duration of the current action */
   double get_max_duration() const { return max_duration_; }
@@ -184,23 +191,22 @@ public:
   /** @brief Set the tracing category of the current Action */
   void set_category(const std::string& category) { category_ = category; }
 
-  /** @brief Get the priority of the current Action */
-  double get_priority() const { return sharing_priority_; };
-  /** @brief Set the priority of the current Action */
-  virtual void set_priority(double priority);
-  void set_priority_no_update(double priority) { sharing_priority_ = priority; }
+  /** @brief Get the sharing_penalty (RTT or 1/thread_count) of the current Action */
+  double get_sharing_penalty() const { return sharing_penalty_; };
+  /** @brief Set the sharing_penalty (RTT or 1/thread_count) of the current Action */
+  virtual void set_sharing_penalty(double sharing_penalty);
+  void set_sharing_penalty_no_update(double sharing_penalty) { sharing_penalty_ = sharing_penalty; }
 
   /** @brief Get the state set in which the action is */
   StateSet* get_state_set() const { return state_set_; };
 
   simgrid::kernel::resource::Model* get_model() const { return model_; }
 
-protected:
-  StateSet* state_set_;
-
 private:
+  StateSet* state_set_;
+  Action::SuspendStates suspended_ = Action::SuspendStates::RUNNING;
   int refcount_            = 1;
-  double sharing_priority_ = 1.0;             /**< priority (1.0 by default) */
+  double sharing_penalty_          = 1.0;             /**< priority (1.0 by default) */
   double max_duration_   = 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_time_;        /**< start time  */
@@ -209,7 +215,8 @@ private:
 
   double cost_;
   simgrid::kernel::resource::Model* model_;
-  void* data_ = nullptr; /**< for your convenience */
+  void* data_                       = nullptr; /**< for your convenience */
+  activity::ActivityImpl* activity_ = nullptr;
 
   /* LMM */
   double last_update_                                = 0;
@@ -230,9 +237,7 @@ public:
 
   double get_last_value() const { return last_value_; }
   void set_last_value(double val) { last_value_ = val; }
-
-protected:
-  Action::SuspendStates suspended_ = Action::SuspendStates::not_suspended;
+  void set_suspend_state(Action::SuspendStates state) { suspended_ = state; }
 };
 
 } // namespace resource
index 49918bb..5d4990a 100644 (file)
@@ -6,6 +6,7 @@
 #ifndef SIMGRID_KERNEL_RESOURCE_MODEL_HPP
 #define SIMGRID_KERNEL_RESOURCE_MODEL_HPP
 
+#include <memory>
 #include <simgrid/kernel/resource/Action.hpp>
 
 namespace simgrid {
@@ -34,28 +35,28 @@ public:
   virtual ~Model();
 
   /** @brief Get the set of [actions](@ref Action) in *inited* state */
-  Action::StateSet* get_inited_action_set() const { return inited_action_set_; }
+  Action::StateSet* get_inited_action_set() { return &inited_action_set_; }
 
   /** @brief Get the set of [actions](@ref Action) in *started* state */
-  Action::StateSet* get_started_action_set() const { return started_action_set_; }
+  Action::StateSet* get_started_action_set() { return &started_action_set_; }
 
   /** @brief Get the set of [actions](@ref Action) in *failed* state */
-  Action::StateSet* get_failed_action_set() const { return failed_action_set_; }
+  Action::StateSet* get_failed_action_set() { return &failed_action_set_; }
 
   /** @brief Get the set of [actions](@ref Action) in *finished* state */
-  Action::StateSet* get_finished_action_set() const { return finished_action_set_; }
+  Action::StateSet* get_finished_action_set() { return &finished_action_set_; }
 
   /** @brief Get the set of [actions](@ref Action) in *ignored* state */
-  Action::StateSet* get_ignored_action_set() const { return ignored_action_set_; }
+  Action::StateSet* get_ignored_action_set() { return &ignored_action_set_; }
 
   /** @brief Get the set of modified [actions](@ref Action) */
   Action::ModifiedSet* get_modified_set() const;
 
   /** @brief Get the maxmin system of the current Model */
-  lmm::System* get_maxmin_system() const { return maxmin_system_; }
+  lmm::System* get_maxmin_system() const { return maxmin_system_.get(); }
 
   /** @brief Set the maxmin system of the current Model */
-  void set_maxmin_system(lmm::System* system) { maxmin_system_ = system; }
+  void set_maxmin_system(lmm::System* system);
 
   /** @brief Get the update algorithm of the current Model */
   UpdateAlgo get_update_algorithm() const { return update_algorithm_; }
@@ -92,19 +93,19 @@ public:
 
   /** @brief Returns whether this model have an idempotent share_resource()
    *
-   * The only model that is not is NS3: computing the next timestamp moves the model up to that point,
+   * The only model that is not is ns-3: computing the next timestamp moves the model up to that point,
    * so we need to call it only when the next timestamp of other sources is computed.
    */
   virtual bool next_occuring_event_is_idempotent() { return true; }
 
 private:
-  lmm::System* maxmin_system_           = nullptr;
+  std::unique_ptr<lmm::System> maxmin_system_;
   const UpdateAlgo update_algorithm_;
-  Action::StateSet* inited_action_set_  = new Action::StateSet(); /**< Created not started */
-  Action::StateSet* started_action_set_  = new Action::StateSet(); /**< Started not done */
-  Action::StateSet* failed_action_set_  = new Action::StateSet(); /**< Done with failure */
-  Action::StateSet* finished_action_set_ = new Action::StateSet(); /**< Done successful */
-  Action::StateSet* ignored_action_set_  = new Action::StateSet(); /**< not considered (failure detectors?) */
+  Action::StateSet inited_action_set_;   /**< Created not started */
+  Action::StateSet started_action_set_;  /**< Started not done */
+  Action::StateSet failed_action_set_;   /**< Done with failure */
+  Action::StateSet finished_action_set_; /**< Done successful */
+  Action::StateSet ignored_action_set_;  /**< not considered (failure detectors?) */
 
   ActionHeap action_heap_;
 };
index f805299..25dd2ba 100644 (file)
@@ -18,14 +18,11 @@ public:
   unsigned int group_;
   unsigned int chassis_;
   unsigned int blade_;
-  resource::LinkImpl** blue_links_  = nullptr;
-  resource::LinkImpl** black_links_ = nullptr;
-  resource::LinkImpl** green_links_ = nullptr;
-  resource::LinkImpl** my_nodes_    = nullptr;
-  DragonflyRouter(int i, int j, int k);
-  DragonflyRouter(const DragonflyRouter&) = delete;
-  DragonflyRouter& operator=(const DragonflyRouter&) = delete;
-  ~DragonflyRouter();
+  resource::LinkImpl* blue_link_ = nullptr;
+  std::vector<resource::LinkImpl*> black_links_;
+  std::vector<resource::LinkImpl*> green_links_;
+  std::vector<resource::LinkImpl*> my_nodes_;
+  DragonflyRouter(unsigned group, unsigned chassis, unsigned blade) : group_(group), chassis_(chassis), blade_(blade) {}
 };
 
 /** @ingroup ROUTING_API
@@ -64,10 +61,6 @@ public:
 class XBT_PUBLIC DragonflyZone : public ClusterZone {
 public:
   explicit DragonflyZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel);
-  DragonflyZone(const DragonflyZone&) = delete;
-  DragonflyZone& operator=(const DragonflyZone&) = delete;
-  ~DragonflyZone() override;
-  //      void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position) override;
   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
   void parse_specific_arguments(ClusterCreationArgs* cluster) override;
   void seal() override;
@@ -91,7 +84,7 @@ private:
   unsigned int num_links_black_        = 0;
   unsigned int num_links_blue_         = 0;
   unsigned int num_links_per_link_     = 1; // splitduplex -> 2, only for local link
-  DragonflyRouter** routers_        = nullptr;
+  std::vector<DragonflyRouter> routers_;
 };
 } // namespace routing
 } // namespace kernel
index eaad97d..ef9b53c 100644 (file)
@@ -61,7 +61,7 @@ public:
 
   /** @brief Make a host within that NetZone */
   simgrid::s4u::Host* create_host(const char* name, const std::vector<double>& speed_per_pstate, int core_count,
-                                  std::map<std::string, std::string>* props);
+                                  const std::map<std::string, std::string>* props);
   /** @brief Creates a new route in this NetZone */
   virtual void add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
                                 std::vector<resource::LinkImpl*>& link_list, bool symmetrical);
index 2ecdbfc..55995aa 100644 (file)
@@ -62,25 +62,6 @@ protected:
   void get_route_check_params(NetPoint* src, NetPoint* dst);
   void add_route_check_params(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
                               std::vector<resource::LinkImpl*>& link_list, bool symmetrical);
-
-  // deprecated
-  XBT_ATTRIB_DEPRECATED_v323("Please use RoutedZone::new_extended_route()") virtual RouteCreationArgs* newExtendedRoute(
-      RoutingMode hierarchy, NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
-      std::vector<resource::LinkImpl*>& link_list, bool symmetrical, bool change_order)
-  {
-    return new_extended_route(hierarchy, src, dst, gw_src, gw_dst, link_list, symmetrical, change_order);
-  }
-  XBT_ATTRIB_DEPRECATED_v323("Please use RoutedZone::get_route_check_params()") void getRouteCheckParams(NetPoint* src,
-                                                                                                         NetPoint* dst)
-  {
-    get_route_check_params(src, dst);
-  }
-  XBT_ATTRIB_DEPRECATED_v323("Please use RoutedZone::add_route_check_params()") void addRouteCheckParams(
-      NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, std::vector<resource::LinkImpl*>& link_list,
-      bool symmetrical)
-  {
-    add_route_check_params(src, dst, gw_src, gw_dst, link_list, symmetrical);
-  }
 };
 } // namespace routing
 } // namespace kernel
index 22c14e8..38c89db 100644 (file)
@@ -50,14 +50,6 @@ public:
 
   void set_peer_link(NetPoint* netpoint, double bw_in, double bw_out, const std::string& coord);
   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
-
-  // deprecated
-  XBT_ATTRIB_DEPRECATED_v323("Please use VivaldiZone::set_peer_link()") void setPeerLink(NetPoint* netpoint,
-                                                                                         double bw_in, double bw_out,
-                                                                                         std::string coord)
-  {
-    set_peer_link(netpoint, bw_in, bw_out, coord);
-  }
 };
 
 namespace vivaldi {
index 8dddeae..2ddf8a9 100644 (file)
@@ -31,7 +31,7 @@ XBT_PUBLIC int MC_random(int min, int max);
 extern XBT_PUBLIC int _sg_do_model_check;
 extern XBT_PUBLIC int _sg_mc_max_visited_states;
 
-#define MC_is_active()                  _sg_do_model_check
+#define MC_is_active()         _sg_do_model_check
 #define MC_visited_reduction() _sg_mc_max_visited_states
 
 /** Assertion for the model-checker
index d9d09d0..60aad3b 100644 (file)
@@ -13,6 +13,7 @@
 #include <simgrid/host.h>
 #include <simgrid/instr.h>
 #include <simgrid/mailbox.h>
+#include <simgrid/mutex.h>
 #include <simgrid/plugins/live_migration.h>
 #include <simgrid/semaphore.h>
 #include <simgrid/storage.h>
@@ -235,6 +236,12 @@ XBT_PUBLIC void MSG_process_set_kill_time(msg_process_t process, double kill_tim
 XBT_PUBLIC void MSG_process_yield();
 /*** @brief Sleep for the specified number of seconds */
 XBT_PUBLIC msg_error_t MSG_process_sleep(double nb_sec);
+XBT_PUBLIC msg_process_t MSG_process_self();
+XBT_PUBLIC aid_t MSG_process_self_PID();
+XBT_PUBLIC aid_t MSG_process_self_PPID();
+XBT_PUBLIC const char* MSG_process_self_name();
+XBT_PUBLIC void MSG_process_ref(msg_process_t process);
+XBT_PUBLIC void MSG_process_unref(msg_process_t process);
 
 /** @brief Object representing an ongoing communication between processes.
  *
@@ -263,16 +270,16 @@ XBT_PUBLIC void MSG_config(const char* key, const char* value);
 /** @brief Initialize the MSG internal data.
  *  @hideinitializer
  *
- *  It also check that the link-time and compile-time versions of SimGrid do
+ *  It also checks that the link-time and compile-time versions of SimGrid do
  *  match, so you should use this version instead of the #MSG_init_nocheck
  *  function that does the same initializations, but without this check.
  *
- *  We allow to link against compiled versions that differ in the patch level.
+ *  We allow linking against compiled versions that differ in the patch level.
  */
 #define MSG_init(argc, argv)                                                                                           \
   do {                                                                                                                 \
     sg_version_check(SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR, SIMGRID_VERSION_PATCH);                             \
-    MSG_init_nocheck(argc, argv);                                                                                      \
+    MSG_init_nocheck((argc), (argv));                                                                                  \
   } while (0)
 
 XBT_PUBLIC void MSG_init_nocheck(int* argc, char** argv);
@@ -320,10 +327,6 @@ XBT_PUBLIC msg_process_t MSG_process_attach(const char* name, void* data, msg_ho
 XBT_PUBLIC void MSG_process_detach();
 
 XBT_PUBLIC void MSG_process_set_data_cleanup(void_f_pvoid_t data_cleanup);
-XBT_PUBLIC int MSG_process_self_PID();
-XBT_PUBLIC int MSG_process_self_PPID();
-XBT_PUBLIC const char* MSG_process_self_name();
-XBT_PUBLIC msg_process_t MSG_process_self();
 XBT_PUBLIC xbt_dynar_t MSG_processes_as_dynar();
 XBT_PUBLIC int MSG_process_get_number();
 
@@ -332,9 +335,6 @@ XBT_PUBLIC msg_error_t MSG_process_set_data(msg_process_t process, void* data);
 
 XBT_PUBLIC void MSG_process_on_exit(int_f_int_pvoid_t fun, void* data);
 
-XBT_PUBLIC void MSG_process_ref(msg_process_t process);
-XBT_PUBLIC void MSG_process_unref(msg_process_t process);
-
 /************************** Task handling ************************************/
 XBT_PUBLIC msg_task_t MSG_task_create(const char* name, double flops_amount, double bytes_amount, void* data);
 XBT_PUBLIC msg_task_t MSG_parallel_task_create(const char* name, int host_nb, const msg_host_t* host_list,
@@ -369,7 +369,7 @@ XBT_ATTRIB_DEPRECATED_v325("Getting a task from a specific host is no longer sup
 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);
-#define MSG_task_recv(t,a) MSG_task_receive(t,a)
+#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);
@@ -377,7 +377,7 @@ XBT_PUBLIC msg_error_t MSG_task_receive_ext_bounded(msg_task_t* task, const char
 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)
+#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);
@@ -443,8 +443,6 @@ XBT_PUBLIC int MSG_barrier_wait(msg_bar_t bar);
 
 /* ****************************************************************************************** */
 /* DO NOT USE this nasty pimple (unless if you're writing a binding) */
-XBT_ATTRIB_DEPRECATED_v323("MSG_process_get_smx_ctx is deprecated. Please contact us if you need it.")
-    XBT_PUBLIC smx_context_t MSG_process_get_smx_ctx(msg_process_t process);
 XBT_ATTRIB_DEPRECATED_v325("MSG_process_set_copy_callback is deprecated. Please contact us if you need it.") XBT_PUBLIC
     void MSG_task_set_copy_callback(void (*callback)(msg_task_t task, msg_process_t src, msg_process_t dst));
 
diff --git a/include/simgrid/mutex.h b/include/simgrid/mutex.h
new file mode 100644 (file)
index 0000000..47222d9
--- /dev/null
@@ -0,0 +1,21 @@
+/* Copyright (c) 2019. The SimGrid Team. All rights reserved.          */
+
+/* This program 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 INCLUDE_SIMGRID_MUTEX_H_
+#define INCLUDE_SIMGRID_MUTEX_H_
+
+#include <simgrid/forward.h>
+
+/* C interface */
+SG_BEGIN_DECL()
+XBT_PUBLIC sg_mutex_t sg_mutex_init();
+XBT_PUBLIC void sg_mutex_lock(sg_mutex_t mutex);
+XBT_PUBLIC void sg_mutex_unlock(sg_mutex_t mutex);
+XBT_PUBLIC int sg_mutex_try_lock(sg_mutex_t mutex);
+XBT_PUBLIC void sg_mutex_destroy(sg_mutex_t mutex);
+
+SG_END_DECL()
+
+#endif /* INCLUDE_SIMGRID_MUTEX_H_ */
index cfd6840..7b08818 100644 (file)
@@ -17,6 +17,7 @@ XBT_PUBLIC double sg_host_get_consumed_energy(sg_host_t host);
 XBT_PUBLIC double sg_host_get_idle_consumption(sg_host_t host);
 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_power_range_slope_at(sg_host_t host, int pstate);
 XBT_PUBLIC double sg_host_get_current_consumption(sg_host_t host);
 
 XBT_PUBLIC void sg_link_energy_plugin_init();
@@ -26,8 +27,9 @@ XBT_PUBLIC int sg_link_energy_is_inited();
 
 #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)
+#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))
+#define MSG_host_get_power_range_slope_at(host,pstate) sg_host_get_power_range_slope_at((host), (pstate))
 #define MSG_host_get_current_consumption(host) sg_host_get_current_consumption(host)
 
 SG_END_DECL()
index 5661719..feb2a74 100644 (file)
 #include <xbt/base.h>
 #include <xbt/dict.h>
 
+#ifdef __cplusplus
+#include <xbt/Extendable.hpp>
+
+#include <map>
+#include <memory>
+#include <string>
+#endif
+
 // C interface
 ////////////////
 typedef sg_file_t msg_file_t; // MSG backwards compatibility
@@ -33,6 +41,11 @@ XBT_PUBLIC void sg_file_unlink(sg_file_t fd);
 XBT_PUBLIC int sg_file_rcopy(sg_file_t file, sg_host_t host, const char* fullpath);
 XBT_PUBLIC int sg_file_rmove(sg_file_t file, sg_host_t host, const char* fullpath);
 
+XBT_PUBLIC sg_size_t sg_disk_get_size_free(sg_disk_t d);
+XBT_PUBLIC sg_size_t sg_disk_get_size_used(sg_disk_t d);
+XBT_PUBLIC sg_size_t sg_disk_get_size(sg_disk_t d);
+XBT_PUBLIC const char* sg_disk_get_mount_point(sg_disk_t d);
+
 XBT_PUBLIC sg_size_t sg_storage_get_size_free(sg_storage_t st);
 XBT_PUBLIC sg_size_t sg_storage_get_size_used(sg_storage_t st);
 XBT_PUBLIC sg_size_t sg_storage_get_size(sg_storage_t st);
@@ -40,21 +53,21 @@ XBT_PUBLIC xbt_dict_t sg_storage_get_content(sg_storage_t storage);
 
 XBT_PUBLIC xbt_dict_t sg_host_get_storage_content(sg_host_t host);
 
-#define MSG_file_open(fullpath, data) sg_file_open(fullpath, data)
-#define MSG_file_read(fd, size) sg_file_read(fd, size)
-#define MSG_file_write(fd, size) sg_file_write(fd, size)
+#define MSG_file_open(fullpath, data) sg_file_open((fullpath), (data))
+#define MSG_file_read(fd, size) sg_file_read((fd), (size))
+#define MSG_file_write(fd, size) sg_file_write((fd), (size))
 #define MSG_file_close(fd) sg_file_close(fd)
 #define MSG_file_get_name(fd) sg_file_get_name(fd)
 #define MSG_file_get_size(fd) sg_file_get_size(fd)
 #define MSG_file_dump(fd) sg_file_dump(fd)
 #define MSG_file_get_data(fd) sg_file_get_data(fd)
-#define MSG_file_set_data(fd, data) sg_file_set_data(fd, data)
-#define MSG_file_seek(fd, offset, origin) sg_file_seek(fd, offset, origin)
+#define MSG_file_set_data(fd, data) sg_file_set_data((fd), (data))
+#define MSG_file_seek(fd, offset, origin) sg_file_seek((fd), (offset), (origin))
 #define MSG_file_tell(fd) sg_file_tell(fd)
-#define MSG_file_move(fd, fullpath) sg_file_get_size(fd, fullpath)
+#define MSG_file_move(fd, fullpath) sg_file_get_size((fd), (fullpath))
 #define MSG_file_unlink(fd) sg_file_unlink(fd)
-#define MSG_file_rcopy(file, host, fullpath) sg_file_rcopy(file, host, fullpath)
-#define MSG_file_rmove(file, host, fullpath) sg_file_rmove(file, host, fullpath)
+#define MSG_file_rcopy(file, host, fullpath) sg_file_rcopy((file), (host), (fullpath))
+#define MSG_file_rmove(file, host, fullpath) sg_file_rmove((file), (host), (fullpath))
 
 #define MSG_storage_file_system_init() sg_storage_file_system_init()
 #define MSG_storage_get_free_size(st) sg_storage_get_size_free(st)
@@ -70,10 +83,6 @@ SG_END_DECL()
 //////////////////
 
 #ifdef __cplusplus
-#include <xbt/Extendable.hpp>
-
-#include <map>
-#include <string>
 
 namespace simgrid {
 namespace s4u {
@@ -101,7 +110,7 @@ public:
   sg_size_t read(sg_size_t size);
 
   /** Simulates a write action. Returns the size of data actually written. */
-  sg_size_t write(sg_size_t size);
+  sg_size_t write(sg_size_t size, int write_inside=0);
 
   /** Allows to store user data on that host */
   void set_userdata(void* data) { userdata_ = data; }
@@ -122,7 +131,8 @@ public:
   void dump();
 
   int desc_id = 0;
-  Storage* local_storage_;
+  Disk* local_disk_       = nullptr;
+  Storage* local_storage_ = nullptr;
   std::string mount_point_;
 
 private:
@@ -133,22 +143,48 @@ private:
   void* userdata_             = nullptr;
 };
 
+class XBT_PUBLIC FileSystemDiskExt {
+public:
+  static simgrid::xbt::Extension<Disk, FileSystemDiskExt> EXTENSION_ID;
+  explicit FileSystemDiskExt(Disk* ptr);
+  FileSystemDiskExt(const FileSystemDiskExt&) = delete;
+  FileSystemDiskExt& operator=(const FileSystemDiskExt&) = delete;
+  std::map<std::string, sg_size_t>* parse_content(const std::string& filename);
+  std::map<std::string, sg_size_t>* get_content() const { return content_.get(); }
+  const char* get_mount_point() { return mount_point_.c_str(); }
+  const char* get_mount_point(s4u::Host* remote_host) { return remote_mount_points_[remote_host].c_str(); }
+  void add_remote_mount(Host* host, const std::string& mount_point)
+  {
+    remote_mount_points_.insert({host, mount_point});
+  }
+  sg_size_t get_size() const { return size_; }
+  sg_size_t get_used_size() const { return used_size_; }
+  void decr_used_size(sg_size_t size) { used_size_ -= size; }
+  void incr_used_size(sg_size_t size) { used_size_ += size; }
+
+private:
+  std::unique_ptr<std::map<std::string, sg_size_t>> content_;
+  std::map<Host*, std::string> remote_mount_points_;
+  std::string mount_point_;
+  sg_size_t used_size_ = 0;
+  sg_size_t size_      = static_cast<sg_size_t>(500 * 1024) * 1024 * 1024;
+};
+
 class XBT_PUBLIC FileSystemStorageExt {
 public:
   static simgrid::xbt::Extension<Storage, FileSystemStorageExt> EXTENSION_ID;
   explicit FileSystemStorageExt(Storage* ptr);
   FileSystemStorageExt(const FileSystemStorageExt&) = delete;
   FileSystemStorageExt& operator=(const FileSystemStorageExt&) = delete;
-  ~FileSystemStorageExt();
   std::map<std::string, sg_size_t>* parse_content(const std::string& filename);
-  std::map<std::string, sg_size_t>* get_content() { return content_; }
+  std::map<std::string, sg_size_t>* get_content() { return content_.get(); }
   sg_size_t get_size() { return size_; }
   sg_size_t get_used_size() { return used_size_; }
   void decr_used_size(sg_size_t size) { used_size_ -= size; }
   void incr_used_size(sg_size_t size) { used_size_ += size; }
 
 private:
-  std::map<std::string, sg_size_t>* content_;
+  std::unique_ptr<std::map<std::string, sg_size_t>> content_;
   sg_size_t used_size_ = 0;
   sg_size_t size_     = 0;
 };
@@ -159,8 +195,7 @@ public:
   FileDescriptorHostExt() = default;
   FileDescriptorHostExt(const FileDescriptorHostExt&) = delete;
   FileDescriptorHostExt& operator=(const FileDescriptorHostExt&) = delete;
-  ~FileDescriptorHostExt() { delete file_descriptor_table; }
-  std::vector<int>* file_descriptor_table = nullptr; // Created lazily on need
+  std::unique_ptr<std::vector<int>> file_descriptor_table        = nullptr; // Created lazily on need
 };
 } // namespace s4u
 } // namespace simgrid
index 6b6a4cd..085c03b 100644 (file)
@@ -31,10 +31,10 @@ XBT_PUBLIC sg_vm_t sg_vm_create_migratable(sg_host_t pm, const char* name, int c
 #define MSG_vm_live_migration_plugin_init() sg_vm_live_migration_plugin_init()
 
 #define MSG_vm_create_migratable(pm, name, coreAmount, ramsize, mig_netspeed, dp_intensity)                            \
-  sg_vm_create_migratable(pm, name, coreAmount, ramsize, mig_netspeed, dp_intensity)
+  sg_vm_create_migratable((pm), (name), (coreAmount), (ramsize), (mig_netspeed), (dp_intensity))
 
 #define MSG_vm_is_migrating(vm) sg_vm_is_migrating(vm)
-#define MSG_vm_migrate(vm, dst_pm) sg_vm_migrate(vm, dst_pm)
+#define MSG_vm_migrate(vm, dst_pm) sg_vm_migrate((vm), (dst_pm))
 
 SG_END_DECL()
 
index d4c4829..7dc4005 100644 (file)
@@ -6,11 +6,14 @@
 #ifndef SIMGRID_S4U_S4U_H
 #define SIMGRID_S4U_S4U_H
 
+#include <simgrid/forward.h>
+
 #include <simgrid/s4u/Activity.hpp>
 #include <simgrid/s4u/Actor.hpp>
 #include <simgrid/s4u/Barrier.hpp>
 #include <simgrid/s4u/Comm.hpp>
 #include <simgrid/s4u/ConditionVariable.hpp>
+#include <simgrid/s4u/Disk.hpp>
 #include <simgrid/s4u/Engine.hpp>
 #include <simgrid/s4u/Exec.hpp>
 #include <simgrid/s4u/Host.hpp>
index 085c853..0b5b174 100644 (file)
@@ -86,17 +86,7 @@ public:
 
   /** Put some user data onto the Activity */
 
-  kernel::activity::ActivityImplPtr get_impl() { return pimpl_; }
-
-#ifndef DOXYGEN
-  XBT_ATTRIB_DEPRECATED_v324("Please use Activity::wait_for()") virtual void wait(double timeout) = 0;
-  XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_state()") Activity::State getState() { return state_; }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_remaining()") double getRemains() { return get_remaining(); }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Activity::set_remaining()") Activity* setRemains(double remains)
-  {
-    return set_remaining(remains);
-  }
-#endif
+  kernel::activity::ActivityImpl* get_impl() const { return pimpl_.get(); }
 
 private:
   kernel::activity::ActivityImplPtr pimpl_ = nullptr;
index e5f1878..d584d6d 100644 (file)
@@ -6,15 +6,18 @@
 #ifndef SIMGRID_S4U_ACTOR_HPP
 #define SIMGRID_S4U_ACTOR_HPP
 
-#include <functional>
-#include <map> // deprecated wrappers
+#include <simgrid/forward.h>
+
 #include <simgrid/chrono.hpp>
-#include <unordered_map>
 #include <xbt/Extendable.hpp>
 #include <xbt/functional.hpp>
 #include <xbt/signal.hpp>
 #include <xbt/string.hpp>
 
+#include <functional>
+#include <map> // deprecated wrappers
+#include <unordered_map>
+
 namespace simgrid {
 namespace s4u {
 
@@ -121,12 +124,14 @@ namespace s4u {
 
 /** @brief Simulation Agent */
 class XBT_PUBLIC Actor : public xbt::Extendable<Actor> {
+#ifndef DOXYGEN
   friend Exec;
   friend Mailbox;
   friend kernel::actor::ActorImpl;
   friend kernel::activity::MailboxImpl;
 
   kernel::actor::ActorImpl* const pimpl_;
+#endif
 
   explicit Actor(smx_actor_t pimpl) : pimpl_(pimpl) {}
 
@@ -139,12 +144,13 @@ public:
   // ***** Reference count *****
   friend XBT_PUBLIC void intrusive_ptr_add_ref(Actor * actor);
   friend XBT_PUBLIC void intrusive_ptr_release(Actor * actor);
+  int get_refcount();
 
   // ***** Actor creation *****
   /** Retrieve a reference to myself */
-  static ActorPtr self();
+  static Actor* self();
 
-  /** Signal to others that a new actor has been created **/
+  /** Fired when a new actor has been created **/
   static xbt::signal<void(Actor&)> on_creation;
   /** Signal to others that an actor has been suspended**/
   static xbt::signal<void(Actor const&)> on_suspend;
@@ -158,9 +164,15 @@ public:
   static xbt::signal<void(Actor const&)> on_migration_start;
   /** Signal to others that an actor is has been migrated to another host **/
   static xbt::signal<void(Actor const&)> on_migration_end;
-  /** Signal indicating that an actor is about to disappear.
-   *  This signal is fired for any dying actor, which is mostly useful when designing plugins and extensions. If you
-   *  want to register to the termination of a given actor, use this_actor::on_exit() instead.*/
+  /** Signal indicating that an actor terminated its code.
+   *  The actor may continue to exist if it is still referenced in the simulation, but it's not active anymore.
+   *  If you want to free extra data when the actor's destructor is called, use Actor::on_destruction.
+   *  If you want to register to the termination of a given actor, use this_actor::on_exit() instead.*/
+  static xbt::signal<void(Actor const&)> on_termination;
+  /** Signal indicating that an actor is about to disappear (its destructor was called).
+   *  This signal is fired for any destructed actor, which is mostly useful when designing plugins and extensions.
+   *  If you want to react to the end of the actor's code, use Actor::on_termination instead.
+   *  If you want to register to the termination of a given actor, use this_actor::on_exit() instead.*/
   static xbt::signal<void(Actor const&)> on_destruction;
 
   /** Create an actor from a std::function<void()>
@@ -289,9 +301,9 @@ public:
   kernel::actor::ActorImpl* get_impl() const { return pimpl_; }
 
   /** Retrieve the property value (or nullptr if not set) */
-  std::unordered_map<std::string, std::string>*
-  get_properties(); // FIXME: do not export the map, but only the keys or something
-  const char* get_property(const std::string& key);
+  const std::unordered_map<std::string, std::string>*
+  get_properties() const; // FIXME: do not export the map, but only the keys or something
+  const char* get_property(const std::string& key) const;
   void set_property(const std::string& key, const std::string& value);
 
 #ifndef DOXYGEN
@@ -299,98 +311,6 @@ public:
       const std::function<void(int, void*)>& fun, void* data);
 
   XBT_ATTRIB_DEPRECATED_v325("Please use Actor::by_pid(pid).kill() instead") static void kill(aid_t pid);
-
-  /** @deprecated See Actor::create() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::create()") static ActorPtr
-      createActor(const char* name, s4u::Host* host, const std::function<void()>& code)
-  {
-    return create(name, host, code);
-  }
-  /** @deprecated See Actor::create() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::create()") static ActorPtr
-      createActor(const char* name, s4u::Host* host, const std::function<void(std::vector<std::string>*)>& code,
-                  std::vector<std::string>* args)
-  {
-    return create(name, host, code, args);
-  }
-  /** @deprecated See Actor::create() */
-  template <class F, class... Args, typename = typename std::result_of<F(Args...)>::type>
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::create()") static ActorPtr createActor(
-      const char* name, s4u::Host* host, F code, Args... args)
-  {
-    return create(name, host, code, std::move(args)...);
-  }
-  /** @deprecated See Actor::create() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::create()") static ActorPtr createActor(
-      const char* name, s4u::Host* host, const char* function, std::vector<std::string> args)
-  {
-    return create(name, host, function, args);
-  }
-  /** @deprecated See Actor::is_daemon() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::is_daemon()") bool isDaemon() const;
-  /** @deprecated See Actor::get_name() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_name()") const simgrid::xbt::string& getName() const
-  {
-    return get_name();
-  }
-  /** @deprecated See Actor::get_cname() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_cname()") const char* getCname() const { return get_cname(); }
-  /** @deprecated See Actor::get_host() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_host()") Host* getHost() { return get_host(); }
-  /** @deprecated See Actor::get_pid() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_pid()") aid_t getPid() { return get_pid(); }
-  /** @deprecated See Actor::get_ppid() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_ppid()") aid_t getPpid() { return get_ppid(); }
-  /** @deprecated See Actor::is_suspended() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::is_suspended()") int isSuspended() { return is_suspended(); }
-  /** @deprecated See Actor::set_auto_restart() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::set_auto_restart()") void setAutoRestart(bool a)
-  {
-    set_auto_restart(a);
-  }
-  /** @deprecated Please use a std::function<void(int, void*)> for first parameter */
-  XBT_ATTRIB_DEPRECATED_v323("Please use a std::function<void(int, void*)> for first parameter.") void on_exit(
-      int_f_pvoid_pvoid_t fun, void* data);
-  /** @deprecated See Actor::on_exit() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::on_exit()") void onExit(int_f_pvoid_pvoid_t fun, void* data)
-  {
-    on_exit([fun, data](bool a) { fun((void*)(uintptr_t)a, data); });
-  }
-  /** @deprecated See Actor::set_kill_time() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::set_kill_time()") void setKillTime(double time) { set_kill_time(time); }
-  /** @deprecated See Actor::get_kill_time() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_kill_time()") double getKillTime() { return get_kill_time(); }
-  /** @deprecated See Actor::by_pid() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::by_pid()") static ActorPtr byPid(aid_t pid) { return by_pid(pid); }
-  /** @deprecated See Actor::kill_all() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::kill_all()") static void killAll() { kill_all(); }
-  /** @deprecated See Actor::kill_all() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::kill_all() with no parameter") static void killAll(
-      int XBT_ATTRIB_UNUSED resetPid)
-  {
-    kill_all();
-  }
-  /** @deprecated See Actor::get_impl() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_impl()") kernel::actor::ActorImpl* getImpl() { return get_impl(); }
-  /** @deprecated See Actor::get_property() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_property()") const char* getProperty(const char* key)
-  {
-    return get_property(key);
-  }
-  /** @deprecated See Actor::get_properties() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_properties()") std::map<std::string, std::string>* getProperties()
-  {
-    std::map<std::string, std::string>* res             = new std::map<std::string, std::string>();
-    std::unordered_map<std::string, std::string>* props = get_properties();
-    for (auto const& kv : *props)
-      res->insert(kv);
-    return res;
-  }
-  /** @deprecated See Actor::get_properties() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::set_property()") void setProperty(const char* key, const char* value)
-  {
-    set_property(key, value);
-  }
 #endif
 };
 
@@ -400,10 +320,10 @@ namespace this_actor {
 
 XBT_PUBLIC bool is_maestro();
 
-/** Block the current actor sleeping for that amount of seconds (may throw hostFailure) */
+/** Block the current actor sleeping for that amount of seconds */
 XBT_PUBLIC void sleep_for(double duration);
-/** Block the current actor sleeping until the specified timestamp (may throw hostFailure) */
-XBT_PUBLIC void sleep_until(double timeout);
+/** Block the current actor sleeping until the specified timestamp */
+XBT_PUBLIC void sleep_until(double wakeup_time);
 
 template <class Rep, class Period> inline void sleep_for(std::chrono::duration<Rep, Period> duration)
 {
@@ -411,9 +331,9 @@ template <class Rep, class Period> inline void sleep_for(std::chrono::duration<R
   this_actor::sleep_for(seconds.count());
 }
 
-template <class Duration> inline void sleep_until(const SimulationTimePoint<Duration>& timeout_time)
+template <class Duration> inline void sleep_until(const SimulationTimePoint<Duration>& wakeup_time)
 {
-  auto timeout_native = std::chrono::time_point_cast<SimulationClockDuration>(timeout_time);
+  auto timeout_native = std::chrono::time_point_cast<SimulationClockDuration>(wakeup_time);
   this_actor::sleep_until(timeout_native.time_since_epoch().count());
 }
 
@@ -514,7 +434,7 @@ XBT_PUBLIC std::string get_name();
 /** @brief Returns the name of the current actor as a C string. */
 XBT_PUBLIC const char* get_cname();
 
-/** @brief Returns the name of the host on which the curret actor is running. */
+/** @brief Returns the name of the host on which the current actor is running. */
 XBT_PUBLIC Host* get_host();
 
 /** @brief Suspend the current actor, that is blocked until resume()ed by another actor. */
@@ -553,26 +473,6 @@ XBT_PUBLIC void migrate(Host* new_host);
 #ifndef DOXYGEN
 XBT_ATTRIB_DEPRECATED_v325("Please use std::function<void(bool)> for first parameter.") XBT_PUBLIC
     void on_exit(const std::function<void(int, void*)>& fun, void* data);
-
-/** @deprecated Please use std::function<void(int, void*)> for first parameter */
-XBT_ATTRIB_DEPRECATED_v323("Please use std::function<void(bool)> for first parameter.") XBT_PUBLIC
-    void on_exit(int_f_pvoid_pvoid_t fun, void* data);
-/** @deprecated See this_actor::get_name() */
-XBT_ATTRIB_DEPRECATED_v323("Please use this_actor::get_name()") XBT_PUBLIC std::string getName();
-/** @deprecated See this_actor::get_cname() */
-XBT_ATTRIB_DEPRECATED_v323("Please use this_actor::get_cname()") XBT_PUBLIC const char* getCname();
-/** @deprecated See this_actor::is_maestro() */
-XBT_ATTRIB_DEPRECATED_v323("Please use this_actor::is_maestro()") XBT_PUBLIC bool isMaestro();
-/** @deprecated See this_actor::get_pid() */
-XBT_ATTRIB_DEPRECATED_v323("Please use this_actor::get_pid()") XBT_PUBLIC aid_t getPid();
-/** @deprecated See this_actor::get_ppid() */
-XBT_ATTRIB_DEPRECATED_v323("Please use this_actor::get_ppid()") XBT_PUBLIC aid_t getPpid();
-/** @deprecated See this_actor::get_host() */
-XBT_ATTRIB_DEPRECATED_v323("Please use this_actor::get_host()") XBT_PUBLIC Host* getHost();
-/** @deprecated See this_actor::on_exit() */
-XBT_ATTRIB_DEPRECATED_v323("Please use this_actor::on_exit()") XBT_PUBLIC void onExit(int_f_pvoid_pvoid_t fun, void* data);
-/** @deprecated See this_actor::exit() */
-XBT_ATTRIB_DEPRECATED_v324("Please use this_actor::exit()") XBT_PUBLIC void kill();
 #endif
 }
 
index 92ece5a..6a2dcb7 100644 (file)
@@ -6,9 +6,10 @@
 #ifndef SIMGRID_S4U_BARRIER_HPP
 #define SIMGRID_S4U_BARRIER_HPP
 
+#include <simgrid/barrier.h>
+#include <simgrid/chrono.hpp>
 #include <simgrid/forward.h>
 #include <simgrid/s4u/ConditionVariable.hpp>
-#include <simgrid/chrono.hpp>
 #include <simgrid/s4u/Mutex.hpp>
 
 #include <atomic>
@@ -21,8 +22,8 @@ class XBT_PUBLIC Barrier {
 private:
   MutexPtr mutex_;
   ConditionVariablePtr cond_;
-  unsigned int expected_processes_;
-  unsigned int arrived_processes_ = 0;
+  unsigned int expected_actors_;
+  unsigned int arrived_actors_ = 0;
 
   /* refcounting */
   std::atomic_int_fast32_t refcount_{0};
@@ -30,17 +31,19 @@ private:
 public:
   explicit Barrier(unsigned int count);
   ~Barrier()              = default;
+#ifndef DOXYGEN
   Barrier(Barrier const&) = delete;
   Barrier& operator=(Barrier const&) = delete;
+#endif
 
-  /** Constructs a new barrier */
-  static BarrierPtr create(unsigned int expected_processes);
-
+  static BarrierPtr create(unsigned int expected_actors);
   int wait();
 
+#ifndef DOXYGEN
   /* refcounting */
   friend XBT_PUBLIC void intrusive_ptr_add_ref(Barrier* barrier);
   friend XBT_PUBLIC void intrusive_ptr_release(Barrier* barrier);
+#endif
 };
 } // namespace s4u
 } // namespace simgrid
index 7cb8725..612266e 100644 (file)
@@ -10,6 +10,7 @@
 #include <simgrid/s4u/Activity.hpp>
 
 #include <atomic>
+#include <string>
 #include <vector>
 
 namespace simgrid {
@@ -27,10 +28,10 @@ class XBT_PUBLIC Comm : public Activity_T<Comm> {
   size_t dst_buff_size_               = 0;
   void* src_buff_                     = nullptr;
   size_t src_buff_size_               = sizeof(void*);
+  std::string tracing_category_       = "";
   std::atomic_int_fast32_t refcount_{0};
-
   /* FIXME: expose these elements in the API */
-  int detached_                                                           = 0;
+  bool detached_                                                          = false;
   int (*match_fun_)(void*, void*, kernel::activity::CommImpl*)            = nullptr;
   void (*clean_fun_)(void*)                                               = nullptr;
   void (*copy_data_function_)(kernel::activity::CommImpl*, void*, size_t) = nullptr;
@@ -38,9 +39,11 @@ class XBT_PUBLIC Comm : public Activity_T<Comm> {
   Comm() = default;
 
 public:
+#ifndef DOXYGEN
   friend XBT_PUBLIC void intrusive_ptr_release(Comm* c);
   friend XBT_PUBLIC void intrusive_ptr_add_ref(Comm* c);
   friend Mailbox; // Factory of comms
+#endif
 
   virtual ~Comm();
 
@@ -111,45 +114,14 @@ public:
    * That's a buffer where the sent data will be copied  */
   CommPtr set_dst_data(void** buff, size_t size);
 
+  CommPtr set_tracing_category(const std::string& category);
+
   /** Retrieve the mailbox on which this comm acts */
   Mailbox* get_mailbox();
   /** Retrieve the size of the received data. Not to be mixed with @ref Activity::set_remaining()  */
   size_t get_dst_data_size();
 
-  s4u::ActorPtr get_sender();
-
-#ifndef DOXYGEN
-  XBT_ATTRIB_DEPRECATED_v324("Please use Comm::wait_for()") void wait(double t) override { wait_for(t); }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_rate()") Activity* setRate(double rate)
-  {
-    return set_rate(rate).get();
-  }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_src_data()") Activity* setSrcData(void* buff)
-  {
-    return set_src_data(buff).get();
-  }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_src_data()") Activity* setSrcData(void* buff, size_t size)
-  {
-    return set_src_data(buff, size).get();
-  }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_src_data_size()") Activity* setSrcDataSize(size_t size)
-  {
-    return set_src_data_size(size).get();
-  }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_dst_data()") Activity* setDstData(void** buff)
-  {
-    return set_dst_data(buff).get();
-  }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Comm::set_dst_data()") Activity* setDstData(void** buff, size_t size)
-  {
-    return set_dst_data(buff, size).get();
-  }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Comm::get_dst_data_size()") size_t getDstDataSize()
-  {
-    return get_dst_data_size();
-  }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Comm::get_mailbox()") Mailbox* getMailbox() { return get_mailbox(); }
-#endif
+  Actor* get_sender();
 };
 } // namespace s4u
 } // namespace simgrid
index 6e6ec31..f11df5c 100644 (file)
@@ -6,6 +6,8 @@
 #ifndef SIMGRID_S4U_COND_VARIABLE_HPP
 #define SIMGRID_S4U_COND_VARIABLE_HPP
 
+#include <simgrid/forward.h>
+
 #include <simgrid/chrono.hpp>
 #include <simgrid/s4u/Mutex.hpp>
 
@@ -26,9 +28,8 @@ private:
   friend kernel::activity::ConditionVariableImpl;
   kernel::activity::ConditionVariableImpl* const cond_;
 
-  explicit ConditionVariable(kernel::activity::ConditionVariableImpl* cond) : cond_(cond) {}
-
 public:
+  explicit ConditionVariable(kernel::activity::ConditionVariableImpl* cond) : cond_(cond) {}
   ConditionVariable(ConditionVariable const&) = delete;
   ConditionVariable& operator=(ConditionVariable const&) = delete;
 
@@ -37,15 +38,6 @@ public:
 
   static ConditionVariablePtr create();
 
-#ifndef DOXYGEN
-  /** @deprecated See Comm::get_mailbox() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use ConditionVariableImpl::create()") ConditionVariablePtr
-      createConditionVariable()
-  {
-    return create();
-  }
-#endif
-
   //  Wait functions without time:
 
   void wait(MutexPtr lock);
diff --git a/include/simgrid/s4u/Disk.hpp b/include/simgrid/s4u/Disk.hpp
new file mode 100644 (file)
index 0000000..106da72
--- /dev/null
@@ -0,0 +1,74 @@
+/* Copyright (c) 2019. The SimGrid Team. All rights reserved.          */
+
+/* This program 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 INCLUDE_SIMGRID_S4U_DISK_HPP_
+#define INCLUDE_SIMGRID_S4U_DISK_HPP_
+
+#include <simgrid/forward.h>
+#include <simgrid/s4u/Io.hpp>
+#include <xbt/Extendable.hpp>
+#include <xbt/base.h>
+#include <xbt/signal.hpp>
+
+#include <map>
+#include <string>
+#include <unordered_map>
+
+namespace simgrid {
+namespace s4u {
+
+/** Disk represent the disk resources associated to a host
+ *
+ * By default, SimGrid does not keep track of the actual data being written but
+ * only computes the time taken by the corresponding data movement.
+ */
+
+class XBT_PUBLIC Disk : public xbt::Extendable<Disk> {
+  friend Engine;
+  friend Io;
+  friend kernel::resource::DiskImpl;
+
+public:
+  explicit Disk(const std::string& name, kernel::resource::DiskImpl* pimpl) : pimpl_(pimpl), name_(name) {}
+
+protected:
+  virtual ~Disk() = default;
+
+public:
+  /** @brief Callback signal fired when a new Disk is created */
+  static xbt::signal<void(Disk&)> on_creation;
+  /** @brief Callback signal fired when a Disk is destroyed */
+  static xbt::signal<void(Disk const&)> on_destruction;
+  /** @brief Callback signal fired when a Disk's state changes */
+  static xbt::signal<void(Disk const&)> on_state_change;
+
+  /** @brief Retrieves the name of that disk as a C++ string */
+  std::string const& get_name() const { return name_; }
+  /** @brief Retrieves the name of that disk as a C string */
+  const char* get_cname() const { return name_.c_str(); }
+
+  const std::unordered_map<std::string, std::string>* get_properties() const;
+  const char* get_property(const std::string& key) const;
+  void set_property(const std::string&, const std::string& value);
+  Host* get_host();
+
+  IoPtr io_init(sg_size_t size, s4u::Io::OpType type);
+
+  IoPtr read_async(sg_size_t size);
+  sg_size_t read(sg_size_t size);
+
+  IoPtr write_async(sg_size_t size);
+  sg_size_t write(sg_size_t size);
+  kernel::resource::DiskImpl* get_impl() const { return pimpl_; }
+
+private:
+  kernel::resource::DiskImpl* const pimpl_;
+  std::string name_;
+};
+
+} // namespace s4u
+} // namespace simgrid
+
+#endif /* INCLUDE_SIMGRID_S4U_DISK_HPP_ */
index 0d4aee0..ea53d1c 100644 (file)
@@ -6,10 +6,6 @@
 #ifndef SIMGRID_S4U_ENGINE_HPP
 #define SIMGRID_S4U_ENGINE_HPP
 
-#include <string>
-#include <utility>
-#include <vector>
-
 #include <xbt/base.h>
 #include <xbt/functional.hpp>
 
 
 #include <simgrid/s4u/NetZone.hpp>
 
+#include <string>
+#include <utility>
+#include <vector>
+
 namespace simgrid {
 namespace s4u {
 /** @brief Simulation engine
@@ -87,6 +87,7 @@ protected:
 #ifndef DOXYGEN
   friend Host;
   friend Link;
+  friend Disk;
   friend Storage;
   friend kernel::routing::NetPoint;
   friend kernel::routing::NetZoneImpl;
@@ -154,156 +155,27 @@ public:
    */
   void set_config(const std::string& str);
 
-private:
-  kernel::EngineImpl* const pimpl;
-  static Engine* instance_;
+  /** Callback fired when the platform is created (ie, the xml file parsed),
+   * right before the actual simulation starts. */
+  static xbt::signal<void()> on_platform_created;
 
-  //////////////// Deprecated functions
-#ifndef DOXYGEN
-public:
-  /** @deprecated See Engine::load_platform() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::load_platform()") void loadPlatform(const std::string& platf)
-  {
-    load_platform(platf);
-  }
-  /** @deprecated See Engine::register_function() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::register_function()") void registerFunction(const std::string& name,
-                                                                                             int (*code)(int, char**))
-  {
-    register_function(name, code);
-  }
-  /** @deprecated See Engine::register_default() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::register_default()") void registerDefault(int (*code)(int, char**))
-  {
-    register_default(code);
-  }
-  /** @deprecated See Engine::register_actor() */
-  template <class F>
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::register_actor()") void registerFunction(const std::string& name)
-  {
-    register_actor<F>(name);
-  }
-  /** @deprecated See Engine::register_actor() */
-  template <class F>
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::register_actor()") void registerFunction(const std::string& name,
-                                                                                          F code)
-  {
-    register_actor<F>(name, code);
-  }
+  /** Callback fired when the platform is about to be created
+   * (ie, after any configuration change and just before the resource creation) */
+  static xbt::signal<void()> on_platform_creation;
 
-  /** @deprecated See Engine::load_deployment() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::load_deployment()") void loadDeployment(const std::string& deploy)
-  {
-    load_deployment(deploy);
-  }
-  /** @deprecated See Engine::host_by_name() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::host_by_name()") simgrid::s4u::Host* hostByName(
-      const std::string& name)
-  {
-    return host_by_name(name);
-  }
-  /** @deprecated See Engine::host_by_name_or_null() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::host_by_name_or_null()") simgrid::s4u::Host* hostByNameOrNull(
-      const std::string& name)
-  {
-    return host_by_name_or_null(name);
-  }
-  /** @deprecated See Engine::storage_by_name() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::storage_by_name()") simgrid::s4u::Storage* storageByName(
-      const std::string& name)
-  {
-    return storage_by_name(name);
-  }
-  /** @deprecated See Engine::storage_by_name_or_null() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::storage_by_name_or_null()") simgrid::s4u::Storage* storageByNameOrNull(
-      const std::string& name)
-  {
-    return storage_by_name_or_null(name);
-  }
+  /** Callback fired when the main simulation loop ends, just before the end of Engine::run() */
+  static xbt::signal<void()> on_simulation_end;
 
-  /** @deprecated See Engine::get_host_count() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_host_count()") size_t getHostCount() { return get_host_count(); }
-  /** @deprecated See Engine::get_all_hosts() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_all_hosts()") std::vector<Host*> getAllHosts()
-  {
-    return get_all_hosts();
-  }
-  /** @deprecated See Engine::get_link_count() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_link_count()") size_t getLinkCount() { return get_link_count(); }
-  /** @deprecated See Engine::get_link_list() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_link_list()") std::vector<Link*> getAllLinks()
-  {
-    return get_all_links();
-  }
-  /** @deprecated See Engine::get_all_storages() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_all_storages()") std::vector<Storage*> getAllStorages()
-  {
-    return get_all_storages();
-  }
-  /** @deprecated See Engine::get_clock() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_clock()") static double getClock() { return get_clock(); }
-  /** @deprecated See Engine::get_all_netpoints() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_all_netpoints()") void getNetpointList(
-      std::vector<simgrid::kernel::routing::NetPoint*>* list);
-  /** @deprecated See Engine::netpoint_by_name_or_null() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::netpoint_by_name_or_null()")
-      simgrid::kernel::routing::NetPoint* getNetpointByNameOrNull(const std::string& name)
-  {
-    return netpoint_by_name_or_null(name);
-  }
-  /** @deprecated See Engine::get_netzone_root() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_netzone_root()") simgrid::s4u::NetZone* getNetRoot()
-  {
-    return get_netzone_root();
-  }
-  /** @deprecated See Engine::netzone_by_name_or_null() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::netzone_by_name_or_null()")
-      simgrid::s4u::NetZone* getNetzoneByNameOrNull(const std::string& name)
-  {
-    return netzone_by_name_or_null(name);
-  }
-  /** @deprecated See Engine::filter_netzones_by_type() */
-  template <class T>
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::filter_netzones_by_type()") void getNetzoneByType(
-      std::vector<T*>* whereto)
-  {
-    get_filtered_netzones_recursive(get_netzone_root(), whereto);
-  }
+  /** Callback fired when the time jumps into the future */
+  static xbt::signal<void(double)> on_time_advance;
 
-  /** @deprecated See Engine::get_instance() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::get_instance()") static s4u::Engine* getInstance()
-  {
-    return get_instance();
-  }
-  /** @deprecated See Engine::is_initialized() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::is_initialized()") static bool isInitialized()
-  {
-    return is_initialized();
-  }
-  /** @deprecated See Engine::set_config() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Engine::set_config()") void setConfig(const std::string& str)
-  {
-    set_config(str);
-  }
-#endif
-};
-
-/** Callback fired when the platform is created (ie, the xml file parsed),
- * right before the actual simulation starts. */
-extern XBT_PUBLIC xbt::signal<void()> on_platform_created;
+  /** Callback fired when the time cannot advance because of inter-actors deadlock */
+  static xbt::signal<void(void)> on_deadlock;
 
-/** Callback fired when the platform is about to be created
- * (ie, after any configuration change and just before the resource creation) */
-extern XBT_PUBLIC xbt::signal<void()> on_platform_creation;
-
-/** Callback fired when the main simulation loop ends, just before the end of Engine::run() */
-extern XBT_PUBLIC xbt::signal<void()> on_simulation_end;
-
-/** Callback fired when the time jumps into the future */
-extern XBT_PUBLIC xbt::signal<void(double)> on_time_advance;
-
-/** Callback fired when the time cannot advance because of inter-actors deadlock */
-extern XBT_PUBLIC xbt::signal<void(void)> on_deadlock;
+private:
+  kernel::EngineImpl* const pimpl;
+  static Engine* instance_;
+};
 
 #ifndef DOXYGEN /* Internal use only, no need to expose it */
 template <class T> XBT_PRIVATE void get_filtered_netzones_recursive(s4u::NetZone* current, std::vector<T*>* whereto)
index e7e9610..bf9acf3 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <simgrid/forward.h>
 #include <simgrid/s4u/Activity.hpp>
+#include <simgrid/s4u/Actor.hpp>
 #include <xbt/ex.h>
 
 #include <atomic>
@@ -35,14 +36,14 @@ public:
 #ifndef DOXYGEN
   Exec(Exec const&) = delete;
   Exec& operator=(Exec const&) = delete;
-#endif
 
   friend ExecSeq;
   friend ExecPar;
   friend XBT_PUBLIC void intrusive_ptr_release(Exec* e);
   friend XBT_PUBLIC void intrusive_ptr_add_ref(Exec* e);
-  static xbt::signal<void(Actor const&)> on_start;
-  static xbt::signal<void(Actor const&)> on_completion;
+#endif
+  static xbt::signal<void(Actor const&, Exec const&)> on_start;
+  static xbt::signal<void(Actor const&, Exec const&)> on_completion;
 
   virtual Exec* start() override          = 0;
   virtual double get_remaining_ratio()    = 0;
@@ -50,19 +51,25 @@ public:
 
   Exec* wait() override;
   Exec* wait_for(double timeout) override;
+  /*! take a vector of s4u::ExecPtr and return when one of them is finished.
+   * The return value is the rank of the first finished ExecPtr. */
+  static int wait_any(std::vector<ExecPtr>* execs) { return wait_any_for(execs, -1); }
+  /*! Same as wait_any, but with a timeout. If the timeout occurs, parameter last is returned.*/
+  static int wait_any_for(std::vector<ExecPtr>* execs, double timeout);
+
   bool test() override;
 
   ExecPtr set_bound(double bound);
   ExecPtr set_priority(double priority);
   ExecPtr set_timeout(double timeout);
   Exec* cancel() override;
-
-  XBT_ATTRIB_DEPRECATED_v323("Please use Exec::set_priority()") ExecPtr setPriority(double priority)
-  {
-    return set_priority(priority);
-  }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Exec::set_bound()") ExecPtr setBound(double bound) { return set_bound(bound); }
-  XBT_ATTRIB_DEPRECATED_v324("Please use Exec::wait_for()") void wait(double t) override { wait_for(t); }
+  const std::string& get_name() const { return name_; }
+  const char* get_cname() const { return name_.c_str(); }
+  Host* get_host() const;
+  unsigned int get_host_number() const;
+  double get_start_time() const;
+  double get_finish_time() const;
+  double get_cost() const;
 };
 
 class XBT_PUBLIC ExecSeq : public Exec {
@@ -82,16 +89,6 @@ public:
 
   double get_remaining() override;
   double get_remaining_ratio() override;
-
-#ifndef DOXYGEN
-  //////////////// Deprecated functions
-  XBT_ATTRIB_DEPRECATED_v323("Please use Exec::set_host()") ExecPtr setHost(Host* host) { return set_host(host); }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Exec::get_host()") Host* getHost() { return get_host(); }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Exec::get_remaining_ratio()") double getRemainingRatio()
-  {
-    return get_remaining_ratio();
-  }
-#endif
 };
 
 class XBT_PUBLIC ExecPar : public Exec {
@@ -100,7 +97,7 @@ class XBT_PUBLIC ExecPar : public Exec {
   std::vector<double> bytes_amounts_;
   explicit ExecPar(const std::vector<s4u::Host*>& hosts, const std::vector<double>& flops_amounts,
                    const std::vector<double>& bytes_amounts);
-  ExecPtr set_host(Host* host) override { return this; }
+  ExecPtr set_host(Host*) override { /* parallel exec cannot be moved */ THROW_UNIMPLEMENTED; }
 
 public:
   ~ExecPar() = default;
index 81a031e..d06da07 100644 (file)
@@ -50,13 +50,13 @@ private:
   bool currently_destroying_ = false;
 
 public:
-  /*** Called on each newly created host */
+  /** Called on each newly created host */
   static xbt::signal<void(Host&)> on_creation;
-  /*** Called just before destructing a host */
+  /** Called just before destructing a host */
   static xbt::signal<void(Host const&)> on_destruction;
-  /*** Called when the machine is turned on or off (called AFTER the change) */
+  /** Called when the machine is turned on or off (called AFTER the change) */
   static xbt::signal<void(Host const&)> on_state_change;
-  /*** Called when the speed of the machine is changed (called AFTER the change)
+  /** Called when the speed of the machine is changed (called AFTER the change)
    * (either because of a pstate switch or because of an external load event coming from the profile) */
   static xbt::signal<void(Host const&)> on_speed_change;
 
@@ -99,23 +99,12 @@ public:
 
   const char* get_property(const std::string& key) const;
   void set_property(const std::string& key, const std::string& value);
-  std::unordered_map<std::string, std::string>* get_properties();
+  const std::unordered_map<std::string, std::string>* get_properties() const;
+  void set_properties(const std::map<std::string, std::string>& properties);
 
   void set_state_profile(kernel::profile::Profile* p);
   void set_speed_profile(kernel::profile::Profile* p);
 
-#ifndef DOXYGEN
-  /** @deprecated See Host::get_properties() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_properties()") std::map<std::string, std::string>* getProperties()
-  {
-    std::map<std::string, std::string>* res             = new std::map<std::string, std::string>();
-    std::unordered_map<std::string, std::string>* props = get_properties();
-    for (auto const& kv : *props)
-      res->insert(kv);
-    return res;
-  }
-#endif
-
   double get_speed() const;
   double get_available_speed() const;
   int get_core_count() const;
@@ -126,36 +115,23 @@ public:
   void set_pstate(int pstate_index);
   int get_pstate() const;
 
-  std::vector<const char*> get_attached_storages() const;
+  std::vector<Disk*> get_disks() const;
+  void add_disk(Disk* disk);
+  void remove_disk(const std::string& disk_name);
 
-#ifndef DOXYGEN
-  /** @deprecated See Host::get_speed() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_speed() instead.") double getSpeed() { return get_speed(); }
-  /** @deprecated See Host::get_pstate_speed() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_pstate_speed() instead.") double getPstateSpeed(int pstate_index)
-  {
-    return get_pstate_speed(pstate_index);
-  }
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_attached_storages() instead.") void getAttachedStorages(
-      std::vector<const char*>* storages);
-#endif
+  std::vector<const char*> get_attached_storages() const;
 
   /** Get an associative list [mount point]->[Storage] of all local mount points.
    *
    *  This is defined in the platform file, and cannot be modified programatically (yet).
    */
   std::unordered_map<std::string, Storage*> const& get_mounted_storages();
-#ifndef DOXYGEN
-  /** @deprecated See Host::get_mounted_storages() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_mounted_storages() instead.") std::unordered_map<std::string, Storage*> const& getMountedStorages()
-  {
-    return get_mounted_storages();
-  }
-#endif
 
   void route_to(Host* dest, std::vector<Link*>& links, double* latency);
   void route_to(Host* dest, std::vector<kernel::resource::LinkImpl*>& links, double* latency);
+  void send_to(Host* dest, double byte_amount);
 
+  NetZone* get_englobing_zone();
   /** 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.
@@ -168,63 +144,6 @@ public:
   /** Block the calling actor on an execution located on the called host (with explicit priority) */
   void execute(double flops, double priority);
 
-  // Deprecated functions
-#ifndef DOXYGEN
-  /** @deprecated See Host::get_name() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_name()") simgrid::xbt::string const& getName() const
-  {
-    return name_;
-  }
-  /** @deprecated See Host::get_cname() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_cname()") const char* getCname() const { return name_.c_str(); }
-  /** @deprecated See Host::get_all_actors() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_all_actors()") void actorList(std::vector<ActorPtr>* whereto);
-  /** @deprecated See Host::get_all_actors() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_all_actors()") void getProcesses(std::vector<ActorPtr>* list);
-  /** @deprecated See Host::turn_on() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::turn_on()") void turnOn() { turn_on(); }
-  /** @deprecated See Host::turn_off() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::turn_off()") void turnOff() { turn_off(); }
-  /** @deprecated See Host::is_on() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::is_on()") bool isOn() { return is_on(); }
-  /** @deprecated See Host::is_off() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::is_off()") bool isOff() { return not is_on(); }
-  /** @deprecated See Host::get_property() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_property()") const char* getProperty(const char* key)
-  {
-    return get_property(key);
-  }
-  /** @deprecated See Host::set_property() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::set_property()") void setProperty(const std::string& key,
-                                                                                 const std::string& value)
-  {
-    set_property(key, value);
-  }
-  /** @deprecated See Host::set_pstate() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::set_pstate()") void setPstate(int idx) { set_pstate(idx); }
-  /** @deprecated See Host::get_pstate() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_pstate()") int getPstate() { return get_pstate(); }
-  /** @deprecated See Host::route_to() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::route_to()") void routeTo(Host* dest, std::vector<Link*>& links,
-                                                                         double* latency)
-  {
-    route_to(dest, links, latency);
-  }
-  /** @deprecated See Host::route_to() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::route_to()") void routeTo(
-      Host* dest, std::vector<kernel::resource::LinkImpl*>& links, double* latency)
-  {
-    route_to(dest, links, latency);
-  }
-  /** @deprecated See Host::get_core_count() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_core_count()") int getCoreCount() { return get_core_count(); }
-  /** @deprecated See Host::get_pstate_count() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_pstate_count()") int getPstatesCount() const
-  {
-    return get_pstate_count();
-  }
-#endif /* !DOXYGEN */
-
 private:
   xbt::string name_{"noname"};
   std::unordered_map<std::string, Storage*>* mounts_ = nullptr; // caching
@@ -232,7 +151,7 @@ private:
 public:
 #ifndef DOXYGEN
   /** DO NOT USE DIRECTLY (@todo: these should be protected, once our code is clean) */
-  surf::Cpu* pimpl_cpu = nullptr;
+  kernel::resource::Cpu* pimpl_cpu = nullptr;
   // TODO, this could be a unique_ptr
   surf::HostImpl* pimpl_ = nullptr;
   /** DO NOT USE DIRECTLY (@todo: these should be protected, once our code is clean) */
@@ -242,6 +161,4 @@ public:
 } // namespace s4u
 } // namespace simgrid
 
-extern int USER_HOST_LEVEL;
-
 #endif /* SIMGRID_S4U_HOST_HPP */
index 395dfb9..c9d55d6 100644 (file)
@@ -17,7 +17,7 @@ namespace s4u {
 
 /** I/O Activity, representing the asynchronous disk access.
  *
- * They are generated from Storage::io_init() or Storage::read() and Storage::write().
+ * They are generated from Disk::io_init(), Disk::read() Disk::read_async(), Disk::write() and Disk::write_async().
  */
 
 class XBT_PUBLIC Io : public Activity_T<Io> {
@@ -26,16 +26,21 @@ public:
 
 private:
   Storage* storage_ = nullptr;
+  Disk* disk_       = nullptr;
   sg_size_t size_   = 0;
   OpType type_      = OpType::READ;
   std::atomic_int_fast32_t refcount_{0};
 
   explicit Io(sg_storage_t storage, sg_size_t size, OpType type);
+  explicit Io(sg_disk_t disk, sg_size_t size, OpType type);
 
 public:
+#ifndef DOXYGEN
   friend XBT_PUBLIC void intrusive_ptr_release(simgrid::s4u::Io* i);
   friend XBT_PUBLIC void intrusive_ptr_add_ref(simgrid::s4u::Io* i);
+  friend Disk;    // Factory of IOs
   friend Storage; // Factory of IOs
+#endif
 
   ~Io() = default;
 
@@ -47,10 +52,6 @@ public:
 
   double get_remaining() override;
   sg_size_t get_performed_ioops();
-
-#ifndef DOXYGEN
-  XBT_ATTRIB_DEPRECATED_v324("Please use Io::wait_for()") void wait(double t) override { wait_for(t); }
-#endif
 };
 
 } // namespace s4u
index 8a9c723..8d788ed 100644 (file)
@@ -6,6 +6,7 @@
 #ifndef S4U_LINK_HPP_
 #define S4U_LINK_HPP_
 
+#include <simgrid/forward.h>
 #include <simgrid/kernel/resource/Action.hpp>
 #include <simgrid/link.h>
 #include <string>
@@ -31,9 +32,9 @@ class XBT_PUBLIC Link : public xbt::Extendable<Link> {
   kernel::resource::LinkImpl* const pimpl_;
 
 public:
-  enum class SharingPolicy { SPLITDUPLEX = 2, SHARED = 1, FATPIPE = 0 };
+  enum class SharingPolicy { WIFI = 3, SPLITDUPLEX = 2, SHARED = 1, FATPIPE = 0 };
 
-  kernel::resource::LinkImpl* get_impl() { return pimpl_; }
+  kernel::resource::LinkImpl* get_impl() const { return pimpl_; }
 
   /** @brief Retrieve a link from its name */
   static Link* by_name(const std::string& name);
@@ -63,9 +64,6 @@ public:
   bool is_on() const;
   void turn_off();
 
-  void* get_data(); /** Should be used only from the C interface. Prefer extensions in C++ */
-  void set_data(void* d);
-
 #ifndef DOXYGEN
   XBT_ATTRIB_DEPRECATED_v325("Please use Link::set_state_profile()") void set_state_trace(
       kernel::profile::Profile* profile)
@@ -93,7 +91,7 @@ public:
    * The profile must contain absolute values */
   void set_latency_profile(kernel::profile::Profile* profile);
 
-  const char* get_property(const std::string& key);
+  const char* get_property(const std::string& key) const;
   void set_property(const std::string& key, const std::string& value);
 
   /* The signals */
@@ -115,64 +113,6 @@ public:
   /** @brief Callback signal fired when a communication changes it state (ready/done/cancel) */
   static xbt::signal<void(kernel::resource::NetworkAction&, kernel::resource::Action::State)>
       on_communication_state_change;
-
-#ifndef DOXYGEN
-  // Deprecated methods
-  /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::by_name()") static Link* byName(const char* name) { return by_name(name); }
-  /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_name()") const std::string& getName() const { return get_name(); }
-  /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_cname()") const char* getCname() const { return get_cname(); }
-  /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_sharing_policy()") SharingPolicy sharingPolicy() {return get_sharing_policy();}
-  /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_usage()") double getUsage() {return get_usage();}
-  /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::is_used()") bool isUsed() {return is_used();}
-  /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_bandwidth()") double bandwidth() {return get_bandwidth();}
-  /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_latency()") double latency() {return get_latency();}
-
-  /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::turn_on()") void turnOn() {turn_on();}
-  /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::turn_off()") void turnOff() {turn_off();}
-
-  /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_property()") const char* getProperty(const char* key) {return get_property(key);}
-  /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::set_property()") void setProperty(const std::string& key,
-                                                                                 const std::string& value)
-  {
-    set_property(key, value);
-  }
-
-  /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_data()") void* getData() {return get_data();}
-  /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::set_data()") void setData(void* d) {set_data(d);}
-
-  /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_state_profile()") void setStateTrace(
-      kernel::profile::Profile* profile)
-  {
-    set_state_profile(profile);
-  }
-  /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_bandwidth_profile()") void setBandwidthTrace(
-      kernel::profile::Profile* profile)
-  {
-    set_bandwidth_profile(profile);
-  }
-  /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_latency_profile()") void setLatencyTrace(
-      kernel::profile::Profile* profile)
-  {
-    set_latency_profile(profile);
-  }
-#endif
 };
 } // namespace s4u
 } // namespace simgrid
index 2ce888a..989ae54 100644 (file)
@@ -6,8 +6,10 @@
 #ifndef SIMGRID_S4U_MAILBOX_HPP
 #define SIMGRID_S4U_MAILBOX_HPP
 
-#include <xbt/string.hpp>
+#include <simgrid/forward.h>
+
 #include <simgrid/s4u/Actor.hpp>
+#include <xbt/string.hpp>
 
 #include <string>
 
@@ -26,7 +28,7 @@ class XBT_PUBLIC Mailbox {
 
 public:
   /** private function, do not use. FIXME: make me protected */
-  kernel::activity::MailboxImpl* get_impl() { return pimpl_; }
+  kernel::activity::MailboxImpl* get_impl() const { return pimpl_; }
 
   /** @brief Retrieves the name of that mailbox as a C++ string */
   const xbt::string& get_name() const;
@@ -93,36 +95,6 @@ public:
   void* get(); // FIXME: make a typed template version
   /** Blocking data reception with timeout */
   void* get(double timeout);
-
-  // Deprecated functions
-#ifndef DOXYGEN
-  /** @deprecated Mailbox::set_receiver() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::set_receiver()") void setReceiver(ActorPtr actor)
-  {
-    set_receiver(actor);
-  }
-  /** @deprecated Mailbox::get_receiver() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::get_receiver()") ActorPtr getReceiver() { return get_receiver(); }
-  /** @deprecated Mailbox::get_name() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::get_name()") const xbt::string& getName() const { return get_name(); }
-  /** @deprecated Mailbox::get_cname() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::get_cname()") const char* getCname() const { return get_cname(); }
-  /** @deprecated Mailbox::get_impl() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::get_impl()") kernel::activity::MailboxImpl* getImpl()
-  {
-    return get_impl();
-  }
-  /** @deprecated Mailbox::by_name() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::by_name()") static Mailbox* byName(const char* name)
-  {
-    return by_name(name);
-  }
-  /** @deprecated Mailbox::by_name() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::by_name()") static Mailbox* byName(const std::string& name)
-  {
-    return by_name(name);
-  }
-#endif
 };
 
 } // namespace s4u
index 81b167c..05f4912 100644 (file)
@@ -31,12 +31,12 @@ class XBT_PUBLIC Mutex {
   friend kernel::activity::MutexImpl;
 
   kernel::activity::MutexImpl* const pimpl_;
-  explicit Mutex(kernel::activity::MutexImpl* mutex) : pimpl_(mutex) {}
   /* refcounting */
   friend XBT_PUBLIC void intrusive_ptr_add_ref(Mutex* mutex);
   friend XBT_PUBLIC void intrusive_ptr_release(Mutex* mutex);
 
 public:
+  explicit Mutex(kernel::activity::MutexImpl* mutex) : pimpl_(mutex) {}
   ~Mutex();
   // No copy:
   /** You cannot create a new mutex by copying an existing one. Use MutexPtr instead */
@@ -49,12 +49,6 @@ public:
   void lock();
   void unlock();
   bool try_lock();
-
-#ifndef DOXYGEN
-  // deprecated
-  /** @deprecated Mutex::create() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Mutex::create()") static MutexPtr createMutex() { return create(); }
-#endif
 };
 
 } // namespace s4u
index 815b176..609542f 100644 (file)
@@ -27,8 +27,7 @@ class XBT_PUBLIC NetZone {
 protected:
   friend kernel::routing::NetZoneImpl;
 
-  explicit NetZone(kernel::routing::NetZoneImpl* impl);
-  ~NetZone();
+  explicit NetZone(kernel::routing::NetZoneImpl* impl) : pimpl_(impl) {}
 
 public:
   /** @brief Retrieves the name of that netzone as a C++ string */
@@ -41,7 +40,7 @@ public:
   std::vector<Host*> get_all_hosts();
   int get_host_count();
 
-  kernel::routing::NetZoneImpl* get_impl() { return pimpl_; }
+  kernel::routing::NetZoneImpl* get_impl() const { return pimpl_; }
 
 private:
   kernel::routing::NetZoneImpl* const pimpl_;
@@ -49,12 +48,12 @@ private:
 
 public:
   /** Get the properties assigned to a netzone */
-  std::unordered_map<std::string, std::string>* get_properties();
+  const std::unordered_map<std::string, std::string>* get_properties() const;
 
   std::vector<NetZone*> get_children();
 
   /** Retrieve the property value (or nullptr if not set) */
-  const char* get_property(const std::string& key);
+  const char* get_property(const std::string& key) const;
   void set_property(const std::string& key, const std::string& value);
 
   /* Add content to the netzone, at parsing time. It should be sealed afterward. */
@@ -73,65 +72,6 @@ public:
       on_route_creation;
   static xbt::signal<void(NetZone const&)> on_creation;
   static xbt::signal<void(NetZone const&)> on_seal;
-
-#ifndef DOXYGEN
-  // Deprecation wrappers
-  /** @deprecated NetZone::get_father() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_father()") NetZone* getFather() { return get_father(); }
-  /** @deprecated NetZone::get_name() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_name()") const std::string& getName() const { return get_name(); }
-  /** @deprecated NetZone::get_cname() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_cname()") const char* getCname() const { return get_cname(); }
-  /** @deprecated NetZone::add_route() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::add_route()") void addRoute(
-      kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src,
-      kernel::routing::NetPoint* gw_dst, std::vector<kernel::resource::LinkImpl*>& link_list, bool symmetrical)
-  {
-    add_route(src, dst, gw_src, gw_dst, link_list, symmetrical);
-  }
-  /** @deprecated NetZone::add_bypass_route() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::add_bypass_route()") void addBypassRoute(
-      kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, kernel::routing::NetPoint* gw_src,
-      kernel::routing::NetPoint* gw_dst, std::vector<kernel::resource::LinkImpl*>& link_list, bool symmetrical)
-  {
-    add_bypass_route(src, dst, gw_src, gw_dst, link_list, symmetrical);
-  }
-  /** @deprecated NetZone::get_properties() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_properties()") std::unordered_map<std::string, std::string>* getProperties()
-  {
-    return get_properties();
-  }
-  /** @deprecated NetZone::get_property() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_property()") const char* getProperty(const char* key)
-  {
-    return get_property(key);
-  }
-  /** @deprecated NetZone::set_property() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::set_property()") void setProperty(const char* key, const char* value)
-  {
-    set_property(key, value);
-  }
-  /** @deprecated NetZone::add_component() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::add_component()") int addComponent(kernel::routing::NetPoint* elm)
-  {
-    return add_component(elm);
-  }
-  /** @deprecated NetZone::get_vertices() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_vertices()") std::vector<kernel::routing::NetPoint*> getVertices();
-  /** @deprecated NetZone::get_host_count() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_host_count()") int getHostCount() { return get_host_count(); }
-  /** @deprecated NetZone::get_all_hosts() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_all_hosts()") void getHosts(
-      std::vector<s4u::Host*>* whereto); // retrieve my content as a vector of hosts
-  /** @deprecated NetZone::get_children() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_children()") std::vector<NetZone*>* getChildren()
-  {
-    std::vector<NetZone*>* res = new std::vector<NetZone*>();
-    for (auto child : get_children())
-      res->push_back(child);
-    return res;
-  }
-#endif
 };
 
 } // namespace s4u
index 1b5107b..3099a47 100644 (file)
@@ -56,13 +56,10 @@ public:
   Host* get_host() { return attached_to_; };
   void set_host(Host* host) { attached_to_ = host; }
 
-  std::unordered_map<std::string, std::string>* get_properties();
-  const char* get_property(const std::string& key);
+  const std::unordered_map<std::string, std::string>* get_properties() const;
+  const char* get_property(const std::string& key) const;
   void set_property(const std::string&, const std::string& value);
 
-  void set_data(void* data) { userdata_ = data; }
-  void* get_data() { return userdata_; }
-
   IoPtr io_init(sg_size_t size, s4u::Io::OpType type);
 
   IoPtr read_async(sg_size_t size);
@@ -70,54 +67,12 @@ public:
 
   IoPtr write_async(sg_size_t size);
   sg_size_t write(sg_size_t size);
-  kernel::resource::StorageImpl* get_impl() { return pimpl_; }
-
-  // Deprecated functions
-#ifndef DOXYGEN
-  /** @deprecated Storage::by_name() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Storage::by_name()") Storage* byName(const std::string& name)
-  {
-    return by_name(name);
-  }
-  /** @deprecated Storage::get_name() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Storage::get_name()") std::string const& getName() const { return get_name(); }
-  /** @deprecated Storage::get_cname() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Storage::get_cname()") const char* getCname() const { return get_cname(); }
-  /** @deprecated Storage::get_type() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Storage::get_type()") const char* getType() { return get_type(); }
-  /** @deprecated Storage::get_host() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Storage::get_host()") Host* getHost() { return get_host(); }
-  /** @deprecated Storage::get_properties() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Storage::get_properties()") std::map<std::string, std::string>* getProperties()
-  {
-    std::map<std::string, std::string>* res             = new std::map<std::string, std::string>();
-    std::unordered_map<std::string, std::string>* props = get_properties();
-    for (auto const& kv : *props)
-      res->insert(kv);
-    return res;
-  }
-  /** @deprecated Storage::get_property() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Storage::get_property()") const char* getProperty(const char* key)
-  {
-    return get_property(key);
-  }
-  /** @deprecated Storage::set_property() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Storage::set_property()") void setProperty(const std::string& key,
-                                                                                    const std::string& value)
-  {
-    set_property(key, value);
-  }
-  /** @deprecated Storage::set_data() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Storage::set_data()") void setUserdata(void* data) { set_data(data); }
-  /** @deprecated Storage::get_data() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Storage::get_data()") void* getUserdata() { return get_data(); }
-#endif
+  kernel::resource::StorageImpl* get_impl() const { return pimpl_; }
 
 private:
   Host* attached_to_ = nullptr;
   kernel::resource::StorageImpl* const pimpl_;
   std::string name_;
-  void* userdata_ = nullptr;
 };
 
 } // namespace s4u
index 4dd134d..5ea7916 100644 (file)
@@ -6,6 +6,7 @@
 #ifndef SIMGRID_S4U_VM_HPP
 #define SIMGRID_S4U_VM_HPP
 
+#include <simgrid/forward.h>
 #include <simgrid/s4u/Host.hpp>
 
 namespace simgrid {
@@ -59,33 +60,6 @@ public:
   static xbt::signal<void(VirtualMachine const&)> on_resume;
   static xbt::signal<void(VirtualMachine const&)> on_migration_start;
   static xbt::signal<void(VirtualMachine const&)> on_migration_end;
-
-#ifndef DOXYGEN
-  // Deprecated methods
-  /** @deprecated See VirtualMachine::get_state() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::get_state()") VirtualMachine::state getState()
-  {
-    return get_state();
-  }
-  /** @deprecated See VirtualMachine::get_impl() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::get_impl()") vm::VirtualMachineImpl* getImpl()
-  {
-    return pimpl_vm_;
-  }
-  /** @deprecated See VirtualMachine::get_pm() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::get_pm()") Host* getPm() { return get_pm(); }
-  /** @deprecated See VirtualMachine::set_pm() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::set_pm()") void setPm(Host* pm) { set_pm(pm); }
-  /** @deprecated See VirtualMachine::get_ramsize() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::get_ramsize()") size_t getRamsize() { return get_ramsize(); }
-  /** @deprecated See VirtualMachine::set_ramsize() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::set_ramsize()") void setRamsize(size_t ramsize)
-  {
-    set_ramsize(ramsize);
-  }
-  /** @deprecated See VirtualMachine::set_bound() */
-  XBT_ATTRIB_DEPRECATED_v323("Please use VirtualMachine::set_bound()") void setBound(double bound) { set_bound(bound); }
-#endif
 };
 } // namespace s4u
 } // namespace simgrid
index fc162d6..5031939 100644 (file)
@@ -144,7 +144,7 @@ XBT_PUBLIC int SD_task_dependency_exists(SD_task_t src, SD_task_t dst);
 #define SD_init(argc, argv)                                                                                            \
   do {                                                                                                                 \
     sg_version_check(SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR, SIMGRID_VERSION_PATCH);                             \
-    SD_init_nocheck(argc, argv);                                                                                       \
+    SD_init_nocheck((argc), (argv));                                                                                   \
   } while (0)
 
 XBT_PUBLIC void SD_init_nocheck(int* argc, char** argv);
index 1a6bb09..db8f5dc 100644 (file)
@@ -94,18 +94,8 @@ XBT_PUBLIC double SIMIX_timer_get_date(smx_timer_t timer);
 XBT_PUBLIC void SIMIX_display_process_status();
 SG_END_DECL()
 
-/******************************* Environment **********************************/
-SG_BEGIN_DECL()
-XBT_ATTRIB_DEPRECATED_v324("Please use simgrid_load_platform()") XBT_PUBLIC
-    void SIMIX_create_environment(const char* file);
-SG_END_DECL()
-
 /******************************** Deployment **********************************/
 SG_BEGIN_DECL()
-XBT_ATTRIB_DEPRECATED_v324("Please use simgrid_register_function()") XBT_PUBLIC
-    void SIMIX_function_register(const char* name, xbt_main_func_t code);
-XBT_ATTRIB_DEPRECATED_v324("Please use simgrid_load_deployment()") XBT_PUBLIC
-    void SIMIX_launch_application(const char* file);
 XBT_PUBLIC void SIMIX_function_register_default(xbt_main_func_t code);
 
 XBT_PUBLIC void SIMIX_init_application();
@@ -180,18 +170,18 @@ XBT_ATTRIB_DEPRECATED_v325("Please use CommImpl::finish()") XBT_PUBLIC void SIMI
 /******************************* Host simcalls ********************************/
 #ifdef __cplusplus
 XBT_PUBLIC e_smx_state_t simcall_execution_wait(const smx_activity_t& execution);
-XBT_PUBLIC e_smx_state_t simcall_execution_test(const smx_activity_t& execution);
+XBT_PUBLIC unsigned int simcall_execution_waitany_for(simgrid::kernel::activity::ExecImpl* execs[], size_t count,
+                                                      double timeout);
+XBT_PUBLIC bool simcall_execution_test(const smx_activity_t& execution);
 #endif
 
 /**************************** Process simcalls ********************************/
 SG_BEGIN_DECL()
-XBT_ATTRIB_DEPRECATED_v324("Please use ActorImpl::throw_exception") XBT_PUBLIC
-    void SIMIX_process_throw(smx_actor_t process, xbt_errcat_t cat, int value, const char* mesg);
-
 void simcall_process_set_data(smx_actor_t process, void* data);
-/* Process handling */
-XBT_PUBLIC void simcall_process_suspend(smx_actor_t process);
-XBT_PUBLIC void simcall_process_join(smx_actor_t process, double timeout);
+XBT_ATTRIB_DEPRECATED_v327("Please use Actor::suspend()") XBT_PUBLIC void simcall_process_suspend(smx_actor_t process);
+
+XBT_ATTRIB_DEPRECATED_v327("Please use Actor::join()") 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);
@@ -211,7 +201,7 @@ XBT_PUBLIC smx_activity_t simcall_comm_isend(smx_actor_t sender, smx_mailbox_t m
                                              int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
                                              void (*clean_fun)(void*),
                                              void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t),
-                                             void* data, int detached);
+                                             void* data, bool detached);
 
 XBT_PUBLIC void simcall_comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size,
                                   int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
@@ -233,7 +223,7 @@ XBT_PUBLIC unsigned int simcall_comm_waitany(smx_activity_t comms[], size_t coun
 XBT_PUBLIC unsigned int simcall_comm_waitany(simgrid::kernel::activity::CommImpl* comms[], size_t count,
                                              double timeout);
 XBT_PUBLIC void simcall_comm_wait(const smx_activity_t& comm, double timeout);
-XBT_PUBLIC int simcall_comm_test(const smx_activity_t& comm);
+XBT_PUBLIC bool simcall_comm_test(const smx_activity_t& comm);
 XBT_PUBLIC int simcall_comm_testany(smx_activity_t comms[], size_t count);
 XBT_PUBLIC int simcall_comm_testany(simgrid::kernel::activity::CommImpl* comms[], size_t count);
 #endif
@@ -271,16 +261,14 @@ XBT_ATTRIB_DEPRECATED_v325("Please use Comm::cancel()") XBT_PUBLIC void simcall_
 
 XBT_ATTRIB_DEPRECATED_v325("Please use Exec::cancel()") XBT_PUBLIC
     void simcall_execution_cancel(smx_activity_t execution);
-XBT_ATTRIB_DEPRECATED_v325("Please use Exec::set_priority()") XBT_PUBLIC
-    void simcall_execution_set_priority(smx_activity_t execution, double priority);
 XBT_ATTRIB_DEPRECATED_v325("Please use Exec::set_bound()") XBT_PUBLIC
     void simcall_execution_set_bound(smx_activity_t execution, double bound);
 SG_END_DECL()
 
 #ifdef __cplusplus
 XBT_ATTRIB_DEPRECATED_v325("Please use Exec::start()") XBT_PUBLIC smx_activity_t
-    simcall_execution_start(const std::string& name, const std::string& category, double flops_amount, double priority,
-                            double bound, sg_host_t host);
+    simcall_execution_start(const std::string& name, const std::string& category, double flops_amount,
+                            double sharing_penalty, double bound, sg_host_t host);
 
 // Should be deprecated in v325 too but is still used in other deprecated calls
 XBT_PUBLIC smx_activity_t simcall_execution_parallel_start(const std::string& name, int host_nb,
index 9b48080..9539451 100644 (file)
 #include <string>
 #include <unordered_map>
 
-XBT_PUBLIC void simcall_run_kernel(std::function<void()> const& code);
+XBT_PUBLIC void simcall_run_kernel(std::function<void()> const& code, simgrid::mc::SimcallInspector* t);
+XBT_PUBLIC void simcall_run_blocking(std::function<void()> const& code, simgrid::mc::SimcallInspector* t);
 
-/** Execute some code in the kernel and block
+namespace simgrid {
+namespace kernel {
+namespace actor {
+
+/** Execute some code in kernel context on behalf of the user code.
+ *
+ * Every modification of the environment must be protected this way: every setter, constructor and similar.
+ * Getters don't have to be protected this way.
+ *
+ * This allows deterministic parallel simulation without any locking, even if almost nobody uses parallel simulation in
+ * SimGrid. More interestingly it makes every modification of the simulated world observable by the model-checker,
+ * allowing the whole MC business.
  *
- * run_blocking() is a generic blocking simcall. It is given a callback
- * which is executed immediately in the SimGrid kernel. The callback is
- * responsible for setting the suitable logic for waking up the process
- * when needed.
+ * It is highly inspired from the syscalls in a regular operating system, allowing the user code to get some specific
+ * code executed in the kernel context. But here, there is almost no security involved. Parameters get checked for
+ * finitness but that's all. The main goal remain to ensure reproductible ordering of uncomparable events (in [parallel]
+ * simulation) and observability of events (in model-checking).
  *
- * @ref simix::kernelSync() is a higher level wrapper for this.
+ * The code passed as argument is supposed to terminate at the exact same simulated timestamp.
+ * Do not use it if your code may block waiting for a subsequent event, e.g. if you lock a mutex,
+ * you may need to wait for that mutex to be unlocked by its current owner.
+ * Potentially blocking simcall must be issued using simcall_blocking(), right below in this file.
  */
-XBT_PUBLIC void simcall_run_blocking(std::function<void()> const& code);
-
-template<class F> inline
-void simcall_run_kernel(F& f)
-{
-  simcall_run_kernel(std::function<void()>(std::ref(f)));
-}
-template<class F> inline
-void simcall_run_blocking(F& f)
+template <class F> typename std::result_of<F()>::type simcall(F&& code, mc::SimcallInspector* t = nullptr)
 {
-  simcall_run_blocking(std::function<void()>(std::ref(f)));
-}
+  // If we are in the maestro, we take the fast path and execute the
+  // code directly without simcall mashalling/unmarshalling/dispatch:
+  if (SIMIX_is_maestro())
+    return std::forward<F>(code)();
 
-namespace simgrid {
-namespace simix {
+  // If we are in the application, pass the code to the maestro which
+  // executes it for us and reports the result. We use a std::future which
+  // conveniently handles the success/failure value for us.
+  typedef typename std::result_of<F()>::type R;
+  simgrid::xbt::Result<R> result;
+  simcall_run_kernel([&result, &code] { simgrid::xbt::fulfill_promise(result, std::forward<F>(code)); }, t);
+  return result.get();
+}
 
-/** Execute some code in the kernel/maestro
+/** Execute some code (that does not return immediately) in kernel context
  *
- *  This can be used to enforce mutual exclusion with other simcall.
- *  More importantly, this enforces a deterministic/reproducible ordering
- *  of the operation with respect to other simcalls.
+ * This is very similar to simcall() right above, but the calling actor will not get rescheduled until
+ * actor->simcall_answer() is called explicitely.
+ *
+ * Since the return value does not come from the lambda directly, its type cannot be guessed automatically and must
+ * be provided as template parameter.
+ *
+ * This is meant for blocking actions. For example, locking a mutex is a blocking simcall.
+ * First it's a simcall because that's obviously a modification of the world. Then, that's a blocking simcall because if
+ * the mutex happens not to be free, the actor is added to a queue of actors in the mutex. Every mutex->unlock() takes
+ * the first actor from the queue, mark it as current owner of the mutex and call actor->simcall_answer() to mark that
+ * this mutex is now unblocked and ready to run again. If the mutex is initially free, the calling actor is unblocked
+ * right away with actor->simcall_answer() once the mutex is marked as locked.
+ *
+ * If your code never calls actor->simcall_answer() itself, the actor will never return from its simcall.
  */
-template <class F> typename std::result_of<F()>::type simcall(F&& code)
+template <class R, class F> R simcall_blocking(F&& code, mc::SimcallInspector* t = nullptr)
 {
   // If we are in the maestro, we take the fast path and execute the
   // code directly without simcall mashalling/unmarshalling/dispatch:
@@ -59,11 +85,15 @@ template <class F> typename std::result_of<F()>::type simcall(F&& code)
   // If we are in the application, pass the code to the maestro which
   // executes it for us and reports the result. We use a std::future which
   // conveniently handles the success/failure value for us.
-  typedef typename std::result_of<F()>::type R;
   simgrid::xbt::Result<R> result;
-  simcall_run_kernel([&result, &code] { simgrid::xbt::fulfill_promise(result, std::forward<F>(code)); });
+  simcall_run_blocking([&result, &code] { simgrid::xbt::fulfill_promise(result, std::forward<F>(code)); }, t);
   return result.get();
 }
+} // namespace actor
+} // namespace kernel
+} // namespace simgrid
+namespace simgrid {
+namespace simix {
 
 XBT_ATTRIB_DEPRECATED_v325("Please manifest if you actually need this function")
     XBT_PUBLIC const std::vector<smx_actor_t>& process_get_runnable();
index 2e1cac1..017b7f2 100644 (file)
@@ -18,8 +18,6 @@
 #include <simgrid/simix.h>
 #include <simgrid/simix.hpp>
 
-XBT_PUBLIC void simcall_run_blocking(std::function<void()> const& code);
-
 namespace simgrid {
 namespace simix {
 
@@ -54,30 +52,26 @@ template <class F> auto kernel_sync(F code) -> decltype(code().get())
   smx_actor_t self = SIMIX_process_self();
   simgrid::xbt::Result<T> result;
 
-  simcall_run_blocking([&result, self, &code]{
-    try {
-      auto future = code();
-      future.then_([&result, self](std::shared_ptr<simgrid::kernel::FutureState<T>>&& value) {
-        simgrid::xbt::set_promise(result, simgrid::kernel::Future<T>(value));
-        simgrid::simix::unblock(self);
-      });
-    }
-    catch (...) {
-      result.set_exception(std::current_exception());
-      simgrid::simix::unblock(self);
-    }
-  });
+  simcall_run_blocking(
+      [&result, self, &code] {
+        try {
+          auto future = code();
+          future.then_([&result, self](std::shared_ptr<simgrid::kernel::FutureState<T>>&& value) {
+            simgrid::xbt::set_promise(result, simgrid::kernel::Future<T>(value));
+            simgrid::simix::unblock(self);
+          });
+        } catch (...) {
+          result.set_exception(std::current_exception());
+          simgrid::simix::unblock(self);
+        }
+      },
+      nullptr);
   return result.get();
 }
-template <class F>
-XBT_ATTRIB_DEPRECATED_v323("Please use simix::kernel_sync()") auto kernelSync(F code) -> decltype(code().get())
-{
-  return kernel_sync(code);
-}
 
 /** A blocking (`wait()`-based) future for SIMIX processes */
-// TODO, .wait_for()
-// TODO, .wait_until()
+// TODO, .wait_for
+// TODO, .wait_until
 // TODO, SharedFuture
 // TODO, simgrid::simix::when_all - wait for all future to be ready (this one is simple!)
 // TODO, simgrid::simix::when_any - wait for any future to be ready
@@ -94,20 +88,21 @@ public:
       throw std::future_error(std::future_errc::no_state);
     smx_actor_t self = SIMIX_process_self();
     simgrid::xbt::Result<T> result;
-    simcall_run_blocking([this, &result, self]{
-      try {
-        // When the kernel future is ready...
-        this->future_.then_([&result, self](std::shared_ptr<simgrid::kernel::FutureState<T>>&& value) {
-          // ... wake up the process with the result of the kernel future.
-          simgrid::xbt::set_promise(result, simgrid::kernel::Future<T>(value));
-          simgrid::simix::unblock(self);
-        });
-      }
-      catch (...) {
-        result.set_exception(std::current_exception());
-        simgrid::simix::unblock(self);
-      }
-    });
+    simcall_run_blocking(
+        [this, &result, self] {
+          try {
+            // When the kernel future is ready...
+            this->future_.then_([&result, self](std::shared_ptr<simgrid::kernel::FutureState<T>>&& value) {
+              // ... wake up the process with the result of the kernel future.
+              simgrid::xbt::set_promise(result, simgrid::kernel::Future<T>(value));
+              simgrid::simix::unblock(self);
+            });
+          } catch (...) {
+            result.set_exception(std::current_exception());
+            simgrid::simix::unblock(self);
+          }
+        },
+        nullptr);
     return result.get();
   }
   bool is_ready() const
@@ -124,20 +119,21 @@ public:
     // The future is not ready. We have to delegate to the SimGrid kernel:
     std::exception_ptr exception;
     smx_actor_t self = SIMIX_process_self();
-    simcall_run_blocking([this, &exception, self]{
-      try {
-        // When the kernel future is ready...
-        this->future_.then_([this, self](std::shared_ptr<simgrid::kernel::FutureState<T>>&& value) {
-          // ...store it the simix kernel and wake up.
-          this->future_ = std::move(simgrid::kernel::Future<T>(value));
-          simgrid::simix::unblock(self);
-        });
-      }
-      catch (...) {
-        exception = std::current_exception();
-        simgrid::simix::unblock(self);
-      }
-    });
+    simcall_run_blocking(
+        [this, &exception, self] {
+          try {
+            // When the kernel future is ready...
+            this->future_.then_([this, self](std::shared_ptr<simgrid::kernel::FutureState<T>>&& value) {
+              // ...store it the simix kernel and wake up.
+              this->future_ = std::move(simgrid::kernel::Future<T>(value));
+              simgrid::simix::unblock(self);
+            });
+          } catch (...) {
+            exception = std::current_exception();
+            simgrid::simix::unblock(self);
+          }
+        },
+        nullptr);
   }
 private:
   // We wrap an event-based kernel future:
@@ -154,16 +150,11 @@ template <class F> auto kernel_async(F code) -> Future<decltype(code().get())>
   typedef decltype(code().get()) T;
 
   // Execute the code in the kernel and get the kernel future:
-  simgrid::kernel::Future<T> future = simgrid::simix::simcall(std::move(code));
+  simgrid::kernel::Future<T> future = simgrid::kernel::actor::simcall(std::move(code));
 
   // Wrap the kernel future in a actor future:
   return simgrid::simix::Future<T>(std::move(future));
 }
-template <class F>
-XBT_ATTRIB_DEPRECATED_v323("Please use simix::kernel_sync()") auto kernelAsync(F code) -> Future<decltype(code().get())>
-{
-  return kernel_async(code);
-}
 }
 }
 
index 91f8943..c25ab90 100644 (file)
 
 #define CHECK_ACTION_PARAMS(action, mandatory, optional)                                                               \
   {                                                                                                                    \
-    if (action.size() < static_cast<unsigned long>(mandatory + 2)) {                                                   \
+    if ((action).size() < static_cast<unsigned long>((mandatory) + 2)) {                                               \
       std::stringstream ss;                                                                                            \
       ss << __func__ << " replay failed.\n"                                                                            \
-         << action.size() << " items were given on the line. First two should be process_id and action.  "             \
-         << "This action needs after them " << mandatory << " mandatory arguments, and accepts " << optional           \
+         << (action).size() << " items were given on the line. First two should be process_id and action.  "           \
+         << "This action needs after them " << (mandatory) << " mandatory arguments, and accepts " << (optional)       \
          << " optional ones. \n"                                                                                       \
          << "The full line that was given is:\n   ";                                                                   \
-      for (const auto& elem : action) {                                                                                \
+      for (const auto& elem : (action)) {                                                                              \
         ss << elem << " ";                                                                                             \
       }                                                                                                                \
       ss << "\nPlease contact the Simgrid team if support is needed";                                                  \
@@ -31,8 +31,8 @@
     }                                                                                                                  \
   }
 
-XBT_PRIVATE void* smpi_get_tmp_sendbuffer(int size);
-XBT_PRIVATE void* smpi_get_tmp_recvbuffer(int size);
+XBT_PRIVATE unsigned char* smpi_get_tmp_sendbuffer(size_t size);
+XBT_PRIVATE unsigned char* smpi_get_tmp_recvbuffer(size_t size);
 
 XBT_PRIVATE void log_timed_action(simgrid::xbt::ReplayAction& action, double clock);
 
@@ -74,12 +74,26 @@ public:
 
 class ComputeParser : public ActionArgParser {
 public:
-  /* communication partner; if we send, this is the receiver and vice versa */
   double flops;
 
   void parse(simgrid::xbt::ReplayAction& action, const std::string& name) override;
 };
 
+class SleepParser : public ActionArgParser {
+public:
+  double time;
+
+  void parse(simgrid::xbt::ReplayAction& action, const std::string& name) override;
+};
+
+class LocationParser : public ActionArgParser {
+public:
+  std::string filename;
+  int line;
+
+  void parse(simgrid::xbt::ReplayAction& action, const std::string& name) override;
+};
+
 class CollCommParser : public ActionArgParser {
 public:
   double size;
@@ -187,8 +201,8 @@ public:
   }
 
   virtual void kernel(simgrid::xbt::ReplayAction& action) = 0;
-  void* send_buffer(int size) { return smpi_get_tmp_sendbuffer(size); }
-  void* recv_buffer(int size) { return smpi_get_tmp_recvbuffer(size); }
+  unsigned char* send_buffer(int size) { return smpi_get_tmp_sendbuffer(size); }
+  unsigned char* recv_buffer(int size) { return smpi_get_tmp_recvbuffer(size); }
 };
 
 class WaitAction : public ReplayAction<WaitTestParser> {
@@ -224,6 +238,18 @@ public:
   void kernel(simgrid::xbt::ReplayAction& action) override;
 };
 
+class SleepAction : public ReplayAction<SleepParser> {
+public:
+  explicit SleepAction() : ReplayAction("sleep") {}
+  void kernel(simgrid::xbt::ReplayAction& action) override;
+};
+
+class LocationAction : public ReplayAction<LocationParser> {
+public:
+  explicit LocationAction() : ReplayAction("location") {}
+  void kernel(simgrid::xbt::ReplayAction& action) override;
+};
+
 class TestAction : public ReplayAction<WaitTestParser> {
 private:
   RequestStorage& req_storage;
index b23b185..fd92dd6 100644 (file)
@@ -17,6 +17,8 @@ class Coll;
 class Colls;
 class Comm;
 class Datatype;
+class Errhandler;
+class File;
 class Group;
 class Info;
 class Keyval;
@@ -35,6 +37,8 @@ class Win;
 
 typedef simgrid::smpi::Comm SMPI_Comm;
 typedef simgrid::smpi::Datatype SMPI_Datatype;
+typedef simgrid::smpi::Errhandler SMPI_Errhandler;
+typedef simgrid::smpi::File SMPI_File;
 typedef simgrid::smpi::Group SMPI_Group;
 typedef simgrid::smpi::Info SMPI_Info;
 typedef simgrid::smpi::Op SMPI_Op;
@@ -49,6 +53,8 @@ typedef simgrid::smpi::Win SMPI_Win;
 
 typedef struct SMPI_Comm SMPI_Comm;
 typedef struct SMPI_Datatype SMPI_Datatype;
+typedef struct SMPI_Errhandler SMPI_Errhandler;
+typedef struct SMPI_File SMPI_File;
 typedef struct SMPI_Group SMPI_Group;
 typedef struct SMPI_Info SMPI_Info;
 typedef struct SMPI_Op SMPI_Op;
index 786e226..019ee69 100644 (file)
@@ -35,8 +35,8 @@
       parameter(MPI_SOURCE=1)
       parameter(MPI_TAG=2)
       parameter(MPI_ERROR=3)
-      parameter(MPI_VERSION=2)
-      parameter(MPI_SUBVERSION=2)
+      parameter(MPI_VERSION=3)
+      parameter(MPI_SUBVERSION=1)
       parameter(MPI_LOCK_EXCLUSIVE=1)
       parameter(MPI_LOCK_SHARED=2)
       integer MPI_MODE_NOSTORE, MPI_MODE_NOPUT, MPI_MODE_NOPRECEDE
       parameter(MPI_COMM_NULL_DELETE_FN =0)
       integer MPI_COMM_DUP_FN
       parameter(MPI_COMM_DUP_FN =1)
-      integer MPI_WIN_NULL_COPY_FN, MPI_WIN_NULL_DELETE_FN
-      parameter(MPI_WIN_NULL_COPY_FN =0)
+      integer MPI_WIN_NULL_DELETE_FN
       parameter(MPI_WIN_NULL_DELETE_FN =0)
-      integer MPI_WIN_DUP_FN
-      parameter(MPI_WIN_DUP_FN =1)
       integer MPI_TYPE_NULL_COPY_FN, MPI_TYPE_NULL_DELETE_FN
       parameter(MPI_TYPE_NULL_COPY_FN =0)
       parameter(MPI_TYPE_NULL_DELETE_FN =0)
       parameter(MPI_UNIVERSE_SIZE=-7)
       parameter(MPI_LASTUSEDCODE=-8)
 
-      integer MPI_ERRORS_RETURN, MPI_ERRORS_ARE_FATAL
-      integer MPI_ERRHANDLER_NULL
-      parameter(MPI_ERRORS_RETURN=0)
-      parameter(MPI_ERRORS_ARE_FATAL=1)
-      parameter(MPI_ERRHANDLER_NULL=2)
-
 ! This should be equal to the number of int fields in MPI_Status
       integer MPI_STATUS_SIZE
       parameter(MPI_STATUS_SIZE=5)
       integer MPI_INTEGER_KIND
       parameter(MPI_INTEGER_KIND=4)
 
-      integer MPI_IN_PLACE
-      parameter(MPI_IN_PLACE=-100)
-      integer MPI_BOTTOM
-      parameter(MPI_BOTTOM=-200)
-      integer MPI_STATUS_IGNORE
-      parameter(MPI_STATUS_IGNORE=-300)
-      integer MPI_STATUSES_IGNORE
-      parameter(MPI_STATUSES_IGNORE=-400)
-
+      external MPI_IN_PLACE, MPI_BOTTOM
+      external MPI_STATUS_IGNORE, MPI_STATUSES_IGNORE
 
       integer MPI_BYTE, MPI_CHARACTER, MPI_LOGICAL
       integer MPI_INTEGER, MPI_INTEGER1, MPI_INTEGER2, MPI_INTEGER4
       integer MPI_DOUBLE_PRECISION, MPI_COMPLEX, MPI_DOUBLE_COMPLEX
       integer MPI_2INTEGER, MPI_LOGICAL1, MPI_LOGICAL2, MPI_LOGICAL4
       integer MPI_LOGICAL8, MPI_2REAL, MPI_2DOUBLE_PRECISION
-      integer MPI_AINT, MPI_OFFSET, MPI_COUNT
-      integer MPI_REAL16, MPI_PACKED
+      integer MPI_AINT, MPI_OFFSET, MPI_COUNT, MPI_REAL16
+      integer MPI_PACKED, MPI_COMPLEX8, MPI_COMPLEX16, MPI_COMPLEX32
 
       integer MPI_MAX, MPI_MIN, MPI_MAXLOC, MPI_MINLOC
       integer MPI_SUM, MPI_PROD, MPI_LAND, MPI_LOR, MPI_LXOR, MPI_BAND
       integer MPI_REQUEST_NULL,MPI_DATATYPE_NULL,MPI_OP_NULL
       integer MPI_COMM_NULL, MPI_COMM_WORLD, MPI_COMM_SELF
       integer MPI_GROUP_NULL, MPI_GROUP_EMPTY, MPI_WIN_NULL
-      integer MPI_INFO_NULL
+      integer MPI_INFO_NULL, MPI_ERRHANDLER_NULL
 
       parameter(MPI_REQUEST_NULL=-1)
       parameter(MPI_DATATYPE_NULL=-1)
       parameter(MPI_GROUP_NULL=-1)
       parameter(MPI_GROUP_EMPTY=-2)
       parameter(MPI_WIN_NULL=-1)
+      parameter(MPI_ERRHANDLER_NULL=-1)
 
       integer MPI_WIN_BASE, MPI_WIN_SIZE, MPI_WIN_DISP_UNIT
 
       parameter(MPI_COUNT=24)
       parameter(MPI_REAL16=25)
       parameter(MPI_PACKED=26)
+      parameter(MPI_COMPLEX8=27)
+      parameter(MPI_COMPLEX16=28)
+      parameter(MPI_COMPLEX32=29)
+      parameter(MPI_MAX=30)
+      parameter(MPI_MIN=31)
+      parameter(MPI_MAXLOC=32)
+      parameter(MPI_MINLOC=33)
+      parameter(MPI_SUM=34)
+      parameter(MPI_PROD=35)
+      parameter(MPI_LAND=36)
+      parameter(MPI_LOR=37)
+      parameter(MPI_LXOR=38)
+      parameter(MPI_BAND=39)
+      parameter(MPI_BOR=40)
+      parameter(MPI_BXOR=41)
 
-      parameter(MPI_MAX=27)
-      parameter(MPI_MIN=28)
-      parameter(MPI_MAXLOC=29)
-      parameter(MPI_MINLOC=30)
-      parameter(MPI_SUM=31)
-      parameter(MPI_PROD=32)
-      parameter(MPI_LAND=33)
-      parameter(MPI_LOR=34)
-      parameter(MPI_LXOR=35)
-      parameter(MPI_BAND=36)
-      parameter(MPI_BOR=37)
-      parameter(MPI_BXOR=38)
-
+      integer MPI_ERRORS_RETURN, MPI_ERRORS_ARE_FATAL
+      parameter(MPI_ERRORS_RETURN=42)
+      parameter(MPI_ERRORS_ARE_FATAL=43)
+      
       INTEGER MPI_ADDRESS_KIND, MPI_OFFSET_KIND
       PARAMETER (MPI_ADDRESS_KIND=@CMAKE_SIZEOF_VOID_P@)
       PARAMETER (MPI_OFFSET_KIND=@CMAKE_SIZEOF_VOID_P@)
       external MPI_BCAST, MPI_BARRIER, MPI_REDUCE, MPI_ALLREDUCE
       external MPI_SCATTER, MPI_GATHER, MPI_ALLGATHER, MPI_SCAN
       external MPI_ALLTOALL, MPI_GATHERV, MPI_SENDRECV
+      external MPI_WIN_DUP_FN, MPI_WIN_NULL_COPY_FN
 
       external MPI_WTIME
       external MPI_WTICK
 
       double precision MPI_WTIME
       double precision MPI_WTICK
-
-      external smpi_execute_flops
-      external smpi_execute
-      external smpi_get_host_power_peak_at
-      external smpi_get_host_current_power_peak
-      external smpi_get_host_nb_pstates
-      external smpi_set_host_pstate
-      external smpi_get_host_consumed_energy
-
-      double precision smpi_get_host_power_peak_at
-      double precision smpi_get_host_current_power_peak
-      integer smpi_get_host_nb_pstates
-      double precision smpi_get_host_consumed_energy
 @MODULE_MPIF_OUT@
index 03155b4..e7c7d7c 100644 (file)
 #include <smpi/smpi.h>
 
 #define AMPI_CALL(type, name, args)                                                                                    \
-  type A##name args __attribute__((weak));                                                                             \
-  type AP##name args;
+  type _XBT_CONCAT(A, name) args __attribute__((weak));                                                                \
+  type _XBT_CONCAT(AP, name) args;
 
 #ifndef HAVE_SMPI
 // Internally disable these overrides (HAVE_SMPI is only defined when building the library)
 #define malloc(nbytes) _sampi_malloc(nbytes)
-#define calloc(n_elm,elm_size) _sampi_calloc(n_elm,elm_size)
-#define realloc(ptr,nbytes) _sampi_realloc(ptr,nbytes)
+#define calloc(n_elm, elm_size) _sampi_calloc((n_elm), (elm_size))
+#define realloc(ptr, nbytes) _sampi_realloc((ptr), (nbytes))
 #define free(ptr) _sampi_free(ptr)
 #endif
 
index ad51171..5af6d62 100644 (file)
 #include <unistd.h>
 #include <xbt/misc.h>
 
+#ifdef __cplusplus
+#include <vector>
+#endif
+
 #ifdef _WIN32
-#define MPI_CALL(type,name,args) \
-  type name args; \
-  type P##name args
+#define MPI_CALL(type, name, args)                                                                                     \
+  type name args;                                                                                                      \
+  type _XBT_CONCAT(P, name) args
 #else
-#define MPI_CALL(type,name,args) \
-  type name args __attribute__((weak)); \
-  type P##name args
+#define MPI_CALL(type, name, args)                                                                                     \
+  type name args __attribute__((weak));                                                                                \
+  type _XBT_CONCAT(P, name) args
 #endif
 
 SG_BEGIN_DECL()
@@ -125,7 +129,7 @@ SG_BEGIN_DECL()
           ERROR(MPI_T_ERR_PVAR_NO_ATOMIC)
 
 #define GENERATE_ENUM(ENUM) ENUM,
-#define GENERATE_STRING(STRING) #STRING,
+#define GENERATE_STRING(STRING) _XBT_STRINGIFY(STRING),
 
 enum ERROR_ENUM {
     FOREACH_ERROR(GENERATE_ENUM)
@@ -180,8 +184,8 @@ enum ERROR_ENUM {
 #define MPI_COMM_TYPE_SHARED    1
 #define MPI_WIN_NULL ((MPI_Win)NULL)
 
-#define MPI_VERSION 2
-#define MPI_SUBVERSION 2
+#define MPI_VERSION 3
+#define MPI_SUBVERSION 1
 #define MPI_UNWEIGHTED      (int *)0
 #define MPI_ARGV_NULL (char **)0
 #define MPI_ARGVS_NULL (char ***)0
@@ -212,11 +216,9 @@ enum ERROR_ENUM {
 
 typedef ptrdiff_t MPI_Aint;
 typedef long long MPI_Offset;
+typedef long long MPI_Count;
 
-struct s_MPI_File;
-typedef struct s_MPI_File *MPI_File;
-
-
+typedef SMPI_File *MPI_File;
 typedef SMPI_Datatype *MPI_Datatype;
 
 typedef struct {
@@ -232,6 +234,7 @@ typedef SMPI_Info* MPI_Info;
 
 #define MPI_STATUS_IGNORE ((MPI_Status*)NULL)
 #define MPI_STATUSES_IGNORE ((MPI_Status*)NULL)
+#define MPI_STATUS_SIZE 5
 
 XBT_PUBLIC_DATA const MPI_Datatype MPI_DATATYPE_NULL;
 XBT_PUBLIC_DATA const MPI_Datatype MPI_CHAR;
@@ -292,9 +295,7 @@ XBT_PUBLIC_DATA const MPI_Datatype MPI_INTEGER4;
 XBT_PUBLIC_DATA const MPI_Datatype MPI_INTEGER8;
 XBT_PUBLIC_DATA const MPI_Datatype MPI_INTEGER16;
 
-//for now we only send int values at max
-#define MPI_Count int
-#define MPI_COUNT MPI_INT
+XBT_PUBLIC_DATA const MPI_Datatype MPI_COUNT;
 
 //defines for fortran compatibility
 #if defined(__alpha__) || defined(__sparc64__) || defined(__x86_64__) || defined(__ia64__)
@@ -363,6 +364,10 @@ typedef SMPI_Request* MPI_Request;
 #define MPI_REQUEST_NULL ((MPI_Request)NULL)
 #define MPI_FORTRAN_REQUEST_NULL -1
 
+typedef SMPI_Errhandler* MPI_Errhandler;
+#define MPI_ERRHANDLER_NULL ((MPI_Errhandler)NULL)
+
+
 typedef enum SMPI_Topo_type {
   MPI_GRAPH=1,
   MPI_CART=2,
@@ -392,6 +397,9 @@ typedef void MPI_Type_delete_attr_function_fort(MPI_Datatype type, int keyval, v
 typedef void MPI_Win_copy_attr_function_fort(MPI_Win win, int keyval, void* extra_state, void* attribute_val_in,
                               void* attribute_val_out, int* flag, int* ierr);
 typedef void MPI_Win_delete_attr_function_fort(MPI_Win win, int keyval, void* attribute_val, void* extra_state, int* ierr);
+typedef int MPI_Grequest_query_function(void *extra_state, MPI_Status *status);
+typedef int MPI_Grequest_free_function(void *extra_state);
+typedef int MPI_Grequest_cancel_function(void *extra_state, int complete);
 #define MPI_COMM_NULL_COPY_FN ((MPI_Comm_copy_attr_function*)0)
 #define MPI_COMM_NULL_DELETE_FN ((MPI_Comm_delete_attr_function*)0)
 #define MPI_TYPE_NULL_COPY_FN ((MPI_Type_copy_attr_function*)0)
@@ -402,6 +410,14 @@ typedef void MPI_Win_delete_attr_function_fort(MPI_Win win, int keyval, void* at
 typedef int (MPI_Datarep_extent_function)(MPI_Datatype, MPI_Aint *, void *);
 typedef int (MPI_Datarep_conversion_function)(void *, MPI_Datatype, int, void *, MPI_Offset, void *);
 
+typedef void MPI_Handler_function(MPI_Comm*, int*, ...);
+typedef void MPI_Comm_errhandler_function(MPI_Comm *, int *, ...);
+typedef void MPI_File_errhandler_function(MPI_File *, int *, ...);
+typedef void MPI_Win_errhandler_function(MPI_Win *, int *, ...);
+typedef MPI_Comm_errhandler_function MPI_Comm_errhandler_fn;
+typedef MPI_File_errhandler_function MPI_File_errhandler_fn;
+typedef MPI_Win_errhandler_function MPI_Win_errhandler_fn;
+
 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));
@@ -417,10 +433,12 @@ MPI_CALL(XBT_PUBLIC int, MPI_Alloc_mem, (MPI_Aint size, MPI_Info info, void* bas
 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_Buffer_attach, (void* buffer, int size));
+MPI_CALL(XBT_PUBLIC int, MPI_Buffer_detach, (void* buffer, int* size));
+MPI_CALL(XBT_PUBLIC int, MPI_Address, (const void* location, MPI_Aint* address));
+MPI_CALL(XBT_PUBLIC int, MPI_Get_address, (const void* location, MPI_Aint* address));
 MPI_CALL(XBT_PUBLIC int, MPI_Error_class, (int errorcode, int* errorclass));
+MPI_CALL(XBT_PUBLIC int, MPI_Error_string, (int errorcode, char* string, int* resultlen));
 
 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));
@@ -439,25 +457,25 @@ MPI_CALL(XBT_PUBLIC int, MPI_Type_lb, (MPI_Datatype datatype, MPI_Aint* disp));
 MPI_CALL(XBT_PUBLIC int, MPI_Type_ub, (MPI_Datatype datatype, MPI_Aint* disp));
 MPI_CALL(XBT_PUBLIC int, MPI_Type_commit, (MPI_Datatype * datatype));
 MPI_CALL(XBT_PUBLIC int, MPI_Type_hindexed,
-         (int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype));
+         (int count, const int* blocklens, const MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype));
 MPI_CALL(XBT_PUBLIC int, MPI_Type_create_hindexed,
-         (int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype));
+         (int count, const int* blocklens, const MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype));
 MPI_CALL(XBT_PUBLIC int, MPI_Type_create_hindexed_block,
-         (int count, int blocklength, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype));
+         (int count, int blocklength, const MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype));
 MPI_CALL(XBT_PUBLIC int, MPI_Type_hvector,
          (int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* newtype));
 MPI_CALL(XBT_PUBLIC int, MPI_Type_create_hvector,
          (int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* newtype));
 MPI_CALL(XBT_PUBLIC int, MPI_Type_indexed,
-         (int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* newtype));
+         (int count, const int* blocklens, const int* indices, MPI_Datatype old_type, MPI_Datatype* newtype));
 MPI_CALL(XBT_PUBLIC int, MPI_Type_create_indexed,
-         (int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* newtype));
+         (int count, const int* blocklens, const int* indices, MPI_Datatype old_type, MPI_Datatype* newtype));
 MPI_CALL(XBT_PUBLIC int, MPI_Type_create_indexed_block,
-         (int count, int blocklength, int* indices, MPI_Datatype old_type, MPI_Datatype* newtype));
+         (int count, int blocklength, const int* indices, MPI_Datatype old_type, MPI_Datatype* newtype));
 MPI_CALL(XBT_PUBLIC int, MPI_Type_struct,
-         (int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* newtype));
+         (int count, const int* blocklens, const MPI_Aint* indices, const MPI_Datatype* old_types, MPI_Datatype* newtype));
 MPI_CALL(XBT_PUBLIC int, MPI_Type_create_struct,
-         (int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* newtype));
+         (int count, const int* blocklens, const MPI_Aint* indices, const MPI_Datatype* old_types, MPI_Datatype* newtype));
 MPI_CALL(XBT_PUBLIC int, MPI_Type_vector,
          (int count, int blocklen, int stride, MPI_Datatype old_type, MPI_Datatype* newtype));
 MPI_CALL(XBT_PUBLIC int, MPI_Type_contiguous, (int count, MPI_Datatype old_type, MPI_Datatype* newtype));
@@ -465,7 +483,7 @@ 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_Get_count, (const 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));
@@ -474,14 +492,14 @@ MPI_CALL(XBT_PUBLIC int, MPI_Type_create_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_set_name, (MPI_Datatype datatype, const 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));
+         (const 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));
+         (const 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));
@@ -493,13 +511,13 @@ MPI_CALL(XBT_PUBLIC int, MPI_Group_free, (MPI_Group * group));
 MPI_CALL(XBT_PUBLIC int, MPI_Group_size, (MPI_Group group, int* size));
 MPI_CALL(XBT_PUBLIC int, MPI_Group_rank, (MPI_Group group, int* rank));
 MPI_CALL(XBT_PUBLIC int, MPI_Group_translate_ranks,
-         (MPI_Group group1, int n, int* ranks1, MPI_Group group2, int* ranks2));
+         (MPI_Group group1, int n, const int* ranks1, MPI_Group group2, int* ranks2));
 MPI_CALL(XBT_PUBLIC int, MPI_Group_compare, (MPI_Group group1, MPI_Group group2, int* result));
 MPI_CALL(XBT_PUBLIC int, MPI_Group_union, (MPI_Group group1, MPI_Group group2, MPI_Group* newgroup));
 MPI_CALL(XBT_PUBLIC int, MPI_Group_intersection, (MPI_Group group1, MPI_Group group2, MPI_Group* newgroup));
 MPI_CALL(XBT_PUBLIC int, MPI_Group_difference, (MPI_Group group1, MPI_Group group2, MPI_Group* newgroup));
-MPI_CALL(XBT_PUBLIC int, MPI_Group_incl, (MPI_Group group, int n, int* ranks, MPI_Group* newgroup));
-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_incl, (MPI_Group group, int n, const int* ranks, MPI_Group* newgroup));
+MPI_CALL(XBT_PUBLIC int, MPI_Group_excl, (MPI_Group group, int n, const 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));
@@ -508,8 +526,9 @@ 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_Comm_set_name, (MPI_Comm comm, char* name));
+MPI_CALL(XBT_PUBLIC int, MPI_Comm_set_name, (MPI_Comm comm, const char* name));
 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_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));
@@ -524,11 +543,15 @@ MPI_CALL(XBT_PUBLIC int, MPI_Comm_create_group, (MPI_Comm comm, MPI_Group group,
 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 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_split_type,
+         (MPI_Comm comm, int split_type, int key, MPI_Info info, MPI_Comm* newcomm));
 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));
+         (const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request));
 MPI_CALL(XBT_PUBLIC int, MPI_Recv_init,
          (void* buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Request* request));
 MPI_CALL(XBT_PUBLIC int, MPI_Start, (MPI_Request * request));
@@ -537,17 +560,22 @@ MPI_CALL(XBT_PUBLIC int, MPI_Request_free, (MPI_Request * request));
 MPI_CALL(XBT_PUBLIC int, MPI_Irecv,
          (void* buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Request* request));
 MPI_CALL(XBT_PUBLIC int, MPI_Isend,
-         (void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request));
+         (const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request));
 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_Send, (const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm));
+MPI_CALL(XBT_PUBLIC int, MPI_Ssend, (const 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));
+         (const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request));
+MPI_CALL(XBT_PUBLIC int, MPI_Bsend, (const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm));
+MPI_CALL(XBT_PUBLIC int, MPI_Bsend_init,
+         (const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request));
+MPI_CALL(XBT_PUBLIC int, MPI_Ibsend,
+         (const 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));
+         (const 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,
+         (const 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));
 MPI_CALL(XBT_PUBLIC int, MPI_Sendrecv_replace, (void* buf, int count, MPI_Datatype datatype, int dst, int sendtag,
                                                 int src, int recvtag, MPI_Comm comm, MPI_Status* status));
@@ -557,6 +585,7 @@ MPI_CALL(XBT_PUBLIC int, MPI_Testany, (int count, MPI_Request requests[], int* i
 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_Test_cancelled, (const MPI_Status * status, int* flag));
 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[]));
@@ -571,78 +600,81 @@ MPI_CALL(XBT_PUBLIC int, MPI_Bcast, (void* buf, int count, MPI_Datatype datatype
 MPI_CALL(XBT_PUBLIC int, MPI_Barrier, (MPI_Comm comm));
 MPI_CALL(XBT_PUBLIC int, MPI_Ibarrier, (MPI_Comm comm, MPI_Request *request));
 MPI_CALL(XBT_PUBLIC int, MPI_Ibcast, (void* buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm, MPI_Request *request));
-MPI_CALL(XBT_PUBLIC int, MPI_Igather, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+MPI_CALL(XBT_PUBLIC int, MPI_Igather, (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
                                       MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request));
-MPI_CALL(XBT_PUBLIC int, MPI_Igatherv, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
-                                       int* recvcounts, int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request));
-MPI_CALL(XBT_PUBLIC int, MPI_Iallgather, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+MPI_CALL(XBT_PUBLIC int, MPI_Igatherv, (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+                                       const int* recvcounts, const int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Iallgather, (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
                                          int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request));
-MPI_CALL(XBT_PUBLIC int, MPI_Iallgatherv, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
-                                          int* recvcounts, int* displs, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request));
-MPI_CALL(XBT_PUBLIC int, MPI_Iscatter, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+MPI_CALL(XBT_PUBLIC int, MPI_Iallgatherv, (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+                                          const int* recvcounts, const int* displs, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Iscatter, (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
                                        int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request));
-MPI_CALL(XBT_PUBLIC int, MPI_Iscatterv, (void* sendbuf, int* sendcounts, int* displs, MPI_Datatype sendtype,
+MPI_CALL(XBT_PUBLIC int, MPI_Iscatterv, (const void* sendbuf, const int* sendcounts, const int* displs, MPI_Datatype sendtype,
                                         void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request));
 MPI_CALL(XBT_PUBLIC int, MPI_Ireduce,
-         (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request *request));
+         (const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request *request));
 MPI_CALL(XBT_PUBLIC int, MPI_Iallreduce,
-         (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request));
+         (const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request));
 MPI_CALL(XBT_PUBLIC int, MPI_Iscan,
-         (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request));
+         (const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request));
 MPI_CALL(XBT_PUBLIC int, MPI_Iexscan,
-         (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request));
+         (const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request));
 MPI_CALL(XBT_PUBLIC int, MPI_Ireduce_scatter,
-         (void* sendbuf, void* recvbuf, int* recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request));
+         (const void* sendbuf, void* recvbuf, const int* recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request));
 MPI_CALL(XBT_PUBLIC int, MPI_Ireduce_scatter_block,
-         (void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request));
-MPI_CALL(XBT_PUBLIC int, MPI_Ialltoall, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+         (const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Ialltoall, (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
                                         int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request));
 MPI_CALL(XBT_PUBLIC int, MPI_Ialltoallv,
-         (void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype sendtype, void* recvbuf, int* recvcounts,
-          int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request));
+         (const void* sendbuf, const int* sendcounts, const int* senddisps, MPI_Datatype sendtype, void* recvbuf, const int* recvcounts,
+          const int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request));
 MPI_CALL(XBT_PUBLIC int, MPI_Ialltoallw,
-         (void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype* sendtypes, void* recvbuf, int* recvcounts,
-          int* recvdisps, MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request *request));
-MPI_CALL(XBT_PUBLIC int, MPI_Gather, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+         (const void* sendbuf, const int* sendcounts, const int* senddisps, const MPI_Datatype* sendtypes, void* recvbuf, const int* recvcounts,
+          const int* recvdisps, const MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Gather, (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
                                       MPI_Datatype recvtype, int root, MPI_Comm comm));
-MPI_CALL(XBT_PUBLIC int, MPI_Gatherv, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
-                                       int* recvcounts, int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm));
-MPI_CALL(XBT_PUBLIC int, MPI_Allgather, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+MPI_CALL(XBT_PUBLIC int, MPI_Gatherv, (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+                                       const int* recvcounts, const int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm));
+MPI_CALL(XBT_PUBLIC int, MPI_Allgather, (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
                                          int recvcount, MPI_Datatype recvtype, MPI_Comm comm));
-MPI_CALL(XBT_PUBLIC int, MPI_Allgatherv, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
-                                          int* recvcounts, int* displs, MPI_Datatype recvtype, MPI_Comm comm));
-MPI_CALL(XBT_PUBLIC int, MPI_Scatter, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+MPI_CALL(XBT_PUBLIC int, MPI_Allgatherv, (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+                                          const int* recvcounts, const int* displs, MPI_Datatype recvtype, MPI_Comm comm));
+MPI_CALL(XBT_PUBLIC int, MPI_Scatter, (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
                                        int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm));
-MPI_CALL(XBT_PUBLIC int, MPI_Scatterv, (void* sendbuf, int* sendcounts, int* displs, MPI_Datatype sendtype,
+MPI_CALL(XBT_PUBLIC int, MPI_Scatterv, (const void* sendbuf, const int* sendcounts, const int* displs, MPI_Datatype sendtype,
                                         void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm));
 MPI_CALL(XBT_PUBLIC int, MPI_Reduce,
-         (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm));
+         (const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm));
 MPI_CALL(XBT_PUBLIC int, MPI_Allreduce,
-         (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm));
+         (const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, 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));
+         (const 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));
+         (const 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));
+         (const void* sendbuf, void* recvbuf, const int* recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm));
 MPI_CALL(XBT_PUBLIC int, MPI_Reduce_scatter_block,
-         (void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm));
-MPI_CALL(XBT_PUBLIC int, MPI_Alltoall, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+         (const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm));
+MPI_CALL(XBT_PUBLIC int, MPI_Alltoall, (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
                                         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_Reduce_local, (void* inbuf, void* inoutbuf, int count, MPI_Datatype datatype, MPI_Op op));
+         (const void* sendbuf, const int* sendcounts, const int* senddisps, MPI_Datatype sendtype, void* recvbuf, const int* recvcounts,
+          const int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm));
+MPI_CALL(XBT_PUBLIC int, MPI_Alltoallw,
+         (const void* sendbuf, const int* sendcnts, const int* sdispls, const MPI_Datatype* sendtypes, void* recvbuf, const int* recvcnts,
+          const int* rdispls, const MPI_Datatype* recvtypes, MPI_Comm comm));
+MPI_CALL(XBT_PUBLIC int, MPI_Reduce_local, (const 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_set, (MPI_Info info, const char* key, const char* value));
+MPI_CALL(XBT_PUBLIC int, MPI_Info_get, (MPI_Info info, const 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_delete, (MPI_Info info, const 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_Info_get_valuelen, (MPI_Info info, const 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));
 
@@ -655,8 +687,8 @@ MPI_CALL(XBT_PUBLIC int, MPI_Win_allocate_shared,
          (MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void* base, MPI_Win* win));
 MPI_CALL(XBT_PUBLIC int, MPI_Win_create_dynamic, (MPI_Info info, MPI_Comm comm, MPI_Win* win));
 MPI_CALL(XBT_PUBLIC int, MPI_Win_attach, (MPI_Win win, void* base, MPI_Aint size));
-MPI_CALL(XBT_PUBLIC int, MPI_Win_detach, (MPI_Win win, void* base));
-MPI_CALL(XBT_PUBLIC int, MPI_Win_set_name, (MPI_Win win, char* name));
+MPI_CALL(XBT_PUBLIC int, MPI_Win_detach, (MPI_Win win, const void* base));
+MPI_CALL(XBT_PUBLIC int, MPI_Win_set_name, (MPI_Win win, const char* name));
 MPI_CALL(XBT_PUBLIC int, MPI_Win_get_name, (MPI_Win win, char* name, int* len));
 MPI_CALL(XBT_PUBLIC int, MPI_Win_set_info, (MPI_Win win, MPI_Info info));
 MPI_CALL(XBT_PUBLIC int, MPI_Win_get_info, (MPI_Win win, MPI_Info* info));
@@ -688,44 +720,109 @@ 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));
-MPI_CALL(XBT_PUBLIC int, MPI_Put, (void* origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
+MPI_CALL(XBT_PUBLIC int, MPI_Put, (const void* origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
                                    MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win));
 MPI_CALL(XBT_PUBLIC int, MPI_Accumulate,
-         (void* origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
+         (const 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_Op op, MPI_Win win));
 MPI_CALL(XBT_PUBLIC int, MPI_Get_accumulate,
-         (void* origin_addr, int origin_count, MPI_Datatype origin_datatype, void* result_addr, int result_count,
+         (const 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, MPI_Aint target_disp,
+         (const 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_Raccumulate,
-         (void* origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp,
+         (const 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_Op op, MPI_Win win, MPI_Request* request));
 MPI_CALL(XBT_PUBLIC int, MPI_Rget_accumulate,
-         (void* origin_addr, int origin_count, MPI_Datatype origin_datatype, void* result_addr, int result_count,
+         (const 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,
+MPI_CALL(XBT_PUBLIC int, MPI_Fetch_and_op, (const 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,
+         (const 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_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_Comm comm_old, int ndims, const int* dims, const 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_rank, (MPI_Comm comm, const 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_Cart_sub, (MPI_Comm comm, const 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 int, MPI_Request_get_status, (MPI_Request request, int* flag, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_Grequest_start,
+         (MPI_Grequest_query_function * query_fn, MPI_Grequest_free_function* free_fn,
+          MPI_Grequest_cancel_function* cancel_fn, void* extra_state, MPI_Request* request));
+MPI_CALL(XBT_PUBLIC int, MPI_Grequest_complete, (MPI_Request request));
+MPI_CALL(XBT_PUBLIC int, MPI_Status_set_cancelled, (MPI_Status * status, int flag));
+MPI_CALL(XBT_PUBLIC int, MPI_Status_set_elements, (MPI_Status * status, MPI_Datatype datatype, int count));
+MPI_CALL(XBT_PUBLIC int, MPI_Type_create_subarray,
+         (int ndims, const int* array_of_sizes, const int* array_of_subsizes, const int* array_of_starts, int order, MPI_Datatype oldtype,
+          MPI_Datatype* newtype));
+
+MPI_CALL(XBT_PUBLIC int, MPI_File_open, (MPI_Comm comm, const char* filename, int amode, MPI_Info info, MPI_File* fh));
+MPI_CALL(XBT_PUBLIC int, MPI_File_close, (MPI_File * fh));
+MPI_CALL(XBT_PUBLIC int, MPI_File_delete, (const char* filename, MPI_Info info));
+MPI_CALL(XBT_PUBLIC int, MPI_File_get_size, (MPI_File fh, MPI_Offset* size));
+MPI_CALL(XBT_PUBLIC int, MPI_File_get_group, (MPI_File fh, MPI_Group* group));
+MPI_CALL(XBT_PUBLIC int, MPI_File_get_amode, (MPI_File fh, int* amode));
+MPI_CALL(XBT_PUBLIC int, MPI_File_set_info, (MPI_File fh, MPI_Info info));
+MPI_CALL(XBT_PUBLIC int, MPI_File_get_info, (MPI_File fh, MPI_Info* info_used));
+MPI_CALL(XBT_PUBLIC int, MPI_File_read_at,
+         (MPI_File fh, MPI_Offset offset, void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_File_read_at_all,
+         (MPI_File fh, MPI_Offset offset, void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_File_write_at,
+         (MPI_File fh, MPI_Offset offset, const void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_File_write_at_all,
+         (MPI_File fh, MPI_Offset offset, const void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_File_read, (MPI_File fh, void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_File_read_all,
+         (MPI_File fh, void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_File_write,
+         (MPI_File fh, const void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_File_write_all,
+         (MPI_File fh, const void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_File_seek, (MPI_File fh, MPI_Offset offset, int whenace));
+MPI_CALL(XBT_PUBLIC int, MPI_File_get_position, (MPI_File fh, MPI_Offset* offset));
+MPI_CALL(XBT_PUBLIC int, MPI_File_read_shared,
+         (MPI_File fh, void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_File_write_shared,
+         (MPI_File fh, const void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_File_read_ordered,
+         (MPI_File fh, void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_File_write_ordered,
+         (MPI_File fh, const void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_File_seek_shared, (MPI_File fh, MPI_Offset offset, int whence));
+MPI_CALL(XBT_PUBLIC int, MPI_File_get_position_shared, (MPI_File fh, MPI_Offset* offset));
+MPI_CALL(XBT_PUBLIC int, MPI_File_sync, (MPI_File fh));
 
+MPI_CALL(XBT_PUBLIC int, MPI_Errhandler_set, (MPI_Comm comm, MPI_Errhandler errhandler));
+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));
+MPI_CALL(XBT_PUBLIC int, MPI_Comm_set_errhandler, (MPI_Comm comm, MPI_Errhandler errhandler));
+MPI_CALL(XBT_PUBLIC int, MPI_Comm_get_errhandler, (MPI_Comm comm, MPI_Errhandler* errhandler));
+MPI_CALL(XBT_PUBLIC int, MPI_Comm_create_errhandler, (MPI_Comm_errhandler_fn * function, MPI_Errhandler* errhandler));
+MPI_CALL(XBT_PUBLIC int, MPI_Comm_call_errhandler, (MPI_Comm comm, int errorcode));
+MPI_CALL(XBT_PUBLIC int, MPI_Win_set_errhandler, (MPI_Win win, MPI_Errhandler errhandler));
+MPI_CALL(XBT_PUBLIC int, MPI_Win_get_errhandler, (MPI_Win win, MPI_Errhandler* errhandler));
+MPI_CALL(XBT_PUBLIC int, MPI_Win_create_errhandler, (MPI_Win_errhandler_fn * function, MPI_Errhandler* errhandler));
+MPI_CALL(XBT_PUBLIC int, MPI_Win_call_errhandler, (MPI_Win win, int errorcode));MPI_CALL(XBT_PUBLIC int, MPI_Type_get_envelope,
+         (MPI_Datatype datatype, int* num_integers, int* num_addresses, int* num_datatypes, int* combiner));
+MPI_CALL(XBT_PUBLIC int, MPI_File_call_errhandler, (MPI_File fh, int errorcode));
+MPI_CALL(XBT_PUBLIC int, MPI_File_create_errhandler,
+         (MPI_File_errhandler_function * function, MPI_Errhandler* errhandler));
+MPI_CALL(XBT_PUBLIC int, MPI_File_set_errhandler, (MPI_File file, MPI_Errhandler errhandler));
+MPI_CALL(XBT_PUBLIC int, MPI_File_get_errhandler, (MPI_File file, MPI_Errhandler* errhandler));
 //FIXME: these are not yet implemented
 
 typedef enum MPIR_Combiner_enum{
@@ -750,79 +847,45 @@ typedef enum MPIR_Combiner_enum{
   MPI_COMBINER_HINDEXED_BLOCK
 }MPIR_Combiner_enum;
 
-typedef void MPI_Handler_function(MPI_Comm*, int*, ...);
-
-typedef void* MPI_Errhandler;
-
-typedef void MPI_Comm_errhandler_function(MPI_Comm *, int *, ...);
-typedef void MPI_File_errhandler_function(MPI_File *, int *, ...);
-typedef void MPI_Win_errhandler_function(MPI_Win *, int *, ...);
-typedef int MPI_Grequest_query_function(void *extra_state, MPI_Status *status);
-typedef int MPI_Grequest_free_function(void *extra_state);
-typedef int MPI_Grequest_cancel_function(void *extra_state, int complete);
+typedef void* MPI_Message;
 #define MPI_DUP_FN 1
 
 #define MPI_WIN_DUP_FN ((MPI_Win_copy_attr_function*)MPI_DUP_FN)
 #define MPI_TYPE_DUP_FN ((MPI_Type_copy_attr_function*)MPI_DUP_FN)
 #define MPI_COMM_DUP_FN  ((MPI_Comm_copy_attr_function *)MPI_DUP_FN)
-typedef MPI_Comm_errhandler_function MPI_Comm_errhandler_fn;
-typedef MPI_File_errhandler_function MPI_File_errhandler_fn;
-typedef MPI_Win_errhandler_function MPI_Win_errhandler_fn;
-#define MPI_INFO_ENV 1
+#define MPI_INFO_ENV smpi_process_info_env()
 XBT_PUBLIC_DATA const MPI_Datatype MPI_PACKED;
-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;
+XBT_PUBLIC_DATA MPI_Errhandler MPI_ERRORS_RETURN;
+XBT_PUBLIC_DATA MPI_Errhandler MPI_ERRORS_ARE_FATAL;
 
 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_Cart_map, (MPI_Comm comm_old, int ndims, int* dims, int* periods, int* newrank));
+MPI_CALL(XBT_PUBLIC int, MPI_Cart_map, (MPI_Comm comm_old, int ndims, const int* dims, const int* periods, int* newrank));
 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_Comm comm_old, int nnodes, const int* index, const 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));
-MPI_CALL(XBT_PUBLIC int, MPI_Graph_map, (MPI_Comm comm_old, int nnodes, int* index, int* edges, int* newrank));
+MPI_CALL(XBT_PUBLIC int, MPI_Graph_map, (MPI_Comm comm_old, int nnodes, const int* index, const int* edges, int* newrank));
 MPI_CALL(XBT_PUBLIC int, MPI_Graph_neighbors, (MPI_Comm comm, int rank, int maxneighbors, int* neighbors));
 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_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));
-MPI_CALL(XBT_PUBLIC int, MPI_Error_string, (int errorcode, char* string, int* resultlen));
-MPI_CALL(XBT_PUBLIC int, MPI_Errhandler_set, (MPI_Comm comm, MPI_Errhandler errhandler));
-MPI_CALL(XBT_PUBLIC int, MPI_Comm_set_errhandler, (MPI_Comm comm, MPI_Errhandler errhandler));
-MPI_CALL(XBT_PUBLIC int, MPI_Comm_get_errhandler, (MPI_Comm comm, MPI_Errhandler* errhandler));
-MPI_CALL(XBT_PUBLIC int, MPI_Comm_create_errhandler, (MPI_Comm_errhandler_fn * function, MPI_Errhandler* errhandler));
-MPI_CALL(XBT_PUBLIC int, MPI_Comm_call_errhandler, (MPI_Comm comm, int errorcode));
 MPI_CALL(XBT_PUBLIC int, MPI_Add_error_class, (int* errorclass));
 MPI_CALL(XBT_PUBLIC int, MPI_Add_error_code, (int errorclass, int* errorcode));
 MPI_CALL(XBT_PUBLIC int, MPI_Add_error_string, (int errorcode, char* string));
 MPI_CALL(XBT_PUBLIC int, MPI_Cancel, (MPI_Request * request));
-MPI_CALL(XBT_PUBLIC int, MPI_Buffer_attach, (void* buffer, int size));
-MPI_CALL(XBT_PUBLIC int, MPI_Buffer_detach, (void* buffer, int* size));
 MPI_CALL(XBT_PUBLIC int, MPI_Comm_test_inter, (MPI_Comm comm, int* flag));
 MPI_CALL(XBT_PUBLIC int, MPI_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));
-MPI_CALL(XBT_PUBLIC int, MPI_Bsend, (void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm));
-MPI_CALL(XBT_PUBLIC int, MPI_Bsend_init,
-         (void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request));
-MPI_CALL(XBT_PUBLIC int, MPI_Ibsend,
-         (void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, 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_Rsend, (void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm));
+MPI_CALL(XBT_PUBLIC int, MPI_Rsend, (const 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));
+         (const 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_Test_cancelled, (MPI_Status * status, int* flag));
+         (const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request));
 MPI_CALL(XBT_PUBLIC int, MPI_Get_elements, (MPI_Status * status, MPI_Datatype datatype, int* elements));
 MPI_CALL(XBT_PUBLIC int, MPI_Pcontrol, (const int level, ...));
-
-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));
 MPI_CALL(XBT_PUBLIC int, MPI_Type_get_contents,
          (MPI_Datatype datatype, int max_integers, int max_addresses, int max_datatypes, int* array_of_integers,
           MPI_Aint* array_of_addresses, MPI_Datatype* array_of_datatypes));
@@ -834,35 +897,17 @@ MPI_CALL(XBT_PUBLIC int, MPI_Pack_external, (char* datarep, void* inbuf, int inc
                                              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_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_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_with_info, (MPI_Comm comm, MPI_Info info, MPI_Comm* newcomm));
-MPI_CALL(XBT_PUBLIC int, MPI_Comm_split_type,
-         (MPI_Comm comm, int split_type, int key, MPI_Info info, MPI_Comm* newcomm));
 MPI_CALL(XBT_PUBLIC int, MPI_Comm_connect,
-         (char* port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm* newcomm));
-MPI_CALL(XBT_PUBLIC int, MPI_Request_get_status, (MPI_Request request, int* flag, MPI_Status* status));
-MPI_CALL(XBT_PUBLIC int, MPI_Grequest_start,
-         (MPI_Grequest_query_function * query_fn, MPI_Grequest_free_function* free_fn,
-          MPI_Grequest_cancel_function* cancel_fn, void* extra_state, MPI_Request* request));
-MPI_CALL(XBT_PUBLIC int, MPI_Grequest_complete, (MPI_Request request));
-MPI_CALL(XBT_PUBLIC int, MPI_Status_set_cancelled, (MPI_Status * status, int flag));
-MPI_CALL(XBT_PUBLIC int, MPI_Status_set_elements, (MPI_Status * status, MPI_Datatype datatype, int count));
+         (const char* port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm* newcomm));
 MPI_CALL(XBT_PUBLIC int, MPI_Unpublish_name, (char* service_name, MPI_Info info, char* port_name));
 MPI_CALL(XBT_PUBLIC int, MPI_Publish_name, (char* service_name, MPI_Info info, char* port_name));
 MPI_CALL(XBT_PUBLIC int, MPI_Lookup_name, (char* service_name, MPI_Info info, char* port_name));
 MPI_CALL(XBT_PUBLIC int, MPI_Comm_join, (int fd, MPI_Comm* intercomm));
 MPI_CALL(XBT_PUBLIC int, MPI_Open_port, (MPI_Info info, char* port_name));
-MPI_CALL(XBT_PUBLIC int, MPI_Close_port, (char* port_name));
-MPI_CALL(XBT_PUBLIC int, MPI_Comm_accept, (char* port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm* newcomm));
-MPI_CALL(XBT_PUBLIC int, MPI_Comm_spawn, (char* command, char** argv, int maxprocs, MPI_Info info, int root,
+MPI_CALL(XBT_PUBLIC int, MPI_Close_port, (const char* port_name));
+MPI_CALL(XBT_PUBLIC int, MPI_Comm_accept, (const char* port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm* newcomm));
+MPI_CALL(XBT_PUBLIC int, MPI_Comm_spawn, (const char* command, char** argv, int maxprocs, MPI_Info info, int root,
                                           MPI_Comm comm, MPI_Comm* intercomm, int* array_of_errcodes));
 MPI_CALL(XBT_PUBLIC int, MPI_Comm_spawn_multiple,
          (int count, char** array_of_commands, char*** array_of_argv, int* array_of_maxprocs, MPI_Info* array_of_info,
@@ -875,97 +920,60 @@ MPI_CALL(XBT_PUBLIC MPI_File, MPI_File_f2c, (MPI_Fint file));
 MPI_CALL(XBT_PUBLIC int, MPI_Register_datarep, (char* datarep, MPI_Datarep_conversion_function* read_conversion_fn,
                                                 MPI_Datarep_conversion_function* write_conversion_fn,
                                                 MPI_Datarep_extent_function* dtype_file_extent_fn, void* extra_state));
-MPI_CALL(XBT_PUBLIC int, MPI_File_call_errhandler, (MPI_File fh, int errorcode));
-MPI_CALL(XBT_PUBLIC int, MPI_File_create_errhandler,
-         (MPI_File_errhandler_function * function, MPI_Errhandler* errhandler));
-MPI_CALL(XBT_PUBLIC int, MPI_File_set_errhandler, (MPI_File file, MPI_Errhandler errhandler));
-MPI_CALL(XBT_PUBLIC int, MPI_File_get_errhandler, (MPI_File file, MPI_Errhandler* errhandler));
-MPI_CALL(XBT_PUBLIC int, MPI_File_open, (MPI_Comm comm, char* filename, int amode, MPI_Info info, MPI_File* fh));
-MPI_CALL(XBT_PUBLIC int, MPI_File_close, (MPI_File * fh));
-MPI_CALL(XBT_PUBLIC int, MPI_File_delete, (char* filename, MPI_Info info));
 MPI_CALL(XBT_PUBLIC int, MPI_File_set_size, (MPI_File fh, MPI_Offset size));
 MPI_CALL(XBT_PUBLIC int, MPI_File_preallocate, (MPI_File fh, MPI_Offset size));
-MPI_CALL(XBT_PUBLIC int, MPI_File_get_size, (MPI_File fh, MPI_Offset* size));
-MPI_CALL(XBT_PUBLIC int, MPI_File_get_group, (MPI_File fh, MPI_Group* group));
-MPI_CALL(XBT_PUBLIC int, MPI_File_get_amode, (MPI_File fh, int* amode));
-MPI_CALL(XBT_PUBLIC int, MPI_File_set_info, (MPI_File fh, MPI_Info info));
-MPI_CALL(XBT_PUBLIC int, MPI_File_get_info, (MPI_File fh, MPI_Info* info_used));
 MPI_CALL(XBT_PUBLIC int, MPI_File_set_view,
-         (MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, char* datarep, MPI_Info info));
+         (MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, const char* datarep, MPI_Info info));
 MPI_CALL(XBT_PUBLIC int, MPI_File_get_view,
          (MPI_File fh, MPI_Offset* disp, MPI_Datatype* etype, MPI_Datatype* filetype, char* datarep));
-MPI_CALL(XBT_PUBLIC int, MPI_File_read_at,
-         (MPI_File fh, MPI_Offset offset, void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
-MPI_CALL(XBT_PUBLIC int, MPI_File_read_at_all,
-         (MPI_File fh, MPI_Offset offset, void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
-MPI_CALL(XBT_PUBLIC int, MPI_File_write_at,
-         (MPI_File fh, MPI_Offset offset, void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
-MPI_CALL(XBT_PUBLIC int, MPI_File_write_at_all,
-         (MPI_File fh, MPI_Offset offset, void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
 MPI_CALL(XBT_PUBLIC int, MPI_File_iread_at,
          (MPI_File fh, MPI_Offset offset, void* buf, int count, MPI_Datatype datatype, MPI_Request* request));
 MPI_CALL(XBT_PUBLIC int, MPI_File_iwrite_at,
-         (MPI_File fh, MPI_Offset offset, void* buf, int count, MPI_Datatype datatype, MPI_Request* request));
+         (MPI_File fh, MPI_Offset offset, const void* buf, int count, MPI_Datatype datatype, MPI_Request* request));
 MPI_CALL(XBT_PUBLIC int, MPI_File_iread_at_all,
          (MPI_File fh, MPI_Offset offset, void* buf, int count, MPI_Datatype datatype, MPI_Request* request));
 MPI_CALL(XBT_PUBLIC int, MPI_File_iwrite_at_all,
-         (MPI_File fh, MPI_Offset offset, void* buf, int count, MPI_Datatype datatype, MPI_Request* request));
-MPI_CALL(XBT_PUBLIC int, MPI_File_read, (MPI_File fh, void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
-MPI_CALL(XBT_PUBLIC int, MPI_File_read_all,
-         (MPI_File fh, void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
-MPI_CALL(XBT_PUBLIC int, MPI_File_write,
-         (MPI_File fh, void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
-MPI_CALL(XBT_PUBLIC int, MPI_File_write_all,
-         (MPI_File fh, void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
+         (MPI_File fh, MPI_Offset offset, const void* buf, int count, MPI_Datatype datatype, MPI_Request* request));
 MPI_CALL(XBT_PUBLIC int, MPI_File_iread,
          (MPI_File fh, void* buf, int count, MPI_Datatype datatype, MPI_Request* request));
 MPI_CALL(XBT_PUBLIC int, MPI_File_iwrite,
-         (MPI_File fh, void* buf, int count, MPI_Datatype datatype, MPI_Request* request));
+         (MPI_File fh, const void* buf, int count, MPI_Datatype datatype, MPI_Request* request));
 MPI_CALL(XBT_PUBLIC int, MPI_File_iread_all,
          (MPI_File fh, void* buf, int count, MPI_Datatype datatype, MPI_Request* request));
 MPI_CALL(XBT_PUBLIC int, MPI_File_iwrite_all,
-         (MPI_File fh, void* buf, int count, MPI_Datatype datatype, MPI_Request* request));
-MPI_CALL(XBT_PUBLIC int, MPI_File_seek, (MPI_File fh, MPI_Offset offset, int whenace));
-MPI_CALL(XBT_PUBLIC int, MPI_File_get_position, (MPI_File fh, MPI_Offset* offset));
+         (MPI_File fh, const void* buf, int count, MPI_Datatype datatype, MPI_Request* request));
 MPI_CALL(XBT_PUBLIC int, MPI_File_get_byte_offset, (MPI_File fh, MPI_Offset offset, MPI_Offset* disp));
-MPI_CALL(XBT_PUBLIC int, MPI_File_read_shared,
-         (MPI_File fh, void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
-MPI_CALL(XBT_PUBLIC int, MPI_File_write_shared,
-         (MPI_File fh, void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
 MPI_CALL(XBT_PUBLIC int, MPI_File_iread_shared,
          (MPI_File fh, void* buf, int count, MPI_Datatype datatype, MPI_Request* request));
 MPI_CALL(XBT_PUBLIC int, MPI_File_iwrite_shared,
-         (MPI_File fh, void* buf, int count, MPI_Datatype datatype, MPI_Request* request));
-MPI_CALL(XBT_PUBLIC int, MPI_File_read_ordered,
-         (MPI_File fh, void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
-MPI_CALL(XBT_PUBLIC int, MPI_File_write_ordered,
-         (MPI_File fh, void* buf, int count, MPI_Datatype datatype, MPI_Status* status));
-MPI_CALL(XBT_PUBLIC int, MPI_File_seek_shared, (MPI_File fh, MPI_Offset offset, int whence));
-MPI_CALL(XBT_PUBLIC int, MPI_File_get_position_shared, (MPI_File fh, MPI_Offset* offset));
+         (MPI_File fh, const void* buf, int count, MPI_Datatype datatype, MPI_Request* request));
 MPI_CALL(XBT_PUBLIC int, MPI_File_read_at_all_begin,
          (MPI_File fh, MPI_Offset offset, void* buf, int count, MPI_Datatype datatype));
 MPI_CALL(XBT_PUBLIC int, MPI_File_read_at_all_end, (MPI_File fh, void* buf, MPI_Status* status));
 MPI_CALL(XBT_PUBLIC int, MPI_File_write_at_all_begin,
-         (MPI_File fh, MPI_Offset offset, void* buf, int count, MPI_Datatype datatype));
-MPI_CALL(XBT_PUBLIC int, MPI_File_write_at_all_end, (MPI_File fh, void* buf, MPI_Status* status));
+         (MPI_File fh, MPI_Offset offset, const void* buf, int count, MPI_Datatype datatype));
+MPI_CALL(XBT_PUBLIC int, MPI_File_write_at_all_end, (MPI_File fh, const void* buf, MPI_Status* status));
 MPI_CALL(XBT_PUBLIC int, MPI_File_read_all_begin, (MPI_File fh, void* buf, int count, MPI_Datatype datatype));
 MPI_CALL(XBT_PUBLIC int, MPI_File_read_all_end, (MPI_File fh, void* buf, MPI_Status* status));
-MPI_CALL(XBT_PUBLIC int, MPI_File_write_all_begin, (MPI_File fh, void* buf, int count, MPI_Datatype datatype));
-MPI_CALL(XBT_PUBLIC int, MPI_File_write_all_end, (MPI_File fh, void* buf, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_File_write_all_begin, (MPI_File fh, const void* buf, int count, MPI_Datatype datatype));
+MPI_CALL(XBT_PUBLIC int, MPI_File_write_all_end, (MPI_File fh, const void* buf, MPI_Status* status));
 MPI_CALL(XBT_PUBLIC int, MPI_File_read_ordered_begin, (MPI_File fh, void* buf, int count, MPI_Datatype datatype));
 MPI_CALL(XBT_PUBLIC int, MPI_File_read_ordered_end, (MPI_File fh, void* buf, MPI_Status* status));
-MPI_CALL(XBT_PUBLIC int, MPI_File_write_ordered_begin, (MPI_File fh, void* buf, int count, MPI_Datatype datatype));
-MPI_CALL(XBT_PUBLIC int, MPI_File_write_ordered_end, (MPI_File fh, void* buf, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_File_write_ordered_begin, (MPI_File fh, const void* buf, int count, MPI_Datatype datatype));
+MPI_CALL(XBT_PUBLIC int, MPI_File_write_ordered_end, (MPI_File fh, const void* buf, MPI_Status* status));
 MPI_CALL(XBT_PUBLIC int, MPI_File_get_type_extent, (MPI_File fh, MPI_Datatype datatype, MPI_Aint* extent));
 MPI_CALL(XBT_PUBLIC int, MPI_File_set_atomicity, (MPI_File fh, int flag));
 MPI_CALL(XBT_PUBLIC int, MPI_File_get_atomicity, (MPI_File fh, int* flag));
-MPI_CALL(XBT_PUBLIC int, MPI_File_sync, (MPI_File fh));
-
+MPI_CALL(XBT_PUBLIC int, MPI_Mrecv, (void* buf, int count, MPI_Datatype datatype, MPI_Message* message, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_Mprobe, (int source, int tag, MPI_Comm comm, MPI_Message* message, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_Imrecv, (void* buf, int count, MPI_Datatype datatype, MPI_Message* message, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Improbe, (int source, int tag, MPI_Comm comm, int *flag, MPI_Message* message, MPI_Status* status));
 //FIXME: End of all the not yet implemented stuff
 
 // smpi functions
 XBT_PUBLIC int smpi_global_size();
 XBT_PUBLIC MPI_Comm smpi_process_comm_self();
+XBT_PUBLIC MPI_Info smpi_process_info_env();
 XBT_PUBLIC void* smpi_process_get_user_data();
 XBT_PUBLIC void smpi_process_set_user_data(void*);
 
@@ -973,16 +981,6 @@ XBT_PUBLIC void smpi_execute_flops(double flops);
 XBT_PUBLIC void smpi_execute(double duration);
 XBT_PUBLIC void smpi_execute_benched(double duration);
 
-// PLEASE NOTE: If you remove these functions, the entire smpi_dvfs.cpp file can be removed as well!!
-XBT_ATTRIB_DEPRECATED_v324("Please use sg_host_get_pstate_speed(sg_host_self(), pstate_index) instead") XBT_PUBLIC double smpi_get_host_power_peak_at(int pstate_index);
-XBT_ATTRIB_DEPRECATED_v324("Please use sg_host_speed(sg_host_self()) instead") XBT_PUBLIC double smpi_get_host_current_power_peak();
-XBT_ATTRIB_DEPRECATED_v324("Please use sg_host_get_nb_pstates(sg_host_self()) instead") XBT_PUBLIC int smpi_get_host_nb_pstates();
-XBT_ATTRIB_DEPRECATED_v324("Please use sg_host_set_pstate(sg_host_self(), pstate_index) instead") XBT_PUBLIC void smpi_set_host_pstate(int pstate_index);
-XBT_ATTRIB_DEPRECATED_v324("Please use sg_host_get_pstate(sg_host_self()) instead") XBT_PUBLIC int smpi_get_host_pstate();
-
-XBT_ATTRIB_DEPRECATED_v324("Please use sg_host_get_consumed_energy(sg_host_self()) instead") XBT_PUBLIC double smpi_get_host_consumed_energy();
-
-
 XBT_PUBLIC unsigned long long smpi_rastro_resolution();
 XBT_PUBLIC unsigned long long smpi_rastro_timestamp();
 XBT_PUBLIC void smpi_sample_1(int global, const char* file, int line, int iters, double threshold);
@@ -1006,29 +1004,33 @@ 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_ITER_NAME1(line) iter_count##line
+#define SMPI_ITER_NAME1(line) _XBT_CONCAT(iter_count, line)
 #define SMPI_ITER_NAME(line) SMPI_ITER_NAME1(line)
-#define SMPI_SAMPLE_LOOP(loop_init, loop_end, loop_iter, global, iters, thres)\
-  int SMPI_ITER_NAME(__LINE__)=0;\
-  {loop_init;\
-  while(loop_end){\
-    SMPI_ITER_NAME(__LINE__)++;\
-    loop_iter;\
-  }}                                                                         \
-  for(loop_init; \
-      loop_end ? (smpi_sample_1(global, __FILE__, __LINE__, iters, thres), (smpi_sample_2(global, __FILE__, __LINE__, SMPI_ITER_NAME(__LINE__)))) :\
-      smpi_sample_exit(global, __FILE__, __LINE__, SMPI_ITER_NAME(__LINE__));\
-      smpi_sample_3(global, __FILE__, __LINE__),loop_iter)
-#define SMPI_SAMPLE_LOCAL(loop_init, loop_end, loop_iter, iters, thres) SMPI_SAMPLE_LOOP(loop_init, loop_end, loop_iter, 0, iters, thres)
-#define SMPI_SAMPLE_GLOBAL(loop_init, loop_end, loop_iter,iters, thres) SMPI_SAMPLE_LOOP(loop_init, loop_end, loop_iter, 1, iters, thres)
+#define SMPI_SAMPLE_LOOP(loop_init, loop_end, loop_iter, global, iters, thres)                                         \
+  int SMPI_ITER_NAME(__LINE__) = 0;                                                                                    \
+  {                                                                                                                    \
+    loop_init;                                                                                                         \
+    while (loop_end) {                                                                                                 \
+      SMPI_ITER_NAME(__LINE__)++;                                                                                      \
+      (loop_iter);                                                                                                     \
+    }                                                                                                                  \
+  }                                                                                                                    \
+  for (loop_init; (loop_end) ? (smpi_sample_1((global), __FILE__, __LINE__, (iters), (thres)),                         \
+                                (smpi_sample_2((global), __FILE__, __LINE__, SMPI_ITER_NAME(__LINE__))))               \
+                             : smpi_sample_exit((global), __FILE__, __LINE__, SMPI_ITER_NAME(__LINE__));               \
+       smpi_sample_3((global), __FILE__, __LINE__), (loop_iter))
+#define SMPI_SAMPLE_LOCAL(loop_init, loop_end, loop_iter, iters, thres)                                                \
+  SMPI_SAMPLE_LOOP(loop_init, (loop_end), (loop_iter), 0, (iters), (thres))
+#define SMPI_SAMPLE_GLOBAL(loop_init, loop_end, loop_iter, iters, thres)                                               \
+  SMPI_SAMPLE_LOOP(loop_init, (loop_end), (loop_iter), 1, (iters), (thres))
 #define SMPI_SAMPLE_DELAY(duration) for(smpi_execute(duration); 0; )
 #define SMPI_SAMPLE_FLOPS(flops) for(smpi_execute_flops(flops); 0; )
 
 XBT_PUBLIC void* smpi_shared_malloc(size_t size, const char* file, int line);
-#define SMPI_SHARED_MALLOC(size) smpi_shared_malloc(size, __FILE__, __LINE__)
+#define SMPI_SHARED_MALLOC(size) smpi_shared_malloc((size), __FILE__, __LINE__)
 XBT_PUBLIC void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int nb_shared_blocks);
 #define SMPI_PARTIAL_SHARED_MALLOC(size, shared_block_offsets, nb_shared_blocks)                                       \
-  smpi_shared_malloc_partial(size, shared_block_offsets, nb_shared_blocks)
+  smpi_shared_malloc_partial((size), (shared_block_offsets), (nb_shared_blocks))
 
 XBT_PUBLIC void smpi_shared_free(void* data);
 #define SMPI_SHARED_FREE(data) smpi_shared_free(data)
@@ -1036,14 +1038,14 @@ XBT_PUBLIC void smpi_shared_free(void* data);
 XBT_PUBLIC int smpi_shared_known_call(const char* func, const char* input);
 XBT_PUBLIC void* smpi_shared_get_call(const char* func, const char* input);
 XBT_PUBLIC void* smpi_shared_set_call(const char* func, const char* input, void* data);
-#define SMPI_SHARED_CALL(func, input, ...) \
-   (smpi_shared_known_call(#func, input) ? smpi_shared_get_call(#func, input) \
-                                         : smpi_shared_set_call(#func, input, (func(__VA_ARGS__))))
+#define SMPI_SHARED_CALL(func, input, ...)                                                                             \
+  (smpi_shared_known_call(_XBT_STRINGIFY(func), (input))                                                               \
+       ? smpi_shared_get_call(_XBT_STRINGIFY(func), (input))                                                           \
+       : smpi_shared_set_call(_XBT_STRINGIFY(func), (input), ((func)(__VA_ARGS__))))
 
 /* Fortran specific stuff */
 
 XBT_PUBLIC int smpi_main(const char* program, int argc, char* argv[]);
-XBT_PUBLIC void smpi_process_init(int* argc, char*** argv);
 
 /* Trace replay specific stuff */
 XBT_PUBLIC void smpi_replay_init(const char* instance_id, int rank, double start_delay_flops); // Only initialization
@@ -1055,81 +1057,16 @@ XBT_PUBLIC void SMPI_app_instance_register(const char* name, xbt_main_func_t cod
 XBT_PUBLIC void SMPI_init();
 XBT_PUBLIC void SMPI_finalize();
 
-/* Manual global privatization fallback */
-XBT_PUBLIC void smpi_register_static(void* arg, void_f_pvoid_t free_fn);
-XBT_PUBLIC void smpi_free_static();
-
-#define SMPI_VARINIT_GLOBAL(name,type)                          \
-type *name = NULL;                                              \
-static void __attribute__((constructor)) __preinit_##name(void) { \
-   if(!name)                                                    \
-      name = (type*)calloc(smpi_global_size(), sizeof(type));   \
-}                                                               \
-static void __attribute__((destructor)) __postfini_##name(void) { \
-   free(name);                                                  \
-   name = NULL;                                                 \
-}
-
-#define SMPI_VARINIT_GLOBAL_AND_SET(name,type,expr)             \
-type *name = NULL;                                              \
-static void __attribute__((constructor)) __preinit_##name(void) { \
-   size_t size = smpi_global_size();                            \
-   size_t i;                                                    \
-   type value = expr;                                           \
-   if(!name) {                                                  \
-      name = (type*)malloc(size * sizeof(type));                \
-      for(i = 0; i < size; i++) {                               \
-         name[i] = value;                                       \
-      }                                                         \
-   }                                                            \
-}                                                               \
-static void __attribute__((destructor)) __postfini_##name(void) { \
-   free(name);                                                  \
-   name = NULL;                                                 \
-}
-
-#define SMPI_VARGET_GLOBAL(name) name[SIMIX_process_self()->pid]
-
-/**
- * This is used for the old privatization method, i.e., on old
- * machines that do not yet support privatization via mmap
- */
-#define SMPI_VARINIT_STATIC(name,type)                      \
-static type *name = NULL;                                   \
-if(!name) {                                                 \
-   name = (type*)calloc(smpi_global_size(), sizeof(type));  \
-   smpi_register_static(name, xbt_free_f);                  \
-}
-
-#define SMPI_VARINIT_STATIC_AND_SET(name,type,expr) \
-static type *name = NULL;                           \
-if(!name) {                                         \
-   size_t size = smpi_global_size();                \
-   size_t i;                                        \
-   type value = expr;                               \
-   name = (type*)malloc(size * sizeof(type));       \
-   for(i = 0; i < size; i++) {                      \
-      name[i] = value;                              \
-   }                                                \
-   smpi_register_static(name, xbt_free_f);          \
-}
-
-#define SMPI_VARGET_STATIC(name) name[SIMIX_process_self()->pid]
-
-
 SG_END_DECL()
 
 /* C++ declarations for shared_malloc */
 #ifdef __cplusplus
-#include <vector>
-
 XBT_PUBLIC int smpi_is_shared(void* ptr, std::vector<std::pair<size_t, size_t>>& private_blocks, size_t* offset);
 
 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>> merge_private_blocks(const std::vector<std::pair<size_t, size_t>>& src,
                                                             const std::vector<std::pair<size_t, size_t>>& dst);
-
 #endif
 
 #endif 
index 3dca953..b17bb99 100644 (file)
@@ -1,7 +1,7 @@
 // This file has been automatically generated by the script
 // in tools/smpi/generate_smpi_defines.pl
 // DO NOT EDIT MANUALLY. ALL CHANGES WILL BE OVERWRITTEN!
-#define MPI_Init(...) ({ smpi_process_init(__VA_ARGS__); smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Init(NULL, NULL); })
+#define MPI_Init(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Init(__VA_ARGS__); })
 #define MPI_Finalize(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Finalize(__VA_ARGS__); })
 #define MPI_Finalized(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Finalized(__VA_ARGS__); })
 #define MPI_Init_thread(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Init_thread(__VA_ARGS__); })
 #define MPI_Free_mem(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Free_mem(__VA_ARGS__); })
 #define MPI_Wtime(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Wtime(__VA_ARGS__); })
 #define MPI_Wtick(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Wtick(__VA_ARGS__); })
+#define MPI_Buffer_attach(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Buffer_attach(__VA_ARGS__); })
+#define MPI_Buffer_detach(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Buffer_detach(__VA_ARGS__); })
 #define MPI_Address(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Address(__VA_ARGS__); })
 #define MPI_Get_address(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Get_address(__VA_ARGS__); })
 #define MPI_Error_class(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Error_class(__VA_ARGS__); })
+#define MPI_Error_string(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Error_string(__VA_ARGS__); })
 #define MPI_Attr_delete(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Attr_delete(__VA_ARGS__); })
 #define MPI_Attr_get(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Attr_get(__VA_ARGS__); })
 #define MPI_Attr_put(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Attr_put(__VA_ARGS__); })
@@ -84,6 +87,7 @@
 #define MPI_Comm_get_name(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_get_name(__VA_ARGS__); })
 #define MPI_Comm_set_name(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_set_name(__VA_ARGS__); })
 #define MPI_Comm_dup(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_dup(__VA_ARGS__); })
+#define MPI_Comm_dup_with_info(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_dup_with_info(__VA_ARGS__); })
 #define MPI_Comm_get_attr(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_get_attr(__VA_ARGS__); })
 #define MPI_Comm_set_attr(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_set_attr(__VA_ARGS__); })
 #define MPI_Comm_delete_attr(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_delete_attr(__VA_ARGS__); })
 #define MPI_Comm_free(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_free(__VA_ARGS__); })
 #define MPI_Comm_disconnect(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_disconnect(__VA_ARGS__); })
 #define MPI_Comm_split(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_split(__VA_ARGS__); })
+#define MPI_Comm_set_info(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_set_info(__VA_ARGS__); })
+#define MPI_Comm_get_info(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_get_info(__VA_ARGS__); })
+#define MPI_Comm_split_type(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_split_type(__VA_ARGS__); })
 #define MPI_Comm_f2c(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_f2c(__VA_ARGS__); })
 #define MPI_Comm_c2f(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_c2f(__VA_ARGS__); })
 #define MPI_Send_init(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Send_init(__VA_ARGS__); })
 #define MPI_Send(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Send(__VA_ARGS__); })
 #define MPI_Ssend(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Ssend(__VA_ARGS__); })
 #define MPI_Ssend_init(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Ssend_init(__VA_ARGS__); })
+#define MPI_Bsend(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Bsend(__VA_ARGS__); })
+#define MPI_Bsend_init(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Bsend_init(__VA_ARGS__); })
+#define MPI_Ibsend(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Ibsend(__VA_ARGS__); })
 #define MPI_Issend(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Issend(__VA_ARGS__); })
 #define MPI_Sendrecv(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Sendrecv(__VA_ARGS__); })
 #define MPI_Sendrecv_replace(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Sendrecv_replace(__VA_ARGS__); })
 #define MPI_Testany(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Testany(__VA_ARGS__); })
 #define MPI_Testall(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Testall(__VA_ARGS__); })
 #define MPI_Testsome(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Testsome(__VA_ARGS__); })
+#define MPI_Test_cancelled(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Test_cancelled(__VA_ARGS__); })
 #define MPI_Wait(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Wait(__VA_ARGS__); })
 #define MPI_Waitany(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Waitany(__VA_ARGS__); })
 #define MPI_Waitall(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Waitall(__VA_ARGS__); })
 #define MPI_Reduce_scatter_block(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Reduce_scatter_block(__VA_ARGS__); })
 #define MPI_Alltoall(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Alltoall(__VA_ARGS__); })
 #define MPI_Alltoallv(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Alltoallv(__VA_ARGS__); })
+#define MPI_Alltoallw(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Alltoallw(__VA_ARGS__); })
 #define MPI_Reduce_local(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Reduce_local(__VA_ARGS__); })
 #define MPI_Info_create(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Info_create(__VA_ARGS__); })
 #define MPI_Info_set(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Info_set(__VA_ARGS__); })
 #define MPI_Cart_sub(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Cart_sub(__VA_ARGS__); })
 #define MPI_Cartdim_get(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Cartdim_get(__VA_ARGS__); })
 #define MPI_Dims_create(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Dims_create(__VA_ARGS__); })
+#define MPI_Request_get_status(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Request_get_status(__VA_ARGS__); })
+#define MPI_Grequest_start(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Grequest_start(__VA_ARGS__); })
+#define MPI_Grequest_complete(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Grequest_complete(__VA_ARGS__); })
+#define MPI_Status_set_cancelled(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Status_set_cancelled(__VA_ARGS__); })
+#define MPI_Status_set_elements(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Status_set_elements(__VA_ARGS__); })
+#define MPI_Type_create_subarray(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Type_create_subarray(__VA_ARGS__); })
+#define MPI_File_open(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_open(__VA_ARGS__); })
+#define MPI_File_close(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_close(__VA_ARGS__); })
+#define MPI_File_delete(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_delete(__VA_ARGS__); })
+#define MPI_File_get_size(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_get_size(__VA_ARGS__); })
+#define MPI_File_get_group(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_get_group(__VA_ARGS__); })
+#define MPI_File_get_amode(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_get_amode(__VA_ARGS__); })
+#define MPI_File_set_info(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_set_info(__VA_ARGS__); })
+#define MPI_File_get_info(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_get_info(__VA_ARGS__); })
+#define MPI_File_read_at(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_read_at(__VA_ARGS__); })
+#define MPI_File_read_at_all(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_read_at_all(__VA_ARGS__); })
+#define MPI_File_write_at(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_write_at(__VA_ARGS__); })
+#define MPI_File_write_at_all(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_write_at_all(__VA_ARGS__); })
+#define MPI_File_read(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_read(__VA_ARGS__); })
+#define MPI_File_read_all(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_read_all(__VA_ARGS__); })
+#define MPI_File_write(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_write(__VA_ARGS__); })
+#define MPI_File_write_all(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_write_all(__VA_ARGS__); })
+#define MPI_File_seek(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_seek(__VA_ARGS__); })
+#define MPI_File_get_position(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_get_position(__VA_ARGS__); })
+#define MPI_File_read_shared(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_read_shared(__VA_ARGS__); })
+#define MPI_File_write_shared(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_write_shared(__VA_ARGS__); })
+#define MPI_File_read_ordered(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_read_ordered(__VA_ARGS__); })
+#define MPI_File_write_ordered(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_write_ordered(__VA_ARGS__); })
+#define MPI_File_seek_shared(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_seek_shared(__VA_ARGS__); })
+#define MPI_File_get_position_shared(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_get_position_shared(__VA_ARGS__); })
+#define MPI_File_sync(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_sync(__VA_ARGS__); })
+#define MPI_Errhandler_set(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Errhandler_set(__VA_ARGS__); })
+#define MPI_Errhandler_create(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Errhandler_create(__VA_ARGS__); })
+#define MPI_Errhandler_free(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Errhandler_free(__VA_ARGS__); })
+#define MPI_Errhandler_get(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Errhandler_get(__VA_ARGS__); })
+#define MPI_Comm_set_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_set_errhandler(__VA_ARGS__); })
+#define MPI_Comm_get_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_get_errhandler(__VA_ARGS__); })
+#define MPI_Comm_create_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_create_errhandler(__VA_ARGS__); })
+#define MPI_Comm_call_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_call_errhandler(__VA_ARGS__); })
+#define MPI_Win_set_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Win_set_errhandler(__VA_ARGS__); })
+#define MPI_Win_get_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Win_get_errhandler(__VA_ARGS__); })
+#define MPI_Win_create_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Win_create_errhandler(__VA_ARGS__); })
+#define MPI_Win_call_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Win_call_errhandler(__VA_ARGS__); })
+#define MPI_File_call_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_call_errhandler(__VA_ARGS__); })
+#define MPI_File_create_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_create_errhandler(__VA_ARGS__); })
+#define MPI_File_set_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_set_errhandler(__VA_ARGS__); })
+#define MPI_File_get_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_get_errhandler(__VA_ARGS__); })
 #define MPI_Errhandler_f2c(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Errhandler_f2c(__VA_ARGS__); })
 #define MPI_Errhandler_c2f(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Errhandler_c2f(__VA_ARGS__); })
 #define MPI_Cart_map(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Cart_map(__VA_ARGS__); })
 #define MPI_Graph_neighbors_count(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Graph_neighbors_count(__VA_ARGS__); })
 #define MPI_Graphdims_get(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Graphdims_get(__VA_ARGS__); })
 #define MPI_Topo_test(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Topo_test(__VA_ARGS__); })
-#define MPI_Errhandler_create(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Errhandler_create(__VA_ARGS__); })
-#define MPI_Errhandler_free(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Errhandler_free(__VA_ARGS__); })
-#define MPI_Errhandler_get(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Errhandler_get(__VA_ARGS__); })
-#define MPI_Error_string(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Error_string(__VA_ARGS__); })
-#define MPI_Errhandler_set(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Errhandler_set(__VA_ARGS__); })
-#define MPI_Comm_set_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_set_errhandler(__VA_ARGS__); })
-#define MPI_Comm_get_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_get_errhandler(__VA_ARGS__); })
-#define MPI_Comm_create_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_create_errhandler(__VA_ARGS__); })
-#define MPI_Comm_call_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_call_errhandler(__VA_ARGS__); })
 #define MPI_Add_error_class(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Add_error_class(__VA_ARGS__); })
 #define MPI_Add_error_code(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Add_error_code(__VA_ARGS__); })
 #define MPI_Add_error_string(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Add_error_string(__VA_ARGS__); })
 #define MPI_Cancel(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Cancel(__VA_ARGS__); })
-#define MPI_Buffer_attach(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Buffer_attach(__VA_ARGS__); })
-#define MPI_Buffer_detach(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Buffer_detach(__VA_ARGS__); })
 #define MPI_Comm_test_inter(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_test_inter(__VA_ARGS__); })
 #define MPI_Intercomm_create(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Intercomm_create(__VA_ARGS__); })
 #define MPI_Intercomm_merge(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Intercomm_merge(__VA_ARGS__); })
-#define MPI_Bsend(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Bsend(__VA_ARGS__); })
-#define MPI_Bsend_init(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Bsend_init(__VA_ARGS__); })
-#define MPI_Ibsend(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Ibsend(__VA_ARGS__); })
 #define MPI_Comm_remote_group(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_remote_group(__VA_ARGS__); })
 #define MPI_Comm_remote_size(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_remote_size(__VA_ARGS__); })
 #define MPI_Rsend(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Rsend(__VA_ARGS__); })
 #define MPI_Rsend_init(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Rsend_init(__VA_ARGS__); })
 #define MPI_Irsend(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Irsend(__VA_ARGS__); })
-#define MPI_Test_cancelled(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Test_cancelled(__VA_ARGS__); })
 #define MPI_Get_elements(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Get_elements(__VA_ARGS__); })
 #define MPI_Pcontrol(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Pcontrol(__VA_ARGS__); })
-#define MPI_Win_set_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Win_set_errhandler(__VA_ARGS__); })
-#define MPI_Type_get_envelope(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Type_get_envelope(__VA_ARGS__); })
 #define MPI_Type_get_contents(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Type_get_contents(__VA_ARGS__); })
 #define MPI_Type_create_darray(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Type_create_darray(__VA_ARGS__); })
 #define MPI_Pack_external_size(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Pack_external_size(__VA_ARGS__); })
 #define MPI_Pack_external(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Pack_external(__VA_ARGS__); })
 #define MPI_Unpack_external(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Unpack_external(__VA_ARGS__); })
-#define MPI_Type_create_subarray(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Type_create_subarray(__VA_ARGS__); })
 #define MPI_Type_match_size(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Type_match_size(__VA_ARGS__); })
-#define MPI_Alltoallw(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Alltoallw(__VA_ARGS__); })
-#define MPI_Comm_set_info(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_set_info(__VA_ARGS__); })
-#define MPI_Comm_get_info(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_get_info(__VA_ARGS__); })
-#define MPI_Comm_dup_with_info(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_dup_with_info(__VA_ARGS__); })
-#define MPI_Comm_split_type(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_split_type(__VA_ARGS__); })
 #define MPI_Comm_connect(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Comm_connect(__VA_ARGS__); })
-#define MPI_Request_get_status(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Request_get_status(__VA_ARGS__); })
-#define MPI_Grequest_start(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Grequest_start(__VA_ARGS__); })
-#define MPI_Grequest_complete(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Grequest_complete(__VA_ARGS__); })
-#define MPI_Status_set_cancelled(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Status_set_cancelled(__VA_ARGS__); })
-#define MPI_Status_set_elements(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Status_set_elements(__VA_ARGS__); })
 #define MPI_Unpublish_name(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Unpublish_name(__VA_ARGS__); })
 #define MPI_Publish_name(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Publish_name(__VA_ARGS__); })
 #define MPI_Lookup_name(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Lookup_name(__VA_ARGS__); })
 #define MPI_File_c2f(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_c2f(__VA_ARGS__); })
 #define MPI_File_f2c(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_f2c(__VA_ARGS__); })
 #define MPI_Register_datarep(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Register_datarep(__VA_ARGS__); })
-#define MPI_File_call_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_call_errhandler(__VA_ARGS__); })
-#define MPI_File_create_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_create_errhandler(__VA_ARGS__); })
-#define MPI_File_set_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_set_errhandler(__VA_ARGS__); })
-#define MPI_File_get_errhandler(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_get_errhandler(__VA_ARGS__); })
-#define MPI_File_open(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_open(__VA_ARGS__); })
-#define MPI_File_close(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_close(__VA_ARGS__); })
-#define MPI_File_delete(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_delete(__VA_ARGS__); })
 #define MPI_File_set_size(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_set_size(__VA_ARGS__); })
 #define MPI_File_preallocate(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_preallocate(__VA_ARGS__); })
-#define MPI_File_get_size(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_get_size(__VA_ARGS__); })
-#define MPI_File_get_group(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_get_group(__VA_ARGS__); })
-#define MPI_File_get_amode(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_get_amode(__VA_ARGS__); })
-#define MPI_File_set_info(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_set_info(__VA_ARGS__); })
-#define MPI_File_get_info(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_get_info(__VA_ARGS__); })
 #define MPI_File_set_view(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_set_view(__VA_ARGS__); })
 #define MPI_File_get_view(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_get_view(__VA_ARGS__); })
-#define MPI_File_read_at(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_read_at(__VA_ARGS__); })
-#define MPI_File_read_at_all(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_read_at_all(__VA_ARGS__); })
-#define MPI_File_write_at(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_write_at(__VA_ARGS__); })
-#define MPI_File_write_at_all(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_write_at_all(__VA_ARGS__); })
 #define MPI_File_iread_at(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_iread_at(__VA_ARGS__); })
 #define MPI_File_iwrite_at(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_iwrite_at(__VA_ARGS__); })
 #define MPI_File_iread_at_all(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_iread_at_all(__VA_ARGS__); })
 #define MPI_File_iwrite_at_all(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_iwrite_at_all(__VA_ARGS__); })
-#define MPI_File_read(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_read(__VA_ARGS__); })
-#define MPI_File_read_all(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_read_all(__VA_ARGS__); })
-#define MPI_File_write(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_write(__VA_ARGS__); })
-#define MPI_File_write_all(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_write_all(__VA_ARGS__); })
 #define MPI_File_iread(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_iread(__VA_ARGS__); })
 #define MPI_File_iwrite(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_iwrite(__VA_ARGS__); })
 #define MPI_File_iread_all(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_iread_all(__VA_ARGS__); })
 #define MPI_File_iwrite_all(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_iwrite_all(__VA_ARGS__); })
-#define MPI_File_seek(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_seek(__VA_ARGS__); })
-#define MPI_File_get_position(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_get_position(__VA_ARGS__); })
 #define MPI_File_get_byte_offset(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_get_byte_offset(__VA_ARGS__); })
-#define MPI_File_read_shared(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_read_shared(__VA_ARGS__); })
-#define MPI_File_write_shared(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_write_shared(__VA_ARGS__); })
 #define MPI_File_iread_shared(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_iread_shared(__VA_ARGS__); })
 #define MPI_File_iwrite_shared(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_iwrite_shared(__VA_ARGS__); })
-#define MPI_File_read_ordered(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_read_ordered(__VA_ARGS__); })
-#define MPI_File_write_ordered(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_write_ordered(__VA_ARGS__); })
-#define MPI_File_seek_shared(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_seek_shared(__VA_ARGS__); })
-#define MPI_File_get_position_shared(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_get_position_shared(__VA_ARGS__); })
 #define MPI_File_read_at_all_begin(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_read_at_all_begin(__VA_ARGS__); })
 #define MPI_File_read_at_all_end(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_read_at_all_end(__VA_ARGS__); })
 #define MPI_File_write_at_all_begin(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_write_at_all_begin(__VA_ARGS__); })
 #define MPI_File_get_type_extent(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_get_type_extent(__VA_ARGS__); })
 #define MPI_File_set_atomicity(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_set_atomicity(__VA_ARGS__); })
 #define MPI_File_get_atomicity(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_get_atomicity(__VA_ARGS__); })
-#define MPI_File_sync(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_File_sync(__VA_ARGS__); })
+#define MPI_Mrecv(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Mrecv(__VA_ARGS__); })
+#define MPI_Mprobe(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Mprobe(__VA_ARGS__); })
+#define MPI_Imrecv(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Imrecv(__VA_ARGS__); })
+#define MPI_Improbe(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Improbe(__VA_ARGS__); })
index ef443c0..b1d58c8 100644 (file)
 #define MPI_WTIME smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Wtime
 #define mpi_wtick smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Wtick
 #define MPI_WTICK smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Wtick
+#define mpi_buffer_attach smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Buffer_attach
+#define MPI_BUFFER_ATTACH smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Buffer_attach
+#define mpi_buffer_detach smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Buffer_detach
+#define MPI_BUFFER_DETACH smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Buffer_detach
 #define mpi_address smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Address
 #define MPI_ADDRESS smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Address
 #define mpi_get_address smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Get_address
 #define MPI_GET_ADDRESS smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Get_address
 #define mpi_error_class smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Error_class
 #define MPI_ERROR_CLASS smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Error_class
+#define mpi_error_string smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Error_string
+#define MPI_ERROR_STRING smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Error_string
 #define mpi_attr_delete smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Attr_delete
 #define MPI_ATTR_DELETE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Attr_delete
 #define mpi_attr_get smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Attr_get
 #define MPI_COMM_SET_NAME smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_set_name
 #define mpi_comm_dup smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_dup
 #define MPI_COMM_DUP smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_dup
+#define mpi_comm_dup_with_info smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_dup_with_info
+#define MPI_COMM_DUP_WITH_INFO smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_dup_with_info
 #define mpi_comm_get_attr smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_get_attr
 #define MPI_COMM_GET_ATTR smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_get_attr
 #define mpi_comm_set_attr smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_set_attr
 #define MPI_COMM_DISCONNECT smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_disconnect
 #define mpi_comm_split smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_split
 #define MPI_COMM_SPLIT smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_split
+#define mpi_comm_set_info smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_set_info
+#define MPI_COMM_SET_INFO smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_set_info
+#define mpi_comm_get_info smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_get_info
+#define MPI_COMM_GET_INFO smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_get_info
+#define mpi_comm_split_type smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_split_type
+#define MPI_COMM_SPLIT_TYPE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_split_type
 #define mpi_comm_f2c smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_f2c
 #define MPI_COMM_F2C smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_f2c
 #define mpi_comm_c2f smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_c2f
 #define MPI_SSEND smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Ssend
 #define mpi_ssend_init smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Ssend_init
 #define MPI_SSEND_INIT smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Ssend_init
+#define mpi_bsend smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Bsend
+#define MPI_BSEND smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Bsend
+#define mpi_bsend_init smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Bsend_init
+#define MPI_BSEND_INIT smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Bsend_init
+#define mpi_ibsend smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Ibsend
+#define MPI_IBSEND smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Ibsend
 #define mpi_issend smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Issend
 #define MPI_ISSEND smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Issend
 #define mpi_sendrecv smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Sendrecv
 #define MPI_TESTALL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Testall
 #define mpi_testsome smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Testsome
 #define MPI_TESTSOME smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Testsome
+#define mpi_test_cancelled smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Test_cancelled
+#define MPI_TEST_CANCELLED smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Test_cancelled
 #define mpi_wait smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Wait
 #define MPI_WAIT smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Wait
 #define mpi_waitany smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Waitany
 #define MPI_ALLTOALL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Alltoall
 #define mpi_alltoallv smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Alltoallv
 #define MPI_ALLTOALLV smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Alltoallv
+#define mpi_alltoallw smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Alltoallw
+#define MPI_ALLTOALLW smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Alltoallw
 #define mpi_reduce_local smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Reduce_local
 #define MPI_REDUCE_LOCAL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Reduce_local
 #define mpi_info_create smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Info_create
 #define MPI_CARTDIM_GET smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Cartdim_get
 #define mpi_dims_create smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Dims_create
 #define MPI_DIMS_CREATE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Dims_create
+#define mpi_request_get_status smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Request_get_status
+#define MPI_REQUEST_GET_STATUS smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Request_get_status
+#define mpi_grequest_start smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Grequest_start
+#define MPI_GREQUEST_START smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Grequest_start
+#define mpi_grequest_complete smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Grequest_complete
+#define MPI_GREQUEST_COMPLETE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Grequest_complete
+#define mpi_status_set_cancelled smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Status_set_cancelled
+#define MPI_STATUS_SET_CANCELLED smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Status_set_cancelled
+#define mpi_status_set_elements smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Status_set_elements
+#define MPI_STATUS_SET_ELEMENTS smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Status_set_elements
+#define mpi_type_create_subarray smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Type_create_subarray
+#define MPI_TYPE_CREATE_SUBARRAY smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Type_create_subarray
+#define mpi_file_open smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_open
+#define MPI_FILE_OPEN smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_open
+#define mpi_file_close smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_close
+#define MPI_FILE_CLOSE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_close
+#define mpi_file_delete smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_delete
+#define MPI_FILE_DELETE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_delete
+#define mpi_file_get_size smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_size
+#define MPI_FILE_GET_SIZE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_size
+#define mpi_file_get_group smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_group
+#define MPI_FILE_GET_GROUP smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_group
+#define mpi_file_get_amode smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_amode
+#define MPI_FILE_GET_AMODE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_amode
+#define mpi_file_set_info smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_set_info
+#define MPI_FILE_SET_INFO smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_set_info
+#define mpi_file_get_info smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_info
+#define MPI_FILE_GET_INFO smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_info
+#define mpi_file_read_at smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_at
+#define MPI_FILE_READ_AT smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_at
+#define mpi_file_read_at_all smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_at_all
+#define MPI_FILE_READ_AT_ALL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_at_all
+#define mpi_file_write_at smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_at
+#define MPI_FILE_WRITE_AT smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_at
+#define mpi_file_write_at_all smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_at_all
+#define MPI_FILE_WRITE_AT_ALL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_at_all
+#define mpi_file_read smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read
+#define MPI_FILE_READ smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read
+#define mpi_file_read_all smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_all
+#define MPI_FILE_READ_ALL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_all
+#define mpi_file_write smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write
+#define MPI_FILE_WRITE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write
+#define mpi_file_write_all smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_all
+#define MPI_FILE_WRITE_ALL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_all
+#define mpi_file_seek smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_seek
+#define MPI_FILE_SEEK smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_seek
+#define mpi_file_get_position smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_position
+#define MPI_FILE_GET_POSITION smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_position
+#define mpi_file_read_shared smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_shared
+#define MPI_FILE_READ_SHARED smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_shared
+#define mpi_file_write_shared smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_shared
+#define MPI_FILE_WRITE_SHARED smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_shared
+#define mpi_file_read_ordered smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_ordered
+#define MPI_FILE_READ_ORDERED smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_ordered
+#define mpi_file_write_ordered smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_ordered
+#define MPI_FILE_WRITE_ORDERED smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_ordered
+#define mpi_file_seek_shared smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_seek_shared
+#define MPI_FILE_SEEK_SHARED smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_seek_shared
+#define mpi_file_get_position_shared smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_position_shared
+#define MPI_FILE_GET_POSITION_SHARED smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_position_shared
+#define mpi_file_sync smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_sync
+#define MPI_FILE_SYNC smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_sync
+#define mpi_errhandler_set smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_set
+#define MPI_ERRHANDLER_SET smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_set
+#define mpi_errhandler_create smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_create
+#define MPI_ERRHANDLER_CREATE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_create
+#define mpi_errhandler_free smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_free
+#define MPI_ERRHANDLER_FREE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_free
+#define mpi_errhandler_get smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_get
+#define MPI_ERRHANDLER_GET smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_get
+#define mpi_comm_set_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_set_errhandler
+#define MPI_COMM_SET_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_set_errhandler
+#define mpi_comm_get_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_get_errhandler
+#define MPI_COMM_GET_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_get_errhandler
+#define mpi_comm_create_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_create_errhandler
+#define MPI_COMM_CREATE_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_create_errhandler
+#define mpi_comm_call_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_call_errhandler
+#define MPI_COMM_CALL_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_call_errhandler
+#define mpi_win_set_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Win_set_errhandler
+#define MPI_WIN_SET_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Win_set_errhandler
+#define mpi_win_get_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Win_get_errhandler
+#define MPI_WIN_GET_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Win_get_errhandler
+#define mpi_win_create_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Win_create_errhandler
+#define MPI_WIN_CREATE_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Win_create_errhandler
+#define mpi_win_call_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Win_call_errhandler
+#define MPI_WIN_CALL_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Win_call_errhandler
+#define mpi_file_call_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_call_errhandler
+#define MPI_FILE_CALL_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_call_errhandler
+#define mpi_file_create_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_create_errhandler
+#define MPI_FILE_CREATE_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_create_errhandler
+#define mpi_file_set_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_set_errhandler
+#define MPI_FILE_SET_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_set_errhandler
+#define mpi_file_get_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_errhandler
+#define MPI_FILE_GET_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_errhandler
 #define mpi_errhandler_f2c smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_f2c
 #define MPI_ERRHANDLER_F2C smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_f2c
 #define mpi_errhandler_c2f smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_c2f
 #define MPI_GRAPHDIMS_GET smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Graphdims_get
 #define mpi_topo_test smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Topo_test
 #define MPI_TOPO_TEST smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Topo_test
-#define mpi_errhandler_create smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_create
-#define MPI_ERRHANDLER_CREATE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_create
-#define mpi_errhandler_free smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_free
-#define MPI_ERRHANDLER_FREE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_free
-#define mpi_errhandler_get smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_get
-#define MPI_ERRHANDLER_GET smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_get
-#define mpi_error_string smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Error_string
-#define MPI_ERROR_STRING smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Error_string
-#define mpi_errhandler_set smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_set
-#define MPI_ERRHANDLER_SET smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Errhandler_set
-#define mpi_comm_set_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_set_errhandler
-#define MPI_COMM_SET_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_set_errhandler
-#define mpi_comm_get_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_get_errhandler
-#define MPI_COMM_GET_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_get_errhandler
-#define mpi_comm_create_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_create_errhandler
-#define MPI_COMM_CREATE_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_create_errhandler
-#define mpi_comm_call_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_call_errhandler
-#define MPI_COMM_CALL_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_call_errhandler
 #define mpi_add_error_class smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Add_error_class
 #define MPI_ADD_ERROR_CLASS smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Add_error_class
 #define mpi_add_error_code smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Add_error_code
 #define MPI_ADD_ERROR_STRING smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Add_error_string
 #define mpi_cancel smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Cancel
 #define MPI_CANCEL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Cancel
-#define mpi_buffer_attach smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Buffer_attach
-#define MPI_BUFFER_ATTACH smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Buffer_attach
-#define mpi_buffer_detach smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Buffer_detach
-#define MPI_BUFFER_DETACH smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Buffer_detach
 #define mpi_comm_test_inter smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_test_inter
 #define MPI_COMM_TEST_INTER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_test_inter
 #define mpi_intercomm_create smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Intercomm_create
 #define MPI_INTERCOMM_CREATE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Intercomm_create
 #define mpi_intercomm_merge smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Intercomm_merge
 #define MPI_INTERCOMM_MERGE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Intercomm_merge
-#define mpi_bsend smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Bsend
-#define MPI_BSEND smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Bsend
-#define mpi_bsend_init smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Bsend_init
-#define MPI_BSEND_INIT smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Bsend_init
-#define mpi_ibsend smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Ibsend
-#define MPI_IBSEND smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Ibsend
 #define mpi_comm_remote_group smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_remote_group
 #define MPI_COMM_REMOTE_GROUP smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_remote_group
 #define mpi_comm_remote_size smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_remote_size
 #define MPI_RSEND_INIT smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Rsend_init
 #define mpi_irsend smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Irsend
 #define MPI_IRSEND smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Irsend
-#define mpi_test_cancelled smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Test_cancelled
-#define MPI_TEST_CANCELLED smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Test_cancelled
 #define mpi_get_elements smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Get_elements
 #define MPI_GET_ELEMENTS smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Get_elements
 #define mpi_pcontrol smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Pcontrol
 #define MPI_PCONTROL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Pcontrol
-#define mpi_win_set_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Win_set_errhandler
-#define MPI_WIN_SET_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Win_set_errhandler
-#define mpi_type_get_envelope smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Type_get_envelope
-#define MPI_TYPE_GET_ENVELOPE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Type_get_envelope
 #define mpi_type_get_contents smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Type_get_contents
 #define MPI_TYPE_GET_CONTENTS smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Type_get_contents
 #define mpi_type_create_darray smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Type_create_darray
 #define MPI_PACK_EXTERNAL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Pack_external
 #define mpi_unpack_external smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Unpack_external
 #define MPI_UNPACK_EXTERNAL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Unpack_external
-#define mpi_type_create_subarray smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Type_create_subarray
-#define MPI_TYPE_CREATE_SUBARRAY smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Type_create_subarray
 #define mpi_type_match_size smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Type_match_size
 #define MPI_TYPE_MATCH_SIZE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Type_match_size
-#define mpi_alltoallw smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Alltoallw
-#define MPI_ALLTOALLW smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Alltoallw
-#define mpi_comm_set_info smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_set_info
-#define MPI_COMM_SET_INFO smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_set_info
-#define mpi_comm_get_info smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_get_info
-#define MPI_COMM_GET_INFO smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_get_info
-#define mpi_comm_dup_with_info smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_dup_with_info
-#define MPI_COMM_DUP_WITH_INFO smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_dup_with_info
-#define mpi_comm_split_type smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_split_type
-#define MPI_COMM_SPLIT_TYPE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_split_type
 #define mpi_comm_connect smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_connect
 #define MPI_COMM_CONNECT smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Comm_connect
-#define mpi_request_get_status smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Request_get_status
-#define MPI_REQUEST_GET_STATUS smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Request_get_status
-#define mpi_grequest_start smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Grequest_start
-#define MPI_GREQUEST_START smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Grequest_start
-#define mpi_grequest_complete smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Grequest_complete
-#define MPI_GREQUEST_COMPLETE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Grequest_complete
-#define mpi_status_set_cancelled smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Status_set_cancelled
-#define MPI_STATUS_SET_CANCELLED smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Status_set_cancelled
-#define mpi_status_set_elements smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Status_set_elements
-#define MPI_STATUS_SET_ELEMENTS smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Status_set_elements
 #define mpi_unpublish_name smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Unpublish_name
 #define MPI_UNPUBLISH_NAME smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Unpublish_name
 #define mpi_publish_name smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Publish_name
 #define MPI_FILE_F2C smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_f2c
 #define mpi_register_datarep smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Register_datarep
 #define MPI_REGISTER_DATAREP smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Register_datarep
-#define mpi_file_call_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_call_errhandler
-#define MPI_FILE_CALL_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_call_errhandler
-#define mpi_file_create_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_create_errhandler
-#define MPI_FILE_CREATE_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_create_errhandler
-#define mpi_file_set_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_set_errhandler
-#define MPI_FILE_SET_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_set_errhandler
-#define mpi_file_get_errhandler smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_errhandler
-#define MPI_FILE_GET_ERRHANDLER smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_errhandler
-#define mpi_file_open smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_open
-#define MPI_FILE_OPEN smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_open
-#define mpi_file_close smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_close
-#define MPI_FILE_CLOSE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_close
-#define mpi_file_delete smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_delete
-#define MPI_FILE_DELETE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_delete
 #define mpi_file_set_size smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_set_size
 #define MPI_FILE_SET_SIZE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_set_size
 #define mpi_file_preallocate smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_preallocate
 #define MPI_FILE_PREALLOCATE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_preallocate
-#define mpi_file_get_size smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_size
-#define MPI_FILE_GET_SIZE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_size
-#define mpi_file_get_group smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_group
-#define MPI_FILE_GET_GROUP smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_group
-#define mpi_file_get_amode smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_amode
-#define MPI_FILE_GET_AMODE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_amode
-#define mpi_file_set_info smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_set_info
-#define MPI_FILE_SET_INFO smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_set_info
-#define mpi_file_get_info smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_info
-#define MPI_FILE_GET_INFO smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_info
 #define mpi_file_set_view smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_set_view
 #define MPI_FILE_SET_VIEW smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_set_view
 #define mpi_file_get_view smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_view
 #define MPI_FILE_GET_VIEW smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_view
-#define mpi_file_read_at smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_at
-#define MPI_FILE_READ_AT smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_at
-#define mpi_file_read_at_all smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_at_all
-#define MPI_FILE_READ_AT_ALL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_at_all
-#define mpi_file_write_at smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_at
-#define MPI_FILE_WRITE_AT smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_at
-#define mpi_file_write_at_all smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_at_all
-#define MPI_FILE_WRITE_AT_ALL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_at_all
 #define mpi_file_iread_at smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_iread_at
 #define MPI_FILE_IREAD_AT smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_iread_at
 #define mpi_file_iwrite_at smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_iwrite_at
 #define MPI_FILE_IREAD_AT_ALL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_iread_at_all
 #define mpi_file_iwrite_at_all smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_iwrite_at_all
 #define MPI_FILE_IWRITE_AT_ALL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_iwrite_at_all
-#define mpi_file_read smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read
-#define MPI_FILE_READ smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read
-#define mpi_file_read_all smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_all
-#define MPI_FILE_READ_ALL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_all
-#define mpi_file_write smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write
-#define MPI_FILE_WRITE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write
-#define mpi_file_write_all smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_all
-#define MPI_FILE_WRITE_ALL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_all
 #define mpi_file_iread smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_iread
 #define MPI_FILE_IREAD smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_iread
 #define mpi_file_iwrite smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_iwrite
 #define MPI_FILE_IREAD_ALL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_iread_all
 #define mpi_file_iwrite_all smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_iwrite_all
 #define MPI_FILE_IWRITE_ALL smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_iwrite_all
-#define mpi_file_seek smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_seek
-#define MPI_FILE_SEEK smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_seek
-#define mpi_file_get_position smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_position
-#define MPI_FILE_GET_POSITION smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_position
 #define mpi_file_get_byte_offset smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_byte_offset
 #define MPI_FILE_GET_BYTE_OFFSET smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_byte_offset
-#define mpi_file_read_shared smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_shared
-#define MPI_FILE_READ_SHARED smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_shared
-#define mpi_file_write_shared smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_shared
-#define MPI_FILE_WRITE_SHARED smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_shared
 #define mpi_file_iread_shared smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_iread_shared
 #define MPI_FILE_IREAD_SHARED smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_iread_shared
 #define mpi_file_iwrite_shared smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_iwrite_shared
 #define MPI_FILE_IWRITE_SHARED smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_iwrite_shared
-#define mpi_file_read_ordered smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_ordered
-#define MPI_FILE_READ_ORDERED smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_ordered
-#define mpi_file_write_ordered smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_ordered
-#define MPI_FILE_WRITE_ORDERED smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_write_ordered
-#define mpi_file_seek_shared smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_seek_shared
-#define MPI_FILE_SEEK_SHARED smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_seek_shared
-#define mpi_file_get_position_shared smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_position_shared
-#define MPI_FILE_GET_POSITION_SHARED smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_position_shared
 #define mpi_file_read_at_all_begin smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_at_all_begin
 #define MPI_FILE_READ_AT_ALL_BEGIN smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_at_all_begin
 #define mpi_file_read_at_all_end smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_read_at_all_end
 #define MPI_FILE_SET_ATOMICITY smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_set_atomicity
 #define mpi_file_get_atomicity smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_atomicity
 #define MPI_FILE_GET_ATOMICITY smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_get_atomicity
-#define mpi_file_sync smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_sync
-#define MPI_FILE_SYNC smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_File_sync
+#define mpi_mrecv smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Mrecv
+#define MPI_MRECV smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Mrecv
+#define mpi_mprobe smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Mprobe
+#define MPI_MPROBE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Mprobe
+#define mpi_imrecv smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Imrecv
+#define MPI_IMRECV smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Imrecv
+#define mpi_improbe smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Improbe
+#define MPI_IMPROBE smpi_trace_set_call_location(__FILE__,__LINE__); call MPI_Improbe
index be15a24..b1a12da 100644 (file)
 #endif
 
 #include <smpi/smpi_helpers_internal.h>
-
+#ifndef TRACE_CALL_LOCATION /* Defined by smpicc on the command line */
 #define sleep(x) smpi_sleep(x)
 #define usleep(x) smpi_usleep(x)
-#define gettimeofday(x, y) smpi_gettimeofday(x, 0)
+#else
+#define sleep(x) ({ smpi_trace_set_call_location(__FILE__,__LINE__); smpi_sleep(x); })
+#define usleep(x) ({ smpi_trace_set_call_location(__FILE__,__LINE__); smpi_usleep(x); })
+#endif
+
+#define gettimeofday(x, y) smpi_gettimeofday((x), 0)
 #if _POSIX_TIMERS > 0
-#define nanosleep(x, y) smpi_nanosleep(x, y)
-#define clock_gettime(x, y) smpi_clock_gettime(x, y)
+#ifndef TRACE_CALL_LOCATION /* Defined by smpicc on the command line */
+#define nanosleep(x, y) smpi_nanosleep((x), (y))
+#else
+#define nanosleep(x) ({ smpi_trace_set_call_location(__FILE__,__LINE__); smpi_nanosleep(x); })
+#endif
+#define clock_gettime(x, y) smpi_clock_gettime((x), (y))
 #endif
 
-#define getopt(x,y,z) smpi_getopt(x,y,z)
-#define getopt_long(x,y,z,a,b) smpi_getopt_long(x,y,z,a,b)
-#define getopt_long_only(x,y,z,a,b) smpi_getopt_long_only(x,y,z,a,b)
+#define getopt(x, y, z) smpi_getopt((x), (y), (z))
+#define getopt_long(x, y, z, a, b) smpi_getopt_long((x), (y), (z), (a), (b))
+#define getopt_long_only(x, y, z, a, b) smpi_getopt_long_only((x), (y), (z), (a), (b))
 
 #endif
index 5a3e4b6..57490ce 100644 (file)
@@ -7,6 +7,8 @@
 #define SMPI_HELPERS_INTERNAL_H
 
 #include <getopt.h>
+#include <stdio.h>  /* for getopt() on OpenIndiana, don't remove */
+#include <stdlib.h> /* for getopt() on OpenIndiana, don't remove */
 #include <unistd.h>
 
 #include <sys/time.h>
index 37a7d41..d95d186 100644 (file)
@@ -52,9 +52,11 @@ private:
 public:
   static size_t extension_create(void (*deleter)(void*))
   {
-    std::size_t res = deleters_.size();
+    if (deleters_.empty()) { // Save space for void* user data
+      deleters_.push_back(nullptr);
+    }
     deleters_.push_back(deleter);
-    return res;
+    return deleters_.size() - 1;
   }
   template<class U>
   static Extension<T,U> extension_create(void (*deleter)(void*))
@@ -66,7 +68,7 @@ public:
   {
     return Extension<T, U>(extension_create([](void* p) { delete static_cast<U*>(p); }));
   }
-  Extendable() : extensions_(deleters_.size(), nullptr) {}
+  Extendable() : extensions_((deleters_.size() > 0 ? deleters_.size() : 1), nullptr) {}
   Extendable(const Extendable&) = delete;
   Extendable& operator=(const Extendable&) = delete;
   ~Extendable()
@@ -77,7 +79,7 @@ public:
      * an extension A, the subsystem of B might depend on the subsystem on A and
      * 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)
+    for (std::size_t i = extensions_.size(); i > 1; --i) // rank=0 is the spot of user's void*
       if (extensions_[i - 1] != nullptr && deleters_[i - 1] != nullptr)
         deleters_[i - 1](extensions_[i - 1]);
   }
@@ -85,17 +87,14 @@ public:
   // Type-unsafe versions of the facet access methods:
   void* extension(std::size_t rank) const
   {
-    if (rank >= extensions_.size())
-      return nullptr;
-    else
-      return extensions_.at(rank);
+    return rank < extensions_.size() ? extensions_[rank] : nullptr;
   }
   void extension_set(std::size_t rank, void* value, bool use_dtor = true)
   {
     if (rank >= extensions_.size())
       extensions_.resize(rank + 1, nullptr);
     void* old_value = this->extension(rank);
-    extensions_.at(rank) = value;
+    extensions_[rank] = value;
     if (use_dtor && old_value != nullptr && deleters_[rank])
       deleters_[rank](old_value);
   }
@@ -107,7 +106,13 @@ public:
   {
     extension_set(rank.id(), value, use_dtor);
   }
-
+  // void* version, for C users and nostalgics
+  void set_data(void* data){
+    extensions_[0]=data;
+  }
+  void* get_data(){
+    return extensions_[0];
+  }
   // Convenience extension access when the type has a associated EXTENSION ID:
   template <class U> U* extension() const { return extension<U>(U::EXTENSION_ID); }
   template<class U> void extension_set(U* p) { extension_set<U>(U::EXTENSION_ID, p); }
index b455627..585b123 100644 (file)
@@ -35,8 +35,7 @@ XBT_PUBLIC void xbt_backtrace_display_current();
    @hideinitializer  */
 #define xbt_assert(...) \
   _XBT_IF_ONE_ARG(_xbt_assert_ARG1, _xbt_assert_ARGN, __VA_ARGS__)(__VA_ARGS__)
-#define _xbt_assert_ARG1(cond) \
-  _xbt_assert_ARGN(cond, "Assertion %s failed", #cond)
+#define _xbt_assert_ARG1(cond) _xbt_assert_ARGN((cond), "Assertion %s failed", #cond)
 #define _xbt_assert_ARGN(cond, ...)                                                                                    \
   do {                                                                                                                 \
     if (!(cond)) {                                                                                                     \
index d34b992..1f49c1b 100644 (file)
 #ifdef __MINGW32__
 #  include <stdio.h>
 
-#  define XBT_ATTRIB_PRINTF( format_idx, arg_idx )    \
-     __attribute__((__format__ (__MINGW_PRINTF_FORMAT, format_idx, arg_idx)))
-#  define XBT_ATTRIB_SCANF( format_idx, arg_idx )     \
-     __attribute__((__MINGW_SCANF_FORMAT (__scanf__, format_idx, arg_idx)))
+#define XBT_ATTRIB_PRINTF(format_idx, arg_idx)                                                                         \
+  __attribute__((__format__(__MINGW_PRINTF_FORMAT, (format_idx), (arg_idx))))
+#define XBT_ATTRIB_SCANF(format_idx, arg_idx) __attribute__((__MINGW_SCANF_FORMAT(__scanf__, (format_idx), (arg_idx))))
 #else
-#  define XBT_ATTRIB_PRINTF( format_idx, arg_idx )    \
-     __attribute__((__format__ (__printf__, format_idx, arg_idx)))
-#  define XBT_ATTRIB_SCANF( format_idx, arg_idx )     \
-     __attribute__((__format__ (__scanf__, format_idx, arg_idx)))
+#define XBT_ATTRIB_PRINTF(format_idx, arg_idx) __attribute__((__format__(__printf__, (format_idx), (arg_idx))))
+#define XBT_ATTRIB_SCANF(format_idx, arg_idx) __attribute__((__format__(__scanf__, (format_idx), (arg_idx))))
 #endif
 
 #if defined(__cplusplus)
 #define XBT_ATTRIB_DEPRECATED(mesg) __attribute__((deprecated(mesg)))
 #endif
 
-#define XBT_ATTRIB_DEPRECATED_v323(mesg)                                                                               \
-  XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped in v3.23)") /* Will be dropped in v3.23 */
-#define XBT_ATTRIB_DEPRECATED_v324(mesg)                                                                               \
-  XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped in v3.24)") /* Will be dropped in v3.24 */
 #define XBT_ATTRIB_DEPRECATED_v325(mesg)                                                                               \
   XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped in v3.25)") /* Will be dropped in v3.25 */
-#define XBT_ATTRIB_DEPRECATED_v326(mesg)                                                                               \
-  XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped in v3.26)") /* Will be dropped in v3.26 */
+#define XBT_ATTRIB_DEPRECATED_v327(mesg)                                                                               \
+  XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped in v3.27)") /* Will be dropped in v3.27 */
 
 #if !defined(__APPLE__)
 #  define XBT_ATTRIB_CONSTRUCTOR(prio) __attribute__((__constructor__(prio)))
 #  endif
 #endif
 
+/* Stringify argument. */
+#define _XBT_STRINGIFY(a) #a
+
+/* Concatenate arguments. _XBT_CONCAT2 adds a level of indirection over _XBT_CONCAT. */
+#define _XBT_CONCAT(a, b) a##b
+#define _XBT_CONCAT2(a, b) _XBT_CONCAT(a, b)
+#define _XBT_CONCAT3(a, b, c) _XBT_CONCAT2(_XBT_CONCAT(a, b), c)
+#define _XBT_CONCAT4(a, b, c, d) _XBT_CONCAT2(_XBT_CONCAT3(a, b, c), d)
+
 /*
  * Expands to `one' if there is only one argument for the variadic part.
  * Otherwise, expands to `more'.
index c3b7ea8..486c5f7 100644 (file)
@@ -63,38 +63,20 @@ typedef void* xbt_cfg_t;
 
 SG_BEGIN_DECL()
 
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::set_parse") 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_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<int>") XBT_PUBLIC
+XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<int> or sg_cfg_set_int") XBT_PUBLIC
     void xbt_cfg_set_int(const char* name, int val);
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<double>") XBT_PUBLIC
+XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<double> or sg_cfg_set_double") XBT_PUBLIC
     void xbt_cfg_set_double(const char* name, double val);
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<bool>") XBT_PUBLIC
+XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<bool> or sg_cfg_set_boolean") XBT_PUBLIC
     void xbt_cfg_set_boolean(const char* name, const char* val);
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<std::string>") XBT_PUBLIC
+XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::set_value<std::string>or sg_cfg_set_string") XBT_PUBLIC
     void xbt_cfg_set_string(const char* name, const char* val);
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::set_as_string") XBT_PUBLIC
-    void xbt_cfg_set_as_string(const char* name, const char* val);
-
-/*
-  Set the default value of the cell @a name in @a cfg with the provided value.
-  If it was already set to something (possibly from the command line), do nothing.
- */
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::set_default<int>") XBT_PUBLIC
-    void xbt_cfg_setdefault_int(const char* name, int val);
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::set_default<double>") XBT_PUBLIC
-    void xbt_cfg_setdefault_double(const char* name, double val);
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::set_default<bool>") XBT_PUBLIC
-    void xbt_cfg_setdefault_boolean(const char* name, const char* val);
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::set_default<std::string>") XBT_PUBLIC
-    void xbt_cfg_setdefault_string(const char* name, const char* val);
-
-/** @brief Return if configuration is set by default*/
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::is_default") XBT_PUBLIC
-    int xbt_cfg_is_default_value(const char* name);
 
+XBT_PUBLIC void sg_cfg_set_int(const char* name, int val);
+XBT_PUBLIC void sg_cfg_set_double(const char* name, double val);
+XBT_PUBLIC void sg_cfg_set_boolean(const char* name, const char* val);
+XBT_PUBLIC void sg_cfg_set_string(const char* name, const char* val);
 /* @} */
 
 /** @defgroup XBT_cfg_decl Configuration type declaration and memory management
@@ -106,35 +88,8 @@ XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::is_default") XBT_PUBLIC
 /** @brief Callback types. They get the name of the modified entry, and the position of the changed value */
 typedef void (*xbt_cfg_cb_t)(const char* name);
 
-XBT_ATTRIB_DEPRECATED_v323("Please don't use it") XBT_PUBLIC xbt_cfg_t xbt_cfg_new();
-XBT_ATTRIB_DEPRECATED_v323("Please don't use it") XBT_PUBLIC void xbt_cfg_free(xbt_cfg_t* cfg);
-XBT_ATTRIB_DEPRECATED_v323("Please don't use it") XBT_PUBLIC
-    void xbt_cfg_dump(const char* name, const char* indent, xbt_cfg_t cfg);
-
 /** @} */
 
-/** @defgroup XBT_cfg_register  Registering stuff
- *  @ingroup XBT_config
- *
- *  This how to add new variables to an existing configuration set. Use it to make your code configurable.
- *
- *  @{
- */
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::declare_flag<double>") XBT_PUBLIC
-    void xbt_cfg_register_double(const char* name, double default_val, xbt_cfg_cb_t cb_set, const char* desc);
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::declare_flag<int>") XBT_PUBLIC
-    void xbt_cfg_register_int(const char* name, int default_val, xbt_cfg_cb_t cb_set, const char* desc);
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::declare_flag<std::string>") XBT_PUBLIC
-    void xbt_cfg_register_string(const char* name, const char* default_val, xbt_cfg_cb_t cb_set, const char* desc);
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::declare_flag<bool>") XBT_PUBLIC
-    void xbt_cfg_register_boolean(const char* name, const char* default_val, xbt_cfg_cb_t cb_set, const char* desc);
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::alias") XBT_PUBLIC
-    void xbt_cfg_register_alias(const char* newname, const char* oldname);
-
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::show_aliases") XBT_PUBLIC void xbt_cfg_aliases();
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::help") XBT_PUBLIC void xbt_cfg_help();
-
-/*  @} */
 /** @defgroup XBT_cfg_get Getting the stored values
  *  @ingroup XBT_config
  *
@@ -148,13 +103,16 @@ XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::help") XBT_PUBLIC void x
  *  @{
  */
 
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::get_value<int>") XBT_PUBLIC
+XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::get_value<int> or sg_cfg_get_int") XBT_PUBLIC
     int xbt_cfg_get_int(const char* name);
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::get_value<double>") XBT_PUBLIC
+XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::get_value<double> or sg_cfg_get_double") XBT_PUBLIC
     double xbt_cfg_get_double(const char* name);
-XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::get_value<bool>") XBT_PUBLIC
+XBT_ATTRIB_DEPRECATED_v325("Please use simgrid::config::get_value<bool> or sg_cfg_get_boolean") XBT_PUBLIC
     int xbt_cfg_get_boolean(const char* name);
 
+XBT_PUBLIC int sg_cfg_get_int(const char* name);
+XBT_PUBLIC double sg_cfg_get_double(const char* name);
+XBT_PUBLIC int sg_cfg_get_boolean(const char* name);
 /** @} */
 
 SG_END_DECL()
index b6f60f0..a0406db 100644 (file)
@@ -307,7 +307,5 @@ XBT_PUBLIC void show_aliases();
 XBT_PUBLIC void help();
 }
 }
-XBT_ATTRIB_DEPRECATED_v323("Please use simgrid::config::get_value<std::string>") XBT_PUBLIC std::string
-    xbt_cfg_get_string(const char* name);
 
 #endif
index 2ee6f60..f27f5d3 100644 (file)
@@ -79,7 +79,6 @@ XBT_PUBLIC xbt_dictelm_t xbt_dict_get_elm_or_null(xbt_dict_t dict, const char* k
 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(xbt_dict_t dict, void (*output)(void*));
 XBT_PUBLIC int xbt_dict_is_empty(xbt_dict_t dict);
 
 /** @} */
@@ -159,10 +158,9 @@ xbt_dict_foreach(head, cursor, key, data) {
 }
 @endcode
  */
-#  define xbt_dict_foreach(dict,cursor,key,data)                       \
-    for (cursor=NULL, xbt_dict_cursor_first((dict),&(cursor)) ;        \
-         xbt_dict_cursor_get_or_free(&(cursor),(char**)&(key),(void**)(&data));\
-         xbt_dict_cursor_step(cursor) )
+#define xbt_dict_foreach(dict, cursor, key, data)                                                                      \
+  for ((cursor) = NULL, xbt_dict_cursor_first((dict), &(cursor));                                                      \
+       xbt_dict_cursor_get_or_free(&(cursor), (char**)&(key), (void**)&(data)); xbt_dict_cursor_step(cursor))
 
 /** @} */
 
index 5384cfb..9df2eca 100644 (file)
@@ -92,7 +92,6 @@ XBT_PUBLIC unsigned int xbt_dynar_search(xbt_dynar_t const dynar, void* elem);
 XBT_PUBLIC signed int xbt_dynar_search_or_negative(xbt_dynar_t const dynar, void* const elem);
 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 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);
 
@@ -152,26 +151,23 @@ XBT_PUBLIC void* xbt_dynar_pop_ptr(xbt_dynar_t const dynar);
           (*(type*)xbt_dynar_get_ptr((dynar),(idx)))
 /** @brief Quick setting of scalar content
  *  @hideinitializer */
-#  define xbt_dynar_set_as(dynar,idx,type,val) \
-         (*(type*)xbt_dynar_set_at_ptr((dynar),(idx))) = val
-  /** @brief Quick retrieval of scalar content
-   *  @hideinitializer */
+#define xbt_dynar_set_as(dynar, idx, type, val) (*(type*)xbt_dynar_set_at_ptr((dynar), (idx))) = (val)
+/** @brief Quick retrieval of scalar content
+ *  @hideinitializer */
 #  define xbt_dynar_getlast_as(dynar,type) \
           (*(type*)xbt_dynar_get_ptr((dynar),xbt_dynar_length(dynar)-1))
-  /** @brief Quick retrieval of scalar content
  *  @hideinitializer */
+/** @brief Quick retrieval of scalar content
+ *  @hideinitializer */
 #  define xbt_dynar_getfirst_as(dynar,type) \
           (*(type*)xbt_dynar_get_ptr((dynar),0))
-  /** @brief Quick insertion of scalar content
-   *  @hideinitializer */
-#  define xbt_dynar_insert_at_as(dynar,idx,type,value) \
-          *(type*)xbt_dynar_insert_at_ptr(dynar,idx)=value
-  /** @brief Quick insertion of scalar content
-   *  @hideinitializer */
-#  define xbt_dynar_push_as(dynar,type,value) \
-          *(type*)xbt_dynar_push_ptr(dynar)=value
-  /** @brief Quick removal of scalar content
-   *  @hideinitializer */
+/** @brief Quick insertion of scalar content
+ *  @hideinitializer */
+#define xbt_dynar_insert_at_as(dynar, idx, type, value) *(type*)xbt_dynar_insert_at_ptr((dynar), (idx)) = (value)
+/** @brief Quick insertion of scalar content
+ *  @hideinitializer */
+#define xbt_dynar_push_as(dynar, type, value) *(type*)xbt_dynar_push_ptr(dynar) = (value)
+/** @brief Quick removal of scalar content
+ *  @hideinitializer */
 #  define xbt_dynar_pop_as(dynar,type) \
            (*(type*)xbt_dynar_pop_ptr(dynar))
 
@@ -210,11 +206,8 @@ static inline int _xbt_dynar_cursor_get(const xbt_dynar_t dynar, unsigned int id
   if (!dynar) /* iterating over a NULL dynar is a no-op */
     return 0;
 
-  if (idx >= dynar->used) {
-    //XBT_DEBUG("Cursor on %p already on last elem", (void *) dynar);
+  if (idx >= dynar->used)
     return 0;
-  }
-  //  XBT_DEBUG("Cash out cursor on %p at %u", (void *) dynar, *idx);
 
   memcpy(dst, ((char *) dynar->data) + idx * dynar->elmsize, dynar->elmsize);
 
@@ -241,35 +234,20 @@ xbt_dynar_foreach (dyn,cpt,str) {
  * Note that underneath, that's a simple for loop with no real black  magic involved. It's perfectly safe to interrupt
  * a foreach with a break or a return statement.
  */
-#define xbt_dynar_foreach(_dynar,_cursor,_data) \
-       for ( (_cursor) = 0      ; \
-             _xbt_dynar_cursor_get(_dynar,_cursor,&_data) ; \
-             (_cursor)++         )
+#define xbt_dynar_foreach(_dynar, _cursor, _data)                                                                      \
+  for ((_cursor) = 0; _xbt_dynar_cursor_get((_dynar), (_cursor), &(_data)); (_cursor)++)
 
 #ifndef __cplusplus
-#define xbt_dynar_foreach_ptr(_dynar,_cursor,_ptr) \
-       for ((_cursor) = 0       ; \
-            (_ptr = _cursor < _dynar->used ? xbt_dynar_get_ptr(_dynar,_cursor) : NULL) ; \
-            (_cursor)++         )
+#define xbt_dynar_foreach_ptr(_dynar, _cursor, _ptr)                                                                   \
+  for ((_cursor) = 0; ((_ptr) = (_cursor) < (_dynar)->used ? xbt_dynar_get_ptr((_dynar), (_cursor)) : NULL);           \
+       (_cursor)++)
 #else
-#define xbt_dynar_foreach_ptr(_dynar,_cursor,_ptr) \
-       for ((_cursor) = 0       ; \
-            (_ptr = _cursor < _dynar->used ? (decltype(_ptr)) xbt_dynar_get_ptr(_dynar,_cursor) : NULL) ; \
-            (_cursor)++         )
+#define xbt_dynar_foreach_ptr(_dynar, _cursor, _ptr)                                                                   \
+  for ((_cursor) = 0;                                                                                                  \
+       ((_ptr) = (_cursor) < (_dynar)->used ? (decltype(_ptr))xbt_dynar_get_ptr((_dynar), (_cursor)) : NULL);          \
+       (_cursor)++)
 #endif
 /** @} */
 SG_END_DECL()
 
-#ifdef __cplusplus
-namespace simgrid {
-namespace xbt {
-/** Dynar of `T*` which `delete` its values */
-template <class T> inline xbt_dynar_t newDeleteDynar()
-{
-  return xbt_dynar_new(sizeof(T*), [](void* p) { delete *(T**)p; });
-}
-}
-}
-#endif
-
 #endif /* XBT_DYNAR_H */
index c37ff47..dc31878 100644 (file)
  *  exactly play nicely together.
  */
 
-/** Categories of errors
- *
- *  This very similar to std::error_catgory and should probably be replaced
- *  by this in the future.
- *
- *  @ingroup XBT_ex_c
- */
-typedef enum {
-  unknown_error = 0,            /**< unknown error */
-  arg_error,                    /**< Invalid argument */
-  bound_error,                  /**< Out of bounds argument */
-  mismatch_error,               /**< The provided ID does not match */
-  not_found_error,              /**< The searched element was not found */
-  system_error,                 /**< a syscall did fail */
-  network_error,                /**< error while sending/receiving data */
-  timeout_error,                /**< not quick enough, dude */
-  cancel_error,                 /**< an action was canceled */
-  thread_error,                 /**< error while [un]locking */
-  host_error,                   /**< host failed */
-  tracing_error,                /**< error during the simulation tracing */
-  io_error,                     /**< disk or file error */
-  vm_error                      /**< vm  error */
-} xbt_errcat_t;
-
 SG_BEGIN_DECL()
 
-/** Get the name of a category
- *  @ingroup XBT_ex_c
- */
-XBT_PUBLIC const char* xbt_ex_catname(xbt_errcat_t cat);
-
 /** Helper function used to throw exceptions in C */
-XBT_ATTRIB_NORETURN 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_PUBLIC void _xbt_throw(char* message, int value, const char* file, int line, const char* func);
 
 /** Builds and throws an exception
  *  @ingroup XBT_ex_c
  *  @hideinitializer
  */
-#define THROW(c, v)             { _xbt_throw(NULL, (xbt_errcat_t) c, v, __FILE__, __LINE__, __func__); }
+#define THROW(v) _xbt_throw(NULL, (v), __FILE__, __LINE__, __func__)
 
 /** Builds and throws an exception with a printf-like formatted message
  *  @ingroup XBT_ex_c
  *  @hideinitializer
  */
-#define THROWF(c, v, ...)       _xbt_throw(bprintf(__VA_ARGS__), (xbt_errcat_t) c, v, __FILE__, __LINE__, __func__)
+#define THROWF(v, ...) _xbt_throw(bprintf(__VA_ARGS__), (v), __FILE__, __LINE__, __func__)
 
 XBT_ATTRIB_NORETURN void xbt_throw_impossible(const char* file, int line, const char* func);
 /** Throw an exception because something impossible happened
index 9ca66f8..386830b 100644 (file)
@@ -281,15 +281,6 @@ template <class F, class... Args> auto make_task(F code, Args... args) -> Task<d
   return Task<decltype(code(std::move(args)...))()>(std::move(task));
 }
 
-// Deprecated
-template <class F, class... Args>
-XBT_ATTRIB_DEPRECATED_v323("Please use make_task()") auto makeTask(F code, Args... args)
-    -> Task<decltype(code(std::move(args)...))()>
-{
-  TaskImpl<F, Args...> task(std::move(code), std::make_tuple(std::move(args)...));
-  return Task<decltype(code(std::move(args)...))()>(std::move(task));
-}
-
 } // namespace xbt
 } // namespace simgrid
 #endif
index 8422e5f..4d2842f 100644 (file)
@@ -12,6 +12,7 @@
 #include <boost/variant.hpp>
 #include <exception>
 #include <functional>
+#include <future> // std::future_error
 #include <stdexcept>
 #include <type_traits>
 #include <utility>
@@ -66,7 +67,7 @@ public:
         break;
       }
       default:
-        throw std::logic_error("Invalid result");
+        throw std::future_error(std::future_errc::no_state);
     }
   }
 private:
@@ -125,19 +126,8 @@ template <class R, class F> auto fulfill_promise(R& promise, F&& code) -> declty
     promise.set_exception(std::current_exception());
   }
 }
-template <class R, class F>
-XBT_ATTRIB_DEPRECATED_v323("Please use xbt::fulfill_promise()") auto fulfillPromise(R& promise, F&& code)
-    -> decltype(promise.set_value(code()))
-{
-  try {
-    promise.set_value(std::forward<F>(code)());
-  }
-  catch(...) {
-    promise.set_exception(std::current_exception());
-  }
-}
 
-template <class P, class F> auto fulfill_promise(P& promise, F&& code) -> decltype(promise.set_value())
+template <class R, class F> auto fulfill_promise(R& promise, F&& code) -> decltype(promise.set_value())
 {
   try {
     std::forward<F>(code)();
@@ -146,18 +136,6 @@ template <class P, class F> auto fulfill_promise(P& promise, F&& code) -> declty
     promise.set_exception(std::current_exception());
   }
 }
-template <class P, class F>
-XBT_ATTRIB_DEPRECATED_v323("Please use xbt::fulfill_promise()") auto fulfillPromise(P& promise, F&& code)
-    -> decltype(promise.set_value())
-{
-  try {
-    std::forward<F>(code)();
-    promise.set_value();
-  }
-  catch(...) {
-    promise.set_exception(std::current_exception());
-  }
-}
 
 /** Set a promise/result from a future/result
  *
index 50eeb68..98e7661 100644 (file)
@@ -23,7 +23,6 @@ typedef struct xbt_graph *xbt_graph_t;
 
 /* Node structure */
 /* Be careful of what you do with this structure */
-/* typedef struct xbt_node *xbt_node_t; */
 typedef struct xbt_node {
   xbt_dynar_t out;
   xbt_dynar_t in;               /* not used when the graph is directed */
@@ -34,7 +33,6 @@ typedef struct xbt_node {
 
 /* edge structure */
 /* Be careful of what you do with this structure */
-/* typedef struct xbt_edge *xbt_edge_t; */
 typedef struct xbt_edge {
   xbt_node_t src;
   xbt_node_t dst;
@@ -43,7 +41,6 @@ typedef struct xbt_edge {
 
 /* Graph structure */
 /* Be careful of what you do with this structure */
-/* typedef struct xbt_graph *xbt_graph_t; */
 typedef struct xbt_graph {
   xbt_dynar_t nodes;
   xbt_dynar_t edges;
index a6df123..1df2b5c 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <stdarg.h>
 #include <stddef.h> /* NULL */
+#include <stdio.h>  /* FILE */
 #include <xbt/misc.h>
 SG_BEGIN_DECL()
 /**@brief Log priorities
@@ -83,10 +84,8 @@ typedef enum {
 #endif                          /* !defined(NLOG) */
 
 /* Transforms a category name to a global variable name. */
-#define _XBT_LOGV(cat) _XBT_LOG_CONCAT(_simgrid_log_category__, cat)
-#define _XBT_LOGV_CTOR(cat) _XBT_LOG_CONCAT2(_XBT_LOGV(cat), __constructor__)
-#define _XBT_LOG_CONCAT(x, y) x ## y
-#define _XBT_LOG_CONCAT2(x, y) _XBT_LOG_CONCAT(x, y)
+#define _XBT_LOGV(cat) _XBT_CONCAT(_simgrid_log_category__, cat)
+#define _XBT_LOGV_CTOR(cat) _XBT_CONCAT2(_XBT_LOGV(cat), __constructor__)
 
 /* The root of the category hierarchy. */
 #define XBT_LOG_ROOT_CAT   root
@@ -117,8 +116,8 @@ typedef enum {
       &_XBT_LOGV(parent),                                                                                              \
       NULL /* firstChild */,                                                                                           \
       NULL /* nextSibling */,                                                                                          \
-      #catName,                                                                                                        \
-      desc,                                                                                                            \
+      _XBT_STRINGIFY(catName),                                                                                         \
+      (desc),                                                                                                          \
       0 /*initialized */,                                                                                              \
       xbt_log_priority_uninitialized /* threshold */,                                                                  \
       1 /* isThreshInherited */,                                                                                       \
@@ -136,9 +135,9 @@ typedef enum {
  *
  * Defines a new subcategory of the parent.
  */
-#define XBT_LOG_NEW_SUBCATEGORY(catName, parent, desc)    \
-  XBT_LOG_EXTERNAL_CATEGORY(parent);                      \
-  XBT_LOG_NEW_SUBCATEGORY_helper(catName, parent, desc)
+#define XBT_LOG_NEW_SUBCATEGORY(catName, parent, desc)                                                                 \
+  XBT_LOG_EXTERNAL_CATEGORY(parent);                                                                                   \
+  XBT_LOG_NEW_SUBCATEGORY_helper(catName, parent, (desc))
 
 /**
  * @ingroup XBT_log
@@ -148,8 +147,7 @@ typedef enum {
  *
  * Creates a new subcategory of the root category.
  */
-# define XBT_LOG_NEW_CATEGORY(catName,desc)  \
-   XBT_LOG_NEW_SUBCATEGORY_helper(catName, XBT_LOG_ROOT_CAT, desc)
+#define XBT_LOG_NEW_CATEGORY(catName, desc) XBT_LOG_NEW_SUBCATEGORY_helper(catName, XBT_LOG_ROOT_CAT, (desc))
 
 /**
  * @ingroup XBT_log
@@ -175,9 +173,9 @@ typedef enum {
  * Creates a new subcategory of the root category and makes it the default (used by macros that don't explicitly
  * specify a category).
  */
-# define XBT_LOG_NEW_DEFAULT_CATEGORY(cname,desc)        \
-    XBT_LOG_NEW_CATEGORY(cname,desc);                   \
-    XBT_LOG_DEFAULT_CATEGORY(cname)
+#define XBT_LOG_NEW_DEFAULT_CATEGORY(cname, desc)                                                                      \
+  XBT_LOG_NEW_CATEGORY(cname, (desc));                                                                                 \
+  XBT_LOG_DEFAULT_CATEGORY(cname)
 
 /**
  * @ingroup XBT_log
@@ -189,9 +187,9 @@ typedef enum {
  * Creates a new subcategory of the parent category and makes it the default
  * (used by macros that don't explicitly specify a category).
  */
-#define XBT_LOG_NEW_DEFAULT_SUBCATEGORY(cname, parent, desc) \
-    XBT_LOG_NEW_SUBCATEGORY(cname, parent, desc);            \
-    XBT_LOG_DEFAULT_CATEGORY(cname)
+#define XBT_LOG_NEW_DEFAULT_SUBCATEGORY(cname, parent, desc)                                                           \
+  XBT_LOG_NEW_SUBCATEGORY(cname, parent, (desc));                                                                      \
+  XBT_LOG_DEFAULT_CATEGORY(cname)
 
 /**
  * @ingroup XBT_log
@@ -299,6 +297,7 @@ XBT_PUBLIC void xbt_log_additivity_set(xbt_log_category_t cat, int additivity);
  */
 XBT_PUBLIC xbt_log_layout_t xbt_log_layout_simple_new(const char* arg);
 XBT_PUBLIC xbt_log_layout_t xbt_log_layout_format_new(const char* arg);
+XBT_PUBLIC xbt_log_appender_t xbt_log_appender_stream(FILE* f);
 XBT_PUBLIC xbt_log_appender_t xbt_log_appender_file_new(const char* arg);
 XBT_PUBLIC xbt_log_appender_t xbt_log_appender2_file_new(const char* arg, int roll);
 
@@ -336,8 +335,7 @@ extern xbt_log_layout_t xbt_log_default_layout;
  * If you have expensive expressions that are computed outside of the log command and used only within it, you should
  * make its evaluation conditional using this macro.
  */
-#define XBT_LOG_ISENABLED(catName, priority) \
-            _XBT_LOG_ISENABLEDV(_XBT_LOGV(catName), priority)
+#define XBT_LOG_ISENABLED(catName, priority) _XBT_LOG_ISENABLEDV(_XBT_LOGV(catName), (priority))
 
 /*
  * Helper function that implements XBT_LOG_ISENABLED.
@@ -346,10 +344,9 @@ extern xbt_log_layout_t xbt_log_default_layout;
  * First part is a compile-time constant.
  * Call to xbt_log_cat_init only happens once.
  */
-#define _XBT_LOG_ISENABLEDV(catv, priority)                  \
-       (priority >= XBT_LOG_STATIC_THRESHOLD                 \
-        && ((catv).initialized || _xbt_log_cat_init(&(catv), priority)) \
-        && priority >= (catv).threshold)
+#define _XBT_LOG_ISENABLEDV(catv, priority)                                                                            \
+  ((priority) >= XBT_LOG_STATIC_THRESHOLD && ((catv).initialized || _xbt_log_cat_init(&(catv), (priority))) &&         \
+   (priority) >= (catv).threshold)
 
 /*
  * Internal Macros
@@ -374,34 +371,21 @@ extern xbt_log_layout_t xbt_log_default_layout;
 # define XBT_LOG(...) XBT_CLOG(0, __VA_ARGS__)
 #else
 
-// This code is duplicated to remove one level of indirection, working around a MSVC bug
-// See: http://stackoverflow.com/questions/9183993/msvc-variadic-macro-expansion
-
-# define XBT_CLOG(category, prio, ...) \
-  do {                                                                  \
-    if (_XBT_LOG_ISENABLEDV((category), prio)) {                        \
-      s_xbt_log_event_t _log_ev;                                        \
-      _log_ev.cat = &(category);                                        \
-      _log_ev.priority = (prio);                                        \
-      _log_ev.fileName = __FILE__;                                      \
-      _log_ev.functionName = __func__;                             \
-      _log_ev.lineNum = __LINE__;                                       \
-      _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-    }                                                                   \
-  }  while (0)
-
-# define XBT_LOG(prio,...) \
-  do {                                                                  \
-    if (_XBT_LOG_ISENABLEDV((*_simgrid_log_category__default), prio)) { \
-      s_xbt_log_event_t _log_ev;                                        \
-      _log_ev.cat = _simgrid_log_category__default;                     \
-      _log_ev.priority = (prio);                                        \
-      _log_ev.fileName = __FILE__;                                      \
-      _log_ev.functionName = __func__;                             \
-      _log_ev.lineNum = __LINE__;                                       \
-      _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-    }                                                                   \
-  }  while (0)
+#define XBT_CLOG(category, prio, ...)                                                                                  \
+  do {                                                                                                                 \
+    if (_XBT_LOG_ISENABLEDV((category), (prio))) {                                                                     \
+      s_xbt_log_event_t _log_ev;                                                                                       \
+      _log_ev.cat          = &(category);                                                                              \
+      _log_ev.priority     = (prio);                                                                                   \
+      _log_ev.fileName     = __FILE__;                                                                                 \
+      _log_ev.functionName = __func__;                                                                                 \
+      _log_ev.lineNum      = __LINE__;                                                                                 \
+      _xbt_log_event_log(&_log_ev, __VA_ARGS__);                                                                       \
+    }                                                                                                                  \
+  } while (0)
+
+#define XBT_LOG(prio, ...) XBT_CLOG(*_simgrid_log_category__default, (prio), __VA_ARGS__)
+
 #endif
 
 /** @ingroup XBT_log
@@ -410,221 +394,79 @@ extern xbt_log_layout_t xbt_log_default_layout;
  * @param ... the format string and its arguments
  *  @brief Log an event at the DEBUG priority on the specified category with these args.
  */
-#define XBT_CDEBUG(categ, ...) \
-      do {                                                                  \
-        if (XBT_LOG_ISENABLED (categ, xbt_log_priority_debug)) {            \
-          s_xbt_log_event_t _log_ev;                                        \
-          _log_ev.cat = &(_XBT_LOGV(categ));                                \
-          _log_ev.priority = xbt_log_priority_debug;                        \
-          _log_ev.fileName = __FILE__;                                      \
-          _log_ev.functionName = __func__;                             \
-          _log_ev.lineNum = __LINE__;                                       \
-          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-        }                                                                   \
-      }  while (0)
+#define XBT_CDEBUG(categ, ...) XBT_CLOG(_XBT_LOGV(categ), xbt_log_priority_debug, __VA_ARGS__)
 
 /** @ingroup XBT_log
  *  @hideinitializer
  *  @brief Log an event at the VERB priority on the specified category with these args.
  */
-#define XBT_CVERB(categ, ...)  \
-      do {                                                                  \
-        if (XBT_LOG_ISENABLED (categ, xbt_log_priority_verbose)) {          \
-          s_xbt_log_event_t _log_ev;                                        \
-          _log_ev.cat = &(_XBT_LOGV(categ));                                \
-          _log_ev.priority = xbt_log_priority_verbose;                      \
-          _log_ev.fileName = __FILE__;                                      \
-          _log_ev.functionName = __func__;                             \
-          _log_ev.lineNum = __LINE__;                                       \
-          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-        }                                                                   \
-      }  while (0)
+#define XBT_CVERB(categ, ...) XBT_CLOG(_XBT_LOGV(categ), xbt_log_priority_verbose, __VA_ARGS__)
 
 /** @ingroup XBT_log
  *  @hideinitializer
  *  @brief Log an event at the INFO priority on the specified category with these args.
  */
-#define XBT_CINFO(categ, ...) \
-      do {                                                                  \
-        if (XBT_LOG_ISENABLED (categ, xbt_log_priority_info)) {             \
-          s_xbt_log_event_t _log_ev;                                        \
-          _log_ev.cat = &(_XBT_LOGV(categ));                                \
-          _log_ev.priority = xbt_log_priority_info;                         \
-          _log_ev.fileName = __FILE__;                                      \
-          _log_ev.functionName = __func__;                             \
-          _log_ev.lineNum = __LINE__;                                       \
-          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-        }                                                                   \
-      }  while (0)
-
+#define XBT_CINFO(categ, ...) XBT_CLOG(_XBT_LOGV(categ), xbt_log_priority_info, __VA_ARGS__)
 
 /** @ingroup XBT_log
  *  @hideinitializer
  *  @brief Log an event at the WARN priority on the specified category with these args.
  */
-#define XBT_CWARN(categ, ...) \
-      do {                                                                  \
-        if (XBT_LOG_ISENABLED (categ, xbt_log_priority_warning)) {          \
-          s_xbt_log_event_t _log_ev;                                        \
-          _log_ev.cat = &(_XBT_LOGV(categ));                                \
-          _log_ev.priority = xbt_log_priority_warning;                      \
-          _log_ev.fileName = __FILE__;                                      \
-          _log_ev.functionName = __func__;                             \
-          _log_ev.lineNum = __LINE__;                                       \
-          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-        }                                                                   \
-      }  while (0)
-
+#define XBT_CWARN(categ, ...) XBT_CLOG(_XBT_LOGV(categ), xbt_log_priority_warning, __VA_ARGS__)
 
 /** @ingroup XBT_log
  *  @hideinitializer
  *  @brief Log an event at the ERROR priority on the specified category with these args.
  */
-#define XBT_CERROR(categ, ...) \
-      do {                                                                  \
-        if (XBT_LOG_ISENABLED (categ, xbt_log_priority_error)) {            \
-          s_xbt_log_event_t _log_ev;                                        \
-          _log_ev.cat = &(_XBT_LOGV(categ));                                \
-          _log_ev.priority = xbt_log_priority_error;                        \
-          _log_ev.fileName = __FILE__;                                      \
-          _log_ev.functionName = __func__;                             \
-          _log_ev.lineNum = __LINE__;                                       \
-          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-        }                                                                   \
-      }  while (0)
+#define XBT_CERROR(categ, ...) XBT_CLOG(_XBT_LOGV(categ), xbt_log_priority_error, __VA_ARGS__)
 
 /** @ingroup XBT_log
  *  @hideinitializer
- *  @brief Log an event at the CRITICAL priority on the specified category with these args (CCRITICALn exists for any n<10).
- */
-#define XBT_CCRITICAL(categ, ...) \
-      do {                                                                  \
-        if (XBT_LOG_ISENABLED (categ, xbt_log_priority_critical)) {         \
-          s_xbt_log_event_t _log_ev;                                        \
-          _log_ev.cat = &(_XBT_LOGV(categ));                                \
-          _log_ev.priority = xbt_log_priority_critical;                     \
-          _log_ev.fileName = __FILE__;                                      \
-          _log_ev.functionName = __func__;                             \
-          _log_ev.lineNum = __LINE__;                                       \
-          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-        }                                                                   \
-      }  while (0)
+ *  @brief Log an event at the CRITICAL priority on the specified category with these args.
+ */
+#define XBT_CCRITICAL(categ, ...) XBT_CLOG(_XBT_LOGV(categ), xbt_log_priority_critical, __VA_ARGS__)
 
 /** @ingroup XBT_log
  *  @hideinitializer
  *  @param ... the format string and its arguments
  *  @brief Log an event at the DEBUG priority on the default category with these args.
  */
-#define XBT_DEBUG(...) \
-      do {                                                                  \
-        if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default,            \
-                            xbt_log_priority_debug)) {                  \
-          s_xbt_log_event_t _log_ev;                                        \
-          _log_ev.cat = _simgrid_log_category__default;                     \
-          _log_ev.priority = xbt_log_priority_debug;                        \
-          _log_ev.fileName = __FILE__;                                      \
-          _log_ev.functionName = __func__;                              \
-          _log_ev.lineNum = __LINE__;                                       \
-          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-        }                                                                   \
-      }  while (0)
+#define XBT_DEBUG(...) XBT_LOG(xbt_log_priority_debug, __VA_ARGS__)
 
 /** @ingroup XBT_log
  *  @hideinitializer
  *  @brief Log an event at the VERB priority on the default category with these args.
  */
-#define XBT_VERB(...) \
-      do {                                                                  \
-        if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default,            \
-                            xbt_log_priority_verbose)) {                \
-          s_xbt_log_event_t _log_ev;                                        \
-          _log_ev.cat = _simgrid_log_category__default;                     \
-          _log_ev.priority = xbt_log_priority_verbose;                      \
-          _log_ev.fileName = __FILE__;                                      \
-          _log_ev.functionName = __func__;                             \
-          _log_ev.lineNum = __LINE__;                                       \
-          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-        }                                                                   \
-      }  while (0)
+#define XBT_VERB(...) XBT_LOG(xbt_log_priority_verbose, __VA_ARGS__)
 
 /** @ingroup XBT_log
  *  @hideinitializer
  *  @brief Log an event at the INFO priority on the default category with these args.
  */
-#define XBT_INFO(...) \
-      do {                                                                  \
-        if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default,            \
-                            xbt_log_priority_info)) {                   \
-          s_xbt_log_event_t _log_ev;                                        \
-          _log_ev.cat = _simgrid_log_category__default;                     \
-          _log_ev.priority = xbt_log_priority_info;                         \
-          _log_ev.fileName = __FILE__;                                      \
-          _log_ev.functionName = __func__;                             \
-          _log_ev.lineNum = __LINE__;                                       \
-          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-        }                                                                   \
-      }  while (0)
+#define XBT_INFO(...) XBT_LOG(xbt_log_priority_info, __VA_ARGS__)
 
 /** @ingroup XBT_log
  *  @hideinitializer
  *  @brief Log an event at the WARN priority on the default category with these args.
  */
-#define XBT_WARN(...) \
-      do {                                                                  \
-        if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default,            \
-                            xbt_log_priority_warning)) {                \
-          s_xbt_log_event_t _log_ev;                                        \
-          _log_ev.cat = _simgrid_log_category__default;                     \
-          _log_ev.priority = xbt_log_priority_warning;                      \
-          _log_ev.fileName = __FILE__;                                      \
-          _log_ev.functionName = __func__;                             \
-          _log_ev.lineNum = __LINE__;                                       \
-          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-        }                                                                   \
-      }  while (0)
+#define XBT_WARN(...) XBT_LOG(xbt_log_priority_warning, __VA_ARGS__)
 
 /** @ingroup XBT_log
  *  @hideinitializer
  *  @brief Log an event at the ERROR priority on the default category with these args.
  */
-#define XBT_ERROR(...) \
-      do {                                                                  \
-        if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default,            \
-                            xbt_log_priority_error)) {                  \
-          s_xbt_log_event_t _log_ev;                                        \
-          _log_ev.cat = _simgrid_log_category__default;                     \
-          _log_ev.priority = xbt_log_priority_error;                        \
-          _log_ev.fileName = __FILE__;                                      \
-          _log_ev.functionName = __func__;                             \
-          _log_ev.lineNum = __LINE__;                                       \
-          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-        }                                                                   \
-      }  while (0)
+#define XBT_ERROR(...) XBT_LOG(xbt_log_priority_error, __VA_ARGS__)
 
 /** @ingroup XBT_log
  *  @hideinitializer
  *  @brief Log an event at the CRITICAL priority on the default category with these args.
  */
-#define XBT_CRITICAL(...) \
-      do {                                                                  \
-        if (_XBT_LOG_ISENABLEDV(*_simgrid_log_category__default,            \
-                            xbt_log_priority_critical)) {               \
-          s_xbt_log_event_t _log_ev;                                        \
-          _log_ev.cat = _simgrid_log_category__default;                     \
-          _log_ev.priority = xbt_log_priority_critical;                     \
-          _log_ev.fileName = __FILE__;                                      \
-          _log_ev.functionName = __func__;                             \
-          _log_ev.lineNum = __LINE__;                                       \
-          _xbt_log_event_log(&_log_ev, __VA_ARGS__);                        \
-        }                                                                   \
-      }  while (0)
+#define XBT_CRITICAL(...) XBT_LOG(xbt_log_priority_critical, __VA_ARGS__)
 
 #define _XBT_IN_OUT(...) \
   _XBT_IF_ONE_ARG(_XBT_IN_OUT_ARG1, _XBT_IN_OUT_ARGN, __VA_ARGS__)(__VA_ARGS__)
-#define _XBT_IN_OUT_ARG1(fmt) \
-  XBT_LOG(xbt_log_priority_trace, fmt, __func__)
-#define _XBT_IN_OUT_ARGN(fmt, ...) \
-  XBT_LOG(xbt_log_priority_trace, fmt, __func__, __VA_ARGS__)
+#define _XBT_IN_OUT_ARG1(fmt) XBT_LOG(xbt_log_priority_trace, (fmt), __func__)
+#define _XBT_IN_OUT_ARGN(fmt, ...) XBT_LOG(xbt_log_priority_trace, (fmt), __func__, __VA_ARGS__)
 
 /** @ingroup XBT_log
  *  @hideinitializer
@@ -644,5 +486,11 @@ extern xbt_log_layout_t xbt_log_default_layout;
  */
 #define XBT_HERE(...) XBT_LOG(xbt_log_priority_trace, "-- was here" __VA_ARGS__)
 
+/** @ingroup XBT_log
+ *  @hideinitializer
+ *  @brief Log help messages through category xbt.xbt_help.
+ */
+#define XBT_HELP(...) XBT_CINFO(xbt_help, __VA_ARGS__)
+
 SG_END_DECL()
 #endif                          /* ! _XBT_LOG_H_ */
index d1d9f04..3f74fb5 100644 (file)
@@ -19,9 +19,5 @@ namespace xbt {
 XBT_PUBLIC void log_exception(e_xbt_log_priority_t priority, const char* context, std::exception const& exception);
 
 XBT_PUBLIC void install_exception_handler();
-
-// deprecated
-XBT_ATTRIB_DEPRECATED_v323("xbt::log_exception()") XBT_PUBLIC void logException(e_xbt_log_priority_t priority, const char* context, std::exception const& exception);
-XBT_ATTRIB_DEPRECATED_v323("xbt::install_exception_handler()") XBT_PUBLIC void installExceptionHandler();
 }
 }
index fde48b9..872efe1 100644 (file)
@@ -7,6 +7,8 @@
 #ifndef SIMGRID_XBT_RANGE_HPP
 #define SIMGRID_XBT_RANGE_HPP
 
+#include <algorithm>
+
 namespace simgrid {
 namespace xbt {
 
index c81b95b..a5e6544 100644 (file)
@@ -7,8 +7,8 @@
 #define SIMGRID_XBT_SIGNAL_HPP
 
 #include <functional>
+#include <map>
 #include <utility>
-#include <vector>
 
 namespace simgrid {
 namespace xbt {
@@ -23,25 +23,24 @@ namespace xbt {
   */
   template<class R, class... P>
   class signal<R(P...)> {
-  private:
     typedef std::function<R(P...)> callback_type;
-    std::vector<callback_type> handlers_;
+    std::map<unsigned int, callback_type> handlers_;
+    unsigned int callback_sequence_id = 0;
+
   public:
-    template<class U>
-    void connect(U slot)
+    template <class U> unsigned int connect(U slot)
     {
-      handlers_.push_back(std::move(slot));
+      handlers_.insert({callback_sequence_id, std::move(slot)});
+      return callback_sequence_id++;
     }
     R operator()(P... args) const
     {
       for (auto const& handler : handlers_)
-        handler(args...);
+        handler.second(args...);
     }
+    void disconnect(unsigned int id) { handlers_.erase(id); }
     void disconnect_slots() { handlers_.clear(); }
     int get_slot_count() { return handlers_.size(); }
-    // deprecated
-    XBT_ATTRIB_DEPRECATED_v323("Please use xbt::disconnect_slots)") void disconnectSlots() { disconnect_slots(); }
-    XBT_ATTRIB_DEPRECATED_v323("Please use xbt::get_slot_count)") int getSlotsAmount() { return get_slot_count(); }
   };
 
 }
index 5b8ab7d..46063e3 100644 (file)
@@ -54,8 +54,9 @@ struct string_data {
  *  * the [C++11-conforming implementation](https://gcc.gnu.org/gcc-5/changes.html)
  *    does not use refcouting/COW but has a small string optimization.
  */
-class XBT_PUBLIC string : private string_data {
+class XBT_PUBLIC string {
   static char NUL;
+  string_data str;
 
 public:
   // Types
@@ -68,21 +69,21 @@ public:
   // Dtor
   ~string()
   {
-    if (string_data::data != &NUL)
-      delete[] string_data::data;
+    if (str.data != &NUL)
+      delete[] str.data;
   }
 
   // Ctors
   string(const char* s, size_t size)
   {
     if (size == 0) {
-      string_data::len = 0;
-      string_data::data = &NUL;
+      str.len  = 0;
+      str.data = &NUL;
     } else {
-      string_data::len = size;
-      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';
+      str.len  = size;
+      str.data = new char[str.len + 1];
+      std::copy_n(s, str.len, str.data);
+      str.data[str.len] = '\0';
     }
   }
   string() : string(&NUL, 0) {}
@@ -90,26 +91,26 @@ public:
   string(string const& s) : string(s.c_str(), s.size()) {}
   string(string&& s)
   {
-    string_data::len = s.string_data::len;
-    string_data::data = s.string_data::data;
-    s.string_data::len = 0;
-    s.string_data::data = &NUL;
+    str.len    = s.str.len;
+    str.data   = s.str.data;
+    s.str.len  = 0;
+    s.str.data = &NUL;
   }
   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) {
-      delete[] string_data::data;
-      string_data::data = nullptr;
-      string_data::len = 0;
+    if (str.data != &NUL) {
+      delete[] str.data;
+      str.data = nullptr;
+      str.len  = 0;
     }
     if (size != 0) {
-      string_data::len = size;
-      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';
+      str.len  = size;
+      str.data = new char[str.len + 1];
+      std::copy_n(s, str.len, str.data);
+      str.data[str.len] = '\0';
     }
   }
 
@@ -132,16 +133,16 @@ public:
   }
 
   // Capacity
-  size_t size() const   { return len; }
-  size_t length() const { return len; }
-  bool empty() const    { return len != 0; }
+  size_t size() const { return str.len; }
+  size_t length() const { return str.len; }
+  bool empty() const { return str.len != 0; }
   void shrink_to_fit() { /* Being there, but doing nothing */}
 
   // Element access
-  char* data()              { return string_data::data; }
-  const char* data()  const { return string_data::data; }
-  char* c_str()             { return string_data::data; }
-  const char* c_str() const { return string_data::data; };
+  char* data() { return str.data; }
+  const char* data() const { return str.data; }
+  char* c_str() { return str.data; }
+  const char* c_str() const { return str.data; };
   reference at(size_type i)
   {
     if (i >= size())
@@ -163,7 +164,7 @@ public:
     return data()[i];
   }
   // Conversion
-  static string_data& to_string_data(string& s) { return s; }
+  static string_data& to_string_data(string& s) { return s.str; }
   operator std::string() const { return std::string(this->c_str(), this->size()); }
 
   // Iterators
@@ -178,8 +179,8 @@ public:
   // Operations
   void clear()
   {
-    string_data::len = 0;
-    string_data::data = &NUL;
+    str.len  = 0;
+    str.data = &NUL;
   }
 
   bool equals(const char* data, std::size_t len) const
index 96d7556..c57b925 100644 (file)
@@ -34,10 +34,10 @@ typedef struct s_smx_mutex_* xbt_mutex_t;
 #endif
 
 /** @brief Creates a new mutex variable */
-XBT_PUBLIC xbt_mutex_t xbt_mutex_init(void);
+XBT_ATTRIB_DEPRECATED_v327("Please use sg_mutex_init") XBT_PUBLIC xbt_mutex_t xbt_mutex_init(void);
 
 /** @brief Blocks onto the given mutex variable */
-XBT_PUBLIC void xbt_mutex_acquire(xbt_mutex_t mutex);
+XBT_ATTRIB_DEPRECATED_v327("Please use sg_mutex_lock") XBT_PUBLIC void xbt_mutex_acquire(xbt_mutex_t mutex);
 
 /** @brief Tries to block onto the given mutex variable
  * Tries to lock a mutex, return 1 if the mutex is unlocked, else 0.
@@ -45,13 +45,13 @@ XBT_PUBLIC void xbt_mutex_acquire(xbt_mutex_t mutex);
  * @param mutex The mutex
  * @return 1 - mutex free, 0 - mutex used
  */
-XBT_PUBLIC int xbt_mutex_try_acquire(xbt_mutex_t mutex);
+XBT_ATTRIB_DEPRECATED_v327("Please use sg_mutex_try_lock") XBT_PUBLIC int xbt_mutex_try_acquire(xbt_mutex_t mutex);
 
 /** @brief Releases the given mutex variable */
-XBT_PUBLIC void xbt_mutex_release(xbt_mutex_t mutex);
+XBT_ATTRIB_DEPRECATED_v327("Please use sg_mutex_unlock") XBT_PUBLIC void xbt_mutex_release(xbt_mutex_t mutex);
 
 /** @brief Destroyes the given mutex variable */
-XBT_PUBLIC void xbt_mutex_destroy(xbt_mutex_t mutex);
+XBT_ATTRIB_DEPRECATED_v327("Please use sg_mutex_destroy") XBT_PUBLIC void xbt_mutex_destroy(xbt_mutex_t mutex);
 
 /** @brief Thread condition data type (opaque object)
  *  @hideinitializer
@@ -63,19 +63,20 @@ typedef struct s_smx_cond_* xbt_cond_t;
 #endif
 
 /** @brief Creates a condition variable */
-XBT_PUBLIC xbt_cond_t xbt_cond_init(void);
+XBT_ATTRIB_DEPRECATED_v327("Please use sg_cond_init") XBT_PUBLIC xbt_cond_t xbt_cond_init(void);
 
 /** @brief Blocks onto the given condition variable */
-XBT_PUBLIC void xbt_cond_wait(xbt_cond_t cond, xbt_mutex_t mutex);
+XBT_ATTRIB_DEPRECATED_v327("Please use sg_cond_wait") XBT_PUBLIC void xbt_cond_wait(xbt_cond_t cond, xbt_mutex_t mutex);
 /** @brief Blocks onto the given condition variable, but only for the given amount of time.
  *  @return 0 on success, 1 on timeout */
-XBT_PUBLIC int xbt_cond_timedwait(xbt_cond_t cond, xbt_mutex_t mutex, double delay);
+XBT_ATTRIB_DEPRECATED_v327("Please use sg_cond_wait_for") XBT_PUBLIC
+    int xbt_cond_timedwait(xbt_cond_t cond, xbt_mutex_t mutex, double delay);
 /** @brief Signals the given mutex variable */
-XBT_PUBLIC void xbt_cond_signal(xbt_cond_t cond);
+XBT_ATTRIB_DEPRECATED_v327("Please use sg_cond_notify_one") XBT_PUBLIC void xbt_cond_signal(xbt_cond_t cond);
 /** @brief Broadcasts the given mutex variable */
-XBT_PUBLIC void xbt_cond_broadcast(xbt_cond_t cond);
+XBT_ATTRIB_DEPRECATED_v327("Please use sg_cond_notify_all") XBT_PUBLIC void xbt_cond_broadcast(xbt_cond_t cond);
 /** @brief Destroys the given mutex variable */
-XBT_PUBLIC void xbt_cond_destroy(xbt_cond_t cond);
+XBT_ATTRIB_DEPRECATED_v327("Please use sg_cond_destroy") XBT_PUBLIC void xbt_cond_destroy(xbt_cond_t cond);
 
 /** @} */
 
index 45d9320..f24b717 100644 (file)
@@ -49,8 +49,10 @@ XBT_ATTRIB_NORETURN XBT_PUBLIC void xbt_abort(void);
 
 #ifdef XBT_LOG_LOCALLY_DEFINE_XBT_CHANNEL
 XBT_LOG_NEW_CATEGORY(xbt, "All XBT categories (simgrid toolbox)");
+XBT_LOG_NEW_SUBCATEGORY(xbt_help, xbt, "Help messages");
 #else
 XBT_LOG_EXTERNAL_CATEGORY(xbt);
+XBT_LOG_EXTERNAL_CATEGORY(xbt_help);
 #endif
 
 /** @addtogroup XBT_syscall
index 84c282e..e80adf5 100644 (file)
@@ -8,10 +8,28 @@
 #define XBT_UTILITY_HPP
 
 #include <tuple>
+#include <functional>
 
 namespace simgrid {
 namespace xbt {
 
+/** @brief A hash which works with more stuff
+ *
+ *  It can hash pairs: the standard hash currently doesn't include this.
+ */
+template <class X> class hash : public std::hash<X> {
+};
+
+template <class X, class Y> class hash<std::pair<X, Y>> {
+public:
+  std::size_t operator()(std::pair<X, Y> const& x) const
+  {
+    hash<X> h1;
+    hash<X> h2;
+    return h1(x.first) ^ h2(x.second);
+  }
+};
+
 /** @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
@@ -57,10 +75,6 @@ template <class List, class Elem> inline void intrusive_erase(List& list, Elem&
  */
 template<class T, T... N>
 class integer_sequence {
-  static constexpr std::size_t size()
-  {
-    return std::tuple_size<decltype(std::make_tuple(N...))>::value;
-  }
 };
 
 namespace bits {
diff --git a/setup.py b/setup.py
new file mode 100755 (executable)
index 0000000..394d07d
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,126 @@
+
+
+# python3 setup.py sdist # Build a source distrib (building binary distribs is complex on linux)
+
+# twine upload --repository-url https://test.pypi.org/legacy/ dist/simgrid-*.tar.gz # Upload to test
+# pip3 install --user --index-url https://test.pypi.org/simple  simgrid
+
+# Once it works, upload to the real infra.  /!\ you cannot modify a file once uploaded
+# twine upload dist/simgrid-*.tar.gz
+
+import os
+import re
+import sys
+import platform
+import subprocess
+
+from setuptools import setup, Extension
+from setuptools.command.build_ext import build_ext
+from distutils.version import LooseVersion
+
+
+class CMakeExtension(Extension):
+    def __init__(self, name, sourcedir=''):
+        Extension.__init__(self, name, sources=[])
+        self.sourcedir = os.path.abspath(sourcedir)
+
+
+class CMakeBuild(build_ext):
+    def run(self):
+        try:
+            out = subprocess.check_output(['cmake', '--version'])
+        except OSError:
+            raise RuntimeError(
+                "CMake must be installed to build python bindings of SimGrid")
+
+        if not os.path.exists("MANIFEST.in"):
+            raise RuntimeError(
+                "Please generate a MANIFEST.in file (configure simgrid, and copy it here if you build out of tree)")
+
+        if platform.system() == "Windows":
+            cmake_version = LooseVersion(
+                re.search(r'version\s*([\d.]+)', out.decode()).group(1))
+            if cmake_version < '3.1.0':
+                raise RuntimeError("CMake >= 3.1.0 is required on Windows")
+
+        for ext in self.extensions:
+            self.build_extension(ext)
+
+    def build_extension(self, ext):
+        extdir = os.path.abspath(os.path.dirname(
+            self.get_ext_fullpath(ext.name)))
+        cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
+                      '-DPYTHON_EXECUTABLE=' + sys.executable,
+                      '-Denable_smpi=OFF',
+                      '-Denable_java=OFF',
+                      '-Denable_python=ON',
+                      '-Dminimal-bindings=ON']
+
+        cfg = 'Debug' if self.debug else 'Release'
+        build_args = ['--config', cfg]
+
+        if platform.system() == "Windows":
+            cmake_args += [
+                '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(cfg.upper(), extdir)]
+            if sys.maxsize > 2**32:
+                cmake_args += ['-A', 'x64']
+            build_args += ['--', '/m']
+        else:
+            cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg]
+            build_args += ['--', '-j4']
+
+        env = os.environ.copy()
+        env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format(env.get('CXXFLAGS', ''),
+                                                              self.distribution.get_version())
+        if not os.path.exists(self.build_temp):
+            os.makedirs(self.build_temp)
+        subprocess.check_call(['cmake', ext.sourcedir] +
+                              cmake_args, cwd=self.build_temp, env=env)
+        subprocess.check_call(['cmake', '--build', '.'] +
+                              build_args, cwd=self.build_temp)
+
+
+setup(
+    name='simgrid',
+    version='3.23.3',
+    author='Da SimGrid Team',
+    author_email='simgrid-devel@lists.gforge.inria.fr',
+    description='Toolkit for scalable simulation of distributed applications',
+    long_description=("SimGrid is a scientific instrument to study the behavior of "
+                      "large-scale distributed systems such as Grids, Clouds, HPC or P2P "
+                      "systems. It can be used to evaluate heuristics, prototype applications "
+                      "or even assess legacy MPI applications.\n\n"
+                      "This package contains a native library. Please install cmake, boost, pybind11 and a "
+                      "C++ compiler before using pip3. On Debian/Ubuntu, this is as easy as\n"
+                      "sudo apt install cmake libboost-dev pybind11-dev g++ gcc"),
+    ext_modules=[CMakeExtension('simgrid')],
+    cmdclass=dict(build_ext=CMakeBuild),
+    install_requires=['pybind11>=2.3'],
+    setup_requires=['pybind11>=2.3'],
+    zip_safe=False,
+    classifiers=[
+        "Development Status :: 4 - Beta",
+        "Environment :: Console",
+        "Intended Audience :: Education",
+        "Intended Audience :: Developers",
+        "Intended Audience :: Science/Research",
+        "Intended Audience :: System Administrators",
+        "License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)",
+        "Operating System :: POSIX",
+        "Operating System :: MacOS",
+        "Operating System :: Microsoft :: Windows",
+        "Programming Language :: Python :: 3",
+        "Programming Language :: C++",
+        "Programming Language :: C",
+        "Programming Language :: Fortran",
+        "Programming Language :: Java",
+        "Topic :: System :: Distributed Computing",
+        "Topic :: System :: Systems Administration",
+    ],
+    url="https://simgrid.org",
+    project_urls={
+        'Tracker': 'https://framagit.org/simgrid/simgrid/issues/',
+        'Source':  'https://framagit.org/simgrid/simgrid/',
+        'Documentation': 'https://simgrid.org/doc/latest/',
+    },
+)
index b6c12aa..bd63c27 100644 (file)
@@ -1,9 +1,10 @@
 # This file is used to scan the project for issues automatically 
 # Browse the result here: https://sonarcloud.io/dashboard/?id=simgrid
 
-sonar.projectKey=simgrid
+sonar.organization=simgrid
+sonar.projectKey=simgrid_simgrid
 sonar.projectName=SimGrid
-sonar.projectVersion=3.22.90
+sonar.projectVersion=3.23.3
 
 sonar.links.homepage=https://simgrid.org
 sonar.links.issue=https://framagit.org/simgrid/simgrid/issues
@@ -13,7 +14,7 @@ sonar.sources=src,examples,include,teshsuite
 
 
 # Disable some rules on some files
-sonar.issue.ignore.multicriteria=j1,j2,j3,jni1,jni2,c1,c2a,c2b,c3,c4a,c4b,c5a,c5b,c6a,c6b,c7,c8,c9,f1
+sonar.issue.ignore.multicriteria=j1,j2,j3,j4,j5,jni1,jni2,c1,c2a,c2b,c3,c4a,c4b,c5a,c5b,c6a,c6b,c7,c8,c9,c10,f1,p1,s1,s2,s3,s4
 
 # The Object.finalize() method should not be overriden
 # But we need to clean the native memory with JNI
@@ -30,6 +31,16 @@ sonar.issue.ignore.multicriteria.j2.resourceKey=**/*.java
 sonar.issue.ignore.multicriteria.j3.ruleKey=squid:S4823
 sonar.issue.ignore.multicriteria.j3.resourceKey=**/*.java
 
+# Standard outputs should not be used directly to log anything
+# But this file is used before SimGrid is initialized
+sonar.issue.ignore.multicriteria.j4.ruleKey=squid:S106
+sonar.issue.ignore.multicriteria.j4.resourceKey=src/bindings/java/org/simgrid/NativeLib.java
+
+# Deprecated code should be removed
+# We do have a process to remove deprecated code
+sonar.issue.ignore.multicriteria.j5.ruleKey=squid:S1133
+sonar.issue.ignore.multicriteria.j5.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
@@ -96,11 +107,37 @@ sonar.issue.ignore.multicriteria.c8.resourceKey=**/*
 sonar.issue.ignore.multicriteria.c9.ruleKey=cpp:S3574
 sonar.issue.ignore.multicriteria.c9.resourceKey=**/*
 
+# Standard outputs should not be used directly to log anything
+# Irrelevant for parsing examples in teshsuite/simdag
+sonar.issue.ignore.multicriteria.c10.ruleKey=cpp:S106
+sonar.issue.ignore.multicriteria.c10.resourceKey=teshsuite/simdag/**/*.cpp
+
 # "reinterpret_cast" should not be used
 # But we need this to interface C and Fortran
 sonar.issue.ignore.multicriteria.f1.ruleKey=cpp:S3630
 sonar.issue.ignore.multicriteria.f1.resourceKey=src/smpi/bindings/smpi_f77*.cpp
 
+# In Python, Using command line arguments is security-sensitive
+# But we are cautionous with it
+sonar.issue.ignore.multicriteria.p1.ruleKey=python:S4823
+sonar.issue.ignore.multicriteria.p1.resourceKey=**/*.py
+
+# In MPI, there are C function pointers
+sonar.issue.ignore.multicriteria.s1.ruleKey=cpp:S5205
+sonar.issue.ignore.multicriteria.s1.resourceKey=src/smpi/**/*.cpp
+
+# MPI standard has long prototypes
+sonar.issue.ignore.multicriteria.s2.ruleKey=cpp:S107
+sonar.issue.ignore.multicriteria.s2.resourceKey=src/smpi/**/*.cpp
+
+# MPI standard uses void*
+sonar.issue.ignore.multicriteria.s3.ruleKey=cpp:S5008
+sonar.issue.ignore.multicriteria.s3.resourceKey=src/smpi/**/*.cpp
+
+# MPI standard uses const, sometimes const_cast is needed
+sonar.issue.ignore.multicriteria.s4.ruleKey=cpp:S859
+sonar.issue.ignore.multicriteria.s4.resourceKey=src/smpi/**/*.cpp
+
 # Exclude some files from the analysis:
 #  - our unit tests
 #  - the tests that we borrowed elsewhere (MPICH and ISP)
@@ -109,7 +146,7 @@ sonar.issue.ignore.multicriteria.f1.resourceKey=src/smpi/bindings/smpi_f77*.cpp
 #  - the NAS, that are included in our examples
 #  - The Catch2 library, that is included in our unit tests
 #  - RngStream, that is included in SimGrid
-sonar.exclusions=src/include/catch.hpp,src/*_unit.c*,teshsuite/smpi/mpich3-test/**,teshsuite/smpi/isp/**,**/*_dtd.c,**/*_dtd.h,**/*yy.c,src/xbt/automaton/parserPromela.tab.*,src/smpi/colls/**/*,examples/smpi/NAS/*,src/xbt/RngStream.c,include/xbt/RngStream.h
+sonar.exclusions=src/include/catch.hpp,src/*_unit.c*,teshsuite/smpi/mpich3-test/**,teshsuite/smpi/isp/**,**/*_dtd.c,**/*_dtd.h,**/*yy.c,src/xbt/automaton/parserPromela.tab.*,src/smpi/colls/**/*,examples/smpi/NAS/*,examples/smpi/gemm/gemm.c,src/xbt/RngStream.c,include/xbt/RngStream.h
 
 # Exclude our examples from the duplication detection.
 # Examples are expected to be somehow repetitive
@@ -128,8 +165,8 @@ sonar.cfamily.gcov.reportsPath=Testing/CoverageInfo
 #   - foreign test suites
 #   - XML files
 #   - Python files used to generate either simcalls or deployment files
-sonar.coverage.exclusions=teshsuite/smpi/isp/**,teshsuite/smpi/mpich3-test/**,**/*.xml,src/simix/simcalls.py,**/generate.py
-
+#   - Any java source code (it's deprecated now)
+sonar.coverage.exclusions=teshsuite/smpi/isp/**,teshsuite/smpi/mpich3-test/**,**/*.xml,src/simix/simcalls.py,**/generate.py,**/*.java,src/bindings/java/**
 # Encoding of the source files
 sonar.sourceEncoding=UTF-8
 
index 5d500af..ad355eb 100644 (file)
@@ -34,7 +34,7 @@ JavaContextFactory::JavaContextFactory() : ContextFactory()
 
 JavaContextFactory::~JavaContextFactory()=default;
 
-JavaContext* JavaContextFactory::create_context(std::function<void()>&& code, smx_actor_t actor)
+Context* JavaContextFactory::create_context(std::function<void()>&& code, actor::ActorImpl* actor)
 {
   return this->new_context<JavaContext>(std::move(code), actor);
 }
index 8eef41b..573e4f8 100644 (file)
@@ -42,7 +42,7 @@ class JavaContextFactory : public simgrid::kernel::context::ContextFactory {
 public:
   JavaContextFactory();
   ~JavaContextFactory() override;
-  JavaContext* create_context(std::function<void()>&& code, smx_actor_t actor) override;
+  Context* create_context(std::function<void()>&& code, actor::ActorImpl* actor) override;
   void run_all() override;
 };
 
index 2781ac3..7de0a98 100644 (file)
@@ -109,7 +109,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Comm_waitCompletion(JNIEnv *env, job
   }
 
   msg_error_t status;
-  status = MSG_comm_wait(comm,static_cast<double>(timeout));
+  status = MSG_comm_wait(comm, timeout);
   env->SetBooleanField(jcomm, jcomm_field_Comm_finished, JNI_TRUE);
   if (status == MSG_OK) {
     jcomm_bind_task(env,jcomm);
@@ -145,7 +145,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Comm_waitAll(JNIEnv *env, jclass cls
   if (not comms)
     return;
 
-  MSG_comm_waitall(comms, count, static_cast<double>(timeout));
+  MSG_comm_waitall(comms, count, timeout);
   delete[] comms;
 }
 JNIEXPORT int JNICALL Java_org_simgrid_msg_Comm_waitAny(JNIEnv *env, jclass cls, jobjectArray jcomms)
index c893103..5d57308 100644 (file)
@@ -75,7 +75,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_create(JNIEnv* env, jobject
   simgrid::simix::ActorCode function = [jprocess]() { simgrid::kernel::context::java_main_jprocess(jprocess); };
   smx_actor_t self                   = SIMIX_process_self();
   sg_host_t host                     = jhost_get_native(env, jhost);
-  smx_actor_t actor                  = simgrid::simix::simcall([name, function, host, self] {
+  smx_actor_t actor                  = simgrid::kernel::actor::simcall([name, function, host, self] {
     return simgrid::kernel::actor::ActorImpl::create(std::move(name), std::move(function), nullptr, host, nullptr, self)
         .get();
   });
index 075c5ff..620754f 100644 (file)
@@ -22,7 +22,7 @@ SG_BEGIN_DECL();
 #endif
 /* end of eclipse-mandated pimple */
 
-// Cached java fields accessed by the rest of the code (FIXME: they should not)
+// Cached java fields accessed by the rest of the code
 extern jfieldID jprocess_field_Process_pid;
 extern jfieldID jprocess_field_Process_ppid;
 
index b6d3f6d..f00245c 100644 (file)
@@ -9,7 +9,8 @@
 #include "jmsg.hpp"
 #include "jxbt_utilities.hpp"
 #include "simgrid/Exception.hpp"
-#include "xbt/synchro.h"
+#include "simgrid/mutex.h"
+#include "simgrid/semaphore.h"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
 
@@ -21,30 +22,26 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_nativeInit(JNIEnv *env, jclass
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_init(JNIEnv * env, jobject obj) {
-  xbt_mutex_t mutex = xbt_mutex_init();
+  sg_mutex_t mutex = sg_mutex_init();
 
   env->SetLongField(obj, jsynchro_field_Mutex_bind, (jlong)(uintptr_t)(mutex));
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_acquire(JNIEnv * env, jobject obj) {
-  xbt_mutex_t mutex = (xbt_mutex_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Mutex_bind);
-  try {
-    xbt_mutex_acquire(mutex);
-  } catch (xbt_ex const& e) {
-    XBT_DEBUG("Caught an exception: %s", e.what());
-  }
+  sg_mutex_t mutex = (sg_mutex_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Mutex_bind);
+  sg_mutex_lock(mutex);
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_release(JNIEnv * env, jobject obj) {
-  xbt_mutex_t mutex;
+  sg_mutex_t mutex;
 
-  mutex = (xbt_mutex_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Mutex_bind);
-  xbt_mutex_release(mutex);
+  mutex = (sg_mutex_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Mutex_bind);
+  sg_mutex_unlock(mutex);
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Mutex_nativeFinalize(JNIEnv * env, jobject obj) {
-  xbt_mutex_t mutex = (xbt_mutex_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Mutex_bind);
-  xbt_mutex_destroy(mutex);
+  sg_mutex_t mutex = (sg_mutex_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Mutex_bind);
+  sg_mutex_destroy(mutex);
 }
 
 static jfieldID jsynchro_field_Semaphore_bind;
@@ -55,39 +52,39 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_nativeInit(JNIEnv *env, jc
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_init(JNIEnv * env, jobject obj, jint capacity) {
-  msg_sem_t sem = MSG_sem_init((int) capacity);
+  sg_sem_t sem = sg_sem_init((int)capacity);
 
   env->SetLongField(obj, jsynchro_field_Semaphore_bind, (jlong)(uintptr_t)(sem));
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_acquire(JNIEnv * env, jobject obj, jdouble timeout) {
-  msg_sem_t sem;
+  sg_sem_t sem;
 
-  sem             = (msg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
-  msg_error_t res = MSG_sem_acquire_timeout(sem, (double)timeout) == 0 ? MSG_OK : MSG_TIMEOUT;
+  sem             = (sg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
+  msg_error_t res = sg_sem_acquire_timeout(sem, (double)timeout) == 0 ? MSG_OK : MSG_TIMEOUT;
   if (res != MSG_OK) {
     jmsg_throw_status(env, res);
   }
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_release(JNIEnv * env, jobject obj) {
-  msg_sem_t sem;
+  sg_sem_t sem;
 
-  sem = (msg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
-  MSG_sem_release(sem);
+  sem = (sg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
+  sg_sem_release(sem);
 }
 
 JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Semaphore_wouldBlock(JNIEnv * env, jobject obj) {
-  msg_sem_t sem;
+  sg_sem_t sem;
 
-  sem     = (msg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
-  int res = MSG_sem_would_block(sem);
+  sem     = (sg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
+  int res = sg_sem_would_block(sem);
   return (jboolean) res;
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Semaphore_nativeFinalize(JNIEnv * env, jobject obj) {
-  msg_sem_t sem;
+  sg_sem_t sem;
 
-  sem = (msg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
-  MSG_sem_destroy(sem);
+  sem = (sg_sem_t)(uintptr_t)env->GetLongField(obj, jsynchro_field_Semaphore_bind);
+  sg_sem_destroy(sem);
 }
index ede08bb..5c28035 100644 (file)
@@ -61,7 +61,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_create(JNIEnv * env, jobject jt
 
   if (jname)
     name = env->GetStringUTFChars(jname, 0);
-  msg_task_t task = MSG_task_create(name, static_cast<double>(jflopsAmount), static_cast<double>(jbytesAmount), jtask);
+  msg_task_t task = MSG_task_create(name, jflopsAmount, jbytesAmount, jtask);
   if (jname)
     env->ReleaseStringUTFChars(jname, name);
 
@@ -73,7 +73,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_parallelCreate(JNIEnv * env, jo
                                          jobjectArray jhosts, jdoubleArray jcomputeDurations_arg,
                                          jdoubleArray jmessageSizes_arg)
 {
-  int host_count = static_cast<int>(env->GetArrayLength(jhosts));
+  int host_count = env->GetArrayLength(jhosts);
 
   jdouble* jcomputeDurations = env->GetDoubleArrayElements(jcomputeDurations_arg, 0);
   msg_host_t* hosts          = new msg_host_t[host_count];
@@ -234,7 +234,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setPriority(JNIEnv * env, jobje
     jxbt_throw_notbound(env, "task", jtask);
     return;
   }
-  MSG_task_set_priority(task, static_cast<double>(priority));
+  MSG_task_set_priority(task, priority);
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setFlopsAmount (JNIEnv *env, jobject jtask, jdouble computationAmount)
@@ -245,7 +245,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setFlopsAmount (JNIEnv *env, jo
     jxbt_throw_notbound(env, "task", jtask);
     return;
   }
-  MSG_task_set_flops_amount(task, static_cast<double>(computationAmount));
+  MSG_task_set_flops_amount(task, computationAmount);
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBytesAmount (JNIEnv *env, jobject jtask, jdouble dataSize)
@@ -257,7 +257,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBytesAmount (JNIEnv *env, jo
     return;
   }
   env->SetDoubleField(jtask, jtask_field_Task_messageSize, dataSize);
-  MSG_task_set_bytes_amount(task, static_cast<double>(dataSize));
+  MSG_task_set_bytes_amount(task, dataSize);
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_sendBounded(JNIEnv * env,jobject jtask, jstring jalias,
@@ -273,8 +273,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_sendBounded(JNIEnv * env,jobjec
   MSG_task_set_data(task, (void *) env->NewGlobalRef(jtask));
 
   const char* alias = env->GetStringUTFChars(jalias, 0);
-  msg_error_t res =
-      MSG_task_send_with_timeout_bounded(task, alias, static_cast<double>(jtimeout), static_cast<double>(maxrate));
+  msg_error_t res   = MSG_task_send_with_timeout_bounded(task, alias, jtimeout, maxrate);
   env->ReleaseStringUTFChars(jalias, alias);
 
   if (res != MSG_OK)
@@ -340,8 +339,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receiveBounded(JNIEnv* env,
   msg_task_t task = nullptr;
 
   const char *alias = env->GetStringUTFChars(jalias, 0);
-  msg_error_t res   = MSG_task_receive_ext_bounded(&task, alias, static_cast<double>(jtimeout), /*host*/ nullptr,
-                                                 static_cast<double>(rate));
+  msg_error_t res   = MSG_task_receive_ext_bounded(&task, alias, jtimeout, /*host*/ nullptr, rate);
   if (env->ExceptionOccurred())
     return nullptr;
   if (res != MSG_OK) {
@@ -377,7 +375,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_irecvBounded(JNIEnv * env, j
   }
 
   const char* mailbox = env->GetStringUTFChars(jmailbox, 0);
-  msg_comm_t comm     = MSG_task_irecv_bounded(task, mailbox, static_cast<double>(rate));
+  msg_comm_t comm     = MSG_task_irecv_bounded(task, mailbox, rate);
   env->ReleaseStringUTFChars(jmailbox, mailbox);
 
   env->SetLongField(jcomm, jtask_field_Comm_bind, (jlong) (uintptr_t)(comm));
@@ -517,7 +515,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_dsendBounded(JNIEnv * env, jobj
 
   /* Pass a global ref to the Jtask into the Ctask so that the receiver can use it */
   MSG_task_set_data(task, (void *) env->NewGlobalRef(jtask));
-  MSG_task_dsend_bounded(task, alias, msg_task_cancel_on_failed_dsend,static_cast<double>(maxrate));
+  MSG_task_dsend_bounded(task, alias, msg_task_cancel_on_failed_dsend, maxrate);
 
   env->ReleaseStringUTFChars(jalias, alias);
 }
index 414947c..b7b1cf4 100644 (file)
@@ -61,15 +61,15 @@ JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostPushState (JNIEnv *env,
 JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_hostPopState (JNIEnv *env, jclass cls, jstring js_host,
                                                                   jstring js_state);
 
-/* Missing calls
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableSetWithTime (JNIEnv *env, jclass cls, jdouble, jstring, jstring, jdouble);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableAddWithTime (JNIEnv *env, jclass cls, jdouble, jstring, jstring, jdouble);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkVariableSubWithTime (JNIEnv *env, jclass cls, jdouble, jstring, jstring, jdouble);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableAdd (JNIEnv *env, jclass cls, jstring, jstring, jstring, jdouble);
-JNIEXPORT void JNICALL Java_org_simgrid_trace_Trace_linkSrcDstVariableSub (JNIEnv *env, jclass cls, 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);
+/* Missing calls:
+Java_org_simgrid_trace_Trace_linkVariableSetWithTime
+Java_org_simgrid_trace_Trace_linkVariableAddWithTime
+Java_org_simgrid_trace_Trace_linkVariableSubWithTime
+Java_org_simgrid_trace_Trace_linkSrcDstVariableAdd
+Java_org_simgrid_trace_Trace_linkSrcDstVariableSub
+Java_org_simgrid_trace_Trace_linkSrcDstVariableSetWithTime
+Java_org_simgrid_trace_Trace_linkSrcdstVariableAddWithTime
+Java_org_simgrid_trace_Trace_linkSrcDstVariableSubWithTime
 */
 #ifdef __cplusplus
 }
index 177bce3..48b1e70 100644 (file)
@@ -35,16 +35,16 @@ jfieldID jxbt_get_sfield(JNIEnv* env, const char* classname, const char* name, c
 
 #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);                                                                          \
+    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)
 
index 13d27ff..e19be69 100644 (file)
@@ -69,9 +69,9 @@ public final class NativeLib {
                
                System.err.println("\nCannot load the bindings to the "+name+" library in path "+getPath()+" and no usable SimGrid installation found on disk.");
                if (cause != null) {
-                       if (cause.getMessage().matches(".*libcgraph.so.*"))
+                       if (cause.getMessage().contains("libcgraph.so"))
                                System.err.println("HINT: Try to install the libcgraph package (sudo apt-get install libcgraph).");
-                       else if (cause.getMessage().matches(".*libboost_context.so.*"))
+                       else if (cause.getMessage().contains("libboost_context.so"))
                                System.err.println("HINT: Try to install the boost-context package (sudo apt-get install libboost-context-dev).");
                        else
                                System.err.println("Try to install the missing dependencies, if any. Read carefully the following error message.");
@@ -163,9 +163,9 @@ public final class NativeLib {
                public void run() {
                        try {
                                for (File f : dir.listFiles())
-                                       if (! f.delete() && !f.getAbsolutePath().contains("appveyor")) // Be silent on AppVeyor to not break the tests. Ugly trick :)
+                                       if (! f.delete() && !f.getAbsolutePath().contains("travis") && !f.getAbsolutePath().contains("appveyor")) // Be silent on Travis to not break the tests. Ugly trick :)
                                                System.out.println("Unable to clean temporary file "+f.getAbsolutePath()+" during shutdown.");
-                               if (! dir.delete() && !dir.getAbsolutePath().contains("appveyor") )
+                               if (! dir.delete() && !dir.getAbsolutePath().contains("travis") && !dir.getAbsolutePath().contains("appveyor"))
                                        System.out.println("Unable to clean temporary file "+dir.getAbsolutePath()+" during shutdown.");                                
                        } catch(Exception e) {
                                System.out.println("Error while cleaning temporary file "+dir.getAbsolutePath()+" during shutdown: "+e.getCause());
index b6c6b15..3346fac 100644 (file)
@@ -29,8 +29,11 @@ public class Comm {
        protected Comm() {
 
        }
-       /** Destroy the C communication object, when the GC reclaims the java part. */
-       @Override
+       /**
+        * Destroy the C communication object, when the GC reclaims the java part.
+        * @deprecated (from Java9 onwards)
+        */
+       @Deprecated @Override
        protected void finalize() throws Throwable{
                nativeFinalize();
        }
index 6e253ea..e23d1fc 100644 (file)
@@ -18,7 +18,8 @@ public class Mutex {
                init();
        }
 
-       @Override
+       /** @deprecated (from Java9 onwards) */
+       @Deprecated @Override
        protected void finalize() throws Throwable {
                nativeFinalize();
        }
index b9ebb49..9e8377e 100644 (file)
@@ -7,16 +7,19 @@ package org.simgrid.msg;
 
 /** Used internally to interrupt the user code when the process gets killed.
  *
+ * \rst
  * You can catch it for cleanups or to debug, but DO NOT BLOCK IT, or your simulation will segfault!
  *
- * <code>
- * try {
- *   getHost().off();
- * } catch (ProcessKilledError e) {
- *   e.printStackTrace();
- *   throw e;
- * }
- * </code>
+ * .. code-block:: java
+ *
+ *    try {
+ *      getHost().off();
+ *    } catch (ProcessKilledError e) {
+ *      e.printStackTrace();
+ *      throw e;
+ *    }
+ *
+ * \endrst
  */
 
 public class ProcessKilledError extends Error {
index 5aa76d9..2209f49 100644 (file)
@@ -42,7 +42,8 @@ public class RngStream {
         */
        private native void create(String name);
 
-       @Override
+       /** @deprecated (from Java9 onwards) */
+       @Deprecated @Override
        protected void finalize() throws Throwable{
                nativeFinalize();
        }
index e404376..c348bd4 100644 (file)
@@ -66,8 +66,11 @@ public class Semaphore {
        }
 
 
-       /** Deletes this semaphore when the GC reclaims it */
-       @Override
+       /**
+        * Deletes this semaphore when the GC reclaims it
+        * @deprecated (from Java9 onwards)
+        */
+       @Deprecated @Override
        protected void finalize() throws Throwable {
                nativeFinalize();
        }
@@ -80,4 +83,4 @@ public class Semaphore {
                org.simgrid.NativeLib.nativeInit();
                nativeInit();
        }
-}
\ No newline at end of file
+}
index a8d11ac..5bb5d29 100644 (file)
@@ -180,8 +180,11 @@ public class Task {
        /** Cancels a task. */
        public native void cancel();
 
-       /** Deletes a task once the garbage collector reclaims it */
-       @Override
+       /**
+        * Deletes a task once the garbage collector reclaims it
+        * @deprecated (from Java9 onwards)
+        */
+       @Deprecated @Override
        protected void finalize() throws Throwable{
                nativeFinalize();
                bind=0; // to avoid segfaults if the impossible happens yet again making this task surviving its finalize()
index 7804e9f..f0a778b 100644 (file)
@@ -14,7 +14,7 @@ public class VM extends Host {
        private int coreAmount = 1;
 
        /**
-        * Create a `basic' VM : 1 core and 1GB of RAM.
+        * Create a `basic` VM : 1 core and 1GB of RAM.
         * @param host Host node
         * @param name name of the machine
         */     
@@ -67,7 +67,11 @@ public class VM extends Host {
        /** Retrieve a VM from its name */
        public static native VM getVMByName(String name);
 
-       /* Make sure that the GC also destroys the C object */
+       /**
+        * Make sure that the GC also destroys the C object
+        * @deprecated (from Java9 onwards)
+        */
+       @Deprecated @Override
        protected void finalize() throws Throwable {
                nativeFinalize();
        }
index 4471c98..f9f4d63 100644 (file)
@@ -16,6 +16,10 @@ public final class Trace {
     NativeLib.nativeInit();
   }
 
+  private Trace() {
+    throw new IllegalStateException("Utility class \"Trace\"");
+  }
+
   // TODO complete the binding of the tracing API
 
   /**
index 7adcf77..c9e1523 100644 (file)
@@ -208,7 +208,7 @@ void sglua_register_host_functions(lua_State* L)
 
   /* metatable.__index = simgrid.host
    * we put the host functions inside the host userdata itself:
-   * this allows to write my_host:method(args) for
+   * this allows one to write my_host:method(args) for
    * simgrid.host.method(my_host, args) */
   lua_setfield(L, -2, "__index");         /* simgrid simgrid.host mt */
 
index 905776d..404887f 100644 (file)
@@ -7,21 +7,23 @@
 
 #include "lua_private.hpp"
 #include "simgrid/kernel/routing/NetPoint.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/network_interface.hpp"
+#include "src/surf/surf_private.hpp"
 #include "src/surf/xml/platf_private.hpp"
-#include <cctype>
-#include <cstring>
 
-#include <lauxlib.h>
-
-#include "src/surf/surf_private.hpp"
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
 #include <simgrid/s4u/Engine.hpp>
 #include <simgrid/s4u/Host.hpp>
+
+#include <cctype>
+#include <cstring>
 #include <string>
 #include <vector>
 
+#include <lauxlib.h>
+
 XBT_LOG_NEW_DEFAULT_CATEGORY(lua_platf, "Lua bindings (platform module)");
 
 constexpr char PLATF_MODULE_NAME[] = "simgrid.engine";
@@ -63,14 +65,14 @@ static simgrid::s4u::Link::SharingPolicy link_policy_get_by_name(const char* pol
 int console_open(lua_State*)
 {
   sg_platf_init();
-  simgrid::s4u::on_platform_creation();
+  simgrid::s4u::Engine::on_platform_creation();
 
   return 0;
 }
 
 int console_close(lua_State*)
 {
-  simgrid::s4u::on_platform_created();
+  simgrid::s4u::Engine::on_platform_created();
   sg_platf_exit();
   return 0;
 }
@@ -92,7 +94,7 @@ int console_add_backbone(lua_State *L) {
   type = lua_gettable(L, -2);
   lua_ensure(type == LUA_TSTRING || type == LUA_TNUMBER,
       "Attribute 'bandwidth' must be specified for backbone and must either be a string (in the right format; see docs) or a number.");
-  link.bandwidth = surf_parse_get_bandwidth(lua_tostring(L, -1), "bandwidth of backbone", link.id.c_str());
+  link.bandwidths.push_back(surf_parse_get_bandwidth(lua_tostring(L, -1), "bandwidth of backbone", link.id.c_str()));
   lua_pop(L, 1);
 
   lua_pushstring(L, "lat");
@@ -226,9 +228,9 @@ int  console_add_link(lua_State *L) {
   lua_ensure(type == LUA_TSTRING || type == LUA_TNUMBER,
       "Attribute 'bandwidth' must be specified for any link and must either be either a string (in the right format; see docs) or a number.");
   if (type == LUA_TNUMBER)
-    link.bandwidth = lua_tonumber(L, -1);
+    link.bandwidths.push_back(lua_tonumber(L, -1));
   else // LUA_TSTRING
-    link.bandwidth = surf_parse_get_bandwidth(lua_tostring(L, -1), "bandwidth of link", link.id.c_str());
+    link.bandwidths.push_back(surf_parse_get_bandwidth(lua_tostring(L, -1), "bandwidth of link", link.id.c_str()));
   lua_pop(L, 1);
 
   //get latency value
index 5a8e235..30db85b 100644 (file)
@@ -17,7 +17,7 @@ msg_host_t sglua_check_host(lua_State* L, int index);
 void sglua_register_platf_functions(lua_State* L);
 
 #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_ARG1(cond) _lua_ensure_ARGN((cond), "Assertion " _XBT_STRINGIFY(cond) " failed")
 #define _lua_ensure_ARGN(cond, ...)                                                                                    \
   do {                                                                                                                 \
     if (!(cond)) {                                                                                                     \
index c17b53b..21ddf1e 100644 (file)
@@ -6,13 +6,13 @@
 #ifndef SIMGRID_LUA_HPP
 #define SIMGRID_LUA_HPP
 
-extern "C" {
-#include <lua.h>
+#include <lua.hpp>
 
 /* ********************************************************************************* */
 /*                           Plaftorm functions                                      */
 /* ********************************************************************************* */
 
+extern "C" {
 int console_open(lua_State* L);
 int console_close(lua_State* L);
 
index 340c5d2..4b70a2d 100644 (file)
@@ -8,10 +8,19 @@
 #define _hypot hypot
 #endif
 
+#if defined(__GNUG__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-value"
+#endif
+
 #include <pybind11/functional.h>
 #include <pybind11/pybind11.h> // Must come before our own stuff
 #include <pybind11/stl.h>
 
+#if defined(__GNUG__)
+#pragma GCC diagnostic pop
+#endif
+
 #include "src/kernel/context/Context.hpp"
 #include <simgrid/Exception.hpp>
 #include <simgrid/s4u/Actor.hpp>
index f0567c5..9371068 100644 (file)
@@ -22,7 +22,6 @@ struct s_stack_region{
 #endif
   size_t size;
   int block;
-  int process_index;
 };
 typedef struct s_stack_region  s_stack_region_t;
 
index b96e69a..b502542 100644 (file)
@@ -25,7 +25,7 @@
 SG_BEGIN_DECL()
 
 /********************************* Global *************************************/
-XBT_PUBLIC void MC_run();
+XBT_ATTRIB_NORETURN XBT_PUBLIC void MC_run();
 XBT_PUBLIC void MC_process_clock_add(smx_actor_t, double);
 XBT_PUBLIC double MC_process_clock_get(smx_actor_t);
 XBT_PRIVATE void MC_automaton_load(const char *file);
index 5e602a5..a9c8c10 100644 (file)
@@ -11,7 +11,6 @@
 /** Config Globals */
 
 XBT_PUBLIC_DATA int _sg_cfg_init_status;
-XBT_PUBLIC_DATA bool _sg_cfg_exit_asap;
 
 XBT_PUBLIC void sg_config_init(int* argc, char** argv);
 XBT_PUBLIC void sg_config_finalize();
index b5b027e..410508c 100644 (file)
 /** @ingroup SURF_models
  *  @brief The CPU model object for the physical machine layer
  */
-XBT_PUBLIC_DATA simgrid::surf::CpuModel* surf_cpu_model_pm;
+XBT_PUBLIC_DATA simgrid::kernel::resource::CpuModel* surf_cpu_model_pm;
 
 /** @ingroup SURF_models
  *  @brief The CPU model object for the virtual machine layer
  */
-XBT_PUBLIC_DATA simgrid::surf::CpuModel* surf_cpu_model_vm;
+XBT_PUBLIC_DATA simgrid::kernel::resource::CpuModel* surf_cpu_model_vm;
 
 /** @ingroup SURF_models
  *  @brief The host model
diff --git a/src/include/xxhash.hpp b/src/include/xxhash.hpp
new file mode 100644 (file)
index 0000000..81e8207
--- /dev/null
@@ -0,0 +1,719 @@
+#pragma once
+#include <cstdint>
+#include <cstring>
+#include <array>
+#include <type_traits>
+#include <cstdint>
+#include <vector>
+#include <string>
+
+#include <iostream>
+
+/*
+xxHash - Extremely Fast Hash algorithm
+Header File
+Copyright (C) 2012-2018, Yann Collet.
+Copyright (C) 2017-2018, Piotr Pliszka.
+All rights reserved.
+
+BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+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.
+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.
+You can contact the author at :
+- xxHash source repository : https://github.com/Cyan4973/xxHash
+- xxHash C++ port repository : https://github.com/RedSpah/xxhash_cpp
+*/
+
+/* *************************************
+*  Tuning parameters
+***************************************/
+/*!XXH_FORCE_MEMORY_ACCESS :
+* By default, access to unaligned memory is controlled by `memcpy()`, which is safe and portable.
+* Unfortunately, on some target/compiler combinations, the generated assembly is sub-optimal.
+* The below switch allow to select different access method for improved performance.
+* Method 0 (default) : use `memcpy()`. Safe and portable.
+* Method 1 : `__packed` statement. It depends on compiler extension (ie, not portable).
+*            This method is safe if your compiler supports it, and *generally* as fast or faster than `memcpy`.
+* Method 2 : direct access. This method doesn't depend on compiler but violate C standard.
+*            It can generate buggy code on targets which do not support unaligned memory accesses.
+*            But in some circumstances, it's the only known way to get the most performance (ie GCC + ARMv6)
+* See http://stackoverflow.com/a/32095106/646947 for details.
+* Prefer these methods in priority order (0 > 1 > 2)
+*/
+#ifndef XXH_FORCE_MEMORY_ACCESS   /* can be defined externally, on command line for example */
+#  if defined(__GNUC__) && ( defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) )
+#    define XXH_FORCE_MEMORY_ACCESS 2
+#  elif defined(__INTEL_COMPILER) || (defined(__GNUC__) && ( defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) ))
+#    define XXH_FORCE_MEMORY_ACCESS 1
+#  endif
+#endif
+
+
+/*!XXH_FORCE_NATIVE_FORMAT :
+* By default, xxHash library provides endian-independent Hash values, based on little-endian convention.
+* Results are therefore identical for little-endian and big-endian CPU.
+* This comes at a performance cost for big-endian CPU, since some swapping is required to emulate little-endian format.
+* Should endian-independence be of no importance for your application, you may set the #define below to 1,
+* to improve speed for Big-endian CPU.
+* This option has no impact on Little_Endian CPU.
+*/
+#if !defined(XXH_FORCE_NATIVE_FORMAT) || (XXH_FORCE_NATIVE_FORMAT == 0)  /* can be defined externally */
+#      define XXH_FORCE_NATIVE_FORMAT 0
+#      define XXH_CPU_LITTLE_ENDIAN 1
+#endif
+
+
+/*!XXH_FORCE_ALIGN_CHECK :
+* This is a minor performance trick, only useful with lots of very small keys.
+* It means : check for aligned/unaligned input.
+* The check costs one initial branch per hash;
+* set it to 0 when the input is guaranteed to be aligned,
+* or when alignment doesn't matter for performance.
+*/
+#ifndef XXH_FORCE_ALIGN_CHECK /* can be defined externally */
+#      if defined(__i386) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64)
+#              define XXH_FORCE_ALIGN_CHECK 0
+#      else
+#              define XXH_FORCE_ALIGN_CHECK 1
+#      endif
+#endif
+
+/*!XXH_CPU_LITTLE_ENDIAN :
+* This is a CPU endian detection macro, will be
+* automatically set to 1 (little endian) if XXH_FORCE_NATIVE_FORMAT
+* is left undefined, XXH_FORCE_NATIVE_FORMAT is defined to 0, or if an x86/x86_64 compiler macro is defined.
+* If left undefined, endianness will be determined at runtime, at the cost of a slight one-time overhead
+* and a larger overhead due to get_endian() not being constexpr.
+*/
+#ifndef XXH_CPU_LITTLE_ENDIAN
+#      if defined(__i386) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64)
+#              define XXH_CPU_LITTLE_ENDIAN 1
+#      endif
+#endif
+
+/* *************************************
+*  Compiler Specific Options
+***************************************/
+#define XXH_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
+
+namespace xxh
+{
+       /* *************************************
+       *  Version
+       ***************************************/
+       constexpr int cpp_version_major = 0;
+       constexpr int cpp_version_minor = 6;
+       constexpr int cpp_version_release = 5;
+       constexpr uint32_t version_number() { return cpp_version_major * 10000 + cpp_version_minor * 100 + cpp_version_release; }
+
+       namespace hash_t_impl
+       {
+               /* *************************************
+               *  Basic Types - Detail
+               ***************************************/
+
+               using _hash32_underlying = uint32_t;
+               using _hash64_underlying = uint64_t;
+
+               template <size_t N>
+               struct hash_type { using type = void; };
+               template <>
+               struct hash_type<32> { using type = _hash32_underlying; };
+               template <>
+               struct hash_type<64> { using type = _hash64_underlying; };
+       }
+
+       /* *************************************
+       *  Basic Types - Public
+       ***************************************/
+
+       template <size_t N>
+       using hash_t = typename hash_t_impl::hash_type<N>::type;
+       using hash32_t = hash_t<32>;
+       using hash64_t = hash_t<64>;
+
+       /* *************************************
+       *  Bit Functions - Public
+       ***************************************/
+
+       namespace bit_ops
+       {
+               /* ****************************************
+               *  Intrinsics and Bit Operations
+               ******************************************/
+
+#if defined(_MSC_VER)
+               inline uint32_t rotl32(uint32_t x, int32_t r) { return _rotl(x, r); }
+               inline uint64_t rotl64(uint64_t x, int32_t r) { return _rotl64(x, r); }
+#else
+               inline uint32_t rotl32(uint32_t x, int32_t r) { return ((x << r) | (x >> (32 - r))); }
+               inline uint64_t rotl64(uint64_t x, int32_t r) { return ((x << r) | (x >> (64 - r))); }
+#endif
+
+#if defined(_MSC_VER)     /* Visual Studio */
+               inline uint32_t swap32(uint32_t x) { return _byteswap_ulong(x); }
+               inline uint64_t swap64(uint64_t x) { return _byteswap_uint64(x); }
+#elif XXH_GCC_VERSION >= 403
+               inline uint32_t swap32(uint32_t x) { return __builtin_bswap32(x); }
+               inline uint64_t swap64(uint64_t x) { return __builtin_bswap64(x); }
+#else
+               inline uint32_t swap32(uint32_t x) { return ((x << 24) & 0xff000000) | ((x << 8) & 0x00ff0000) | ((x >> 8) & 0x0000ff00) | ((x >> 24) & 0x000000ff); }
+               inline uint64_t swap64(uint64_t x) { return ((x << 56) & 0xff00000000000000ULL) | ((x << 40) & 0x00ff000000000000ULL) | ((x << 24) & 0x0000ff0000000000ULL) | ((x << 8) & 0x000000ff00000000ULL) | ((x >> 8) & 0x00000000ff000000ULL) | ((x >> 24) & 0x0000000000ff0000ULL) | ((x >> 40) & 0x000000000000ff00ULL) | ((x >> 56) & 0x00000000000000ffULL); }
+#endif
+               template <size_t N>
+               inline hash_t<N> rotl(hash_t<N> n, int32_t r) {};
+
+               template <>
+               inline hash_t<32> rotl<32>(hash_t<32> n, int32_t r)
+               {
+                       return rotl32(n, r);
+               };
+
+               template <>
+               inline hash_t<64> rotl<64>(hash_t<64> n, int32_t r)
+               {
+                       return rotl64(n, r);
+               };
+
+               template <size_t N>
+               inline hash_t<N> swap(hash_t<N> n) {};
+
+               template <>
+               inline hash_t<32> swap<32>(hash_t<32> n)
+               {
+                       return swap32(n);
+               };
+
+               template <>
+               inline hash_t<64> swap<64>(hash_t<64> n)
+               {
+                       return swap64(n);
+               };
+       }
+
+       /* *************************************
+       *  Memory Functions - Public
+       ***************************************/
+
+       enum class alignment : uint8_t { aligned, unaligned };
+       enum class endianness : uint8_t { big_endian = 0, little_endian = 1, unspecified = 2 };
+
+       namespace mem_ops
+       {
+               /* *************************************
+               *  Memory Access
+               ***************************************/
+#if (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==2))
+
+               /* Force direct memory access. Only works on CPU which support unaligned memory access in hardware */
+               template <size_t N>
+               inline hash_t<N> read_unaligned(const void* memPtr) { return *(const hash_t<N>*)memPtr; }
+
+#elif (defined(XXH_FORCE_MEMORY_ACCESS) && (XXH_FORCE_MEMORY_ACCESS==1))
+
+               /* __pack instructions are safer, but compiler specific, hence potentially problematic for some compilers */
+               /* currently only defined for gcc and icc */
+               template <size_t N>
+               using unalign = union { hash_t<N> uval; } __attribute((packed));
+
+               template <size_t N>
+               inline hash_t<N> read_unaligned(const void* memPtr) { return ((const unalign*)memPtr)->uval; }
+#else
+
+               /* portable and safe solution. Generally efficient.
+               * see : http://stackoverflow.com/a/32095106/646947
+               */
+               template <size_t N>
+               inline hash_t<N> read_unaligned(const void* memPtr)
+               {
+                       hash_t<N> val;
+                       memcpy(&val, memPtr, sizeof(val));
+                       return val;
+               }
+
+#endif   /* XXH_FORCE_DIRECT_MEMORY_ACCESS */
+
+               inline hash_t<32> read32(const void* memPtr) { return read_unaligned<32>(memPtr); }
+               inline hash_t<64> read64(const void* memPtr) { return read_unaligned<64>(memPtr); }
+
+               /* *************************************
+               *  Architecture Macros
+               ***************************************/
+
+               /* XXH_CPU_LITTLE_ENDIAN can be defined externally, for example on the compiler command line */
+
+#ifndef XXH_CPU_LITTLE_ENDIAN
+
+               inline endianness get_endian(endianness endian)
+               {
+                       static struct _dummy_t
+                       {
+                               std::array<endianness, 3> endian_lookup = { endianness::big_endian, endianness::little_endian, endianness::unspecified };
+                               const int g_one = 1;
+                               _dummy_t()
+                               {
+                                       endian_lookup[2] = static_cast<endianness>(*(const char*)(&g_one));
+                               }
+                       } _dummy;
+
+                       return _dummy.endian_lookup[(uint8_t)endian];
+               }
+
+               inline bool is_little_endian()
+               {
+                       return get_endian(endianness::unspecified) == endianness::little_endian;
+               }
+
+#else
+               constexpr endianness get_endian(endianness endian)
+               {
+                       constexpr std::array<endianness, 3> endian_lookup = { endianness::big_endian, endianness::little_endian, (XXH_CPU_LITTLE_ENDIAN) ? endianness::little_endian : endianness::big_endian };
+                       return endian_lookup[static_cast<uint8_t>(endian)];
+               }
+
+               constexpr bool is_little_endian()
+               {
+                       return get_endian(endianness::unspecified) == endianness::little_endian;
+               }
+
+#endif
+
+
+
+               /* ***************************
+               *  Memory reads
+               *****************************/
+
+
+               template <size_t N>
+               inline hash_t<N> readLE_align(const void* ptr, endianness endian, alignment align)
+               {
+                       if (align == alignment::unaligned)
+                       {
+                               return endian == endianness::little_endian ? read_unaligned<N>(ptr) : bit_ops::swap<N>(read_unaligned<N>(ptr));
+                       }
+                       else
+                       {
+                               return endian == endianness::little_endian ? *reinterpret_cast<const hash_t<N>*>(ptr) : bit_ops::swap<N>(*reinterpret_cast<const hash_t<N>*>(ptr));
+                       }
+               }
+
+               template <size_t N>
+               inline hash_t<N> readLE(const void* ptr, endianness endian)
+               {
+                       return readLE_align<N>(ptr, endian, alignment::unaligned);
+               }
+
+               template <size_t N>
+               inline hash_t<N> readBE(const void* ptr)
+               {
+                       return is_little_endian() ? bit_ops::swap<N>(read_unaligned<N>(ptr)) : read_unaligned<N>(ptr);
+               }
+
+               template <size_t N>
+               inline alignment get_alignment(const void* input)
+               {
+                       return ((XXH_FORCE_ALIGN_CHECK) && ((reinterpret_cast<uintptr_t>(input) & ((N / 8) - 1)) == 0)) ? xxh::alignment::aligned : xxh::alignment::unaligned;
+               }
+       }
+
+       /* *******************************************************************
+       *  Hash functions
+       *********************************************************************/
+
+       namespace detail
+       {
+               /* *******************************************************************
+               *  Hash functions - Implementation
+               *********************************************************************/
+
+               constexpr static std::array<hash32_t, 5> primes32 = { 2654435761U, 2246822519U, 3266489917U, 668265263U, 374761393U };
+               constexpr static std::array<hash64_t, 5> primes64 = { 11400714785074694791ULL, 14029467366897019727ULL, 1609587929392839161ULL, 9650029242287828579ULL, 2870177450012600261ULL };
+
+               template <size_t N>
+               constexpr hash_t<N> PRIME(int32_t n) {};
+
+               template <>
+               constexpr hash32_t PRIME<32>(int32_t n)
+               {
+                       return primes32[n - 1];
+               }
+
+               template <>
+               constexpr hash64_t PRIME<64>(int32_t n)
+               {
+                       return primes64[n - 1];
+               }
+
+               template <size_t N>
+               inline hash_t<N> round(hash_t<N> seed, hash_t<N> input)
+               {
+                       seed += input * PRIME<N>(2);
+                       seed = bit_ops::rotl<N>(seed, ((N == 32) ? 13 : 31));
+                       seed *= PRIME<N>(1);
+                       return seed;
+               }
+
+               inline hash64_t mergeRound64(hash64_t acc, hash64_t val)
+               {
+                       val = round<64>(0, val);
+                       acc ^= val;
+                       acc = acc * PRIME<64>(1) + PRIME<64>(4);
+                       return acc;
+               }
+
+               template <size_t N>
+               inline void endian_align_sub_mergeround([[maybe_unused]] hash_t<N>& hash_ret, hash_t<N> v1, hash_t<N> v2, hash_t<N> v3, hash_t<N> v4) {};
+
+               template <>
+               inline void endian_align_sub_mergeround<64>(hash_t<64>& hash_ret, hash_t<64> v1, hash_t<64> v2, hash_t<64> v3, hash_t<64> v4)
+               {
+                       hash_ret = mergeRound64(hash_ret, v1);
+                       hash_ret = mergeRound64(hash_ret, v2);
+                       hash_ret = mergeRound64(hash_ret, v3);
+                       hash_ret = mergeRound64(hash_ret, v4);
+               }
+
+               template <size_t N>
+               inline hash_t<N> endian_align_sub_ending(hash_t<N> hash_ret, const uint8_t* p, const uint8_t* bEnd, xxh::endianness endian, xxh::alignment align) {};
+
+               template <>
+               inline hash_t<32> endian_align_sub_ending<32>(hash_t<32> hash_ret, const uint8_t* p, const uint8_t* bEnd, xxh::endianness endian, xxh::alignment align)
+               {
+                       while ((p + 4) <= bEnd)
+                       {
+                               hash_ret += mem_ops::readLE_align<32>(p, endian, align) * PRIME<32>(3);
+                               hash_ret = bit_ops::rotl<32>(hash_ret, 17) * PRIME<32>(4);
+                               p += 4;
+                       }
+
+                       while (p < bEnd)
+                       {
+                               hash_ret += (*p) * PRIME<32>(5);
+                               hash_ret = bit_ops::rotl<32>(hash_ret, 11) * PRIME<32>(1);
+                               p++;
+                       }
+
+                       hash_ret ^= hash_ret >> 15;
+                       hash_ret *= PRIME<32>(2);
+                       hash_ret ^= hash_ret >> 13;
+                       hash_ret *= PRIME<32>(3);
+                       hash_ret ^= hash_ret >> 16;
+
+                       return hash_ret;
+               }
+
+               template <>
+               inline hash_t<64> endian_align_sub_ending<64>(hash_t<64> hash_ret, const uint8_t* p, const uint8_t* bEnd, xxh::endianness endian, xxh::alignment align)
+               {
+                       while (p + 8 <= bEnd)
+                       {
+                               const hash64_t k1 = round<64>(0, mem_ops::readLE_align<64>(p, endian, align));
+                               hash_ret ^= k1;
+                               hash_ret = bit_ops::rotl<64>(hash_ret, 27) * PRIME<64>(1) + PRIME<64>(4);
+                               p += 8;
+                       }
+
+                       if (p + 4 <= bEnd)
+                       {
+                               hash_ret ^= static_cast<hash64_t>(mem_ops::readLE_align<32>(p, endian, align)) * PRIME<64>(1);
+                               hash_ret = bit_ops::rotl<64>(hash_ret, 23) * PRIME<64>(2) + PRIME<64>(3);
+                               p += 4;
+                       }
+
+                       while (p < bEnd)
+                       {
+                               hash_ret ^= (*p) * PRIME<64>(5);
+                               hash_ret = bit_ops::rotl<64>(hash_ret, 11) * PRIME<64>(1);
+                               p++;
+                       }
+
+                       hash_ret ^= hash_ret >> 33;
+                       hash_ret *= PRIME<64>(2);
+                       hash_ret ^= hash_ret >> 29;
+                       hash_ret *= PRIME<64>(3);
+                       hash_ret ^= hash_ret >> 32;
+
+                       return hash_ret;
+               }
+
+               template <size_t N>
+               inline hash_t<N> endian_align(const void* input, size_t len, hash_t<N> seed, xxh::endianness endian, xxh::alignment align)
+               {
+                       static_assert(!(N != 32 && N != 64), "You can only call endian_align in 32 or 64 bit mode.");
+
+                       const uint8_t* p = static_cast<const uint8_t*>(input);
+                       const uint8_t* bEnd = p + len;
+                       hash_t<N> hash_ret;
+
+                       if (len >= (N / 2))
+                       {
+                               const uint8_t* const limit = bEnd - (N / 2);
+                               hash_t<N> v1 = seed + PRIME<N>(1) + PRIME<N>(2);
+                               hash_t<N> v2 = seed + PRIME<N>(2);
+                               hash_t<N> v3 = seed + 0;
+                               hash_t<N> v4 = seed - PRIME<N>(1);
+
+                               do
+                               {
+                                       v1 = round<N>(v1, mem_ops::readLE_align<N>(p, endian, align)); p += (N / 8);
+                                       v2 = round<N>(v2, mem_ops::readLE_align<N>(p, endian, align)); p += (N / 8);
+                                       v3 = round<N>(v3, mem_ops::readLE_align<N>(p, endian, align)); p += (N / 8);
+                                       v4 = round<N>(v4, mem_ops::readLE_align<N>(p, endian, align)); p += (N / 8);
+                               } while (p <= limit);
+
+                               hash_ret = bit_ops::rotl<N>(v1, 1) + bit_ops::rotl<N>(v2, 7) + bit_ops::rotl<N>(v3, 12) + bit_ops::rotl<N>(v4, 18);
+
+                               endian_align_sub_mergeround<N>(hash_ret, v1, v2, v3, v4);
+                       }
+                       else { hash_ret = seed + PRIME<N>(5); }
+
+                       hash_ret += static_cast<hash_t<N>>(len);
+
+                       return endian_align_sub_ending<N>(hash_ret, p, bEnd, endian, align);
+               }
+       }
+
+       template <size_t N>
+       hash_t<N> xxhash(const void* input, size_t len, hash_t<N> seed = 0, endianness endian = endianness::unspecified)
+       {
+               static_assert(!(N != 32 && N != 64), "You can only call xxhash in 32 or 64 bit mode.");
+               return detail::endian_align<N>(input, len, seed, mem_ops::get_endian(endian), mem_ops::get_alignment<N>(input));
+       }
+
+       template <size_t N, typename T>
+       hash_t<N> xxhash(const std::basic_string<T>& input, hash_t<N> seed = 0, endianness endian = endianness::unspecified)
+       {
+               static_assert(!(N != 32 && N != 64), "You can only call xxhash in 32 or 64 bit mode.");
+               return detail::endian_align<N>(static_cast<const void*>(input.data()), input.length() * sizeof(T), seed, mem_ops::get_endian(endian), mem_ops::get_alignment<N>(static_cast<const void*>(input.data())));
+       }
+
+       template <size_t N, typename ContiguousIterator>
+       hash_t<N> xxhash(ContiguousIterator begin, ContiguousIterator end, hash_t<N> seed = 0, endianness endian = endianness::unspecified)
+       {
+               static_assert(!(N != 32 && N != 64), "You can only call xxhash in 32 or 64 bit mode.");
+               using T = typename std::decay_t<decltype(*end)>;
+               return detail::endian_align<N>(static_cast<const void*>(&*begin), (end - begin) * sizeof(T), seed, mem_ops::get_endian(endian), mem_ops::get_alignment<N>(static_cast<const void*>(&*begin)));
+       }
+
+       template <size_t N, typename T>
+       hash_t<N> xxhash(const std::vector<T>& input, hash_t<N> seed = 0, endianness endian = endianness::unspecified)
+       {
+               static_assert(!(N != 32 && N != 64), "You can only call xxhash in 32 or 64 bit mode.");
+               return detail::endian_align<N>(static_cast<const void*>(input.data()), input.size() * sizeof(T), seed, mem_ops::get_endian(endian), mem_ops::get_alignment<N>(static_cast<const void*>(input.data())));
+       }
+
+       template <size_t N, typename T, size_t AN>
+       hash_t<N> xxhash(const std::array<T, AN>& input, hash_t<N> seed = 0, endianness endian = endianness::unspecified)
+       {
+               static_assert(!(N != 32 && N != 64), "You can only call xxhash in 32 or 64 bit mode.");
+               return detail::endian_align<N>(static_cast<const void*>(input.data()), AN * sizeof(T), seed, mem_ops::get_endian(endian), mem_ops::get_alignment<N>(static_cast<const void*>(input.data())));
+       }
+
+       template <size_t N, typename T>
+       hash_t<N> xxhash(const std::initializer_list<T>& input, hash_t<N> seed = 0, endianness endian = endianness::unspecified)
+       {
+               static_assert(!(N != 32 && N != 64), "You can only call xxhash in 32 or 64 bit mode.");
+               return detail::endian_align<N>(static_cast<const void*>(input.begin()), input.size() * sizeof(T), seed, mem_ops::get_endian(endian), mem_ops::get_alignment<N>(static_cast<const void*>(input.begin())));
+       }
+
+
+       /* *******************************************************************
+       *  Hash streaming
+       *********************************************************************/
+       enum class error_code : uint8_t { ok = 0, error };
+
+       template <size_t N>
+       class hash_state_t {
+
+               uint64_t total_len = 0;
+               hash_t<N> v1 = 0, v2 = 0, v3 = 0, v4 = 0;
+               std::array<hash_t<N>, 4> mem = {{ 0,0,0,0 }};
+               uint32_t memsize = 0;
+
+               inline error_code _update_impl(const void* input, size_t length, endianness endian)
+               {
+                       const uint8_t* p = reinterpret_cast<const uint8_t*>(input);
+                       const uint8_t* const bEnd = p + length;
+
+                       if (!input) { return xxh::error_code::error; }
+
+                       total_len += length;
+
+                       if (memsize + length < (N / 2))
+                       {   /* fill in tmp buffer */
+                               memcpy(reinterpret_cast<uint8_t*>(mem.data()) + memsize, input, length);
+                               memsize += static_cast<uint32_t>(length);
+                               return error_code::ok;
+                       }
+
+                       if (memsize)
+                       {   /* some data left from previous update */
+                               memcpy(reinterpret_cast<uint8_t*>(mem.data()) + memsize, input, (N / 2) - memsize);
+
+                               const hash_t<N>* ptr = mem.data();
+                               v1 = detail::round<N>(v1, mem_ops::readLE<N>(ptr, endian)); ptr++;
+                               v2 = detail::round<N>(v2, mem_ops::readLE<N>(ptr, endian)); ptr++;
+                               v3 = detail::round<N>(v3, mem_ops::readLE<N>(ptr, endian)); ptr++;
+                               v4 = detail::round<N>(v4, mem_ops::readLE<N>(ptr, endian));
+
+                               p += (N / 2) - memsize;
+                               memsize = 0;
+                       }
+
+                       if (p <= bEnd - (N / 2))
+                       {
+                               const uint8_t* const limit = bEnd - (N / 2);
+
+                               do
+                               {
+                                       v1 = detail::round<N>(v1, mem_ops::readLE<N>(p, endian)); p += (N / 8);
+                                       v2 = detail::round<N>(v2, mem_ops::readLE<N>(p, endian)); p += (N / 8);
+                                       v3 = detail::round<N>(v3, mem_ops::readLE<N>(p, endian)); p += (N / 8);
+                                       v4 = detail::round<N>(v4, mem_ops::readLE<N>(p, endian)); p += (N / 8);
+                               } while (p <= limit);
+                       }
+
+                       if (p < bEnd)
+                       {
+                               memcpy(mem.data(), p, static_cast<size_t>(bEnd - p));
+                               memsize = static_cast<uint32_t>(bEnd - p);
+                       }
+
+                       return error_code::ok;
+               }
+
+               inline hash_t<N> _digest_impl(endianness endian) const
+               {
+                       const uint8_t* p = reinterpret_cast<const uint8_t*>(mem.data());
+                       const uint8_t* const bEnd = reinterpret_cast<const uint8_t*>(mem.data()) + memsize;
+                       hash_t<N> hash_ret;
+
+                       if (total_len > (N / 2))
+                       {
+                               hash_ret = bit_ops::rotl<N>(v1, 1) + bit_ops::rotl<N>(v2, 7) + bit_ops::rotl<N>(v3, 12) + bit_ops::rotl<N>(v4, 18);
+
+                               detail::endian_align_sub_mergeround<N>(hash_ret, v1, v2, v3, v4);
+                       }
+                       else { hash_ret = v3 + detail::PRIME<N>(5); }
+
+                       hash_ret += static_cast<hash_t<N>>(total_len);
+
+                       return detail::endian_align_sub_ending<N>(hash_ret, p, bEnd, endian, alignment::unaligned);
+               }
+
+       public:
+               hash_state_t(hash_t<N> seed = 0)
+               {
+                       static_assert(!(N != 32 && N != 64), "You can only stream hashing in 32 or 64 bit mode.");
+                       v1 = seed + detail::PRIME<N>(1) + detail::PRIME<N>(2);
+                       v2 = seed + detail::PRIME<N>(2);
+                       v3 = seed + 0;
+                       v4 = seed - detail::PRIME<N>(1);
+               };
+
+               hash_state_t operator=(hash_state_t<N>& other)
+               {
+                       memcpy(this, other, sizeof(hash_state_t<N>));
+               }
+
+               error_code reset(hash_t<N> seed = 0)
+               {
+                       memset(this, 0, sizeof(hash_state_t<N>));
+                       v1 = seed + detail::PRIME<N>(1) + detail::PRIME<N>(2);
+                       v2 = seed + detail::PRIME<N>(2);
+                       v3 = seed + 0;
+                       v4 = seed - detail::PRIME<N>(1);
+                       return error_code::ok;
+               }
+
+               error_code update(const void* input, size_t length, endianness endian = endianness::unspecified)
+               {
+                       return _update_impl(input, length, mem_ops::get_endian(endian));
+               }
+
+               template <typename T>
+               error_code update(const std::basic_string<T>& input, endianness endian = endianness::unspecified)
+               {
+                       return _update_impl(static_cast<const void*>(input.data()), input.length() * sizeof(T), mem_ops::get_endian(endian));
+               }
+
+               template <typename ContiguousIterator>
+               error_code update(ContiguousIterator begin, ContiguousIterator end, endianness endian = endianness::unspecified)
+               {
+                       using T = typename std::decay_t<decltype(*end)>;
+                       return _update_impl(static_cast<const void*>(&*begin), (end - begin) * sizeof(T), mem_ops::get_endian(endian));
+               }
+
+               template <typename T>
+               error_code update(const std::vector<T>& input, endianness endian = endianness::unspecified)
+               {
+                       return _update_impl(static_cast<const void*>(input.data()), input.size() * sizeof(T), mem_ops::get_endian(endian));
+               }
+
+               template <typename T, size_t AN>
+               error_code update(const std::array<T, AN>& input, endianness endian = endianness::unspecified)
+               {
+                       return _update_impl(static_cast<const void*>(input.data()), AN * sizeof(T), mem_ops::get_endian(endian));
+               }
+
+               template <typename T>
+               error_code update(const std::initializer_list<T>& input, endianness endian = endianness::unspecified)
+               {
+                       return _update_impl(static_cast<const void*>(input.begin()), input.size() * sizeof(T), mem_ops::get_endian(endian));
+               }
+
+               hash_t<N> digest(endianness endian = endianness::unspecified)
+               {
+                       return _digest_impl(mem_ops::get_endian(endian));
+               }
+       };
+
+       using hash_state32_t = hash_state_t<32>;
+       using hash_state64_t = hash_state_t<64>;
+
+
+       /* *******************************************************************
+       *  Canonical
+       *********************************************************************/
+
+       template <size_t N>
+       struct canonical_t
+       {
+               std::array<uint8_t, N / 8> digest;\
+
+
+
+               canonical_t(hash_t<N> hash)
+               {
+                       if (mem_ops::is_little_endian()) { hash = bit_ops::swap<N>(hash); }
+                       memcpy(digest.data(), &hash, sizeof(canonical_t<N>));
+               }
+
+               hash_t<N> get_hash() const
+               {
+                       return mem_ops::readBE<N>(&digest);
+               }
+       };
+
+       using canonical32_t = canonical_t<32>;
+       using canonical64_t = canonical_t<64>;
+}
index c6cdff7..ff20f26 100644 (file)
@@ -4,6 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "include/xbt/config.hpp"
+#include "simgrid/Exception.hpp"
 #include "simgrid/s4u/Engine.hpp"
 #include "src/instr/instr_private.hpp"
 #include "surf/surf.hpp"
@@ -103,7 +104,9 @@ static void TRACE_start()
     std::string filename = TRACE_get_filename();
     tracing_file.open(filename.c_str(), std::ofstream::out);
     if (tracing_file.fail()) {
-      THROWF(system_error, 1, "Tracefile %s could not be opened for writing.", filename.c_str());
+      throw simgrid::TracingError(
+          XBT_THROW_POINT,
+          simgrid::xbt::string_printf("Tracefile %s could not be opened for writing.", filename.c_str()));
     }
 
     XBT_DEBUG("Filename %s is open for writing", filename.c_str());
@@ -291,9 +294,9 @@ void TRACE_global_init()
                                      6);
 
   /* Connect callbacks */
-  simgrid::s4u::on_platform_creation.connect(TRACE_start);
-  simgrid::s4u::on_deadlock.connect(TRACE_end);
-  simgrid::s4u::on_simulation_end.connect(TRACE_end);
+  simgrid::s4u::Engine::on_platform_creation.connect(TRACE_start);
+  simgrid::s4u::Engine::on_deadlock.connect(TRACE_end);
+  simgrid::s4u::Engine::on_simulation_end.connect(TRACE_end);
 }
 
 static void print_line(const char* option, const char* desc, const char* longdesc)
@@ -301,15 +304,15 @@ static void print_line(const char* option, const char* desc, const char* longdes
   std::string str = std::string("--cfg=") + option + " ";
 
   int len = str.size();
-  printf("%s%*.*s %s\n", str.c_str(), 30 - len, 30 - len, "", desc);
+  XBT_HELP("%s%*.*s %s", str.c_str(), 30 - len, 30 - len, "", desc);
   if (longdesc != nullptr) {
-    printf ("%s\n\n", longdesc);
+    XBT_HELP("%s\n", longdesc);
   }
 }
 
 void TRACE_help()
 {
-  printf("Description of the tracing options accepted by this simulator:\n\n");
+  XBT_HELP("Description of the tracing options accepted by this simulator:\n");
   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"
index 14e3d3b..83a1112 100644 (file)
@@ -3,12 +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 "simgrid/Exception.hpp"
 #include "simgrid/kernel/routing/NetPoint.hpp"
 #include "src/instr/instr_private.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/surf_private.hpp"
 #include "surf/surf.hpp"
 #include <algorithm>
+#include <cmath>
+#include <random>
 
 enum class InstrUserVariable { DECLARE, SET, ADD, SUB };
 
@@ -88,9 +91,11 @@ void TRACE_category_with_color (const char *category, const char *color)
   std::string final_color;
   if (not color) {
     //generate a random color
-    double red = drand48();
-    double green = drand48();
-    double blue = drand48();
+    static std::default_random_engine rnd_engine;
+    std::uniform_real_distribution<double> prng(0.0, std::nextafter(1.0, 2.0));
+    double red   = prng(rnd_engine);
+    double green = prng(rnd_engine);
+    double blue  = prng(rnd_engine);
     final_color  = std::to_string(red) + " " + std::to_string(green) + " " + std::to_string(blue);
   }else{
     final_color = std::string(color);
@@ -141,7 +146,8 @@ void TRACE_declare_mark(const char *mark_type)
 
   //check if mark_type is already declared
   if (declared_marks.find(mark_type) != declared_marks.end()) {
-    THROWF (tracing_error, 1, "mark_type with name (%s) is already declared", mark_type);
+    throw simgrid::TracingError(XBT_THROW_POINT,
+                                simgrid::xbt::string_printf("mark_type with name (%s) is already declared", mark_type));
   }
 
   XBT_DEBUG("MARK,declare %s", mark_type);
@@ -176,7 +182,8 @@ void TRACE_declare_mark_value_with_color (const char *mark_type, const char *mar
   simgrid::instr::EventType* type =
       static_cast<simgrid::instr::EventType*>(simgrid::instr::Container::get_root()->type_->by_name(mark_type));
   if (not type) {
-    THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type);
+    throw simgrid::TracingError(XBT_THROW_POINT,
+                                simgrid::xbt::string_printf("mark_type with name (%s) is not declared", mark_type));
   } else {
     if (not mark_color)
       mark_color = "1.0 1.0 1.0" /*white*/;
@@ -230,7 +237,8 @@ void TRACE_mark(const char *mark_type, const char *mark_value)
   simgrid::instr::EventType* type =
       static_cast<simgrid::instr::EventType*>(simgrid::instr::Container::get_root()->type_->by_name(mark_type));
   if (not type) {
-    THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type);
+    throw simgrid::TracingError(XBT_THROW_POINT,
+                                simgrid::xbt::string_printf("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::get_root(), type,
index dedda24..95bf51d 100644 (file)
@@ -3,9 +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 "simgrid/Exception.hpp"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "src/instr/instr_private.hpp"
+#include <sys/stat.h>
+#ifdef WIN32
+#include <direct.h> // _mkdir
+#endif
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_containers, instr, "Paje tracing event system (containers)");
 
@@ -89,7 +94,9 @@ Container::Container(const std::string& name, const std::string& type_name, Cont
 
   //register all kinds by name
   if (not allContainers.emplace(name_, this).second)
-    THROWF(tracing_error, 1, "container %s already present in allContainers data structure", get_cname());
+    throw simgrid::TracingError(
+        XBT_THROW_POINT,
+        simgrid::xbt::string_printf("container %s already present in allContainers data structure", get_cname()));
 
   XBT_DEBUG("Add container name '%s'", get_cname());
 
index ed016d8..54ebc59 100644 (file)
@@ -83,10 +83,6 @@ void VariableEvent::print()
   tracing_file << stream_.str() << std::endl;
 }
 
-StateEvent::~StateEvent(){
-  delete extra_;
-}
-
 void StateEvent::print()
 {
   if (trace_format == simgrid::instr::TraceFormat::Paje) {
@@ -109,15 +105,18 @@ void StateEvent::print()
       return;
 
     /* Unimplemented calls are: WAITANY, SENDRECV, SCAN, EXSCAN, SSEND, and ISSEND. */
-
+    std::string container_name(get_container()->get_name());
     // FIXME: dirty extract "rank-" from the name, as we want the bare process id here
-    if (get_container()->get_name().find("rank-") != 0) {
-      stream_ << get_container()->get_name() << " " << extra_->print();
-    } else {
+    if (get_container()->get_name().find("rank-") == 0) {
       /* Subtract -1 because this is the process id and we transform it to the rank id */
-      std::string container_name(get_container()->get_name());
-      stream_ << stoi(container_name.erase(0, 5)) - 1 << " " << extra_->print();
+      container_name=std::to_string(stoi(container_name.erase(0, 5)) - 1);
     }
+#if HAVE_SMPI
+    if (simgrid::config::get_value<bool>("smpi/trace-call-location")) {
+      stream_ << container_name << " location " << filename << " " << linenumber << std::endl ;
+    }
+#endif
+    stream_ << container_name << " " << extra_->print();
     *tracing_files.at(get_container()) << stream_.str() << std::endl;
   } else {
     THROW_IMPOSSIBLE;
index d57c644..d1004b1 100644 (file)
@@ -70,11 +70,10 @@ class StateEvent : public PajeEvent {
   std::string filename = "(null)";
   int linenumber       = -1;
 #endif
-  TIData* extra_;
+  std::unique_ptr<TIData> extra_;
 
 public:
   StateEvent(Container* container, Type* type, e_event_type event_type, EntityValue* value, TIData* extra);
-  ~StateEvent();
   void print() override;
 };
 
index f880887..927a8db 100644 (file)
@@ -4,6 +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 "simgrid/Exception.hpp"
 #include "simgrid/sg_config.hpp"
 #include "src/instr/instr_private.hpp"
 #include "src/instr/instr_smpi.hpp"
@@ -30,7 +31,9 @@ void dump_comment_file(const std::string& filename)
   std::ifstream fs(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());
+    throw simgrid::TracingError(
+        XBT_THROW_POINT,
+        simgrid::xbt::string_printf("Comment file %s could not be opened for reading.", filename.c_str()));
 
   while (not fs.eof()) {
     std::string line;
@@ -68,20 +71,6 @@ void TRACE_paje_dump_buffer(bool force)
   XBT_DEBUG("%s: ends", __func__);
 }
 
-static 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 const& event : *buf) {
-    event->print();
-    XBT_DEBUG("%p %s", event, event->stream_.str().c_str());
-    event->stream_.str("");
-    event->stream_.clear();
-  }
-  XBT_DEBUG("<<<<<<");
-}
-
 /* internal do the instrumentation module */
 void simgrid::instr::PajeEvent::insert_into_buffer()
 {
index 3df9437..bc9f521 100644 (file)
@@ -4,6 +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 "simgrid/Exception.hpp"
 #include "src/instr/instr_private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_types, instr, "Paje tracing event system (types)");
@@ -19,10 +20,10 @@ Type::Type(const std::string& name, const std::string& alias, const std::string&
     : id_(instr_new_paje_id()), name_(name), color_(color), father_(father)
 {
   if (name_.empty() || alias.empty())
-    THROWF(tracing_error, 0, "can't create a new type with no name or alias");
+    throw simgrid::TracingError(XBT_THROW_POINT, "can't create a new type with no name or alias");
 
   if (father != nullptr){
-    father->children_.insert({alias, this});
+    father->children_[alias].reset(this);
     XBT_DEBUG("new type %s, child of %s", get_cname(), father->get_cname());
   }
   if (trace_format == simgrid::instr::TraceFormat::Paje) {
@@ -30,18 +31,6 @@ Type::Type(const std::string& name, const std::string& alias, const std::string&
   }
 }
 
-Type::~Type()
-{
-  for (auto elm : children_)
-    delete elm.second;
-}
-
-ValueType::~ValueType()
-{
-  for (auto elm : values_)
-    delete elm.second;
-}
-
 ContainerType::ContainerType(const std::string& name, Type* father) : Type(name, name, "", father)
 {
   XBT_DEBUG("ContainerType %s(%lld), child of %s(%lld)", get_cname(), get_id(), father->get_cname(), father->get_id());
@@ -60,11 +49,6 @@ StateType::StateType(const std::string& name, Type* father) : ValueType(name, fa
   log_definition(PAJE_DefineStateType);
 }
 
-StateType::~StateType()
-{
-  events_.clear();
-}
-
 void StateType::set_event(const std::string& value_name)
 {
   events_.push_back(new StateEvent(issuer_, this, PAJE_SetState, get_entity_value(value_name), nullptr));
@@ -97,11 +81,6 @@ VariableType::VariableType(const std::string& name, const std::string& color, Ty
   log_definition(PAJE_DefineVariableType);
 }
 
-VariableType::~VariableType()
-{
-  events_.clear();
-}
-
 void VariableType::instr_event(double now, double delta, const char* resource, double value)
 {
   /* To trace resource utilization, we use AddEvent and SubEvent only. This implies to add a SetEvent first to set the
@@ -181,17 +160,19 @@ void Type::log_definition(simgrid::instr::Type* source, simgrid::instr::Type* de
 Type* Type::by_name(const std::string& name)
 {
   Type* ret = nullptr;
-  for (auto elm : children_) {
+  for (auto const& elm : children_) {
     if (elm.second->name_ == name) {
       if (ret != nullptr) {
-        THROWF (tracing_error, 0, "there are two children types with the same name?");
+        throw simgrid::TracingError(XBT_THROW_POINT, "there are two children types with the same name?");
       } else {
-        ret = elm.second;
+        ret = elm.second.get();
       }
     }
   }
   if (ret == nullptr)
-    THROWF(tracing_error, 2, "type with name (%s) not found in father type (%s)", name.c_str(), get_cname());
+    throw simgrid::TracingError(
+        XBT_THROW_POINT,
+        simgrid::xbt::string_printf("type with name (%s) not found in father type (%s)", name.c_str(), get_cname()));
   return ret;
 }
 
@@ -203,14 +184,13 @@ void ValueType::add_entity_value(const std::string& name)
 void ValueType::add_entity_value(const std::string& name, const std::string& color)
 {
   if (name.empty())
-    THROWF(tracing_error, 0, "can't get a value with no name");
+    throw simgrid::TracingError(XBT_THROW_POINT, "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});
+    auto res = values_.emplace(name, EntityValue(name, color, this));
     XBT_DEBUG("new value %s, child of %s", name.c_str(), get_cname());
-    new_val->print();
+    res.first->second.print();
   }
 }
 
@@ -218,16 +198,19 @@ EntityValue* ValueType::get_entity_value(const 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(), get_cname());
+    throw simgrid::TracingError(
+        XBT_THROW_POINT,
+        simgrid::xbt::string_printf("value with name (%s) not found in father type (%s)", name.c_str(), get_cname()));
   }
-  return ret->second;
+  return &ret->second;
 }
 
 VariableType* Type::by_name_or_create(const std::string& name, const 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);
+  return cont == children_.end() ? new VariableType(name, mycolor, this)
+                                 : static_cast<VariableType*>(cont->second.get());
 }
 
 LinkType* Type::by_name_or_create(const std::string& name, Type* source, Type* dest)
@@ -241,7 +224,7 @@ LinkType* Type::by_name_or_create(const std::string& name, Type* source, Type* d
     ret->log_definition(source, dest);
     return ret;
   } else
-    return static_cast<LinkType*>(it->second);
+    return static_cast<LinkType*>(it->second.get());
 }
 }
 }
index eed2593..0c9c668 100644 (file)
@@ -7,6 +7,7 @@
 #define INSTR_PAJE_TYPES_HPP
 
 #include "src/instr/instr_private.hpp"
+#include <memory>
 #include <sstream>
 #include <string>
 #include <vector>
@@ -23,12 +24,12 @@ class Type {
   Type* father_;
 
 public:
-  std::map<std::string, Type*> children_;
+  std::map<std::string, std::unique_ptr<Type>> children_;
   Container* issuer_ = nullptr;
   std::stringstream stream_;
 
   Type(const std::string& name, const std::string& alias, const std::string& color, Type* father);
-  virtual ~Type();
+  virtual ~Type() = default;
 
   const std::string& get_name() const { return name_; }
   const char* get_cname() { return name_.c_str(); }
@@ -42,7 +43,7 @@ public:
   template <class T> T* by_name_or_create(const std::string& name)
   {
     auto cont = children_.find(name);
-    return cont == children_.end() ? new T(name, this) : static_cast<T*>(cont->second);
+    return cont == children_.end() ? new T(name, this) : static_cast<T*>(cont->second.get());
   }
 
   void set_calling_container(Container* container) { issuer_ = container; }
@@ -61,7 +62,6 @@ class VariableType : public Type {
   std::vector<VariableEvent*> events_;
 public:
   VariableType(const std::string& name, const std::string& color, Type* father);
-  ~VariableType();
   void instr_event(double now, double delta, const char* resource, double value);
   void set_event(double timestamp, double value);
   void add_event(double timestamp, double value);
@@ -70,10 +70,10 @@ public:
 
 class ValueType : public Type {
 public:
-  std::map<std::string, EntityValue*> values_;
+  std::map<std::string, EntityValue> values_;
   ValueType(const std::string& name, const std::string& alias, Type* father) : Type(name, alias, "", father){};
   ValueType(const std::string& name, Type* father) : Type(name, name, "", father){};
-  virtual ~ValueType();
+  virtual ~ValueType() = default;
   void add_entity_value(const std::string& name, const std::string& color);
   void add_entity_value(const std::string& name);
   EntityValue* get_entity_value(const std::string& name);
@@ -96,7 +96,6 @@ class StateType : public ValueType {
   std::vector<StateEvent*> events_;
 public:
   StateType(const std::string& name, Type* father);
-  ~StateType();
   void set_event(const std::string& value_name);
   void push_event(const std::string& value_name);
   void push_event(const std::string& value_name, TIData* extra);
index 4e96d8a..9014e60 100644 (file)
@@ -20,7 +20,6 @@ class EntityValue {
 
 public:
   explicit EntityValue(const std::string& name, const std::string& color, Type* father);
-  ~EntityValue() = default;
   const char* get_cname() { return name_.c_str(); }
   long long int get_id() { return id_; }
   void print();
index e260779..f72c308 100644 (file)
@@ -247,9 +247,8 @@ static void instr_action_on_state_change(simgrid::kernel::resource::Action const
   for (int i = 0; i < n; i++) {
     double value = action.get_variable()->get_value() * action.get_variable()->get_constraint_weight(i);
     /* Beware of composite actions: ptasks put links and cpus together. Extra pb: we cannot dynamic_cast from void* */
-    simgrid::kernel::resource::Resource* resource =
-        static_cast<simgrid::kernel::resource::Resource*>(action.get_variable()->get_constraint(i)->get_id());
-    simgrid::surf::Cpu* cpu = dynamic_cast<simgrid::surf::Cpu*>(resource);
+    simgrid::kernel::resource::Resource* resource = action.get_variable()->get_constraint(i)->get_id();
+    simgrid::kernel::resource::Cpu* cpu = dynamic_cast<simgrid::kernel::resource::Cpu*>(resource);
 
     if (cpu != nullptr)
       TRACE_surf_resource_set_utilization("HOST", "speed_used", cpu->get_cname(), action.get_category(), value,
@@ -356,7 +355,7 @@ void instr_define_callbacks()
   // always need the callbacks to zones (we need only the root zone), to create the rootContainer and the rootType
   // properly
   if (TRACE_needs_platform()) {
-    simgrid::s4u::on_platform_created.connect(instr_on_platform_created);
+    simgrid::s4u::Engine::on_platform_created.connect(instr_on_platform_created);
     simgrid::s4u::Host::on_creation.connect(instr_host_on_creation);
     simgrid::s4u::Host::on_speed_change.connect(instr_host_on_speed_change);
     simgrid::s4u::Link::on_creation.connect(instr_link_on_creation);
@@ -367,7 +366,7 @@ void instr_define_callbacks()
   }
   simgrid::s4u::NetZone::on_creation.connect(instr_netzone_on_creation);
 
-  simgrid::surf::CpuAction::on_state_change.connect(instr_action_on_state_change);
+  simgrid::kernel::resource::CpuAction::on_state_change.connect(instr_action_on_state_change);
   simgrid::s4u::Link::on_communication_state_change.connect(instr_action_on_state_change);
 
   if (TRACE_actor_is_enabled()) {
@@ -389,10 +388,10 @@ void instr_define_callbacks()
     simgrid::s4u::Actor::on_wake_up.connect([](simgrid::s4u::Actor const& actor) {
       simgrid::instr::Container::by_name(instr_pid(actor))->get_state("ACTOR_STATE")->pop_event();
     });
-    simgrid::s4u::Exec::on_start.connect([](simgrid::s4u::Actor const& actor) {
+    simgrid::s4u::Exec::on_start.connect([](simgrid::s4u::Actor const& actor, simgrid::s4u::Exec const&) {
       simgrid::instr::Container::by_name(instr_pid(actor))->get_state("ACTOR_STATE")->push_event("execute");
     });
-    simgrid::s4u::Exec::on_completion.connect([](simgrid::s4u::Actor const& actor) {
+    simgrid::s4u::Exec::on_completion.connect([](simgrid::s4u::Actor const& actor, simgrid::s4u::Exec const&) {
       simgrid::instr::Container::by_name(instr_pid(actor))->get_state("ACTOR_STATE")->pop_event();
     });
     simgrid::s4u::Comm::on_sender_start.connect([](simgrid::s4u::Actor const& actor) {
@@ -439,8 +438,8 @@ static void recursiveNewVariableType(const std::string& new_typename, const std:
   if (root->get_name() == "LINK")
     root->by_name_or_create(std::string("b") + new_typename, color);
 
-  for (auto elm : root->children_) {
-    recursiveNewVariableType(new_typename, color, elm.second);
+  for (auto const& elm : root->children_) {
+    recursiveNewVariableType(new_typename, color, elm.second.get());
   }
 }
 
@@ -455,8 +454,8 @@ static void recursiveNewUserVariableType(const std::string& father_type, const s
   if (root->get_name() == father_type) {
     root->by_name_or_create(new_typename, color);
   }
-  for (auto elm : root->children_)
-    recursiveNewUserVariableType(father_type, new_typename, color, elm.second);
+  for (auto const& elm : root->children_)
+    recursiveNewUserVariableType(father_type, new_typename, color, elm.second.get());
 }
 
 void instr_new_user_variable_type(const std::string& father_type, const std::string& new_typename,
@@ -471,8 +470,8 @@ static void recursiveNewUserStateType(const std::string& father_type, const std:
   if (root->get_name() == father_type)
     root->by_name_or_create<simgrid::instr::StateType>(new_typename);
 
-  for (auto elm : root->children_)
-    recursiveNewUserStateType(father_type, new_typename, elm.second);
+  for (auto const& elm : root->children_)
+    recursiveNewUserStateType(father_type, new_typename, elm.second.get());
 }
 
 void instr_new_user_state_type(const std::string& father_type, const std::string& new_typename)
@@ -486,8 +485,8 @@ static void recursiveNewValueForUserStateType(const std::string& type_name, cons
   if (root->get_name() == type_name)
     static_cast<simgrid::instr::StateType*>(root)->add_entity_value(val, color);
 
-  for (auto elm : root->children_)
-    recursiveNewValueForUserStateType(type_name, val, color, elm.second);
+  for (auto const& elm : root->children_)
+    recursiveNewValueForUserStateType(type_name, val, color, elm.second.get());
 }
 
 void instr_new_value_for_user_state_type(const std::string& type_name, const char* value, const std::string& color)
index 985d664..35e9893 100644 (file)
 #include <set>
 #include <sstream>
 #include <string>
-#include <sys/stat.h>
-#ifdef WIN32
-#include <direct.h> // _mkdir
-/* Need to define function drand48 for Windows */
-#define drand48() (rand() / (RAND_MAX + 1.0))
-#endif
 
 typedef simgrid::instr::Container* container_t;
 
index 4ac56a9..f5f7f9f 100644 (file)
@@ -25,7 +25,6 @@ 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);
 /* SMPI + LB (load balancer) */
 XBT_PRIVATE void TRACE_smpi_process_change_host(int rank, sg_host_t new_host);
 
index e548f74..ddbecb0 100644 (file)
 namespace simgrid{
 namespace jedule {
 
-Jedule::~Jedule() {
-  delete this->root_container_;
-  for (auto const& evt : this->event_set_)
-    delete evt;
-  this->event_set_.clear();
-}
-
 void Jedule::add_meta_info(char* key, char* value)
 {
   xbt_assert(key != nullptr);
@@ -40,12 +33,12 @@ void Jedule::write_output(FILE* file)
     }
 
     fprintf(file, "  <platform>\n");
-    this->root_container_->print(file);
+    this->root_container_.print(file);
     fprintf(file, "  </platform>\n");
 
     fprintf(file, "  <events>\n");
     for (auto const& event : this->event_set_)
-      event->print(file);
+      event.print(file);
     fprintf(file, "  </events>\n");
 
     fprintf(file, "</jedule>\n");
index c166df4..2744fcd 100644 (file)
 namespace simgrid{
 namespace jedule{
 
-Event::Event(const std::string& name, double start_time, double end_time, const std::string& type)
-    : name_(name), start_time_(start_time), end_time_(end_time), type_(type)
-{
-  this->resource_subsets_ = new std::vector<jed_subset_t>();
-}
-
-Event::~Event()
-{
-  if (not this->resource_subsets_->empty()) {
-    for (auto const& subset : *this->resource_subsets_)
-      delete subset;
-    delete this->resource_subsets_;
-  }
-}
-
-void Event::add_resources(std::vector<sg_host_t>* host_selection)
+void Event::add_resources(const std::vector<sg_host_t>& host_selection)
 {
   get_resource_selection_by_hosts(this->resource_subsets_, host_selection);
 }
@@ -44,7 +29,7 @@ void Event::add_info(char* key, char* value)
   this->info_map_.insert({key, value});
 }
 
-void Event::print(FILE *jed_file)
+void Event::print(FILE* jed_file) const
 {
   fprintf(jed_file, "    <event>\n");
   fprintf(jed_file, "      <prop key=\"name\" value=\"%s\" />\n", this->name_.c_str());
@@ -52,12 +37,12 @@ void Event::print(FILE *jed_file)
   fprintf(jed_file, "      <prop key=\"end\" value=\"%g\" />\n", this->end_time_);
   fprintf(jed_file, "      <prop key=\"type\" value=\"%s\" />\n", this->type_.c_str());
 
-  xbt_assert(not this->resource_subsets_->empty());
+  xbt_assert(not this->resource_subsets_.empty());
   fprintf(jed_file, "      <res_util>\n");
-  for (auto const& subset : *this->resource_subsets_) {
+  for (auto const& subset : this->resource_subsets_) {
     fprintf(jed_file, "        <select resources=\"");
-    fprintf(jed_file, "%s", subset->parent->get_hierarchy_as_string().c_str());
-    fprintf(jed_file, ".[%d-%d]", subset->start_idx, subset->start_idx + subset->nres-1);
+    fprintf(jed_file, "%s", subset.parent->get_hierarchy_as_string().c_str());
+    fprintf(jed_file, ".[%d-%d]", subset.start_idx, subset.start_idx + subset.nres - 1);
     fprintf(jed_file, "\" />\n");
   }
   fprintf(jed_file, "      </res_util>\n");
@@ -65,14 +50,14 @@ void Event::print(FILE *jed_file)
   if (not this->characteristics_list_.empty()) {
     fprintf(jed_file, "      <characteristics>\n");
     for (auto const& ch : this->characteristics_list_)
-      fprintf(jed_file, "          <characteristic name=\"%s\" />\n", ch);
+      fprintf(jed_file, "          <characteristic name=\"%s\" />\n", ch.c_str());
     fprintf(jed_file, "      </characteristics>\n");
   }
 
   if (not this->info_map_.empty()) {
     fprintf(jed_file, "      <info>\n");
     for (auto const& elm : this->info_map_)
-      fprintf(jed_file, "        <prop key=\"%s\" value=\"%s\" />\n",elm.first,elm.second);
+      fprintf(jed_file, "        <prop key=\"%s\" value=\"%s\" />\n", elm.first.c_str(), elm.second.c_str());
     fprintf(jed_file, "      </info>\n");
   }
 
index 372c9c2..891b31a 100644 (file)
@@ -29,17 +29,10 @@ Container::Container(const std::string& name) : name(name)
   container_name2container.insert({this->name, this});
 }
 
-Container::~Container()
-{
-  if (not this->children.empty())
-    for (auto const& child : this->children)
-      delete child;
-}
-
 void Container::add_child(jed_container_t child)
 {
   xbt_assert(child != nullptr);
-  this->children.push_back(child);
+  this->children.emplace_back(child);
   child->parent = this;
 }
 
@@ -87,7 +80,7 @@ std::vector<int> Container::get_hierarchy()
       int child_nb = -1;
 
       for (auto const& child : this->parent->children) {
-        if( child == this) {
+        if (child.get() == this) {
           child_nb = i;
           break;
         }
@@ -160,7 +153,8 @@ void Container::print(FILE* jed_file)
 }
 }
 
-static void add_subsets_to(std::vector<jed_subset_t> *subset_list, std::vector<const char*> hostgroup, jed_container_t parent)
+static void add_subsets_to(std::vector<simgrid::jedule::Subset>& subset_list, std::vector<const char*> hostgroup,
+                           jed_container_t parent)
 {
   // get ids for each host
   // sort ids
@@ -185,15 +179,15 @@ static void add_subsets_to(std::vector<jed_subset_t> *subset_list, std::vector<c
     int pos = start;
     for(unsigned int i=0; i<nb_ids; i++) {
       if( id_list[i] - id_list[pos] > 1 ) {
-        subset_list->push_back(new simgrid::jedule::Subset(id_list[start], id_list[pos], parent));
+        subset_list.emplace_back(id_list[start], id_list[pos], parent);
         start = i;
 
         if( i == nb_ids-1 ) {
-         subset_list->push_back(new simgrid::jedule::Subset(id_list[i], id_list[i], parent));
+          subset_list.emplace_back(id_list[i], id_list[i], parent);
         }
       } else {
         if( i == nb_ids-1 ) {
-          subset_list->push_back(new simgrid::jedule::Subset(id_list[start], id_list[i], parent));
+          subset_list.emplace_back(id_list[start], id_list[i], parent);
         }
       }
       pos = i;
@@ -202,14 +196,14 @@ static void add_subsets_to(std::vector<jed_subset_t> *subset_list, std::vector<c
 
 }
 
-void get_resource_selection_by_hosts(std::vector<jed_subset_t> *subset_list, std::vector<sg_host_t> *host_list)
+void get_resource_selection_by_hosts(std::vector<simgrid::jedule::Subset>& subset_list,
+                                     const std::vector<sg_host_t>& host_list)
 {
-  xbt_assert( host_list != nullptr );
   // for each host name
   //  find parent container
   //  group by parent container
   std::unordered_map<const char*, std::vector<const char*>> parent2hostgroup;
-  for (auto const& 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 );
index 1541655..5819009 100644 (file)
@@ -20,10 +20,10 @@ void jedule_log_sd_event(SD_task_t task)
 {
   xbt_assert(task != nullptr);
 
-  jed_event_t event = new simgrid::jedule::Event(std::string(SD_task_get_name(task)),
-                                                 SD_task_get_start_time(task), SD_task_get_finish_time(task), "SD");
-  event->add_resources(task->allocation);
-  my_jedule->event_set_.push_back(event);
+  simgrid::jedule::Event event(std::string(SD_task_get_name(task)), SD_task_get_start_time(task),
+                               SD_task_get_finish_time(task), "SD");
+  event.add_resources(*task->allocation);
+  my_jedule->event_set_.emplace_back(std::move(event));
 }
 
 void jedule_sd_init()
@@ -31,11 +31,8 @@ void jedule_sd_init()
   sg_netzone_t root_comp = simgrid::s4u::Engine::get_instance()->get_netzone_root();
   XBT_DEBUG("root name %s\n", root_comp->get_cname());
 
-  my_jedule = new simgrid::jedule::Jedule();
-
-  jed_container_t root_container = new simgrid::jedule::Container(root_comp->get_name());
-  root_container->create_hierarchy(root_comp);
-  my_jedule->root_container_ = root_container;
+  my_jedule = new simgrid::jedule::Jedule(root_comp->get_name());
+  my_jedule->root_container_.create_hierarchy(root_comp);
 }
 
 void jedule_sd_exit()
index 8541070..f6e6193 100644 (file)
@@ -99,4 +99,5 @@
 /* The lib unwind library (for MC and backtrace display) */
 #cmakedefine01 HAVE_LIBUNWIND
 /* The boost_stacktrace_backtrace library */
-#cmakedefine01 HAVE_BOOST_STACKTRACE
+#cmakedefine01 HAVE_BOOST_STACKTRACE_BACKTRACE /* prefered */
+#cmakedefine01 HAVE_BOOST_STACKTRACE_ADDR2LINE /* fallback */
index 77390cb..4d98ab4 100644 (file)
@@ -7,29 +7,20 @@
 #include "simgrid/kernel/routing/NetPoint.hpp"
 #include "simgrid/kernel/routing/NetZoneImpl.hpp"
 #include "simgrid/s4u/Host.hpp"
+#include "src/kernel/resource/DiskImpl.hpp"
 #include "src/surf/StorageImpl.hpp"
 #include "src/surf/network_interface.hpp"
 
-#include <algorithm>
-
 namespace simgrid {
 namespace kernel {
 
 EngineImpl::~EngineImpl()
 {
-  /* copy all names to not modify the map while iterating over it.
-   *
-   * Plus, the hosts are destroyed in the lexicographic order to ensure that the output is reproducible: we don't want
-   * to kill them in the pointer order as it could be platform-dependent, which would break the tests.
+  /* Since hosts_ is a std::map, the hosts are destroyed in the lexicographic order, which ensures that the output is
+   * reproducible.
    */
-  std::vector<std::string> names;
-  for (auto const& kv : hosts_)
-    names.push_back(kv.second->get_name());
-
-  std::sort(names.begin(), names.end());
-
-  for (auto const& name : names)
-    hosts_.at(name)->destroy();
+  while (not hosts_.empty())
+    hosts_.begin()->second->destroy();
 
   /* Also delete the other data */
   delete netzone_root_;
index f7f719c..3027879 100644 (file)
@@ -4,6 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/kernel/activity/ActivityImpl.hpp"
+#include "src/simix/smx_private.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process);
 
@@ -12,14 +13,30 @@ namespace kernel {
 namespace activity {
 
 ActivityImpl::~ActivityImpl()
+{
+  clean_action();
+  XBT_DEBUG("Destroy activity %p", this);
+}
+
+void ActivityImpl::register_simcall(smx_simcall_t simcall)
+{
+  simcalls_.push_back(simcall);
+  simcall->issuer_->waiting_synchro = this;
+}
+
+void ActivityImpl::clean_action()
 {
   if (surf_action_) {
     surf_action_->unref();
-    XBT_DEBUG("Destroy activity %p", this);
     surf_action_ = nullptr;
   }
 }
 
+double ActivityImpl::get_remaining() const
+{
+  return surf_action_ ? surf_action_->get_remains() : 0;
+}
+
 void ActivityImpl::suspend()
 {
   if (surf_action_ == nullptr)
@@ -38,10 +55,12 @@ void ActivityImpl::resume()
   on_resumed(*this);
 }
 
-void ActivityImpl::set_category(const std::string& category)
+void ActivityImpl::cancel()
 {
-  if (surf_action_)
-    surf_action_->set_category(category);
+  XBT_VERB("Activity %p is canceled", this);
+  if (surf_action_ != nullptr)
+    surf_action_->cancel();
+  state_ = SIMIX_CANCELED;
 }
 
 // boost::intrusive_ptr<Activity> support:
index 8fdd778..f9532eb 100644 (file)
@@ -22,25 +22,25 @@ namespace activity {
 
 class XBT_PUBLIC ActivityImpl {
   std::atomic_int_fast32_t refcount_{0};
-  std::string name_; /* Activity name if any */
 public:
   virtual ~ActivityImpl();
   ActivityImpl() = default;
-  explicit ActivityImpl(const std::string& name) : name_(name) {}
   e_smx_state_t state_ = SIMIX_WAITING; /* State of the activity */
   std::list<smx_simcall_t> simcalls_;   /* List of simcalls waiting for this activity */
   resource::Action* surf_action_ = nullptr;
 
-  const std::string& get_name() const { return name_; }
-  const char* get_cname() const { return name_.c_str(); }
-  void set_name(const std::string& name) { name_ = name; }
-  void set_category(const std::string& category);
-
   virtual void suspend();
   virtual void resume();
-  virtual void post()   = 0; // What to do when a simcall terminates
-  virtual void finish() = 0;
+  virtual void cancel();
+
+  virtual void post() = 0; // Called by the main loop when the activity is marked as terminated or failed by its model.
+                           // Setups the status, clean things up, and call finish()
+  virtual void finish() = 0; // Unlock all simcalls blocked on that activity, either because it was marked as done by
+                             // the model or because it terminated without waiting for the model
 
+  virtual void register_simcall(smx_simcall_t simcall);
+  void clean_action();
+  virtual double get_remaining() const;
   // boost::intrusive_ptr<ActivityImpl> support:
   friend XBT_PUBLIC void intrusive_ptr_add_ref(ActivityImpl* activity);
   friend XBT_PUBLIC void intrusive_ptr_release(ActivityImpl* activity);
@@ -48,6 +48,29 @@ public:
   static xbt::signal<void(ActivityImpl const&)> on_suspended;
   static xbt::signal<void(ActivityImpl const&)> on_resumed;
 };
+
+template <class AnyActivityImpl> class ActivityImpl_T : public ActivityImpl {
+private:
+  std::string name_             = "";
+  std::string tracing_category_ = "";
+
+public:
+  AnyActivityImpl& set_name(const std::string& name)
+  {
+    name_ = name;
+    return static_cast<AnyActivityImpl&>(*this);
+  }
+  const std::string& get_name() { return name_; }
+  const char* get_cname() { return name_.c_str(); }
+
+  AnyActivityImpl& set_tracing_category(const std::string& category)
+  {
+    tracing_category_ = category;
+    return static_cast<AnyActivityImpl&>(*this);
+  }
+  const std::string& get_tracing_category() { return tracing_category_; }
+};
+
 } // namespace activity
 } // namespace kernel
 } // namespace simgrid
index a838619..03c3cbf 100644 (file)
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_network, simix, "SIMIX network-related synchronization");
 
 XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_actor_t src, smx_mailbox_t mbox, double task_size,
-                                           double rate, void* src_buff, size_t src_buff_size,
+                                           double rate, unsigned char* src_buff, size_t src_buff_size,
                                            int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
                                            void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t),
                                            void* data, double timeout)
 {
   smx_activity_t comm = simcall_HANDLER_comm_isend(simcall, src, mbox, task_size, rate, src_buff, src_buff_size,
                                                    match_fun, nullptr, copy_data_fun, data, 0);
-  SIMCALL_SET_MC_VALUE(simcall, 0);
+  SIMCALL_SET_MC_VALUE(*simcall, 0);
   simcall_HANDLER_comm_wait(simcall, static_cast<simgrid::kernel::activity::CommImpl*>(comm.get()), 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,
-    size_t src_buff_size, int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
+    smx_simcall_t /*simcall*/, smx_actor_t src_proc, smx_mailbox_t mbox, double task_size, double rate,
+    unsigned char* 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)(simgrid::kernel::activity::CommImpl*, void*, size_t), // used to copy data if not default one
-    void* data, int detached)
+    void* data, bool detached)
 {
   XBT_DEBUG("send from mailbox %p", mbox);
 
@@ -73,7 +73,7 @@ XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend(
   }
 
   if (detached) {
-    other_comm->detached  = true;
+    other_comm->detach();
     other_comm->clean_fun = clean_fun;
   } else {
     other_comm->clean_fun = nullptr;
@@ -97,19 +97,19 @@ XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend(
 }
 
 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,
+                                           unsigned char* dst_buff, size_t* dst_buff_size,
                                            int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
                                            void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t),
                                            void* data, double timeout, double rate)
 {
   smx_activity_t comm = simcall_HANDLER_comm_irecv(simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun,
                                                    copy_data_fun, data, rate);
-  SIMCALL_SET_MC_VALUE(simcall, 0);
+  SIMCALL_SET_MC_VALUE(*simcall, 0);
   simcall_HANDLER_comm_wait(simcall, static_cast<simgrid::kernel::activity::CommImpl*>(comm.get()), 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,
+    smx_simcall_t /*simcall*/, smx_actor_t receiver, smx_mailbox_t mbox, unsigned char* dst_buff, size_t* dst_buff_size,
     simix_match_func_t match_fun, void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t),
     void* data, double rate)
 {
@@ -134,11 +134,10 @@ XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_irecv(
       other_comm = std::move(this_synchro);
       mbox->push(other_comm);
     } else {
-      if (other_comm->surf_action_ && other_comm->remains() < 1e-12) {
+      if (other_comm->surf_action_ && other_comm->get_remaining() < 1e-12) {
         XBT_DEBUG("comm %p has been already sent, and is finished, destroy it", other_comm.get());
         other_comm->state_ = SIMIX_DONE;
-        other_comm->set_type(simgrid::kernel::activity::CommImpl::Type::DONE);
-        other_comm->mbox   = nullptr;
+        other_comm->set_type(simgrid::kernel::activity::CommImpl::Type::DONE).set_mailbox(nullptr);
       }
     }
   } else {
@@ -189,11 +188,10 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, simgrid::kernel::activity:
   /* Associate this simcall to the wait synchro */
   XBT_DEBUG("simcall_HANDLER_comm_wait, %p", comm);
 
-  comm->simcalls_.push_back(simcall);
-  simcall->issuer->waiting_synchro = comm;
+  comm->register_simcall(simcall);
 
   if (MC_is_active() || MC_record_replay_is_active()) {
-    int idx = SIMCALL_GET_MC_VALUE(simcall);
+    int idx = SIMCALL_GET_MC_VALUE(*simcall);
     if (idx == 0) {
       comm->state_ = SIMIX_DONE;
     } else {
@@ -202,7 +200,7 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, simgrid::kernel::activity:
       if (timeout < 0.0)
         THROW_IMPOSSIBLE;
 
-      if (comm->src_actor_ == simcall->issuer)
+      if (comm->src_actor_ == simcall->issuer_)
         comm->state_ = SIMIX_SRC_TIMEOUT;
       else
         comm->state_ = SIMIX_DST_TIMEOUT;
@@ -217,10 +215,10 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, simgrid::kernel::activity:
   if (comm->state_ != SIMIX_WAITING && comm->state_ != SIMIX_RUNNING) {
     comm->finish();
   } else { /* we need a sleep action (even when there is no timeout) to be notified of host failures */
-    simgrid::kernel::resource::Action* sleep = simcall->issuer->get_host()->pimpl_cpu->sleep(timeout);
-    sleep->set_data(comm);
+    simgrid::kernel::resource::Action* sleep = simcall->issuer_->get_host()->pimpl_cpu->sleep(timeout);
+    sleep->set_activity(comm);
 
-    if (simcall->issuer == comm->src_actor_)
+    if (simcall->issuer_ == comm->src_actor_)
       comm->src_timeout_ = sleep;
     else
       comm->dst_timeout_ = sleep;
@@ -229,7 +227,7 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, simgrid::kernel::activity:
 
 void simcall_HANDLER_comm_test(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl* comm)
 {
-  int res;
+  bool res;
 
   if (MC_is_active() || MC_record_replay_is_active()) {
     res = comm->src_actor_ && comm->dst_actor_;
@@ -240,11 +238,11 @@ void simcall_HANDLER_comm_test(smx_simcall_t simcall, simgrid::kernel::activity:
   }
 
   simcall_comm_test__set__result(simcall, res);
-  if (simcall_comm_test__get__result(simcall)) {
+  if (res) {
     comm->simcalls_.push_back(simcall);
     comm->finish();
   } else {
-    SIMIX_simcall_answer(simcall);
+    simcall->issuer_->simcall_answer();
   }
 }
 
@@ -255,9 +253,9 @@ void simcall_HANDLER_comm_testany(smx_simcall_t simcall, simgrid::kernel::activi
   simcall_comm_testany__set__result(simcall, -1);
 
   if (MC_is_active() || MC_record_replay_is_active()) {
-    int idx = SIMCALL_GET_MC_VALUE(simcall);
+    int idx = SIMCALL_GET_MC_VALUE(*simcall);
     if (idx == -1) {
-      SIMIX_simcall_answer(simcall);
+      simcall->issuer_->simcall_answer();
     } else {
       simgrid::kernel::activity::CommImpl* comm = comms[idx];
       simcall_comm_testany__set__result(simcall, idx);
@@ -277,7 +275,7 @@ void simcall_HANDLER_comm_testany(smx_simcall_t simcall, simgrid::kernel::activi
       return;
     }
   }
-  SIMIX_simcall_answer(simcall);
+  simcall->issuer_->simcall_answer();
 }
 
 static void SIMIX_waitany_remove_simcall_from_actions(smx_simcall_t simcall)
@@ -299,7 +297,7 @@ void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, simgrid::kernel::activi
   if (MC_is_active() || MC_record_replay_is_active()) {
     if (timeout > 0.0)
       xbt_die("Timeout not implemented for waitany in the model-checker");
-    int idx                 = SIMCALL_GET_MC_VALUE(simcall);
+    int idx                 = SIMCALL_GET_MC_VALUE(*simcall);
     auto* comm              = comms[idx];
     comm->simcalls_.push_back(simcall);
     simcall_comm_waitany__set__result(simcall, idx);
@@ -309,12 +307,12 @@ void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, simgrid::kernel::activi
   }
 
   if (timeout < 0.0) {
-    simcall->timer = NULL;
+    simcall->timeout_cb_ = NULL;
   } else {
-    simcall->timer = simgrid::simix::Timer::set(SIMIX_get_clock() + timeout, [simcall]() {
+    simcall->timeout_cb_ = simgrid::simix::Timer::set(SIMIX_get_clock() + timeout, [simcall]() {
       SIMIX_waitany_remove_simcall_from_actions(simcall);
       simcall_comm_waitany__set__result(simcall, -1);
-      SIMIX_simcall_answer(simcall);
+      simcall->issuer_->simcall_answer();
     });
   }
 
@@ -341,8 +339,8 @@ void SIMIX_comm_copy_buffer_callback(simgrid::kernel::activity::CommImpl* comm,
 {
   XBT_DEBUG("Copy the data over");
   memcpy(comm->dst_buff_, buff, buff_size);
-  if (comm->detached) { // if this is a detached send, the source buffer was duplicated by SMPI sender to make the
-                        // original buffer available to the application ASAP
+  if (comm->detached()) { // if this is a detached send, the source buffer was duplicated by SMPI sender to make the
+                          // original buffer available to the application ASAP
     xbt_free(buff);
     comm->src_buff_ = nullptr;
   }
@@ -380,36 +378,46 @@ CommImpl& CommImpl::set_rate(double rate)
   rate_ = rate;
   return *this;
 }
+CommImpl& CommImpl::set_mailbox(MailboxImpl* mbox)
+{
+  mbox_ = mbox;
+  return *this;
+}
 
-CommImpl& CommImpl::set_src_buff(void* buff, size_t size)
+CommImpl& CommImpl::set_src_buff(unsigned char* buff, size_t size)
 {
   src_buff_      = buff;
   src_buff_size_ = size;
   return *this;
 }
 
-CommImpl& CommImpl::set_dst_buff(void* buff, size_t* size)
+CommImpl& CommImpl::set_dst_buff(unsigned char* buff, size_t* size)
 {
   dst_buff_      = buff;
   dst_buff_size_ = size;
   return *this;
 }
 
+CommImpl& CommImpl::detach()
+{
+  detached_ = true;
+  return *this;
+}
+
 CommImpl::~CommImpl()
 {
-  XBT_DEBUG("Really free communication %p in state %d (detached = %d)", this, static_cast<int>(state_),
-            static_cast<int>(detached));
+  XBT_DEBUG("Really free communication %p in state %d (detached = %d)", this, static_cast<int>(state_), detached_);
 
   cleanupSurf();
 
-  if (detached && state_ != SIMIX_DONE) {
+  if (detached_ && state_ != SIMIX_DONE) {
     /* the communication has failed and was detached:
      * we have to free the buffer */
     if (clean_fun)
       clean_fun(src_buff_);
     src_buff_ = nullptr;
-  } else if (mbox) {
-    mbox->remove(this);
+  } else if (mbox_) {
+    mbox_->remove(this);
   }
 }
 
@@ -423,7 +431,8 @@ CommImpl* CommImpl::start()
     s4u::Host* receiver = dst_actor_->get_host();
 
     surf_action_ = surf_network_model->communicate(sender, receiver, size_, rate_);
-    surf_action_->set_data(this);
+    surf_action_->set_activity(this);
+    surf_action_->set_category(get_tracing_category());
     state_ = SIMIX_RUNNING;
 
     XBT_DEBUG("Starting communication %p from '%s' to '%s' (surf_action: %p)", this, sender->get_cname(),
@@ -434,7 +443,7 @@ CommImpl* CommImpl::start()
       XBT_DEBUG("Communication from '%s' to '%s' failed to start because of a link failure", sender->get_cname(),
                 receiver->get_cname());
       state_ = SIMIX_LINK_FAILURE;
-      cleanupSurf();
+      post();
 
     } else if (src_actor_->is_suspended() || dst_actor_->is_suspended()) {
       /* If any of the process is suspended, create the synchro but stop its execution,
@@ -460,7 +469,7 @@ void CommImpl::copy_data()
 {
   size_t buff_size = src_buff_size_;
   /* If there is no data to copy then return */
-  if (not src_buff_ || not dst_buff_ || copied)
+  if (not src_buff_ || not dst_buff_ || copied_)
     return;
 
   XBT_DEBUG("Copying comm %p data from %s (%p) -> %s (%p) (%zu bytes)", this,
@@ -484,7 +493,7 @@ void CommImpl::copy_data()
 
   /* Set the copied flag so we copy data only once */
   /* (this function might be called from both communication ends) */
-  copied = true;
+  copied_ = true;
 }
 
 void CommImpl::suspend()
@@ -507,8 +516,8 @@ void CommImpl::cancel()
 {
   /* if the synchro is a waiting state means that it is still in a mbox so remove from it and delete it */
   if (state_ == SIMIX_WAITING) {
-    if (not detached) {
-      mbox->remove(this);
+    if (not detached_) {
+      mbox_->remove(this);
       state_ = SIMIX_CANCELED;
     }
   } else if (not MC_is_active() /* when running the MC there are no surf actions */
@@ -517,19 +526,10 @@ void CommImpl::cancel()
   }
 }
 
-/**  @brief get the amount remaining from the communication */
-double CommImpl::remains()
-{
-  return surf_action_->get_remains();
-}
-
 /** @brief This is part of the cleanup process, probably an internal command */
 void CommImpl::cleanupSurf()
 {
-  if (surf_action_) {
-    surf_action_->unref();
-    surf_action_ = nullptr;
-  }
+  clean_action();
 
   if (src_timeout_) {
     src_timeout_->unref();
@@ -559,15 +559,13 @@ void CommImpl::post()
     state_ = SIMIX_DONE;
 
   XBT_DEBUG("SIMIX_post_comm: comm %p, state %d, src_proc %p, dst_proc %p, detached: %d", this, (int)state_,
-            src_actor_.get(), dst_actor_.get(), detached);
+            src_actor_.get(), dst_actor_.get(), detached_);
 
   /* destroy the surf actions associated with the Simix communication */
   cleanupSurf();
 
-  /* if there are simcalls associated with the synchro, then answer them */
-  if (not simcalls_.empty()) {
-    finish();
-  }
+  /* Answer all simcalls associated with the synchro */
+  finish();
 }
 
 void CommImpl::finish()
@@ -580,13 +578,13 @@ void CommImpl::finish()
      * list. Afterwards, get the position of the actual synchro in the waitany list and return it as the result of the
      * simcall */
 
-    if (simcall->call == SIMCALL_NONE) // FIXME: maybe a better way to handle this case
-      continue;                        // if process handling comm is killed
-    if (simcall->call == SIMCALL_COMM_WAITANY) {
+    if (simcall->call_ == SIMCALL_NONE) // FIXME: maybe a better way to handle this case
+      continue;                         // if actor handling comm is killed
+    if (simcall->call_ == SIMCALL_COMM_WAITANY) {
       SIMIX_waitany_remove_simcall_from_actions(simcall);
-      if (simcall->timer) {
-        simcall->timer->remove();
-        simcall->timer = nullptr;
+      if (simcall->timeout_cb_) {
+        simcall->timeout_cb_->remove();
+        simcall->timeout_cb_ = nullptr;
       }
       if (not MC_is_active() && not MC_record_replay_is_active()) {
         CommImpl** comms   = simcall_comm_waitany__get__comms(simcall);
@@ -598,15 +596,15 @@ void CommImpl::finish()
     }
 
     /* If the synchro is still in a rendez-vous point then remove from it */
-    if (mbox)
-      mbox->remove(this);
+    if (mbox_)
+      mbox_->remove(this);
 
     XBT_DEBUG("CommImpl::finish(): synchro state = %d", static_cast<int>(state_));
 
     /* Check out for errors */
 
-    if (not simcall->issuer->get_host()->is_on()) {
-      simcall->issuer->context_->iwannadie = true;
+    if (not simcall->issuer_->get_host()->is_on()) {
+      simcall->issuer_->context_->iwannadie = true;
     } else {
       switch (state_) {
 
@@ -616,28 +614,28 @@ void CommImpl::finish()
           break;
 
         case SIMIX_SRC_TIMEOUT:
-          simcall->issuer->exception_ = std::make_exception_ptr(
-              simgrid::TimeoutError(XBT_THROW_POINT, "Communication timeouted because of the sender"));
+          simcall->issuer_->exception_ = std::make_exception_ptr(
+              simgrid::TimeoutException(XBT_THROW_POINT, "Communication timeouted because of the sender"));
           break;
 
         case SIMIX_DST_TIMEOUT:
-          simcall->issuer->exception_ = std::make_exception_ptr(
-              simgrid::TimeoutError(XBT_THROW_POINT, "Communication timeouted because of the receiver"));
+          simcall->issuer_->exception_ = std::make_exception_ptr(
+              simgrid::TimeoutException(XBT_THROW_POINT, "Communication timeouted because of the receiver"));
           break;
 
         case SIMIX_SRC_HOST_FAILURE:
-          if (simcall->issuer == src_actor_)
-            simcall->issuer->context_->iwannadie = true;
+          if (simcall->issuer_ == src_actor_)
+            simcall->issuer_->context_->iwannadie = true;
           else
-            simcall->issuer->exception_ =
+            simcall->issuer_->exception_ =
                 std::make_exception_ptr(simgrid::NetworkFailureException(XBT_THROW_POINT, "Remote peer failed"));
           break;
 
         case SIMIX_DST_HOST_FAILURE:
-          if (simcall->issuer == dst_actor_)
-            simcall->issuer->context_->iwannadie = true;
+          if (simcall->issuer_ == dst_actor_)
+            simcall->issuer_->context_->iwannadie = true;
           else
-            simcall->issuer->exception_ =
+            simcall->issuer_->exception_ =
                 std::make_exception_ptr(simgrid::NetworkFailureException(XBT_THROW_POINT, "Remote peer failed"));
           break;
 
@@ -645,43 +643,44 @@ void CommImpl::finish()
           XBT_DEBUG("Link failure in synchro %p between '%s' and '%s': posting an exception to the issuer: %s (%p) "
                     "detached:%d",
                     this, src_actor_ ? src_actor_->get_host()->get_cname() : nullptr,
-                    dst_actor_ ? dst_actor_->get_host()->get_cname() : nullptr, simcall->issuer->get_cname(),
-                    simcall->issuer, detached);
-          if (src_actor_ == simcall->issuer) {
+                    dst_actor_ ? dst_actor_->get_host()->get_cname() : nullptr, simcall->issuer_->get_cname(),
+                    simcall->issuer_, detached_);
+          if (src_actor_ == simcall->issuer_) {
             XBT_DEBUG("I'm source");
-          } else if (dst_actor_ == simcall->issuer) {
+          } else if (dst_actor_ == simcall->issuer_) {
             XBT_DEBUG("I'm dest");
           } else {
             XBT_DEBUG("I'm neither source nor dest");
           }
-          simcall->issuer->throw_exception(
+          simcall->issuer_->throw_exception(
               std::make_exception_ptr(simgrid::NetworkFailureException(XBT_THROW_POINT, "Link failure")));
           break;
 
         case SIMIX_CANCELED:
-          if (simcall->issuer == dst_actor_)
-            simcall->issuer->exception_ = std::make_exception_ptr(
+          if (simcall->issuer_ == dst_actor_)
+            simcall->issuer_->exception_ = std::make_exception_ptr(
                 simgrid::CancelException(XBT_THROW_POINT, "Communication canceled by the sender"));
           else
-            simcall->issuer->exception_ = std::make_exception_ptr(
+            simcall->issuer_->exception_ = std::make_exception_ptr(
                 simgrid::CancelException(XBT_THROW_POINT, "Communication canceled by the receiver"));
           break;
 
         default:
           xbt_die("Unexpected synchro state in CommImpl::finish: %d", static_cast<int>(state_));
       }
+      simcall->issuer_->simcall_answer();
     }
     /* if there is an exception during a waitany or a testany, indicate the position of the failed communication */
-    if (simcall->issuer->exception_ &&
-        (simcall->call == SIMCALL_COMM_WAITANY || simcall->call == SIMCALL_COMM_TESTANY)) {
+    if (simcall->issuer_->exception_ &&
+        (simcall->call_ == SIMCALL_COMM_WAITANY || simcall->call_ == SIMCALL_COMM_TESTANY)) {
       // First retrieve the rank of our failing synchro
       CommImpl** comms;
       size_t count;
-      if (simcall->call == SIMCALL_COMM_WAITANY) {
+      if (simcall->call_ == SIMCALL_COMM_WAITANY) {
         comms = simcall_comm_waitany__get__comms(simcall);
         count = simcall_comm_waitany__get__count(simcall);
       } else {
-        /* simcall->call == SIMCALL_COMM_TESTANY */
+        /* simcall->call_ == SIMCALL_COMM_TESTANY */
         comms = simcall_comm_testany__get__comms(simcall);
         count = simcall_comm_testany__get__count(simcall);
       }
@@ -690,26 +689,19 @@ void CommImpl::finish()
 
       // In order to modify the exception we have to rethrow it:
       try {
-        std::rethrow_exception(simcall->issuer->exception_);
-      } catch (simgrid::TimeoutError& e) {
-        e.value                     = rank;
-        simcall->issuer->exception_ = std::make_exception_ptr(e);
-      } catch (simgrid::NetworkFailureException& e) {
-        e.value                     = rank;
-        simcall->issuer->exception_ = std::make_exception_ptr(e);
-      } catch (simgrid::CancelException& e) {
-        e.value                     = rank;
-        simcall->issuer->exception_ = std::make_exception_ptr(e);
+        std::rethrow_exception(simcall->issuer_->exception_);
+      } catch (simgrid::Exception& e) {
+        e.value = rank;
       }
     }
 
-    simcall->issuer->waiting_synchro = nullptr;
-    simcall->issuer->comms.remove(this);
-    if (detached) {
-      if (simcall->issuer == src_actor_) {
+    simcall->issuer_->waiting_synchro = nullptr;
+    simcall->issuer_->comms.remove(this);
+    if (detached_) {
+      if (simcall->issuer_ == src_actor_) {
         if (dst_actor_)
           dst_actor_->comms.remove(this);
-      } else if (simcall->issuer == dst_actor_) {
+      } else if (simcall->issuer_ == dst_actor_) {
         if (src_actor_)
           src_actor_->comms.remove(this);
       } else {
@@ -717,11 +709,6 @@ void CommImpl::finish()
         src_actor_->comms.remove(this);
       }
     }
-
-    if (simcall->issuer->get_host()->is_on())
-      SIMIX_simcall_answer(simcall);
-    else
-      simcall->issuer->context_->iwannadie = true;
   }
 }
 
index 481b16b..9321faf 100644 (file)
@@ -15,41 +15,47 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
-class XBT_PUBLIC CommImpl : public ActivityImpl {
+class XBT_PUBLIC CommImpl : public ActivityImpl_T<CommImpl> {
   ~CommImpl() override;
   void cleanupSurf();
 
-  double rate_ = 0.0;
-  double size_ = 0.0;
+  double rate_       = 0.0;
+  double size_       = 0.0;
+  bool detached_     = false;   /* If detached or not */
+  bool copied_       = false;   /* whether the data were already copied */
+  MailboxImpl* mbox_ = nullptr; /* Rendez-vous where the comm is queued */
 
 public:
   enum class Type { SEND = 0, RECEIVE, READY, DONE };
 
   CommImpl& set_type(CommImpl::Type type);
   CommImpl& set_size(double size);
-  double get_rate() { return rate_; }
+  CommImpl& set_src_buff(unsigned char* buff, size_t size);
+  CommImpl& set_dst_buff(unsigned char* buff, size_t* size);
   CommImpl& set_rate(double rate);
-  CommImpl& set_src_buff(void* buff, size_t size);
-  CommImpl& set_dst_buff(void* buff, size_t* size);
+  CommImpl& set_mailbox(MailboxImpl* mbox);
+  CommImpl& detach();
+
+  double get_rate() const { return rate_; }
+  MailboxImpl* get_mailbox() const { return mbox_; }
+  bool detached() const { return detached_; }
 
-  CommImpl* start();
   void copy_data();
+
+  CommImpl* start();
   void suspend() override;
   void resume() override;
+  void cancel() override;
   void post() override;
   void finish() override;
-  void cancel();
-  double remains();
 
   CommImpl::Type type_;        /* Type of the communication (SIMIX_COMM_SEND or SIMIX_COMM_RECEIVE) */
-  MailboxImpl* mbox = nullptr; /* Rendez-vous where the comm is queued */
 
 #if SIMGRID_HAVE_MC
   MailboxImpl* mbox_cpy = nullptr; /* Copy of the rendez-vous where the comm is queued, MC needs it for DPOR
                                      (comm.mbox set to nullptr when the communication is removed from the mailbox
                                      (used as garbage collector)) */
 #endif
-  bool detached = false; /* If detached or not */
 
   void (*clean_fun)(void*) = nullptr; /* Function to clean the detached src_buf if something goes wrong */
   int (*match_fun)(void*, void*, CommImpl*) = nullptr; /* Filter function used by the other side. It is used when
@@ -64,11 +70,10 @@ expectations of the other side, too. See  */
   actor::ActorImplPtr dst_actor_ = nullptr;
 
   /* Data to be transfered */
-  void* src_buff_        = nullptr;
-  void* dst_buff_        = nullptr;
-  size_t src_buff_size_  = 0;
-  size_t* dst_buff_size_ = nullptr;
-  bool copied           = false; /* whether the data were already copied */
+  unsigned char* src_buff_ = nullptr;
+  unsigned char* dst_buff_ = nullptr;
+  size_t src_buff_size_    = 0;
+  size_t* dst_buff_size_   = nullptr;
 
   void* src_data_ = nullptr; /* User data associated to the communication */
   void* dst_data_ = nullptr;
index 18d1197..5efb83c 100644 (file)
@@ -15,21 +15,13 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ConditionVariable, simix_synchro, "Condition var
 /** @brief Handle a condition waiting simcall without timeouts */
 void simcall_HANDLER_cond_wait(smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex)
 {
-  XBT_IN("(%p)", simcall);
-  smx_actor_t issuer = simcall->issuer;
-
-  cond->wait(mutex, -1, issuer, simcall);
-  XBT_OUT();
+  cond->wait(mutex, -1, simcall->issuer_);
 }
 
 /** @brief Handle a condition waiting simcall with timeouts */
 void simcall_HANDLER_cond_wait_timeout(smx_simcall_t simcall, smx_cond_t cond, smx_mutex_t mutex, double timeout)
 {
-  XBT_IN("(%p)", simcall);
-  smx_actor_t issuer = simcall->issuer;
-  simcall_cond_wait_timeout__set__result(simcall, 0); // default result, will be set to 1 on timeout
-  cond->wait(mutex, timeout, issuer, simcall);
-  XBT_OUT();
+  cond->wait(mutex, timeout, simcall->issuer_);
 }
 
 namespace simgrid {
@@ -61,13 +53,13 @@ void ConditionVariableImpl::signal()
     /* Now transform the cond wait simcall into a mutex lock one */
     smx_simcall_t simcall = &proc.simcall;
     MutexImpl* simcall_mutex;
-    if (simcall->call == SIMCALL_COND_WAIT)
+    if (simcall->call_ == SIMCALL_COND_WAIT)
       simcall_mutex = simcall_cond_wait__get__mutex(simcall);
     else
       simcall_mutex = simcall_cond_wait_timeout__get__mutex(simcall);
-    simcall->call = SIMCALL_MUTEX_LOCK;
+    simcall->call_ = SIMCALL_MUTEX_LOCK;
 
-    simcall_mutex->lock(simcall->issuer);
+    simcall_mutex->lock(simcall->issuer_);
   }
   XBT_OUT();
 }
@@ -87,26 +79,23 @@ void ConditionVariableImpl::broadcast()
     signal();
 }
 
-void ConditionVariableImpl::wait(smx_mutex_t mutex, double timeout, actor::ActorImpl* issuer, smx_simcall_t simcall)
+void ConditionVariableImpl::wait(smx_mutex_t mutex, double timeout, actor::ActorImpl* issuer)
 {
-  XBT_IN("(%p, %p, %f, %p,%p)", this, mutex, timeout, issuer, simcall);
-  RawImplPtr synchro = nullptr;
-
   XBT_DEBUG("Wait condition %p", this);
 
   /* If there is a mutex unlock it */
-  /* FIXME: what happens if the issuer is not the owner of the mutex? */
   if (mutex != nullptr) {
+    xbt_assert(mutex->owner_ == issuer,
+               "Actor %s cannot wait on ConditionVariable %p since it does not own the provided mutex %p",
+               issuer->get_cname(), this, mutex);
     mutex_ = mutex;
     mutex->unlock(issuer);
   }
 
-  synchro = RawImplPtr(new RawImpl());
-  (*synchro).set_host(issuer->get_host()).set_timeout(timeout).start();
-  synchro->simcalls_.push_front(simcall);
-  issuer->waiting_synchro = synchro;
-  sleeping_.push_back(*simcall->issuer);
-  XBT_OUT();
+  RawImplPtr synchro(new RawImpl());
+  synchro->set_host(issuer->get_host()).set_timeout(timeout).start();
+  synchro->register_simcall(&issuer->simcall);
+  sleeping_.push_back(*issuer);
 }
 
 // boost::intrusive_ptr<ConditionVariableImpl> support:
index f165dde..7945f2a 100644 (file)
@@ -25,7 +25,7 @@ public:
 
   void broadcast();
   void signal();
-  void wait(MutexImpl* mutex, double timeout, actor::ActorImpl* issuer, smx_simcall_t simcall);
+  void wait(MutexImpl* mutex, double timeout, actor::ActorImpl* issuer);
 
 private:
   std::atomic_int_fast32_t refcount_{1};
index 07b3c4e..a210ab0 100644 (file)
@@ -13,6 +13,8 @@
 
 #include "simgrid/s4u/Host.hpp"
 
+#include <boost/range/algorithm.hpp>
+
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process);
 
 void simcall_HANDLER_execution_wait(smx_simcall_t simcall, simgrid::kernel::activity::ExecImpl* synchro)
@@ -20,8 +22,7 @@ void simcall_HANDLER_execution_wait(smx_simcall_t simcall, simgrid::kernel::acti
   XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro, (int)synchro->state_);
 
   /* Associate this simcall to the synchro */
-  synchro->simcalls_.push_back(simcall);
-  simcall->issuer->waiting_synchro = synchro;
+  synchro->register_simcall(simcall);
 
   /* set surf's synchro */
   if (MC_is_active() || MC_record_replay_is_active()) {
@@ -37,16 +38,48 @@ void simcall_HANDLER_execution_wait(smx_simcall_t simcall, simgrid::kernel::acti
 
 void simcall_HANDLER_execution_test(smx_simcall_t simcall, simgrid::kernel::activity::ExecImpl* synchro)
 {
-  int res = (synchro->state_ != SIMIX_WAITING && synchro->state_ != SIMIX_RUNNING);
+  bool res = (synchro->state_ != SIMIX_WAITING && synchro->state_ != SIMIX_RUNNING);
   if (res) {
     synchro->simcalls_.push_back(simcall);
     synchro->finish();
   } else {
-    SIMIX_simcall_answer(simcall);
+    simcall->issuer_->simcall_answer();
   }
   simcall_execution_test__set__result(simcall, res);
 }
 
+void simcall_HANDLER_execution_waitany_for(smx_simcall_t simcall, simgrid::kernel::activity::ExecImpl* execs[],
+                                           size_t count, double timeout)
+{
+  if (timeout < 0.0) {
+    simcall->timeout_cb_ = nullptr;
+  } else {
+    simcall->timeout_cb_ = simgrid::simix::Timer::set(SIMIX_get_clock() + timeout, [simcall, execs, count]() {
+      for (size_t i = 0; i < count; i++) {
+        // Remove the first occurence of simcall:
+        auto* exec = execs[i];
+        auto j     = boost::range::find(exec->simcalls_, simcall);
+        if (j != exec->simcalls_.end())
+          exec->simcalls_.erase(j);
+      }
+      simcall_execution_waitany_for__set__result(simcall, -1);
+      simcall->issuer_->simcall_answer();
+    });
+  }
+
+  for (size_t i = 0; i < count; i++) {
+    /* associate this simcall to the the synchro */
+    auto* exec = execs[i];
+    exec->simcalls_.push_back(simcall);
+
+    /* see if the synchro is already finished */
+    if (exec->state_ != SIMIX_WAITING && exec->state_ != SIMIX_RUNNING) {
+      exec->finish();
+      break;
+    }
+  }
+}
+
 namespace simgrid {
 namespace kernel {
 namespace activity {
@@ -72,23 +105,11 @@ ExecImpl& ExecImpl::set_hosts(const std::vector<s4u::Host*>& hosts)
   return *this;
 }
 
-ExecImpl& ExecImpl::set_name(const std::string& name)
-{
-  ActivityImpl::set_name(name);
-  return *this;
-}
-
-ExecImpl& ExecImpl::set_tracing_category(const std::string& category)
-{
-  ActivityImpl::set_category(category);
-  return *this;
-}
-
 ExecImpl& ExecImpl::set_timeout(double timeout)
 {
   if (timeout > 0 && not MC_is_active() && not MC_record_replay_is_active()) {
     timeout_detector_ = hosts_.front()->pimpl_cpu->sleep(timeout);
-    timeout_detector_->set_data(this);
+    timeout_detector_->set_activity(this);
   }
   return *this;
 }
@@ -120,32 +141,21 @@ ExecImpl* ExecImpl::start()
   if (not MC_is_active() && not MC_record_replay_is_active()) {
     if (hosts_.size() == 1) {
       surf_action_ = hosts_.front()->pimpl_cpu->execution_start(flops_amounts_.front());
-      surf_action_->set_priority(priority_);
+      surf_action_->set_sharing_penalty(sharing_penalty_);
+      surf_action_->set_category(get_tracing_category());
+
       if (bound_ > 0)
         surf_action_->set_bound(bound_);
     } else {
       surf_action_ = surf_host_model->execute_parallel(hosts_, flops_amounts_.data(), bytes_amounts_.data(), -1);
     }
-    surf_action_->set_data(this);
+    surf_action_->set_activity(this);
   }
 
   XBT_DEBUG("Create execute synchro %p: %s", this, get_cname());
-  ExecImpl::on_creation(*this);
   return this;
 }
 
-void ExecImpl::cancel()
-{
-  XBT_VERB("This exec %p is canceled", this);
-  if (surf_action_ != nullptr)
-    surf_action_->cancel();
-}
-
-double ExecImpl::get_remaining() const
-{
-  return surf_action_ ? surf_action_->get_remains() : 0;
-}
-
 double ExecImpl::get_seq_remaining_ratio()
 {
   return (surf_action_ == nullptr) ? 0 : surf_action_->get_remains() / surf_action_->get_cost();
@@ -163,9 +173,9 @@ ExecImpl& ExecImpl::set_bound(double bound)
   return *this;
 }
 
-ExecImpl& ExecImpl::set_priority(double priority)
+ExecImpl& ExecImpl::set_sharing_penalty(double sharing_penalty)
 {
-  priority_ = priority;
+  sharing_penalty_ = sharing_penalty;
   return *this;
 }
 
@@ -184,20 +194,15 @@ void ExecImpl::post()
     state_ = SIMIX_DONE;
   }
 
-  on_completion(*this);
+  clean_action();
 
-  if (surf_action_) {
-    surf_action_->unref();
-    surf_action_ = nullptr;
-  }
   if (timeout_detector_) {
     timeout_detector_->unref();
     timeout_detector_ = nullptr;
   }
 
-  /* If there are simcalls associated with the synchro, then answer them */
-  if (not simcalls_.empty())
-    finish();
+  /* Answer all simcalls associated with the synchro */
+  finish();
 }
 
 void ExecImpl::finish()
@@ -205,6 +210,37 @@ void ExecImpl::finish()
   while (not simcalls_.empty()) {
     smx_simcall_t simcall = simcalls_.front();
     simcalls_.pop_front();
+
+    /* If a waitany simcall is waiting for this synchro to finish, then remove it from the other synchros in the waitany
+     * list. Afterwards, get the position of the actual synchro in the waitany list and return it as the result of the
+     * simcall */
+
+    if (simcall->call_ == SIMCALL_NONE) // FIXME: maybe a better way to handle this case
+      continue;                        // if process handling comm is killed
+    if (simcall->call_ == SIMCALL_EXECUTION_WAITANY_FOR) {
+      simgrid::kernel::activity::ExecImpl** execs = simcall_execution_waitany_for__get__execs(simcall);
+      size_t count                                = simcall_execution_waitany_for__get__count(simcall);
+
+      for (size_t i = 0; i < count; i++) {
+        // Remove the first occurence of simcall:
+        auto* exec = execs[i];
+        auto j     = boost::range::find(exec->simcalls_, simcall);
+        if (j != exec->simcalls_.end())
+          exec->simcalls_.erase(j);
+
+        if (simcall->timeout_cb_) {
+          simcall->timeout_cb_->remove();
+          simcall->timeout_cb_ = nullptr;
+        }
+      }
+
+      if (not MC_is_active() && not MC_record_replay_is_active()) {
+        ExecImpl** element = std::find(execs, execs + count, this);
+        int rank           = (element != execs + count) ? element - execs : -1;
+        simcall_execution_waitany_for__set__result(simcall, rank);
+      }
+    }
+
     switch (state_) {
 
       case SIMIX_DONE:
@@ -213,37 +249,35 @@ void ExecImpl::finish()
         break;
 
       case SIMIX_FAILED:
-        XBT_DEBUG("ExecImpl::finish(): host '%s' failed", simcall->issuer->get_host()->get_cname());
-        simcall->issuer->context_->iwannadie = true;
-        if (simcall->issuer->get_host()->is_on())
-          simcall->issuer->exception_ =
+        XBT_DEBUG("ExecImpl::finish(): host '%s' failed", simcall->issuer_->get_host()->get_cname());
+        simcall->issuer_->context_->iwannadie = true;
+        if (simcall->issuer_->get_host()->is_on())
+          simcall->issuer_->exception_ =
               std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Host failed"));
         /* else, the actor will be killed with no possibility to survive */
         break;
 
       case SIMIX_CANCELED:
         XBT_DEBUG("ExecImpl::finish(): execution canceled");
-        simcall->issuer->exception_ =
+        simcall->issuer_->exception_ =
             std::make_exception_ptr(simgrid::CancelException(XBT_THROW_POINT, "Execution Canceled"));
         break;
 
       case SIMIX_TIMEOUT:
         XBT_DEBUG("ExecImpl::finish(): execution timeouted");
-        simcall->issuer->exception_ = std::make_exception_ptr(simgrid::TimeoutError(XBT_THROW_POINT, "Timeouted"));
+        simcall->issuer_->exception_ = std::make_exception_ptr(simgrid::TimeoutException(XBT_THROW_POINT, "Timeouted"));
         break;
 
       default:
         xbt_die("Internal error in ExecImpl::finish(): unexpected synchro state %d", static_cast<int>(state_));
     }
 
-    simcall->issuer->waiting_synchro = nullptr;
-    simcall_execution_wait__set__result(simcall, state_);
-
+    simcall->issuer_->waiting_synchro = nullptr;
     /* Fail the process if the host is down */
-    if (simcall->issuer->get_host()->is_on())
-      SIMIX_simcall_answer(simcall);
+    if (simcall->issuer_->get_host()->is_on())
+      simcall->issuer_->simcall_answer();
     else
-      simcall->issuer->context_->iwannadie = true;
+      simcall->issuer_->context_->iwannadie = true;
   }
 }
 
@@ -253,13 +287,13 @@ ActivityImpl* ExecImpl::migrate(s4u::Host* to)
     resource::Action* old_action = this->surf_action_;
     resource::Action* new_action = to->pimpl_cpu->execution_start(old_action->get_cost());
     new_action->set_remains(old_action->get_remains());
-    new_action->set_data(this);
-    new_action->set_priority(old_action->get_priority());
+    new_action->set_activity(this);
+    new_action->set_sharing_penalty(old_action->get_sharing_penalty());
 
     // FIXME: the user-defined bound seem to not be kept by LMM, that seem to overwrite it for the multi-core modeling.
     // I hope that the user did not provide any.
 
-    old_action->set_data(nullptr);
+    old_action->set_activity(nullptr);
     old_action->cancel();
     old_action->unref();
     this->surf_action_ = new_action;
@@ -272,8 +306,6 @@ ActivityImpl* ExecImpl::migrate(s4u::Host* to)
 /*************
  * Callbacks *
  *************/
-xbt::signal<void(ExecImpl&)> ExecImpl::on_creation;
-xbt::signal<void(ExecImpl const&)> ExecImpl::on_completion;
 xbt::signal<void(ExecImpl const&, s4u::Host*)> ExecImpl::on_migration;
 
 } // namespace activity
index 80d25bd..86ac8a3 100644 (file)
@@ -14,9 +14,9 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
-class XBT_PUBLIC ExecImpl : public ActivityImpl {
+class XBT_PUBLIC ExecImpl : public ActivityImpl_T<ExecImpl> {
   resource::Action* timeout_detector_ = nullptr;
-  double priority_                    = 1.0;
+  double sharing_penalty_             = 1.0;
   double bound_                       = 0.0;
   std::vector<s4u::Host*> hosts_;
   std::vector<double> flops_amounts_;
@@ -24,11 +24,9 @@ class XBT_PUBLIC ExecImpl : public ActivityImpl {
   ~ExecImpl();
 
 public:
-  ExecImpl& set_name(const std::string& name);
-  ExecImpl& set_tracing_category(const std::string& category);
   ExecImpl& set_timeout(double timeout);
   ExecImpl& set_bound(double bound);
-  ExecImpl& set_priority(double priority);
+  ExecImpl& set_sharing_penalty(double sharing_penalty);
 
   ExecImpl& set_flops_amount(double flop_amount);
   ExecImpl& set_host(s4u::Host* host);
@@ -39,18 +37,14 @@ public:
   ExecImpl& set_hosts(const std::vector<s4u::Host*>& hosts);
 
   unsigned int get_host_number() const { return hosts_.size(); }
-  double get_remaining() const;
   double get_seq_remaining_ratio();
   double get_par_remaining_ratio();
   virtual ActivityImpl* migrate(s4u::Host* to);
 
   ExecImpl* start();
-  void cancel();
   void post() override;
   void finish() override;
 
-  static xbt::signal<void(ExecImpl&)> on_creation;
-  static xbt::signal<void(ExecImpl const&)> on_completion;
   static xbt::signal<void(ExecImpl const&, s4u::Host*)> on_migration;
 };
 } // namespace activity
index e24fe23..63f5381 100644 (file)
@@ -7,6 +7,7 @@
 #include "simgrid/Exception.hpp"
 #include "simgrid/kernel/resource/Action.hpp"
 #include "simgrid/s4u/Host.hpp"
+#include "src/kernel/resource/DiskImpl.hpp"
 #include "src/mc/mc_replay.hpp"
 #include "src/simix/smx_private.hpp"
 #include "src/surf/StorageImpl.hpp"
@@ -18,15 +19,10 @@ void simcall_HANDLER_io_wait(smx_simcall_t simcall, simgrid::kernel::activity::I
   XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro, (int)synchro->state_);
 
   /* Associate this simcall to the synchro */
-  synchro->simcalls_.push_back(simcall);
-  simcall->issuer->waiting_synchro = synchro;
+  synchro->register_simcall(simcall);
 
-  /* set surf's synchro */
-  if (MC_is_active() || MC_record_replay_is_active()) {
+  if (MC_is_active() || MC_record_replay_is_active())
     synchro->state_ = SIMIX_DONE;
-    synchro->finish();
-    return;
-  }
 
   /* If the synchro is already finished then perform the error handling */
   if (synchro->state_ != SIMIX_RUNNING)
@@ -37,12 +33,6 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
-IoImpl& IoImpl::set_name(const std::string& name)
-{
-  ActivityImpl::set_name(name);
-  return *this;
-}
-
 IoImpl& IoImpl::set_type(s4u::Io::OpType type)
 {
   type_ = type;
@@ -55,6 +45,12 @@ IoImpl& IoImpl::set_size(sg_size_t size)
   return *this;
 }
 
+IoImpl& IoImpl::set_disk(resource::DiskImpl* disk)
+{
+  disk_ = disk;
+  return *this;
+}
+
 IoImpl& IoImpl::set_storage(resource::StorageImpl* storage)
 {
   storage_ = storage;
@@ -64,8 +60,11 @@ IoImpl& IoImpl::set_storage(resource::StorageImpl* storage)
 IoImpl* IoImpl::start()
 {
   state_       = SIMIX_RUNNING;
-  surf_action_ = storage_->io_start(size_, type_);
-  surf_action_->set_data(this);
+  if (storage_)
+    surf_action_ = storage_->io_start(size_, type_);
+  else
+    surf_action_ = disk_->io_start(size_, type_);
+  surf_action_->set_activity(this);
 
   XBT_DEBUG("Create IO synchro %p %s", this, get_cname());
   IoImpl::on_start(*this);
@@ -73,61 +72,46 @@ IoImpl* IoImpl::start()
   return this;
 }
 
-void IoImpl::cancel()
-{
-  XBT_VERB("This exec %p is canceled", this);
-  if (surf_action_ != nullptr)
-    surf_action_->cancel();
-  state_ = SIMIX_CANCELED;
-}
-
-double IoImpl::get_remaining()
-{
-  return surf_action_ ? surf_action_->get_remains() : 0;
-}
-
 void IoImpl::post()
 {
   performed_ioops_ = surf_action_->get_cost();
-  switch (surf_action_->get_state()) {
-    case resource::Action::State::FAILED:
+  if (surf_action_->get_state() == resource::Action::State::FAILED) {
+    if ((storage_ && not storage_->is_on()) || (disk_ && not disk_->is_on()))
       state_ = SIMIX_FAILED;
-      break;
-    case resource::Action::State::FINISHED:
-      state_ = SIMIX_DONE;
-      break;
-    default:
-      THROW_IMPOSSIBLE;
+    else
+      state_ = SIMIX_CANCELED;
+  } else if (surf_action_->get_state() == resource::Action::State::FINISHED) {
+    state_ = SIMIX_DONE;
   }
   on_completion(*this);
 
+  /* Answer all simcalls associated with the synchro */
   finish();
 }
 
 void IoImpl::finish()
 {
-  for (smx_simcall_t const& simcall : simcalls_) {
+  while (not simcalls_.empty()) {
+    smx_simcall_t simcall = simcalls_.front();
+    simcalls_.pop_front();
     switch (state_) {
       case SIMIX_DONE:
         /* do nothing, synchro done */
         break;
       case SIMIX_FAILED:
-        simcall->issuer->exception_ =
-            std::make_exception_ptr(simgrid::StorageFailureException(XBT_THROW_POINT, "Storage failed"));
+        simcall->issuer_->context_->iwannadie = true;
+        simcall->issuer_->exception_ =
+            std::make_exception_ptr(StorageFailureException(XBT_THROW_POINT, "Storage failed"));
         break;
       case SIMIX_CANCELED:
-        simcall->issuer->exception_ =
-            std::make_exception_ptr(simgrid::CancelException(XBT_THROW_POINT, "I/O Canceled"));
+        simcall->issuer_->exception_ = std::make_exception_ptr(CancelException(XBT_THROW_POINT, "I/O Canceled"));
         break;
       default:
         xbt_die("Internal error in IoImpl::finish(): unexpected synchro state %d", static_cast<int>(state_));
     }
 
-    simcall->issuer->waiting_synchro = nullptr;
-    if (simcall->issuer->get_host()->is_on())
-      SIMIX_simcall_answer(simcall);
-    else
-      simcall->issuer->context_->iwannadie = true;
+    simcall->issuer_->waiting_synchro = nullptr;
+    simcall->issuer_->simcall_answer();
   }
 }
 
index 102b691..8d8f04c 100644 (file)
@@ -14,25 +14,24 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
-class XBT_PUBLIC IoImpl : public ActivityImpl {
+class XBT_PUBLIC IoImpl : public ActivityImpl_T<IoImpl> {
   resource::StorageImpl* storage_ = nullptr;
+  resource::DiskImpl* disk_       = nullptr;
   sg_size_t size_                 = 0;
   s4u::Io::OpType type_           = s4u::Io::OpType::READ;
   sg_size_t performed_ioops_      = 0;
 
 public:
-  IoImpl& set_name(const std::string& name);
   IoImpl& set_size(sg_size_t size);
   IoImpl& set_type(s4u::Io::OpType type);
   IoImpl& set_storage(resource::StorageImpl* storage);
+  IoImpl& set_disk(resource::DiskImpl* disk);
 
   sg_size_t get_performed_ioops() { return performed_ioops_; }
 
   IoImpl* start();
   void post() override;
   void finish() override;
-  void cancel();
-  double get_remaining();
 
   static xbt::signal<void(IoImpl const&)> on_start;
   static xbt::signal<void(IoImpl const&)> on_completion;
index c7a8362..3137c62 100644 (file)
@@ -64,7 +64,7 @@ void MailboxImpl::set_receiver(s4u::ActorPtr actor)
  */
 void MailboxImpl::push(CommImplPtr comm)
 {
-  comm->mbox = this;
+  comm->set_mailbox(this);
   this->comm_queue_.push_back(std::move(comm));
 }
 
@@ -73,9 +73,10 @@ void MailboxImpl::push(CommImplPtr comm)
  */
 void MailboxImpl::remove(const CommImplPtr& comm)
 {
-  xbt_assert(comm->mbox == this, "Comm %p is in mailbox %s, not mailbox %s", comm.get(),
-             (comm->mbox ? comm->mbox->get_cname() : "(null)"), this->get_cname());
-  comm->mbox = nullptr;
+  xbt_assert(comm->get_mailbox() == this, "Comm %p is in mailbox %s, not mailbox %s", comm.get(),
+             (comm->get_mailbox() ? comm->get_mailbox()->get_cname() : "(null)"), this->get_cname());
+
+  comm->set_mailbox(nullptr);
   for (auto it = this->comm_queue_.begin(); it != this->comm_queue_.end(); it++)
     if (*it == comm) {
       this->comm_queue_.erase(it);
@@ -140,9 +141,9 @@ CommImplPtr MailboxImpl::find_matching_comm(CommImpl::Type type, int (*match_fun
         (not comm->match_fun || comm->match_fun(other_user_data, this_user_data, my_synchro.get()))) {
       XBT_DEBUG("Found a matching communication synchro %p", comm.get());
 #if SIMGRID_HAVE_MC
-      comm->mbox_cpy = comm->mbox;
+      comm->mbox_cpy = comm->get_mailbox();
 #endif
-      comm->mbox = nullptr;
+      comm->set_mailbox(nullptr);
       CommImplPtr comm_cpy = comm;
       if (remove_matching)
         comm_queue.erase(it);
index 29b561c..b176c76 100644 (file)
@@ -22,6 +22,9 @@ namespace activity {
 class MailboxImpl {
   static constexpr size_t MAX_MAILBOX_SIZE = 10000000;
 
+  s4u::Mailbox piface_;
+  xbt::string name_;
+
   friend s4u::Mailbox;
   friend s4u::Mailbox* s4u::Mailbox::by_name(const std::string& name);
   friend mc::CommunicationDeterminismChecker;
@@ -43,11 +46,6 @@ public:
   CommImplPtr find_matching_comm(CommImpl::Type type, int (*match_fun)(void*, void*, CommImpl*), void* this_user_data,
                                  const CommImplPtr& my_synchro, bool done, bool remove_matching);
 
-private:
-  s4u::Mailbox piface_;
-  xbt::string name_;
-
-public:
   actor::ActorImplPtr permanent_receiver_; // actor to which the mailbox is attached
   boost::circular_buffer_space_optimized<CommImplPtr> comm_queue_;
   boost::circular_buffer_space_optimized<CommImplPtr> done_comm_queue_; // messages already received in the permanent
index e8a2b1d..9274c47 100644 (file)
@@ -12,18 +12,6 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
-MutexImpl::MutexImpl() : piface_(this)
-{
-  XBT_IN("(%p)", this);
-  XBT_OUT();
-}
-
-MutexImpl::~MutexImpl()
-{
-  XBT_IN("(%p)", this);
-  XBT_OUT();
-}
-
 void MutexImpl::lock(actor::ActorImpl* issuer)
 {
   XBT_IN("(%p; %p)", this, issuer);
@@ -42,7 +30,7 @@ void MutexImpl::lock(actor::ActorImpl* issuer)
     /* mutex free */
     locked_ = true;
     owner_  = issuer;
-    SIMIX_simcall_answer(&issuer->simcall);
+    issuer->simcall_answer();
   }
   XBT_OUT();
 }
@@ -75,21 +63,16 @@ bool MutexImpl::try_lock(actor::ActorImpl* issuer)
 void MutexImpl::unlock(actor::ActorImpl* issuer)
 {
   XBT_IN("(%p, %p)", this, issuer);
-  if (not locked_)
-    THROWF(mismatch_error, 0, "Cannot release that mutex: it was not locked.");
-
-  /* If the mutex is not owned by the issuer, that's not good */
-  if (issuer != owner_)
-    THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%ld), not by you.",
-           owner_->get_cname(), owner_->get_pid());
+  xbt_assert(locked_, "Cannot release that mutex: it was not locked.");
+  xbt_assert(issuer == owner_, "Cannot release that mutex: it was locked by %s (pid:%ld), not by you.",
+             owner_->get_cname(), owner_->get_pid());
 
   if (not sleeping_.empty()) {
-    /*process to wake up */
-    actor::ActorImpl* p = &sleeping_.front();
+    /* Give the ownership to the first waiting actor */
+    owner_ = &sleeping_.front();
     sleeping_.pop_front();
-    p->waiting_synchro = nullptr;
-    owner_             = p;
-    SIMIX_simcall_answer(&p->simcall);
+    owner_->waiting_synchro = nullptr;
+    owner_->simcall_answer();
   } else {
     /* nobody to wake up */
     locked_ = false;
@@ -118,15 +101,15 @@ void MutexImpl::unref()
 
 void simcall_HANDLER_mutex_lock(smx_simcall_t simcall, smx_mutex_t mutex)
 {
-  mutex->lock(simcall->issuer);
+  mutex->lock(simcall->issuer_);
 }
 
 int simcall_HANDLER_mutex_trylock(smx_simcall_t simcall, smx_mutex_t mutex)
 {
-  return mutex->try_lock(simcall->issuer);
+  return mutex->try_lock(simcall->issuer_);
 }
 
 void simcall_HANDLER_mutex_unlock(smx_simcall_t simcall, smx_mutex_t mutex)
 {
-  mutex->unlock(simcall->issuer);
+  mutex->unlock(simcall->issuer_);
 }
index b60f735..3abf068 100644 (file)
@@ -15,19 +15,23 @@ namespace kernel {
 namespace activity {
 
 class XBT_PUBLIC MutexImpl {
+  std::atomic_int_fast32_t refcount_{1};
+  s4u::Mutex piface_;
+  bool locked_ = false;
+
 public:
-  MutexImpl();
-  ~MutexImpl();
+  MutexImpl() : piface_(this) {}
   MutexImpl(MutexImpl const&) = delete;
   MutexImpl& operator=(MutexImpl const&) = delete;
 
   void lock(actor::ActorImpl* issuer);
   bool try_lock(actor::ActorImpl* issuer);
   void unlock(actor::ActorImpl* issuer);
+  bool is_locked() { return locked_; }
 
   MutexImpl* ref();
   void unref();
-  bool locked_             = false;
+
   actor::ActorImpl* owner_ = nullptr;
   // List of sleeping actors:
   actor::SynchroList sleeping_;
@@ -46,10 +50,6 @@ public:
   }
 
   s4u::Mutex& mutex() { return piface_; }
-
-private:
-  std::atomic_int_fast32_t refcount_{1};
-  s4u::Mutex piface_;
 };
 }
 }
index 66e9900..2daeba6 100644 (file)
@@ -14,18 +14,15 @@ namespace activity {
 
 void SemaphoreImpl::acquire(actor::ActorImpl* issuer, double timeout)
 {
-  RawImplPtr synchro = nullptr;
-
   XBT_DEBUG("Wait semaphore %p (timeout:%f)", this, timeout);
   if (value_ <= 0) {
-    synchro = RawImplPtr(new RawImpl());
-    (*synchro).set_host(issuer->get_host()).set_timeout(timeout).start();
-    synchro->simcalls_.push_front(&issuer->simcall);
-    issuer->waiting_synchro = synchro;
+    RawImplPtr synchro = RawImplPtr(new RawImpl());
+    synchro->set_host(issuer->get_host()).set_timeout(timeout).start();
+    synchro->register_simcall(&issuer->simcall);
     sleeping_.push_back(*issuer);
   } else {
     value_--;
-    SIMIX_simcall_answer(&issuer->simcall);
+    issuer->simcall_answer();
   }
 }
 void SemaphoreImpl::release()
@@ -36,7 +33,7 @@ void SemaphoreImpl::release()
     auto& actor = sleeping_.front();
     sleeping_.pop_front();
     actor.waiting_synchro = nullptr;
-    SIMIX_simcall_answer(&actor.simcall);
+    actor.simcall_answer();
   } else {
     value_++;
   }
@@ -52,7 +49,7 @@ void SemaphoreImpl::release()
  */
 void simcall_HANDLER_sem_acquire(smx_simcall_t simcall, smx_sem_t sem)
 {
-  sem->acquire(simcall->issuer, -1);
+  sem->acquire(simcall->issuer_, -1);
 }
 
 /**
@@ -61,5 +58,5 @@ void simcall_HANDLER_sem_acquire(smx_simcall_t simcall, smx_sem_t sem)
 void simcall_HANDLER_sem_acquire_timeout(smx_simcall_t simcall, smx_sem_t sem, double timeout)
 {
   simcall_sem_acquire_timeout__set__result(simcall, 0); // default result, will be set to 1 on timeout
-  sem->acquire(simcall->issuer, timeout);
+  sem->acquire(simcall->issuer_, timeout);
 }
index 73faa7b..e6dc57d 100644 (file)
@@ -17,7 +17,12 @@ namespace kernel {
 namespace activity {
 
 class XBT_PUBLIC SemaphoreImpl {
+  std::atomic_int_fast32_t refcount_{1};
+  unsigned int value_;
+
 public:
+  actor::SynchroList sleeping_; /* list of sleeping actors*/
+
   explicit SemaphoreImpl(unsigned int value) : value_(value){};
   ~SemaphoreImpl() = default;
 
@@ -27,6 +32,7 @@ public:
   void acquire(actor::ActorImpl* issuer, double timeout);
   void release();
   bool would_block() { return (value_ == 0); }
+
   unsigned int get_capacity() { return value_; }
 
   friend void intrusive_ptr_add_ref(SemaphoreImpl* sem)
@@ -39,12 +45,6 @@ public:
     if (sem->refcount_.fetch_sub(1) == 1)
       delete sem;
   }
-
-  unsigned int value_;
-  actor::SynchroList sleeping_; /* list of sleeping actors*/
-
-private:
-  std::atomic_int_fast32_t refcount_{1};
 };
 } // namespace activity
 } // namespace kernel
index 3072fb9..dc94cff 100644 (file)
@@ -18,12 +18,6 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
-SleepImpl& SleepImpl::set_name(const std::string& name)
-{
-  ActivityImpl::set_name(name);
-  return *this;
-}
-
 SleepImpl& SleepImpl::set_host(s4u::Host* host)
 {
   host_ = host;
@@ -39,56 +33,42 @@ SleepImpl& SleepImpl::set_duration(double duration)
 SleepImpl* SleepImpl::start()
 {
   surf_action_ = host_->pimpl_cpu->sleep(duration_);
-  surf_action_->set_data(this);
+  surf_action_->set_activity(this);
   XBT_DEBUG("Create sleep synchronization %p", this);
   return this;
 }
 
 void SleepImpl::post()
+{
+  if (surf_action_->get_state() == resource::Action::State::FAILED) {
+    if (host_ && not host_->is_on())
+      state_ = SIMIX_SRC_HOST_FAILURE;
+    else
+      state_ = SIMIX_CANCELED;
+  } else if (surf_action_->get_state() == resource::Action::State::FINISHED) {
+    state_ = SIMIX_DONE;
+  }
+  /* Answer all simcalls associated with the synchro */
+  finish();
+}
+
+void SleepImpl::finish()
 {
   while (not simcalls_.empty()) {
     smx_simcall_t simcall = simcalls_.front();
     simcalls_.pop_front();
-    e_smx_state_t result;
-    if (host_ && not host_->is_on()) {
-      /* If the host running the synchro failed, notice it. This way, the asking
-       * actor can be killed if it runs on that host itself */
-      result = SIMIX_SRC_HOST_FAILURE;
-      simcall->issuer->throw_exception(
-          std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Host failed")));
-    }
-
-    switch (surf_action_->get_state()) {
-      case resource::Action::State::FAILED:
-        simcall->issuer->context_->iwannadie = true;
-        result                               = SIMIX_FAILED;
-        break;
-
-      case resource::Action::State::FINISHED:
-        result = SIMIX_DONE;
-        break;
 
-      default:
-        THROW_IMPOSSIBLE;
-    }
-    if (not simcall->issuer->get_host()->is_on()) {
-      simcall->issuer->context_->iwannadie = true;
-    }
-    simcall_process_sleep__set__result(simcall, result);
-    simcall->issuer->waiting_synchro = nullptr;
-    if (simcall->issuer->is_suspended()) {
+    simcall->issuer_->waiting_synchro = nullptr;
+    if (simcall->issuer_->is_suspended()) {
       XBT_DEBUG("Wait! This process is suspended and can't wake up now.");
-      simcall->issuer->suspended_ = false;
-      simcall_HANDLER_process_suspend(simcall, simcall->issuer);
+      simcall->issuer_->suspended_ = false;
+      simcall->issuer_->suspend();
     } else {
-      SIMIX_simcall_answer(simcall);
+      simcall->issuer_->simcall_answer();
     }
   }
-  SIMIX_process_sleep_destroy(this);
-}
-void SleepImpl::finish()
-{
-  /* FIXME some part of post should move to finish */
+
+  clean_action();
 }
 } // namespace activity
 } // namespace kernel
index a4d75b0..ec5c9e2 100644 (file)
@@ -13,12 +13,11 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
-class XBT_PUBLIC SleepImpl : public ActivityImpl {
+class XBT_PUBLIC SleepImpl : public ActivityImpl_T<SleepImpl> {
   sg_host_t host_  = nullptr;
   double duration_ = 0;
 
 public:
-  SleepImpl& set_name(const std::string& name);
   SleepImpl& set_host(s4u::Host* host);
   SleepImpl& set_duration(double duration);
   void post() override;
index 9f55eba..62c1231 100644 (file)
@@ -34,7 +34,7 @@ RawImpl& RawImpl::set_timeout(double timeout)
 RawImpl* RawImpl::start()
 {
   surf_action_ = host_->pimpl_cpu->sleep(timeout_);
-  surf_action_->set_data(this);
+  surf_action_->set_activity(this);
   return this;
 }
 
@@ -48,6 +48,12 @@ void RawImpl::resume()
   /* I cannot resume raw synchros directly. This is delayed to when the process is rescheduled at
    * the end of the synchro. */
 }
+
+void RawImpl::cancel()
+{
+  /* I cannot cancel raw synchros directly. */
+}
+
 void RawImpl::post()
 {
   if (surf_action_->get_state() == resource::Action::State::FAILED) {
@@ -63,55 +69,43 @@ void RawImpl::finish()
   smx_simcall_t simcall = simcalls_.front();
   simcalls_.pop_front();
 
-  switch (state_) {
-    case SIMIX_DONE:
-      /* do nothing, synchro done */
-      XBT_DEBUG("RawImpl::finish(): execution successful");
-      break;
-
-    case SIMIX_FAILED:
-      XBT_DEBUG("RawImpl::finish(): host '%s' failed", simcall->issuer->get_host()->get_cname());
-      simcall->issuer->context_->iwannadie = true;
-      simcall->issuer->exception_ =
-          std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Host failed"));
-      break;
-    case SIMIX_SRC_TIMEOUT:
-      simcall->issuer->exception_ =
-          std::make_exception_ptr(simgrid::TimeoutError(XBT_THROW_POINT, "Synchronization timeout"));
-      break;
-    default:
-      xbt_die("Internal error in RawImpl::finish() unexpected synchro state %d", static_cast<int>(state_));
+  if (state_ == SIMIX_FAILED) {
+    XBT_DEBUG("RawImpl::finish(): host '%s' failed", simcall->issuer_->get_host()->get_cname());
+    simcall->issuer_->context_->iwannadie = true;
+    simcall->issuer_->exception_ = std::make_exception_ptr(HostFailureException(XBT_THROW_POINT, "Host failed"));
+  } else if (state_ != SIMIX_SRC_TIMEOUT) {
+    xbt_die("Internal error in RawImpl::finish() unexpected synchro state %d", static_cast<int>(state_));
   }
 
-  switch (simcall->call) {
+  switch (simcall->call_) {
 
     case SIMCALL_MUTEX_LOCK:
-      simgrid::xbt::intrusive_erase(simcall_mutex_lock__get__mutex(simcall)->sleeping_, *simcall->issuer);
+      simgrid::xbt::intrusive_erase(simcall_mutex_lock__get__mutex(simcall)->sleeping_, *simcall->issuer_);
       break;
 
     case SIMCALL_COND_WAIT:
-      simgrid::xbt::intrusive_erase(simcall_cond_wait__get__cond(simcall)->sleeping_, *simcall->issuer);
+      simgrid::xbt::intrusive_erase(simcall_cond_wait__get__cond(simcall)->sleeping_, *simcall->issuer_);
       break;
 
     case SIMCALL_COND_WAIT_TIMEOUT:
-      simgrid::xbt::intrusive_erase(simcall_cond_wait_timeout__get__cond(simcall)->sleeping_, *simcall->issuer);
+      simgrid::xbt::intrusive_erase(simcall_cond_wait_timeout__get__cond(simcall)->sleeping_, *simcall->issuer_);
       simcall_cond_wait_timeout__set__result(simcall, 1); // signal a timeout
       break;
 
     case SIMCALL_SEM_ACQUIRE:
-      simgrid::xbt::intrusive_erase(simcall_sem_acquire__get__sem(simcall)->sleeping_, *simcall->issuer);
+      simgrid::xbt::intrusive_erase(simcall_sem_acquire__get__sem(simcall)->sleeping_, *simcall->issuer_);
       break;
 
     case SIMCALL_SEM_ACQUIRE_TIMEOUT:
-      simgrid::xbt::intrusive_erase(simcall_sem_acquire_timeout__get__sem(simcall)->sleeping_, *simcall->issuer);
+      simgrid::xbt::intrusive_erase(simcall_sem_acquire_timeout__get__sem(simcall)->sleeping_, *simcall->issuer_);
       simcall_sem_acquire_timeout__set__result(simcall, 1); // signal a timeout
       break;
 
     default:
       THROW_IMPOSSIBLE;
   }
-  simcall->issuer->waiting_synchro = nullptr;
-  SIMIX_simcall_answer(simcall);
+  simcall->issuer_->waiting_synchro = nullptr;
+  simcall->issuer_->simcall_answer();
 }
 
 } // namespace activity
index a1d4ca3..13953ea 100644 (file)
@@ -14,7 +14,7 @@ namespace kernel {
 namespace activity {
 
   /** Used to implement mutexes, semaphores and conditions */
-class XBT_PUBLIC RawImpl : public ActivityImpl {
+class XBT_PUBLIC RawImpl : public ActivityImpl_T<RawImpl> {
   sg_host_t host_ = nullptr;
   double timeout_ = -1;
 
@@ -25,6 +25,7 @@ public:
   RawImpl* start();
   void suspend() override;
   void resume() override;
+  void cancel() override;
   void post() override;
   void finish() override;
 };
index b0d47c3..4c83228 100644 (file)
 #include "src/surf/cpu_interface.hpp"
 
 #include <boost/range/algorithm.hpp>
+#include <utility>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_process, simix, "Logging specific to SIMIX (process)");
 
-static unsigned long simix_process_maxpid = 0;
-
 /**
  * @brief Returns the current agent.
  *
@@ -53,13 +52,28 @@ namespace simgrid {
 namespace kernel {
 namespace actor {
 
-ActorImpl::ActorImpl(const simgrid::xbt::string& name, s4u::Host* host) : host_(host), name_(name), piface_(this)
+static unsigned long maxpid = 0;
+int get_maxpid()
 {
-  pid_           = simix_process_maxpid++;
-  simcall.issuer = this;
+  return maxpid;
 }
 
-ActorImpl::~ActorImpl() = default;
+ActorImpl::ActorImpl(simgrid::xbt::string name, s4u::Host* host) : host_(host), name_(std::move(name)), piface_(this)
+{
+  pid_           = maxpid++;
+  simcall.issuer_ = this;
+}
+
+ActorImpl::~ActorImpl()
+{
+  if (simix_global != nullptr && this != simix_global->maestro_process) {
+    if (context_.get() != nullptr) /* the actor was not start()ed yet. This happens if its host was initially off */
+      context_->iwannadie = false; // don't let the simcall's yield() do a Context::stop(), to avoid infinite loops
+    simgrid::kernel::actor::simcall([this] { simgrid::s4u::Actor::on_destruction(*ciface()); });
+    if (context_.get() != nullptr)
+      context_->iwannadie = true;
+  }
+}
 
 /* Become an actor in the simulation
  *
@@ -70,7 +84,7 @@ ActorImpl::~ActorImpl() = default;
  */
 
 ActorImplPtr ActorImpl::attach(const std::string& name, void* data, s4u::Host* host,
-                               std::unordered_map<std::string, std::string>* properties)
+                               const std::unordered_map<std::string, std::string>* properties)
 {
   // This is mostly a copy/paste from create(), it'd be nice to share some code between those two functions.
 
@@ -78,14 +92,13 @@ ActorImplPtr ActorImpl::attach(const std::string& name, void* data, s4u::Host* h
 
   if (not host->is_on()) {
     XBT_WARN("Cannot launch process '%s' on failed host '%s'", name.c_str(), host->get_cname());
-    std::rethrow_exception(
-        std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Cannot attach actor on failed host.")));
+    throw simgrid::HostFailureException(XBT_THROW_POINT, "Cannot attach actor on failed host.");
   }
 
   ActorImpl* actor = new ActorImpl(xbt::string(name), host);
   /* Actor data */
   actor->set_user_data(data);
-  actor->code = nullptr;
+  actor->code_ = nullptr;
 
   XBT_VERB("Create context %s", actor->get_cname());
   xbt_assert(simix_global != nullptr, "simix is not initialized, please call MSG_init first");
@@ -93,8 +106,7 @@ ActorImplPtr ActorImpl::attach(const std::string& name, void* data, s4u::Host* h
 
   /* Add properties */
   if (properties != nullptr)
-    for (auto const& kv : *properties)
-      actor->set_property(kv.first, kv.second);
+    actor->set_properties(*properties);
 
   /* Add the process to it's host process list */
   host->pimpl_->process_list_.push_back(*actor);
@@ -140,13 +152,14 @@ void ActorImpl::cleanup()
     watched_hosts.insert(get_host()->get_name());
   }
 
-  // Execute the termination callbacks
-  bool failed = context_->iwannadie;
-  while (not on_exit.empty()) {
-    auto exit_fun = on_exit.back();
-    on_exit.pop_back();
-    exit_fun(failed);
+  if (on_exit) {
+    // Execute the termination callbacks
+    bool failed = context_->iwannadie;
+    for (auto exit_fun = on_exit->crbegin(); exit_fun != on_exit->crend(); ++exit_fun)
+      (*exit_fun)(failed);
+    on_exit.reset();
   }
+  undaemonize();
 
   /* cancel non-blocking activities */
   for (auto activity : comms)
@@ -181,57 +194,41 @@ void ActorImpl::cleanup()
   simix_global->mutex.unlock();
 
   context_->iwannadie = false; // don't let the simcall's yield() do a Context::stop(), to avoid infinite loops
-  simgrid::simix::simcall([this] { simgrid::s4u::Actor::on_destruction(*ciface()); });
+  simgrid::kernel::actor::simcall([this] { simgrid::s4u::Actor::on_termination(*ciface()); });
   context_->iwannadie = true;
 }
 
 void ActorImpl::exit()
 {
   context_->iwannadie = true;
-  blocked_            = false;
   suspended_          = false;
   exception_          = nullptr;
 
-  // Forcefully kill the actor if its host is turned off. Not a HostFailureException because you should not survive that
-  if (not host_->is_on())
-    this->throw_exception(std::make_exception_ptr(ForcefulKillException("host failed")));
-
   /* destroy the blocking synchro if any */
   if (waiting_synchro != nullptr) {
+    waiting_synchro->cancel();
+    waiting_synchro->state_ = SIMIX_FAILED;
 
     activity::ExecImplPtr exec   = boost::dynamic_pointer_cast<activity::ExecImpl>(waiting_synchro);
     activity::CommImplPtr comm   = boost::dynamic_pointer_cast<activity::CommImpl>(waiting_synchro);
-    activity::SleepImplPtr sleep = boost::dynamic_pointer_cast<activity::SleepImpl>(waiting_synchro);
-    activity::RawImplPtr raw     = boost::dynamic_pointer_cast<activity::RawImpl>(waiting_synchro);
-    activity::IoImplPtr io       = boost::dynamic_pointer_cast<activity::IoImpl>(waiting_synchro);
-
-    if (exec != nullptr && exec->surf_action_) {
-      exec->cancel();
-      exec->surf_action_->unref();
-      exec->surf_action_ = nullptr;
+
+    if (exec != nullptr) {
+      exec->clean_action();
     } else if (comm != nullptr) {
       comms.remove(waiting_synchro);
-      comm->cancel();
       // Remove first occurrence of &actor->simcall:
       auto i = boost::range::find(waiting_synchro->simcalls_, &simcall);
       if (i != waiting_synchro->simcalls_.end())
         waiting_synchro->simcalls_.remove(&simcall);
-    } else if (sleep != nullptr) {
-      if (sleep->surf_action_)
-        sleep->surf_action_->cancel();
-      sleep->post();
-    } else if (raw != nullptr) {
-      raw->finish();
-    } else if (io != nullptr) {
-      io->cancel();
     } else {
-      simgrid::kernel::activity::ActivityImplPtr activity = waiting_synchro;
-      xbt_die("Activity %s is of unknown type %s", activity->get_cname(),
-              simgrid::xbt::demangle(typeid(activity).name()).get());
+      activity::ActivityImplPtr(waiting_synchro)->finish();
     }
 
     waiting_synchro = nullptr;
   }
+
+  // Forcefully kill the actor if its host is turned off. Not a HostFailureException because you should not survive that
+  this->throw_exception(std::make_exception_ptr(ForcefulKillException(host_->is_on() ? "exited" : "host failed")));
 }
 
 void ActorImpl::kill(ActorImpl* actor)
@@ -300,7 +297,7 @@ void ActorImpl::yield()
 
     xbt_assert(exception_ == nullptr, "Gasp! This exception may be lost by subsequent calls.");
     suspended_ = false;
-    suspend(this);
+    suspend();
   }
 
   if (exception_ != nullptr) {
@@ -321,15 +318,20 @@ void ActorImpl::daemonize()
   if (not daemon_) {
     daemon_ = true;
     simix_global->daemons.push_back(this);
-    SIMIX_process_on_exit(this, [this](bool) {
-      auto& vect = simix_global->daemons;
-      auto it    = std::find(vect.begin(), vect.end(), this);
-      xbt_assert(it != vect.end(), "The dying daemon is not a daemon after all. Please report that bug.");
-
-      /* Don't move the whole content since we don't really care about the order */
-      std::swap(*it, vect.back());
-      vect.pop_back();
-    });
+  }
+}
+
+void ActorImpl::undaemonize()
+{
+  if (daemon_) {
+    auto& vect = simix_global->daemons;
+    auto it    = std::find(vect.begin(), vect.end(), this);
+    xbt_assert(it != vect.end(), "The dying daemon is not a daemon after all. Please report that bug.");
+    /* Don't move the whole content since we don't really care about the order */
+
+    std::swap(*it, vect.back());
+    vect.pop_back();
+    daemon_ = false;
   }
 }
 
@@ -348,33 +350,31 @@ s4u::Actor* ActorImpl::restart()
   // start the new actor
   ActorImplPtr actor =
       ActorImpl::create(arg.name, std::move(arg.code), arg.data, arg.host, arg.properties.get(), nullptr);
+  *actor->on_exit = std::move(*arg.on_exit);
   actor->set_kill_time(arg.kill_time);
   actor->set_auto_restart(arg.auto_restart);
 
   return actor->ciface();
 }
 
-activity::ActivityImplPtr ActorImpl::suspend(ActorImpl* issuer)
+void ActorImpl::suspend()
 {
   if (suspended_) {
     XBT_DEBUG("Actor '%s' is already suspended", get_cname());
-    return nullptr;
+    return;
   }
 
   suspended_ = true;
 
-  /* If we are suspending another actor that is waiting on a sync, suspend its synchronization. */
-  if (this != issuer) {
-    if (waiting_synchro)
-      waiting_synchro->suspend();
-    /* If the other actor is not waiting, its suspension is delayed to when the actor is rescheduled. */
+  /* If the suspended actor is waiting on a sync, suspend its synchronization. */
+  if (waiting_synchro == nullptr) {
+    auto exec = new activity::ExecImpl();
+    exec->set_name("suspend").set_host(host_).set_flops_amount(0.0).start();
+    waiting_synchro = activity::ExecImplPtr(exec);
 
-    return nullptr;
-  } else {
-    activity::ExecImpl* exec = new activity::ExecImpl();
-    (*exec).set_name("suspend").set_host(host_).set_flops_amount(0.0).start();
-    return activity::ExecImplPtr(exec);
+    waiting_synchro->simcalls_.push_back(&simcall);
   }
+  waiting_synchro->suspend();
 }
 
 void ActorImpl::resume()
@@ -413,8 +413,8 @@ activity::ActivityImplPtr ActorImpl::sleep(double duration)
     throw_exception(std::make_exception_ptr(simgrid::HostFailureException(
         XBT_THROW_POINT, std::string("Host ") + host_->get_cname() + " failed, you cannot sleep there.")));
 
-  activity::SleepImpl* sleep = new activity::SleepImpl();
-  (*sleep).set_name("sleep").set_host(host_).set_duration(duration).start();
+  auto sleep = new activity::SleepImpl();
+  sleep->set_name("sleep").set_host(host_).set_duration(duration).start();
   return activity::SleepImplPtr(sleep);
 }
 
@@ -427,39 +427,29 @@ void ActorImpl::throw_exception(std::exception_ptr e)
 
   /* cancel the blocking synchro if any */
   if (waiting_synchro) {
-
-    activity::ExecImplPtr exec = boost::dynamic_pointer_cast<activity::ExecImpl>(waiting_synchro);
-    if (exec != nullptr)
-      exec->cancel();
+    waiting_synchro->cancel();
 
     activity::CommImplPtr comm = boost::dynamic_pointer_cast<activity::CommImpl>(waiting_synchro);
-    if (comm != nullptr) {
-      comms.remove(comm);
-      comm->cancel();
-    }
 
-    activity::SleepImplPtr sleep = boost::dynamic_pointer_cast<activity::SleepImpl>(waiting_synchro);
-    if (sleep != nullptr) {
-      SIMIX_process_sleep_destroy(sleep);
-      if (std::find(begin(simix_global->actors_to_run), end(simix_global->actors_to_run), this) ==
-              end(simix_global->actors_to_run) &&
-          this != SIMIX_process_self()) {
-        XBT_DEBUG("Inserting [%p] %s in the to_run list", this, get_cname());
-        simix_global->actors_to_run.push_back(this);
-      }
-    }
+    if (comm != nullptr)
+      comms.remove(comm);
 
-    activity::RawImplPtr raw = boost::dynamic_pointer_cast<activity::RawImpl>(waiting_synchro);
-    if (raw != nullptr) {
-      raw->finish();
-    }
+    waiting_synchro = nullptr;
+  }
+}
 
-    activity::IoImplPtr io = boost::dynamic_pointer_cast<activity::IoImpl>(waiting_synchro);
-    if (io != nullptr) {
-      io->cancel();
-    }
+void ActorImpl::simcall_answer()
+{
+  if (this != simix_global->maestro_process){
+    XBT_DEBUG("Answer simcall %s (%d) issued by %s (%p)", SIMIX_simcall_name(simcall.call_), (int)simcall.call_,
+              get_cname(), this);
+    simcall.call_ = SIMCALL_NONE;
+    xbt_assert(not XBT_LOG_ISENABLED(simix_process, xbt_log_priority_debug) ||
+                   std::find(begin(simix_global->actors_to_run), end(simix_global->actors_to_run), this) ==
+                       end(simix_global->actors_to_run),
+               "Actor %p should not exist in actors_to_run!", this);
+    simix_global->actors_to_run.push_back(this);
   }
-  waiting_synchro = nullptr;
 }
 
 void ActorImpl::set_host(s4u::Host* dest)
@@ -488,11 +478,10 @@ ActorImpl* ActorImpl::start(const simix::ActorCode& code)
   if (not host_->is_on()) {
     XBT_WARN("Cannot launch actor '%s' on failed host '%s'", name_.c_str(), host_->get_cname());
     intrusive_ptr_release(this);
-    std::rethrow_exception(
-        std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Cannot start actor on failed host.")));
+    throw simgrid::HostFailureException(XBT_THROW_POINT, "Cannot start actor on failed host.");
   }
 
-  this->code = code;
+  this->code_ = code;
   XBT_VERB("Create context %s", get_cname());
   context_.reset(simix_global->context_factory->create_context(simix::ActorCode(code), this));
 
@@ -510,7 +499,7 @@ ActorImpl* ActorImpl::start(const simix::ActorCode& code)
 }
 
 ActorImplPtr ActorImpl::create(const std::string& name, const simix::ActorCode& code, void* data, s4u::Host* host,
-                               std::unordered_map<std::string, std::string>* properties, ActorImpl* parent_actor)
+                               const std::unordered_map<std::string, std::string>* properties, ActorImpl* parent_actor)
 {
   XBT_DEBUG("Start actor %s@'%s'", name.c_str(), host->get_cname());
 
@@ -525,8 +514,7 @@ ActorImplPtr ActorImpl::create(const std::string& name, const simix::ActorCode&
 
   /* Add properties */
   if (properties != nullptr)
-    for (auto const& kv : *properties)
-      actor->set_property(kv.first, kv.second);
+    actor->set_properties(*properties);
 
   actor->start(code);
 
@@ -544,7 +532,7 @@ void create_maestro(const std::function<void()>& code)
     maestro->context_.reset(simix_global->context_factory->create_maestro(simix::ActorCode(code), maestro));
   }
 
-  maestro->simcall.issuer       = maestro;
+  maestro->simcall.issuer_      = maestro;
   simix_global->maestro_process = maestro;
 }
 
@@ -552,88 +540,18 @@ void create_maestro(const std::function<void()>& code)
 } // namespace kernel
 } // namespace simgrid
 
-void SIMIX_process_detach()
+void SIMIX_process_detach() // deprecated v3.25
 {
   simgrid::kernel::actor::ActorImpl::detach();
 }
 
 smx_actor_t SIMIX_process_attach(const char* name, void* data, const char* hostname,
                                  std::unordered_map<std::string, std::string>* properties,
-                                 smx_actor_t /*parent_process*/)
+                                 smx_actor_t /*parent_process*/) // deprecated 3.25
 {
   return simgrid::kernel::actor::ActorImpl::attach(name, data, sg_host_by_name(hostname), properties).get();
 }
 
-/** @deprecated When this function gets removed, also remove the xbt_ex class, that is only there to help users to
- * transition */
-void SIMIX_process_throw(smx_actor_t actor, xbt_errcat_t cat, int value, const char* msg)
-{
-  SMX_EXCEPTION(actor, cat, value, msg);
-
-  if (actor->is_suspended())
-    actor->resume();
-
-  /* cancel the blocking synchro if any */
-  if (actor->waiting_synchro) {
-
-    simgrid::kernel::activity::ExecImplPtr exec =
-        boost::dynamic_pointer_cast<simgrid::kernel::activity::ExecImpl>(actor->waiting_synchro);
-    if (exec != nullptr)
-      exec->cancel();
-
-    simgrid::kernel::activity::CommImplPtr comm =
-        boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(actor->waiting_synchro);
-    if (comm != nullptr) {
-      actor->comms.remove(comm);
-      comm->cancel();
-    }
-
-    simgrid::kernel::activity::SleepImplPtr sleep =
-        boost::dynamic_pointer_cast<simgrid::kernel::activity::SleepImpl>(actor->waiting_synchro);
-    if (sleep != nullptr) {
-      SIMIX_process_sleep_destroy(sleep);
-      if (std::find(begin(simix_global->actors_to_run), end(simix_global->actors_to_run), actor) ==
-              end(simix_global->actors_to_run) &&
-          actor != SIMIX_process_self()) {
-        XBT_DEBUG("Inserting [%p] %s in the to_run list", actor, actor->get_cname());
-        simix_global->actors_to_run.push_back(actor);
-      }
-    }
-
-    simgrid::kernel::activity::RawImplPtr raw =
-        boost::dynamic_pointer_cast<simgrid::kernel::activity::RawImpl>(actor->waiting_synchro);
-    if (raw != nullptr) {
-      raw->finish();
-    }
-
-    simgrid::kernel::activity::IoImplPtr io =
-        boost::dynamic_pointer_cast<simgrid::kernel::activity::IoImpl>(actor->waiting_synchro);
-    if (io != nullptr) {
-      io->cancel();
-    }
-  }
-  actor->waiting_synchro = nullptr;
-}
-
-void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_actor_t actor)
-{
-  smx_activity_t sync_suspend = actor->suspend(simcall->issuer);
-
-  if (actor != simcall->issuer) {
-    SIMIX_simcall_answer(simcall);
-  } else {
-    sync_suspend->simcalls_.push_back(simcall);
-    actor->waiting_synchro = sync_suspend;
-    actor->waiting_synchro->suspend();
-  }
-  /* If we are suspending ourselves, then just do not finish the simcall now */
-}
-
-int SIMIX_process_get_maxpid()
-{
-  return simix_process_maxpid;
-}
-
 int SIMIX_process_count()
 {
   return simix_global->process_list.size();
@@ -666,42 +584,6 @@ const char* SIMIX_process_self_get_name()
   return process->get_cname();
 }
 
-void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_actor_t process, double timeout)
-{
-  if (process->finished_) {
-    // The joined process is already finished, just wake up the issuer process right away
-    simcall_process_sleep__set__result(simcall, SIMIX_DONE);
-    SIMIX_simcall_answer(simcall);
-    return;
-  }
-  smx_activity_t sync = simcall->issuer->join(process, timeout);
-  sync->simcalls_.push_back(simcall);
-  simcall->issuer->waiting_synchro = sync;
-}
-
-void simcall_HANDLER_process_sleep(smx_simcall_t simcall, double duration)
-{
-  if (MC_is_active() || MC_record_replay_is_active()) {
-    MC_process_clock_add(simcall->issuer, duration);
-    simcall_process_sleep__set__result(simcall, SIMIX_DONE);
-    SIMIX_simcall_answer(simcall);
-    return;
-  }
-  smx_activity_t sync = simcall->issuer->sleep(duration);
-  sync->simcalls_.push_back(simcall);
-  simcall->issuer->waiting_synchro = sync;
-}
-
-void SIMIX_process_sleep_destroy(simgrid::kernel::activity::SleepImplPtr sleep)
-{
-  XBT_DEBUG("Destroy sleep synchro %p", sleep.get());
-
-  if (sleep->surf_action_) {
-    sleep->surf_action_->unref();
-    sleep->surf_action_ = nullptr;
-  }
-}
-
 /**
  * @brief Calling this function makes the process to yield.
  *
@@ -721,8 +603,14 @@ const std::vector<smx_actor_t>& simgrid::simix::process_get_runnable()
 /** @brief Returns the process from PID. */
 smx_actor_t SIMIX_process_from_PID(aid_t PID)
 {
-  auto actor = simix_global->process_list.find(PID);
-  return actor == simix_global->process_list.end() ? nullptr : actor->second;
+  auto item = simix_global->process_list.find(PID);
+  if (item == simix_global->process_list.end()) {
+    for (auto& a : simix_global->actors_to_destroy)
+      if (a.get_pid() == PID)
+        return &a;
+    return nullptr; // Not found, even in the trash
+  }
+  return item->second;
 }
 
 void SIMIX_process_on_exit(smx_actor_t actor, int_f_pvoid_pvoid_t fun, void* data)
@@ -741,7 +629,7 @@ void SIMIX_process_on_exit(smx_actor_t actor, const std::function<void(int, void
 void SIMIX_process_on_exit(smx_actor_t actor, const std::function<void(bool /*failed*/)>& fun)
 {
   xbt_assert(actor, "current process not found: are you in maestro context ?");
-  actor->on_exit.emplace_back(fun);
+  actor->on_exit->emplace_back(fun);
 }
 
 /** @brief Restart a process, starting it again from the beginning. */
@@ -763,12 +651,12 @@ smx_actor_t simcall_process_create(const std::string& name, const simgrid::simix
                                    sg_host_t host, std::unordered_map<std::string, std::string>* properties)
 {
   smx_actor_t self = SIMIX_process_self();
-  return simgrid::simix::simcall([&name, &code, data, host, properties, self] {
+  return simgrid::kernel::actor::simcall([&name, &code, data, host, properties, self] {
     return simgrid::kernel::actor::ActorImpl::create(name, code, data, host, properties, self).get();
   });
 }
 
 void simcall_process_set_data(smx_actor_t process, void* data)
 {
-  simgrid::simix::simcall([process, data] { process->set_user_data(data); });
+  simgrid::kernel::actor::simcall([process, data] { process->set_user_data(data); });
 }
index f4ee3a8..ee082de 100644 (file)
@@ -29,7 +29,7 @@ class XBT_PUBLIC ActorImpl : public surf::PropertyHolder {
 
 public:
   xbt::string name_;
-  ActorImpl(const xbt::string& name, s4u::Host* host);
+  ActorImpl(xbt::string name, s4u::Host* host);
   ActorImpl(const ActorImpl&) = delete;
   ActorImpl& operator=(const ActorImpl&) = delete;
   ~ActorImpl();
@@ -59,15 +59,16 @@ public:
 
   std::exception_ptr exception_;
   bool finished_  = false;
-  bool blocked_   = false; /* FIXME this field is never set to true. Either use it or remove it. */
   bool suspended_ = false;
 
   activity::ActivityImplPtr waiting_synchro = nullptr; /* the current blocking synchro if any */
   std::list<activity::ActivityImplPtr> comms;          /* the current non-blocking communication synchros */
   s_smx_simcall simcall;
-  std::vector<std::function<void(bool)>> on_exit; /* list of functions executed when the process dies */
+  /* list of functions executed when the process dies */
+  std::shared_ptr<std::vector<std::function<void(bool)>>> on_exit =
+      std::make_shared<std::vector<std::function<void(bool)>>>();
 
-  std::function<void()> code;
+  std::function<void()> code_;
   simix::Timer* kill_timer = nullptr;
 
 private:
@@ -75,13 +76,17 @@ private:
   std::atomic_int_fast32_t refcount_{0};
 
 public:
+  int get_refcount() { return refcount_; }
   friend void intrusive_ptr_add_ref(ActorImpl* actor)
   {
-    // std::memory_order_relaxed ought to be enough here instead of std::memory_order_seq_cst
-    // But then, we have a threading issue when an actor commits a suicide:
-    //  it seems that in this case, the worker thread kills the last occurrence of the actor
-    //  while usually, the maestro does so. FIXME: we should change how actors suicide
-    actor->refcount_.fetch_add(1, std::memory_order_seq_cst);
+    // This whole memory consistency semantic drives me nuts.
+    // std::memory_order_relaxed proves to not be enough: There is a threading issue when actors commit suicide.
+    //   My guess is that the maestro context wants to propagate changes to the actor's fields after the
+    //   actor context frees that memory area or something. But I'm not 100% certain of what's going on.
+    // std::memory_order_seq_cst works but that's rather demanding.
+    // AFAIK, std::memory_order_acq_rel works on all tested platforms, so let's stick to it.
+    // Reducing the requirements to _relaxed would require to fix our suicide procedure, which is a messy piece of code.
+    actor->refcount_.fetch_add(1, std::memory_order_acq_rel);
   }
   friend void intrusive_ptr_release(ActorImpl* actor)
   {
@@ -97,6 +102,9 @@ public:
   /* S4U/implem interfaces */
 private:
   s4u::Actor piface_; // Our interface is part of ourselves
+
+  void undaemonize();
+
 public:
   s4u::ActorPtr iface() { return s4u::ActorPtr(&piface_); }
   s4u::Actor* ciface() { return &piface_; }
@@ -105,9 +113,9 @@ public:
   ActorImpl* start(const simix::ActorCode& code);
 
   static ActorImplPtr create(const std::string& name, const simix::ActorCode& code, void* data, s4u::Host* host,
-                             std::unordered_map<std::string, std::string>* properties, ActorImpl* parent_actor);
+                             const std::unordered_map<std::string, std::string>* properties, ActorImpl* parent_actor);
   static ActorImplPtr attach(const std::string& name, void* data, s4u::Host* host,
-                             std::unordered_map<std::string, std::string>* properties);
+                             const std::unordered_map<std::string, std::string>* properties);
   static void detach();
   void cleanup();
   void exit();
@@ -118,12 +126,18 @@ public:
   void daemonize();
   bool is_suspended() { return suspended_; }
   s4u::Actor* restart();
-  activity::ActivityImplPtr suspend(ActorImpl* issuer);
+  void suspend();
   void resume();
   activity::ActivityImplPtr join(ActorImpl* actor, double timeout);
   activity::ActivityImplPtr sleep(double duration);
   /** Ask the actor to throw an exception right away */
   void throw_exception(std::exception_ptr e);
+
+  /** execute the pending simcall -- must be called from the maestro context */
+  void simcall_handle(int value);
+  /** Terminates a simcall currently executed in maestro context. The actor will be restarted in the next scheduling
+   * round */
+  void simcall_answer();
 };
 
 class ProcessArg {
@@ -133,9 +147,12 @@ public:
   void* data                                                               = nullptr;
   s4u::Host* host                                                          = nullptr;
   double kill_time                                                         = 0.0;
-  std::shared_ptr<std::unordered_map<std::string, std::string>> properties = nullptr;
+  std::shared_ptr<const std::unordered_map<std::string, std::string>> properties = nullptr;
   bool auto_restart                                                        = false;
   bool daemon_                                                             = false;
+  /* list of functions executed when the process dies */
+  const std::shared_ptr<std::vector<std::function<void(bool)>>> on_exit;
+
   ProcessArg()                                                             = default;
 
   explicit ProcessArg(const std::string& name, const std::function<void()>& code, void* data, s4u::Host* host,
@@ -153,12 +170,13 @@ public:
 
   explicit ProcessArg(s4u::Host* host, ActorImpl* actor)
       : name(actor->get_name())
-      , code(actor->code)
+      , code(actor->code_)
       , data(actor->get_user_data())
       , host(host)
       , kill_time(actor->get_kill_time())
       , auto_restart(actor->has_to_auto_restart())
       , daemon_(actor->is_daemon())
+      , on_exit(actor->on_exit)
   {
     properties.reset(actor->get_properties(), [](decltype(actor->get_properties())) {});
   }
@@ -170,12 +188,11 @@ typedef boost::intrusive::list<ActorImpl, boost::intrusive::member_hook<ActorImp
     SynchroList;
 
 XBT_PUBLIC void create_maestro(const std::function<void()>& code);
+XBT_PUBLIC int get_maxpid();
 } // namespace actor
 } // namespace kernel
 } // namespace simgrid
 
 extern void (*SMPI_switch_data_segment)(simgrid::s4u::ActorPtr actor);
 
-XBT_PRIVATE void SIMIX_process_sleep_destroy(simgrid::kernel::activity::SleepImplPtr synchro);
-
 #endif
index 145e1e1..886b201 100644 (file)
@@ -77,9 +77,3 @@ AttachContext::~AttachContext() = default;
 } // namespace context
 } // namespace kernel
 } // namespace simgrid
-
-/** @brief Executes all the processes to run (in parallel if possible). */
-void SIMIX_context_runall()
-{
-  simix_global->context_factory->run_all();
-}
index 60504fa..b2fadf0 100644 (file)
@@ -109,11 +109,6 @@ XBT_PRIVATE void SIMIX_context_mod_exit();
 XBT_PUBLIC_DATA unsigned char sigsegv_stack[SIGSTKSZ];
 #endif
 
-/** @brief Executes all the processes to run (in parallel if possible). */
-XBT_PRIVATE void SIMIX_context_runall();
-
-XBT_PUBLIC int SIMIX_process_get_maxpid();
-
 XBT_PRIVATE simgrid::simix::ActorCodeFactory& SIMIX_get_actor_code_factory(const std::string& name);
 
 #endif
index d4dc55d..afdb933 100644 (file)
@@ -72,7 +72,7 @@ void BoostContext::wrapper(BoostContext::arg_type arg)
   } catch (ForcefulKillException const&) {
     XBT_DEBUG("Caught a ForcefulKillException");
   } catch (simgrid::Exception const& e) {
-    XBT_INFO("Actor killed by an uncatched exception %s", simgrid::xbt::demangle(typeid(e).name()).get());
+    XBT_INFO("Actor killed by an uncaught exception %s", simgrid::xbt::demangle(typeid(e).name()).get());
     throw;
   }
   ASAN_ONLY(context->asan_stop_ = true);
index 5645aea..d493cae 100644 (file)
@@ -215,7 +215,7 @@ void RawContext::wrapper(RawContext* context)
   } catch (ForcefulKillException const&) {
     XBT_DEBUG("Caught a ForcefulKillException");
   } catch (simgrid::Exception const& e) {
-    XBT_INFO("Actor killed by an uncatched exception %s", simgrid::xbt::demangle(typeid(e).name()).get());
+    XBT_INFO("Actor killed by an uncaught exception %s", simgrid::xbt::demangle(typeid(e).name()).get());
     throw;
   }
   ASAN_ONLY(context->asan_stop_ = true);
index 3d7740f..fbecf2b 100644 (file)
@@ -35,21 +35,20 @@ namespace simgrid {
 namespace kernel {
 namespace context {
 
-/* rank of the execution thread */
-thread_local uintptr_t SwappedContext::worker_id_;             /* thread-specific storage for the thread id */
+/* thread-specific storage for the worker's context */
+thread_local SwappedContext* SwappedContext::worker_context_ = nullptr;
 
 SwappedContextFactory::SwappedContextFactory() : ContextFactory(), parallel_(SIMIX_context_is_parallel())
 {
   parmap_ = nullptr; // will be created lazily with the right parameters if needed (ie, in parallel)
-  workers_context_.resize(parallel_ ? SIMIX_context_get_nthreads() : 1, nullptr);
 }
 
 SwappedContext::SwappedContext(std::function<void()>&& code, smx_actor_t actor, SwappedContextFactory* factory)
     : Context(std::move(code), actor), factory_(factory)
 {
   // Save maestro (=context created first) in preparation for run_all
-  if (not factory->parallel_ && factory_->workers_context_[0] == nullptr)
-    factory_->workers_context_[0] = this;
+  if (not factory->parallel_ && factory->maestro_context_ == nullptr)
+    factory->maestro_context_ = this;
 
   if (has_code()) {
     xbt_assert((smx_context_stack_size & 0xf) == 0, "smx_context_stack_size should be multiple of 16");
@@ -86,8 +85,9 @@ SwappedContext::SwappedContext(std::function<void()>&& code, smx_actor_t actor,
             "Failed to protect stack: %s.\n"
             "If you are running a lot of actors, you may be exceeding the amount of mappings allowed per process.\n"
             "On Linux systems, change this value with sudo sysctl -w vm.max_map_count=newvalue (default value: 65536)\n"
-            "Please see http://simgrid.gforge.inria.fr/simgrid/latest/doc/html/options.html#options_virt for more "
-            "info.",
+            "Please see "
+            "https://simgrid.org/doc/latest/Configuring_SimGrid.html#configuring-the-user-code-virtualization for more "
+            "information.",
             strerror(errno));
         /* This is fatal. We are going to fail at some point when we try reusing this. */
       }
@@ -156,8 +156,6 @@ void SwappedContextFactory::run_all()
    * for the ones of the simulated processes that must run.
    */
   if (parallel_) {
-    threads_working_ = 0;
-
     // We lazily create the parmap so that all options are actually processed when doing so.
     if (parmap_ == nullptr)
       parmap_.reset(
@@ -196,14 +194,11 @@ void SwappedContextFactory::run_all()
 void SwappedContext::resume()
 {
   if (factory_->parallel_) {
-    // Save the thread number (my body) in an os-thread-specific area
-    worker_id_ = factory_->threads_working_.fetch_add(1, std::memory_order_relaxed);
-    // Save my current soul (either maestro, or one of the minions) in a permanent area
-    SwappedContext* worker_context = static_cast<SwappedContext*>(self());
-    factory_->workers_context_[worker_id_] = worker_context;
+    // Save my current soul (either maestro, or one of the minions) in a thread-specific area
+    worker_context_ = static_cast<SwappedContext*>(self());
     // Switch my soul and the actor's one
     Context::set_current(this);
-    worker_context->swap_into(this);
+    worker_context_->swap_into(this);
     // No body runs that soul anymore at this point, but it is stored in a safe place.
     // When the executed actor will do a blocking action, ActorImpl::yield() will call suspend(), below.
   } else { // sequential execution
@@ -234,8 +229,8 @@ void SwappedContext::suspend()
     } else {
       // All actors were run, go back to the parmap context
       XBT_DEBUG("No more actors to run");
-      // worker_id_ is the identity of my body, stored in thread_local when starting the scheduling round
-      next_context = factory_->workers_context_[worker_id_];
+      // worker_context_ is my own soul, stored in thread_local when starting the scheduling round
+      next_context = worker_context_;
       // When given that soul, the body will wait for the next scheduling round
     }
 
@@ -256,7 +251,7 @@ void SwappedContext::suspend()
     } else {
       /* all processes were run, actually return to maestro */
       XBT_DEBUG("No more actors to run");
-      next_context = factory_->workers_context_[0];
+      next_context = factory_->maestro_context_;
     }
     Context::set_current(next_context);
     this->swap_into(next_context);
index c132b63..a8973d1 100644 (file)
@@ -9,7 +9,6 @@
 #include "src/kernel/context/Context.hpp"
 
 #include <memory>
-#include <vector>
 
 namespace simgrid {
 namespace kernel {
@@ -27,12 +26,12 @@ public:
 private:
   bool parallel_;
 
-  unsigned long process_index_ = 0; // Next actor to execute during sequential run_all()
+  /* For the sequential execution */
+  unsigned long process_index_     = 0;       // next actor to execute
+  SwappedContext* maestro_context_ = nullptr; // save maestro's context
 
   /* For the parallel execution */
   std::unique_ptr<simgrid::xbt::Parmap<smx_actor_t>> parmap_;
-  std::vector<SwappedContext*> workers_context_; /* space to save the worker's context in each thread */
-  std::atomic<uintptr_t> threads_working_{0};    /* number of threads that have started their work */
 };
 
 class SwappedContext : public Context {
@@ -50,7 +49,7 @@ public:
 
   unsigned char* get_stack();
 
-  static thread_local uintptr_t worker_id_;
+  static thread_local SwappedContext* worker_context_;
 
 #if HAVE_SANITIZER_ADDRESS_FIBER_SUPPORT
   const void* asan_stack_   = nullptr;
index d246a3c..a9736cc 100644 (file)
@@ -106,7 +106,7 @@ void ThreadContext::wrapper(ThreadContext* context)
     XBT_DEBUG("Caught a ForcefulKillException in Thread::wrapper");
     xbt_assert(not context->is_maestro(), "Maestro shall not receive ForcefulKillExceptions, even when detached.");
   } catch (simgrid::Exception const& e) {
-    XBT_INFO("Actor killed by an uncatched exception %s", simgrid::xbt::demangle(typeid(e).name()).get());
+    XBT_INFO("Actor killed by an uncaught exception %s", simgrid::xbt::demangle(typeid(e).name()).get());
     throw;
   }
   // Signal to the caller (normally the maestro) that we have finished:
index 2ebe3da..569f2d8 100644 (file)
@@ -44,7 +44,7 @@ static void smx_ctx_wrapper(int i1, int i2)
   } catch (simgrid::ForcefulKillException const&) {
     XBT_DEBUG("Caught a ForcefulKillException");
   } catch (simgrid::Exception const& e) {
-    XBT_INFO("Actor killed by an uncatched exception %s", simgrid::xbt::demangle(typeid(e).name()).get());
+    XBT_INFO("Actor killed by an uncaught exception %s", simgrid::xbt::demangle(typeid(e).name()).get());
     throw;
   }
   ASAN_ONLY(context->asan_stop_ = true);
@@ -83,7 +83,7 @@ UContext::UContext(std::function<void()>&& code, actor::ActorImpl* actor, Swappe
 
 #if SIMGRID_HAVE_MC
     if (MC_is_active()) {
-      MC_register_stack_area(get_stack(), actor, &(this->uc_), smx_context_stack_size);
+      MC_register_stack_area(get_stack(), &(this->uc_), smx_context_stack_size);
     }
 #endif
   }
index 4426ce8..1db0704 100644 (file)
@@ -27,16 +27,16 @@ void simgrid::kernel::lmm::FairBottleneck::bottleneck_solve()
 
   XBT_DEBUG("Variable set : %zu", variable_set.size());
   for (Variable& var : variable_set) {
-    var.value = 0.0;
+    var.value_ = 0.0;
     XBT_DEBUG("Handling variable %p", &var);
-    if (var.sharing_weight > 0.0 && std::find_if(begin(var.cnsts), end(var.cnsts), [](Element const& x) {
-                                      return x.consumption_weight != 0.0;
-                                    }) != end(var.cnsts)) {
+    if (var.sharing_penalty_ > 0.0 && std::find_if(begin(var.cnsts_), end(var.cnsts_), [](Element const& x) {
+                                        return x.consumption_weight != 0.0;
+                                      }) != end(var.cnsts_)) {
       saturated_variable_set.push_back(var);
     } else {
       XBT_DEBUG("Err, finally, there is no need to take care of variable %p", &var);
-      if (var.sharing_weight > 0.0)
-        var.value = 1.0;
+      if (var.sharing_penalty_ > 0.0)
+        var.value_ = 1.0;
     }
   }
 
@@ -45,8 +45,8 @@ void simgrid::kernel::lmm::FairBottleneck::bottleneck_solve()
     saturated_constraint_set.push_back(cnst);
   }
   for (Constraint& cnst : saturated_constraint_set) {
-    cnst.remaining = cnst.bound;
-    cnst.usage     = 0.0;
+    cnst.remaining_ = cnst.bound_;
+    cnst.usage_     = 0.0;
   }
 
   XBT_DEBUG("Fair bottleneck Initialized");
@@ -66,22 +66,22 @@ void simgrid::kernel::lmm::FairBottleneck::bottleneck_solve()
       Constraint& cnst = *iter;
       int nb = 0;
       XBT_DEBUG("Processing cnst %p ", &cnst);
-      cnst.usage = 0.0;
-      for (Element& elem : cnst.enabled_element_set) {
-        xbt_assert(elem.variable->sharing_weight > 0);
-        if (elem.consumption_weight > 0 && elem.variable->saturated_variable_set_hook.is_linked())
+      cnst.usage_ = 0.0;
+      for (Element& elem : cnst.enabled_element_set_) {
+        xbt_assert(elem.variable->sharing_penalty_ > 0);
+        if (elem.consumption_weight > 0 && elem.variable->saturated_variable_set_hook_.is_linked())
           nb++;
       }
       XBT_DEBUG("\tThere are %d variables", nb);
-      if (nb > 0 && cnst.sharing_policy == s4u::Link::SharingPolicy::FATPIPE)
+      if (nb > 0 && cnst.sharing_policy_ == s4u::Link::SharingPolicy::FATPIPE)
         nb = 1;
       if (nb == 0) {
-        cnst.remaining = 0.0;
-        cnst.usage     = 0.0;
+        cnst.remaining_ = 0.0;
+        cnst.usage_     = 0.0;
         iter           = cnst_list.erase(iter);
       } else {
-        cnst.usage = cnst.remaining / nb;
-        XBT_DEBUG("\tConstraint Usage %p : %f with %d variables", &cnst, cnst.usage, nb);
+        cnst.usage_ = cnst.remaining_ / nb;
+        XBT_DEBUG("\tConstraint Usage %p : %f with %d variables", &cnst, cnst.usage_, nb);
         iter++;
       }
     }
@@ -89,16 +89,16 @@ void simgrid::kernel::lmm::FairBottleneck::bottleneck_solve()
     for (auto iter = std::begin(var_list); iter != std::end(var_list);) {
       Variable& var  = *iter;
       double min_inc = DBL_MAX;
-      for (Element const& elm : var.cnsts) {
+      for (Element const& elm : var.cnsts_) {
         if (elm.consumption_weight > 0)
-          min_inc = std::min(min_inc, elm.constraint->usage / elm.consumption_weight);
+          min_inc = std::min(min_inc, elm.constraint->usage_ / elm.consumption_weight);
       }
-      if (var.bound > 0)
-        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;
-      if (var.value == var.bound)
+      if (var.bound_ > 0)
+        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_;
+      if (var.value_ == var.bound_)
         iter = var_list.erase(iter);
       else
         iter++;
@@ -107,33 +107,33 @@ void simgrid::kernel::lmm::FairBottleneck::bottleneck_solve()
     for (auto iter = std::begin(cnst_list); iter != std::end(cnst_list);) {
       Constraint& cnst = *iter;
       XBT_DEBUG("Updating cnst %p ", &cnst);
-      if (cnst.sharing_policy != s4u::Link::SharingPolicy::FATPIPE) {
-        for (Element& elem : cnst.enabled_element_set) {
-          xbt_assert(elem.variable->sharing_weight > 0);
-          XBT_DEBUG("\tUpdate constraint %p (%g) with variable %p by %g", &cnst, cnst.remaining, elem.variable,
-                    elem.variable->mu);
-          double_update(&cnst.remaining, elem.consumption_weight * elem.variable->mu, sg_maxmin_precision);
+      if (cnst.sharing_policy_ != s4u::Link::SharingPolicy::FATPIPE) {
+        for (Element& elem : cnst.enabled_element_set_) {
+          xbt_assert(elem.variable->sharing_penalty_ > 0);
+          XBT_DEBUG("\tUpdate constraint %p (%g) with variable %p by %g", &cnst, cnst.remaining_, elem.variable,
+                    elem.variable->mu_);
+          double_update(&cnst.remaining_, elem.consumption_weight * elem.variable->mu_, sg_maxmin_precision);
         }
       } else {
-        for (Element& elem : cnst.enabled_element_set) {
-          xbt_assert(elem.variable->sharing_weight > 0);
+        for (Element& elem : cnst.enabled_element_set_) {
+          xbt_assert(elem.variable->sharing_penalty_ > 0);
           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 = std::min(cnst.usage, elem.consumption_weight * elem.variable->mu);
+                    cnst.usage_, elem.variable, elem.variable->mu_);
+          cnst.usage_ = std::min(cnst.usage_, elem.consumption_weight * elem.variable->mu_);
         }
-        XBT_DEBUG("\tUpdate constraint %p (%g) by %g", &cnst, cnst.remaining, cnst.usage);
-        double_update(&cnst.remaining, cnst.usage, sg_maxmin_precision);
+        XBT_DEBUG("\tUpdate constraint %p (%g) by %g", &cnst, cnst.remaining_, cnst.usage_);
+        double_update(&cnst.remaining_, cnst.usage_, sg_maxmin_precision);
       }
 
-      XBT_DEBUG("\tRemaining for %p : %g", &cnst, cnst.remaining);
-      if (cnst.remaining <= 0.0) {
+      XBT_DEBUG("\tRemaining for %p : %g", &cnst, cnst.remaining_);
+      if (cnst.remaining_ <= 0.0) {
         XBT_DEBUG("\tGet rid of constraint %p", &cnst);
 
         iter = cnst_list.erase(iter);
-        for (Element& elem : cnst.enabled_element_set) {
-          if (elem.variable->sharing_weight <= 0)
+        for (Element& elem : cnst.enabled_element_set_) {
+          if (elem.variable->sharing_penalty_ <= 0)
             break;
-          if (elem.consumption_weight > 0 && elem.variable->saturated_variable_set_hook.is_linked()) {
+          if (elem.consumption_weight > 0 && elem.variable->saturated_variable_set_hook_.is_linked()) {
             XBT_DEBUG("\t\tGet rid of variable %p", elem.variable);
             simgrid::xbt::intrusive_erase(var_list, *elem.variable);
           }
diff --git a/src/kernel/lmm/lagrange.cpp b/src/kernel/lmm/lagrange.cpp
deleted file mode 100644 (file)
index fdab111..0000000
+++ /dev/null
@@ -1,512 +0,0 @@
-/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-/*
- * 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 "src/kernel/lmm/maxmin.hpp"
-#include "src/surf/surf_interface.hpp"
-#include "xbt/log.h"
-#include "xbt/sysdep.h"
-
-#include <algorithm>
-#include <cmath>
-#include <cstdlib>
-
-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)");
-
-static constexpr double VEGAS_SCALING = 1000.0;
-static constexpr double RENO_SCALING  = 1.0;
-static constexpr double RENO2_SCALING = 1.0;
-
-namespace simgrid {
-namespace kernel {
-namespace lmm {
-
-System* make_new_lagrange_system(bool selective_update)
-{
-  return new Lagrange(selective_update);
-}
-
-bool Lagrange::check_feasible(bool warn)
-{
-  for (Constraint const& cnst : active_constraint_set) {
-    double tmp = 0;
-    for (Element const& elem : cnst.enabled_element_set) {
-      Variable* var = elem.variable;
-      xbt_assert(var->sharing_weight > 0);
-      tmp += var->value;
-    }
-
-    if (double_positive(tmp - cnst.bound, sg_maxmin_precision)) {
-      if (warn)
-        XBT_WARN("The link (%p) is over-used. Expected less than %f and got %f", &cnst, cnst.bound, tmp);
-      return false;
-    }
-    XBT_DEBUG("Checking feasability for constraint (%p): sat = %f, lambda = %f ", &cnst, tmp - cnst.bound, cnst.lambda);
-  }
-
-  for (Variable const& var : variable_set) {
-    if (not var.sharing_weight)
-      break;
-    if (var.bound < 0)
-      continue;
-    XBT_DEBUG("Checking feasability for variable (%p): sat = %f mu = %f", &var, var.value - var.bound, var.mu);
-
-    if (double_positive(var.value - var.bound, sg_maxmin_precision)) {
-      if (warn)
-        XBT_WARN("The variable (%p) is too large. Expected less than %f and got %f", &var, var.bound, var.value);
-      return false;
-    }
-  }
-  return true;
-}
-
-double Lagrange::new_value(const Variable& var)
-{
-  double tmp = 0;
-
-  for (Element const& elem : var.cnsts) {
-    tmp += elem.constraint->lambda;
-  }
-  if (var.bound > 0)
-    tmp += var.mu;
-  XBT_DEBUG("\t Working on var (%p). cost = %e; Weight = %e", &var, tmp, var.sharing_weight);
-  // uses the partial differential inverse function
-  return func_fpi(var, tmp);
-}
-
-double Lagrange::new_mu(const Variable& var)
-{
-  double mu_i    = 0.0;
-  double sigma_i = 0.0;
-
-  for (Element const& elem : var.cnsts) {
-    sigma_i += elem.constraint->lambda;
-  }
-  mu_i = func_fp(var, var.bound) - sigma_i;
-  if (mu_i < 0.0)
-    return 0.0;
-  return mu_i;
-}
-
-double Lagrange::dual_objective()
-{
-  double obj = 0.0;
-
-  for (Variable const& var : variable_set) {
-    double sigma_i = 0.0;
-
-    if (not var.sharing_weight)
-      break;
-
-    for (Element const& elem : var.cnsts)
-      sigma_i += elem.constraint->lambda;
-
-    if (var.bound > 0)
-      sigma_i += var.mu;
-
-    XBT_DEBUG("var %p : sigma_i = %1.20f", &var, sigma_i);
-
-    obj += func_f(var, func_fpi(var, sigma_i)) - sigma_i * func_fpi(var, sigma_i);
-
-    if (var.bound > 0)
-      obj += var.mu * var.bound;
-  }
-
-  for (Constraint const& cnst : active_constraint_set)
-    obj += cnst.lambda * cnst.bound;
-
-  return obj;
-}
-
-// solves the proportional fairness using a Lagrangian optimization with dichotomy step
-void Lagrange::lagrange_solve()
-{
-  /* Lagrange Variables. */
-  int max_iterations       = 100;
-  double epsilon_min_error = 0.00001; /* this is the precision on the objective function so it's none of the
-                                         configurable values and this value is the legacy one */
-  double dichotomy_min_error  = 1e-14;
-  double overall_modification = 1;
-
-  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)) {
-    print();
-  }
-
-  if (not modified_)
-    return;
-
-  /* Initialize lambda. */
-  for (Constraint& cnst : active_constraint_set) {
-    cnst.lambda     = 1.0;
-    cnst.new_lambda = 2.0;
-    XBT_DEBUG("#### cnst(%p)->lambda :  %e", &cnst, cnst.lambda);
-  }
-
-  /*
-   * Initialize the active variables. Initialize mu.
-   */
-  for (Variable& var : variable_set) {
-    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);
-      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), [](Element const& x) { return x.consumption_weight != 0.0; });
-      if (weighted == end(var.cnsts))
-        var.value = 1.0;
-    }
-  }
-
-  /*  Compute dual objective. */
-  double obj = dual_objective();
-
-  /* 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);
-    XBT_DEBUG("-------------- Gradient Descent ----------");
-
-    /* Improve the value of mu_i */
-    for (Variable& var : variable_set) {
-      if (var.sharing_weight && var.bound >= 0) {
-        XBT_DEBUG("Working on var (%p)", &var);
-        var.new_mu = new_mu(var);
-        XBT_DEBUG("Updating mu : var->mu (%p) : %1.20f -> %1.20f", &var, var.mu, var.new_mu);
-        var.mu = var.new_mu;
-
-        double new_obj = dual_objective();
-        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;
-      }
-    }
-
-    /* Improve the value of lambda_i */
-    for (Constraint& cnst : active_constraint_set) {
-      XBT_DEBUG("Working on cnst (%p)", &cnst);
-      cnst.new_lambda = dichotomy(cnst.lambda, cnst, dichotomy_min_error);
-      XBT_DEBUG("Updating lambda : cnst->lambda (%p) : %1.20f -> %1.20f", &cnst, cnst.lambda, cnst.new_lambda);
-      cnst.lambda = cnst.new_lambda;
-
-      double new_obj = dual_objective();
-      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;
-    }
-
-    /* Now computes the values of each variable (@rho) based on the values of @lambda and @mu. */
-    XBT_DEBUG("-------------- Check convergence ----------");
-    overall_modification = 0;
-    for (Variable& var : variable_set) {
-      if (var.sharing_weight <= 0)
-        var.value = 0.0;
-      else {
-        double tmp = new_value(var);
-
-        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);
-      }
-    }
-
-    XBT_DEBUG("-------------- Check feasability ----------");
-    if (not check_feasible(false))
-      overall_modification = 1.0;
-    XBT_DEBUG("Iteration %d: overall_modification : %f", iteration, overall_modification);
-  }
-
-  check_feasible(true);
-
-  if (overall_modification <= epsilon_min_error) {
-    XBT_DEBUG("The method converges in %d iterations.", iteration);
-  }
-  if (iteration >= max_iterations) {
-    XBT_DEBUG("Method reach %d iterations, which is the maximum number of iterations allowed.", iteration);
-  }
-
-  if (XBT_LOG_ISENABLED(surf_lagrange, xbt_log_priority_debug)) {
-    print();
-  }
-}
-
-/*
- * Returns a double value corresponding to the result of a dichotomy process with respect to a given
- * variable/constraint (@mu in the case of a variable or @lambda in case of a constraint) and a initial value init.
- *
- * @param init initial value for @mu or @lambda
- * @param diff a function that computes the differential of with respect a @mu or @lambda
- * @param var_cnst a pointer to a variable or constraint
- * @param min_erro a minimum error tolerated
- *
- * @return a double corresponding to the result of the dichotomy process
- */
-double Lagrange::dichotomy(double init, const Constraint& cnst, double min_error)
-{
-  double min = init;
-  double max = init;
-  double overall_error;
-  double middle;
-  double middle_diff;
-  double diff_0 = 0.0;
-
-  XBT_IN();
-
-  if (fabs(init) < 1e-20) {
-    min = 0.5;
-    max = 0.5;
-  }
-
-  overall_error = 1;
-
-  diff_0 = partial_diff_lambda(1e-16, cnst);
-  if (diff_0 >= 0) {
-    XBT_CDEBUG(surf_lagrange_dichotomy, "returning 0.0 (diff = %e)", diff_0);
-    XBT_OUT();
-    return 0.0;
-  }
-
-  double min_diff = partial_diff_lambda(min, cnst);
-  double max_diff = partial_diff_lambda(max, cnst);
-
-  while (overall_error > min_error) {
-    XBT_CDEBUG(surf_lagrange_dichotomy, "[min, max] = [%1.20f, %1.20f] || diffmin, diffmax = %1.20f, %1.20f", min, max,
-               min_diff, max_diff);
-
-    if (min_diff > 0 && max_diff > 0) {
-      if (min == max) {
-        XBT_CDEBUG(surf_lagrange_dichotomy, "Decreasing min");
-        min      = min / 2.0;
-        min_diff = partial_diff_lambda(min, cnst);
-      } else {
-        XBT_CDEBUG(surf_lagrange_dichotomy, "Decreasing max");
-        max      = min;
-        max_diff = min_diff;
-      }
-    } else if (min_diff < 0 && max_diff < 0) {
-      if (min == max) {
-        XBT_CDEBUG(surf_lagrange_dichotomy, "Increasing max");
-        max      = max * 2.0;
-        max_diff = partial_diff_lambda(max, cnst);
-      } else {
-        XBT_CDEBUG(surf_lagrange_dichotomy, "Increasing min");
-        min      = max;
-        min_diff = max_diff;
-      }
-    } else if (min_diff < 0 && max_diff > 0) {
-      middle = (max + min) / 2.0;
-      XBT_CDEBUG(surf_lagrange_dichotomy, "Trying (max+min)/2 : %1.20f", middle);
-
-      if ((fabs(min - middle) < 1e-20) || (fabs(max - middle) < 1e-20)) {
-        XBT_CWARN(surf_lagrange_dichotomy,
-                  "Cannot improve the convergence! min=max=middle=%1.20f, diff = %1.20f."
-                  " Reaching the 'double' limits. Maybe scaling your function would help ([%1.20f,%1.20f]).",
-                  min, max - min, min_diff, max_diff);
-        break;
-      }
-      middle_diff = partial_diff_lambda(middle, cnst);
-
-      if (middle_diff < 0) {
-        XBT_CDEBUG(surf_lagrange_dichotomy, "Increasing min");
-        min           = middle;
-        overall_error = max_diff - middle_diff;
-        min_diff      = middle_diff;
-      } else if (middle_diff > 0) {
-        XBT_CDEBUG(surf_lagrange_dichotomy, "Decreasing max");
-        max           = middle;
-        overall_error = max_diff - middle_diff;
-        max_diff      = middle_diff;
-      } else {
-        overall_error = 0;
-      }
-    } else if (fabs(min_diff) < 1e-20) {
-      max           = min;
-      overall_error = 0;
-    } else if (fabs(max_diff) < 1e-20) {
-      min           = max;
-      overall_error = 0;
-    } 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();
-    } else {
-      XBT_CWARN(surf_lagrange_dichotomy,
-                "diffmin (%1.20f) or diffmax (%1.20f) are something I don't know, taking no action.", min_diff,
-                max_diff);
-      xbt_abort();
-    }
-  }
-
-  XBT_CDEBUG(surf_lagrange_dichotomy, "returning %e", (min + max) / 2.0);
-  XBT_OUT();
-  return ((min + max) / 2.0);
-}
-
-double Lagrange::partial_diff_lambda(double lambda, const Constraint& cnst)
-{
-  double diff           = 0.0;
-
-  XBT_IN();
-
-  XBT_CDEBUG(surf_lagrange_dichotomy, "Computing diff of cnst (%p)", &cnst);
-
-  for (Element const& elem : cnst.enabled_element_set) {
-    Variable& var = *elem.variable;
-    xbt_assert(var.sharing_weight > 0);
-    XBT_CDEBUG(surf_lagrange_dichotomy, "Computing sigma_i for var (%p)", &var);
-    // Initialize the summation variable
-    double sigma_i = 0.0;
-
-    // Compute sigma_i
-    for (Element const& elem2 : var.cnsts)
-      sigma_i += elem2.constraint->lambda;
-
-    // add mu_i if this flow has a RTT constraint associated
-    if (var.bound > 0)
-      sigma_i += var.mu;
-
-    // replace value of cnst.lambda by the value of parameter lambda
-    sigma_i = (sigma_i - cnst.lambda) + lambda;
-
-    diff += -func_fpi(var, sigma_i);
-  }
-
-  diff += cnst.bound;
-
-  XBT_CDEBUG(surf_lagrange_dichotomy, "d D/d lambda for cnst (%p) at %1.20f = %1.20f", &cnst, lambda, diff);
-  XBT_OUT();
-  return diff;
-}
-
-/** @brief Attribute the value bound to var->bound.
- *
- *  @param f    function (f)
- *  @param fp   partial differential of f (f prime, (f'))
- *  @param fpi  inverse of the partial differential of f (f prime inverse, (f')^{-1})
- *
- *  Set default functions to the ones passed as parameters.
- */
-void Lagrange::set_default_protocol_function(double (*f)(const Variable& var, double x),
-                                             double (*fp)(const Variable& var, double x),
-                                             double (*fpi)(const Variable& var, double x))
-{
-  func_f   = f;
-  func_fp  = fp;
-  func_fpi = fpi;
-}
-
-double (*Lagrange::func_f)(const Variable&, double);
-double (*Lagrange::func_fp)(const Variable&, double);
-double (*Lagrange::func_fpi)(const Variable&, double);
-
-/**************** Vegas and Reno functions *************************/
-/* NOTE for Reno: all functions consider the network coefficient (alpha) equal to 1. */
-
-/*
- * For Vegas: $f(x) = @alpha D_f@ln(x)$
- * Therefore: $fp(x) = @frac{@alpha D_f}{x}$
- * Therefore: $fpi(x) = @frac{@alpha D_f}{x}$
- */
-double func_vegas_f(const Variable& var, double x)
-{
-  xbt_assert(x > 0.0, "Don't call me with stupid values! (%1.20f)", x);
-  return VEGAS_SCALING * var.sharing_weight * log(x);
-}
-
-double func_vegas_fp(const Variable& var, double x)
-{
-  xbt_assert(x > 0.0, "Don't call me with stupid values! (%1.20f)", x);
-  return VEGAS_SCALING * var.sharing_weight / x;
-}
-
-double func_vegas_fpi(const Variable& var, double x)
-{
-  xbt_assert(x > 0.0, "Don't call me with stupid values! (%1.20f)", x);
-  return var.sharing_weight / (x / VEGAS_SCALING);
-}
-
-/*
- * For Reno:  $f(x) = @frac{@sqrt{3/2}}{D_f} atan(@sqrt{3/2}D_f 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}}$
- */
-double func_reno_f(const Variable& var, double x)
-{
-  xbt_assert(var.sharing_weight > 0.0, "Don't call me with stupid values!");
-
-  return RENO_SCALING * sqrt(3.0 / 2.0) / var.sharing_weight * atan(sqrt(3.0 / 2.0) * var.sharing_weight * x);
-}
-
-double func_reno_fp(const Variable& var, double x)
-{
-  return RENO_SCALING * 3.0 / (3.0 * var.sharing_weight * var.sharing_weight * x * x + 2.0);
-}
-
-double func_reno_fpi(const Variable& var, double x)
-{
-  double res_fpi;
-
-  xbt_assert(var.sharing_weight > 0.0, "Don't call me with stupid values!");
-  xbt_assert(x > 0.0, "Don't call me with stupid values!");
-
-  res_fpi = 1.0 / (var.sharing_weight * var.sharing_weight * (x / RENO_SCALING)) -
-            2.0 / (3.0 * var.sharing_weight * var.sharing_weight);
-  if (res_fpi <= 0.0)
-    return 0.0;
-  return sqrt(res_fpi);
-}
-
-/* Implementing new Reno-2
- * For Reno-2:  $f(x)   = U_f(x_f) = @frac{{2}{D_f}}*ln(2+x*D_f)$
- * Therefore:   $fp(x)  = 2/(Weight*x + 2)
- * Therefore:   $fpi(x) = (2*Weight)/x - 4
- */
-double func_reno2_f(const Variable& var, double x)
-{
-  xbt_assert(var.sharing_weight > 0.0, "Don't call me with stupid values!");
-  return RENO2_SCALING * (1.0 / var.sharing_weight) *
-         log((x * var.sharing_weight) / (2.0 * x * var.sharing_weight + 3.0));
-}
-
-double func_reno2_fp(const Variable& var, double x)
-{
-  return RENO2_SCALING * 3.0 / (var.sharing_weight * x * (2.0 * var.sharing_weight * x + 3.0));
-}
-
-double func_reno2_fpi(const Variable& var, double x)
-{
-  xbt_assert(x > 0.0, "Don't call me with stupid values!");
-  double tmp     = x * var.sharing_weight * var.sharing_weight;
-  double res_fpi = tmp * (9.0 * x + 24.0);
-
-  if (res_fpi <= 0.0)
-    return 0.0;
-
-  res_fpi = RENO2_SCALING * (-3.0 * tmp + sqrt(res_fpi)) / (4.0 * tmp);
-  return res_fpi;
-}
-}
-}
-}
index a39eaa6..1cc6c4e 100644 (file)
@@ -19,8 +19,8 @@ namespace lmm {
 
 typedef std::vector<int> dyn_light_t;
 
-int Variable::Global_debug_id   = 1;
-int Constraint::Global_debug_id = 1;
+int Variable::next_rank_   = 1;
+int Constraint::next_rank_ = 1;
 
 System* make_new_maxmin_system(bool selective_update)
 {
@@ -41,19 +41,19 @@ int Element::get_concurrency() const
 
 void Element::decrease_concurrency()
 {
-  xbt_assert(constraint->concurrency_current >= get_concurrency());
-  constraint->concurrency_current -= get_concurrency();
+  xbt_assert(constraint->concurrency_current_ >= get_concurrency());
+  constraint->concurrency_current_ -= get_concurrency();
 }
 
 void Element::increase_concurrency()
 {
-  constraint->concurrency_current += get_concurrency();
+  constraint->concurrency_current_ += get_concurrency();
 
-  if (constraint->concurrency_current > constraint->concurrency_maximum)
-    constraint->concurrency_maximum = constraint->concurrency_current;
+  if (constraint->concurrency_current_ > constraint->concurrency_maximum_)
+    constraint->concurrency_maximum_ = constraint->concurrency_current_;
 
   xbt_assert(constraint->get_concurrency_limit() < 0 ||
-                 constraint->concurrency_current <= constraint->get_concurrency_limit(),
+                 constraint->concurrency_current_ <= constraint->get_concurrency_limit(),
              "Concurrency limit overflow!");
 }
 
@@ -65,34 +65,34 @@ void System::check_concurrency() const
 
   for (Constraint const& cnst : constraint_set) {
     int concurrency       = 0;
-    for (Element const& elem : cnst.enabled_element_set) {
-      xbt_assert(elem.variable->sharing_weight > 0);
+    for (Element const& elem : cnst.enabled_element_set_) {
+      xbt_assert(elem.variable->sharing_penalty_ > 0);
       concurrency += elem.get_concurrency();
     }
 
-    for (Element const& elem : cnst.disabled_element_set) {
+    for (Element const& elem : cnst.disabled_element_set_) {
       // We should have staged variables only if concurrency is reached in some constraint
-      xbt_assert(cnst.get_concurrency_limit() < 0 || elem.variable->staged_weight == 0 ||
-                     elem.variable->get_min_concurrency_slack() < elem.variable->concurrency_share,
+      xbt_assert(cnst.get_concurrency_limit() < 0 || elem.variable->staged_penalty_ == 0 ||
+                     elem.variable->get_min_concurrency_slack() < elem.variable->concurrency_share_,
                  "should not have staged variable!");
     }
 
     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!");
+    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)
   for (Variable const& var : variable_set) {
-    if (var.cnsts.empty())
+    if (var.cnsts_.empty())
       continue;
 
-    const Element& elem    = var.cnsts[0];
+    const Element& elem    = var.cnsts_[0];
     int belong_to_enabled  = elem.enabled_element_set_hook.is_linked();
     int belong_to_disabled = elem.disabled_element_set_hook.is_linked();
     int belong_to_active   = elem.active_element_set_hook.is_linked();
 
-    for (Element const& elem2 : var.cnsts) {
+    for (Element const& elem2 : var.cnsts_) {
       xbt_assert(belong_to_enabled == elem2.enabled_element_set_hook.is_linked(),
                  "Variable inconsistency (1): enabled_element_set");
       xbt_assert(belong_to_disabled == elem2.disabled_element_set_hook.is_linked(),
@@ -110,26 +110,26 @@ void System::var_free(Variable* var)
 
   // TODOLATER Can do better than that by leaving only the variable in only one enabled_element_set, call
   // update_modified_set, and then remove it..
-  if (not var->cnsts.empty())
-    update_modified_set(var->cnsts[0].constraint);
+  if (not var->cnsts_.empty())
+    update_modified_set(var->cnsts_[0].constraint);
 
-  for (Element& elem : var->cnsts) {
-    if (var->sharing_weight > 0)
+  for (Element& elem : var->cnsts_) {
+    if (var->sharing_penalty_ > 0)
       elem.decrease_concurrency();
     if (elem.enabled_element_set_hook.is_linked())
-      simgrid::xbt::intrusive_erase(elem.constraint->enabled_element_set, elem);
+      simgrid::xbt::intrusive_erase(elem.constraint->enabled_element_set_, elem);
     if (elem.disabled_element_set_hook.is_linked())
-      simgrid::xbt::intrusive_erase(elem.constraint->disabled_element_set, elem);
+      simgrid::xbt::intrusive_erase(elem.constraint->disabled_element_set_, elem);
     if (elem.active_element_set_hook.is_linked())
-      simgrid::xbt::intrusive_erase(elem.constraint->active_element_set, elem);
-    int nelements = elem.constraint->enabled_element_set.size() + elem.constraint->disabled_element_set.size();
+      simgrid::xbt::intrusive_erase(elem.constraint->active_element_set_, elem);
+    int nelements = elem.constraint->enabled_element_set_.size() + elem.constraint->disabled_element_set_.size();
     if (nelements == 0)
       make_constraint_inactive(elem.constraint);
     else
       on_disabled_var(elem.constraint);
   }
 
-  var->cnsts.clear();
+  var->cnsts_.clear();
 
   check_concurrency();
 
@@ -151,9 +151,9 @@ System::~System()
   Constraint* cnst;
 
   while ((var = extract_variable())) {
-    auto demangled = simgrid::xbt::demangle(typeid(*var->id).name());
+    auto demangled = simgrid::xbt::demangle(var->id_ ? typeid(*var->id_).name() : "(unidentified)");
     XBT_WARN("Probable bug: a %s variable (#%d) not removed before the LMM system destruction.", demangled.get(),
-             var->id_int);
+             var->rank_);
     var_free(var);
   }
   while ((cnst = extract_constraint()))
@@ -169,23 +169,23 @@ void System::cnst_free(Constraint* cnst)
   delete cnst;
 }
 
-Constraint::Constraint(void* id_value, double bound_value) : bound(bound_value), id(id_value)
+Constraint::Constraint(resource::Resource* id_value, double bound_value) : bound_(bound_value), id_(id_value)
 {
-  id_int = Global_debug_id++;
+  rank_ = next_rank_++;
 
-  remaining           = 0.0;
-  usage               = 0.0;
-  concurrency_limit   = sg_concurrency_limit;
-  concurrency_current = 0;
-  concurrency_maximum = 0;
-  sharing_policy      = s4u::Link::SharingPolicy::SHARED;
+  remaining_           = 0.0;
+  usage_               = 0.0;
+  concurrency_limit_   = sg_concurrency_limit;
+  concurrency_current_ = 0;
+  concurrency_maximum_ = 0;
+  sharing_policy_      = s4u::Link::SharingPolicy::SHARED;
 
-  lambda     = 0.0;
-  new_lambda = 0.0;
-  cnst_light = nullptr;
+  lambda_     = 0.0;
+  new_lambda_ = 0.0;
+  cnst_light_ = nullptr;
 }
 
-Constraint* System::constraint_new(void* id, double bound_value)
+Constraint* System::constraint_new(resource::Resource* id, double bound_value)
 {
   Constraint* cnst = new Constraint(id, bound_value);
   insert_constraint(cnst);
@@ -202,13 +202,14 @@ void System::variable_mallocator_free_f(void* var)
   delete static_cast<Variable*>(var);
 }
 
-Variable* System::variable_new(resource::Action* id, double sharing_weight, double bound, size_t number_of_constraints)
+Variable* System::variable_new(resource::Action* id, double sharing_penalty, double bound, size_t number_of_constraints)
 {
-  XBT_IN("(sys=%p, id=%p, weight=%f, bound=%f, num_cons =%zu)", this, id, sharing_weight, bound, number_of_constraints);
+  XBT_IN("(sys=%p, id=%p, penalty=%f, bound=%f, num_cons =%zu)", this, id, sharing_penalty, bound,
+         number_of_constraints);
 
   Variable* var = static_cast<Variable*>(xbt_mallocator_get(variable_mallocator_));
-  var->initialize(id, sharing_weight, bound, number_of_constraints, visited_counter_ - 1);
-  if (sharing_weight > 0)
+  var->initialize(id, sharing_penalty, bound, number_of_constraints, visited_counter_ - 1);
+  if (sharing_penalty > 0)
     variable_set.push_front(*var);
   else
     variable_set.push_back(*var);
@@ -223,6 +224,13 @@ void System::variable_free(Variable* var)
   var_free(var);
 }
 
+void System::variable_free_all()
+{
+  Variable* var;
+  while ((var = extract_variable()))
+    variable_free(var);
+}
+
 void System::expand(Constraint* cnst, Variable* var, double consumption_weight)
 {
   modified_ = true;
@@ -230,47 +238,47 @@ void System::expand(Constraint* cnst, Variable* var, double consumption_weight)
   // 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 (Element& elem : var->cnsts) {
+  if (var->concurrency_share_ > 1) {
+    for (Element& elem : var->cnsts_) {
       if (elem.constraint == cnst && elem.enabled_element_set_hook.is_linked())
         current_share += elem.get_concurrency();
     }
   }
 
   // Check if we need to disable the variable
-  if (var->sharing_weight > 0 && var->concurrency_share - current_share > cnst->get_concurrency_slack()) {
-    double weight = var->sharing_weight;
+  if (var->sharing_penalty_ > 0 && var->concurrency_share_ - current_share > cnst->get_concurrency_slack()) {
+    double penalty = var->sharing_penalty_;
     disable_var(var);
-    for (Element const& elem : var->cnsts)
+    for (Element const& elem : var->cnsts_)
       on_disabled_var(elem.constraint);
     consumption_weight = 0;
-    var->staged_weight = weight;
-    xbt_assert(not var->sharing_weight);
+    var->staged_penalty_ = penalty;
+    xbt_assert(not var->sharing_penalty_);
   }
 
-  xbt_assert(var->cnsts.size() < var->cnsts.capacity(), "Too much constraints");
+  xbt_assert(var->cnsts_.size() < var->cnsts_.capacity(), "Too much constraints");
 
-  var->cnsts.resize(var->cnsts.size() + 1);
-  Element& elem = var->cnsts.back();
+  var->cnsts_.resize(var->cnsts_.size() + 1);
+  Element& elem = var->cnsts_.back();
 
   elem.consumption_weight = consumption_weight;
   elem.constraint         = cnst;
   elem.variable           = var;
 
-  if (var->sharing_weight) {
-    elem.constraint->enabled_element_set.push_front(elem);
+  if (var->sharing_penalty_) {
+    elem.constraint->enabled_element_set_.push_front(elem);
     elem.increase_concurrency();
   } else
-    elem.constraint->disabled_element_set.push_back(elem);
+    elem.constraint->disabled_element_set_.push_back(elem);
 
   if (not selective_update_active) {
     make_constraint_active(cnst);
-  } else if (elem.consumption_weight > 0 || var->sharing_weight > 0) {
+  } else if (elem.consumption_weight > 0 || var->sharing_penalty_ > 0) {
     make_constraint_active(cnst);
     update_modified_set(cnst);
     // TODOLATER: Why do we need this second call?
-    if (var->cnsts.size() > 1)
-      update_modified_set(var->cnsts[0].constraint);
+    if (var->cnsts_.size() > 1)
+      update_modified_set(var->cnsts_[0].constraint);
   }
 
   check_concurrency();
@@ -284,26 +292,26 @@ void System::expand_add(Constraint* cnst, Variable* var, double value)
 
   // BEWARE: In case you have multiple elements in one constraint, this will always add value to the first element.
   auto elem_it =
-      std::find_if(begin(var->cnsts), end(var->cnsts), [&cnst](Element const& x) { return x.constraint == cnst; });
-  if (elem_it != end(var->cnsts)) {
+      std::find_if(begin(var->cnsts_), end(var->cnsts_), [&cnst](Element const& x) { return x.constraint == cnst; });
+  if (elem_it != end(var->cnsts_)) {
     Element& elem = *elem_it;
-    if (var->sharing_weight)
+    if (var->sharing_penalty_)
       elem.decrease_concurrency();
 
-    if (cnst->sharing_policy != s4u::Link::SharingPolicy::FATPIPE)
+    if (cnst->sharing_policy_ != s4u::Link::SharingPolicy::FATPIPE)
       elem.consumption_weight += value;
     else
       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 (var->sharing_penalty_) {
       if (cnst->get_concurrency_slack() < elem.get_concurrency()) {
-        double weight = var->sharing_weight;
+        double penalty = var->sharing_penalty_;
         disable_var(var);
-        for (Element const& elem2 : var->cnsts)
+        for (Element const& elem2 : var->cnsts_)
           on_disabled_var(elem2.constraint);
-        var->staged_weight = weight;
-        xbt_assert(not var->sharing_weight);
+        var->staged_penalty_ = penalty;
+        xbt_assert(not var->sharing_penalty_);
       }
       elem.increase_concurrency();
     }
@@ -319,26 +327,26 @@ Variable* Constraint::get_variable(const Element** 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)
-    if (not enabled_element_set.empty())
-      *elem = &enabled_element_set.front();
-    else if (not disabled_element_set.empty())
-      *elem = &disabled_element_set.front();
+    if (not enabled_element_set_.empty())
+      *elem = &enabled_element_set_.front();
+    else if (not disabled_element_set_.empty())
+      *elem = &disabled_element_set_.front();
     else
       *elem = nullptr;
   } else {
     // elem is not null, so we carry on
     if ((*elem)->enabled_element_set_hook.is_linked()) {
       // Look at enabled_element_set, and jump to disabled_element_set when finished
-      auto iter = std::next(enabled_element_set.iterator_to(**elem));
-      if (iter != std::end(enabled_element_set))
+      auto iter = std::next(enabled_element_set_.iterator_to(**elem));
+      if (iter != std::end(enabled_element_set_))
         *elem = &*iter;
-      else if (not disabled_element_set.empty())
-        *elem = &disabled_element_set.front();
+      else if (not disabled_element_set_.empty())
+        *elem = &disabled_element_set_.front();
       else
         *elem = nullptr;
     } else {
-      auto iter = std::next(disabled_element_set.iterator_to(**elem));
-      *elem     = iter != std::end(disabled_element_set) ? &*iter : nullptr;
+      auto iter = std::next(disabled_element_set_.iterator_to(**elem));
+      *elem     = iter != std::end(disabled_element_set_) ? &*iter : nullptr;
     }
   }
   if (*elem)
@@ -352,11 +360,11 @@ Variable* Constraint::get_variable(const Element** elem) const
 Variable* Constraint::get_variable_safe(const Element** elem, const Element** nextelem, int* numelem) const
 {
   if (*elem == nullptr) {
-    *numelem = enabled_element_set.size() + disabled_element_set.size() - 1;
-    if (not enabled_element_set.empty())
-      *elem = &enabled_element_set.front();
-    else if (not disabled_element_set.empty())
-      *elem = &disabled_element_set.front();
+    *numelem = enabled_element_set_.size() + disabled_element_set_.size() - 1;
+    if (not enabled_element_set_.empty())
+      *elem = &enabled_element_set_.front();
+    else if (not disabled_element_set_.empty())
+      *elem = &disabled_element_set_.front();
     else
       *elem = nullptr;
   } else {
@@ -370,16 +378,16 @@ Variable* Constraint::get_variable_safe(const Element** elem, const Element** ne
     // elem is not null, so we carry on
     if ((*elem)->enabled_element_set_hook.is_linked()) {
       // Look at enabled_element_set, and jump to disabled_element_set when finished
-      auto iter = std::next(enabled_element_set.iterator_to(**elem));
-      if (iter != std::end(enabled_element_set))
+      auto iter = std::next(enabled_element_set_.iterator_to(**elem));
+      if (iter != std::end(enabled_element_set_))
         *nextelem = &*iter;
-      else if (not disabled_element_set.empty())
-        *nextelem = &disabled_element_set.front();
+      else if (not disabled_element_set_.empty())
+        *nextelem = &disabled_element_set_.front();
       else
         *nextelem = nullptr;
     } else {
-      auto iter = std::next(disabled_element_set.iterator_to(**elem));
-      *nextelem = iter != std::end(disabled_element_set) ? &*iter : nullptr;
+      auto iter = std::next(disabled_element_set_.iterator_to(**elem));
+      *nextelem = iter != std::end(disabled_element_set_) ? &*iter : nullptr;
     }
     return (*elem)->variable;
   } else
@@ -407,10 +415,9 @@ static inline void saturated_variable_set_update(ConstraintLight* cnst_light_tab
    * (cnst_light_tab)*/
   for (int const& saturated_cnst : saturated_constraints) {
     ConstraintLight& cnst = cnst_light_tab[saturated_cnst];
-    for (Element const& elem : cnst.cnst->active_element_set) {
-      // 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 && not elem.variable->saturated_variable_set_hook.is_linked())
+    for (Element const& elem : cnst.cnst->active_element_set_) {
+      xbt_assert(elem.variable->sharing_penalty_ > 0); // All elements of active_element_set should be active
+      if (elem.consumption_weight > 0 && not elem.variable->saturated_variable_set_hook_.is_linked())
         sys->saturated_variable_set.push_back(*elem.variable);
     }
   }
@@ -421,13 +428,13 @@ static void format_element_list(const ElemList& elem_list, s4u::Link::SharingPol
                                 std::string& buf)
 {
   for (Element const& elem : elem_list) {
-    buf += std::to_string(elem.consumption_weight) + ".'" + std::to_string(elem.variable->id_int) + "'(" +
-           std::to_string(elem.variable->value) + ")" +
+    buf += std::to_string(elem.consumption_weight) + ".'" + std::to_string(elem.variable->rank_) + "'(" +
+           std::to_string(elem.variable->value_) + ")" +
            (sharing_policy != s4u::Link::SharingPolicy::FATPIPE ? " + " : " , ");
     if (sharing_policy != s4u::Link::SharingPolicy::FATPIPE)
-      sum += elem.consumption_weight * elem.variable->value;
+      sum += elem.consumption_weight * elem.variable->value_;
     else
-      sum = std::max(sum, elem.consumption_weight * elem.variable->value);
+      sum = std::max(sum, elem.consumption_weight * elem.variable->value_);
   }
 }
 
@@ -437,7 +444,7 @@ void System::print() const
 
   /* Printing Objective */
   for (Variable const& var : variable_set)
-    buf += "'" + std::to_string(var.id_int) + "'(" + std::to_string(var.sharing_weight) + ") ";
+    buf += "'" + std::to_string(var.rank_) + "'(" + std::to_string(var.sharing_penalty_) + ") ";
   buf += ")";
   XBT_DEBUG("%20s", buf.c_str());
   buf.clear();
@@ -448,31 +455,31 @@ void System::print() const
     double sum            = 0.0;
     // Show  the enabled variables
     buf += "\t";
-    buf += cnst.sharing_policy != s4u::Link::SharingPolicy::FATPIPE ? "(" : "max(";
-    format_element_list(cnst.enabled_element_set, cnst.sharing_policy, sum, buf);
+    buf += cnst.sharing_policy_ != s4u::Link::SharingPolicy::FATPIPE ? "(" : "max(";
+    format_element_list(cnst.enabled_element_set_, cnst.sharing_policy_, sum, buf);
     // TODO: Adding disabled elements only for test compatibility, but do we really want them to be printed?
-    format_element_list(cnst.disabled_element_set, cnst.sharing_policy, sum, buf);
+    format_element_list(cnst.disabled_element_set_, cnst.sharing_policy_, sum, buf);
 
-    buf += "0) <= " + std::to_string(cnst.bound) + " ('" + std::to_string(cnst.id_int) + "')";
+    buf += "0) <= " + std::to_string(cnst.bound_) + " ('" + std::to_string(cnst.rank_) + "')";
 
-    if (cnst.sharing_policy == s4u::Link::SharingPolicy::FATPIPE) {
+    if (cnst.sharing_policy_ == s4u::Link::SharingPolicy::FATPIPE) {
       buf += " [MAX-Constraint]";
     }
     XBT_DEBUG("%s", buf.c_str());
     buf.clear();
-    xbt_assert(not double_positive(sum - cnst.bound, cnst.bound * sg_maxmin_precision),
-               "Incorrect value (%f is not smaller than %f): %g", sum, cnst.bound, sum - cnst.bound);
+    xbt_assert(not double_positive(sum - cnst.bound_, cnst.bound_ * sg_maxmin_precision),
+               "Incorrect value (%f is not smaller than %f): %g", sum, cnst.bound_, sum - cnst.bound_);
   }
 
   XBT_DEBUG("Variables");
   /* Printing Result */
   for (Variable const& var : variable_set) {
-    if (var.bound > 0) {
-      XBT_DEBUG("'%d'(%f) : %f (<=%f)", var.id_int, var.sharing_weight, var.value, var.bound);
-      xbt_assert(not double_positive(var.value - var.bound, var.bound * sg_maxmin_precision),
-                 "Incorrect value (%f is not smaller than %f", var.value, var.bound);
+    if (var.bound_ > 0) {
+      XBT_DEBUG("'%d'(%f) : %f (<=%f)", var.rank_, var.sharing_penalty_, var.value_, var.bound_);
+      xbt_assert(not double_positive(var.value_ - var.bound_, var.bound_ * sg_maxmin_precision),
+                 "Incorrect value (%f is not smaller than %f", var.value_, var.bound_);
     } else {
-      XBT_DEBUG("'%d'(%f) : %f", var.id_int, var.sharing_weight, var.value);
+      XBT_DEBUG("'%d'(%f) : %f", var.rank_, var.sharing_penalty_, var.value_);
     }
   }
 }
@@ -500,9 +507,9 @@ template <class CnstList> void System::lmm_solve(CnstList& cnst_list)
   XBT_DEBUG("Active constraints : %zu", cnst_list.size());
   /* Init: Only modified code portions: reset the value of active variables */
   for (Constraint const& cnst : cnst_list) {
-    for (Element const& elem : cnst.enabled_element_set) {
-      xbt_assert(elem.variable->sharing_weight > 0.0);
-      elem.variable->value = 0.0;
+    for (Element const& elem : cnst.enabled_element_set_) {
+      xbt_assert(elem.variable->sharing_penalty_ > 0.0);
+      elem.variable->value_ = 0.0;
     }
   }
 
@@ -513,35 +520,35 @@ template <class CnstList> void System::lmm_solve(CnstList& cnst_list)
   for (Constraint& cnst : cnst_list) {
     /* INIT: Collect constraints that actually need to be saturated (i.e remaining  and usage are strictly positive)
      * into cnst_light_tab. */
-    cnst.remaining = cnst.bound;
-    if (not double_positive(cnst.remaining, cnst.bound * sg_maxmin_precision))
+    cnst.remaining_ = cnst.bound_;
+    if (not double_positive(cnst.remaining_, cnst.bound_ * sg_maxmin_precision))
       continue;
-    cnst.usage = 0;
-    for (Element& elem : cnst.enabled_element_set) {
-      xbt_assert(elem.variable->sharing_weight > 0);
+    cnst.usage_ = 0;
+    for (Element& elem : cnst.enabled_element_set_) {
+      xbt_assert(elem.variable->sharing_penalty_ > 0);
       if (elem.consumption_weight > 0) {
-        if (cnst.sharing_policy != s4u::Link::SharingPolicy::FATPIPE)
-          cnst.usage += elem.consumption_weight / elem.variable->sharing_weight;
-        else if (cnst.usage < elem.consumption_weight / elem.variable->sharing_weight)
-          cnst.usage = elem.consumption_weight / elem.variable->sharing_weight;
+        if (cnst.sharing_policy_ != s4u::Link::SharingPolicy::FATPIPE)
+          cnst.usage_ += elem.consumption_weight / elem.variable->sharing_penalty_;
+        else if (cnst.usage_ < elem.consumption_weight / elem.variable->sharing_penalty_)
+          cnst.usage_ = elem.consumption_weight / elem.variable->sharing_penalty_;
 
         elem.make_active();
-        resource::Action* action = static_cast<resource::Action*>(elem.variable->id);
+        resource::Action* action = static_cast<resource::Action*>(elem.variable->id_);
         if (modified_set_ && not action->is_within_modified_set())
           modified_set_->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.get_concurrency_limit());
+    XBT_DEBUG("Constraint '%d' usage: %f remaining: %f concurrency: %i<=%i<=%i", cnst.rank_, cnst.usage_,
+              cnst.remaining_, cnst.concurrency_current_, cnst.concurrency_maximum_, cnst.get_concurrency_limit());
     /* Saturated constraints update */
 
-    if (cnst.usage > 0) {
+    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;
+      cnst.cnst_light_                                    = &cnst_light_tab[cnst_light_num];
+      cnst_light_tab[cnst_light_num].remaining_over_usage = cnst.remaining_ / cnst.usage_;
       saturated_constraints_update(cnst_light_tab[cnst_light_num].remaining_over_usage, cnst_light_num,
                                    saturated_constraints, &min_usage);
-      xbt_assert(not cnst.active_element_set.empty(),
+      xbt_assert(not cnst.active_element_set_.empty(),
                  "There is no sense adding a constraint that has no active element!");
       cnst_light_num++;
     }
@@ -554,16 +561,16 @@ template <class CnstList> void System::lmm_solve(CnstList& cnst_list)
     /* Fix the variables that have to be */
     auto& var_list = saturated_variable_set;
     for (Variable const& var : var_list) {
-      if (var.sharing_weight <= 0.0)
+      if (var.sharing_penalty_ <= 0.0)
         DIE_IMPOSSIBLE;
       /* First check if some of these variables could reach their upper bound and update min_bound accordingly. */
-      XBT_DEBUG("var=%d, var.bound=%f, var.weight=%f, min_usage=%f, var.bound*var.weight=%f", var.id_int, var.bound,
-                var.sharing_weight, min_usage, var.bound * var.sharing_weight);
-      if ((var.bound > 0) && (var.bound * var.sharing_weight < min_usage)) {
+      XBT_DEBUG("var=%d, var.bound=%f, var.penalty=%f, min_usage=%f, var.bound*var.penalty=%f", var.rank_, var.bound_,
+                var.sharing_penalty_, min_usage, var.bound_ * var.sharing_penalty_);
+      if ((var.bound_ > 0) && (var.bound_ * var.sharing_penalty_ < min_usage)) {
         if (min_bound < 0)
-          min_bound = var.bound * var.sharing_weight;
+          min_bound = var.bound_ * var.sharing_penalty_;
         else
-          min_bound = std::min(min_bound, (var.bound * var.sharing_weight));
+          min_bound = std::min(min_bound, (var.bound_ * var.sharing_penalty_));
         XBT_DEBUG("Updated min_bound=%f", min_bound);
       }
     }
@@ -573,76 +580,80 @@ template <class CnstList> void System::lmm_solve(CnstList& cnst_list)
       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 var (%d) value to %f\n", var.id_int, var.value);
+        var.value_ = min_usage / var.sharing_penalty_;
+        XBT_DEBUG("Setting var (%d) value to %f\n", var.rank_, var.value_);
       } else {
         // If there exist a variable that can reach its bound, only update it (and other with the same bound) for now.
-        if (double_equals(min_bound, var.bound * var.sharing_weight, sg_maxmin_precision)) {
-          var.value = var.bound;
-          XBT_DEBUG("Setting %p (%d) value to %f\n", &var, var.id_int, var.value);
+        if (double_equals(min_bound, var.bound_ * var.sharing_penalty_, sg_maxmin_precision)) {
+          var.value_ = var.bound_;
+          XBT_DEBUG("Setting %p (%d) value to %f\n", &var, var.rank_, var.value_);
         } else {
           // Variables which bound is different are not considered for this cycle, but they will be afterwards.
-          XBT_DEBUG("Do not consider %p (%d) \n", &var, var.id_int);
+          XBT_DEBUG("Do not consider %p (%d) \n", &var, var.rank_);
           var_list.pop_front();
           continue;
         }
       }
-      XBT_DEBUG("Min usage: %f, Var(%d).weight: %f, Var(%d).value: %f ", min_usage, var.id_int, var.sharing_weight,
-                var.id_int, var.value);
+      XBT_DEBUG("Min usage: %f, Var(%d).penalty: %f, Var(%d).value: %f ", min_usage, var.rank_, var.sharing_penalty_,
+                var.rank_, var.value_);
 
       /* Update the usage of contraints where this variable is involved */
-      for (Element& elem : var.cnsts) {
+      for (Element& elem : var.cnsts_) {
         Constraint* cnst = elem.constraint;
-        if (cnst->sharing_policy != s4u::Link::SharingPolicy::FATPIPE) {
+        if (cnst->sharing_policy_ != s4u::Link::SharingPolicy::FATPIPE) {
           // 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);
+          double_update(&(cnst->remaining_), elem.consumption_weight * var.value_, cnst->bound_ * sg_maxmin_precision);
+          double_update(&(cnst->usage_), elem.consumption_weight / var.sharing_penalty_, 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);
+          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);
+                        cnst_light_num, 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_tab[index].cnst->cnst_light_ = &cnst_light_tab[index];
               cnst_light_num--;
-              cnst->cnst_light = nullptr;
+              cnst->cnst_light_ = nullptr;
             }
           } else {
-            cnst->cnst_light->remaining_over_usage = cnst->remaining / cnst->usage;
+            if (cnst->cnst_light_) {
+              cnst->cnst_light_->remaining_over_usage = cnst->remaining_ / cnst->usage_;
+            }
           }
           elem.make_inactive();
         } else {
           // Remember: non-shared constraints only require that max(elem.value * var.value) < cnst->bound
-          cnst->usage = 0.0;
+          cnst->usage_ = 0.0;
           elem.make_inactive();
-          for (Element& elem2 : cnst->enabled_element_set) {
-            xbt_assert(elem2.variable->sharing_weight > 0);
-            if (elem2.variable->value > 0)
+          for (Element& elem2 : cnst->enabled_element_set_) {
+            xbt_assert(elem2.variable->sharing_penalty_ > 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);
+              cnst->usage_ = std::max(cnst->usage_, elem2.consumption_weight / elem2.variable->sharing_penalty_);
           }
           // 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);
+          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 || \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);
+                        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_tab[index].cnst->cnst_light_ = &cnst_light_tab[index];
               cnst_light_num--;
-              cnst->cnst_light = nullptr;
+              cnst->cnst_light_ = nullptr;
             }
           } else {
-            cnst->cnst_light->remaining_over_usage = cnst->remaining / cnst->usage;
-            xbt_assert(not cnst->active_element_set.empty(),
-                       "Should not keep a maximum constraint that has no active"
-                       " element! You want to check the maxmin precision and possible rounding effects.");
+            if (cnst->cnst_light_) {
+              cnst->cnst_light_->remaining_over_usage = cnst->remaining_ / cnst->usage_;
+              xbt_assert(not cnst->active_element_set_.empty(),
+                         "Should not keep a maximum constraint that has no active"
+                         " element! You want to check the maxmin precision and possible rounding effects.");
+            }
           }
         }
       }
@@ -655,12 +666,12 @@ template <class CnstList> void System::lmm_solve(CnstList& cnst_list)
     saturated_constraints.clear();
     int pos;
     for (pos = 0; pos < cnst_light_num; pos++) {
-      xbt_assert(not cnst_light_tab[pos].cnst->active_element_set.empty(),
+      xbt_assert(not cnst_light_tab[pos].cnst->active_element_set_.empty(),
                  "Cannot saturate more a constraint that has"
                  " no active element! You may want to change the maxmin precision (--cfg=maxmin/precision:<new_value>)"
                  " 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);
+                 cnst_light_tab[pos].cnst->usage_, sg_maxmin_precision, cnst_light_tab[pos - 1].cnst->usage_);
       saturated_constraints_update(cnst_light_tab[pos].remaining_over_usage, pos, saturated_constraints, &min_usage);
     }
 
@@ -692,35 +703,34 @@ template <class CnstList> void System::lmm_solve(CnstList& cnst_list)
 void System::update_variable_bound(Variable* var, double bound)
 {
   modified_  = true;
-  var->bound = bound;
+  var->bound_ = bound;
 
-  if (not var->cnsts.empty())
-    update_modified_set(var->cnsts[0].constraint);
+  if (not var->cnsts_.empty())
+    update_modified_set(var->cnsts_[0].constraint);
 }
 
-void Variable::initialize(resource::Action* id_value, double sharing_weight_value, double bound_value,
+void Variable::initialize(resource::Action* id_value, double sharing_penalty, 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;
+  id_     = id_value;
+  rank_   = next_rank_++;
+  cnsts_.reserve(number_of_constraints);
+  sharing_penalty_   = sharing_penalty;
+  staged_penalty_    = 0.0;
+  bound_             = bound_value;
+  concurrency_share_ = 1;
+  value_             = 0.0;
+  visited_           = visited_value;
+  mu_                = 0.0;
 
-  xbt_assert(not variable_set_hook.is_linked());
-  xbt_assert(not saturated_variable_set_hook.is_linked());
+  xbt_assert(not variable_set_hook_.is_linked());
+  xbt_assert(not saturated_variable_set_hook_.is_linked());
 }
 
 int Variable::get_min_concurrency_slack() const
 {
   int minslack = std::numeric_limits<int>::max();
-  for (Element const& elem : cnsts) {
+  for (Element 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
@@ -740,21 +750,21 @@ void System::enable_var(Variable* 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;
+  var->sharing_penalty_ = var->staged_penalty_;
+  var->staged_penalty_  = 0;
 
   // Enabling the variable, move var to list head. Subtlety is: here, we need to call update_modified_set AFTER
   // moving at least one element of var.
 
   simgrid::xbt::intrusive_erase(variable_set, *var);
   variable_set.push_front(*var);
-  for (Element& elem : var->cnsts) {
-    simgrid::xbt::intrusive_erase(elem.constraint->disabled_element_set, elem);
-    elem.constraint->enabled_element_set.push_front(elem);
+  for (Element& elem : var->cnsts_) {
+    simgrid::xbt::intrusive_erase(elem.constraint->disabled_element_set_, elem);
+    elem.constraint->enabled_element_set_.push_front(elem);
     elem.increase_concurrency();
   }
-  if (not var->cnsts.empty())
-    update_modified_set(var->cnsts[0].constraint);
+  if (not var->cnsts_.empty())
+    update_modified_set(var->cnsts_[0].constraint);
 
   // 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.
@@ -763,30 +773,30 @@ void System::enable_var(Variable* var)
 
 void System::disable_var(Variable* var)
 {
-  xbt_assert(not var->staged_weight, "Staged weight should have been cleared");
+  xbt_assert(not var->staged_penalty_, "Staged penalty should have been cleared");
   // 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.
   simgrid::xbt::intrusive_erase(variable_set, *var);
   variable_set.push_back(*var);
-  if (not var->cnsts.empty())
-    update_modified_set(var->cnsts[0].constraint);
-  for (Element& elem : var->cnsts) {
-    simgrid::xbt::intrusive_erase(elem.constraint->enabled_element_set, elem);
-    elem.constraint->disabled_element_set.push_back(elem);
+  if (not var->cnsts_.empty())
+    update_modified_set(var->cnsts_[0].constraint);
+  for (Element& elem : var->cnsts_) {
+    simgrid::xbt::intrusive_erase(elem.constraint->enabled_element_set_, elem);
+    elem.constraint->disabled_element_set_.push_back(elem);
     if (elem.active_element_set_hook.is_linked())
-      simgrid::xbt::intrusive_erase(elem.constraint->active_element_set, elem);
+      simgrid::xbt::intrusive_erase(elem.constraint->active_element_set_, elem);
     elem.decrease_concurrency();
   }
 
-  var->sharing_weight = 0.0;
-  var->staged_weight  = 0.0;
-  var->value          = 0.0;
+  var->sharing_penalty_ = 0.0;
+  var->staged_penalty_  = 0.0;
+  var->value_          = 0.0;
   check_concurrency();
 }
 
 /* /brief Find variables that can be enabled and enable them.
  *
- * Assuming that the variable has already been removed from non-zero weights
+ * Assuming that the variable has already been removed from non-zero penalties
  * Can we find a staged variable to add?
  * 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
@@ -796,32 +806,32 @@ void System::on_disabled_var(Constraint* cnstr)
   if (cnstr->get_concurrency_limit() < 0)
     return;
 
-  int numelem = cnstr->disabled_element_set.size();
+  int numelem = cnstr->disabled_element_set_.size();
   if (not numelem)
     return;
 
-  Element* elem = &cnstr->disabled_element_set.front();
+  Element* elem = &cnstr->disabled_element_set_.front();
 
   // Cannot use foreach loop, because System::enable_var() will modify disabled_element_set.. within the loop
   while (numelem-- && elem) {
 
     Element* nextelem;
     if (elem->disabled_element_set_hook.is_linked()) {
-      auto iter = std::next(cnstr->disabled_element_set.iterator_to(*elem));
-      nextelem  = iter != std::end(cnstr->disabled_element_set) ? &*iter : nullptr;
+      auto iter = std::next(cnstr->disabled_element_set_.iterator_to(*elem));
+      nextelem  = iter != std::end(cnstr->disabled_element_set_) ? &*iter : nullptr;
     } else {
       nextelem = nullptr;
     }
 
-    if (elem->variable->staged_weight > 0 && elem->variable->can_enable()) {
+    if (elem->variable->staged_penalty_ > 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?
       enable_var(elem->variable);
     }
 
-    xbt_assert(cnstr->concurrency_current <= cnstr->get_concurrency_limit(), "Concurrency overflow!");
-    if (cnstr->concurrency_current == cnstr->get_concurrency_limit())
+    xbt_assert(cnstr->concurrency_current_ <= cnstr->get_concurrency_limit(), "Concurrency overflow!");
+    if (cnstr->concurrency_current_ == cnstr->get_concurrency_limit())
       break;
 
     elem = nextelem;
@@ -832,40 +842,37 @@ void System::on_disabled_var(Constraint* cnstr)
   // 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 System::update_variable_weight(Variable* var, double weight)
+/** @brief update the penalty of a variable (disable it by passing 0 as a penalty) */
+void System::update_variable_penalty(Variable* var, double penalty)
 {
-  xbt_assert(weight >= 0, "Variable weight should not be negative!");
+  xbt_assert(penalty >= 0, "Variable penalty should not be negative!");
 
-  if (weight == var->sharing_weight)
+  if (penalty == var->sharing_penalty_)
     return;
 
-  int enabling_var  = (weight > 0 && var->sharing_weight <= 0);
-  int disabling_var = (weight <= 0 && var->sharing_weight > 0);
+  int enabling_var  = (penalty > 0 && var->sharing_penalty_ <= 0);
+  int disabling_var = (penalty <= 0 && var->sharing_penalty_ > 0);
 
-  XBT_IN("(sys=%p, var=%p, weight=%f)", this, var, weight);
+  XBT_IN("(sys=%p, var=%p, penalty=%f)", this, var, penalty);
 
   modified_ = true;
 
   // Are we enabling this variable?
   if (enabling_var) {
-    var->staged_weight = weight;
+    var->staged_penalty_ = penalty;
     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"
+    if (minslack < var->concurrency_share_) {
+      XBT_DEBUG("Staging var (instead of enabling) because min concurrency slack %i, with penalty %f and concurrency"
                 " share %i",
-                minslack, weight, var->concurrency_share);
+                minslack, penalty, var->concurrency_share_);
       return;
     }
     XBT_DEBUG("Enabling var with min concurrency slack %i", minslack);
     enable_var(var);
   } else if (disabling_var) {
-    // Are we disabling this variable?
     disable_var(var);
   } else {
-    var->sharing_weight = weight;
+    var->sharing_penalty_ = penalty;
   }
 
   check_concurrency();
@@ -877,7 +884,7 @@ void System::update_constraint_bound(Constraint* cnst, double bound)
 {
   modified_ = true;
   update_modified_set(cnst);
-  cnst->bound = bound;
+  cnst->bound_ = bound;
 }
 
 /** @brief Update the constraint set propagating recursively to other constraints so the system should not be entirely
@@ -890,25 +897,25 @@ void System::update_constraint_bound(Constraint* cnst, double bound)
  */
 void System::update_modified_set_rec(Constraint* cnst)
 {
-  for (Element const& elem : cnst->enabled_element_set) {
+  for (Element const& elem : cnst->enabled_element_set_) {
     Variable* var = elem.variable;
-    for (Element const& elem2 : var->cnsts) {
-      if (var->visited == visited_counter_)
+    for (Element const& elem2 : var->cnsts_) {
+      if (var->visited_ == visited_counter_)
         break;
-      if (elem2.constraint != cnst && not elem2.constraint->modified_constraint_set_hook.is_linked()) {
+      if (elem2.constraint != cnst && not elem2.constraint->modified_constraint_set_hook_.is_linked()) {
         modified_constraint_set.push_back(*elem2.constraint);
         update_modified_set_rec(elem2.constraint);
       }
     }
     // var will be ignored in later visits as long as sys->visited_counter does not move
-    var->visited = visited_counter_;
+    var->visited_ = visited_counter_;
   }
 }
 
 void System::update_modified_set(Constraint* cnst)
 {
   /* nothing to do if selective update isn't active */
-  if (selective_update_active && not cnst->modified_constraint_set_hook.is_linked()) {
+  if (selective_update_active && not cnst->modified_constraint_set_hook_.is_linked()) {
     modified_constraint_set.push_back(*cnst);
     update_modified_set_rec(cnst);
   }
@@ -924,7 +931,7 @@ void System::remove_all_modified_set()
   if (++visited_counter_ == 1) {
     /* the counter wrapped around, reset each variable->visited */
     for (Variable& var : variable_set)
-      var.visited = 0;
+      var.visited_ = 0;
   }
   modified_constraint_set.clear();
 }
@@ -941,21 +948,21 @@ void System::remove_all_modified_set()
 double Constraint::get_usage() const
 {
   double result              = 0.0;
-  if (sharing_policy != s4u::Link::SharingPolicy::FATPIPE) {
-    for (Element const& elem : enabled_element_set)
+  if (sharing_policy_ != s4u::Link::SharingPolicy::FATPIPE) {
+    for (Element const& elem : enabled_element_set_)
       if (elem.consumption_weight > 0)
-        result += elem.consumption_weight * elem.variable->value;
+        result += elem.consumption_weight * elem.variable->value_;
   } else {
-    for (Element const& elem : enabled_element_set)
+    for (Element const& elem : enabled_element_set_)
       if (elem.consumption_weight > 0)
-        result = std::max(result, elem.consumption_weight * elem.variable->value);
+        result = std::max(result, elem.consumption_weight * elem.variable->value_);
   }
   return result;
 }
 
 int Constraint::get_variable_amount() const
 {
-  return std::count_if(std::begin(enabled_element_set), std::end(enabled_element_set),
+  return std::count_if(std::begin(enabled_element_set_), std::end(enabled_element_set_),
                        [](const Element& elem) { return elem.consumption_weight > 0; });
 }
 }
index 123169d..4e88bba 100644 (file)
@@ -131,20 +131,6 @@ namespace lmm {
 
 /** @{ @ingroup SURF_lmm */
 
-/** Default functions associated to the chosen protocol. When using the lagrangian approach. */
-
-XBT_PUBLIC double func_reno_f(const Variable& var, double x);
-XBT_PUBLIC double func_reno_fp(const Variable& var, double x);
-XBT_PUBLIC double func_reno_fpi(const Variable& var, double x);
-
-XBT_PUBLIC double func_reno2_f(const Variable& var, double x);
-XBT_PUBLIC double func_reno2_fp(const Variable& var, double x);
-XBT_PUBLIC double func_reno2_fpi(const Variable& var, double x);
-
-XBT_PUBLIC double func_vegas_f(const Variable& var, double x);
-XBT_PUBLIC double func_vegas_fp(const Variable& var, double x);
-XBT_PUBLIC double func_vegas_fpi(const Variable& var, double x);
-
 /**
  * @brief LMM element
  * Elements can be seen as glue between constraint objects and variable objects.
@@ -193,62 +179,47 @@ public:
 class XBT_PUBLIC Constraint {
 public:
   Constraint() = delete;
-  Constraint(void* id_value, double bound_value);
+  Constraint(resource::Resource* id_value, double bound_value);
 
   /** @brief Unshare a constraint. */
-  void unshare() { sharing_policy = s4u::Link::SharingPolicy::FATPIPE; }
+  void unshare() { sharing_policy_ = s4u::Link::SharingPolicy::FATPIPE; }
 
-  /**
-   * @brief Check if a constraint is shared (shared by default)
-   * @return 1 if shared, 0 otherwise
-   */
-  s4u::Link::SharingPolicy get_sharing_policy() const { return sharing_policy; }
+  /** @brief Check how a constraint is shared  */
+  s4u::Link::SharingPolicy 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
-   */
+  /** @brief Get the usage of the constraint after the last lmm solve */
   double get_usage() const;
   int get_variable_amount() const;
 
-  /**
-   * @brief Sets the concurrency limit for this constraint
-   * @param limit The concurrency limit to use for this constraint
-   */
+  /** @brief Sets the concurrency limit for this constraint */
   void set_concurrency_limit(int limit)
   {
-    xbt_assert(limit < 0 || concurrency_maximum <= 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;
+    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 Gets the concurrency limit for 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; }
+  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
-   */
+  /** @brief Get the concurrency maximum for a given constraint (which reflects constraint evolution). */
   int get_concurrency_maximum() const
   {
-    xbt_assert(concurrency_limit < 0 || concurrency_maximum <= concurrency_limit,
+    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;
+    return concurrency_maximum_;
   }
 
   int get_concurrency_slack() const
   {
-    return concurrency_limit < 0 ? std::numeric_limits<int>::max() : concurrency_limit - concurrency_current;
+    return concurrency_limit_ < 0 ? std::numeric_limits<int>::max() : concurrency_limit_ - concurrency_current_;
   }
 
   /**
@@ -273,41 +244,41 @@ public:
    * @brief Get the data associated to a constraint
    * @return The data associated to the constraint
    */
-  void* get_id() const { return id; }
+  resource::Resource* get_id() const { return id_; }
 
   /* hookup to system */
-  boost::intrusive::list_member_hook<> constraint_set_hook;
-  boost::intrusive::list_member_hook<> active_constraint_set_hook;
-  boost::intrusive::list_member_hook<> modified_constraint_set_hook;
-  boost::intrusive::list_member_hook<> saturated_constraint_set_hook;
+  boost::intrusive::list_member_hook<> constraint_set_hook_;
+  boost::intrusive::list_member_hook<> active_constraint_set_hook_;
+  boost::intrusive::list_member_hook<> modified_constraint_set_hook_;
+  boost::intrusive::list_member_hook<> saturated_constraint_set_hook_;
   boost::intrusive::list<Element, boost::intrusive::member_hook<Element, boost::intrusive::list_member_hook<>,
                                                                 &Element::enabled_element_set_hook>>
-      enabled_element_set;
+      enabled_element_set_;
   boost::intrusive::list<Element, boost::intrusive::member_hook<Element, boost::intrusive::list_member_hook<>,
                                                                 &Element::disabled_element_set_hook>>
-      disabled_element_set;
+      disabled_element_set_;
   boost::intrusive::list<Element, boost::intrusive::member_hook<Element, boost::intrusive::list_member_hook<>,
                                                                 &Element::active_element_set_hook>>
-      active_element_set;
-  double remaining;
-  double usage;
-  double bound;
+      active_element_set_;
+  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 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)*/
 
-  s4u::Link::SharingPolicy sharing_policy;
-  int id_int;
-  double lambda;
-  double new_lambda;
-  ConstraintLight* cnst_light;
+  s4u::Link::SharingPolicy sharing_policy_;
+  int rank_; // Only used in debug messages to identify the constraint
+  double lambda_;
+  double new_lambda_;
+  ConstraintLight* 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;
+  static int next_rank_;  // To give a separate rank_ to each contraint
+  int concurrency_limit_; /* The maximum number of variables that may be enabled at any time (stage variables if
+                           * necessary) */
+  resource::Resource* id_;
 };
 
 /**
@@ -318,104 +289,89 @@ private:
  */
 class XBT_PUBLIC Variable {
 public:
-  void initialize(resource::Action* id_value, double sharing_weight_value, double bound_value,
-                  int number_of_constraints, unsigned visited_value);
+  void initialize(resource::Action* id_value, double sharing_penalty, 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 value of the variable after the last lmm solve */
+  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 Get the maximum value of the variable (-1.0 if no specified maximum) */
+  double get_bound() const { return bound_; }
 
   /**
    * @brief Set the concurrent share of the variable
    * @param value The new concurrency share
    */
-  void set_concurrency_share(short int value) { concurrency_share = value; }
+  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
    */
-  Constraint* get_constraint(unsigned num) const { return num < cnsts.size() ? cnsts[num].constraint : nullptr; }
+  Constraint* 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; }
+  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
-   */
-  size_t get_number_of_constraint() const { return cnsts.size(); }
+  /** @brief Get the number of constraint associated to a variable */
+  size_t get_number_of_constraint() const { return cnsts_.size(); }
 
-  /**
-   * @brief Get the data associated to a variable
-   * @return The data associated to the variable
-   */
-  resource::Action* get_id() const { return id; }
+  /** @brief Get the data associated to a variable */
+  resource::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 Get the penalty of a variable */
+  double get_penalty() const { return sharing_penalty_; }
 
   /** @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
+   * Make sure to set staged_penalty before, if your intent is only to check concurrency
    */
-  int can_enable() const { return staged_weight > 0 && get_min_concurrency_slack() >= concurrency_share; }
+  int can_enable() const { return staged_penalty_ > 0 && get_min_concurrency_slack() >= concurrency_share_; }
 
   /* hookup to system */
-  boost::intrusive::list_member_hook<> variable_set_hook;
-  boost::intrusive::list_member_hook<> saturated_variable_set_hook;
+  boost::intrusive::list_member_hook<> variable_set_hook_;
+  boost::intrusive::list_member_hook<> saturated_variable_set_hook_;
 
-  std::vector<Element> cnsts;
+  std::vector<Element> cnsts_;
 
-  // sharing_weight: variable's impact on the resource during the sharing
+  // sharing_penalty: 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 */
-  resource::Action* id;
-  int id_int;
-  unsigned visited; /* used by System::update_modified_set() */
-  /* \begin{For Lagrange only} */
-  double mu;
-  double new_mu;
-  /* \end{For Lagrange only} */
+  //   on network, the actions with higher latency have a lesser sharing_penalty
+  double sharing_penalty_;
+
+  double staged_penalty_; /* 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 */
+  resource::Action* id_;
+  int rank_;         // Only used in debug messages to identify the variable
+  unsigned visited_; /* used by System::update_modified_set() */
+  double mu_;
 
 private:
-  static int Global_debug_id;
+  static int next_rank_; // To give a separate rank_ to each variable
 };
 
 inline void Element::make_active()
 {
-  constraint->active_element_set.push_front(*this);
+  constraint->active_element_set_.push_front(*this);
 }
 inline void Element::make_inactive()
 {
   if (active_element_set_hook.is_linked())
-    simgrid::xbt::intrusive_erase(constraint->active_element_set, *this);
+    simgrid::xbt::intrusive_erase(constraint->active_element_set_, *this);
 }
 
 /**
@@ -436,16 +392,17 @@ public:
    * @param id Data associated to the constraint (e.g.: a network link)
    * @param bound_value The bound value of the constraint
    */
-  Constraint* constraint_new(void* id, double bound_value);
+  Constraint* constraint_new(resource::Resource* 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 sharing_penalty 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
+   * @param number_of_constraints The maximum number of constraints to associate to the variable
    */
-  Variable* variable_new(resource::Action* id, double weight_value, double bound, size_t number_of_constraints);
+  Variable* variable_new(resource::Action* id, double sharing_penalty, double bound = -1.0,
+                         size_t number_of_constraints = 1);
 
   /**
    * @brief Free a variable
@@ -453,6 +410,9 @@ public:
    */
   void variable_free(Variable * var);
 
+  /** @brief Free all variables */
+  void variable_free_all();
+
   /**
    * @brief Associate a variable to a constraint with a coefficient
    * @param cnst A constraint
@@ -469,33 +429,16 @@ public:
    */
   void expand_add(Constraint * cnst, Variable * var, double value);
 
-  /**
-   * @brief Update the bound of a variable
-   * @param var A constraint
-   * @param bound The new bound
-   */
+  /** @brief Update the bound of a variable */
   void update_variable_bound(Variable * 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(Variable * var, double weight);
+  /** @brief Update the sharing penalty of a variable */
+  void update_variable_penalty(Variable* var, double penalty);
 
-  /**
-   * @brief Update a constraint bound
-   * @param cnst A constraint
-   * @param bound The new bound of the consrtaint
-   */
+  /** @brief Update a constraint bound */
   void update_constraint_bound(Constraint * cnst, double bound);
 
-  /**
-   * @brief [brief description]
-   * @param cnst A constraint
-   * @return [description]
-   */
-  int constraint_used(Constraint * cnst) { return cnst->active_constraint_set_hook.is_linked(); }
+  int constraint_used(Constraint* cnst) { return cnst->active_constraint_set_hook_.is_linked(); }
 
   /** @brief Print the lmm system */
   void print() const;
@@ -531,21 +474,21 @@ private:
   void insert_constraint(Constraint * cnst) { constraint_set.push_back(*cnst); }
   void remove_variable(Variable * var)
   {
-    if (var->variable_set_hook.is_linked())
+    if (var->variable_set_hook_.is_linked())
       simgrid::xbt::intrusive_erase(variable_set, *var);
-    if (var->saturated_variable_set_hook.is_linked())
+    if (var->saturated_variable_set_hook_.is_linked())
       simgrid::xbt::intrusive_erase(saturated_variable_set, *var);
   }
   void make_constraint_active(Constraint * cnst)
   {
-    if (not cnst->active_constraint_set_hook.is_linked())
+    if (not cnst->active_constraint_set_hook_.is_linked())
       active_constraint_set.push_back(*cnst);
   }
   void make_constraint_inactive(Constraint * cnst)
   {
-    if (cnst->active_constraint_set_hook.is_linked())
+    if (cnst->active_constraint_set_hook_.is_linked())
       simgrid::xbt::intrusive_erase(active_constraint_set, *cnst);
-    if (cnst->modified_constraint_set_hook.is_linked())
+    if (cnst->modified_constraint_set_hook_.is_linked())
       simgrid::xbt::intrusive_erase(modified_constraint_set, *cnst);
   }
 
@@ -573,16 +516,16 @@ private:
 public:
   bool modified_ = false;
   boost::intrusive::list<Variable, boost::intrusive::member_hook<Variable, boost::intrusive::list_member_hook<>,
-                                                                 &Variable::variable_set_hook>>
+                                                                 &Variable::variable_set_hook_>>
       variable_set;
   boost::intrusive::list<Constraint, boost::intrusive::member_hook<Constraint, boost::intrusive::list_member_hook<>,
-                                                                   &Constraint::active_constraint_set_hook>>
+                                                                   &Constraint::active_constraint_set_hook_>>
       active_constraint_set;
   boost::intrusive::list<Variable, boost::intrusive::member_hook<Variable, boost::intrusive::list_member_hook<>,
-                                                                 &Variable::saturated_variable_set_hook>>
+                                                                 &Variable::saturated_variable_set_hook_>>
       saturated_variable_set;
   boost::intrusive::list<Constraint, boost::intrusive::member_hook<Constraint, boost::intrusive::list_member_hook<>,
-                                                                   &Constraint::saturated_constraint_set_hook>>
+                                                                   &Constraint::saturated_constraint_set_hook_>>
       saturated_constraint_set;
 
   resource::Action::ModifiedSet* modified_set_ = nullptr;
@@ -592,10 +535,10 @@ private:
   unsigned visited_counter_ = 1; /* used by System::update_modified_set() and System::remove_all_modified_set() to
                                   * cleverly (un-)flag the constraints (more details in these functions) */
   boost::intrusive::list<Constraint, boost::intrusive::member_hook<Constraint, boost::intrusive::list_member_hook<>,
-                                                                   &Constraint::constraint_set_hook>>
+                                                                   &Constraint::constraint_set_hook_>>
       constraint_set;
   boost::intrusive::list<Constraint, boost::intrusive::member_hook<Constraint, boost::intrusive::list_member_hook<>,
-                                                                   &Constraint::modified_constraint_set_hook>>
+                                                                   &Constraint::modified_constraint_set_hook_>>
       modified_constraint_set;
   xbt_mallocator_t variable_mallocator_ =
       xbt_mallocator_new(65536, System::variable_mallocator_new_f, System::variable_mallocator_free_f, nullptr);
@@ -610,40 +553,8 @@ private:
   void bottleneck_solve();
 };
 
-class XBT_PUBLIC Lagrange : public System {
-public:
-  explicit Lagrange(bool selective_update) : System(selective_update) {}
-  void solve() final { lagrange_solve(); }
-
-  static void set_default_protocol_function(double (*func_f)(const Variable& var, double x),
-                                            double (*func_fp)(const Variable& var, double x),
-                                            double (*func_fpi)(const Variable& var, double x));
-
-private:
-  void lagrange_solve();
-
-  bool check_feasible(bool warn);
-  double dual_objective();
-
-  static double (*func_f)(const Variable& var, double x);   /* (f)    */
-  static double (*func_fp)(const Variable& var, double x);  /* (f')    */
-  static double (*func_fpi)(const Variable& var, double x); /* (f')^{-1}    */
-
-  /*
-   * Local prototypes to implement the Lagrangian optimization with optimal step, also called dichotomy.
-   */
-  // computes the value of the dichotomy using a initial values, init, with a specific variable or constraint
-  static double dichotomy(double init, const Constraint& cnst, double min_error);
-  // computes the value of the differential of constraint cnst applied to lambda
-  static double partial_diff_lambda(double lambda, const Constraint& cnst);
-
-  static double new_value(const Variable& var);
-  static double new_mu(const Variable& var);
-};
-
 XBT_PUBLIC System* make_new_maxmin_system(bool selective_update);
 XBT_PUBLIC System* make_new_fair_bottleneck_system(bool selective_update);
-XBT_PUBLIC System* make_new_lagrange_system(bool selective_update);
 
 /** @} */
 }
diff --git a/src/kernel/lmm/maxmin_test.cpp b/src/kernel/lmm/maxmin_test.cpp
new file mode 100644 (file)
index 0000000..8075d9e
--- /dev/null
@@ -0,0 +1,290 @@
+/* Copyright (c) 2019. The SimGrid Team. All rights reserved.               */
+
+/* This program is 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/include/catch.hpp"
+#include "src/kernel/lmm/maxmin.hpp"
+#include "src/surf/surf_interface.hpp"
+#include "xbt/log.h"
+
+namespace lmm = simgrid::kernel::lmm;
+
+TEST_CASE("kernel::lmm Single constraint shared systems", "[kernel-lmm-shared-single-sys]")
+{
+  lmm::System* Sys = lmm::make_new_maxmin_system(false);
+
+  SECTION("Variable penalty")
+  {
+    /*
+     * A variable with twice the penalty gets half of the share
+     *
+     * In details:
+     *   o System:  a1 * p1 * \rho1  +  a2 * p2 * \rho2 < C
+     *   o consumption_weight: a1=1 ; a2=1
+     *   o sharing_penalty:    p1=1 ; p2=2
+     *
+     * Expectations
+     *   o rho1 = 2* rho2 (because rho2 has twice the penalty)
+     *   o rho1 + rho2 = C (because all weights are 1)
+     */
+
+    lmm::Constraint* sys_cnst = Sys->constraint_new(nullptr, 3);
+    lmm::Variable* rho_1      = Sys->variable_new(nullptr, 1);
+    lmm::Variable* rho_2      = Sys->variable_new(nullptr, 2);
+
+    Sys->expand(sys_cnst, rho_1, 1);
+    Sys->expand(sys_cnst, rho_2, 1);
+    Sys->solve();
+
+    REQUIRE(double_equals(rho_1->get_value(), 2, sg_maxmin_precision));
+    REQUIRE(double_equals(rho_2->get_value(), 1, sg_maxmin_precision));
+  }
+
+  SECTION("Consumption weight")
+  {
+    /*
+     * Variables of higher consumption weight consume more resource but get the same share
+     *
+     * In details:
+     *   o System:  a1 * p1 * \rho1  +  a2 * p2 * \rho2 < C
+     *   o consumption_weight: a1=1 ; a2=2
+     *   o sharing_penalty:    p1=1 ; p2=1
+     *
+     * Expectations
+     *   o rho1 = rho2 (because all penalties are 1)
+     *   o rho1 + 2* rho2 = C (because weight_2 is 2)
+     *   o so, rho1 = rho2 = 1 (because C is 3)
+     */
+
+    lmm::Constraint* sys_cnst = Sys->constraint_new(nullptr, 3);
+    lmm::Variable* rho_1      = Sys->variable_new(nullptr, 1);
+    lmm::Variable* rho_2      = Sys->variable_new(nullptr, 1);
+
+    Sys->expand(sys_cnst, rho_1, 1);
+    Sys->expand(sys_cnst, rho_2, 2);
+    Sys->solve();
+
+    REQUIRE(double_equals(rho_1->get_value(), 1, sg_maxmin_precision));
+    REQUIRE(double_equals(rho_2->get_value(), 1, sg_maxmin_precision));
+  }
+
+  SECTION("Consumption weight + variable penalty")
+  {
+
+    /*
+     * Resource proportionality between variable is kept while
+     * varying consumption weight
+     *
+     * In details:
+     *   o System:  a1 * p1 * \rho1  +  a2 * p2 * \rho2 < C
+     *   o consumption_weight: a1=1 ; a2=2
+     *   o sharing_penalty:    p1=1 ; p2=2
+     *
+     * Expectations
+     *   o rho1 = 2* rho2 (because rho2 has twice the penalty)
+     *   o rho1 + 2*rho2 = C (because consumption weight of rho2 is 2)
+     */
+
+    lmm::Constraint* sys_cnst = Sys->constraint_new(nullptr, 20);
+    lmm::Variable* rho_1      = Sys->variable_new(nullptr, 1);
+    lmm::Variable* rho_2      = Sys->variable_new(nullptr, 2);
+
+    Sys->expand(sys_cnst, rho_1, 1);
+    Sys->expand(sys_cnst, rho_2, 2);
+    Sys->solve();
+
+    double rho_1_share = 10;
+    REQUIRE(double_equals(rho_1->get_value(), rho_1_share, sg_maxmin_precision));
+    REQUIRE(double_equals(rho_2->get_value(), rho_1_share / 2, sg_maxmin_precision));
+  }
+
+  SECTION("Multiple constraints systems")
+  {
+
+    /*
+     * Multiple constraint systems can be solved with shared variables
+     *
+     * In details:
+     *   o System:  a1 * p1 * \rho1  +  a2 * p2 * \rho2 < C1
+     *              a3 * p1 * \rho1  +  a4 * p3 * \rho3 < C2
+     *   o consumption_weight: a1=1 ; a2=2 ; a3=2 ; a4=1
+     *   o sharing_penalty:    p1=1 ; p2=2 ; p3=1
+     *   o load: load_1=C1/(p1/a1 + p2/a2)=20 ; load_2=C2/(a2/p1 + a3/p3)=30
+     *
+     * Expectations
+     *   o First constraint will be solve first (because load_1 < load_2)
+     *   o rho1 = 2* rho2 (because rho2 has twice the penalty)
+     *   o rho1 + 2*rho2 = C1 (because consumption weight of rho2 is 2)
+     *   o 2*rho1 + rho3 = C2 (because consumption weight of rho1 is 2)
+     */
+
+    lmm::Constraint* sys_cnst_1 = Sys->constraint_new(nullptr, 20);
+    lmm::Constraint* sys_cnst_2 = Sys->constraint_new(nullptr, 60);
+
+    lmm::Variable* rho_1 = Sys->variable_new(nullptr, 1, -1, 2);
+    lmm::Variable* rho_2 = Sys->variable_new(nullptr, 2, -1, 1);
+    lmm::Variable* rho_3 = Sys->variable_new(nullptr, 1, -1, 1);
+
+    // Constraint 1
+    Sys->expand(sys_cnst_1, rho_1, 1);
+    Sys->expand(sys_cnst_1, rho_2, 2);
+
+    // Constraint 2
+    Sys->expand(sys_cnst_2, rho_1, 2);
+    Sys->expand(sys_cnst_2, rho_3, 1);
+    Sys->solve();
+
+    double rho_1_share = 10; // Start by solving the first constraint (results is the same as previous tests)
+    REQUIRE(double_equals(rho_1->get_value(), rho_1_share, sg_maxmin_precision));
+    REQUIRE(double_equals(rho_2->get_value(), rho_1_share / 2, sg_maxmin_precision));
+    REQUIRE(double_equals(rho_3->get_value(), 60 - 2 * rho_1_share, sg_maxmin_precision));
+  }
+
+  Sys->variable_free_all();
+  delete Sys;
+}
+
+TEST_CASE("kernel::lmm Single constraint unshared systems", "[kernel-lmm-unshared-single-sys]")
+{
+  lmm::System* Sys = lmm::make_new_maxmin_system(false);
+
+  SECTION("Variable penalty")
+  {
+
+    /*
+     * A variable with a penalty of two get half of the max_share
+     *
+     * In details:
+     *   o System:  a1 * p1 * \rho1  +  a2 * p2 * \rho2 < C1
+     *   o consumption_weight: a1=1 ; a2=1
+     *   o sharing_penalty:    p1=1 ; p2=2
+     *   o max_share: max(C1/(a1/p1),C1/(a2/p2))
+     *
+     * Expectations
+     *   o rho1 = max_share
+     *   o rho2 = max_share/2 (because penalty of rho2 is 2)
+     */
+
+    lmm::Constraint* sys_cnst = Sys->constraint_new(nullptr, 10);
+    sys_cnst->unshare(); // FATPIPE
+    lmm::Variable* rho_1 = Sys->variable_new(nullptr, 1);
+    lmm::Variable* rho_2 = Sys->variable_new(nullptr, 2);
+
+    Sys->expand(sys_cnst, rho_1, 1);
+    Sys->expand(sys_cnst, rho_2, 1);
+    Sys->solve();
+
+    REQUIRE(double_equals(rho_1->get_value(), 10, sg_maxmin_precision));
+    REQUIRE(double_equals(rho_2->get_value(), 10 / 2, sg_maxmin_precision));
+  }
+
+  SECTION("Consumption weight")
+  {
+
+    /*
+     * In a given constraint with all variable penalty to 1,
+     * the max_share is affected only by the maximum consumption weight
+     *
+     * In details:
+     *   o System:  a1 * p1 * \rho1  +  a2 * p2 * \rho2 < C1
+     *   o consumption_weight: a1=1 ; a2=1
+     *   o sharing_penalty:    p1=1 ; p2=2
+     *   o max_share: max(C1/(a1/p1),C1/(a2/p2))
+     *
+     * Expectations
+     *   o rho1 = max_share/2 (because penalty of rho1 is 1)
+     *   o rho2 = max_share/2 (because penalty of rho2 is 1)
+     */
+
+    lmm::Constraint* sys_cnst = Sys->constraint_new(nullptr, 10);
+    sys_cnst->unshare(); // FATPIPE
+    lmm::Variable* rho_1 = Sys->variable_new(nullptr, 1);
+    lmm::Variable* rho_2 = Sys->variable_new(nullptr, 1);
+
+    Sys->expand(sys_cnst, rho_1, 1);
+    Sys->expand(sys_cnst, rho_2, 2);
+    Sys->solve();
+
+    REQUIRE(double_equals(rho_1->get_value(), 5, sg_maxmin_precision));
+    REQUIRE(double_equals(rho_2->get_value(), 5, sg_maxmin_precision));
+  }
+
+  SECTION("Consumption weight + variable penalty")
+  {
+
+    /*
+     * Resource proportionality between variable is kept but
+     * constraint bound can be violated
+     *
+     * In details:
+     *   o System:  a1 * p1 * \rho1  +  a2 * p2 * \rho2 < C
+     *   o consumption_weight: a1=1 ; a2=2
+     *   o sharing_penalty:    p1=1 ; p2=2
+     *
+     * Expectations
+     *   o rho1 = 2 * rho2 (because rho2 has twice the penalty)
+     *   o rho1 + 2*rho2 can be greater than C
+     *   o rho1 <= C and 2*rho2 <= C
+     */
+
+    lmm::Constraint* sys_cnst = Sys->constraint_new(nullptr, 10);
+    sys_cnst->unshare();
+    lmm::Variable* sys_var_1 = Sys->variable_new(nullptr, 1);
+    lmm::Variable* sys_var_2 = Sys->variable_new(nullptr, 2);
+
+    Sys->expand(sys_cnst, sys_var_1, 1);
+    Sys->expand(sys_cnst, sys_var_2, 2);
+    Sys->solve();
+
+    REQUIRE(double_equals(sys_var_1->get_value(), 10, sg_maxmin_precision));
+    REQUIRE(double_equals(sys_var_2->get_value(), 5, sg_maxmin_precision));
+  }
+
+  SECTION("Multiple constraints systems")
+  {
+
+    /*
+     * Multiple constraint systems can be solved with shared variables
+     * on unshair constraints.
+     *
+     * In details:
+     *   o System:  a1 * p1 * \rho1  +  a2 * p2 * \rho2 < C1
+     *              a3 * p1 * \rho1  +  a4 * p3 * \rho3 < C2
+     *   o consumption_weight: a1=1 ; a2=2 ; a3=2 ; a4=1
+     *   o sharing_penalty:    p1=1 ; p2=2 ; p3=1
+     *   o load: load_1=C1/max(p1/a1,p2/a2)=20 ; load_2=C2/max(a3/p1,a4/p3)=30
+     *
+     * Expectations
+     *   o First constraint will be solve first (because load_1 < load_2)
+     *   o Second constraint load will not be updated !
+     *   o Each constraint should satisfy max(a_i * rho_i) <= C_r
+     */
+
+    lmm::Constraint* sys_cnst_1 = Sys->constraint_new(nullptr, 10);
+    lmm::Constraint* sys_cnst_2 = Sys->constraint_new(nullptr, 60);
+    sys_cnst_1->unshare(); // FATPIPE
+    sys_cnst_2->unshare();
+
+    lmm::Variable* rho_1 = Sys->variable_new(nullptr, 1, -1, 2);
+    lmm::Variable* rho_2 = Sys->variable_new(nullptr, 2, -1, 1);
+    lmm::Variable* rho_3 = Sys->variable_new(nullptr, 1, -1, 1);
+
+    // Constraint 1
+    Sys->expand(sys_cnst_1, rho_1, 1);
+    Sys->expand(sys_cnst_1, rho_2, 2);
+
+    // Constraint 2
+    Sys->expand(sys_cnst_2, rho_1, 2);
+    Sys->expand(sys_cnst_2, rho_3, 1);
+    Sys->solve();
+
+    double rho_1_share = 10; // Start by solving the first constraint (results is the same as previous tests)
+    REQUIRE(double_equals(rho_1->get_value(), rho_1_share, sg_maxmin_precision));
+    REQUIRE(double_equals(rho_2->get_value(), rho_1_share / 2, sg_maxmin_precision));
+    REQUIRE(double_equals(rho_3->get_value(), 60, sg_maxmin_precision));
+  }
+
+  Sys->variable_free_all();
+  delete Sys;
+}
index cf86b5c..e5688bf 100644 (file)
@@ -121,11 +121,11 @@ void Action::set_max_duration(double duration)
     get_model()->get_action_heap().remove(this);
 }
 
-void Action::set_priority(double weight)
+void Action::set_sharing_penalty(double sharing_penalty)
 {
-  XBT_IN("(%p,%g)", this, weight);
-  sharing_priority_ = weight;
-  get_model()->get_maxmin_system()->update_variable_weight(get_variable(), weight);
+  XBT_IN("(%p,%g)", this, sharing_penalty);
+  sharing_penalty_ = sharing_penalty;
+  get_model()->get_maxmin_system()->update_variable_penalty(get_variable(), sharing_penalty);
 
   if (get_model()->get_update_algorithm() == Model::UpdateAlgo::LAZY)
     get_model()->get_action_heap().remove(this);
@@ -155,16 +155,16 @@ bool Action::unref()
 void Action::suspend()
 {
   XBT_IN("(%p)", this);
-  if (suspended_ != SuspendStates::sleeping) {
-    get_model()->get_maxmin_system()->update_variable_weight(get_variable(), 0.0);
+  if (suspended_ != SuspendStates::SLEEPING) {
+    get_model()->get_maxmin_system()->update_variable_penalty(get_variable(), 0.0);
     if (get_model()->get_update_algorithm() == Model::UpdateAlgo::LAZY) {
       get_model()->get_action_heap().remove(this);
-      if (state_set_ == get_model()->get_started_action_set() && sharing_priority_ > 0) {
+      if (state_set_ == get_model()->get_started_action_set() && sharing_penalty_ > 0) {
         // If we have a lazy model, we need to update the remaining value accordingly
         update_remains_lazy(surf_get_clock());
       }
     }
-    suspended_ = SuspendStates::suspended;
+    suspended_ = SuspendStates::SUSPENDED;
   }
   XBT_OUT();
 }
@@ -172,20 +172,15 @@ void Action::suspend()
 void Action::resume()
 {
   XBT_IN("(%p)", this);
-  if (suspended_ != SuspendStates::sleeping) {
-    get_model()->get_maxmin_system()->update_variable_weight(get_variable(), get_priority());
-    suspended_ = SuspendStates::not_suspended;
+  if (suspended_ != SuspendStates::SLEEPING) {
+    get_model()->get_maxmin_system()->update_variable_penalty(get_variable(), get_sharing_penalty());
+    suspended_ = SuspendStates::RUNNING;
     if (get_model()->get_update_algorithm() == Model::UpdateAlgo::LAZY)
       get_model()->get_action_heap().remove(this);
   }
   XBT_OUT();
 }
 
-bool Action::is_suspended()
-{
-  return suspended_ == SuspendStates::suspended;
-}
-
 double Action::get_remains()
 {
   XBT_IN("(%p)", this);
diff --git a/src/kernel/resource/DiskImpl.cpp b/src/kernel/resource/DiskImpl.cpp
new file mode 100644 (file)
index 0000000..f2877f2
--- /dev/null
@@ -0,0 +1,105 @@
+/* Copyright (c) 2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "DiskImpl.hpp"
+
+#include "simgrid/s4u/Engine.hpp"
+#include "src/kernel/EngineImpl.hpp"
+#include "src/kernel/lmm/maxmin.hpp"
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(disk_kernel, surf, "Logging specific to the disk kernel resource");
+
+simgrid::kernel::resource::DiskModel* surf_disk_model = nullptr;
+
+namespace simgrid {
+namespace kernel {
+namespace resource {
+
+/*********
+ * Model *
+ *********/
+
+DiskModel::DiskModel() : Model(Model::UpdateAlgo::FULL)
+{
+  set_maxmin_system(new simgrid::kernel::lmm::System(true /* selective update */));
+}
+
+DiskModel::~DiskModel()
+{
+  surf_disk_model = nullptr;
+}
+
+/************
+ * Resource *
+ ************/
+
+DiskImpl::DiskImpl(kernel::resource::Model* model, const std::string& name, kernel::lmm::System* maxminSystem,
+                   double read_bw, double write_bw)
+    : Resource(model, name, maxminSystem->constraint_new(this, std::max(read_bw, write_bw))), piface_(name, this)
+{
+  DiskImpl::turn_on();
+  XBT_DEBUG("Create resource with read_bw '%f' write_bw '%f'", read_bw, write_bw);
+  constraint_read_  = maxminSystem->constraint_new(this, read_bw);
+  constraint_write_ = maxminSystem->constraint_new(this, write_bw);
+}
+
+DiskImpl::~DiskImpl()
+{
+  xbt_assert(currently_destroying_, "Don't delete Disks directly. Call destroy() instead.");
+}
+
+/** @brief Fire the required callbacks and destroy the object
+ *
+ * Don't delete directly a Disk, call d->destroy() instead.
+ */
+void DiskImpl::destroy()
+{
+  if (not currently_destroying_) {
+    currently_destroying_ = true;
+    s4u::Disk::on_destruction(this->piface_);
+    delete this;
+  }
+}
+
+bool DiskImpl::is_used()
+{
+  THROW_UNIMPLEMENTED;
+}
+
+void DiskImpl::apply_event(kernel::profile::Event* /*event*/, double /*value*/)
+{
+  THROW_UNIMPLEMENTED;
+}
+
+void DiskImpl::turn_on()
+{
+  if (not is_on()) {
+    Resource::turn_on();
+    s4u::Disk::on_state_change(this->piface_);
+  }
+}
+void DiskImpl::turn_off()
+{
+  if (is_on()) {
+    Resource::turn_off();
+    s4u::Disk::on_state_change(this->piface_);
+  }
+}
+
+xbt::signal<void(DiskAction const&, kernel::resource::Action::State, kernel::resource::Action::State)>
+    DiskAction::on_state_change;
+
+/**********
+ * Action *
+ **********/
+void DiskAction::set_state(Action::State state)
+{
+  Action::State old = get_state();
+  Action::set_state(state);
+  on_state_change(*this, old, state);
+}
+} // namespace resource
+} // namespace kernel
+} // namespace simgrid
diff --git a/src/kernel/resource/DiskImpl.hpp b/src/kernel/resource/DiskImpl.hpp
new file mode 100644 (file)
index 0000000..80ae7a6
--- /dev/null
@@ -0,0 +1,118 @@
+/* Copyright (c) 2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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/kernel/resource/Action.hpp"
+#include "simgrid/kernel/resource/Model.hpp"
+#include "simgrid/kernel/resource/Resource.hpp"
+#include "simgrid/s4u/Disk.hpp"
+#include "simgrid/s4u/Io.hpp"
+#include "src/surf/PropertyHolder.hpp"
+#include "src/surf/surf_interface.hpp"
+
+#include <map>
+
+#ifndef DISK_INTERFACE_HPP_
+#define DISK_INTERFACE_HPP_
+
+/*********
+ * Model *
+ *********/
+
+XBT_PUBLIC_DATA simgrid::kernel::resource::DiskModel* surf_disk_model;
+
+namespace simgrid {
+namespace kernel {
+namespace resource {
+/***********
+ * Classes *
+ ***********/
+
+class DiskAction;
+
+/*********
+ * Model *
+ *********/
+class DiskModel : public kernel::resource::Model {
+public:
+  DiskModel();
+  DiskModel(const DiskModel&) = delete;
+  DiskModel& operator=(const DiskModel&) = delete;
+  ~DiskModel();
+
+  virtual DiskImpl* createDisk(const std::string& id, double read_bw, double write_bw) = 0;
+};
+
+/************
+ * Resource *
+ ************/
+class DiskImpl : public Resource, public surf::PropertyHolder {
+  bool currently_destroying_ = false;
+  s4u::Host* host_           = nullptr;
+
+public:
+  DiskImpl(Model* model, const std::string& name, kernel::lmm::System* maxmin_system, double read_bw, double bwrite_bw);
+  DiskImpl(const DiskImpl&) = delete;
+  DiskImpl& operator=(const DiskImpl&) = delete;
+
+  ~DiskImpl() override;
+
+  /** @brief Public interface */
+  s4u::Disk piface_;
+  s4u::Disk* get_iface() { return &piface_; }
+  /** @brief Check if the Storage is used (if an action currently uses its resources) */
+  bool is_used() override;
+
+  void apply_event(profile::Event* event, double value) override;
+
+  void turn_on() override;
+  void turn_off() override;
+
+  s4u::Host* get_host() { return host_; }
+  void set_host(s4u::Host* host) { host_ = host; }
+
+  void destroy(); // Must be called instead of the destructor
+  virtual DiskAction* io_start(sg_size_t size, s4u::Io::OpType type) = 0;
+  virtual DiskAction* read(sg_size_t size)                           = 0;
+  virtual DiskAction* write(sg_size_t size)                          = 0;
+
+  lmm::Constraint* constraint_write_; /* Constraint for maximum write bandwidth*/
+  lmm::Constraint* constraint_read_;  /* Constraint for maximum write bandwidth*/
+};
+
+/**********
+ * Action *
+ **********/
+
+class DiskAction : public Action {
+public:
+  static xbt::signal<void(DiskAction const&, Action::State, Action::State)> on_state_change;
+
+  DiskAction(Model* model, double cost, bool failed, DiskImpl* disk, s4u::Io::OpType type)
+      : Action(model, cost, failed), type_(type), disk_(disk){};
+
+  /**
+   * @brief diskAction constructor
+   *
+   * @param model The StorageModel associated to this DiskAction
+   * @param cost The cost of this DiskAction in bytes
+   * @param failed [description]
+   * @param var The lmm variable associated to this DiskAction if it is part of a LMM component
+   * @param storage The Storage associated to this DiskAction
+   * @param type [description]
+   */
+  DiskAction(kernel::resource::Model* model, double cost, bool failed, kernel::lmm::Variable* var, DiskImpl* disk,
+             s4u::Io::OpType type)
+      : Action(model, cost, failed, var), type_(type), disk_(disk){};
+
+  void set_state(simgrid::kernel::resource::Action::State state) override;
+
+  s4u::Io::OpType type_;
+  DiskImpl* disk_;
+};
+
+} // namespace resource
+} // namespace kernel
+} // namespace simgrid
+#endif /* DISK_INTERFACE_HPP_ */
index 1e8998c..6f392e4 100644 (file)
@@ -13,20 +13,17 @@ namespace kernel {
 namespace resource {
 
 Model::Model(Model::UpdateAlgo algo) : update_algorithm_(algo) {}
+Model::~Model() = default;
 
-Model::~Model()
+Action::ModifiedSet* Model::get_modified_set() const
 {
-  delete inited_action_set_;
-  delete started_action_set_;
-  delete failed_action_set_;
-  delete finished_action_set_;
-  delete ignored_action_set_;
-  delete maxmin_system_;
+  return maxmin_system_->modified_set_;
 }
 
-Action::ModifiedSet* Model::get_modified_set() const
+void Model::set_maxmin_system(lmm::System* system)
 {
-  return maxmin_system_->modified_set_;
+  maxmin_system_.release(); // ugly...
+  maxmin_system_.reset(system);
 }
 
 double Model::next_occuring_event(double now)
@@ -51,11 +48,11 @@ double Model::next_occuring_event_lazy(double now)
     maxmin_system_->modified_set_->pop_front();
     bool max_duration_flag = false;
 
-    if (action->get_state_set() != started_action_set_)
+    if (action->get_state_set() != &started_action_set_)
       continue;
 
     /* bogus priority, skip it */
-    if (action->get_priority() <= 0 || action->get_type() == ActionHeap::Type::latency)
+    if (action->get_sharing_penalty() <= 0 || action->get_type() == ActionHeap::Type::latency)
       continue;
 
     action->update_remains_lazy(now);
@@ -80,7 +77,7 @@ double Model::next_occuring_event_lazy(double now)
       max_duration_flag = true;
     }
 
-    XBT_DEBUG("Action(%p) corresponds to variable %d", action, action->get_variable()->id_int);
+    XBT_DEBUG("Action(%p) corresponds to variable %d", action, action->get_variable()->rank_);
 
     XBT_DEBUG("Action(%p) Start %f. May finish at %f (got a share of %f). Max_duration %f", action,
               action->get_start_time(), min, share, action->get_max_duration());
index 16851b2..a8e7f5d 100644 (file)
@@ -5,7 +5,8 @@
 
 #include "simgrid/kernel/resource/Resource.hpp"
 #include "src/kernel/lmm/maxmin.hpp" // Constraint
-#include "src/kernel/resource/profile/trace_mgr.hpp"
+#include "src/kernel/resource/profile/FutureEvtSet.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/surf_interface.hpp"
 
 namespace simgrid {
@@ -22,7 +23,7 @@ double Resource::get_load() const
 void Resource::set_state_profile(profile::Profile* profile)
 {
   xbt_assert(state_event_ == nullptr, "Cannot set a second state profile to %s", get_cname());
-  state_event_ = profile->schedule(&future_evt_set, this);
+  state_event_ = profile->schedule(&profile::future_evt_set, this);
 }
 
 } // namespace resource
diff --git a/src/kernel/resource/profile/DatedValue.cpp b/src/kernel/resource/profile/DatedValue.cpp
new file mode 100644 (file)
index 0000000..62cb065
--- /dev/null
@@ -0,0 +1,25 @@
+/* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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/resource/profile/DatedValue.hpp"
+#include <math.h>
+
+namespace simgrid {
+namespace kernel {
+namespace profile {
+
+bool DatedValue::operator==(DatedValue const& e2) const
+{
+  return (fabs(date_ - e2.date_) < 0.0001) && (fabs(value_ - e2.value_) < 0.0001);
+}
+std::ostream& operator<<(std::ostream& out, const DatedValue& e)
+{
+  out << e.date_ << " " << e.value_;
+  return out;
+}
+
+} // namespace profile
+} // namespace kernel
+} // namespace simgrid
diff --git a/src/kernel/resource/profile/DatedValue.hpp b/src/kernel/resource/profile/DatedValue.hpp
new file mode 100644 (file)
index 0000000..84bdf99
--- /dev/null
@@ -0,0 +1,41 @@
+/* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program 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_KERNEL_PROFILE_DATEDVALUE
+#define SIMGRID_KERNEL_PROFILE_DATEDVALUE
+
+#include "simgrid/forward.h"
+#include <iostream>
+
+namespace simgrid {
+namespace kernel {
+namespace profile {
+
+/** @brief Modeling of the availability profile (due to an external load) or the churn
+ *
+ * There is 4 main concepts in this module:
+ * - #simgrid::kernel::profile::DatedValue: a pair <timestamp, value> (both are of type double)
+ * - #simgrid::kernel::profile::Profile: a list of dated values
+ * - #simgrid::kernel::profile::Event: links a given trace to a given SimGrid resource.
+ *   A Cpu for example has 2 kinds of events: state (ie, is it ON/OFF) and speed,
+ *   while a link has 3 iterators: state, bandwidth and latency.
+ * - #simgrid::kernel::profile::FutureEvtSet: makes it easy to find the next occuring event of all profiles
+ */
+class XBT_PUBLIC DatedValue {
+public:
+  double date_          = 0;
+  double value_         = 0;
+  explicit DatedValue() = default;
+  explicit DatedValue(double d, double v) : date_(d), value_(v) {}
+  bool operator==(DatedValue const& e2) const;
+  bool operator!=(DatedValue const& e2) const { return not(*this == e2); }
+};
+std::ostream& operator<<(std::ostream& out, const DatedValue& e);
+
+} // namespace profile
+} // namespace kernel
+} // namespace simgrid
+
+#endif
diff --git a/src/kernel/resource/profile/Event.hpp b/src/kernel/resource/profile/Event.hpp
new file mode 100644 (file)
index 0000000..576e92e
--- /dev/null
@@ -0,0 +1,34 @@
+/* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program 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_KERNEL_PROFILE_EVENT_HPP
+#define SIMGRID_KERNEL_PROFILE_EVENT_HPP
+
+#include "simgrid/forward.h"
+
+namespace simgrid {
+namespace kernel {
+namespace profile {
+
+class Event {
+public:
+  Profile* profile;
+  unsigned int idx;
+  resource::Resource* resource;
+  bool free_me;
+};
+} // namespace profile
+} // namespace kernel
+} // namespace simgrid
+/**
+ * @brief Free a trace event structure
+ *
+ * This function frees a trace_event if it can be freed, ie, if it has the free_me flag set to 1.
+ * This flag indicates whether the structure is still used somewhere or not.
+ * When the structure is freed, the argument is set to nullptr
+ */
+XBT_PUBLIC void tmgr_trace_event_unref(simgrid::kernel::profile::Event** trace_event);
+
+#endif // SIMGRID_KERNEL_PROFILE_EVENT_HPP
diff --git a/src/kernel/resource/profile/FutureEvtSet.cpp b/src/kernel/resource/profile/FutureEvtSet.cpp
new file mode 100644 (file)
index 0000000..19937f4
--- /dev/null
@@ -0,0 +1,57 @@
+/* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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/resource/profile/FutureEvtSet.hpp"
+#include "src/kernel/resource/profile/Event.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
+
+namespace simgrid {
+namespace kernel {
+namespace profile {
+
+simgrid::kernel::profile::FutureEvtSet future_evt_set; // FIXME: singleton antipattern
+
+FutureEvtSet::FutureEvtSet() = default;
+FutureEvtSet::~FutureEvtSet()
+{
+  while (not heap_.empty()) {
+    delete heap_.top().second;
+    heap_.pop();
+  }
+}
+
+/** @brief Schedules an event to a future date */
+void FutureEvtSet::add_event(double date, Event* evt)
+{
+  heap_.emplace(date, evt);
+}
+
+/** @brief returns the date of the next occurring event (or -1 if empty) */
+double FutureEvtSet::next_date() const
+{
+  return heap_.empty() ? -1.0 : heap_.top().first;
+}
+
+/** @brief Retrieves the next occurring event, or nullptr if none happens before date */
+Event* FutureEvtSet::pop_leq(double date, double* value, resource::Resource** resource)
+{
+  double event_date = next_date();
+  if (event_date > date || heap_.empty())
+    return nullptr;
+
+  Event* event       = heap_.top().second;
+  Profile* profile   = event->profile;
+  DatedValue dateVal = profile->next(event);
+
+  *resource = event->resource;
+  *value    = dateVal.value_;
+
+  heap_.pop();
+
+  return event;
+}
+} // namespace profile
+} // namespace kernel
+} // namespace simgrid
diff --git a/src/kernel/resource/profile/FutureEvtSet.hpp b/src/kernel/resource/profile/FutureEvtSet.hpp
new file mode 100644 (file)
index 0000000..a324d57
--- /dev/null
@@ -0,0 +1,40 @@
+/* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program 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 FUTUREEVTSET_HPP
+#define FUTUREEVTSET_HPP
+
+#include "simgrid/forward.h"
+#include <queue>
+
+namespace simgrid {
+namespace kernel {
+namespace profile {
+
+/** @brief Future Event Set (collection of iterators over the traces)
+ * That's useful to quickly know which is the next occurring event in a set of traces. */
+class XBT_PUBLIC FutureEvtSet {
+public:
+  FutureEvtSet();
+  FutureEvtSet(const FutureEvtSet&) = delete;
+  FutureEvtSet& operator=(const FutureEvtSet&) = delete;
+  virtual ~FutureEvtSet();
+  double next_date() const;
+  Event* pop_leq(double date, double* value, resource::Resource** resource);
+  void add_event(double date, Event* evt);
+
+private:
+  typedef std::pair<double, Event*> Qelt;
+  std::priority_queue<Qelt, std::vector<Qelt>, std::greater<Qelt>> heap_;
+};
+
+// FIXME: kill that singleton
+extern XBT_PRIVATE simgrid::kernel::profile::FutureEvtSet future_evt_set;
+
+} // namespace profile
+} // namespace kernel
+} // namespace simgrid
+
+#endif
similarity index 74%
rename from src/kernel/resource/profile/trace_mgr.cpp
rename to src/kernel/resource/profile/Profile.cpp
index a796657..482ee82 100644 (file)
@@ -3,20 +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 "xbt/log.h"
-#include "xbt/sysdep.h"
-
-#include "src/kernel/resource/profile/trace_mgr.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
+#include "simgrid/forward.h"
+#include "src/kernel/resource/profile/DatedValue.hpp"
+#include "src/kernel/resource/profile/Event.hpp"
+#include "src/kernel/resource/profile/FutureEvtSet.hpp"
 #include "src/surf/surf_interface.hpp"
+
 #include <boost/algorithm/string.hpp>
-#include <boost/algorithm/string/join.hpp>
-#include <boost/algorithm/string/split.hpp>
-#include <cmath>
 #include <fstream>
+#include <ostream>
 #include <sstream>
 #include <unordered_map>
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(profile, resource, "Surf profile management");
+#include <vector>
 
 static std::unordered_map<std::string, simgrid::kernel::profile::Profile*> trace_list;
 
@@ -24,23 +23,13 @@ namespace simgrid {
 namespace kernel {
 namespace profile {
 
-bool DatedValue::operator==(DatedValue const& e2) const
-{
-  return (fabs(date_ - e2.date_) < 0.0001) && (fabs(value_ - e2.value_) < 0.0001);
-}
-std::ostream& operator<<(std::ostream& out, const DatedValue& e)
-{
-  out << e.date_ << " " << e.value_;
-  return out;
-}
-
 Profile::Profile()
 {
   /* Add the first fake event storing the time at which the trace begins */
   DatedValue val(0, -1);
   event_list.push_back(val);
 }
-Profile::~Profile()          = default;
+Profile::~Profile() = default;
 
 /** @brief Register this profile for that resource onto that FES,
  * and get an iterator over the integrated trace  */
@@ -137,48 +126,11 @@ Profile* Profile::from_file(const std::string& path)
 
   return Profile::from_string(path, buffer.str(), -1);
 }
-FutureEvtSet::FutureEvtSet() = default;
-FutureEvtSet::~FutureEvtSet()
-{
-  while (not heap_.empty()) {
-    delete heap_.top().second;
-    heap_.pop();
-  }
-}
 
-/** @brief Schedules an event to a future date */
-void FutureEvtSet::add_event(double date, Event* evt)
-{
-  heap_.emplace(date, evt);
-}
-
-/** @brief returns the date of the next occurring event (or -1 if empty) */
-double FutureEvtSet::next_date() const
-{
-  return heap_.empty() ? -1.0 : heap_.top().first;
-}
-
-/** @brief Retrieves the next occurring event, or nullptr if none happens before date */
-Event* FutureEvtSet::pop_leq(double date, double* value, resource::Resource** resource)
-{
-  double event_date = next_date();
-  if (event_date > date || heap_.empty())
-    return nullptr;
-
-  Event* event = heap_.top().second;
-  Profile* profile = event->profile;
-  DatedValue dateVal = profile->next(event);
-
-  *resource = event->resource;
-  *value = dateVal.value_;
-
-  heap_.pop();
-
-  return event;
-}
 } // namespace profile
 } // namespace kernel
 } // namespace simgrid
+
 void tmgr_finalize()
 {
   for (auto const& kv : trace_list)
diff --git a/src/kernel/resource/profile/Profile.hpp b/src/kernel/resource/profile/Profile.hpp
new file mode 100644 (file)
index 0000000..3c173db
--- /dev/null
@@ -0,0 +1,50 @@
+/* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program 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_KERNEL_PROFILE_HPP
+#define SIMGRID_KERNEL_PROFILE_HPP
+
+#include "simgrid/forward.h"
+#include "src/kernel/resource/profile/DatedValue.hpp"
+#include "src/kernel/resource/profile/FutureEvtSet.hpp"
+
+#include <queue>
+#include <vector>
+
+namespace simgrid {
+namespace kernel {
+namespace profile {
+
+/** @brief A profile is a set of timed values, encoding the value that a variable takes at what time
+ *
+ * It is useful to model dynamic platforms, where an external load that makes the resource availability change over
+ * time. To model that, you have to set several profiles per resource: one for the on/off state and one for each
+ * numerical value (computational speed, bandwidth and/or latency).
+ */
+class XBT_PUBLIC Profile {
+public:
+  /**  Creates an empty trace */
+  explicit Profile();
+  virtual ~Profile();
+  Event* schedule(FutureEvtSet* fes, resource::Resource* resource);
+  DatedValue next(Event* event);
+
+  static Profile* from_file(const std::string& path);
+  static Profile* from_string(const std::string& name, const std::string& input, double periodicity);
+  // private:
+  std::vector<DatedValue> event_list;
+
+private:
+  FutureEvtSet* fes_ = nullptr;
+};
+
+} // namespace profile
+} // namespace kernel
+} // namespace simgrid
+
+/** Module finalizer: frees all profiles */
+XBT_PUBLIC void tmgr_finalize();
+
+#endif
@@ -6,7 +6,9 @@
 #include "catch.hpp"
 
 #include "simgrid/kernel/resource/Resource.hpp"
-#include "src/kernel/resource/profile/trace_mgr.hpp"
+#include "src/kernel/resource/profile/DatedValue.hpp"
+#include "src/kernel/resource/profile/Event.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/surf_interface.hpp"
 
 #include "xbt/log.h"
diff --git a/src/kernel/resource/profile/trace_mgr.hpp b/src/kernel/resource/profile/trace_mgr.hpp
deleted file mode 100644 (file)
index c0abe9e..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved.          */
-
-/* This program 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_PMGR_H
-#define SURF_PMGR_H
-
-#include "simgrid/forward.h"
-#include "xbt/sysdep.h"
-
-#include <queue>
-#include <vector>
-
-/* Iterator within a trace */
-namespace simgrid {
-namespace kernel {
-namespace profile {
-/** @brief Links a profile to a resource */
-class Event {
-public:
-  Profile* profile;
-  unsigned int idx;
-  resource::Resource* resource;
-  bool free_me;
-};
-
-} // namespace profile
-} // namespace kernel
-} // namespace simgrid
-extern XBT_PRIVATE simgrid::kernel::profile::FutureEvtSet future_evt_set;
-
-/**
- * @brief Free a trace event structure
- *
- * This function frees a trace_event if it can be freed, ie, if it has the free_me flag set to 1.
- * This flag indicates whether the structure is still used somewhere or not.
- * When the structure is freed, the argument is set to nullptr
- */
-XBT_PUBLIC void tmgr_trace_event_unref(simgrid::kernel::profile::Event** trace_event);
-
-XBT_PUBLIC void tmgr_finalize();
-
-namespace simgrid {
-namespace kernel {
-namespace profile {
-
-/** @brief Modeling of the availability profile (due to an external load) or the churn
- *
- * There is 4 main concepts in this module:
- * - #simgrid::kernel::profile::DatedValue: a pair <timestamp, value> (both are of type double)
- * - #simgrid::kernel::profile::Profile: a list of dated values
- * - #simgrid::kernel::profile::Event: links a given trace to a given SimGrid resource.
- *   A Cpu for example has 2 kinds of events: state (ie, is it ON/OFF) and speed,
- *   while a link has 3 iterators: state, bandwidth and latency.
- * - #simgrid::kernel::profile::FutureEvtSet: makes it easy to find the next occuring event of all profiles
- */
-class XBT_PUBLIC DatedValue {
-public:
-  double date_          = 0;
-  double value_         = 0;
-  explicit DatedValue() = default;
-  explicit DatedValue(double d, double v) : date_(d), value_(v) {}
-  bool operator==(DatedValue const& e2) const;
-  bool operator!=(DatedValue const& e2) const { return not(*this == e2); }
-};
-std::ostream& operator<<(std::ostream& out, const DatedValue& e);
-
-/** @brief A profile is a set of timed values, encoding the value that a variable takes at what time
- *
- * It is useful to model dynamic platforms, where an external load that makes the resource availability change over
- * time. To model that, you have to set several profiles per resource: one for the on/off state and one for each
- * numerical value (computational speed, bandwidth and/or latency).
- */
-class XBT_PUBLIC Profile {
-public:
-  /**  Creates an empty trace */
-  explicit Profile();
-  virtual ~Profile();
-  Event* schedule(FutureEvtSet* fes, resource::Resource* resource);
-  DatedValue next(Event* event);
-
-  static Profile* from_file(const std::string& path);
-  static Profile* from_string(const std::string& name, const std::string& input, double periodicity);
-  // private:
-  std::vector<DatedValue> event_list;
-
-private:
-  FutureEvtSet* fes_ = nullptr;
-};
-
-/** @brief Future Event Set (collection of iterators over the traces)
- * That's useful to quickly know which is the next occurring event in a set of traces. */
-class XBT_PUBLIC FutureEvtSet {
-public:
-  FutureEvtSet();
-  FutureEvtSet(const FutureEvtSet&) = delete;
-  FutureEvtSet& operator=(const FutureEvtSet&) = delete;
-  virtual ~FutureEvtSet();
-  double next_date() const;
-  Event* pop_leq(double date, double* value, resource::Resource** resource);
-  void add_event(double date, Event* evt);
-
-private:
-  typedef std::pair<double, Event*> Qelt;
-  std::priority_queue<Qelt, std::vector<Qelt>, std::greater<Qelt>> heap_;
-};
-
-} // namespace profile
-} // namespace kernel
-} // namespace simgrid
-
-#endif /* SURF_PMGR_H */
index 021eddd..fd2a827 100644 (file)
@@ -29,12 +29,14 @@ void ClusterZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArg
              "Cluster routing: no links attached to the source node - did you use host_link tag?");
 
   if ((src->id() == dst->id()) && has_loopback_) {
-    xbt_assert(not src->is_router(), "Routing from a cluster private router to itself is meaningless");
-
-    std::pair<resource::LinkImpl*, resource::LinkImpl*> info = private_links_.at(node_pos(src->id()));
-    route->link_list.push_back(info.first);
-    if (lat)
-      *lat += info.first->get_latency();
+    if (src->is_router()) {
+      XBT_WARN("Routing from a cluster private router to itself is meaningless");
+    } else {
+      std::pair<resource::LinkImpl*, resource::LinkImpl*> info = private_links_.at(node_pos(src->id()));
+      route->link_list.push_back(info.first);
+      if (lat)
+        *lat += info.first->get_latency();
+    }
     return;
   }
 
@@ -127,7 +129,7 @@ void ClusterZone::create_links_for_node(ClusterCreationArgs* cluster, int id, in
 
   LinkCreationArgs link;
   link.id        = link_id;
-  link.bandwidth = cluster->bw;
+  link.bandwidths.push_back(cluster->bw);
   link.latency   = cluster->lat;
   link.policy    = cluster->sharing_policy;
   sg_platf_new_link(&link);
index 3645a4f..1b6902f 100644 (file)
@@ -8,6 +8,7 @@
 #include "src/surf/network_interface.hpp"
 #include "src/surf/xml/platf_private.hpp"
 #include "surf/surf.hpp"
+#include "xbt/string.hpp"
 
 #include <cfloat>
 #include <queue>
@@ -124,7 +125,7 @@ void DijkstraZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationAr
     xbt_edge_t edge     = xbt_graph_get_edge(route_graph_, node_s_v, node_e_v);
 
     if (edge == nullptr)
-      THROWF(arg_error, 0, "No route from '%s' to '%s'", src->get_cname(), dst->get_cname());
+      throw std::invalid_argument(xbt::string_printf("No route from '%s' to '%s'", src->get_cname(), dst->get_cname()));
 
     RouteCreationArgs* e_route = static_cast<RouteCreationArgs*>(xbt_graph_edge_get_data(edge));
 
@@ -193,7 +194,7 @@ void DijkstraZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationAr
     xbt_edge_t edge        = xbt_graph_get_edge(route_graph_, node_pred_v, node_v);
 
     if (edge == nullptr)
-      THROWF(arg_error, 0, "No route from '%s' to '%s'", src->get_cname(), dst->get_cname());
+      throw std::invalid_argument(xbt::string_printf("No route from '%s' to '%s'", src->get_cname(), dst->get_cname()));
 
     RouteCreationArgs* e_route = static_cast<RouteCreationArgs*>(xbt_graph_edge_get_data(edge));
 
@@ -265,10 +266,12 @@ void DijkstraZone::new_edge(int src_id, int dst_id, simgrid::kernel::routing::Ro
   // Make sure that this graph edge was not already added to the graph
   if (xbt_graph_get_edge(route_graph_, src, dst) != nullptr) {
     if (route->gw_dst == nullptr || route->gw_src == nullptr)
-      THROWF(arg_error, 0, "Route from %s to %s already exists", route->src->get_cname(), route->dst->get_cname());
+      throw std::invalid_argument(
+          xbt::string_printf("Route from %s to %s already exists", route->src->get_cname(), route->dst->get_cname()));
     else
-      THROWF(arg_error, 0, "Route from %s@%s to %s@%s already exists", route->src->get_cname(),
-             route->gw_src->get_cname(), route->dst->get_cname(), route->gw_dst->get_cname());
+      throw std::invalid_argument(xbt::string_printf("Route from %s@%s to %s@%s already exists",
+                                                     route->src->get_cname(), route->gw_src->get_cname(),
+                                                     route->dst->get_cname(), route->gw_dst->get_cname()));
   }
 
   // Finally add it
index 68235e4..d390e51 100644 (file)
@@ -23,15 +23,6 @@ DragonflyZone::DragonflyZone(NetZoneImpl* father, const std::string& name, resou
 {
 }
 
-DragonflyZone::~DragonflyZone()
-{
-  if (this->routers_ != nullptr) {
-    for (unsigned int i = 0; i < this->num_groups_ * this->num_chassis_per_group_ * this->num_blades_per_chassis_; i++)
-      delete routers_[i];
-    delete[] routers_;
-  }
-}
-
 void DragonflyZone::rankId_to_coords(int rankId, unsigned int coords[4])
 {
   // coords : group, chassis, blade, node
@@ -62,13 +53,13 @@ void DragonflyZone::parse_specific_arguments(ClusterCreationArgs* cluster)
 
   try {
     this->num_groups_ = std::stoi(tmp[0]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Invalid number of groups:") + tmp[0]);
   }
 
   try {
     this->num_links_blue_ = std::stoi(tmp[1]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     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
@@ -79,13 +70,13 @@ void DragonflyZone::parse_specific_arguments(ClusterCreationArgs* cluster)
 
   try {
     this->num_chassis_per_group_ = std::stoi(tmp[0]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Invalid number of groups:") + tmp[0]);
   }
 
   try {
     this->num_links_black_ = std::stoi(tmp[1]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Invalid number of links for the black level:") + tmp[1]);
   }
 
@@ -97,20 +88,20 @@ void DragonflyZone::parse_specific_arguments(ClusterCreationArgs* cluster)
 
   try {
     this->num_blades_per_chassis_ = std::stoi(tmp[0]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Invalid number of groups:") + tmp[0]);
   }
 
   try {
     this->num_links_green_ = std::stoi(tmp[1]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     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
   try {
     this->num_nodes_per_blade_ = std::stoi(parameters[3]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Last parameter is not the amount of nodes per blade:") + parameters[3]);
   }
 
@@ -132,32 +123,13 @@ void DragonflyZone::seal()
   this->generate_links();
 }
 
-DragonflyRouter::DragonflyRouter(int group, int chassis, int blade) : group_(group), chassis_(chassis), blade_(blade)
-{
-}
-
-DragonflyRouter::~DragonflyRouter()
-{
-  delete[] my_nodes_;
-  delete[] green_links_;
-  delete[] black_links_;
-  delete blue_links_;
-}
-
 void DragonflyZone::generate_routers()
 {
-  this->routers_ =
-      new DragonflyRouter*[this->num_groups_ * this->num_chassis_per_group_ * this->num_blades_per_chassis_];
-
-  for (unsigned int i = 0; i < this->num_groups_; i++) {
-    for (unsigned int j = 0; j < this->num_chassis_per_group_; j++) {
-      for (unsigned int k = 0; k < this->num_blades_per_chassis_; k++) {
-        DragonflyRouter* router = new DragonflyRouter(i, j, k);
-        this->routers_[i * this->num_chassis_per_group_ * this->num_blades_per_chassis_ +
-                       j * this->num_blades_per_chassis_ + k] = router;
-      }
-    }
-  }
+  this->routers_.reserve(this->num_groups_ * this->num_chassis_per_group_ * this->num_blades_per_chassis_);
+  for (unsigned int i = 0; i < this->num_groups_; i++)
+    for (unsigned int j = 0; j < this->num_chassis_per_group_; j++)
+      for (unsigned int k = 0; k < this->num_blades_per_chassis_; k++)
+        this->routers_.emplace_back(i, j, k);
 }
 
 void DragonflyZone::create_link(const std::string& id, int numlinks, resource::LinkImpl** linkup,
@@ -166,7 +138,7 @@ void DragonflyZone::create_link(const std::string& id, int numlinks, resource::L
   *linkup   = nullptr;
   *linkdown = nullptr;
   LinkCreationArgs linkTemplate;
-  linkTemplate.bandwidth = this->bw_ * numlinks;
+  linkTemplate.bandwidths.push_back(this->bw_ * numlinks);
   linkTemplate.latency   = this->lat_;
   linkTemplate.policy    = this->sharing_policy_;
   linkTemplate.id        = std::move(id);
@@ -194,18 +166,18 @@ void DragonflyZone::generate_links()
   // Links from routers to their local nodes.
   for (unsigned int i = 0; i < numRouters; i++) {
     // allocate structures
-    this->routers_[i]->my_nodes_    = new resource::LinkImpl*[num_links_per_link_ * this->num_nodes_per_blade_];
-    this->routers_[i]->green_links_ = new resource::LinkImpl*[this->num_blades_per_chassis_];
-    this->routers_[i]->black_links_ = new resource::LinkImpl*[this->num_chassis_per_group_];
+    this->routers_[i].my_nodes_.resize(num_links_per_link_ * this->num_nodes_per_blade_);
+    this->routers_[i].green_links_.resize(this->num_blades_per_chassis_);
+    this->routers_[i].black_links_.resize(this->num_chassis_per_group_);
 
     for (unsigned int j = 0; j < num_links_per_link_ * this->num_nodes_per_blade_; j += num_links_per_link_) {
       std::string id = "local_link_from_router_" + std::to_string(i) + "_to_node_" +
                        std::to_string(j / num_links_per_link_) + "_" + std::to_string(uniqueId);
       this->create_link(id, 1, &linkup, &linkdown);
 
-      this->routers_[i]->my_nodes_[j] = linkup;
+      this->routers_[i].my_nodes_[j] = linkup;
       if (this->sharing_policy_ == s4u::Link::SharingPolicy::SPLITDUPLEX)
-        this->routers_[i]->my_nodes_[j + 1] = linkdown;
+        this->routers_[i].my_nodes_[j + 1] = linkdown;
 
       uniqueId++;
     }
@@ -219,8 +191,8 @@ void DragonflyZone::generate_links()
                          std::to_string(j) + "_and_" + std::to_string(k) + "_" + std::to_string(uniqueId);
         this->create_link(id, this->num_links_green_, &linkup, &linkdown);
 
-        this->routers_[i * num_blades_per_chassis_ + j]->green_links_[k] = linkup;
-        this->routers_[i * num_blades_per_chassis_ + k]->green_links_[j] = linkdown;
+        this->routers_[i * num_blades_per_chassis_ + j].green_links_[k] = linkup;
+        this->routers_[i * num_blades_per_chassis_ + k].green_links_[j] = linkdown;
         uniqueId++;
       }
     }
@@ -236,9 +208,9 @@ void DragonflyZone::generate_links()
           this->create_link(id, this->num_links_black_, &linkup, &linkdown);
 
           this->routers_[i * num_blades_per_chassis_ * num_chassis_per_group_ + j * num_blades_per_chassis_ + l]
-              ->black_links_[k] = linkup;
+              .black_links_[k] = linkup;
           this->routers_[i * num_blades_per_chassis_ * num_chassis_per_group_ + k * num_blades_per_chassis_ + l]
-              ->black_links_[j] = linkdown;
+              .black_links_[j] = linkdown;
           uniqueId++;
         }
       }
@@ -252,14 +224,12 @@ void DragonflyZone::generate_links()
     for (unsigned int j = i + 1; j < this->num_groups_; j++) {
       unsigned int routernumi                 = i * num_blades_per_chassis_ * num_chassis_per_group_ + j;
       unsigned int routernumj                 = j * num_blades_per_chassis_ * num_chassis_per_group_ + i;
-      this->routers_[routernumi]->blue_links_ = new resource::LinkImpl*;
-      this->routers_[routernumj]->blue_links_ = new resource::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->create_link(id, this->num_links_blue_, &linkup, &linkdown);
 
-      this->routers_[routernumi]->blue_links_[0] = linkup;
-      this->routers_[routernumj]->blue_links_[0] = linkdown;
+      this->routers_[routernumi].blue_link_ = linkup;
+      this->routers_[routernumj].blue_link_ = linkdown;
       uniqueId++;
     }
   }
@@ -293,10 +263,10 @@ void DragonflyZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationA
   XBT_DEBUG("dst : %u group, %u chassis, %u blade, %u node", targetCoords[0], targetCoords[1], targetCoords[2],
             targetCoords[3]);
 
-  DragonflyRouter* myRouter      = routers_[myCoords[0] * (num_chassis_per_group_ * num_blades_per_chassis_) +
-                                       myCoords[1] * num_blades_per_chassis_ + myCoords[2]];
-  DragonflyRouter* targetRouter  = routers_[targetCoords[0] * (num_chassis_per_group_ * num_blades_per_chassis_) +
-                                           targetCoords[1] * num_blades_per_chassis_ + targetCoords[2]];
+  DragonflyRouter* myRouter = &routers_[myCoords[0] * (num_chassis_per_group_ * num_blades_per_chassis_) +
+                                        myCoords[1] * num_blades_per_chassis_ + myCoords[2]];
+  DragonflyRouter* targetRouter = &routers_[targetCoords[0] * (num_chassis_per_group_ * num_blades_per_chassis_) +
+                                            targetCoords[1] * num_blades_per_chassis_ + targetCoords[2]];
   DragonflyRouter* currentRouter = myRouter;
 
   // node->router local link
@@ -319,8 +289,8 @@ void DragonflyZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationA
         route->link_list.push_back(currentRouter->green_links_[targetCoords[0]]);
         if (latency)
           *latency += currentRouter->green_links_[targetCoords[0]]->get_latency();
-        currentRouter = routers_[myCoords[0] * (num_chassis_per_group_ * num_blades_per_chassis_) +
-                                 myCoords[1] * num_blades_per_chassis_ + targetCoords[0]];
+        currentRouter = &routers_[myCoords[0] * (num_chassis_per_group_ * num_blades_per_chassis_) +
+                                  myCoords[1] * num_blades_per_chassis_ + targetCoords[0]];
       }
 
       if (currentRouter->chassis_ != 0) {
@@ -328,14 +298,14 @@ void DragonflyZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationA
         route->link_list.push_back(currentRouter->black_links_[0]);
         if (latency)
           *latency += currentRouter->black_links_[0]->get_latency();
-        currentRouter = routers_[myCoords[0] * (num_chassis_per_group_ * num_blades_per_chassis_) + targetCoords[0]];
+        currentRouter = &routers_[myCoords[0] * (num_chassis_per_group_ * num_blades_per_chassis_) + targetCoords[0]];
       }
 
       // go to destination group - the only optical hop
-      route->link_list.push_back(currentRouter->blue_links_[0]);
+      route->link_list.push_back(currentRouter->blue_link_);
       if (latency)
-        *latency += currentRouter->blue_links_[0]->get_latency();
-      currentRouter = routers_[targetCoords[0] * (num_chassis_per_group_ * num_blades_per_chassis_) + myCoords[0]];
+        *latency += currentRouter->blue_link_->get_latency();
+      currentRouter = &routers_[targetCoords[0] * (num_chassis_per_group_ * num_blades_per_chassis_) + myCoords[0]];
     }
 
     // same group, but same blade ?
@@ -343,7 +313,7 @@ void DragonflyZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationA
       route->link_list.push_back(currentRouter->green_links_[targetCoords[2]]);
       if (latency)
         *latency += currentRouter->green_links_[targetCoords[2]]->get_latency();
-      currentRouter = routers_[targetCoords[0] * (num_chassis_per_group_ * num_blades_per_chassis_) + targetCoords[2]];
+      currentRouter = &routers_[targetCoords[0] * (num_chassis_per_group_ * num_blades_per_chassis_) + targetCoords[2]];
     }
 
     // same blade, but same chassis ?
index ae1556c..c277462 100644 (file)
@@ -373,7 +373,7 @@ void FatTreeZone::parse_specific_arguments(ClusterCreationArgs* cluster)
   // The first parts of topo_parameters should be the levels number
   try {
     this->levels_ = std::stoi(parameters[0]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("First parameter is not the amount of levels:") + parameters[0]);
   }
 
@@ -385,7 +385,7 @@ void FatTreeZone::parse_specific_arguments(ClusterCreationArgs* cluster)
   for (size_t i = 0; i < tmp.size(); i++) {
     try {
       this->num_children_per_node_.push_back(std::stoi(tmp[i]));
-    } catch (std::invalid_argument& ia) {
+    } catch (const std::invalid_argument&) {
       throw std::invalid_argument(std::string("Invalid lower level node number:") + tmp[i]);
     }
   }
@@ -398,7 +398,7 @@ void FatTreeZone::parse_specific_arguments(ClusterCreationArgs* cluster)
   for (size_t i = 0; i < tmp.size(); i++) {
     try {
       this->num_parents_per_node_.push_back(std::stoi(tmp[i]));
-    } catch (std::invalid_argument& ia) {
+    } catch (const std::invalid_argument&) {
       throw std::invalid_argument(std::string("Invalid upper level node number:") + tmp[i]);
     }
   }
@@ -411,7 +411,7 @@ void FatTreeZone::parse_specific_arguments(ClusterCreationArgs* cluster)
   for (size_t i = 0; i < tmp.size(); i++) {
     try {
       this->num_port_lower_level_.push_back(std::stoi(tmp[i]));
-    } catch (std::invalid_argument& ia) {
+    } catch (const std::invalid_argument&) {
       throw std::invalid_argument(std::string("Invalid lower level port number:") + tmp[i]);
     }
   }
@@ -445,7 +445,7 @@ FatTreeNode::FatTreeNode(ClusterCreationArgs* cluster, int id, int level, int po
 {
   LinkCreationArgs linkTemplate;
   if (cluster->limiter_link) {
-    linkTemplate.bandwidth = cluster->limiter_link;
+    linkTemplate.bandwidths.push_back(cluster->limiter_link);
     linkTemplate.latency   = 0;
     linkTemplate.policy    = s4u::Link::SharingPolicy::SHARED;
     linkTemplate.id        = "limiter_"+std::to_string(id);
@@ -453,7 +453,7 @@ FatTreeNode::FatTreeNode(ClusterCreationArgs* cluster, int id, int level, int po
     this->limiter_link_ = s4u::Link::by_name(linkTemplate.id)->get_impl();
   }
   if (cluster->loopback_bw || cluster->loopback_lat) {
-    linkTemplate.bandwidth = cluster->loopback_bw;
+    linkTemplate.bandwidths.push_back(cluster->loopback_bw);
     linkTemplate.latency   = cluster->loopback_lat;
     linkTemplate.policy    = s4u::Link::SharingPolicy::FATPIPE;
     linkTemplate.id        = "loopback_"+ std::to_string(id);
@@ -467,7 +467,7 @@ FatTreeLink::FatTreeLink(ClusterCreationArgs* cluster, FatTreeNode* downNode, Fa
 {
   static int uniqueId = 0;
   LinkCreationArgs linkTemplate;
-  linkTemplate.bandwidth = cluster->bw;
+  linkTemplate.bandwidths.push_back(cluster->bw);
   linkTemplate.latency   = cluster->lat;
   linkTemplate.policy    = cluster->sharing_policy; // sthg to do with that ?
   linkTemplate.id =
index e791ece..c7bb065 100644 (file)
@@ -8,6 +8,7 @@
 #include "src/surf/network_interface.hpp"
 #include "src/surf/xml/platf_private.hpp"
 #include "surf/surf.hpp"
+#include "xbt/string.hpp"
 
 #include <cfloat>
 #include <limits>
@@ -57,7 +58,7 @@ void FloydZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs*
   do {
     int pred = TO_FLOYD_PRED(src->id(), cur);
     if (pred == -1)
-      THROWF(arg_error, 0, "No route from '%s' to '%s'", src->get_cname(), dst->get_cname());
+      throw std::invalid_argument(xbt::string_printf("No route from '%s' to '%s'", src->get_cname(), dst->get_cname()));
     route_stack.push_back(TO_FLOYD_LINK(pred, cur));
     cur = pred;
   } while (cur != src->id());
index b87a8dd..670720c 100644 (file)
@@ -93,7 +93,7 @@ int NetZoneImpl::get_host_count()
 }
 
 simgrid::s4u::Host* NetZoneImpl::create_host(const char* name, const std::vector<double>& speed_per_pstate,
-                                             int coreAmount, std::map<std::string, std::string>* props)
+                                             int coreAmount, const std::map<std::string, std::string>* props)
 {
   simgrid::s4u::Host* res = new simgrid::s4u::Host(name);
 
@@ -105,8 +105,7 @@ simgrid::s4u::Host* NetZoneImpl::create_host(const char* name, const std::vector
   surf_cpu_model_pm->create_cpu(res, speed_per_pstate, coreAmount);
 
   if (props != nullptr)
-    for (auto const& kv : *props)
-      res->set_property(kv.first, kv.second);
+    res->set_properties(*props);
 
   simgrid::s4u::Host::on_creation(*res); // notify the signal
 
index dd4e9a3..a1001e6 100644 (file)
@@ -40,7 +40,7 @@ void TorusZone::create_links_for_node(ClusterCreationArgs* cluster, int id, int
     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.bandwidths.push_back(cluster->bw);
     link.latency   = cluster->lat;
     link.policy    = cluster->sharing_policy;
     sg_platf_new_link(&link);
index 5eb0694..818bffe 100644 (file)
@@ -73,8 +73,10 @@ void VivaldiZone::set_peer_link(NetPoint* netpoint, double bw_in, double bw_out,
 
   std::string link_up      = "link_" + netpoint->get_name() + "_UP";
   std::string link_down    = "link_" + netpoint->get_name() + "_DOWN";
-  resource::LinkImpl* linkUp   = network_model_->create_link(link_up, bw_out, 0, s4u::Link::SharingPolicy::SHARED);
-  resource::LinkImpl* linkDown = network_model_->create_link(link_down, bw_in, 0, s4u::Link::SharingPolicy::SHARED);
+  resource::LinkImpl* linkUp =
+      network_model_->create_link(link_up, std::vector<double>(1, bw_out), 0, s4u::Link::SharingPolicy::SHARED);
+  resource::LinkImpl* linkDown =
+      network_model_->create_link(link_down, std::vector<double>(1, bw_in), 0, s4u::Link::SharingPolicy::SHARED);
   private_links_.insert({netpoint->id(), {linkUp, linkDown}});
 }
 
index a7658e6..d14040e 100644 (file)
 namespace simgrid {
 namespace mc {
 
-/** Process index used when no process is available (SMPI privatization)
- *
- *  The expected behavior is that if a process index is needed it will fail.
- * */
-const int ProcessIndexMissing = -1;
-
-/** Process index used when we don't care about the process index (SMPI privatization)
- * */
-const int ProcessIndexDisabled = -2;
-
-/** Constant used when any process will do (SMPI privatization)
- *
- *  Note: This is is index of the first process.
- */
-const int ProcessIndexAny = 0;
-
 /** Options for read operations
  *
  *  This is a set of flags managed with bitwise operators. Only the
@@ -116,35 +100,27 @@ public:
    *  @param buffer        target buffer for the data
    *  @param size          number of bytes to read
    *  @param address       remote source address of the data
-   *  @param process_index which process (used for SMPI privatization)
    *  @param options
    */
-  virtual const void* read_bytes(void* buffer, std::size_t size,
-    RemotePtr<void> address, int process_index = ProcessIndexAny,
-    ReadOptions options = ReadOptions::none()) const = 0;
+  virtual void* read_bytes(void* buffer, std::size_t size, RemotePtr<void> address,
+                           ReadOptions options = ReadOptions::none()) const = 0;
 
   /** Read a given data structure from the address space */
-  template<class T> inline
-  void read(T *buffer, RemotePtr<T> ptr, int process_index = ProcessIndexAny) const
-  {
-    this->read_bytes(buffer, sizeof(T), ptr, process_index);
-  }
+  template <class T> inline void read(T* buffer, RemotePtr<T> ptr) const { this->read_bytes(buffer, sizeof(T), ptr); }
 
-  template<class T> inline
-  void read(Remote<T>& buffer, RemotePtr<T> ptr, int process_index = ProcessIndexAny) const
+  template <class T> inline void read(Remote<T>& buffer, RemotePtr<T> ptr) const
   {
-    this->read_bytes(buffer.getBuffer(), sizeof(T), ptr, process_index);
+    this->read_bytes(buffer.get_buffer(), sizeof(T), ptr);
   }
 
-  /** Read a given data structure from the addres space
+  /** Read a given data structure from the address space
    *
    *  This version returns by value.
    */
-  template<class T> inline
-  Remote<T> read(RemotePtr<T> ptr, int process_index = ProcessIndexMissing) const
+  template <class T> inline Remote<T> read(RemotePtr<T> ptr) const
   {
     Remote<T> res;
-    this->read_bytes(&res, sizeof(T), ptr, process_index);
+    this->read_bytes(&res, sizeof(T), ptr);
     return res;
   }
 
diff --git a/src/mc/DwarfExpression.cpp b/src/mc/DwarfExpression.cpp
deleted file mode 100644 (file)
index 31852a6..0000000
+++ /dev/null
@@ -1,278 +0,0 @@
-/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include <cstddef>
-#include <cstdint>
-
-#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/mc_dwarf.hpp"
-#include "src/mc/mc_private.hpp"
-
-using simgrid::mc::remote;
-
-namespace simgrid {
-namespace dwarf {
-
-void execute(
-  const Dwarf_Op* ops, std::size_t n,
-  const ExpressionContext& context, ExpressionStack& stack)
-{
-  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) {
-
-      // Registers:
-
-    case DW_OP_breg0:
-    case DW_OP_breg1:
-    case DW_OP_breg2:
-    case DW_OP_breg3:
-    case DW_OP_breg4:
-    case DW_OP_breg5:
-    case DW_OP_breg6:
-    case DW_OP_breg7:
-    case DW_OP_breg8:
-    case DW_OP_breg9:
-    case DW_OP_breg10:
-    case DW_OP_breg11:
-    case DW_OP_breg12:
-    case DW_OP_breg13:
-    case DW_OP_breg14:
-    case DW_OP_breg15:
-    case DW_OP_breg16:
-    case DW_OP_breg17:
-    case DW_OP_breg18:
-    case DW_OP_breg19:
-    case DW_OP_breg20:
-    case DW_OP_breg21:
-    case DW_OP_breg22:
-    case DW_OP_breg23:
-    case DW_OP_breg24:
-    case DW_OP_breg25:
-    case DW_OP_breg26:
-    case DW_OP_breg27:
-    case DW_OP_breg28:
-    case DW_OP_breg29:
-    case DW_OP_breg30:
-    case DW_OP_breg31:{
-        // Push register + constant:
-        int register_id = simgrid::dwarf::dwarf_register_to_libunwind(
-          op->atom - DW_OP_breg0);
-        unw_word_t res;
-        if (not context.cursor)
-          throw evaluation_error("Missing stack context");
-        unw_get_reg(context.cursor, register_id, &res);
-        stack.push(res + op->number);
-        break;
-      }
-
-      // Push the CFA (Canonical Frame Address):
-    case DW_OP_call_frame_cfa:
-      {
-        /* See 6.4 of DWARF4 (http://dwarfstd.org/doc/DWARF4.pdf#page=140):
-         *
-         * > Typically, the CFA is defined to be the value of the stack
-         * > pointer at the call site in the previous frame (which may be
-         * > different from its value on entry to the current frame).
-         *
-         * We need to unwind the frame in order to get the SP of the parent
-         * frame.
-         *
-         * Warning: the CFA returned by libunwind (UNW_X86_64_RSP, etc.)
-         * is the SP of the *current* frame. */
-
-        if (not context.cursor)
-          throw evaluation_error("Missint cursor");
-
-        // Get frame:
-        unw_cursor_t cursor = *(context.cursor);
-        unw_step(&cursor);
-
-        unw_word_t res;
-        unw_get_reg(&cursor, UNW_REG_SP, &res);
-        stack.push(res);
-        break;
-      }
-
-      // Frame base:
-
-    case DW_OP_fbreg:
-      stack.push((std::uintptr_t) context.frame_base + op->number);
-      break;
-
-      // ***** Constants:
-
-      // Short constant literals:
-    case DW_OP_lit0:
-    case DW_OP_lit1:
-    case DW_OP_lit2:
-    case DW_OP_lit3:
-    case DW_OP_lit4:
-    case DW_OP_lit5:
-    case DW_OP_lit6:
-    case DW_OP_lit7:
-    case DW_OP_lit8:
-    case DW_OP_lit9:
-    case DW_OP_lit10:
-    case DW_OP_lit11:
-    case DW_OP_lit12:
-    case DW_OP_lit13:
-    case DW_OP_lit14:
-    case DW_OP_lit15:
-    case DW_OP_lit16:
-    case DW_OP_lit17:
-    case DW_OP_lit18:
-    case DW_OP_lit19:
-    case DW_OP_lit20:
-    case DW_OP_lit21:
-    case DW_OP_lit22:
-    case DW_OP_lit23:
-    case DW_OP_lit24:
-    case DW_OP_lit25:
-    case DW_OP_lit26:
-    case DW_OP_lit27:
-    case DW_OP_lit28:
-    case DW_OP_lit29:
-    case DW_OP_lit30:
-    case DW_OP_lit31:
-      // Push a literal/constant on the stack:
-      stack.push(atom - DW_OP_lit0);
-      break;
-
-      // Address from the base address of this ELF object.
-      // Push the address on the stack (base_address + argument).
-    case DW_OP_addr: {
-      if (not context.object_info)
-        throw evaluation_error("No base address");
-      Dwarf_Off addr = (Dwarf_Off) (std::uintptr_t)
-        context.object_info->base_address() + op->number;
-      stack.push(addr);
-      break;
-    }
-
-      // General constants:
-      // Push the constant argument on the stack.
-    case DW_OP_const1u:
-    case DW_OP_const2u:
-    case DW_OP_const4u:
-    case DW_OP_const8u:
-    case DW_OP_const1s:
-    case DW_OP_const2s:
-    case DW_OP_const4s:
-    case DW_OP_const8s:
-    case DW_OP_constu:
-    case DW_OP_consts:
-      stack.push(op->number);
-      break;
-
-      // ***** Stack manipulation:
-
-      // Push another copy/duplicate the value at the top of the stack:
-    case DW_OP_dup:
-      stack.dup();
-      break;
-
-      // Pop/drop the top of the stack:
-    case DW_OP_drop:
-      stack.pop();
-      break;
-
-    case DW_OP_swap:
-      stack.swap();
-      break;
-
-      // Duplicate the value under the top of the stack:
-    case DW_OP_over:
-      stack.push(stack.top(1));
-      break;
-
-      // ***** Operations:
-      // Those usually take the top of the stack and the next value as argument
-      // and replace the top of the stack with the computed value
-      // (stack.top() += stack.before_top()).
-
-    case DW_OP_plus:
-      first  = stack.pop();
-      second = stack.pop();
-      stack.push(first + second);
-      break;
-
-    case DW_OP_mul:
-      first  = stack.pop();
-      second = stack.pop();
-      stack.push(first * second);
-      break;
-
-    case DW_OP_plus_uconst:
-      stack.top() += op->number;
-      break;
-
-    case DW_OP_not:
-      stack.top() = ~stack.top();
-      break;
-
-    case DW_OP_neg:
-      stack.top() = - (intptr_t) stack.top();
-      break;
-
-    case DW_OP_minus:
-      first  = stack.pop();
-      second = stack.pop();
-      stack.push(second - first);
-      break;
-
-    case DW_OP_and:
-      first  = stack.pop();
-      second = stack.pop();
-      stack.push(first & second);
-      break;
-
-    case DW_OP_or:
-      first  = stack.pop();
-      second = stack.pop();
-      stack.push(first | second);
-      break;
-
-    case DW_OP_xor:
-      first  = stack.pop();
-      second = stack.pop();
-      stack.push(first ^ second);
-      break;
-
-    case DW_OP_nop:
-      break;
-
-      // ***** Deference (memory fetch)
-
-    case DW_OP_deref_size:
-      throw evaluation_error("Unsupported operation");
-
-    case DW_OP_deref:
-      // Computed address:
-      if (not context.address_space)
-        throw evaluation_error("Missing address space");
-      context.address_space->read_bytes(
-        &stack.top(), sizeof(uintptr_t), remote(stack.top()),
-        context.process_index);
-      break;
-
-      // Not handled:
-    default:
-      throw evaluation_error("Unsupported operation");
-    }
-
-  }
-}
-
-}
-}
index 439e677..2b1d6d9 100644 (file)
@@ -3,32 +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 <cassert>
-
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/socket.h>
-#include <sys/ptrace.h>
-
-#include <memory>
-#include <system_error>
-
-#include "xbt/automaton.h"
-#include "xbt/automaton.hpp"
-#include "xbt/log.h"
-#include "xbt/system_error.hpp"
-
-#include "simgrid/sg_config.hpp"
-
 #include "src/mc/ModelChecker.hpp"
+#include "src/mc/Session.hpp"
 #include "src/mc/Transition.hpp"
 #include "src/mc/checker/Checker.hpp"
+#include "src/mc/mc_config.hpp"
 #include "src/mc/mc_exit.hpp"
 #include "src/mc/mc_private.hpp"
-#include "src/mc/mc_record.hpp"
 #include "src/mc/remote/RemoteClient.hpp"
-#include "src/mc/remote/mc_protocol.h"
-#include "src/mc/sosp/PageStore.hpp"
+#include "xbt/automaton.hpp"
+#include "xbt/system_error.hpp"
+
+#include <sys/ptrace.h>
+#include <sys/wait.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_ModelChecker, mc, "ModelChecker");
 
@@ -51,7 +38,6 @@ ModelChecker::ModelChecker(std::unique_ptr<RemoteClient> process)
     , signal_event_(nullptr)
     , page_store_(500)
     , process_(std::move(process))
-    , parent_snapshot_(nullptr)
 {
 
 }
@@ -67,17 +53,12 @@ ModelChecker::~ModelChecker() {
 
 void ModelChecker::start()
 {
-  const pid_t pid = process_->pid();
-
   base_ = event_base_new();
   event_callback_fn event_callback = [](evutil_socket_t fd, short events, void *arg)
   {
     ((ModelChecker *)arg)->handle_events(fd, events);
   };
-  socket_event_ = event_new(base_,
-                            process_->getChannel().getSocket(),
-                            EV_READ|EV_PERSIST,
-                            event_callback, this);
+  socket_event_ = event_new(base_, process_->get_channel().get_socket(), EV_READ | EV_PERSIST, event_callback, this);
   event_add(socket_event_, NULL);
   signal_event_ = event_new(base_,
                             SIGCHLD,
@@ -89,6 +70,8 @@ void ModelChecker::start()
   int status;
 
   // The model-checked process SIGSTOP itself to signal it's ready:
+  const pid_t pid = process_->pid();
+
   pid_t res = waitpid(pid, &status, WAITPID_CHECKED_FLAGS);
   if (res < 0 || not WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP)
     xbt_die("Could not wait model-checked process");
@@ -143,7 +126,7 @@ void ModelChecker::shutdown()
 
 void ModelChecker::resume(simgrid::mc::RemoteClient& process)
 {
-  int res = process.getChannel().send(MC_MESSAGE_CONTINUE);
+  int res = process.get_channel().send(MC_MESSAGE_CONTINUE);
   if (res)
     throw simgrid::xbt::errno_error();
   process.clear_cache();
@@ -158,17 +141,19 @@ static void MC_report_crash(int status)
     XBT_INFO("From signal: %s", strsignal(WTERMSIG(status)));
   else if (WIFEXITED(status))
     XBT_INFO("From exit: %i", WEXITSTATUS(status));
-  if (WCOREDUMP(status))
-    XBT_INFO("A core dump was generated by the system.");
-  else
-    XBT_INFO("No core dump was generated by the system.");
+  if (not xbt_log_no_loc)
+    XBT_INFO("%s core dump was generated by the system.", WCOREDUMP(status) ? "A" : "No");
   XBT_INFO("Counter-example execution trace:");
+  for (auto const& s : mc_model_checker->getChecker()->get_textual_trace())
+    XBT_INFO("  %s", s.c_str());
   simgrid::mc::dumpRecordPath();
-  for (auto const& s : mc_model_checker->getChecker()->getTextualTrace())
-    XBT_INFO("%s", s.c_str());
-  simgrid::mc::session->logState();
-  XBT_INFO("Stack trace:");
-  mc_model_checker->process().dumpStack();
+  simgrid::mc::session->log_state();
+  if (xbt_log_no_loc) {
+    XBT_INFO("Stack trace not displayed because you passed --log=no_loc");
+  } else {
+    XBT_INFO("Stack trace:");
+    mc_model_checker->process().dump_stack();
+  }
 }
 
 static void MC_report_assertion_error()
@@ -177,10 +162,10 @@ static void MC_report_assertion_error()
   XBT_INFO("*** PROPERTY NOT VALID ***");
   XBT_INFO("**************************");
   XBT_INFO("Counter-example execution trace:");
+  for (auto const& s : mc_model_checker->getChecker()->get_textual_trace())
+    XBT_INFO("  %s", s.c_str());
   simgrid::mc::dumpRecordPath();
-  for (auto const& s : mc_model_checker->getChecker()->getTextualTrace())
-    XBT_INFO("%s", s.c_str());
-  simgrid::mc::session->logState();
+  simgrid::mc::session->log_state();
 }
 
 bool ModelChecker::handle_message(char* buffer, ssize_t size)
@@ -265,7 +250,6 @@ bool ModelChecker::handle_message(char* buffer, ssize_t size)
   case MC_MESSAGE_ASSERTION_FAILED:
     MC_report_assertion_error();
     this->exit(SIMGRID_MC_EXIT_SAFETY);
-    break;
 
   default:
     xbt_die("Unexpected message from model-checked application");
@@ -287,7 +271,7 @@ void ModelChecker::handle_events(int fd, short events)
 {
   if (events == EV_READ) {
     char buffer[MC_MESSAGE_LENGTH];
-    ssize_t size = process_->getChannel().receive(buffer, sizeof(buffer), false);
+    ssize_t size = process_->get_channel().receive(buffer, sizeof(buffer), false);
     if (size == -1 && errno != EAGAIN)
       throw simgrid::xbt::errno_error();
     if (not handle_message(buffer, size)) {
@@ -354,7 +338,10 @@ void ModelChecker::handle_waitpid()
           xbt_die("Could not PTRACE_CONT");
       }
 
-      else if (WIFEXITED(status) || WIFSIGNALED(status)) {
+      else if (WIFSIGNALED(status)) {
+        MC_report_crash(status);
+        mc_model_checker->exit(SIMGRID_MC_EXIT_PROGRAM_CRASH);
+      } else if (WIFEXITED(status)) {
         XBT_DEBUG("Child process is over");
         this->process().terminate();
       }
@@ -380,9 +367,9 @@ void ModelChecker::handle_simcall(Transition const& transition)
   s_mc_message_simcall_handle_t m;
   memset(&m, 0, sizeof(m));
   m.type  = MC_MESSAGE_SIMCALL_HANDLE;
-  m.pid   = transition.pid;
-  m.value = transition.argument;
-  this->process_->getChannel().send(m);
+  m.pid   = transition.pid_;
+  m.value = transition.argument_;
+  this->process_->get_channel().send(m);
   this->process_->clear_cache();
   if (this->process_->running())
     event_base_dispatch(base_);
@@ -391,10 +378,10 @@ void ModelChecker::handle_simcall(Transition const& transition)
 bool ModelChecker::checkDeadlock()
 {
   int res;
-  if ((res = this->process().getChannel().send(MC_MESSAGE_DEADLOCK_CHECK)))
+  if ((res = this->process().get_channel().send(MC_MESSAGE_DEADLOCK_CHECK)))
     xbt_die("Could not check deadlock state");
   s_mc_message_int_t message;
-  ssize_t s = mc_model_checker->process().getChannel().receive(message);
+  ssize_t s = mc_model_checker->process().get_channel().receive(message);
   if (s == -1)
     xbt_die("Could not receive message");
   if (s != sizeof(message) || message.type != MC_MESSAGE_DEADLOCK_CHECK_REPLY)
index e68ce22..d5016d3 100644 (file)
@@ -6,7 +6,8 @@
 #ifndef SIMGRID_MC_MODEL_CHECKER_HPP
 #define SIMGRID_MC_MODEL_CHECKER_HPP
 
-#include <sys/types.h>
+#include "src/mc/sosp/PageStore.hpp"
+#include "xbt/base.h"
 
 #include <memory>
 #include <set>
 
 #include <event2/event.h>
 
-#include <sys/types.h>
-
-#include "src/mc/mc_forward.hpp"
-#include "src/mc/remote/mc_protocol.h"
-#include "src/mc/sosp/PageStore.hpp"
-
 namespace simgrid {
 namespace mc {
 
@@ -37,7 +32,6 @@ class ModelChecker {
   std::unique_ptr<RemoteClient> process_;
   Checker* checker_ = nullptr;
 public:
-  std::shared_ptr<simgrid::mc::Snapshot> parent_snapshot_;
 
   ModelChecker(ModelChecker const&) = delete;
   ModelChecker& operator=(ModelChecker const&) = delete;
@@ -50,10 +44,6 @@ public:
     return page_store_;
   }
 
-  std::string const& get_host_name(const char* hostname)
-  {
-    return *this->hostnames_.insert(hostname).first;
-  }
   std::string const& get_host_name(std::string const& hostname)
   {
     return *this->hostnames_.insert(hostname).first;
@@ -66,7 +56,7 @@ public:
   void handle_events(int fd, short events);
   void wait_for_requests();
   void handle_simcall(Transition const& transition);
-  void exit(int status);
+  XBT_ATTRIB_NORETURN void exit(int status);
 
   bool checkDeadlock();
 
diff --git a/src/mc/ObjectInformation.cpp b/src/mc/ObjectInformation.cpp
deleted file mode 100644 (file)
index 1f5e703..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/* Copyright (c) 2014-2019. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is 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 <vector>
-
-#include "src/mc/Frame.hpp"
-#include "src/mc/ObjectInformation.hpp"
-#include "src/mc/Variable.hpp"
-
-namespace simgrid {
-namespace mc {
-
-/* For an executable object, addresses are virtual address
- * (there is no offset) i.e.
- * \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
- * object must be used as offset
- * i.e. \f$\text{virtual address} = \text{shared object base address}
- *             + \text{dwarf address}\f$.
- */
-void *ObjectInformation::base_address() const
-{
-  // For an executable (more precisely for a ET_EXEC) the base it 0:
-  if (this->executable())
-    return nullptr;
-
-  // For an a shared-object (ET_DYN, including position-independant executables)
-  // the base address is its lowest address:
-  void *result = this->start_exec;
-  if (this->start_rw != nullptr && result > (void *) this->start_rw)
-    result = this->start_rw;
-  if (this->start_ro != nullptr && result > (void *) this->start_ro)
-    result = this->start_ro;
-  return result;
-}
-
-simgrid::mc::Frame* ObjectInformation::find_function(const void *ip) const
-{
-  /* This is implemented by binary search on a sorted array.
-   *
-   * We do quite a lot of those so we want this to be cache efficient.
-   * We pack the only information we need in the index entries in order
-   * to successfully do the binary search. We do not need the high_pc
-   * during the binary search (only at the end) so it is not included
-   * in the index entry. We could use parallel arrays as well.
-   *
-   * We cannot really use the std:: algorithm for this.
-   * We could use std::binary_search by including the high_pc inside
-   * the FunctionIndexEntry.
-   */
-  const simgrid::mc::FunctionIndexEntry* base =
-    this->functions_index.data();
-  int i = 0;
-  int j = this->functions_index.size() - 1;
-  while (j >= i) {
-    int k = i + ((j - i) / 2);
-
-    /* In most of the search, we do not dereference the base[k].function.
-     * This way the memory accesses are located in the base[k] array. */
-    if (ip < base[k].low_pc)
-      j = k - 1;
-    else if (k < j && ip >= base[k + 1].low_pc)
-      i = k + 1;
-
-    /* At this point, the search is over.
-     * Either we have found the correct function or we do not know
-     * any function corresponding to this instruction address.
-     * Only at the point do we dereference the function pointer. */
-    else if ((std::uint64_t) ip < base[k].function->range.end())
-      return base[k].function;
-    else
-      return nullptr;
-  }
-  return nullptr;
-}
-
-simgrid::mc::Variable* ObjectInformation::find_variable(const char* name) const
-{
-  for (simgrid::mc::Variable& variable : this->global_variables)
-    if(variable.name == name)
-      return &variable;
-  return nullptr;
-}
-
-void ObjectInformation::remove_global_variable(const char* name)
-{
-  typedef std::vector<Variable>::size_type size_type;
-
-  if (this->global_variables.empty())
-    return;
-
-  // Binary search:
-  size_type first = 0;
-  size_type last = this->global_variables.size() - 1;
-
-  while (first <= last) {
-    size_type cursor = first + (last - first) / 2;
-    simgrid::mc::Variable& current_var = this->global_variables[cursor];
-    int cmp = current_var.name.compare(name);
-
-    if (cmp == 0) {
-
-      // Find the whole range:
-      first = cursor;
-      while (first != 0 && this->global_variables[first - 1].name == name)
-        first--;
-      size_type size = this->global_variables.size();
-      last           = cursor;
-      while (last != size - 1 && this->global_variables[last + 1].name == name)
-        last++;
-
-      // Remove the whole range:
-      this->global_variables.erase(
-        this->global_variables.begin() + first,
-        this->global_variables.begin() + last + 1);
-
-      return;
-    } else if (cmp < 0)
-      first = cursor + 1;
-    else if (cursor != 0)
-      last = cursor - 1;
-    else
-      break;
-  }
-}
-
-/** Ignore a local variable in a scope
- *
- *  Ignore all instances of variables with a given name in
- *  any (possibly inlined) subprogram with a given namespaced
- *  name.
- *
- *  @param var_name        Name of the local variable to ignore
- *  @param subprogram_name Name of the subprogram to ignore (nullptr for any)
- *  @param subprogram      (possibly inlined) Subprogram of the scope current scope
- *  @param scope           Current scope
- */
-static void remove_local_variable(simgrid::mc::Frame& scope,
-                            const char *var_name,
-                            const char *subprogram_name,
-                            simgrid::mc::Frame const& subprogram)
-{
-  typedef std::vector<Variable>::size_type size_type;
-
-  // If the current subprogram matches the given name:
-  if ((subprogram_name == nullptr || (not subprogram.name.empty() && subprogram.name == subprogram_name)) &&
-      not scope.variables.empty()) {
-
-    // Try to find the variable and remove it:
-    size_type start = 0;
-    size_type end = scope.variables.size() - 1;
-
-    // Binary search:
-    while (start <= end) {
-      size_type cursor = start + (end - start) / 2;
-      simgrid::mc::Variable& current_var = scope.variables[cursor];
-      int compare = current_var.name.compare(var_name);
-      if (compare == 0) {
-        // Variable found, remove it:
-        scope.variables.erase(scope.variables.begin() + cursor);
-        break;
-      } else if (compare < 0)
-        start = cursor + 1;
-      else if (cursor != 0)
-        end = cursor - 1;
-      else
-        break;
-    }
-  }
-
-  // And recursive processing in nested scopes:
-  for (simgrid::mc::Frame& nested_scope : scope.scopes) {
-    // The new scope may be an inlined subroutine, in this case we want to use its
-    // namespaced name in recursive calls:
-    simgrid::mc::Frame const& nested_subprogram =
-        nested_scope.tag ==
-        DW_TAG_inlined_subroutine ? nested_scope : subprogram;
-    remove_local_variable(nested_scope, var_name, subprogram_name,
-                          nested_subprogram);
-  }
-}
-
-void ObjectInformation::remove_local_variable(
-  const char* var_name, const char* subprogram_name)
-{
-  for (auto& entry : this->subprograms)
-    simgrid::mc::remove_local_variable(entry.second,
-      var_name, subprogram_name, entry.second);
-}
-
-}
-}
index 3d62b73..a5721e3 100644 (file)
@@ -3,23 +3,18 @@
 /* This program is 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 <functional>
-
-#include "xbt/log.h"
-#include "xbt/system_error.hpp"
-#include <mc/mc.h>
-#include <simgrid/modelchecker.h>
-#include <simgrid/sg_config.hpp>
-
 #include "src/mc/Session.hpp"
 #include "src/mc/checker/Checker.hpp"
+#include "src/mc/mc_config.hpp"
 #include "src/mc/mc_private.hpp"
 #include "src/mc/mc_state.hpp"
+#include "xbt/log.h"
+#include "xbt/system_error.hpp"
 
-#include "src/smpi/include/private.hpp"
+#include <fcntl.h>
+#ifdef __linux__
+#include <sys/prctl.h>
+#endif
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_Session, mc, "Model-checker session");
 
@@ -29,71 +24,64 @@ namespace mc {
 static void setup_child_environment(int socket)
 {
 #ifdef __linux__
-  // Make sure we do not outlive our parent:
+  // Make sure we do not outlive our parent
   sigset_t mask;
   sigemptyset (&mask);
-  if (sigprocmask(SIG_SETMASK, &mask, nullptr) < 0)
-    throw simgrid::xbt::errno_error("Could not unblock signals");
-  if (prctl(PR_SET_PDEATHSIG, SIGHUP) != 0)
-    throw simgrid::xbt::errno_error("Could not PR_SET_PDEATHSIG");
+  xbt_assert(sigprocmask(SIG_SETMASK, &mask, nullptr) >= 0, "Could not unblock signals");
+  xbt_assert(prctl(PR_SET_PDEATHSIG, SIGHUP) == 0, "Could not PR_SET_PDEATHSIG");
 #endif
 
-  int res;
-
-  // Remove CLOEXEC in order to pass the socket to the exec-ed program:
+  // Remove CLOEXEC to pass the socket to the application
   int fdflags = fcntl(socket, F_GETFD, 0);
-  if (fdflags == -1 || fcntl(socket, F_SETFD, fdflags & ~FD_CLOEXEC) == -1)
-    throw simgrid::xbt::errno_error("Could not remove CLOEXEC for socket");
+  xbt_assert(fdflags != -1 && fcntl(socket, F_SETFD, fdflags & ~FD_CLOEXEC) != -1,
+             "Could not remove CLOEXEC for socket");
 
-  // Set environment:
+  // Set environment so that mmalloc gets used in application
   setenv(MC_ENV_VARIABLE, "1", 1);
 
-  // Disable lazy relocation in the model-checked process.
-  // We don't want the model-checked process to modify its .got.plt during
-  // snapshot.
+  // Disable lazy relocation in the model-checked process to prevent the application from
+  // modifying its .got.plt during snapshot.
   setenv("LC_BIND_NOW", "1", 1);
 
   char buffer[64];
-  res = std::snprintf(buffer, sizeof(buffer), "%i", socket);
-  if ((size_t) res >= sizeof(buffer) || res == -1)
-    std::abort();
+  int res = std::snprintf(buffer, sizeof(buffer), "%i", socket);
+  xbt_assert((size_t)res < sizeof(buffer) && res != -1);
   setenv(MC_ENV_SOCKET_FD, buffer, 1);
 }
 
-/** Execute some code in a forked process */
-template<class F>
-static inline
-pid_t do_fork(F code)
+Session::Session(const std::function<void()>& code)
 {
+#if HAVE_SMPI
+  xbt_assert(smpi_privatize_global_variables != SmpiPrivStrategies::MMAP,
+             "Please use the dlopen privatization schema when model-checking SMPI code");
+#endif
+
+  // Create a AF_LOCAL socketpair used for exchanging messages
+  // between the model-checker process (ourselves) and the model-checked
+  // process:
+  int sockets[2];
+  int res = socketpair(AF_LOCAL, SOCK_SEQPACKET | SOCK_CLOEXEC, 0, sockets);
+  xbt_assert(res != -1, "Could not create socketpair");
+
   pid_t pid = fork();
-  if (pid < 0)
-    throw simgrid::xbt::errno_error("Could not fork model-checked process");
-  if (pid != 0)
-    return pid;
+  xbt_assert(pid >= 0, "Could not fork model-checked process");
 
-  // Child-process:
-  try {
+  if (pid == 0) { // Child
+    ::close(sockets[1]);
+    setup_child_environment(sockets[0]);
     code();
-    _exit(EXIT_SUCCESS);
-  }
-  catch(...) {
-    // The callback should catch exceptions:
-    std::terminate();
+    xbt_die("The model-checked process failed to exec()");
   }
-}
 
-Session::Session(pid_t pid, int socket)
-{
-  std::unique_ptr<simgrid::mc::RemoteClient> process(new simgrid::mc::RemoteClient(pid, socket));
-#if HAVE_SMPI
-  // TODO, automatic detection of the config from the process
-  process->privatized(smpi_privatize_global_variables != SmpiPrivStrategies::NONE);
-#else
-  process->privatized(false);
-#endif
-  modelChecker_.reset(new simgrid::mc::ModelChecker(std::move(process)));
-  xbt_assert(mc_model_checker == nullptr);
-  mc_model_checker = modelChecker_.get();
+  // Parent (model-checker):
+  ::close(sockets[0]);
+
+  xbt_assert(mc_model_checker == nullptr, "Did you manage to start the MC twice in this process?");
+
+  std::unique_ptr<simgrid::mc::RemoteClient> process(new simgrid::mc::RemoteClient(pid, sockets[1]));
+  model_checker_.reset(new simgrid::mc::ModelChecker(std::move(process)));
+
+  mc_model_checker = model_checker_.get();
   mc_model_checker->start();
 }
 
@@ -104,25 +92,25 @@ Session::~Session()
 
 void Session::initialize()
 {
-  xbt_assert(initialSnapshot_ == nullptr);
+  xbt_assert(initial_snapshot_ == nullptr);
   mc_model_checker->wait_for_requests();
-  initialSnapshot_ = simgrid::mc::take_snapshot(0);
+  initial_snapshot_ = std::make_shared<simgrid::mc::Snapshot>(0);
 }
 
 void Session::execute(Transition const& transition)
 {
-  modelChecker_->handle_simcall(transition);
-  modelChecker_->wait_for_requests();
+  model_checker_->handle_simcall(transition);
+  model_checker_->wait_for_requests();
 }
 
-void Session::restoreInitialState()
+void Session::restore_initial_state()
 {
-  simgrid::mc::restore_snapshot(this->initialSnapshot_);
+  this->initial_snapshot_->restore(&mc_model_checker->process());
 }
 
-void Session::logState()
+void Session::log_state()
 {
-  mc_model_checker->getChecker()->logState();
+  mc_model_checker->getChecker()->log_state();
 
   if (not _sg_mc_dot_output_file.get().empty()) {
     fprintf(dot_output, "}\n");
@@ -134,53 +122,12 @@ void Session::logState()
   }
 }
 
-// static
-Session* Session::fork(const std::function<void()>& code)
-{
-  // Create a AF_LOCAL socketpair used for exchanging messages
-  // between the model-checker process (ourselves) and the model-checked
-  // process:
-  int res;
-  int sockets[2];
-  res = socketpair(AF_LOCAL, SOCK_SEQPACKET | SOCK_CLOEXEC, 0, sockets);
-  if (res == -1)
-    throw simgrid::xbt::errno_error("Could not create socketpair");
-
-  pid_t pid = do_fork([sockets, &code] {
-    ::close(sockets[1]);
-    setup_child_environment(sockets[0]);
-    code();
-    xbt_die("The model-checked process failed to exec()");
-  });
-
-  // Parent (model-checker):
-  ::close(sockets[0]);
-
-  return new Session(pid, sockets[1]);
-}
-
-// static
-Session* Session::spawnv(const char *path, char *const argv[])
-{
-  return Session::fork([path, argv] {
-    execv(path, argv);
-  });
-}
-
-// static
-Session* Session::spawnvp(const char *file, char *const argv[])
-{
-  return Session::fork([file, argv] {
-    execvp(file, argv);
-  });
-}
-
 void Session::close()
 {
-  initialSnapshot_ = nullptr;
-  if (modelChecker_) {
-    modelChecker_->shutdown();
-    modelChecker_ = nullptr;
+  initial_snapshot_ = nullptr;
+  if (model_checker_) {
+    model_checker_->shutdown();
+    model_checker_   = nullptr;
     mc_model_checker = nullptr;
   }
 }
index 342e37c..ab21a05 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2016-2019. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2016-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program 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,22 +6,10 @@
 #ifndef SIMGRID_MC_SESSION_HPP
 #define SIMGRID_MC_SESSION_HPP
 
-#ifdef __linux__
-#include <sys/prctl.h>
-#endif
-
-#include "xbt/sysdep.h"
-#include "xbt/system_error.hpp"
-#include <sys/socket.h>
-#include <sys/types.h>
+#include "src/mc/ModelChecker.hpp"
 
 #include <functional>
 
-#include "xbt/log.h"
-
-#include "src/mc/mc_forward.hpp"
-#include "src/mc/ModelChecker.hpp"
-
 namespace simgrid {
 namespace mc {
 
@@ -34,54 +21,36 @@ namespace mc {
  *  algorithms should be able to be written in high-level languages
  *  (e.g. Python) using bindings on this interface.
  */
-class Session {
+class XBT_PUBLIC Session {
 private:
-  std::unique_ptr<ModelChecker> modelChecker_;
-  std::shared_ptr<simgrid::mc::Snapshot> initialSnapshot_;
-
-  Session(pid_t pid, int socket);
+  std::unique_ptr<ModelChecker> model_checker_;
+  std::shared_ptr<simgrid::mc::Snapshot> initial_snapshot_;
 
   // No copy:
   Session(Session const&) = delete;
   Session& operator=(Session const&) = delete;
 
 public:
-  ~Session();
-  void close();
-
-  void initialize();
-  void execute(Transition const& transition);
-  void logState();
-
-  void restoreInitialState();
-
-  // static constructors
-
-  /** Create a new session by forking
+  /** Create a new session by executing the provided code in a fork()
    *
    *  This sets up the environment for the model-checked process
-   *  (environoment variables, sockets, etc.).
+   *  (environment variables, sockets, etc.).
    *
-   *  The code is expected to `exec` the model-checker program.
+   *  The code is expected to `exec` the model-checked application.
    */
-  static Session* fork(const std::function<void()>& code);
+  explicit Session(const std::function<void()>& code);
 
-  /** Spawn a model-checked process
-   *
-   *  @param path full path of the executable
-   *  @param argv arguments for the model-checked process (NULL-terminated)
-   */
-  static Session* spawnv(const char *path, char *const argv[]);
+  ~Session();
+  void close();
 
-  /** Spawn a model-checked process (using PATH)
-   *
-   *  @param file file name of the executable (found using `PATH`)
-   *  @param argv arguments for the model-checked process (NULL-terminated)
-   */
-  static Session* spawnvp(const char *file, char *const argv[]);
+  void initialize();
+  void execute(Transition const& transition);
+  void log_state();
+
+  void restore_initial_state();
 };
 
-// Temporary
+// Temporary :)
 extern simgrid::mc::Session* session;
 
 }
index d956ac1..a0a2813 100644 (file)
@@ -20,7 +20,7 @@ namespace mc {
  */
 class Transition {
 public:
-  int pid = 0;
+  int pid_ = 0;
 
   /* Which transition was executed for this simcall
    *
@@ -30,10 +30,10 @@ public:
    *
    * * random can produce different values.
    */
-  int argument = 0;
+  int argument_ = 0;
 };
 
-}
-}
+} // namespace mc
+} // namespace simgrid
 
 #endif
index 85bf68f..24e3c5c 100644 (file)
@@ -3,36 +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/mc/VisitedState.hpp"
+#include "src/mc/mc_private.hpp"
+
 #include <unistd.h>
 #include <sys/wait.h>
-
 #include <memory>
-
 #include <boost/range/algorithm.hpp>
 
-#include "xbt/log.h"
-#include "xbt/sysdep.h"
-
-#include "src/mc/VisitedState.hpp"
-#include "src/mc/mc_comm_pattern.hpp"
-#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");
 
 namespace simgrid {
 namespace mc {
 
-static int snapshot_compare(simgrid::mc::VisitedState* state1, simgrid::mc::VisitedState* state2)
-{
-  simgrid::mc::Snapshot* s1 = state1->system_state.get();
-  simgrid::mc::Snapshot* s2 = state2->system_state.get();
-  int num1 = state1->num;
-  int num2 = state2->num;
-  return snapshot_compare(num1, s1, num2, s2);
-}
-
 /** @brief Save the current state */
 VisitedState::VisitedState(unsigned long state_number) : num(state_number)
 {
@@ -43,7 +26,7 @@ VisitedState::VisitedState(unsigned long state_number) : num(state_number)
 
   this->actors_count = mc_model_checker->process().actors().size();
 
-  this->system_state = simgrid::mc::take_snapshot(state_number);
+  this->system_state = std::make_shared<simgrid::mc::Snapshot>(state_number);
   this->original_num = -1;
 }
 
@@ -63,22 +46,22 @@ void VisitedStates::prune()
 }
 
 /** @brief Checks whether a given state has already been visited by the algorithm. */
-std::unique_ptr<simgrid::mc::VisitedState> VisitedStates::addVisitedState(
-  unsigned long state_number, simgrid::mc::State* graph_state, bool compare_snpashots)
+std::unique_ptr<simgrid::mc::VisitedState>
+VisitedStates::addVisitedState(unsigned long state_number, simgrid::mc::State* graph_state, bool compare_snapshots)
 {
   std::unique_ptr<simgrid::mc::VisitedState> new_state =
     std::unique_ptr<simgrid::mc::VisitedState>(new VisitedState(state_number));
   graph_state->system_state = new_state->system_state;
-  XBT_DEBUG("Snapshot %p of visited state %d (exploration stack state %d)",
-    new_state->system_state.get(), new_state->num, graph_state->num);
+  XBT_DEBUG("Snapshot %p of visited state %d (exploration stack state %d)", new_state->system_state.get(),
+            new_state->num, graph_state->num_);
 
   auto range =
       boost::range::equal_range(states_, new_state.get(), simgrid::mc::DerefAndCompareByActorsCountAndUsedHeap());
 
-  if (compare_snpashots)
+  if (compare_snapshots)
     for (auto i = range.first; i != range.second; ++i) {
       auto& visited_state = *i;
-      if (snapshot_compare(visited_state.get(), new_state.get()) == 0) {
+      if (snapshot_equal(visited_state->system_state.get(), new_state->system_state.get())) {
         // The state has been visited:
 
         std::unique_ptr<simgrid::mc::VisitedState> old_state =
index 42afbee..ea116d9 100644 (file)
@@ -7,7 +7,7 @@
 #define SIMGRID_MC_VISITED_STATE_HPP
 
 #include "src/mc/mc_state.hpp"
-#include "src/mc/sosp/mc_snapshot.hpp"
+#include "src/mc/sosp/Snapshot.hpp"
 
 #include <cstddef>
 #include <memory>
@@ -31,7 +31,9 @@ class XBT_PRIVATE VisitedStates {
   std::vector<std::unique_ptr<simgrid::mc::VisitedState>> states_;
 public:
   void clear() { states_.clear(); }
-  std::unique_ptr<simgrid::mc::VisitedState> addVisitedState(unsigned long state_number, simgrid::mc::State* graph_state, bool compare_snpashots);
+  std::unique_ptr<simgrid::mc::VisitedState> addVisitedState(unsigned long state_number,
+                                                             simgrid::mc::State* graph_state, bool compare_snapshots);
+
 private:
   void prune();
 };
index 6ca26a6..b34fbce 100644 (file)
@@ -4,12 +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 <string>
-
-#include <xbt/asserts.h>
-
 #include "src/mc/checker/Checker.hpp"
 #include "src/mc/ModelChecker.hpp"
+#include "xbt/asserts.h"
 
 namespace simgrid {
 namespace mc {
index 96f5c36..c71f17e 100644 (file)
@@ -7,11 +7,7 @@
 #ifndef SIMGRID_MC_CHECKER_HPP
 #define SIMGRID_MC_CHECKER_HPP
 
-#include <functional>
-#include <memory>
-#include <string>
-
-#include "src/mc/Session.hpp"
+//#include "src/mc/Session.hpp"
 #include "src/mc/mc_forward.hpp"
 #include "src/mc/mc_record.hpp"
 
@@ -52,18 +48,19 @@ public:
   /** Show the current trace/stack
    *
    *  Could this be handled in the Session/ModelChecker instead? */
-  virtual RecordTrace getRecordTrace() = 0;
+  virtual RecordTrace get_record_trace() = 0;
 
   /** Generate a textual execution trace of the simulated application */
-  virtual std::vector<std::string> getTextualTrace() = 0;
+  virtual std::vector<std::string> get_textual_trace() = 0;
 
   /** Log additional information about the state of the model-checker */
-  virtual void logState() = 0;
+  virtual void log_state() = 0;
 
 protected:
-  Session& getSession() { return *session_; }
+  Session& get_session() { return *session_; }
 };
 
+// External constructors so that the types (and the types of their content) remain hidden
 XBT_PUBLIC Checker* createLivenessChecker(Session& session);
 XBT_PUBLIC Checker* createSafetyChecker(Session& session);
 XBT_PUBLIC Checker* createCommunicationDeterminismChecker(Session& session);
index f67819b..1302502 100644 (file)
@@ -5,14 +5,12 @@
 
 #include "src/mc/checker/CommunicationDeterminismChecker.hpp"
 #include "src/kernel/activity/MailboxImpl.hpp"
-#include "src/mc/VisitedState.hpp"
+#include "src/mc/Session.hpp"
+#include "src/mc/mc_config.hpp"
 #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"
 
 #if HAVE_SMPI
 #include "smpi_request.hpp"
@@ -26,8 +24,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_comm_determinism, mc, "Logging specific to MC
 
 /********** Global variables **********/
 
-xbt_dynar_t initial_communications_pattern;
-xbt_dynar_t incomplete_communications_pattern;
+std::vector<simgrid::mc::PatternCommunicationList> initial_communications_pattern;
+std::vector<std::vector<simgrid::mc::PatternCommunication*>> incomplete_communications_pattern;
 
 /********** Static functions ***********/
 
@@ -79,10 +77,10 @@ static char* print_determinism_result(e_mc_comm_pattern_difference_t diff, int p
     res = bprintf("%s Different destination for communication #%u", type, cursor);
     break;
   case DATA_SIZE_DIFF:
-    res = bprintf("%s\n Different data size for communication #%u", type, cursor);
+    res = bprintf("%s Different data size for communication #%u", type, cursor);
     break;
   case DATA_DIFF:
-    res = bprintf("%s\n Different data for communication #%u", type, cursor);
+    res = bprintf("%s Different data for communication #%u", type, cursor);
     break;
   default:
     res = nullptr;
@@ -98,10 +96,10 @@ static void update_comm_pattern(simgrid::mc::PatternCommunication* comm_pattern,
   // HACK, type punning
   simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_comm;
   mc_model_checker->process().read(temp_comm, comm_addr);
-  simgrid::kernel::activity::CommImpl* comm = temp_comm.getBuffer();
+  simgrid::kernel::activity::CommImpl* comm = temp_comm.get_buffer();
 
-  smx_actor_t src_proc   = mc_model_checker->process().resolveActor(simgrid::mc::remote(comm->src_actor_.get()));
-  smx_actor_t dst_proc   = mc_model_checker->process().resolveActor(simgrid::mc::remote(comm->dst_actor_.get()));
+  smx_actor_t src_proc   = mc_model_checker->process().resolve_actor(simgrid::mc::remote(comm->src_actor_.get()));
+  smx_actor_t dst_proc   = mc_model_checker->process().resolve_actor(simgrid::mc::remote(comm->dst_actor_.get()));
   comm_pattern->src_proc = src_proc->get_pid();
   comm_pattern->dst_proc = dst_proc->get_pid();
   comm_pattern->src_host = MC_smx_actor_get_host_name(src_proc);
@@ -121,23 +119,22 @@ namespace mc {
 void CommunicationDeterminismChecker::deterministic_comm_pattern(int process, simgrid::mc::PatternCommunication* comm,
                                                                  int backtracking)
 {
-  simgrid::mc::PatternCommunicationList* list =
-    xbt_dynar_get_as(initial_communications_pattern, process, simgrid::mc::PatternCommunicationList*);
+  simgrid::mc::PatternCommunicationList& list = initial_communications_pattern[process];
 
   if (not backtracking) {
-    e_mc_comm_pattern_difference_t diff = compare_comm_pattern(list->list[list->index_comm].get(), comm);
+    e_mc_comm_pattern_difference_t diff = compare_comm_pattern(list.list[list.index_comm].get(), comm);
 
     if (diff != NONE_DIFF) {
       if (comm->type == simgrid::mc::PatternCommunicationType::send) {
         this->send_deterministic = 0;
         if (this->send_diff != nullptr)
           xbt_free(this->send_diff);
-        this->send_diff = print_determinism_result(diff, process, comm, list->index_comm + 1);
+        this->send_diff = print_determinism_result(diff, process, comm, list.index_comm + 1);
       } else {
         this->recv_deterministic = 0;
         if (this->recv_diff != nullptr)
           xbt_free(this->recv_diff);
-        this->recv_diff = print_determinism_result(diff, process, comm, list->index_comm + 1);
+        this->recv_diff = print_determinism_result(diff, process, comm, list.index_comm + 1);
       }
       if (_sg_mc_send_determinism && not this->send_deterministic) {
         XBT_INFO("*********************************************************");
@@ -146,19 +143,23 @@ void CommunicationDeterminismChecker::deterministic_comm_pattern(int process, si
         XBT_INFO("%s", this->send_diff);
         xbt_free(this->send_diff);
         this->send_diff = nullptr;
-        simgrid::mc::session->logState();
+        simgrid::mc::session->log_state();
         mc_model_checker->exit(SIMGRID_MC_EXIT_NON_DETERMINISM);
       } else if (_sg_mc_comms_determinism && (not this->send_deterministic && not this->recv_deterministic)) {
         XBT_INFO("****************************************************");
         XBT_INFO("***** Non-deterministic communications pattern *****");
         XBT_INFO("****************************************************");
-        XBT_INFO("%s", this->send_diff);
-        XBT_INFO("%s", this->recv_diff);
-        xbt_free(this->send_diff);
-        this->send_diff = nullptr;
-        xbt_free(this->recv_diff);
-        this->recv_diff = nullptr;
-        simgrid::mc::session->logState();
+        if (this->send_diff) {
+          XBT_INFO("%s", this->send_diff);
+          xbt_free(this->send_diff);
+          this->send_diff = nullptr;
+        }
+        if (this->recv_diff) {
+          XBT_INFO("%s", this->recv_diff);
+          xbt_free(this->recv_diff);
+          this->recv_diff = nullptr;
+        }
+        simgrid::mc::session->log_state();
         mc_model_checker->exit(SIMGRID_MC_EXIT_NON_DETERMINISM);
       }
     }
@@ -171,12 +172,12 @@ void CommunicationDeterminismChecker::get_comm_pattern(smx_simcall_t request, e_
                                                        int backtracking)
 {
   const smx_actor_t issuer = MC_smx_simcall_get_issuer(request);
-  simgrid::mc::PatternCommunicationList* initial_pattern =
-      xbt_dynar_get_as(initial_communications_pattern, issuer->get_pid(), simgrid::mc::PatternCommunicationList*);
-  xbt_dynar_t incomplete_pattern = xbt_dynar_get_as(incomplete_communications_pattern, issuer->get_pid(), xbt_dynar_t);
+  const simgrid::mc::PatternCommunicationList& initial_pattern = initial_communications_pattern[issuer->get_pid()];
+  const std::vector<simgrid::mc::PatternCommunication*>& incomplete_pattern =
+      incomplete_communications_pattern[issuer->get_pid()];
 
   std::unique_ptr<simgrid::mc::PatternCommunication> pattern(new simgrid::mc::PatternCommunication());
-  pattern->index = initial_pattern->index_comm + xbt_dynar_length(incomplete_pattern);
+  pattern->index = initial_pattern.index_comm + incomplete_pattern.size();
 
   if (call_type == MC_CALL_TYPE_SEND) {
     /* Create comm pattern */
@@ -187,18 +188,19 @@ void CommunicationDeterminismChecker::get_comm_pattern(smx_simcall_t request, e_
     mc_model_checker->process().read(temp_synchro,
                                      remote(static_cast<simgrid::kernel::activity::CommImpl*>(pattern->comm_addr)));
     simgrid::kernel::activity::CommImpl* synchro =
-        static_cast<simgrid::kernel::activity::CommImpl*>(temp_synchro.getBuffer());
+        static_cast<simgrid::kernel::activity::CommImpl*>(temp_synchro.get_buffer());
 
-    char* remote_name = mc_model_checker->process().read<char*>(
-        RemotePtr<char*>((uint64_t)(synchro->mbox ? &synchro->mbox->name_ : &synchro->mbox_cpy->name_)));
+    char* remote_name = mc_model_checker->process().read<char*>(RemotePtr<char*>(
+        (uint64_t)(synchro->get_mailbox() ? &synchro->get_mailbox()->name_ : &synchro->mbox_cpy->name_)));
     pattern->rdv      = mc_model_checker->process().read_string(RemotePtr<char>(remote_name));
     pattern->src_proc =
-        mc_model_checker->process().resolveActor(simgrid::mc::remote(synchro->src_actor_.get()))->get_pid();
+        mc_model_checker->process().resolve_actor(simgrid::mc::remote(synchro->src_actor_.get()))->get_pid();
     pattern->src_host = MC_smx_actor_get_host_name(issuer);
 
 #if HAVE_SMPI
-    simgrid::smpi::Request mpi_request = mc_model_checker->process().read<simgrid::smpi::Request>(
-        RemotePtr<simgrid::smpi::Request>((std::uint64_t)simcall_comm_isend__get__data(request)));
+    simgrid::smpi::Request mpi_request;
+    mc_model_checker->process().read(
+        &mpi_request, remote(static_cast<simgrid::smpi::Request*>(simcall_comm_isend__get__data(request))));
     pattern->tag = mpi_request.tag();
 #endif
 
@@ -208,16 +210,13 @@ void CommunicationDeterminismChecker::get_comm_pattern(smx_simcall_t request, e_
     }
 #if HAVE_SMPI
     if(mpi_request.detached()){
-      if (not this->initial_communications_pattern_done) {
-        /* Store comm pattern */
-        simgrid::mc::PatternCommunicationList* list =
-            xbt_dynar_get_as(initial_communications_pattern, pattern->src_proc, simgrid::mc::PatternCommunicationList*);
-        list->list.push_back(std::move(pattern));
-      } else {
+      if (this->initial_communications_pattern_done) {
         /* Evaluate comm determinism */
         this->deterministic_comm_pattern(pattern->src_proc, pattern.get(), backtracking);
-        xbt_dynar_get_as(initial_communications_pattern, pattern->src_proc, simgrid::mc::PatternCommunicationList*)
-            ->index_comm++;
+        initial_communications_pattern[pattern->src_proc].index_comm++;
+      } else {
+        /* Store comm pattern */
+        initial_communications_pattern[pattern->src_proc].list.push_back(std::move(pattern));
       }
       return;
     }
@@ -228,66 +227,56 @@ void CommunicationDeterminismChecker::get_comm_pattern(smx_simcall_t request, e_
 
 #if HAVE_SMPI
     simgrid::smpi::Request mpi_request;
-    mc_model_checker->process().read(&mpi_request,
-                                     remote((simgrid::smpi::Request*)simcall_comm_irecv__get__data(request)));
+    mc_model_checker->process().read(
+        &mpi_request, remote(static_cast<simgrid::smpi::Request*>(simcall_comm_irecv__get__data(request))));
     pattern->tag = mpi_request.tag();
 #endif
 
     simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_comm;
     mc_model_checker->process().read(temp_comm,
                                      remote(static_cast<simgrid::kernel::activity::CommImpl*>(pattern->comm_addr)));
-    simgrid::kernel::activity::CommImpl* comm = temp_comm.getBuffer();
+    simgrid::kernel::activity::CommImpl* comm = temp_comm.get_buffer();
 
     char* remote_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));
+    mc_model_checker->process().read(&remote_name,
+                                     remote(comm->get_mailbox()
+                                                ? &simgrid::xbt::string::to_string_data(comm->get_mailbox()->name_).data
+                                                : &simgrid::xbt::string::to_string_data(comm->mbox_cpy->name_).data));
     pattern->rdv      = mc_model_checker->process().read_string(RemotePtr<char>(remote_name));
     pattern->dst_proc =
-        mc_model_checker->process().resolveActor(simgrid::mc::remote(comm->dst_actor_.get()))->get_pid();
+        mc_model_checker->process().resolve_actor(simgrid::mc::remote(comm->dst_actor_.get()))->get_pid();
     pattern->dst_host = MC_smx_actor_get_host_name(issuer);
   } else
     xbt_die("Unexpected call_type %i", (int) call_type);
 
   XBT_DEBUG("Insert incomplete comm pattern %p for process %ld", pattern.get(), issuer->get_pid());
-  xbt_dynar_t dynar = xbt_dynar_get_as(incomplete_communications_pattern, issuer->get_pid(), xbt_dynar_t);
-  simgrid::mc::PatternCommunication* pattern2 = pattern.release();
-  xbt_dynar_push(dynar, &pattern2);
+  incomplete_communications_pattern[issuer->get_pid()].push_back(pattern.release());
 }
 
 void CommunicationDeterminismChecker::complete_comm_pattern(
     simgrid::mc::RemotePtr<simgrid::kernel::activity::CommImpl> comm_addr, unsigned int issuer, int backtracking)
 {
-  simgrid::mc::PatternCommunication* current_comm_pattern;
-  unsigned int cursor = 0;
-  std::unique_ptr<simgrid::mc::PatternCommunication> comm_pattern;
-  int completed = 0;
-
   /* Complete comm pattern */
-  xbt_dynar_foreach(xbt_dynar_get_as(incomplete_communications_pattern, issuer, xbt_dynar_t), cursor, current_comm_pattern)
-    if (remote(current_comm_pattern->comm_addr) == comm_addr) {
-      update_comm_pattern(current_comm_pattern, comm_addr);
-      completed = 1;
-      simgrid::mc::PatternCommunication* temp;
-      xbt_dynar_remove_at(xbt_dynar_get_as(incomplete_communications_pattern, issuer, xbt_dynar_t), cursor, &temp);
-      comm_pattern.reset(temp);
-      XBT_DEBUG("Remove incomplete comm pattern for process %u at cursor %u", issuer, cursor);
-      break;
-    }
-
-  if (not completed)
+  std::vector<simgrid::mc::PatternCommunication*>& incomplete_pattern = incomplete_communications_pattern[issuer];
+  auto current_comm_pattern = std::find_if(
+      begin(incomplete_pattern), end(incomplete_pattern),
+      [&comm_addr](simgrid::mc::PatternCommunication* comm) { return remote(comm->comm_addr) == comm_addr; });
+  if (current_comm_pattern == std::end(incomplete_pattern))
     xbt_die("Corresponding communication not found!");
 
-  simgrid::mc::PatternCommunicationList* pattern =
-      xbt_dynar_get_as(initial_communications_pattern, issuer, simgrid::mc::PatternCommunicationList*);
+  update_comm_pattern(*current_comm_pattern, comm_addr);
+  std::unique_ptr<simgrid::mc::PatternCommunication> comm_pattern(*current_comm_pattern);
+  XBT_DEBUG("Remove incomplete comm pattern for process %u at cursor %zd", issuer,
+            std::distance(begin(incomplete_pattern), current_comm_pattern));
+  incomplete_pattern.erase(current_comm_pattern);
 
-  if (not this->initial_communications_pattern_done)
-    /* Store comm pattern */
-    pattern->list.push_back(std::move(comm_pattern));
-  else {
+  if (this->initial_communications_pattern_done) {
     /* Evaluate comm determinism */
     this->deterministic_comm_pattern(issuer, comm_pattern.get(), backtracking);
-    pattern->index_comm++;
+    initial_communications_pattern[issuer].index_comm++;
+  } else {
+    /* Store comm pattern */
+    initial_communications_pattern[issuer].list.push_back(std::move(comm_pattern));
   }
 }
 
@@ -297,74 +286,65 @@ CommunicationDeterminismChecker::CommunicationDeterminismChecker(Session& s) : C
 
 CommunicationDeterminismChecker::~CommunicationDeterminismChecker() = default;
 
-RecordTrace CommunicationDeterminismChecker::getRecordTrace() // override
+RecordTrace CommunicationDeterminismChecker::get_record_trace() // override
 {
   RecordTrace res;
   for (auto const& state : stack_)
-    res.push_back(state->getTransition());
+    res.push_back(state->get_transition());
   return res;
 }
 
-std::vector<std::string> CommunicationDeterminismChecker::getTextualTrace() // override
+std::vector<std::string> CommunicationDeterminismChecker::get_textual_trace() // override
 {
   std::vector<std::string> trace;
   for (auto const& state : stack_) {
-    smx_simcall_t req = &state->executed_req;
+    smx_simcall_t req = &state->executed_req_;
     if (req)
       trace.push_back(
-          simgrid::mc::request_to_string(req, state->transition.argument, simgrid::mc::RequestType::executed));
+          simgrid::mc::request_to_string(req, state->transition_.argument_, simgrid::mc::RequestType::executed));
   }
   return trace;
 }
 
-void CommunicationDeterminismChecker::logState() // override
+void CommunicationDeterminismChecker::log_state() // override
 {
-  if (_sg_mc_comms_determinism && not this->recv_deterministic && this->send_deterministic) {
-    XBT_INFO("******************************************************");
-    XBT_INFO("**** Only-send-deterministic communication pattern ****");
-    XBT_INFO("******************************************************");
-    XBT_INFO("%s", this->recv_diff);
-  } else if (_sg_mc_comms_determinism && not this->send_deterministic && this->recv_deterministic) {
-    XBT_INFO("******************************************************");
-    XBT_INFO("**** Only-recv-deterministic communication pattern ****");
-    XBT_INFO("******************************************************");
-    XBT_INFO("%s", this->send_diff);
+  if (_sg_mc_comms_determinism) {
+    if (this->send_deterministic && not this->recv_deterministic) {
+      XBT_INFO("*******************************************************");
+      XBT_INFO("**** Only-send-deterministic communication pattern ****");
+      XBT_INFO("*******************************************************");
+      XBT_INFO("%s", this->recv_diff);
+    }
+    if (not this->send_deterministic && this->recv_deterministic) {
+      XBT_INFO("*******************************************************");
+      XBT_INFO("**** Only-recv-deterministic communication pattern ****");
+      XBT_INFO("*******************************************************");
+      XBT_INFO("%s", this->send_diff);
+    }
   }
-  XBT_INFO("Expanded states = %lu", expandedStatesCount_);
+  XBT_INFO("Expanded states = %lu", expanded_states_count_);
   XBT_INFO("Visited states = %lu", mc_model_checker->visited_states);
   XBT_INFO("Executed transitions = %lu", mc_model_checker->executed_transitions);
-  XBT_INFO("Send-deterministic : %s", not this->send_deterministic ? "No" : "Yes");
+  XBT_INFO("Send-deterministic : %s", this->send_deterministic ? "Yes" : "No");
   if (_sg_mc_comms_determinism)
-    XBT_INFO("Recv-deterministic : %s", not this->recv_deterministic ? "No" : "Yes");
+    XBT_INFO("Recv-deterministic : %s", this->recv_deterministic ? "Yes" : "No");
 }
 
 void CommunicationDeterminismChecker::prepare()
 {
   const int maxpid = MC_smx_get_maxpid();
 
-  // Create initial_communications_pattern elements:
-  initial_communications_pattern = simgrid::xbt::newDeleteDynar<simgrid::mc::PatternCommunicationList*>();
-  for (int i = 0; i < maxpid; i++) {
-    simgrid::mc::PatternCommunicationList* process_list_pattern = new simgrid::mc::PatternCommunicationList();
-    xbt_dynar_insert_at(initial_communications_pattern, i, &process_list_pattern);
-  }
-
-  // Create incomplete_communications_pattern elements:
-  incomplete_communications_pattern = xbt_dynar_new(sizeof(xbt_dynar_t), xbt_dynar_free_voidp);
-  for (int i = 0; i < maxpid; i++) {
-    xbt_dynar_t process_pattern = xbt_dynar_new(sizeof(simgrid::mc::PatternCommunication*), nullptr);
-    xbt_dynar_insert_at(incomplete_communications_pattern, i, &process_pattern);
-  }
+  initial_communications_pattern.resize(maxpid);
+  incomplete_communications_pattern.resize(maxpid);
 
-  std::unique_ptr<simgrid::mc::State> initial_state =
-      std::unique_ptr<simgrid::mc::State>(new simgrid::mc::State(++expandedStatesCount_));
+  std::unique_ptr<simgrid::mc::State> initial_state(new simgrid::mc::State(++expanded_states_count_));
 
   XBT_DEBUG("********* Start communication determinism verification *********");
 
   /* Get an enabled actor and insert it in the interleave set of the initial state */
   for (auto& actor : mc_model_checker->process().actors())
-    if (simgrid::mc::actor_is_enabled(actor.copy.getBuffer()))
-      initial_state->addInterleavingSet(actor.copy.getBuffer());
+    if (simgrid::mc::actor_is_enabled(actor.copy.get_buffer()))
+      initial_state->add_interleaving_set(actor.copy.get_buffer());
 
   stack_.push_back(std::move(initial_state));
 }
@@ -372,8 +352,7 @@ void CommunicationDeterminismChecker::prepare()
 static inline bool all_communications_are_finished()
 {
   for (size_t current_actor = 1; current_actor < MC_smx_get_maxpid(); current_actor++) {
-    xbt_dynar_t pattern = xbt_dynar_get_as(incomplete_communications_pattern, current_actor, xbt_dynar_t);
-    if (not xbt_dynar_is_empty(pattern)) {
+    if (not incomplete_communications_pattern[current_actor].empty()) {
       XBT_DEBUG("Some communications are not finished, cannot stop the exploration! State not visited.");
       return false;
     }
@@ -386,20 +365,20 @@ void CommunicationDeterminismChecker::restoreState()
   /* Intermediate backtracking */
   simgrid::mc::State* last_state = stack_.back().get();
   if (last_state->system_state) {
-    simgrid::mc::restore_snapshot(last_state->system_state);
+    last_state->system_state->restore(&mc_model_checker->process());
     MC_restore_communications_pattern(last_state);
     return;
   }
 
   /* Restore the initial state */
-  simgrid::mc::session->restoreInitialState();
+  simgrid::mc::session->restore_initial_state();
 
   unsigned n = MC_smx_get_maxpid();
-  assert(n == xbt_dynar_length(incomplete_communications_pattern));
-  assert(n == xbt_dynar_length(initial_communications_pattern));
+  assert(n == incomplete_communications_pattern.size());
+  assert(n == initial_communications_pattern.size());
   for (unsigned j=0; j < n ; j++) {
-    xbt_dynar_reset((xbt_dynar_t)xbt_dynar_get_as(incomplete_communications_pattern, j, xbt_dynar_t));
-    xbt_dynar_get_as(initial_communications_pattern, j, simgrid::mc::PatternCommunicationList*)->index_comm = 0;
+    incomplete_communications_pattern[j].clear();
+    initial_communications_pattern[j].index_comm = 0;
   }
 
   /* Traverse the stack from the state at position start and re-execute the transitions */
@@ -407,8 +386,8 @@ void CommunicationDeterminismChecker::restoreState()
     if (state == stack_.back())
       break;
 
-    int req_num = state->transition.argument;
-    smx_simcall_t saved_req = &state->executed_req;
+    int req_num             = state->transition_.argument_;
+    smx_simcall_t saved_req = &state->executed_req_;
     xbt_assert(saved_req);
 
     /* because we got a copy of the executed request, we have to fetch the
@@ -419,7 +398,7 @@ void CommunicationDeterminismChecker::restoreState()
 
     /* TODO : handle test and testany simcalls */
     e_mc_call_type_t call = MC_get_call_type(req);
-    mc_model_checker->handle_simcall(state->transition);
+    mc_model_checker->handle_simcall(state->transition_);
     MC_handle_comm_pattern(call, req, req_num, 1);
     mc_model_checker->wait_for_requests();
 
@@ -439,20 +418,20 @@ void CommunicationDeterminismChecker::real_run()
     simgrid::mc::State* cur_state = stack_.back().get();
 
     XBT_DEBUG("**************************************************");
-    XBT_DEBUG("Exploration depth = %zu (state = %d, interleaved processes = %zu)", stack_.size(), cur_state->num,
-              cur_state->interleaveSize());
+    XBT_DEBUG("Exploration depth = %zu (state = %d, interleaved processes = %zu)", stack_.size(), cur_state->num_,
+              cur_state->interleave_size());
 
     /* Update statistics */
     mc_model_checker->visited_states++;
 
     if (stack_.size() <= (std::size_t)_sg_mc_max_depth)
-      req = MC_state_get_request(cur_state);
+      req = MC_state_choose_request(cur_state);
     else
       req = nullptr;
 
     if (req != nullptr && visited_state == nullptr) {
 
-      int req_num = cur_state->transition.argument;
+      int req_num = cur_state->transition_.argument_;
 
       XBT_DEBUG("Execute: %s", simgrid::mc::request_to_string(req, req_num, simgrid::mc::RequestType::simix).c_str());
 
@@ -468,7 +447,7 @@ void CommunicationDeterminismChecker::real_run()
         call = MC_get_call_type(req);
 
       /* Answer the request */
-      mc_model_checker->handle_simcall(cur_state->transition);
+      mc_model_checker->handle_simcall(cur_state->transition_);
       /* After this call req is no longer useful */
 
       MC_handle_comm_pattern(call, req, req_num, 0);
@@ -477,16 +456,15 @@ void CommunicationDeterminismChecker::real_run()
       mc_model_checker->wait_for_requests();
 
       /* Create the new expanded state */
-      std::unique_ptr<simgrid::mc::State> next_state =
-          std::unique_ptr<simgrid::mc::State>(new simgrid::mc::State(++expandedStatesCount_));
+      std::unique_ptr<simgrid::mc::State> next_state(new simgrid::mc::State(++expanded_states_count_));
 
       /* If comm determinism verification, we cannot stop the exploration if some communications are not finished (at
        * least, data are transferred). These communications  are incomplete and they cannot be analyzed and compared
        * with the initial pattern. */
-      bool compare_snapshots = all_communications_are_finished() && this->initial_communications_pattern_done;
+      bool compare_snapshots = this->initial_communications_pattern_done && all_communications_are_finished();
 
       if (_sg_mc_max_visited_states != 0)
-        visited_state = visitedStates_.addVisitedState(expandedStatesCount_, next_state.get(), compare_snapshots);
+        visited_state = visited_states_.addVisitedState(expanded_states_count_, next_state.get(), compare_snapshots);
       else
         visited_state = nullptr;
 
@@ -494,14 +472,14 @@ void CommunicationDeterminismChecker::real_run()
 
         /* Get enabled actors and insert them in the interleave set of the next state */
         for (auto& actor : mc_model_checker->process().actors())
-          if (simgrid::mc::actor_is_enabled(actor.copy.getBuffer()))
-            next_state->addInterleavingSet(actor.copy.getBuffer());
+          if (simgrid::mc::actor_is_enabled(actor.copy.get_buffer()))
+            next_state->add_interleaving_set(actor.copy.get_buffer());
 
         if (dot_output != nullptr)
-          fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", cur_state->num, next_state->num, req_str.c_str());
+          fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", cur_state->num_, next_state->num_, req_str.c_str());
 
       } else if (dot_output != nullptr)
-        fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", cur_state->num,
+        fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", cur_state->num_,
                 visited_state->original_num == -1 ? visited_state->num : visited_state->original_num, req_str.c_str());
 
       stack_.push_back(std::move(next_state));
@@ -516,11 +494,10 @@ void CommunicationDeterminismChecker::real_run()
       else
         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;
+      this->initial_communications_pattern_done = true;
 
       /* Trash the current state, no longer needed */
-      XBT_DEBUG("Delete state %d at depth %zu", cur_state->num, stack_.size());
+      XBT_DEBUG("Delete state %d at depth %zu", cur_state->num_, stack_.size());
       stack_.pop_back();
 
       visited_state = nullptr;
@@ -532,26 +509,26 @@ void CommunicationDeterminismChecker::real_run()
       }
 
       while (not stack_.empty()) {
-        std::unique_ptr<simgrid::mc::State> state = std::move(stack_.back());
+        std::unique_ptr<simgrid::mc::State> state(std::move(stack_.back()));
         stack_.pop_back();
-        if (state->interleaveSize() && stack_.size() < (std::size_t)_sg_mc_max_depth) {
+        if (state->interleave_size() && 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 %zu", 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 %zu 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 %zu", state->num, stack_.size() + 1);
+          XBT_DEBUG("Delete state %d at depth %zu", state->num_, stack_.size() + 1);
         }
       }
     }
   }
 
-  simgrid::mc::session->logState();
+  simgrid::mc::session->log_state();
 }
 
 void CommunicationDeterminismChecker::run()
index 72b4931..c10d60f 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. */
 
-#include <list>
-#include <memory>
-#include <string>
-#include <vector>
-
 #include "src/mc/VisitedState.hpp"
 #include "src/mc/checker/Checker.hpp"
 #include "src/mc/mc_comm_pattern.hpp"
-#include "src/mc/mc_forward.hpp"
+
+#include <string>
+#include <vector>
 
 #ifndef SIMGRID_MC_COMMUNICATION_DETERMINISM_CHECKER_HPP
 #define SIMGRID_MC_COMMUNICATION_DETERMINISM_CHECKER_HPP
@@ -24,12 +21,13 @@ public:
   explicit CommunicationDeterminismChecker(Session& session);
   ~CommunicationDeterminismChecker();
   void run() override;
-  RecordTrace getRecordTrace() override;
-  std::vector<std::string> getTextualTrace() override;
+  RecordTrace get_record_trace() override;
+  std::vector<std::string> get_textual_trace() override;
+
 private:
   void prepare();
   void real_run();
-  void logState() override;
+  void log_state() override;
   void deterministic_comm_pattern(int process, simgrid::mc::PatternCommunication* comm, int backtracking);
   void restoreState();
 public:
@@ -41,8 +39,8 @@ public:
 private:
   /** Stack representing the position in the exploration graph */
   std::list<std::unique_ptr<simgrid::mc::State>> stack_;
-  simgrid::mc::VisitedStates visitedStates_;
-  unsigned long expandedStatesCount_ = 0;
+  simgrid::mc::VisitedStates visited_states_;
+  unsigned long expanded_states_count_ = 0;
 
   bool initial_communications_pattern_done = false;
   bool recv_deterministic                  = true;
index 5875f80..bbced3a 100644 (file)
@@ -3,32 +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. */
 
-#include <cstring>
-
-#include <memory>
-#include <list>
-
-#include <boost/range/algorithm.hpp>
-
-#include <unistd.h>
-#include <sys/wait.h>
-
-#include <xbt/automaton.h>
-#include <xbt/dynar.h>
-#include <xbt/log.h>
-#include <xbt/sysdep.h>
-
-#include "src/mc/Session.hpp"
-#include "src/mc/Transition.hpp"
 #include "src/mc/checker/LivenessChecker.hpp"
+#include "src/mc/Session.hpp"
+#include "src/mc/mc_config.hpp"
 #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"
+
+#include <boost/range/algorithm.hpp>
+#include <cstring>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_liveness, mc, "Logging specific to algorithms for liveness properties verification");
 
@@ -46,7 +30,7 @@ VisitedPair::VisitedPair(int pair_num, xbt_automaton_state_t automaton_state,
 
   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->graph_state->system_state = std::make_shared<simgrid::mc::Snapshot>(pair_num);
   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();
@@ -86,7 +70,7 @@ static bool evaluate_label(xbt_automaton_exp_label_t l, std::vector<int> const&
 Pair::Pair(unsigned long expanded_pairs) : num(expanded_pairs)
 {}
 
-std::shared_ptr<const std::vector<int>> LivenessChecker::getPropositionValues()
+std::shared_ptr<const std::vector<int>> LivenessChecker::get_proposition_values()
 {
   std::vector<int> values;
   unsigned int cursor = 0;
@@ -96,48 +80,38 @@ std::shared_ptr<const std::vector<int>> LivenessChecker::getPropositionValues()
   return std::make_shared<const std::vector<int>>(std::move(values));
 }
 
-int LivenessChecker::compare(simgrid::mc::VisitedPair* state1, simgrid::mc::VisitedPair* state2)
-{
-  simgrid::mc::Snapshot* s1 = state1->graph_state->system_state.get();
-  simgrid::mc::Snapshot* s2 = state2->graph_state->system_state.get();
-  int num1 = state1->num;
-  int num2 = state2->num;
-  return simgrid::mc::snapshot_compare(num1, s1, num2, s2);
-}
-
-std::shared_ptr<VisitedPair> LivenessChecker::insertAcceptancePair(simgrid::mc::Pair* pair)
+std::shared_ptr<VisitedPair> LivenessChecker::insert_acceptance_pair(simgrid::mc::Pair* pair)
 {
   std::shared_ptr<VisitedPair> new_pair = std::make_shared<VisitedPair>(
     pair->num, pair->automaton_state, pair->atomic_propositions,
     pair->graph_state);
 
-  auto res = boost::range::equal_range(acceptancePairs_, new_pair.get(),
+  auto res = boost::range::equal_range(acceptance_pairs_, new_pair.get(),
                                        simgrid::mc::DerefAndCompareByActorsCountAndUsedHeap());
 
   if (pair->search_cycle) for (auto i = res.first; i != res.second; ++i) {
     std::shared_ptr<simgrid::mc::VisitedPair> const& pair_test = *i;
-    if (xbt_automaton_state_compare(
-          pair_test->automaton_state, new_pair->automaton_state) != 0
-        || *(pair_test->atomic_propositions) != *(new_pair->atomic_propositions)
-        || this->compare(pair_test.get(), new_pair.get()) != 0)
+    if (xbt_automaton_state_compare(pair_test->automaton_state, new_pair->automaton_state) != 0 ||
+        *(pair_test->atomic_propositions) != *(new_pair->atomic_propositions) ||
+        not snapshot_equal(pair_test->graph_state->system_state.get(), new_pair->graph_state->system_state.get()))
       continue;
     XBT_INFO("Pair %d already reached (equal to pair %d) !", new_pair->num, pair_test->num);
-    explorationStack_.pop_back();
+    exploration_stack_.pop_back();
     if (dot_output != nullptr)
-      fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", this->previousPair_, pair_test->num,
-              this->previousRequest_.c_str());
+      fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", this->previous_pair_, pair_test->num,
+              this->previous_request_.c_str());
     return nullptr;
   }
 
-  acceptancePairs_.insert(res.first, new_pair);
+  acceptance_pairs_.insert(res.first, new_pair);
   return new_pair;
 }
 
-void LivenessChecker::removeAcceptancePair(int pair_num)
+void LivenessChecker::remove_acceptance_pair(int pair_num)
 {
-  for (auto i = acceptancePairs_.begin(); i != acceptancePairs_.end(); ++i)
+  for (auto i = acceptance_pairs_.begin(); i != acceptance_pairs_.end(); ++i)
     if ((*i)->num == pair_num) {
-      acceptancePairs_.erase(i);
+      acceptance_pairs_.erase(i);
       break;
     }
 }
@@ -148,28 +122,28 @@ void LivenessChecker::replay()
 
   /* Intermediate backtracking */
   if(_sg_mc_checkpoint > 0) {
-    simgrid::mc::Pair* pair = explorationStack_.back().get();
+    simgrid::mc::Pair* pair = exploration_stack_.back().get();
     if(pair->graph_state->system_state){
-      simgrid::mc::restore_snapshot(pair->graph_state->system_state);
+      pair->graph_state->system_state->restore(&mc_model_checker->process());
       return;
     }
   }
 
   /* Restore the initial state */
-  simgrid::mc::session->restoreInitialState();
+  simgrid::mc::session->restore_initial_state();
 
   /* Traverse the stack from the initial state and re-execute the transitions */
   int depth = 1;
-  for (std::shared_ptr<Pair> const& pair : explorationStack_) {
-    if (pair == explorationStack_.back())
+  for (std::shared_ptr<Pair> const& pair : exploration_stack_) {
+    if (pair == exploration_stack_.back())
       break;
 
     std::shared_ptr<State> state = pair->graph_state;
 
     if (pair->exploration_started) {
 
-      int req_num = state->transition.argument;
-      smx_simcall_t saved_req = &state->executed_req;
+      int req_num             = state->transition_.argument_;
+      smx_simcall_t saved_req = &state->executed_req_;
 
       smx_simcall_t req = nullptr;
 
@@ -187,11 +161,11 @@ void LivenessChecker::replay()
           state.get());
       }
 
-      this->getSession().execute(state->transition);
+      this->get_session().execute(state->transition_);
     }
 
     /* Update statistics */
-    visitedPairsCount_++;
+    visited_pairs_count_++;
     mc_model_checker->executed_transitions++;
 
     depth++;
@@ -204,7 +178,7 @@ void LivenessChecker::replay()
 /**
  * @brief Checks whether a given pair has already been visited by the algorithm.
  */
-int LivenessChecker::insertVisitedPair(std::shared_ptr<VisitedPair> visited_pair, simgrid::mc::Pair* pair)
+int LivenessChecker::insert_visited_pair(std::shared_ptr<VisitedPair> visited_pair, simgrid::mc::Pair* pair)
 {
   if (_sg_mc_max_visited_states == 0)
     return -1;
@@ -213,16 +187,15 @@ int LivenessChecker::insertVisitedPair(std::shared_ptr<VisitedPair> visited_pair
     visited_pair =
         std::make_shared<VisitedPair>(pair->num, pair->automaton_state, pair->atomic_propositions, pair->graph_state);
 
-  auto range = boost::range::equal_range(visitedPairs_, visited_pair.get(),
+  auto range = boost::range::equal_range(visited_pairs_, visited_pair.get(),
                                          simgrid::mc::DerefAndCompareByActorsCountAndUsedHeap());
 
   for (auto i = range.first; i != range.second; ++i) {
     VisitedPair* pair_test = i->get();
-    if (xbt_automaton_state_compare(
-          pair_test->automaton_state, visited_pair->automaton_state) != 0
-        || *(pair_test->atomic_propositions) != *(visited_pair->atomic_propositions)
-        || this->compare(pair_test, visited_pair.get()) != 0)
-        continue;
+    if (xbt_automaton_state_compare(pair_test->automaton_state, visited_pair->automaton_state) != 0 ||
+        *(pair_test->atomic_propositions) != *(visited_pair->atomic_propositions) ||
+        not snapshot_equal(pair_test->graph_state->system_state.get(), visited_pair->graph_state->system_state.get()))
+      continue;
     if (pair_test->other_num == -1)
       visited_pair->other_num = pair_test->num;
     else
@@ -236,18 +209,18 @@ int LivenessChecker::insertVisitedPair(std::shared_ptr<VisitedPair> visited_pair
     return (*i)->other_num;
   }
 
-  visitedPairs_.insert(range.first, std::move(visited_pair));
-  this->purgeVisitedPairs();
+  visited_pairs_.insert(range.first, std::move(visited_pair));
+  this->purge_visited_pairs();
   return -1;
 }
 
-void LivenessChecker::purgeVisitedPairs()
+void LivenessChecker::purge_visited_pairs()
 {
-  if (_sg_mc_max_visited_states != 0 && visitedPairs_.size() > (std::size_t)_sg_mc_max_visited_states) {
+  if (_sg_mc_max_visited_states != 0 && visited_pairs_.size() > (std::size_t)_sg_mc_max_visited_states) {
     // Remove the oldest entry with a linear search:
-    visitedPairs_.erase(boost::min_element(visitedPairs_,
-      [](std::shared_ptr<VisitedPair> const a, std::shared_ptr<VisitedPair> const& b) {
-        return a->num < b->num; } ));
+    visited_pairs_.erase(
+        boost::min_element(visited_pairs_, [](std::shared_ptr<VisitedPair> const a,
+                                              std::shared_ptr<VisitedPair> const& b) { return a->num < b->num; }));
   }
 }
 
@@ -255,54 +228,54 @@ LivenessChecker::LivenessChecker(Session& s) : Checker(s)
 {
 }
 
-RecordTrace LivenessChecker::getRecordTrace() // override
+RecordTrace LivenessChecker::get_record_trace() // override
 {
   RecordTrace res;
-  for (std::shared_ptr<Pair> const& pair : explorationStack_)
-    res.push_back(pair->graph_state->getTransition());
+  for (std::shared_ptr<Pair> const& pair : exploration_stack_)
+    res.push_back(pair->graph_state->get_transition());
   return res;
 }
 
-void LivenessChecker::logState() // override
+void LivenessChecker::log_state() // override
 {
-  XBT_INFO("Expanded pairs = %lu", expandedPairsCount_);
-  XBT_INFO("Visited pairs = %lu", visitedPairsCount_);
+  XBT_INFO("Expanded pairs = %lu", expanded_pairs_count_);
+  XBT_INFO("Visited pairs = %lu", visited_pairs_count_);
   XBT_INFO("Executed transitions = %lu", mc_model_checker->executed_transitions);
 }
 
-void LivenessChecker::showAcceptanceCycle(std::size_t depth)
+void LivenessChecker::show_acceptance_cycle(std::size_t depth)
 {
   XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
   XBT_INFO("|             ACCEPTANCE CYCLE            |");
   XBT_INFO("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
-  XBT_INFO("Counter-example that violates formula :");
+  XBT_INFO("Counter-example that violates formula:");
+  for (auto const& s : this->get_textual_trace())
+    XBT_INFO("  %s", s.c_str());
   simgrid::mc::dumpRecordPath();
-  for (auto const& s : this->getTextualTrace())
-    XBT_INFO("%s", s.c_str());
-  simgrid::mc::session->logState();
-  XBT_INFO("Counter-example depth : %zu", depth);
+  simgrid::mc::session->log_state();
+  XBT_INFO("Counter-example depth: %zu", depth);
 }
 
-std::vector<std::string> LivenessChecker::getTextualTrace() // override
+std::vector<std::string> LivenessChecker::get_textual_trace() // override
 {
   std::vector<std::string> trace;
-  for (std::shared_ptr<Pair> const& pair : explorationStack_) {
-    int req_num = pair->graph_state->transition.argument;
-    smx_simcall_t req = &pair->graph_state->executed_req;
-    if (req && req->call != SIMCALL_NONE)
+  for (std::shared_ptr<Pair> const& pair : exploration_stack_) {
+    int req_num       = pair->graph_state->transition_.argument_;
+    smx_simcall_t req = &pair->graph_state->executed_req_;
+    if (req && req->call_ != SIMCALL_NONE)
       trace.push_back(simgrid::mc::request_to_string(
         req, req_num, simgrid::mc::RequestType::executed));
   }
   return trace;
 }
 
-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> LivenessChecker::create_pair(Pair* current_pair, xbt_automaton_state_t state,
+                                                   std::shared_ptr<const std::vector<int>> propositions)
 {
-  expandedPairsCount_++;
-  std::shared_ptr<Pair> next_pair = std::make_shared<Pair>(expandedPairsCount_);
+  expanded_pairs_count_++;
+  std::shared_ptr<Pair> next_pair = std::make_shared<Pair>(expanded_pairs_count_);
   next_pair->automaton_state      = state;
-  next_pair->graph_state          = std::shared_ptr<simgrid::mc::State>(new simgrid::mc::State(++expandedStatesCount_));
+  next_pair->graph_state = std::shared_ptr<simgrid::mc::State>(new simgrid::mc::State(++expanded_states_count_));
   next_pair->atomic_propositions  = std::move(propositions);
   if (current_pair)
     next_pair->depth = current_pair->depth + 1;
@@ -310,9 +283,9 @@ std::shared_ptr<Pair> LivenessChecker::newPair(Pair* current_pair, xbt_automaton
     next_pair->depth = 1;
   /* Get enabled actors and insert them in the interleave set of the next graph_state */
   for (auto& actor : mc_model_checker->process().actors())
-    if (simgrid::mc::actor_is_enabled(actor.copy.getBuffer()))
-      next_pair->graph_state->addInterleavingSet(actor.copy.getBuffer());
-  next_pair->requests = next_pair->graph_state->interleaveSize();
+    if (simgrid::mc::actor_is_enabled(actor.copy.get_buffer()))
+      next_pair->graph_state->add_interleaving_set(actor.copy.get_buffer());
+  next_pair->requests = next_pair->graph_state->interleave_size();
   /* FIXME : get search_cycle value for each accepting state */
   if (next_pair->automaton_state->type == 1 || (current_pair && current_pair->search_cycle))
     next_pair->search_cycle = true;
@@ -325,20 +298,20 @@ void LivenessChecker::backtrack()
 {
   /* Traverse the stack backwards until a pair with a non empty interleave
      set is found, deleting all the pairs that have it empty in the way. */
-  while (not explorationStack_.empty()) {
-    std::shared_ptr<simgrid::mc::Pair> current_pair = explorationStack_.back();
-    explorationStack_.pop_back();
+  while (not exploration_stack_.empty()) {
+    std::shared_ptr<simgrid::mc::Pair> current_pair = exploration_stack_.back();
+    exploration_stack_.pop_back();
     if (current_pair->requests > 0) {
       /* We found a backtracking point */
       XBT_DEBUG("Backtracking to depth %d", current_pair->depth);
-      explorationStack_.push_back(std::move(current_pair));
+      exploration_stack_.push_back(std::move(current_pair));
       this->replay();
       XBT_DEBUG("Backtracking done");
       break;
     } else {
       XBT_DEBUG("Delete pair %d at depth %d", current_pair->num, current_pair->depth);
       if (current_pair->automaton_state->type == 1)
-        this->removeAcceptancePair(current_pair->num);
+        this->remove_acceptance_pair(current_pair->num);
     }
   }
 }
@@ -352,9 +325,9 @@ void LivenessChecker::run()
   simgrid::mc::session->initialize();
 
   /* Initialize */
-  this->previousPair_ = 0;
+  this->previous_pair_ = 0;
 
-  std::shared_ptr<const std::vector<int>> propos = this->getPropositionValues();
+  std::shared_ptr<const std::vector<int>> propos = this->get_proposition_values();
 
   // For each initial state of the property automaton, push a
   // (application_state, automaton_state) pair to the exploration stack:
@@ -362,19 +335,19 @@ void LivenessChecker::run()
   xbt_automaton_state_t automaton_state;
   xbt_dynar_foreach (simgrid::mc::property_automaton->states, cursor, automaton_state)
     if (automaton_state->type == -1)
-      explorationStack_.push_back(this->newPair(nullptr, automaton_state, propos));
+      exploration_stack_.push_back(this->create_pair(nullptr, automaton_state, propos));
 
   /* Actually run the double DFS search for counter-examples */
-  while (not explorationStack_.empty()) {
-    std::shared_ptr<Pair> current_pair = explorationStack_.back();
+  while (not exploration_stack_.empty()) {
+    std::shared_ptr<Pair> current_pair = exploration_stack_.back();
 
     /* 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 = %zu, pair_num = %d, requests = %d)",
-        current_pair->depth, current_pair->search_cycle, current_pair->graph_state->interleaveSize(), current_pair->num,
-        current_pair->requests);
+        current_pair->depth, current_pair->search_cycle, current_pair->graph_state->interleave_size(),
+        current_pair->num, current_pair->requests);
 
     if (current_pair->requests == 0) {
       this->backtrack();
@@ -383,20 +356,20 @@ 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());
+      reached_pair = this->insert_acceptance_pair(current_pair.get());
       if (reached_pair == nullptr) {
-        this->showAcceptanceCycle(current_pair->depth);
+        this->show_acceptance_cycle(current_pair->depth);
         throw simgrid::mc::LivenessError();
       }
     }
 
     /* Pair already visited ? stop the exploration on the current path */
     if (not current_pair->exploration_started) {
-      int visited_num = this->insertVisitedPair(reached_pair, current_pair.get());
+      int visited_num = this->insert_visited_pair(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());
+          fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", this->previous_pair_, visited_num,
+                  this->previous_request_.c_str());
           fflush(dot_output);
         }
         XBT_DEBUG("Pair already visited (equal to pair %d), exploration on the current path stopped.", visited_num);
@@ -406,18 +379,17 @@ void LivenessChecker::run()
       }
     }
 
-    smx_simcall_t req = MC_state_get_request(current_pair->graph_state.get());
-    int req_num = current_pair->graph_state->transition.argument;
+    smx_simcall_t req = MC_state_choose_request(current_pair->graph_state.get());
+    int req_num       = current_pair->graph_state->transition_.argument_;
 
     if (dot_output != nullptr) {
-      if (this->previousPair_ != 0 && this->previousPair_ != current_pair->num) {
-        fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n",
-          this->previousPair_, current_pair->num,
-          this->previousRequest_.c_str());
-        this->previousRequest_.clear();
+      if (this->previous_pair_ != 0 && this->previous_pair_ != current_pair->num) {
+        fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", this->previous_pair_, current_pair->num,
+                this->previous_request_.c_str());
+        this->previous_request_.clear();
       }
-      this->previousPair_ = current_pair->num;
-      this->previousRequest_ = simgrid::mc::request_get_dot_output(req, req_num);
+      this->previous_pair_    = current_pair->num;
+      this->previous_request_ = simgrid::mc::request_get_dot_output(req, req_num);
       if (current_pair->search_cycle)
         fprintf(dot_output, "%d [shape=doublecircle];\n", current_pair->num);
       fflush(dot_output);
@@ -430,10 +402,10 @@ void LivenessChecker::run()
     /* Update stats */
     mc_model_checker->executed_transitions++;
     if (not current_pair->exploration_started)
-      visitedPairsCount_++;
+      visited_pairs_count_++;
 
     /* Answer the request */
-    mc_model_checker->handle_simcall(current_pair->graph_state->transition);
+    mc_model_checker->handle_simcall(current_pair->graph_state->transition_);
 
     /* Wait for requests (schedules processes) */
     mc_model_checker->wait_for_requests();
@@ -442,7 +414,7 @@ void LivenessChecker::run()
     current_pair->exploration_started = true;
 
     /* Get values of atomic propositions (variables used in the property formula) */
-    std::shared_ptr<const std::vector<int>> prop_values = this->getPropositionValues();
+    std::shared_ptr<const std::vector<int>> prop_values = this->get_proposition_values();
 
     // For each enabled transition in the property automaton, push a
     // (application_state, automaton_state) pair to the exploration stack:
@@ -450,14 +422,13 @@ void LivenessChecker::run()
       xbt_automaton_transition_t transition_succ = (xbt_automaton_transition_t)xbt_dynar_get_as(
           current_pair->automaton_state->out, i, xbt_automaton_transition_t);
       if (evaluate_label(transition_succ->label, *prop_values))
-          explorationStack_.push_back(this->newPair(
-            current_pair.get(), transition_succ->dst, prop_values));
+        exploration_stack_.push_back(this->create_pair(current_pair.get(), transition_succ->dst, prop_values));
      }
 
   }
 
   XBT_INFO("No property violation found.");
-  simgrid::mc::session->logState();
+  simgrid::mc::session->log_state();
 }
 
 Checker* createLivenessChecker(Session& s)
index 25517a0..3867a9e 100644 (file)
@@ -7,19 +7,14 @@
 #ifndef SIMGRID_MC_LIVENESS_CHECKER_HPP
 #define SIMGRID_MC_LIVENESS_CHECKER_HPP
 
-#include <cstddef>
+#include "src/mc/checker/Checker.hpp"
+#include "src/mc/mc_state.hpp"
+#include "xbt/automaton.hpp"
 
-#include <string>
 #include <list>
 #include <memory>
 #include <vector>
 
-#include "src/mc/checker/Checker.hpp"
-#include "src/mc/mc_state.hpp"
-#include <simgrid/config.h>
-#include <xbt/automaton.h>
-#include <xbt/base.h>
-
 namespace simgrid {
 namespace mc {
 
@@ -63,30 +58,31 @@ public:
   explicit LivenessChecker(Session& session);
   ~LivenessChecker() = default;
   void run() override;
-  RecordTrace getRecordTrace() override;
-  std::vector<std::string> getTextualTrace() override;
-  void logState() override;
+  RecordTrace get_record_trace() override;
+  std::vector<std::string> get_textual_trace() override;
+  void log_state() override;
+
 private:
-  int compare(simgrid::mc::VisitedPair* state1, simgrid::mc::VisitedPair* state2);
-  std::shared_ptr<const std::vector<int>> getPropositionValues();
-  std::shared_ptr<VisitedPair> insertAcceptancePair(simgrid::mc::Pair* pair);
-  int insertVisitedPair(std::shared_ptr<VisitedPair> visited_pair, simgrid::mc::Pair* pair);
-  void showAcceptanceCycle(std::size_t depth);
+  std::shared_ptr<const std::vector<int>> get_proposition_values();
+  std::shared_ptr<VisitedPair> insert_acceptance_pair(simgrid::mc::Pair* pair);
+  int insert_visited_pair(std::shared_ptr<VisitedPair> visited_pair, simgrid::mc::Pair* pair);
+  void show_acceptance_cycle(std::size_t depth);
   void replay();
-  void removeAcceptancePair(int pair_num);
-  void purgeVisitedPairs();
+  void remove_acceptance_pair(int pair_num);
+  void purge_visited_pairs();
   void backtrack();
-  std::shared_ptr<Pair> newPair(Pair* pair, xbt_automaton_state_t state, std::shared_ptr<const std::vector<int>> propositions);
+  std::shared_ptr<Pair> create_pair(Pair* pair, xbt_automaton_state_t state,
+                                    std::shared_ptr<const std::vector<int>> propositions);
 
   // 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_;
-  std::list<std::shared_ptr<VisitedPair>> visitedPairs_;
-  unsigned long visitedPairsCount_ = 0;
-  unsigned long expandedPairsCount_ = 0;
-  unsigned long expandedStatesCount_ = 0;
-  int previousPair_ = 0;
-  std::string previousRequest_;
+  std::list<std::shared_ptr<Pair>> exploration_stack_;
+  std::list<std::shared_ptr<VisitedPair>> acceptance_pairs_;
+  std::list<std::shared_ptr<VisitedPair>> visited_pairs_;
+  unsigned long visited_pairs_count_   = 0;
+  unsigned long expanded_pairs_count_  = 0;
+  unsigned long expanded_states_count_ = 0;
+  int previous_pair_                   = 0;
+  std::string previous_request_;
 };
 
 }
index 079f3fe..c08ecaa 100644 (file)
@@ -17,6 +17,7 @@
 #include "src/mc/Transition.hpp"
 #include "src/mc/VisitedState.hpp"
 #include "src/mc/checker/SafetyChecker.hpp"
+#include "src/mc/mc_config.hpp"
 #include "src/mc/mc_exit.hpp"
 #include "src/mc/mc_private.hpp"
 #include "src/mc/mc_record.hpp"
@@ -30,46 +31,38 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_safety, mc,
 namespace simgrid {
 namespace mc {
 
-static int snapshot_compare(simgrid::mc::State* state1, simgrid::mc::State* state2)
-{
-  simgrid::mc::Snapshot* s1 = state1->system_state.get();
-  simgrid::mc::Snapshot* s2 = state2->system_state.get();
-  int num1 = state1->num;
-  int num2 = state2->num;
-  return snapshot_compare(num1, s1, num2, s2);
-}
-
-void SafetyChecker::checkNonTermination(simgrid::mc::State* current_state)
+void SafetyChecker::check_non_termination(simgrid::mc::State* current_state)
 {
   for (auto state = stack_.rbegin(); state != stack_.rend(); ++state)
-    if (snapshot_compare(state->get(), current_state) == 0) {
-      XBT_INFO("Non-progressive cycle: state %d -> state %d", (*state)->num, current_state->num);
+    if (snapshot_equal((*state)->system_state.get(), current_state->system_state.get())) {
+      XBT_INFO("Non-progressive cycle: state %d -> state %d", (*state)->num_, current_state->num_);
       XBT_INFO("******************************************");
       XBT_INFO("*** NON-PROGRESSIVE CYCLE DETECTED ***");
       XBT_INFO("******************************************");
       XBT_INFO("Counter-example execution trace:");
-      for (auto const& s : mc_model_checker->getChecker()->getTextualTrace())
-        XBT_INFO("%s", s.c_str());
-      simgrid::mc::session->logState();
+      for (auto const& s : mc_model_checker->getChecker()->get_textual_trace())
+        XBT_INFO("  %s", s.c_str());
+      simgrid::mc::dumpRecordPath();
+      simgrid::mc::session->log_state();
 
       throw simgrid::mc::TerminationError();
     }
 }
 
-RecordTrace SafetyChecker::getRecordTrace() // override
+RecordTrace SafetyChecker::get_record_trace() // override
 {
   RecordTrace res;
   for (auto const& state : stack_)
-    res.push_back(state->getTransition());
+    res.push_back(state->get_transition());
   return res;
 }
 
-std::vector<std::string> SafetyChecker::getTextualTrace() // override
+std::vector<std::string> SafetyChecker::get_textual_trace() // override
 {
   std::vector<std::string> trace;
   for (auto const& state : stack_) {
-    int value = state->transition.argument;
-    smx_simcall_t req = &state->executed_req;
+    int value         = state->transition_.argument_;
+    smx_simcall_t req = &state->executed_req_;
     if (req)
       trace.push_back(simgrid::mc::request_to_string(
         req, value, simgrid::mc::RequestType::executed));
@@ -77,9 +70,9 @@ std::vector<std::string> SafetyChecker::getTextualTrace() // override
   return trace;
 }
 
-void SafetyChecker::logState() // override
+void SafetyChecker::log_state() // override
 {
-  XBT_INFO("Expanded states = %lu", expandedStatesCount_);
+  XBT_INFO("Expanded states = %lu", expanded_states_count_);
   XBT_INFO("Visited states = %lu", mc_model_checker->visited_states);
   XBT_INFO("Executed transitions = %lu", mc_model_checker->executed_transitions);
 }
@@ -88,7 +81,7 @@ void SafetyChecker::run()
 {
   /* This function runs the DFS algorithm the state space.
    * We do so iteratively instead of recursively, dealing with the call stack manually.
-   * This allows to explore the call stack at wish. */
+   * This allows one to explore the call stack at will. */
 
   while (not stack_.empty()) {
 
@@ -96,8 +89,8 @@ void SafetyChecker::run()
     simgrid::mc::State* state = stack_.back().get();
 
     XBT_DEBUG("**************************************************");
-    XBT_DEBUG("Exploration depth=%zu (state=%p, num %d)(%zu interleave)", stack_.size(), state, state->num,
-              state->interleaveSize());
+    XBT_VERB("Exploration depth=%zu (state=%p, num %d)(%zu interleave)", stack_.size(), state, state->num_,
+             state->interleave_size());
 
     mc_model_checker->visited_states++;
 
@@ -109,18 +102,18 @@ void SafetyChecker::run()
     }
 
     // Backtrack if we are revisiting a state we saw previously
-    if (visitedState_ != nullptr) {
+    if (visited_state_ != nullptr) {
       XBT_DEBUG("State already visited (equal to state %d), exploration stopped on this path.",
-                visitedState_->original_num == -1 ? visitedState_->num : visitedState_->original_num);
+                visited_state_->original_num == -1 ? visited_state_->num : visited_state_->original_num);
 
-      visitedState_ = nullptr;
+      visited_state_ = nullptr;
       this->backtrack();
       continue;
     }
 
     // Search an enabled transition in the current state; backtrack if the interleave set is empty
     // get_request also sets state.transition to be the one corresponding to the returned req
-    smx_simcall_t req = MC_state_get_request(state);
+    smx_simcall_t req = MC_state_choose_request(state);
     // req is now the transition of the process that was selected to be executed
 
     if (req == nullptr) {
@@ -132,57 +125,56 @@ void SafetyChecker::run()
 
     // If there are processes to interleave and the maximum depth has not been
     // reached then perform one step of the exploration algorithm.
-    XBT_DEBUG("Execute: %s",
-      simgrid::mc::request_to_string(
-        req, state->transition.argument, simgrid::mc::RequestType::simix).c_str());
+    XBT_DEBUG(
+        "Execute: %s",
+        simgrid::mc::request_to_string(req, state->transition_.argument_, simgrid::mc::RequestType::simix).c_str());
 
     std::string req_str;
     if (dot_output != nullptr)
-      req_str = simgrid::mc::request_get_dot_output(req, state->transition.argument);
+      req_str = simgrid::mc::request_get_dot_output(req, state->transition_.argument_);
 
     mc_model_checker->executed_transitions++;
 
     /* Actually answer the request: let execute the selected request (MCed does one step) */
-    this->getSession().execute(state->transition);
+    this->get_session().execute(state->transition_);
 
     /* Create the new expanded state (copy the state of MCed into our MCer data) */
     std::unique_ptr<simgrid::mc::State> next_state =
-        std::unique_ptr<simgrid::mc::State>(new simgrid::mc::State(++expandedStatesCount_));
+        std::unique_ptr<simgrid::mc::State>(new simgrid::mc::State(++expanded_states_count_));
 
     if (_sg_mc_termination)
-      this->checkNonTermination(next_state.get());
+      this->check_non_termination(next_state.get());
 
     /* Check whether we already explored next_state in the past (but only if interested in state-equality reduction) */
     if (_sg_mc_max_visited_states > 0)
-      visitedState_ = visitedStates_.addVisitedState(expandedStatesCount_, next_state.get(), true);
+      visited_state_ = visited_states_.addVisitedState(expanded_states_count_, next_state.get(), true);
 
     /* If this is a new state (or if we don't care about state-equality reduction) */
-    if (visitedState_ == nullptr) {
+    if (visited_state_ == nullptr) {
 
       /* Get an enabled process and insert it in the interleave set of the next state */
       for (auto& remoteActor : mc_model_checker->process().actors()) {
-        auto actor = remoteActor.copy.getBuffer();
+        auto actor = remoteActor.copy.get_buffer();
         if (simgrid::mc::actor_is_enabled(actor)) {
-          next_state->addInterleavingSet(actor);
+          next_state->add_interleaving_set(actor);
           if (reductionMode_ == simgrid::mc::ReductionMode::dpor)
             break; // With DPOR, we take the first enabled transition
         }
       }
 
       if (dot_output != nullptr)
-        std::fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n",
-          state->num, next_state->num, req_str.c_str());
+        std::fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", state->num_, next_state->num_, req_str.c_str());
 
     } else if (dot_output != nullptr)
-      std::fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", state->num,
-                   visitedState_->original_num == -1 ? visitedState_->num : visitedState_->original_num,
+      std::fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", state->num_,
+                   visited_state_->original_num == -1 ? visited_state_->num : visited_state_->original_num,
                    req_str.c_str());
 
     stack_.push_back(std::move(next_state));
   }
 
   XBT_INFO("No property violation found.");
-  simgrid::mc::session->logState();
+  simgrid::mc::session->log_state();
 }
 
 void SafetyChecker::backtrack()
@@ -207,7 +199,7 @@ void SafetyChecker::backtrack()
     stack_.pop_back();
     if (reductionMode_ == simgrid::mc::ReductionMode::dpor) {
       smx_simcall_t req = &state->internal_req;
-      if (req->call == SIMCALL_MUTEX_LOCK || req->call == SIMCALL_MUTEX_TRYLOCK)
+      if (req->call_ == SIMCALL_MUTEX_LOCK || req->call_ == SIMCALL_MUTEX_TRYLOCK)
         xbt_die("Mutex is currently not supported with DPOR,  use --cfg=model-check/reduction:none");
 
       const smx_actor_t issuer = MC_smx_simcall_get_issuer(req);
@@ -216,73 +208,71 @@ void SafetyChecker::backtrack()
         if (simgrid::mc::request_depend(req, &prev_state->internal_req)) {
           if (XBT_LOG_ISENABLED(mc_safety, xbt_log_priority_debug)) {
             XBT_DEBUG("Dependent Transitions:");
-            int value = prev_state->transition.argument;
-            smx_simcall_t prev_req = &prev_state->executed_req;
+            int value              = prev_state->transition_.argument_;
+            smx_simcall_t prev_req = &prev_state->executed_req_;
             XBT_DEBUG("%s (state=%d)",
-              simgrid::mc::request_to_string(
-                prev_req, value, simgrid::mc::RequestType::internal).c_str(),
-              prev_state->num);
-            value = state->transition.argument;
-            prev_req = &state->executed_req;
+                      simgrid::mc::request_to_string(prev_req, value, simgrid::mc::RequestType::internal).c_str(),
+                      prev_state->num_);
+            value    = state->transition_.argument_;
+            prev_req = &state->executed_req_;
             XBT_DEBUG("%s (state=%d)",
-              simgrid::mc::request_to_string(
-                prev_req, value, simgrid::mc::RequestType::executed).c_str(),
-              state->num);
+                      simgrid::mc::request_to_string(prev_req, value, simgrid::mc::RequestType::executed).c_str(),
+                      state->num_);
           }
 
-          if (not prev_state->actorStates[issuer->get_pid()].isDone())
-            prev_state->addInterleavingSet(issuer);
+          if (not prev_state->actor_states_[issuer->get_pid()].is_done())
+            prev_state->add_interleaving_set(issuer);
           else
-            XBT_DEBUG("Process %p is in done set", req->issuer);
+            XBT_DEBUG("Process %p is in done set", req->issuer_);
 
           break;
 
-        } else if (req->issuer == prev_state->internal_req.issuer) {
+        } else if (req->issuer_ == prev_state->internal_req.issuer_) {
 
-          XBT_DEBUG("Simcall %d and %d with same issuer", req->call, prev_state->internal_req.call);
+          XBT_DEBUG("Simcall %s and %s with same issuer", SIMIX_simcall_name(req->call_),
+                    SIMIX_simcall_name(prev_state->internal_req.call_));
           break;
 
         } else {
 
           const smx_actor_t previous_issuer = MC_smx_simcall_get_issuer(&prev_state->internal_req);
-          XBT_DEBUG("Simcall %d, process %ld (state %d) and simcall %d, process %ld (state %d) are independent",
-                    req->call, issuer->get_pid(), state->num, prev_state->internal_req.call, previous_issuer->get_pid(),
-                    prev_state->num);
+          XBT_DEBUG("Simcall %s, process %ld (state %d) and simcall %s, process %ld (state %d) are independent",
+                    SIMIX_simcall_name(req->call_), issuer->get_pid(), state->num_,
+                    SIMIX_simcall_name(prev_state->internal_req.call_), previous_issuer->get_pid(), prev_state->num_);
         }
       }
     }
 
-    if (state->interleaveSize()
-        && stack_.size() < (std::size_t) _sg_mc_max_depth) {
+    if (state->interleave_size() && 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 %zu", 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 %zu done", stack_.back()->num, stack_.size());
+      this->restore_state();
+      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 %zu", state->num, stack_.size() + 1);
+      XBT_DEBUG("Delete state %d at depth %zu", state->num_, stack_.size() + 1);
     }
   }
 }
 
-void SafetyChecker::restoreState()
+void SafetyChecker::restore_state()
 {
   /* Intermediate backtracking */
   simgrid::mc::State* last_state = stack_.back().get();
   if (last_state->system_state) {
-    simgrid::mc::restore_snapshot(last_state->system_state);
+    last_state->system_state->restore(&mc_model_checker->process());
     return;
   }
 
   /* Restore the initial state */
-  simgrid::mc::session->restoreInitialState();
+  simgrid::mc::session->restore_initial_state();
 
   /* Traverse the stack from the state at position start and re-execute the transitions */
   for (std::unique_ptr<simgrid::mc::State> const& state : stack_) {
     if (state == stack_.back())
       break;
-    session->execute(state->transition);
+    session->execute(state->transition_);
     /* Update statistics */
     mc_model_checker->visited_states++;
     mc_model_checker->executed_transitions++;
@@ -308,15 +298,15 @@ SafetyChecker::SafetyChecker(Session& s) : Checker(s)
   XBT_DEBUG("Starting the safety algorithm");
 
   std::unique_ptr<simgrid::mc::State> initial_state =
-      std::unique_ptr<simgrid::mc::State>(new simgrid::mc::State(++expandedStatesCount_));
+      std::unique_ptr<simgrid::mc::State>(new simgrid::mc::State(++expanded_states_count_));
 
   XBT_DEBUG("**************************************************");
   XBT_DEBUG("Initial state");
 
   /* Get an enabled actor and insert it in the interleave set of the initial state */
   for (auto& actor : mc_model_checker->process().actors())
-    if (simgrid::mc::actor_is_enabled(actor.copy.getBuffer())) {
-      initial_state->addInterleavingSet(actor.copy.getBuffer());
+    if (simgrid::mc::actor_is_enabled(actor.copy.get_buffer())) {
+      initial_state->add_interleaving_set(actor.copy.get_buffer());
       if (reductionMode_ != simgrid::mc::ReductionMode::none)
         break;
     }
index d7b5ce8..1377934 100644 (file)
@@ -7,16 +7,15 @@
 #ifndef SIMGRID_MC_SAFETY_CHECKER_HPP
 #define SIMGRID_MC_SAFETY_CHECKER_HPP
 
+#include "src/mc/VisitedState.hpp"
+#include "src/mc/checker/Checker.hpp"
+#include "src/mc/mc_safety.hpp"
+
 #include <list>
 #include <memory>
 #include <string>
 #include <vector>
 
-#include "src/mc/VisitedState.hpp"
-#include "src/mc/checker/Checker.hpp"
-#include "src/mc/mc_forward.hpp"
-#include "src/mc/mc_safety.hpp"
-
 namespace simgrid {
 namespace mc {
 
@@ -26,19 +25,20 @@ public:
   explicit SafetyChecker(Session& session);
   ~SafetyChecker() = default;
   void run() override;
-  RecordTrace getRecordTrace() override;
-  std::vector<std::string> getTextualTrace() override;
-  void logState() override;
+  RecordTrace get_record_trace() override;
+  std::vector<std::string> get_textual_trace() override;
+  void log_state() override;
+
 private:
-  void checkNonTermination(simgrid::mc::State* current_state);
+  void check_non_termination(simgrid::mc::State* current_state);
   void backtrack();
-  void restoreState();
+  void restore_state();
 
   /** Stack representing the position in the exploration graph */
   std::list<std::unique_ptr<simgrid::mc::State>> stack_;
-  simgrid::mc::VisitedStates visitedStates_;
-  std::unique_ptr<simgrid::mc::VisitedState> visitedState_;
-  unsigned long expandedStatesCount_ = 0;
+  simgrid::mc::VisitedStates visited_states_;
+  std::unique_ptr<simgrid::mc::VisitedState> visited_state_;
+  unsigned long expanded_states_count_ = 0;
 };
 
 }
diff --git a/src/mc/checker/SimcallInspector.hpp b/src/mc/checker/SimcallInspector.hpp
new file mode 100644 (file)
index 0000000..525f3a5
--- /dev/null
@@ -0,0 +1,40 @@
+/* Copyright (c) 2019. The SimGrid Team. All rights reserved.          */
+
+/* This program 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_SIMCALL_INSPECTOR_HPP
+#define SIMGRID_MC_SIMCALL_INSPECTOR_HPP
+
+#include <string>
+
+namespace simgrid {
+namespace mc {
+
+class SimcallInspector {
+public:
+  /** Whether this transition can currently be taken without blocking.
+   *
+   * For example, a mutex_lock is not enabled when the mutex is not free.
+   * A comm_receive is not enabled before the corresponding send has been issued.
+   */
+  virtual bool is_enabled() { return true; }
+
+  /** Prepare the simcall to be executed
+   *
+   * Do the choices that the platform would have done in non-MC settings.
+   * For example if it's a waitany, pick the communication that should finish first.
+   * If it's a random(), choose the next value to explore.
+   */
+  virtual void arm() {}
+
+  /** Some simcalls may only be observable under some circomstances.
+   * Most simcalls are not visible from the MC because they don't have an inspector at all. */
+  virtual bool is_visible() { return true; }
+  virtual std::string to_string() = 0;
+  virtual std::string dot_label() = 0;
+};
+} // namespace mc
+} // namespace simgrid
+
+#endif
index e8c0ca8..010cbfe 100644 (file)
@@ -5,11 +5,14 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/sg_config.hpp"
+#include "src/mc/Session.hpp"
 #include "src/mc/checker/Checker.hpp"
+#include "src/mc/mc_config.hpp"
 #include "src/mc/mc_exit.hpp"
 
 #include <cstring>
 #include <memory>
+#include <unistd.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_main, mc, "Entry point for simgrid-mc");
 
@@ -22,7 +25,7 @@ char** argvdup(int argc, char** argv)
   return argv_copy;
 }
 
-static std::unique_ptr<simgrid::mc::Checker> createChecker(simgrid::mc::Session& session)
+static std::unique_ptr<simgrid::mc::Checker> create_checker(simgrid::mc::Session& session)
 {
   if (_sg_mc_comms_determinism || _sg_mc_send_determinism)
     return std::unique_ptr<simgrid::mc::Checker>(simgrid::mc::createCommunicationDeterminismChecker(session));
@@ -34,48 +37,34 @@ static std::unique_ptr<simgrid::mc::Checker> createChecker(simgrid::mc::Session&
 
 int main(int argc, char** argv)
 {
-  using simgrid::mc::Session;
+  if (argc < 2)
+    xbt_die("Missing arguments.\n");
 
-  try {
-    if (argc < 2)
-      xbt_die("Missing arguments.\n");
-
-    // Currently, we need this before sg_config_init:
-    _sg_do_model_check = 1;
+  // Currently, we need this before sg_config_init:
+  _sg_do_model_check = 1;
 
-    // The initialization function can touch argv.
-    // We make a copy of argv before modifying it in order to pass the original
-    // value to the model-checked:
-    char** argv_copy = argvdup(argc, argv);
-    xbt_log_init(&argc, argv);
-    sg_config_init(&argc, argv);
+  // The initialization function can touch argv.
+  // We make a copy of argv before modifying it in order to pass the original
+  // value to the model-checked:
+  char** argv_copy = argvdup(argc, argv);
+  xbt_log_init(&argc, argv);
+  sg_config_init(&argc, argv);
 
-    std::unique_ptr<Session> session =
-      std::unique_ptr<Session>(Session::spawnvp(argv_copy[1], argv_copy+1));
-    delete[] argv_copy;
+  simgrid::mc::session = new simgrid::mc::Session([argv_copy] { execvp(argv_copy[1], argv_copy + 1); });
+  delete[] argv_copy;
 
-    simgrid::mc::session = session.get();
-    std::unique_ptr<simgrid::mc::Checker> checker = createChecker(*session);
-    int res = SIMGRID_MC_EXIT_SUCCESS;
-    try {
-      checker->run();
-    } catch (simgrid::mc::DeadlockError& de) {
-      res = SIMGRID_MC_EXIT_DEADLOCK;
-    } catch (simgrid::mc::TerminationError& te) {
-      res = SIMGRID_MC_EXIT_NON_TERMINATION;
-    } catch (simgrid::mc::LivenessError& le) {
-      res = SIMGRID_MC_EXIT_LIVENESS;
-    }
-    checker = nullptr;
-    session->close();
-    return res;
-  }
-  catch(std::exception& e) {
-    XBT_ERROR("Exception: %s", e.what());
-    return SIMGRID_MC_EXIT_ERROR;
-  }
-  catch(...) {
-    XBT_ERROR("Unknown exception");
-    return SIMGRID_MC_EXIT_ERROR;
+  std::unique_ptr<simgrid::mc::Checker> checker = create_checker(*simgrid::mc::session);
+  int res                                       = SIMGRID_MC_EXIT_SUCCESS;
+  try {
+    checker->run();
+  } catch (const simgrid::mc::DeadlockError&) {
+    res = SIMGRID_MC_EXIT_DEADLOCK;
+  } catch (const simgrid::mc::TerminationError&) {
+    res = SIMGRID_MC_EXIT_NON_TERMINATION;
+  } catch (const simgrid::mc::LivenessError&) {
+    res = SIMGRID_MC_EXIT_LIVENESS;
   }
+  checker = nullptr;
+  simgrid::mc::session->close();
+  return res;
 }
index 7149a71..f302e81 100644 (file)
@@ -5,69 +5,21 @@
 
 /** \file compare.cpp Memory snapshooting and comparison                    */
 
-#include <cinttypes>
-
-#include <array>
-#include <memory>
-#include <set>
-#include <utility>
-#include <unordered_set>
-
-#include "xbt/dynar.h"
-#include "xbt/sysdep.h"
-#include <xbt/mmalloc.h>
-
-#include <mc/mc.h>
-#include <mc/datatypes.h>
-
-#include "src/internal_config.h"
-
-#include "src/xbt/mmalloc/mmprivate.h"
-
-#if HAVE_SMPI
-#include "src/smpi/include/private.hpp"
-#endif
-
-#include "src/mc/Frame.hpp"
-#include "src/mc/ObjectInformation.hpp"
-#include "src/mc/Type.hpp"
-#include "src/mc/Variable.hpp"
 #include "src/mc/mc_config.hpp"
-#include "src/mc/mc_dwarf.hpp"
-#include "src/mc/mc_forward.hpp"
 #include "src/mc/mc_private.hpp"
 #include "src/mc/mc_smx.hpp"
-#include "src/mc/sosp/mc_snapshot.hpp"
+#include "src/mc/sosp/Snapshot.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_compare, xbt, "Logging specific to mc_compare in mc");
 
+using simgrid::mc::remote;
+
 namespace simgrid {
 namespace mc {
 
-struct HeapLocation;
-typedef std::array<HeapLocation, 2> HeapLocationPair;
-typedef std::set<HeapLocationPair> HeapLocationPairs;
-struct HeapArea;
-struct ProcessComparisonState;
-struct StateComparator;
-
-static int compare_heap_area(
-  StateComparator& state,
-  int process_index, const void *area1, const void* area2,
-  Snapshot* snapshot1, Snapshot* snapshot2,
-  HeapLocationPairs* previous, Type* type, int pointer_level);
-
-}
-}
-
-using simgrid::mc::remote;
-
 /*********************************** Heap comparison ***********************************/
 /***************************************************************************************/
 
-namespace simgrid {
-namespace mc {
-
 class HeapLocation {
 public:
   int block_    = 0;
@@ -86,14 +38,8 @@ public:
   }
 };
 
-static inline
-HeapLocationPair makeHeapLocationPair(int block1, int fragment1, int block2, int fragment2)
-{
-  return simgrid::mc::HeapLocationPair{{
-    simgrid::mc::HeapLocation(block1, fragment1),
-    simgrid::mc::HeapLocation(block2, fragment2)
-  }};
-}
+typedef std::array<HeapLocation, 2> HeapLocationPair;
+typedef std::set<HeapLocationPair> HeapLocationPairs;
 
 class HeapArea : public HeapLocation {
 public:
@@ -109,85 +55,47 @@ public:
 
 class ProcessComparisonState {
 public:
-  std::vector<simgrid::mc::IgnoredHeapRegion>* to_ignore = nullptr;
+  const std::vector<simgrid::mc::IgnoredHeapRegion>* to_ignore = nullptr;
   std::vector<HeapArea> equals_to;
   std::vector<simgrid::mc::Type*> types;
   std::size_t heapsize = 0;
 
-  void initHeapInformation(xbt_mheap_t heap, std::vector<simgrid::mc::IgnoredHeapRegion>* i);
-};
-
-namespace {
-
-/** A hash which works with more stuff
- *
- *  It can hash pairs: the standard hash currently doesn't include this.
- */
-template <class X> class hash : public std::hash<X> {
-};
-
-template <class X, class Y> class hash<std::pair<X, Y>> {
-public:
-  std::size_t operator()(std::pair<X,Y>const& x) const
-  {
-    hash<X> h1;
-    hash<X> h2;
-    return h1(x.first) ^ h2(x.second);
-  }
+  void initHeapInformation(xbt_mheap_t heap, const std::vector<simgrid::mc::IgnoredHeapRegion>& i);
 };
 
-}
-
 class StateComparator {
 public:
   s_xbt_mheap_t std_heap_copy;
   std::size_t heaplimit;
   std::array<ProcessComparisonState, 2> processStates;
 
-  std::unordered_set<std::pair<void*, void*>, hash<std::pair<void*, void*>>> compared_pointers;
+  std::unordered_set<std::pair<const void*, const void*>, simgrid::xbt::hash<std::pair<const void*, const void*>>>
+      compared_pointers;
 
   void clear()
   {
     compared_pointers.clear();
   }
 
-  int initHeapInformation(
-    xbt_mheap_t heap1, xbt_mheap_t heap2,
-    std::vector<simgrid::mc::IgnoredHeapRegion>* i1,
-    std::vector<simgrid::mc::IgnoredHeapRegion>* i2);
+  int initHeapInformation(xbt_mheap_t heap1, xbt_mheap_t heap2, const std::vector<simgrid::mc::IgnoredHeapRegion>& i1,
+                          const std::vector<simgrid::mc::IgnoredHeapRegion>& i2);
 
-  HeapArea& equals_to1_(std::size_t i, std::size_t j)
+  template <int rank> HeapArea& equals_to_(std::size_t i, std::size_t j)
   {
-    return processStates[0].equals_to[ MAX_FRAGMENT_PER_BLOCK * i + j];
+    return processStates[rank - 1].equals_to[MAX_FRAGMENT_PER_BLOCK * i + j];
   }
-  HeapArea& equals_to2_(std::size_t i, std::size_t j)
+  template <int rank> Type*& types_(std::size_t i, std::size_t j)
   {
-    return processStates[1].equals_to[ MAX_FRAGMENT_PER_BLOCK * i + j];
-  }
-  Type*& types1_(std::size_t i, std::size_t j)
-  {
-    return processStates[0].types[ MAX_FRAGMENT_PER_BLOCK * i + j];
-  }
-  Type*& types2_(std::size_t i, std::size_t j)
-  {
-    return processStates[1].types[ MAX_FRAGMENT_PER_BLOCK * i + j];
+    return processStates[rank - 1].types[MAX_FRAGMENT_PER_BLOCK * i + j];
   }
 
-  HeapArea const& equals_to1_(std::size_t i, std::size_t j) const
-  {
-    return processStates[0].equals_to[ MAX_FRAGMENT_PER_BLOCK * i + j];
-  }
-  HeapArea const& equals_to2_(std::size_t i, std::size_t j) const
+  template <int rank> HeapArea const& equals_to_(std::size_t i, std::size_t j) const
   {
-    return processStates[1].equals_to[ MAX_FRAGMENT_PER_BLOCK * i + j];
+    return processStates[rank - 1].equals_to[MAX_FRAGMENT_PER_BLOCK * i + j];
   }
-  Type* const& types1_(std::size_t i, std::size_t j) const
+  template <int rank> Type* const& types_(std::size_t i, std::size_t j) const
   {
-    return processStates[0].types[ MAX_FRAGMENT_PER_BLOCK * i + j];
-  }
-  Type* const& types2_(std::size_t i, std::size_t j) const
-  {
-    return processStates[1].types[ MAX_FRAGMENT_PER_BLOCK * i + j];
+    return processStates[rank - 1].types[MAX_FRAGMENT_PER_BLOCK * i + j];
   }
 
   /** Check whether two blocks are known to be matching
@@ -198,7 +106,7 @@ public:
    */
   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_to_<1>(b1, 0).block_ == b2 && this->equals_to_<2>(b2, 0).block_ == b1;
   }
 
   /** Check whether two fragments are known to be matching
@@ -211,8 +119,8 @@ public:
    */
   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_to_<1>(b1, f1).block_ == b2 && this->equals_to_<1>(b1, f1).fragment_ == f2 &&
+           this->equals_to_<2>(b2, f2).block_ == b1 && this->equals_to_<2>(b2, f2).fragment_ == f1;
   }
 
   void match_equals(HeapLocationPairs* list);
@@ -223,9 +131,8 @@ public:
 
 /************************************************************************************/
 
-static ssize_t heap_comparison_ignore_size(
-  std::vector<simgrid::mc::IgnoredHeapRegion>* ignore_list,
-  const void *address)
+static ssize_t heap_comparison_ignore_size(const std::vector<simgrid::mc::IgnoredHeapRegion>* ignore_list,
+                                           const void* address)
 {
   int start = 0;
   int end = ignore_list->size() - 1;
@@ -268,28 +175,27 @@ 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_);
+      this->equals_to_<1>(pair[0].block_, pair[0].fragment_) = simgrid::mc::HeapArea(pair[1].block_, pair[1].fragment_);
+      this->equals_to_<2>(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_to_<1>(pair[0].block_, 0) = simgrid::mc::HeapArea(pair[1].block_, pair[1].fragment_);
+      this->equals_to_<2>(pair[1].block_, 0) = simgrid::mc::HeapArea(pair[0].block_, pair[0].fragment_);
     }
   }
 }
 
-void ProcessComparisonState::initHeapInformation(xbt_mheap_t heap,
-                        std::vector<simgrid::mc::IgnoredHeapRegion>* i)
+void ProcessComparisonState::initHeapInformation(xbt_mheap_t heap, const std::vector<simgrid::mc::IgnoredHeapRegion>& i)
 {
   auto heaplimit  = heap->heaplimit;
   this->heapsize  = heap->heapsize;
-  this->to_ignore = i;
+  this->to_ignore = &i;
   this->equals_to.assign(heaplimit * MAX_FRAGMENT_PER_BLOCK, HeapArea());
   this->types.assign(heaplimit * MAX_FRAGMENT_PER_BLOCK, nullptr);
 }
 
 int StateComparator::initHeapInformation(xbt_mheap_t heap1, xbt_mheap_t heap2,
-                          std::vector<simgrid::mc::IgnoredHeapRegion>* i1,
-                          std::vector<simgrid::mc::IgnoredHeapRegion>* i2)
+                                         const std::vector<simgrid::mc::IgnoredHeapRegion>& i1,
+                                         const std::vector<simgrid::mc::IgnoredHeapRegion>& i2)
 {
   if ((heap1->heaplimit != heap2->heaplimit) || (heap1->heapsize != heap2->heapsize))
     return -1;
@@ -301,135 +207,117 @@ int StateComparator::initHeapInformation(xbt_mheap_t heap1, xbt_mheap_t heap2,
 }
 
 // TODO, have a robust way to find it in O(1)
-static inline
-mc_mem_region_t MC_get_heap_region(simgrid::mc::Snapshot* snapshot)
+static inline Region* MC_get_heap_region(const Snapshot& snapshot)
 {
-  for (auto const& 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");
 }
 
-static
-int mmalloc_compare_heap(
-  simgrid::mc::StateComparator& state, simgrid::mc::Snapshot* snapshot1, simgrid::mc::Snapshot* snapshot2)
-{
-  simgrid::mc::RemoteClient* process = &mc_model_checker->process();
+static bool heap_area_differ(StateComparator& state, const void* area1, const void* area2, const Snapshot& snapshot1,
+                             const Snapshot& snapshot2, HeapLocationPairs* previous, Type* type, int pointer_level);
 
-  /* Start comparison */
-  size_t i1;
-  size_t i2;
-  size_t j1;
-  size_t j2;
-  size_t k;
-  void* addr_block1;
-  void* addr_block2;
-  void* addr_frag1;
-  void* addr_frag2;
-  int nb_diff1 = 0;
-  int nb_diff2 = 0;
-  int equal;
+static bool mmalloc_heap_differ(simgrid::mc::StateComparator& state, const simgrid::mc::Snapshot& snapshot1,
+                                const simgrid::mc::Snapshot& snapshot2)
+{
+  const simgrid::mc::RemoteClient& process = mc_model_checker->process();
 
   /* Check busy blocks */
-  i1 = 1;
+  size_t i1 = 1;
 
   malloc_info heapinfo_temp1;
   malloc_info heapinfo_temp2;
   malloc_info heapinfo_temp2b;
 
-  mc_mem_region_t heap_region1 = MC_get_heap_region(snapshot1);
-  mc_mem_region_t heap_region2 = MC_get_heap_region(snapshot2);
+  simgrid::mc::Region* heap_region1 = MC_get_heap_region(snapshot1);
+  simgrid::mc::Region* heap_region2 = MC_get_heap_region(snapshot2);
 
   // This is the address of std_heap->heapinfo in the application process:
-  void* heapinfo_address = &((xbt_mheap_t) process->heap_address)->heapinfo;
+  void* heapinfo_address = &((xbt_mheap_t)process.heap_address)->heapinfo;
 
   // This is in snapshot do not use them directly:
-  const malloc_info* heapinfos1 = snapshot1->read<malloc_info*>(
-      RemotePtr<malloc_info*>((std::uint64_t)heapinfo_address), simgrid::mc::ProcessIndexMissing);
-  const malloc_info* heapinfos2 = snapshot2->read<malloc_info*>(
-      RemotePtr<malloc_info*>((std::uint64_t)heapinfo_address), simgrid::mc::ProcessIndexMissing);
+  const malloc_info* heapinfos1 =
+      snapshot1.read<malloc_info*>(RemotePtr<malloc_info*>((std::uint64_t)heapinfo_address));
+  const malloc_info* heapinfos2 =
+      snapshot2.read<malloc_info*>(RemotePtr<malloc_info*>((std::uint64_t)heapinfo_address));
 
   while (i1 < state.heaplimit) {
 
-    const malloc_info* heapinfo1 = (const malloc_info*) MC_region_read(heap_region1, &heapinfo_temp1, &heapinfos1[i1], sizeof(malloc_info));
-    const malloc_info* heapinfo2 = (const malloc_info*) MC_region_read(heap_region2, &heapinfo_temp2, &heapinfos2[i1], sizeof(malloc_info));
+    const malloc_info* heapinfo1 =
+        (const malloc_info*)heap_region1->read(&heapinfo_temp1, &heapinfos1[i1], sizeof(malloc_info));
+    const malloc_info* heapinfo2 =
+        (const malloc_info*)heap_region2->read(&heapinfo_temp2, &heapinfos2[i1], sizeof(malloc_info));
 
     if (heapinfo1->type == MMALLOC_TYPE_FREE || heapinfo1->type == MMALLOC_TYPE_HEAPINFO) {      /* Free block */
       i1 ++;
       continue;
     }
 
-    if (heapinfo1->type < 0) {
-      fprintf(stderr, "Unkown mmalloc block type.\n");
-      abort();
-    }
+    xbt_assert(heapinfo1->type >= 0, "Unkown mmalloc block type: %d", heapinfo1->type);
 
-    addr_block1 = ((void*)(((ADDR2UINT(i1)) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase));
+    void* addr_block1 = ((void*)(((ADDR2UINT(i1)) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase));
 
     if (heapinfo1->type == MMALLOC_TYPE_UNFRAGMENTED) {       /* Large block */
 
       if (is_stack(addr_block1)) {
-        for (k = 0; k < heapinfo1->busy_block.size; k++)
-          state.equals_to1_(i1 + k, 0) = HeapArea(i1, -1);
-        for (k = 0; k < heapinfo2->busy_block.size; k++)
-          state.equals_to2_(i1 + k, 0) = HeapArea(i1, -1);
+        for (size_t k = 0; k < heapinfo1->busy_block.size; k++)
+          state.equals_to_<1>(i1 + k, 0) = HeapArea(i1, -1);
+        for (size_t k = 0; k < heapinfo2->busy_block.size; k++)
+          state.equals_to_<2>(i1 + k, 0) = HeapArea(i1, -1);
         i1 += heapinfo1->busy_block.size;
         continue;
       }
 
-      if (state.equals_to1_(i1, 0).valid_) {
+      if (state.equals_to_<1>(i1, 0).valid_) {
         i1++;
         continue;
       }
 
-      i2          = 1;
-      equal       = 0;
+      size_t i2 = 1;
+      bool equal = false;
 
       /* Try first to associate to same block in the other heap */
-      if (heapinfo2->type == heapinfo1->type && state.equals_to2_(i1, 0).valid_ == 0) {
-        addr_block2 = (ADDR2UINT(i1) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase;
-        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);
-          for (k = 1; k < heapinfo1->busy_block.size; k++)
-            state.equals_to1_(i1 + k, 0) = HeapArea(i1, -1);
-          equal = 1;
+      if (heapinfo2->type == heapinfo1->type && state.equals_to_<2>(i1, 0).valid_ == 0) {
+        void* addr_block2 = (ADDR2UINT(i1) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase;
+        if (not heap_area_differ(state, addr_block1, addr_block2, snapshot1, snapshot2, nullptr, nullptr, 0)) {
+          for (size_t k = 1; k < heapinfo2->busy_block.size; k++)
+            state.equals_to_<2>(i1 + k, 0) = HeapArea(i1, -1);
+          for (size_t k = 1; k < heapinfo1->busy_block.size; k++)
+            state.equals_to_<1>(i1 + k, 0) = HeapArea(i1, -1);
+          equal = true;
           i1 += heapinfo1->busy_block.size;
         }
       }
 
       while (i2 < state.heaplimit && not equal) {
 
-        addr_block2 = (ADDR2UINT(i2) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase;
+        void* addr_block2 = (ADDR2UINT(i2) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase;
 
         if (i2 == i1) {
           i2++;
           continue;
         }
 
-        const malloc_info* heapinfo2b = (const malloc_info*) MC_region_read(heap_region2, &heapinfo_temp2b, &heapinfos2[i2], sizeof(malloc_info));
+        const malloc_info* heapinfo2b =
+            (const malloc_info*)heap_region2->read(&heapinfo_temp2b, &heapinfos2[i2], sizeof(malloc_info));
 
         if (heapinfo2b->type != MMALLOC_TYPE_UNFRAGMENTED) {
           i2++;
           continue;
         }
 
-        if (state.equals_to2_(i2, 0).valid_) {
+        if (state.equals_to_<2>(i2, 0).valid_) {
           i2++;
           continue;
         }
 
-        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++)
-            state.equals_to2_(i2 + k, 0) = HeapArea(i1, -1);
-          for (k = 1; k < heapinfo1->busy_block.size; k++)
-            state.equals_to1_(i1 + k, 0) = HeapArea(i2, -1);
-          equal = 1;
+        if (not heap_area_differ(state, addr_block1, addr_block2, snapshot1, snapshot2, nullptr, nullptr, 0)) {
+          for (size_t k = 1; k < heapinfo2b->busy_block.size; k++)
+            state.equals_to_<2>(i2 + k, 0) = HeapArea(i1, -1);
+          for (size_t k = 1; k < heapinfo1->busy_block.size; k++)
+            state.equals_to_<1>(i1 + k, 0) = HeapArea(i2, -1);
+          equal = true;
           i1 += heapinfo1->busy_block.size;
         }
 
@@ -438,43 +326,36 @@ int mmalloc_compare_heap(
 
       if (not equal) {
         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++;
+        return true;
       }
 
     } else {                    /* Fragmented block */
 
-      for (j1 = 0; j1 < (size_t) (BLOCKSIZE >> heapinfo1->type); j1++) {
+      for (size_t j1 = 0; j1 < (size_t)(BLOCKSIZE >> heapinfo1->type); j1++) {
 
         if (heapinfo1->busy_frag.frag_size[j1] == -1) /* Free fragment_ */
           continue;
 
-        if (state.equals_to1_(i1, j1).valid_)
+        if (state.equals_to_<1>(i1, j1).valid_)
           continue;
 
-        addr_frag1 = (void*)((char*)addr_block1 + (j1 << heapinfo1->type));
+        void* addr_frag1 = (void*)((char*)addr_block1 + (j1 << heapinfo1->type));
 
-        i2 = 1;
-        equal = 0;
+        size_t i2 = 1;
+        bool equal = false;
 
         /* 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));
-          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;
+        if (heapinfo2->type == heapinfo1->type && not state.equals_to_<2>(i1, j1).valid_) {
+          void* addr_block2 = (ADDR2UINT(i1) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase;
+          void* addr_frag2  = (void*)((char*)addr_block2 + (j1 << heapinfo2->type));
+          if (not heap_area_differ(state, addr_frag1, addr_frag2, snapshot1, snapshot2, nullptr, nullptr, 0))
+            equal = true;
         }
 
         while (i2 < state.heaplimit && not equal) {
 
-          const malloc_info* heapinfo2b = (const malloc_info*) MC_region_read(
-            heap_region2, &heapinfo_temp2b, &heapinfos2[i2],
-            sizeof(malloc_info));
+          const malloc_info* heapinfo2b =
+              (const malloc_info*)heap_region2->read(&heapinfo_temp2b, &heapinfos2[i2], sizeof(malloc_info));
 
           if (heapinfo2b->type == MMALLOC_TYPE_FREE || heapinfo2b->type == MMALLOC_TYPE_HEAPINFO) {
             i2 ++;
@@ -487,27 +368,21 @@ int mmalloc_compare_heap(
             continue;
           }
 
-          if (heapinfo2b->type < 0) {
-            fprintf(stderr, "Unknown mmalloc block type.\n");
-            abort();
-          }
+          xbt_assert(heapinfo2b->type >= 0, "Unkown mmalloc block type: %d", heapinfo2b->type);
 
-          for (j2 = 0; j2 < (size_t) (BLOCKSIZE >> heapinfo2b->type);
-               j2++) {
+          for (size_t j2 = 0; j2 < (size_t)(BLOCKSIZE >> heapinfo2b->type); j2++) {
 
             if (i2 == i1 && j2 == j1)
               continue;
 
-            if (state.equals_to2_(i2, j2).valid_)
+            if (state.equals_to_<2>(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));
+            void* addr_block2 = (ADDR2UINT(i2) - 1) * BLOCKSIZE + (char*)state.std_heap_copy.heapbase;
+            void* addr_frag2  = (void*)((char*)addr_block2 + (j2 << heapinfo2b->type));
 
-            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;
+            if (not heap_area_differ(state, addr_frag1, addr_frag2, snapshot1, snapshot2, nullptr, nullptr, 0)) {
+              equal = true;
               break;
             }
           }
@@ -518,9 +393,7 @@ int mmalloc_compare_heap(
         if (not equal) {
           XBT_DEBUG("Block %zu, fragment_ %zu not found (size_used = %zd, address = %p)\n", i1, j1,
                     heapinfo1->busy_frag.frag_size[j1], addr_frag1);
-          i1 = state.heaplimit + 1;
-          nb_diff1++;
-          break;
+          return true;
         }
       }
 
@@ -529,57 +402,47 @@ int mmalloc_compare_heap(
   }
 
   /* All blocks/fragments are equal to another block/fragment_ ? */
-  size_t i = 1;
-  size_t j = 0;
-
-  for(i = 1; i < state.heaplimit; i++) {
-    const malloc_info* heapinfo1 = (const malloc_info*) MC_region_read(
-      heap_region1, &heapinfo_temp1, &heapinfos1[i], sizeof(malloc_info));
+  for (size_t i = 1; i < state.heaplimit; i++) {
+    const malloc_info* heapinfo1 =
+        (const malloc_info*)heap_region1->read(&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_to_<1>(i, 0).valid_) {
       XBT_DEBUG("Block %zu not found (size used = %zu)", i, heapinfo1->busy_block.busy_size);
-      nb_diff1++;
+      return true;
     }
 
     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_) {
+    for (size_t j = 0; j < (size_t)(BLOCKSIZE >> heapinfo1->type); j++)
+      if (i1 == state.heaplimit && heapinfo1->busy_frag.frag_size[j] > 0 && not state.equals_to_<1>(i, j).valid_) {
         XBT_DEBUG("Block %zu, Fragment %zu not found (size used = %zd)", i, j, heapinfo1->busy_frag.frag_size[j]);
-        nb_diff1++;
+        return true;
       }
   }
 
-  if (i1 == state.heaplimit)
-    XBT_DEBUG("Number of blocks/fragments not found in heap1: %d", nb_diff1);
-
-  for (i=1; i < state.heaplimit; i++) {
-    const malloc_info* heapinfo2 = (const malloc_info*) MC_region_read(
-      heap_region2, &heapinfo_temp2, &heapinfos2[i], sizeof(malloc_info));
+  for (size_t i = 1; i < state.heaplimit; i++) {
+    const malloc_info* heapinfo2 =
+        (const malloc_info*)heap_region2->read(&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_to_<2>(i, 0).valid_) {
       XBT_DEBUG("Block %zu not found (size used = %zu)", i,
                 heapinfo2->busy_block.busy_size);
-      nb_diff2++;
+      return true;
     }
 
     if (heapinfo2->type <= 0)
       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_) {
+    for (size_t j = 0; j < (size_t)(BLOCKSIZE >> heapinfo2->type); j++)
+      if (i1 == state.heaplimit && heapinfo2->busy_frag.frag_size[j] > 0 && not state.equals_to_<2>(i, j).valid_) {
         XBT_DEBUG("Block %zu, Fragment %zu not found (size used = %zd)",
           i, j, heapinfo2->busy_frag.frag_size[j]);
-        nb_diff2++;
+        return true;
       }
-
   }
 
-  if (i1 == state.heaplimit)
-    XBT_DEBUG("Number of blocks/fragments not found in heap2: %d", nb_diff2);
-
-  return nb_diff1 > 0 || nb_diff2 > 0;
+  return false;
 }
 
 /**
@@ -592,31 +455,27 @@ int mmalloc_compare_heap(
  * @param previous
  * @param size
  * @param check_ignore
+ * @return true when different, false otherwise (same or unknown)
  */
-static int compare_heap_area_without_type(
-  simgrid::mc::StateComparator& state, int process_index,
-  const void *real_area1, const void *real_area2,
-  simgrid::mc::Snapshot* snapshot1,
-  simgrid::mc::Snapshot* snapshot2,
-  HeapLocationPairs* previous, int size,
-  int check_ignore)
+static bool heap_area_differ_without_type(simgrid::mc::StateComparator& state, const void* real_area1,
+                                          const void* real_area2, const simgrid::mc::Snapshot& snapshot1,
+                                          const simgrid::mc::Snapshot& snapshot2, HeapLocationPairs* previous, int size,
+                                          int check_ignore)
 {
-  simgrid::mc::RemoteClient* process = &mc_model_checker->process();
-  mc_mem_region_t heap_region1 = MC_get_heap_region(snapshot1);
-  mc_mem_region_t heap_region2 = MC_get_heap_region(snapshot2);
+  const simgrid::mc::RemoteClient& process = mc_model_checker->process();
+  simgrid::mc::Region* heap_region1  = MC_get_heap_region(snapshot1);
+  simgrid::mc::Region* heap_region2  = MC_get_heap_region(snapshot2);
 
   for (int i = 0; i < size; ) {
 
     if (check_ignore > 0) {
-      ssize_t ignore1 = heap_comparison_ignore_size(
-        state.processStates[0].to_ignore, (char *) real_area1 + i);
+      ssize_t ignore1 = heap_comparison_ignore_size(state.processStates[0].to_ignore, (const char*)real_area1 + i);
       if (ignore1 != -1) {
-        ssize_t ignore2 = heap_comparison_ignore_size(
-          state.processStates[1].to_ignore, (char *) real_area2 + i);
+        ssize_t ignore2 = heap_comparison_ignore_size(state.processStates[1].to_ignore, (const char*)real_area2 + i);
         if (ignore2 == ignore1) {
           if (ignore1 == 0) {
             check_ignore--;
-            return 0;
+            return false;
           } else {
             i = i + ignore2;
             check_ignore--;
@@ -626,41 +485,33 @@ static int compare_heap_area_without_type(
       }
     }
 
-    if (MC_snapshot_region_memcmp(((char *) real_area1) + i, heap_region1, ((char *) real_area2) + i, heap_region2, 1) != 0) {
+    if (MC_snapshot_region_memcmp((const char*)real_area1 + i, heap_region1, (const char*)real_area2 + i, heap_region2,
+                                  1) != 0) {
 
       int pointer_align = (i / sizeof(void *)) * sizeof(void *);
-      const void* addr_pointed1 = snapshot1->read(
-        remote((void**)((char *) real_area1 + pointer_align)), process_index);
-      const void* addr_pointed2 = snapshot2->read(
-        remote((void**)((char *) real_area2 + pointer_align)), process_index);
+      const void* addr_pointed1 = snapshot1.read(remote((void* const*)((const char*)real_area1 + pointer_align)));
+      const void* addr_pointed2 = snapshot2.read(remote((void* const*)((const char*)real_area2 + pointer_align)));
 
-      if (process->in_maestro_stack(remote(addr_pointed1))
-        && process->in_maestro_stack(remote(addr_pointed2))) {
+      if (process.in_maestro_stack(remote(addr_pointed1)) && process.in_maestro_stack(remote(addr_pointed2))) {
         i = pointer_align + sizeof(void *);
         continue;
       }
 
-      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)) {
-        // Both addreses are in the heap:
-        int res_compare = compare_heap_area(state ,process_index,
-          addr_pointed1, addr_pointed2,
-          snapshot1, snapshot2, previous, nullptr, 0);
-        if (res_compare == 1)
-          return res_compare;
+      if (snapshot1.on_heap(addr_pointed1) && snapshot2.on_heap(addr_pointed2)) {
+        // Both addresses are in the heap:
+        if (heap_area_differ(state, addr_pointed1, addr_pointed2, snapshot1, snapshot2, previous, nullptr, 0))
+          return true;
         i = pointer_align + sizeof(void *);
         continue;
       }
 
-      return 1;
+      return true;
     }
 
     i++;
   }
 
-  return 0;
+  return false;
 }
 
 /**
@@ -675,188 +526,169 @@ static int compare_heap_area_without_type(
  * @param area_size      either a byte_size or an elements_count (?)
  * @param check_ignore
  * @param pointer_level
- * @return               0 (same), 1 (different), -1 (unknown)
+ * @return               true when different, false otherwise (same or unknown)
  */
-static int compare_heap_area_with_type(
-  simgrid::mc::StateComparator& state, int process_index,
-  const void *real_area1, const void *real_area2,
-  simgrid::mc::Snapshot* snapshot1,
-  simgrid::mc::Snapshot* snapshot2,
-  HeapLocationPairs* previous, simgrid::mc::Type* type,
-  int area_size, int check_ignore,
-  int pointer_level)
+static bool heap_area_differ_with_type(simgrid::mc::StateComparator& state, const void* real_area1,
+                                       const void* real_area2, const simgrid::mc::Snapshot& snapshot1,
+                                       const simgrid::mc::Snapshot& snapshot2, HeapLocationPairs* previous,
+                                       simgrid::mc::Type* type, int area_size, int check_ignore, int pointer_level)
 {
-  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;
+  // 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 false;
+
+  if (is_stack(real_area1) && is_stack(real_area2))
+    return false;
+
+  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 false;
+  }
 
-    if (is_stack(real_area1) && is_stack(real_area2))
-      return 0;
+  simgrid::mc::Type* subtype;
+  simgrid::mc::Type* subsubtype;
+  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;
-    }
+  simgrid::mc::Region* heap_region1 = MC_get_heap_region(snapshot1);
+  simgrid::mc::Region* heap_region2 = MC_get_heap_region(snapshot2);
 
-    simgrid::mc::Type* subtype;
-    simgrid::mc::Type* subsubtype;
-    int elm_size;
-    const void* addr_pointed1;
-    const void* addr_pointed2;
-
-    mc_mem_region_t heap_region1 = MC_get_heap_region(snapshot1);
-    mc_mem_region_t heap_region2 = MC_get_heap_region(snapshot2);
-
-    switch (type->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;
-        }
+  switch (type->type) {
+    case DW_TAG_unspecified_type:
+      return true;
 
-      case DW_TAG_enumeration_type:
+    case DW_TAG_base_type:
+      if (not type->name.empty() && type->name == "char") { /* String, hence random (arbitrary ?) size */
+        if (real_area1 == real_area2)
+          return false;
+        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;
-        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;
-        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;
-        }
-        for (int i = 0; i < type->element_count; i++) {
-          // TODO, add support for variable stride (DW_AT_byte_stride)
-          int 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_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 false;
+        else
+          return MC_snapshot_region_memcmp(real_area1, heap_region1, real_area2, heap_region2, type->byte_size) != 0;
+      }
+
+    case DW_TAG_enumeration_type:
+      if (area_size != -1 && type->byte_size != area_size)
+        return false;
+      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:
+      return heap_area_differ_with_type(state, real_area1, real_area2, snapshot1, snapshot2, previous, type->subtype,
+                                        area_size, check_ignore, pointer_level);
+
+    case DW_TAG_array_type:
+      subtype = type->subtype;
+      switch (subtype->type) {
+        case DW_TAG_unspecified_type:
+          return true;
+
+        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 false;
+      }
+      for (int i = 0; i < type->element_count; i++) {
+        // TODO, add support for variable stride (DW_AT_byte_stride)
+        if (heap_area_differ_with_type(state, (const char*)real_area1 + (i * elm_size),
+                                       (const char*)real_area2 + (i * elm_size), snapshot1, snapshot2, previous,
+                                       type->subtype, subtype->byte_size, check_ignore, pointer_level))
+          return true;
+      }
+      return false;
+
+    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* const*)real_area1));
+        addr_pointed2 = snapshot2.read(remote((void* const*)real_area2));
+        return (addr_pointed1 != addr_pointed2);
+      }
+      pointer_level++;
+      if (pointer_level <= 1) {
+        addr_pointed1 = snapshot1.read(remote((void* const*)real_area1));
+        addr_pointed2 = snapshot2.read(remote((void* const*)real_area2));
+        if (snapshot1.on_heap(addr_pointed1) && snapshot2.on_heap(addr_pointed2))
+          return heap_area_differ(state, 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* const*)((const char*)real_area1 + i * sizeof(void*))));
+        addr_pointed2 = snapshot2.read(remote((void* const*)((const char*)real_area2 + i * sizeof(void*))));
+        bool differ   = snapshot1.on_heap(addr_pointed1) && snapshot2.on_heap(addr_pointed2)
+                          ? heap_area_differ(state, addr_pointed1, addr_pointed2, snapshot1, snapshot2, previous,
+                                             type->subtype, pointer_level)
+                          : addr_pointed1 != addr_pointed2;
+        if (differ)
+          return true;
+      }
+      return false;
+
+    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 false;
+        for (size_t i = 0; i < (size_t)(area_size / type->byte_size); i++) {
+          if (heap_area_differ_with_type(state, (const char*)real_area1 + i * type->byte_size,
+                                         (const char*)real_area2 + i * type->byte_size, snapshot1, snapshot2, previous,
+                                         type, -1, check_ignore, 0))
+            return true;
         }
-        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);
-          int res;
-          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_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;
+            void* real_member1 = simgrid::dwarf::resolve_member(real_area1, type, &member, &snapshot1);
+            void* real_member2 = simgrid::dwarf::resolve_member(real_area2, type, &member, &snapshot2);
+            if (heap_area_differ_with_type(state, real_member1, real_member2, snapshot1, snapshot2, previous,
+                                           member.type, -1, check_ignore, 0))
+              return true;
           }
         }
-        return 0;
+        return false;
 
-      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_union_type:
+      return heap_area_differ_without_type(state, real_area1, real_area2, snapshot1, snapshot2, previous,
+                                           type->byte_size, check_ignore);
 
-      default:
-        return 0;
-    }
-
-    xbt_die("Unreachable");
-  } while (true);
+    default:
+      THROW_IMPOSSIBLE;
+  }
 }
 
 /** Infer the type of a part of the block from the type of the block
@@ -869,9 +701,8 @@ static int compare_heap_area_with_type(
  * @param  area_size
  * @return                    DWARF type ID for given offset
  */
-static simgrid::mc::Type* get_offset_type(void *real_base_address, simgrid::mc::Type* type,
-                                 int offset, int area_size,
-                                 simgrid::mc::Snapshot* snapshot, int process_index)
+static simgrid::mc::Type* get_offset_type(void* real_base_address, simgrid::mc::Type* type, int offset, int area_size,
+                                          const simgrid::mc::Snapshot& snapshot)
 {
 
   // Beginning of the block, the infered variable type if the type of the block:
@@ -897,7 +728,7 @@ static simgrid::mc::Type* get_offset_type(void *real_base_address, simgrid::mc::
         if (member.offset() == offset)
           return member.type;
       } else {
-        void* real_member = simgrid::dwarf::resolve_member(real_base_address, type, &member, snapshot, process_index);
+        void* real_member = simgrid::dwarf::resolve_member(real_base_address, type, &member, &snapshot);
         if ((char*)real_member - (char*)real_base_address == offset)
           return member.type;
       }
@@ -920,17 +751,13 @@ static simgrid::mc::Type* get_offset_type(void *real_base_address, simgrid::mc::
  * @param previous       Pairs of blocks already compared on the current path (or nullptr)
  * @param type_id        Type of variable
  * @param pointer_level
- * @return 0 (same), 1 (different), -1
+ * @return true when different, false otherwise (same or unknown)
  */
-static
-int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
-                      const void *area1, const void *area2,
-                      simgrid::mc::Snapshot* snapshot1,
-                      simgrid::mc::Snapshot* snapshot2,
-                      HeapLocationPairs* previous,
-                      simgrid::mc::Type* type, int pointer_level)
+static bool heap_area_differ(simgrid::mc::StateComparator& state, const void* area1, const void* area2,
+                             const simgrid::mc::Snapshot& snapshot1, const simgrid::mc::Snapshot& snapshot2,
+                             HeapLocationPairs* previous, simgrid::mc::Type* type, int pointer_level)
 {
-  simgrid::mc::RemoteClient* process = &mc_model_checker->process();
+  const simgrid::mc::RemoteClient& process = mc_model_checker->process();
 
   ssize_t block1;
   ssize_t block2;
@@ -949,10 +776,10 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
   bool match_pairs = false;
 
   // This is the address of std_heap->heapinfo in the application process:
-  void* heapinfo_address = &((xbt_mheap_t) process->heap_address)->heapinfo;
+  void* heapinfo_address = &((xbt_mheap_t)process.heap_address)->heapinfo;
 
-  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);
+  const malloc_info* heapinfos1 = snapshot1.read(remote((const malloc_info**)heapinfo_address));
+  const malloc_info* heapinfos2 = snapshot2.read(remote((const malloc_info**)heapinfo_address));
 
   malloc_info heapinfo_temp1;
   malloc_info heapinfo_temp2;
@@ -969,17 +796,17 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
 
   // If either block is a stack block:
   if (is_block_stack((int) block1) && is_block_stack((int) block2)) {
-    previous->insert(simgrid::mc::makeHeapLocationPair(block1, -1, block2, -1));
+    previous->insert(HeapLocationPair{{HeapLocation(block1, -1), HeapLocation(block2, -1)}});
     if (match_pairs)
       state.match_equals(previous);
-    return 0;
+    return false;
   }
 
   // If either block is not in the expected area of memory:
   if (((char*)area1 < (char*)state.std_heap_copy.heapbase) || (block1 > (ssize_t)state.processStates[0].heapsize) ||
       (block1 < 1) || ((char*)area2 < (char*)state.std_heap_copy.heapbase) ||
       (block2 > (ssize_t)state.processStates[1].heapsize) || (block2 < 1)) {
-    return 1;
+    return true;
   }
 
   // Process address of the block:
@@ -1003,20 +830,20 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
 
   }
 
-  mc_mem_region_t heap_region1 = MC_get_heap_region(snapshot1);
-  mc_mem_region_t heap_region2 = MC_get_heap_region(snapshot2);
+  simgrid::mc::Region* heap_region1 = MC_get_heap_region(snapshot1);
+  simgrid::mc::Region* heap_region2 = MC_get_heap_region(snapshot2);
 
-  const malloc_info* heapinfo1 = (const malloc_info*) MC_region_read(
-    heap_region1, &heapinfo_temp1, &heapinfos1[block1], sizeof(malloc_info));
-  const malloc_info* heapinfo2 = (const malloc_info*) MC_region_read(
-    heap_region2, &heapinfo_temp2, &heapinfos2[block2], sizeof(malloc_info));
+  const malloc_info* heapinfo1 =
+      (const malloc_info*)heap_region1->read(&heapinfo_temp1, &heapinfos1[block1], sizeof(malloc_info));
+  const malloc_info* heapinfo2 =
+      (const malloc_info*)heap_region2->read(&heapinfo_temp2, &heapinfos2[block2], sizeof(malloc_info));
 
   if ((heapinfo1->type == MMALLOC_TYPE_FREE || heapinfo1->type==MMALLOC_TYPE_HEAPINFO)
     && (heapinfo2->type == MMALLOC_TYPE_FREE || heapinfo2->type ==MMALLOC_TYPE_HEAPINFO)) {
     /* Free block */
     if (match_pairs)
       state.match_equals(previous);
-    return 0;
+    return false;
   }
 
   if (heapinfo1->type == MMALLOC_TYPE_UNFRAGMENTED && heapinfo2->type == MMALLOC_TYPE_UNFRAGMENTED) {
@@ -1024,11 +851,11 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
 
     // TODO, lookup variable type from block type as done for fragmented blocks
 
-    if (state.equals_to1_(block1, 0).valid_ && state.equals_to2_(block2, 0).valid_ &&
+    if (state.equals_to_<1>(block1, 0).valid_ && state.equals_to_<2>(block2, 0).valid_ &&
         state.blocksEqual(block1, block2)) {
       if (match_pairs)
         state.match_equals(previous);
-      return 0;
+      return false;
     }
 
     if (type_size != -1 && type_size != (ssize_t)heapinfo1->busy_block.busy_size &&
@@ -1036,18 +863,17 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
         (type->name.empty() || type->name == "struct s_smx_context")) {
       if (match_pairs)
         state.match_equals(previous);
-      return -1;
+      return false;
     }
 
-    if (heapinfo1->busy_block.size != heapinfo2->busy_block.size)
-      return 1;
-    if (heapinfo1->busy_block.busy_size != heapinfo2->busy_block.busy_size)
-      return 1;
+    if (heapinfo1->busy_block.size != heapinfo2->busy_block.size ||
+        heapinfo1->busy_block.busy_size != heapinfo2->busy_block.busy_size)
+      return true;
 
-    if (not previous->insert(simgrid::mc::makeHeapLocationPair(block1, -1, block2, -1)).second) {
+    if (not previous->insert(HeapLocationPair{{HeapLocation(block1, -1), HeapLocation(block2, -1)}}).second) {
       if (match_pairs)
         state.match_equals(previous);
-      return 0;
+      return false;
     }
 
     size = heapinfo1->busy_block.busy_size;
@@ -1055,14 +881,14 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
     // Remember (basic) type inference.
     // The current data structure only allows us to do this for the whole block.
     if (type != nullptr && area1 == real_addr_block1)
-      state.types1_(block1, 0) = type;
+      state.types_<1>(block1, 0) = type;
     if (type != nullptr && area2 == real_addr_block2)
-      state.types2_(block2, 0) = type;
+      state.types_<2>(block2, 0) = type;
 
     if (size <= 0) {
       if (match_pairs)
         state.match_equals(previous);
-      return 0;
+      return false;
     }
 
     if (heapinfo1->busy_block.ignore > 0
@@ -1084,32 +910,32 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
       if (heapinfo1->busy_frag.frag_size[frag1] == -1 || heapinfo2->busy_frag.frag_size[frag2] == -1) {
         if (match_pairs)
           state.match_equals(previous);
-        return -1;
+        return false;
       }
       // ?
       if (type_size != heapinfo1->busy_frag.frag_size[frag1]
           || type_size != heapinfo2->busy_frag.frag_size[frag2]) {
         if (match_pairs)
           state.match_equals(previous);
-        return -1;
+        return false;
       }
     }
 
     // Check if the blocks are already matched together:
-    if (state.equals_to1_(block1, frag1).valid_ && state.equals_to2_(block2, frag2).valid_ && offset1 == offset2 &&
+    if (state.equals_to_<1>(block1, frag1).valid_ && state.equals_to_<2>(block2, frag2).valid_ && offset1 == offset2 &&
         state.fragmentsEqual(block1, frag1, block2, frag2)) {
       if (match_pairs)
         state.match_equals(previous);
-      return 0;
+      return false;
     }
     // Compare the size of both fragments:
     if (heapinfo1->busy_frag.frag_size[frag1] != heapinfo2->busy_frag.frag_size[frag2]) {
       if (type_size == -1) {
         if (match_pairs)
           state.match_equals(previous);
-        return -1;
+        return false;
       } else
-        return 1;
+        return true;
     }
 
     // Size of the fragment_:
@@ -1118,39 +944,33 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
     // Remember (basic) type inference.
     // 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;
+      state.types_<1>(block1, frag1) = type;
     if (type != nullptr && area2 == real_addr_frag2)
-      state.types2_(block2, frag2) = type;
+      state.types_<2>(block2, frag2) = type;
 
     // The type of the variable is already known:
     if (type) {
       new_type1 = new_type2 = type;
     }
     // Type inference from the block type.
-    else if (state.types1_(block1, frag1) != nullptr || state.types2_(block2, frag2) != nullptr) {
+    else if (state.types_<1>(block1, frag1) != nullptr || state.types_<2>(block2, frag2) != nullptr) {
 
       offset1 = (char*)area1 - (char*)real_addr_frag1;
       offset2 = (char*)area2 - (char*)real_addr_frag2;
 
-      if (state.types1_(block1, frag1) != nullptr && state.types2_(block2, frag2) != nullptr) {
-        new_type1 =
-            get_offset_type(real_addr_frag1, state.types1_(block1, frag1), offset1, size, snapshot1, process_index);
-        new_type2 =
-            get_offset_type(real_addr_frag2, state.types2_(block2, frag2), offset1, size, snapshot2, process_index);
-      } else if (state.types1_(block1, frag1) != nullptr) {
-        new_type1 =
-            get_offset_type(real_addr_frag1, state.types1_(block1, frag1), offset1, size, snapshot1, process_index);
-        new_type2 =
-            get_offset_type(real_addr_frag2, state.types1_(block1, frag1), offset2, size, snapshot2, process_index);
-      } else if (state.types2_(block2, frag2) != nullptr) {
-        new_type1 =
-            get_offset_type(real_addr_frag1, state.types2_(block2, frag2), offset1, size, snapshot1, process_index);
-        new_type2 =
-            get_offset_type(real_addr_frag2, state.types2_(block2, frag2), offset2, size, snapshot2, process_index);
+      if (state.types_<1>(block1, frag1) != nullptr && state.types_<2>(block2, frag2) != nullptr) {
+        new_type1 = get_offset_type(real_addr_frag1, state.types_<1>(block1, frag1), offset1, size, snapshot1);
+        new_type2 = get_offset_type(real_addr_frag2, state.types_<2>(block2, frag2), offset1, size, snapshot2);
+      } else if (state.types_<1>(block1, frag1) != nullptr) {
+        new_type1 = get_offset_type(real_addr_frag1, state.types_<1>(block1, frag1), offset1, size, snapshot1);
+        new_type2 = get_offset_type(real_addr_frag2, state.types_<1>(block1, frag1), offset2, size, snapshot2);
+      } else if (state.types_<2>(block2, frag2) != nullptr) {
+        new_type1 = get_offset_type(real_addr_frag1, state.types_<2>(block2, frag2), offset1, size, snapshot1);
+        new_type2 = get_offset_type(real_addr_frag2, state.types_<2>(block2, frag2), offset2, size, snapshot2);
       } else {
         if (match_pairs)
           state.match_equals(previous);
-        return -1;
+        return false;
       }
 
       if (new_type1 != nullptr && new_type2 != nullptr && new_type1 != new_type2) {
@@ -1168,7 +988,7 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
       } else {
         if (match_pairs)
           state.match_equals(previous);
-        return -1;
+        return false;
       }
     }
 
@@ -1178,16 +998,16 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
     }
 
     if (offset1 == 0 && offset2 == 0 &&
-        not previous->insert(simgrid::mc::makeHeapLocationPair(block1, frag1, block2, frag2)).second) {
+        not previous->insert(HeapLocationPair{{HeapLocation(block1, frag1), HeapLocation(block2, frag2)}}).second) {
       if (match_pairs)
         state.match_equals(previous);
-      return 0;
+      return false;
     }
 
     if (size <= 0) {
       if (match_pairs)
         state.match_equals(previous);
-      return 0;
+      return false;
     }
 
     if ((heapinfo1->busy_frag.ignore[frag1] > 0) &&
@@ -1195,24 +1015,19 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
       check_ignore = heapinfo1->busy_frag.ignore[frag1];
 
   } else
-    return 1;
-
+    return true;
 
   /* 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);
-  else
-    res_compare = compare_heap_area_without_type(state, process_index, area1, area2, snapshot1, snapshot2, previous,
-                                                 size, check_ignore);
-
-  if (res_compare == 1)
-    return res_compare;
+  bool differ =
+      type ? heap_area_differ_with_type(state, area1, area2, snapshot1, snapshot2, previous, type, size, check_ignore,
+                                        pointer_level)
+           : heap_area_differ_without_type(state, area1, area2, snapshot1, snapshot2, previous, size, check_ignore);
+  if (differ)
+    return true;
 
   if (match_pairs)
     state.match_equals(previous);
-  return 0;
+  return false;
 }
 
 }
@@ -1221,176 +1036,141 @@ int compare_heap_area(simgrid::mc::StateComparator& state, int process_index,
 /************************** Snapshot comparison *******************************/
 /******************************************************************************/
 
-static int compare_areas_with_type(simgrid::mc::StateComparator& state,
-                                   int process_index,
-                                   void* real_area1, simgrid::mc::Snapshot* snapshot1, mc_mem_region_t region1,
-                                   void* real_area2, simgrid::mc::Snapshot* snapshot2, mc_mem_region_t region2,
-                                   simgrid::mc::Type* type, int pointer_level)
+static bool areas_differ_with_type(simgrid::mc::StateComparator& state, const void* real_area1,
+                                   const simgrid::mc::Snapshot& snapshot1, simgrid::mc::Region* region1,
+                                   const void* real_area2, const simgrid::mc::Snapshot& snapshot2,
+                                   simgrid::mc::Region* region2, simgrid::mc::Type* type, int pointer_level)
 {
-  simgrid::mc::RemoteClient* process = &mc_model_checker->process();
-
   simgrid::mc::Type* subtype;
   simgrid::mc::Type* subsubtype;
   int elm_size;
   int i;
-  int res;
-
-  do {
-    xbt_assert(type != nullptr);
-    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;
-        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;
-        }
-        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
-
-        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.
+  xbt_assert(type != nullptr);
+  switch (type->type) {
+    case DW_TAG_unspecified_type:
+      return true;
 
+    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:
+      return areas_differ_with_type(state, real_area1, snapshot1, region1, real_area2, snapshot2, region2,
+                                    type->subtype, pointer_level);
+    case DW_TAG_array_type:
+      subtype = type->subtype;
+      switch (subtype->type) {
+        case DW_TAG_unspecified_type:
+          return true;
+
+        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 false;
+      }
+      for (i = 0; i < type->element_count; i++) {
+        size_t off = i * elm_size;
+        if (areas_differ_with_type(state, (const char*)real_area1 + off, snapshot1, region1,
+                                   (const char*)real_area2 + off, snapshot2, region2, type->subtype, pointer_level))
+          return true;
+      }
+      break;
+    case DW_TAG_pointer_type:
+    case DW_TAG_reference_type:
+    case DW_TAG_rvalue_reference_type: {
+      const void* addr_pointed1 = MC_region_read_pointer(region1, real_area1);
+      const 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 false;
+      if (addr_pointed1 == nullptr || addr_pointed2 == nullptr)
+        return true;
+      if (not state.compared_pointers.insert(std::make_pair(addr_pointed1, addr_pointed2)).second)
+        return false;
+
+      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 (snapshot1.on_heap(addr_pointed1)) {
+        if (not snapshot2.on_heap(addr_pointed2))
+          return true;
+        // The pointers are both in the heap:
+        return simgrid::mc::heap_area_differ(state, 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 true;
+        if (not type->type_id)
           return (addr_pointed1 != addr_pointed2);
-        }
+        else
+          return areas_differ_with_type(state, 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.
+
+        return (addr_pointed1 != addr_pointed2);
       }
-      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;
-      default:
-        XBT_VERB("Unknown case: %d", type->type);
-        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);
+        void* member2                   = simgrid::dwarf::resolve_member(real_area2, type, &member, &snapshot2);
+        simgrid::mc::Region* subregion1 = snapshot1.get_region(member1, region1); // region1 is hinted
+        simgrid::mc::Region* subregion2 = snapshot2.get_region(member2, region2); // region2 is hinted
+        if (areas_differ_with_type(state, member1, snapshot1, subregion1, member2, snapshot2, subregion2, member.type,
+                                   pointer_level))
+          return true;
+      }
+      break;
+    case DW_TAG_subroutine_type:
+      return false;
+    default:
+      XBT_VERB("Unknown case: %d", type->type);
+      break;
+  }
 
-    return 0;
-  } while (true);
+  return false;
 }
 
-static int compare_global_variables(
-  simgrid::mc::StateComparator& state,
-  simgrid::mc::ObjectInformation* object_info,
-  int process_index,
-  mc_mem_region_t r1, mc_mem_region_t r2,
-  simgrid::mc::Snapshot* snapshot1, simgrid::mc::Snapshot* snapshot2)
+static bool global_variables_differ(simgrid::mc::StateComparator& state, simgrid::mc::ObjectInformation* object_info,
+                                    simgrid::mc::Region* r1, simgrid::mc::Region* r2,
+                                    const simgrid::mc::Snapshot& snapshot1, const simgrid::mc::Snapshot& snapshot2)
 {
   xbt_assert(r1 && r2, "Missing region.");
 
-#if HAVE_SMPI
-  if (r1->storage_type() == simgrid::mc::StorageType::Privatized) {
-    xbt_assert(process_index >= 0);
-    if (r2->storage_type() != simgrid::mc::StorageType::Privatized)
-      return 1;
-
-    size_t process_count = MC_smpi_process_count();
-    xbt_assert(process_count == r1->privatized_data().size()
-      && process_count == r2->privatized_data().size());
-
-    // Compare the global variables separately for each simulates process:
-    for (size_t i = 0; i < process_count; i++) {
-      if (compare_global_variables(state, object_info, i, &r1->privatized_data()[i], &r2->privatized_data()[i],
-                                   snapshot1, snapshot2))
-        return 1;
-    }
-    return 0;
-  }
-#else
-  xbt_assert(r1->storage_type() != simgrid::mc::StorageType::Privatized);
-#endif
-  xbt_assert(r2->storage_type() != simgrid::mc::StorageType::Privatized);
-
-  std::vector<simgrid::mc::Variable>& variables = object_info->global_variables;
+  const std::vector<simgrid::mc::Variable>& variables = object_info->global_variables;
 
   for (simgrid::mc::Variable const& current_var : variables) {
 
@@ -1402,254 +1182,138 @@ static int compare_global_variables(
       continue;
 
     simgrid::mc::Type* bvariable_type = current_var.type;
-    int res = compare_areas_with_type(state, process_index,
-                                (char *) current_var.address, snapshot1, r1,
-                                (char *) current_var.address, snapshot2, r2,
-                                bvariable_type, 0);
-    if (res == 1) {
-      XBT_VERB("Global variable %s (%p) is different between snapshots",
-               current_var.name.c_str(),
-               (char *) current_var.address);
-      return 1;
+    if (areas_differ_with_type(state, current_var.address, snapshot1, r1, current_var.address, snapshot2, r2,
+                               bvariable_type, 0)) {
+      XBT_VERB("Global variable %s (%p) is different between snapshots", current_var.name.c_str(), current_var.address);
+      return true;
     }
   }
 
-  return 0;
+  return false;
 }
 
-static int compare_local_variables(simgrid::mc::StateComparator& state,
-                                   int process_index,
-                                   simgrid::mc::Snapshot* snapshot1,
-                                   simgrid::mc::Snapshot* snapshot2,
-                                   mc_snapshot_stack_t stack1,
-                                   mc_snapshot_stack_t stack2)
+static bool local_variables_differ(simgrid::mc::StateComparator& state, const simgrid::mc::Snapshot& snapshot1,
+                                   const simgrid::mc::Snapshot& snapshot2, const_mc_snapshot_stack_t stack1,
+                                   const_mc_snapshot_stack_t stack2)
 {
   if (stack1->local_variables.size() != stack2->local_variables.size()) {
     XBT_VERB("Different number of local variables");
-    return 1;
+    return true;
   }
 
-    unsigned int cursor = 0;
-    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];
-      if (current_var1->name != current_var2->name
-          || current_var1->subprogram != current_var2->subprogram
-          || current_var1->ip != current_var2->ip) {
-        // TODO, fix current_varX->subprogram->name to include name if DW_TAG_inlined_subprogram
-        XBT_VERB
-            ("Different name of variable (%s - %s) "
-             "or frame (%s - %s) or ip (%lu - %lu)",
-             current_var1->name.c_str(),
-             current_var2->name.c_str(),
-             current_var1->subprogram->name.c_str(),
-             current_var2->subprogram->name.c_str(),
-             current_var1->ip, current_var2->ip);
-        return 1;
-      }
+  for (unsigned int cursor = 0; cursor < stack1->local_variables.size(); cursor++) {
+    const_local_variable_t current_var1 = &stack1->local_variables[cursor];
+    const_local_variable_t current_var2 = &stack2->local_variables[cursor];
+    if (current_var1->name != current_var2->name || current_var1->subprogram != current_var2->subprogram ||
+        current_var1->ip != current_var2->ip) {
       // TODO, fix current_varX->subprogram->name to include name if DW_TAG_inlined_subprogram
+      XBT_VERB("Different name of variable (%s - %s) or frame (%s - %s) or ip (%lu - %lu)", current_var1->name.c_str(),
+               current_var2->name.c_str(), current_var1->subprogram->name.c_str(),
+               current_var2->subprogram->name.c_str(), current_var1->ip, current_var2->ip);
+      return true;
+    }
 
-        simgrid::mc::Type* subtype = current_var1->type;
-        int res                    = compare_areas_with_type(
-            state, process_index, current_var1->address, snapshot1,
-            mc_get_snapshot_region(current_var1->address, snapshot1, process_index), current_var2->address, snapshot2,
-            mc_get_snapshot_region(current_var2->address, snapshot2, process_index), subtype, 0);
-
-        if (res == 1) {
-          // TODO, fix current_varX->subprogram->name to include name if DW_TAG_inlined_subprogram
-          XBT_VERB("Local variable %s (%p - %p) in frame %s "
-                   "is different between snapshots",
-                   current_var1->name.c_str(), current_var1->address, current_var2->address,
-                   current_var1->subprogram->name.c_str());
-          return res;
-      }
-      cursor++;
+    if (areas_differ_with_type(state, current_var1->address, snapshot1, snapshot1.get_region(current_var1->address),
+                               current_var2->address, snapshot2, snapshot2.get_region(current_var2->address),
+                               current_var1->type, 0)) {
+      XBT_VERB("Local variable %s (%p - %p) in frame %s is different between snapshots", current_var1->name.c_str(),
+               current_var1->address, current_var2->address, current_var1->subprogram->name.c_str());
+      return true;
     }
-    return 0;
+  }
+  return false;
 }
 
 namespace simgrid {
 namespace mc {
 
-static std::unique_ptr<simgrid::mc::StateComparator> state_comparator;
-
-int snapshot_compare(int num1, simgrid::mc::Snapshot* s1, int num2, simgrid::mc::Snapshot* s2)
+bool snapshot_equal(const Snapshot* s1, const Snapshot* s2)
 {
   // TODO, make this a field of ModelChecker or something similar
+  static StateComparator state_comparator;
+
+  const RemoteClient& process = mc_model_checker->process();
 
-  if (state_comparator == nullptr)
-    state_comparator.reset(new StateComparator());
-  else
-    state_comparator->clear();
-
-  simgrid::mc::RemoteClient* process = &mc_model_checker->process();
-
-  int errors = 0;
-
-  int hash_result = 0;
-  if (_sg_mc_hash) {
-    hash_result = (s1->hash != s2->hash);
-    if (hash_result) {
-      XBT_VERB("(%d - %d) Different hash: 0x%" PRIx64 "--0x%" PRIx64, num1, num2, s1->hash, s2->hash);
-#ifndef MC_DEBUG
-      return 1;
-#endif
-    } else
-      XBT_VERB("(%d - %d) Same hash: 0x%" PRIx64, num1, num2, s1->hash);
+  if (s1->hash_ != s2->hash_) {
+    XBT_VERB("(%d - %d) Different hash: 0x%" PRIx64 "--0x%" PRIx64, s1->num_state_, s2->num_state_, s1->hash_,
+             s2->hash_);
+    return false;
   }
+  XBT_VERB("(%d - %d) Same hash: 0x%" PRIx64, s1->num_state_, s2->num_state_, s1->hash_);
 
   /* Compare enabled processes */
-  if (s1->enabled_processes != s2->enabled_processes) {
-    XBT_VERB("(%d - %d) Different amount of enabled processes", num1, num2);
-    return 1;
+  if (s1->enabled_processes_ != s2->enabled_processes_) {
+    XBT_VERB("(%d - %d) Different amount of enabled processes", s1->num_state_, s2->num_state_);
+    return false;
   }
 
   /* Compare size of stacks */
-  int is_diff = 0;
-  for (unsigned long i = 0; i < s1->stacks.size(); i++) {
-    size_t size_used1 = s1->stack_sizes[i];
-    size_t size_used2 = s2->stack_sizes[i];
+  for (unsigned long i = 0; i < s1->stacks_.size(); i++) {
+    size_t size_used1 = s1->stack_sizes_[i];
+    size_t size_used2 = s2->stack_sizes_[i];
     if (size_used1 != size_used2) {
-#ifdef MC_DEBUG
-      XBT_DEBUG("(%d - %d) Different size used in stacks: %zu - %zu", num1, num2, size_used1, size_used2);
-      errors++;
-      is_diff = 1;
-#else
-#ifdef MC_VERBOSE
-      XBT_VERB("(%d - %d) Different size used in stacks: %zu - %zu", num1, num2, size_used1, size_used2);
-#endif
-      return 1;
-#endif
+      XBT_VERB("(%d - %d) Different size used in stacks: %zu - %zu", s1->num_state_, s2->num_state_, size_used1,
+               size_used2);
+      return false;
     }
   }
-  if (is_diff) // do not proceed if there is any stacks that don't match
-    return 1;
 
   /* Init heap information used in heap comparison algorithm */
-  xbt_mheap_t heap1 = (xbt_mheap_t)s1->read_bytes(
-    alloca(sizeof(struct mdesc)), sizeof(struct mdesc),
-    remote(process->heap_address),
-    simgrid::mc::ProcessIndexMissing, simgrid::mc::ReadOptions::lazy());
-  xbt_mheap_t heap2 = (xbt_mheap_t)s2->read_bytes(
-    alloca(sizeof(struct mdesc)), sizeof(struct mdesc),
-    remote(process->heap_address),
-    simgrid::mc::ProcessIndexMissing, simgrid::mc::ReadOptions::lazy());
-  int res_init = state_comparator->initHeapInformation(heap1, heap2, &s1->to_ignore, &s2->to_ignore);
-
-  if (res_init == -1) {
-#ifdef MC_DEBUG
-    XBT_DEBUG("(%d - %d) Different heap information", num1, num2);
-    errors++;
-#else
-#ifdef MC_VERBOSE
-    XBT_VERB("(%d - %d) Different heap information", num1, num2);
-#endif
-
-    return 1;
-#endif
+  xbt_mheap_t heap1 =
+      static_cast<xbt_mheap_t>(s1->read_bytes(alloca(sizeof(struct mdesc)), sizeof(struct mdesc),
+                                              remote(process.heap_address), simgrid::mc::ReadOptions::lazy()));
+  xbt_mheap_t heap2 =
+      static_cast<xbt_mheap_t>(s2->read_bytes(alloca(sizeof(struct mdesc)), sizeof(struct mdesc),
+                                              remote(process.heap_address), simgrid::mc::ReadOptions::lazy()));
+  if (state_comparator.initHeapInformation(heap1, heap2, s1->to_ignore_, s2->to_ignore_) == -1) {
+    XBT_VERB("(%d - %d) Different heap information", s1->num_state_, s2->num_state_);
+    return false;
   }
 
   /* Stacks comparison */
-  int diff_local = 0;
-  for (unsigned int cursor = 0; cursor < s1->stacks.size(); cursor++) {
-    mc_snapshot_stack_t stack1 = &s1->stacks[cursor];
-    mc_snapshot_stack_t stack2 = &s2->stacks[cursor];
-
-    if (stack1->process_index != stack2->process_index) {
-      diff_local = 1;
-      XBT_DEBUG("(%d - %d) Stacks with different process index (%i vs %i)", num1, num2,
-        stack1->process_index, stack2->process_index);
-    }
-    else diff_local = compare_local_variables(*state_comparator,
-      stack1->process_index, s1, s2, stack1, stack2);
-    if (diff_local > 0) {
-#ifdef MC_DEBUG
-      XBT_DEBUG("(%d - %d) Different local variables between stacks %d", num1,
-                num2, cursor + 1);
-      errors++;
-#else
-
-#ifdef MC_VERBOSE
-      XBT_VERB("(%d - %d) Different local variables between stacks %u", num1, num2, cursor + 1);
-#endif
-
-      return 1;
-#endif
+  for (unsigned int cursor = 0; cursor < s1->stacks_.size(); cursor++) {
+    const_mc_snapshot_stack_t stack1 = &s1->stacks_[cursor];
+    const_mc_snapshot_stack_t stack2 = &s2->stacks_[cursor];
+
+    if (local_variables_differ(state_comparator, *s1, *s2, stack1, stack2)) {
+      XBT_VERB("(%d - %d) Different local variables between stacks %u", s1->num_state_, s2->num_state_, cursor + 1);
+      return false;
     }
   }
 
-  size_t regions_count = s1->snapshot_regions.size();
-  // TODO, raise a difference instead?
-  xbt_assert(regions_count == s2->snapshot_regions.size());
+  size_t regions_count = s1->snapshot_regions_.size();
+  if (regions_count != s2->snapshot_regions_.size())
+    return false;
 
   for (size_t k = 0; k != regions_count; ++k) {
-    mc_mem_region_t region1 = s1->snapshot_regions[k].get();
-    mc_mem_region_t region2 = s2->snapshot_regions[k].get();
+    Region* region1 = s1->snapshot_regions_[k].get();
+    Region* region2 = s2->snapshot_regions_[k].get();
 
     // Preconditions:
-    if (region1->region_type() != simgrid::mc::RegionType::Data)
+    if (region1->region_type() != RegionType::Data)
       continue;
 
     xbt_assert(region1->region_type() == region2->region_type());
     xbt_assert(region1->object_info() == region2->object_info());
     xbt_assert(region1->object_info());
 
-    std::string const& name = region1->object_info()->file_name;
-
     /* Compare global variables */
-    if (compare_global_variables(*state_comparator, region1->object_info(), simgrid::mc::ProcessIndexDisabled, region1,
-                                 region2, s1, s2)) {
-
-#ifdef MC_DEBUG
-      XBT_DEBUG("(%d - %d) Different global variables in %s",
-        num1, num2, name.c_str());
-      errors++;
-#else
-#ifdef MC_VERBOSE
-      XBT_VERB("(%d - %d) Different global variables in %s",
-        num1, num2, name.c_str());
-#endif
-
-      return 1;
-#endif
+    if (global_variables_differ(state_comparator, region1->object_info(), region1, region2, *s1, *s2)) {
+      std::string const& name = region1->object_info()->file_name;
+      XBT_VERB("(%d - %d) Different global variables in %s", s1->num_state_, s2->num_state_, name.c_str());
+      return false;
     }
   }
 
   /* Compare heap */
-  if (simgrid::mc::mmalloc_compare_heap(*state_comparator, s1, s2) > 0) {
-
-#ifdef MC_DEBUG
-    XBT_DEBUG("(%d - %d) Different heap (mmalloc_compare)", num1, num2);
-    errors++;
-#else
-
-#ifdef MC_VERBOSE
-    XBT_VERB("(%d - %d) Different heap (mmalloc_compare)", num1, num2);
-#endif
-    return 1;
-#endif
+  if (mmalloc_heap_differ(state_comparator, *s1, *s2)) {
+    XBT_VERB("(%d - %d) Different heap (mmalloc_compare)", s1->num_state_, s2->num_state_);
+    return false;
   }
 
-#ifdef MC_VERBOSE
-  if (errors || hash_result)
-    XBT_VERB("(%d - %d) Difference found", num1, num2);
-  else
-    XBT_VERB("(%d - %d) No difference found", num1, num2);
-#endif
-
-#if defined(MC_DEBUG) && defined(MC_VERBOSE)
-  if (_sg_mc_hash) {
-    // * false positive SHOULD be avoided.
-    // * There MUST not be any false negative.
-
-    XBT_VERB("(%d - %d) State equality hash test is %s %s", num1, num2,
-             (hash_result != 0) == (errors != 0) ? "true" : "false", not hash_result ? "positive" : "negative");
-  }
-#endif
+  XBT_VERB("(%d - %d) No difference found", s1->num_state_, s2->num_state_);
 
-  return errors > 0 || hash_result;
+  return true;
 }
 
 }
diff --git a/src/mc/inspect/DwarfExpression.cpp b/src/mc/inspect/DwarfExpression.cpp
new file mode 100644 (file)
index 0000000..c0c6a3e
--- /dev/null
@@ -0,0 +1,270 @@
+/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include <cstddef>
+#include <cstdint>
+
+#include "src/mc/AddressSpace.hpp"
+#include "src/mc/inspect/DwarfExpression.hpp"
+#include "src/mc/inspect/Frame.hpp"
+#include "src/mc/inspect/LocationList.hpp"
+#include "src/mc/inspect/ObjectInformation.hpp"
+#include "src/mc/inspect/mc_dwarf.hpp"
+#include "src/mc/mc_private.hpp"
+
+using simgrid::mc::remote;
+
+namespace simgrid {
+namespace dwarf {
+
+void execute(const Dwarf_Op* ops, std::size_t n, const ExpressionContext& context, ExpressionStack& stack)
+{
+  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) {
+
+        // Registers:
+
+      case DW_OP_breg0:
+      case DW_OP_breg1:
+      case DW_OP_breg2:
+      case DW_OP_breg3:
+      case DW_OP_breg4:
+      case DW_OP_breg5:
+      case DW_OP_breg6:
+      case DW_OP_breg7:
+      case DW_OP_breg8:
+      case DW_OP_breg9:
+      case DW_OP_breg10:
+      case DW_OP_breg11:
+      case DW_OP_breg12:
+      case DW_OP_breg13:
+      case DW_OP_breg14:
+      case DW_OP_breg15:
+      case DW_OP_breg16:
+      case DW_OP_breg17:
+      case DW_OP_breg18:
+      case DW_OP_breg19:
+      case DW_OP_breg20:
+      case DW_OP_breg21:
+      case DW_OP_breg22:
+      case DW_OP_breg23:
+      case DW_OP_breg24:
+      case DW_OP_breg25:
+      case DW_OP_breg26:
+      case DW_OP_breg27:
+      case DW_OP_breg28:
+      case DW_OP_breg29:
+      case DW_OP_breg30:
+      case DW_OP_breg31: {
+        // Push register + constant:
+        int register_id = simgrid::dwarf::dwarf_register_to_libunwind(op->atom - DW_OP_breg0);
+        unw_word_t res;
+        if (not context.cursor)
+          throw evaluation_error("Missing stack context");
+        unw_get_reg(context.cursor, register_id, &res);
+        stack.push(res + op->number);
+        break;
+      }
+
+        // Push the CFA (Canonical Frame Address):
+      case DW_OP_call_frame_cfa: {
+        /* See 6.4 of DWARF4 (http://dwarfstd.org/doc/DWARF4.pdf#page=140):
+         *
+         * > Typically, the CFA is defined to be the value of the stack
+         * > pointer at the call site in the previous frame (which may be
+         * > different from its value on entry to the current frame).
+         *
+         * We need to unwind the frame in order to get the SP of the parent
+         * frame.
+         *
+         * Warning: the CFA returned by libunwind (UNW_X86_64_RSP, etc.)
+         * is the SP of the *current* frame. */
+
+        if (not context.cursor)
+          throw evaluation_error("Missint cursor");
+
+        // Get frame:
+        unw_cursor_t cursor = *(context.cursor);
+        unw_step(&cursor);
+
+        unw_word_t res;
+        unw_get_reg(&cursor, UNW_REG_SP, &res);
+        stack.push(res);
+        break;
+      }
+
+        // Frame base:
+
+      case DW_OP_fbreg:
+        stack.push((std::uintptr_t)context.frame_base + op->number);
+        break;
+
+        // ***** Constants:
+
+        // Short constant literals:
+      case DW_OP_lit0:
+      case DW_OP_lit1:
+      case DW_OP_lit2:
+      case DW_OP_lit3:
+      case DW_OP_lit4:
+      case DW_OP_lit5:
+      case DW_OP_lit6:
+      case DW_OP_lit7:
+      case DW_OP_lit8:
+      case DW_OP_lit9:
+      case DW_OP_lit10:
+      case DW_OP_lit11:
+      case DW_OP_lit12:
+      case DW_OP_lit13:
+      case DW_OP_lit14:
+      case DW_OP_lit15:
+      case DW_OP_lit16:
+      case DW_OP_lit17:
+      case DW_OP_lit18:
+      case DW_OP_lit19:
+      case DW_OP_lit20:
+      case DW_OP_lit21:
+      case DW_OP_lit22:
+      case DW_OP_lit23:
+      case DW_OP_lit24:
+      case DW_OP_lit25:
+      case DW_OP_lit26:
+      case DW_OP_lit27:
+      case DW_OP_lit28:
+      case DW_OP_lit29:
+      case DW_OP_lit30:
+      case DW_OP_lit31:
+        // Push a literal/constant on the stack:
+        stack.push(atom - DW_OP_lit0);
+        break;
+
+        // Address from the base address of this ELF object.
+        // Push the address on the stack (base_address + argument).
+      case DW_OP_addr: {
+        if (not context.object_info)
+          throw evaluation_error("No base address");
+        Dwarf_Off addr = (Dwarf_Off)(std::uintptr_t)context.object_info->base_address() + op->number;
+        stack.push(addr);
+        break;
+      }
+
+        // General constants:
+        // Push the constant argument on the stack.
+      case DW_OP_const1u:
+      case DW_OP_const2u:
+      case DW_OP_const4u:
+      case DW_OP_const8u:
+      case DW_OP_const1s:
+      case DW_OP_const2s:
+      case DW_OP_const4s:
+      case DW_OP_const8s:
+      case DW_OP_constu:
+      case DW_OP_consts:
+        stack.push(op->number);
+        break;
+
+        // ***** Stack manipulation:
+
+        // Push another copy/duplicate the value at the top of the stack:
+      case DW_OP_dup:
+        stack.dup();
+        break;
+
+        // Pop/drop the top of the stack:
+      case DW_OP_drop:
+        stack.pop();
+        break;
+
+      case DW_OP_swap:
+        stack.swap();
+        break;
+
+        // Duplicate the value under the top of the stack:
+      case DW_OP_over:
+        stack.push(stack.top(1));
+        break;
+
+        // ***** Operations:
+        // Those usually take the top of the stack and the next value as argument
+        // and replace the top of the stack with the computed value
+        // (stack.top() += stack.before_top()).
+
+      case DW_OP_plus:
+        first  = stack.pop();
+        second = stack.pop();
+        stack.push(first + second);
+        break;
+
+      case DW_OP_mul:
+        first  = stack.pop();
+        second = stack.pop();
+        stack.push(first * second);
+        break;
+
+      case DW_OP_plus_uconst:
+        stack.top() += op->number;
+        break;
+
+      case DW_OP_not:
+        stack.top() = ~stack.top();
+        break;
+
+      case DW_OP_neg:
+        stack.top() = -(intptr_t)stack.top();
+        break;
+
+      case DW_OP_minus:
+        first  = stack.pop();
+        second = stack.pop();
+        stack.push(second - first);
+        break;
+
+      case DW_OP_and:
+        first  = stack.pop();
+        second = stack.pop();
+        stack.push(first & second);
+        break;
+
+      case DW_OP_or:
+        first  = stack.pop();
+        second = stack.pop();
+        stack.push(first | second);
+        break;
+
+      case DW_OP_xor:
+        first  = stack.pop();
+        second = stack.pop();
+        stack.push(first ^ second);
+        break;
+
+      case DW_OP_nop:
+        break;
+
+        // ***** Deference (memory fetch)
+
+      case DW_OP_deref_size:
+        throw evaluation_error("Unsupported operation");
+
+      case DW_OP_deref:
+        // Computed address:
+        if (not context.address_space)
+          throw evaluation_error("Missing address space");
+        context.address_space->read_bytes(&stack.top(), sizeof(uintptr_t), remote(stack.top()));
+        break;
+
+        // Not handled:
+      default:
+        throw evaluation_error("Unsupported operation");
+    }
+  }
+}
+
+} // namespace dwarf
+} // namespace simgrid
similarity index 83%
rename from src/mc/DwarfExpression.hpp
rename to src/mc/inspect/DwarfExpression.hpp
index b6713b2..efb089e 100644 (file)
@@ -16,8 +16,7 @@
 #include <elfutils/libdw.h>
 #include <libunwind.h>
 
-#include "src/mc/AddressSpace.hpp"
-#include "src/mc/mc_dwarf.hpp"
+#include "src/mc/inspect/mc_dwarf.hpp"
 #include "src/mc/mc_forward.hpp"
 
 /** @file DwarfExpression.hpp
@@ -45,16 +44,19 @@ typedef std::vector<Dwarf_Op> DwarfExpression;
  */
 class ExpressionContext {
 public:
-  ExpressionContext() :
-    cursor(nullptr), frame_base(nullptr), address_space(nullptr),
-    object_info(nullptr), process_index(simgrid::mc::ProcessIndexMissing) {}
+  ExpressionContext()
+      : cursor(nullptr)
+      , frame_base(nullptr)
+      , address_space(nullptr)
+      , object_info(nullptr)
+  {
+  }
   /** CPU state (registers) */
   unw_cursor_t* cursor;
   void* frame_base;
   /** Address space used to read memory */
-  simgrid::mc::AddressSpace* address_space;
+  const simgrid::mc::AddressSpace* address_space;
   simgrid::mc::ObjectInformation* object_info;
-  int process_index;
 };
 
 /** When an error happens in the execution of a DWARF expression */
@@ -71,18 +73,20 @@ class ExpressionStack {
 public:
   typedef std::uintptr_t value_type;
   static const std::size_t max_size = 64;
+
 private:
   // Values of the stack (the top is stack_[size_ - 1]):
-  uintptr_t stack_[max_size] {0};
+  uintptr_t stack_[max_size]{0};
   size_t size_;
+
 public:
   ExpressionStack() : size_(0) {}
 
   // Access:
   std::size_t size() const { return size_; }
-  bool empty()       const { return size_ == 0; }
-  void clear()             { size_ = 0; }
-  uintptr_t&       operator[](int i)       { return stack_[i]; }
+  bool empty() const { return size_ == 0; }
+  void clear() { size_ = 0; }
+  uintptr_t& operator[](int i) { return stack_[i]; }
   uintptr_t const& operator[](int i) const { return stack_[i]; }
 
   /** Top of the stack */
@@ -133,8 +137,7 @@ public:
  *  @param context evaluation context (registers, memory, etc.)
  *  @param stack   DWARf stack where the operations are executed
  */
-void execute(const Dwarf_Op* ops, std::size_t n,
-  ExpressionContext const& context, ExpressionStack& stack);
+void execute(const Dwarf_Op* ops, std::size_t n, ExpressionContext const& context, ExpressionStack& stack);
 
 /** Executes/evaluates a DWARF expression
  *
@@ -142,14 +145,13 @@ void execute(const Dwarf_Op* ops, std::size_t n,
  *  @param context    evaluation context (registers, memory, etc.)
  *  @param stack      DWARf stack where the operations are executed
  */
-inline
-void execute(simgrid::dwarf::DwarfExpression const& expression,
-  ExpressionContext const& context, ExpressionStack& stack)
+inline void execute(simgrid::dwarf::DwarfExpression const& expression, ExpressionContext const& context,
+                    ExpressionStack& stack)
 {
   execute(expression.data(), expression.size(), context, stack);
 }
 
-}
-}
+} // namespace dwarf
+} // namespace simgrid
 
 #endif
similarity index 74%
rename from src/mc/Frame.cpp
rename to src/mc/inspect/Frame.cpp
index 7a2f5ba..25b3bc2 100644 (file)
@@ -8,16 +8,15 @@
 
 #include "xbt/sysdep.h"
 
-#include "src/mc/Frame.hpp"
+#include "src/mc/inspect/Frame.hpp"
 
 namespace simgrid {
 namespace mc {
 
 void* Frame::frame_base(unw_cursor_t& unw_cursor) const
 {
-  simgrid::dwarf::Location location = simgrid::dwarf::resolve(
-                             frame_base_location, object_info,
-                             &unw_cursor, nullptr, nullptr, -1);
+  simgrid::dwarf::Location location =
+      simgrid::dwarf::resolve(frame_base_location, object_info, &unw_cursor, nullptr, nullptr);
   if (location.in_memory())
     return location.address();
   else if (location.in_register()) {
@@ -28,10 +27,10 @@ void* Frame::frame_base(unw_cursor_t& unw_cursor) const
     // contains the address of the frame base.
     unw_word_t word;
     unw_get_reg(&unw_cursor, location.register_id(), &word);
-    return (void*) word;
-  }
-  else xbt_die("Unexpected location type");
+    return (void*)word;
+  } else
+    xbt_die("Unexpected location type");
 }
 
-}
-}
+} // namespace mc
+} // namespace simgrid
similarity index 84%
rename from src/mc/Frame.hpp
rename to src/mc/inspect/Frame.hpp
index e6d9e0d..0d653ed 100644 (file)
@@ -7,15 +7,15 @@
 #ifndef SIMGRID_MC_FRAME_HPP
 #define SIMGRID_MC_FRAME_HPP
 
-#include <string>
 #include <cstdint>
+#include <string>
 
 #include "xbt/base.h"
 #include "xbt/range.hpp"
 
+#include "src/mc/inspect/LocationList.hpp"
+#include "src/mc/inspect/Variable.hpp"
 #include "src/mc/mc_forward.hpp"
-#include "src/mc/LocationList.hpp"
-#include "src/mc/Variable.hpp"
 
 namespace simgrid {
 namespace mc {
@@ -59,17 +59,16 @@ public:
   void remove_variable(char* name);
 };
 
-inline
-Frame::Frame()
+inline Frame::Frame()
 {
-  this->tag = 0;
-  this->range = {0, 0};
-  this->id = 0;
+  this->tag                = 0;
+  this->range              = {0, 0};
+  this->id                 = 0;
   this->abstract_origin_id = 0;
-  this->object_info = nullptr;
+  this->object_info        = nullptr;
 }
 
-}
-}
+} // namespace mc
+} // namespace simgrid
 
 #endif
similarity index 54%
rename from src/mc/LocationList.cpp
rename to src/mc/inspect/LocationList.cpp
index ef1e2a9..cc70196 100644 (file)
@@ -3,36 +3,30 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <cstddef>
-#include <cstdint>
-#include <utility>
+#include "src/mc/inspect/LocationList.hpp"
+#include "src/mc/inspect/ObjectInformation.hpp"
+#include "src/mc/inspect/mc_dwarf.hpp"
 
 #include "xbt/asserts.h"
 #include "xbt/sysdep.h"
 
+#include <cstddef>
+#include <cstdint>
 #include <libunwind.h>
-
-#include "src/mc/mc_dwarf.hpp"
-#include "src/mc/ObjectInformation.hpp"
-#include "src/mc/LocationList.hpp"
+#include <utility>
 
 namespace simgrid {
 namespace dwarf {
 
 /** Resolve a location expression */
-Location resolve(
-                      simgrid::dwarf::DwarfExpression const& expression,
-                      simgrid::mc::ObjectInformation* object_info,
-                      unw_cursor_t * c,
-                      void *frame_pointer_address,
-                      simgrid::mc::AddressSpace* address_space, int process_index)
+Location resolve(simgrid::dwarf::DwarfExpression const& expression, simgrid::mc::ObjectInformation* object_info,
+                 unw_cursor_t* c, void* frame_pointer_address, simgrid::mc::AddressSpace* address_space)
 {
   simgrid::dwarf::ExpressionContext context;
-  context.frame_base = frame_pointer_address;
-  context.cursor = c;
+  context.frame_base    = frame_pointer_address;
+  context.cursor        = c;
   context.address_space = address_space;
-  context.object_info = object_info;
-  context.process_index = process_index;
+  context.object_info   = object_info;
 
   if (not expression.empty() && expression[0].atom >= DW_OP_reg0 && expression[0].atom <= DW_OP_reg31) {
     int dwarf_register = expression[0].atom - DW_OP_reg0;
@@ -42,12 +36,12 @@ Location resolve(
 
   simgrid::dwarf::ExpressionStack stack;
   simgrid::dwarf::execute(expression, context, stack);
-  return Location((void*) stack.top());
+  return Location((void*)stack.top());
 }
 
 // TODO, move this in a method of LocationList
-static simgrid::dwarf::DwarfExpression const* find_expression(
-    simgrid::dwarf::LocationList const& locations, unw_word_t ip)
+static simgrid::dwarf::DwarfExpression const* find_expression(simgrid::dwarf::LocationList const& locations,
+                                                              unw_word_t ip)
 {
   for (simgrid::dwarf::LocationListEntry const& entry : locations)
     if (entry.valid_for_ip(ip))
@@ -55,29 +49,19 @@ static simgrid::dwarf::DwarfExpression const* find_expression(
   return nullptr;
 }
 
-Location resolve(
-  simgrid::dwarf::LocationList const& locations,
-  simgrid::mc::ObjectInformation* object_info,
-  unw_cursor_t * c,
-  void *frame_pointer_address,
-  simgrid::mc::AddressSpace* address_space,
-  int process_index)
+Location resolve(simgrid::dwarf::LocationList const& locations, simgrid::mc::ObjectInformation* object_info,
+                 unw_cursor_t* c, void* frame_pointer_address, simgrid::mc::AddressSpace* address_space)
 {
   unw_word_t ip = 0;
   if (c && unw_get_reg(c, UNW_REG_IP, &ip))
     xbt_die("Could not resolve IP");
-  simgrid::dwarf::DwarfExpression const* expression =
-    find_expression(locations, ip);
+  simgrid::dwarf::DwarfExpression const* expression = find_expression(locations, ip);
   if (not expression)
     xbt_die("Could not resolve location");
-  return simgrid::dwarf::resolve(
-          *expression, object_info, c,
-          frame_pointer_address, address_space, process_index);
+  return simgrid::dwarf::resolve(*expression, object_info, c, frame_pointer_address, address_space);
 }
 
-LocationList location_list(
-  simgrid::mc::ObjectInformation& info,
-  Dwarf_Attribute& attr)
+LocationList location_list(simgrid::mc::ObjectInformation& info, Dwarf_Attribute& attr)
 {
   LocationList locations;
   std::ptrdiff_t offset = 0;
@@ -85,7 +69,7 @@ LocationList location_list(
     Dwarf_Addr base;
     Dwarf_Addr start;
     Dwarf_Addr end;
-    Dwarf_Op *ops;
+    Dwarf_Opops;
     std::size_t len;
 
     offset = dwarf_getlocations(&attr, offset, &base, &start, &end, &ops, &len);
@@ -95,19 +79,19 @@ LocationList location_list(
     else if (offset == -1)
       xbt_die("Error while loading location list");
 
-    std::uint64_t base_address = (std::uint64_t) info.base_address();
+    std::uint64_t base_address = (std::uint64_t)info.base_address();
 
     LocationListEntry::range_type range;
     if (start == 0)
       // If start == 0, this is not a location list:
-      range = { 0, UINT64_MAX };
+      range = {0, UINT64_MAX};
     else
-      range =  { base_address + start, base_address + end };
+      range = {base_address + start, base_address + end};
 
-    locations.push_back({ DwarfExpression(ops, ops+len), range });
+    locations.push_back({DwarfExpression(ops, ops + len), range});
   }
 
   return locations;
 }
-}
-}
+} // namespace dwarf
+} // namespace simgrid
similarity index 59%
rename from src/mc/LocationList.hpp
rename to src/mc/inspect/LocationList.hpp
index 3427060..07dcb7c 100644 (file)
@@ -9,9 +9,9 @@
 #include "xbt/base.h"
 #include "xbt/range.hpp"
 
+#include "src/mc/inspect/DwarfExpression.hpp"
 #include "src/mc/mc_base.h"
 #include "src/mc/mc_forward.hpp"
-#include "src/mc/DwarfExpression.hpp"
 
 #include <cstdint>
 #include <vector>
@@ -23,31 +23,22 @@ namespace dwarf {
 class LocationListEntry {
 public:
   typedef simgrid::xbt::Range<std::uint64_t> range_type;
+
 private:
   DwarfExpression expression_;
   // By default, the expression is always valid:
   range_type range_ = {0, UINT64_MAX};
+
 public:
   LocationListEntry() = default;
-  LocationListEntry(DwarfExpression expression, range_type range)
-    : expression_(std::move(expression)), range_(range)
-  {}
+  LocationListEntry(DwarfExpression expression, range_type range) : expression_(std::move(expression)), range_(range) {}
   explicit LocationListEntry(DwarfExpression expression) : expression_(std::move(expression)), range_({0, UINT64_MAX})
   {
   }
 
-  DwarfExpression& expression()
-  {
-    return expression_;
-  }
-  DwarfExpression const& expression() const
-  {
-    return expression_;
-  }
-  bool valid_for_ip(unw_word_t ip) const
-  {
-    return range_.contain(ip);
-  }
+  DwarfExpression& expression() { return expression_; }
+  DwarfExpression const& expression() const { return expression_; }
+  bool valid_for_ip(unw_word_t ip) const { return range_.contain(ip); }
 };
 
 typedef std::vector<LocationListEntry> LocationList;
@@ -66,34 +57,24 @@ public:
   explicit Location(int register_id) : memory_(nullptr), register_id_(register_id) {}
   // Type of location:
   bool in_register() const { return memory_ == nullptr; }
-  bool in_memory()   const { return memory_ != nullptr; }
+  bool in_memory() const { return memory_ != nullptr; }
 
   // Get the location:
-  void* address()    const { return memory_; }
-  int register_id()  const { return register_id_;     }
+  void* address() const { return memory_; }
+  int register_id() const { return register_id_; }
 };
 
 XBT_PRIVATE
-Location resolve(
-  simgrid::dwarf::DwarfExpression const& expression,
-  simgrid::mc::ObjectInformation* object_info, unw_cursor_t* c,
-  void* frame_pointer_address, simgrid::mc::AddressSpace* address_space,
-  int process_index);
-
-Location resolve(
-  simgrid::dwarf::LocationList const& locations,
-  simgrid::mc::ObjectInformation* object_info,
-  unw_cursor_t * c,
-  void *frame_pointer_address,
-  simgrid::mc::AddressSpace* address_space,
-  int process_index);
+Location resolve(simgrid::dwarf::DwarfExpression const& expression, simgrid::mc::ObjectInformation* object_info,
+                 unw_cursor_t* c, void* frame_pointer_address, simgrid::mc::AddressSpace* address_space);
+
+Location resolve(simgrid::dwarf::LocationList const& locations, simgrid::mc::ObjectInformation* object_info,
+                 unw_cursor_t* c, void* frame_pointer_address, simgrid::mc::AddressSpace* address_space);
 
 XBT_PRIVATE
-simgrid::dwarf::LocationList location_list(
-  simgrid::mc::ObjectInformation& info,
-  Dwarf_Attribute& attr);
+simgrid::dwarf::LocationList location_list(simgrid::mc::ObjectInformation& info, Dwarf_Attribute& attr);
 
-}
-}
+} // namespace dwarf
+} // namespace simgrid
 
 #endif
diff --git a/src/mc/inspect/ObjectInformation.cpp b/src/mc/inspect/ObjectInformation.cpp
new file mode 100644 (file)
index 0000000..64adf52
--- /dev/null
@@ -0,0 +1,262 @@
+/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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 <sys/mman.h> // PROT_READ and friends
+#include <vector>
+
+#include "src/mc/inspect/Frame.hpp"
+#include "src/mc/inspect/ObjectInformation.hpp"
+#include "src/mc/inspect/Variable.hpp"
+#include "src/mc/mc_private.hpp"
+#include "xbt/file.hpp"
+
+namespace simgrid {
+namespace mc {
+
+/* For an executable object, addresses are virtual address
+ * (there is no offset) i.e.
+ * \f$\text{virtual address} = \{dwarf address}\f$
+ *
+ * For a shared object, the addresses are offset from the begining
+ * of the shared object (the base address of the mapped shared
+ * object must be used as offset
+ * i.e. \f$\text{virtual address} = \text{shared object base address}
+ *             + \text{dwarf address}\f$.
+ */
+void* ObjectInformation::base_address() const
+{
+  // For an executable (more precisely for a ET_EXEC) the base it 0:
+  if (this->executable())
+    return nullptr;
+
+  // For an a shared-object (ET_DYN, including position-independent executables)
+  // the base address is its lowest address:
+  void* result = this->start_exec;
+  if (this->start_rw != nullptr && result > (void*)this->start_rw)
+    result = this->start_rw;
+  if (this->start_ro != nullptr && result > (void*)this->start_ro)
+    result = this->start_ro;
+  return result;
+}
+
+simgrid::mc::Frame* ObjectInformation::find_function(const void* ip) const
+{
+  /* This is implemented by binary search on a sorted array.
+   *
+   * We do quite a lot of those so we want this to be cache efficient.
+   * We pack the only information we need in the index entries in order
+   * to successfully do the binary search. We do not need the high_pc
+   * during the binary search (only at the end) so it is not included
+   * in the index entry. We could use parallel arrays as well.
+   *
+   * We cannot really use the std:: algorithm for this.
+   * We could use std::binary_search by including the high_pc inside
+   * the FunctionIndexEntry.
+   */
+  const simgrid::mc::FunctionIndexEntry* base = this->functions_index.data();
+  int i                                       = 0;
+  int j                                       = this->functions_index.size() - 1;
+  while (j >= i) {
+    int k = i + ((j - i) / 2);
+
+    /* In most of the search, we do not dereference the base[k].function.
+     * This way the memory accesses are located in the base[k] array. */
+    if (ip < base[k].low_pc)
+      j = k - 1;
+    else if (k < j && ip >= base[k + 1].low_pc)
+      i = k + 1;
+
+    /* At this point, the search is over.
+     * Either we have found the correct function or we do not know
+     * any function corresponding to this instruction address.
+     * Only at the point do we dereference the function pointer. */
+    else if ((std::uint64_t)ip < base[k].function->range.end())
+      return base[k].function;
+    else
+      return nullptr;
+  }
+  return nullptr;
+}
+
+const simgrid::mc::Variable* ObjectInformation::find_variable(const char* name) const
+{
+  for (simgrid::mc::Variable const& variable : this->global_variables) {
+    if (variable.name == name)
+      return &variable;
+  }
+  return nullptr;
+}
+
+void ObjectInformation::remove_global_variable(const char* name)
+{
+  typedef std::vector<Variable>::size_type size_type;
+
+  if (this->global_variables.empty())
+    return;
+
+  // Binary search:
+  size_type first = 0;
+  size_type last  = this->global_variables.size() - 1;
+
+  while (first <= last) {
+    size_type cursor                   = first + (last - first) / 2;
+    simgrid::mc::Variable& current_var = this->global_variables[cursor];
+    int cmp                            = current_var.name.compare(name);
+
+    if (cmp == 0) {
+
+      // Find the whole range:
+      first = cursor;
+      while (first != 0 && this->global_variables[first - 1].name == name)
+        first--;
+      size_type size = this->global_variables.size();
+      last           = cursor;
+      while (last != size - 1 && this->global_variables[last + 1].name == name)
+        last++;
+
+      // Remove the whole range:
+      this->global_variables.erase(this->global_variables.begin() + first, this->global_variables.begin() + last + 1);
+
+      return;
+    } else if (cmp < 0)
+      first = cursor + 1;
+    else if (cursor != 0)
+      last = cursor - 1;
+    else
+      break;
+  }
+}
+
+/** Ignore a local variable in a scope
+ *
+ *  Ignore all instances of variables with a given name in
+ *  any (possibly inlined) subprogram with a given namespaced
+ *  name.
+ *
+ *  @param var_name        Name of the local variable to ignore
+ *  @param subprogram_name Name of the subprogram to ignore (nullptr for any)
+ *  @param subprogram      (possibly inlined) Subprogram of the scope current scope
+ *  @param scope           Current scope
+ */
+static void remove_local_variable(simgrid::mc::Frame& scope, const char* var_name, const char* subprogram_name,
+                                  simgrid::mc::Frame const& subprogram)
+{
+  typedef std::vector<Variable>::size_type size_type;
+
+  // If the current subprogram matches the given name:
+  if ((subprogram_name == nullptr || (not subprogram.name.empty() && subprogram.name == subprogram_name)) &&
+      not scope.variables.empty()) {
+
+    // Try to find the variable and remove it:
+    size_type start = 0;
+    size_type end   = scope.variables.size() - 1;
+
+    // Binary search:
+    while (start <= end) {
+      size_type cursor                   = start + (end - start) / 2;
+      simgrid::mc::Variable& current_var = scope.variables[cursor];
+      int compare                        = current_var.name.compare(var_name);
+      if (compare == 0) {
+        // Variable found, remove it:
+        scope.variables.erase(scope.variables.begin() + cursor);
+        break;
+      } else if (compare < 0)
+        start = cursor + 1;
+      else if (cursor != 0)
+        end = cursor - 1;
+      else
+        break;
+    }
+  }
+
+  // And recursive processing in nested scopes:
+  for (simgrid::mc::Frame& nested_scope : scope.scopes) {
+    // The new scope may be an inlined subroutine, in this case we want to use its
+    // namespaced name in recursive calls:
+    simgrid::mc::Frame const& nested_subprogram =
+        nested_scope.tag == DW_TAG_inlined_subroutine ? nested_scope : subprogram;
+    remove_local_variable(nested_scope, var_name, subprogram_name, nested_subprogram);
+  }
+}
+
+void ObjectInformation::remove_local_variable(const char* var_name, const char* subprogram_name)
+{
+  for (auto& entry : this->subprograms)
+    simgrid::mc::remove_local_variable(entry.second, var_name, subprogram_name, entry.second);
+}
+
+/** @brief Fills the position of the segments (executable, read-only, read/write) */
+// TODO, use the ELF segment information for more robustness
+void find_object_address(std::vector<simgrid::xbt::VmMap> const& maps, simgrid::mc::ObjectInformation* result)
+{
+  const int PROT_RW = PROT_READ | PROT_WRITE;
+  const int PROT_RX = PROT_READ | PROT_EXEC;
+
+  std::string name = simgrid::xbt::Path(result->file_name).get_base_name();
+
+  for (size_t i = 0; i < maps.size(); ++i) {
+    simgrid::xbt::VmMap const& reg = maps[i];
+    if (maps[i].pathname.empty())
+      continue;
+    std::string map_basename = simgrid::xbt::Path(maps[i].pathname).get_base_name();
+    if (map_basename != name)
+      continue;
+
+    // This is the non-GNU_RELRO-part of the data segment:
+    if (reg.prot == PROT_RW) {
+      xbt_assert(not result->start_rw, "Multiple read-write segments for %s, not supported", maps[i].pathname.c_str());
+      result->start_rw = (char*)reg.start_addr;
+      result->end_rw   = (char*)reg.end_addr;
+
+      // The next VMA might be end of the data segment:
+      if (i + 1 < maps.size() && maps[i + 1].pathname.empty() && maps[i + 1].prot == PROT_RW &&
+          maps[i + 1].start_addr == reg.end_addr)
+        result->end_rw = (char*)maps[i + 1].end_addr;
+    }
+
+    // This is the text segment:
+    else if (reg.prot == PROT_RX) {
+      xbt_assert(not result->start_exec, "Multiple executable segments for %s, not supported",
+                 maps[i].pathname.c_str());
+      result->start_exec = (char*)reg.start_addr;
+      result->end_exec   = (char*)reg.end_addr;
+
+      // The next VMA might be end of the data segment:
+      if (i + 1 < maps.size() && maps[i + 1].pathname.empty() && maps[i + 1].prot == PROT_RW &&
+          maps[i + 1].start_addr == reg.end_addr) {
+        result->start_rw = (char*)maps[i + 1].start_addr;
+        result->end_rw   = (char*)maps[i + 1].end_addr;
+      }
+    }
+
+    // This is the GNU_RELRO-part of the data segment:
+    else if (reg.prot == PROT_READ) {
+      xbt_assert(not result->start_ro,
+                 "Multiple read-only segments for %s, not supported. Compiling with the following may help: "
+                "-Wl,-znorelro -Wl,-znoseparate-code",
+                 maps[i].pathname.c_str());
+      result->start_ro = (char*)reg.start_addr;
+      result->end_ro   = (char*)reg.end_addr;
+    }
+  }
+
+  result->start = result->start_rw;
+  if ((const void*)result->start_ro < result->start)
+    result->start = result->start_ro;
+  if ((const void*)result->start_exec < result->start)
+    result->start = result->start_exec;
+
+  result->end = result->end_rw;
+  if (result->end_ro && (const void*)result->end_ro > result->end)
+    result->end = result->end_ro;
+  if (result->end_exec && (const void*)result->end_exec > result->end)
+    result->end = result->end_exec;
+
+  xbt_assert(result->start_exec || result->start_rw || result->start_ro);
+}
+
+} // namespace mc
+} // namespace simgrid
similarity index 77%
rename from src/mc/ObjectInformation.hpp
rename to src/mc/inspect/ObjectInformation.hpp
index c59369b..71550be 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2007-2019. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program 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 +6,13 @@
 #ifndef SIMGRID_MC_OBJECT_INFORMATION_HPP
 #define SIMGRID_MC_OBJECT_INFORMATION_HPP
 
+#include <memory>
 #include <string>
 #include <unordered_map>
-#include <memory>
 #include <vector>
 
-#include "src/mc/Frame.hpp"
-#include "src/mc/Type.hpp"
+#include "src/mc/inspect/Frame.hpp"
+#include "src/mc/inspect/Type.hpp"
 #include "src/mc/mc_forward.hpp"
 #include "src/xbt/memory_map.hpp"
 
@@ -63,16 +62,16 @@ public:
   int flags = 0;
   std::string file_name;
   const void* start = nullptr;
-  const void *end = nullptr;
+  const void* end   = nullptr;
   // Location of its text segment:
-  char *start_exec = nullptr;
-  char *end_exec = nullptr;
+  charstart_exec = nullptr;
+  char* end_exec   = nullptr;
   // Location of the read-only part of its data segment:
-  char *start_rw = nullptr;
-  char *end_rw = nullptr;
+  charstart_rw = nullptr;
+  char* end_rw   = nullptr;
   // Location of the read/write part of its data segment:
-  char *start_ro = nullptr;
-  char *end_ro = nullptr;
+  charstart_ro = nullptr;
+  char* end_ro   = nullptr;
 
   /** All of its subprograms indexed by their address */
   std::unordered_map<std::uint64_t, simgrid::mc::Frame> subprograms;
@@ -90,8 +89,7 @@ public:
    */
   std::vector<FunctionIndexEntry> functions_index;
 
-  // TODO, remove the mutable (to remove it we'll have to add a lot of const everywhere)
-  mutable std::vector<simgrid::mc::Variable> global_variables;
+  std::vector<simgrid::mc::Variable> global_variables;
 
   /** Types indexed by DWARF ID */
   std::unordered_map<std::uint64_t, simgrid::mc::Type> types;
@@ -108,20 +106,17 @@ public:
   /** Whether this module is an executable
    *
    *  More precisely we check if this is an ET_EXE ELF. These ELF files
-   *  use fixed addresses instead of base-addres relative addresses.
+   *  use fixed addresses instead of base-address relative addresses.
    *  Position independant executables are in fact ET_DYN.
    */
-  bool executable() const
-  {
-    return this->flags & simgrid::mc::ObjectInformation::Executable;
-  }
+  bool executable() const { return this->flags & simgrid::mc::ObjectInformation::Executable; }
 
   /** Base address of the module
    *
    *  All the location information in ELF and DWARF are expressed as an offsets
    *  from this base address:
    *
-   *  - location of the functions and globale variables;
+   *  - location of the functions and global variables
    *
    *  - the DWARF instruction `OP_addr` pushes this on the DWARF stack.
    **/
@@ -132,7 +127,7 @@ public:
    *  @param ip instruction address
    *  @return corresponding function (if any) or nullptr
    */
-  simgrid::mc::Frame* find_function(const void *ip) const;
+  simgrid::mc::Frame* find_function(const voidip) const;
 
   /** Find a global variable by name
    *
@@ -142,7 +137,7 @@ public:
    *  @param name scopes name of the global variable (`myproject::Foo::count`)
    *  @return corresponding variable (if any) or nullptr
    */
-  simgrid::mc::Variable* find_variable(const char* name) const;
+  const simgrid::mc::Variable* find_variable(const char* name) const;
 
   /** Remove a global variable (in order to ignore it)
    *
@@ -150,21 +145,20 @@ public:
    */
   void remove_global_variable(const char* name);
 
-  /** Remove a loval variables (in order to ignore it)
+  /** Remove a local variables (in order to ignore it)
    *
-   *  @param name Name of the globale variable
-   *  @param scope Namespaceed name of the function (or null for all functions)
+   *  @param name Name of the local variable
+   *  @param scope scopes name name of the function (myproject::Foo::count) or null for all functions
    */
-  void remove_local_variable(
-    const char* name, const char* scope);
+  void remove_local_variable(const char* name, const char* scope);
 };
 
-XBT_PRIVATE std::shared_ptr<ObjectInformation> createObjectInformation(
-  std::vector<simgrid::xbt::VmMap> const& maps, const char* name);
+XBT_PRIVATE std::shared_ptr<ObjectInformation> createObjectInformation(std::vector<simgrid::xbt::VmMap> const& maps,
+                                                                       const char* name);
 
 /** Augment the current module with informations about the other ones */
 XBT_PRIVATE void postProcessObjectInformation(simgrid::mc::RemoteClient* process, simgrid::mc::ObjectInformation* info);
-}
-}
+} // namespace mc
+} // namespace simgrid
 
 #endif
similarity index 58%
rename from src/mc/Type.hpp
rename to src/mc/inspect/Type.hpp
index 7bc1464..ff9642f 100644 (file)
@@ -8,14 +8,17 @@
 
 #include <cstddef>
 
-#include <vector>
 #include <string>
+#include <vector>
+
+#define DW_LANG_Objc DW_LANG_ObjC /* fix spelling error in older dwarf.h */
+#include <dwarf.h>
 
 #include "xbt/asserts.h"
 #include "xbt/base.h"
 
+#include "src/mc/inspect/LocationList.hpp"
 #include "src/mc/mc_forward.hpp"
-#include "src/mc/LocationList.hpp"
 
 namespace simgrid {
 namespace mc {
@@ -27,7 +30,7 @@ namespace mc {
 class Member {
 public:
   typedef int flags_type;
-  static constexpr flags_type INHERITANCE_FLAG = 1;
+  static constexpr flags_type INHERITANCE_FLAG     = 1;
   static constexpr flags_type VIRTUAL_POINTER_FLAG = 2;
 
   Member() = default;
@@ -43,35 +46,28 @@ public:
 
   std::size_t byte_size = 0; // Do we really need this?
 
-  unsigned type_id = 0;
+  unsigned type_id        = 0;
   simgrid::mc::Type* type = nullptr;
 
-  bool isInheritance() const
-  {
-    return this->flags & INHERITANCE_FLAG;
-  }
-  bool isVirtualPointer() const
-  {
-    return this->flags & VIRTUAL_POINTER_FLAG;
-  }
+  bool isInheritance() const { return this->flags & INHERITANCE_FLAG; }
+  bool isVirtualPointer() const { return this->flags & VIRTUAL_POINTER_FLAG; }
 
   /** Whether the member is at a fixed offset from the base address */
   bool has_offset_location() const
   {
     // Recognize the expression `DW_OP_plus_uconst(offset)`:
-    return location_expression.size() == 1 &&
-      location_expression[0].atom == DW_OP_plus_uconst;
+    return location_expression.size() == 1 && location_expression[0].atom == DW_OP_plus_uconst;
   }
 
   /** Get the offset of the member
-  *
-  *  This is only valid is the member is at a fixed offset from the base.
-  *  This is often the case (for C types, C++ type without virtual
-  *  inheritance).
-  *
-  *  If the location is more complex, the location expression has
-  *  to be evaluated (which might need accessing the memory).
-  */
+   *
+   *  This is only valid is the member is at a fixed offset from the base.
+   *  This is often the case (for C types, C++ type without virtual
+   *  inheritance).
+   *
+   *  If the location is more complex, the location expression has
+   *  to be evaluated (which might need accessing the memory).
+   */
   int offset() const
   {
     xbt_assert(this->has_offset_location());
@@ -83,11 +79,10 @@ public:
   {
     // Set the expression to be `DW_OP_plus_uconst(offset)`:
     Dwarf_Op op;
-    op.atom = DW_OP_plus_uconst;
-    op.number = new_offset;
-    this->location_expression = { op };
+    op.atom                   = DW_OP_plus_uconst;
+    op.number                 = new_offset;
+    this->location_expression = {op};
   }
-
 };
 
 /** A type in the model-checked program */
@@ -96,19 +91,19 @@ public:
   Type() = default;
 
   /** The DWARF TAG of the type (e.g. DW_TAG_array_type) */
-  int type = 0;
-  unsigned id = 0; /* Offset in the section (in hexadecimal form) */
-  std::string name; /* Name of the type */
-  int byte_size = 0; /* Size in bytes */
-  int element_count = 0; /* Number of elements for array type */
-  unsigned type_id = 0; /* DW_AT_type id */
+  int type    = 0;
+  unsigned id = 0;             /* Offset in the section (in hexadecimal form) */
+  std::string name;            /* Name of the type */
+  int byte_size     = 0;       /* Size in bytes */
+  int element_count = 0;       /* Number of elements for array type */
+  unsigned type_id  = 0;       /* DW_AT_type id */
   std::vector<Member> members; /* if DW_TAG_structure_type, DW_TAG_class_type, DW_TAG_union_type*/
 
-  simgrid::mc::Type* subtype = nullptr; // DW_AT_type
+  simgrid::mc::Type* subtype   = nullptr; // DW_AT_type
   simgrid::mc::Type* full_type = nullptr; // The same (but more complete) type
 };
 
-}
-}
+} // namespace mc
+} // namespace simgrid
 
 #endif
similarity index 86%
rename from src/mc/Variable.hpp
rename to src/mc/inspect/Variable.hpp
index b3a0817..8c4f6c2 100644 (file)
@@ -11,8 +11,8 @@
 
 #include <string>
 
+#include "src/mc/inspect/LocationList.hpp"
 #include "src/mc/mc_forward.hpp"
-#include "src/mc/LocationList.hpp"
 
 namespace simgrid {
 namespace mc {
@@ -20,11 +20,11 @@ namespace mc {
 /** A variable (global or local) in the model-checked program */
 class Variable {
 public:
-  Variable() = default;
+  Variable()       = default;
   std::uint32_t id = 0;
-  bool global = false;
+  bool global      = false;
   std::string name;
-  unsigned type_id = 0;
+  unsigned type_id        = 0;
   simgrid::mc::Type* type = nullptr;
 
   /** Address of the variable (if it is fixed) */
@@ -43,7 +43,7 @@ public:
   simgrid::mc::ObjectInformation* object_info = nullptr;
 };
 
-}
-}
+} // namespace mc
+} // namespace simgrid
 
 #endif
similarity index 57%
rename from src/mc/mc_dwarf.cpp
rename to src/mc/inspect/mc_dwarf.cpp
index ec22c9a..93fc9c7 100644 (file)
@@ -3,33 +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 "src/simgrid/util.hpp"
+#include "xbt/log.h"
+#include "xbt/string.hpp"
+#include "xbt/sysdep.h"
+#include <simgrid/config.h>
+
+#include "src/mc/inspect/ObjectInformation.hpp"
+#include "src/mc/inspect/Variable.hpp"
+#include "src/mc/inspect/mc_dwarf.hpp"
+#include "src/mc/mc_private.hpp"
+#include "src/mc/remote/RemoteClient.hpp"
+
 #include <cinttypes>
 #include <cstdint>
-
+#include <cstdlib>
+#include <fcntl.h>
 #include <memory>
 #include <utility>
 
 #include <boost/range/algorithm.hpp>
 
-#include <fcntl.h>
-#include <cstdlib>
 #include <elfutils/libdw.h>
 
 #include <boost/algorithm/string/predicate.hpp>
 
-#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_dwarf.hpp"
-#include "src/mc/mc_private.hpp"
-
-#include "src/mc/ObjectInformation.hpp"
-#include "src/mc/Variable.hpp"
-#include "src/mc/remote/RemoteClient.hpp"
-
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_dwarf, mc, "DWARF processing");
 
 /** @brief The default DW_TAG_lower_bound for a given DW_AT_language.
@@ -57,7 +55,7 @@ static uint64_t MC_dwarf_subrange_element_count(Dwarf_Die* die, Dwarf_Die* unit)
  *
  * @param die DIE for the DW_TAG_array_type
  */
-static uint64_t MC_dwarf_array_element_count(Dwarf_Die * die, Dwarf_Die * unit);
+static uint64_t MC_dwarf_array_element_count(Dwarf_Die* die, Dwarf_Die* unit);
 
 /** @brief Process a DIE
  *
@@ -66,15 +64,13 @@ static uint64_t MC_dwarf_array_element_count(Dwarf_Die * die, Dwarf_Die * unit);
  *  @param unit the DIE of the compile unit of the current DIE
  *  @param frame containing frame if any
  */
-static void MC_dwarf_handle_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
-                                Dwarf_Die * unit, simgrid::mc::Frame* frame,
-                                const char *ns);
+static void MC_dwarf_handle_die(simgrid::mc::ObjectInformation* info, Dwarf_Die* die, Dwarf_Die* unit,
+                                simgrid::mc::Frame* frame, const char* ns);
 
 /** @brief Process a type DIE
  */
-static void MC_dwarf_handle_type_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
-                                     Dwarf_Die * unit, simgrid::mc::Frame* frame,
-                                     const char *ns);
+static void MC_dwarf_handle_type_die(simgrid::mc::ObjectInformation* info, Dwarf_Die* die, Dwarf_Die* unit,
+                                     simgrid::mc::Frame* frame, const char* ns);
 
 /** @brief Calls MC_dwarf_handle_die on all children of the given die
  *
@@ -83,9 +79,8 @@ static void MC_dwarf_handle_type_die(simgrid::mc::ObjectInformation* info, Dwarf
  *  @param unit the DIE of the compile unit of the current DIE
  *  @param frame containing frame if any
  */
-static void MC_dwarf_handle_children(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
-                                     Dwarf_Die * unit, simgrid::mc::Frame* frame,
-                                     const char *ns);
+static void MC_dwarf_handle_children(simgrid::mc::ObjectInformation* info, Dwarf_Die* die, Dwarf_Die* unit,
+                                     simgrid::mc::Frame* frame, const char* ns);
 
 /** @brief Handle a variable (DW_TAG_variable or other)
  *
@@ -94,34 +89,26 @@ static void MC_dwarf_handle_children(simgrid::mc::ObjectInformation* info, Dwarf
  *  @param unit the DIE of the compile unit of the current DIE
  *  @param frame containing frame if any
  */
-static void MC_dwarf_handle_variable_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
-                                         Dwarf_Die * unit, simgrid::mc::Frame* frame,
-                                         const char *ns);
+static void MC_dwarf_handle_variable_die(simgrid::mc::ObjectInformation* info, Dwarf_Die* die, Dwarf_Die* unit,
+                                         simgrid::mc::Frame* frame, const char* ns);
 
 /** @brief Get the DW_TAG_type of the DIE
  *
  *  @param die DIE
  *  @return DW_TAG_type attribute as a new string (nullptr if none)
  */
-static std::uint64_t MC_dwarf_at_type(Dwarf_Die * die);
+static std::uint64_t MC_dwarf_at_type(Dwarf_Die* die);
 
 namespace simgrid {
 namespace dwarf {
 
-enum class TagClass {
-  Unknown,
-  Type,
-  Subprogram,
-  Variable,
-  Scope,
-  Namespace
-};
+enum class TagClass { Unknown, Type, Subprogram, Variable, Scope, Namespace };
 
 /*** Class of forms defined in the DWARF standard */
 enum class FormClass {
   Unknown,
-  Address,   // Location in the program's address space
-  Block,     // Arbitrary block of bytes
+  Address, // Location in the program's address space
+  Block,   // Arbitrary block of bytes
   Constant,
   String,
   Flag,      // Boolean value
@@ -133,55 +120,54 @@ enum class FormClass {
   RangeListPtr
 };
 
-static
-TagClass classify_tag(int tag)
+static TagClass classify_tag(int tag)
 {
   switch (tag) {
 
-  case DW_TAG_array_type:
-  case DW_TAG_class_type:
-  case DW_TAG_enumeration_type:
-  case DW_TAG_typedef:
-  case DW_TAG_pointer_type:
-  case DW_TAG_reference_type:
-  case DW_TAG_rvalue_reference_type:
-  case DW_TAG_string_type:
-  case DW_TAG_structure_type:
-  case DW_TAG_subroutine_type:
-  case DW_TAG_union_type:
-  case DW_TAG_ptr_to_member_type:
-  case DW_TAG_set_type:
-  case DW_TAG_subrange_type:
-  case DW_TAG_base_type:
-  case DW_TAG_const_type:
-  case DW_TAG_file_type:
-  case DW_TAG_packed_type:
-  case DW_TAG_volatile_type:
-  case DW_TAG_restrict_type:
-  case DW_TAG_interface_type:
-  case DW_TAG_unspecified_type:
-  case DW_TAG_shared_type:
-    return TagClass::Type;
-
-  case DW_TAG_subprogram:
-    return TagClass::Subprogram;
-
-  case DW_TAG_variable:
-  case DW_TAG_formal_parameter:
-    return TagClass::Variable;
-
-  case DW_TAG_lexical_block:
-  case DW_TAG_try_block:
-  case DW_TAG_catch_block:
-  case DW_TAG_inlined_subroutine:
-  case DW_TAG_with_stmt:
-    return TagClass::Scope;
-
-  case DW_TAG_namespace:
-    return TagClass::Namespace;
-
-  default:
-    return TagClass::Unknown;
+    case DW_TAG_array_type:
+    case DW_TAG_class_type:
+    case DW_TAG_enumeration_type:
+    case DW_TAG_typedef:
+    case DW_TAG_pointer_type:
+    case DW_TAG_reference_type:
+    case DW_TAG_rvalue_reference_type:
+    case DW_TAG_string_type:
+    case DW_TAG_structure_type:
+    case DW_TAG_subroutine_type:
+    case DW_TAG_union_type:
+    case DW_TAG_ptr_to_member_type:
+    case DW_TAG_set_type:
+    case DW_TAG_subrange_type:
+    case DW_TAG_base_type:
+    case DW_TAG_const_type:
+    case DW_TAG_file_type:
+    case DW_TAG_packed_type:
+    case DW_TAG_volatile_type:
+    case DW_TAG_restrict_type:
+    case DW_TAG_interface_type:
+    case DW_TAG_unspecified_type:
+    case DW_TAG_shared_type:
+      return TagClass::Type;
+
+    case DW_TAG_subprogram:
+      return TagClass::Subprogram;
+
+    case DW_TAG_variable:
+    case DW_TAG_formal_parameter:
+      return TagClass::Variable;
+
+    case DW_TAG_lexical_block:
+    case DW_TAG_try_block:
+    case DW_TAG_catch_block:
+    case DW_TAG_inlined_subroutine:
+    case DW_TAG_with_stmt:
+      return TagClass::Scope;
+
+    case DW_TAG_namespace:
+      return TagClass::Namespace;
+
+    default:
+      return TagClass::Unknown;
   }
 }
 
@@ -192,43 +178,42 @@ TagClass classify_tag(int tag)
  *  @param form The form (values taken from the DWARF spec)
  *  @return An internal representation for the corresponding class
  * */
-static
-FormClass classify_form(int form)
+static FormClass classify_form(int form)
 {
   switch (form) {
-  case DW_FORM_addr:
-    return FormClass::Address;
-  case DW_FORM_block2:
-  case DW_FORM_block4:
-  case DW_FORM_block:
-  case DW_FORM_block1:
-    return FormClass::Block;
-  case DW_FORM_data1:
-  case DW_FORM_data2:
-  case DW_FORM_data4:
-  case DW_FORM_data8:
-  case DW_FORM_udata:
-  case DW_FORM_sdata:
-    return FormClass::Constant;
-  case DW_FORM_string:
-  case DW_FORM_strp:
-    return FormClass::String;
-  case DW_FORM_ref_addr:
-  case DW_FORM_ref1:
-  case DW_FORM_ref2:
-  case DW_FORM_ref4:
-  case DW_FORM_ref8:
-  case DW_FORM_ref_udata:
-    return FormClass::Reference;
-  case DW_FORM_flag:
-  case DW_FORM_flag_present:
-    return FormClass::Flag;
-  case DW_FORM_exprloc:
-    return FormClass::ExprLoc;
-    // TODO sec offset
-    // TODO indirect
-  default:
-    return FormClass::Unknown;
+    case DW_FORM_addr:
+      return FormClass::Address;
+    case DW_FORM_block2:
+    case DW_FORM_block4:
+    case DW_FORM_block:
+    case DW_FORM_block1:
+      return FormClass::Block;
+    case DW_FORM_data1:
+    case DW_FORM_data2:
+    case DW_FORM_data4:
+    case DW_FORM_data8:
+    case DW_FORM_udata:
+    case DW_FORM_sdata:
+      return FormClass::Constant;
+    case DW_FORM_string:
+    case DW_FORM_strp:
+      return FormClass::String;
+    case DW_FORM_ref_addr:
+    case DW_FORM_ref1:
+    case DW_FORM_ref2:
+    case DW_FORM_ref4:
+    case DW_FORM_ref8:
+    case DW_FORM_ref_udata:
+      return FormClass::Reference;
+    case DW_FORM_flag:
+    case DW_FORM_flag_present:
+      return FormClass::Flag;
+    case DW_FORM_exprloc:
+      return FormClass::ExprLoc;
+      // TODO sec offset
+      // TODO indirect
+    default:
+      return FormClass::Unknown;
   }
 }
 
@@ -237,14 +222,13 @@ FormClass classify_form(int form)
  *  @param die DIE
  *  @return name of the tag of this DIE
  */
-inline XBT_PRIVATE
-const char *tagname(Dwarf_Die * die)
+inline XBT_PRIVATE const char* tagname(Dwarf_Die* die)
 {
   return simgrid::dwarf::tagname(dwarf_tag(die));
 }
 
-}
-}
+} // namespace dwarf
+} // namespace simgrid
 
 // ***** Attributes
 
@@ -254,8 +238,7 @@ const char *tagname(Dwarf_Die * die)
  *  @param attribute attribute
  *  @return value of the given attribute of the given DIE
  */
-static const char *MC_dwarf_attr_integrate_string(Dwarf_Die * die,
-                                                  int attribute)
+static const char* MC_dwarf_attr_integrate_string(Dwarf_Die* die, int attribute)
 {
   Dwarf_Attribute attr;
   if (not dwarf_attr_integrate(die, attribute, &attr))
@@ -264,28 +247,25 @@ static const char *MC_dwarf_attr_integrate_string(Dwarf_Die * die,
     return dwarf_formstring(&attr);
 }
 
-static Dwarf_Off MC_dwarf_attr_dieoffset(Dwarf_Die * die, int attribute)
+static Dwarf_Off MC_dwarf_attr_dieoffset(Dwarf_Die* die, int attribute)
 {
   Dwarf_Attribute attr;
   if (dwarf_hasattr_integrate(die, attribute) == 0)
     return 0;
   dwarf_attr_integrate(die, attribute, &attr);
   Dwarf_Die subtype_die;
-  if (dwarf_formref_die(&attr, &subtype_die) == nullptr)
-    xbt_die("Could not find DIE");
+  xbt_assert(dwarf_formref_die(&attr, &subtype_die) != nullptr, "Could not find DIE");
   return dwarf_dieoffset(&subtype_die);
 }
 
-static Dwarf_Off MC_dwarf_attr_integrate_dieoffset(Dwarf_Die * die,
-                                                   int attribute)
+static Dwarf_Off MC_dwarf_attr_integrate_dieoffset(Dwarf_Die* die, int attribute)
 {
   Dwarf_Attribute attr;
   if (dwarf_hasattr_integrate(die, attribute) == 0)
     return 0;
   dwarf_attr_integrate(die, DW_AT_type, &attr);
   Dwarf_Die subtype_die;
-  if (dwarf_formref_die(&attr, &subtype_die) == nullptr)
-    xbt_die("Could not find DIE");
+  xbt_assert(dwarf_formref_die(&attr, &subtype_die) != nullptr, "Could not find DIE");
   return dwarf_dieoffset(&subtype_die);
 }
 
@@ -294,46 +274,41 @@ static Dwarf_Off MC_dwarf_attr_integrate_dieoffset(Dwarf_Die * die,
  *  @param die the DIE
  *  @return DW_AT_type reference as a global offset in hexadecimal (or nullptr)
  */
-static
-std::uint64_t MC_dwarf_at_type(Dwarf_Die * die)
+static std::uint64_t MC_dwarf_at_type(Dwarf_Die* die)
 {
   return MC_dwarf_attr_integrate_dieoffset(die, DW_AT_type);
 }
 
-static uint64_t MC_dwarf_attr_integrate_addr(Dwarf_Die * die, int attribute)
+static uint64_t MC_dwarf_attr_integrate_addr(Dwarf_Die* die, int attribute)
 {
   Dwarf_Attribute attr;
   if (dwarf_attr_integrate(die, attribute, &attr) == nullptr)
     return 0;
   Dwarf_Addr value;
   if (dwarf_formaddr(&attr, &value) == 0)
-    return (uint64_t) value;
+    return (uint64_t)value;
   else
     return 0;
 }
 
-static uint64_t MC_dwarf_attr_integrate_uint(Dwarf_Die * die, int attribute,
-                                             uint64_t default_value)
+static uint64_t MC_dwarf_attr_integrate_uint(Dwarf_Die* die, int attribute, uint64_t default_value)
 {
   Dwarf_Attribute attr;
   if (dwarf_attr_integrate(die, attribute, &attr) == nullptr)
     return default_value;
   Dwarf_Word value;
-  return dwarf_formudata(dwarf_attr_integrate(die, attribute, &attr),
-                         &value) == 0 ? (uint64_t) value : default_value;
+  return dwarf_formudata(dwarf_attr_integrate(die, attribute, &attr), &value) == 0 ? (uint64_t)value : default_value;
 }
 
-static bool MC_dwarf_attr_flag(Dwarf_Die * die, int attribute, bool integrate)
+static bool MC_dwarf_attr_flag(Dwarf_Die* die, int attribute, bool integrate)
 {
   Dwarf_Attribute attr;
-  if ((integrate ? dwarf_attr_integrate(die, attribute, &attr)
-       : dwarf_attr(die, attribute, &attr)) == 0)
+  if ((integrate ? dwarf_attr_integrate(die, attribute, &attr) : dwarf_attr(die, attribute, &attr)) == 0)
     return false;
 
   bool result;
-  if (dwarf_formflag(&attr, &result))
-    xbt_die("Unexpected form for attribute %s",
-      simgrid::dwarf::attrname(attribute));
+  xbt_assert(not dwarf_formflag(&attr, &result), "Unexpected form for attribute %s",
+             simgrid::dwarf::attrname(attribute));
   return result;
 }
 
@@ -348,32 +323,31 @@ static bool MC_dwarf_attr_flag(Dwarf_Die * die, int attribute, bool integrate)
 static uint64_t MC_dwarf_default_lower_bound(int lang)
 {
   switch (lang) {
-  case DW_LANG_C:
-  case DW_LANG_C89:
-  case DW_LANG_C99:
-  case DW_LANG_C_plus_plus:
-  case DW_LANG_D:
-  case DW_LANG_Java:
-  case DW_LANG_ObjC:
-  case DW_LANG_ObjC_plus_plus:
-  case DW_LANG_Python:
-  case DW_LANG_UPC:
-    return 0;
-  case DW_LANG_Ada83:
-  case DW_LANG_Ada95:
-  case DW_LANG_Fortran77:
-  case DW_LANG_Fortran90:
-  case DW_LANG_Fortran95:
-  case DW_LANG_Modula2:
-  case DW_LANG_Pascal83:
-  case DW_LANG_PL1:
-  case DW_LANG_Cobol74:
-  case DW_LANG_Cobol85:
-    return 1;
-  default:
-    xbt_die("No default DW_TAG_lower_bound for language %i and none given",
-            lang);
-    return 0;
+    case DW_LANG_C:
+    case DW_LANG_C89:
+    case DW_LANG_C99:
+    case DW_LANG_C_plus_plus:
+    case DW_LANG_D:
+    case DW_LANG_Java:
+    case DW_LANG_ObjC:
+    case DW_LANG_ObjC_plus_plus:
+    case DW_LANG_Python:
+    case DW_LANG_UPC:
+      return 0;
+    case DW_LANG_Ada83:
+    case DW_LANG_Ada95:
+    case DW_LANG_Fortran77:
+    case DW_LANG_Fortran90:
+    case DW_LANG_Fortran95:
+    case DW_LANG_Modula2:
+    case DW_LANG_Pascal83:
+    case DW_LANG_PL1:
+    case DW_LANG_Cobol74:
+    case DW_LANG_Cobol85:
+      return 1;
+    default:
+      xbt_die("No default DW_TAG_lower_bound for language %i and none given", lang);
+      return 0;
   }
 }
 
@@ -383,13 +357,10 @@ static uint64_t MC_dwarf_default_lower_bound(int lang)
  *  @param unit DIE of the compilation unit
  *  @return     number of elements in the range
  * */
-static uint64_t MC_dwarf_subrange_element_count(Dwarf_Die * die,
-                                                Dwarf_Die * unit)
+static uint64_t MC_dwarf_subrange_element_count(Dwarf_Die* die, Dwarf_Die* unit)
 {
-  xbt_assert(dwarf_tag(die) == DW_TAG_enumeration_type
-             || dwarf_tag(die) == DW_TAG_subrange_type,
-             "MC_dwarf_subrange_element_count called with DIE of type %s",
-             simgrid::dwarf::tagname(die));
+  xbt_assert(dwarf_tag(die) == DW_TAG_enumeration_type || dwarf_tag(die) == DW_TAG_subrange_type,
+             "MC_dwarf_subrange_element_count called with DIE of type %s", simgrid::dwarf::tagname(die));
 
   // Use DW_TAG_count if present:
   if (dwarf_hasattr_integrate(die, DW_AT_count))
@@ -419,20 +390,17 @@ static uint64_t MC_dwarf_subrange_element_count(Dwarf_Die * die,
  *  @param unit the DIE of the compilation unit
  *  @return number of elements in this array type
  * */
-static uint64_t MC_dwarf_array_element_count(Dwarf_Die * die, Dwarf_Die * unit)
+static uint64_t MC_dwarf_array_element_count(Dwarf_Die* die, Dwarf_Die* unit)
 {
-  xbt_assert(dwarf_tag(die) == DW_TAG_array_type,
-             "MC_dwarf_array_element_count called with DIE of type %s",
+  xbt_assert(dwarf_tag(die) == DW_TAG_array_type, "MC_dwarf_array_element_count called with DIE of type %s",
              simgrid::dwarf::tagname(die));
 
   int result = 1;
   Dwarf_Die child;
   int res;
-  for (res = dwarf_child(die, &child); res == 0;
-       res = dwarf_siblingof(&child, &child)) {
+  for (res = dwarf_child(die, &child); res == 0; res = dwarf_siblingof(&child, &child)) {
     int child_tag = dwarf_tag(&child);
-    if (child_tag == DW_TAG_subrange_type
-        || child_tag == DW_TAG_enumeration_type)
+    if (child_tag == DW_TAG_subrange_type || child_tag == DW_TAG_enumeration_type)
       result *= MC_dwarf_subrange_element_count(&child, unit);
   }
   return result;
@@ -444,8 +412,7 @@ static uint64_t MC_dwarf_array_element_count(Dwarf_Die * die, Dwarf_Die * unit)
  *
  *  We could use boost::container::flat_set instead.
  */
-static bool MC_compare_variable(
-  simgrid::mc::Variable const& a, simgrid::mc::Variable const& b)
+static bool MC_compare_variable(simgrid::mc::Variable const& a, simgrid::mc::Variable const& b)
 {
   int cmp = a.name.compare(b.name);
   if (cmp < 0)
@@ -465,59 +432,50 @@ static bool MC_compare_variable(
  *  @param  member the member of the type
  *  @param  child  DIE of the member (DW_TAG_member)
  */
-static void MC_dwarf_fill_member_location(
-  simgrid::mc::Type* type, simgrid::mc::Member* member, Dwarf_Die * child)
+static void MC_dwarf_fill_member_location(simgrid::mc::Type* type, simgrid::mc::Member* member, Dwarf_Die* child)
 {
-  if (dwarf_hasattr(child, DW_AT_data_bit_offset))
-    xbt_die("Can't groke DW_AT_data_bit_offset.");
+  xbt_assert(not dwarf_hasattr(child, DW_AT_data_bit_offset), "Can't groke DW_AT_data_bit_offset.");
 
   if (not dwarf_hasattr_integrate(child, DW_AT_data_member_location)) {
     if (type->type == DW_TAG_union_type)
       return;
-    xbt_die
-        ("Missing DW_AT_data_member_location field in DW_TAG_member %s of type <%"
-         PRIx64 ">%s", member->name.c_str(),
-         (uint64_t) type->id, type->name.c_str());
+    xbt_die("Missing DW_AT_data_member_location field in DW_TAG_member %s of type <%" PRIx64 ">%s",
+            member->name.c_str(), (uint64_t)type->id, type->name.c_str());
   }
 
   Dwarf_Attribute attr;
   dwarf_attr_integrate(child, DW_AT_data_member_location, &attr);
-  int form = dwarf_whatform(&attr);
+  int form                             = dwarf_whatform(&attr);
   simgrid::dwarf::FormClass form_class = simgrid::dwarf::classify_form(form);
   switch (form_class) {
-  case simgrid::dwarf::FormClass::ExprLoc:
-  case simgrid::dwarf::FormClass::Block:
-    // Location expression:
-    {
-      Dwarf_Op *expr;
-      size_t len;
-      if (dwarf_getlocation(&attr, &expr, &len))
-        xbt_die
-            ("Could not read location expression DW_AT_data_member_location in DW_TAG_member %s of type <%"
-             PRIx64 ">%s", MC_dwarf_attr_integrate_string(child, DW_AT_name),
-             (uint64_t) type->id, type->name.c_str());
-      member->location_expression = simgrid::dwarf::DwarfExpression(expr, expr+len);
-      break;
-    }
-  case simgrid::dwarf::FormClass::Constant:
-    // Offset from the base address of the object:
-    {
-      Dwarf_Word offset;
-      if (not dwarf_formudata(&attr, &offset))
+    case simgrid::dwarf::FormClass::ExprLoc:
+    case simgrid::dwarf::FormClass::Block:
+      // Location expression:
+      {
+        Dwarf_Op* expr;
+        size_t len;
+        xbt_assert(not dwarf_getlocation(&attr, &expr, &len),
+                   "Could not read location expression DW_AT_data_member_location in DW_TAG_member %s of type <%" PRIx64
+                   ">%s",
+                   MC_dwarf_attr_integrate_string(child, DW_AT_name), (uint64_t)type->id, type->name.c_str());
+        member->location_expression = simgrid::dwarf::DwarfExpression(expr, expr + len);
+        break;
+      }
+    case simgrid::dwarf::FormClass::Constant:
+      // Offset from the base address of the object:
+      {
+        Dwarf_Word offset;
+        xbt_assert(not dwarf_formudata(&attr, &offset), "Cannot get %s location <%" PRIx64 ">%s",
+                   MC_dwarf_attr_integrate_string(child, DW_AT_name), (uint64_t)type->id, type->name.c_str());
         member->offset(offset);
-      else
-        xbt_die("Cannot get %s location <%" PRIx64 ">%s",
-                MC_dwarf_attr_integrate_string(child, DW_AT_name),
-                (uint64_t) type->id, type->name.c_str());
-      break;
-    }
+        break;
+      }
 
-  default:
-    // includes FormClass::LocListPtr (reference to a location list: TODO) and FormClass::Reference (it's supposed to be
-    // possible in DWARF2 but I couldn't find its semantic in the spec)
-    xbt_die("Can't handle form class (%d) / form 0x%x as DW_AT_member_location", (int)form_class, (unsigned)form);
+    default:
+      // includes FormClass::LocListPtr (reference to a location list: TODO) and FormClass::Reference (it's supposed to
+      // be possible in DWARF2 but I couldn't find its semantic in the spec)
+      xbt_die("Can't handle form class (%d) / form 0x%x as DW_AT_member_location", (int)form_class, (unsigned)form);
   }
-
 }
 
 /** @brief Populate the list of members of a type
@@ -533,8 +491,7 @@ static void MC_dwarf_add_members(simgrid::mc::ObjectInformation* /*info*/, Dwarf
   int res;
   Dwarf_Die child;
   xbt_assert(type->members.empty());
-  for (res = dwarf_child(die, &child); res == 0;
-       res = dwarf_siblingof(&child, &child)) {
+  for (res = dwarf_child(die, &child); res == 0; res = dwarf_siblingof(&child, &child)) {
     int tag = dwarf_tag(&child);
     if (tag == DW_TAG_member || tag == DW_TAG_inheritance) {
 
@@ -551,13 +508,13 @@ static void MC_dwarf_add_members(simgrid::mc::ObjectInformation* /*info*/, Dwarf
       if (tag == DW_TAG_inheritance)
         member.flags |= simgrid::mc::Member::INHERITANCE_FLAG;
 
-      const char *name = MC_dwarf_attr_integrate_string(&child, DW_AT_name);
+      const charname = MC_dwarf_attr_integrate_string(&child, DW_AT_name);
       if (name)
         member.name = name;
       // Those base names are used by GCC and clang for virtual table pointers
       // respectively ("__vptr$ClassName", "__vptr.ClassName"):
       if (boost::algorithm::starts_with(member.name, "__vptr$") ||
-        boost::algorithm::starts_with(member.name, "__vptr."))
+          boost::algorithm::starts_with(member.name, "__vptr."))
         member.flags |= simgrid::mc::Member::VIRTUAL_POINTER_FLAG;
       // A cleaner solution would be to check against the type:
       // ---
@@ -577,19 +534,15 @@ static void MC_dwarf_add_members(simgrid::mc::ObjectInformation* /*info*/, Dwarf
       //         name: "int"
       // ---
 
-      member.byte_size =
-          MC_dwarf_attr_integrate_uint(&child, DW_AT_byte_size, 0);
-      member.type_id = MC_dwarf_at_type(&child);
+      member.byte_size = MC_dwarf_attr_integrate_uint(&child, DW_AT_byte_size, 0);
+      member.type_id   = MC_dwarf_at_type(&child);
 
-      if (dwarf_hasattr(&child, DW_AT_data_bit_offset))
-        xbt_die("Can't groke DW_AT_data_bit_offset.");
+      xbt_assert(not dwarf_hasattr(&child, DW_AT_data_bit_offset), "Can't groke DW_AT_data_bit_offset.");
 
       MC_dwarf_fill_member_location(type, &member, &child);
 
-      if (not member.type_id)
-        xbt_die("Missing type for member %s of <%" PRIx64 ">%s",
-                member.name.c_str(),
-                (uint64_t) type->id, type->name.c_str());
+      xbt_assert(member.type_id, "Missing type for member %s of <%" PRIx64 ">%s", member.name.c_str(),
+                 (uint64_t)type->id, type->name.c_str());
 
       type->members.push_back(std::move(member));
     }
@@ -603,35 +556,33 @@ static void MC_dwarf_add_members(simgrid::mc::ObjectInformation* /*info*/, Dwarf
  *  @param unit compilation unit of the current DIE
  *  @return MC representation of the type
  */
-static simgrid::mc::Type MC_dwarf_die_to_type(
-  simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
-  Dwarf_Die * unit, simgrid::mc::Frame* frame,
-  const char *ns)
+static simgrid::mc::Type MC_dwarf_die_to_type(simgrid::mc::ObjectInformation* info, Dwarf_Die* die, Dwarf_Die* unit,
+                                              simgrid::mc::Frame* frame, const char* ns)
 {
   simgrid::mc::Type type;
-  type.type = dwarf_tag(die);
-  type.name = std::string();
+  type.type          = dwarf_tag(die);
+  type.name          = std::string();
   type.element_count = -1;
 
   // Global Offset
   type.id = dwarf_dieoffset(die);
 
-  const char *prefix = "";
+  const charprefix = "";
   switch (type.type) {
-  case DW_TAG_structure_type:
-    prefix = "struct ";
-    break;
-  case DW_TAG_union_type:
-    prefix = "union ";
-    break;
-  case DW_TAG_class_type:
-    prefix = "class ";
-    break;
-  default:
-    prefix = "";
+    case DW_TAG_structure_type:
+      prefix = "struct ";
+      break;
+    case DW_TAG_union_type:
+      prefix = "union ";
+      break;
+    case DW_TAG_class_type:
+      prefix = "class ";
+      break;
+    default:
+      prefix = "";
   }
 
-  const char *name = MC_dwarf_attr_integrate_string(die, DW_AT_name);
+  const charname = MC_dwarf_attr_integrate_string(die, DW_AT_name);
   if (name != nullptr) {
     if (ns)
       type.name = simgrid::xbt::string_printf("%s%s::%s", prefix, ns, name);
@@ -650,47 +601,44 @@ static simgrid::mc::Type MC_dwarf_die_to_type(
   // 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
-           || type.type == DW_TAG_structure_type
-           || type.type == DW_TAG_class_type) {
+  else if (type.type == DW_TAG_array_type || type.type == DW_TAG_structure_type || type.type == DW_TAG_class_type) {
     Dwarf_Word size;
     if (dwarf_aggregate_size(die, &size) == 0)
       type.byte_size = size;
   }
 
   switch (type.type) {
-  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
-    break;
-
-  case DW_TAG_pointer_type:
-  case DW_TAG_reference_type:
-  case DW_TAG_rvalue_reference_type:
-    break;
-
-  case DW_TAG_structure_type:
-  case DW_TAG_union_type:
-  case DW_TAG_class_type:
-    MC_dwarf_add_members(info, die, unit, &type);
-    MC_dwarf_handle_children(info, die, unit, frame,
-                             ns ? simgrid::xbt::string_printf("%s::%s", ns, name).c_str() : type.name.c_str());
-    break;
-
-  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
+      break;
+
+    case DW_TAG_pointer_type:
+    case DW_TAG_reference_type:
+    case DW_TAG_rvalue_reference_type:
+      break;
+
+    case DW_TAG_structure_type:
+    case DW_TAG_union_type:
+    case DW_TAG_class_type:
+      MC_dwarf_add_members(info, die, unit, &type);
+      MC_dwarf_handle_children(info, die, unit, frame,
+                               ns ? simgrid::xbt::string_printf("%s::%s", ns, name).c_str() : type.name.c_str());
+      break;
+
+    default:
+      XBT_DEBUG("Unhandled type: %d (%s)", type.type, simgrid::dwarf::tagname(type.type));
+      break;
   }
 
   return type;
 }
 
-static void MC_dwarf_handle_type_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
-                                     Dwarf_Die * unit, simgrid::mc::Frame* frame,
-                                     const char *ns)
+static void MC_dwarf_handle_type_die(simgrid::mc::ObjectInformation* info, Dwarf_Die* die, Dwarf_Die* unit,
+                                     simgrid::mc::Frame* frame, const char* ns)
 {
   simgrid::mc::Type type = MC_dwarf_die_to_type(info, die, unit, frame, ns);
-  auto& t = (info->types[type.id] = std::move(type));
+  auto& t                = (info->types[type.id] = std::move(type));
   if (not t.name.empty() && type.byte_size != 0)
     info->full_types_by_name[t.name] = &t;
 }
@@ -714,13 +662,12 @@ static std::unique_ptr<simgrid::mc::Variable> MC_die_to_variable(simgrid::mc::Ob
     // No location: do not add it ?
     return nullptr;
 
-  std::unique_ptr<simgrid::mc::Variable> variable =
-    std::unique_ptr<simgrid::mc::Variable>(new simgrid::mc::Variable());
-  variable->id = dwarf_dieoffset(die);
-  variable->global = frame == nullptr;     // Can be override base on DW_AT_location
-  variable->object_info = info;
+  std::unique_ptr<simgrid::mc::Variable> variable = std::unique_ptr<simgrid::mc::Variable>(new simgrid::mc::Variable());
+  variable->id                                    = dwarf_dieoffset(die);
+  variable->global                                = frame == nullptr; // Can be override base on DW_AT_location
+  variable->object_info                           = info;
 
-  const char *name = MC_dwarf_attr_integrate_string(die, DW_AT_name);
+  const charname = MC_dwarf_attr_integrate_string(die, DW_AT_name);
   if (name)
     variable->name = name;
   variable->type_id = MC_dwarf_at_type(die);
@@ -732,42 +679,38 @@ static std::unique_ptr<simgrid::mc::Variable> MC_die_to_variable(simgrid::mc::Ob
   else
     form_class = simgrid::dwarf::classify_form(form);
   switch (form_class) {
-  case simgrid::dwarf::FormClass::ExprLoc:
-  case simgrid::dwarf::FormClass::Block:
-    // Location expression:
-    {
-      Dwarf_Op *expr;
-      size_t len;
-      if (dwarf_getlocation(&attr_location, &expr, &len)) {
-        xbt_die(
-          "Could not read location expression in DW_AT_location "
-          "of variable <%" PRIx64 ">%s",
-          (uint64_t) variable->id,
-          variable->name.c_str());
-      }
+    case simgrid::dwarf::FormClass::ExprLoc:
+    case simgrid::dwarf::FormClass::Block:
+      // Location expression:
+      {
+        Dwarf_Op* expr;
+        size_t len;
+        xbt_assert(not dwarf_getlocation(&attr_location, &expr, &len),
+                   "Could not read location expression in DW_AT_location "
+                   "of variable <%" PRIx64 ">%s",
+                   (uint64_t)variable->id, variable->name.c_str());
+
+        if (len == 1 && expr[0].atom == DW_OP_addr) {
+          variable->global  = true;
+          uintptr_t offset  = (uintptr_t)expr[0].number;
+          uintptr_t base    = (uintptr_t)info->base_address();
+          variable->address = (void*)(base + offset);
+        } else
+          variable->location_list = {
+              simgrid::dwarf::LocationListEntry(simgrid::dwarf::DwarfExpression(expr, expr + len))};
 
-      if (len == 1 && expr[0].atom == DW_OP_addr) {
-        variable->global = true;
-        uintptr_t offset = (uintptr_t) expr[0].number;
-        uintptr_t base = (uintptr_t) info->base_address();
-        variable->address = (void *) (base + offset);
-      } else
-        variable->location_list = {
-            simgrid::dwarf::LocationListEntry(simgrid::dwarf::DwarfExpression(expr, expr + len))};
+        break;
+      }
 
+    case simgrid::dwarf::FormClass::LocListPtr:
+    case simgrid::dwarf::FormClass::Constant:
+      // Reference to location list:
+      variable->location_list = simgrid::dwarf::location_list(*info, attr_location);
       break;
-    }
 
-  case simgrid::dwarf::FormClass::LocListPtr:
-  case simgrid::dwarf::FormClass::Constant:
-    // Reference to location list:
-    variable->location_list = simgrid::dwarf::location_list(
-      *info, attr_location);
-    break;
-
-  default:
-    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());
+    default:
+      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:
@@ -787,8 +730,7 @@ static std::unique_ptr<simgrid::mc::Variable> MC_die_to_variable(simgrid::mc::Ob
   }
 
   if (ns && variable->global)
-    variable->name =
-      std::string(ns) + "::" + variable->name;
+    variable->name = std::string(ns) + "::" + variable->name;
 
   // The current code needs a variable name,
   // generate a fake one:
@@ -799,12 +741,10 @@ static std::unique_ptr<simgrid::mc::Variable> MC_die_to_variable(simgrid::mc::Ob
   return variable;
 }
 
-static void MC_dwarf_handle_variable_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
-                                         Dwarf_Die * unit, simgrid::mc::Frame* frame,
-                                         const char *ns)
+static void MC_dwarf_handle_variable_die(simgrid::mc::ObjectInformation* info, Dwarf_Die* die, Dwarf_Die* unit,
+                                         simgrid::mc::Frame* frame, const char* ns)
 {
-  std::unique_ptr<simgrid::mc::Variable> variable =
-    MC_die_to_variable(info, die, unit, frame, ns);
+  std::unique_ptr<simgrid::mc::Variable> variable = MC_die_to_variable(info, die, unit, frame, ns);
   if (not variable)
     return;
   // Those arrays are sorted later:
@@ -816,83 +756,75 @@ static void MC_dwarf_handle_variable_die(simgrid::mc::ObjectInformation* info, D
     xbt_die("No frame for this local variable");
 }
 
-static void MC_dwarf_handle_scope_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
-                                      Dwarf_Die * unit, simgrid::mc::Frame* parent_frame,
-                                      const char *ns)
+static void MC_dwarf_handle_scope_die(simgrid::mc::ObjectInformation* info, Dwarf_Die* die, Dwarf_Die* unit,
+                                      simgrid::mc::Frame* parent_frame, const char* ns)
 {
   // TODO, handle DW_TAG_type/DW_TAG_location for DW_TAG_with_stmt
-  int tag = dwarf_tag(die);
+  int tag                        = dwarf_tag(die);
   simgrid::dwarf::TagClass klass = simgrid::dwarf::classify_tag(tag);
 
   // (Template) Subprogram declaration:
-  if (klass == simgrid::dwarf::TagClass::Subprogram
-      && MC_dwarf_attr_flag(die, DW_AT_declaration, false))
+  if (klass == simgrid::dwarf::TagClass::Subprogram && MC_dwarf_attr_flag(die, DW_AT_declaration, false))
     return;
 
   if (klass == simgrid::dwarf::TagClass::Scope)
     xbt_assert(parent_frame, "No parent scope for this scope");
 
   simgrid::mc::Frame frame;
-  frame.tag = tag;
-  frame.id = dwarf_dieoffset(die);
+  frame.tag         = tag;
+  frame.id          = dwarf_dieoffset(die);
   frame.object_info = info;
 
   if (klass == simgrid::dwarf::TagClass::Subprogram) {
-    const char *name = MC_dwarf_attr_integrate_string(die, DW_AT_name);
+    const charname = MC_dwarf_attr_integrate_string(die, DW_AT_name);
     if (name && ns)
-      frame.name  = std::string(ns) + "::" + name;
+      frame.name = std::string(ns) + "::" + name;
     else if (name)
       frame.name = name;
   }
 
-  frame.abstract_origin_id =
-    MC_dwarf_attr_dieoffset(die, DW_AT_abstract_origin);
+  frame.abstract_origin_id = MC_dwarf_attr_dieoffset(die, DW_AT_abstract_origin);
 
   // This is the base address for DWARF addresses.
   // Relocated addresses are offset from this base address.
   // See DWARF4 spec 7.5
-  std::uint64_t base = (std::uint64_t) info->base_address();
+  std::uint64_t base = (std::uint64_t)info->base_address();
 
   // TODO, support DW_AT_ranges
-  uint64_t low_pc = MC_dwarf_attr_integrate_addr(die, DW_AT_low_pc);
-  frame.range.begin() = low_pc ? (std::uint64_t) base + low_pc : 0;
+  uint64_t low_pc     = MC_dwarf_attr_integrate_addr(die, DW_AT_low_pc);
+  frame.range.begin() = low_pc ? (std::uint64_t)base + low_pc : 0;
   if (low_pc) {
     // DW_AT_high_pc:
     Dwarf_Attribute attr;
-    if (not dwarf_attr_integrate(die, DW_AT_high_pc, &attr))
-      xbt_die("Missing DW_AT_high_pc matching with DW_AT_low_pc");
+    xbt_assert(dwarf_attr_integrate(die, DW_AT_high_pc, &attr), "Missing DW_AT_high_pc matching with DW_AT_low_pc");
 
     Dwarf_Sword offset;
     Dwarf_Addr high_pc;
 
     switch (simgrid::dwarf::classify_form(dwarf_whatform(&attr))) {
 
-      // DW_AT_high_pc if an offset from the low_pc:
-    case simgrid::dwarf::FormClass::Constant:
-
-      if (dwarf_formsdata(&attr, &offset) != 0)
-        xbt_die("Could not read constant");
-      frame.range.end() = frame.range.begin() + offset;
-      break;
+        // DW_AT_high_pc if an offset from the low_pc:
+      case simgrid::dwarf::FormClass::Constant:
 
-      // DW_AT_high_pc is a relocatable address:
-    case simgrid::dwarf::FormClass::Address:
-      if (dwarf_formaddr(&attr, &high_pc) != 0)
-        xbt_die("Could not read address");
-      frame.range.end() = base + high_pc;
-      break;
+        xbt_assert(dwarf_formsdata(&attr, &offset) == 0, "Could not read constant");
+        frame.range.end() = frame.range.begin() + offset;
+        break;
 
-    default:
-      xbt_die("Unexpected class for DW_AT_high_pc");
+        // DW_AT_high_pc is a relocatable address:
+      case simgrid::dwarf::FormClass::Address:
+        xbt_assert(dwarf_formaddr(&attr, &high_pc) == 0, "Could not read address");
+        frame.range.end() = base + high_pc;
+        break;
 
+      default:
+        xbt_die("Unexpected class for DW_AT_high_pc");
     }
   }
 
   if (klass == simgrid::dwarf::TagClass::Subprogram) {
     Dwarf_Attribute attr_frame_base;
     if (dwarf_attr_integrate(die, DW_AT_frame_base, &attr_frame_base))
-      frame.frame_base_location = simgrid::dwarf::location_list(*info,
-                                  attr_frame_base);
+      frame.frame_base_location = simgrid::dwarf::location_list(*info, attr_frame_base);
   }
 
   // Handle children:
@@ -909,68 +841,59 @@ static void MC_dwarf_handle_scope_die(simgrid::mc::ObjectInformation* info, Dwar
     parent_frame->scopes.push_back(std::move(frame));
 }
 
-static void mc_dwarf_handle_namespace_die(simgrid::mc::ObjectInformation* info,
-                                          Dwarf_Die * die, Dwarf_Die * unit,
-                                          simgrid::mc::Frame* frame,
-                                          const char *ns)
+static void mc_dwarf_handle_namespace_die(simgrid::mc::ObjectInformation* info, Dwarf_Die* die, Dwarf_Die* unit,
+                                          simgrid::mc::Frame* frame, const char* ns)
 {
-  const char *name = MC_dwarf_attr_integrate_string(die, DW_AT_name);
-  if (frame)
-    xbt_die("Unexpected namespace in a subprogram");
-  char *new_ns = ns == nullptr ? xbt_strdup(name)
-      : bprintf("%s::%s", ns, name);
+  const char* name = MC_dwarf_attr_integrate_string(die, DW_AT_name);
+  xbt_assert(not frame, "Unexpected namespace in a subprogram");
+  char* new_ns = ns == nullptr ? xbt_strdup(name) : bprintf("%s::%s", ns, name);
   MC_dwarf_handle_children(info, die, unit, frame, new_ns);
   xbt_free(new_ns);
 }
 
-static void MC_dwarf_handle_children(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
-                                     Dwarf_Die * unit, simgrid::mc::Frame* frame,
-                                     const char *ns)
+static void MC_dwarf_handle_children(simgrid::mc::ObjectInformation* info, Dwarf_Die* die, Dwarf_Die* unit,
+                                     simgrid::mc::Frame* frame, const char* ns)
 {
   // For each child DIE:
   Dwarf_Die child;
   int res;
-  for (res = dwarf_child(die, &child); res == 0;
-       res = dwarf_siblingof(&child, &child))
+  for (res = dwarf_child(die, &child); res == 0; res = dwarf_siblingof(&child, &child))
     MC_dwarf_handle_die(info, &child, unit, frame, ns);
 }
 
-static void MC_dwarf_handle_die(simgrid::mc::ObjectInformation* info, Dwarf_Die * die,
-                                Dwarf_Die * unit, simgrid::mc::Frame* frame,
-                                const char *ns)
+static void MC_dwarf_handle_die(simgrid::mc::ObjectInformation* info, Dwarf_Die* die, Dwarf_Die* unit,
+                                simgrid::mc::Frame* frame, const char* ns)
 {
-  int tag = dwarf_tag(die);
+  int tag                        = dwarf_tag(die);
   simgrid::dwarf::TagClass klass = simgrid::dwarf::classify_tag(tag);
   switch (klass) {
 
-    // Type:
-  case simgrid::dwarf::TagClass::Type:
-    MC_dwarf_handle_type_die(info, die, unit, frame, ns);
-    break;
-
-    // Subprogram or scope:
-  case simgrid::dwarf::TagClass::Subprogram:
-  case simgrid::dwarf::TagClass::Scope:
-    MC_dwarf_handle_scope_die(info, die, unit, frame, ns);
-    return;
+      // Type:
+    case simgrid::dwarf::TagClass::Type:
+      MC_dwarf_handle_type_die(info, die, unit, frame, ns);
+      break;
 
-    // Variable:
-  case simgrid::dwarf::TagClass::Variable:
-    MC_dwarf_handle_variable_die(info, die, unit, frame, ns);
-    break;
+      // Subprogram or scope:
+    case simgrid::dwarf::TagClass::Subprogram:
+    case simgrid::dwarf::TagClass::Scope:
+      MC_dwarf_handle_scope_die(info, die, unit, frame, ns);
+      return;
 
-  case simgrid::dwarf::TagClass::Namespace:
-    mc_dwarf_handle_namespace_die(info, die, unit, frame, ns);
-    break;
+      // Variable:
+    case simgrid::dwarf::TagClass::Variable:
+      MC_dwarf_handle_variable_die(info, die, unit, frame, ns);
+      break;
 
-  default:
-    break;
+    case simgrid::dwarf::TagClass::Namespace:
+      mc_dwarf_handle_namespace_die(info, die, unit, frame, ns);
+      break;
 
+    default:
+      break;
   }
 }
 
-static
-Elf64_Half get_type(Elf* elf)
+static Elf64_Half get_type(Elf* elf)
 {
   Elf64_Ehdr* ehdr64 = elf64_getehdr(elf);
   if (ehdr64)
@@ -981,16 +904,14 @@ Elf64_Half get_type(Elf* elf)
   xbt_die("Could not get ELF heeader");
 }
 
-static
-void read_dwarf_info(simgrid::mc::ObjectInformation* info, Dwarf* dwarf)
+static void read_dwarf_info(simgrid::mc::ObjectInformation* info, Dwarf* dwarf)
 {
   // For each compilation unit:
-  Dwarf_Off offset = 0;
+  Dwarf_Off offset      = 0;
   Dwarf_Off next_offset = 0;
   size_t length;
 
-  while (dwarf_nextcu(dwarf, offset, &next_offset, &length, nullptr, nullptr, nullptr) ==
-         0) {
+  while (dwarf_nextcu(dwarf, offset, &next_offset, &length, nullptr, nullptr, nullptr) == 0) {
     Dwarf_Die unit_die;
     if (dwarf_offdie(dwarf, offset + length, &unit_die) != nullptr)
       MC_dwarf_handle_children(info, &unit_die, &unit_die, nullptr, nullptr);
@@ -1006,21 +927,19 @@ void read_dwarf_info(simgrid::mc::ObjectInformation* info, Dwarf* dwarf)
  *  @param  elf libelf handle for an ELF file
  *  @return build-id for this ELF file (or an empty vector if none is found)
  */
-static
-std::vector<char> get_build_id(Elf* elf)
+static std::vector<char> get_build_id(Elf* elf)
 {
 #ifdef __linux
   // Summary: the GNU build ID is stored in a ("GNU, NT_GNU_BUILD_ID) note
   // found in a PT_NOTE entry in the program header table.
 
   size_t phnum;
-  if (elf_getphdrnum (elf, &phnum) != 0)
-    xbt_die("Could not read program headers");
+  xbt_assert(elf_getphdrnum(elf, &phnum) == 0, "Could not read program headers");
 
   // Iterate over the program headers and find the PT_NOTE ones:
   for (size_t i = 0; i < phnum; ++i) {
     GElf_Phdr phdr_temp;
-    GElf_Phdr *phdr = gelf_getphdr(elf, i, &phdr_temp);
+    GElf_Phdrphdr = gelf_getphdr(elf, i, &phdr_temp);
     if (phdr->p_type != PT_NOTE)
       continue;
 
@@ -1036,41 +955,34 @@ std::vector<char> get_build_id(Elf* elf)
       pos = gelf_getnote(data, pos, &nhdr, &name_pos, &desc_pos);
       // A build ID note is identified by the pair ("GNU", NT_GNU_BUILD_ID)
       // (a namespace and a type within this namespace):
-      if (nhdr.n_type == NT_GNU_BUILD_ID
-          && nhdr.n_namesz == sizeof("GNU")
-          && memcmp((char*) data->d_buf + name_pos, "GNU", sizeof("GNU")) == 0) {
+      if (nhdr.n_type == NT_GNU_BUILD_ID && nhdr.n_namesz == sizeof("GNU") &&
+          memcmp((char*)data->d_buf + name_pos, "GNU", sizeof("GNU")) == 0) {
         XBT_DEBUG("Found GNU/NT_GNU_BUILD_ID note");
-        char* start = (char*) data->d_buf + desc_pos;
-        char* end = (char*) start + nhdr.n_descsz;
+        char* start = (char*)data->d_buf + desc_pos;
+        char* end   = (char*)start + nhdr.n_descsz;
         return std::vector<char>(start, end);
       }
     }
-
   }
 #endif
   return std::vector<char>();
 }
 
-static char hexdigits[16] = {
-  '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
-  'a', 'b', 'c', 'd', 'e', 'f'
-};
+static char hexdigits[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
 
 /** Binary data to hexadecimal */
-static inline
-std::array<char, 2> to_hex(std::uint8_t byte)
+static inline std::array<char, 2> to_hex(std::uint8_t byte)
 {
   // Horrid double braces!
   // Apparently, this is needed in C++11 (not in C++14).
-  return { { hexdigits[byte >> 4], hexdigits[byte & 0xF] } };
+  return {{hexdigits[byte >> 4], hexdigits[byte & 0xF]}};
 }
 
 /** Binary data to hexadecimal */
-static
-std::string to_hex(const char* data, std::size_t count)
+static std::string to_hex(const char* data, std::size_t count)
 {
   std::string res;
-  res.resize(2*count);
+  res.resize(2 * count);
   for (std::size_t i = 0; i < count; i++) {
     std::array<char, 2> hex_byte = to_hex(data[i]);
     for (int j = 0; j < 2; ++j)
@@ -1080,17 +992,15 @@ std::string to_hex(const char* data, std::size_t count)
 }
 
 /** Binary data to hexadecimal */
-static
-std::string to_hex(std::vector<char> const& data)
+static std::string to_hex(std::vector<char> const& data)
 {
   return to_hex(data.data(), data.size());
 }
 
 /** Base directories for external debug files */
-static
-const char* debug_paths[] = {
-  "/usr/lib/debug/",
-  "/usr/local/lib/debug/",
+static const char* debug_paths[] = {
+    "/usr/lib/debug/",
+    "/usr/local/lib/debug/",
 };
 
 /** Locate an external debug file from the NT_GNU_BUILD_ID
@@ -1100,16 +1010,14 @@ const char* debug_paths[] = {
  */
 // Example:
 // /usr/lib/debug/.build-id/0b/dc77f1c29aea2b14ff5acd9a19ab3175ffdeae.debug
-static
-std::string find_by_build_id(std::vector<char> id)
+static std::string find_by_build_id(std::vector<char> id)
 {
   std::string filename;
   std::string hex = to_hex(id);
   for (const char* const& debug_path : debug_paths) {
     // Example:
-    filename = std::string(debug_path) + ".build-id/"
-      + to_hex(id.data(), 1) + '/'
-      + to_hex(id.data() + 1, id.size() - 1) + ".debug";
+    filename = std::string(debug_path) + ".build-id/" + to_hex(id.data(), 1) + '/' +
+               to_hex(id.data() + 1, id.size() - 1) + ".debug";
     XBT_DEBUG("Checking debug file: %s", filename.c_str());
     if (access(filename.c_str(), F_OK) == 0) {
       XBT_DEBUG("Found debug file: %s\n", hex.c_str());
@@ -1125,22 +1033,17 @@ std::string find_by_build_id(std::vector<char> id)
  *  Read the DWARf information of the EFFL object and populate the
  *  lists of types, variables, functions.
  */
-static
-void MC_load_dwarf(simgrid::mc::ObjectInformation* info)
+static void MC_load_dwarf(simgrid::mc::ObjectInformation* info)
 {
-  if (elf_version(EV_CURRENT) == EV_NONE)
-    xbt_die("libelf initialization error");
+  xbt_assert(elf_version(EV_CURRENT) != EV_NONE, "libelf initialization error");
 
   // Open the ELF file:
   int fd = open(info->file_name.c_str(), O_RDONLY);
-  if (fd < 0)
-    xbt_die("Could not open file %s", info->file_name.c_str());
+  xbt_assert(fd >= 0, "Could not open file %s", info->file_name.c_str());
   Elf* elf = elf_begin(fd, ELF_C_READ, nullptr);
-  if (elf == nullptr)
-    xbt_die("Not an ELF file");
+  xbt_assert(elf != nullptr, "Not an ELF file");
   Elf_Kind kind = elf_kind(elf);
-  if (kind != ELF_K_ELF)
-    xbt_die("Not an ELF file");
+  xbt_assert(kind == ELF_K_ELF, "Not an ELF file");
 
   // Remember if this is a `ET_EXEC` (fixed location) or `ET_DYN`:
   Elf64_Half type = get_type(elf);
@@ -1148,7 +1051,7 @@ void MC_load_dwarf(simgrid::mc::ObjectInformation* info)
     info->flags |= simgrid::mc::ObjectInformation::Executable;
 
   // Read DWARF debug information in the file:
-  Dwarf* dwarf = dwarf_begin_elf (elf, DWARF_C_READ, nullptr);
+  Dwarf* dwarf = dwarf_begin_elf(elf, DWARF_C_READ, nullptr);
   if (dwarf != nullptr) {
     read_dwarf_info(info, dwarf);
     dwarf_end(dwarf);
@@ -1174,23 +1077,17 @@ void MC_load_dwarf(simgrid::mc::ObjectInformation* info)
 
     // Find the debug file using the build id:
     std::string debug_file = find_by_build_id(build_id);
-    if (debug_file.empty()) {
-      std::string hex = to_hex(build_id);
-      xbt_die("Missing debug info for %s with build-id %s\n"
-        "You might want to install the suitable debugging package.\n",
-        info->file_name.c_str(), hex.c_str());
-    }
+    xbt_assert(not debug_file.empty(),
+               "Missing debug info for %s with build-id %s\n"
+               "You might want to install the suitable debugging package.\n",
+               info->file_name.c_str(), to_hex(build_id).c_str());
 
     // Load the DWARF info from this file:
-    XBT_DEBUG("Load DWARF for %s from %s",
-      info->file_name.c_str(), debug_file.c_str());
+    XBT_DEBUG("Load DWARF for %s from %s", info->file_name.c_str(), debug_file.c_str());
     fd = open(debug_file.c_str(), O_RDONLY);
-    if (fd < 0)
-      xbt_die("Could not open file %s", debug_file.c_str());
+    xbt_assert(fd >= 0, "Could not open file %s", debug_file.c_str());
     dwarf = dwarf_begin(fd, DWARF_C_READ);
-    if (dwarf == nullptr)
-      xbt_die("No DWARF info in %s for %s",
-        debug_file.c_str(), info->file_name.c_str());
+    xbt_assert(dwarf != nullptr, "No DWARF info in %s for %s", debug_file.c_str(), info->file_name.c_str());
     read_dwarf_info(info, dwarf);
     dwarf_end(dwarf);
     close(fd);
@@ -1216,7 +1113,7 @@ static void MC_make_functions_index(simgrid::mc::ObjectInformation* info)
     if (e.second.range.begin() == 0)
       continue;
     simgrid::mc::FunctionIndexEntry entry;
-    entry.low_pc = (void*) e.second.range.begin();
+    entry.low_pc   = (void*)e.second.range.begin();
     entry.function = &e.second;
     info->functions_index.push_back(entry);
   }
@@ -1225,11 +1122,9 @@ static void MC_make_functions_index(simgrid::mc::ObjectInformation* info)
 
   // Sort the array by low_pc:
   boost::range::sort(info->functions_index,
-        [](simgrid::mc::FunctionIndexEntry const& a,
-          simgrid::mc::FunctionIndexEntry const& b)
-        {
-          return a.low_pc < b.low_pc;
-        });
+                     [](simgrid::mc::FunctionIndexEntry const& a, simgrid::mc::FunctionIndexEntry const& b) {
+                       return a.low_pc < b.low_pc;
+                     });
 }
 
 static void MC_post_process_variables(simgrid::mc::ObjectInformation* info)
@@ -1239,8 +1134,7 @@ static void MC_post_process_variables(simgrid::mc::ObjectInformation* info)
 
   for (simgrid::mc::Variable& variable : info->global_variables)
     if (variable.type_id)
-      variable.type = simgrid::util::find_map_ptr(
-        info->types, variable.type_id);
+      variable.type = simgrid::util::find_map_ptr(info->types, variable.type_id);
 }
 
 static void mc_post_process_scope(simgrid::mc::ObjectInformation* info, simgrid::mc::Frame* scope)
@@ -1249,26 +1143,22 @@ static void mc_post_process_scope(simgrid::mc::ObjectInformation* info, simgrid:
   if (scope->tag == DW_TAG_inlined_subroutine) {
     // Attach correct namespaced name in inlined subroutine:
     auto i = info->subprograms.find(scope->abstract_origin_id);
-    xbt_assert(i != info->subprograms.end(),
-      "Could not lookup abstract origin %" PRIx64,
-      (std::uint64_t) scope->abstract_origin_id);
+    xbt_assert(i != info->subprograms.end(), "Could not lookup abstract origin %" PRIx64,
+               (std::uint64_t)scope->abstract_origin_id);
     scope->name = i->second.name;
   }
 
   // Direct:
   for (simgrid::mc::Variable& variable : scope->variables)
     if (variable.type_id)
-      variable.type = simgrid::util::find_map_ptr(
-        info->types, variable.type_id);
+      variable.type = simgrid::util::find_map_ptr(info->types, variable.type_id);
 
   // Recursive post-processing of nested-scopes:
   for (simgrid::mc::Frame& nested_scope : scope->scopes)
     mc_post_process_scope(info, &nested_scope);
 }
 
-static
-simgrid::mc::Type* MC_resolve_type(
-  simgrid::mc::ObjectInformation* info, unsigned type_id)
+static simgrid::mc::Type* MC_resolve_type(simgrid::mc::ObjectInformation* info, unsigned type_id)
 {
   if (not type_id)
     return nullptr;
@@ -1286,8 +1176,7 @@ simgrid::mc::Type* MC_resolve_type(
 
   // Try to find a more complete description of the type:
   // We need to fix in order to support C++.
-  simgrid::mc::Type** subtype = simgrid::util::find_map_ptr(
-    info->full_types_by_name, type->name);
+  simgrid::mc::Type** subtype = simgrid::util::find_map_ptr(info->full_types_by_name, type->name);
   if (subtype)
     type = *subtype;
   return type;
@@ -1307,12 +1196,11 @@ namespace simgrid {
 namespace mc {
 
 /** @brief Finds informations about a given shared object/executable */
-std::shared_ptr<simgrid::mc::ObjectInformation> createObjectInformation(
-  std::vector<simgrid::xbt::VmMap> const& maps, const char *name)
+std::shared_ptr<simgrid::mc::ObjectInformation> createObjectInformation(std::vector<simgrid::xbt::VmMap> const& maps,
+                                                                        const char* name)
 {
-  std::shared_ptr<simgrid::mc::ObjectInformation> result =
-    std::make_shared<simgrid::mc::ObjectInformation>();
-  result->file_name = name;
+  std::shared_ptr<simgrid::mc::ObjectInformation> result = std::make_shared<simgrid::mc::ObjectInformation>();
+  result->file_name                                      = name;
   simgrid::mc::find_object_address(maps, result.get());
   MC_load_dwarf(result.get());
   MC_post_process_variables(result.get());
@@ -1331,9 +1219,8 @@ void postProcessObjectInformation(simgrid::mc::RemoteClient* process, simgrid::m
 
     simgrid::mc::Type* type    = &(t.second);
     simgrid::mc::Type* subtype = type;
-    while (subtype->type == DW_TAG_typedef
-        || subtype->type == DW_TAG_volatile_type
-        || subtype->type == DW_TAG_const_type)
+    while (subtype->type == DW_TAG_typedef || subtype->type == DW_TAG_volatile_type ||
+           subtype->type == DW_TAG_const_type)
       if (subtype->subtype)
         subtype = subtype->subtype;
       else
@@ -1348,13 +1235,13 @@ void postProcessObjectInformation(simgrid::mc::RemoteClient* process, simgrid::m
           break;
         }
       }
-    else type->full_type = subtype;
-
+    else
+      type->full_type = subtype;
   }
 }
 
-}
-}
+} // namespace mc
+} // namespace simgrid
 
 namespace simgrid {
 namespace dwarf {
@@ -1374,61 +1261,61 @@ int dwarf_register_to_libunwind(int dwarf_register)
   // Couldn't find the authoritative source of information for this.
   // This is inspired from http://source.winehq.org/source/dlls/dbghelp/cpu_i386.c#L517.
   switch (dwarf_register) {
-  case 0:
-    return UNW_X86_EAX;
-  case 1:
-    return UNW_X86_ECX;
-  case 2:
-    return UNW_X86_EDX;
-  case 3:
-    return UNW_X86_EBX;
-  case 4:
-    return UNW_X86_ESP;
-  case 5:
-    return UNW_X86_EBP;
-  case 6:
-    return UNW_X86_ESI;
-  case 7:
-    return UNW_X86_EDI;
-  case 8:
-    return UNW_X86_EIP;
-  case 9:
-    return UNW_X86_EFLAGS;
-  case 10:
-    return UNW_X86_CS;
-  case 11:
-    return UNW_X86_SS;
-  case 12:
-    return UNW_X86_DS;
-  case 13:
-    return UNW_X86_ES;
-  case 14:
-    return UNW_X86_FS;
-  case 15:
-    return UNW_X86_GS;
-  case 16:
-    return UNW_X86_ST0;
-  case 17:
-    return UNW_X86_ST1;
-  case 18:
-    return UNW_X86_ST2;
-  case 19:
-    return UNW_X86_ST3;
-  case 20:
-    return UNW_X86_ST4;
-  case 21:
-    return UNW_X86_ST5;
-  case 22:
-    return UNW_X86_ST6;
-  case 23:
-    return UNW_X86_ST7;
-  default:
-    xbt_die("Bad/unknown register number.");
+    case 0:
+      return UNW_X86_EAX;
+    case 1:
+      return UNW_X86_ECX;
+    case 2:
+      return UNW_X86_EDX;
+    case 3:
+      return UNW_X86_EBX;
+    case 4:
+      return UNW_X86_ESP;
+    case 5:
+      return UNW_X86_EBP;
+    case 6:
+      return UNW_X86_ESI;
+    case 7:
+      return UNW_X86_EDI;
+    case 8:
+      return UNW_X86_EIP;
+    case 9:
+      return UNW_X86_EFLAGS;
+    case 10:
+      return UNW_X86_CS;
+    case 11:
+      return UNW_X86_SS;
+    case 12:
+      return UNW_X86_DS;
+    case 13:
+      return UNW_X86_ES;
+    case 14:
+      return UNW_X86_FS;
+    case 15:
+      return UNW_X86_GS;
+    case 16:
+      return UNW_X86_ST0;
+    case 17:
+      return UNW_X86_ST1;
+    case 18:
+      return UNW_X86_ST2;
+    case 19:
+      return UNW_X86_ST3;
+    case 20:
+      return UNW_X86_ST4;
+    case 21:
+      return UNW_X86_ST5;
+    case 22:
+      return UNW_X86_ST6;
+    case 23:
+      return UNW_X86_ST7;
+    default:
+      xbt_die("Bad/unknown register number.");
   }
 #else
 #error This architecture is not supported yet for DWARF expression evaluation.
 #endif
 }
 
-}
-}
+} // namespace dwarf
+} // namespace simgrid
similarity index 66%
rename from src/mc/mc_dwarf.hpp
rename to src/mc/inspect/mc_dwarf.hpp
index aef260c..d24ebe9 100644 (file)
@@ -8,9 +8,6 @@
 
 #include "xbt/base.h"
 
-#define DW_LANG_Objc DW_LANG_ObjC       /* fix spelling error in older dwarf.h */
-#include <dwarf.h>
-
 #include "src/mc/mc_forward.hpp"
 
 namespace simgrid {
@@ -19,14 +16,13 @@ namespace dwarf {
 XBT_PRIVATE const char* attrname(int attr);
 XBT_PRIVATE const char* tagname(int tag);
 
-XBT_PRIVATE void* resolve_member(
-  const void* base, simgrid::mc::Type* type, simgrid::mc::Member* member,
-  simgrid::mc::AddressSpace* snapshot, int process_index);
+XBT_PRIVATE void* resolve_member(const void* base, simgrid::mc::Type* type, simgrid::mc::Member* member,
+                                 const simgrid::mc::AddressSpace* snapshot);
 
 XBT_PRIVATE
 int dwarf_register_to_libunwind(int dwarf_register);
 
-}
-}
+} // namespace dwarf
+} // namespace simgrid
 
 #endif
similarity index 95%
rename from src/mc/mc_dwarf_attrnames.cpp
rename to src/mc/inspect/mc_dwarf_attrnames.cpp
index 248a127..cbbc5b2 100644 (file)
@@ -1,16 +1,13 @@
-/* Copyright (c) 2014-2019. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program 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 "src/mc/inspect/mc_dwarf.hpp"
 
 #include <string>
 #include <unordered_map>
 
-#include "src/mc/mc_dwarf.hpp"
-
 namespace {
 const std::unordered_map<int, const char*> attrname_map = {
     {0x01, "DW_AT_sibling"},
@@ -158,7 +155,7 @@ const std::unordered_map<int, const char*> attrname_map = {
 }
 
 namespace simgrid {
-namespace dwarf  {
+namespace dwarf {
 
 /** @brief Get the name of an attribute (DW_AT_*) from its code
  *
@@ -166,11 +163,11 @@ namespace dwarf  {
  *  @return name of the attribute
  */
 XBT_PRIVATE
-const char *attrname(int attr)
+const charattrname(int attr)
 {
   auto name = attrname_map.find(attr);
   return name == attrname_map.end() ? "DW_AT_unknown" : name->second;
 }
 
-}
-}
+} // namespace dwarf
+} // namespace simgrid
similarity index 94%
rename from src/mc/mc_dwarf_tagnames.cpp
rename to src/mc/inspect/mc_dwarf_tagnames.cpp
index f94c2c6..3cf69dd 100644 (file)
@@ -1,16 +1,15 @@
-/* Copyright (c) 2014-2019. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program 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 "src/mc/inspect/mc_dwarf.hpp"
+
 #include <string>
 #include <unordered_map>
 
-#include "src/mc/mc_dwarf.hpp"
-
 namespace {
 const std::unordered_map<int, const char*> tagname_map = {
     {0x00, "DW_TAG_invalid"},
@@ -100,11 +99,11 @@ namespace dwarf {
  *  @return name of the tag
  */
 XBT_PRIVATE
-const char *tagname(int tag)
+const chartagname(int tag)
 {
   auto name = tagname_map.find(tag);
   return name == tagname_map.end() ? "DW_TAG_unknown" : name->second;
 }
 
-}
-}
+} // namespace dwarf
+} // namespace simgrid
similarity index 64%
rename from src/mc/mc_member.cpp
rename to src/mc/inspect/mc_member.cpp
index c92ab41..1bd5ad4 100644 (file)
@@ -1,11 +1,10 @@
-/* Copyright (c) 2014-2019. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program is 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/Type.hpp"
-#include "src/mc/mc_dwarf.hpp"
+#include "src/mc/inspect/Type.hpp"
+#include "src/mc/inspect/mc_dwarf.hpp"
 #include "src/mc/mc_private.hpp"
 
 namespace simgrid {
@@ -20,19 +19,18 @@ namespace dwarf {
  * @return Process address of the given member of the 'object' struct/class
  */
 void* resolve_member(const void* base, simgrid::mc::Type* /*type*/, simgrid::mc::Member* member,
-                     simgrid::mc::AddressSpace* address_space, int process_index)
+                     const simgrid::mc::AddressSpace* address_space)
 {
   ExpressionContext state;
-  state.frame_base = nullptr;
-  state.cursor = nullptr;
+  state.frame_base    = nullptr;
+  state.cursor        = nullptr;
   state.address_space = address_space;
-  state.process_index = process_index;
 
   ExpressionStack stack;
-  stack.push((ExpressionStack::value_type) base);
+  stack.push((ExpressionStack::value_type)base);
   simgrid::dwarf::execute(member->location_expression, state, stack);
-  return (void*) stack.top();
+  return (void*)stack.top();
 }
 
-}
-}
+} // namespace dwarf
+} // namespace simgrid
diff --git a/src/mc/inspect/mc_unw.cpp b/src/mc/inspect/mc_unw.cpp
new file mode 100644 (file)
index 0000000..82efd56
--- /dev/null
@@ -0,0 +1,258 @@
+/* Copyright (c) 2015-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program 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
+ *  Libunwind support for mc_address_space objects.
+ */
+
+// We need this for the register indices:
+// #define _GNU_SOURCE
+
+#include "src/mc/inspect/mc_unw.hpp"
+#include "src/mc/inspect/Frame.hpp"
+#include "src/mc/remote/RemoteClient.hpp"
+
+#include <cstring>
+
+// On x86_64, libunwind unw_context_t has the same layout as ucontext_t:
+#include <sys/types.h>
+#include <sys/ucontext.h>
+#ifdef __FreeBSD__
+typedef register_t greg_t;
+#endif
+
+#include <libunwind.h>
+
+using simgrid::mc::remote;
+
+namespace simgrid {
+namespace mc {
+
+// ***** Implementation
+
+/** Get frame unwind information (libunwind method)
+ *
+ *  Delegates to the local/ptrace implementation.
+ */
+int UnwindContext::find_proc_info(unw_addr_space_t /*as*/, unw_word_t ip, unw_proc_info_t* pip, int need_unwind_info,
+                                  void* arg) noexcept
+{
+  simgrid::mc::UnwindContext* context = (simgrid::mc::UnwindContext*)arg;
+  return unw_get_accessors(context->process_->unw_underlying_addr_space)
+      ->find_proc_info(context->process_->unw_underlying_addr_space, ip, pip, need_unwind_info,
+                       context->process_->unw_underlying_context);
+}
+
+/** Release frame unwind information (libunwind method)
+ *
+ *  Delegates to the local/ptrace implementation.
+ */
+void UnwindContext::put_unwind_info(unw_addr_space_t /*as*/, unw_proc_info_t* pip, void* arg) noexcept
+{
+  simgrid::mc::UnwindContext* context = (simgrid::mc::UnwindContext*)arg;
+  return unw_get_accessors(context->process_->unw_underlying_addr_space)
+      ->put_unwind_info(context->process_->unw_underlying_addr_space, pip, context->process_->unw_underlying_context);
+}
+
+/** (libunwind method)
+ *
+ *  Not implemented.
+ */
+int UnwindContext::get_dyn_info_list_addr(unw_addr_space_t /*as*/, unw_word_t* dilap, void* arg) noexcept
+{
+  simgrid::mc::UnwindContext* context = (simgrid::mc::UnwindContext*)arg;
+  return unw_get_accessors(context->process_->unw_underlying_addr_space)
+      ->get_dyn_info_list_addr(context->process_->unw_underlying_addr_space, dilap,
+                               context->process_->unw_underlying_context);
+}
+
+/** Read from the target address space memory (libunwind method)
+ *
+ *  Delegates to the `simgrid::mc::Process*`.
+ */
+int UnwindContext::access_mem(unw_addr_space_t /*as*/, unw_word_t addr, unw_word_t* valp, int write, void* arg) noexcept
+{
+  simgrid::mc::UnwindContext* context = (simgrid::mc::UnwindContext*)arg;
+  if (write)
+    return -UNW_EREADONLYREG;
+  context->address_space_->read_bytes(valp, sizeof(unw_word_t), remote(addr));
+  return 0;
+}
+
+void* UnwindContext::get_reg(unw_context_t* context, unw_regnum_t regnum) noexcept
+{
+#ifdef __x86_64
+  mcontext_t* mcontext = &context->uc_mcontext;
+  switch (regnum) {
+#ifdef __linux__
+    case UNW_X86_64_RAX:
+      return &mcontext->gregs[REG_RAX];
+    case UNW_X86_64_RDX:
+      return &mcontext->gregs[REG_RDX];
+    case UNW_X86_64_RCX:
+      return &mcontext->gregs[REG_RCX];
+    case UNW_X86_64_RBX:
+      return &mcontext->gregs[REG_RBX];
+    case UNW_X86_64_RSI:
+      return &mcontext->gregs[REG_RSI];
+    case UNW_X86_64_RDI:
+      return &mcontext->gregs[REG_RDI];
+    case UNW_X86_64_RBP:
+      return &mcontext->gregs[REG_RBP];
+    case UNW_X86_64_RSP:
+      return &mcontext->gregs[REG_RSP];
+    case UNW_X86_64_R8:
+      return &mcontext->gregs[REG_R8];
+    case UNW_X86_64_R9:
+      return &mcontext->gregs[REG_R9];
+    case UNW_X86_64_R10:
+      return &mcontext->gregs[REG_R10];
+    case UNW_X86_64_R11:
+      return &mcontext->gregs[REG_R11];
+    case UNW_X86_64_R12:
+      return &mcontext->gregs[REG_R12];
+    case UNW_X86_64_R13:
+      return &mcontext->gregs[REG_R13];
+    case UNW_X86_64_R14:
+      return &mcontext->gregs[REG_R14];
+    case UNW_X86_64_R15:
+      return &mcontext->gregs[REG_R15];
+    case UNW_X86_64_RIP:
+      return &mcontext->gregs[REG_RIP];
+#elif defined __FreeBSD__
+    case UNW_X86_64_RAX:
+      return &mcontext->mc_rax;
+    case UNW_X86_64_RDX:
+      return &mcontext->mc_rdx;
+    case UNW_X86_64_RCX:
+      return &mcontext->mc_rcx;
+    case UNW_X86_64_RBX:
+      return &mcontext->mc_rbx;
+    case UNW_X86_64_RSI:
+      return &mcontext->mc_rsi;
+    case UNW_X86_64_RDI:
+      return &mcontext->mc_rdi;
+    case UNW_X86_64_RBP:
+      return &mcontext->mc_rbp;
+    case UNW_X86_64_RSP:
+      return &mcontext->mc_rsp;
+    case UNW_X86_64_R8:
+      return &mcontext->mc_r8;
+    case UNW_X86_64_R9:
+      return &mcontext->mc_r9;
+    case UNW_X86_64_R10:
+      return &mcontext->mc_r10;
+    case UNW_X86_64_R11:
+      return &mcontext->mc_r11;
+    case UNW_X86_64_R12:
+      return &mcontext->mc_r12;
+    case UNW_X86_64_R13:
+      return &mcontext->mc_r13;
+    case UNW_X86_64_R14:
+      return &mcontext->mc_r14;
+    case UNW_X86_64_R15:
+      return &mcontext->mc_r15;
+    case UNW_X86_64_RIP:
+      return &mcontext->mc_rip;
+#else
+#error "Unable to get register from ucontext, please add your case"
+#endif
+    default:
+      return nullptr;
+  }
+#else
+  return nullptr;
+#endif
+}
+
+/** Read a standard register (libunwind method)
+ */
+int UnwindContext::access_reg(unw_addr_space_t /*as*/, unw_regnum_t regnum, unw_word_t* valp, int write,
+                              void* arg) noexcept
+{
+  simgrid::mc::UnwindContext* as_context = (simgrid::mc::UnwindContext*)arg;
+  unw_context_t* context                 = &as_context->unwind_context_;
+  if (write)
+    return -UNW_EREADONLYREG;
+  greg_t* preg = (greg_t*)get_reg(context, regnum);
+  if (not preg)
+    return -UNW_EBADREG;
+  *valp = *preg;
+  return 0;
+}
+
+/** Find informations about a function (libunwind method)
+ */
+int UnwindContext::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
+{
+  simgrid::mc::UnwindContext* context = (simgrid::mc::UnwindContext*)arg;
+  simgrid::mc::Frame* frame           = context->process_->find_function(remote(addr));
+  if (not frame)
+    return -UNW_ENOINFO;
+  *offp = (unw_word_t)frame->range.begin() - addr;
+
+  strncpy(bufp, frame->name.c_str(), buf_len);
+  if (bufp[buf_len - 1]) {
+    bufp[buf_len - 1] = 0;
+    return -UNW_ENOMEM;
+  }
+
+  return 0;
+}
+
+// ***** Init
+
+/** Virtual table for our `libunwind` implementation
+ *
+ *  Stack unwinding on a `simgrid::mc::Process*` (for memory, unwinding information)
+ *  and `ucontext_t` (for processor registers).
+ *
+ * It works with the `simgrid::mc::UnwindContext` context.
+ *
+ * Use nullptr as access_fpreg and resume, as we don't need them.
+ */
+unw_accessors_t UnwindContext::accessors = {&find_proc_info, &put_unwind_info, &get_dyn_info_list_addr,
+                                            &access_mem,     &access_reg,      nullptr,
+                                            nullptr,         &get_proc_name};
+
+unw_addr_space_t UnwindContext::createUnwindAddressSpace()
+{
+  return unw_create_addr_space(&UnwindContext::accessors, BYTE_ORDER);
+}
+
+void UnwindContext::initialize(simgrid::mc::RemoteClient* process, unw_context_t* c)
+{
+  this->address_space_ = process;
+  this->process_      = process;
+
+  // Take a copy of the context for our own purpose:
+  this->unwind_context_ = *c;
+#if SIMGRID_PROCESSOR_x86_64 || SIMGRID_PROCESSOR_i686
+#ifdef __linux__
+  // On x86_64, ucontext_t contains a pointer to itself for FP registers.
+  // 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
+  // Let's ignore this and see what happens:
+  this->unwind_context_.uc_mcontext.fpregs = nullptr;
+#endif
+#else
+  // Do we need to do any fixup like this?
+#error Target CPU type is not handled.
+#endif
+}
+
+unw_cursor_t UnwindContext::cursor()
+{
+  unw_cursor_t cursor;
+  xbt_assert(process_ != nullptr && address_space_ != nullptr &&
+                 unw_init_remote(&cursor, process_->unw_addr_space, this) == 0,
+             "UnwindContext not initialized");
+  return cursor;
+}
+
+} // namespace mc
+} // namespace simgrid
similarity index 84%
rename from src/mc/mc_unw.hpp
rename to src/mc/inspect/mc_unw.hpp
index aedcf7e..628cbba 100644 (file)
@@ -36,24 +36,19 @@ namespace unw {
 
 XBT_PRIVATE unw_addr_space_t create_addr_space();
 XBT_PRIVATE void* create_context(unw_addr_space_t as, pid_t pid);
-}
-}
+} // namespace unw
+} // namespace simgrid
 
 namespace simgrid {
 namespace mc {
 
 class UnwindContext {
-  simgrid::mc::AddressSpace* addressSpace_ = nullptr;
+  simgrid::mc::AddressSpace* address_space_ = nullptr;
   simgrid::mc::RemoteClient* process_      = nullptr;
-  unw_context_t unwindContext_;
+  unw_context_t unwind_context_;
 
 public:
-  UnwindContext() = default;
-  UnwindContext(const UnwindContext&) = default;
-  UnwindContext& operator=(const UnwindContext&) = default;
-  ~UnwindContext() { clear(); }
   void initialize(simgrid::mc::RemoteClient* process, unw_context_t* c);
-  void clear();
   unw_cursor_t cursor();
 
 private: // Methods and virtual table for libunwind
@@ -64,8 +59,6 @@ private: // Methods and virtual table for libunwind
   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 unw_accessors_t accessors;
@@ -77,7 +70,7 @@ public:
 
 void dumpStack(FILE* file, unw_cursor_t&& cursor);
 void dumpStack(FILE* file, pid_t pid);
-}
-}
+} // namespace mc
+} // namespace simgrid
 
 #endif
similarity index 63%
rename from src/mc/mc_unw_vmread.cpp
rename to src/mc/inspect/mc_unw_vmread.cpp
index 1e7674c..5f2acba 100644 (file)
@@ -1,23 +1,20 @@
-/* Copyright (c) 2015-2019. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2015-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program is 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/inspect/mc_unw.hpp"
+#include "src/mc/remote/RemoteClient.hpp"
+
 #include <sys/types.h>
 #include <sys/uio.h>
 
 #include <fcntl.h>
-#include <libunwind.h>
 #include <libunwind-ptrace.h>
-
-#include "src/mc/mc_unw.hpp"
-#include "src/mc/remote/RemoteClient.hpp"
+#include <libunwind.h>
 
 /** \file
  *  Libunwind namespace implementation using process_vm_readv.
- *.
- *  This implem
  */
 
 /** Partial structure of libunwind-ptrace context in order to get the PID
@@ -33,71 +30,65 @@ struct _UPT_info {
 
 /** Get the PID of a `libunwind-ptrace` context
  */
-static inline
-pid_t _UPT_getpid(void* arg)
+static inline pid_t _UPT_getpid(void* arg)
 {
   _UPT_info* info = static_cast<_UPT_info*>(arg);
   return info->pid;
 }
 
-/** Read from the memory, avoid using `ptrace` (libunwind method)
- */
-static int access_mem(const unw_addr_space_t as,
-              const unw_word_t addr, unw_word_t* const  valp,
-              const int write, void* const arg)
+/** Read from the memory, avoid using `ptrace` (libunwind method) */
+static int access_mem(const unw_addr_space_t as, const unw_word_t addr, unw_word_t* const valp, const int write,
+                      void* const arg)
 {
   if (write)
-    return - UNW_EINVAL;
-  pid_t pid = _UPT_getpid(arg);
+    return -UNW_EINVAL;
+  pid_t pid   = _UPT_getpid(arg);
   size_t size = sizeof(unw_word_t);
 
-#if HAVE_PROCESS_VM_READV
+#if HAVE_PROCESS_VM_READV /* linux but not freebsd */
   // process_vm_read implementation.
   // This is only available since Linux 3.2.
 
-  struct iovec local = { valp, size };
-  struct iovec remote = { (void*) addr, size };
-  ssize_t s = process_vm_readv(pid, &local, 1, &remote, 1, 0);
+  struct iovec local  = {valp, size};
+  struct iovec remote = {(void*)addr, size};
+  ssize_t s           = process_vm_readv(pid, &local, 1, &remote, 1, 0);
   if (s >= 0) {
-    if ((size_t) s != size)
-      return - UNW_EINVAL;
+    if ((size_t)s != size)
+      return -UNW_EINVAL;
     else
       return 0;
   }
   if (s < 0 && errno != ENOSYS)
-    return - UNW_EINVAL;
+    return -UNW_EINVAL;
 #endif
 
   // /proc/${pid}/mem implementation.
   // On recent kernels, we do not need to ptrace the target process.
   // On older kernels, it is necessary to ptrace the target process.
   size_t count = size;
-  off_t off = (off_t) addr;
-  char* buf = (char*) valp;
-  int fd = simgrid::mc::open_vm(pid, O_RDONLY);
+  off_t off    = (off_t)addr;
+  char* buf    = (char*)valp;
+  int fd       = simgrid::mc::open_vm(pid, O_RDONLY);
   if (fd < 0)
-    return - UNW_EINVAL;
-  while (1) {
+    return -UNW_EINVAL;
+
+  while (count > 0) {
     ssize_t nread = pread(fd, buf, count, off);
     if (nread == 0) {
       close(fd);
-      return - UNW_EINVAL;
+      return -UNW_EINVAL;
     }
     if (nread == -1)
-      break;
+      // ptrace implementation.
+      // We need to have PTRACE_ATTACH-ed it before.
+      return _UPT_access_mem(as, addr, valp, write, arg);
+
     count -= nread;
     buf += nread;
     off += nread;
-    if (count == 0) {
-      close(fd);
-      return 0;
-    }
   }
   close(fd);
-
-  // ptrace implementation.
-  // We need to have PTRACE_ATTACH-ed it before.
-  return _UPT_access_mem(as, addr, valp, write, arg);
+  return 0;
 }
 
 namespace simgrid {
@@ -116,16 +107,9 @@ namespace unw {
  */
 // TODO, we could get rid of this if we properly stop the model-checked
 // process before reading the memory.
-static unw_accessors_t accessors = {
-  &_UPT_find_proc_info,
-  &_UPT_put_unwind_info,
-  &_UPT_get_dyn_info_list_addr,
-  &access_mem,
-  &_UPT_access_reg,
-  &_UPT_access_fpreg,
-  &_UPT_resume,
-  &_UPT_get_proc_name
-};
+static unw_accessors_t accessors = {&_UPT_find_proc_info, &_UPT_put_unwind_info, &_UPT_get_dyn_info_list_addr,
+                                    &access_mem,          &_UPT_access_reg,      &_UPT_access_fpreg,
+                                    &_UPT_resume,         &_UPT_get_proc_name};
 
 unw_addr_space_t create_addr_space()
 {
@@ -137,5 +121,5 @@ void* create_context(unw_addr_space_t /*as*/, pid_t pid)
   return _UPT_create(pid);
 }
 
-}
-}
+} // namespace unw
+} // namespace simgrid
index d441926..c75d927 100644 (file)
@@ -5,11 +5,9 @@
 
 #include "src/mc/mc_base.h"
 #include "mc/mc.h"
-#include "simgrid/config.h"
 #include "src/kernel/activity/CommImpl.hpp"
 #include "src/kernel/activity/MutexImpl.hpp"
-#include "src/mc/mc_config.hpp"
-#include "src/mc/mc_forward.hpp"
+#include "src/mc/checker/SimcallInspector.hpp"
 #include "src/mc/mc_replay.hpp"
 #include "src/simix/smx_private.hpp"
 
@@ -45,8 +43,8 @@ void wait_for_requests()
     simix_global->run_all_actors();
     for (smx_actor_t const& process : simix_global->actors_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);
+      if (req->call_ != SIMCALL_NONE && not simgrid::mc::request_is_visible(req))
+        process->simcall_handle(0);
     }
   }
 #if SIMGRID_HAVE_MC
@@ -81,7 +79,10 @@ bool actor_is_enabled(smx_actor_t actor)
   // Now, we are in the client app, no need for remote memory reading.
   smx_simcall_t req = &actor->simcall;
 
-  switch (req->call) {
+  if (req->inspector_ != nullptr)
+    return req->inspector_->is_enabled();
+
+  switch (req->call_) {
     case SIMCALL_NONE:
       return false;
 
@@ -97,7 +98,7 @@ bool actor_is_enabled(smx_actor_t actor)
           return true;
       }
       /* On the other hand if it hasn't a timeout, check if the comm is ready.*/
-      else if (act->detached && act->src_actor_ == nullptr &&
+      else if (act->detached() && act->src_actor_ == nullptr &&
                act->type_ == simgrid::kernel::activity::CommImpl::Type::READY)
         return (act->dst_actor_ != nullptr);
       return (act->src_actor_ && act->dst_actor_);
@@ -119,7 +120,7 @@ bool actor_is_enabled(smx_actor_t actor)
 
       if (mutex->owner_ == nullptr)
         return true;
-      return mutex->owner_->get_pid() == req->issuer->get_pid();
+      return mutex->owner_->get_pid() == req->issuer_->get_pid();
     }
 
     case SIMCALL_SEM_ACQUIRE: {
@@ -153,10 +154,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 ||
-         req->call == SIMCALL_MUTEX_UNLOCK;
+  return (req->inspector_ != nullptr && req->inspector_->is_visible()) || 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;
 }
 
 }
@@ -169,5 +170,5 @@ int simcall_HANDLER_mc_random(smx_simcall_t simcall, int min, int max)
     std::uniform_int_distribution<int> prng(min, max);
     return prng(rnd_engine);
   }
-  return simcall->mc_value;
+  return simcall->mc_value_;
 }
index 0aeee5b..d2c13d6 100644 (file)
@@ -4,16 +4,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/log.h"
-#include "xbt/sysdep.h"
-#include <simgrid/modelchecker.h>
-
 #include "src/mc/ModelChecker.hpp"
 #include "src/mc/mc_ignore.hpp"
 #include "src/mc/mc_private.hpp"
 #include "src/mc/mc_record.hpp"
+#include "src/mc/mc_replay.hpp"
 #include "src/mc/remote/Client.hpp"
-#include "src/mc/remote/mc_protocol.h"
+#include "xbt/asserts.h"
 
 /** @file mc_client_api.cpp
  *
@@ -29,8 +26,12 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_client_api, mc,
 void MC_assert(int prop)
 {
   xbt_assert(mc_model_checker == nullptr);
-  if (MC_is_active() && not prop)
-    simgrid::mc::Client::get()->reportAssertionFailure();
+  if (not prop) {
+    if (MC_is_active())
+      simgrid::mc::Client::get()->report_assertion_failure();
+    if (MC_record_replay_is_active())
+      xbt_die("MC assertion failed");
+  }
 }
 
 void MC_cut()
@@ -47,7 +48,7 @@ void MC_ignore(void* addr, size_t size)
   xbt_assert(mc_model_checker == nullptr);
   if (not MC_is_active())
     return;
-  simgrid::mc::Client::get()->ignoreMemory(addr, size);
+  simgrid::mc::Client::get()->ignore_memory(addr, size);
 }
 
 void MC_automaton_new_propositional_symbol(const char* /*id*/, int (*/*fct*/)())
@@ -64,7 +65,7 @@ void MC_automaton_new_propositional_symbol_pointer(const char *name, int* value)
   xbt_assert(mc_model_checker == nullptr);
   if (not MC_is_active())
     return;
-  simgrid::mc::Client::get()->declareSymbol(name, value);
+  simgrid::mc::Client::get()->declare_symbol(name, value);
 }
 
 /** @brief Register a stack in the model checker
@@ -78,12 +79,12 @@ void MC_automaton_new_propositional_symbol_pointer(const char *name, int* value)
  *  @param context The context associated to that stack
  *  @param size    Size of the stack
  */
-void MC_register_stack_area(void* stack, smx_actor_t actor, ucontext_t* context, size_t size)
+void MC_register_stack_area(void* stack, ucontext_t* context, size_t size)
 {
   xbt_assert(mc_model_checker == nullptr);
   if (not MC_is_active())
     return;
-  simgrid::mc::Client::get()->declareStack(stack, size, actor, context);
+  simgrid::mc::Client::get()->declare_stack(stack, size, context);
 }
 
 void MC_ignore_global_variable(const char* /*name*/)
@@ -100,7 +101,7 @@ void MC_ignore_heap(void *address, size_t size)
   xbt_assert(mc_model_checker == nullptr);
   if (not MC_is_active())
     return;
-  simgrid::mc::Client::get()->ignoreHeap(address, size);
+  simgrid::mc::Client::get()->ignore_heap(address, size);
 }
 
 void MC_unignore_heap(void* address, size_t size)
@@ -108,5 +109,5 @@ void MC_unignore_heap(void* address, size_t size)
   xbt_assert(mc_model_checker == nullptr);
   if (not MC_is_active())
     return;
-  simgrid::mc::Client::get()->unignoreHeap(address, size);
+  simgrid::mc::Client::get()->unignore_heap(address, size);
 }
index 0614251..8e4b405 100644 (file)
@@ -5,11 +5,7 @@
 
 #include <cstring>
 
-#include "xbt/dynar.h"
-#include "xbt/sysdep.h"
-
 #include "src/mc/checker/CommunicationDeterminismChecker.hpp"
-#include "src/mc/mc_comm_pattern.hpp"
 #include "src/mc/mc_smx.hpp"
 
 using simgrid::mc::remote;
@@ -17,52 +13,41 @@ using simgrid::mc::remote;
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_comm_pattern, mc,
                                 "Logging specific to MC communication patterns");
 
-static void MC_patterns_copy(xbt_dynar_t dest,
-  std::vector<simgrid::mc::PatternCommunication> const& source)
+static void MC_patterns_copy(std::vector<simgrid::mc::PatternCommunication*>& dest,
+                             std::vector<simgrid::mc::PatternCommunication> const& source)
 {
-  xbt_dynar_reset(dest);
+  dest.clear();
   for (simgrid::mc::PatternCommunication const& comm : source) {
     simgrid::mc::PatternCommunication* copy_comm = new simgrid::mc::PatternCommunication(comm.dup());
-    xbt_dynar_push(dest, &copy_comm);
+    dest.push_back(copy_comm);
   }
 }
 
 void MC_restore_communications_pattern(simgrid::mc::State* state)
 {
-  simgrid::mc::PatternCommunicationList* list_process_comm;
-  unsigned int cursor;
-
-  xbt_dynar_foreach(initial_communications_pattern, cursor, list_process_comm)
-    list_process_comm->index_comm = state->communicationIndices[cursor];
+  for (unsigned i = 0; i < initial_communications_pattern.size(); i++)
+    initial_communications_pattern[i].index_comm = state->communication_indices_[i];
 
   for (unsigned i = 0; i < MC_smx_get_maxpid(); i++)
-    MC_patterns_copy(
-      xbt_dynar_get_as(incomplete_communications_pattern, i, xbt_dynar_t),
-      state->incomplete_comm_pattern[i]
-    );
+    MC_patterns_copy(incomplete_communications_pattern[i], state->incomplete_comm_pattern_[i]);
 }
 
 void MC_state_copy_incomplete_communications_pattern(simgrid::mc::State* state)
 {
-  state->incomplete_comm_pattern.clear();
+  state->incomplete_comm_pattern_.clear();
   for (unsigned i=0; i < MC_smx_get_maxpid(); i++) {
-    xbt_dynar_t patterns = xbt_dynar_get_as(incomplete_communications_pattern, i, xbt_dynar_t);
     std::vector<simgrid::mc::PatternCommunication> res;
-    simgrid::mc::PatternCommunication* comm;
-    unsigned int cursor;
-    xbt_dynar_foreach(patterns, cursor, comm)
+    for (auto const& comm : incomplete_communications_pattern[i])
       res.push_back(comm->dup());
-    state->incomplete_comm_pattern.push_back(std::move(res));
+    state->incomplete_comm_pattern_.push_back(std::move(res));
   }
 }
 
 void MC_state_copy_index_communications_pattern(simgrid::mc::State* state)
 {
-  state->communicationIndices.clear();
-  simgrid::mc::PatternCommunicationList* list_process_comm;
-  unsigned int cursor;
-  xbt_dynar_foreach(initial_communications_pattern, cursor, list_process_comm)
-    state->communicationIndices.push_back(list_process_comm->index_comm);
+  state->communication_indices_.clear();
+  for (auto const& list_process_comm : initial_communications_pattern)
+    state->communication_indices_.push_back(list_process_comm.index_comm);
 }
 
 void MC_handle_comm_pattern(e_mc_call_type_t call_type, smx_simcall_t req, int value, int backtracking)
index b1bf313..9d55a88 100644 (file)
@@ -9,8 +9,6 @@
 #include <vector>
 
 #include "smpi/smpi.h"
-#include "xbt/dynar.h"
-
 #include "src/mc/mc_state.hpp"
 
 namespace simgrid {
@@ -23,15 +21,8 @@ struct PatternCommunicationList {
 }
 }
 
-/**
- *  Type: `xbt_dynar_t<mc_list_comm_pattern_t>`
- */
-extern XBT_PRIVATE xbt_dynar_t initial_communications_pattern;
-
-/**
- *  Type: `xbt_dynar_t<xbt_dynar_t<simgrid::mc::PatternCommunication*>>`
- */
-extern XBT_PRIVATE xbt_dynar_t incomplete_communications_pattern;
+extern XBT_PRIVATE std::vector<simgrid::mc::PatternCommunicationList> initial_communications_pattern;
+extern XBT_PRIVATE std::vector<std::vector<simgrid::mc::PatternCommunication*>> incomplete_communications_pattern;
 
 enum e_mc_call_type_t {
   MC_CALL_TYPE_NONE,
@@ -54,7 +45,7 @@ enum e_mc_comm_pattern_difference_t {
 
 static inline e_mc_call_type_t MC_get_call_type(smx_simcall_t req)
 {
-  switch (req->call) {
+  switch (req->call_) {
     case SIMCALL_COMM_ISEND:
       return MC_CALL_TYPE_SEND;
     case SIMCALL_COMM_IRECV:
index 5f7e1dc..2ba61a4 100644 (file)
@@ -3,21 +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/config.hpp"
-#include "xbt/log.h"
-#include <xbt/sysdep.h>
-
 #include "src/mc/mc_replay.hpp"
-#include <mc/mc.h>
-
 #include <simgrid/sg_config.hpp>
-
 #if SIMGRID_HAVE_MC
-#include "src/mc/mc_private.hpp"
 #include "src/mc/mc_safety.hpp"
 #endif
 
-#include "src/mc/mc_record.hpp"
+#include <climits>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_config, mc, "Configuration of the Model Checker");
 
@@ -28,9 +20,7 @@ namespace mc {
 simgrid::mc::ReductionMode reduction_mode = simgrid::mc::ReductionMode::unset;
 }
 }
-#endif
-
-#if !SIMGRID_HAVE_MC
+#else
 #define _sg_do_model_check 0
 #endif
 
@@ -54,8 +44,6 @@ simgrid::config::Flag<bool> _sg_mc_timeout{
 int _sg_do_model_check = 0;
 int _sg_mc_max_visited_states = 0;
 
-simgrid::config::Flag<bool> _sg_do_model_check_record{"model-check/record", "Record the model-checking paths", false};
-
 simgrid::config::Flag<int> _sg_mc_checkpoint{
     "model-check/checkpoint", "Specify the amount of steps between checkpoints during stateful model-checking "
                               "(default: 0 => stateless verification). If value=1, one checkpoint is saved for each "
@@ -63,12 +51,6 @@ simgrid::config::Flag<int> _sg_mc_checkpoint{
                               "compromises between speed and memory consumption.",
     0, [](int) { _mc_cfg_cb_check("checkpointing value"); }};
 
-simgrid::config::Flag<bool> _sg_mc_sparse_checkpoint{"model-check/sparse-checkpoint", "Use sparse per-page snapshots.",
-                                                     false, [](bool) { _mc_cfg_cb_check("checkpointing value"); }};
-
-simgrid::config::Flag<bool> _sg_mc_ksm{"model-check/ksm", "Kernel same-page merging", false,
-                                       [](bool) { _mc_cfg_cb_check("KSM value"); }};
-
 simgrid::config::Flag<std::string> _sg_mc_property_file{
     "model-check/property", "Name of the file containing the property, as formatted by the ltl2ba program.", "",
     [](const std::string&) { _mc_cfg_cb_check("property"); }};
@@ -91,6 +73,14 @@ simgrid::config::Flag<bool> _sg_mc_send_determinism{
       _mc_cfg_cb_check("value to enable/disable the detection of send-determinism in the communications schemes");
     }};
 
+simgrid::config::Flag<std::string> _sg_mc_buffering{
+    "smpi/buffering",
+    "Buffering semantic to use for MPI (only used in MC)",
+    "infty",
+    {{"zero", "No system buffering: MPI_Send is blocking"},
+     {"infty", "Infinite system buffering: MPI_Send returns immediately"}},
+    [](const std::string&) { _mc_cfg_cb_check("buffering mode"); }};
+
 static simgrid::config::Flag<std::string> _sg_mc_reduce{
     "model-check/reduction", "Specify the kind of exploration reduction (either none or DPOR)", "dpor",
     [](const std::string& value) {
@@ -104,17 +94,6 @@ static simgrid::config::Flag<std::string> _sg_mc_reduce{
         xbt_die("configuration option model-check/reduction can only take 'none' or 'dpor' as a value");
     }};
 
-simgrid::config::Flag<bool> _sg_mc_hash{
-    "model-check/hash", "Whether to enable state hash for state comparison (experimental)", false,
-    [](bool) { _mc_cfg_cb_check("value to enable/disable the use of global hash to speedup state comparaison"); }};
-
-simgrid::config::Flag<bool> _sg_mc_snapshot_fds{
-    "model-check/snapshot-fds",
-    {"model-check/snapshot_fds"},
-    "Whether file descriptors must be snapshoted (currently unusable)",
-    false,
-    [](bool) { _mc_cfg_cb_check("value to enable/disable the use of FD snapshotting"); }};
-
 simgrid::config::Flag<int> _sg_mc_max_depth{"model-check/max-depth",
                                             {"model-check/max_depth"},
                                             "Maximal exploration depth (default: 1000)",
index b04cf84..391d789 100644 (file)
 
 /********************************** Configuration of MC **************************************/
 extern "C" XBT_PUBLIC int _sg_do_model_check;
+extern XBT_PUBLIC simgrid::config::Flag<std::string> _sg_mc_buffering;
 extern XBT_PUBLIC simgrid::config::Flag<std::string> _sg_mc_record_path;
-extern XBT_PRIVATE simgrid::config::Flag<bool> _sg_do_model_check_record;
 extern XBT_PRIVATE simgrid::config::Flag<int> _sg_mc_checkpoint;
-extern XBT_PUBLIC simgrid::config::Flag<bool> _sg_mc_sparse_checkpoint;
-extern XBT_PUBLIC simgrid::config::Flag<bool> _sg_mc_ksm;
 extern XBT_PUBLIC simgrid::config::Flag<std::string> _sg_mc_property_file;
 extern XBT_PUBLIC simgrid::config::Flag<bool> _sg_mc_comms_determinism;
 extern XBT_PUBLIC simgrid::config::Flag<bool> _sg_mc_send_determinism;
 extern XBT_PRIVATE simgrid::config::Flag<bool> _sg_mc_timeout;
-extern XBT_PRIVATE simgrid::config::Flag<bool> _sg_mc_hash;
-extern XBT_PRIVATE simgrid::config::Flag<bool> _sg_mc_snapshot_fds;
 extern XBT_PRIVATE simgrid::config::Flag<int> _sg_mc_max_depth;
 extern "C" XBT_PUBLIC int _sg_mc_max_visited_states;
 extern XBT_PRIVATE simgrid::config::Flag<std::string> _sg_mc_dot_output_file;
index c725e83..6494e19 100644 (file)
@@ -6,6 +6,7 @@
 #ifndef SIMGRID_MC_EXIT_HPP
 #define SIMGRID_MC_EXIT_HPP
 #include "xbt/base.h"
+#include <exception>
 
 constexpr int SIMGRID_MC_EXIT_SUCCESS         = 0;
 constexpr int SIMGRID_MC_EXIT_SAFETY          = 1;
@@ -19,11 +20,11 @@ constexpr int SIMGRID_MC_EXIT_ERROR           = 63;
 
 namespace simgrid {
 namespace mc {
-class XBT_PUBLIC DeadlockError {
+class XBT_PUBLIC DeadlockError : public std::exception {
 };
-class XBT_PUBLIC TerminationError {
+class XBT_PUBLIC TerminationError : public std::exception {
 };
-class XBT_PUBLIC LivenessError {
+class XBT_PUBLIC LivenessError : public std::exception {
 };
 }
 }
index c9b5ba6..975d079 100644 (file)
@@ -3,47 +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 <cinttypes>
-#include <cassert>
-#include <cstddef>
-#include <cstdint>
-
-#include <cxxabi.h>
-
-#include <vector>
-
-#include "xbt/automaton.h"
-#include "xbt/backtrace.hpp"
-#include "xbt/dynar.h"
-
-#include "mc_base.h"
-
 #include "mc/mc.h"
-
-#ifndef _WIN32
-#include <unistd.h>
-#include <sys/wait.h>
-#include <sys/time.h>
-#endif
-
 #include "src/kernel/actor/ActorImpl.hpp"
 
 #if SIMGRID_HAVE_MC
+#include "src/mc/Session.hpp"
 #include "src/mc/checker/Checker.hpp"
+#include "src/mc/inspect/mc_unw.hpp"
 #include "src/mc/mc_comm_pattern.hpp"
+#include "src/mc/mc_config.hpp"
 #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_unw.hpp"
-#include "src/mc/sosp/mc_snapshot.hpp"
+#include "src/mc/remote/Client.hpp"
+#include "src/mc/sosp/Snapshot.hpp"
+#include "xbt/backtrace.hpp"
+
 #include <libunwind.h>
 #endif
 
-#include "src/mc/Transition.hpp"
-#include "src/mc/mc_record.hpp"
-#include "src/mc/remote/Client.hpp"
-#include "src/mc/remote/mc_protocol.h"
+#ifndef _WIN32
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#endif
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_global, mc, "Logging specific to MC (global)");
 
@@ -93,22 +77,22 @@ void MC_init_dot_output()
 
 void MC_run()
 {
-  simgrid::mc::processes_time.resize(SIMIX_process_get_maxpid());
+  simgrid::mc::processes_time.resize(simgrid::kernel::actor::get_maxpid());
   MC_ignore_heap(simgrid::mc::processes_time.data(),
     simgrid::mc::processes_time.size() * sizeof(simgrid::mc::processes_time[0]));
-  simgrid::mc::Client::get()->mainLoop();
-  simgrid::mc::processes_time.clear();
+  simgrid::mc::Client::get()->main_loop();
 }
 
 void MC_show_deadlock()
 {
   XBT_INFO("**************************");
-  XBT_INFO("*** DEAD-LOCK DETECTED ***");
+  XBT_INFO("*** DEADLOCK DETECTED ***");
   XBT_INFO("**************************");
   XBT_INFO("Counter-example execution trace:");
-  for (auto const& s : mc_model_checker->getChecker()->getTextualTrace())
-    XBT_INFO("%s", s.c_str());
-  simgrid::mc::session->logState();
+  for (auto const& s : mc_model_checker->getChecker()->get_textual_trace())
+    XBT_INFO("  %s", s.c_str());
+  simgrid::mc::dumpRecordPath();
+  simgrid::mc::session->log_state();
 }
 
 void MC_automaton_load(const char *file)
@@ -150,24 +134,6 @@ void dumpStack(FILE* file, unw_cursor_t&& cursor)
 
 }
 }
-
-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);
-    nstack++;
-
-    simgrid::mc::UnwindContext context;
-    unw_context_t raw_context =
-      (unw_context_t) mc_model_checker->process().read<unw_context_t>(
-        simgrid::mc::remote((unw_context_t *)stack.context));
-    context.initialize(&mc_model_checker->process(), &raw_context);
-
-    unw_cursor_t cursor = context.cursor();
-    simgrid::mc::dumpStack(file, std::move(cursor));
-  }
-}
 #endif
 
 double MC_process_clock_get(smx_actor_t process)
index 626927f..d23fe69 100644 (file)
@@ -4,7 +4,6 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include <cinttypes>
-
 #include <cstdint>
 
 #include "xbt/log.h"
@@ -12,7 +11,7 @@
 #include "mc/datatypes.h"
 #include "src/mc/mc_hash.hpp"
 #include "src/mc/mc_private.hpp"
-#include "src/mc/sosp/mc_snapshot.hpp"
+#include "src/mc/sosp/Snapshot.hpp"
 #include <mc/mc.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_hash, mc, "Logging specific to mc_hash");
@@ -29,7 +28,7 @@ public:
   template<class T>
   void update(T& x)
   {
-    state_ = (state_ << 5) + state_ + state_;
+    state_ = (state_ << 5) + state_ + x;
   }
   hash_type value()
   {
@@ -41,14 +40,15 @@ public:
 
 hash_type hash(Snapshot const& snapshot)
 {
-  XBT_DEBUG("START hash %i", snapshot.num_state);
+  XBT_DEBUG("START hash %i", snapshot.num_state_);
   djb_hash hash;
-  // TODO, nb_processes
-  // TODO, heap_bytes_used
-  // TODO, root variables
-  // TODO, basic stack frame information
-  // TODO, stack frame local variables
-  XBT_DEBUG("END hash %i", snapshot.num_state);
+  // TODO:
+  // * nb_processes
+  // * heap_bytes_used
+  // * root variables
+  // * basic stack frame information
+  // * stack frame local variables
+  XBT_DEBUG("END hash %i", snapshot.num_state_);
   return hash.value();
 }
 
index bef60ce..c25b45b 100644 (file)
@@ -6,12 +6,13 @@
 #ifndef SIMGRID_MC_IGNORE_HPP
 #define SIMGRID_MC_IGNORE_HPP
 
+#include "simgrid/forward.h"
 #include "src/internal_config.h"
 
 #if HAVE_UCONTEXT_H
 #include <ucontext.h> /* context relative declarations */
 
-XBT_PUBLIC void MC_register_stack_area(void* stack, smx_actor_t process, ucontext_t* context, size_t size);
+XBT_PUBLIC void MC_register_stack_area(void* stack, ucontext_t* context, size_t size);
 
 #endif
 
index dae7a09..21975e6 100644 (file)
@@ -13,9 +13,9 @@
 #define XBT_ALWAYS_INLINE inline __attribute__((always_inline))
 #endif
 
-/** Cache the size of a memory page for the current system. */
+/** Size of a memory page for the current system. */
 extern "C" int xbt_pagesize;
-/** Cache the number of bits of addresses inside a given page, log2(xbt_pagesize). */
+/** Number of bits of addresses inside a given page, log2(xbt_pagesize). */
 extern "C" int xbt_pagebits;
 
 namespace simgrid {
@@ -23,7 +23,7 @@ namespace mc {
 // TODO, do not depend on xbt_pagesize/xbt_pagebits but our own chunk size
 namespace mmu {
 
-static int chunkSize()
+static int chunk_size()
 {
   return xbt_pagesize;
 }
@@ -33,9 +33,9 @@ static int chunkSize()
  *  @param size Byte size
  *  @return Number of memory pages
  */
-static XBT_ALWAYS_INLINE std::size_t chunkCount(std::size_t size)
+static XBT_ALWAYS_INLINE std::size_t chunk_count(std::size_t size)
 {
-  size_t page_count = size >> xbt_pagebits;
+  std::size_t page_count = size >> xbt_pagebits;
   if (size & (xbt_pagesize - 1))
     page_count++;
   return page_count;
@@ -47,7 +47,7 @@ static XBT_ALWAYS_INLINE std::pair<std::size_t, std::uintptr_t> split(std::uintp
   return {offset >> xbt_pagebits, offset & (xbt_pagesize - 1)};
 }
 
-/** Merge chunk number and remaining offset info a global offset */
+/** Merge chunk number and remaining offset into 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;
@@ -58,7 +58,7 @@ static XBT_ALWAYS_INLINE std::uintptr_t join(std::pair<std::size_t, std::uintptr
   return join(value.first, value.second);
 }
 
-static XBT_ALWAYS_INLINE bool sameChunk(std::uintptr_t a, std::uintptr_t b)
+static XBT_ALWAYS_INLINE bool same_chunk(std::uintptr_t a, std::uintptr_t b)
 {
   return (a >> xbt_pagebits) == (b >> xbt_pagebits);
 }
index 1f6ad5d..a23fb13 100644 (file)
@@ -32,11 +32,6 @@ XBT_PRIVATE extern FILE* dot_output;
 
 XBT_PRIVATE void MC_show_deadlock(void);
 
-/********************************** Snapshot comparison **********************************/
-
-//#define MC_DEBUG 1
-#define MC_VERBOSE 1
-
 /********************************** Miscellaneous **********************************/
 namespace simgrid {
 namespace mc {
@@ -45,7 +40,7 @@ XBT_PRIVATE void find_object_address(std::vector<simgrid::xbt::VmMap> const& map
                                      simgrid::mc::ObjectInformation* result);
 
 XBT_PRIVATE
-int snapshot_compare(int num1, simgrid::mc::Snapshot* s1, int num2, simgrid::mc::Snapshot* s2);
+bool snapshot_equal(const Snapshot* s1, const Snapshot* s2);
 
 // Move is somewhere else (in the LivenessChecker class, in the Session class?):
 extern XBT_PRIVATE xbt_automaton_t property_automaton;
index dd19a66..4c7f441 100644 (file)
@@ -18,8 +18,7 @@
 #include "src/mc/mc_state.hpp"
 #endif
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_record, mc,
-  " Logging specific to MC record/replay facility");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_record, mc, "Logging specific to MC record/replay facility");
 
 namespace simgrid {
 namespace mc {
@@ -29,27 +28,27 @@ void replay(RecordTrace const& trace)
   simgrid::mc::wait_for_requests();
 
   for (simgrid::mc::Transition const& transition : trace) {
-    XBT_DEBUG("Executing %i$%i", transition.pid, transition.argument);
+    XBT_DEBUG("Executing %i$%i", transition.pid_, transition.argument_);
 
     // Choose a request:
-    smx_actor_t process = SIMIX_process_from_PID(transition.pid);
+    smx_actor_t process = SIMIX_process_from_PID(transition.pid_);
     if (not process)
-      xbt_die("Unexpected process (pid:%d).", transition.pid);
+      xbt_die("Unexpected process (pid:%d).", transition.pid_);
     smx_simcall_t simcall = &(process->simcall);
-    if (not simcall || simcall->call == SIMCALL_NONE)
-      xbt_die("No simcall for process %d.", transition.pid);
+    if (simcall == nullptr || simcall->call_ == SIMCALL_NONE)
+      xbt_die("No simcall for process %d.", transition.pid_);
     if (not simgrid::mc::request_is_visible(simcall) || not simgrid::mc::actor_is_enabled(process))
       xbt_die("Unexpected simcall.");
 
     // Execute the request:
-    SIMIX_simcall_handle(simcall, transition.argument);
+    simcall->issuer_->simcall_handle(transition.argument_);
     simgrid::mc::wait_for_requests();
   }
 }
 
 void replay(const std::string& path_string)
 {
-  simgrid::mc::processes_time.resize(SIMIX_process_get_maxpid());
+  simgrid::mc::processes_time.resize(simgrid::kernel::actor::get_maxpid());
   simgrid::mc::RecordTrace trace = simgrid::mc::parseRecordTrace(path_string.c_str());
   simgrid::mc::replay(trace);
   simgrid::mc::processes_time.clear();
@@ -66,7 +65,7 @@ RecordTrace parseRecordTrace(const char* data)
   while (*current) {
 
     simgrid::mc::Transition item;
-    int count = sscanf(current, "%d/%d", &item.pid, &item.argument);
+    int count = sscanf(current, "%d/%d", &item.pid_, &item.argument_);
     if(count != 2 && count != 1)
       throw std::invalid_argument("Could not parse record path");
     res.push_back(item);
@@ -90,19 +89,17 @@ std::string traceToString(simgrid::mc::RecordTrace const& trace)
   for (auto i = trace.begin(); i != trace.end(); ++i) {
     if (i != trace.begin())
       stream << ';';
-    stream << i->pid;
-    if (i->argument)
-      stream << '/' << i->argument;
+    stream << i->pid_;
+    if (i->argument_)
+      stream << '/' << i->argument_;
   }
   return stream.str();
 }
 
 void dumpRecordPath()
 {
-  if (MC_record_is_active()) {
-    RecordTrace trace = mc_model_checker->getChecker()->getRecordTrace();
-    XBT_INFO("Path = %s", traceToString(trace).c_str());
-  }
+  RecordTrace trace = mc_model_checker->getChecker()->get_record_trace();
+  XBT_INFO("Path = %s", traceToString(trace).c_str());
 }
 
 #endif
index df5285e..85bf484 100644 (file)
@@ -6,9 +6,8 @@
 /** \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`'`.
- *  The path is written in the log output and an be replayed with MC disabled
- *  (even with an non-MC build) with `--cfg=model-check/replay:$replayPath`.
+ *  The recorded path is written in the log output and can be replayed with MC disabled
+ *  (even with an non-MC build) using `--cfg=model-check/replay:$replayPath`.
  *
  *  The same version of Simgrid should be used and the same arguments should be
  *  passed to the application (without the MC specific arguments).
 #ifndef SIMGRID_MC_RECORD_HPP
 #define SIMGRID_MC_RECORD_HPP
 
-#include "src/mc/mc_config.hpp"
 #include "src/mc/mc_forward.hpp"
 #include "xbt/base.h"
 
+#include <string>
 #include <vector>
 
 namespace simgrid {
@@ -39,13 +38,6 @@ XBT_PRIVATE void replay(const std::string& trace);
 }
 }
 
-/** Whether the MC record mode is enabled
- *
- *  The behaviour is not changed. The only real difference is that
- *  the path is writtent in the log when an interesting path is found.
- */
-#define MC_record_is_active() _sg_do_model_check_record
-
 // **** Data conversion
 
 #endif
index b531d8d..ff543ee 100644 (file)
@@ -8,6 +8,7 @@
 #include "src/kernel/activity/CommImpl.hpp"
 #include "src/kernel/activity/MutexImpl.hpp"
 #include "src/mc/ModelChecker.hpp"
+#include "src/mc/checker/SimcallInspector.hpp"
 #include "src/mc/mc_smx.hpp"
 
 using simgrid::mc::remote;
@@ -20,26 +21,26 @@ static char *buff_size_to_string(size_t size);
 
 static inline simgrid::kernel::activity::CommImpl* MC_get_comm(smx_simcall_t r)
 {
-  switch (r->call ) {
-  case SIMCALL_COMM_WAIT:
-    return static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(r));
-  case SIMCALL_COMM_TEST:
-    return static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_test__getraw__comm(r));
-  default:
-    return nullptr;
+  switch (r->call_) {
+    case SIMCALL_COMM_WAIT:
+      return static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(r));
+    case SIMCALL_COMM_TEST:
+      return static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_test__getraw__comm(r));
+    default:
+      return nullptr;
   }
 }
 
 static inline
 smx_mailbox_t MC_get_mbox(smx_simcall_t r)
 {
-  switch(r->call) {
-  case SIMCALL_COMM_ISEND:
-    return simcall_comm_isend__get__mbox(r);
-  case SIMCALL_COMM_IRECV:
-    return simcall_comm_irecv__get__mbox(r);
-  default:
-    return nullptr;
+  switch (r->call_) {
+    case SIMCALL_COMM_ISEND:
+      return simcall_comm_isend__get__mbox(r);
+    case SIMCALL_COMM_IRECV:
+      return simcall_comm_irecv__get__mbox(r);
+    default:
+      return nullptr;
   }
 }
 
@@ -50,10 +51,10 @@ namespace mc {
 static inline
 bool request_depend_asymmetric(smx_simcall_t r1, smx_simcall_t r2)
 {
-  if (r1->call == SIMCALL_COMM_ISEND && r2->call == SIMCALL_COMM_IRECV)
+  if (r1->call_ == SIMCALL_COMM_ISEND && r2->call_ == SIMCALL_COMM_IRECV)
     return false;
 
-  if (r1->call == SIMCALL_COMM_IRECV && r2->call == SIMCALL_COMM_ISEND)
+  if (r1->call_ == SIMCALL_COMM_IRECV && r2->call_ == SIMCALL_COMM_ISEND)
     return false;
 
   // Those are internal requests, we do not need indirection
@@ -61,8 +62,7 @@ bool request_depend_asymmetric(smx_simcall_t r1, smx_simcall_t r2)
   simgrid::kernel::activity::CommImpl* synchro1 = MC_get_comm(r1);
   simgrid::kernel::activity::CommImpl* synchro2 = MC_get_comm(r2);
 
-  if ((r1->call == SIMCALL_COMM_ISEND || r1->call == SIMCALL_COMM_IRECV)
-      && r2->call == SIMCALL_COMM_WAIT) {
+  if ((r1->call_ == SIMCALL_COMM_ISEND || r1->call_ == SIMCALL_COMM_IRECV) && r2->call_ == SIMCALL_COMM_WAIT) {
 
     smx_mailbox_t mbox = MC_get_mbox(r1);
 
@@ -70,15 +70,15 @@ bool request_depend_asymmetric(smx_simcall_t r1, smx_simcall_t r2)
         && simcall_comm_wait__get__timeout(r2) <= 0)
       return false;
 
-    if ((r1->issuer != synchro2->src_actor_.get()) && (r1->issuer != synchro2->dst_actor_.get()) &&
+    if ((r1->issuer_ != synchro2->src_actor_.get()) && (r1->issuer_ != synchro2->dst_actor_.get()) &&
         simcall_comm_wait__get__timeout(r2) <= 0)
       return false;
 
-    if ((r1->call == SIMCALL_COMM_ISEND) && (synchro2->type_ == kernel::activity::CommImpl::Type::SEND) &&
+    if ((r1->call_ == SIMCALL_COMM_ISEND) && (synchro2->type_ == kernel::activity::CommImpl::Type::SEND) &&
         (synchro2->src_buff_ != simcall_comm_isend__get__src_buff(r1)) && simcall_comm_wait__get__timeout(r2) <= 0)
       return false;
 
-    if ((r1->call == SIMCALL_COMM_IRECV) && (synchro2->type_ == kernel::activity::CommImpl::Type::RECEIVE) &&
+    if ((r1->call_ == SIMCALL_COMM_IRECV) && (synchro2->type_ == kernel::activity::CommImpl::Type::RECEIVE) &&
         (synchro2->dst_buff_ != simcall_comm_irecv__get__dst_buff(r1)) && simcall_comm_wait__get__timeout(r2) <= 0)
       return false;
   }
@@ -92,19 +92,19 @@ bool request_depend_asymmetric(smx_simcall_t r1, smx_simcall_t r2)
      return false;
 #endif
 
-  if (r1->call == SIMCALL_COMM_WAIT && (r2->call == SIMCALL_COMM_WAIT || r2->call == SIMCALL_COMM_TEST) &&
+  if (r1->call_ == SIMCALL_COMM_WAIT && (r2->call_ == SIMCALL_COMM_WAIT || r2->call_ == SIMCALL_COMM_TEST) &&
       (synchro1->src_actor_.get() == nullptr || synchro1->dst_actor_.get() == nullptr))
     return false;
 
-  if (r1->call == SIMCALL_COMM_TEST &&
+  if (r1->call_ == SIMCALL_COMM_TEST &&
       (simcall_comm_test__get__comm(r1) == nullptr || synchro1->src_buff_ == nullptr || synchro1->dst_buff_ == nullptr))
     return false;
 
-  if (r1->call == SIMCALL_COMM_TEST && r2->call == SIMCALL_COMM_WAIT && synchro1->src_buff_ == synchro2->src_buff_ &&
+  if (r1->call_ == SIMCALL_COMM_TEST && r2->call_ == SIMCALL_COMM_WAIT && synchro1->src_buff_ == synchro2->src_buff_ &&
       synchro1->dst_buff_ == synchro2->dst_buff_)
     return false;
 
-  if (r1->call == SIMCALL_COMM_WAIT && r2->call == SIMCALL_COMM_TEST && synchro1->src_buff_ != nullptr &&
+  if (r1->call_ == SIMCALL_COMM_WAIT && r2->call_ == SIMCALL_COMM_TEST && 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_)
@@ -116,15 +116,15 @@ bool request_depend_asymmetric(smx_simcall_t r1, smx_simcall_t r2)
 // Those are internal_req
 bool request_depend(smx_simcall_t req1, smx_simcall_t req2)
 {
-  if (req1->issuer == req2->issuer)
+  if (req1->issuer_ == req2->issuer_)
     return false;
 
   /* Wait with timeout transitions are not considered by the independence theorem, thus we consider them as dependent with all other transitions */
-  if ((req1->call == SIMCALL_COMM_WAIT && simcall_comm_wait__get__timeout(req1) > 0) ||
-      (req2->call == SIMCALL_COMM_WAIT && simcall_comm_wait__get__timeout(req2) > 0))
+  if ((req1->call_ == SIMCALL_COMM_WAIT && simcall_comm_wait__get__timeout(req1) > 0) ||
+      (req2->call_ == SIMCALL_COMM_WAIT && simcall_comm_wait__get__timeout(req2) > 0))
     return true;
 
-  if (req1->call != req2->call)
+  if (req1->call_ != req2->call_)
     return request_depend_asymmetric(req1, req2) && request_depend_asymmetric(req2, req1);
 
   // Those are internal requests, we do not need indirection
@@ -132,7 +132,7 @@ bool request_depend(smx_simcall_t req1, smx_simcall_t req2)
   simgrid::kernel::activity::CommImpl* synchro1 = MC_get_comm(req1);
   simgrid::kernel::activity::CommImpl* synchro2 = MC_get_comm(req2);
 
-  switch (req1->call) {
+  switch (req1->call_) {
     case SIMCALL_COMM_ISEND:
       return simcall_comm_isend__get__mbox(req1) == simcall_comm_isend__get__mbox(req2);
     case SIMCALL_COMM_IRECV:
@@ -176,6 +176,9 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid
 {
   xbt_assert(mc_model_checker != nullptr, "Must be called from MCer");
 
+  if (req->inspector_ != nullptr)
+    return req->inspector_->to_string();
+
   bool use_remote_comm = true;
   switch(request_type) {
   case simgrid::mc::RequestType::simix:
@@ -194,163 +197,159 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid
 
   smx_actor_t issuer = MC_smx_simcall_get_issuer(req);
 
-  switch (req->call) {
-
-  case SIMCALL_COMM_ISEND: {
-    type = "iSend";
-    char* p = pointer_to_string(simcall_comm_isend__get__src_buff(req));
-    char* bs = buff_size_to_string(simcall_comm_isend__get__src_buff_size(req));
-    if (issuer->get_host())
-      args = bprintf("src=(%ld)%s (%s), buff=%s, size=%s", issuer->get_pid(), MC_smx_actor_get_host_name(issuer),
-                     MC_smx_actor_get_name(issuer), p, bs);
-    else
-      args = bprintf("src=(%ld)%s, buff=%s, size=%s", issuer->get_pid(), MC_smx_actor_get_name(issuer), p, bs);
-    xbt_free(bs);
-    xbt_free(p);
-    break;
-  }
+  switch (req->call_) {
 
-  case SIMCALL_COMM_IRECV: {
-    size_t* remote_size = simcall_comm_irecv__get__dst_buff_size(req);
-    size_t size = 0;
-    if (remote_size)
-      mc_model_checker->process().read_bytes(&size, sizeof(size),
-        remote(remote_size));
-
-    type = "iRecv";
-    char* p = pointer_to_string(simcall_comm_irecv__get__dst_buff(req));
-    char* bs = buff_size_to_string(size);
-    if (issuer->get_host())
-      args = bprintf("dst=(%ld)%s (%s), buff=%s, size=%s", issuer->get_pid(), MC_smx_actor_get_host_name(issuer),
-                     MC_smx_actor_get_name(issuer), p, bs);
-    else
-      args = bprintf("dst=(%ld)%s, buff=%s, size=%s", issuer->get_pid(), MC_smx_actor_get_name(issuer), p, bs);
-    xbt_free(bs);
-    xbt_free(p);
-    break;
-  }
+    case SIMCALL_COMM_ISEND: {
+      type     = "iSend";
+      char* p  = pointer_to_string(simcall_comm_isend__get__src_buff(req));
+      char* bs = buff_size_to_string(simcall_comm_isend__get__src_buff_size(req));
+      if (issuer->get_host())
+        args = bprintf("src=(%ld)%s (%s), buff=%s, size=%s", issuer->get_pid(), MC_smx_actor_get_host_name(issuer),
+                       MC_smx_actor_get_name(issuer), p, bs);
+      else
+        args = bprintf("src=(%ld)%s, buff=%s, size=%s", issuer->get_pid(), MC_smx_actor_get_name(issuer), p, bs);
+      xbt_free(bs);
+      xbt_free(p);
+      break;
+    }
+
+    case SIMCALL_COMM_IRECV: {
+      size_t* remote_size = simcall_comm_irecv__get__dst_buff_size(req);
+      size_t size         = 0;
+      if (remote_size)
+        mc_model_checker->process().read_bytes(&size, sizeof(size), remote(remote_size));
+
+      type     = "iRecv";
+      char* p  = pointer_to_string(simcall_comm_irecv__get__dst_buff(req));
+      char* bs = buff_size_to_string(size);
+      if (issuer->get_host())
+        args = bprintf("dst=(%ld)%s (%s), buff=%s, size=%s", issuer->get_pid(), MC_smx_actor_get_host_name(issuer),
+                       MC_smx_actor_get_name(issuer), p, bs);
+      else
+        args = bprintf("dst=(%ld)%s, buff=%s, size=%s", issuer->get_pid(), MC_smx_actor_get_name(issuer), p, bs);
+      xbt_free(bs);
+      xbt_free(p);
+      break;
+    }
 
-  case SIMCALL_COMM_WAIT: {
-    simgrid::kernel::activity::CommImpl* remote_act =
-        static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(req));
-    char* p;
-    if (value == -1) {
-      type = "WaitTimeout";
-      p = pointer_to_string(remote_act);
-      args = bprintf("comm=%s", p);
-    } else {
-      type = "Wait";
-      p = pointer_to_string(remote_act);
+    case SIMCALL_COMM_WAIT: {
+      simgrid::kernel::activity::CommImpl* remote_act =
+          static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(req));
+      char* p;
+      if (value == -1) {
+        type = "WaitTimeout";
+        p    = pointer_to_string(remote_act);
+        args = bprintf("comm=%s", p);
+      } else {
+        type = "Wait";
+        p    = pointer_to_string(remote_act);
+
+        simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_synchro;
+        simgrid::kernel::activity::CommImpl* act;
+        if (use_remote_comm) {
+          mc_model_checker->process().read(temp_synchro,
+                                           remote(static_cast<simgrid::kernel::activity::CommImpl*>(remote_act)));
+          act = temp_synchro.get_buffer();
+        } else
+          act = remote_act;
+
+        smx_actor_t src_proc = mc_model_checker->process().resolve_actor(simgrid::mc::remote(act->src_actor_.get()));
+        smx_actor_t dst_proc = mc_model_checker->process().resolve_actor(simgrid::mc::remote(act->dst_actor_.get()));
+        args                 = bprintf("comm=%s [(%ld)%s (%s)-> (%ld)%s (%s)]", p, src_proc ? src_proc->get_pid() : 0,
+                       src_proc ? MC_smx_actor_get_host_name(src_proc) : "",
+                       src_proc ? MC_smx_actor_get_name(src_proc) : "", dst_proc ? dst_proc->get_pid() : 0,
+                       dst_proc ? MC_smx_actor_get_host_name(dst_proc) : "",
+                       dst_proc ? MC_smx_actor_get_name(dst_proc) : "");
+      }
+      xbt_free(p);
+      break;
+    }
 
+    case SIMCALL_COMM_TEST: {
+      simgrid::kernel::activity::CommImpl* remote_act =
+          static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_test__getraw__comm(req));
       simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_synchro;
       simgrid::kernel::activity::CommImpl* act;
       if (use_remote_comm) {
         mc_model_checker->process().read(temp_synchro,
                                          remote(static_cast<simgrid::kernel::activity::CommImpl*>(remote_act)));
-        act = temp_synchro.getBuffer();
+        act = temp_synchro.get_buffer();
       } else
         act = remote_act;
 
-      smx_actor_t src_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(act->src_actor_.get()));
-      smx_actor_t dst_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(act->dst_actor_.get()));
-      args =
-          bprintf("comm=%s [(%ld)%s (%s)-> (%ld)%s (%s)]", p, src_proc ? src_proc->get_pid() : 0,
-                  src_proc ? MC_smx_actor_get_host_name(src_proc) : "", src_proc ? MC_smx_actor_get_name(src_proc) : "",
-                  dst_proc ? dst_proc->get_pid() : 0, dst_proc ? MC_smx_actor_get_host_name(dst_proc) : "",
-                  dst_proc ? MC_smx_actor_get_name(dst_proc) : "");
+      char* p;
+      if (act->src_actor_.get() == nullptr || act->dst_actor_.get() == nullptr) {
+        type = "Test FALSE";
+        p    = pointer_to_string(remote_act);
+        args = bprintf("comm=%s", p);
+      } else {
+        type = "Test TRUE";
+        p    = pointer_to_string(remote_act);
+
+        smx_actor_t src_proc = mc_model_checker->process().resolve_actor(simgrid::mc::remote(act->src_actor_.get()));
+        smx_actor_t dst_proc = mc_model_checker->process().resolve_actor(simgrid::mc::remote(act->dst_actor_.get()));
+        args                 = bprintf("comm=%s [(%ld)%s (%s) -> (%ld)%s (%s)]", p, src_proc->get_pid(),
+                       MC_smx_actor_get_name(src_proc), MC_smx_actor_get_host_name(src_proc), dst_proc->get_pid(),
+                       MC_smx_actor_get_name(dst_proc), MC_smx_actor_get_host_name(dst_proc));
+      }
+      xbt_free(p);
+      break;
     }
-    xbt_free(p);
-    break;
-  }
 
-  case SIMCALL_COMM_TEST: {
-    simgrid::kernel::activity::CommImpl* remote_act =
-        static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_test__getraw__comm(req));
-    simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_synchro;
-    simgrid::kernel::activity::CommImpl* act;
-    if (use_remote_comm) {
-      mc_model_checker->process().read(temp_synchro,
-                                       remote(static_cast<simgrid::kernel::activity::CommImpl*>(remote_act)));
-      act = temp_synchro.getBuffer();
-    } else
-      act = remote_act;
-
-    char* p;
-    if (act->src_actor_.get() == nullptr || act->dst_actor_.get() == nullptr) {
-      type = "Test FALSE";
-      p = pointer_to_string(remote_act);
-      args = bprintf("comm=%s", p);
-    } else {
-      type = "Test TRUE";
-      p = pointer_to_string(remote_act);
-
-      smx_actor_t src_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(act->src_actor_.get()));
-      smx_actor_t dst_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(act->dst_actor_.get()));
-      args = bprintf("comm=%s [(%ld)%s (%s) -> (%ld)%s (%s)]", p, src_proc->get_pid(), MC_smx_actor_get_name(src_proc),
-                     MC_smx_actor_get_host_name(src_proc), dst_proc->get_pid(), MC_smx_actor_get_name(dst_proc),
-                     MC_smx_actor_get_host_name(dst_proc));
+    case SIMCALL_COMM_WAITANY: {
+      type         = "WaitAny";
+      size_t count = simcall_comm_waitany__get__count(req);
+      if (count > 0) {
+        simgrid::kernel::activity::CommImpl* remote_sync;
+        remote_sync = mc_model_checker->process().read(remote(simcall_comm_waitany__get__comms(req) + value));
+        char* p     = pointer_to_string(remote_sync);
+        args        = bprintf("comm=%s (%d of %zu)", p, value + 1, count);
+        xbt_free(p);
+      } else
+        args = bprintf("comm at idx %d", value);
+      break;
     }
-    xbt_free(p);
-    break;
-  }
-
-  case SIMCALL_COMM_WAITANY: {
-    type = "WaitAny";
-    size_t count = simcall_comm_waitany__get__count(req);
-    if (count > 0) {
-      simgrid::kernel::activity::CommImpl* remote_sync;
-      remote_sync = mc_model_checker->process().read(remote(simcall_comm_waitany__get__comms(req) + value));
-      char* p     = pointer_to_string(remote_sync);
-      args        = bprintf("comm=%s (%d of %zu)", p, value + 1, count);
-      xbt_free(p);
-    } else
-      args = bprintf("comm at idx %d", value);
-    break;
-  }
 
-  case SIMCALL_COMM_TESTANY:
-    if (value == -1) {
-      type = "TestAny FALSE";
-      args = xbt_strdup("-");
-    } else {
-      type = "TestAny";
-      args =
-          bprintf("(%d of %zu)", value + 1,
-                    simcall_comm_testany__get__count(req));
+    case SIMCALL_COMM_TESTANY:
+      if (value == -1) {
+        type = "TestAny FALSE";
+        args = xbt_strdup("-");
+      } else {
+        type = "TestAny";
+        args = bprintf("(%d of %zu)", value + 1, simcall_comm_testany__get__count(req));
+      }
+      break;
+
+    case SIMCALL_MUTEX_TRYLOCK:
+    case SIMCALL_MUTEX_LOCK: {
+      if (req->call_ == SIMCALL_MUTEX_LOCK)
+        type = "Mutex LOCK";
+      else
+        type = "Mutex TRYLOCK";
+
+      simgrid::mc::Remote<simgrid::kernel::activity::MutexImpl> mutex;
+      mc_model_checker->process().read_bytes(mutex.get_buffer(), sizeof(mutex),
+                                             remote(req->call_ == SIMCALL_MUTEX_LOCK
+                                                        ? simcall_mutex_lock__get__mutex(req)
+                                                        : simcall_mutex_trylock__get__mutex(req)));
+      args = bprintf("locked = %d, owner = %d, sleeping = n/a", mutex.get_buffer()->is_locked(),
+                     mutex.get_buffer()->owner_ != nullptr
+                         ? (int)mc_model_checker->process()
+                               .resolve_actor(simgrid::mc::remote(mutex.get_buffer()->owner_))
+                               ->get_pid()
+                         : -1);
+      break;
     }
-    break;
 
-  case SIMCALL_MUTEX_TRYLOCK:
-  case SIMCALL_MUTEX_LOCK: {
-    if (req->call == SIMCALL_MUTEX_LOCK)
-      type = "Mutex LOCK";
-    else
-      type = "Mutex TRYLOCK";
-
-    simgrid::mc::Remote<simgrid::kernel::activity::MutexImpl> mutex;
-    mc_model_checker->process().read_bytes(mutex.getBuffer(), sizeof(mutex),
-      remote(
-        req->call == SIMCALL_MUTEX_LOCK
-        ? simcall_mutex_lock__get__mutex(req)
-        : simcall_mutex_trylock__get__mutex(req)
-      ));
-    args = bprintf(
-        "locked = %d, owner = %d, sleeping = n/a", mutex.getBuffer()->locked_,
-        mutex.getBuffer()->owner_ != nullptr
-            ? (int)mc_model_checker->process().resolveActor(simgrid::mc::remote(mutex.getBuffer()->owner_))->get_pid()
-            : -1);
-    break;
-  }
+    case SIMCALL_MC_RANDOM:
+      type = "MC_RANDOM";
+      args = bprintf("%d", value);
+      break;
 
-  case SIMCALL_MC_RANDOM:
-    type = "MC_RANDOM";
-    args = bprintf("%d", value);
-    break;
-
-  default:
-    type = SIMIX_simcall_name(req->call);
-    args = bprintf("??");
-    break;
+    default:
+      type = SIMIX_simcall_name(req->call_);
+      args = bprintf("??");
+      break;
   }
 
   std::string str;
@@ -370,28 +369,28 @@ namespace mc {
 bool request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx)
 {
   simgrid::kernel::activity::CommImpl* remote_act = nullptr;
-  switch (req->call) {
+  switch (req->call_) {
 
-  case SIMCALL_COMM_WAIT:
-    /* FIXME: check also that src and dst processes are not suspended */
-    remote_act = simcall_comm_wait__getraw__comm(req);
-    break;
+    case SIMCALL_COMM_WAIT:
+      /* FIXME: check also that src and dst processes are not suspended */
+      remote_act = simcall_comm_wait__getraw__comm(req);
+      break;
 
-  case SIMCALL_COMM_WAITANY:
-    remote_act = mc_model_checker->process().read(remote(simcall_comm_testany__get__comms(req) + idx));
-    break;
+    case SIMCALL_COMM_WAITANY:
+      remote_act = mc_model_checker->process().read(remote(simcall_comm_testany__get__comms(req) + idx));
+      break;
 
-  case SIMCALL_COMM_TESTANY:
-    remote_act = mc_model_checker->process().read(remote(simcall_comm_testany__get__comms(req) + idx));
-    break;
+    case SIMCALL_COMM_TESTANY:
+      remote_act = mc_model_checker->process().read(remote(simcall_comm_testany__get__comms(req) + idx));
+      break;
 
-  default:
-    return true;
+    default:
+      return true;
   }
 
   simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_comm;
   mc_model_checker->process().read(temp_comm, remote(remote_act));
-  simgrid::kernel::activity::CommImpl* comm = temp_comm.getBuffer();
+  simgrid::kernel::activity::CommImpl* comm = temp_comm.get_buffer();
   return comm->src_actor_.get() && comm->dst_actor_.get();
 }
 
@@ -419,121 +418,126 @@ static inline const char* get_color(int id)
 
 std::string request_get_dot_output(smx_simcall_t req, int value)
 {
-  std::string label;
-
   const smx_actor_t issuer = MC_smx_simcall_get_issuer(req);
+  const char* color        = get_color(issuer->get_pid() - 1);
 
-  switch (req->call) {
-  case SIMCALL_COMM_ISEND:
-    if (issuer->get_host())
-      label = simgrid::xbt::string_printf("[(%ld)%s] iSend", issuer->get_pid(), MC_smx_actor_get_host_name(issuer));
-    else
-      label = bprintf("[(%ld)] iSend", issuer->get_pid());
-    break;
+  if (req->inspector_ != nullptr)
+    return simgrid::xbt::string_printf("label = \"%s\", color = %s, fontcolor = %s",
+                                       req->inspector_->dot_label().c_str(), color, color);
 
-  case SIMCALL_COMM_IRECV:
-    if (issuer->get_host())
-      label = simgrid::xbt::string_printf("[(%ld)%s] iRecv", issuer->get_pid(), MC_smx_actor_get_host_name(issuer));
-    else
-      label = simgrid::xbt::string_printf("[(%ld)] iRecv", issuer->get_pid());
-    break;
+  std::string label;
 
-  case SIMCALL_COMM_WAIT:
-    if (value == -1) {
+  switch (req->call_) {
+    case SIMCALL_COMM_ISEND:
       if (issuer->get_host())
-        label =
-            simgrid::xbt::string_printf("[(%ld)%s] WaitTimeout", issuer->get_pid(), MC_smx_actor_get_host_name(issuer));
+        label = simgrid::xbt::string_printf("[(%ld)%s] iSend", issuer->get_pid(), MC_smx_actor_get_host_name(issuer));
       else
-        label = simgrid::xbt::string_printf("[(%ld)] WaitTimeout", issuer->get_pid());
-    } else {
-      simgrid::kernel::activity::ActivityImpl* remote_act = simcall_comm_wait__getraw__comm(req);
-      simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_comm;
-      mc_model_checker->process().read(temp_comm,
-                                       remote(static_cast<simgrid::kernel::activity::CommImpl*>(remote_act)));
-      simgrid::kernel::activity::CommImpl* comm = temp_comm.getBuffer();
+        label = bprintf("[(%ld)] iSend", issuer->get_pid());
+      break;
 
-      smx_actor_t src_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(comm->src_actor_.get()));
-      smx_actor_t dst_proc = mc_model_checker->process().resolveActor(simgrid::mc::remote(comm->dst_actor_.get()));
+    case SIMCALL_COMM_IRECV:
       if (issuer->get_host())
-        label = simgrid::xbt::string_printf("[(%ld)%s] Wait [(%ld)->(%ld)]", issuer->get_pid(),
-                                            MC_smx_actor_get_host_name(issuer), src_proc ? src_proc->get_pid() : 0,
-                                            dst_proc ? dst_proc->get_pid() : 0);
+        label = simgrid::xbt::string_printf("[(%ld)%s] iRecv", issuer->get_pid(), MC_smx_actor_get_host_name(issuer));
       else
-        label = simgrid::xbt::string_printf("[(%ld)] Wait [(%ld)->(%ld)]", issuer->get_pid(),
-                                            src_proc ? src_proc->get_pid() : 0, dst_proc ? dst_proc->get_pid() : 0);
+        label = simgrid::xbt::string_printf("[(%ld)] iRecv", issuer->get_pid());
+      break;
+
+    case SIMCALL_COMM_WAIT:
+      if (value == -1) {
+        if (issuer->get_host())
+          label = simgrid::xbt::string_printf("[(%ld)%s] WaitTimeout", issuer->get_pid(),
+                                              MC_smx_actor_get_host_name(issuer));
+        else
+          label = simgrid::xbt::string_printf("[(%ld)] WaitTimeout", issuer->get_pid());
+      } else {
+        simgrid::kernel::activity::ActivityImpl* remote_act = simcall_comm_wait__getraw__comm(req);
+        simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_comm;
+        mc_model_checker->process().read(temp_comm,
+                                         remote(static_cast<simgrid::kernel::activity::CommImpl*>(remote_act)));
+        simgrid::kernel::activity::CommImpl* comm = temp_comm.get_buffer();
+
+        smx_actor_t src_proc = mc_model_checker->process().resolve_actor(simgrid::mc::remote(comm->src_actor_.get()));
+        smx_actor_t dst_proc = mc_model_checker->process().resolve_actor(simgrid::mc::remote(comm->dst_actor_.get()));
+        if (issuer->get_host())
+          label = simgrid::xbt::string_printf("[(%ld)%s] Wait [(%ld)->(%ld)]", issuer->get_pid(),
+                                              MC_smx_actor_get_host_name(issuer), src_proc ? src_proc->get_pid() : 0,
+                                              dst_proc ? dst_proc->get_pid() : 0);
+        else
+          label = simgrid::xbt::string_printf("[(%ld)] Wait [(%ld)->(%ld)]", issuer->get_pid(),
+                                              src_proc ? src_proc->get_pid() : 0, dst_proc ? dst_proc->get_pid() : 0);
+      }
+      break;
+
+    case SIMCALL_COMM_TEST: {
+      simgrid::kernel::activity::ActivityImpl* remote_act = simcall_comm_test__getraw__comm(req);
+      simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_comm;
+      mc_model_checker->process().read(temp_comm,
+                                       remote(static_cast<simgrid::kernel::activity::CommImpl*>(remote_act)));
+      simgrid::kernel::activity::CommImpl* comm = temp_comm.get_buffer();
+      if (comm->src_actor_.get() == nullptr || comm->dst_actor_.get() == nullptr) {
+        if (issuer->get_host())
+          label = simgrid::xbt::string_printf("[(%ld)%s] Test FALSE", issuer->get_pid(),
+                                              MC_smx_actor_get_host_name(issuer));
+        else
+          label = bprintf("[(%ld)] Test FALSE", issuer->get_pid());
+      } else {
+        if (issuer->get_host())
+          label =
+              simgrid::xbt::string_printf("[(%ld)%s] Test TRUE", issuer->get_pid(), MC_smx_actor_get_host_name(issuer));
+        else
+          label = simgrid::xbt::string_printf("[(%ld)] Test TRUE", issuer->get_pid());
+      }
+      break;
     }
-    break;
 
-  case SIMCALL_COMM_TEST: {
-    simgrid::kernel::activity::ActivityImpl* remote_act = simcall_comm_test__getraw__comm(req);
-    simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_comm;
-    mc_model_checker->process().read(temp_comm, remote(static_cast<simgrid::kernel::activity::CommImpl*>(remote_act)));
-    simgrid::kernel::activity::CommImpl* comm = temp_comm.getBuffer();
-    if (comm->src_actor_.get() == nullptr || comm->dst_actor_.get() == nullptr) {
+    case SIMCALL_COMM_WAITANY: {
+      size_t comms_size = simcall_comm_waitany__get__count(req);
       if (issuer->get_host())
-        label =
-            simgrid::xbt::string_printf("[(%ld)%s] Test FALSE", issuer->get_pid(), MC_smx_actor_get_host_name(issuer));
+        label = simgrid::xbt::string_printf("[(%ld)%s] WaitAny [%d of %zu]", issuer->get_pid(),
+                                            MC_smx_actor_get_host_name(issuer), value + 1, comms_size);
       else
-        label = bprintf("[(%ld)] Test FALSE", issuer->get_pid());
-    } else {
-      if (issuer->get_host())
-        label =
-            simgrid::xbt::string_printf("[(%ld)%s] Test TRUE", issuer->get_pid(), MC_smx_actor_get_host_name(issuer));
-      else
-        label = simgrid::xbt::string_printf("[(%ld)] Test TRUE", issuer->get_pid());
+        label = simgrid::xbt::string_printf("[(%ld)] WaitAny [%d of %zu]", issuer->get_pid(), value + 1, comms_size);
+      break;
     }
-    break;
-  }
 
-  case SIMCALL_COMM_WAITANY: {
-    size_t comms_size = simcall_comm_waitany__get__count(req);
-    if (issuer->get_host())
-      label = simgrid::xbt::string_printf("[(%ld)%s] WaitAny [%d of %zu]", issuer->get_pid(),
-                                          MC_smx_actor_get_host_name(issuer), value + 1, comms_size);
-    else
-      label = simgrid::xbt::string_printf("[(%ld)] WaitAny [%d of %zu]", issuer->get_pid(), value + 1, comms_size);
-    break;
-  }
-
-  case SIMCALL_COMM_TESTANY:
-    if (value == -1) {
-      if (issuer->get_host())
-        label = simgrid::xbt::string_printf("[(%ld)%s] TestAny FALSE", issuer->get_pid(),
-                                            MC_smx_actor_get_host_name(issuer));
-      else
-        label = simgrid::xbt::string_printf("[(%ld)] TestAny FALSE", issuer->get_pid());
-    } else {
+    case SIMCALL_COMM_TESTANY:
+      if (value == -1) {
+        if (issuer->get_host())
+          label = simgrid::xbt::string_printf("[(%ld)%s] TestAny FALSE", issuer->get_pid(),
+                                              MC_smx_actor_get_host_name(issuer));
+        else
+          label = simgrid::xbt::string_printf("[(%ld)] TestAny FALSE", issuer->get_pid());
+      } else {
+        if (issuer->get_host())
+          label = simgrid::xbt::string_printf("[(%ld)%s] TestAny TRUE [%d of %lu]", issuer->get_pid(),
+                                              MC_smx_actor_get_host_name(issuer), value + 1,
+                                              simcall_comm_testany__get__count(req));
+        else
+          label = simgrid::xbt::string_printf("[(%ld)] TestAny TRUE [%d of %lu]", issuer->get_pid(), value + 1,
+                                              simcall_comm_testany__get__count(req));
+      }
+      break;
+
+    case SIMCALL_MUTEX_TRYLOCK:
+      label = simgrid::xbt::string_printf("[(%ld)] Mutex TRYLOCK", issuer->get_pid());
+      break;
+
+    case SIMCALL_MUTEX_LOCK:
+      label = simgrid::xbt::string_printf("[(%ld)] Mutex LOCK", issuer->get_pid());
+      break;
+
+    case SIMCALL_MC_RANDOM:
       if (issuer->get_host())
-        label = simgrid::xbt::string_printf("[(%ld)%s] TestAny TRUE [%d of %lu]", issuer->get_pid(),
-                                            MC_smx_actor_get_host_name(issuer), value + 1,
-                                            simcall_comm_testany__get__count(req));
+        label = simgrid::xbt::string_printf("[(%ld)%s] MC_RANDOM (%d)", issuer->get_pid(),
+                                            MC_smx_actor_get_host_name(issuer), value);
       else
-        label = simgrid::xbt::string_printf("[(%ld)] TestAny TRUE [%d of %lu]", issuer->get_pid(), value + 1,
-                                            simcall_comm_testany__get__count(req));
-    }
-    break;
+        label = simgrid::xbt::string_printf("[(%ld)] MC_RANDOM (%d)", issuer->get_pid(), value);
+      break;
 
-  case SIMCALL_MUTEX_TRYLOCK:
-    label = simgrid::xbt::string_printf("[(%ld)] Mutex TRYLOCK", issuer->get_pid());
-    break;
-
-  case SIMCALL_MUTEX_LOCK:
-    label = simgrid::xbt::string_printf("[(%ld)] Mutex LOCK", issuer->get_pid());
-    break;
-
-  case SIMCALL_MC_RANDOM:
-    if (issuer->get_host())
-      label = simgrid::xbt::string_printf("[(%ld)%s] MC_RANDOM (%d)", issuer->get_pid(),
-                                          MC_smx_actor_get_host_name(issuer), value);
-    else
-      label = simgrid::xbt::string_printf("[(%ld)] MC_RANDOM (%d)", issuer->get_pid(), value);
-    break;
-
-  default:
-    THROW_UNIMPLEMENTED;
+    default:
+      THROW_UNIMPLEMENTED;
   }
 
-  const char* color = get_color(issuer->get_pid() - 1);
   return  simgrid::xbt::string_printf(
         "label = \"%s\", color = %s, fontcolor = %s", label.c_str(),
         color, color);
index 60d5ae5..3570f8e 100644 (file)
@@ -19,7 +19,7 @@ using simgrid::mc::remote;
 static inline simgrid::mc::ActorInformation* actor_info_cast(smx_actor_t actor)
 {
   simgrid::mc::ActorInformation temp;
-  std::size_t offset = (char*) temp.copy.getBuffer() - (char*)&temp;
+  std::size_t offset = (char*)temp.copy.get_buffer() - (char*)&temp;
 
   simgrid::mc::ActorInformation* process_info = (simgrid::mc::ActorInformation*)((char*)actor - offset);
   return process_info;
@@ -77,9 +77,9 @@ void RemoteClient::refresh_simix()
   Remote<simgrid::simix::Global> simix_global =
     this->read<simgrid::simix::Global>(simix_global_p);
 
-  MC_process_refresh_simix_actor_dynar(this, this->smx_actors_infos, remote(simix_global.getBuffer()->actors_vector));
+  MC_process_refresh_simix_actor_dynar(this, this->smx_actors_infos, remote(simix_global.get_buffer()->actors_vector));
   MC_process_refresh_simix_actor_dynar(this, this->smx_dead_actors_infos,
-                                       remote(simix_global.getBuffer()->dead_actors_vector));
+                                       remote(simix_global.get_buffer()->dead_actors_vector));
 
   this->cache_flags_ |= RemoteClient::cache_simix_processes;
 }
@@ -101,15 +101,15 @@ smx_actor_t MC_smx_simcall_get_issuer(s_smx_simcall const* req)
   xbt_assert(mc_model_checker != nullptr);
 
   // This is the address of the smx_actor in the MCed process:
-  auto address = simgrid::mc::remote(req->issuer);
+  auto address = simgrid::mc::remote(req->issuer_);
 
   // Lookup by address:
   for (auto& actor : mc_model_checker->process().actors())
     if (actor.address == address)
-      return actor.copy.getBuffer();
+      return actor.copy.get_buffer();
   for (auto& actor : mc_model_checker->process().dead_actors())
     if (actor.address == address)
-      return actor.copy.getBuffer();
+      return actor.copy.get_buffer();
 
   xbt_die("Issuer not found");
 }
@@ -121,27 +121,9 @@ const char* MC_smx_actor_get_host_name(smx_actor_t actor)
 
   simgrid::mc::RemoteClient* process = &mc_model_checker->process();
 
-  /* HACK, Horrible hack to find the offset of the id in the simgrid::s4u::Host.
-
-     Offsetof is not supported for non-POD types but this should
-     work in practice for the targets currently supported by the MC
-     as long as we do not add funny features to the Host class
-     (such as virtual base).
-
-     We are using a (C++11) unrestricted union in order to avoid
-     any construction/destruction of the simgrid::s4u::Host.
-  */
-  union fake_host {
-    simgrid::s4u::Host host;
-    fake_host() { /* Nothing to do*/}
-    ~fake_host() { /* Nothing to do*/}
-  };
-  fake_host foo;
-  const size_t offset = (char*)&foo.host.get_name() - (char*)&foo.host;
-
   // Read the simgrid::xbt::string in the MCed process:
   simgrid::mc::ActorInformation* info     = actor_info_cast(actor);
-  auto remote_string_address              = remote((simgrid::xbt::string_data*)((char*)actor->get_host() + offset));
+  auto remote_string_address              = remote((simgrid::xbt::string_data*)&actor->get_host()->get_name());
   simgrid::xbt::string_data remote_string = process->read(remote_string_address);
   char hostname[remote_string.len];
   process->read_bytes(hostname, remote_string.len + 1, remote(remote_string.data));
@@ -163,22 +145,12 @@ const char* MC_smx_actor_get_name(smx_actor_t actor)
   return info->name.c_str();
 }
 
-#if HAVE_SMPI
-int MC_smpi_process_count()
-{
-  if (mc_model_checker == nullptr)
-    return smpi_process_count();
-  int res;
-  mc_model_checker->process().read_variable("process_count",
-    &res, sizeof(res));
-  return res;
-}
-#endif
-
 unsigned long MC_smx_get_maxpid()
 {
   unsigned long maxpid;
-  mc_model_checker->process().read_variable("simix_process_maxpid",
-    &maxpid, sizeof(maxpid));
+  const char* name = "simgrid::kernel::actor::maxpid";
+  if (mc_model_checker->process().find_variable(name) == nullptr)
+    name = "maxpid"; // We seem to miss the namespaces when compiling with GCC
+  mc_model_checker->process().read_variable(name, &maxpid, sizeof(maxpid));
   return maxpid;
 }
index 3c7165d..e46a1ee 100644 (file)
@@ -42,8 +42,6 @@ XBT_PRIVATE smx_actor_t MC_smx_simcall_get_issuer(s_smx_simcall const* req);
 XBT_PRIVATE const char* MC_smx_actor_get_name(smx_actor_t p);
 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);
 
 #endif
index 035c8d7..535dae9 100644 (file)
@@ -3,10 +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 "src/mc/mc_state.hpp"
 #include "src/mc/mc_comm_pattern.hpp"
+#include "src/mc/mc_config.hpp"
 #include "src/mc/mc_request.hpp"
 #include "src/mc/mc_smx.hpp"
-#include "src/mc/mc_state.hpp"
 
 #include <boost/range/algorithm.hpp>
 
@@ -17,16 +18,16 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_state, mc, "Logging specific to MC (state)");
 namespace simgrid {
 namespace mc {
 
-State::State(unsigned long state_number) : num(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));
+  this->internal_req  = s_smx_simcall();
+  this->executed_req_ = s_smx_simcall();
 
-  actorStates.resize(MC_smx_get_maxpid());
+  actor_states_.resize(MC_smx_get_maxpid());
   /* Stateful model checking */
   if ((_sg_mc_checkpoint > 0 && (state_number % _sg_mc_checkpoint == 0)) || _sg_mc_termination) {
-    system_state = simgrid::mc::take_snapshot(num);
+    system_state = std::make_shared<simgrid::mc::Snapshot>(num_);
     if (_sg_mc_comms_determinism || _sg_mc_send_determinism) {
       MC_state_copy_incomplete_communications_pattern(this);
       MC_state_copy_index_communications_pattern(this);
@@ -34,14 +35,14 @@ State::State(unsigned long state_number) : num(state_number)
   }
 }
 
-std::size_t State::interleaveSize() const
+std::size_t State::interleave_size() const
 {
-  return boost::range::count_if(this->actorStates, [](simgrid::mc::ProcessState const& p) { return p.isTodo(); });
+  return boost::range::count_if(this->actor_states_, [](simgrid::mc::ActorState const& a) { return a.is_todo(); });
 }
 
-Transition State::getTransition() const
+Transition State::get_transition() const
 {
-  return this->transition;
+  return this->transition_;
 }
 
 }
@@ -52,54 +53,59 @@ Transition State::getTransition() const
  * This can be seen as an iterator returning the next transition of the process.
  *
  * We only consider the processes that are both
- *  - marked "to be interleaved" in their ProcessState (controlled by the checker algorithm).
+ *  - marked "to be interleaved" in their ActorState (controlled by the checker algorithm).
  *  - 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.
  */
-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_choose_request_for_process(simgrid::mc::State* state, smx_actor_t actor)
 {
   /* reset the outgoing transition */
-  simgrid::mc::ProcessState* procstate = &state->actorStates[actor->get_pid()];
-  state->transition.pid                = -1;
-  state->transition.argument           = -1;
-  state->executed_req.call             = SIMCALL_NONE;
+  simgrid::mc::ActorState* procstate   = &state->actor_states_[actor->get_pid()];
+  state->transition_.pid_              = -1;
+  state->transition_.argument_         = -1;
+  state->executed_req_.call_           = SIMCALL_NONE;
 
   if (not simgrid::mc::actor_is_enabled(actor))
     return nullptr; // Not executable in the application
 
   smx_simcall_t req = nullptr;
-  switch (actor->simcall.call) {
+  switch (actor->simcall.call_) {
     case SIMCALL_COMM_WAITANY:
-      state->transition.argument = -1;
+      state->transition_.argument_ = -1;
       while (procstate->times_considered < simcall_comm_waitany__get__count(&actor->simcall)) {
-        if (simgrid::mc::request_is_enabled_by_idx(&actor->simcall, procstate->times_considered++)) {
-          state->transition.argument = procstate->times_considered - 1;
+        if (simgrid::mc::request_is_enabled_by_idx(&actor->simcall, procstate->times_considered)) {
+          state->transition_.argument_ = procstate->times_considered;
+          ++procstate->times_considered;
           break;
         }
+        ++procstate->times_considered;
       }
 
       if (procstate->times_considered >= simcall_comm_waitany__get__count(&actor->simcall))
-        procstate->setDone();
-      if (state->transition.argument != -1)
+        procstate->set_done();
+      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;
+      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;
+          ++procstate->times_considered;
           break;
         }
+        ++procstate->times_considered;
+      }
 
       if (procstate->times_considered >= simcall_comm_testany__get__count(&actor->simcall))
-        procstate->setDone();
+        procstate->set_done();
 
-      if (state->transition.argument != -1 || start_count == 0)
+      if (state->transition_.argument_ != -1 || start_count == 0)
         req = &actor->simcall;
 
       break;
@@ -110,100 +116,100 @@ static inline smx_simcall_t MC_state_get_request_for_process(simgrid::mc::State*
           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();
+      simgrid::kernel::activity::CommImpl* act = temp_act.get_buffer();
       if (act->src_actor_.get() && act->dst_actor_.get())
-        state->transition.argument = 0;
+        state->transition_.argument_ = 0; // OK
       else if (act->src_actor_.get() == nullptr && act->type_ == simgrid::kernel::activity::CommImpl::Type::READY &&
-               act->detached == 1)
-        state->transition.argument = 0;
+               act->detached())
+        state->transition_.argument_ = 0; // OK
       else
-        state->transition.argument = -1;
-      procstate->setDone();
+        state->transition_.argument_ = -1; // timeout
+      procstate->set_done();
       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;
+      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_ == simcall_mc_random__get__max(&actor->simcall))
+        procstate->set_done();
       req = &actor->simcall;
       break;
     }
 
     default:
-      procstate->setDone();
-      state->transition.argument = 0;
+      procstate->set_done();
+      state->transition_.argument_ = 0;
       req                        = &actor->simcall;
       break;
   }
   if (not req)
     return nullptr;
 
-  state->transition.pid = actor->get_pid();
-  state->executed_req = *req;
+  state->transition_.pid_ = actor->get_pid();
+  state->executed_req_    = *req;
   // 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. */
-  switch (req->call) {
-  case SIMCALL_COMM_WAITANY: {
-    state->internal_req.call = SIMCALL_COMM_WAIT;
-    simgrid::kernel::activity::CommImpl* remote_comm;
-    remote_comm =
-        mc_model_checker->process().read(remote(simcall_comm_waitany__get__comms(req) + state->transition.argument));
-    mc_model_checker->process().read(state->internal_comm, remote(remote_comm));
-    simcall_comm_wait__set__comm(&state->internal_req, state->internal_comm.getBuffer());
-    simcall_comm_wait__set__timeout(&state->internal_req, 0);
-    break;
-  }
-
-  case SIMCALL_COMM_TESTANY:
-    state->internal_req.call = SIMCALL_COMM_TEST;
-
-    if (state->transition.argument > 0) {
-      simgrid::kernel::activity::CommImpl* remote_comm =
-          mc_model_checker->process().read(remote(simcall_comm_testany__get__comms(req) + state->transition.argument));
+  switch (req->call_) {
+    case SIMCALL_COMM_WAITANY: {
+      state->internal_req.call_ = SIMCALL_COMM_WAIT;
+      simgrid::kernel::activity::CommImpl* remote_comm;
+      remote_comm = mc_model_checker->process().read(
+          remote(simcall_comm_waitany__get__comms(req) + state->transition_.argument_));
       mc_model_checker->process().read(state->internal_comm, remote(remote_comm));
+      simcall_comm_wait__set__comm(&state->internal_req, state->internal_comm.get_buffer());
+      simcall_comm_wait__set__timeout(&state->internal_req, 0);
+      break;
     }
 
-    simcall_comm_test__set__comm(&state->internal_req, state->internal_comm.getBuffer());
-    simcall_comm_test__set__result(&state->internal_req, state->transition.argument);
-    break;
-
-  case SIMCALL_COMM_WAIT:
-    mc_model_checker->process().read_bytes(&state->internal_comm, sizeof(state->internal_comm),
-                                           remote(simcall_comm_wait__getraw__comm(req)));
-    simcall_comm_wait__set__comm(&state->executed_req, state->internal_comm.getBuffer());
-    simcall_comm_wait__set__comm(&state->internal_req, state->internal_comm.getBuffer());
-    break;
-
-  case SIMCALL_COMM_TEST:
-    mc_model_checker->process().read_bytes(&state->internal_comm, sizeof(state->internal_comm),
-                                           remote(simcall_comm_test__getraw__comm(req)));
-    simcall_comm_test__set__comm(&state->executed_req, state->internal_comm.getBuffer());
-    simcall_comm_test__set__comm(&state->internal_req, state->internal_comm.getBuffer());
-    break;
-
-  default:
-    /* No translation needed */
-    break;
+    case SIMCALL_COMM_TESTANY:
+      state->internal_req.call_ = SIMCALL_COMM_TEST;
+
+      if (state->transition_.argument_ > 0) {
+        simgrid::kernel::activity::CommImpl* remote_comm = mc_model_checker->process().read(
+            remote(simcall_comm_testany__get__comms(req) + state->transition_.argument_));
+        mc_model_checker->process().read(state->internal_comm, remote(remote_comm));
+      }
+
+      simcall_comm_test__set__comm(&state->internal_req, state->internal_comm.get_buffer());
+      simcall_comm_test__set__result(&state->internal_req, state->transition_.argument_);
+      break;
+
+    case SIMCALL_COMM_WAIT:
+      mc_model_checker->process().read_bytes(&state->internal_comm, sizeof(state->internal_comm),
+                                             remote(simcall_comm_wait__getraw__comm(req)));
+      simcall_comm_wait__set__comm(&state->executed_req_, state->internal_comm.get_buffer());
+      simcall_comm_wait__set__comm(&state->internal_req, state->internal_comm.get_buffer());
+      break;
+
+    case SIMCALL_COMM_TEST:
+      mc_model_checker->process().read_bytes(&state->internal_comm, sizeof(state->internal_comm),
+                                             remote(simcall_comm_test__getraw__comm(req)));
+      simcall_comm_test__set__comm(&state->executed_req_, state->internal_comm.get_buffer());
+      simcall_comm_test__set__comm(&state->internal_req, state->internal_comm.get_buffer());
+      break;
+
+    default:
+      /* No translation needed */
+      break;
   }
 
   return req;
 }
 
-smx_simcall_t MC_state_get_request(simgrid::mc::State* state)
+smx_simcall_t MC_state_choose_request(simgrid::mc::State* state)
 {
   for (auto& actor : mc_model_checker->process().actors()) {
     /* Only consider the actors that were marked as interleaving by the checker algorithm */
-    if (not state->actorStates[actor.copy.getBuffer()->get_pid()].isTodo())
+    if (not state->actor_states_[actor.copy.get_buffer()->get_pid()].is_todo())
       continue;
 
-    smx_simcall_t res = MC_state_get_request_for_process(state, actor.copy.getBuffer());
+    smx_simcall_t res = MC_state_choose_request_for_process(state, actor.copy.get_buffer());
     if (res)
       return res;
   }
index bfdce90..4123468 100644 (file)
@@ -6,14 +6,9 @@
 #ifndef SIMGRID_MC_STATE_HPP
 #define SIMGRID_MC_STATE_HPP
 
-#include <list>
-#include <memory>
-
-#include "src/mc/mc_record.hpp"
-#include "src/mc/sosp/mc_snapshot.hpp"
-
 #include "src/kernel/activity/CommImpl.hpp"
 #include "src/mc/Transition.hpp"
+#include "src/mc/sosp/Snapshot.hpp"
 
 namespace simgrid {
 namespace mc {
@@ -58,18 +53,18 @@ public:
   }
 };
 
-/* On every state, each process has an entry of the following type.
- * This represents both the process and its transition because
- *   a process cannot have more than one enabled transition at a given time.
+/* On every state, each actor has an entry of the following type.
+ * This represents both the actor and its transition because
+ *   an actor cannot have more than one enabled transition at a given time.
  */
-class ProcessState {
-  /* Possible exploration status of a process transition in a state.
-   * Either the checker did not consider the transition, or it was considered and to do, or considered and done.
+class ActorState {
+  /* Possible exploration status of a actor transition in a state.
+   * Either the checker did not consider the transition, or it was considered and still to do, or considered and done.
    */
   enum class InterleavingType {
-    /** This process transition is not considered by the checker (yet?) */
+    /** This actor transition is not considered by the checker (yet?) */
     disabled = 0,
-    /** The checker algorithm decided that this process transitions should be done at some point */
+    /** The checker algorithm decided that this actor transitions should be done at some point */
     todo,
     /** The checker algorithm decided that this should be done, but it was done in the meanwhile */
     done,
@@ -83,32 +78,31 @@ public:
   // 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 is_disabled() const { return this->state == InterleavingType::disabled; }
+  bool is_done() const { return this->state == InterleavingType::done; }
+  bool is_todo() 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()
   {
     this->state            = InterleavingType::todo;
     this->times_considered = 0;
   }
-  void setDone() { this->state = InterleavingType::done; }
+  void set_done() { this->state = InterleavingType::done; }
 };
 
-/* A node in the exploration graph (kind-of)
- */
+/* A node in the exploration graph (kind-of) */
 class XBT_PRIVATE State {
 public:
   /** Sequential state number (used for debugging) */
-  int num = 0;
+  int num_ = 0;
 
   /** State's exploration status by process */
-  std::vector<ProcessState> actorStates;
+  std::vector<ActorState> actor_states_;
 
-  Transition transition;
+  Transition transition_;
 
   /** The simcall which was executed, going out of that state */
-  s_smx_simcall executed_req;
+  s_smx_simcall executed_req_;
 
   /* Internal translation of the executed_req simcall
    *
@@ -124,18 +118,18 @@ public:
   std::shared_ptr<simgrid::mc::Snapshot> system_state;
 
   // For CommunicationDeterminismChecker
-  std::vector<std::vector<simgrid::mc::PatternCommunication>> incomplete_comm_pattern;
-  std::vector<unsigned> communicationIndices;
+  std::vector<std::vector<simgrid::mc::PatternCommunication>> incomplete_comm_pattern_;
+  std::vector<unsigned> communication_indices_;
 
   explicit State(unsigned long state_number);
 
-  std::size_t interleaveSize() const;
-  void addInterleavingSet(smx_actor_t actor) { this->actorStates[actor->get_pid()].consider(); }
-  Transition getTransition() const;
+  std::size_t interleave_size() const;
+  void add_interleaving_set(smx_actor_t actor) { this->actor_states_[actor->get_pid()].consider(); }
+  Transition get_transition() const;
 };
 }
 }
 
-XBT_PRIVATE smx_simcall_t MC_state_get_request(simgrid::mc::State* state);
+XBT_PRIVATE smx_simcall_t MC_state_choose_request(simgrid::mc::State* state);
 
 #endif
diff --git a/src/mc/mc_unw.cpp b/src/mc/mc_unw.cpp
deleted file mode 100644 (file)
index 78299e3..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-/* Copyright (c) 2015-2019. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program 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
- *  Libunwind support for mc_address_space objects.
- */
-
-// We need this for the register indices:
-// #define _GNU_SOURCE
-
-#include <cstring>
-
-// On x86_64, libunwind unw_context_t has the same layout as ucontext_t:
-#include <sys/types.h>
-#include <sys/ucontext.h>
-#ifdef __FreeBSD__
-typedef register_t greg_t;
-#endif
-
-#include <libunwind.h>
-
-#include "src/mc/Frame.hpp"
-#include "src/mc/mc_unw.hpp"
-#include "src/mc/remote/RemoteClient.hpp"
-
-using simgrid::mc::remote;
-
-namespace simgrid {
-namespace mc {
-
-// ***** Implementation
-
-/** Get frame unwind information (libunwind method)
- *
- *  Delegates to the local/ptrace implementation.
- */
-int UnwindContext::find_proc_info(unw_addr_space_t /*as*/, unw_word_t ip, unw_proc_info_t* pip, int need_unwind_info,
-                                  void* arg) noexcept
-{
-  simgrid::mc::UnwindContext* context = (simgrid::mc::UnwindContext*) arg;
-  return unw_get_accessors(context->process_->unw_underlying_addr_space)->find_proc_info(
-    context->process_->unw_underlying_addr_space, ip, pip,
-    need_unwind_info, context->process_->unw_underlying_context
-  );
-}
-
-/** Release frame unwind information (libunwind method)
- *
- *  Delegates to the local/ptrace implementation.
- */
-void UnwindContext::put_unwind_info(unw_addr_space_t /*as*/, unw_proc_info_t* pip, void* arg) noexcept
-{
-  simgrid::mc::UnwindContext* context = (simgrid::mc::UnwindContext*) arg;
-  return unw_get_accessors(context->process_->unw_underlying_addr_space)->put_unwind_info(
-    context->process_->unw_underlying_addr_space, pip,
-    context->process_->unw_underlying_context
-  );
-}
-
-/** (libunwind method)
- *
- *  Not implemented.
- */
-int UnwindContext::get_dyn_info_list_addr(unw_addr_space_t /*as*/, unw_word_t* dilap, void* arg) noexcept
-{
-  simgrid::mc::UnwindContext* context = (simgrid::mc::UnwindContext*) arg;
-  return unw_get_accessors(context->process_->unw_underlying_addr_space)->get_dyn_info_list_addr(
-    context->process_->unw_underlying_addr_space,
-    dilap,
-    context->process_->unw_underlying_context
-  );
-}
-
-/** Read from the target address space memory (libunwind method)
- *
- *  Delegates to the `simgrid::mc::Process*`.
- */
-int UnwindContext::access_mem(unw_addr_space_t /*as*/, unw_word_t addr, unw_word_t* valp, int write, void* arg) noexcept
-{
-  simgrid::mc::UnwindContext* context = (simgrid::mc::UnwindContext*) arg;
-  if (write)
-    return - UNW_EREADONLYREG;
-  context->addressSpace_->read_bytes(valp, sizeof(unw_word_t), remote(addr));
-  return 0;
-}
-
-void* UnwindContext::get_reg(unw_context_t* context, unw_regnum_t regnum) noexcept
-{
-#ifdef __x86_64
-  mcontext_t* mcontext = &context->uc_mcontext;
-  switch (regnum) {
-# ifdef __linux__
-  case UNW_X86_64_RAX: return &mcontext->gregs[REG_RAX];
-  case UNW_X86_64_RDX: return &mcontext->gregs[REG_RDX];
-  case UNW_X86_64_RCX: return &mcontext->gregs[REG_RCX];
-  case UNW_X86_64_RBX: return &mcontext->gregs[REG_RBX];
-  case UNW_X86_64_RSI: return &mcontext->gregs[REG_RSI];
-  case UNW_X86_64_RDI: return &mcontext->gregs[REG_RDI];
-  case UNW_X86_64_RBP: return &mcontext->gregs[REG_RBP];
-  case UNW_X86_64_RSP: return &mcontext->gregs[REG_RSP];
-  case UNW_X86_64_R8:  return &mcontext->gregs[REG_R8];
-  case UNW_X86_64_R9:  return &mcontext->gregs[REG_R9];
-  case UNW_X86_64_R10: return &mcontext->gregs[REG_R10];
-  case UNW_X86_64_R11: return &mcontext->gregs[REG_R11];
-  case UNW_X86_64_R12: return &mcontext->gregs[REG_R12];
-  case UNW_X86_64_R13: return &mcontext->gregs[REG_R13];
-  case UNW_X86_64_R14: return &mcontext->gregs[REG_R14];
-  case UNW_X86_64_R15: return &mcontext->gregs[REG_R15];
-  case UNW_X86_64_RIP: return &mcontext->gregs[REG_RIP];
-# elif defined __FreeBSD__
-  case UNW_X86_64_RAX: return &mcontext->mc_rax;
-  case UNW_X86_64_RDX: return &mcontext->mc_rdx;
-  case UNW_X86_64_RCX: return &mcontext->mc_rcx;
-  case UNW_X86_64_RBX: return &mcontext->mc_rbx;
-  case UNW_X86_64_RSI: return &mcontext->mc_rsi;
-  case UNW_X86_64_RDI: return &mcontext->mc_rdi;
-  case UNW_X86_64_RBP: return &mcontext->mc_rbp;
-  case UNW_X86_64_RSP: return &mcontext->mc_rsp;
-  case UNW_X86_64_R8:  return &mcontext->mc_r8;
-  case UNW_X86_64_R9:  return &mcontext->mc_r9;
-  case UNW_X86_64_R10: return &mcontext->mc_r10;
-  case UNW_X86_64_R11: return &mcontext->mc_r11;
-  case UNW_X86_64_R12: return &mcontext->mc_r12;
-  case UNW_X86_64_R13: return &mcontext->mc_r13;
-  case UNW_X86_64_R14: return &mcontext->mc_r14;
-  case UNW_X86_64_R15: return &mcontext->mc_r15;
-  case UNW_X86_64_RIP: return &mcontext->mc_rip;
-# else
-#  error "Unable to get register from ucontext, please add your case"
-# endif
-  default: return nullptr;
-  }
-#else
-  return nullptr;
-#endif
-}
-
-/** Read a standard register (libunwind method)
- */
-int UnwindContext::access_reg(unw_addr_space_t /*as*/, unw_regnum_t regnum, unw_word_t* valp, int write,
-                              void* arg) noexcept
-{
-  simgrid::mc::UnwindContext* as_context = (simgrid::mc::UnwindContext*) arg;
-  unw_context_t* context = &as_context->unwindContext_;
-  if (write)
-    return -UNW_EREADONLYREG;
-  greg_t* preg = (greg_t*) get_reg(context, regnum);
-  if (not preg)
-    return -UNW_EBADREG;
-  *valp = *preg;
-  return 0;
-}
-
-/** Read a floating-point register (libunwind method)
- *
- *  FP registers are caller-saved. The values saved by functions such as
- *  `getcontext()` is not relevant for the caller. It is not really necessary
- *  to save and handle them.
- */
-int UnwindContext::access_fpreg(unw_addr_space_t /*as*/, unw_regnum_t /*regnum*/, unw_fpreg_t* /*fpvalp*/,
-                                int /*write*/, void* /*arg*/) noexcept
-{
-  return -UNW_EBADREG;
-}
-
-/** Resume the execution of the context (libunwind method)
- *
- * We don't use this.
- */
-int UnwindContext::resume(unw_addr_space_t /*as*/, unw_cursor_t* /*cp*/, void* /*arg*/) noexcept
-{
-  return -UNW_EUNSPEC;
-}
-
-/** Find informations about a function (libunwind method)
- */
-int UnwindContext::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
-{
-  simgrid::mc::UnwindContext* context = (simgrid::mc::UnwindContext*) arg;
-  simgrid::mc::Frame* frame = context->process_->find_function(remote(addr));
-  if (not frame)
-    return - UNW_ENOINFO;
-  *offp = (unw_word_t) frame->range.begin() - addr;
-
-  strncpy(bufp, frame->name.c_str(), buf_len);
-  if (bufp[buf_len - 1]) {
-    bufp[buf_len - 1] = 0;
-    return -UNW_ENOMEM;
-  }
-
-  return 0;
-}
-
-// ***** Init
-
-/** Virtual table for our `libunwind` implementation
- *
- *  Stack unwinding on a `simgrid::mc::Process*` (for memory, unwinding information)
- *  and `ucontext_t` (for processor registers).
- *
- *  It works with the `simgrid::mc::UnwindContext` context.
- */
-unw_accessors_t UnwindContext::accessors = {
-  &find_proc_info,
-  &put_unwind_info,
-  &get_dyn_info_list_addr,
-  &access_mem,
-  &access_reg,
-  &access_fpreg,
-  &resume,
-  &get_proc_name
-};
-
-unw_addr_space_t UnwindContext::createUnwindAddressSpace()
-{
-  return unw_create_addr_space(&UnwindContext::accessors, BYTE_ORDER);
-}
-
-void UnwindContext::clear()
-{
-  addressSpace_ = nullptr;
-  process_ = nullptr;
-}
-
-void UnwindContext::initialize(simgrid::mc::RemoteClient* process, unw_context_t* c)
-{
-  clear();
-
-  this->addressSpace_ = process;
-  this->process_ = process;
-
-  // Take a copy of the context for our own purpose:
-  this->unwindContext_ = *c;
-#if SIMGRID_PROCESSOR_x86_64 || SIMGRID_PROCESSOR_i686
-# ifdef __linux__
-  // On x86_64, ucontext_t contains a pointer to itself for FP registers.
-  // 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
-  // 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.
-#endif
-}
-
-unw_cursor_t UnwindContext::cursor()
-{
-  unw_cursor_t cursor;
-  if (process_ == nullptr
-    || addressSpace_ == nullptr
-    || unw_init_remote(&cursor, process_->unw_addr_space, this) != 0)
-    xbt_die("UnwindContext not initialized");
-  return cursor;
-}
-
-}
-}
index b703e0b..a3e2344 100644 (file)
@@ -13,7 +13,7 @@
 namespace simgrid {
 namespace mc {
 
-/** A channel for exchanging messages between model-checker and model-checked
+/** A channel for exchanging messages between model-checker and model-checked app
  *
  *  This abstracts away the way the messages are transferred. Currently, they
  *  are sent over a (connected) `SOCK_SEQPACKET` socket.
@@ -63,7 +63,7 @@ public:
     return this->receive(&m, sizeof(M));
   }
 
-  int getSocket() const { return socket_; }
+  int get_socket() const { return socket_; }
 };
 }
 }
index 321aa36..06916a4 100644 (file)
@@ -68,11 +68,11 @@ Client* Client::initialize()
   if (errno != 0 || raise(SIGSTOP) != 0)
     xbt_die("Could not wait for the model-checker (errno = %d: %s)", errno, strerror(errno));
 
-  instance_->handleMessages();
+  instance_->handle_messages();
   return instance_.get();
 }
 
-void Client::handleDeadlockCheck(s_mc_message_t*)
+void Client::handle_deadlock_check(s_mc_message_t*)
 {
   bool deadlock = false;
   if (not simix_global->process_list.empty()) {
@@ -88,33 +88,28 @@ void Client::handleDeadlockCheck(s_mc_message_t*)
   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(s_mc_message_t*)
+void Client::handle_continue(s_mc_message_t*)
 {
   /* Nothing to do */
 }
-void Client::handleSimcall(s_mc_message_simcall_handle_t* message)
+void Client::handle_simcall(s_mc_message_simcall_handle_t* message)
 {
   smx_actor_t process = SIMIX_process_from_PID(message->pid);
   if (not process)
     xbt_die("Invalid pid %lu", (unsigned long)message->pid);
-  SIMIX_simcall_handle(&process->simcall, message->value);
+  process->simcall_handle(message->value);
   if (channel_.send(MC_MESSAGE_WAITING))
     xbt_die("Could not send MESSAGE_WAITING to model-checker");
 }
-void Client::handleRestore(s_mc_message_restore_t* message)
-{
-#if HAVE_SMPI
-  smpi_really_switch_data_segment(simgrid::s4u::Actor::by_pid(message->index));
-#endif
-}
-void Client::handleActorEnabled(s_mc_message_actor_enabled_t* msg)
+
+void Client::handle_actor_enabled(s_mc_message_actor_enabled_t* msg)
 {
   bool res = simgrid::mc::actor_is_enabled(SIMIX_process_from_PID(msg->aid));
   s_mc_message_int_t answer{MC_MESSAGE_ACTOR_ENABLED_REPLY, res};
   channel_.send(answer);
 }
 
-void Client::handleMessages()
+void Client::handle_messages()
 {
   while (1) {
     XBT_DEBUG("Waiting messages from model-checker");
@@ -131,33 +126,27 @@ void Client::handleMessages()
       case MC_MESSAGE_DEADLOCK_CHECK:
         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);
+        handle_deadlock_check(message);
         break;
 
       case MC_MESSAGE_CONTINUE:
         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);
+        handle_continue(message);
         return;
 
       case MC_MESSAGE_SIMCALL_HANDLE:
         xbt_assert(received_size == sizeof(s_mc_message_simcall_handle_t),
                    "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(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);
+        handle_simcall((s_mc_message_simcall_handle_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 (%zd != %zu)", received_size,
                    sizeof(s_mc_message_actor_enabled_t));
-        handleActorEnabled((s_mc_message_actor_enabled_t*)message_buffer);
+        handle_actor_enabled((s_mc_message_actor_enabled_t*)message_buffer);
         break;
 
       default:
@@ -167,23 +156,23 @@ void Client::handleMessages()
   }
 }
 
-void Client::mainLoop()
+void Client::main_loop()
 {
   while (1) {
     simgrid::mc::wait_for_requests();
     xbt_assert(channel_.send(MC_MESSAGE_WAITING) == 0, "Could not send WAITING message to model-checker");
-    this->handleMessages();
+    this->handle_messages();
   }
 }
 
-void Client::reportAssertionFailure()
+void Client::report_assertion_failure()
 {
   if (channel_.send(MC_MESSAGE_ASSERTION_FAILED))
     xbt_die("Could not send assertion to model-checker");
-  this->handleMessages();
+  this->handle_messages();
 }
 
-void Client::ignoreMemory(void* addr, std::size_t size)
+void Client::ignore_memory(void* addr, std::size_t size)
 {
   s_mc_message_ignore_memory_t message;
   message.type = MC_MESSAGE_IGNORE_MEMORY;
@@ -193,7 +182,7 @@ void Client::ignoreMemory(void* addr, std::size_t size)
     xbt_die("Could not send IGNORE_MEMORY mesage to model-checker");
 }
 
-void Client::ignoreHeap(void* address, std::size_t size)
+void Client::ignore_heap(void* address, std::size_t size)
 {
   xbt_mheap_t heap = mmalloc_get_current_heap();
 
@@ -214,7 +203,7 @@ void Client::ignoreHeap(void* address, std::size_t size)
     xbt_die("Could not send ignored region to MCer");
 }
 
-void Client::unignoreHeap(void* address, std::size_t size)
+void Client::unignore_heap(void* address, std::size_t size)
 {
   s_mc_message_ignore_memory_t message;
   message.type = MC_MESSAGE_UNIGNORE_HEAP;
@@ -224,7 +213,7 @@ void Client::unignoreHeap(void* address, std::size_t size)
     xbt_die("Could not send IGNORE_HEAP message to model-checker");
 }
 
-void Client::declareSymbol(const char* name, int* value)
+void Client::declare_symbol(const char* name, int* value)
 {
   s_mc_message_register_symbol_t message;
   message.type = MC_MESSAGE_REGISTER_SYMBOL;
@@ -237,7 +226,7 @@ void Client::declareSymbol(const char* name, int* value)
     xbt_die("Could send REGISTER_SYMBOL message to model-checker");
 }
 
-void Client::declareStack(void* stack, size_t size, smx_actor_t process, ucontext_t* context)
+void Client::declare_stack(void* stack, size_t size, ucontext_t* context)
 {
   xbt_mheap_t heap = mmalloc_get_current_heap();
 
@@ -247,12 +236,6 @@ void Client::declareStack(void* stack, size_t size, smx_actor_t process, ucontex
   region.context = context;
   region.size    = size;
   region.block   = ((char*)stack - (char*)heap->heapbase) / BLOCKSIZE + 1;
-#if HAVE_SMPI
-  if (smpi_privatize_global_variables == SmpiPrivStrategies::MMAP && process)
-    region.process_index = process->get_pid() - 1;
-  else
-#endif
-    region.process_index = -1;
 
   s_mc_message_stack_region_t message;
   message.type         = MC_MESSAGE_STACK_REGION;
index d28987d..b26207e 100644 (file)
@@ -25,26 +25,25 @@ private:
 public:
   Client();
   explicit Client(int fd) : channel_(fd) {}
-  void handleMessages();
+  void handle_messages();
 
 private:
-  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);
+  void handle_deadlock_check(s_mc_message_t* msg);
+  void handle_continue(s_mc_message_t* msg);
+  void handle_simcall(s_mc_message_simcall_handle_t* message);
+  void handle_actor_enabled(s_mc_message_actor_enabled_t* msg);
 
 public:
-  Channel const& getChannel() const { return channel_; }
-  Channel& getChannel() { return channel_; }
-  void mainLoop();
-  void reportAssertionFailure();
-  void ignoreMemory(void* addr, std::size_t size);
-  void ignoreHeap(void* addr, std::size_t size);
-  void unignoreHeap(void* addr, std::size_t size);
-  void declareSymbol(const char* name, int* value);
+  Channel const& get_channel() const { return channel_; }
+  Channel& get_channel() { return channel_; }
+  XBT_ATTRIB_NORETURN void main_loop();
+  void report_assertion_failure();
+  void ignore_memory(void* addr, std::size_t size);
+  void ignore_heap(void* addr, std::size_t size);
+  void unignore_heap(void* addr, std::size_t size);
+  void declare_symbol(const char* name, int* value);
 #if HAVE_UCONTEXT_H
-  void declareStack(void* stack, size_t size, smx_actor_t process, ucontext_t* context);
+  void declare_stack(void* stack, size_t size, ucontext_t* context);
 #endif
 
   // Singleton :/
index 9904e03..1828f23 100644 (file)
@@ -7,10 +7,10 @@
 
 #include "src/mc/remote/RemoteClient.hpp"
 
+#include "src/mc/mc_smx.hpp"
+#include "src/mc/sosp/Snapshot.hpp"
 #include "xbt/file.hpp"
 #include "xbt/log.h"
-#include "src/mc/mc_smx.hpp"
-#include "src/mc/sosp/mc_snapshot.hpp"
 
 #include <fcntl.h>
 #include <libunwind-ptrace.h>
@@ -42,6 +42,7 @@ static const std::vector<std::string> filtered_libraries = {
     "libboost_chrono",
     "libboost_context",
     "libboost_context-mt",
+    "libboost_stacktrace_addr2line",
     "libboost_stacktrace_backtrace",
     "libboost_system",
     "libboost_thread",
@@ -200,13 +201,12 @@ void RemoteClient::init()
   this->memory_file = fd;
 
   // Read std_heap (is a struct mdesc*):
-  simgrid::mc::Variable* std_heap_var = this->find_variable("__mmalloc_default_mdp");
+  const simgrid::mc::Variable* std_heap_var = this->find_variable("__mmalloc_default_mdp");
   if (not std_heap_var)
     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(mdesc*), remote(std_heap_var->address),
-                   simgrid::mc::ProcessIndexDisabled);
+  this->read_bytes(&this->heap_address, sizeof(mdesc*), remote(std_heap_var->address));
 
   this->smx_actors_infos.clear();
   this->smx_dead_actors_infos.clear();
@@ -240,7 +240,7 @@ void RemoteClient::refresh_heap()
   // Read/dereference/refresh the std_heap pointer:
   if (not this->heap)
     this->heap.reset(new s_xbt_mheap_t());
-  this->read_bytes(this->heap.get(), sizeof(mdesc), remote(this->heap_address), simgrid::mc::ProcessIndexDisabled);
+  this->read_bytes(this->heap.get(), sizeof(mdesc), remote(this->heap_address));
   this->cache_flags_ |= RemoteClient::cache_heap;
 }
 
@@ -257,8 +257,7 @@ void RemoteClient::refresh_malloc_info()
   size_t count = this->heap->heaplimit + 1;
   if (this->heap_info.size() < count)
     this->heap_info.resize(count);
-  this->read_bytes(this->heap_info.data(), count * sizeof(malloc_info), remote(this->heap->heapinfo),
-                   simgrid::mc::ProcessIndexDisabled);
+  this->read_bytes(this->heap_info.data(), count * sizeof(malloc_info), remote(this->heap->heapinfo));
   this->cache_flags_ |= RemoteClient::cache_malloc;
 }
 
@@ -365,7 +364,7 @@ simgrid::mc::Frame* RemoteClient::find_function(RemotePtr<void> ip) const
 
 /** Find (one occurrence of) the named variable definition
  */
-simgrid::mc::Variable* RemoteClient::find_variable(const char* name) const
+const simgrid::mc::Variable* RemoteClient::find_variable(const char* name) const
 {
   // First lookup the variable in the executable shared object.
   // A global variable used directly by the executable code from a library
@@ -373,13 +372,13 @@ simgrid::mc::Variable* RemoteClient::find_variable(const char* name) const
   // We need to look up the variable in the executable first.
   if (this->binary_info) {
     std::shared_ptr<simgrid::mc::ObjectInformation> const& info = this->binary_info;
-    simgrid::mc::Variable* var                                  = info->find_variable(name);
+    const simgrid::mc::Variable* var                            = info->find_variable(name);
     if (var)
       return var;
   }
 
   for (std::shared_ptr<simgrid::mc::ObjectInformation> const& info : this->object_infos) {
-    simgrid::mc::Variable* var = info->find_variable(name);
+    const simgrid::mc::Variable* var = info->find_variable(name);
     if (var)
       return var;
   }
@@ -389,7 +388,8 @@ simgrid::mc::Variable* RemoteClient::find_variable(const char* name) const
 
 void RemoteClient::read_variable(const char* name, void* target, size_t size) const
 {
-  simgrid::mc::Variable* var = this->find_variable(name);
+  const simgrid::mc::Variable* var = this->find_variable(name);
+  xbt_assert(var, "Variable %s not found", 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 %zu, was %zu)", name,
@@ -426,33 +426,8 @@ std::string RemoteClient::read_string(RemotePtr<char> address) const
   }
 }
 
-const void* RemoteClient::read_bytes(void* buffer, std::size_t size, RemotePtr<void> address, int process_index,
-                                     ReadOptions /*options*/) const
+void* RemoteClient::read_bytes(void* buffer, std::size_t size, RemotePtr<void> address, ReadOptions /*options*/) const
 {
-#if HAVE_SMPI
-  if (process_index != simgrid::mc::ProcessIndexDisabled) {
-    std::shared_ptr<simgrid::mc::ObjectInformation> const& info = this->find_object_info_rw(address);
-    // Segment overlap is not handled.
-    if (info.get() && this->privatized(*info)) {
-      if (process_index < 0)
-        xbt_die("Missing process index");
-      if (process_index >= (int)MC_smpi_process_count())
-        xbt_die("Invalid process index");
-
-      // Read smpi_privatization_regions from MCed:
-      smpi_privatization_region_t remote_smpi_privatization_regions =
-          mc_model_checker->process().read_variable<smpi_privatization_region_t>("smpi_privatization_regions");
-
-      s_smpi_privatization_region_t privatization_region =
-          mc_model_checker->process().read<s_smpi_privatization_region_t>(
-              remote(remote_smpi_privatization_regions + process_index));
-
-      // Address translation in the privatization segment:
-      size_t offset = address.address() - (std::uint64_t)info->start_rw;
-      address       = remote((char*)privatization_region.address + offset);
-    }
-  }
-#endif
   if (pread_whole(this->memory_file, buffer, size, (size_t)address.address()) < 0)
     xbt_die("Read at %p from process %lli failed", (void*)address.address(), (long long)this->pid_);
   return buffer;
@@ -605,7 +580,7 @@ std::vector<simgrid::mc::ActorInformation>& RemoteClient::dead_actors()
   return smx_dead_actors_infos;
 }
 
-void RemoteClient::dumpStack()
+void RemoteClient::dump_stack()
 {
   unw_addr_space_t as = unw_create_addr_space(&_UPT_accessors, BYTE_ORDER);
   if (as == nullptr) {
@@ -637,9 +612,9 @@ void RemoteClient::dumpStack()
 bool RemoteClient::actor_is_enabled(aid_t pid)
 {
   s_mc_message_actor_enabled_t msg{MC_MESSAGE_ACTOR_ENABLED, pid};
-  process()->getChannel().send(msg);
+  process()->get_channel().send(msg);
   char buff[MC_MESSAGE_LENGTH];
-  ssize_t received = process()->getChannel().receive(buff, MC_MESSAGE_LENGTH, true);
+  ssize_t received = process()->get_channel().receive(buff, MC_MESSAGE_LENGTH, true);
   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 d2c84c4..b5cfdc9 100644 (file)
@@ -6,9 +6,11 @@
 #ifndef SIMGRID_MC_PROCESS_H
 #define SIMGRID_MC_PROCESS_H
 
-#include "src/xbt/mmalloc/mmprivate.h"
+#include "src/mc/AddressSpace.hpp"
+#include "src/mc/inspect/ObjectInformation.hpp"
 #include "src/mc/remote/Channel.hpp"
-#include "src/mc/ObjectInformation.hpp"
+#include "src/mc/remote/RemotePtr.hpp"
+#include "src/xbt/mmalloc/mmprivate.h"
 
 #include <vector>
 
@@ -80,8 +82,8 @@ public:
   RemoteClient& operator=(RemoteClient&&) = delete;
 
   // Read memory:
-  const void* read_bytes(void* buffer, std::size_t size, RemotePtr<void> address, int process_index = ProcessIndexAny,
-                         ReadOptions options = ReadOptions::none()) const override;
+  void* read_bytes(void* buffer, std::size_t size, RemotePtr<void> address,
+                   ReadOptions options = ReadOptions::none()) const override;
 
   void read_variable(const char* name, void* target, size_t size) const;
   template <class T> void read_variable(const char* name, T* target) const
@@ -91,7 +93,7 @@ public:
   template <class T> Remote<T> read_variable(const char* name) const
   {
     Remote<T> res;
-    read_variable(name, res.getBuffer(), sizeof(T));
+    read_variable(name, res.get_buffer(), sizeof(T));
     return res;
   }
 
@@ -107,7 +109,7 @@ public:
   std::shared_ptr<simgrid::mc::ObjectInformation> find_object_info_exec(RemotePtr<void> addr) const;
   std::shared_ptr<simgrid::mc::ObjectInformation> find_object_info_rw(RemotePtr<void> addr) const;
   simgrid::mc::Frame* find_function(RemotePtr<void> ip) const;
-  simgrid::mc::Variable* find_variable(const char* name) const;
+  const simgrid::mc::Variable* find_variable(const char* name) const;
 
   // Heap access:
   xbt_mheap_t get_heap()
@@ -125,8 +127,8 @@ public:
 
   void clear_cache() { this->cache_flags_ = RemoteClient::cache_none; }
 
-  Channel const& getChannel() const { return channel_; }
-  Channel& getChannel() { return channel_; }
+  Channel const& get_channel() const { return channel_; }
+  Channel& get_channel() { return channel_; }
 
   std::vector<IgnoredRegion> const& ignored_regions() const { return ignored_regions_; }
   void ignore_region(std::uint64_t address, std::size_t size);
@@ -142,10 +144,6 @@ public:
 
   void terminate() { running_ = false; }
 
-  bool privatized(ObjectInformation const& info) const { return privatized_ && info.executable(); }
-  bool privatized() const { return privatized_; }
-  void privatized(bool privatized) { privatized_ = privatized; }
-
   void ignore_global_variable(const char* name)
   {
     for (std::shared_ptr<simgrid::mc::ObjectInformation> const& info : this->object_infos)
@@ -164,7 +162,7 @@ public:
   std::vector<simgrid::mc::ActorInformation>& dead_actors();
 
   /** Get a local description of a remote SIMIX actor */
-  simgrid::mc::ActorInformation* resolveActorInfo(simgrid::mc::RemotePtr<simgrid::kernel::actor::ActorImpl> actor)
+  simgrid::mc::ActorInformation* resolve_actor_info(simgrid::mc::RemotePtr<simgrid::kernel::actor::ActorImpl> actor)
   {
     xbt_assert(mc_model_checker != nullptr);
     if (not actor)
@@ -180,16 +178,16 @@ public:
   }
 
   /** Get a local copy of the SIMIX actor structure */
-  simgrid::kernel::actor::ActorImpl* resolveActor(simgrid::mc::RemotePtr<simgrid::kernel::actor::ActorImpl> process)
+  simgrid::kernel::actor::ActorImpl* resolve_actor(simgrid::mc::RemotePtr<simgrid::kernel::actor::ActorImpl> process)
   {
-    simgrid::mc::ActorInformation* actor_info = this->resolveActorInfo(process);
+    simgrid::mc::ActorInformation* actor_info = this->resolve_actor_info(process);
     if (actor_info)
-      return actor_info->copy.getBuffer();
+      return actor_info->copy.get_buffer();
     else
       return nullptr;
   }
 
-  void dumpStack();
+  void dump_stack();
 
 private:
   void init_memory_map_info();
@@ -205,7 +203,6 @@ private:
   RemotePtr<void> maestro_stack_end_;
   int memory_file = -1;
   std::vector<IgnoredRegion> ignored_regions_;
-  bool privatized_ = false;
   std::vector<s_stack_region_t> stack_areas_;
   std::vector<IgnoredHeapRegion> ignored_heap_;
 
index 5d13c42..5da8005 100644 (file)
@@ -19,41 +19,29 @@ namespace mc {
  *
  *  * raw memory copy (std::memcpy) is used to copy Remote<T>;
  *
- *  * raw memory comparison is used to compare them;
- *
  *  * when T is a trivial type, Remote is convertible to a T.
  *
  *  We currently only handle the case where the type has the same layout
  *  in the current process and in the target process: we don't handle
  *  cross-architecture (such as 32-bit/64-bit access).
  */
-template <class T> union Remote {
+template <class T> class Remote {
 private:
-  T buffer;
+  typename std::aligned_storage<sizeof(T), alignof(T)>::type buffer;
 
 public:
-  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(static_cast<void*>(&buffer), static_cast<const void*>(&that.buffer), sizeof(buffer));
-    return *this;
-  }
-  T* getBuffer() { return &buffer; }
-  const T* getBuffer() const { return &buffer; }
-  std::size_t getBufferSize() const { return sizeof(T); }
+  Remote() = default;
+  explicit Remote(T const& p) { std::memcpy(&buffer, &p, sizeof buffer); }
+
+  T* get_buffer() { return reinterpret_cast<T*>(&buffer); }
+  const T* get_buffer() const { return reinterpret_cast<const T*>(&buffer); }
+  std::size_t get_buffer_size() const { return sizeof(T); }
   operator T() const
   {
-//FIXME: assert turned off because smpi:Request is not seen as "trivial".
-//    static_assert(std::is_trivial<T>::value, "Cannot convert non trivial type");
-    return buffer;
+    static_assert(std::is_trivial<T>::value, "Cannot convert non trivial type");
+    return *get_buffer();
   }
-  void clear() { std::memset(static_cast<void*>(&buffer), 0, sizeof(T)); }
+  void clear() { std::memset(&buffer, 0, sizeof buffer); }
 };
 
 /** Pointer to a remote address-space (process, snapshot)
@@ -78,7 +66,7 @@ public:
   explicit RemotePtr(std::nullptr_t) : address_(0) {}
   explicit RemotePtr(std::uint64_t address) : address_(address) {}
   explicit RemotePtr(T* address) : address_((std::uintptr_t)address) {}
-  explicit RemotePtr(Remote<T*> p) : address_((std::uintptr_t)*p.getBuffer()) {}
+  explicit RemotePtr(Remote<T*> p) : address_((std::uintptr_t)*p.get_buffer()) {}
   std::uint64_t address() const { return address_; }
 
   /** Turn into a local pointer
index 80c9f25..fd79b48 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "mc/datatypes.h"
 #include "simgrid/forward.h"
+#include "stdint.h"
 
 SG_BEGIN_DECL()
 
@@ -36,8 +37,6 @@ enum e_mc_message_type {
   MC_MESSAGE_WAITING,
   MC_MESSAGE_SIMCALL_HANDLE,
   MC_MESSAGE_ASSERTION_FAILED,
-  // MCer request to finish the restoration:
-  MC_MESSAGE_RESTORE,
   MC_MESSAGE_ACTOR_ENABLED,
   MC_MESSAGE_ACTOR_ENABLED_REPLY
 };
index 1c1227e..808fc60 100644 (file)
@@ -3,17 +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 <cstddef>
-#include <cstdint>
-
-#include <vector>
-
-#include "xbt/asserts.h"
-#include "xbt/misc.h"
-
 #include "src/mc/AddressSpace.hpp"
 #include "src/mc/sosp/ChunkedData.hpp"
-#include "src/mc/sosp/PageStore.hpp"
 
 namespace simgrid {
 namespace mc {
@@ -43,7 +34,7 @@ ChunkedData::ChunkedData(PageStore& store, AddressSpace& as, RemotePtr<void> add
        - move the segments in shared memory (this will break `fork` however)
     */
 
-    as.read_bytes(buffer.data(), xbt_pagesize, page, simgrid::mc::ProcessIndexDisabled);
+    as.read_bytes(buffer.data(), xbt_pagesize, page);
 
     pagenos_[i] = store_->store_page(buffer.data());
   }
index da5854e..ac4e24a 100644 (file)
@@ -6,13 +6,10 @@
 #ifndef SIMGRID_MC_CHUNKED_DATA_HPP
 #define SIMGRID_MC_CHUNKED_DATA_HPP
 
-#include <cstddef>
-#include <cstdint>
-
-#include <utility>
 #include <vector>
 
 #include "src/mc/mc_forward.hpp"
+#include "src/mc/remote/RemotePtr.hpp"
 #include "src/mc/sosp/PageStore.hpp"
 
 namespace simgrid {
@@ -22,7 +19,7 @@ namespace mc {
  *
  *  In order to save memory when taking memory snapshots, a given byte-string
  *  is split in fixed-size chunks. Identical chunks (either from the same
- *  snapshot or more probably from different snpashots) share the same memory
+ *  snapshot or more probably from different snapshots) share the same memory
  *  storage.
  *
  *  Thus a chunked is represented as a sequence of indices of each chunk.
index bc10291..ce53075 100644 (file)
@@ -3,23 +3,23 @@
 /* This program is 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 <sys/mman.h>
 #ifdef __FreeBSD__
 #define MAP_POPULATE MAP_PREFAULT_READ
 #endif
 
-#include "xbt/base.h"
+#include "src/internal_config.h"
 #include "xbt/log.h"
 #include "xbt/sysdep.h"
 
-#include "src/internal_config.h"
-
+#ifdef SG_HAVE_CPP14
+#include "src/include/xxhash.hpp"
+#endif
+#include "src/mc/mc_mmu.hpp"
 #include "src/mc/sosp/PageStore.hpp"
 
-#include "src/mc/mc_mmu.hpp"
+#include <cstring> // memcpy, memcmp
+#include <unistd.h>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_page_snapshot, mc, "Logging specific to mc_page_snapshot");
 
@@ -36,6 +36,9 @@ namespace mc {
  */
 static XBT_ALWAYS_INLINE PageStore::hash_type mc_hash_page(const void* data)
 {
+#ifdef SG_HAVE_CPP14
+  return xxh::xxhash<64>(data, xbt_pagesize);
+#else
   const std::uint64_t* values = (const uint64_t*)data;
   std::size_t n               = xbt_pagesize / sizeof(uint64_t);
 
@@ -44,6 +47,7 @@ static XBT_ALWAYS_INLINE PageStore::hash_type mc_hash_page(const void* data)
   for (std::size_t i = 0; i != n; ++i)
     hash = ((hash << 5) + hash) + values[i];
   return hash;
+#endif
 }
 
 // ***** snapshot_page_manager
index 5851513..c78f575 100644 (file)
@@ -6,14 +6,12 @@
 #ifndef SIMGRID_MC_PAGESTORE_HPP
 #define SIMGRID_MC_PAGESTORE_HPP
 
-#include <cstdint>
-#include <vector>
+#include "src/mc/mc_forward.hpp"
+#include "src/mc/mc_mmu.hpp"
 
 #include <unordered_map>
 #include <unordered_set>
-
-#include "src/mc/mc_forward.hpp"
-#include "src/mc/mc_mmu.hpp"
+#include <vector>
 
 #ifndef XBT_ALWAYS_INLINE
 #define XBT_ALWAYS_INLINE inline __attribute__((always_inline))
@@ -36,7 +34,7 @@ namespace mc {
  *
  *    We want to keep this memory region aligned on the memory pages (so
  *    that we might be able to create non-linear memory mappings on those
- *    pages in the future) and be able to expand it without coyping the
+ *    pages in the future) and be able to expand it without copying the
  *    data (there will be a lot of pages here): we will be able to
  *    efficiently expand the memory mapping using `mremap()`, moving it
  *    to another virtual address if necessary.
@@ -130,7 +128,7 @@ public:
    * store.
    *
    * This will be the case if a page if soft clean: we know that is has not
-   * changed since the previous cnapshot/restoration and we can avoid
+   * changed since the previous snapshot/restoration and we can avoid
    * hashing the page, comparing byte-per-byte to candidates.
    * */
   void ref_page(size_t pageno);
index 2200651..c9fbe6f 100644 (file)
@@ -39,7 +39,7 @@ public:
   static void new_content(void* buf, std::size_t size);
 };
 
-// static member datat initialization
+// static member data initialization
 std::size_t helper_tests::pagesize             = 0;
 std::unique_ptr<PageStore> helper_tests::store = nullptr;
 void* helper_tests::data                       = nullptr;
diff --git a/src/mc/sosp/Region.cpp b/src/mc/sosp/Region.cpp
new file mode 100644 (file)
index 0000000..8c27e7c
--- /dev/null
@@ -0,0 +1,128 @@
+/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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/ModelChecker.hpp"
+#include "src/mc/mc_config.hpp"
+#include "src/mc/mc_forward.hpp"
+
+#include "src/mc/mc_smx.hpp"
+#include "src/mc/sosp/Region.hpp"
+
+#include <cstdlib>
+#include <sys/mman.h>
+#ifdef __FreeBSD__
+#define MAP_POPULATE MAP_PREFAULT_READ
+#endif
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_RegionSnaphot, mc, "Logging specific to region snapshots");
+
+namespace simgrid {
+namespace mc {
+
+Region::Region(RegionType region_type, void* start_addr, size_t size)
+    : region_type_(region_type), start_addr_(start_addr), size_(size)
+{
+  xbt_assert((((uintptr_t)start_addr) & (xbt_pagesize - 1)) == 0, "Start address not at the beginning of a page");
+
+  chunks_ = ChunkedData(mc_model_checker->page_store(), mc_model_checker->process(), RemotePtr<void>(start_addr),
+                        mmu::chunk_count(size));
+}
+
+/** @brief Restore a region from a snapshot
+ *
+ *  @param region     Target region
+ */
+void Region::restore()
+{
+  xbt_assert(((start().address()) & (xbt_pagesize - 1)) == 0, "Not at the beginning of a page");
+  xbt_assert(simgrid::mc::mmu::chunk_count(size()) == get_chunks().page_count());
+
+  for (size_t i = 0; i != get_chunks().page_count(); ++i) {
+    void* target_page       = (void*)simgrid::mc::mmu::join(i, (std::uintptr_t)(void*)start().address());
+    const void* source_page = get_chunks().page(i);
+    mc_model_checker->process().write_bytes(source_page, xbt_pagesize, remote(target_page));
+  }
+}
+
+static XBT_ALWAYS_INLINE void* mc_translate_address_region(uintptr_t addr, simgrid::mc::Region* region)
+{
+  auto split                = simgrid::mc::mmu::split(addr - region->start().address());
+  auto pageno               = split.first;
+  auto offset               = split.second;
+  const void* snapshot_page = region->get_chunks().page(pageno);
+  return (char*)snapshot_page + offset;
+}
+
+void* Region::read(void* target, const void* addr, std::size_t size)
+{
+  xbt_assert(contain(simgrid::mc::remote(addr)), "Trying to read out of the region boundary.");
+
+  // Last byte of the region:
+  void* end = (char*)addr + size - 1;
+  if (simgrid::mc::mmu::same_chunk((std::uintptr_t)addr, (std::uintptr_t)end)) {
+    // The memory is contained in a single page:
+    return mc_translate_address_region((uintptr_t)addr, this);
+  }
+  // Otherwise, the memory spans several pages. Let's copy it all into the provided buffer
+  xbt_assert(target != nullptr, "Missing destination buffer for fragmented memory access");
+
+  // TODO, we assume the chunks are aligned to natural chunk boundaries.
+  // We should remove this assumption.
+
+  // Page of the last byte of the memory area:
+  size_t page_end = simgrid::mc::mmu::split((std::uintptr_t)end).first;
+
+  void* dest = target; // iterator in the buffer to where we should copy next
+
+  // Read each page:
+  while (simgrid::mc::mmu::split((std::uintptr_t)addr).first != page_end) {
+    void* snapshot_addr = mc_translate_address_region((uintptr_t)addr, this);
+    void* next_page     = (void*)simgrid::mc::mmu::join(simgrid::mc::mmu::split((std::uintptr_t)addr).first + 1, 0);
+    size_t readable     = (char*)next_page - (char*)addr;
+    memcpy(dest, snapshot_addr, readable);
+    addr = (char*)addr + readable;
+    dest = (char*)dest + readable;
+    size -= readable;
+  }
+
+  // Read the end:
+  void* snapshot_addr = mc_translate_address_region((uintptr_t)addr, this);
+  memcpy(dest, snapshot_addr, size);
+
+  return target;
+}
+
+} // namespace mc
+} // namespace simgrid
+
+/** Compare memory between snapshots (with known regions)
+ *
+ * @param addr1 Address in the first snapshot
+ * @param region1 Region of the address in the first snapshot
+ * @param addr2 Address in the second snapshot
+ * @param region2 Region of the address in the second snapshot
+ * @return same semantic as memcmp
+ */
+int MC_snapshot_region_memcmp(const void* addr1, simgrid::mc::Region* region1, const void* addr2,
+                              simgrid::mc::Region* region2, size_t size)
+{
+  // Using alloca() for large allocations may trigger stack overflow:
+  // use malloc if the buffer is too big.
+  bool stack_alloc    = size < 64;
+  void* buffer1a      = stack_alloc ? alloca(size) : ::operator new(size);
+  void* buffer2a      = stack_alloc ? alloca(size) : ::operator new(size);
+  const void* buffer1 = region1->read(buffer1a, addr1, size);
+  const void* buffer2 = region2->read(buffer2a, addr2, size);
+  int res;
+  if (buffer1 == buffer2)
+    res = 0;
+  else
+    res = memcmp(buffer1, buffer2, size);
+  if (not stack_alloc) {
+    ::operator delete(buffer1a);
+    ::operator delete(buffer2a);
+  }
+  return res;
+}
diff --git a/src/mc/sosp/Region.hpp b/src/mc/sosp/Region.hpp
new file mode 100644 (file)
index 0000000..8293df6
--- /dev/null
@@ -0,0 +1,87 @@
+/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program 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_SOSP_REGION_HPP
+#define SIMGRID_MC_SOSP_REGION_HPP
+
+#include "src/mc/remote/RemotePtr.hpp"
+#include "src/mc/sosp/ChunkedData.hpp"
+
+#include <memory>
+#include <vector>
+
+namespace simgrid {
+namespace mc {
+
+enum class RegionType { Heap = 1, Data = 2 };
+
+/** A copy/snapshot of a given memory region, where identical pages are stored only once */
+class Region {
+public:
+  static const RegionType HeapRegion    = RegionType::Heap;
+  static const RegionType DataRegion    = RegionType::Data;
+
+private:
+  RegionType region_type_;
+  simgrid::mc::ObjectInformation* object_info_ = nullptr;
+
+  /** @brief  Virtual address of the region in the simulated process */
+  void* start_addr_ = nullptr;
+
+  /** @brief Size of the data region in bytes */
+  std::size_t size_ = 0;
+
+  ChunkedData chunks_;
+
+public:
+  Region(RegionType type, void* start_addr, size_t size);
+  ~Region()             = default;
+  Region(Region const&) = delete;
+  Region& operator=(Region const&) = delete;
+  Region(Region&& that)            = delete;
+  Region& operator=(Region&& that) = delete;
+
+  // Data
+
+  ChunkedData const& get_chunks() const { return chunks_; }
+
+  simgrid::mc::ObjectInformation* object_info() const { return object_info_; }
+  void object_info(simgrid::mc::ObjectInformation* info) { object_info_ = info; }
+
+  // Other getters
+
+  RemotePtr<void> start() const { return remote(start_addr_); }
+  RemotePtr<void> end() const { return remote((char*)start_addr_ + size_); }
+  std::size_t size() const { return size_; }
+  RegionType region_type() const { return region_type_; }
+
+  bool contain(RemotePtr<void> p) const { return p >= start() && p < end(); }
+
+  /** @brief Restore a region from a snapshot */
+  void restore();
+
+  /** @brief Read memory that was snapshoted in this region
+   *
+   *  @param target  Buffer to store contiguously the value if it spans over several pages
+   *  @param addr    Process (non-snapshot) address of the data
+   *  @param size    Size of the data to read in bytes
+   *  @return Pointer where the data is located (either target buffer or original location)
+   */
+  void* read(void* target, const void* addr, std::size_t size);
+};
+
+} // namespace mc
+} // namespace simgrid
+
+int MC_snapshot_region_memcmp(const void* addr1, simgrid::mc::Region* region1, const void* addr2,
+                              simgrid::mc::Region* region2, std::size_t size);
+
+static XBT_ALWAYS_INLINE void* MC_region_read_pointer(simgrid::mc::Region* region, const void* addr)
+{
+  void* res;
+  return *(void**)region->read(&res, addr, sizeof(void*));
+}
+
+#endif
diff --git a/src/mc/sosp/RegionSnapshot.cpp b/src/mc/sosp/RegionSnapshot.cpp
deleted file mode 100644 (file)
index ea2445f..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
-
-/* This program is 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 <sys/mman.h>
-#ifdef __FreeBSD__
-#define MAP_POPULATE MAP_PREFAULT_READ
-#endif
-
-#include "mc/mc.h"
-#include "src/mc/mc_config.hpp"
-#include "src/mc/sosp/mc_snapshot.hpp"
-
-#include "src/mc/sosp/ChunkedData.hpp"
-#include "src/mc/sosp/RegionSnapshot.hpp"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_RegionSnaphot, mc, "Logging specific to region snapshots");
-
-namespace simgrid {
-namespace mc {
-
-static inline const char* to_cstr(RegionType region)
-{
-  switch (region) {
-    case RegionType::Unknown:
-      return "unknown";
-    case RegionType::Heap:
-      return "Heap";
-    case RegionType::Data:
-      return "Data";
-    default:
-      return "?";
-  }
-}
-
-Buffer::Buffer(std::size_t size, Type type) : size_(size), type_(type)
-{
-  switch (type_) {
-    case Type::Malloc:
-      data_ = ::operator new(size_);
-      break;
-    case Type::Mmap:
-      data_ = ::mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_POPULATE, -1, 0);
-      if (data_ == MAP_FAILED) {
-        data_ = nullptr;
-        size_ = 0;
-        type_ = Type::Malloc;
-        throw std::bad_alloc();
-      }
-      break;
-    default:
-      abort();
-  }
-}
-
-void Buffer::clear() noexcept
-{
-  switch (type_) {
-    case Type::Malloc:
-      ::operator delete(data_);
-      break;
-    case Type::Mmap:
-      if (munmap(data_, size_) != 0)
-        abort();
-      break;
-    default:
-      abort();
-  }
-  data_ = nullptr;
-  size_ = 0;
-  type_ = Type::Malloc;
-}
-
-RegionSnapshot dense_region(RegionType region_type, 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
-  simgrid::mc::Buffer data;
-  if (_sg_mc_ksm)
-    data = Buffer::mmap(size);
-  else
-    data = Buffer::malloc(size);
-
-  mc_model_checker->process().read_bytes(data.get(), size, remote(permanent_addr), simgrid::mc::ProcessIndexDisabled);
-
-#ifdef __linux__
-  if (_sg_mc_ksm)
-    // Mark the region as mergeable *after* we have written into it.
-    // Trying to merge them before is useless/counterproductive.
-    madvise(data.get(), size, MADV_MERGEABLE);
-#endif
-
-  simgrid::mc::RegionSnapshot region(region_type, start_addr, permanent_addr, size);
-  region.flat_data(std::move(data));
-
-  XBT_DEBUG("New region : type : %s, data : %p (real addr %p), size : %zu", to_cstr(region_type),
-            region.flat_data().get(), permanent_addr, size);
-  return region;
-}
-
-/** @brief Take a snapshot of a given region
- *
- * @param type
- * @param start_addr   Address of the region in the simulated process
- * @param permanent_addr Permanent address of this data (for privatized variables, this is the virtual address of the
- * privatized mapping)
- * @param size         Size of the data*
- */
-RegionSnapshot region(RegionType type, void* start_addr, void* permanent_addr, size_t size)
-{
-  if (_sg_mc_sparse_checkpoint)
-    return sparse_region(type, start_addr, permanent_addr, size);
-  else
-    return dense_region(type, start_addr, permanent_addr, size);
-}
-
-RegionSnapshot sparse_region(RegionType region_type, void* start_addr, void* permanent_addr, size_t size)
-{
-  simgrid::mc::RemoteClient* process = &mc_model_checker->process();
-  assert(process != nullptr);
-
-  xbt_assert((((uintptr_t)start_addr) & (xbt_pagesize - 1)) == 0, "Not at the beginning of a page");
-  xbt_assert((((uintptr_t)permanent_addr) & (xbt_pagesize - 1)) == 0, "Not at the beginning of a page");
-  size_t page_count = simgrid::mc::mmu::chunkCount(size);
-
-  simgrid::mc::ChunkedData page_data(mc_model_checker->page_store(), *process, RemotePtr<void>(permanent_addr),
-                                     page_count);
-
-  simgrid::mc::RegionSnapshot region(region_type, start_addr, permanent_addr, size);
-  region.page_data(std::move(page_data));
-  return region;
-}
-
-} // namespace mc
-} // namespace simgrid
diff --git a/src/mc/sosp/RegionSnapshot.hpp b/src/mc/sosp/RegionSnapshot.hpp
deleted file mode 100644 (file)
index d1011af..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
-
-/* This program 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_REGION_SNAPSHOT_HPP
-#define SIMGRID_MC_REGION_SNAPSHOT_HPP
-
-#include <cstddef>
-#include <utility>
-
-#include <memory>
-#include <vector>
-
-#include "xbt/base.h"
-
-#include "src/mc/AddressSpace.hpp"
-#include "src/mc/remote/RemotePtr.hpp"
-#include "src/mc/sosp/ChunkedData.hpp"
-#include "src/mc/sosp/PageStore.hpp"
-
-namespace simgrid {
-namespace mc {
-
-enum class RegionType { Unknown = 0, Heap = 1, Data = 2 };
-
-enum class StorageType { NoData = 0, Flat = 1, Chunked = 2, Privatized = 3 };
-
-class Buffer {
-private:
-  enum class Type { Malloc, Mmap };
-  void* data_ = nullptr;
-  std::size_t size_;
-  Type type_ = Type::Malloc;
-
-  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) {}
-
-public:
-  Buffer() = default;
-  void clear() noexcept;
-  ~Buffer() noexcept { clear(); }
-
-  static Buffer malloc(std::size_t size) { return Buffer(size, Type::Malloc); }
-  static Buffer mmap(std::size_t size) { return Buffer(size, Type::Mmap); }
-
-  // No copy
-  Buffer(Buffer const& buffer) = delete;
-  Buffer& operator=(Buffer const& buffer) = delete;
-
-  // Move
-  Buffer(Buffer&& that) noexcept : data_(that.data_), size_(that.size_), type_(that.type_)
-  {
-    that.data_ = nullptr;
-    that.size_ = 0;
-    that.type_ = Type::Malloc;
-  }
-  Buffer& operator=(Buffer&& that) noexcept
-  {
-    clear();
-    data_      = that.data_;
-    size_      = that.size_;
-    type_      = that.type_;
-    that.data_ = nullptr;
-    that.size_ = 0;
-    that.type_ = Type::Malloc;
-    return *this;
-  }
-
-  void* get() { return data_; }
-  const void* get() const { return data_; }
-  std::size_t size() const { return size_; }
-};
-
-/** A copy/snapshot of a given memory region
- *
- *  Different types of region snapshot storage types exist:
- *
- *  * flat/dense snapshots are a simple copy of the region;
- *
- *  * sparse/per-page snapshots are snaapshots which shared
- *    identical pages.
- *
- *  * privatized (SMPI global variable privatization).
- *
- *  This is handled with a variant based approach:
- *
- *  * `storage_type` identified the type of storage;
- *
- *  * an anonymous enum is used to distinguish the relevant types for
- *    each type.
- */
-class RegionSnapshot {
-public:
-  static const RegionType UnknownRegion = RegionType::Unknown;
-  static const RegionType HeapRegion    = RegionType::Heap;
-  static const RegionType DataRegion    = RegionType::Data;
-
-private:
-  RegionType region_type_;
-  StorageType storage_type_;
-  simgrid::mc::ObjectInformation* object_info_;
-
-  /** @brief  Virtual address of the region in the simulated process */
-  void* start_addr_;
-
-  /** @brief Size of the data region in bytes */
-  std::size_t size_;
-
-  /** @brief Permanent virtual address of the region
-   *
-   * This is usually the same address as the simuilated process address.
-   * However, when using SMPI privatization of global variables,
-   * each SMPI process has its own set of global variables stored
-   * at a different virtual address. The scheduler maps those region
-   * on the region of the global variables.
-   *
-   * */
-  void* permanent_addr_;
-
-  Buffer flat_data_;
-  ChunkedData page_numbers_;
-  std::vector<RegionSnapshot> privatized_regions_;
-
-public:
-  RegionSnapshot()
-      : region_type_(UnknownRegion)
-      , storage_type_(StorageType::NoData)
-      , object_info_(nullptr)
-      , start_addr_(nullptr)
-      , size_(0)
-      , permanent_addr_(nullptr)
-  {
-  }
-  RegionSnapshot(RegionType type, void* start_addr, void* permanent_addr, size_t size)
-      : region_type_(type)
-      , storage_type_(StorageType::NoData)
-      , object_info_(nullptr)
-      , start_addr_(start_addr)
-      , size_(size)
-      , permanent_addr_(permanent_addr)
-  {
-  }
-  ~RegionSnapshot()                     = default;
-  RegionSnapshot(RegionSnapshot const&) = delete;
-  RegionSnapshot& operator=(RegionSnapshot const&) = delete;
-  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_))
-  {
-    that.clear();
-  }
-  RegionSnapshot& operator=(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_);
-    that.clear();
-    return *this;
-  }
-
-  // Data
-
-  void clear()
-  {
-    region_type_  = UnknownRegion;
-    storage_type_ = StorageType::NoData;
-    privatized_regions_.clear();
-    page_numbers_.clear();
-    flat_data_.clear();
-    object_info_    = nullptr;
-    start_addr_     = nullptr;
-    size_           = 0;
-    permanent_addr_ = nullptr;
-  }
-
-  void clear_data()
-  {
-    storage_type_ = StorageType::NoData;
-    flat_data_.clear();
-    page_numbers_.clear();
-    privatized_regions_.clear();
-  }
-
-  void flat_data(Buffer data)
-  {
-    storage_type_ = StorageType::Flat;
-    flat_data_    = std::move(data);
-    page_numbers_.clear();
-    privatized_regions_.clear();
-  }
-  const Buffer& flat_data() const { return flat_data_; }
-  Buffer& flat_data() { return flat_data_; }
-
-  void page_data(ChunkedData&& page_data)
-  {
-    storage_type_ = StorageType::Chunked;
-    flat_data_.clear();
-    page_numbers_ = std::move(page_data);
-    privatized_regions_.clear();
-  }
-  ChunkedData const& page_data() const { return page_numbers_; }
-
-  void privatized_data(std::vector<RegionSnapshot> data)
-  {
-    storage_type_ = StorageType::Privatized;
-    flat_data_.clear();
-    page_numbers_.clear();
-    privatized_regions_ = std::move(data);
-  }
-  std::vector<RegionSnapshot> const& privatized_data() const { return privatized_regions_; }
-  std::vector<RegionSnapshot>& privatized_data() { return privatized_regions_; }
-
-  simgrid::mc::ObjectInformation* object_info() const { return object_info_; }
-  void object_info(simgrid::mc::ObjectInformation* info) { object_info_ = info; }
-
-  // Other getters
-
-  RemotePtr<void> start() const { return remote(start_addr_); }
-  RemotePtr<void> end() const { return remote((char*)start_addr_ + size_); }
-  RemotePtr<void> permanent_address() const { return remote(permanent_addr_); }
-  std::size_t size() const { return size_; }
-  StorageType storage_type() const { return storage_type_; }
-  RegionType region_type() const { return region_type_; }
-
-  bool contain(RemotePtr<void> p) const { return p >= start() && p < end(); }
-};
-
-RegionSnapshot privatized_region(RegionType region_type, void* start_addr, void* permanent_addr, std::size_t size);
-RegionSnapshot dense_region(RegionType type, void* start_addr, void* data_addr, std::size_t size);
-simgrid::mc::RegionSnapshot sparse_region(RegionType type, void* start_addr, void* data_addr, std::size_t size);
-simgrid::mc::RegionSnapshot region(RegionType type, void* start_addr, void* data_addr, std::size_t size);
-
-} // namespace mc
-} // namespace simgrid
-
-typedef simgrid::mc::RegionSnapshot s_mc_mem_region_t;
-typedef s_mc_mem_region_t* mc_mem_region_t;
-#endif
diff --git a/src/mc/sosp/Snapshot.cpp b/src/mc/sosp/Snapshot.cpp
new file mode 100644 (file)
index 0000000..bc32ba6
--- /dev/null
@@ -0,0 +1,294 @@
+/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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/sosp/Snapshot.hpp"
+#include "src/mc/mc_config.hpp"
+#include "src/mc/mc_hash.hpp"
+#include "src/mc/mc_smx.hpp"
+
+#include <cstddef> /* std::size_t */
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_snapshot, mc, "Taking and restoring snapshots");
+namespace simgrid {
+namespace mc {
+/************************************* Take Snapshot ************************************/
+/****************************************************************************************/
+
+void simgrid::mc::Snapshot::snapshot_regions(simgrid::mc::RemoteClient* process)
+{
+  snapshot_regions_.clear();
+
+  for (auto const& object_info : process->object_infos)
+    add_region(simgrid::mc::RegionType::Data, object_info.get(), object_info->start_rw,
+               object_info->end_rw - object_info->start_rw);
+
+  xbt_mheap_t heap = process->get_heap();
+  void* start_heap = heap->base;
+  void* end_heap   = heap->breakval;
+
+  add_region(simgrid::mc::RegionType::Heap, nullptr, start_heap, (char*)end_heap - (char*)start_heap);
+  heap_bytes_used_ = mmalloc_get_bytes_used_remote(heap->heaplimit, process->get_malloc_info());
+}
+
+/** @brief Checks whether the variable is in scope for a given IP.
+ *
+ *  A variable may be defined only from a given value of IP.
+ *
+ *  @param var   Variable description
+ *  @param scope Scope description
+ *  @param ip    Instruction pointer
+ *  @return      true if the variable is valid
+ * */
+static bool valid_variable(simgrid::mc::Variable* var, simgrid::mc::Frame* scope, const void* ip)
+{
+  // The variable is not yet valid:
+  if (scope->range.begin() + var->start_scope > (std::uint64_t)ip)
+    return false;
+  else
+    return true;
+}
+
+static void fill_local_variables_values(mc_stack_frame_t stack_frame, simgrid::mc::Frame* scope,
+                                        std::vector<s_local_variable_t>& result)
+{
+  if (not scope || not scope->range.contain(stack_frame->ip))
+    return;
+
+  for (simgrid::mc::Variable& current_variable : scope->variables) {
+
+    if (not valid_variable(&current_variable, scope, (void*)stack_frame->ip))
+      continue;
+
+    s_local_variable_t new_var;
+    new_var.subprogram = stack_frame->frame;
+    new_var.ip         = stack_frame->ip;
+    new_var.name       = current_variable.name;
+    new_var.type       = current_variable.type;
+    new_var.address    = nullptr;
+
+    if (current_variable.address != nullptr)
+      new_var.address = current_variable.address;
+    else if (not current_variable.location_list.empty()) {
+      simgrid::dwarf::Location location = simgrid::dwarf::resolve(
+          current_variable.location_list, current_variable.object_info, &(stack_frame->unw_cursor),
+          (void*)stack_frame->frame_base, &mc_model_checker->process());
+
+      if (not location.in_memory())
+        xbt_die("Cannot handle non-address variable");
+      new_var.address = location.address();
+
+    } else
+      xbt_die("No address");
+
+    result.push_back(std::move(new_var));
+  }
+
+  // Recursive processing of nested scopes:
+  for (simgrid::mc::Frame& nested_scope : scope->scopes)
+    fill_local_variables_values(stack_frame, &nested_scope, result);
+}
+
+static std::vector<s_local_variable_t> get_local_variables_values(std::vector<s_mc_stack_frame_t>& stack_frames)
+{
+  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, variables);
+  return variables;
+}
+
+static std::vector<s_mc_stack_frame_t> unwind_stack_frames(simgrid::mc::UnwindContext* stack_context)
+{
+  simgrid::mc::RemoteClient* process = &mc_model_checker->process();
+  std::vector<s_mc_stack_frame_t> result;
+
+  unw_cursor_t c = stack_context->cursor();
+
+  // TODO, check condition check (unw_init_local==0 means end of frame)
+
+  while (1) {
+
+    s_mc_stack_frame_t stack_frame;
+
+    stack_frame.unw_cursor = c;
+
+    unw_word_t ip;
+    unw_word_t sp;
+
+    unw_get_reg(&c, UNW_REG_IP, &ip);
+    unw_get_reg(&c, UNW_REG_SP, &sp);
+
+    stack_frame.ip = ip;
+    stack_frame.sp = sp;
+
+    // TODO, use real addresses in frame_t instead of fixing it here
+
+    simgrid::mc::Frame* frame = process->find_function(remote(ip));
+    stack_frame.frame         = frame;
+
+    if (frame) {
+      stack_frame.frame_name = frame->name;
+      stack_frame.frame_base = (unw_word_t)frame->frame_base(c);
+    } else {
+      stack_frame.frame_base = 0;
+      stack_frame.frame_name = std::string();
+    }
+
+    result.push_back(std::move(stack_frame));
+
+    /* Stop before context switch with maestro */
+    if (frame != nullptr && frame->name == "smx_ctx_wrapper")
+      break;
+
+    int ret = unw_step(&c);
+    if (ret == 0)
+      xbt_die("Unexpected end of stack.");
+    else if (ret < 0)
+      xbt_die("Error while unwinding stack");
+  }
+
+  xbt_assert(not result.empty(), "unw_init_local failed");
+
+  return result;
+}
+
+void simgrid::mc::Snapshot::snapshot_stacks(simgrid::mc::RemoteClient* process)
+{
+  for (auto const& stack : process->stack_areas()) {
+    s_mc_snapshot_stack_t st;
+
+    // Read the context from remote process:
+    unw_context_t context;
+    process->read_bytes(&context, sizeof(context), remote(stack.context));
+
+    st.context.initialize(process, &context);
+
+    st.stack_frames    = unwind_stack_frames(&st.context);
+    st.local_variables = get_local_variables_values(st.stack_frames);
+
+    unw_word_t sp = st.stack_frames[0].sp;
+
+    stacks_.push_back(std::move(st));
+
+    size_t stack_size = (char*)stack.address + stack.size - (char*)sp;
+    stack_sizes_.push_back(stack_size);
+  }
+}
+
+static void snapshot_handle_ignore(simgrid::mc::Snapshot* snapshot)
+{
+  xbt_assert(snapshot->process());
+
+  // Copy the memory:
+  for (auto const& region : snapshot->process()->ignored_regions()) {
+    s_mc_snapshot_ignored_data_t ignored_data;
+    ignored_data.start = (void*)region.addr;
+    ignored_data.data.resize(region.size);
+    // TODO, we should do this once per privatization segment:
+    snapshot->process()->read_bytes(ignored_data.data.data(), region.size, remote(region.addr));
+    snapshot->ignored_data_.push_back(std::move(ignored_data));
+  }
+
+  // Zero the memory:
+  for (auto const& region : snapshot->process()->ignored_regions())
+    snapshot->process()->clear_bytes(remote(region.addr), region.size);
+}
+static void snapshot_ignore_restore(simgrid::mc::Snapshot* snapshot)
+{
+  for (auto const& ignored_data : snapshot->ignored_data_)
+    snapshot->process()->write_bytes(ignored_data.data.data(), ignored_data.data.size(), remote(ignored_data.start));
+}
+
+Snapshot::Snapshot(int num_state, RemoteClient* process)
+    : AddressSpace(process), num_state_(num_state), heap_bytes_used_(0), enabled_processes_(), hash_(0)
+{
+  XBT_DEBUG("Taking snapshot %i", num_state);
+
+  for (auto const& p : process->actors())
+    enabled_processes_.insert(p.copy.get_buffer()->get_pid());
+
+  snapshot_handle_ignore(this);
+
+  /* Save the std heap and the writable mapped pages of libsimgrid and binary */
+  snapshot_regions(process);
+
+  to_ignore_ = process->ignored_heap();
+
+  if (_sg_mc_max_visited_states > 0 || not _sg_mc_property_file.get().empty()) {
+    snapshot_stacks(process);
+    hash_ = simgrid::mc::hash(*this);
+  }
+
+  snapshot_ignore_restore(this);
+}
+
+void Snapshot::add_region(RegionType type, ObjectInformation* object_info, void* start_addr, std::size_t size)
+{
+  if (type == simgrid::mc::RegionType::Data)
+    xbt_assert(object_info, "Missing object info for object.");
+  else if (type == simgrid::mc::RegionType::Heap)
+    xbt_assert(not object_info, "Unexpected object info for heap region.");
+
+  simgrid::mc::Region* region = new Region(type, start_addr, size);
+  region->object_info(object_info);
+  snapshot_regions_.push_back(std::unique_ptr<simgrid::mc::Region>(std::move(region)));
+}
+
+void* Snapshot::read_bytes(void* buffer, std::size_t size, RemotePtr<void> address, ReadOptions options) const
+{
+  Region* region = this->get_region((void*)address.address());
+  if (region) {
+    void* res = region->read(buffer, (void*)address.address(), size);
+    if (buffer == res || options & ReadOptions::lazy())
+      return res;
+    else {
+      memcpy(buffer, res, size);
+      return buffer;
+    }
+  } else
+    return this->process()->read_bytes(buffer, size, address, options);
+}
+/** @brief Find the snapshoted region from a pointer
+ *
+ *  @param addr     Pointer
+ * */
+Region* Snapshot::get_region(const void* addr) const
+{
+  size_t n = snapshot_regions_.size();
+  for (size_t i = 0; i != n; ++i) {
+    Region* region = snapshot_regions_[i].get();
+    if (not(region && region->contain(simgrid::mc::remote(addr))))
+      continue;
+
+    return region;
+  }
+
+  return nullptr;
+}
+
+/** @brief Find the snapshoted region from a pointer, with a hinted_region */
+Region* Snapshot::get_region(const void* addr, Region* hinted_region) const
+{
+  if (hinted_region->contain(simgrid::mc::remote(addr)))
+    return hinted_region;
+  else
+    return get_region(addr);
+}
+
+void Snapshot::restore(RemoteClient* process)
+{
+  XBT_DEBUG("Restore snapshot %i", num_state_);
+
+  // Restore regions
+  for (std::unique_ptr<simgrid::mc::Region> const& region : snapshot_regions_) {
+    if (region) // privatized variables are not snapshoted
+      region.get()->restore();
+  }
+
+  snapshot_ignore_restore(this);
+  process->clear_cache();
+}
+
+} // namespace mc
+} // namespace simgrid
diff --git a/src/mc/sosp/Snapshot.hpp b/src/mc/sosp/Snapshot.hpp
new file mode 100644 (file)
index 0000000..f227fe7
--- /dev/null
@@ -0,0 +1,98 @@
+/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program 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_HPP
+#define SIMGRID_MC_SNAPSHOT_HPP
+
+#include "src/mc/ModelChecker.hpp"
+#include "src/mc/inspect/mc_unw.hpp"
+#include "src/mc/remote/RemoteClient.hpp"
+#include "src/mc/sosp/Region.hpp"
+
+// ***** MC Snapshot
+
+/** Ignored data
+ *
+ *  Some parts of the snapshot are ignored by zeroing them out: the real
+ *  values is stored here.
+ * */
+struct s_mc_snapshot_ignored_data_t {
+  void* start;
+  std::vector<char> data;
+};
+
+/** Information about a given stack frame */
+struct s_mc_stack_frame_t {
+  /** Instruction pointer */
+  unw_word_t ip;
+  /** Stack pointer */
+  unw_word_t sp;
+  unw_word_t frame_base;
+  simgrid::mc::Frame* frame;
+  std::string frame_name;
+  unw_cursor_t unw_cursor;
+};
+typedef s_mc_stack_frame_t* mc_stack_frame_t;
+
+struct s_local_variable_t {
+  simgrid::mc::Frame* subprogram;
+  unsigned long ip;
+  std::string name;
+  simgrid::mc::Type* type;
+  void* address;
+};
+typedef s_local_variable_t* local_variable_t;
+typedef const s_local_variable_t* const_local_variable_t;
+
+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;
+};
+typedef s_mc_snapshot_stack_t* mc_snapshot_stack_t;
+typedef const s_mc_snapshot_stack_t* const_mc_snapshot_stack_t;
+
+namespace simgrid {
+namespace mc {
+
+class XBT_PRIVATE Snapshot final : public AddressSpace {
+public:
+  /* Initialization */
+  Snapshot(int num_state, RemoteClient* process = &mc_model_checker->process());
+  ~Snapshot() = default;
+
+  /* Regular use */
+  bool on_heap(const void* address) const
+  {
+    const xbt_mheap_t heap = process()->get_heap();
+    return address >= heap->heapbase && address < heap->breakval;
+  }
+
+  void* read_bytes(void* buffer, std::size_t size, RemotePtr<void> address,
+                   ReadOptions options = ReadOptions::none()) const override;
+  Region* get_region(const void* addr) const;
+  Region* get_region(const void* addr, Region* hinted_region) const;
+  void restore(RemoteClient* process);
+
+  // To be private
+  int num_state_;
+  std::size_t heap_bytes_used_;
+  std::vector<std::unique_ptr<Region>> snapshot_regions_;
+  std::set<pid_t> enabled_processes_;
+  std::vector<std::size_t> stack_sizes_;
+  std::vector<s_mc_snapshot_stack_t> stacks_;
+  std::vector<simgrid::mc::IgnoredHeapRegion> to_ignore_;
+  std::uint64_t hash_ = 0;
+  std::vector<s_mc_snapshot_ignored_data_t> ignored_data_;
+
+private:
+  void add_region(RegionType type, ObjectInformation* object_info, void* start_addr, std::size_t size);
+  void snapshot_regions(simgrid::mc::RemoteClient* process);
+  void snapshot_stacks(simgrid::mc::RemoteClient* process);
+};
+} // namespace mc
+} // namespace simgrid
+
+#endif
similarity index 75%
rename from src/mc/sosp/mc_snapshot_test.cpp
rename to src/mc/sosp/Snapshot_test.cpp
index ef1591c..cadb7bd 100644 (file)
@@ -4,30 +4,25 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/include/catch.hpp"
+#include "src/mc/mc_config.hpp"
+#include "src/mc/sosp/Snapshot.hpp"
 
-#include <cstdlib>
-#include <cstring>
+#include <cstddef>
 #include <random>
-
 #include <sys/mman.h>
 
-#include "src/mc/mc_config.hpp"
-#include "src/mc/mc_mmu.hpp"
-#include "src/mc/mc_private.hpp"
-#include "src/mc/sosp/mc_snapshot.hpp"
-
 /**************** Class BOOST_tests *************************/
-using simgrid::mc::RegionSnapshot;
+using simgrid::mc::Region;
 class snap_test_helper {
 public:
   static void init_memory(void* mem, size_t size);
-  static void Init(bool sparse_ckpt);
+  static void Init();
   typedef struct {
     size_t size;
     void* src;
     void* dstn;
-    RegionSnapshot region0;
-    RegionSnapshot region;
+    Region* region0;
+    Region* region;
   } prologue_return;
   static prologue_return prologue(int n); // common to the below 5 fxs
   static void read_whole_region();
@@ -43,13 +38,11 @@ public:
   }
 
   static std::default_random_engine rnd_engine;
-  static bool sparse_checkpoint;
   static std::unique_ptr<simgrid::mc::RemoteClient> process;
 };
 
 // static member variables init.
 std::default_random_engine snap_test_helper::rnd_engine;
-bool snap_test_helper::sparse_checkpoint                             = 0;
 std::unique_ptr<simgrid::mc::RemoteClient> snap_test_helper::process = nullptr;
 
 void snap_test_helper::init_memory(void* mem, size_t size)
@@ -60,9 +53,8 @@ void snap_test_helper::init_memory(void* mem, size_t size)
   }
 }
 
-void snap_test_helper::Init(bool sparse_ckpt)
+void snap_test_helper::Init()
 {
-  _sg_mc_sparse_checkpoint = sparse_ckpt;
   REQUIRE(xbt_pagesize == getpagesize());
   REQUIRE(1 << xbt_pagebits == xbt_pagesize);
 
@@ -81,13 +73,11 @@ snap_test_helper::prologue_return snap_test_helper::prologue(int n)
 
   // Init memory and take snapshots:
   init_memory(source, byte_size);
-  simgrid::mc::RegionSnapshot region0 =
-      simgrid::mc::sparse_region(simgrid::mc::RegionType::Unknown, source, source, byte_size);
+  simgrid::mc::Region* region0 = new simgrid::mc::Region(simgrid::mc::RegionType::Data, source, byte_size);
   for (int i = 0; i < n; i += 2) {
     init_memory((char*)source + i * xbt_pagesize, xbt_pagesize);
   }
-  simgrid::mc::RegionSnapshot region =
-      simgrid::mc::sparse_region(simgrid::mc::RegionType::Unknown, source, source, byte_size);
+  simgrid::mc::Region* region = new simgrid::mc::Region(simgrid::mc::RegionType::Data, source, byte_size);
 
   void* destination = mmap(nullptr, byte_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
   INFO("Could not allocate destination memory");
@@ -105,12 +95,14 @@ void snap_test_helper::read_whole_region()
   for (int n = 1; n != 32; ++n) {
 
     prologue_return ret = prologue(n);
-    const void* read    = MC_region_read(&(ret.region), ret.dstn, ret.src, ret.size);
+    const void* read    = ret.region->read(ret.dstn, ret.src, ret.size);
     INFO("Mismatch in MC_region_read()");
     REQUIRE(not memcmp(ret.src, read, ret.size));
 
     munmap(ret.dstn, ret.size);
     munmap(ret.src, ret.size);
+    delete ret.region0;
+    delete ret.region;
   }
 }
 
@@ -123,12 +115,14 @@ void snap_test_helper::read_region_parts()
     for (int j = 0; j != 100; ++j) {
       size_t offset    = rnd_engine() % ret.size;
       size_t size      = rnd_engine() % (ret.size - offset);
-      const void* read = MC_region_read(&(ret.region), ret.dstn, (const char*)ret.src + offset, size);
+      const void* read = ret.region->read(ret.dstn, (const char*)ret.src + offset, size);
       INFO("Mismatch in MC_region_read()");
       REQUIRE(not memcmp((char*)ret.src + offset, read, size));
     }
     munmap(ret.dstn, ret.size);
     munmap(ret.src, ret.size);
+    delete ret.region0;
+    delete ret.region;
   }
 }
 
@@ -139,10 +133,12 @@ void snap_test_helper::compare_whole_region()
     prologue_return ret = prologue(n);
 
     INFO("Unexpected match in MC_snapshot_region_memcmp() with previous snapshot");
-    REQUIRE(MC_snapshot_region_memcmp(ret.src, &(ret.region0), ret.src, &(ret.region), ret.size));
+    REQUIRE(MC_snapshot_region_memcmp(ret.src, ret.region0, ret.src, ret.region, ret.size));
 
     munmap(ret.dstn, ret.size);
     munmap(ret.src, ret.size);
+    delete ret.region0;
+    delete ret.region;
   }
 }
 
@@ -157,11 +153,13 @@ void snap_test_helper::compare_region_parts()
       size_t size   = rnd_engine() % (ret.size - offset);
 
       INFO("Mismatch in MC_snapshot_region_memcmp()");
-      REQUIRE(not MC_snapshot_region_memcmp((char*)ret.src + offset, &(ret.region), (char*)ret.src + offset,
-                                            &(ret.region), size));
+      REQUIRE(not MC_snapshot_region_memcmp((char*)ret.src + offset, ret.region, (char*)ret.src + offset, ret.region,
+                                            size));
     }
     munmap(ret.dstn, ret.size);
     munmap(ret.src, ret.size);
+    delete ret.region0;
+    delete ret.region;
   }
 }
 
@@ -170,28 +168,25 @@ void snap_test_helper::read_pointer()
 
   prologue_return ret = prologue(1);
   memcpy(ret.src, &mc_model_checker, sizeof(void*));
-  simgrid::mc::RegionSnapshot region2 =
-      simgrid::mc::sparse_region(simgrid::mc::RegionType::Unknown, ret.src, ret.src, ret.size);
+  simgrid::mc::Region* region2 = new simgrid::mc::Region(simgrid::mc::RegionType::Data, ret.src, ret.size);
   INFO("Mismtach in MC_region_read_pointer()");
-  REQUIRE(MC_region_read_pointer(&region2, ret.src) == mc_model_checker);
+  REQUIRE(MC_region_read_pointer(region2, ret.src) == mc_model_checker);
 
   munmap(ret.dstn, ret.size);
   munmap(ret.src, ret.size);
+  delete ret.region0;
+  delete ret.region;
+  delete region2;
 }
 
 /*************** End: class snap_test_helper *****************************/
 
 TEST_CASE("MC::Snapshot: A copy/snapshot of a given memory region", "MC::Snapshot")
 {
-  auto sparse = GENERATE(false, true);
 
-  if (sparse) {
-    INFO("Sparse snapshot (using pages)");
-  } else {
-    INFO("Flat snapshot (no pages)");
-  }
+  INFO("Sparse snapshot (using pages)");
 
-  snap_test_helper::Init(sparse);
+  snap_test_helper::Init();
 
   INFO("Read whole region");
   snap_test_helper::read_whole_region();
diff --git a/src/mc/sosp/mc_checkpoint.cpp b/src/mc/sosp/mc_checkpoint.cpp
deleted file mode 100644 (file)
index 26e07f5..0000000
+++ /dev/null
@@ -1,578 +0,0 @@
-/* Copyright (c) 2008-2019. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include <unistd.h>
-
-#include <cstring>
-#include <dirent.h>
-#include <fcntl.h>
-#include <link.h>
-
-#ifndef WIN32
-#include <sys/mman.h>
-#endif
-
-#include "src/internal_config.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.hpp"
-
-#include <libelf.h>
-#include <libunwind.h>
-
-#include "src/mc/mc_private.hpp"
-#include <mc/mc.h>
-
-#include "src/mc/mc_config.hpp"
-#include "src/mc/mc_hash.hpp"
-#include "src/mc/mc_mmu.hpp"
-#include "src/mc/mc_smx.hpp"
-#include "src/mc/mc_unw.hpp"
-#include "src/mc/remote/mc_protocol.h"
-#include "src/mc/sosp/mc_snapshot.hpp"
-
-#include "src/mc/Frame.hpp"
-#include "src/mc/ObjectInformation.hpp"
-#include "src/mc/Variable.hpp"
-#include "src/mc/sosp/RegionSnapshot.hpp"
-
-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)
-
-namespace simgrid {
-namespace mc {
-
-/************************************  Free functions **************************************/
-/*****************************************************************************************/
-
-/** @brief Restore a region from a snapshot
- *
- *  @param region     Target region
- */
-static void restore(mc_mem_region_t region)
-{
-  switch (region->storage_type()) {
-    case simgrid::mc::StorageType::Flat:
-      mc_model_checker->process().write_bytes(region->flat_data().get(), region->size(), region->permanent_address());
-      break;
-
-    case simgrid::mc::StorageType::Chunked:
-      mc_region_restore_sparse(&mc_model_checker->process(), region);
-      break;
-
-    case simgrid::mc::StorageType::Privatized:
-      for (auto& p : region->privatized_data())
-        restore(&p);
-      break;
-
-    default: // includes StorageType::NoData
-      xbt_die("Storage type not supported");
-      break;
-  }
-}
-
-#if HAVE_SMPI
-RegionSnapshot privatized_region(RegionType region_type, void* start_addr, void* permanent_addr, std::size_t size)
-{
-  size_t process_count = MC_smpi_process_count();
-
-  // Read smpi_privatization_regions from MCed:
-  smpi_privatization_region_t remote_smpi_privatization_regions;
-  mc_model_checker->process().read_variable("smpi_privatization_regions", &remote_smpi_privatization_regions,
-                                            sizeof(remote_smpi_privatization_regions));
-  s_smpi_privatization_region_t privatization_regions[process_count];
-  mc_model_checker->process().read_bytes(&privatization_regions, sizeof(privatization_regions),
-                                         remote(remote_smpi_privatization_regions));
-
-  std::vector<simgrid::mc::RegionSnapshot> data;
-  data.reserve(process_count);
-  for (size_t i = 0; i < process_count; i++)
-    data.push_back(simgrid::mc::region(region_type, start_addr, privatization_regions[i].address, size));
-
-  simgrid::mc::RegionSnapshot region = simgrid::mc::RegionSnapshot(region_type, start_addr, permanent_addr, size);
-  region.privatized_data(std::move(data));
-  return region;
-}
-#endif
-
-static void add_region(int index, simgrid::mc::Snapshot* snapshot, simgrid::mc::RegionType type,
-                       simgrid::mc::ObjectInformation* object_info, void* start_addr, void* permanent_addr,
-                       std::size_t size)
-{
-  if (type == simgrid::mc::RegionType::Data)
-    xbt_assert(object_info, "Missing object info for object.");
-  else if (type == simgrid::mc::RegionType::Heap)
-    xbt_assert(not object_info, "Unexpected object info for heap region.");
-
-  simgrid::mc::RegionSnapshot region;
-#if HAVE_SMPI
-  const bool privatization_aware = object_info && mc_model_checker->process().privatized(*object_info);
-  if (privatization_aware && MC_smpi_process_count())
-    region = simgrid::mc::privatized_region(type, start_addr, permanent_addr, size);
-  else
-#endif
-    region = simgrid::mc::region(type, start_addr, permanent_addr, size);
-
-  region.object_info(object_info);
-  snapshot->snapshot_regions[index] =
-      std::unique_ptr<simgrid::mc::RegionSnapshot>(new simgrid::mc::RegionSnapshot(std::move(region)));
-}
-
-static void get_memory_regions(simgrid::mc::RemoteClient* process, simgrid::mc::Snapshot* snapshot)
-{
-  const size_t n = process->object_infos.size();
-  snapshot->snapshot_regions.resize(n + 1);
-  int i = 0;
-  for (auto const& object_info : process->object_infos)
-    add_region(i++, snapshot, simgrid::mc::RegionType::Data, object_info.get(), object_info->start_rw,
-               object_info->start_rw, object_info->end_rw - object_info->start_rw);
-
-  xbt_mheap_t heap = process->get_heap();
-  void* start_heap = heap->base;
-  void* end_heap   = heap->breakval;
-
-  add_region(n, snapshot, simgrid::mc::RegionType::Heap, nullptr, start_heap, start_heap,
-             (char*)end_heap - (char*)start_heap);
-  snapshot->heap_bytes_used = mmalloc_get_bytes_used_remote(heap->heaplimit, process->get_malloc_info());
-
-#if HAVE_SMPI
-  if (mc_model_checker->process().privatized() && MC_smpi_process_count())
-    // snapshot->privatization_index = smpi_loaded_page
-    mc_model_checker->process().read_variable("smpi_loaded_page", &snapshot->privatization_index,
-                                              sizeof(snapshot->privatization_index));
-  else
-#endif
-    snapshot->privatization_index = simgrid::mc::ProcessIndexMissing;
-}
-
-/** @brief Fills the position of the segments (executable, read-only, read/write).
- * */
-// TODO, use the ELF segment information for more robustness
-void find_object_address(std::vector<simgrid::xbt::VmMap> const& maps, simgrid::mc::ObjectInformation* result)
-{
-  std::string name = simgrid::xbt::Path(result->file_name).get_base_name();
-
-  for (size_t i = 0; i < maps.size(); ++i) {
-    simgrid::xbt::VmMap const& reg = maps[i];
-    if (maps[i].pathname.empty())
-      continue;
-    std::string map_basename = simgrid::xbt::Path(maps[i].pathname).get_base_name();
-    if (map_basename != name)
-      continue;
-
-    // This is the non-GNU_RELRO-part of the data segment:
-    if (reg.prot == PROT_RW) {
-      xbt_assert(not result->start_rw, "Multiple read-write segments for %s, not supported", maps[i].pathname.c_str());
-      result->start_rw = (char*)reg.start_addr;
-      result->end_rw   = (char*)reg.end_addr;
-
-      // The next VMA might be end of the data segment:
-      if (i + 1 < maps.size() && maps[i + 1].pathname.empty() && maps[i + 1].prot == PROT_RW &&
-          maps[i + 1].start_addr == reg.end_addr)
-        result->end_rw = (char*)maps[i + 1].end_addr;
-    }
-
-    // This is the text segment:
-    else if (reg.prot == PROT_RX) {
-      xbt_assert(not result->start_exec, "Multiple executable segments for %s, not supported",
-                 maps[i].pathname.c_str());
-      result->start_exec = (char*)reg.start_addr;
-      result->end_exec   = (char*)reg.end_addr;
-
-      // The next VMA might be end of the data segment:
-      if (i + 1 < maps.size() && maps[i + 1].pathname.empty() && maps[i + 1].prot == PROT_RW &&
-          maps[i + 1].start_addr == reg.end_addr) {
-        result->start_rw = (char*)maps[i + 1].start_addr;
-        result->end_rw   = (char*)maps[i + 1].end_addr;
-      }
-    }
-
-    // This is the GNU_RELRO-part of the data segment:
-    else if (reg.prot == PROT_READ) {
-      xbt_assert(not result->start_ro, "Multiple read only segments for %s, not supported", maps[i].pathname.c_str());
-      result->start_ro = (char*)reg.start_addr;
-      result->end_ro   = (char*)reg.end_addr;
-    }
-  }
-
-  result->start = result->start_rw;
-  if ((const void*)result->start_ro < result->start)
-    result->start = result->start_ro;
-  if ((const void*)result->start_exec < result->start)
-    result->start = result->start_exec;
-
-  result->end = result->end_rw;
-  if (result->end_ro && (const void*)result->end_ro > result->end)
-    result->end = result->end_ro;
-  if (result->end_exec && (const void*)result->end_exec > result->end)
-    result->end = result->end_exec;
-
-  xbt_assert(result->start_exec || result->start_rw || result->start_ro);
-}
-
-/************************************* Take Snapshot ************************************/
-/****************************************************************************************/
-
-/** @brief Checks whether the variable is in scope for a given IP.
- *
- *  A variable may be defined only from a given value of IP.
- *
- *  @param var   Variable description
- *  @param scope Scope description
- *  @param ip    Instruction pointer
- *  @return      true if the variable is valid
- * */
-static bool valid_variable(simgrid::mc::Variable* var, simgrid::mc::Frame* scope, const void* ip)
-{
-  // The variable is not yet valid:
-  if (scope->range.begin() + var->start_scope > (std::uint64_t)ip)
-    return false;
-  else
-    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_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) {
-
-    if (not valid_variable(&current_variable, scope, (void*)stack_frame->ip))
-      continue;
-
-    int region_type;
-    // FIXME, get rid of `region_type`
-    if ((long)stack_frame->ip > (long)process->libsimgrid_info->start_exec)
-      region_type = 1;
-    else
-      region_type = 2;
-
-    s_local_variable_t new_var;
-    new_var.subprogram = stack_frame->frame;
-    new_var.ip         = stack_frame->ip;
-    new_var.name       = current_variable.name;
-    new_var.type       = current_variable.type;
-    new_var.region     = region_type;
-    new_var.address    = nullptr;
-
-    if (current_variable.address != nullptr)
-      new_var.address = current_variable.address;
-    else if (not current_variable.location_list.empty()) {
-      simgrid::dwarf::Location location = simgrid::dwarf::resolve(
-          current_variable.location_list, current_variable.object_info, &(stack_frame->unw_cursor),
-          (void*)stack_frame->frame_base, &mc_model_checker->process(), process_index);
-
-      if (not location.in_memory())
-        xbt_die("Cannot handle non-address variable");
-      new_var.address = location.address();
-
-    } else
-      xbt_die("No address");
-
-    result.push_back(std::move(new_var));
-  }
-
-  // Recursive processing of nested 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_t> get_local_variables_values(std::vector<s_mc_stack_frame_t>& stack_frames,
-                                                                  int process_index)
-{
-  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;
-}
-
-static std::vector<s_mc_stack_frame_t> unwind_stack_frames(simgrid::mc::UnwindContext* stack_context)
-{
-  simgrid::mc::RemoteClient* process = &mc_model_checker->process();
-  std::vector<s_mc_stack_frame_t> result;
-
-  unw_cursor_t c = stack_context->cursor();
-
-  // TODO, check condition check (unw_init_local==0 means end of frame)
-
-  while (1) {
-
-    s_mc_stack_frame_t stack_frame;
-
-    stack_frame.unw_cursor = c;
-
-    unw_word_t ip;
-    unw_word_t sp;
-
-    unw_get_reg(&c, UNW_REG_IP, &ip);
-    unw_get_reg(&c, UNW_REG_SP, &sp);
-
-    stack_frame.ip = ip;
-    stack_frame.sp = sp;
-
-    // TODO, use real addresses in frame_t instead of fixing it here
-
-    simgrid::mc::Frame* frame = process->find_function(remote(ip));
-    stack_frame.frame         = frame;
-
-    if (frame) {
-      stack_frame.frame_name = frame->name;
-      stack_frame.frame_base = (unw_word_t)frame->frame_base(c);
-    } else {
-      stack_frame.frame_base = 0;
-      stack_frame.frame_name = std::string();
-    }
-
-    result.push_back(std::move(stack_frame));
-
-    /* Stop before context switch with maestro */
-    if (frame != nullptr && frame->name == "smx_ctx_wrapper")
-      break;
-
-    int ret = unw_step(&c);
-    if (ret == 0)
-      xbt_die("Unexpected end of stack.");
-    else if (ret < 0)
-      xbt_die("Error while unwinding stack");
-  }
-
-  if (result.empty()) {
-    XBT_INFO("unw_init_local failed");
-    xbt_abort();
-  }
-
-  return result;
-}
-
-static std::vector<s_mc_snapshot_stack_t> take_snapshot_stacks(simgrid::mc::Snapshot* snapshot)
-{
-  std::vector<s_mc_snapshot_stack_t> res;
-
-  for (auto const& stack : mc_model_checker->process().stack_areas()) {
-    s_mc_snapshot_stack_t st;
-
-    // Read the context from remote process:
-    unw_context_t context;
-    mc_model_checker->process().read_bytes(&context, sizeof(context), remote(stack.context));
-
-    st.context.initialize(&mc_model_checker->process(), &context);
-
-    st.stack_frames    = unwind_stack_frames(&st.context);
-    st.local_variables = get_local_variables_values(st.stack_frames, stack.process_index);
-    st.process_index   = stack.process_index;
-
-    unw_word_t sp = st.stack_frames[0].sp;
-
-    res.push_back(std::move(st));
-
-    size_t stack_size = (char*)stack.address + stack.size - (char*)sp;
-    snapshot->stack_sizes.push_back(stack_size);
-  }
-
-  return res;
-}
-
-static void snapshot_handle_ignore(simgrid::mc::Snapshot* snapshot)
-{
-  xbt_assert(snapshot->process());
-
-  // Copy the memory:
-  for (auto const& region : mc_model_checker->process().ignored_regions()) {
-    s_mc_snapshot_ignored_data_t ignored_data;
-    ignored_data.start = (void*)region.addr;
-    ignored_data.data.resize(region.size);
-    // TODO, we should do this once per privatization segment:
-    snapshot->process()->read_bytes(ignored_data.data.data(), region.size, remote(region.addr),
-                                    simgrid::mc::ProcessIndexDisabled);
-    snapshot->ignored_data.push_back(std::move(ignored_data));
-  }
-
-  // Zero the memory:
-  for (auto const& region : mc_model_checker->process().ignored_regions())
-    snapshot->process()->clear_bytes(remote(region.addr), region.size);
-}
-
-static void snapshot_ignore_restore(simgrid::mc::Snapshot* snapshot)
-{
-  for (auto const& ignored_data : snapshot->ignored_data)
-    snapshot->process()->write_bytes(ignored_data.data.data(), ignored_data.data.size(), remote(ignored_data.start));
-}
-
-static std::vector<s_fd_infos_t> get_current_fds(pid_t pid)
-{
-  const size_t fd_dir_path_size = 20;
-  char fd_dir_path[fd_dir_path_size];
-  int res;
-  res = snprintf(fd_dir_path, fd_dir_path_size, "/proc/%lli/fd", (long long int)pid);
-  xbt_assert(res >= 0);
-  if ((size_t)res > fd_dir_path_size)
-    xbt_die("Unexpected buffer is too small for fd_dir_path");
-
-  DIR* fd_dir = opendir(fd_dir_path);
-  if (fd_dir == nullptr)
-    xbt_die("Cannot open directory '/proc/self/fd'\n");
-
-  std::vector<s_fd_infos_t> fds;
-
-  struct dirent* fd_number;
-  while ((fd_number = readdir(fd_dir))) {
-
-    int fd_value = xbt_str_parse_int(fd_number->d_name, "Found a non-numerical FD: %s. Freaking out!");
-
-    if (fd_value < 3)
-      continue;
-
-    const size_t source_size = 25;
-    char source[25];
-    res = snprintf(source, source_size, "/proc/%lli/fd/%s", (long long int)pid, fd_number->d_name);
-    xbt_assert(res >= 0);
-    if ((size_t)res > source_size)
-      xbt_die("Unexpected buffer is too small for fd %s", fd_number->d_name);
-
-    const size_t link_size = 200;
-    char link[200];
-    res = readlink(source, link, link_size);
-
-    if (res < 0)
-      xbt_die("Could not read link for %s", source);
-    if (res == 200)
-      xbt_die("Buffer to small for link of %s", source);
-
-    link[res] = '\0';
-
-#if HAVE_SMPI
-    if (smpi_is_privatization_file(link))
-      continue;
-#endif
-
-    // This is (probably) the DIR* we are reading:
-    // TODO, read all the file entries at once and close the DIR.*
-    if (strcmp(fd_dir_path, link) == 0)
-      continue;
-
-    // We don't handle them.
-    // It does not mean we should silently ignore them however.
-    if (strncmp(link, "pipe:", std::strlen("pipe:")) == 0 || strncmp(link, "socket:", std::strlen("socket:")) == 0)
-      continue;
-
-    // If dot_output enabled, do not handle the corresponding file
-    if (dot_output != nullptr) {
-      std::string link_basename = simgrid::xbt::Path(link).get_base_name();
-      if (link_basename == _sg_mc_dot_output_file.get())
-        continue;
-    }
-
-    // This is probably a shared memory used by lttng-ust:
-    if (strncmp("/dev/shm/ust-shm-tmp-", link, std::strlen("/dev/shm/ust-shm-tmp-")) == 0)
-      continue;
-
-    // Add an entry for this FD in the snapshot:
-    s_fd_infos_t fd;
-    fd.filename         = std::string(link);
-    fd.number           = fd_value;
-    fd.flags            = fcntl(fd_value, F_GETFL) | fcntl(fd_value, F_GETFD);
-    fd.current_position = lseek(fd_value, 0, SEEK_CUR);
-    fds.push_back(std::move(fd));
-  }
-
-  closedir(fd_dir);
-  return fds;
-}
-
-std::shared_ptr<simgrid::mc::Snapshot> take_snapshot(int num_state)
-{
-  XBT_DEBUG("Taking snapshot %i", num_state);
-
-  simgrid::mc::RemoteClient* mc_process = &mc_model_checker->process();
-
-  std::shared_ptr<simgrid::mc::Snapshot> snapshot = std::make_shared<simgrid::mc::Snapshot>(mc_process, num_state);
-
-  for (auto const& p : mc_model_checker->process().actors())
-    snapshot->enabled_processes.insert(p.copy.getBuffer()->get_pid());
-
-  snapshot_handle_ignore(snapshot.get());
-
-  if (_sg_mc_snapshot_fds)
-    snapshot->current_fds = get_current_fds(mc_model_checker->process().pid());
-
-  /* Save the std heap and the writable mapped pages of libsimgrid and binary */
-  get_memory_regions(mc_process, snapshot.get());
-
-  snapshot->to_ignore = mc_model_checker->process().ignored_heap();
-
-  if (_sg_mc_max_visited_states > 0 || not _sg_mc_property_file.get().empty()) {
-    snapshot->stacks = take_snapshot_stacks(snapshot.get());
-    if (_sg_mc_hash)
-      snapshot->hash = simgrid::mc::hash(*snapshot);
-    else
-      snapshot->hash = 0;
-  } else
-    snapshot->hash = 0;
-
-  snapshot_ignore_restore(snapshot.get());
-  return snapshot;
-}
-
-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 privatized, variables we decided it was not necessary to take the snapshot:
-    if (region)
-      restore(region.get());
-  }
-
-#if HAVE_SMPI
-  if (snapshot->privatization_index >= 0) {
-    // Fix the privatization mmap:
-    s_mc_message_restore_t message{MC_MESSAGE_RESTORE, snapshot->privatization_index};
-    mc_model_checker->process().getChannel().send(message);
-  }
-#endif
-}
-
-static inline void restore_snapshot_fds(simgrid::mc::Snapshot* snapshot)
-{
-  xbt_die("FD snapshot not implemented in client/server mode.");
-
-  for (auto const& fd : snapshot->current_fds) {
-
-    int new_fd = open(fd.filename.c_str(), fd.flags);
-    if (new_fd < 0)
-      xbt_die("Could not reopen the file %s fo restoring the file descriptor", fd.filename.c_str());
-    if (new_fd != fd.number) {
-      dup2(new_fd, fd.number);
-      close(new_fd);
-    }
-    lseek(fd.number, fd.current_position, SEEK_SET);
-  }
-}
-
-void restore_snapshot(std::shared_ptr<simgrid::mc::Snapshot> snapshot)
-{
-  XBT_DEBUG("Restore snapshot %i", snapshot->num_state);
-  restore_snapshot_regions(snapshot.get());
-  if (_sg_mc_snapshot_fds)
-    restore_snapshot_fds(snapshot.get());
-  snapshot_ignore_restore(snapshot.get());
-  mc_model_checker->process().clear_cache();
-}
-
-} // namespace mc
-} // namespace simgrid
diff --git a/src/mc/sosp/mc_page_snapshot.cpp b/src/mc/sosp/mc_page_snapshot.cpp
deleted file mode 100644 (file)
index c3994d1..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-/* MC interface: definitions that non-MC modules must see, but not the user */
-
-#include <unistd.h> // pread, pwrite
-
-#include "src/mc/mc_mmu.hpp"
-#include "src/mc/mc_private.hpp"
-#include "src/mc/sosp/PageStore.hpp"
-#include "src/mc/sosp/mc_snapshot.hpp"
-
-#include "src/mc/sosp/ChunkedData.hpp"
-#include <xbt/mmalloc.h>
-
-using simgrid::mc::remote;
-
-/** @brief Restore a snapshot of a region
- *
- *  If possible, the restoration will be incremental
- *  (the modified pages will not be touched).
- *
- *  @param start_addr
- *  @param page_count       Number of pages of the region
- *  @param pagenos
- */
-void mc_restore_page_snapshot_region(simgrid::mc::RemoteClient* process, void* start_addr,
-                                     simgrid::mc::ChunkedData const& pages_copy)
-{
-  for (size_t i = 0; i != pages_copy.page_count(); ++i) {
-    // Otherwise, copy the page:
-    void* target_page       = (void*)simgrid::mc::mmu::join(i, (std::uintptr_t)start_addr);
-    const void* source_page = pages_copy.page(i);
-    process->write_bytes(source_page, xbt_pagesize, remote(target_page));
-  }
-}
-
-// ***** High level API
-
-void mc_region_restore_sparse(simgrid::mc::RemoteClient* process, mc_mem_region_t reg)
-{
-  xbt_assert(((reg->permanent_address().address()) & (xbt_pagesize - 1)) == 0, "Not at the beginning of a page");
-  xbt_assert(simgrid::mc::mmu::chunkCount(reg->size()) == reg->page_data().page_count());
-  mc_restore_page_snapshot_region(process, (void*)reg->permanent_address().address(), reg->page_data());
-}
diff --git a/src/mc/sosp/mc_snapshot.cpp b/src/mc/sosp/mc_snapshot.cpp
deleted file mode 100644 (file)
index 34d2ee4..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include <cstddef>
-
-#include <memory>
-#include <utility>
-
-#include "xbt/asserts.h"
-#include "xbt/sysdep.h"
-
-#include "src/internal_config.h"
-#include "src/smpi/include/private.hpp"
-
-#include "src/mc/mc_mmu.hpp"
-#include "src/mc/mc_private.hpp"
-#include "src/mc/sosp/PageStore.hpp"
-#include "src/mc/sosp/mc_snapshot.hpp"
-
-/** @brief Find the snapshoted region from a pointer
- *
- *  @param addr     Pointer
- *  @param snapshot Snapshot
- *  @param process_index rank requesting the region
- * */
-mc_mem_region_t mc_get_snapshot_region(const void* addr, const simgrid::mc::Snapshot* snapshot, int process_index)
-{
-  size_t n = snapshot->snapshot_regions.size();
-  for (size_t i = 0; i != n; ++i) {
-    mc_mem_region_t region = snapshot->snapshot_regions[i].get();
-    if (not(region && region->contain(simgrid::mc::remote(addr))))
-      continue;
-
-    if (region->storage_type() == simgrid::mc::StorageType::Privatized) {
-#if HAVE_SMPI
-      // Use the current process index of the snapshot:
-      if (process_index == simgrid::mc::ProcessIndexDisabled)
-        process_index = snapshot->privatization_index;
-      if (process_index < 0)
-        xbt_die("Missing process index");
-      if (process_index >= (int)region->privatized_data().size())
-        xbt_die("Invalid process index");
-      simgrid::mc::RegionSnapshot& priv_region = region->privatized_data()[process_index];
-      xbt_assert(priv_region.contain(simgrid::mc::remote(addr)));
-      return &priv_region;
-#else
-      xbt_die("Privatized region in a non SMPI build (this should not happen)");
-#endif
-    }
-
-    return region;
-  }
-
-  return nullptr;
-}
-
-/** @brief Read memory from a snapshot region broken across fragmented pages
- *
- *  @param addr    Process (non-snapshot) address of the data
- *  @param region  Snapshot memory region where the data is located
- *  @param target  Buffer to store the value
- *  @param size    Size of the data to read in bytes
- *  @return Pointer where the data is located (target buffer of original location)
- */
-const void* MC_region_read_fragmented(mc_mem_region_t region, void* target, const void* addr, size_t size)
-{
-  // Last byte of the memory area:
-  void* end = (char*)addr + size - 1;
-
-  // TODO, we assume the chunks are aligned to natural chunk boundaries.
-  // We should remove this assumption.
-
-  // Page of the last byte of the memory area:
-  size_t page_end = simgrid::mc::mmu::split((std::uintptr_t)end).first;
-
-  void* dest = target;
-
-  if (dest == nullptr)
-    xbt_die("Missing destination buffer for fragmented memory access");
-
-  // Read each page:
-  while (simgrid::mc::mmu::split((std::uintptr_t)addr).first != page_end) {
-    void* snapshot_addr = mc_translate_address_region_chunked((uintptr_t)addr, region);
-    void* next_page     = (void*)simgrid::mc::mmu::join(simgrid::mc::mmu::split((std::uintptr_t)addr).first + 1, 0);
-    size_t readable     = (char*)next_page - (char*)addr;
-    memcpy(dest, snapshot_addr, readable);
-    addr = (char*)addr + readable;
-    dest = (char*)dest + readable;
-    size -= readable;
-  }
-
-  // Read the end:
-  void* snapshot_addr = mc_translate_address_region_chunked((uintptr_t)addr, region);
-  memcpy(dest, snapshot_addr, size);
-
-  return target;
-}
-
-/** Compare memory between snapshots (with known regions)
- *
- * @param addr1 Address in the first snapshot
- * @param region1 Region of the address in the first snapshot
- * @param addr2 Address in the second snapshot
- * @param region2 Region of the address in the second snapshot
- * @return same semantic as memcmp
- */
-int MC_snapshot_region_memcmp(const void* addr1, mc_mem_region_t region1, const void* addr2, mc_mem_region_t region2,
-                              size_t size)
-{
-  // Using alloca() for large allocations may trigger stack overflow:
-  // use malloc if the buffer is too big.
-  bool stack_alloc = size < 64;
-  void* buffer1a   = nullptr;
-  void* buffer2a   = nullptr;
-  if (region1 != nullptr && region1->storage_type() != simgrid::mc::StorageType::Flat)
-    buffer1a = stack_alloc ? alloca(size) : ::operator new(size);
-  if (region2 != nullptr && region2->storage_type() != simgrid::mc::StorageType::Flat)
-    buffer2a = 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;
-  if (buffer1 == buffer2)
-    res = 0;
-  else
-    res = memcmp(buffer1, buffer2, size);
-  if (not stack_alloc) {
-    ::operator delete(buffer1a);
-    ::operator delete(buffer2a);
-  }
-  return res;
-}
-
-namespace simgrid {
-namespace mc {
-
-Snapshot::Snapshot(RemoteClient* process, int _num_state)
-    : AddressSpace(process)
-    , num_state(_num_state)
-    , heap_bytes_used(0)
-    , enabled_processes()
-    , privatization_index(0)
-    , hash(0)
-{
-}
-
-const void* Snapshot::read_bytes(void* buffer, std::size_t size, RemotePtr<void> address, int process_index,
-                                 ReadOptions options) const
-{
-  mc_mem_region_t region = mc_get_snapshot_region((void*)address.address(), this, process_index);
-  if (region) {
-    const void* res = MC_region_read(region, buffer, (void*)address.address(), size);
-    if (buffer == res || options & ReadOptions::lazy())
-      return res;
-    else {
-      memcpy(buffer, res, size);
-      return buffer;
-    }
-  } else
-    return this->process()->read_bytes(buffer, size, address, process_index, options);
-}
-
-} // namespace mc
-} // namespace simgrid
diff --git a/src/mc/sosp/mc_snapshot.hpp b/src/mc/sosp/mc_snapshot.hpp
deleted file mode 100644 (file)
index 92a4325..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
-
-/* This program 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_HPP
-#define SIMGRID_MC_SNAPSHOT_HPP
-
-#include "src/mc/ModelChecker.hpp"
-#include "src/mc/mc_unw.hpp"
-#include "src/mc/remote/RemoteClient.hpp"
-#include "src/mc/sosp/RegionSnapshot.hpp"
-
-// ***** Snapshot region
-
-XBT_PRIVATE void mc_region_restore_sparse(simgrid::mc::RemoteClient* process, mc_mem_region_t reg);
-
-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;
-  const void* snapshot_page = region->page_data().page(pageno);
-  return (char*)snapshot_page + offset;
-}
-
-static XBT_ALWAYS_INLINE void* mc_translate_address_region(uintptr_t addr, mc_mem_region_t region, int process_index)
-{
-  switch (region->storage_type()) {
-    case simgrid::mc::StorageType::Flat: {
-      uintptr_t offset = (uintptr_t)addr - (uintptr_t)region->start().address();
-      return (void*)((uintptr_t)region->flat_data().get() + offset);
-    }
-    case simgrid::mc::StorageType::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);
-
-// ***** MC Snapshot
-
-/** Ignored data
- *
- *  Some parts of the snapshot are ignored by zeroing them out: the real
- *  values is stored here.
- * */
-struct s_mc_snapshot_ignored_data_t {
-  void* start;
-  std::vector<char> data;
-};
-
-struct s_fd_infos_t {
-  std::string filename;
-  int number;
-  off_t current_position;
-  int flags;
-};
-
-/** Information about a given stack frame */
-struct s_mc_stack_frame_t {
-  /** Instruction pointer */
-  unw_word_t ip;
-  /** Stack pointer */
-  unw_word_t sp;
-  unw_word_t frame_base;
-  simgrid::mc::Frame* frame;
-  std::string frame_name;
-  unw_cursor_t unw_cursor;
-};
-typedef s_mc_stack_frame_t* mc_stack_frame_t;
-
-struct s_local_variable_t {
-  simgrid::mc::Frame* subprogram;
-  unsigned long ip;
-  std::string name;
-  simgrid::mc::Type* type;
-  void* address;
-  int region;
-};
-typedef s_local_variable_t* local_variable_t;
-
-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;
-};
-typedef s_mc_snapshot_stack_t* mc_snapshot_stack_t;
-
-namespace simgrid {
-namespace mc {
-
-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;
-
-  // To be private
-  int num_state;
-  std::size_t heap_bytes_used;
-  std::vector<std::unique_ptr<s_mc_mem_region_t>> snapshot_regions;
-  std::set<pid_t> enabled_processes;
-  int privatization_index;
-  std::vector<std::size_t> stack_sizes;
-  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_t> ignored_data;
-  std::vector<s_fd_infos_t> current_fds;
-};
-} // namespace mc
-} // namespace simgrid
-
-static XBT_ALWAYS_INLINE mc_mem_region_t mc_get_region_hinted(void* addr, simgrid::mc::Snapshot* snapshot,
-                                                              int process_index, mc_mem_region_t region)
-{
-  if (region->contain(simgrid::mc::remote(addr)))
-    return region;
-  else
-    return mc_get_snapshot_region(addr, snapshot, process_index);
-}
-
-static const void* mc_snapshot_get_heap_end(simgrid::mc::Snapshot* snapshot);
-
-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);
-} // namespace mc
-} // namespace simgrid
-
-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);
-
-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);
-
-static XBT_ALWAYS_INLINE const void* mc_snapshot_get_heap_end(simgrid::mc::Snapshot* snapshot)
-{
-  if (snapshot == nullptr)
-    xbt_die("snapshot is nullptr");
-  return mc_model_checker->process().get_heap()->breakval;
-}
-
-/** @brief Read memory from a snapshot region
- *
- *  @param addr    Process (non-snapshot) address of the data
- *  @param region  Snapshot memory region where the data is located
- *  @param target  Buffer to store the value
- *  @param size    Size of the data to read in bytes
- *  @return Pointer where the data is located (target buffer of original location)
- */
-static XBT_ALWAYS_INLINE const void* MC_region_read(mc_mem_region_t region, void* target, const void* addr,
-                                                    std::size_t size)
-{
-  xbt_assert(region);
-
-  std::uintptr_t offset = (std::uintptr_t)addr - (std::uintptr_t)region->start().address();
-
-  xbt_assert(region->contain(simgrid::mc::remote(addr)), "Trying to read out of the region boundary.");
-
-  switch (region->storage_type()) {
-    case simgrid::mc::StorageType::Flat:
-      return (char*)region->flat_data().get() + offset;
-
-    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)) {
-        // The memory is contained in a single page:
-        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);
-    }
-
-    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*));
-}
-
-#endif
index 1f7b29c..3bbc4c3 100644 (file)
@@ -28,19 +28,15 @@ bool Comm::test()
       /* I am the receiver */
       (*task_received)->set_not_used();
     }
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutException&) {
     status_  = MSG_TIMEOUT;
     finished = true;
-  } catch (simgrid::CancelException& e) {
+  } catch (const simgrid::CancelException&) {
     status_  = MSG_TASK_CANCELED;
     finished = true;
-  } catch (xbt_ex& e) {
-    if (e.category == network_error) {
-      status_  = MSG_TRANSFER_FAILURE;
-      finished = true;
-    } else {
-      throw;
-    }
+  } catch (const simgrid::NetworkFailureException&) {
+    status_  = MSG_TRANSFER_FAILURE;
+    finished = true;
   }
 
   return finished;
@@ -56,15 +52,12 @@ msg_error_t Comm::wait_for(double timeout)
     }
 
     /* FIXME: these functions are not traceable */
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutException&) {
     status_ = MSG_TIMEOUT;
-  } catch (simgrid::CancelException& e) {
+  } catch (const simgrid::CancelException&) {
     status_ = MSG_TASK_CANCELED;
-  } catch (xbt_ex& e) {
-    if (e.category == network_error)
-      status_ = MSG_TRANSFER_FAILURE;
-    else
-      throw;
+  } catch (const simgrid::NetworkFailureException&) {
+    status_ = MSG_TRANSFER_FAILURE;
   }
 
   return status_;
@@ -101,21 +94,19 @@ int MSG_comm_testany(xbt_dynar_t comms)
   msg_comm_t comm;
   unsigned int cursor;
   xbt_dynar_foreach (comms, cursor, comm) {
-    s_comms.push_back(static_cast<simgrid::kernel::activity::CommImpl*>(comm->s_comm->get_impl().get()));
+    s_comms.push_back(static_cast<simgrid::kernel::activity::CommImpl*>(comm->s_comm->get_impl()));
   }
 
   msg_error_t status = MSG_OK;
   try {
     finished_index = simcall_comm_testany(s_comms.data(), s_comms.size());
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutException& e) {
     finished_index = e.value;
     status         = MSG_TIMEOUT;
-  } catch (simgrid::CancelException& e) {
+  } catch (const simgrid::CancelException& e) {
     finished_index = e.value;
     status         = MSG_TASK_CANCELED;
-  } catch (xbt_ex& e) {
-    if (e.category != network_error)
-      throw;
+  } catch (const simgrid::NetworkFailureException& e) {
     finished_index = e.value;
     status         = MSG_TRANSFER_FAILURE;
   }
@@ -153,7 +144,7 @@ msg_error_t MSG_comm_wait(msg_comm_t comm, double timeout)
   return comm->wait_for(timeout);
 }
 
-/** @brief This function is called by a sender and permit to wait for each communication
+/** @brief This function is called by a sender and permits waiting for each communication
  *
  * @param comm a vector of communication
  * @param nb_elem is the size of the comm vector
@@ -180,25 +171,21 @@ int MSG_comm_waitany(xbt_dynar_t comms)
   msg_comm_t comm;
   unsigned int cursor;
   xbt_dynar_foreach (comms, cursor, comm) {
-    s_comms.push_back(static_cast<simgrid::kernel::activity::CommImpl*>(comm->s_comm->get_impl().get()));
+    s_comms.push_back(static_cast<simgrid::kernel::activity::CommImpl*>(comm->s_comm->get_impl()));
   }
 
   msg_error_t status = MSG_OK;
   try {
     finished_index = simcall_comm_waitany(s_comms.data(), s_comms.size(), -1);
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutException& e) {
     finished_index = e.value;
     status         = MSG_TIMEOUT;
-  } catch (simgrid::CancelException& e) {
+  } catch (const simgrid::CancelException& e) {
     finished_index = e.value;
     status         = MSG_TASK_CANCELED;
-  } catch (xbt_ex& e) {
-    if (e.category == network_error) {
-      finished_index = e.value;
-      status         = MSG_TRANSFER_FAILURE;
-    } else {
-      throw;
-    }
+  } catch (const simgrid::NetworkFailureException& e) {
+    finished_index = e.value;
+    status         = MSG_TRANSFER_FAILURE;
   }
 
   xbt_assert(finished_index != -1, "WaitAny returned -1");
index 8c6365c..e061e0c 100644 (file)
@@ -51,7 +51,7 @@ void MSG_init_nocheck(int *argc, char **argv) {
     MC_ignore_heap(&(msg_global->sent_msg), sizeof(msg_global->sent_msg));
   }
 
-  if (simgrid::config::get_value<bool>("clean-atexit"))
+  if (simgrid::config::get_value<bool>("debug/clean-atexit"))
     atexit(MSG_exit);
 }
 
index fd4562c..cd258f3 100644 (file)
@@ -130,7 +130,7 @@ msg_error_t MSG_process_sleep(double duration)
   try {
     sg_actor_sleep_for(duration);
     return MSG_OK;
-  } catch (simgrid::HostFailureException& e) {
+  } catch (const simgrid::HostFailureException&) {
     return MSG_HOST_FAILURE;
   }
 }
@@ -144,6 +144,44 @@ void MSG_process_detach()
 {
   sg_actor_detach();
 }
+aid_t MSG_process_self_PID()
+{
+  return sg_actor_self_get_pid();
+}
+
+/** @brief Return the PPID of the current process.
+ *
+ * This function returns the PID of the parent of the currently running #msg_process_t.
+ */
+aid_t MSG_process_self_PPID()
+{
+  return sg_actor_self_get_ppid();
+}
+
+/** @brief Return the name of the current process. */
+const char* MSG_process_self_name()
+{
+  return sg_actor_self_get_name();
+}
+/** @brief Return the current process.
+ *
+ * This function returns the currently running #msg_process_t.
+ */
+msg_process_t MSG_process_self()
+{
+  return sg_actor_self();
+}
+
+/** @brief Take an extra reference on that process to prevent it to be garbage-collected */
+void MSG_process_ref(msg_process_t process)
+{
+  sg_actor_ref(process);
+}
+/** @brief Release a reference on that process so that it can get be garbage-collected */
+void MSG_process_unref(msg_process_t process)
+{
+  sg_actor_unref(process);
+}
 
 /* ************************** NetZones *************************** */
 sg_netzone_t MSG_zone_get_root()
@@ -244,11 +282,11 @@ const char* MSG_host_get_name(sg_host_t host)
 }
 void* MSG_host_get_data(sg_host_t host)
 {
-  return sg_host_user(host);
+  return sg_host_data(host);
 }
 void MSG_host_set_data(sg_host_t host, void* data)
 {
-  return sg_host_user_set(host, data);
+  return sg_host_data_set(host, data);
 }
 xbt_dict_t MSG_host_get_mounted_storage_list(sg_host_t host)
 {
index 1d6bb19..d6db894 100644 (file)
@@ -30,7 +30,8 @@ void MSG_process_userdata_init()
 
   simgrid::s4u::Actor::on_destruction.connect([](simgrid::s4u::Actor const& actor) {
     // free the data if a function was provided
-    void* userdata = actor.extension<simgrid::msg::ActorUserData>()->get_user_data();
+    auto extension = actor.extension<simgrid::msg::ActorUserData>();
+    void* userdata = extension ? extension->get_user_data() : nullptr;
     if (userdata && msg_global->process_data_cleanup) {
       msg_global->process_data_cleanup(userdata);
     }
@@ -167,43 +168,6 @@ int MSG_process_get_number()
   return SIMIX_process_count();
 }
 
-/** @brief Return the PID of the current process.
- *
- * This function returns the PID of the currently running #msg_process_t.
- */
-int MSG_process_self_PID()
-{
-  smx_actor_t self = SIMIX_process_self();
-  return self == nullptr ? 0 : self->get_pid();
-}
-
-/** @brief Return the PPID of the current process.
- *
- * This function returns the PID of the parent of the currently running #msg_process_t.
- */
-int MSG_process_self_PPID()
-{
-  return MSG_process_get_PPID(MSG_process_self());
-}
-
-/** @brief Return the name of the current process. */
-const char* MSG_process_self_name()
-{
-  return SIMIX_process_self_get_name();
-}
-
-/** @brief Return the current process.
- *
- * This function returns the currently running #msg_process_t.
- */
-msg_process_t MSG_process_self()
-{
-  return SIMIX_process_self()->ciface();
-}
-
-smx_context_t MSG_process_get_smx_ctx(msg_process_t process) { // deprecated -- smx_context_t should die afterward
-  return process->get_impl()->context_.get();
-}
 /** @brief Add a function to the list of "on_exit" functions for the current process.
  *  The on_exit functions are the functions executed when your process is killed.
  *  You should use them to free the data used by your process.
@@ -213,14 +177,3 @@ void MSG_process_on_exit(int_f_int_pvoid_t fun, void* data)
   simgrid::s4u::this_actor::on_exit(
       [fun, data](bool failed) { fun(failed ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS, data); });
 }
-
-/** @brief Take an extra reference on that process to prevent it to be garbage-collected */
-XBT_PUBLIC void MSG_process_ref(msg_process_t process)
-{
-  intrusive_ptr_add_ref(process);
-}
-/** @brief Release a reference on that process so that it can get be garbage-collected */
-XBT_PUBLIC void MSG_process_unref(msg_process_t process)
-{
-  intrusive_ptr_release(process);
-}
index 786ebea..97a7f3f 100644 (file)
@@ -45,7 +45,7 @@ Task* Task::create(const std::string& name, double flops_amount, double bytes_am
 Task* Task::create_parallel(const std::string& name, int host_nb, const msg_host_t* host_list, double* flops_amount,
                             double* bytes_amount, void* data)
 {
-  std::vector<simgrid::s4u::Host*> hosts(host_list, host_list + host_nb);
+  std::vector<s4u::Host*> hosts(host_list, host_list + host_nb);
   std::vector<double> flops;
   std::vector<double> bytes;
   if (flops_amount != nullptr)
@@ -81,11 +81,11 @@ msg_error_t Task::execute()
 
     set_not_used();
     XBT_DEBUG("Execution task '%s' finished", get_cname());
-  } catch (HostFailureException& e) {
+  } catch (const HostFailureException&) {
     status = MSG_HOST_FAILURE;
-  } catch (TimeoutError& e) {
+  } catch (const TimeoutException&) {
     status = MSG_TIMEOUT;
-  } catch (CancelException& e) {
+  } catch (const CancelException&) {
     status = MSG_TASK_CANCELED;
   }
 
@@ -100,9 +100,9 @@ msg_error_t Task::execute()
 s4u::CommPtr Task::send_async(const std::string& alias, void_f_pvoid_t cleanup, bool detached)
 {
   if (TRACE_actor_is_enabled()) {
-    container_t process_container = simgrid::instr::Container::by_name(instr_pid(*MSG_process_self()));
+    container_t process_container = instr::Container::by_name(instr_pid(*MSG_process_self()));
     std::string key               = std::string("p") + std::to_string(get_id());
-    simgrid::instr::Container::get_root()->get_link("ACTOR_TASK_LINK")->start_event(process_container, "SR", key);
+    instr::Container::get_root()->get_link("ACTOR_TASK_LINK")->start_event(process_container, "SR", key);
   }
 
   /* Prepare the task to send */
@@ -111,6 +111,9 @@ s4u::CommPtr Task::send_async(const std::string& alias, void_f_pvoid_t cleanup,
   msg_global->sent_msg++;
 
   s4u::CommPtr s4u_comm = s4u::Mailbox::by_name(alias)->put_init(this, bytes_amount)->set_rate(get_rate());
+  if (TRACE_is_enabled() && has_tracing_category())
+    s4u_comm->set_tracing_category(tracing_category_);
+
   comm                  = s4u_comm;
 
   if (detached)
@@ -118,9 +121,6 @@ s4u::CommPtr Task::send_async(const std::string& alias, void_f_pvoid_t cleanup,
   else
     comm->start();
 
-  if (TRACE_is_enabled() && has_tracing_category())
-    simgrid::simix::simcall([this] { comm->get_impl()->set_category(std::move(tracing_category_)); });
-
   return comm;
 }
 
@@ -133,16 +133,12 @@ msg_error_t Task::send(const std::string& alias, double timeout)
     s4u::CommPtr s4u_comm = send_async(alias, nullptr, false);
     comm                  = s4u_comm;
     comm->wait_for(timeout);
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const TimeoutException&) {
     ret = MSG_TIMEOUT;
-  } catch (simgrid::CancelException& e) {
+  } catch (const CancelException&) {
     ret = MSG_HOST_FAILURE;
-  } catch (xbt_ex& e) {
-    if (e.category == network_error)
-      ret = MSG_TRANSFER_FAILURE;
-    else
-      throw;
-
+  } catch (const NetworkFailureException&) {
+    ret = MSG_TRANSFER_FAILURE;
     /* If the send failed, it is not used anymore */
     set_not_used();
   }
@@ -167,7 +163,7 @@ void Task::set_priority(double priority)
 
 s4u::Actor* Task::get_sender()
 {
-  return comm ? comm->get_sender().get() : nullptr;
+  return comm ? comm->get_sender() : nullptr;
 }
 
 s4u::Host* Task::get_source()
@@ -625,17 +621,14 @@ msg_error_t MSG_task_receive_ext_bounded(msg_task_t* task, const char* alias, do
     *task = static_cast<msg_task_t>(payload);
     XBT_DEBUG("Got task %s from %s", (*task)->get_cname(), alias);
     (*task)->set_not_used();
-  } catch (simgrid::HostFailureException& e) {
+  } catch (const simgrid::HostFailureException&) {
     ret = MSG_HOST_FAILURE;
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutException&) {
     ret = MSG_TIMEOUT;
-  } catch (simgrid::CancelException& e) {
+  } catch (const simgrid::CancelException&) {
     ret = MSG_TASK_CANCELED;
-  } catch (xbt_ex& e) {
-    if (e.category == network_error)
-      ret = MSG_TRANSFER_FAILURE;
-    else
-      throw;
+  } catch (const simgrid::NetworkFailureException&) {
+    ret = MSG_TRANSFER_FAILURE;
   }
 
   if (TRACE_actor_is_enabled() && ret != MSG_HOST_FAILURE && ret != MSG_TRANSFER_FAILURE && ret != MSG_TIMEOUT) {
@@ -698,8 +691,7 @@ msg_comm_t MSG_task_irecv_bounded(msg_task_t* task, const char* name, double rat
  *
  * @param alias the name of the mailbox to be considered
  *
- * @return Returns the PID of sender process,
- * -1 if there is no communication in the mailbox.#include <cmath>
+ * @return Returns the PID of sender process (or -1 if there is no communication in the mailbox)
  *
  */
 int MSG_task_listen_from(const char* alias)
index 684c2ad..ebf4968 100644 (file)
@@ -4,6 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/plugins/live_migration.h"
+#include "simgrid/s4u/Exec.hpp"
 #include "src/kernel/activity/ExecImpl.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 
@@ -72,32 +73,34 @@ static void on_virtual_machine_creation(simgrid::vm::VirtualMachineImpl& vm)
   vm.extension_set<simgrid::vm::DirtyPageTrackingExt>(new simgrid::vm::DirtyPageTrackingExt());
 }
 
-static void on_exec_creation(simgrid::kernel::activity::ExecImpl const& exec)
+static void on_exec_creation(simgrid::s4u::Actor const&, simgrid::s4u::Exec const& e)
 {
-  simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(exec.get_host());
+  auto exec                        = static_cast<simgrid::kernel::activity::ExecImpl*>(e.get_impl());
+  simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(exec->get_host());
   if (vm == nullptr)
     return;
 
   if (vm->get_impl()->extension<simgrid::vm::DirtyPageTrackingExt>()->is_tracking()) {
-    vm->get_impl()->extension<simgrid::vm::DirtyPageTrackingExt>()->track(&exec, exec.get_remaining());
+    vm->get_impl()->extension<simgrid::vm::DirtyPageTrackingExt>()->track(exec, exec->get_remaining());
   } else {
-    vm->get_impl()->extension<simgrid::vm::DirtyPageTrackingExt>()->track(&exec, 0.0);
+    vm->get_impl()->extension<simgrid::vm::DirtyPageTrackingExt>()->track(exec, 0.0);
   }
 }
 
-static void on_exec_completion(simgrid::kernel::activity::ExecImpl const& exec)
+static void on_exec_completion(simgrid::s4u::Actor const&, simgrid::s4u::Exec const& e)
 {
-  simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(exec.get_host());
+  auto exec                        = static_cast<simgrid::kernel::activity::ExecImpl*>(e.get_impl());
+  simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(exec->get_host());
   if (vm == nullptr)
     return;
 
   /* 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->get_impl()->extension<simgrid::vm::DirtyPageTrackingExt>()->is_tracking()) {
-    double delta = vm->get_impl()->extension<simgrid::vm::DirtyPageTrackingExt>()->get_stored_remains(&exec);
+    double delta = vm->get_impl()->extension<simgrid::vm::DirtyPageTrackingExt>()->get_stored_remains(exec);
     vm->get_impl()->extension<simgrid::vm::DirtyPageTrackingExt>()->update_dirty_page_count(delta);
   }
-  vm->get_impl()->extension<simgrid::vm::DirtyPageTrackingExt>()->untrack(&exec);
+  vm->get_impl()->extension<simgrid::vm::DirtyPageTrackingExt>()->untrack(exec);
 }
 
 void sg_vm_dirty_page_tracking_init()
@@ -106,8 +109,8 @@ void sg_vm_dirty_page_tracking_init()
     simgrid::vm::DirtyPageTrackingExt::EXTENSION_ID =
         simgrid::vm::VirtualMachineImpl::extension_create<simgrid::vm::DirtyPageTrackingExt>();
     simgrid::vm::VirtualMachineImpl::on_creation.connect(&on_virtual_machine_creation);
-    simgrid::kernel::activity::ExecImpl::on_creation.connect(&on_exec_creation);
-    simgrid::kernel::activity::ExecImpl::on_completion.connect(&on_exec_completion);
+    simgrid::s4u::Exec::on_start.connect(&on_exec_creation);
+    simgrid::s4u::Exec::on_completion.connect(&on_exec_completion);
   }
 }
 
index b28d3d8..67e7ffd 100644 (file)
@@ -5,7 +5,9 @@
 
 #include "simgrid/plugins/file_system.h"
 #include "simgrid/s4u/Actor.hpp"
+#include "simgrid/s4u/Engine.hpp"
 #include "src/surf/HostImpl.hpp"
+#include "src/surf/xml/platf_private.hpp"
 #include "xbt/config.hpp"
 
 #include <algorithm>
@@ -20,6 +22,7 @@ int sg_storage_max_file_descriptors = 1024;
 
 namespace simgrid {
 namespace s4u {
+simgrid::xbt::Extension<Disk, FileSystemDiskExt> FileSystemDiskExt::EXTENSION_ID;
 simgrid::xbt::Extension<Storage, FileSystemStorageExt> FileSystemStorageExt::EXTENSION_ID;
 simgrid::xbt::Extension<Host, FileDescriptorHostExt> FileDescriptorHostExt::EXTENSION_ID;
 
@@ -28,32 +31,61 @@ File::File(const std::string& fullpath, void* userdata) : File(fullpath, Host::c
 File::File(const 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;
-  XBT_DEBUG("Search for storage name for '%s' on '%s'", fullpath_.c_str(), host->get_cname());
-
-  for (auto const& mnt : host->get_mounted_storages()) {
-    XBT_DEBUG("See '%s'", mnt.first.c_str());
-    mount_point_ = fullpath_.substr(0, mnt.first.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 (not host->get_mounted_storages().empty()) {
+    Storage* st                  = nullptr;
+    size_t longest_prefix_length = 0;
+    XBT_DEBUG("Search for storage name for '%s' on '%s'", fullpath_.c_str(), host->get_cname());
+
+    for (auto const& mnt : host->get_mounted_storages()) {
+      XBT_DEBUG("See '%s'", mnt.first.c_str());
+      mount_point_ = fullpath_.substr(0, mnt.first.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_ = 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_.c_str(), host->get_cname());
+    if (longest_prefix_length > 0) { /* Mount point found, split fullpath_ into mount_name and path+filename*/
+      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_.c_str(), host->get_cname());
 
-  local_storage_ = st;
+    local_storage_ = st;
+  }
+  if (not host->get_disks().empty()) {
+    Disk* d                      = nullptr;
+    size_t longest_prefix_length = 0;
+    for (auto const& disk : host->get_disks()) {
+      std::string current_mount;
+      if (disk->get_host() != host)
+        current_mount = disk->extension<FileSystemDiskExt>()->get_mount_point(disk->get_host());
+      else
+        current_mount = disk->extension<FileSystemDiskExt>()->get_mount_point();
+      mount_point_              = fullpath_.substr(0, current_mount.length());
+      if (mount_point_ == current_mount && current_mount.length() > longest_prefix_length) {
+        /* The current mount name is found in the full path and is bigger than the previous*/
+        longest_prefix_length = current_mount.length();
+        d                     = disk;
+      }
+      if (longest_prefix_length > 0) { /* Mount point found, split fullpath_ into mount_name and path+filename*/
+        mount_point_ = fullpath_.substr(0, longest_prefix_length);
+        if (mount_point_ == std::string("/"))
+          path_ = fullpath_;
+        else
+          path_ = fullpath_.substr(longest_prefix_length, fullpath_.length());
+        XBT_DEBUG("%s + %s", mount_point_.c_str(), path_.c_str());
+      } else
+        xbt_die("Can't find mount point for '%s' on '%s'", fullpath_.c_str(), host->get_cname());
+    }
+    local_disk_ = d;
+  }
 
   // assign a file descriptor id to the newly opened File
   FileDescriptorHostExt* ext = host->extension<simgrid::s4u::FileDescriptorHostExt>();
   if (ext->file_descriptor_table == nullptr) {
-    ext->file_descriptor_table = new std::vector<int>(sg_storage_max_file_descriptors);
+    ext->file_descriptor_table.reset(new std::vector<int>(sg_storage_max_file_descriptors));
     std::iota(ext->file_descriptor_table->rbegin(), ext->file_descriptor_table->rend(), 0); // Fill with ..., 1, 0.
   }
   xbt_assert(not ext->file_descriptor_table->empty(), "Too much files are opened! Some have to be closed.");
@@ -61,15 +93,23 @@ File::File(const std::string& fullpath, sg_host_t host, void* userdata) : fullpa
   ext->file_descriptor_table->pop_back();
 
   XBT_DEBUG("\tOpen file '%s'", path_.c_str());
-  std::map<std::string, sg_size_t>* content = local_storage_->extension<FileSystemStorageExt>()->get_content();
+  std::map<std::string, sg_size_t>* content = nullptr;
+  if (local_storage_)
+    content = local_storage_->extension<FileSystemStorageExt>()->get_content();
+
+  if (local_disk_)
+    content = local_disk_->extension<FileSystemDiskExt>()->get_content();
+
   // 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());
+  if (content) {
+    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());
+    }
   }
 }
 
@@ -80,36 +120,55 @@ File::~File()
 
 void File::dump()
 {
-  XBT_INFO("File Descriptor information:\n"
-           "\t\tFull path: '%s'\n"
-           "\t\tSize: %llu\n"
-           "\t\tMount point: '%s'\n"
-           "\t\tStorage Id: '%s'\n"
-           "\t\tStorage Type: '%s'\n"
-           "\t\tFile Descriptor Id: %d",
-           get_path(), size_, mount_point_.c_str(), local_storage_->get_cname(), local_storage_->get_type(), desc_id);
+  if (local_storage_)
+    XBT_INFO("File Descriptor information:\n"
+             "\t\tFull path: '%s'\n"
+             "\t\tSize: %llu\n"
+             "\t\tMount point: '%s'\n"
+             "\t\tStorage Id: '%s'\n"
+             "\t\tStorage Type: '%s'\n"
+             "\t\tFile Descriptor Id: %d",
+             get_path(), size_, mount_point_.c_str(), local_storage_->get_cname(), local_storage_->get_type(), desc_id);
+  if (local_disk_)
+    XBT_INFO("File Descriptor information:\n"
+             "\t\tFull path: '%s'\n"
+             "\t\tSize: %llu\n"
+             "\t\tMount point: '%s'\n"
+             "\t\tDisk Id: '%s'\n"
+             "\t\tHost Id: '%s'\n"
+             "\t\tFile Descriptor Id: %d",
+             get_path(), size_, mount_point_.c_str(), local_disk_->get_cname(), local_disk_->get_host()->get_cname(),
+             desc_id);
 }
 
 sg_size_t File::read(sg_size_t size)
 {
   if (size_ == 0) /* Nothing to read, return */
     return 0;
+  sg_size_t read_size = 0;
+  Host* host          = nullptr;
+  if (local_storage_) {
+    /* Find the host where the file is physically located and read it */
+    host = local_storage_->get_host();
+    XBT_DEBUG("READ %s on disk '%s'", get_path(), local_storage_->get_cname());
+    // if the current position is close to the end of the file, we may not be able to read the requested size
+    read_size = local_storage_->read(std::min(size, size_ - current_position_));
+    current_position_ += read_size;
+  }
 
-  /* Find the host where the file is physically located and read it */
-  Host* host = local_storage_->get_host();
-  XBT_DEBUG("READ %s on disk '%s'", get_path(), local_storage_->get_cname());
-  // 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 = local_storage_->read(std::min(size, size_ - current_position_));
-  current_position_ += read_size;
+  if (local_disk_) {
+    /* Find the host where the file is physically located and read it */
+    host = local_disk_->get_host();
+    XBT_DEBUG("READ %s on disk '%s'", get_path(), local_disk_->get_cname());
+    // if the current position is close to the end of the file, we may not be able to read the requested size
+    read_size = local_disk_->read(std::min(size, size_ - current_position_));
+    current_position_ += read_size;
+  }
 
-  if (host->get_name() != Host::current()->get_name()) {
+  if (host && host->get_name() != Host::current()->get_name() && read_size > 0) {
     /* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
     XBT_DEBUG("File is on %s remote host, initiate data transfer of %llu bytes.", host->get_cname(), read_size);
-    std::vector<Host*> m_host_list   = {Host::current(), host};
-    std::vector<double> flops_amount = {0., 0.};
-    std::vector<double> bytes_amount = {0., 0., static_cast<double>(read_size), 0.};
-
-    this_actor::parallel_execute(m_host_list, flops_amount, bytes_amount);
+    host->send_to(Host::current(), read_size);
   }
 
   return read_size;
@@ -120,41 +179,74 @@ sg_size_t File::read(sg_size_t size)
  * @param size of the file to write
  * @return the number of bytes successfully write or -1 if an error occurred
  */
-sg_size_t File::write(sg_size_t size)
+sg_size_t File::write(sg_size_t size, int write_inside)
 {
   if (size == 0) /* Nothing to write, return */
     return 0;
+  sg_size_t write_size = 0;
+  Host* host           = nullptr;
 
   /* Find the host where the file is physically located (remote or local)*/
-  Host* host = local_storage_->get_host();
+  if (local_storage_)
+    host = local_storage_->get_host();
+  if (local_disk_)
+    host = local_disk_->get_host();
 
-  if (host->get_name() != Host::current()->get_name()) {
+  if (host && host->get_name() != Host::current()->get_name()) {
     /* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */
     XBT_DEBUG("File is on %s remote host, initiate data transfer of %llu bytes.", host->get_cname(), size);
-    std::vector<Host*> m_host_list   = {Host::current(), host};
-    std::vector<double> flops_amount = {0, 0};
-    std::vector<double> bytes_amount = {0, static_cast<double>(size), 0, 0};
-
-    this_actor::parallel_execute(m_host_list, flops_amount, bytes_amount);
+    Host::current()->send_to(host, size);
   }
 
-  XBT_DEBUG("WRITE %s on disk '%s'. size '%llu/%llu'", get_path(), local_storage_->get_cname(), size, size_);
-  // If the storage is full before even starting to write
-  if (sg_storage_get_size_used(local_storage_) >= sg_storage_get_size(local_storage_))
-    return 0;
-  /* Substract the part of the file that might disappear from the used sized on the storage element */
-  local_storage_->extension<FileSystemStorageExt>()->decr_used_size(size_ - current_position_);
-
-  sg_size_t write_size = local_storage_->write(size);
-  local_storage_->extension<FileSystemStorageExt>()->incr_used_size(write_size);
+  if (local_storage_) {
+    XBT_DEBUG("WRITE %s on disk '%s'. size '%llu/%llu' '%llu:%llu'", get_path(), local_storage_->get_cname(), size,
+              size_, sg_storage_get_size_used(local_storage_), sg_storage_get_size(local_storage_));
+    // If the storage is full before even starting to write
+    if (sg_storage_get_size_used(local_storage_) >= sg_storage_get_size(local_storage_))
+      return 0;
+    if (write_inside == 0) {
+      /* Substract the part of the file that might disappear from the used sized on the storage element */
+      local_storage_->extension<FileSystemStorageExt>()->decr_used_size(size_ - current_position_);
+      write_size = local_storage_->write(size);
+      local_storage_->extension<FileSystemStorageExt>()->incr_used_size(write_size);
+      current_position_ += write_size;
+      size_ = current_position_;
+    } else {
+      write_size = local_storage_->write(size);
+      current_position_ += write_size;
+      if (current_position_ > size_)
+        size_ = current_position_;
+    }
+    std::map<std::string, sg_size_t>* content = local_storage_->extension<FileSystemStorageExt>()->get_content();
 
-  current_position_ += write_size;
-  size_ = current_position_;
-  std::map<std::string, sg_size_t>* content = local_storage_->extension<FileSystemStorageExt>()->get_content();
+    content->erase(path_);
+    content->insert({path_, size_});
+  }
 
-  content->erase(path_);
-  content->insert({path_, size_});
+  if (local_disk_) {
+    XBT_DEBUG("WRITE %s on disk '%s'. size '%llu/%llu' '%llu:%llu'", get_path(), local_disk_->get_cname(), size, size_,
+              sg_disk_get_size_used(local_disk_), sg_disk_get_size(local_disk_));
+    // If the storage is full before even starting to write
+    if (sg_disk_get_size_used(local_disk_) >= sg_disk_get_size(local_disk_))
+      return 0;
+    if (write_inside == 0) {
+      /* Substract the part of the file that might disappear from the used sized on the storage element */
+      local_disk_->extension<FileSystemDiskExt>()->decr_used_size(size_ - current_position_);
+      write_size = local_disk_->write(size);
+      local_disk_->extension<FileSystemDiskExt>()->incr_used_size(write_size);
+      current_position_ += write_size;
+      size_ = current_position_;
+    } else {
+      write_size = local_disk_->write(size);
+      current_position_ += write_size;
+      if (current_position_ > size_)
+        size_ = current_position_;
+    }
+    std::map<std::string, sg_size_t>* content = local_disk_->extension<FileSystemDiskExt>()->get_content();
 
+    content->erase(path_);
+    content->insert({path_, size_});
+  }
   return write_size;
 }
 
@@ -194,16 +286,22 @@ void File::move(const std::string& fullpath)
 {
   /* Check if the new full path is on the same mount point */
   if (fullpath.compare(0, mount_point_.length(), mount_point_) == 0) {
-    std::map<std::string, sg_size_t>* content = local_storage_->extension<FileSystemStorageExt>()->get_content();
-    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());
+    std::map<std::string, sg_size_t>* content = nullptr;
+    if (local_storage_)
+      content = local_storage_->extension<FileSystemStorageExt>()->get_content();
+    if (local_disk_)
+      content = local_disk_->extension<FileSystemDiskExt>()->get_content();
+    if (content) {
+      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());
@@ -213,14 +311,28 @@ void File::move(const std::string& fullpath)
 int File::unlink()
 {
   /* Check if the file is on local storage */
-  std::map<std::string, sg_size_t>* content = local_storage_->extension<FileSystemStorageExt>()->get_content();
+  std::map<std::string, sg_size_t>* content = nullptr;
+  const char* name = "";
+  if (local_storage_) {
+    content = local_storage_->extension<FileSystemStorageExt>()->get_content();
+    name    = local_storage_->get_cname();
+  }
+  if (local_disk_) {
+    content = local_disk_->extension<FileSystemDiskExt>()->get_content();
+    name    = local_disk_->get_cname();
+  }
 
-  if (content->find(path_) == content->end()) {
-    XBT_WARN("File %s is not on disk %s. Impossible to unlink", path_.c_str(), local_storage_->get_cname());
+  if (not content || content->find(path_) == content->end()) {
+    XBT_WARN("File %s is not on disk %s. Impossible to unlink", path_.c_str(), name);
     return -1;
   } else {
-    XBT_DEBUG("UNLINK %s on disk '%s'", path_.c_str(), local_storage_->get_cname());
-    local_storage_->extension<FileSystemStorageExt>()->decr_used_size(size_);
+    XBT_DEBUG("UNLINK %s on disk '%s'", path_.c_str(), name);
+
+    if (local_storage_)
+      local_storage_->extension<FileSystemStorageExt>()->decr_used_size(size_);
+
+    if (local_disk_)
+      local_disk_->extension<FileSystemDiskExt>()->decr_used_size(size_);
 
     // Remove the file from storage
     content->erase(fullpath_);
@@ -232,49 +344,86 @@ int File::unlink()
 int File::remote_copy(sg_host_t host, const char* fullpath)
 {
   /* Find the host where the file is physically located and read it */
-  Storage* storage_src = local_storage_;
-  Host* src_host       = storage_src->get_host();
+  Host* src_host = nullptr;
+  if (local_storage_) {
+    src_host = local_storage_->get_host();
+    XBT_DEBUG("READ %s on disk '%s'", get_path(), local_storage_->get_cname());
+  }
+
+  if (local_disk_) {
+    src_host = local_disk_->get_host();
+    XBT_DEBUG("READ %s on disk '%s'", get_path(), local_disk_->get_cname());
+  }
+
   seek(0, SEEK_SET);
-  XBT_DEBUG("READ %s on disk '%s'", get_path(), local_storage_->get_cname());
   // 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 = local_storage_->read(size_);
+  sg_size_t read_size = 0;
+  if (local_storage_)
+    read_size = local_storage_->read(size_);
+  if (local_disk_)
+    read_size = local_disk_->read(size_);
+
   current_position_ += read_size;
 
-  /* Find the host that owns the storage where the file has to be copied */
-  Storage* storage_dest = nullptr;
-  Host* dst_host;
-  size_t longest_prefix_length = 0;
-
-  for (auto const& elm : host->get_mounted_storages()) {
-    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*/
-      longest_prefix_length = elm.first.length();
-      storage_dest          = elm.second;
+  Host* dst_host = host;
+  if (local_storage_) {
+    /* Find the host that owns the storage where the file has to be copied */
+    Storage* storage_dest        = nullptr;
+    size_t longest_prefix_length = 0;
+
+    for (auto const& elm : host->get_mounted_storages()) {
+      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*/
+        longest_prefix_length = elm.first.length();
+        storage_dest          = elm.second;
+      }
     }
-  }
 
-  if (storage_dest != nullptr) {
-    /* Mount point found, retrieve the host the storage is attached to */
-    dst_host = storage_dest->get_host();
-  } else {
-    XBT_WARN("Can't find mount point for '%s' on destination host '%s'", fullpath, host->get_cname());
-    return -1;
+    if (storage_dest != nullptr) {
+      /* Mount point found, retrieve the host the storage is attached to */
+      dst_host = storage_dest->get_host();
+    } else {
+      XBT_WARN("Can't find mount point for '%s' on destination host '%s'", fullpath, host->get_cname());
+      return -1;
+    }
   }
 
-  XBT_DEBUG("Initiate data transfer of %llu bytes between %s and %s.", read_size, src_host->get_cname(),
-            storage_dest->get_host()->get_cname());
-  std::vector<Host*> m_host_list   = {src_host, dst_host};
-  std::vector<double> flops_amount = {0, 0};
-  std::vector<double> bytes_amount = {0, static_cast<double>(read_size), 0, 0};
+  if (local_disk_) {
+    size_t longest_prefix_length = 0;
+    Disk* dst_disk               = nullptr;
+
+    for (auto const& disk : host->get_disks()) {
+      std::string current_mount = disk->extension<FileSystemDiskExt>()->get_mount_point();
+      std::string mount_point   = std::string(fullpath).substr(0, current_mount.length());
+      if (mount_point == current_mount && current_mount.length() > longest_prefix_length) {
+        /* The current mount name is found in the full path and is bigger than the previous*/
+        longest_prefix_length = current_mount.length();
+        dst_disk              = disk;
+      }
+    }
+
+    if (dst_disk == nullptr) {
+      XBT_WARN("Can't find mount point for '%s' on destination host '%s'", fullpath, host->get_cname());
+      return -1;
+    }
+  }
 
-  this_actor::parallel_execute(m_host_list, flops_amount, bytes_amount);
+  if (src_host) {
+    XBT_DEBUG("Initiate data transfer of %llu bytes between %s and %s.", read_size, src_host->get_cname(),
+              dst_host->get_cname());
+    src_host->send_to(dst_host, read_size);
+  }
 
   /* Create file on remote host, write it and close it */
   File* fd = new File(fullpath, dst_host, nullptr);
-  sg_size_t write_size = fd->local_storage_->write(read_size);
-  fd->local_storage_->extension<FileSystemStorageExt>()->incr_used_size(write_size);
-  (*(fd->local_storage_->extension<FileSystemStorageExt>()->get_content()))[path_] = size_;
+  if (local_storage_) {
+    sg_size_t write_size = fd->local_storage_->write(read_size);
+    fd->local_storage_->extension<FileSystemStorageExt>()->incr_used_size(write_size);
+    (*(fd->local_storage_->extension<FileSystemStorageExt>()->get_content()))[path_] = size_;
+  }
+  if (local_disk_)
+    fd->write(read_size);
   delete fd;
   return 0;
 }
@@ -286,15 +435,54 @@ int File::remote_move(sg_host_t host, const char* fullpath)
   return res;
 }
 
+FileSystemDiskExt::FileSystemDiskExt(simgrid::s4u::Disk* ptr)
+{
+  const char* size_str    = ptr->get_property("size");
+  if (size_str)
+    size_ = surf_parse_get_size(size_str, "disk size", ptr->get_name());
+
+  const char* current_mount_str = ptr->get_property("mount");
+  if (current_mount_str)
+    mount_point_ = std::string(current_mount_str);
+  else
+    mount_point_ = std::string("/");
+
+  const char* content_str = ptr->get_property("content");
+  if (content_str)
+    content_.reset(parse_content(content_str));
+}
+
 FileSystemStorageExt::FileSystemStorageExt(simgrid::s4u::Storage* ptr)
 {
-  content_ = parse_content(ptr->get_impl()->content_name);
+  content_.reset(parse_content(ptr->get_impl()->content_name_));
   size_    = ptr->get_impl()->size_;
 }
 
-FileSystemStorageExt::~FileSystemStorageExt()
+std::map<std::string, sg_size_t>* FileSystemDiskExt::parse_content(const std::string& filename)
 {
-  delete content_;
+  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));
+
+      used_size_ += size;
+      parse_content->insert({tokens.front(), size});
+    }
+  } while (not fs->eof());
+  delete fs;
+  return parse_content;
 }
 
 std::map<std::string, sg_size_t>* FileSystemStorageExt::parse_content(const std::string& filename)
@@ -326,9 +514,14 @@ std::map<std::string, sg_size_t>* FileSystemStorageExt::parse_content(const std:
 }
 }
 
-using simgrid::s4u::FileSystemStorageExt;
 using simgrid::s4u::FileDescriptorHostExt;
+using simgrid::s4u::FileSystemDiskExt;
+using simgrid::s4u::FileSystemStorageExt;
 
+static void on_disk_creation(simgrid::s4u::Disk& d)
+{
+  d.extension_set(new FileSystemDiskExt(&d));
+}
 static void on_storage_creation(simgrid::s4u::Storage& st)
 {
   st.extension_set(new FileSystemStorageExt(&st));
@@ -339,6 +532,51 @@ static void on_host_creation(simgrid::s4u::Host& host)
   host.extension_set<FileDescriptorHostExt>(new FileDescriptorHostExt());
 }
 
+static void on_platform_created()
+{
+  for (auto const& host : simgrid::s4u::Engine::get_instance()->get_all_hosts()) {
+    const char* remote_disk_str = host->get_property("remote_disk");
+    if (remote_disk_str) {
+      std::vector<std::string> tokens;
+      boost::split(tokens, remote_disk_str, boost::is_any_of(":"));
+      std::string mount_point         = tokens[0];
+      simgrid::s4u::Host* remote_host = simgrid::s4u::Host::by_name_or_null(tokens[2]);
+      xbt_assert(remote_host, "You're trying to access a host that does not exist. Please check your platform file");
+
+      simgrid::s4u::Disk* disk = nullptr;
+      for (auto const& d : remote_host->get_disks())
+        if (d->get_name() == tokens[1]) {
+          disk = d;
+          break;
+        }
+
+      xbt_assert(disk, "You're trying to mount a disk that does not exist. Please check your platform file");
+      disk->extension<FileSystemDiskExt>()->add_remote_mount(remote_host, mount_point);
+      host->add_disk(disk);
+
+      XBT_DEBUG("Host '%s' wants to mount a remote disk: %s of %s mounted on %s", host->get_cname(), disk->get_cname(),
+                remote_host->get_cname(), mount_point.c_str());
+      XBT_DEBUG("Host '%s' now has %zu disks", host->get_cname(), host->get_disks().size());
+    }
+  }
+}
+
+static void on_simulation_end()
+{
+  XBT_DEBUG("Simulation is over, time to unregister remote disks if any");
+  for (auto const& host : simgrid::s4u::Engine::get_instance()->get_all_hosts()) {
+    const char* remote_disk_str = host->get_property("remote_disk");
+    if (remote_disk_str) {
+      std::vector<std::string> tokens;
+      boost::split(tokens, remote_disk_str, boost::is_any_of(":"));
+      XBT_DEBUG("Host '%s' wants to unmount a remote disk: %s of %s mounted on %s", host->get_cname(),
+                tokens[1].c_str(), tokens[2].c_str(), tokens[0].c_str());
+      host->remove_disk(tokens[1]);
+      XBT_DEBUG("Host '%s' now has %zu disks", host->get_cname(), host->get_disks().size());
+    }
+  }
+}
+
 /* **************************** Public interface *************************** */
 void sg_storage_file_system_init()
 {
@@ -351,10 +589,17 @@ void sg_storage_file_system_init()
     simgrid::s4u::Storage::on_creation.connect(&on_storage_creation);
   }
 
+  if (not FileSystemDiskExt::EXTENSION_ID.valid()) {
+    FileSystemDiskExt::EXTENSION_ID = simgrid::s4u::Disk::extension_create<FileSystemDiskExt>();
+    simgrid::s4u::Disk::on_creation.connect(&on_disk_creation);
+  }
+
   if (not FileDescriptorHostExt::EXTENSION_ID.valid()) {
     FileDescriptorHostExt::EXTENSION_ID = simgrid::s4u::Host::extension_create<FileDescriptorHostExt>();
     simgrid::s4u::Host::on_creation.connect(&on_host_creation);
   }
+  simgrid::s4u::Engine::on_platform_created.connect(&on_platform_created);
+  simgrid::s4u::Engine::on_simulation_end.connect(&on_simulation_end);
 }
 
 sg_file_t sg_file_open(const char* fullpath, void* data)
@@ -458,6 +703,26 @@ int sg_file_rmove(sg_file_t file, sg_host_t host, const char* fullpath)
   return file->remote_move(host, fullpath);
 }
 
+sg_size_t sg_disk_get_size_free(sg_disk_t d)
+{
+  return d->extension<FileSystemDiskExt>()->get_size() - d->extension<FileSystemDiskExt>()->get_used_size();
+}
+
+sg_size_t sg_disk_get_size_used(sg_disk_t d)
+{
+  return d->extension<FileSystemDiskExt>()->get_used_size();
+}
+
+sg_size_t sg_disk_get_size(sg_disk_t d)
+{
+  return d->extension<FileSystemDiskExt>()->get_size();
+}
+
+const char* sg_disk_get_mount_point(sg_disk_t d)
+{
+  return d->extension<FileSystemDiskExt>()->get_mount_point();
+}
+
 sg_size_t sg_storage_get_size_free(sg_storage_t st)
 {
   return st->extension<FileSystemStorageExt>()->get_size() - st->extension<FileSystemStorageExt>()->get_used_size();
index d94c836..86eecf1 100644 (file)
@@ -293,19 +293,17 @@ public:
         task_id           = 0;
       }
     });
-    simgrid::kernel::activity::ExecImpl::on_creation.connect(
-        [this](simgrid::kernel::activity::ExecImpl const& activity) {
-          if (activity.get_host() == get_host())
-            pre_task();
-        });
-    simgrid::kernel::activity::ExecImpl::on_completion.connect(
-        [this](simgrid::kernel::activity::ExecImpl const& activity) {
-          // For more than one host (not yet supported), we can access the host via
-          // simcalls_.front()->issuer->iface()->get_host()
-          if (activity.get_host() == get_host() && iteration_running) {
-            comp_timer += activity.surf_action_->get_finish_time() - activity.surf_action_->get_start_time();
-          }
-        });
+    simgrid::s4u::Exec::on_start.connect([this](simgrid::s4u::Actor const&, simgrid::s4u::Exec const& activity) {
+      if (activity.get_host() == get_host())
+        pre_task();
+    });
+    simgrid::s4u::Exec::on_completion.connect([this](simgrid::s4u::Actor const&, simgrid::s4u::Exec const& activity) {
+      // For more than one host (not yet supported), we can access the host via
+      // simcalls_.front()->issuer->iface()->get_host()
+      if (activity.get_host() == get_host() && iteration_running) {
+        comp_timer += activity.get_finish_time() - activity.get_start_time();
+      }
+    });
     // FIXME I think that this fires at the same time for all hosts, so when the src sends something,
     // the dst will be notified even though it didn't even arrive at the recv yet
     simgrid::s4u::Link::on_communicate.connect(
@@ -336,9 +334,8 @@ public:
   {
     double computed_flops = sg_host_get_computed_flops(get_host()) - comp_counter;
     double target_time    = (simgrid::s4u::Engine::get_clock() - start_time);
-    target_time =
-        target_time *
-        static_cast<double>(99.0 / 100.0); // FIXME We account for t_copy arbitrarily with 1% -- this needs to be fixed
+    target_time           = target_time * 99.0 / 100.0; // FIXME We account for t_copy arbitrarily with 1%
+                                                        // -- this needs to be fixed
 
     bool is_initialized         = rates[task_id][best_pstate] != 0;
     rates[task_id][best_pstate] = computed_flops / comp_timer;
@@ -440,7 +437,7 @@ static void on_host_added(simgrid::s4u::Host& host)
 
 /* **************************** Public interface *************************** */
 
-/** @ingroup SURF_plugin_load
+/**
  * @brief Initializes the HostDvfs plugin
  * @details The HostDvfs plugin provides an API to get the current load of each host.
  */
index 92a6b5c..f1167b8 100644 (file)
@@ -5,8 +5,9 @@
 
 #include "simgrid/plugins/energy.h"
 #include "simgrid/s4u/Engine.hpp"
-#include "src/kernel/activity/ExecImpl.hpp"
+#include "simgrid/s4u/Exec.hpp"
 #include "src/include/surf/surf.hpp"
+#include "src/kernel/activity/ExecImpl.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "src/surf/cpu_interface.hpp"
 
@@ -15,7 +16,7 @@
 
 SIMGRID_REGISTER_PLUGIN(host_energy, "Cpu energy consumption.", &sg_host_energy_plugin_init)
 
-/** @addtogroup plugin_energy
+/** @defgroup plugin_host_energy
 
 This is the energy plugin, enabling to account not only for computation time, but also for the dissipated energy in the
 simulated platform.
@@ -29,66 +30,52 @@ abnormality when all the cores are idle. The full details are in
 
 As a result, our energy model takes 4 parameters:
 
-  - @b Idle: instantaneous consumption (in Watt) when your host is up and running, but without anything to do.
-  - @b OneCore: instantaneous consumption (in Watt) when only one core is active, at 100%.
-  - @b AllCores: instantaneous consumption (in Watt) when all cores of the host are at 100%.
-  - @b Off: instantaneous consumption (in Watt) when the host is turned off.
+  - @b Idle: wattage (i.e., instantaneous consumption in Watt) when your host is up and running, but without anything to
+do.
+  - @b Epsilon: wattage when all cores are at 0 or epsilon%, but not in Idle state.
+  - @b AllCores: wattage when all cores of the host are at 100%.
+  - @b Off: wattage when the host is turned off.
 
 Here is an example of XML declaration:
 
 @code{.xml}
-<host id="HostA" power="100.0Mf" cores="4">
-    <prop id="watt_per_state" value="100.0:120.0:200.0" />
-    <prop id="watt_off" value="10" />
+<host id="HostA" speed="100.0Mf" core="4">
+    <prop id="wattage_per_state" value="100.0:120.0:200.0" />
+    <prop id="wattage_off" value="10" />
 </host>
 @endcode
 
-This example gives the following parameters: @b Off is 10 Watts; @b Idle is 100 Watts; @b OneCore is 120 Watts and @b
+If the 'Epsilon' parameter is omitted in the XML declaration, 'Idle' is used instead.
+
+This example gives the following parameters: @b Off is 10 Watts; @b Idle is 100 Watts; @b Epsilon is 120 Watts and @b
 AllCores is 200 Watts.
-This is enough to compute the consumption as a function of the amount of loaded cores:
+This is enough to compute the wattage as a function of the amount of loaded cores:
 
 <table>
-<tr><th>@#Cores loaded</th><th>Consumption</th><th>Explanation</th></tr>
-<tr><td>0</td><td> 100 Watts</td><td>Idle value</td></tr>
-<tr><td>1</td><td> 120 Watts</td><td>OneCore value</td></tr>
-<tr><td>2</td><td> 147 Watts</td><td>linear extrapolation between OneCore and AllCores</td></tr>
-<tr><td>3</td><td> 173 Watts</td><td>linear extrapolation between OneCore and AllCores</td></tr>
+<tr><th>@#Cores loaded</th><th>Wattage</th><th>Explanation</th></tr>
+<tr><td>0 (idle)</td><td> 100 Watts</td><td>Idle value</td></tr>
+<tr><td>0 (not idle)</td><td> 120 Watts</td><td>Epsilon value</td></tr>
+<tr><td>1</td><td> 140 Watts</td><td>linear extrapolation between Epsilon and AllCores</td></tr>
+<tr><td>2</td><td> 160 Watts</td><td>linear extrapolation between Epsilon and AllCores</td></tr>
+<tr><td>3</td><td> 180 Watts</td><td>linear extrapolation between Epsilon and AllCores</td></tr>
 <tr><td>4</td><td> 200 Watts</td><td>AllCores value</td></tr>
 </table>
 
-### 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.
-
-### 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 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}
-<host id="HostC" power="100.0Mf" cores="1">
-    <prop id="watt_per_state" value="95.0:200.0" /> <!-- we may have used '95:200:200' instead -->
-    <prop id="watt_off" value="10" />
-</host>
-@endcode
 
 ### 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:
 
 @code{.xml}
-<host id="HostC" power="100.0Mf,50.0Mf,20.0Mf" cores="4">
-    <prop id="watt_per_state" value="95.0:120.0:200.0, 93.0:115.0:170.0, 90.0:110.0:150.0" />
-    <prop id="watt_off" value="10" />
+<host id="HostC" speed="100.0Mf,50.0Mf,20.0Mf" core="4">
+    <prop id="wattage_per_state" value="95.0:120.0:200.0, 93.0:115.0:170.0, 90.0:110.0:150.0" />
+    <prop id="wattage_off" value="10" />
 </host>
 @endcode
 
 This encodes the following values
 <table>
-<tr><th>pstate</th><th>Performance</th><th>Idle</th><th>OneCore</th><th>AllCores</th></tr>
+<tr><th>pstate</th><th>Performance</th><th>Idle</th><th>Epsilon</th><th>AllCores</th></tr>
 <tr><td>0</td><td>100 Mflop/s</td><td>95 Watts</td><td>120 Watts</td><td>200 Watts</td></tr>
 <tr><td>1</td><td>50 Mflop/s</td><td>93 Watts</td><td>115 Watts</td><td>170 Watts</td></tr>
 <tr><td>2</td><td>20 Mflop/s</td><td>90 Watts</td><td>110 Watts</td><td>150 Watts</td></tr>
@@ -117,10 +104,11 @@ namespace plugin {
 class PowerRange {
 public:
   double idle_;
-  double min_;
+  double epsilon_;
   double max_;
+  double slope_;
 
-  PowerRange(double idle, double min, double max) : idle_(idle), min_(min), max_(max) {}
+  PowerRange(double idle, double epsilon, double max) : idle_(idle), epsilon_(epsilon), max_(max), slope_(max-epsilon) {}
 };
 
 class HostEnergy {
@@ -137,12 +125,13 @@ public:
   double get_idle_consumption();
   double get_watt_min_at(int pstate);
   double get_watt_max_at(int pstate);
+  double get_power_range_slope_at(int pstate);
   void update();
 
 private:
   void init_watts_range_list();
   simgrid::s4u::Host* host_ = nullptr;
-  /*< List of (min_power,max_power) pairs corresponding to each cpu pstate */
+  /*< List of (idle_power, epsilon_power, max_power) tuple corresponding to each cpu pstate */
   std::vector<PowerRange> power_range_watts_list_;
 
   /* We need to keep track of what pstate has been used, as we will sometimes be notified only *after* a pstate has been
@@ -177,16 +166,16 @@ void HostEnergy::update()
   if (start_time < finish_time) {
     double previous_energy = this->total_energy_;
 
-    double instantaneous_consumption = this->get_current_watts_value();
+    double instantaneous_power_consumption = this->get_current_watts_value();
 
-    double energy_this_step = instantaneous_consumption * (finish_time - start_time);
+    double energy_this_step = instantaneous_power_consumption * (finish_time - start_time);
 
     // 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;
 
-    XBT_DEBUG("[update_energy of %s] period=[%.8f-%.8f]; current speed=%.2E flop/s (pstate %i); total consumption before: consumption change: %.8f J -> added now: %.8f J",
+    XBT_DEBUG("[update_energy of %s] period=[%.8f-%.8f]; current speed=%.2E flop/s (pstate %i); total consumption before: %.8f J -> added now: %.8f J",
               host_->get_cname(), start_time, finish_time, host_->pimpl_cpu->get_pstate_peak_speed(this->pstate_), this->pstate_, previous_energy,
               energy_this_step);
   }
@@ -198,13 +187,21 @@ void HostEnergy::update()
 HostEnergy::HostEnergy(simgrid::s4u::Host* ptr) : host_(ptr), last_updated_(surf_get_clock())
 {
   init_watts_range_list();
-
-  const char* off_power_str = host_->get_property("watt_off");
+  static bool warned = false;
+
+  const char* off_power_str = host_->get_property("wattage_off");
+  if (off_power_str == nullptr) {
+    off_power_str = host_->get_property("watt_off");
+    if (off_power_str != nullptr && not warned) {
+      warned = true;
+      XBT_WARN("Please use 'wattage_off' instead of 'watt_off' to define the idle wattage of hosts in your XML.");
+    }
+  }
   if (off_power_str != nullptr) {
     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_->get_cname() +
+    } catch (const std::invalid_argument&) {
+      throw std::invalid_argument(std::string("Invalid value for property wattage_off of host ") + host_->get_cname() +
                                   ": " + off_power_str);
     }
   }
@@ -225,7 +222,7 @@ double HostEnergy::get_watt_min_at(int pstate)
 {
   xbt_assert(not power_range_watts_list_.empty(), "No power range properties specified for host %s",
              host_->get_cname());
-  return power_range_watts_list_[pstate].min_;
+  return power_range_watts_list_[pstate].epsilon_;
 }
 
 double HostEnergy::get_watt_max_at(int pstate)
@@ -235,6 +232,13 @@ double HostEnergy::get_watt_max_at(int pstate)
   return power_range_watts_list_[pstate].max_;
 }
 
+double HostEnergy::get_power_range_slope_at(int pstate)
+{
+    xbt_assert(not power_range_watts_list_.empty(), "No power range properties specified for host %s",
+               host_->get_cname());
+   return power_range_watts_list_[pstate].slope_;
+}
+
 /** @brief Computes the power consumed by the host according to the current situation
  *
  * - If the host is off, that's the watts_off value
@@ -255,7 +259,7 @@ double HostEnergy::get_current_watts_value()
   else {
     cpu_load = host_->pimpl_cpu->get_constraint()->get_usage() / current_speed;
 
-    /** Divide by the number of cores here **/
+    /* Divide by the number of cores here to have a value between 0 and 1 */
     cpu_load /= host_->pimpl_cpu->get_core_count();
 
     if (cpu_load > 1) // A machine with a load > 1 consumes as much as a fully loaded machine, not more
@@ -264,13 +268,6 @@ double HostEnergy::get_current_watts_value()
       host_was_used_ = true;
   }
 
-  /* The problem with this model is that the load is always 0 or 1, never something less.
-   * Another possibility could be to model the total energy as
-   *
-   *   X/(X+Y)*W_idle + Y/(X+Y)*W_burn
-   *
-   * where X is the amount of idling cores, and Y the amount of computing cores.
-   */
   return get_current_watts_value(cpu_load);
 }
 
@@ -288,44 +285,29 @@ double HostEnergy::get_current_watts_value(double cpu_load)
     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_);
+  PowerRange power_range = power_range_watts_list_.at(this->pstate_);
   double current_power;
-  double min_power;
-  double max_power;
-  double power_slope;
-
-  if (cpu_load > 0) { /* Something is going on, the machine is not idle */
-    min_power = range.min_;
-    max_power = range.max_;
-
-    /**
-     * The min_power states how much we consume when only one single
-     * core is working. This means that when cpu_load == 1/coreCount, then
-     * current_power == min_power.
-     *
-     * The maximum must be reached when all cores are working (but 1 core was
-     * already accounted for by min_power)
-     * i.e., we need min_power + (maxCpuLoad-1/coreCount)*power_slope == max_power
-     * (maxCpuLoad is by definition 1)
-     */
-    int coreCount         = host_->get_core_count();
-    double coreReciprocal = static_cast<double>(1) / static_cast<double>(coreCount);
-    if (coreCount > 1)
-      power_slope = (max_power - min_power) / (1 - coreReciprocal);
-    else
-      power_slope = 0; // Should be 0, since max_power == min_power (in this case)
-
-    current_power = min_power + (cpu_load - coreReciprocal) * power_slope;
-  } else { /* Our machine is idle, take the dedicated value! */
-    min_power     = 0;
-    max_power     = 0;
-    power_slope   = 0;
-    current_power = range.idle_;
+
+  if (cpu_load > 0)
+  {
+      /**
+       * Something is going on, the host is not idle.
+       *
+       * The power consumption follows the regular model:
+       * P(cpu_load) = Pstatic + Pdynamic * cpu_load
+       * where Pstatic = power_range.epsilon_ and Pdynamic = power_range.slope_
+       * and the cpu_load is a value between 0 and 1.
+       */
+      current_power = power_range.epsilon_ + cpu_load * power_range.slope_;
+  }
+  else
+  {
+      /* The host is idle, take the dedicated value! */
+      current_power = power_range.idle_;
   }
 
-  XBT_DEBUG("[get_current_watts] pstate=%i, min_power=%f, max_power=%f, slope=%f", this->pstate_, min_power, max_power, power_slope);
+  XBT_DEBUG("[get_current_watts] pstate=%i, epsilon_power=%f, max_power=%f, slope=%f", this->pstate_, power_range.epsilon_,
+            power_range.max_, power_range.slope_);
   XBT_DEBUG("[get_current_watts] Current power (watts) = %f, load = %f", current_power, cpu_load);
 
   return current_power;
@@ -334,65 +316,102 @@ double HostEnergy::get_current_watts_value(double cpu_load)
 double HostEnergy::get_consumed_energy()
 {
   if (last_updated_ < surf_get_clock()) // We need to simcall this as it modifies the environment
-    simgrid::simix::simcall(std::bind(&HostEnergy::update, this));
+    simgrid::kernel::actor::simcall(std::bind(&HostEnergy::update, this));
 
   return total_energy_;
 }
 
 void HostEnergy::init_watts_range_list()
 {
-  const char* all_power_values_str = host_->get_property("watt_per_state");
+  const char* old_prop = host_->get_property("watt_per_state");
+  if (old_prop != nullptr) {
+    std::vector<std::string> all_power_values;
+    boost::split(all_power_values, old_prop, boost::is_any_of(","));
+
+    std::string msg = std::string("DEPRECATION WARNING: Property 'watt_per_state' will not work after v3.28.\n");
+    msg += std::string("The old syntax 'Idle:OneCore:AllCores' must be converted into 'Idle:Epsilon:AllCores' to "
+                       "properly model the consumption of non-whole tasks on mono-core hosts. Here are the values to "
+                       "use for host '") +
+           host_->get_cname() + "' in your XML file:\n";
+    msg += "     <prop id=\"wattage_per_state\" value=\"";
+    for (auto const& current_power_values_str : all_power_values) {
+      std::vector<std::string> current_power_values;
+      boost::split(current_power_values, current_power_values_str, boost::is_any_of(":"));
+      double p_idle = xbt_str_parse_double((current_power_values.at(0)).c_str(),
+                                           "Invalid obsolete XML file. Fix your watt_per_state property.");
+      double p_one_core;
+      double p_full;
+      double p_epsilon;
+
+      if (current_power_values.size() == 2) { // Case: Idle:AllCores
+        p_full    = xbt_str_parse_double((current_power_values.at(1)).c_str(),
+                                      "Invalid obsolete XML file. Fix your watt_per_state property.");
+        p_epsilon = p_full;
+      } else { // Case: Idle:Epsilon:AllCores
+        p_one_core = xbt_str_parse_double((current_power_values.at(1)).c_str(),
+                                          "Invalid obsolete XML file. Fix your watt_per_state property.");
+        p_full     = xbt_str_parse_double((current_power_values.at(2)).c_str(),
+                                      "Invalid obsolete XML file. Fix your watt_per_state property.");
+        if (host_->get_core_count() == 1)
+          p_epsilon = p_full;
+        else
+          p_epsilon = p_one_core - ((p_full - p_one_core) / (host_->get_core_count() - 1));
+      }
+      PowerRange range(p_idle, p_epsilon, p_full);
+      power_range_watts_list_.push_back(range);
+
+      msg += std::to_string(p_idle) + ":" + std::to_string(p_epsilon) + ":" + std::to_string(p_full);
+      msg += ",";
+    }
+    msg.pop_back(); // Remove the extraneous ','
+    msg += "\" />";
+    XBT_WARN("%s", msg.c_str());
+    return;
+  }
+  const char* all_power_values_str = host_->get_property("wattage_per_state");
   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(","));
-  XBT_DEBUG("%s: profile: %s, cores: %d", host_->get_cname(), all_power_values_str, host_->get_core_count());
+  XBT_DEBUG("%s: power properties: %s", host_->get_cname(), all_power_values_str);
 
   int i = 0;
   for (auto const& current_power_values_str : all_power_values) {
-    /* retrieve the power values associated with the current pstate */
+    /* retrieve the power values associated with the pstate i */
     std::vector<std::string> current_power_values;
     boost::split(current_power_values, current_power_values_str, boost::is_any_of(":"));
-    if (host_->get_core_count() == 1) {
-      xbt_assert(current_power_values.size() == 2 || current_power_values.size() == 3,
-                 "Power properties incorrectly defined for host %s."
-                 "It should be 'Idle:FullSpeed' power values because you have one core only.",
-                 host_->get_cname());
-      if (current_power_values.size() == 2) {
-        // In this case, 1core == AllCores
-        current_power_values.push_back(current_power_values.at(1));
-      } else { // size == 3
-        current_power_values[1] = current_power_values.at(2);
-        current_power_values[2] = current_power_values.at(2);
-        static bool displayed_warning = false;
-        if (not displayed_warning) { // Otherwise we get in the worst case no_pstate*no_hosts warnings
-          XBT_WARN("Host %s is a single-core machine and part of the power profile is '%s'"
-                   ", which is in the 'Idle:OneCore:AllCores' format."
-                   " Here, only the value for 'AllCores' is used.", host_->get_cname(), current_power_values_str.c_str());
-          displayed_warning = true;
-        }
-      }
-    } else {
-      xbt_assert(current_power_values.size() == 3,
-                 "Power properties incorrectly defined for host %s."
-                 "It should be 'Idle:OneCore:AllCores' power values because you have more than one core.",
-                 host_->get_cname());
+
+    xbt_assert(current_power_values.size() == 2 || current_power_values.size() == 3,
+               "Power properties incorrectly defined for host %s."
+               "It should be 'Idle:AllCores' (or 'Idle:Epsilon:AllCores') power values.",
+               host_->get_cname());
+
+    double idle_power;
+    double epsilon_power;
+    double max_power;
+
+    char* msg_idle    = bprintf("Invalid Idle value for pstate %d on host %s: %%s", i, host_->get_cname());
+    char* msg_epsilon = bprintf("Invalid Epsilon value for pstate %d on host %s: %%s", i, host_->get_cname());
+    char* msg_max     = bprintf("Invalid AllCores value for pstate %d on host %s: %%s", i, host_->get_cname());
+
+    idle_power = xbt_str_parse_double((current_power_values.at(0)).c_str(), msg_idle);
+    if (current_power_values.size() == 2) { // Case: Idle:AllCores
+      epsilon_power = xbt_str_parse_double((current_power_values.at(0)).c_str(), msg_idle);
+      max_power     = xbt_str_parse_double((current_power_values.at(1)).c_str(), msg_max);
+    } else { // Case: Idle:Epsilon:AllCores
+      epsilon_power = xbt_str_parse_double((current_power_values.at(1)).c_str(), msg_epsilon);
+      max_power     = xbt_str_parse_double((current_power_values.at(2)).c_str(), msg_max);
     }
 
-    /* min_power corresponds to the idle power (cpu load = 0) */
-    /* max_power is the power consumed at 100% cpu load       */
-    char* msg_idle = bprintf("Invalid idle value for pstate %d on host %s: %%s", i, host_->get_cname());
-    char* msg_min  = bprintf("Invalid OneCore value for pstate %d on host %s: %%s", i, host_->get_cname());
-    char* msg_max  = bprintf("Invalid AllCores value for pstate %d on host %s: %%s", i, host_->get_cname());
-    PowerRange range(xbt_str_parse_double((current_power_values.at(0)).c_str(), msg_idle),
-                     xbt_str_parse_double((current_power_values.at(1)).c_str(), msg_min),
-                     xbt_str_parse_double((current_power_values.at(2)).c_str(), msg_max));
+    XBT_DEBUG("Creating PowerRange for host %s. Idle:%f, Epsilon:%f, AllCores:%f.", host_->get_cname(), idle_power, epsilon_power, max_power);
+
+    PowerRange range(idle_power, epsilon_power, max_power);
     power_range_watts_list_.push_back(range);
     xbt_free(msg_idle);
-    xbt_free(msg_min);
+    xbt_free(msg_epsilon);
     xbt_free(msg_max);
-    i++;
+    ++i;
   }
 }
 } // namespace plugin
@@ -411,10 +430,10 @@ static void on_creation(simgrid::s4u::Host& host)
   host.extension_set(new HostEnergy(&host));
 }
 
-static void on_action_state_change(simgrid::surf::CpuAction const& action,
+static void on_action_state_change(simgrid::kernel::resource::CpuAction const& action,
                                    simgrid::kernel::resource::Action::State /*previous*/)
 {
-  for (simgrid::surf::Cpu* const& cpu : action.cpus()) {
+  for (simgrid::kernel::resource::Cpu* const& cpu : action.cpus()) {
     simgrid::s4u::Host* host = cpu->get_host();
     if (host != nullptr) {
 
@@ -474,7 +493,7 @@ static void on_simulation_end()
 
 /* **************************** Public interface *************************** */
 
-/** @ingroup plugin_energy
+/** @ingroup plugin_host_energy
  * @brief Enable host energy plugin
  * @details Enable energy plugin to get joules consumption of each cpu. Call this function before #MSG_init().
  */
@@ -489,27 +508,27 @@ void sg_host_energy_plugin_init()
   simgrid::s4u::Host::on_state_change.connect(&on_host_change);
   simgrid::s4u::Host::on_speed_change.connect(&on_host_change);
   simgrid::s4u::Host::on_destruction.connect(&on_host_destruction);
-  simgrid::s4u::on_simulation_end.connect(&on_simulation_end);
-  simgrid::surf::CpuAction::on_state_change.connect(&on_action_state_change);
+  simgrid::s4u::Engine::on_simulation_end.connect(&on_simulation_end);
+  simgrid::kernel::resource::CpuAction::on_state_change.connect(&on_action_state_change);
   // We may only have one actor on a node. If that actor executes something like
   //   compute -> recv -> compute
   // the recv operation will not trigger a "CpuAction::on_state_change". This means
   // that the next trigger would be the 2nd compute, hence ignoring the idle time
   // during the recv call. By updating at the beginning of a compute, we can
   // fix that. (If the cpu is not idle, this is not required.)
-  simgrid::kernel::activity::ExecImpl::on_creation.connect([](simgrid::kernel::activity::ExecImpl const& activity) {
+  simgrid::s4u::Exec::on_start.connect([](simgrid::s4u::Actor const&, simgrid::s4u::Exec const& activity) {
     if (activity.get_host_number() == 1) { // We only run on one host
       simgrid::s4u::Host* host         = activity.get_host();
       simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
       if (vm != nullptr)
         host = vm->get_pm();
-
+      xbt_assert(host != nullptr);
       host->extension<HostEnergy>()->update();
     }
   });
 }
 
-/** @ingroup plugin_energy
+/** @ingroup plugin_host_energy
  *  @brief updates the consumption of all hosts
  *
  * After this call, sg_host_get_consumed_energy() will not interrupt your process
@@ -517,15 +536,17 @@ void sg_host_energy_plugin_init()
  */
 void sg_host_energy_update_all()
 {
-  simgrid::simix::simcall([]() {
+  simgrid::kernel::actor::simcall([]() {
     std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::get_instance()->get_all_hosts();
     for (auto const& host : list)
-      if (dynamic_cast<simgrid::s4u::VirtualMachine*>(host) == nullptr) // Ignore virtual machines
+      if (dynamic_cast<simgrid::s4u::VirtualMachine*>(host) == nullptr) { // Ignore virtual machines
+        xbt_assert(host != nullptr);
         host->extension<HostEnergy>()->update();
+      }
   });
 }
 
-/** @ingroup plugin_energy
+/** @ingroup plugin_host_energy
  *  @brief Returns the total energy consumed by the host so far (in Joules)
  *
  *  Please note that since the consumption is lazily updated, it may require a simcall to update it.
@@ -539,7 +560,7 @@ double sg_host_get_consumed_energy(sg_host_t host)
   return host->extension<HostEnergy>()->get_consumed_energy();
 }
 
-/** @ingroup plugin_energy
+/** @ingroup plugin_host_energy
  *  @brief Get the amount of watt dissipated when the host is idling
  */
 double sg_host_get_idle_consumption(sg_host_t host)
@@ -549,7 +570,7 @@ double sg_host_get_idle_consumption(sg_host_t host)
   return host->extension<HostEnergy>()->get_idle_consumption();
 }
 
-/** @ingroup plugin_energy
+/** @ingroup plugin_host_energy
  *  @brief Get the amount of watt dissipated at the given pstate when the host is idling
  */
 double sg_host_get_wattmin_at(sg_host_t host, int pstate)
@@ -558,7 +579,7 @@ double sg_host_get_wattmin_at(sg_host_t host, int pstate)
              "The Energy plugin is not active. Please call sg_host_energy_plugin_init() during initialization.");
   return host->extension<HostEnergy>()->get_watt_min_at(pstate);
 }
-/** @ingroup plugin_energy
+/** @ingroup plugin_host_energy
  *  @brief  Returns the amount of watt dissipated at the given pstate when the host burns CPU at 100%
  */
 double sg_host_get_wattmax_at(sg_host_t host, int pstate)
@@ -567,8 +588,16 @@ double sg_host_get_wattmax_at(sg_host_t host, int pstate)
              "The Energy plugin is not active. Please call sg_host_energy_plugin_init() during initialization.");
   return host->extension<HostEnergy>()->get_watt_max_at(pstate);
 }
-
-/** @ingroup plugin_energy
+/** @ingroup plugin_host_energy
+ *  @brief  Returns the power slope at the given pstate
+ */
+double sg_host_get_power_range_slope_at(sg_host_t host, int pstate)
+{
+  xbt_assert(HostEnergy::EXTENSION_ID.valid(),
+             "The Energy plugin is not active. Please call sg_host_energy_plugin_init() during initialization.");
+  return host->extension<HostEnergy>()->get_power_range_slope_at(pstate);
+}
+/** @ingroup plugin_host_energy
  *  @brief Returns the current consumption of the host
  */
 double sg_host_get_current_consumption(sg_host_t host)
index ea40824..060577d 100644 (file)
@@ -9,12 +9,26 @@
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include <simgrid/s4u.hpp>
 
+// Makes sure that this plugin can be activated from the command line with ``--plugin=name``
 SIMGRID_REGISTER_PLUGIN(host_load, "Cpu load", &sg_host_load_plugin_init)
 
-/** @addtogroup plugin_load
+/** @defgroup plugin_host_load
 
-This plugin makes it very simple for users to obtain the current load for each host.
+  @rst
 
+Simple plugin that monitors the current load for each host.
+
+In addition, this constitutes a good introductory example on how to write a plugin.
+It attaches an extension to each host to store some data, and places callbacks in the following signals:
+
+  - :cpp:member:`simgrid::s4u::Host::on_creation`: Attach a new extension to the newly created host.
+  - :cpp:member:`simgrid::s4u::Exec::on_start`: Make note that a new execution started, increasing the load.
+  - :cpp:member:`simgrid::s4u::Exec::on_completion`: Make note that an execution completed, decreasing the load.
+  - :cpp:member:`simgrid::s4u::Host::on_state_change`: Do what is appropriate when the host gets suspended, turned off or similar.
+  - :cpp:member:`simgrid::s4u::Host::on_speed_change`: Do what is appropriate when the DVFS is modified.
+
+  Note that extensions are automatically destroyed when the host gets destroyed.
+  @endrst
 */
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_plugin_load, surf, "Logging specific to the HostLoad plugin");
@@ -24,6 +38,21 @@ namespace plugin {
 
 static const double activity_uninitialized_remaining_cost = -1;
 
+/** This class stores the extra data needed by this plugin about a given host
+ *
+ * It is stored as an extension of s4u::Host. Such extensions are retrieved by type as follows:
+ *
+ * @verbatim
+ * simgrid::s4u::Host* this_host = ???;
+ * this_extension = host->extension<HostLoad>();
+ * @endverbatim
+ *
+ * If no extension of that type was ever attached to the inspected object, the ``extension<X>()`` template returns
+ * nullptr.
+ *
+ * Please refer to the implementation of ``sg_host_load_plugin_init()`` to see the extension objects are attached to
+ * hosts at initialization time.
+ */
 class HostLoad {
 public:
   static simgrid::xbt::Extension<simgrid::s4u::Host, HostLoad> EXTENSION_ID;
@@ -55,13 +84,13 @@ public:
   /** Return idle time over the whole simulation */
   double get_total_idle_time() { update(); return total_idle_time_; }
   void update();
-  void add_activity(simgrid::kernel::activity::ExecImplPtr activity);
+  void add_activity(simgrid::kernel::activity::ExecImpl* activity);
   void reset();
 
 private:
   simgrid::s4u::Host* host_ = nullptr;
   /* Stores all currently ongoing activities (computations) on this machine */
-  std::map<simgrid::kernel::activity::ExecImplPtr, /* cost still remaining*/double> current_activities;
+  std::map<simgrid::kernel::activity::ExecImpl*, /* cost still remaining*/ double> current_activities;
   double last_updated_      = 0;
   double last_reset_        = 0;
   /**
@@ -76,13 +105,14 @@ private:
   double current_flops_     = 0;
   double computed_flops_    = 0;
   double idle_time_         = 0;
-  double total_idle_time_   = 0; /* This gets never reset */
+  double total_idle_time_   = 0; /* This updated but never gets reset */
   double theor_max_flops_   = 0;
 };
 
+// Create the static field that the extension mechanism needs
 simgrid::xbt::Extension<simgrid::s4u::Host, HostLoad> HostLoad::EXTENSION_ID;
 
-void HostLoad::add_activity(simgrid::kernel::activity::ExecImplPtr activity)
+void HostLoad::add_activity(simgrid::kernel::activity::ExecImpl* activity)
 {
   current_activities.insert({activity, activity_uninitialized_remaining_cost});
 }
@@ -96,12 +126,13 @@ void HostLoad::update()
   while (iter != end(current_activities)) {
     auto& activity                         = iter->first;  // Just an alias
     auto& remaining_cost_after_last_update = iter->second; // Just an alias
+    auto& action                           = activity->surf_action_;
     auto current_iter                      = iter;
     ++iter;
 
-    if (activity->surf_action_->get_finish_time() != now && activity->state_ == e_smx_state_t::SIMIX_RUNNING) {
+    if (action != nullptr && action->get_finish_time() != now && activity->state_ == e_smx_state_t::SIMIX_RUNNING) {
       if (remaining_cost_after_last_update == activity_uninitialized_remaining_cost) {
-        remaining_cost_after_last_update = activity->surf_action_->get_cost();
+        remaining_cost_after_last_update = action->get_cost();
       }
       double computed_flops_since_last_update = remaining_cost_after_last_update - /*remaining now*/activity->get_remaining();
       computed_flops_                        += computed_flops_since_last_update;
@@ -144,7 +175,7 @@ void HostLoad::update()
 double HostLoad::get_current_load()
 {
   // We don't need to call update() here because it is called every time an action terminates or starts
-  return current_flops_ / static_cast<double>(host_->get_speed() * host_->get_core_count());
+  return current_flops_ / (host_->get_speed() * host_->get_core_count());
 }
 
 /*
@@ -179,58 +210,58 @@ static void on_host_change(simgrid::s4u::Host const& host)
 /* **************************** Public interface *************************** */
 
 /** @brief Initializes the HostLoad plugin
- * @details The HostLoad plugin provides an API to get the current load of each host.
+ *  @ingroup plugin_host_load
  */
 void sg_host_load_plugin_init()
 {
-  if (HostLoad::EXTENSION_ID.valid())
+  if (HostLoad::EXTENSION_ID.valid()) // Don't do the job twice
     return;
 
+  // First register our extension of Hosts properly
   HostLoad::EXTENSION_ID = simgrid::s4u::Host::extension_create<HostLoad>();
 
-  if (simgrid::s4u::Engine::is_initialized()) { // If not yet initialized, this would create a new instance
-                                                // which would cause seg faults...
+  // If SimGrid is already initialized, we need to attach an extension to each existing host
+  if (simgrid::s4u::Engine::is_initialized()) {
     simgrid::s4u::Engine* e = simgrid::s4u::Engine::get_instance();
     for (auto& host : e->get_all_hosts()) {
       host->extension_set(new HostLoad(host));
     }
   }
 
-  /* When attaching a callback into a signal, you can use a lambda as follows, or a regular function as done below */
-
+  // Make sure that every future host also gets an extension (in case the platform is not loaded yet)
   simgrid::s4u::Host::on_creation.connect([](simgrid::s4u::Host& host) {
     if (dynamic_cast<simgrid::s4u::VirtualMachine*>(&host)) // Ignore virtual machines
       return;
     host.extension_set(new HostLoad(&host));
   });
 
-  simgrid::kernel::activity::ExecImpl::on_creation.connect([](simgrid::kernel::activity::ExecImpl& activity) {
+  simgrid::s4u::Exec::on_start.connect([](simgrid::s4u::Actor const&, simgrid::s4u::Exec const& activity) {
     if (activity.get_host_number() == 1) { // We only run on one host
       simgrid::s4u::Host* host         = activity.get_host();
       simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
       if (vm != nullptr)
         host = vm->get_pm();
-
-      host->extension<HostLoad>()->add_activity(&activity);
+      xbt_assert(host != nullptr);
+      host->extension<HostLoad>()->add_activity(static_cast<simgrid::kernel::activity::ExecImpl*>(activity.get_impl()));
       host->extension<HostLoad>()->update(); // If the system was idle until now, we need to update *before*
                                              // this computation starts running so we can keep track of the
                                              // idle time. (Communication operations don't trigger this hook!)
     }
     else { // This runs on multiple hosts
-      XBT_DEBUG("HostLoad plugin currently does not support executions on several hosts");
+      XBT_WARN("HostLoad plugin currently does not support executions on several hosts");
     }
   });
-  simgrid::kernel::activity::ExecImpl::on_completion.connect([](simgrid::kernel::activity::ExecImpl const& activity) {
+  simgrid::s4u::Exec::on_completion.connect([](simgrid::s4u::Actor const&, simgrid::s4u::Exec const& activity) {
     if (activity.get_host_number() == 1) { // We only run on one host
       simgrid::s4u::Host* host         = activity.get_host();
       simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
       if (vm != nullptr)
         host = vm->get_pm();
-
+      xbt_assert(host != nullptr);
       host->extension<HostLoad>()->update();
     }
     else { // This runs on multiple hosts
-      XBT_DEBUG("HostLoad plugin currently does not support executions on several hosts");
+      XBT_WARN("HostLoad plugin currently does not support executions on several hosts");
     }
   });
   simgrid::s4u::Host::on_state_change.connect(&on_host_change);
@@ -238,61 +269,61 @@ void sg_host_load_plugin_init()
 }
 
 /** @brief Returns the current load of that host, as a ratio = achieved_flops / (core_current_speed * core_amount)
- *
- *  See simgrid::plugin::HostLoad::get_current_load() for the full documentation.
+ *  @ingroup plugin_host_load
  */
 double sg_host_get_current_load(sg_host_t host)
 {
-  xbt_assert(HostLoad::EXTENSION_ID.valid(),
-             "The Load plugin is not active. Please call sg_host_load_plugin_init() during initialization.");
+  xbt_assert(HostLoad::EXTENSION_ID.valid(), "Please sg_host_load_plugin_init() to initialize this plugin.");
 
   return host->extension<HostLoad>()->get_current_load();
 }
 
-/** @brief Returns the current load of the host passed as argument
- *
- *  See also @ref plugin_load
+/** @brief Returns the current load of that host
+ *  @ingroup plugin_host_load
  */
 double sg_host_get_avg_load(sg_host_t host)
 {
-  xbt_assert(HostLoad::EXTENSION_ID.valid(),
-             "The Load plugin is not active. Please call sg_host_load_plugin_init() during initialization.");
+  xbt_assert(HostLoad::EXTENSION_ID.valid(), "Please sg_host_load_plugin_init() to initialize this plugin.");
 
   return host->extension<HostLoad>()->get_average_load();
 }
 
 /** @brief Returns the time this host was idle since the last reset
- *
- *  See also @ref plugin_load
+ *  @ingroup plugin_host_load
  */
 double sg_host_get_idle_time(sg_host_t host)
 {
-  xbt_assert(HostLoad::EXTENSION_ID.valid(),
-             "The Load plugin is not active. Please call sg_host_load_plugin_init() during initialization.");
+  xbt_assert(HostLoad::EXTENSION_ID.valid(), "Please sg_host_load_plugin_init() to initialize this plugin.");
 
   return host->extension<HostLoad>()->get_idle_time();
 }
 
+/** @brief Returns the time this host was idle since the beginning of the simulation
+ *  @ingroup plugin_host_load
+ */
 double sg_host_get_total_idle_time(sg_host_t host)
 {
-  xbt_assert(HostLoad::EXTENSION_ID.valid(),
-             "The Load plugin is not active. Please call sg_host_load_plugin_init() during initialization.");
+  xbt_assert(HostLoad::EXTENSION_ID.valid(), "Please sg_host_load_plugin_init() to initialize this plugin.");
 
   return host->extension<HostLoad>()->get_total_idle_time();
 }
 
+/** @brief Returns the amount of flops computed by that host since the last reset
+ *  @ingroup plugin_host_load
+ */
 double sg_host_get_computed_flops(sg_host_t host)
 {
-  xbt_assert(HostLoad::EXTENSION_ID.valid(),
-             "The Load plugin is not active. Please call sg_host_load_plugin_init() during initialization.");
+  xbt_assert(HostLoad::EXTENSION_ID.valid(), "Please sg_host_load_plugin_init() to initialize this plugin.");
 
   return host->extension<HostLoad>()->get_computed_flops();
 }
 
+/** @brief Resets the idle time and flops amount of that host
+ *  @ingroup plugin_host_load
+ */
 void sg_host_load_reset(sg_host_t host)
 {
-  xbt_assert(HostLoad::EXTENSION_ID.valid(),
-             "The Load plugin is not active. Please call sg_host_load_plugin_init() during initialization.");
+  xbt_assert(HostLoad::EXTENSION_ID.valid(), "Please sg_host_load_plugin_init() to initialize this plugin.");
 
   host->extension<HostLoad>()->reset();
 }
index ea5cf2d..01b0bab 100644 (file)
@@ -14,8 +14,7 @@
 
 SIMGRID_REGISTER_PLUGIN(link_energy, "Link energy consumption.", &sg_link_energy_plugin_init)
 
-/** @addtogroup SURF_plugin_energy
-
+/** @defgroup plugin_link_energy
 
  This is the link energy plugin, accounting for the dissipated energy in the simulated platform.
 
@@ -24,8 +23,8 @@ SIMGRID_REGISTER_PLUGIN(link_energy, "Link energy consumption.", &sg_link_energy
 
  @verbatim
  <link id="SWITCH1" bandwidth="125Mbps" latency="5us" sharing_policy="SHARED" >
- <prop id="watt_range" value="100.0:200.0" />
- <prop id="watt_off" value="10" />
+ <prop id="wattage_range" value="100.0:200.0" />
+ <prop id="wattage_off" value="10" />
  </link>
  @endverbatim
 
@@ -87,7 +86,12 @@ void LinkEnergy::init_watts_range_list()
     return;
   inited_ = true;
 
-  const char* all_power_values_str = this->link_->get_property("watt_range");
+  const char* all_power_values_str = this->link_->get_property("wattage_range");
+  if (all_power_values_str == nullptr) {
+    all_power_values_str = this->link_->get_property("watt_range");
+    if (all_power_values_str != nullptr)
+      XBT_WARN("Please rename the 'watt_range' property of link %s into 'wattage_range'.", link_->get_cname());
+  }
 
   if (all_power_values_str == nullptr)
     return;
@@ -107,13 +111,13 @@ void LinkEnergy::init_watts_range_list()
     /* max_power is the power consumed at 100% link load       */
     try {
       idle_ = std::stod(current_power_values.front());
-    } catch (std::invalid_argument& ia) {
+    } catch (const std::invalid_argument&) {
       throw std::invalid_argument(std::string("Invalid idle power value for link ") + this->link_->get_cname());
     }
 
     try {
       busy_ = std::stod(current_power_values.back());
-    } catch (std::invalid_argument& ia) {
+    } catch (const std::invalid_argument&) {
       throw std::invalid_argument(std::string("Invalid busy power value for link ") + this->link_->get_cname());
     }
   }
@@ -136,7 +140,7 @@ double LinkEnergy::get_power()
 double LinkEnergy::get_consumed_energy()
 {
   if (last_updated_ < surf_get_clock()) // We need to simcall this as it modifies the environment
-    simgrid::simix::simcall(std::bind(&LinkEnergy::update, this));
+    simgrid::kernel::actor::simcall(std::bind(&LinkEnergy::update, this));
   return this->total_energy_;
 }
 } // namespace plugin
@@ -179,14 +183,13 @@ int sg_link_energy_is_inited()
 {
   return LinkEnergy::EXTENSION_ID.valid();
 }
-/** @ingroup SURF_plugin_energy
+/** @ingroup plugin_link_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>();
@@ -213,10 +216,10 @@ void sg_link_energy_plugin_init()
   });
 
   simgrid::s4u::Link::on_communicate.connect(&on_communicate);
-  simgrid::s4u::on_simulation_end.connect(&on_simulation_end);
+  simgrid::s4u::Engine::on_simulation_end.connect(&on_simulation_end);
 }
 
-/** @ingroup plugin_energy
+/** @ingroup plugin_link_energy
  *  @brief Returns the total energy consumed by the link so far (in Joules)
  *
  *  Please note that since the consumption is lazily updated, it may require a simcall to update it.
index a461371..2776c8d 100644 (file)
@@ -4,9 +4,10 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
+#include "simgrid/Exception.hpp"
+#include "simgrid/s4u/Exec.hpp"
 #include "src/include/surf/surf.hpp"
 #include "src/kernel/activity/ExecImpl.hpp"
-#include "xbt/asserts.h" // xbt_log_no_loc
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_vm, surf, "Logging specific to the SURF VM module");
 
@@ -23,8 +24,8 @@ namespace vm {
 /*************
  * Callbacks *
  *************/
-simgrid::xbt::signal<void(VirtualMachineImpl&)> VirtualMachineImpl::on_creation;
-simgrid::xbt::signal<void(VirtualMachineImpl const&)> VirtualMachineImpl::on_destruction;
+xbt::signal<void(VirtualMachineImpl&)> VirtualMachineImpl::on_creation;
+xbt::signal<void(VirtualMachineImpl const&)> VirtualMachineImpl::on_destruction;
 
 /*********
  * Model *
@@ -51,25 +52,45 @@ static void host_state_change(s4u::Host const& host)
   }
 }
 
-static s4u::VirtualMachine* get_vm_from_task(kernel::activity::ActivityImpl const& task)
+static void add_active_exec(s4u::Actor const&, s4u::Exec const& task)
 {
-  auto* exec = dynamic_cast<kernel::activity::ExecImpl const*>(&task);
+  s4u::VirtualMachine* vm = dynamic_cast<s4u::VirtualMachine*>(task.get_host());
+  if (vm != nullptr) {
+    VirtualMachineImpl* vm_impl = vm->get_impl();
+    vm_impl->active_tasks_      = vm_impl->active_tasks_ + 1;
+    vm_impl->update_action_weight();
+  }
+}
+
+static void remove_active_exec(s4u::Actor const&, s4u::Exec const& task)
+{
+  s4u::VirtualMachine* vm = dynamic_cast<s4u::VirtualMachine*>(task.get_host());
+  if (vm != nullptr) {
+    VirtualMachineImpl* vm_impl = vm->get_impl();
+    vm_impl->active_tasks_      = vm_impl->active_tasks_ - 1;
+    vm_impl->update_action_weight();
+  }
+}
+
+static s4u::VirtualMachine* get_vm_from_activity(kernel::activity::ActivityImpl const& act)
+{
+  auto* exec = dynamic_cast<kernel::activity::ExecImpl const*>(&act);
   return exec != nullptr ? dynamic_cast<s4u::VirtualMachine*>(exec->get_host()) : nullptr;
 }
 
-static void add_active_task(kernel::activity::ActivityImpl const& task)
+static void add_active_activity(kernel::activity::ActivityImpl const& act)
 {
-  s4u::VirtualMachine* vm = get_vm_from_task(task);
+  s4u::VirtualMachine* vm = get_vm_from_activity(act);
   if (vm != nullptr) {
     VirtualMachineImpl *vm_impl = vm->get_impl();
     vm_impl->active_tasks_ = vm_impl->active_tasks_ + 1;
-    vm_impl->update_action_weight(); 
+    vm_impl->update_action_weight();
   }
 }
 
-static void remove_active_task(kernel::activity::ActivityImpl const& task)
+static void remove_active_activity(kernel::activity::ActivityImpl const& act)
 {
-  s4u::VirtualMachine* vm = get_vm_from_task(task);
+  s4u::VirtualMachine* vm = get_vm_from_activity(act);
   if (vm != nullptr) {
     VirtualMachineImpl *vm_impl = vm->get_impl();
     vm_impl->active_tasks_ = vm_impl->active_tasks_ - 1;
@@ -81,10 +102,10 @@ VMModel::VMModel()
 {
   all_existing_models.push_back(this);
   s4u::Host::on_state_change.connect(host_state_change);
-  kernel::activity::ExecImpl::on_creation.connect(add_active_task);
-  kernel::activity::ExecImpl::on_completion.connect(remove_active_task);
-  kernel::activity::ActivityImpl::on_resumed.connect(add_active_task);
-  kernel::activity::ActivityImpl::on_suspended.connect(remove_active_task);
+  s4u::Exec::on_start.connect(add_active_exec);
+  s4u::Exec::on_completion.connect(remove_active_exec);
+  kernel::activity::ActivityImpl::on_resumed.connect(add_active_activity);
+  kernel::activity::ActivityImpl::on_suspended.connect(remove_active_activity);
 }
 
 double VMModel::next_occuring_event(double now)
@@ -115,7 +136,7 @@ double VMModel::next_occuring_event(double now)
 
   /* iterate for all virtual machines */
   for (s4u::VirtualMachine* const& ws_vm : VirtualMachineImpl::allVms_) {
-    surf::Cpu* cpu = ws_vm->pimpl_cpu;
+    kernel::resource::Cpu* cpu = ws_vm->pimpl_cpu;
 
     double solved_value =
         ws_vm->get_impl()->action_->get_variable()->get_value(); // this is X1 in comment above, what
@@ -173,10 +194,11 @@ VirtualMachineImpl::~VirtualMachineImpl()
 void VirtualMachineImpl::suspend(smx_actor_t issuer)
 {
   if (get_state() != s4u::VirtualMachine::state::RUNNING)
-    THROWF(vm_error, 0, "Cannot suspend VM %s: it is not running.", piface_->get_cname());
+    throw VmFailureException(XBT_THROW_POINT,
+                             xbt::string_printf("Cannot suspend VM %s: it is not running.", piface_->get_cname()));
   if (issuer->get_host() == piface_)
-    THROWF(vm_error, 0, "Actor %s cannot suspend the VM %s in which it runs", issuer->get_cname(),
-           piface_->get_cname());
+    throw VmFailureException(XBT_THROW_POINT, xbt::string_printf("Actor %s cannot suspend the VM %s in which it runs",
+                                                                 issuer->get_cname(), piface_->get_cname()));
 
   XBT_DEBUG("suspend VM(%s), where %zu processes exist", piface_->get_cname(), process_list_.size());
 
@@ -184,7 +206,7 @@ void VirtualMachineImpl::suspend(smx_actor_t issuer)
 
   for (auto& smx_process : process_list_) {
     XBT_DEBUG("suspend %s", smx_process.get_cname());
-    smx_process.suspend(issuer);
+    smx_process.suspend();
   }
 
   XBT_DEBUG("suspend all processes on the VM done done");
@@ -195,7 +217,8 @@ void VirtualMachineImpl::suspend(smx_actor_t issuer)
 void VirtualMachineImpl::resume()
 {
   if (get_state() != s4u::VirtualMachine::state::SUSPENDED)
-    THROWF(vm_error, 0, "Cannot resume VM %s: it was not suspended", piface_->get_cname());
+    throw VmFailureException(XBT_THROW_POINT,
+                             xbt::string_printf("Cannot resume VM %s: it was not suspended", piface_->get_cname()));
 
   XBT_DEBUG("Resume VM %s, containing %zu processes.", piface_->get_cname(), process_list_.size());
 
@@ -266,8 +289,8 @@ void VirtualMachineImpl::set_physical_host(s4u::Host* destination)
 
   /* Update vcpu's action for the new pm */
   /* create a cpu action bound to the pm model at the destination. */
-  surf::CpuAction* new_cpu_action =
-      static_cast<surf::CpuAction*>(destination->pimpl_cpu->execution_start(0, this->core_amount_));
+  kernel::resource::CpuAction* new_cpu_action =
+      static_cast<kernel::resource::CpuAction*>(destination->pimpl_cpu->execution_start(0, this->core_amount_));
 
   if (action_->get_remains_no_update() > 0)
     XBT_CRITICAL("FIXME: need copy the state(?), %f", action_->get_remains_no_update());
@@ -300,9 +323,9 @@ void VirtualMachineImpl::update_action_weight(){
   XBT_DEBUG("set the weight of the dummy CPU action of VM%p on PM to %d (#tasks: %d)", this, impact, active_tasks_);
 
   if (impact > 0)
-    action_->set_priority(1. / impact);
+    action_->set_sharing_penalty(1. / impact);
   else
-    action_->set_priority(0.);
+    action_->set_sharing_penalty(0.);
 
   action_->set_bound(std::min(impact * physical_host_->get_speed(), user_bound_));
 }
index 10a8a19..90b5553 100644 (file)
@@ -107,7 +107,7 @@ sg_size_t MigrationTx::sendMigrationData(sg_size_t size, int stage, int stage2_r
       comm = mbox->put_init(msg, size)->set_rate(mig_speed)->wait_for(timeout);
     else
       comm = mbox->put_async(msg, size)->wait_for(timeout);
-  } catch (xbt_ex& e) {
+  } catch (const Exception&) {
     if (comm) {
       sg_size_t remaining = static_cast<sg_size_t>(comm->get_remaining());
       XBT_VERB("timeout (%lf s) in sending_migration_data, remaining %llu bytes of %llu", timeout, remaining, size);
@@ -182,7 +182,7 @@ void MigrationTx::operator()()
     } else if (sent > ramsize)
       XBT_CRITICAL("bug");
 
-  } catch (xbt_ex& e) {
+  } catch (const Exception&) {
     // hostfailure (if you want to know whether this is the SRC or the DST check directly in send_migration_data code)
     // Stop the dirty page tracking an return (there is no memory space to release)
     sg_vm_stop_dirty_page_tracking(vm_);
@@ -205,63 +205,56 @@ void MigrationTx::operator()()
   if (not skip_stage2) {
 
     int stage2_round = 0;
-    for (;;) {
-      sg_size_t updated_size = 0;
-      if (stage2_round == 0) {
-        /* just after stage1, nothing has been updated. But, we have to send the data updated during stage1 */
-        updated_size = get_updated_size(computed_during_stage1, dp_rate, dp_cap);
-      } else {
-        double computed = sg_vm_lookup_computed_flops(vm_);
-        updated_size    = get_updated_size(computed, dp_rate, dp_cap);
-      }
+    /* just after stage1, nothing has been updated. But, we have to send the data updated during stage1 */
+    sg_size_t updated_size = get_updated_size(computed_during_stage1, dp_rate, dp_cap);
+    remaining_size += updated_size;
+    XBT_DEBUG("mig-stage2.%d: remaining_size %zu (%s threshold %zu)", stage2_round, remaining_size,
+              (remaining_size < threshold) ? "<" : ">", threshold);
+
+    /* When the remaining size is below the threshold value, move to stage 3. */
+    while (threshold < remaining_size) {
 
       XBT_DEBUG("mig-stage 2:%d updated_size %llu computed_during_stage1 %f dp_rate %f dp_cap %llu", stage2_round,
                 updated_size, computed_during_stage1, dp_rate, dp_cap);
 
-      /* Check whether the remaining size is below the threshold value. If so, move to stage 3. */
-      remaining_size += updated_size;
-      XBT_DEBUG("mig-stage2.%d: remaining_size %zu (%s threshold %zu)", stage2_round, remaining_size,
-                (remaining_size < threshold) ? "<" : ">", threshold);
-      if (remaining_size < threshold)
-        break;
-
       sg_size_t sent  = 0;
       clock_prev_send = s4u::Engine::get_clock();
       try {
         XBT_DEBUG("Stage 2, gonna send %llu", updated_size);
         sent = sendMigrationData(updated_size, 2, stage2_round, mig_speed, mig_timeout);
-      } catch (xbt_ex& e) {
+      } catch (const Exception&) {
         // hostfailure (if you want to know whether this is the SRC or the DST check directly in send_migration_data
         // code)
         // Stop the dirty page tracking an return (there is no memory space to release)
         sg_vm_stop_dirty_page_tracking(vm_);
         return;
       }
+
+      remaining_size -= sent;
+      double computed = sg_vm_lookup_computed_flops(vm_);
+
       clock_post_send = s4u::Engine::get_clock();
 
       if (sent == updated_size) {
-        /* timeout did not happen */
         bandwidth = updated_size / (clock_post_send - clock_prev_send);
         threshold = bandwidth * max_downtime;
         XBT_DEBUG("actual bandwidth %f, threshold %zu", bandwidth / 1024 / 1024, threshold);
-        remaining_size -= sent;
         stage2_round += 1;
         mig_timeout -= (clock_post_send - clock_prev_send);
         xbt_assert(mig_timeout > 0);
-
-      } else if (sent < updated_size) {
+        XBT_DEBUG("mig-stage2.%d: remaining_size %zu (%s threshold %zu)", stage2_round, remaining_size,
+                  (remaining_size < threshold) ? "<" : ">", threshold);
+        updated_size = get_updated_size(computed, dp_rate, dp_cap);
+        remaining_size += updated_size;
+      } else {
         /* When timeout happens, we move to stage 3. The size of memory pages
          * updated before timeout must be added to the remaining size. */
         XBT_VERB("mig-stage2.%d: timeout, force moving to stage 3. sent %llu / %llu, eta %lf", stage2_round, sent,
                  updated_size, (clock_post_send - clock_prev_send));
-        remaining_size -= sent;
-
-        double computed = sg_vm_lookup_computed_flops(vm_);
         updated_size    = get_updated_size(computed, dp_rate, dp_cap);
         remaining_size += updated_size;
         break;
-      } else
-        XBT_CRITICAL("bug");
+      }
     }
   }
 
@@ -273,7 +266,7 @@ void MigrationTx::operator()()
   try {
     XBT_DEBUG("Stage 3: Gonna send %zu bytes", remaining_size);
     sendMigrationData(remaining_size, 3, 0, mig_speed, -1);
-  } catch (xbt_ex& e) {
+  } catch (const Exception&) {
     // hostfailure (if you want to know whether this is the SRC or the DST check directly in send_migration_data code)
     // Stop the dirty page tracking an return (there is no memory space to release)
     vm_->resume();
@@ -331,14 +324,21 @@ void sg_vm_migrate(simgrid::s4u::VirtualMachine* vm, simgrid::s4u::Host* dst_pm)
   simgrid::s4u::Host* src_pm = vm->get_pm();
 
   if (not src_pm->is_on())
-    THROWF(vm_error, 0, "Cannot migrate VM '%s' from host '%s', which is offline.", vm->get_cname(),
-           src_pm->get_cname());
+    throw simgrid::VmFailureException(
+        XBT_THROW_POINT, simgrid::xbt::string_printf("Cannot migrate VM '%s' from host '%s', which is offline.",
+                                                     vm->get_cname(), src_pm->get_cname()));
   if (not dst_pm->is_on())
-    THROWF(vm_error, 0, "Cannot migrate VM '%s' to host '%s', which is offline.", vm->get_cname(), dst_pm->get_cname());
+    throw simgrid::VmFailureException(
+        XBT_THROW_POINT, simgrid::xbt::string_printf("Cannot migrate VM '%s' to host '%s', which is offline.",
+                                                     vm->get_cname(), dst_pm->get_cname()));
   if (vm->get_state() != simgrid::s4u::VirtualMachine::state::RUNNING)
-    THROWF(vm_error, 0, "Cannot migrate VM '%s' that is not running yet.", vm->get_cname());
+    throw simgrid::VmFailureException(
+        XBT_THROW_POINT,
+        simgrid::xbt::string_printf("Cannot migrate VM '%s' that is not running yet.", vm->get_cname()));
   if (vm->get_impl()->is_migrating_)
-    THROWF(vm_error, 0, "Cannot migrate VM '%s' that is already migrating.", vm->get_cname());
+    throw simgrid::VmFailureException(
+        XBT_THROW_POINT,
+        simgrid::xbt::string_printf("Cannot migrate VM '%s' that is already migrating.", vm->get_cname()));
 
   vm->get_impl()->is_migrating_ = true;
   simgrid::s4u::VirtualMachine::on_migration_start(*vm);
index 0a927af..3cf72b4 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 "simgrid/Exception.hpp"
 #include "simgrid/s4u/Actor.hpp"
 #include "simgrid/vm.h"
 #include "src/include/surf/surf.hpp"
@@ -63,7 +64,7 @@ void VirtualMachine::start()
 {
   on_start(*this);
 
-  simgrid::simix::simcall([this]() {
+  simgrid::kernel::actor::simcall([this]() {
     simgrid::vm::VmHostExt::ensureVmExtInstalled();
 
     simgrid::s4u::Host* pm = this->pimpl_vm_->get_physical_host();
@@ -84,8 +85,9 @@ void VirtualMachine::start()
       if (vm_ramsize > pm_ramsize - total_ramsize_of_vms) {
         XBT_WARN("cannot start %s@%s due to memory shortage: vm_ramsize %ld, free %ld, pm_ramsize %ld (bytes).",
                  this->get_cname(), pm->get_cname(), 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->get_cname(),
-               this->get_cname());
+        throw VmFailureException(XBT_THROW_POINT,
+                                 xbt::string_printf("Memory shortage on host '%s', VM '%s' cannot be started",
+                                                    pm->get_cname(), this->get_cname()));
       }
     }
 
@@ -99,7 +101,7 @@ void VirtualMachine::suspend()
 {
   on_suspend(*this);
   smx_actor_t issuer = SIMIX_process_self();
-  simgrid::simix::simcall([this, issuer]() { pimpl_vm_->suspend(issuer); });
+  simgrid::kernel::actor::simcall([this, issuer]() { pimpl_vm_->suspend(issuer); });
 }
 
 void VirtualMachine::resume()
@@ -111,7 +113,7 @@ void VirtualMachine::resume()
 void VirtualMachine::shutdown()
 {
   smx_actor_t issuer = SIMIX_process_self();
-  simgrid::simix::simcall([this, issuer]() { pimpl_vm_->shutdown(issuer); });
+  simgrid::kernel::actor::simcall([this, issuer]() { pimpl_vm_->shutdown(issuer); });
   on_shutdown(*this);
 }
 
@@ -131,12 +133,12 @@ simgrid::s4u::Host* VirtualMachine::get_pm()
 
 void VirtualMachine::set_pm(simgrid::s4u::Host* pm)
 {
-  simgrid::simix::simcall([this, pm]() { pimpl_vm_->set_physical_host(pm); });
+  simgrid::kernel::actor::simcall([this, pm]() { pimpl_vm_->set_physical_host(pm); });
 }
 
 VirtualMachine::state VirtualMachine::get_state()
 {
-  return simgrid::simix::simcall([this]() { return pimpl_vm_->get_state(); });
+  return simgrid::kernel::actor::simcall([this]() { return pimpl_vm_->get_state(); });
 }
 
 size_t VirtualMachine::get_ramsize()
@@ -176,7 +178,7 @@ void VirtualMachine::set_ramsize(size_t ramsize)
  */
 void VirtualMachine::set_bound(double bound)
 {
-  simgrid::simix::simcall([this, bound]() { pimpl_vm_->set_bound(bound); });
+  simgrid::kernel::actor::simcall([this, bound]() { pimpl_vm_->set_bound(bound); });
 }
 
 } // namespace simgrid
index 6e49f99..7187920 100644 (file)
@@ -5,11 +5,14 @@
 
 #include "simgrid/Exception.hpp"
 #include "simgrid/actor.h"
+#include "simgrid/modelchecker.h"
 #include "simgrid/s4u/Actor.hpp"
 #include "simgrid/s4u/Exec.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/VirtualMachine.hpp"
+#include "src/include/mc/mc.h"
 #include "src/kernel/activity/ExecImpl.hpp"
+#include "src/mc/mc_replay.hpp"
 #include "src/simix/smx_private.hpp"
 #include "src/surf/HostImpl.hpp"
 
@@ -28,27 +31,29 @@ xbt::signal<void(Actor const&)> s4u::Actor::on_sleep;
 xbt::signal<void(Actor const&)> s4u::Actor::on_wake_up;
 xbt::signal<void(Actor const&)> s4u::Actor::on_migration_start;
 xbt::signal<void(Actor const&)> s4u::Actor::on_migration_end;
+xbt::signal<void(Actor const&)> s4u::Actor::on_termination;
 xbt::signal<void(Actor const&)> s4u::Actor::on_destruction;
 
 // ***** Actor creation *****
-ActorPtr Actor::self()
+Actor* Actor::self()
 {
   kernel::context::Context* self_context = kernel::context::Context::self();
   if (self_context == nullptr)
-    return ActorPtr();
+    return nullptr;
 
-  return self_context->get_actor()->iface();
+  return self_context->get_actor()->ciface();
 }
 ActorPtr Actor::init(const std::string& name, s4u::Host* host)
 {
   smx_actor_t self = SIMIX_process_self();
-  kernel::actor::ActorImpl* actor = simix::simcall([self, &name, host] { return self->init(name, host).get(); });
-  return actor->ciface();
+  kernel::actor::ActorImpl* actor =
+      kernel::actor::simcall([self, &name, host] { return self->init(name, host).get(); });
+  return actor->iface();
 }
 
 ActorPtr Actor::start(const std::function<void()>& code)
 {
-  simgrid::simix::simcall([this, &code] { pimpl_->start(code); });
+  simgrid::kernel::actor::simcall([this, &code] { pimpl_->start(code); });
   return this;
 }
 
@@ -56,7 +61,7 @@ ActorPtr Actor::create(const std::string& name, s4u::Host* host, const std::func
 {
   smx_actor_t self = SIMIX_process_self();
   kernel::actor::ActorImpl* actor =
-      simix::simcall([self, &name, host, &code] { return self->init(name, host)->start(code); });
+      kernel::actor::simcall([self, &name, host, &code] { return self->init(name, host)->start(code); });
 
   return actor->iface();
 }
@@ -76,22 +81,36 @@ void intrusive_ptr_release(Actor* actor)
 {
   intrusive_ptr_release(actor->pimpl_);
 }
+int Actor::get_refcount()
+{
+  return pimpl_->get_refcount();
+}
 
 // ***** Actor methods *****
 
 void Actor::join()
 {
-  simcall_process_join(this->pimpl_, -1);
+  join(-1);
 }
 
 void Actor::join(double timeout)
 {
-  simcall_process_join(this->pimpl_, timeout);
+  auto issuer = SIMIX_process_self();
+  auto target = pimpl_;
+  kernel::actor::simcall_blocking<void>([issuer, target, timeout] {
+    if (target->finished_) {
+      // The joined process is already finished, just wake up the issuer right away
+      issuer->simcall_answer();
+    } else {
+      smx_activity_t sync = issuer->join(target, timeout);
+      sync->register_simcall(&issuer->simcall);
+    }
+  });
 }
 
 void Actor::set_auto_restart(bool autorestart)
 {
-  simix::simcall([this, autorestart]() {
+  kernel::actor::simcall([this, autorestart]() {
     xbt_assert(autorestart && not pimpl_->has_to_auto_restart()); // FIXME: handle all cases
     pimpl_->set_auto_restart(autorestart);
 
@@ -101,14 +120,6 @@ void Actor::set_auto_restart(bool autorestart)
   });
 }
 
-void Actor::on_exit(int_f_pvoid_pvoid_t fun, void* data) /* deprecated */
-{
-  on_exit([fun, data](bool failed) {
-    intptr_t status = failed ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS;
-    fun(reinterpret_cast<void*>(status), data);
-  });
-}
-
 void Actor::on_exit(const std::function<void(int, void*)>& fun, void* data) /* deprecated */
 {
   on_exit([fun, data](bool failed) { fun(failed ? SMX_EXIT_FAILURE : SMX_EXIT_SUCCESS, data); });
@@ -116,17 +127,17 @@ void Actor::on_exit(const std::function<void(int, void*)>& fun, void* data) /* d
 
 void Actor::on_exit(const std::function<void(bool /*failed*/)>& fun) const
 {
-  simix::simcall([this, &fun] { SIMIX_process_on_exit(pimpl_, fun); });
+  kernel::actor::simcall([this, &fun] { SIMIX_process_on_exit(pimpl_, fun); });
 }
 
 void Actor::migrate(Host* new_host)
 {
   s4u::Actor::on_migration_start(*this);
 
-  simix::simcall([this, new_host]() {
+  kernel::actor::simcall([this, new_host]() {
     if (pimpl_->waiting_synchro != nullptr) {
       // The actor is blocked on an activity. If it's an exec, migrate it too.
-      // FIXME: implement the migration of other kind of activities
+      // FIXME: implement the migration of other kinds of activities
       kernel::activity::ExecImplPtr exec =
           boost::dynamic_pointer_cast<kernel::activity::ExecImpl>(pimpl_->waiting_synchro);
       xbt_assert(exec.get() != nullptr, "We can only migrate blocked actors when they are blocked on executions.");
@@ -145,7 +156,7 @@ s4u::Host* Actor::get_host() const
 
 void Actor::daemonize()
 {
-  simix::simcall([this]() { pimpl_->daemonize(); });
+  kernel::actor::simcall([this]() { pimpl_->daemonize(); });
 }
 
 bool Actor::is_daemon() const
@@ -175,24 +186,32 @@ aid_t Actor::get_ppid() const
 
 void Actor::suspend()
 {
+  auto issuer = SIMIX_process_self();
+  auto target = pimpl_;
   s4u::Actor::on_suspend(*this);
-  simcall_process_suspend(pimpl_);
+  kernel::actor::simcall_blocking<void>([issuer, target]() {
+    target->suspend();
+    if (target != issuer) {
+      /* If we are suspending ourselves, then just do not finish the simcall now */
+      issuer->simcall_answer();
+    }
+  });
 }
 
 void Actor::resume()
 {
-  simix::simcall([this] { pimpl_->resume(); });
+  kernel::actor::simcall([this] { pimpl_->resume(); });
   s4u::Actor::on_resume(*this);
 }
 
 bool Actor::is_suspended()
 {
-  return simix::simcall([this] { return pimpl_->is_suspended(); });
+  return pimpl_->is_suspended();
 }
 
 void Actor::set_kill_time(double kill_time)
 {
-  simix::simcall([this, kill_time] { pimpl_->set_kill_time(kill_time); });
+  kernel::actor::simcall([this, kill_time] { pimpl_->set_kill_time(kill_time); });
 }
 
 /** @brief Get the kill time of an actor(or 0 if unset). */
@@ -206,7 +225,7 @@ void Actor::kill(aid_t pid) // deprecated
   kernel::actor::ActorImpl* killer = SIMIX_process_self();
   kernel::actor::ActorImpl* victim = SIMIX_process_from_PID(pid);
   if (victim != nullptr) {
-    simix::simcall([killer, victim] { killer->kill(victim); });
+    kernel::actor::simcall([killer, victim] { killer->kill(victim); });
   } else {
     std::ostringstream oss;
     oss << "kill: (" << pid << ") - No such actor" << std::endl;
@@ -217,7 +236,7 @@ void Actor::kill(aid_t pid) // deprecated
 void Actor::kill()
 {
   kernel::actor::ActorImpl* process = SIMIX_process_self();
-  simix::simcall([this, process] {
+  kernel::actor::simcall([this, process] {
     xbt_assert(pimpl_ != simix_global->maestro_process, "Killing maestro is a rather bad idea");
     process->kill(pimpl_);
   });
@@ -237,28 +256,28 @@ ActorPtr Actor::by_pid(aid_t pid)
 void Actor::kill_all()
 {
   kernel::actor::ActorImpl* self = SIMIX_process_self();
-  simix::simcall([self] { self->kill_all(); });
+  kernel::actor::simcall([self] { self->kill_all(); });
 }
 
-std::unordered_map<std::string, std::string>* Actor::get_properties()
+const std::unordered_map<std::string, std::string>* Actor::get_properties() const
 {
-  return simix::simcall([this] { return this->pimpl_->get_properties(); });
+  return pimpl_->get_properties();
 }
 
 /** Retrieve the property value (or nullptr if not set) */
-const char* Actor::get_property(const std::string& key)
+const char* Actor::get_property(const std::string& key) const
 {
-  return simix::simcall([this, &key] { return pimpl_->get_property(key); });
+  return pimpl_->get_property(key);
 }
 
 void Actor::set_property(const std::string& key, const std::string& value)
 {
-  simix::simcall([this, &key, &value] { pimpl_->set_property(key, value); });
+  kernel::actor::simcall([this, &key, &value] { pimpl_->set_property(key, value); });
 }
 
 Actor* Actor::restart()
 {
-  return simix::simcall([this]() { return pimpl_->restart(); });
+  return kernel::actor::simcall([this]() { return pimpl_->restart(); });
 }
 
 // ***** this_actor *****
@@ -282,26 +301,36 @@ bool is_maestro()
 
 void sleep_for(double duration)
 {
-  if (duration > 0) {
-    kernel::actor::ActorImpl* actor = SIMIX_process_self();
-    Actor::on_sleep(*actor->ciface());
+  xbt_assert(std::isfinite(duration), "duration is not finite!");
 
-    simcall_process_sleep(duration);
-
-    Actor::on_wake_up(*actor->ciface());
+  if (duration > 0) {
+    kernel::actor::ActorImpl* issuer = SIMIX_process_self();
+    Actor::on_sleep(*issuer->ciface());
+
+    kernel::actor::simcall_blocking<void>([issuer, duration]() {
+      if (MC_is_active() || MC_record_replay_is_active()) {
+        MC_process_clock_add(issuer, duration);
+        issuer->simcall_answer();
+        return;
+      }
+      smx_activity_t sync = issuer->sleep(duration);
+      sync->register_simcall(&issuer->simcall);
+    });
+
+    Actor::on_wake_up(*issuer->ciface());
   }
 }
 
 void yield()
 {
-  simix::simcall([] { /* do nothing*/ });
+  kernel::actor::simcall([] { /* do nothing*/ });
 }
 
-XBT_PUBLIC void sleep_until(double timeout)
+XBT_PUBLIC void sleep_until(double wakeup_time)
 {
   double now = SIMIX_get_clock();
-  if (timeout > now)
-    sleep_for(timeout - now);
+  if (wakeup_time > now)
+    sleep_for(wakeup_time - now);
 }
 
 void execute(double flops)
@@ -412,23 +441,22 @@ Host* get_host()
 
 void suspend()
 {
-  kernel::actor::ActorImpl* actor = SIMIX_process_self();
-  Actor::on_suspend(*actor->ciface());
-
-  simcall_process_suspend(actor);
+  kernel::actor::ActorImpl* self = SIMIX_process_self();
+  s4u::Actor::on_suspend(*self->ciface());
+  kernel::actor::simcall_blocking<void>([self] { self->suspend(); });
 }
 
 void resume()
 {
   kernel::actor::ActorImpl* self = SIMIX_process_self();
-  simix::simcall([self] { self->resume(); });
+  kernel::actor::simcall([self] { self->resume(); });
   Actor::on_resume(*self->ciface());
 }
 
 void exit()
 {
   kernel::actor::ActorImpl* self = SIMIX_process_self();
-  simgrid::simix::simcall([self] { self->exit(); });
+  simgrid::kernel::actor::simcall([self] { self->exit(); });
 }
 
 void on_exit(const std::function<void(bool)>& fun)
@@ -450,43 +478,6 @@ void migrate(Host* new_host)
   SIMIX_process_self()->iface()->migrate(new_host);
 }
 
-std::string getName() /* deprecated */
-{
-  return get_name();
-}
-const char* getCname() /* deprecated */
-{
-  return get_cname();
-}
-bool isMaestro() /* deprecated */
-{
-  return is_maestro();
-}
-aid_t getPid() /* deprecated */
-{
-  return get_pid();
-}
-aid_t getPpid() /* deprecated */
-{
-  return get_ppid();
-}
-Host* getHost() /* deprecated */
-{
-  return get_host();
-}
-void on_exit(int_f_pvoid_pvoid_t fun, void* data) /* deprecated */
-{
-  SIMIX_process_self()->iface()->on_exit([fun, data](int a) { fun((void*)(intptr_t)a, data); });
-}
-void onExit(int_f_pvoid_pvoid_t fun, void* data) /* deprecated */
-{
-  on_exit([fun, data](int a) { fun((void*)(intptr_t)a, data); });
-}
-void kill() /* deprecated */
-{
-  exit();
-}
-
 } // namespace this_actor
 } // namespace s4u
 } // namespace simgrid
@@ -565,7 +556,7 @@ xbt_dict_t sg_actor_get_properties(sg_actor_t actor)
 {
   xbt_assert(actor != nullptr, "Invalid parameter: First argument must not be nullptr");
   xbt_dict_t as_dict                        = xbt_dict_new_homogeneous(xbt_free_f);
-  std::unordered_map<std::string, std::string>* props = actor->get_properties();
+  const std::unordered_map<std::string, std::string>* props = actor->get_properties();
   if (props == nullptr)
     return nullptr;
   for (auto const& kv : *props) {
@@ -713,3 +704,50 @@ void sg_actor_detach()
 {
   simgrid::kernel::actor::ActorImpl::detach();
 }
+
+aid_t sg_actor_self_get_pid()
+{
+  return simgrid::s4u::this_actor::get_pid();
+}
+
+aid_t sg_actor_self_get_ppid()
+{
+  return simgrid::s4u::this_actor::get_ppid();
+}
+
+const char* sg_actor_self_get_name()
+{
+  return simgrid::s4u::this_actor::get_cname();
+}
+
+sg_actor_t sg_actor_self()
+{
+  return simgrid::s4u::Actor::self();
+}
+
+void sg_actor_self_execute(double flops)
+{
+  simgrid::s4u::this_actor::execute(flops);
+}
+
+/** @brief Take an extra reference on that actor to prevent it to be garbage-collected */
+void sg_actor_ref(sg_actor_t actor)
+{
+  intrusive_ptr_add_ref(actor);
+}
+/** @brief Release a reference on that actor so that it can get be garbage-collected */
+void sg_actor_unref(sg_actor_t actor)
+{
+  intrusive_ptr_release(actor);
+}
+
+/** @brief Return the user data of a #sg_actor_t */
+void* sg_actor_data(sg_actor_t actor)
+{
+  return actor->get_data();
+}
+/** @brief Set the user data of a #sg_actor_t */
+void sg_actor_data_set(sg_actor_t actor, void* userdata)
+{
+  actor->set_data(userdata);
+}
index 6402d77..be8bb6e 100644 (file)
@@ -17,7 +17,8 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_barrier, "S4U barrier");
 namespace simgrid {
 namespace s4u {
 
-Barrier::Barrier(unsigned int expected_processes) : mutex_(Mutex::create()), cond_(ConditionVariable::create()), expected_processes_(expected_processes)
+Barrier::Barrier(unsigned int expected_processes)
+    : mutex_(Mutex::create()), cond_(ConditionVariable::create()), expected_actors_(expected_processes)
 {
 }
 
@@ -25,24 +26,27 @@ Barrier::Barrier(unsigned int expected_processes) : mutex_(Mutex::create()), con
  *
  * See @ref s4u_raii.
  */
-BarrierPtr Barrier::create(unsigned int expected_processes)
+BarrierPtr Barrier::create(unsigned int expected_actors)
 {
-    return BarrierPtr(new Barrier(expected_processes));
+  return BarrierPtr(new Barrier(expected_actors));
 }
 
-/**
- * Wait functions
+/** @brief Block the current actor until all expected actors reach the barrier.
+ *
+ * This method is meant to be somewhat consistent with the pthread_barrier_wait function.
+ *
+ * @return 0 for all actors but one: exactly one actor will get SG_BARRIER_SERIAL_THREAD as a return value.
  */
 int Barrier::wait()
 {
   mutex_->lock();
-  arrived_processes_++;
-  XBT_DEBUG("waiting %p %u/%u", this, arrived_processes_, expected_processes_);
-  if (arrived_processes_ == expected_processes_) {
+  arrived_actors_++;
+  XBT_DEBUG("waiting %p %u/%u", this, arrived_actors_, expected_actors_);
+  if (arrived_actors_ == expected_actors_) {
     cond_->notify_all();
     mutex_->unlock();
-    arrived_processes_ = 0;
-    return -1;
+    arrived_actors_ = 0;
+    return SG_BARRIER_SERIAL_THREAD;
   }
 
   cond_->wait(mutex_);
index 188fda5..c50b10a 100644 (file)
@@ -106,6 +106,13 @@ CommPtr Comm::set_dst_data(void** buff, size_t size)
   return this;
 }
 
+CommPtr Comm::set_tracing_category(const std::string& category)
+{
+  xbt_assert(state_ == State::INITED, "Cannot change the tracing category of an exec after its start");
+  tracing_category_ = category;
+  return this;
+}
+
 Comm* Comm::start()
 {
   xbt_assert(get_state() == State::INITED, "You cannot use %s() once your communication started (not implemented)",
@@ -193,7 +200,7 @@ Comm* Comm::detach()
 
 Comm* Comm::cancel()
 {
-  simix::simcall([this] {
+  kernel::actor::simcall([this] {
     if (pimpl_)
       boost::static_pointer_cast<kernel::activity::CommImpl>(pimpl_)->cancel();
   });
@@ -223,9 +230,9 @@ Mailbox* Comm::get_mailbox()
   return mailbox_;
 }
 
-ActorPtr Comm::get_sender()
+Actor* Comm::get_sender()
 {
-  return sender_ ? sender_->iface() : nullptr;
+  return sender_ ? sender_->ciface() : nullptr;
 }
 
 void intrusive_ptr_release(simgrid::s4u::Comm* c)
index e9f2c45..0e9683f 100644 (file)
@@ -3,6 +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 "simgrid/cond.h"
+#include "simgrid/forward.h"
 #include "simgrid/s4u/ConditionVariable.hpp"
 #include "simgrid/simix.h"
 #include "src/kernel/activity/ConditionVariableImpl.hpp"
@@ -17,7 +19,7 @@ namespace s4u {
 ConditionVariablePtr ConditionVariable::create()
 {
   kernel::activity::ConditionVariableImpl* cond =
-      simix::simcall([] { return new kernel::activity::ConditionVariableImpl(); });
+      kernel::actor::simcall([] { return new kernel::activity::ConditionVariableImpl(); });
   return ConditionVariablePtr(&cond->cond_, false);
 }
 
@@ -65,12 +67,12 @@ std::cv_status ConditionVariable::wait_until(std::unique_lock<Mutex>& lock, doub
  */
 void ConditionVariable::notify_one()
 {
-  simgrid::simix::simcall([this]() { cond_->signal(); });
+  simgrid::kernel::actor::simcall([this]() { cond_->signal(); });
 }
 
 void ConditionVariable::notify_all()
 {
-  simgrid::simix::simcall([this]() { cond_->broadcast(); });
+  simgrid::kernel::actor::simcall([this]() { cond_->broadcast(); });
 }
 
 void intrusive_ptr_add_ref(ConditionVariable* cond)
@@ -85,3 +87,38 @@ void intrusive_ptr_release(ConditionVariable* cond)
 
 } // namespace s4u
 } // namespace simgrid
+
+/* **************************** Public C interface *************************** */
+sg_cond_t sg_cond_init()
+{
+  simgrid::kernel::activity::ConditionVariableImpl* cond =
+      simgrid::kernel::actor::simcall([] { return new simgrid::kernel::activity::ConditionVariableImpl(); });
+
+  return new simgrid::s4u::ConditionVariable(cond);
+}
+
+void sg_cond_wait(sg_cond_t cond, sg_mutex_t mutex)
+{
+  cond->wait(mutex);
+}
+
+int sg_cond_wait_for(sg_cond_t cond, sg_mutex_t mutex, double delay)
+{
+  std::unique_lock<simgrid::s4u::Mutex> lock(*mutex);
+  return cond->wait_for(lock, delay) == std::cv_status::timeout ? 1 : 0;
+}
+
+void sg_cond_notify_one(sg_cond_t cond)
+{
+  cond->notify_one();
+}
+
+void sg_cond_notify_all(sg_cond_t cond)
+{
+  cond->notify_all();
+}
+
+void sg_cond_destroy(sg_cond_t cond)
+{
+  delete cond;
+}
diff --git a/src/s4u/s4u_Disk.cpp b/src/s4u/s4u_Disk.cpp
new file mode 100644 (file)
index 0000000..562e742
--- /dev/null
@@ -0,0 +1,70 @@
+/* Copyright (c) 2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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/Disk.hpp"
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Host.hpp"
+#include "simgrid/s4u/Io.hpp"
+#include "src/kernel/resource/DiskImpl.hpp"
+
+namespace simgrid {
+namespace xbt {
+template class Extendable<s4u::Disk>;
+} // namespace xbt
+
+namespace s4u {
+
+xbt::signal<void(Disk&)> Disk::on_creation;
+xbt::signal<void(Disk const&)> Disk::on_destruction;
+xbt::signal<void(Disk const&)> Disk::on_state_change;
+
+Host* Disk::get_host()
+{
+  return pimpl_->get_host();
+}
+
+const std::unordered_map<std::string, std::string>* Disk::get_properties() const
+{
+  return pimpl_->get_properties();
+}
+
+const char* Disk::get_property(const std::string& key) const
+{
+  return this->pimpl_->get_property(key);
+}
+
+void Disk::set_property(const std::string& key, const std::string& value)
+{
+  kernel::actor::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
+}
+
+IoPtr Disk::io_init(sg_size_t size, Io::OpType type)
+{
+  return IoPtr(new Io(this, size, type));
+}
+
+IoPtr Disk::read_async(sg_size_t size)
+{
+  return IoPtr(io_init(size, Io::OpType::READ))->start();
+}
+
+sg_size_t Disk::read(sg_size_t size)
+{
+  return IoPtr(io_init(size, Io::OpType::READ))->start()->wait()->get_performed_ioops();
+}
+
+IoPtr Disk::write_async(sg_size_t size)
+{
+
+  return IoPtr(io_init(size, Io::OpType::WRITE)->start());
+}
+
+sg_size_t Disk::write(sg_size_t size)
+{
+  return IoPtr(io_init(size, Io::OpType::WRITE))->start()->wait()->get_performed_ioops();
+}
+
+} // namespace s4u
+} // namespace simgrid
index 141c981..1d12c11 100644 (file)
@@ -8,6 +8,7 @@
 #include "mc/mc.h"
 #include "simgrid/kernel/routing/NetPoint.hpp"
 #include "simgrid/kernel/routing/NetZoneImpl.hpp"
+#include "simgrid/s4u/Disk.hpp"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/Mailbox.hpp"
@@ -28,11 +29,11 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_engine, s4u, "Logging specific to S4U (engin
 
 namespace simgrid {
 namespace s4u {
-xbt::signal<void()> on_platform_creation;
-xbt::signal<void()> on_platform_created;
-xbt::signal<void()> on_simulation_end;
-xbt::signal<void(double)> on_time_advance;
-xbt::signal<void(void)> on_deadlock;
+xbt::signal<void()> Engine::on_platform_creation;
+xbt::signal<void()> Engine::on_platform_created;
+xbt::signal<void()> Engine::on_simulation_end;
+xbt::signal<void(double)> Engine::on_time_advance;
+xbt::signal<void(void)> Engine::on_deadlock;
 
 Engine* Engine::instance_ = nullptr; /* That singleton is awful, but I don't see no other solution right now. */
 
@@ -89,7 +90,7 @@ void Engine::load_platform(const std::string& platf)
   double start = xbt_os_time();
   try {
     parse_platform_file(platf);
-  } catch (xbt_ex& e) {
+  } catch (const Exception& e) {
     xbt_die("Error while loading %s: %s", platf.c_str(), e.what());
   }
 
@@ -340,12 +341,6 @@ kernel::routing::NetPoint* Engine::netpoint_by_name_or_null(const std::string& n
   return netp == pimpl->netpoints_.end() ? nullptr : netp->second;
 }
 
-/** @brief Fill the provided vector with all existing netpoints */
-void Engine::getNetpointList(std::vector<kernel::routing::NetPoint*>* list)
-{
-  for (auto const& kv : pimpl->netpoints_)
-    list->push_back(kv.second);
-}
 std::vector<kernel::routing::NetPoint*> Engine::get_all_netpoints()
 {
   std::vector<kernel::routing::NetPoint*> res;
@@ -357,7 +352,7 @@ std::vector<kernel::routing::NetPoint*> Engine::get_all_netpoints()
 /** @brief Register a new netpoint to the system */
 void Engine::netpoint_register(kernel::routing::NetPoint* point)
 {
-  // simgrid::simix::simcall([&]{ FIXME: this segfaults in set_thread
+  // simgrid::kernel::actor::simcall([&]{ FIXME: this segfaults in set_thread
   pimpl->netpoints_[point->get_name()] = point;
   // });
 }
@@ -365,7 +360,7 @@ void Engine::netpoint_register(kernel::routing::NetPoint* point)
 /** @brief Unregister a given netpoint */
 void Engine::netpoint_unregister(kernel::routing::NetPoint* point)
 {
-  simix::simcall([this, point] {
+  kernel::actor::simcall([this, point] {
     pimpl->netpoints_.erase(point->get_name());
     delete point;
   });
index e65f996..76dbb61 100644 (file)
@@ -12,8 +12,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_exec, s4u_activity, "S4U asynchronous execut
 
 namespace simgrid {
 namespace s4u {
-xbt::signal<void(Actor const&)> Exec::on_start;
-xbt::signal<void(Actor const&)> Exec::on_completion;
+xbt::signal<void(Actor const&, Exec const&)> Exec::on_start;
+xbt::signal<void(Actor const&, Exec const&)> Exec::on_completion;
 
 Exec::Exec()
 {
@@ -44,7 +44,7 @@ Exec* Exec::wait()
     start();
   simcall_execution_wait(pimpl_);
   state_ = State::FINISHED;
-  on_completion(*Actor::self());
+  on_completion(*Actor::self(), *this);
   return this;
 }
 
@@ -53,9 +53,17 @@ Exec* Exec::wait_for(double)
   THROW_UNIMPLEMENTED;
 }
 
+int Exec::wait_any_for(std::vector<ExecPtr>* execs, double timeout)
+{
+  std::unique_ptr<kernel::activity::ExecImpl* []> rexecs(new kernel::activity::ExecImpl*[execs->size()]);
+  std::transform(begin(*execs), end(*execs), rexecs.get(),
+                 [](const ExecPtr& exec) { return static_cast<kernel::activity::ExecImpl*>(exec->pimpl_.get()); });
+  return simcall_execution_waitany_for(rexecs.get(), execs->size(), timeout);
+}
+
 Exec* Exec::cancel()
 {
-  simix::simcall([this] { boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->cancel(); });
+  kernel::actor::simcall([this] { boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->cancel(); });
   state_ = State::CANCELED;
   return this;
 }
@@ -90,6 +98,27 @@ ExecPtr Exec::set_timeout(double timeout)
   return this;
 }
 
+Host* Exec::get_host() const
+{
+  return static_cast<kernel::activity::ExecImpl*>(pimpl_.get())->get_host();
+}
+unsigned int Exec::get_host_number() const
+{
+  return static_cast<kernel::activity::ExecImpl*>(pimpl_.get())->get_host_number();
+}
+double Exec::get_start_time() const
+{
+  return (pimpl_->surf_action_ == nullptr) ? -1 : pimpl_->surf_action_->get_start_time();
+}
+double Exec::get_finish_time() const
+{
+  return (pimpl_->surf_action_ == nullptr) ? -1 : pimpl_->surf_action_->get_finish_time();
+}
+double Exec::get_cost() const
+{
+  return (pimpl_->surf_action_ == nullptr) ? -1 : pimpl_->surf_action_->get_cost();
+}
+
 /** @brief  Change the execution priority, don't you think?
  *
  * An execution with twice the priority will get twice the amount of flops when the resource is shared.
@@ -112,17 +141,17 @@ ExecSeq::ExecSeq(sg_host_t host, double flops_amount) : Exec(), flops_amount_(fl
 
 Exec* ExecSeq::start()
 {
-  simix::simcall([this] {
+  kernel::actor::simcall([this] {
     (*boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_))
         .set_name(name_)
         .set_tracing_category(tracing_category_)
-        .set_priority(1. / priority_)
+        .set_sharing_penalty(1. / priority_)
         .set_bound(bound_)
         .set_flops_amount(flops_amount_)
         .start();
   });
   state_ = State::STARTED;
-  on_start(*Actor::self());
+  on_start(*Actor::self(), *this);
   return this;
 }
 
@@ -151,17 +180,17 @@ Host* ExecSeq::get_host()
 /** @brief Returns the amount of flops that remain to be done */
 double ExecSeq::get_remaining()
 {
-  return simgrid::simix::simcall(
+  return simgrid::kernel::actor::simcall(
       [this]() { return boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(pimpl_)->get_remaining(); });
 }
 
-/** @brief Returns the ratio of elements that are still to do
+/** @brief Returns the ratio of elements that are still to do
  *
  * The returned value is between 0 (completely done) and 1 (nothing done yet).
  */
 double ExecSeq::get_remaining_ratio()
 {
-  return simgrid::simix::simcall([this]() {
+  return simgrid::kernel::actor::simcall([this]() {
     return boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(pimpl_)->get_seq_remaining_ratio();
   });
 }
@@ -175,7 +204,7 @@ ExecPar::ExecPar(const std::vector<s4u::Host*>& hosts, const std::vector<double>
 
 Exec* ExecPar::start()
 {
-  simix::simcall([this] {
+  kernel::actor::simcall([this] {
     (*boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_))
         .set_hosts(hosts_)
         .set_timeout(timeout_)
@@ -184,13 +213,13 @@ Exec* ExecPar::start()
         .start();
   });
   state_ = State::STARTED;
-  on_start(*Actor::self());
+  on_start(*Actor::self(), *this);
   return this;
 }
 
 double ExecPar::get_remaining_ratio()
 {
-  return simix::simcall(
+  return kernel::actor::simcall(
       [this]() { return boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->get_par_remaining_ratio(); });
 }
 
index b2731c4..5cb23b1 100644 (file)
@@ -7,6 +7,8 @@
 #include "simgrid/s4u/Actor.hpp"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Exec.hpp"
+#include "simgrid/s4u/VirtualMachine.hpp"
+#include "src/plugins/vm/VirtualMachineImpl.hpp"
 #include "src/simix/smx_private.hpp"
 #include "src/surf/HostImpl.hpp"
 
@@ -16,8 +18,6 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_host, s4u, "Logging specific to the S4U hosts");
 XBT_LOG_EXTERNAL_CATEGORY(surf_route);
 
-int USER_HOST_LEVEL = -1;
-
 namespace simgrid {
 namespace xbt {
 template class Extendable<s4u::Host>;
@@ -85,7 +85,7 @@ Host* Host::current()
 void Host::turn_on()
 {
   if (not is_on()) {
-    simix::simcall([this] {
+    kernel::actor::simcall([this] {
       this->pimpl_cpu->turn_on();
       this->pimpl_->turn_on();
       on_state_change(*this);
@@ -97,7 +97,12 @@ void Host::turn_on()
 void Host::turn_off()
 {
   if (is_on()) {
-    simix::simcall([this] {
+    kernel::actor::simcall([this] {
+      for (VirtualMachine* const& vm : vm::VirtualMachineImpl::allVms_)
+        if (vm->get_pm() == this) {
+          vm->shutdown();
+          vm->turn_off();
+        }
       this->pimpl_cpu->turn_off();
       this->pimpl_->turn_off();
 
@@ -132,22 +137,6 @@ int Host::get_actor_count()
   return pimpl_->get_actor_count();
 }
 
-/** @deprecated */
-void Host::getProcesses(std::vector<ActorPtr>* list)
-{
-  auto actors = get_all_actors();
-  for (auto& actor : actors)
-    list->push_back(actor);
-}
-
-/** @deprecated */
-void Host::actorList(std::vector<ActorPtr>* whereto)
-{
-  auto actors = get_all_actors();
-  for (auto& actor : actors)
-    whereto->push_back(actor);
-}
-
 /**
  * @brief Find a route toward another host
  *
@@ -180,10 +169,24 @@ void Host::route_to(Host* dest, std::vector<kernel::resource::LinkImpl*>& links,
   }
 }
 
+/** @brief Returns the networking zone englobing that host */
+NetZone* Host::get_englobing_zone()
+{
+  return pimpl_netpoint->get_englobing_zone()->get_iface();
+}
+
+void Host::send_to(Host* dest, double byte_amount)
+{
+  std::vector<Host*> m_host_list   = {this, dest};
+  std::vector<double> flops_amount = {0, 0};
+  std::vector<double> bytes_amount = {0, byte_amount, 0, 0};
+  this_actor::parallel_execute(m_host_list, flops_amount, bytes_amount);
+}
+
 /** Get the properties assigned to a host */
-std::unordered_map<std::string, std::string>* Host::get_properties()
+const std::unordered_map<std::string, std::string>* Host::get_properties() const
 {
-  return simix::simcall([this] { return this->pimpl_->get_properties(); });
+  return this->pimpl_->get_properties();
 }
 
 /** Retrieve the property value (or nullptr if not set) */
@@ -194,13 +197,19 @@ const char* Host::get_property(const std::string& key) const
 
 void Host::set_property(const std::string& key, const std::string& value)
 {
-  simix::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
+  kernel::actor::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
+}
+
+void Host::set_properties(const std::map<std::string, std::string>& properties)
+{
+  kernel::actor::simcall([this, &properties] { this->pimpl_->set_properties(properties); });
 }
+
 /** Specify a profile turning the host on and off according to a exhaustive list or a stochastic law.
  * The profile must contain boolean values. */
 void Host::set_state_profile(kernel::profile::Profile* p)
 {
-  return simix::simcall([this, p] { pimpl_cpu->set_state_profile(p); });
+  return kernel::actor::simcall([this, p] { pimpl_cpu->set_state_profile(p); });
 }
 /** Specify a profile modeling the external load according to a exhaustive list or a stochastic law.
  *
@@ -210,7 +219,7 @@ void Host::set_state_profile(kernel::profile::Profile* p)
  */
 void Host::set_speed_profile(kernel::profile::Profile* p)
 {
-  return simix::simcall([this, p] { pimpl_cpu->set_speed_profile(p); });
+  return kernel::actor::simcall([this, p] { pimpl_cpu->set_speed_profile(p); });
 }
 
 /** @brief Get the peak processor speed (in flops/s), at the specified pstate  */
@@ -265,7 +274,7 @@ int Host::get_core_count() const
 /** @brief Set the pstate at which the host should run */
 void Host::set_pstate(int pstate_index)
 {
-  simix::simcall([this, pstate_index] { this->pimpl_cpu->set_pstate(pstate_index); });
+  kernel::actor::simcall([this, pstate_index] { this->pimpl_cpu->set_pstate(pstate_index); });
 }
 /** @brief Retrieve the pstate at which the host is currently running */
 int Host::get_pstate() const
@@ -273,6 +282,20 @@ int Host::get_pstate() const
   return this->pimpl_cpu->get_pstate();
 }
 
+std::vector<Disk*> Host::get_disks() const
+{
+  return kernel::actor::simcall([this] { return this->pimpl_->get_disks(); });
+}
+
+void Host::add_disk(Disk* disk)
+{
+  kernel::actor::simcall([this, disk] { this->pimpl_->add_disk(disk); });
+}
+
+void Host::remove_disk(const std::string& disk_name)
+{
+  kernel::actor::simcall([this, disk_name] { this->pimpl_->remove_disk(disk_name); });
+}
 /**
  * @ingroup simix_storage_management
  * @brief Returns the list of storages attached to a host.
@@ -280,14 +303,7 @@ int Host::get_pstate() const
  */
 std::vector<const char*> Host::get_attached_storages() const
 {
-  return simix::simcall([this] { return this->pimpl_->get_attached_storages(); });
-}
-
-void Host::getAttachedStorages(std::vector<const char*>* storages)
-{
-  std::vector<const char*> local_storages = simix::simcall([this] { return this->pimpl_->get_attached_storages(); });
-  for (auto elm : local_storages)
-    storages->push_back(elm);
+  return kernel::actor::simcall([this] { return this->pimpl_->get_attached_storages(); });
 }
 
 std::unordered_map<std::string, Storage*> const& Host::get_mounted_storages()
@@ -383,17 +399,25 @@ xbt_dynar_t sg_hosts_as_dynar()
 // ========= Layering madness ==============*
 
 // ========== User data Layer ==========
-void* sg_host_user(sg_host_t host)
+void* sg_host_data(sg_host_t host)
 {
-  return host->extension(USER_HOST_LEVEL);
+  return host->get_data();
 }
-void sg_host_user_set(sg_host_t host, void* userdata)
+void sg_host_data_set(sg_host_t host, void* userdata)
 {
-  host->extension_set(USER_HOST_LEVEL, userdata);
+  host->set_data(userdata);
 }
-void sg_host_user_destroy(sg_host_t host)
+void* sg_host_user(sg_host_t host) // deprecated
 {
-  host->extension_set(USER_HOST_LEVEL, nullptr);
+  return host->get_data();
+}
+void sg_host_user_set(sg_host_t host, void* userdata) // deprecated
+{
+  host->set_data(userdata);
+}
+void sg_host_user_destroy(sg_host_t host) // deprecated
+{
+  host->set_data(nullptr);
 }
 
 // ========= storage related functions ============
@@ -528,7 +552,7 @@ int sg_host_is_off(sg_host_t host)
 xbt_dict_t sg_host_get_properties(sg_host_t host)
 {
   xbt_dict_t as_dict = xbt_dict_new_homogeneous(xbt_free_f);
-  std::unordered_map<std::string, std::string>* props = host->get_properties();
+  const std::unordered_map<std::string, std::string>* props = host->get_properties();
   if (props == nullptr)
     return nullptr;
   for (auto const& elm : *props) {
@@ -601,13 +625,18 @@ double sg_host_route_bandwidth(sg_host_t from, sg_host_t to)
   return min_bandwidth;
 }
 
+void sg_host_send_to(sg_host_t from, sg_host_t to, double byte_amount)
+{
+  from->send_to(to, byte_amount);
+}
+
 /** @brief Displays debugging information about a host */
 void sg_host_dump(sg_host_t host)
 {
   XBT_INFO("Displaying host %s", host->get_cname());
   XBT_INFO("  - speed: %.0f", host->get_speed());
   XBT_INFO("  - available speed: %.2f", sg_host_get_available_speed(host));
-  std::unordered_map<std::string, std::string>* props = host->get_properties();
+  const std::unordered_map<std::string, std::string>* props = host->get_properties();
 
   if (not props->empty()) {
     XBT_INFO("  - properties:");
index 7a89c7b..4cf33bc 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 "simgrid/s4u/Disk.hpp"
 #include "simgrid/s4u/Io.hpp"
 #include "simgrid/s4u/Storage.hpp"
 #include "src/kernel/activity/IoImpl.hpp"
@@ -13,6 +14,12 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_io, s4u_activity, "S4U asynchronous IOs");
 namespace simgrid {
 namespace s4u {
 
+Io::Io(sg_disk_t disk, sg_size_t size, OpType type) : disk_(disk), size_(size), type_(type)
+{
+  Activity::set_remaining(size_);
+  pimpl_ = kernel::activity::IoImplPtr(new kernel::activity::IoImpl());
+}
+
 Io::Io(sg_storage_t storage, sg_size_t size, OpType type) : storage_(storage), size_(size), type_(type)
 {
   Activity::set_remaining(size_);
@@ -21,13 +28,22 @@ Io::Io(sg_storage_t storage, sg_size_t size, OpType type) : storage_(storage), s
 
 Io* Io::start()
 {
-  simix::simcall([this] {
-    (*boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_))
-        .set_name(name_)
-        .set_storage(storage_->get_impl())
-        .set_size(size_)
-        .set_type(type_)
-        .start();
+  kernel::actor::simcall([this] {
+    if (storage_) {
+      (*boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_))
+          .set_name(name_)
+          .set_storage(storage_->get_impl())
+          .set_size(size_)
+          .set_type(type_)
+          .start();
+    } else {
+      (*boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_))
+          .set_name(name_)
+          .set_disk(disk_->get_impl())
+          .set_size(size_)
+          .set_type(type_)
+          .start();
+    }
   });
   state_ = State::STARTED;
   return this;
@@ -35,7 +51,7 @@ Io* Io::start()
 
 Io* Io::cancel()
 {
-  simgrid::simix::simcall([this] { boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->cancel(); });
+  simgrid::kernel::actor::simcall([this] { boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->cancel(); });
   state_ = State::CANCELED;
   return this;
 }
@@ -70,13 +86,13 @@ bool Io::test()
 /** @brief Returns the amount of flops that remain to be done */
 double Io::get_remaining()
 {
-  return simix::simcall(
+  return kernel::actor::simcall(
       [this]() { return boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->get_remaining(); });
 }
 
 sg_size_t Io::get_performed_ioops()
 {
-  return simix::simcall(
+  return kernel::actor::simcall(
       [this]() { return boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->get_performed_ioops(); });
 }
 
index 456c57d..bb48a1b 100644 (file)
@@ -71,11 +71,11 @@ double Link::get_usage()
 
 void Link::turn_on()
 {
-  simgrid::simix::simcall([this]() { this->pimpl_->turn_on(); });
+  simgrid::kernel::actor::simcall([this]() { this->pimpl_->turn_on(); });
 }
 void Link::turn_off()
 {
-  simgrid::simix::simcall([this]() { this->pimpl_->turn_off(); });
+  simgrid::kernel::actor::simcall([this]() { this->pimpl_->turn_off(); });
 }
 
 bool Link::is_on() const
@@ -83,35 +83,26 @@ bool Link::is_on() const
   return this->pimpl_->is_on();
 }
 
-void* Link::get_data()
-{
-  return this->pimpl_->get_data();
-}
-void Link::set_data(void* d)
-{
-  simgrid::simix::simcall([this, d]() { this->pimpl_->set_data(d); });
-}
-
 void Link::set_state_profile(kernel::profile::Profile* profile)
 {
-  simgrid::simix::simcall([this, profile]() { this->pimpl_->set_state_profile(profile); });
+  simgrid::kernel::actor::simcall([this, profile]() { this->pimpl_->set_state_profile(profile); });
 }
 void Link::set_bandwidth_profile(kernel::profile::Profile* profile)
 {
-  simgrid::simix::simcall([this, profile]() { this->pimpl_->set_bandwidth_profile(profile); });
+  simgrid::kernel::actor::simcall([this, profile]() { this->pimpl_->set_bandwidth_profile(profile); });
 }
 void Link::set_latency_profile(kernel::profile::Profile* trace)
 {
-  simgrid::simix::simcall([this, trace]() { this->pimpl_->set_latency_profile(trace); });
+  simgrid::kernel::actor::simcall([this, trace]() { this->pimpl_->set_latency_profile(trace); });
 }
 
-const char* Link::get_property(const std::string& key)
+const char* Link::get_property(const std::string& key) const
 {
   return this->pimpl_->get_property(key);
 }
 void Link::set_property(const std::string& key, const std::string& value)
 {
-  simgrid::simix::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
+  simgrid::kernel::actor::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
 }
 } // namespace s4u
 } // namespace simgrid
index baa91b8..d9d6c6c 100644 (file)
@@ -29,7 +29,7 @@ Mailbox* Mailbox::by_name(const std::string& name)
 {
   kernel::activity::MailboxImpl* mbox = kernel::activity::MailboxImpl::by_name_or_null(name);
   if (mbox == nullptr) {
-    mbox = simix::simcall([&name] { return kernel::activity::MailboxImpl::by_name_or_create(name); });
+    mbox = kernel::actor::simcall([&name] { return kernel::activity::MailboxImpl::by_name_or_create(name); });
   }
   return &mbox->piface_;
 }
@@ -63,7 +63,7 @@ kernel::activity::CommImplPtr Mailbox::front()
 
 void Mailbox::set_receiver(ActorPtr actor)
 {
-  simix::simcall([this, actor]() { this->pimpl_->set_receiver(actor); });
+  kernel::actor::simcall([this, actor]() { this->pimpl_->set_receiver(actor); });
 }
 
 /** @brief get the receiver (process associated to the mailbox) */
@@ -152,7 +152,7 @@ void* Mailbox::get(double timeout)
 
 smx_activity_t Mailbox::iprobe(int type, int (*match_fun)(void*, void*, kernel::activity::CommImpl*), void* data)
 {
-  return simix::simcall([this, type, match_fun, data] { return pimpl_->iprobe(type, match_fun, data); });
+  return kernel::actor::simcall([this, type, match_fun, data] { return pimpl_->iprobe(type, match_fun, data); });
 }
 } // namespace s4u
 } // namespace simgrid
index 2f90b26..6494276 100644 (file)
@@ -3,6 +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 "simgrid/forward.h"
+#include "simgrid/mutex.h"
 #include "simgrid/s4u/Mutex.hpp"
 #include "src/kernel/activity/MutexImpl.hpp"
 
@@ -42,7 +44,7 @@ bool Mutex::try_lock()
  */
 MutexPtr Mutex::create()
 {
-  kernel::activity::MutexImpl* mutex = simix::simcall([] { return new kernel::activity::MutexImpl(); });
+  kernel::activity::MutexImpl* mutex = kernel::actor::simcall([] { return new kernel::activity::MutexImpl(); });
   return MutexPtr(&mutex->mutex(), false);
 }
 
@@ -62,3 +64,32 @@ void intrusive_ptr_release(Mutex* mutex)
 
 } // namespace s4u
 } // namespace simgrid
+
+/* **************************** Public C interface *************************** */
+sg_mutex_t sg_mutex_init()
+{
+  simgrid::kernel::activity::MutexImpl* mutex =
+      simgrid::kernel::actor::simcall([] { return new simgrid::kernel::activity::MutexImpl(); });
+
+  return new simgrid::s4u::Mutex(mutex);
+}
+
+void sg_mutex_lock(sg_mutex_t mutex)
+{
+  mutex->lock();
+}
+
+void sg_mutex_unlock(sg_mutex_t mutex)
+{
+  mutex->unlock();
+}
+
+int sg_mutex_try_lock(sg_mutex_t mutex)
+{
+  return mutex->try_lock();
+}
+
+void sg_mutex_destroy(sg_mutex_t mutex)
+{
+  delete mutex;
+}
index cb45e8e..dec17ec 100644 (file)
@@ -21,25 +21,21 @@ xbt::signal<void(bool symmetrical, kernel::routing::NetPoint* src, kernel::routi
 xbt::signal<void(NetZone const&)> NetZone::on_creation;
 xbt::signal<void(NetZone const&)> NetZone::on_seal;
 
-NetZone::NetZone(kernel::routing::NetZoneImpl* impl) : pimpl_(impl) {}
-
-NetZone::~NetZone()
-{
-}
-
-std::unordered_map<std::string, std::string>* NetZone::get_properties()
+const std::unordered_map<std::string, std::string>* NetZone::get_properties() const
 {
-  return simix::simcall([this] { return &properties_; });
+  return &properties_;
 }
 
 /** Retrieve the property value (or nullptr if not set) */
-const char* NetZone::get_property(const std::string& key)
+const char* NetZone::get_property(const std::string& key) const
 {
-  return properties_.at(key).c_str();
+  auto prop = properties_.find(key);
+  return prop == properties_.end() ? nullptr : prop->second.c_str();
 }
+
 void NetZone::set_property(const std::string& key, const std::string& value)
 {
-  simix::simcall([this, &key, &value] { properties_[key] = value; });
+  kernel::actor::simcall([this, &key, &value] { properties_[key] = value; });
 }
 
 /** @brief Returns the list of direct children (no grand-children) */
@@ -74,15 +70,6 @@ std::vector<Host*> NetZone::get_all_hosts()
   return pimpl_->get_all_hosts();
 }
 
-void NetZone::getHosts(std::vector<Host*>* whereto)
-{
-  for (auto const& card : pimpl_->get_vertices()) {
-    Host* host = Host::by_name_or_null(card->get_name());
-    if (host != nullptr)
-      whereto->push_back(host);
-  }
-}
-
 int NetZone::get_host_count()
 {
   return pimpl_->get_host_count();
@@ -105,10 +92,6 @@ void NetZone::add_bypass_route(kernel::routing::NetPoint* src, kernel::routing::
 {
   pimpl_->add_bypass_route(src, dst, gw_src, gw_dst, link_list, symmetrical);
 }
-std::vector<kernel::routing::NetPoint*> NetZone::getVertices()
-{
-  return pimpl_->get_vertices();
-}
 } // namespace s4u
 } // namespace simgrid
 
index 8476633..debf3ec 100644 (file)
@@ -15,7 +15,7 @@ namespace s4u {
 
 Semaphore::Semaphore(unsigned int initial_capacity)
 {
-  sem_ = simix::simcall([initial_capacity] { return new kernel::activity::SemaphoreImpl(initial_capacity); });
+  sem_ = kernel::actor::simcall([initial_capacity] { return new kernel::activity::SemaphoreImpl(initial_capacity); });
 }
 
 Semaphore::~Semaphore()
@@ -43,17 +43,17 @@ int Semaphore::acquire_timeout(double timeout)
 
 void Semaphore::release()
 {
-  simix::simcall([this] { sem_->release(); });
+  kernel::actor::simcall([this] { sem_->release(); });
 }
 
 int Semaphore::get_capacity()
 {
-  return simix::simcall([this] { return sem_->get_capacity(); });
+  return kernel::actor::simcall([this] { return sem_->get_capacity(); });
 }
 
 int Semaphore::would_block()
 {
-  return simix::simcall([this] { return sem_->would_block(); });
+  return kernel::actor::simcall([this] { return sem_->would_block(); });
 }
 
 void intrusive_ptr_add_ref(Semaphore* sem)
index 0be7985..08ad078 100644 (file)
@@ -41,19 +41,19 @@ const char* Storage::get_type()
   return pimpl_->typeId_.c_str();
 }
 
-std::unordered_map<std::string, std::string>* Storage::get_properties()
+const std::unordered_map<std::string, std::string>* Storage::get_properties() const
 {
-  return simix::simcall([this] { return pimpl_->get_properties(); });
+  return pimpl_->get_properties();
 }
 
-const char* Storage::get_property(const std::string& key)
+const char* Storage::get_property(const std::string& key) const
 {
   return this->pimpl_->get_property(key);
 }
 
 void Storage::set_property(const std::string& key, const std::string& value)
 {
-  simix::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
+  kernel::actor::simcall([this, &key, &value] { this->pimpl_->set_property(key, value); });
 }
 
 IoPtr Storage::io_init(sg_size_t size, Io::OpType type)
@@ -118,7 +118,7 @@ xbt_dict_t sg_storage_get_properties(sg_storage_t storage)
 {
   xbt_assert((storage != nullptr), "Invalid parameters (storage is nullptr)");
   xbt_dict_t as_dict                        = xbt_dict_new_homogeneous(xbt_free_f);
-  std::unordered_map<std::string, std::string>* props = storage->get_properties();
+  const std::unordered_map<std::string, std::string>* props = storage->get_properties();
   if (props == nullptr)
     return nullptr;
   for (auto const& elm : *props) {
index 73b43cd..853e760 100644 (file)
@@ -639,838 +639,472 @@ struct yy_trans_info
        flex_int32_t yy_verify;
        flex_int32_t yy_nxt;
        };
-static const flex_int16_t yy_accept[775] =
-    {   0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,  141,  139,   15,   10,
-       10,   15,   15,  119,   10,  119,    5,    6,    5,    8,
-        9,    8,  135,  127,  128,  136,  133,  136,  134,  138,
-      127,  128,  138,  139,   40,   10,   40,   40,   40,   38,
-
-       40,   40,   40,   40,   40,   40,   40,   44,   10,   44,
-       44,  139,  139,   44,   51,   10,   51,   51,   51,   49,
-       51,   55,   10,   55,  139,   55,   72,   10,   72,   72,
-       72,   70,   72,   72,   72,   72,   72,   76,   10,   76,
-      139,   76,   83,   10,   83,   83,   83,   81,   83,   87,
-       10,   87,  114,   10,  114,  114,  114,  112,  114,  114,
-      114,  114,  114,  114,  118,   10,  118,  136,  135,   10,
-        0,    2,    2,    0,    4,    7,  130,  129,    0,    0,
-        0,    0,    0,    0,    0,   39,   41,   41,   41,   41,
-       41,   41,   41,   41,   41,   41,    0,    0,    0,    0,
-
-        0,    0,    0,    0,   50,   52,   52,    0,    0,   71,
-       73,   73,   73,   73,   73,   73,    0,    0,   82,   84,
-       84,    0,  113,  115,  115,  115,  115,  115,  115,  115,
-      115,    0,    0,    0,    0,    0,    0,    0,    3,    0,
-        0,    0,    0,    0,    0,    0,  137,    0,   41,   41,
-       41,   41,   41,   41,   41,   41,   41,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,   52,    0,    0,    0,
-        0,    0,   73,   73,   73,   73,    0,    0,    0,   84,
-        0,    0,  115,  115,  115,  115,  115,  115,  115,    0,
-        0,    0,  132,    0,   14,    1,    0,    0,  125,    0,
-
-        0,    0,  122,  121,    0,    0,   41,   41,   41,   41,
-       41,   41,   41,   41,   41,    0,    0,   43,    0,    0,
-        0,   57,    0,    0,   56,    0,    0,    0,    0,    0,
-       54,    0,    0,    0,   59,   58,   73,   73,   73,   73,
-        0,    0,   75,    0,    0,    0,    0,    0,    0,   86,
-        0,  115,  115,  115,  115,  115,  115,  115,    0,    0,
-      117,    0,    0,    0,    0,  126,  120,    0,    0,   17,
-       41,   41,   41,   41,   41,    0,    0,   41,   41,   41,
-        0,   16,    0,   57,    0,   88,   56,    0,    0,   48,
-       47,    0,    0,   73,    0,    0,   73,   73,   73,    0,
-
-       89,    0,   80,   79,    0,    0,    0,    0,    0,  115,
-      115,    0,    0,  115,    0,    0,    0,    0,    0,    0,
-        0,   12,    0,  123,  124,   17,   41,    0,    0,   41,
-        0,    0,   41,    0,   29,   28,   41,    0,   41,    0,
-       41,    0,   16,   46,    0,   88,   45,    0,    0,    0,
-        0,    0,   63,   62,   73,   73,   73,    0,   74,   89,
-        0,    0,   91,   90,    0,    0,    0,  115,  115,    0,
-      105,  104,  115,    0,  111,  110,    0,    0,    0,    0,
-        0,   11,   41,    0,   21,   20,   41,    0,   25,   24,
-       41,   41,   41,    0,   33,   32,   41,    0,   42,   46,
-
-       77,   45,    0,   78,    0,   61,   60,   73,   73,   73,
-        0,    0,    0,    0,    0,  115,  115,  115,    0,  116,
-        0,    0,    0,    0,   41,   41,   41,    0,    0,   41,
-       41,   77,    0,   53,   78,   73,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,  115,  115,  115,    0,    0,
-        0,    0,   41,   41,    0,    0,    0,   31,   30,   41,
-       41,   73,    0,   67,   66,    0,   69,   68,    0,   85,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-      131,    0,    0,    0,   41,    0,    0,    0,   27,   26,
-        0,    0,   41,    0,    0,    0,    0,    0,    0,    0,
-
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,   23,   22,    0,   35,   34,   41,
-        0,   65,   64,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,   19,   18,   41,   93,    0,   92,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,   41,   95,   94,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,   41,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-
-        0,    0,    0,   41,    0,   99,    0,   98,    0,  103,
-        0,  102,    0,  109,    0,  108,    0,    0,    0,    0,
-        0,    0,   41,   97,   96,  101,  100,  107,  106,    0,
-        0,    0,   12,    0,   12,    0,   41,    0,    0,    0,
-        0,    0,   41,    0,    0,    0,    0,    0,   11,    0,
-       37,   36,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,   13,    0
-    } ;
-
-static const YY_CHAR yy_ec[256] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
-        1,    2,    4,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    2,    5,    6,    7,    1,    1,    8,    9,    1,
-        1,    1,    1,    1,   10,   11,   12,   13,   13,   13,
-       13,   13,   13,   13,   13,   13,   13,   14,   15,   16,
-       17,   18,   19,    1,   20,   21,   22,   23,   24,   21,
-       25,   25,   25,   25,   25,   26,   27,   25,   28,   29,
-       25,   25,   30,   31,   25,   25,   25,   25,   32,   25,
-       33,    1,   34,    1,   25,    1,   35,   36,   37,   38,
-
-       39,   40,   41,   42,   43,   44,   45,   46,   47,   48,
-       49,   50,   51,   52,   53,   54,   55,   56,   25,   57,
-       58,   59,    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,    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,    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
-    } ;
-
-static const YY_CHAR yy_meta[60] =
-    {   0,
-        1,    2,    2,    2,    1,    1,    1,    1,    1,    3,
-        3,    1,    4,    5,    1,    1,    1,    6,    1,    7,
-        7,    7,    7,    7,    5,    5,    5,    5,    5,    5,
-        5,    5,    1,    1,    7,    7,    7,    7,    7,    7,
-        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
-        5,    5,    5,    5,    5,    5,    5,    5,    5
-    } ;
-
-static const flex_int16_t yy_base[814] =
-    {   0,
-        0,    0,    0,    3,    6,    9,   24,   27,   11,   14,
-       15,   17,   29,   38,   45,   52,   59,   61,   67,   70,
-       95,    0,   73,   76,  153,  156,  159,  162,  177,  180,
-      183,  186,  201,  204,  207,  210,  226,  278,  245,  248,
-      251,  254,  297,  300,  303,  306,  330,    0,  388,  391,
-      394,  397,  412,  415,  418,  421,  437,  489,  456,  459,
-      541,    0,  462,  465,  598,  600, 2053, 2135, 2135,  269,
-      272,   47,   62, 2135,  321,  172, 2135, 2135, 2033, 2135,
-     2135, 2022, 2135, 2033, 2031,  475, 2135, 2135, 2135, 2135,
-     2027, 2025, 1987,  468, 2135,  324, 1998,    0,  196, 2135,
-
-        8, 1968, 1958, 1952, 1863, 1858,   35, 2135,  481,  600,
-      608,  604,  612,  641, 2135,  509, 1878,    0,  258, 2135,
-     1855, 2135,  515,  660,  663,  682, 2135,  525, 1875,    0,
-      310, 2135, 1854, 1852, 1855, 1834, 1849, 2135,  528,  704,
-      701,  723, 2135,  531, 1869,    0,  407, 2135, 1847, 2135,
-      534,  606, 2135,  626, 1857,    0,  469, 2135, 1831, 1829,
-     1821, 1830, 1814,   32, 2135,  667,  621, 1851, 1820,  671,
-      628, 1784, 2135, 1827, 1818, 2135, 2135, 2135,    2,   44,
-     1781, 1780, 1778, 1814, 1793, 2135,    0, 1787, 1774, 1777,
-     1784, 1784, 1772, 1747, 1752, 1753, 1752, 1748, 1742, 1722,
-
-     1735, 1712, 1715, 1720, 2135,    0, 1713, 1695, 1693, 2135,
-        0,  686, 1670, 1671, 1668, 1660, 1666, 1656, 2135,    0,
-     1661, 1650, 2135,    0, 1652, 1644, 1635, 1646, 1627, 1648,
-     1632, 1626, 1634, 1648, 1646, 1649,  458, 1611, 2135,   72,
-        0, 1606, 1602, 1635, 1633, 1594, 2135, 1607, 1590, 1586,
-     1594, 1592, 1601, 1583, 1567, 1567, 1600,  759,  762, 1577,
-     1564, 1570, 1547, 1559, 1560, 1544,  727,  766,  772, 1534,
-      779,  783, 1545, 1536, 1520, 1519,  791,  795, 1528,  799,
-      802,  808, 1527, 1517, 1517, 1513, 1506, 1496, 1503,  815,
-      819, 1519, 2135, 1521, 2135, 2135,   17, 1488, 2135, 1514,
-
-     1513, 1473, 2135, 2135, 1464, 1475, 1477, 1459, 1490, 1453,
-     1450,  825, 1455, 1443, 1438,  828,  832, 2135,  836, 1449,
-     1442,  845, 1447, 1432,  849, 1437,  853,  856,  864,  871,
-     2135,  874, 1433,  877, 2135, 2135, 1425,  891, 1426, 1421,
-      894,  897, 2135,  900, 1410,  903,  907,  919,  922, 2135,
-      925,  928,  931, 1411, 1406,  947, 1404,  950,  953,  956,
-     2135,  966, 1422,  646,  976, 2135, 2135, 1429, 1427,  959,
-     1419,  979, 1386,  983, 1379,  986,  995, 1374, 1004, 1381,
-     1007,  989, 1379, 1010, 1367, 1013, 1020, 1369, 1024, 2135,
-     2135, 1032, 1357, 1035, 1038, 1054, 1352, 1353, 1347, 1041,
-
-     1062, 1065, 2135, 2135, 1073, 1077, 1080, 1093, 1096, 1333,
-     1325, 1104, 1111, 1334, 1120, 1123, 1131, 1352,  507, 1353,
-     1136, 2135, 1347, 2135, 2135, 1139, 1315, 1142, 1149, 1291,
-     1159, 1162, 1297, 1176, 2135, 2135, 1295, 1170, 1285, 1187,
-     1298, 1195, 1198, 1201, 1275, 1204, 1207, 1212, 1274, 1215,
-     1218, 1231, 2135, 2135, 1282, 1273, 1263, 1239, 2135, 1242,
-     1245, 1249, 2135, 2135, 1258,  124,  125, 1274, 1262, 1266,
-     2135, 2135, 1259, 1274, 2135, 2135, 1282, 1261,  491,  152,
-        5, 2135, 1235, 1285, 2135, 2135, 1234, 1293, 2135, 2135,
-     1227, 1301, 1226, 1304, 2135, 2135, 1235, 1312, 2135, 1317,
-
-     1320, 1323, 1329, 1332, 1335, 2135, 2135, 1236, 1346, 1349,
-     1352, 1223, 1211, 1217, 1204, 1210, 1202, 1187, 1355, 2135,
-     1218,  174,  158,  384, 1188, 1177, 1358, 1365, 1374, 1186,
-     1181, 1382, 1385, 2135, 1388, 1187, 1391, 1395, 1407, 1410,
-     1418, 1175, 1169, 1162, 1141, 1423, 1426, 1429, 1161, 1435,
-      176,  461, 1134, 1445, 1448, 1452, 1464, 2135, 2135, 1472,
-     1151, 1475, 1478, 2135, 2135, 1491, 2135, 2135, 1499, 2135,
-     1128, 1131, 1122, 1120, 1502, 1505, 1518, 1521, 1529, 1534,
-     2135, 1545,  228,  179, 1548, 1551, 1555, 1567, 2135, 2135,
-     1575, 1579, 1143, 1587, 1591, 1113, 1105, 1103, 1101, 1599,
-
-      567,  570, 1607,  582,  626, 1615,  668,  671,  280,  222,
-      643, 1623, 1626, 1635, 2135, 2135, 1643, 2135, 2135, 1101,
-     1651, 2135, 2135, 1142, 1093, 1127, 1077, 1095, 1076, 1084,
-     1066, 1081, 1059, 1074, 1052, 1068, 1049, 1058, 1040,  715,
-      244,  385, 1659, 2135, 2135, 1053, 2135, 1082, 2135, 1078,
-     1026, 1015, 1016, 1006, 1008,  992, 1000,  974,  973,  921,
-      929,  918,  388,  391, 1667,  937, 2135, 2135,  912,  907,
-      889,  902,  861,  851,  835,  848,  832,  830,  792,  776,
-     1670, 1673, 1676, 1693,  753,  714,  746,  695,  712,  666,
-      678,  644,  648,  603,  609,  501,  471, 1701, 1704, 1711,
-
-     1721, 1739, 1773,  408,  429, 2135,  421, 2135,  421, 2135,
-      402, 2135,  402, 2135,  396, 2135,  725, 1791,  675,  506,
-     1809, 1843,  272, 2135, 2135, 2135, 2135, 2135, 2135,  684,
-      706,  200,  311,  731,  260, 1731,  220,  668,  218,  202,
-      207, 1765, 1836,  296,  153, 1861, 1757,  728, 2135, 1799,
-     2135, 2135, 1734, 1864,  439,  709,  753,  773,  806,  807,
-      761,  873,  823,  901,  948, 1031, 1013, 1035, 1014,  929,
-     1877, 1881, 2135, 2135, 1899, 1906, 1913, 1920, 1927, 1934,
-     1941, 1948, 1955, 1962, 1969, 1976, 1983, 1990, 1995, 2000,
-     2005, 2010, 2015, 2022, 2025, 2028, 2031, 2034, 2037, 2044,
-
-     2048, 2054, 2060, 2066, 2072, 2078, 2085, 2092, 2099, 2106,
-     2113, 2120, 2127
-    } ;
-
-static const flex_int16_t yy_def[814] =
-    {   0,
-      775,  775,  776,  776,  776,  776,  777,  777,  778,  778,
-      779,  779,  780,  780,  780,  780,  781,  781,  775,  775,
-      774,   21,  782,  782,  782,  782,  775,  775,  782,  782,
-      775,  775,  782,  782,  782,  782,  783,  783,  784,  784,
-      775,  775,  784,  784,  784,  784,  774,   47,  785,  785,
-      775,  775,  785,  785,  785,  785,  786,  786,  787,  787,
-      774,   61,  788,  788,  780,  780,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  789,  774,  774,
-
-      789,  789,  789,  789,  789,  789,  789,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  790,  774,  774,
-      790,  774,  774,  774,  774,  774,  774,  774,  774,  791,
-      774,  774,  791,  791,  791,  791,  791,  774,  774,  774,
-      774,  774,  774,  774,  774,  792,  774,  774,  792,  774,
-      774,  774,  774,  774,  774,  793,  774,  774,  793,  793,
-      793,  793,  793,  793,  774,  774,  774,  774,  774,  774,
-      794,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  789,  789,  789,  789,
-      789,  789,  789,  789,  789,  789,  795,  774,  774,  774,
-
-      774,  774,  774,  774,  774,  790,  790,  796,  774,  774,
-      791,  791,  791,  791,  791,  791,  797,  774,  774,  792,
-      792,  798,  774,  793,  793,  793,  793,  793,  793,  793,
-      793,  799,  774,  774,  800,  774,  800,  774,  774,  774,
-      801,  774,  774,  774,  774,  774,  774,  774,  789,  789,
-      789,  789,  789,  789,  789,  789,  789,  802,  802,  774,
-      774,  774,  774,  774,  774,  774,  790,  803,  803,  774,
-      774,  774,  791,  791,  791,  791,  804,  804,  774,  792,
-      805,  805,  793,  793,  793,  793,  793,  793,  793,  806,
-      806,  774,  774,  800,  774,  774,  800,  774,  774,  801,
-
-      774,  774,  774,  774,  774,  774,  789,  789,  789,  789,
-      789,  789,  789,  789,  789,  774,  802,  774,  802,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  803,
-      774,  803,  774,  774,  774,  774,  791,  791,  791,  791,
-      774,  804,  774,  804,  774,  774,  774,  774,  805,  774,
-      805,  793,  793,  793,  793,  793,  793,  793,  774,  806,
-      774,  806,  774,  800,  807,  774,  774,  774,  774,  774,
-      789,  789,  789,  789,  789,  774,  774,  789,  789,  789,
-      802,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  803,  774,  791,  774,  774,  791,  791,  791,  804,
-
-      774,  774,  774,  774,  805,  774,  774,  774,  774,  793,
-      793,  774,  774,  793,  774,  774,  806,  774,  800,  807,
-      807,  774,  807,  774,  774,  774,  789,  774,  774,  789,
-      774,  774,  789,  774,  774,  774,  789,  774,  789,  774,
-      789,  802,  774,  774,  774,  774,  774,  803,  774,  774,
-      774,  774,  774,  774,  791,  791,  791,  774,  774,  774,
-      805,  774,  774,  774,  774,  774,  774,  793,  793,  774,
-      774,  774,  793,  774,  774,  774,  806,  774,  800,  807,
-      807,  774,  789,  774,  774,  774,  789,  774,  774,  774,
-      789,  789,  789,  774,  774,  774,  789,  774,  774,  774,
-
-      774,  774,  803,  774,  774,  774,  774,  791,  791,  791,
-      805,  774,  774,  774,  774,  793,  793,  793,  774,  774,
-      774,  800,  807,  807,  789,  789,  789,  774,  774,  789,
-      789,  774,  774,  774,  774,  791,  774,  774,  774,  774,
-      805,  774,  774,  774,  774,  793,  793,  793,  774,  800,
-      807,  807,  789,  789,  774,  774,  774,  774,  774,  789,
-      789,  791,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  800,  807,  807,  789,  774,  774,  774,  774,  774,
-      774,  774,  789,  774,  774,  774,  774,  774,  774,  774,
-
-      774,  774,  774,  774,  774,  774,  774,  774,  800,  807,
-      807,  774,  774,  774,  774,  774,  774,  774,  774,  789,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  800,
-      807,  807,  774,  774,  774,  789,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  800,  807,  807,  789,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      800,  807,  807,  807,  789,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  800,  807,  807,
-
-      807,  808,  809,  789,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  800,  807,  810,  811,
-      808,  809,  789,  774,  774,  774,  774,  774,  774,  800,
-      810,  807,  812,  811,  813,  807,  789,  800,  812,  774,
-      813,  807,  789,  800,  774,  774,  774,  800,  774,  774,
-      774,  774,  800,  800,  800,  800,  800,  800,  800,  800,
-      800,  800,  800,  800,  800,  800,  800,  800,  800,  800,
-      800,  800,  774,    0,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774
-    } ;
-
-static const flex_int16_t yy_nxt[2195] =
-    {   0,
-      774,   70,   71,   70,   70,   71,   70,   70,   71,   70,
-       70,   71,   70,   78,  240,   72,   78,   81,   72,   81,
-       79,   73,  422,   79,   73,   75,   71,   75,   75,   71,
-       75,   84,   85,   82,  295,   82,   86,   87,  364,   76,
-       84,   85,   76,  524,   88,   86,   87,   84,   85,  188,
-       89,  171,   86,   88,   84,   85,  189,   89,  241,   86,
-       88,   91,   92,   91,   92,  172,  171,   88,   71,   71,
-       71,   71,   71,   71,  109,   71,  109,  109,   71,  109,
-      173,  195,   94,  230,  240,   94,  299,  196,  110,  231,
-      242,  110,   93,  243,   93,   95,   96,   71,   96,   95,
-
-       95,   95,   95,   95,   95,   95,   97,   95,   98,   95,
-       99,   95,  100,   95,   98,   98,   98,   98,   98,   98,
-       98,   98,   98,   98,   98,   98,   98,   95,   95,   98,
-       98,  101,   98,   98,  102,   98,   98,  103,  104,   98,
-       98,   98,  105,   98,   98,   98,   98,   98,   98,   98,
-      106,  107,   98,   98,  109,   71,  109,  109,   71,  109,
-       71,   71,   71,   71,   71,   71,  512,  514,  111,  422,
-      749,  111,  513,  515,  112,  422,  174,  112,  109,   71,
-      109,  109,   71,  109,   71,   71,   71,   71,   71,   71,
-      173,  295,  110,  422,  551,  110,  422,  550,  113,  523,
-
-      174,  113,  109,   71,  109,  109,   71,  109,  109,   71,
-      109,  109,   71,  109,  173,  740,  111,  422,  423,  111,
-      745,  611,  114,  740,  583,  114,  115,  116,   71,  116,
-      115,  115,  115,  115,  115,  115,  115,  117,  115,  422,
-      115,  119,  115,  120,  115,  422,  123,   71,  123,  123,
-       71,  123,   71,   71,   71,   71,   71,   71,  115,  115,
-      124,  422,  174,  124,  641,  610,  125,  743,  740,  125,
-      170,  170,  170,  170,  170,  170,  173,  121,  115,  116,
-       71,  116,  115,  115,  115,  115,  115,  115,  115,  117,
-      115,  664,  115,  119,  115,  120,  115,  295,  123,   71,
-
-      123,  123,   71,  123,  123,   71,  123,  123,   71,  123,
-      115,  115,  124,  295,  174,  124,  740,  640,  126,  748,
-      737,  126,  170,  170,  170,  170,  170,  170,  173,  121,
-      127,  128,   71,  128,  127,  127,  127,  127,  127,  127,
-      127,  129,  127,  130,  127,  131,  127,  132,  127,  130,
-      130,  130,  130,  130,  130,  130,  130,  130,  130,  130,
-      130,  130,  127,  127,  130,  130,  130,  130,  130,  130,
-      130,  130,  133,  130,  130,  134,  130,  135,  130,  130,
-      130,  136,  130,  130,  130,  137,  130,  130,  130,  139,
-       71,  139,  139,   71,  139,   71,   71,   71,   71,   71,
-
-       71,  422,  422,  140,  729,  295,  140,  728,  422,  141,
-      727,  174,  141,  139,   71,  139,  139,   71,  139,  139,
-       71,  139,  139,   71,  139,  173,  726,  140,  681,  725,
-      140,  682,  665,  142,  724,  552,  142,  143,  144,   71,
-      144,  143,  143,  143,  143,  143,  143,  143,  145,  143,
-      723,  143,  147,  143,  148,  143,  295,  151,   71,  151,
-      151,   71,  151,  166,   71,  166,  166,   71,  166,  143,
-      143,  152,  174,  174,  152,  295,  757,  167,  422,  716,
-      167,  179,  170,  170,  170,  297,  173,  173,  149,  143,
-      144,   71,  144,  143,  143,  143,  143,  143,  143,  143,
-
-      145,  143,  185,  143,  147,  143,  148,  143,  295,  180,
-      170,  170,  170,  584,  732,  181,  170,  170,  170,  522,
-      182,  143,  143,  735,  295,  183,  170,  170,  170,  170,
-      170,  170,  170,  170,  170,  170,  170,  170,  479,  715,
-      149,  153,  154,   71,  154,  153,  153,  153,  153,  153,
-      153,  153,  155,  153,  156,  153,  157,  153,  158,  153,
-      156,  156,  156,  156,  156,  156,  156,  156,  156,  156,
-      156,  156,  156,  153,  153,  156,  156,  156,  156,  156,
-      159,  156,  156,  156,  156,  156,  160,  156,  156,  161,
-      156,  156,  162,  163,  164,  156,  156,  156,  156,  156,
-
-       84,   85,   84,   85,  174,   86,  628,   86,  174,  630,
-      174,  197,  174,  168,  714,  168,  174,  222,  173,  197,
-      629,  632,  173,  631,  173,  174,  173,  170,  170,  170,
-      173,  169,  232,  169,  198,  633,  199,  236,  198,  173,
-      204,  713,  198,  200,  199,  174,  198,  200,  199,  201,
-      237,  203,  197,  201,  202,  203,  712,  201,  202,  173,
-      422,  201,  202,  295,  174,  634,  202,  174,  170,  170,
-      170,  208,  170,  170,  170,  198,  419,  204,  173,  635,
-      732,  173,  711,  710,  203,  295,  174,  271,  271,  271,
-      201,  642,  733,  208,  198,  202,  204,  198,  744,  204,
-
-      173,  295,  272,  203,  709,  174,  203,  636,  174,  209,
-      638,  732,  209,  738,  202,  217,  198,  202,  204,  173,
-      708,  637,  173,  733,  639,  203,  295,  174,  327,  327,
-      327,  201,  295,  707,  217,  198,  202,  204,  198,  732,
-      204,  173,  295,  328,  203,  295,  758,  203,  735,  663,
-      201,  706,  705,  201,  753,  218,  730,  198,  218,  204,
-      316,  316,  316,  316,  316,  316,  203,  329,  329,  329,
-      295,  763,  201,  329,  329,  329,  318,  202,  295,  318,
-      271,  271,  271,  331,  334,  334,  334,  759,  335,  331,
-      295,  336,  341,  341,  341,  272,  341,  341,  341,  319,
-
-      346,  346,  346,  348,  348,  348,  704,  760,  343,  348,
-      348,  348,  343,  332,  697,  347,  359,  359,  359,  350,
-      359,  359,  359,  295,  295,  350,  376,  376,  376,  316,
-      316,  316,  361,  316,  316,  316,  361,  316,  316,  316,
-      295,  377,  351,  344,  696,  318,  384,  384,  384,  318,
-      387,  387,  387,  318,  327,  327,  327,  389,  389,  389,
-      765,  390,  761,  762,  391,  329,  329,  329,  695,  328,
-      381,  362,  329,  329,  329,  329,  329,  329,  334,  334,
-      334,  331,  335,  764,  694,  336,  693,  692,  331,  691,
-      295,  331,  395,  395,  395,  341,  341,  341,  341,  341,
-
-      341,  341,  341,  341,  346,  346,  346,  396,  402,  402,
-      402,  343,  403,  690,  343,  404,  392,  343,  295,  347,
-      348,  348,  348,  348,  348,  348,  348,  348,  348,  406,
-      406,  406,  408,  408,  408,  400,  350,  771,  766,  350,
-      689,  688,  350,  397,  407,  687,  295,  409,  412,  412,
-      412,  415,  415,  415,  359,  359,  359,  359,  359,  359,
-      426,  426,  426,  413,  686,  295,  416,  359,  359,  359,
-      361,  685,  680,  361,  679,  678,  405,  421,  421,  421,
-      428,  428,  428,  361,  431,  431,  431,  376,  376,  376,
-      443,  443,  443,  422,  423,  429,  434,  434,  434,  432,
-
-      435,  767,  377,  436,  417,  438,  438,  438,  316,  316,
-      316,  384,  384,  384,  446,  446,  446,  439,  677,  771,
-      440,  387,  387,  387,  318,  389,  389,  389,  676,  390,
-      295,  295,  391,  329,  329,  329,  450,  450,  450,  395,
-      395,  395,  458,  458,  458,  675,  674,  442,  295,  331,
-      769,  451,  295,  673,  396,  452,  452,  452,  459,  453,
-      672,  671,  454,  460,  460,  460,  402,  402,  402,  670,
-      403,  669,  770,  404,  348,  348,  348,  448,  406,  406,
-      406,  462,  462,  462,  768,  463,  668,  667,  464,  666,
-      350,  662,  661,  407,  408,  408,  408,  465,  465,  465,
-
-      660,  466,  659,  658,  467,  412,  412,  412,  657,  409,
-      656,  461,  470,  470,  470,  655,  471,  654,  653,  472,
-      413,  415,  415,  415,  474,  474,  474,  652,  475,  651,
-      650,  476,  359,  359,  359,  649,  416,  421,  421,  421,
-      426,  426,  426,  428,  428,  428,  648,  647,  361,  646,
-      484,  484,  484,  422,  485,  627,  626,  486,  429,  625,
-      431,  431,  431,  488,  488,  488,  624,  489,  620,  599,
-      490,  438,  438,  438,  480,  432,  598,  434,  434,  434,
-      597,  435,  596,  477,  436,  593,  440,  585,  494,  494,
-      494,  481,  495,  581,  574,  496,  498,  498,  498,  443,
-
-      443,  443,  500,  500,  500,  446,  446,  446,  502,  502,
-      502,  573,  499,  329,  329,  329,  450,  450,  450,  505,
-      505,  505,  572,  506,  571,  562,  507,  561,  560,  331,
-      554,  451,  452,  452,  452,  553,  453,  549,  548,  454,
-      458,  458,  458,  460,  460,  460,  348,  348,  348,  503,
-      462,  462,  462,  547,  463,  546,  459,  464,  545,  465,
-      465,  465,  350,  466,  544,  543,  467,  470,  470,  470,
-      542,  471,  536,  531,  472,  474,  474,  474,  530,  475,
-      527,  526,  476,  519,  519,  519,  484,  484,  484,  525,
-      485,  521,  511,  486,  488,  488,  488,  518,  489,  520,
-
-      517,  490,  528,  528,  528,  494,  494,  494,  516,  495,
-      510,  509,  496,  498,  498,  498,  508,  529,  500,  500,
-      500,  532,  532,  532,  502,  502,  502,  504,  501,  499,
-      533,  533,  533,  535,  535,  535,  505,  505,  505,  497,
-      506,  493,  492,  507,  491,  487,  534,  537,  537,  537,
-      539,  539,  539,  348,  348,  348,  519,  519,  519,  555,
-      555,  555,  538,  483,  482,  540,  528,  528,  528,  350,
-      422,  478,  520,  473,  556,  557,  557,  557,  469,  558,
-      468,  529,  559,  532,  532,  532,  533,  533,  533,  535,
-      535,  535,  537,  537,  537,  457,  563,  563,  563,  456,
-
-      564,  455,  534,  565,  449,  541,  447,  538,  539,  539,
-      539,  566,  566,  566,  445,  567,  444,  441,  568,  569,
-      569,  569,  437,  540,  575,  575,  575,  577,  577,  577,
-      579,  579,  579,  433,  430,  570,  582,  582,  582,  576,
-      427,  425,  578,  424,  418,  580,  586,  586,  586,  555,
-      555,  555,  295,  588,  588,  588,  414,  589,  411,  410,
-      590,  587,  401,  399,  556,  557,  557,  557,  398,  558,
-      394,  393,  559,  591,  591,  591,  594,  594,  594,  563,
-      563,  563,  388,  564,  386,  385,  565,  383,  592,  382,
-      380,  595,  566,  566,  566,  379,  567,  378,  375,  568,
-
-      569,  569,  569,  575,  575,  575,  600,  600,  600,  374,
-      601,  373,  372,  602,  371,  370,  570,  369,  576,  577,
-      577,  577,  603,  603,  603,  368,  604,  367,  366,  605,
-      579,  579,  579,  365,  578,  606,  606,  606,  295,  607,
-      363,  358,  608,  357,  356,  580,  582,  582,  582,  612,
-      612,  612,  586,  586,  586,  355,  614,  614,  614,  354,
-      615,  353,  295,  616,  613,  352,  345,  587,  588,  588,
-      588,  340,  589,  339,  338,  590,  591,  591,  591,  609,
-      617,  617,  617,  337,  618,  333,  326,  619,  594,  594,
-      594,  592,  621,  621,  621,  325,  622,  324,  323,  623,
-
-      600,  600,  600,  595,  601,  322,  321,  602,  603,  603,
-      603,  320,  604,  315,  314,  605,  606,  606,  606,  313,
-      607,  312,  311,  608,  612,  612,  612,  643,  643,  643,
-      310,  644,  309,  308,  645,  307,  614,  614,  614,  613,
-      615,  306,  305,  616,  617,  617,  617,  304,  618,  303,
-      302,  619,  621,  621,  621,  301,  622,  298,  296,  623,
-      643,  643,  643,  295,  644,  293,  292,  645,  683,  683,
-      683,  698,  698,  698,  699,  699,  699,  683,  683,  683,
-      291,  289,  288,  684,  422,  287,  286,  295,  285,  700,
-      422,  284,  684,  422,  701,  701,  701,  283,  702,  282,
-
-      280,  703,  698,  698,  698,  699,  699,  699,  279,  278,
-      422,  276,  718,  718,  718,  275,  719,  274,  295,  720,
-      700,  422,  701,  701,  701,  273,  702,  270,  422,  703,
-      717,  269,  742,  742,  742,  754,  754,  754,  422,  420,
-      420,  420,  420,  420,  420,  420,  420,  420,  422,  423,
-      420,  295,  267,  420,  420,  420,  422,  420,  750,  750,
-      750,  266,  751,  265,  264,  752,  742,  742,  742,  263,
-      262,  420,  420,  420,  420,  420,  420,  420,  420,  420,
-      420,  420,  422,  261,  420,  260,  259,  420,  420,  420,
-      422,  420,  718,  718,  718,  257,  719,  256,  255,  720,
-
-      750,  750,  750,  480,  751,  420,  420,  752,  422,  420,
-      420,  420,  420,  420,  736,  420,  420,  420,  254,  253,
-      420,  252,  251,  420,  420,  420,  422,  420,  250,  249,
-      248,  247,  246,  245,  244,  239,  236,  746,  746,  746,
-      238,  420,  420,  420,  420,  420,  420,  420,  420,  420,
-      420,  736,  747,  234,  420,  233,  229,  420,  420,  420,
-      422,  420,  746,  746,  746,  754,  754,  754,  228,  755,
-      227,  226,  756,  225,  223,  420,  420,  747,  772,  772,
-      772,  295,  772,  772,  772,  221,  219,  216,  215,  214,
-      213,  212,  210,  207,  773,  205,  194,  193,  773,   68,
-
-       68,   68,   68,   68,   68,   68,   69,   69,   69,   69,
-       69,   69,   69,   74,   74,   74,   74,   74,   74,   74,
-       77,   77,   77,   77,   77,   77,   77,   80,   80,   80,
-       80,   80,   80,   80,   83,   83,   83,   83,   83,   83,
-       83,   90,   90,   90,   90,   90,   90,   90,  108,  108,
-      108,  108,  108,  108,  108,  118,  118,  118,  118,  118,
-      118,  118,  122,  122,  122,  122,  122,  122,  122,  138,
-      138,  138,  138,  138,  138,  138,  146,  146,  146,  146,
-      146,  146,  146,  150,  150,  150,  150,  150,  150,  150,
-      165,  165,  165,  165,  165,  165,  165,  187,  187,  187,
-
-      192,  187,  206,  206,  206,  191,  206,  211,  211,  211,
-      190,  211,  220,  220,  220,  186,  220,  224,  224,  224,
-      184,  224,  235,  235,  235,  235,  235,  178,  235,  258,
-      177,  258,  268,  178,  268,  277,  177,  277,  281,  176,
-      281,  290,  175,  290,  294,  294,  294,  294,  294,  294,
-      294,  300,  774,  774,  300,  317,  317,  317,  317,  317,
-      317,  330,  330,  330,  330,  330,  330,  342,  342,  342,
-      342,  342,  342,  349,  349,  349,  349,  349,  349,  360,
-      360,  360,  360,  360,  360,  420,  420,  420,  420,  420,
-      420,  420,  721,  721,  721,  721,  721,  721,  721,  722,
-
-      722,  722,  722,  722,  722,  722,  731,  731,  731,  731,
-      731,  731,  731,  734,  734,  734,  734,  734,  734,  734,
-      739,  739,  739,  739,  739,  739,  739,  741,  741,  741,
-      741,  741,  741,  741,   67,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774
-
-    } ;
-
-static const flex_int16_t yy_chk[2195] =
-    {   0,
-        0,    3,    3,    3,    4,    4,    4,    5,    5,    5,
-        6,    6,    6,    9,  179,    3,   10,   11,    4,   12,
-        9,    5,  481,   10,    6,    7,    7,    7,    8,    8,
-        8,   13,   13,   11,  297,   12,   13,   13,  297,    7,
-       14,   14,    8,  481,   13,   14,   14,   15,   15,  101,
-       15,   72,   15,   14,   16,   16,  101,   16,  179,   16,
-       15,   17,   17,   18,   18,   72,   73,   16,   19,   19,
-       19,   20,   20,   20,   23,   23,   23,   24,   24,   24,
-       73,  107,   19,  164,  240,   20,  240,  107,   23,  164,
-      180,   24,   17,  180,   18,   21,   21,   21,   21,   21,
-
-       21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
-       21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
-       21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
-       21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
-       21,   21,   21,   21,   21,   21,   21,   21,   21,   21,
-       21,   21,   21,   21,   25,   25,   25,   26,   26,   26,
-       27,   27,   27,   28,   28,   28,  466,  467,   25,  480,
-      745,   26,  466,  467,   27,  523,   76,   28,   29,   29,
-       29,   30,   30,   30,   31,   31,   31,   32,   32,   32,
-       76,  522,   29,  551,  523,   30,  584,  522,   31,  480,
-
-       99,   32,   33,   33,   33,   34,   34,   34,   35,   35,
-       35,   36,   36,   36,   99,  741,   33,  732,  732,   34,
-      740,  584,   35,  739,  551,   36,   37,   37,   37,   37,
-       37,   37,   37,   37,   37,   37,   37,   37,   37,  610,
-       37,   37,   37,   37,   37,  583,   39,   39,   39,   40,
-       40,   40,   41,   41,   41,   42,   42,   42,   37,   37,
-       39,  641,  119,   40,  610,  583,   41,  737,  735,   42,
-       70,   70,   70,   71,   71,   71,  119,   37,   38,   38,
-       38,   38,   38,   38,   38,   38,   38,   38,   38,   38,
-       38,  641,   38,   38,   38,   38,   38,  609,   43,   43,
-
-       43,   44,   44,   44,   45,   45,   45,   46,   46,   46,
-       38,   38,   43,  744,  131,   44,  733,  609,   45,  744,
-      723,   46,   75,   75,   75,   96,   96,   96,  131,   38,
-       47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
-       47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
-       47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
-       47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
-       47,   47,   47,   47,   47,   47,   47,   47,   47,   47,
-       47,   47,   47,   47,   47,   47,   47,   47,   47,   49,
-       49,   49,   50,   50,   50,   51,   51,   51,   52,   52,
-
-       52,  524,  642,   49,  715,  663,   50,  713,  664,   51,
-      711,  147,   52,   53,   53,   53,   54,   54,   54,   55,
-       55,   55,   56,   56,   56,  147,  709,   53,  663,  707,
-       54,  664,  642,   55,  705,  524,   56,   57,   57,   57,
-       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-      704,   57,   57,   57,   57,   57,  755,   59,   59,   59,
-       60,   60,   60,   63,   63,   63,   64,   64,   64,   57,
-       57,   59,   94,  157,   60,  237,  755,   63,  552,  697,
-       64,   86,  109,  109,  109,  237,   94,  157,   57,   58,
-       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
-
-       58,   58,   94,   58,   58,   58,   58,   58,  479,   86,
-      116,  116,  116,  552,  720,   86,  123,  123,  123,  479,
-       86,   58,   58,  720,  419,   86,  128,  128,  128,  139,
-      139,  139,  144,  144,  144,  151,  151,  151,  419,  696,
-       58,   61,   61,   61,   61,   61,   61,   61,   61,   61,
-       61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
-       61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
-       61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
-       61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
-       61,   61,   61,   61,   61,   61,   61,   61,   61,   61,
-
-       65,   65,   66,   66,  110,   65,  601,   66,  112,  602,
-      152,  110,  111,   65,  695,   66,  113,  152,  110,  111,
-      601,  604,  112,  602,  152,  167,  111,  154,  154,  154,
-      113,   65,  167,   66,  110,  604,  110,  171,  112,  167,
-      112,  694,  111,  110,  111,  114,  113,  112,  113,  110,
-      171,  111,  114,  112,  110,  113,  693,  111,  112,  114,
-      611,  113,  111,  364,  124,  605,  113,  125,  166,  166,
-      166,  124,  170,  170,  170,  114,  364,  114,  124,  605,
-      719,  125,  692,  691,  114,  738,  126,  212,  212,  212,
-      114,  611,  719,  126,  124,  114,  124,  125,  738,  125,
-
-      126,  730,  212,  124,  690,  141,  125,  607,  140,  124,
-      608,  731,  125,  730,  124,  140,  126,  125,  126,  141,
-      689,  607,  140,  731,  608,  126,  756,  142,  267,  267,
-      267,  126,  640,  688,  142,  141,  126,  141,  140,  734,
-      140,  142,  717,  267,  141,  748,  756,  140,  734,  640,
-      141,  687,  686,  140,  748,  141,  717,  142,  140,  142,
-      258,  258,  258,  259,  259,  259,  142,  268,  268,  268,
-      757,  761,  142,  269,  269,  269,  258,  142,  761,  259,
-      271,  271,  271,  268,  272,  272,  272,  757,  272,  269,
-      758,  272,  277,  277,  277,  271,  278,  278,  278,  259,
-
-      280,  280,  280,  281,  281,  281,  685,  758,  277,  282,
-      282,  282,  278,  269,  680,  280,  290,  290,  290,  281,
-      291,  291,  291,  759,  760,  282,  312,  312,  312,  316,
-      316,  316,  290,  317,  317,  317,  291,  319,  319,  319,
-      763,  312,  282,  278,  679,  316,  322,  322,  322,  317,
-      325,  325,  325,  319,  327,  327,  327,  328,  328,  328,
-      763,  328,  759,  760,  328,  329,  329,  329,  678,  327,
-      319,  291,  330,  330,  330,  332,  332,  332,  334,  334,
-      334,  329,  334,  762,  677,  334,  676,  675,  330,  674,
-      762,  332,  338,  338,  338,  341,  341,  341,  342,  342,
-
-      342,  344,  344,  344,  346,  346,  346,  338,  347,  347,
-      347,  341,  347,  673,  342,  347,  332,  344,  764,  346,
-      348,  348,  348,  349,  349,  349,  351,  351,  351,  352,
-      352,  352,  353,  353,  353,  344,  348,  770,  764,  349,
-      672,  671,  351,  338,  352,  670,  770,  353,  356,  356,
-      356,  358,  358,  358,  359,  359,  359,  360,  360,  360,
-      370,  370,  370,  356,  669,  765,  358,  362,  362,  362,
-      359,  666,  662,  360,  661,  660,  351,  365,  365,  365,
-      372,  372,  372,  362,  374,  374,  374,  376,  376,  376,
-      382,  382,  382,  365,  365,  372,  377,  377,  377,  374,
-
-      377,  765,  376,  377,  362,  379,  379,  379,  381,  381,
-      381,  384,  384,  384,  386,  386,  386,  379,  659,  769,
-      379,  387,  387,  387,  381,  389,  389,  389,  658,  389,
-      767,  769,  389,  392,  392,  392,  394,  394,  394,  395,
-      395,  395,  400,  400,  400,  657,  656,  381,  766,  392,
-      767,  394,  768,  655,  395,  396,  396,  396,  400,  396,
-      654,  653,  396,  401,  401,  401,  402,  402,  402,  652,
-      402,  651,  768,  402,  405,  405,  405,  392,  406,  406,
-      406,  407,  407,  407,  766,  407,  650,  648,  407,  646,
-      405,  639,  638,  406,  408,  408,  408,  409,  409,  409,
-
-      637,  409,  636,  635,  409,  412,  412,  412,  634,  408,
-      633,  405,  413,  413,  413,  632,  413,  631,  630,  413,
-      412,  415,  415,  415,  416,  416,  416,  629,  416,  628,
-      627,  416,  417,  417,  417,  626,  415,  421,  421,  421,
-      426,  426,  426,  428,  428,  428,  625,  624,  417,  620,
-      429,  429,  429,  421,  429,  599,  598,  429,  428,  597,
-      431,  431,  431,  432,  432,  432,  596,  432,  593,  574,
-      432,  438,  438,  438,  421,  431,  573,  434,  434,  434,
-      572,  434,  571,  417,  434,  561,  438,  553,  440,  440,
-      440,  421,  440,  549,  545,  440,  442,  442,  442,  443,
-
-      443,  443,  444,  444,  444,  446,  446,  446,  447,  447,
-      447,  544,  442,  448,  448,  448,  450,  450,  450,  451,
-      451,  451,  543,  451,  542,  536,  451,  531,  530,  448,
-      526,  450,  452,  452,  452,  525,  452,  521,  518,  452,
-      458,  458,  458,  460,  460,  460,  461,  461,  461,  448,
-      462,  462,  462,  517,  462,  516,  458,  462,  515,  465,
-      465,  465,  461,  465,  514,  513,  465,  470,  470,  470,
-      512,  470,  508,  497,  470,  474,  474,  474,  493,  474,
-      491,  487,  474,  477,  477,  477,  484,  484,  484,  483,
-      484,  478,  461,  484,  488,  488,  488,  473,  488,  477,
-
-      469,  488,  492,  492,  492,  494,  494,  494,  468,  494,
-      457,  456,  494,  498,  498,  498,  455,  492,  500,  500,
-      500,  501,  501,  501,  502,  502,  502,  449,  445,  498,
-      503,  503,  503,  504,  504,  504,  505,  505,  505,  441,
-      505,  439,  437,  505,  433,  430,  503,  509,  509,  509,
-      510,  510,  510,  511,  511,  511,  519,  519,  519,  527,
-      527,  527,  509,  427,  423,  510,  528,  528,  528,  511,
-      420,  418,  519,  414,  527,  529,  529,  529,  411,  529,
-      410,  528,  529,  532,  532,  532,  533,  533,  533,  535,
-      535,  535,  537,  537,  537,  399,  538,  538,  538,  398,
-
-      538,  397,  533,  538,  393,  511,  388,  537,  539,  539,
-      539,  540,  540,  540,  385,  540,  383,  380,  540,  541,
-      541,  541,  378,  539,  546,  546,  546,  547,  547,  547,
-      548,  548,  548,  375,  373,  541,  550,  550,  550,  546,
-      371,  369,  547,  368,  363,  548,  554,  554,  554,  555,
-      555,  555,  550,  556,  556,  556,  357,  556,  355,  354,
-      556,  554,  345,  340,  555,  557,  557,  557,  339,  557,
-      337,  333,  557,  560,  560,  560,  562,  562,  562,  563,
-      563,  563,  326,  563,  324,  323,  563,  321,  560,  320,
-      315,  562,  566,  566,  566,  314,  566,  313,  311,  566,
-
-      569,  569,  569,  575,  575,  575,  576,  576,  576,  310,
-      576,  309,  308,  576,  307,  306,  569,  305,  575,  577,
-      577,  577,  578,  578,  578,  302,  578,  301,  300,  578,
-      579,  579,  579,  298,  577,  580,  580,  580,  294,  580,
-      292,  289,  580,  288,  287,  579,  582,  582,  582,  585,
-      585,  585,  586,  586,  586,  286,  587,  587,  587,  285,
-      587,  284,  582,  587,  585,  283,  279,  586,  588,  588,
-      588,  276,  588,  275,  274,  588,  591,  591,  591,  582,
-      592,  592,  592,  273,  592,  270,  266,  592,  594,  594,
-      594,  591,  595,  595,  595,  265,  595,  264,  263,  595,
-
-      600,  600,  600,  594,  600,  262,  261,  600,  603,  603,
-      603,  260,  603,  257,  256,  603,  606,  606,  606,  255,
-      606,  254,  253,  606,  612,  612,  612,  613,  613,  613,
-      252,  613,  251,  250,  613,  249,  614,  614,  614,  612,
-      614,  248,  246,  614,  617,  617,  617,  245,  617,  244,
-      243,  617,  621,  621,  621,  242,  621,  238,  236,  621,
-      643,  643,  643,  235,  643,  234,  233,  643,  665,  665,
-      665,  681,  681,  681,  682,  682,  682,  683,  683,  683,
-      232,  231,  230,  665,  665,  229,  228,  681,  227,  682,
-      682,  226,  683,  683,  684,  684,  684,  225,  684,  222,
-
-      221,  684,  698,  698,  698,  699,  699,  699,  218,  217,
-      684,  216,  700,  700,  700,  215,  700,  214,  698,  700,
-      699,  699,  701,  701,  701,  213,  701,  209,  700,  701,
-      698,  208,  736,  736,  736,  753,  753,  753,  701,  702,
-      702,  702,  702,  702,  702,  702,  702,  702,  736,  736,
-      702,  753,  207,  702,  702,  702,  702,  702,  747,  747,
-      747,  204,  747,  203,  202,  747,  742,  742,  742,  201,
-      200,  702,  702,  703,  703,  703,  703,  703,  703,  703,
-      703,  703,  742,  199,  703,  198,  197,  703,  703,  703,
-      703,  703,  718,  718,  718,  196,  718,  195,  194,  718,
-
-      750,  750,  750,  742,  750,  703,  703,  750,  718,  721,
-      721,  721,  721,  721,  721,  721,  721,  721,  193,  192,
-      721,  191,  190,  721,  721,  721,  721,  721,  189,  188,
-      185,  184,  183,  182,  181,  175,  174,  743,  743,  743,
-      172,  721,  721,  722,  722,  722,  722,  722,  722,  722,
-      722,  722,  743,  169,  722,  168,  163,  722,  722,  722,
-      722,  722,  746,  746,  746,  754,  754,  754,  162,  754,
-      161,  160,  754,  159,  155,  722,  722,  746,  771,  771,
-      771,  754,  772,  772,  772,  149,  145,  137,  136,  135,
-      134,  133,  129,  121,  771,  117,  106,  105,  772,  775,
-
-      775,  775,  775,  775,  775,  775,  776,  776,  776,  776,
-      776,  776,  776,  777,  777,  777,  777,  777,  777,  777,
-      778,  778,  778,  778,  778,  778,  778,  779,  779,  779,
-      779,  779,  779,  779,  780,  780,  780,  780,  780,  780,
-      780,  781,  781,  781,  781,  781,  781,  781,  782,  782,
-      782,  782,  782,  782,  782,  783,  783,  783,  783,  783,
-      783,  783,  784,  784,  784,  784,  784,  784,  784,  785,
-      785,  785,  785,  785,  785,  785,  786,  786,  786,  786,
-      786,  786,  786,  787,  787,  787,  787,  787,  787,  787,
-      788,  788,  788,  788,  788,  788,  788,  789,  789,  789,
-
-      104,  789,  790,  790,  790,  103,  790,  791,  791,  791,
-      102,  791,  792,  792,  792,   97,  792,  793,  793,  793,
-       93,  793,  794,  794,  794,  794,  794,   92,  794,  795,
-       91,  795,  796,   85,  796,  797,   84,  797,  798,   82,
-      798,  799,   79,  799,  800,  800,  800,  800,  800,  800,
-      800,  801,   67,    0,  801,  802,  802,  802,  802,  802,
-      802,  803,  803,  803,  803,  803,  803,  804,  804,  804,
-      804,  804,  804,  805,  805,  805,  805,  805,  805,  806,
-      806,  806,  806,  806,  806,  807,  807,  807,  807,  807,
-      807,  807,  808,  808,  808,  808,  808,  808,  808,  809,
-
-      809,  809,  809,  809,  809,  809,  810,  810,  810,  810,
-      810,  810,  810,  811,  811,  811,  811,  811,  811,  811,
-      812,  812,  812,  812,  812,  812,  812,  813,  813,  813,
-      813,  813,  813,  813,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
-      774,  774,  774,  774
-
-    } ;
-
-/* Table of booleans, true if rule could match eol. */
-static const 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,     };
-
-static yy_state_type yy_last_accepting_state;
-static char *yy_last_accepting_cpos;
-
-extern int yy_flex_debug;
-int yy_flex_debug = 0;
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
+        static const flex_int16_t yy_accept[775] = {
+            0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+            0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+            0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+            0,   0,   0,   0,   141, 139, 15,  10,  10,  15,  15,  119, 10,  119, 5,   6,   5,   8,   9,   8,   135,
+            127, 128, 136, 133, 136, 134, 138, 127, 128, 138, 139, 40,  10,  40,  40,  40,  38,
+
+            40,  40,  40,  40,  40,  40,  40,  44,  10,  44,  44,  139, 139, 44,  61,  10,  61,  61,  61,  59,  61,
+            61,  61,  61,  61,  65,  10,  65,  139, 65,  92,  10,  92,  92,  92,  90,  92,  92,  92,  92,  92,  92,
+            96,  10,  96,  103, 10,  103, 103, 103, 101, 103, 107, 10,  107, 139, 107, 114, 10,  114, 114, 114, 112,
+            114, 118, 10,  118, 136, 135, 10,  0,   2,   2,   0,   4,   7,   130, 129, 0,   0,   0,   0,   0,   0,
+            0,   39,  41,  41,  41,  41,  41,  41,  41,  41,  41,  41,  0,   0,   0,   0,
+
+            0,   0,   0,   0,   60,  62,  62,  62,  62,  62,  62,  0,   0,   91,  93,  93,  93,  93,  93,  93,  93,
+            93,  0,   102, 104, 104, 0,   0,   113, 115, 115, 0,   0,   0,   0,   0,   0,   0,   3,   0,   0,   0,
+            0,   0,   0,   0,   137, 0,   41,  41,  41,  41,  41,  41,  41,  41,  41,  0,   0,   0,   0,   0,   0,
+            0,   0,   0,   0,   0,   62,  62,  62,  62,  0,   0,   0,   93,  93,  93,  93,  93,  93,  93,  0,   0,
+            104, 0,   0,   0,   115, 0,   0,   0,   132, 0,   14,  1,   0,   0,   125, 0,
+
+            0,   0,   122, 121, 0,   0,   41,  41,  41,  41,  41,  41,  41,  41,  41,  0,   0,   43,  0,   0,   0,
+            46,  0,   0,   45,  0,   0,   48,  47,  62,  62,  62,  62,  0,   0,   64,  0,   0,   93,  93,  93,  93,
+            93,  93,  93,  0,   0,   95,  0,   0,   0,   0,   0,   106, 0,   0,   0,   0,   0,   0,   117, 0,   0,
+            0,   0,   126, 120, 0,   0,   17,  41,  41,  41,  41,  41,  0,   0,   41,  41,  41,  0,   16,  0,   46,
+            0,   66,  45,  0,   62,  0,   0,   62,  62,  62,  0,   67,  0,   0,   0,   0,
+
+            93,  93,  0,   0,   93,  0,   0,   0,   0,   100, 99,  0,   0,   0,   111, 110, 0,   0,   0,   0,   0,
+            12,  0,   123, 124, 17,  41,  0,   0,   41,  0,   0,   41,  0,   31,  30,  41,  0,   41,  0,   41,  0,
+            16,  98,  0,   66,  97,  0,   0,   0,   52,  51,  62,  62,  62,  0,   63,  67,  0,   69,  68,  0,   0,
+            0,   93,  93,  0,   89,  88,  93,  0,   87,  86,  0,   0,   0,   0,   0,   0,   0,   0,   11,  41,  0,
+            27,  26,  41,  0,   29,  28,  41,  41,  41,  0,   19,  18,  41,  0,   42,  98,
+
+            108, 97,  0,   58,  57,  62,  62,  62,  0,   0,   0,   0,   93,  93,  93,  0,   94,  0,   109, 0,   0,
+            0,   0,   0,   41,  41,  41,  0,   0,   41,  41,  108, 62,  0,   0,   0,   0,   0,   0,   0,   0,   93,
+            93,  93,  0,   105, 109, 0,   0,   0,   0,   0,   41,  41,  0,   0,   0,   25,  24,  41,  41,  62,  0,
+            56,  55,  0,   54,  53,  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   116, 131, 0,   0,   0,
+            41,  0,   0,   0,   33,  32,  0,   0,   41,  0,   0,   0,   0,   0,   0,   0,
+
+            0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   35,  34,  0,   21,  20,  41,  0,
+            50,  49,  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+            0,   37,  36,  41,  71,  0,   70,  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+            0,   0,   41,  73,  72,  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+            41,  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+
+            0,   0,   0,   41,  0,   85,  0,   84,  0,   77,  0,   76,  0,   81,  0,   80,  0,   0,   0,   0,   0,
+            0,   41,  83,  82,  75,  74,  79,  78,  0,   0,   0,   12,  0,   12,  0,   41,  0,   0,   0,   0,   0,
+            41,  0,   0,   0,   0,   0,   11,  0,   23,  22,  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+            0,   0,   0,   0,   0,   0,   0,   0,   0,   13,  0};
+
+        static const YY_CHAR yy_ec[256] = {
+            0,  1,  1,  1,  1,  1,  1,  1,  1,  2,  3,  1,  2,  4,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
+            1,  1,  1,  1,  1,  1,  2,  5,  6,  7,  1,  1,  8,  9,  1,  1,  1,  1,  1,  10, 11, 12, 13, 13, 13, 13,
+            13, 13, 13, 13, 13, 13, 14, 15, 16, 17, 18, 19, 1,  20, 21, 22, 23, 24, 21, 25, 25, 25, 25, 25, 26, 27,
+            25, 28, 29, 25, 25, 30, 31, 25, 25, 25, 25, 32, 25, 33, 1,  34, 1,  25, 1,  35, 36, 37, 38,
+
+            39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 25, 57, 58, 59, 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,  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,  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};
+
+        static const YY_CHAR yy_meta[60] = {0, 1, 2, 2, 2, 1, 1, 1, 1, 1, 3, 3, 1, 4, 5, 1, 1, 1, 6, 1,
+                                            7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 7, 7, 7, 7, 7,
+                                            7, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5};
+
+        static const flex_int16_t yy_base[814] = {
+            0,    0,    0,    0,    3,    6,    9,    24,   27,   11,   14,   15,   17,   29,   38,   45,   52,
+            59,   61,   67,   70,   95,   0,    73,   76,   153,  156,  159,  162,  177,  180,  183,  186,  201,
+            204,  207,  210,  226,  0,    284,  287,  290,  293,  308,  311,  314,  317,  333,  0,    391,  394,
+            410,  462,  429,  432,  435,  438,  481,  484,  487,  490,  514,  566,  533,  536,  585,  587,  1886,
+            2164, 2164, 397,  400,  47,   62,   2164, 453,  172,  2164, 2164, 1875, 2164, 2164, 1865, 2164, 1866,
+            1863, 551,  2164, 2164, 2164, 2164, 1861, 1861, 1829, 441,  2164, 505,  1844, 0,    196,  2164,
+
+            8,    1818, 1812, 1810, 1823, 1813, 35,   2164, 508,  593,  601,  589,  622,  630,  2164, 539,  1833,
+            0,    303,  2164, 1811, 1809, 1793, 1772, 1786, 2164, 542,  649,  657,  676,  2164, 551,  1798, 0,
+            442,  2164, 1772, 1770, 1750, 1760, 1751, 32,   2164, 557,  545,  2164, 607,  1775, 0,    494,  2164,
+            1752, 2164, 612,  684,  703,  711,  2164, 667,  1764, 0,    546,  2164, 1722, 2164, 733,  641,  1752,
+            1721, 739,  594,  1690, 2164, 1735, 1723, 2164, 2164, 2164, 2,    44,   1685, 1684, 1675, 1711, 1689,
+            2164, 0,    1678, 1663, 1670, 1677, 1676, 1664, 1658, 1650, 1652, 1658, 1650, 1645, 1636,
+
+            1645, 1626, 1628, 1630, 2164, 0,    747,  1615, 1618, 1615, 1610, 1616, 1599, 2164, 0,    1605, 1601,
+            1590, 1602, 1582, 1601, 1585, 1578, 2164, 0,    1588, 1590, 1590, 2164, 0,    1584, 1572, 1584, 1594,
+            1593, 1599, 431,  1554, 2164, 72,   0,    1549, 1549, 1581, 1576, 1541, 2164, 1553, 1540, 1535, 1533,
+            1528, 1544, 1525, 1503, 1507, 1539, 765,  768,  1517, 1507, 1509, 1488, 1500, 1501, 1486, 771,  775,
+            1489, 1487, 1467, 1467, 787,  790,  1479, 1477, 1470, 1470, 1459, 1462, 1445, 1429, 793,  796,  799,
+            815,  818,  1415, 821,  824,  827,  1443, 2164, 1446, 2164, 2164, 17,   1400, 2164, 1428,
+
+            1426, 1384, 2164, 2164, 1381, 1389, 1391, 1373, 1394, 1358, 1364, 844,  1368, 1357, 1344, 848,  851,
+            2164, 854,  1355, 1344, 861,  1350, 1318, 871,  1324, 874,  2164, 2164, 1322, 882,  1317, 1316, 888,
+            891,  2164, 894,  1301, 898,  901,  1304, 1295, 917,  1290, 920,  923,  929,  2164, 936,  940,  946,
+            956,  959,  2164, 962,  1301, 965,  981,  968,  989,  2164, 992,  1309, 616,  995,  2164, 2164, 1316,
+            1314, 998,  1302, 1013, 1274, 1016, 1266, 1019, 1022, 1269, 1035, 1279, 1038, 1043, 1274, 1051, 1253,
+            1055, 1058, 1262, 1061, 1064, 1067, 1248, 1246, 1243, 1080, 1083, 1086, 1090, 1098, 1102,
+
+            1242, 1231, 1110, 1114, 1244, 1122, 1126, 1134, 1138, 2164, 2164, 1146, 1234, 1151, 2164, 2164, 1159,
+            1257, 632,  1258, 1163, 2164, 1256, 2164, 2164, 1166, 1224, 1169, 1176, 1216, 1172, 1191, 1212, 1201,
+            2164, 2164, 1211, 1209, 1196, 1212, 1209, 1220, 1225, 1228, 1196, 1231, 1237, 1240, 1243, 1252, 2164,
+            2164, 1213, 1198, 1188, 1260, 2164, 1263, 1266, 2164, 2164, 1277, 124,  125,  1190, 1181, 1285, 2164,
+            2164, 1178, 1293, 2164, 2164, 1301, 1304, 1155, 1307, 1177, 578,  152,  5,    2164, 1151, 1311, 2164,
+            2164, 1153, 1324, 2164, 2164, 1145, 1332, 1143, 1335, 2164, 2164, 1152, 1343, 2164, 1348,
+
+            1354, 1360, 1363, 2164, 2164, 1153, 1371, 1374, 1140, 1129, 1135, 1104, 1112, 1104, 1099, 1377, 2164,
+            1380, 1383, 1390, 1126, 174,  158,  280,  1097, 1089, 1397, 1400, 1403, 1091, 1086, 1416, 1092, 1419,
+            1422, 1430, 1436, 1072, 1067, 1069, 1056, 1446, 1449, 1452, 1455, 2164, 1458, 1468, 1076, 1472, 176,
+            510,  1053, 1475, 1478, 1485, 1494, 2164, 2164, 1502, 1062, 1505, 1508, 2164, 2164, 1521, 2164, 2164,
+            1040, 1041, 1025, 1027, 1529, 1532, 1540, 1545, 1556, 1559, 1481, 2164, 2164, 1567, 287,  179,  1572,
+            1575, 1578, 1591, 2164, 2164, 1601, 1604, 1049, 1612, 1617, 1020, 1017, 997,  995,  1628,
+
+            633,  643,  1636, 651,  660,  1644, 670,  675,  412,  283,  538,  1652, 1655, 1664, 2164, 2164, 1672,
+            2164, 2164, 999,  1680, 2164, 2164, 1037, 981,  1025, 978,  994,  975,  977,  959,  974,  956,  971,
+            952,  968,  937,  953,  929,  605,  281,  434,  1688, 2164, 2164, 942,  2164, 972,  2164, 967,  927,
+            901,  907,  896,  900,  890,  890,  874,  882,  859,  867,  856,  611,  614,  1696, 875,  2164, 2164,
+            855,  820,  760,  773,  757,  770,  732,  713,  674,  686,  664,  670,  1699, 1702, 1705, 1722, 652,
+            659,  673,  619,  616,  541,  556,  495,  496,  463,  495,  419,  444,  1730, 1733, 1740,
+
+            1750, 1768, 1802, 381,  403,  2164, 399,  2164, 400,  2164, 396,  2164, 325,  2164, 319,  2164, 700,
+            1820, 657,  613,  1838, 1872, 274,  2164, 2164, 2164, 2164, 2164, 2164, 660,  727,  200,  301,  745,
+            295,  1760, 254,  726,  218,  202,  207,  1794, 1865, 480,  153,  1890, 1786, 738,  2164, 1828, 2164,
+            2164, 1763, 1893, 664,  742,  741,  769,  814,  822,  823,  826,  744,  797,  789,  863,  849,  850,
+            864,  898,  1906, 1910, 2164, 2164, 1928, 1935, 1942, 1949, 1956, 1963, 1970, 1977, 1984, 1991, 1998,
+            2005, 2012, 2019, 2024, 2029, 2034, 2039, 2044, 2051, 2054, 2057, 2060, 2063, 2066, 2073,
+
+            2077, 2083, 2089, 2095, 2101, 2107, 2114, 2121, 2128, 2135, 2142, 2149, 2156};
+
+        static const flex_int16_t yy_def[814] = {
+            0,   775, 775, 776, 776, 776, 776, 777, 777, 778, 778, 779, 779, 780, 780, 780, 780, 781, 781, 775, 775,
+            774, 21,  782, 782, 782, 782, 775, 775, 782, 782, 775, 775, 782, 782, 782, 782, 774, 37,  783, 783, 775,
+            775, 783, 783, 783, 783, 774, 47,  784, 784, 785, 785, 786, 786, 775, 775, 786, 786, 786, 786, 787, 787,
+            788, 788, 780, 780, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774,
+            774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 789, 774, 774,
+
+            789, 789, 789, 789, 789, 789, 789, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 790, 774, 774, 790,
+            790, 790, 790, 790, 774, 774, 774, 774, 774, 774, 774, 774, 791, 774, 774, 791, 791, 791, 791, 791, 791,
+            774, 774, 774, 774, 774, 774, 792, 774, 774, 792, 774, 774, 774, 774, 774, 774, 774, 774, 793, 774, 774,
+            793, 774, 774, 774, 774, 774, 774, 794, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774,
+            774, 774, 789, 789, 789, 789, 789, 789, 789, 789, 789, 789, 795, 774, 774, 774,
+
+            774, 774, 774, 774, 774, 790, 790, 790, 790, 790, 790, 796, 774, 774, 791, 791, 791, 791, 791, 791, 791,
+            791, 797, 774, 792, 792, 798, 774, 774, 793, 793, 799, 774, 774, 800, 774, 800, 774, 774, 774, 801, 774,
+            774, 774, 774, 774, 774, 774, 789, 789, 789, 789, 789, 789, 789, 789, 789, 802, 802, 774, 774, 774, 774,
+            774, 774, 774, 774, 774, 790, 790, 790, 790, 803, 803, 774, 791, 791, 791, 791, 791, 791, 791, 804, 804,
+            792, 805, 805, 774, 793, 806, 806, 774, 774, 800, 774, 774, 800, 774, 774, 801,
+
+            774, 774, 774, 774, 774, 774, 789, 789, 789, 789, 789, 789, 789, 789, 789, 774, 802, 774, 802, 774, 774,
+            774, 774, 774, 774, 774, 774, 774, 774, 790, 790, 790, 790, 774, 803, 774, 803, 774, 791, 791, 791, 791,
+            791, 791, 791, 774, 804, 774, 804, 774, 774, 774, 805, 774, 805, 774, 774, 774, 774, 806, 774, 806, 774,
+            800, 807, 774, 774, 774, 774, 774, 789, 789, 789, 789, 789, 774, 774, 789, 789, 789, 802, 774, 774, 774,
+            774, 774, 774, 774, 790, 774, 774, 790, 790, 790, 803, 774, 774, 774, 774, 774,
+
+            791, 791, 774, 774, 791, 774, 774, 804, 774, 774, 774, 805, 774, 774, 774, 774, 806, 774, 800, 807, 807,
+            774, 807, 774, 774, 774, 789, 774, 774, 789, 774, 774, 789, 774, 774, 774, 789, 774, 789, 774, 789, 802,
+            774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 790, 790, 790, 774, 774, 774, 774, 774, 774, 774, 774,
+            774, 791, 791, 774, 774, 774, 791, 774, 774, 774, 804, 805, 774, 806, 774, 800, 807, 807, 774, 789, 774,
+            774, 774, 789, 774, 774, 774, 789, 789, 789, 774, 774, 774, 789, 774, 774, 774,
+
+            774, 774, 774, 774, 774, 790, 790, 790, 774, 774, 774, 774, 791, 791, 791, 774, 774, 805, 774, 806, 774,
+            800, 807, 807, 789, 789, 789, 774, 774, 789, 789, 774, 790, 774, 774, 774, 774, 774, 774, 774, 774, 791,
+            791, 791, 774, 774, 774, 806, 774, 800, 807, 807, 789, 789, 774, 774, 774, 774, 774, 789, 789, 790, 774,
+            774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 800, 807, 807,
+            789, 774, 774, 774, 774, 774, 774, 774, 789, 774, 774, 774, 774, 774, 774, 774,
+
+            774, 774, 774, 774, 774, 774, 774, 774, 800, 807, 807, 774, 774, 774, 774, 774, 774, 774, 774, 789, 774,
+            774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 800, 807, 807,
+            774, 774, 774, 789, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 800,
+            807, 807, 789, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 800, 807, 807, 807,
+            789, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 800, 807, 807,
+
+            807, 808, 809, 789, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 800, 807, 810, 811, 808,
+            809, 789, 774, 774, 774, 774, 774, 774, 800, 810, 807, 812, 811, 813, 807, 789, 800, 812, 774, 813, 807,
+            789, 800, 774, 774, 774, 800, 774, 774, 774, 774, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800, 800,
+            800, 800, 800, 800, 800, 800, 800, 800, 800, 774, 0,   774, 774, 774, 774, 774, 774, 774, 774, 774, 774,
+            774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774,
+
+            774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774};
+
+        static const flex_int16_t yy_nxt[2224] = {
+            0,   774, 70,  71,  70,  70,  71,  70,  70,  71,  70,  70,  71,  70,  78,  240, 72,  78,  81,  72,  81,
+            79,  73,  422, 79,  73,  75,  71,  75,  75,  71,  75,  84,  85,  82,  295, 82,  86,  87,  364, 76,  84,
+            85,  76,  524, 88,  86,  87,  84,  85,  188, 89,  171, 86,  88,  84,  85,  189, 89,  241, 86,  88,  91,
+            92,  91,  92,  172, 171, 88,  71,  71,  71,  71,  71,  71,  109, 71,  109, 109, 71,  109, 173, 195, 94,
+            221, 240, 94,  299, 196, 110, 222, 242, 110, 93,  243, 93,  95,  96,  71,  96,  95,
+
+            95,  95,  95,  95,  95,  95,  97,  95,  98,  95,  99,  95,  100, 95,  98,  98,  98,  98,  98,  98,  98,
+            98,  98,  98,  98,  98,  98,  95,  95,  98,  98,  101, 98,  98,  102, 98,  98,  103, 104, 98,  98,  98,
+            105, 98,  98,  98,  98,  98,  98,  98,  106, 107, 98,  98,  109, 71,  109, 109, 71,  109, 71,  71,  71,
+            71,  71,  71,  509, 511, 111, 422, 749, 111, 510, 512, 112, 422, 174, 112, 109, 71,  109, 109, 71,  109,
+            71,  71,  71,  71,  71,  71,  173, 295, 110, 422, 551, 110, 422, 550, 113, 523,
+
+            174, 113, 109, 71,  109, 109, 71,  109, 109, 71,  109, 109, 71,  109, 173, 740, 111, 422, 423, 111, 745,
+            611, 114, 740, 583, 114, 115, 116, 71,  116, 115, 115, 115, 115, 115, 115, 115, 117, 115, 118, 115, 119,
+            115, 120, 115, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 115, 115, 118, 118, 118,
+            118, 118, 118, 118, 118, 121, 118, 118, 122, 118, 123, 118, 118, 118, 124, 118, 118, 118, 125, 118, 118,
+            118, 127, 71,  127, 127, 71,  127, 71,  71,  71,  71,  71,  71,  422, 422, 128,
+
+            422, 743, 128, 740, 422, 129, 740, 174, 129, 127, 71,  127, 127, 71,  127, 127, 71,  127, 127, 71,  127,
+            173, 737, 128, 610, 641, 128, 729, 664, 130, 728, 552, 130, 131, 132, 71,  132, 131, 131, 131, 131, 131,
+            131, 131, 133, 131, 134, 131, 135, 131, 136, 131, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
+            134, 134, 131, 131, 134, 134, 134, 134, 134, 137, 134, 134, 134, 134, 134, 138, 134, 134, 139, 134, 134,
+            140, 141, 142, 134, 134, 134, 134, 134, 144, 71,  144, 144, 71,  144, 170, 170,
+
+            170, 170, 170, 170, 727, 726, 145, 725, 724, 145, 146, 147, 71,  147, 146, 146, 146, 146, 146, 146, 146,
+            148, 146, 723, 146, 150, 146, 151, 146, 295, 154, 71,  154, 154, 71,  154, 71,  71,  71,  71,  71,  71,
+            146, 146, 155, 174, 174, 155, 295, 640, 156, 422, 716, 156, 170, 170, 170, 715, 297, 173, 173, 152, 146,
+            147, 71,  147, 146, 146, 146, 146, 146, 146, 146, 148, 146, 185, 146, 150, 146, 151, 146, 665, 154, 71,
+            154, 154, 71,  154, 154, 71,  154, 154, 71,  154, 146, 146, 155, 295, 174, 155,
+
+            714, 713, 157, 748, 712, 157, 170, 170, 170, 170, 170, 170, 173, 152, 158, 159, 71,  159, 158, 158, 158,
+            158, 158, 158, 158, 160, 158, 422, 158, 162, 158, 163, 158, 711, 166, 71,  166, 166, 71,  166, 170, 170,
+            170, 170, 170, 170, 158, 158, 167, 174, 174, 167, 170, 170, 170, 422, 223, 179, 170, 170, 170, 710, 584,
+            173, 173, 164, 158, 159, 71,  159, 158, 158, 158, 158, 158, 158, 158, 160, 158, 709, 158, 162, 158, 163,
+            158, 180, 642, 84,  85,  84,  85,  181, 86,  174, 86,  295, 182, 174, 158, 158,
+
+            168, 183, 168, 236, 197, 174, 522, 173, 170, 170, 170, 173, 197, 170, 170, 170, 237, 164, 169, 173, 169,
+            732, 295, 198, 708, 204, 174, 198, 295, 199, 735, 422, 200, 295, 174, 198, 200, 199, 201, 663, 173, 197,
+            201, 202, 203, 174, 419, 202, 173, 295, 201, 681, 232, 174, 682, 202, 198, 707, 199, 173, 212, 174, 732,
+            479, 198, 203, 204, 173, 170, 170, 170, 201, 628, 203, 733, 173, 202, 295, 706, 201, 174, 295, 630, 198,
+            202, 204, 629, 212, 174, 738, 632, 198, 203, 204, 173, 227, 631, 705, 201, 634,
+
+            203, 757, 173, 213, 633, 704, 201, 174, 697, 636, 198, 213, 204, 635, 638, 174, 696, 295, 198, 203, 204,
+            173, 227, 637, 695, 201, 694, 203, 639, 173, 202, 730, 732, 228, 170, 170, 170, 198, 202, 204, 170, 170,
+            170, 295, 733, 198, 203, 204, 267, 267, 267, 693, 228, 732, 203, 295, 744, 202, 295, 295, 201, 295, 735,
+            268, 753, 202, 316, 316, 316, 316, 316, 316, 267, 267, 267, 759, 327, 327, 327, 758, 328, 765, 318, 329,
+            692, 318, 295, 268, 334, 334, 334, 334, 334, 334, 346, 346, 346, 346, 346, 346,
+
+            350, 350, 350, 760, 336, 319, 295, 336, 691, 690, 348, 689, 688, 348, 295, 351, 352, 352, 352, 352, 352,
+            352, 357, 357, 357, 359, 359, 359, 359, 359, 359, 295, 354, 763, 766, 354, 764, 358, 337, 295, 295, 361,
+            767, 295, 361, 376, 376, 376, 349, 316, 316, 316, 316, 316, 316, 316, 316, 316, 687, 355, 377, 362, 384,
+            384, 384, 318, 295, 295, 318, 771, 761, 318, 387, 387, 387, 327, 327, 327, 762, 328, 295, 295, 329, 390,
+            390, 390, 769, 770, 381, 334, 334, 334, 334, 334, 334, 334, 334, 334, 391, 397,
+
+            397, 397, 399, 399, 399, 336, 771, 686, 336, 685, 680, 336, 679, 678, 398, 295, 768, 400, 403, 403, 403,
+            406, 406, 406, 346, 346, 346, 677, 676, 395, 346, 346, 346, 404, 392, 675, 407, 346, 346, 346, 348, 350,
+            350, 350, 674, 673, 348, 409, 409, 409, 672, 410, 671, 348, 411, 670, 351, 352, 352, 352, 352, 352, 352,
+            352, 352, 352, 357, 357, 357, 359, 359, 359, 669, 354, 408, 668, 354, 667, 666, 354, 662, 358, 414, 414,
+            414, 361, 415, 661, 660, 416, 359, 359, 359, 359, 359, 359, 421, 421, 421, 426,
+
+            426, 426, 659, 658, 412, 657, 361, 656, 655, 361, 654, 653, 422, 423, 428, 428, 428, 431, 431, 431, 376,
+            376, 376, 434, 434, 434, 652, 435, 651, 429, 436, 650, 432, 649, 648, 377, 438, 438, 438, 316, 316, 316,
+            647, 417, 443, 443, 443, 646, 439, 627, 626, 440, 384, 384, 384, 318, 446, 446, 446, 387, 387, 387, 448,
+            448, 448, 390, 390, 390, 450, 450, 450, 625, 451, 624, 620, 452, 599, 449, 442, 598, 391, 456, 456, 456,
+            458, 458, 458, 397, 397, 397, 597, 459, 459, 459, 596, 460, 593, 457, 461, 399,
+
+            399, 399, 398, 462, 462, 462, 585, 463, 581, 572, 464, 403, 403, 403, 400, 467, 467, 467, 571, 468, 570,
+            569, 469, 406, 406, 406, 404, 471, 471, 471, 562, 472, 561, 560, 473, 346, 346, 346, 407, 409, 409, 409,
+            554, 410, 553, 549, 411, 352, 352, 352, 544, 348, 414, 414, 414, 543, 415, 542, 541, 416, 359, 359, 359,
+            354, 421, 421, 421, 426, 426, 426, 428, 428, 428, 431, 431, 431, 361, 484, 484, 484, 422, 485, 540, 539,
+            486, 429, 474, 538, 432, 533, 531, 475, 488, 488, 488, 530, 489, 477, 527, 490,
+
+            526, 480, 434, 434, 434, 525, 435, 521, 519, 436, 438, 438, 438, 494, 494, 494, 515, 495, 481, 514, 496,
+            498, 498, 498, 513, 440, 443, 443, 443, 500, 500, 500, 446, 446, 446, 508, 507, 499, 502, 502, 502, 448,
+            448, 448, 503, 503, 503, 506, 504, 501, 497, 505, 493, 450, 450, 450, 449, 451, 492, 491, 452, 456, 456,
+            456, 458, 458, 458, 459, 459, 459, 487, 460, 483, 482, 461, 422, 478, 457, 462, 462, 462, 476, 463, 470,
+            466, 464, 467, 467, 467, 465, 468, 455, 454, 469, 471, 471, 471, 453, 472, 447,
+
+            445, 473, 516, 516, 516, 352, 352, 352, 359, 359, 359, 444, 484, 484, 484, 441, 485, 437, 517, 486, 433,
+            354, 430, 427, 361, 488, 488, 488, 425, 489, 424, 418, 490, 528, 528, 528, 494, 494, 494, 413, 495, 518,
+            405, 496, 498, 498, 498, 402, 529, 500, 500, 500, 401, 396, 520, 532, 532, 532, 394, 393, 499, 502, 502,
+            502, 503, 503, 503, 389, 504, 388, 386, 505, 534, 534, 534, 536, 536, 536, 516, 516, 516, 545, 545, 545,
+            547, 547, 547, 535, 385, 383, 537, 359, 359, 359, 517, 382, 380, 546, 555, 555,
+
+            555, 528, 528, 528, 557, 557, 557, 361, 558, 379, 378, 559, 375, 556, 374, 373, 529, 532, 532, 532, 534,
+            534, 534, 563, 563, 563, 372, 564, 371, 370, 565, 536, 536, 536, 369, 535, 368, 566, 566, 566, 367, 567,
+            366, 548, 568, 365, 537, 573, 573, 573, 575, 575, 575, 577, 577, 577, 545, 545, 545, 547, 547, 547, 574,
+            295, 363, 576, 356, 345, 578, 579, 579, 579, 546, 582, 582, 582, 586, 586, 586, 555, 555, 555, 579, 579,
+            579, 580, 588, 588, 588, 295, 589, 587, 344, 590, 556, 557, 557, 557, 580, 558,
+
+            343, 342, 559, 591, 591, 591, 594, 594, 594, 563, 563, 563, 341, 564, 340, 339, 565, 338, 592, 333, 332,
+            595, 566, 566, 566, 331, 567, 330, 326, 568, 573, 573, 573, 600, 600, 600, 325, 601, 324, 323, 602, 575,
+            575, 575, 322, 574, 603, 603, 603, 321, 604, 320, 315, 605, 314, 313, 576, 577, 577, 577, 606, 606, 606,
+            312, 607, 311, 310, 608, 582, 582, 582, 309, 578, 612, 612, 612, 586, 586, 586, 614, 614, 614, 308, 615,
+            295, 307, 616, 306, 613, 305, 304, 587, 588, 588, 588, 303, 589, 302, 301, 590,
+
+            298, 609, 591, 591, 591, 617, 617, 617, 296, 618, 295, 293, 619, 594, 594, 594, 292, 592, 621, 621, 621,
+            291, 622, 289, 288, 623, 287, 285, 595, 600, 600, 600, 284, 601, 282, 281, 602, 603, 603, 603, 280, 604,
+            279, 278, 605, 606, 606, 606, 277, 607, 276, 275, 608, 612, 612, 612, 643, 643, 643, 274, 644, 272, 271,
+            645, 270, 614, 614, 614, 613, 615, 269, 266, 616, 617, 617, 617, 265, 618, 264, 263, 619, 621, 621, 621,
+            262, 622, 261, 260, 623, 643, 643, 643, 259, 644, 257, 256, 645, 683, 683, 683,
+
+            698, 698, 698, 699, 699, 699, 683, 683, 683, 255, 254, 253, 684, 422, 252, 251, 295, 250, 700, 422, 249,
+            684, 422, 701, 701, 701, 248, 702, 247, 246, 703, 698, 698, 698, 699, 699, 699, 245, 244, 422, 239, 718,
+            718, 718, 236, 719, 238, 295, 720, 700, 422, 701, 701, 701, 234, 702, 233, 422, 703, 717, 231, 742, 742,
+            742, 754, 754, 754, 422, 420, 420, 420, 420, 420, 420, 420, 420, 420, 422, 423, 420, 295, 229, 420, 420,
+            420, 422, 420, 750, 750, 750, 226, 751, 224, 220, 752, 742, 742, 742, 219, 218,
+
+            420, 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, 422, 217, 420, 216, 214, 420, 420, 420, 422, 420,
+            718, 718, 718, 211, 719, 210, 209, 720, 750, 750, 750, 480, 751, 420, 420, 752, 422, 420, 420, 420, 420,
+            420, 736, 420, 420, 420, 208, 207, 420, 205, 194, 420, 420, 420, 422, 420, 193, 192, 191, 190, 186, 184,
+            178, 177, 178, 746, 746, 746, 177, 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, 736, 747, 176, 420,
+            175, 774, 420, 420, 420, 422, 420, 746, 746, 746, 754, 754, 754, 774, 755, 774,
+
+            774, 756, 774, 774, 420, 420, 747, 772, 772, 772, 295, 772, 772, 772, 774, 774, 774, 774, 774, 774, 774,
+            774, 774, 773, 774, 774, 774, 773, 68,  68,  68,  68,  68,  68,  68,  69,  69,  69,  69,  69,  69,  69,
+            74,  74,  74,  74,  74,  74,  74,  77,  77,  77,  77,  77,  77,  77,  80,  80,  80,  80,  80,  80,  80,
+            83,  83,  83,  83,  83,  83,  83,  90,  90,  90,  90,  90,  90,  90,  108, 108, 108, 108, 108, 108, 108,
+            126, 126, 126, 126, 126, 126, 126, 143, 143, 143, 143, 143, 143, 143, 149, 149,
+
+            149, 149, 149, 149, 149, 153, 153, 153, 153, 153, 153, 153, 161, 161, 161, 161, 161, 161, 161, 165, 165,
+            165, 165, 165, 165, 165, 187, 187, 187, 774, 187, 206, 206, 206, 774, 206, 215, 215, 215, 774, 215, 225,
+            225, 225, 774, 225, 230, 230, 230, 774, 230, 235, 235, 235, 235, 235, 774, 235, 258, 774, 258, 273, 774,
+            273, 283, 774, 283, 286, 774, 286, 290, 774, 290, 294, 294, 294, 294, 294, 294, 294, 300, 774, 774, 300,
+            317, 317, 317, 317, 317, 317, 335, 335, 335, 335, 335, 335, 347, 347, 347, 347,
+
+            347, 347, 353, 353, 353, 353, 353, 353, 360, 360, 360, 360, 360, 360, 420, 420, 420, 420, 420, 420, 420,
+            721, 721, 721, 721, 721, 721, 721, 722, 722, 722, 722, 722, 722, 722, 731, 731, 731, 731, 731, 731, 731,
+            734, 734, 734, 734, 734, 734, 734, 739, 739, 739, 739, 739, 739, 739, 741, 741, 741, 741, 741, 741, 741,
+            67,  774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774,
+            774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774,
+
+            774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774,
+            774, 774};
+
+        static const flex_int16_t yy_chk[2224] = {
+            0,   0,   3,   3,   3,   4,   4,   4,   5,   5,   5,   6,   6,   6,   9,   179, 3,   10,  11,  4,   12,
+            9,   5,   481, 10,  6,   7,   7,   7,   8,   8,   8,   13,  13,  11,  297, 12,  13,  13,  297, 7,   14,
+            14,  8,   481, 13,  14,  14,  15,  15,  101, 15,  72,  15,  14,  16,  16,  101, 16,  179, 16,  15,  17,
+            17,  18,  18,  72,  73,  16,  19,  19,  19,  20,  20,  20,  23,  23,  23,  24,  24,  24,  73,  107, 19,
+            142, 240, 20,  240, 107, 23,  142, 180, 24,  17,  180, 18,  21,  21,  21,  21,  21,
+
+            21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,
+            21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,
+            21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,  25,  25,  25,  26,  26,  26,  27,  27,  27,
+            28,  28,  28,  463, 464, 25,  480, 745, 26,  463, 464, 27,  523, 76,  28,  29,  29,  29,  30,  30,  30,
+            31,  31,  31,  32,  32,  32,  76,  522, 29,  551, 523, 30,  584, 522, 31,  480,
+
+            99,  32,  33,  33,  33,  34,  34,  34,  35,  35,  35,  36,  36,  36,  99,  741, 33,  732, 732, 34,  740,
+            584, 35,  739, 551, 36,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,
+            37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,
+            37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,  37,
+            37,  39,  39,  39,  40,  40,  40,  41,  41,  41,  42,  42,  42,  524, 641, 39,
+
+            610, 737, 40,  735, 583, 41,  733, 119, 42,  43,  43,  43,  44,  44,  44,  45,  45,  45,  46,  46,  46,
+            119, 723, 43,  583, 610, 44,  715, 641, 45,  713, 524, 46,  47,  47,  47,  47,  47,  47,  47,  47,  47,
+            47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,
+            47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,  47,
+            47,  47,  47,  47,  47,  47,  47,  47,  49,  49,  49,  50,  50,  50,  70,  70,
+
+            70,  71,  71,  71,  711, 709, 49,  707, 705, 50,  51,  51,  51,  51,  51,  51,  51,  51,  51,  51,  51,
+            51,  51,  704, 51,  51,  51,  51,  51,  609, 53,  53,  53,  54,  54,  54,  55,  55,  55,  56,  56,  56,
+            51,  51,  53,  94,  135, 54,  237, 609, 55,  642, 697, 56,  75,  75,  75,  696, 237, 94,  135, 51,  52,
+            52,  52,  52,  52,  52,  52,  52,  52,  52,  52,  52,  52,  94,  52,  52,  52,  52,  52,  642, 57,  57,
+            57,  58,  58,  58,  59,  59,  59,  60,  60,  60,  52,  52,  57,  744, 150, 58,
+
+            695, 694, 59,  744, 693, 60,  96,  96,  96,  109, 109, 109, 150, 52,  61,  61,  61,  61,  61,  61,  61,
+            61,  61,  61,  61,  61,  61,  552, 61,  61,  61,  61,  61,  692, 63,  63,  63,  64,  64,  64,  116, 116,
+            116, 127, 127, 127, 61,  61,  63,  145, 162, 64,  132, 132, 132, 611, 145, 86,  144, 144, 144, 691, 552,
+            145, 162, 61,  62,  62,  62,  62,  62,  62,  62,  62,  62,  62,  62,  62,  62,  690, 62,  62,  62,  62,
+            62,  86,  611, 65,  65,  66,  66,  86,  65,  112, 66,  479, 86,  110, 62,  62,
+
+            65,  86,  66,  171, 110, 111, 479, 112, 147, 147, 147, 110, 111, 154, 154, 154, 171, 62,  65,  111, 66,
+            720, 640, 112, 689, 112, 113, 110, 663, 110, 720, 664, 112, 364, 114, 111, 110, 111, 112, 640, 113, 114,
+            110, 112, 111, 167, 364, 110, 114, 419, 111, 663, 167, 128, 664, 111, 113, 688, 113, 167, 128, 129, 719,
+            419, 114, 113, 114, 128, 159, 159, 159, 113, 601, 114, 719, 129, 113, 730, 687, 114, 130, 755, 602, 128,
+            114, 128, 601, 130, 155, 730, 604, 129, 128, 129, 130, 155, 602, 686, 128, 605,
+
+            129, 755, 155, 128, 604, 685, 129, 156, 680, 607, 130, 129, 130, 605, 608, 157, 679, 717, 155, 130, 155,
+            156, 157, 607, 678, 130, 677, 155, 608, 157, 130, 717, 731, 155, 166, 166, 166, 156, 155, 156, 170, 170,
+            170, 738, 731, 157, 156, 157, 207, 207, 207, 676, 156, 734, 157, 748, 738, 156, 757, 756, 157, 763, 734,
+            207, 748, 157, 258, 258, 258, 259, 259, 259, 267, 267, 267, 757, 268, 268, 268, 756, 268, 763, 258, 268,
+            675, 259, 758, 267, 273, 273, 273, 274, 274, 274, 283, 283, 283, 284, 284, 284,
+
+            285, 285, 285, 758, 273, 259, 765, 274, 674, 673, 283, 672, 671, 284, 764, 285, 286, 286, 286, 287, 287,
+            287, 289, 289, 289, 290, 290, 290, 291, 291, 291, 759, 286, 761, 764, 287, 762, 289, 274, 760, 761, 290,
+            765, 762, 291, 312, 312, 312, 284, 316, 316, 316, 317, 317, 317, 319, 319, 319, 670, 287, 312, 291, 322,
+            322, 322, 316, 767, 768, 317, 769, 759, 319, 325, 325, 325, 327, 327, 327, 760, 327, 766, 769, 327, 331,
+            331, 331, 767, 768, 319, 334, 334, 334, 335, 335, 335, 337, 337, 337, 331, 339,
+
+            339, 339, 340, 340, 340, 334, 770, 669, 335, 666, 662, 337, 661, 660, 339, 770, 766, 340, 343, 343, 343,
+            345, 345, 345, 346, 346, 346, 659, 658, 337, 347, 347, 347, 343, 331, 657, 345, 349, 349, 349, 346, 350,
+            350, 350, 656, 655, 347, 351, 351, 351, 654, 351, 653, 349, 351, 652, 350, 352, 352, 352, 353, 353, 353,
+            355, 355, 355, 357, 357, 357, 359, 359, 359, 651, 352, 349, 650, 353, 648, 646, 355, 639, 357, 358, 358,
+            358, 359, 358, 638, 637, 358, 360, 360, 360, 362, 362, 362, 365, 365, 365, 370,
+
+            370, 370, 636, 635, 355, 634, 360, 633, 632, 362, 631, 630, 365, 365, 372, 372, 372, 374, 374, 374, 376,
+            376, 376, 377, 377, 377, 629, 377, 628, 372, 377, 627, 374, 626, 625, 376, 379, 379, 379, 381, 381, 381,
+            624, 362, 382, 382, 382, 620, 379, 599, 598, 379, 384, 384, 384, 381, 386, 386, 386, 387, 387, 387, 389,
+            389, 389, 390, 390, 390, 391, 391, 391, 597, 391, 596, 593, 391, 572, 389, 381, 571, 390, 395, 395, 395,
+            396, 396, 396, 397, 397, 397, 570, 398, 398, 398, 569, 398, 561, 395, 398, 399,
+
+            399, 399, 397, 400, 400, 400, 553, 400, 549, 541, 400, 403, 403, 403, 399, 404, 404, 404, 540, 404, 539,
+            538, 404, 406, 406, 406, 403, 407, 407, 407, 533, 407, 531, 530, 407, 408, 408, 408, 406, 409, 409, 409,
+            526, 409, 525, 521, 409, 412, 412, 412, 515, 408, 414, 414, 414, 514, 414, 513, 512, 414, 417, 417, 417,
+            412, 421, 421, 421, 426, 426, 426, 428, 428, 428, 431, 431, 431, 417, 429, 429, 429, 421, 429, 511, 510,
+            429, 428, 408, 509, 431, 506, 497, 412, 432, 432, 432, 493, 432, 417, 491, 432,
+
+            487, 421, 434, 434, 434, 483, 434, 478, 476, 434, 438, 438, 438, 440, 440, 440, 470, 440, 421, 466, 440,
+            442, 442, 442, 465, 438, 443, 443, 443, 444, 444, 444, 446, 446, 446, 455, 454, 442, 447, 447, 447, 448,
+            448, 448, 449, 449, 449, 453, 449, 445, 441, 449, 439, 450, 450, 450, 448, 450, 437, 433, 450, 456, 456,
+            456, 458, 458, 458, 459, 459, 459, 430, 459, 427, 423, 459, 420, 418, 456, 462, 462, 462, 413, 462, 405,
+            402, 462, 467, 467, 467, 401, 467, 394, 393, 467, 471, 471, 471, 392, 471, 388,
+
+            385, 471, 474, 474, 474, 475, 475, 475, 477, 477, 477, 383, 484, 484, 484, 380, 484, 378, 474, 484, 375,
+            475, 373, 371, 477, 488, 488, 488, 369, 488, 368, 363, 488, 492, 492, 492, 494, 494, 494, 356, 494, 475,
+            344, 494, 498, 498, 498, 342, 492, 500, 500, 500, 341, 338, 477, 501, 501, 501, 333, 332, 498, 502, 502,
+            502, 503, 503, 503, 330, 503, 326, 324, 503, 507, 507, 507, 508, 508, 508, 516, 516, 516, 518, 518, 518,
+            519, 519, 519, 507, 323, 321, 508, 520, 520, 520, 516, 320, 315, 518, 527, 527,
+
+            527, 528, 528, 528, 529, 529, 529, 520, 529, 314, 313, 529, 311, 527, 310, 309, 528, 532, 532, 532, 534,
+            534, 534, 535, 535, 535, 308, 535, 307, 306, 535, 536, 536, 536, 305, 534, 302, 537, 537, 537, 301, 537,
+            300, 520, 537, 298, 536, 542, 542, 542, 543, 543, 543, 544, 544, 544, 545, 545, 545, 547, 547, 547, 542,
+            294, 292, 543, 288, 282, 544, 548, 548, 548, 545, 550, 550, 550, 554, 554, 554, 555, 555, 555, 579, 579,
+            579, 548, 556, 556, 556, 550, 556, 554, 281, 556, 555, 557, 557, 557, 579, 557,
+
+            280, 279, 557, 560, 560, 560, 562, 562, 562, 563, 563, 563, 278, 563, 277, 276, 563, 275, 560, 272, 271,
+            562, 566, 566, 566, 270, 566, 269, 266, 566, 573, 573, 573, 574, 574, 574, 265, 574, 264, 263, 574, 575,
+            575, 575, 262, 573, 576, 576, 576, 261, 576, 260, 257, 576, 256, 255, 575, 577, 577, 577, 578, 578, 578,
+            254, 578, 253, 252, 578, 582, 582, 582, 251, 577, 585, 585, 585, 586, 586, 586, 587, 587, 587, 250, 587,
+            582, 249, 587, 248, 585, 246, 245, 586, 588, 588, 588, 244, 588, 243, 242, 588,
+
+            238, 582, 591, 591, 591, 592, 592, 592, 236, 592, 235, 234, 592, 594, 594, 594, 233, 591, 595, 595, 595,
+            232, 595, 231, 228, 595, 227, 226, 594, 600, 600, 600, 223, 600, 222, 221, 600, 603, 603, 603, 220, 603,
+            219, 218, 603, 606, 606, 606, 217, 606, 216, 213, 606, 612, 612, 612, 613, 613, 613, 212, 613, 211, 210,
+            613, 209, 614, 614, 614, 612, 614, 208, 204, 614, 617, 617, 617, 203, 617, 202, 201, 617, 621, 621, 621,
+            200, 621, 199, 198, 621, 643, 643, 643, 197, 643, 196, 195, 643, 665, 665, 665,
+
+            681, 681, 681, 682, 682, 682, 683, 683, 683, 194, 193, 192, 665, 665, 191, 190, 681, 189, 682, 682, 188,
+            683, 683, 684, 684, 684, 185, 684, 184, 183, 684, 698, 698, 698, 699, 699, 699, 182, 181, 684, 175, 700,
+            700, 700, 174, 700, 172, 698, 700, 699, 699, 701, 701, 701, 169, 701, 168, 700, 701, 698, 164, 736, 736,
+            736, 753, 753, 753, 701, 702, 702, 702, 702, 702, 702, 702, 702, 702, 736, 736, 702, 753, 160, 702, 702,
+            702, 702, 702, 747, 747, 747, 152, 747, 148, 141, 747, 742, 742, 742, 140, 139,
+
+            702, 702, 703, 703, 703, 703, 703, 703, 703, 703, 703, 742, 138, 703, 137, 133, 703, 703, 703, 703, 703,
+            718, 718, 718, 125, 718, 124, 123, 718, 750, 750, 750, 742, 750, 703, 703, 750, 718, 721, 721, 721, 721,
+            721, 721, 721, 721, 721, 122, 121, 721, 117, 106, 721, 721, 721, 721, 721, 105, 104, 103, 102, 97,  93,
+            92,  91,  85,  743, 743, 743, 84,  721, 721, 722, 722, 722, 722, 722, 722, 722, 722, 722, 743, 82,  722,
+            79,  67,  722, 722, 722, 722, 722, 746, 746, 746, 754, 754, 754, 0,   754, 0,
+
+            0,   754, 0,   0,   722, 722, 746, 771, 771, 771, 754, 772, 772, 772, 0,   0,   0,   0,   0,   0,   0,
+            0,   0,   771, 0,   0,   0,   772, 775, 775, 775, 775, 775, 775, 775, 776, 776, 776, 776, 776, 776, 776,
+            777, 777, 777, 777, 777, 777, 777, 778, 778, 778, 778, 778, 778, 778, 779, 779, 779, 779, 779, 779, 779,
+            780, 780, 780, 780, 780, 780, 780, 781, 781, 781, 781, 781, 781, 781, 782, 782, 782, 782, 782, 782, 782,
+            783, 783, 783, 783, 783, 783, 783, 784, 784, 784, 784, 784, 784, 784, 785, 785,
+
+            785, 785, 785, 785, 785, 786, 786, 786, 786, 786, 786, 786, 787, 787, 787, 787, 787, 787, 787, 788, 788,
+            788, 788, 788, 788, 788, 789, 789, 789, 0,   789, 790, 790, 790, 0,   790, 791, 791, 791, 0,   791, 792,
+            792, 792, 0,   792, 793, 793, 793, 0,   793, 794, 794, 794, 794, 794, 0,   794, 795, 0,   795, 796, 0,
+            796, 797, 0,   797, 798, 0,   798, 799, 0,   799, 800, 800, 800, 800, 800, 800, 800, 801, 0,   0,   801,
+            802, 802, 802, 802, 802, 802, 803, 803, 803, 803, 803, 803, 804, 804, 804, 804,
+
+            804, 804, 805, 805, 805, 805, 805, 805, 806, 806, 806, 806, 806, 806, 807, 807, 807, 807, 807, 807, 807,
+            808, 808, 808, 808, 808, 808, 808, 809, 809, 809, 809, 809, 809, 809, 810, 810, 810, 810, 810, 810, 810,
+            811, 811, 811, 811, 811, 811, 811, 812, 812, 812, 812, 812, 812, 812, 813, 813, 813, 813, 813, 813, 813,
+            774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774,
+            774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774,
+
+            774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, 774,
+            774, 774};
+
+        /* Table of booleans, true if rule could match eol. */
+        static const 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, 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, 0, 0, 0, 0, 1, 1, 0,
+            1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,
+        };
+
+        static yy_state_type yy_last_accepting_state;
+        static char* yy_last_accepting_cpos;
+
+        extern int yy_flex_debug;
+        int yy_flex_debug = 0;
+
+        /* The intent behind this definition is that it'll catch
+         * any uses of REJECT which flex missed.
+         */
 #define REJECT reject_used_but_not_detected
 #define yymore() yymore_used_but_not_detected
 #define YY_MORE_ADJ 0
@@ -1558,81 +1192,81 @@ const char dax__flexml_version[] = "1.9.6";
 int dax__pcdata_ix;
 extern char *dax__bufferstack;
 #define dax__pcdata (dax__bufferstack + dax__pcdata_ix)
-AT_dax__adag_childCount AX_dax__adag_childCount;
-#define A_dax__adag_childCount (dax__bufferstack + AX_dax__adag_childCount)
-short int dax__adag_childCount_isset;
-AT_dax__adag_count AX_dax__adag_count;
-#define A_dax__adag_count (dax__bufferstack + AX_dax__adag_count)
-short int dax__adag_count_isset;
-AT_dax__adag_fileCount AX_dax__adag_fileCount;
-#define A_dax__adag_fileCount (dax__bufferstack + AX_dax__adag_fileCount)
-short int dax__adag_fileCount_isset;
-AT_dax__adag_index AX_dax__adag_index;
-#define A_dax__adag_index (dax__bufferstack + AX_dax__adag_index)
-short int dax__adag_index_isset;
-AT_dax__adag_jobCount AX_dax__adag_jobCount;
-#define A_dax__adag_jobCount (dax__bufferstack + AX_dax__adag_jobCount)
-short int dax__adag_jobCount_isset;
-AT_dax__adag_name AX_dax__adag_name;
-#define A_dax__adag_name (dax__bufferstack + AX_dax__adag_name)
-short int dax__adag_name_isset;
-AT_dax__adag_version AX_dax__adag_version;
-#define A_dax__adag_version (dax__bufferstack + AX_dax__adag_version)
-short int dax__adag_version_isset;
-AT_dax__adag_xmlns AX_dax__adag_xmlns;
-#define A_dax__adag_xmlns (dax__bufferstack + AX_dax__adag_xmlns)
-short int dax__adag_xmlns_isset;
-AT_dax__adag_xmlns_c_xsi AX_dax__adag_xmlns_c_xsi;
-#define A_dax__adag_xmlns_c_xsi (dax__bufferstack + AX_dax__adag_xmlns_c_xsi)
-short int dax__adag_xmlns_c_xsi_isset;
-AT_dax__adag_xsi_c_schemaLocation AX_dax__adag_xsi_c_schemaLocation;
-#define A_dax__adag_xsi_c_schemaLocation (dax__bufferstack + AX_dax__adag_xsi_c_schemaLocation)
-short int dax__adag_xsi_c_schemaLocation_isset;
-AT_dax__child_ref AX_dax__child_ref;
-#define A_dax__child_ref (dax__bufferstack + AX_dax__child_ref)
-short int dax__child_ref_isset;
-AT_dax__job_id AX_dax__job_id;
-#define A_dax__job_id (dax__bufferstack + AX_dax__job_id)
-short int dax__job_id_isset;
-AT_dax__job_level AX_dax__job_level;
-#define A_dax__job_level (dax__bufferstack + AX_dax__job_level)
-short int dax__job_level_isset;
 AT_dax__job_name AX_dax__job_name;
 #define A_dax__job_name (dax__bufferstack + AX_dax__job_name)
 short int dax__job_name_isset;
-AT_dax__job_namespace AX_dax__job_namespace;
-#define A_dax__job_namespace (dax__bufferstack + AX_dax__job_namespace)
-short int dax__job_namespace_isset;
-AT_dax__job_runtime AX_dax__job_runtime;
-#define A_dax__job_runtime (dax__bufferstack + AX_dax__job_runtime)
-short int dax__job_runtime_isset;
-AT_dax__job_version AX_dax__job_version;
-#define A_dax__job_version (dax__bufferstack + AX_dax__job_version)
-short int dax__job_version_isset;
-AT_dax__parent_ref AX_dax__parent_ref;
-#define A_dax__parent_ref (dax__bufferstack + AX_dax__parent_ref)
-short int dax__parent_ref_isset;
-AT_dax__uses_file AX_dax__uses_file;
-#define A_dax__uses_file (dax__bufferstack + AX_dax__uses_file)
-short int dax__uses_file_isset;
 AT_dax__uses_link AX_dax__uses_link;
 #define A_dax__uses_link AX_dax__uses_link
 short int dax__uses_link_isset;
+AT_dax__uses_transfer AX_dax__uses_transfer;
+#define A_dax__uses_transfer AX_dax__uses_transfer
+short int dax__uses_transfer_isset;
+AT_dax__adag_xmlns_c_xsi AX_dax__adag_xmlns_c_xsi;
+#define A_dax__adag_xmlns_c_xsi (dax__bufferstack + AX_dax__adag_xmlns_c_xsi)
+short int dax__adag_xmlns_c_xsi_isset;
 AT_dax__uses_optional AX_dax__uses_optional;
 #define A_dax__uses_optional AX_dax__uses_optional
 short int dax__uses_optional_isset;
+AT_dax__parent_ref AX_dax__parent_ref;
+#define A_dax__parent_ref (dax__bufferstack + AX_dax__parent_ref)
+short int dax__parent_ref_isset;
 AT_dax__uses_register AX_dax__uses_register;
 #define A_dax__uses_register AX_dax__uses_register
 short int dax__uses_register_isset;
-AT_dax__uses_size AX_dax__uses_size;
-#define A_dax__uses_size (dax__bufferstack + AX_dax__uses_size)
-short int dax__uses_size_isset;
-AT_dax__uses_transfer AX_dax__uses_transfer;
-#define A_dax__uses_transfer AX_dax__uses_transfer
-short int dax__uses_transfer_isset;
+AT_dax__uses_file AX_dax__uses_file;
+#define A_dax__uses_file (dax__bufferstack + AX_dax__uses_file)
+short int dax__uses_file_isset;
 AT_dax__uses_type AX_dax__uses_type;
 #define A_dax__uses_type (dax__bufferstack + AX_dax__uses_type)
 short int dax__uses_type_isset;
+AT_dax__adag_xmlns AX_dax__adag_xmlns;
+#define A_dax__adag_xmlns (dax__bufferstack + AX_dax__adag_xmlns)
+short int dax__adag_xmlns_isset;
+AT_dax__adag_fileCount AX_dax__adag_fileCount;
+#define A_dax__adag_fileCount (dax__bufferstack + AX_dax__adag_fileCount)
+short int dax__adag_fileCount_isset;
+AT_dax__job_version AX_dax__job_version;
+#define A_dax__job_version (dax__bufferstack + AX_dax__job_version)
+short int dax__job_version_isset;
+AT_dax__adag_count AX_dax__adag_count;
+#define A_dax__adag_count (dax__bufferstack + AX_dax__adag_count)
+short int dax__adag_count_isset;
+AT_dax__child_ref AX_dax__child_ref;
+#define A_dax__child_ref (dax__bufferstack + AX_dax__child_ref)
+short int dax__child_ref_isset;
+AT_dax__adag_xsi_c_schemaLocation AX_dax__adag_xsi_c_schemaLocation;
+#define A_dax__adag_xsi_c_schemaLocation (dax__bufferstack + AX_dax__adag_xsi_c_schemaLocation)
+short int dax__adag_xsi_c_schemaLocation_isset;
+AT_dax__job_runtime AX_dax__job_runtime;
+#define A_dax__job_runtime (dax__bufferstack + AX_dax__job_runtime)
+short int dax__job_runtime_isset;
+AT_dax__adag_childCount AX_dax__adag_childCount;
+#define A_dax__adag_childCount (dax__bufferstack + AX_dax__adag_childCount)
+short int dax__adag_childCount_isset;
+AT_dax__uses_size AX_dax__uses_size;
+#define A_dax__uses_size (dax__bufferstack + AX_dax__uses_size)
+short int dax__uses_size_isset;
+AT_dax__job_namespace AX_dax__job_namespace;
+#define A_dax__job_namespace (dax__bufferstack + AX_dax__job_namespace)
+short int dax__job_namespace_isset;
+AT_dax__adag_jobCount AX_dax__adag_jobCount;
+#define A_dax__adag_jobCount (dax__bufferstack + AX_dax__adag_jobCount)
+short int dax__adag_jobCount_isset;
+AT_dax__job_id AX_dax__job_id;
+#define A_dax__job_id (dax__bufferstack + AX_dax__job_id)
+short int dax__job_id_isset;
+AT_dax__job_level AX_dax__job_level;
+#define A_dax__job_level (dax__bufferstack + AX_dax__job_level)
+short int dax__job_level_isset;
+AT_dax__adag_index AX_dax__adag_index;
+#define A_dax__adag_index (dax__bufferstack + AX_dax__adag_index)
+short int dax__adag_index_isset;
+AT_dax__adag_name AX_dax__adag_name;
+#define A_dax__adag_name (dax__bufferstack + AX_dax__adag_name)
+short int dax__adag_name_isset;
+AT_dax__adag_version AX_dax__adag_version;
+#define A_dax__adag_version (dax__bufferstack + AX_dax__adag_version)
+short int dax__adag_version_isset;
 
 /* XML state. */
 #ifdef FLEX_DEBUG
@@ -1800,20 +1434,20 @@ const char* *dax__statenames=NULL;
 #define S_dax__adag_4 15
 #define S_dax__adag_5 16
 #define E_dax__adag 17
-#define AL_dax__child 18
-#define S_dax__child 19
-#define S_dax__child_1 20
-#define S_dax__child_2 21
-#define E_dax__child 22
-#define AL_dax__job 23
-#define S_dax__job 24
-#define S_dax__job_1 25
-#define S_dax__job_2 26
-#define E_dax__job 27
-#define AL_dax__parent 28
-#define E_dax__parent 29
-#define AL_dax__uses 30
-#define E_dax__uses 31
+#define AL_dax__job 18
+#define S_dax__job 19
+#define S_dax__job_1 20
+#define S_dax__job_2 21
+#define E_dax__job 22
+#define AL_dax__uses 23
+#define E_dax__uses 24
+#define AL_dax__child 25
+#define S_dax__child 26
+#define S_dax__child_1 27
+#define S_dax__child_2 28
+#define E_dax__child 29
+#define AL_dax__parent 30
+#define E_dax__parent 31
 #define IMPOSSIBLE 32
 
 #ifndef YY_NO_UNISTD_H
@@ -2087,20 +1721,20 @@ YY_DECL
   dax__statenames[S_dax__adag_4] = "adag";
   dax__statenames[S_dax__adag_5] = "adag";
   dax__statenames[E_dax__adag] = "adag";
-  dax__statenames[AL_dax__child] = NULL;
-  dax__statenames[S_dax__child] = "child";
-  dax__statenames[S_dax__child_1] = "child";
-  dax__statenames[S_dax__child_2] = "child";
-  dax__statenames[E_dax__child] = "child";
   dax__statenames[AL_dax__job] = NULL;
   dax__statenames[S_dax__job] = "job";
   dax__statenames[S_dax__job_1] = "job";
   dax__statenames[S_dax__job_2] = "job";
   dax__statenames[E_dax__job] = "job";
-  dax__statenames[AL_dax__parent] = NULL;
-  dax__statenames[E_dax__parent] = "parent";
   dax__statenames[AL_dax__uses] = NULL;
   dax__statenames[E_dax__uses] = "uses";
+  dax__statenames[AL_dax__child]       = NULL;
+  dax__statenames[S_dax__child]        = "child";
+  dax__statenames[S_dax__child_1]      = "child";
+  dax__statenames[S_dax__child_2]      = "child";
+  dax__statenames[E_dax__child]        = "child";
+  dax__statenames[AL_dax__parent]      = NULL;
+  dax__statenames[E_dax__parent]       = "parent";
   }
 
  /* COMMENTS and PIs: handled uniformly for efficiency. */
@@ -2135,8 +1769,7 @@ yy_match:
                                }
                        yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
                        ++yy_cp;
-                       }
-               while ( yy_base[yy_current_state] != 2135 );
+                } while (yy_base[yy_current_state] != 2164);
 
 yy_find_action:
                yy_act = yy_accept[yy_current_state];
@@ -2257,26 +1890,26 @@ case 17:
 /* rule 17 can match eol */
 YY_RULE_SETUP
 {
-  AX_dax__adag_childCount = 0;
-  dax__adag_childCount_isset = 0;
-  AX_dax__adag_count = 0;
-  dax__adag_count_isset = 0;
-  AX_dax__adag_fileCount = 0;
-  dax__adag_fileCount_isset = 0;
-  AX_dax__adag_index = 0;
-  dax__adag_index_isset = 0;
-  AX_dax__adag_jobCount = 0;
-  dax__adag_jobCount_isset = 0;
-  AX_dax__adag_name = 0;
-  dax__adag_name_isset = 0;
-  AX_dax__adag_version = 153;
-  dax__adag_version_isset = 0;
   AX_dax__adag_xmlns = 1;
   dax__adag_xmlns_isset = 0;
   AX_dax__adag_xmlns_c_xsi = 35;
   dax__adag_xmlns_c_xsi_isset = 0;
   AX_dax__adag_xsi_c_schemaLocation = 77;
   dax__adag_xsi_c_schemaLocation_isset = 0;
+  AX_dax__adag_version                 = 153;
+  dax__adag_version_isset              = 0;
+  AX_dax__adag_count                   = 0;
+  dax__adag_count_isset                = 0;
+  AX_dax__adag_index                   = 0;
+  dax__adag_index_isset                = 0;
+  AX_dax__adag_name                    = 0;
+  dax__adag_name_isset                 = 0;
+  AX_dax__adag_jobCount                = 0;
+  dax__adag_jobCount_isset             = 0;
+  AX_dax__adag_fileCount               = 0;
+  dax__adag_fileCount_isset            = 0;
+  AX_dax__adag_childCount              = 0;
+  dax__adag_childCount_isset           = 0;
   ENTER(AL_dax__adag); pushbuffer(0);
   }
        YY_BREAK
@@ -2284,103 +1917,203 @@ YY_RULE_SETUP
 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
+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
 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
+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
 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
+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
 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
+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
 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
+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
 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
+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
 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
+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
 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
+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
 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
+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
 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
+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
 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
+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
 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
+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
 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
+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
 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
+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
 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
+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
 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
+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
 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
+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
 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
+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
 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
+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
 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
+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
 case 38:
 YY_RULE_SETUP
 {
@@ -2429,491 +2162,683 @@ case 44:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</adag>' expected.",yytext[0]);
        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
+case YY_STATE_EOF(S_dax__adag):
+case YY_STATE_EOF(E_dax__adag):
+  FAIL("Premature EOF: `</adag>' expected.");
+  YY_BREAK
 
 case 45:
 /* rule 45 can match eol */
 YY_RULE_SETUP
-FAIL("Starting tag <child> is not allowed here.");
-       YY_BREAK
+FAIL("Starting tag <job> is not allowed here.");
+YY_BREAK
 case 46:
 /* rule 46 can match eol */
 YY_RULE_SETUP
 {
-  AX_dax__child_ref = 0;
-  dax__child_ref_isset = 0;
-  ENTER(AL_dax__child); pushbuffer(0);
+  AX_dax__job_id           = 0;
+  dax__job_id_isset        = 0;
+  AX_dax__job_namespace    = 0;
+  dax__job_namespace_isset = 0;
+  AX_dax__job_name         = 0;
+  dax__job_name_isset      = 0;
+  AX_dax__job_version      = 157;
+  dax__job_version_isset   = 0;
+  AX_dax__job_runtime      = 0;
+  dax__job_runtime_isset   = 0;
+  AX_dax__job_level        = 0;
+  dax__job_level_isset     = 0;
+  ENTER(AL_dax__job);
+  pushbuffer(0);
   }
        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
+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
 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
+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
 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
+  /* rule 49 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
 case 50:
-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; ETag_dax__child(); popbuffer(); /* attribute */
-  switch (YY_START) {
-   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;
+  /* rule 50 can match eol */
+  YY_RULE_SETUP
+  if (dax__job_namespace_isset != 0) {
+    FAIL("Multiple definition of attribute namespace in <dax__job>");
   }
- }
-       YY_BREAK
+  dax__job_namespace_isset = 1;
+  ENTER(VALUE2);
+  BUFFERSET(AX_dax__job_namespace);
+  YY_BREAK
 case 51:
-YY_RULE_SETUP
-FAIL("Unexpected character `%c' in attribute list of child element.", yytext[0]);
-       YY_BREAK
+  /* rule 51 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
 case 52:
-YY_RULE_SETUP
-FAIL("Bad attribute `%s' in `child' element start tag.",yytext);
-       YY_BREAK
-case YY_STATE_EOF(AL_dax__child):
-FAIL("EOF in attribute list of `child' element.");
-       YY_BREAK
-
+  /* rule 52 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
 case 53:
 /* rule 53 can match eol */
 YY_RULE_SETUP
-{
-  LEAVE;
-  ETag_dax__child();
-  popbuffer(); /* attribute */
-  switch (YY_START) {
-   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
+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
 case 54:
 /* rule 54 can match eol */
 YY_RULE_SETUP
-FAIL("Unexpected end-tag `%s': `</child>' expected.",yytext);
-       YY_BREAK
+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
 case 55:
-YY_RULE_SETUP
-FAIL("Unexpected character `%c': `</child>' expected.",yytext[0]);
-       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
-
+  /* rule 55 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
 case 56:
 /* rule 56 can match eol */
 YY_RULE_SETUP
-FAIL("Starting tag <job> is not allowed here.");
-       YY_BREAK
+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
 case 57:
 /* rule 57 can match eol */
 YY_RULE_SETUP
-{
-  AX_dax__job_id = 0;
-  dax__job_id_isset = 0;
-  AX_dax__job_level = 0;
-  dax__job_level_isset = 0;
-  AX_dax__job_name = 0;
-  dax__job_name_isset = 0;
-  AX_dax__job_namespace = 0;
-  dax__job_namespace_isset = 0;
-  AX_dax__job_runtime = 0;
-  dax__job_runtime_isset = 0;
-  AX_dax__job_version = 157;
-  dax__job_version_isset = 0;
-  ENTER(AL_dax__job); pushbuffer(0);
-  }
-       YY_BREAK
-
+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
 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
+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
 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
+{
+  if (!AX_dax__job_id)
+    FAIL("Required attribute `id' not set for `job' element.");
+  if (!AX_dax__job_name)
+    FAIL("Required attribute `name' not set for `job' element.");
+  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
 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
+{
+  if (!AX_dax__job_id)
+    FAIL("Required attribute `id' not set for `job' element.");
+  if (!AX_dax__job_name)
+    FAIL("Required attribute `name' not set for `job' element.");
+  if (!AX_dax__job_runtime)
+    FAIL("Required attribute `runtime' not set for `job' element.");
+  LEAVE;
+  STag_dax__job();
+  dax__pcdata_ix = 0;
+  ETag_dax__job();
+  popbuffer(); /* attribute */
+  switch (YY_START) {
+    case S_dax__adag:
+    case S_dax__adag_2:
+    case S_dax__adag_3:
+      SET(S_dax__adag_3);
+      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
+FAIL("Unexpected character `%c' in attribute list of job element.", yytext[0]);
+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
+FAIL("Bad attribute `%s' in `job' element start tag.", yytext);
+YY_BREAK
+case YY_STATE_EOF(AL_dax__job):
+  FAIL("EOF in attribute list of `job' element.");
+  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
+{
+  LEAVE;
+  ETag_dax__job();
+  popbuffer(); /* attribute */
+  switch (YY_START) {
+    case S_dax__adag:
+    case S_dax__adag_2:
+    case S_dax__adag_3:
+      SET(S_dax__adag_3);
+      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
+FAIL("Unexpected end-tag `%s': `</job>' expected.", yytext);
+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
+FAIL("Unexpected character `%c': `</job>' expected.", yytext[0]);
+YY_BREAK
+case YY_STATE_EOF(S_dax__job_2):
+case YY_STATE_EOF(S_dax__job):
+case YY_STATE_EOF(E_dax__job):
+  FAIL("Premature EOF: `</job>' expected.");
+  YY_BREAK
+
+/* <!-- ignored -->
+ * <!-- ignored -->  */
 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
+FAIL("Starting tag <uses> is not allowed here.");
+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
+{
+  AX_dax__uses_file        = 0;
+  dax__uses_file_isset     = 0;
+  AX_dax__uses_link        = AU_dax__uses_link;
+  dax__uses_link_isset     = 0;
+  AX_dax__uses_register    = A_dax__uses_register_true;
+  dax__uses_register_isset = 0;
+  AX_dax__uses_transfer    = A_dax__uses_transfer_true;
+  dax__uses_transfer_isset = 0;
+  AX_dax__uses_optional    = A_dax__uses_optional_false;
+  dax__uses_optional_isset = 0;
+  AX_dax__uses_type        = 161;
+  dax__uses_type_isset     = 0;
+  AX_dax__uses_size        = 0;
+  dax__uses_size_isset     = 0;
+  ENTER(AL_dax__uses);
+  pushbuffer(0);
+}
+        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
+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
 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
+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
 case 70:
-YY_RULE_SETUP
-{
-  if (!AX_dax__job_id) FAIL("Required attribute `id' not set for `job' element.");
-  if (!AX_dax__job_name) FAIL("Required attribute `name' not set for `job' element.");
-  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
+/* rule 70 can match eol */
 case 71:
-YY_RULE_SETUP
-{
-  if (!AX_dax__job_id) FAIL("Required attribute `id' not set for `job' element.");
-  if (!AX_dax__job_name) FAIL("Required attribute `name' not set for `job' element.");
-  if (!AX_dax__job_runtime) FAIL("Required attribute `runtime' not set for `job' element.");
-  LEAVE; STag_dax__job(); dax__pcdata_ix = 0; ETag_dax__job(); popbuffer(); /* attribute */
-  switch (YY_START) {
-   case S_dax__adag: case S_dax__adag_2: case S_dax__adag_3: SET(S_dax__adag_3); break;
-  }
- }
-       YY_BREAK
+  /* rule 71 can match eol */
+  YY_RULE_SETUP
+  A_dax__uses_link = A_dax__uses_link_input;
+  YY_BREAK
 case 72:
-YY_RULE_SETUP
-FAIL("Unexpected character `%c' in attribute list of job element.", yytext[0]);
-       YY_BREAK
+/* rule 72 can match eol */
 case 73:
-YY_RULE_SETUP
-FAIL("Bad attribute `%s' in `job' element start tag.",yytext);
-       YY_BREAK
-case YY_STATE_EOF(AL_dax__job):
-FAIL("EOF in attribute list of `job' element.");
-       YY_BREAK
-
+  /* rule 73 can match eol */
+  YY_RULE_SETUP
+  A_dax__uses_link = A_dax__uses_link_output;
+  YY_BREAK
 case 74:
 /* rule 74 can match eol */
-YY_RULE_SETUP
-{
-  LEAVE;
-  ETag_dax__job();
-  popbuffer(); /* attribute */
-  switch (YY_START) {
-   case S_dax__adag: case S_dax__adag_2: case S_dax__adag_3: SET(S_dax__adag_3); break;
-  }
- }
-       YY_BREAK
 case 75:
 /* rule 75 can match eol */
 YY_RULE_SETUP
-FAIL("Unexpected end-tag `%s': `</job>' expected.",yytext);
-       YY_BREAK
+A_dax__uses_register = A_dax__uses_register_false;
+YY_BREAK
 case 76:
-YY_RULE_SETUP
-FAIL("Unexpected character `%c': `</job>' expected.",yytext[0]);
-       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
-
+/* rule 76 can match eol */
 case 77:
 /* rule 77 can match eol */
 YY_RULE_SETUP
-FAIL("Starting tag <parent> is not allowed here.");
-       YY_BREAK
+A_dax__uses_register = A_dax__uses_register_true;
+YY_BREAK
 case 78:
 /* rule 78 can match eol */
-YY_RULE_SETUP
-{
-  AX_dax__parent_ref = 0;
-  dax__parent_ref_isset = 0;
-  ENTER(AL_dax__parent); pushbuffer(0);
-  }
-       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
+A_dax__uses_transfer = A_dax__uses_transfer_false;
+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
 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
+  /* rule 81 can match eol */
+  YY_RULE_SETUP
+  A_dax__uses_transfer = A_dax__uses_transfer_true;
+  YY_BREAK
 case 82:
-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; ETag_dax__parent(); popbuffer(); /* attribute */
-  switch (YY_START) {
-   case S_dax__child: case S_dax__child_1: case S_dax__child_2: SET(S_dax__child_2); break;
-  }
- }
-       YY_BREAK
+/* rule 82 can match eol */
 case 83:
-YY_RULE_SETUP
-FAIL("Unexpected character `%c' in attribute list of parent element.", yytext[0]);
-       YY_BREAK
+  /* rule 83 can match eol */
+  YY_RULE_SETUP
+  A_dax__uses_optional = A_dax__uses_optional_false;
+  YY_BREAK
 case 84:
-YY_RULE_SETUP
-FAIL("Bad attribute `%s' in `parent' element start tag.",yytext);
-       YY_BREAK
-case YY_STATE_EOF(AL_dax__parent):
-FAIL("EOF in attribute list of `parent' element.");
-       YY_BREAK
-
+/* rule 84 can match eol */
 case 85:
 /* rule 85 can match eol */
 YY_RULE_SETUP
-{
-  LEAVE;
-  ETag_dax__parent();
-  popbuffer(); /* attribute */
-  switch (YY_START) {
-   case S_dax__child: case S_dax__child_1: case S_dax__child_2: SET(S_dax__child_2); break;
-  }
- }
-       YY_BREAK
+A_dax__uses_optional = A_dax__uses_optional_true;
+YY_BREAK
 case 86:
 /* rule 86 can match eol */
 YY_RULE_SETUP
-FAIL("Unexpected end-tag `%s': `</parent>' expected.",yytext);
-       YY_BREAK
+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
 case 87:
-YY_RULE_SETUP
-FAIL("Unexpected character `%c': `</parent>' expected.",yytext[0]);
-       YY_BREAK
-case YY_STATE_EOF(E_dax__parent):
-FAIL("Premature EOF: `</parent>' expected.");
-       YY_BREAK
-
-/* <!-- ignored -->
-  * <!-- ignored -->  */
+  /* rule 87 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
 case 88:
 /* rule 88 can match eol */
 YY_RULE_SETUP
-FAIL("Starting tag <uses> is not allowed here.");
-       YY_BREAK
+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
 case 89:
 /* rule 89 can match eol */
 YY_RULE_SETUP
-{
-  AX_dax__uses_file = 0;
-  dax__uses_file_isset = 0;
-  AX_dax__uses_link = AU_dax__uses_link;
-  dax__uses_link_isset = 0;
-  AX_dax__uses_optional = A_dax__uses_optional_false;
-  dax__uses_optional_isset = 0;
-  AX_dax__uses_register = A_dax__uses_register_true;
-  dax__uses_register_isset = 0;
-  AX_dax__uses_size = 0;
-  dax__uses_size_isset = 0;
-  AX_dax__uses_transfer = A_dax__uses_transfer_true;
-  dax__uses_transfer_isset = 0;
-  AX_dax__uses_type = 161;
-  dax__uses_type_isset = 0;
-  ENTER(AL_dax__uses); pushbuffer(0);
-  }
-       YY_BREAK
-
+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
 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
+{
+  if (!AX_dax__uses_file)
+    FAIL("Required attribute `file' not set for `uses' element.");
+  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
 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
+{
+  if (!AX_dax__uses_file)
+    FAIL("Required attribute `file' not set for `uses' element.");
+  if (!AX_dax__uses_size)
+    FAIL("Required attribute `size' not set for `uses' element.");
+  LEAVE;
+  STag_dax__uses();
+  dax__pcdata_ix = 0;
+  ETag_dax__uses();
+  popbuffer(); /* attribute */
+  switch (YY_START) {
+    case S_dax__job_1:
+    case S_dax__job_2:
+    case S_dax__job:
+      SET(S_dax__job_2);
+      break;
+  }
+}
+        YY_BREAK
 case 92:
-/* rule 92 can match eol */
+  YY_RULE_SETUP
+  FAIL("Unexpected character `%c' in attribute list of uses element.", yytext[0]);
+  YY_BREAK
 case 93:
-/* rule 93 can match eol */
 YY_RULE_SETUP
-A_dax__uses_link = A_dax__uses_link_input;
-       YY_BREAK
+FAIL("Bad attribute `%s' in `uses' element start tag.", yytext);
+YY_BREAK
+case YY_STATE_EOF(AL_dax__uses):
+  FAIL("EOF in attribute list of `uses' element.");
+  YY_BREAK
+
 case 94:
 /* rule 94 can match eol */
+YY_RULE_SETUP
+{
+  LEAVE;
+  ETag_dax__uses();
+  popbuffer(); /* attribute */
+  switch (YY_START) {
+    case S_dax__job_1:
+    case S_dax__job_2:
+    case S_dax__job:
+      SET(S_dax__job_2);
+      break;
+  }
+}
+YY_BREAK
 case 95:
 /* rule 95 can match eol */
 YY_RULE_SETUP
-A_dax__uses_link = A_dax__uses_link_output;
-       YY_BREAK
+FAIL("Unexpected end-tag `%s': `</uses>' expected.", yytext);
+YY_BREAK
 case 96:
-/* rule 96 can match eol */
+  YY_RULE_SETUP
+  FAIL("Unexpected character `%c': `</uses>' expected.", yytext[0]);
+  YY_BREAK
+case YY_STATE_EOF(E_dax__uses):
+  FAIL("Premature EOF: `</uses>' expected.");
+  YY_BREAK
+
 case 97:
 /* rule 97 can match eol */
 YY_RULE_SETUP
-A_dax__uses_optional = A_dax__uses_optional_false;
-       YY_BREAK
+FAIL("Starting tag <child> is not allowed here.");
+YY_BREAK
 case 98:
 /* rule 98 can match eol */
+YY_RULE_SETUP
+{
+  AX_dax__child_ref    = 0;
+  dax__child_ref_isset = 0;
+  ENTER(AL_dax__child);
+  pushbuffer(0);
+}
+YY_BREAK
+
 case 99:
 /* rule 99 can match eol */
 YY_RULE_SETUP
-A_dax__uses_optional = A_dax__uses_optional_true;
-       YY_BREAK
+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
 case 100:
 /* rule 100 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
 case 101:
-/* rule 101 can match eol */
 YY_RULE_SETUP
-A_dax__uses_register = A_dax__uses_register_false;
-       YY_BREAK
+{
+  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
 case 102:
-/* rule 102 can match eol */
+  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;
+    ETag_dax__child();
+    popbuffer(); /* attribute */
+    switch (YY_START) {
+      case S_dax__adag_1:
+      case S_dax__adag_3:
+      case S_dax__adag_4:
+      case S_dax__adag:
+      case S_dax__adag_5:
+        SET(S_dax__adag_5);
+        break;
+    }
+  }
+  YY_BREAK
 case 103:
-/* rule 103 can match eol */
 YY_RULE_SETUP
-A_dax__uses_register = A_dax__uses_register_true;
-       YY_BREAK
+FAIL("Unexpected character `%c' in attribute list of child element.", yytext[0]);
+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
+FAIL("Bad attribute `%s' in `child' element start tag.", yytext);
+YY_BREAK
+case YY_STATE_EOF(AL_dax__child):
+  FAIL("EOF in attribute list of `child' element.");
+  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
+{
+  LEAVE;
+  ETag_dax__child();
+  popbuffer(); /* attribute */
+  switch (YY_START) {
+    case S_dax__adag_1:
+    case S_dax__adag_3:
+    case S_dax__adag_4:
+    case S_dax__adag:
+    case S_dax__adag_5:
+      SET(S_dax__adag_5);
+      break;
+  }
+}
+        YY_BREAK
 case 106:
 /* rule 106 can match eol */
+YY_RULE_SETUP
+FAIL("Unexpected end-tag `%s': `</child>' expected.", yytext);
+YY_BREAK
 case 107:
-/* rule 107 can match eol */
 YY_RULE_SETUP
-A_dax__uses_transfer = A_dax__uses_transfer_false;
-       YY_BREAK
+FAIL("Unexpected character `%c': `</child>' expected.", yytext[0]);
+YY_BREAK
+case YY_STATE_EOF(S_dax__child_2):
+case YY_STATE_EOF(S_dax__child):
+case YY_STATE_EOF(E_dax__child):
+  FAIL("Premature EOF: `</child>' expected.");
+  YY_BREAK
+
 case 108:
 /* rule 108 can match eol */
+YY_RULE_SETUP
+FAIL("Starting tag <parent> is not allowed here.");
+YY_BREAK
 case 109:
 /* rule 109 can match eol */
 YY_RULE_SETUP
-A_dax__uses_transfer = A_dax__uses_transfer_true;
-       YY_BREAK
+{
+  AX_dax__parent_ref    = 0;
+  dax__parent_ref_isset = 0;
+  ENTER(AL_dax__parent);
+  pushbuffer(0);
+}
+        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
+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
 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
+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
 case 112:
 YY_RULE_SETUP
 {
-  if (!AX_dax__uses_file) FAIL("Required attribute `file' not set for `uses' element.");
-  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);
+  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
 case 113:
 YY_RULE_SETUP
 {
-  if (!AX_dax__uses_file) FAIL("Required attribute `file' not set for `uses' element.");
-  if (!AX_dax__uses_size) FAIL("Required attribute `size' not set for `uses' element.");
-  LEAVE; STag_dax__uses(); dax__pcdata_ix = 0; ETag_dax__uses(); popbuffer(); /* attribute */
+  if (!AX_dax__parent_ref)
+    FAIL("Required attribute `ref' not set for `parent' element.");
+  LEAVE;
+  STag_dax__parent();
+  dax__pcdata_ix = 0;
+  ETag_dax__parent();
+  popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_dax__job: case S_dax__job_1: case S_dax__job_2: SET(S_dax__job_2); break;
+    case S_dax__child:
+    case S_dax__child_1:
+    case S_dax__child_2:
+      SET(S_dax__child_2);
+      break;
   }
  }
        YY_BREAK
 case 114:
 YY_RULE_SETUP
-FAIL("Unexpected character `%c' in attribute list of uses element.", yytext[0]);
-       YY_BREAK
+FAIL("Unexpected character `%c' in attribute list of parent element.", yytext[0]);
+YY_BREAK
 case 115:
 YY_RULE_SETUP
-FAIL("Bad attribute `%s' in `uses' element start tag.",yytext);
-       YY_BREAK
-case YY_STATE_EOF(AL_dax__uses):
-FAIL("EOF in attribute list of `uses' element.");
-       YY_BREAK
+FAIL("Bad attribute `%s' in `parent' element start tag.", yytext);
+YY_BREAK
+case YY_STATE_EOF(AL_dax__parent):
+  FAIL("EOF in attribute list of `parent' element.");
+  YY_BREAK
 
 case 116:
 /* rule 116 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
-  ETag_dax__uses();
+  ETag_dax__parent();
   popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_dax__job: case S_dax__job_1: case S_dax__job_2: SET(S_dax__job_2); break;
+    case S_dax__child:
+    case S_dax__child_1:
+    case S_dax__child_2:
+      SET(S_dax__child_2);
+      break;
   }
  }
        YY_BREAK
 case 117:
 /* rule 117 can match eol */
 YY_RULE_SETUP
-FAIL("Unexpected end-tag `%s': `</uses>' expected.",yytext);
-       YY_BREAK
+FAIL("Unexpected end-tag `%s': `</parent>' expected.", yytext);
+YY_BREAK
 case 118:
 YY_RULE_SETUP
-FAIL("Unexpected character `%c': `</uses>' expected.",yytext[0]);
-       YY_BREAK
-case YY_STATE_EOF(E_dax__uses):
-FAIL("Premature EOF: `</uses>' expected.");
-       YY_BREAK
+FAIL("Unexpected character `%c': `</parent>' expected.", yytext[0]);
+YY_BREAK
+case YY_STATE_EOF(E_dax__parent):
+  FAIL("Premature EOF: `</parent>' expected.");
+  YY_BREAK
 
-/* EPILOG: after the root element. */
+  /* EPILOG: after the root element. */
 
 case 119:
 YY_RULE_SETUP
@@ -3034,8 +2959,8 @@ case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(ROOT_dax__adag):
 case YY_STATE_EOF(S_dax__adag_2):
 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(S_dax__child_1):
 case YY_STATE_EOF(IMPOSSIBLE):
        yyterminate();
 
@@ -4125,13 +4050,9 @@ static int fail(const char* fmt, ...)
     int chars_left, used;
     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): ",
-                  yylineno, YY_START);
+    used = sprintf(flexml_err_msg, "Invalid XML (XML input line %d, state %d): ", yylineno, YY_START);
 #else
-    used = snprintf(flexml_err_msg,flexml_max_err_msg_size,
-                  "Invalid XML (state %d): ",
-                  YY_START);
+    used  = sprintf(flexml_err_msg, "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 1d218f1..bf09b13 100644 (file)
 /* XML application entry points. */
 XBT_PUBLIC void STag_dax__adag(void);
 XBT_PUBLIC void ETag_dax__adag(void);
-XBT_PUBLIC void STag_dax__child(void);
-XBT_PUBLIC void ETag_dax__child(void);
 XBT_PUBLIC void STag_dax__job(void);
 XBT_PUBLIC void ETag_dax__job(void);
-XBT_PUBLIC void STag_dax__parent(void);
-XBT_PUBLIC void ETag_dax__parent(void);
 XBT_PUBLIC void STag_dax__uses(void);
 XBT_PUBLIC void ETag_dax__uses(void);
+XBT_PUBLIC void STag_dax__child(void);
+XBT_PUBLIC void ETag_dax__child(void);
+XBT_PUBLIC void STag_dax__parent(void);
+XBT_PUBLIC void ETag_dax__parent(void);
 
 /* XML application data. */
-typedef int AT_dax__adag_childCount;
-#define AU_dax__adag_childCount NULL
-typedef int AT_dax__adag_count;
-#define AU_dax__adag_count NULL
-typedef int AT_dax__adag_fileCount;
-#define AU_dax__adag_fileCount NULL
-typedef int AT_dax__adag_index;
-#define AU_dax__adag_index NULL
-typedef int AT_dax__adag_jobCount;
-#define AU_dax__adag_jobCount NULL
+typedef int AT_dax__uses_size;
+#define AU_dax__uses_size NULL
+typedef int AT_dax__job_level;
+#define AU_dax__job_level NULL
 typedef int AT_dax__adag_name;
 #define AU_dax__adag_name NULL
+typedef int AT_dax__adag_jobCount;
+#define AU_dax__adag_jobCount NULL
+typedef int AT_dax__adag_count;
+#define AU_dax__adag_count NULL
+typedef int AT_dax__job_namespace;
+#define AU_dax__job_namespace NULL
 typedef int AT_dax__adag_version;
 #define AU_dax__adag_version NULL
-typedef int AT_dax__adag_xmlns;
-#define AU_dax__adag_xmlns NULL
+typedef enum { AU_dax__uses_optional, A_dax__uses_optional_false, A_dax__uses_optional_true } AT_dax__uses_optional;
 typedef int AT_dax__adag_xmlns_c_xsi;
 #define AU_dax__adag_xmlns_c_xsi NULL
-typedef int AT_dax__adag_xsi_c_schemaLocation;
-#define AU_dax__adag_xsi_c_schemaLocation NULL
+typedef int AT_dax__adag_fileCount;
+#define AU_dax__adag_fileCount NULL
+typedef int AT_dax__uses_file;
+#define AU_dax__uses_file NULL
+typedef int AT_dax__job_version;
+#define AU_dax__job_version NULL
+typedef int AT_dax__parent_ref;
+#define AU_dax__parent_ref NULL
+typedef int AT_dax__adag_xmlns;
+#define AU_dax__adag_xmlns NULL
+typedef int AT_dax__uses_type;
+#define AU_dax__uses_type NULL
+typedef enum { AU_dax__uses_register, A_dax__uses_register_false, A_dax__uses_register_true } AT_dax__uses_register;
+typedef enum { AU_dax__uses_link, A_dax__uses_link_input, A_dax__uses_link_output } AT_dax__uses_link;
+typedef int AT_dax__adag_childCount;
+#define AU_dax__adag_childCount NULL
 typedef int AT_dax__child_ref;
 #define AU_dax__child_ref NULL
+typedef enum { AU_dax__uses_transfer, A_dax__uses_transfer_false, A_dax__uses_transfer_true } AT_dax__uses_transfer;
+typedef int AT_dax__adag_xsi_c_schemaLocation;
+#define AU_dax__adag_xsi_c_schemaLocation NULL
 typedef int AT_dax__job_id;
 #define AU_dax__job_id NULL
-typedef int AT_dax__job_level;
-#define AU_dax__job_level NULL
 typedef int AT_dax__job_name;
 #define AU_dax__job_name NULL
-typedef int AT_dax__job_namespace;
-#define AU_dax__job_namespace NULL
 typedef int AT_dax__job_runtime;
 #define AU_dax__job_runtime NULL
-typedef int AT_dax__job_version;
-#define AU_dax__job_version NULL
-typedef int AT_dax__parent_ref;
-#define AU_dax__parent_ref NULL
-typedef int AT_dax__uses_file;
-#define AU_dax__uses_file NULL
-typedef enum { AU_dax__uses_link, A_dax__uses_link_input,A_dax__uses_link_output } AT_dax__uses_link;
-typedef enum { AU_dax__uses_optional, A_dax__uses_optional_false,A_dax__uses_optional_true } AT_dax__uses_optional;
-typedef enum { AU_dax__uses_register, A_dax__uses_register_false,A_dax__uses_register_true } AT_dax__uses_register;
-typedef int AT_dax__uses_size;
-#define AU_dax__uses_size NULL
-typedef enum { AU_dax__uses_transfer, A_dax__uses_transfer_false,A_dax__uses_transfer_true } AT_dax__uses_transfer;
-typedef int AT_dax__uses_type;
-#define AU_dax__uses_type NULL
+typedef int AT_dax__adag_index;
+#define AU_dax__adag_index NULL
 
 /* FleXML-provided data. */
 XBT_PUBLIC_DATA int dax__pcdata_ix;
 XBT_PUBLIC_DATA char *dax__bufferstack;
 #define dax__pcdata (dax__bufferstack + dax__pcdata_ix)
-XBT_PUBLIC_DATA AT_dax__adag_childCount AX_dax__adag_childCount;
-#define A_dax__adag_childCount (dax__bufferstack + AX_dax__adag_childCount)
-XBT_PUBLIC_DATA short int dax__adag_childCount_isset;
-XBT_PUBLIC_DATA AT_dax__adag_count AX_dax__adag_count;
-#define A_dax__adag_count (dax__bufferstack + AX_dax__adag_count)
-XBT_PUBLIC_DATA short int dax__adag_count_isset;
-XBT_PUBLIC_DATA AT_dax__adag_fileCount AX_dax__adag_fileCount;
-#define A_dax__adag_fileCount (dax__bufferstack + AX_dax__adag_fileCount)
-XBT_PUBLIC_DATA short int dax__adag_fileCount_isset;
-XBT_PUBLIC_DATA AT_dax__adag_index AX_dax__adag_index;
-#define A_dax__adag_index (dax__bufferstack + AX_dax__adag_index)
-XBT_PUBLIC_DATA short int dax__adag_index_isset;
-XBT_PUBLIC_DATA AT_dax__adag_jobCount AX_dax__adag_jobCount;
-#define A_dax__adag_jobCount (dax__bufferstack + AX_dax__adag_jobCount)
-XBT_PUBLIC_DATA short int dax__adag_jobCount_isset;
+XBT_PUBLIC_DATA AT_dax__uses_size AX_dax__uses_size;
+#define A_dax__uses_size (dax__bufferstack + AX_dax__uses_size)
+XBT_PUBLIC_DATA short int dax__uses_size_isset;
+XBT_PUBLIC_DATA AT_dax__job_level AX_dax__job_level;
+#define A_dax__job_level (dax__bufferstack + AX_dax__job_level)
+XBT_PUBLIC_DATA short int dax__job_level_isset;
 XBT_PUBLIC_DATA AT_dax__adag_name AX_dax__adag_name;
 #define A_dax__adag_name (dax__bufferstack + AX_dax__adag_name)
 XBT_PUBLIC_DATA short int dax__adag_name_isset;
+XBT_PUBLIC_DATA AT_dax__adag_jobCount AX_dax__adag_jobCount;
+#define A_dax__adag_jobCount (dax__bufferstack + AX_dax__adag_jobCount)
+XBT_PUBLIC_DATA short int dax__adag_jobCount_isset;
+XBT_PUBLIC_DATA AT_dax__adag_count AX_dax__adag_count;
+#define A_dax__adag_count (dax__bufferstack + AX_dax__adag_count)
+XBT_PUBLIC_DATA short int dax__adag_count_isset;
+XBT_PUBLIC_DATA AT_dax__job_namespace AX_dax__job_namespace;
+#define A_dax__job_namespace (dax__bufferstack + AX_dax__job_namespace)
+XBT_PUBLIC_DATA short int dax__job_namespace_isset;
 XBT_PUBLIC_DATA AT_dax__adag_version AX_dax__adag_version;
 #define A_dax__adag_version (dax__bufferstack + AX_dax__adag_version)
 XBT_PUBLIC_DATA short int dax__adag_version_isset;
-XBT_PUBLIC_DATA AT_dax__adag_xmlns AX_dax__adag_xmlns;
-#define A_dax__adag_xmlns (dax__bufferstack + AX_dax__adag_xmlns)
-XBT_PUBLIC_DATA short int dax__adag_xmlns_isset;
+XBT_PUBLIC_DATA AT_dax__uses_optional AX_dax__uses_optional;
+#define A_dax__uses_optional AX_dax__uses_optional
+XBT_PUBLIC_DATA short int dax__uses_optional_isset;
 XBT_PUBLIC_DATA AT_dax__adag_xmlns_c_xsi AX_dax__adag_xmlns_c_xsi;
 #define A_dax__adag_xmlns_c_xsi (dax__bufferstack + AX_dax__adag_xmlns_c_xsi)
 XBT_PUBLIC_DATA short int dax__adag_xmlns_c_xsi_isset;
-XBT_PUBLIC_DATA AT_dax__adag_xsi_c_schemaLocation AX_dax__adag_xsi_c_schemaLocation;
-#define A_dax__adag_xsi_c_schemaLocation (dax__bufferstack + AX_dax__adag_xsi_c_schemaLocation)
-XBT_PUBLIC_DATA short int dax__adag_xsi_c_schemaLocation_isset;
-XBT_PUBLIC_DATA AT_dax__child_ref AX_dax__child_ref;
-#define A_dax__child_ref (dax__bufferstack + AX_dax__child_ref)
-XBT_PUBLIC_DATA short int dax__child_ref_isset;
-XBT_PUBLIC_DATA AT_dax__job_id AX_dax__job_id;
-#define A_dax__job_id (dax__bufferstack + AX_dax__job_id)
-XBT_PUBLIC_DATA short int dax__job_id_isset;
-XBT_PUBLIC_DATA AT_dax__job_level AX_dax__job_level;
-#define A_dax__job_level (dax__bufferstack + AX_dax__job_level)
-XBT_PUBLIC_DATA short int dax__job_level_isset;
-XBT_PUBLIC_DATA AT_dax__job_name AX_dax__job_name;
-#define A_dax__job_name (dax__bufferstack + AX_dax__job_name)
-XBT_PUBLIC_DATA short int dax__job_name_isset;
-XBT_PUBLIC_DATA AT_dax__job_namespace AX_dax__job_namespace;
-#define A_dax__job_namespace (dax__bufferstack + AX_dax__job_namespace)
-XBT_PUBLIC_DATA short int dax__job_namespace_isset;
-XBT_PUBLIC_DATA AT_dax__job_runtime AX_dax__job_runtime;
-#define A_dax__job_runtime (dax__bufferstack + AX_dax__job_runtime)
-XBT_PUBLIC_DATA short int dax__job_runtime_isset;
+XBT_PUBLIC_DATA AT_dax__adag_fileCount AX_dax__adag_fileCount;
+#define A_dax__adag_fileCount (dax__bufferstack + AX_dax__adag_fileCount)
+XBT_PUBLIC_DATA short int dax__adag_fileCount_isset;
+XBT_PUBLIC_DATA AT_dax__uses_file AX_dax__uses_file;
+#define A_dax__uses_file (dax__bufferstack + AX_dax__uses_file)
+XBT_PUBLIC_DATA short int dax__uses_file_isset;
 XBT_PUBLIC_DATA AT_dax__job_version AX_dax__job_version;
 #define A_dax__job_version (dax__bufferstack + AX_dax__job_version)
 XBT_PUBLIC_DATA short int dax__job_version_isset;
 XBT_PUBLIC_DATA AT_dax__parent_ref AX_dax__parent_ref;
 #define A_dax__parent_ref (dax__bufferstack + AX_dax__parent_ref)
 XBT_PUBLIC_DATA short int dax__parent_ref_isset;
-XBT_PUBLIC_DATA AT_dax__uses_file AX_dax__uses_file;
-#define A_dax__uses_file (dax__bufferstack + AX_dax__uses_file)
-XBT_PUBLIC_DATA short int dax__uses_file_isset;
-XBT_PUBLIC_DATA AT_dax__uses_link AX_dax__uses_link;
-#define A_dax__uses_link AX_dax__uses_link
-XBT_PUBLIC_DATA short int dax__uses_link_isset;
-XBT_PUBLIC_DATA AT_dax__uses_optional AX_dax__uses_optional;
-#define A_dax__uses_optional AX_dax__uses_optional
-XBT_PUBLIC_DATA short int dax__uses_optional_isset;
+XBT_PUBLIC_DATA AT_dax__adag_xmlns AX_dax__adag_xmlns;
+#define A_dax__adag_xmlns (dax__bufferstack + AX_dax__adag_xmlns)
+XBT_PUBLIC_DATA short int dax__adag_xmlns_isset;
+XBT_PUBLIC_DATA AT_dax__uses_type AX_dax__uses_type;
+#define A_dax__uses_type (dax__bufferstack + AX_dax__uses_type)
+XBT_PUBLIC_DATA short int dax__uses_type_isset;
 XBT_PUBLIC_DATA AT_dax__uses_register AX_dax__uses_register;
 #define A_dax__uses_register AX_dax__uses_register
 XBT_PUBLIC_DATA short int dax__uses_register_isset;
-XBT_PUBLIC_DATA AT_dax__uses_size AX_dax__uses_size;
-#define A_dax__uses_size (dax__bufferstack + AX_dax__uses_size)
-XBT_PUBLIC_DATA short int dax__uses_size_isset;
+XBT_PUBLIC_DATA AT_dax__uses_link AX_dax__uses_link;
+#define A_dax__uses_link AX_dax__uses_link
+XBT_PUBLIC_DATA short int dax__uses_link_isset;
+XBT_PUBLIC_DATA AT_dax__adag_childCount AX_dax__adag_childCount;
+#define A_dax__adag_childCount (dax__bufferstack + AX_dax__adag_childCount)
+XBT_PUBLIC_DATA short int dax__adag_childCount_isset;
+XBT_PUBLIC_DATA AT_dax__child_ref AX_dax__child_ref;
+#define A_dax__child_ref (dax__bufferstack + AX_dax__child_ref)
+XBT_PUBLIC_DATA short int dax__child_ref_isset;
 XBT_PUBLIC_DATA AT_dax__uses_transfer AX_dax__uses_transfer;
 #define A_dax__uses_transfer AX_dax__uses_transfer
 XBT_PUBLIC_DATA short int dax__uses_transfer_isset;
-XBT_PUBLIC_DATA AT_dax__uses_type AX_dax__uses_type;
-#define A_dax__uses_type (dax__bufferstack + AX_dax__uses_type)
-XBT_PUBLIC_DATA short int dax__uses_type_isset;
+XBT_PUBLIC_DATA AT_dax__adag_xsi_c_schemaLocation AX_dax__adag_xsi_c_schemaLocation;
+#define A_dax__adag_xsi_c_schemaLocation (dax__bufferstack + AX_dax__adag_xsi_c_schemaLocation)
+XBT_PUBLIC_DATA short int dax__adag_xsi_c_schemaLocation_isset;
+XBT_PUBLIC_DATA AT_dax__job_id AX_dax__job_id;
+#define A_dax__job_id (dax__bufferstack + AX_dax__job_id)
+XBT_PUBLIC_DATA short int dax__job_id_isset;
+XBT_PUBLIC_DATA AT_dax__job_name AX_dax__job_name;
+#define A_dax__job_name (dax__bufferstack + AX_dax__job_name)
+XBT_PUBLIC_DATA short int dax__job_name_isset;
+XBT_PUBLIC_DATA AT_dax__job_runtime AX_dax__job_runtime;
+#define A_dax__job_runtime (dax__bufferstack + AX_dax__job_runtime)
+XBT_PUBLIC_DATA short int dax__job_runtime_isset;
+XBT_PUBLIC_DATA AT_dax__adag_index AX_dax__adag_index;
+#define A_dax__adag_index (dax__bufferstack + AX_dax__adag_index)
+XBT_PUBLIC_DATA short int dax__adag_index_isset;
 
 /* XML application utilities. */
 XBT_PUBLIC int dax__element_context(int);
index 54baf37..5872efa 100644 (file)
@@ -11,6 +11,7 @@
 #include "xbt/misc.h"
 #include <algorithm>
 #include <map>
+#include <stdexcept>
 
 #include "dax_dtd.h"
 #include "dax_dtd.c"
@@ -237,7 +238,7 @@ void STag_dax__adag()
   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) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Parse error: ") + A_dax__adag_version + " is not a double");
   }
 }
@@ -253,7 +254,7 @@ void STag_dax__job()
     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) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Parse error: ") + A_dax__job_runtime + " is not a double");
   }
 }
@@ -263,7 +264,7 @@ void STag_dax__uses()
   double size;
   try {
     size = std::stod(std::string(A_dax__uses_size));
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     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);
@@ -273,7 +274,7 @@ void STag_dax__uses()
   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);
+    sd_global->initial_tasks.erase(file);
     files[A_dax__uses_file] = file;
   } else {
     file = it->second;
index bc5f199..a862ecc 100644 (file)
@@ -17,30 +17,16 @@ simgrid::sd::Global *sd_global = nullptr;
 
 namespace simgrid{
 namespace sd{
-Global::Global(){
-  watch_point_reached = false;
-  initial_tasks = new std::set<SD_task_t>();
-  runnable_tasks = new std::set<SD_task_t>();
-  completed_tasks = new std::set<SD_task_t>();
-  return_set = new std::set<SD_task_t>();
-}
-
-Global::~Global(){
-  delete initial_tasks;
-  delete runnable_tasks;
-  delete completed_tasks;
-  delete return_set;
-}
 
 std::set<SD_task_t>* simulate(double how_long){
   XBT_VERB("Run simulation for %f seconds", how_long);
 
   sd_global->watch_point_reached = false;
-  sd_global->return_set->clear();
+  sd_global->return_set.clear();
 
   /* explore the runnable tasks */
-  while (not sd_global->runnable_tasks->empty())
-    SD_task_run(*(sd_global->runnable_tasks->begin()));
+  while (not sd_global->runnable_tasks.empty())
+    SD_task_run(*(sd_global->runnable_tasks.begin()));
 
   double elapsed_time = 0.0;
   double total_time = 0.0;
@@ -64,8 +50,8 @@ std::set<SD_task_t>* simulate(double how_long){
         SD_task_set_state(task, SD_DONE);
 
         /* the state has changed. Add it only if it's the first change */
-        if (sd_global->return_set->find(task) == sd_global->return_set->end())
-          sd_global->return_set->insert(task);
+        if (sd_global->return_set.find(task) == sd_global->return_set.end())
+          sd_global->return_set.insert(task);
 
         /* remove the dependencies after this task */
         for (auto const& succ : *task->successors) {
@@ -112,15 +98,15 @@ std::set<SD_task_t>* simulate(double how_long){
         SD_task_t task = static_cast<SD_task_t>(action->get_data());
         XBT_VERB("Task '%s' failed", SD_task_get_name(task));
         SD_task_set_state(task, SD_FAILED);
-        sd_global->return_set->insert(task);
+        sd_global->return_set.insert(task);
         action = model->extract_failed_action();
       }
     }
   }
 
-  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 (auto const& t : *sd_global->initial_tasks)
+  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 (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)));
   }
 
@@ -128,7 +114,7 @@ std::set<SD_task_t>* simulate(double how_long){
              elapsed_time, total_time, sd_global->watch_point_reached);
   XBT_DEBUG("current time = %f", surf_get_clock());
 
-  return sd_global->return_set;
+  return &sd_global->return_set;
 }
 }
 }
@@ -157,16 +143,13 @@ void SD_init_nocheck(int *argc, char **argv)
 {
   xbt_assert(sd_global == nullptr, "SD_init() already called");
 
-  sd_global = new simgrid::sd::Global();
-
   surf_init(argc, argv);
 
+  sd_global = new simgrid::sd::Global();
+
   simgrid::config::set_default<std::string>("host/model", "ptask_L07");
-  if (simgrid::config::get_value<bool>("clean-atexit"))
+  if (simgrid::config::get_value<bool>("debug/clean-atexit"))
     atexit(SD_exit);
-  if (_sg_cfg_exit_asap) {
-    exit(0);
-  }
 }
 
 /** @brief set a configuration variable
index 0827cc7..c1b86b4 100644 (file)
@@ -15,7 +15,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_task, sd, "Logging specific to SimDag (task)"
 static void __SD_task_destroy_scheduling_data(SD_task_t task)
 {
   if (task->state != SD_SCHEDULED && task->state != SD_RUNNABLE)
-    THROWF(arg_error, 0, "Task '%s' must be SD_SCHEDULED or SD_RUNNABLE", SD_task_get_name(task));
+    throw std::invalid_argument(
+        simgrid::xbt::string_printf("Task '%s' must be SD_SCHEDULED or SD_RUNNABLE", SD_task_get_name(task)));
 
   xbt_free(task->flops_amount);
   xbt_free(task->bytes_amount);
@@ -37,7 +38,7 @@ SD_task_t SD_task_create(const char *name, void *data, double amount)
   SD_task_t task = xbt_new0(s_SD_task_t, 1);
   task->kind = SD_TASK_NOT_TYPED;
   task->state= SD_NOT_SCHEDULED;
-  sd_global->initial_tasks->insert(task);
+  sd_global->initial_tasks.insert(task);
 
   task->marked = 0;
   task->start_time = -1.0;
@@ -68,7 +69,7 @@ static inline SD_task_t SD_task_create_sized(const char *name, void *data, doubl
 
 /** @brief create a end-to-end communication task that can then be auto-scheduled
  *
- * Auto-scheduling mean that the task can be used with SD_task_schedulev(). This allows to specify the task costs at
+ * Auto-scheduling mean that the task can be used with SD_task_schedulev(). This allows one to specify the task costs at
  * creation, and decouple them from the scheduling process where you just specify which resource should deliver the
  * mandatory power.
  *
@@ -86,7 +87,7 @@ SD_task_t SD_task_create_comm_e2e(const char *name, void *data, double amount)
 
 /** @brief create a sequential computation task that can then be auto-scheduled
  *
- * Auto-scheduling mean that the task can be used with SD_task_schedulev(). This allows to specify the task costs at
+ * Auto-scheduling mean that the task can be used with SD_task_schedulev(). This allows one to specify the task costs at
  * creation, and decouple them from the scheduling process where you just specify which resource should deliver the
  * mandatory power.
  *
@@ -108,7 +109,7 @@ SD_task_t SD_task_create_comp_seq(const char *name, void *data, double flops_amo
 
 /** @brief create a parallel computation task that can then be auto-scheduled
  *
- * Auto-scheduling mean that the task can be used with SD_task_schedulev(). This allows to specify the task costs at
+ * Auto-scheduling mean that the task can be used with SD_task_schedulev(). This allows one to specify the task costs at
  * creation, and decouple them from the scheduling process where you just specify which resource should deliver the
  * mandatory power.
  *
@@ -135,7 +136,7 @@ SD_task_t SD_task_create_comp_par_amdahl(const char *name, void *data, double fl
 /** @brief create a complex data redistribution task that can then be  auto-scheduled
  *
  * Auto-scheduling mean that the task can be used with SD_task_schedulev().
- * This allows to specify the task costs at creation, and decouple them from the scheduling process where you just
+ * This allows one to specify the task costs at creation, and decouple them from the scheduling process where you just
  * specify which resource should communicate.
  *
  * A data redistribution can be scheduled on any number of host.
@@ -265,28 +266,28 @@ void SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state)
   std::set<SD_task_t>::iterator idx;
   XBT_DEBUG("Set state of '%s' to %d", task->name, new_state);
   if ((new_state == SD_NOT_SCHEDULED || new_state == SD_SCHEDULABLE) && task->state == SD_FAILED){
-    sd_global->completed_tasks->erase(task);
-    sd_global->initial_tasks->insert(task);
+    sd_global->completed_tasks.erase(task);
+    sd_global->initial_tasks.insert(task);
   }
 
   if (new_state == SD_SCHEDULED && task->state == SD_RUNNABLE){
-    sd_global->initial_tasks->insert(task);
-    sd_global->runnable_tasks->erase(task);
+    sd_global->initial_tasks.insert(task);
+    sd_global->runnable_tasks.erase(task);
   }
 
   if (new_state == SD_RUNNABLE){
-    idx = sd_global->initial_tasks->find(task);
-    if (idx != sd_global->initial_tasks->end()) {
-      sd_global->runnable_tasks->insert(*idx);
-      sd_global->initial_tasks->erase(idx);
+    idx = sd_global->initial_tasks.find(task);
+    if (idx != sd_global->initial_tasks.end()) {
+      sd_global->runnable_tasks.insert(*idx);
+      sd_global->initial_tasks.erase(idx);
     }
   }
 
   if (new_state == SD_RUNNING)
-    sd_global->runnable_tasks->erase(task);
+    sd_global->runnable_tasks.erase(task);
 
   if (new_state == SD_DONE || new_state == SD_FAILED){
-    sd_global->completed_tasks->insert(task);
+    sd_global->completed_tasks.insert(task);
     task->start_time = task->surf_action->get_start_time();
     if (new_state == SD_DONE){
       task->finish_time = task->surf_action->get_finish_time();
@@ -534,19 +535,21 @@ void SD_task_dotty(SD_task_t task, void *out)
 void SD_task_dependency_add(SD_task_t src, SD_task_t dst)
 {
   if (src == dst)
-    THROWF(arg_error, 0, "Cannot add a dependency between task '%s' and itself", SD_task_get_name(src));
+    throw std::invalid_argument(
+        simgrid::xbt::string_printf("Cannot add a dependency between task '%s' and itself", SD_task_get_name(src)));
 
   if (src->state == SD_DONE || src->state == SD_FAILED)
-    THROWF(arg_error, 0, "Task '%s' must be SD_NOT_SCHEDULED, SD_SCHEDULABLE, SD_SCHEDULED, SD_RUNNABLE, or SD_RUNNING",
-           src->name);
+    throw std::invalid_argument(simgrid::xbt::string_printf(
+        "Task '%s' must be SD_NOT_SCHEDULED, SD_SCHEDULABLE, SD_SCHEDULED, SD_RUNNABLE, or SD_RUNNING", src->name));
 
   if (dst->state == SD_DONE || dst->state == SD_FAILED || dst->state == SD_RUNNING)
-    THROWF(arg_error, 0, "Task '%s' must be SD_NOT_SCHEDULED, SD_SCHEDULABLE, SD_SCHEDULED, or SD_RUNNABLE",
-           dst->name);
+    throw std::invalid_argument(simgrid::xbt::string_printf(
+        "Task '%s' must be SD_NOT_SCHEDULED, SD_SCHEDULABLE, SD_SCHEDULED, or SD_RUNNABLE", dst->name));
 
   if (dst->inputs->find(src) != dst->inputs->end() || src->outputs->find(dst) != src->outputs->end() ||
       src->successors->find(dst) != src->successors->end() || dst->predecessors->find(src) != dst->predecessors->end())
-    THROWF(arg_error, 0, "A dependency already exists between task '%s' and task '%s'", src->name, dst->name);
+    throw std::invalid_argument(simgrid::xbt::string_printf(
+        "A dependency already exists between task '%s' and task '%s'", src->name, dst->name));
 
   XBT_DEBUG("SD_task_dependency_add: src = %s, dst = %s", src->name, dst->name);
 
@@ -607,8 +610,9 @@ void SD_task_dependency_remove(SD_task_t src, SD_task_t dst)
   XBT_DEBUG("SD_task_dependency_remove: src = %s, dst = %s", SD_task_get_name(src), SD_task_get_name(dst));
 
   if (src->successors->find(dst) == src->successors->end() && src->outputs->find(dst) == src->outputs->end())
-    THROWF(arg_error, 0, "No dependency found between task '%s' and '%s': task '%s' is not a successor of task '%s'",
-           src->name, dst->name, dst->name, src->name);
+    throw std::invalid_argument(simgrid::xbt::string_printf(
+        "No dependency found between task '%s' and '%s': task '%s' is not a successor of task '%s'", src->name,
+        dst->name, dst->name, src->name));
 
   if (src->kind == SD_TASK_COMM_E2E || src->kind == SD_TASK_COMM_PAR_MXN_1D_BLOCK){
     if (dst->kind == SD_TASK_COMP_SEQ || dst->kind == SD_TASK_COMP_PAR_AMDAHL)
@@ -642,7 +646,7 @@ void SD_task_dependency_remove(SD_task_t src, SD_task_t dst)
 void SD_task_watch(SD_task_t task, e_SD_task_state_t state)
 {
   if (state & SD_NOT_SCHEDULED)
-    THROWF(arg_error, 0, "Cannot add a watch point for state SD_NOT_SCHEDULED");
+    throw std::invalid_argument("Cannot add a watch point for state SD_NOT_SCHEDULED");
 
   task->watch_points = task->watch_points | state;
 }
@@ -699,7 +703,8 @@ double SD_task_get_execution_time(SD_task_t /*task*/, int host_count, const sg_h
 static inline void SD_task_do_schedule(SD_task_t task)
 {
   if (SD_task_get_state(task) > SD_SCHEDULABLE)
-    THROWF(arg_error, 0, "Task '%s' has already been scheduled", SD_task_get_name(task));
+    throw std::invalid_argument(
+        simgrid::xbt::string_printf("Task '%s' has already been scheduled", SD_task_get_name(task)));
 
   if (task->predecessors->empty() && task->inputs->empty())
     SD_task_set_state(task, SD_RUNNABLE);
@@ -764,7 +769,8 @@ void SD_task_schedule(SD_task_t task, int host_count, const sg_host_t * host_lis
 void SD_task_unschedule(SD_task_t task)
 {
   if (task->state == SD_NOT_SCHEDULED || task->state == SD_SCHEDULABLE)
-    THROWF(arg_error, 0, "Task %s: the state must be SD_SCHEDULED, SD_RUNNABLE, SD_RUNNING or SD_FAILED", task->name);
+    throw std::invalid_argument(simgrid::xbt::string_printf(
+        "Task %s: the state must be SD_SCHEDULED, SD_RUNNABLE, SD_RUNNING or SD_FAILED", task->name));
 
   if ((task->state == SD_SCHEDULED || task->state == SD_RUNNABLE) /* if the task is scheduled or runnable */
       && ((task->kind == SD_TASK_COMP_PAR_AMDAHL) || (task->kind == SD_TASK_COMM_PAR_MXN_1D_BLOCK))) {
@@ -802,7 +808,7 @@ void SD_task_run(SD_task_t task)
   XBT_DEBUG("surf_action = %p", task->surf_action);
 
   SD_task_set_state(task, SD_RUNNING);
-  sd_global->return_set->insert(task);
+  sd_global->return_set.insert(task);
 }
 
 /**
@@ -876,7 +882,7 @@ void SD_task_build_MxN_1D_block_matrix(SD_task_t task, int src_nb, int dst_nb){
 
 /** @brief Auto-schedules a task.
  *
- * Auto-scheduling mean that the task can be used with SD_task_schedulev(). This allows to specify the task costs at
+ * Auto-scheduling mean that the task can be used with SD_task_schedulev(). This allows one to specify the task costs at
  * creation, and decouple them from the scheduling process where you just specify which resource should deliver the
  * mandatory power.
  *
index 7565424..e452c3b 100644 (file)
@@ -19,15 +19,11 @@ namespace simgrid{
 namespace sd{
 class Global {
 public:
-  explicit Global();
-  Global(const Global&) = delete;
-  Global& operator=(const Global&) = delete;
-  ~Global();
-  bool watch_point_reached;      /* has a task just reached a watch point? */
-  std::set<SD_task_t> *initial_tasks;
-  std::set<SD_task_t> *runnable_tasks;
-  std::set<SD_task_t> *completed_tasks;
-  std::set<SD_task_t> *return_set;
+  bool watch_point_reached = false; /* has a task just reached a watch point? */
+  std::set<SD_task_t> initial_tasks;
+  std::set<SD_task_t> runnable_tasks;
+  std::set<SD_task_t> completed_tasks;
+  std::set<SD_task_t> return_set;
 };
 
 std::set<SD_task_t>* simulate (double how_long);
index d59d487..ed0a7e9 100644 (file)
@@ -9,6 +9,11 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
 
 namespace simgrid {
 
+// DO NOT define destructors for exceptions in Exception.hpp.
+// Defining it here ensures that the exceptions are defined only in libsimgrid, but not in libsimgrid-java.
+// Doing otherwise naturally breaks things (at least on freebsd with clang).
+
+Exception::~Exception()                         = default;
 ForcefulKillException::~ForcefulKillException() = default;
 
 void ForcefulKillException::do_throw()
index 6358b59..e736195 100644 (file)
@@ -41,15 +41,6 @@ void sg_config_continue_after_help()
  */
 int _sg_cfg_init_status = 0;
 
-/* instruct the upper layer (simix or simdag) to exit as soon as possible */
-bool _sg_cfg_exit_asap = false;
-
-#define sg_cfg_exit_early()                                                                                            \
-  do {                                                                                                                 \
-    _sg_cfg_exit_asap = true;                                                                                          \
-    return;                                                                                                            \
-  } while (0)
-
 /* Parse the command line, looking for options */
 static void sg_config_cmd_line(int *argc, char **argv)
 {
@@ -72,41 +63,39 @@ static void sg_config_cmd_line(int *argc, char **argv)
       sg_version();
       shall_exit = true;
     } else if (parse_args && (not strcmp(argv[i], "--cfg-help") || not strcmp(argv[i], "--help"))) {
-      printf("Description of the configuration accepted by this simulator:\n");
+      XBT_HELP("Description of the configuration accepted by this simulator:");
       simgrid::config::help();
-      printf(
-          "\n"
-          "Each of these configurations can be used by adding\n"
-          "    --cfg=<option name>:<option value>\n"
-          "to the command line.\n"
-          "\n"
-          "For more information, please refer to:\n"
-          "   --help-aliases for the list of all option aliases.\n"
-          "   --help-logs and --help-log-categories for the details of logging output.\n"
-          "   --help-models for a list of all models known by this simulator.\n"
-          "   --help-tracing for the details of all tracing options known by this simulator.\n"
-          "   --version to get SimGrid version information.\n"
-          "\n"
-        );
+      XBT_HELP("\n"
+               "Each of these configurations can be used by adding\n"
+               "    --cfg=<option name>:<option value>\n"
+               "to the command line. Try passing \"help\" as a value\n"
+               "to get the list of values accepted by a given option.\n"
+               "For example, \"--cfg=plugin:help\" gives you the list of\n"
+               "plugins available in your installation of SimGrid.\n"
+               "\n"
+               "For more information, please refer to:\n"
+               "   --help-aliases for the list of all option aliases.\n"
+               "   --help-logs and --help-log-categories for the details of logging output.\n"
+               "   --help-models for a list of all models known by this simulator.\n"
+               "   --help-tracing for the details of all tracing options known by this simulator.\n"
+               "   --version to get SimGrid version information.\n");
       shall_exit = not cfg_continue_after_help;
       argv[j++]  = argv[i]; // Preserve the --help in argv just in case someone else wants to see it
     } else if (parse_args && not strcmp(argv[i], "--help-aliases")) {
-      printf("Here is a list of all deprecated option names, with their replacement.\n");
+      XBT_HELP("Here is a list of all deprecated option names, with their replacement.");
       simgrid::config::show_aliases();
-      printf("Please consider using the recent names\n");
+      XBT_HELP("Please consider using the recent names");
       shall_exit = true;
     } else if (parse_args && not strcmp(argv[i], "--help-models")) {
       model_help("host", surf_host_model_description);
-      printf("\n");
+      XBT_HELP("%s", "");
       model_help("CPU", surf_cpu_model_description);
-      printf("\n");
+      XBT_HELP("%s", "");
       model_help("network", surf_network_model_description);
-      printf("\nLong description of all optimization levels accepted by the models of this simulator:\n");
-      for (int k = 0; surf_optimization_mode_description[k].name; k++)
-        printf("  %s: %s\n",
-               surf_optimization_mode_description[k].name,
-               surf_optimization_mode_description[k].description);
-      printf("Both network and CPU models have 'Lazy' as default optimization level\n\n");
+      XBT_HELP("\nLong description of all optimization levels accepted by the models of this simulator:");
+      for (auto const& item : surf_optimization_mode_description)
+        XBT_HELP("  %s: %s", item.name, item.description);
+      XBT_HELP("Both network and CPU models have 'Lazy' as default optimization level\n");
       shall_exit = true;
     } else if (parse_args && not strcmp(argv[i], "--help-tracing")) {
       TRACE_help();
@@ -120,7 +109,7 @@ static void sg_config_cmd_line(int *argc, char **argv)
     *argc = j;
   }
   if (shall_exit)
-    sg_cfg_exit_early();
+    exit(0);
 }
 
 /* callback of the plugin variable */
@@ -132,12 +121,12 @@ static void _sg_cfg_cb__plugin(const std::string& value)
     return;
 
   if (value == "help") {
-    model_help("plugin", surf_plugin_description);
-    sg_cfg_exit_early();
+    model_help("plugin", *surf_plugin_description);
+    exit(0);
   }
 
-  int plugin_id = find_model_description(surf_plugin_description, value);
-  surf_plugin_description[plugin_id].model_init_preparse();
+  int plugin_id = find_model_description(*surf_plugin_description, value);
+  (*surf_plugin_description)[plugin_id].model_init_preparse();
 }
 
 /* callback of the host/model variable */
@@ -147,7 +136,7 @@ static void _sg_cfg_cb__host_model(const std::string& value)
 
   if (value == "help") {
     model_help("host", surf_host_model_description);
-    sg_cfg_exit_early();
+    exit(0);
   }
 
   /* Make sure that the model exists */
@@ -161,7 +150,7 @@ static void _sg_cfg_cb__cpu_model(const std::string& value)
 
   if (value == "help") {
     model_help("CPU", surf_cpu_model_description);
-    sg_cfg_exit_early();
+    exit(0);
   }
 
   /* New Module missing */
@@ -175,21 +164,33 @@ static void _sg_cfg_cb__optimization_mode(const std::string& value)
 
   if (value == "help") {
     model_help("optimization", surf_optimization_mode_description);
-    sg_cfg_exit_early();
+    exit(0);
   }
 
   /* New Module missing */
   find_model_description(surf_optimization_mode_description, value);
 }
 
+static void _sg_cfg_cb__disk_model(const std::string& value)
+{
+  xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");
+
+  if (value == "help") {
+    model_help("disk", surf_disk_model_description);
+    exit(0);
+  }
+
+  find_model_description(surf_disk_model_description, value);
+}
+
 /* callback of the cpu/model variable */
-static void _sg_cfg_cb__storage_mode(const std::string& value)
+static void _sg_cfg_cb__storage_model(const std::string& value)
 {
   xbt_assert(_sg_cfg_init_status < 2, "Cannot change the model after the initialization");
 
   if (value == "help") {
     model_help("storage", surf_storage_model_description);
-    sg_cfg_exit_early();
+    exit(0);
   }
 
   find_model_description(surf_storage_model_description, value);
@@ -202,7 +203,7 @@ static void _sg_cfg_cb__network_model(const std::string& value)
 
   if (value == "help") {
     model_help("network", surf_network_model_description);
-    sg_cfg_exit_early();
+    exit(0);
   }
 
   /* New Module missing */
@@ -224,28 +225,24 @@ static void _sg_cfg_cb_contexts_parallel_mode(const std::string& mode_name)
 }
 
 /* build description line with possible values */
-static void describe_model(char *result,int resultsize,
-                           const s_surf_model_description_t model_description[],
-                           const char *name,
-                           const char *description)
+static void declare_model_flag(const std::string& name, const std::string& value,
+                               const std::function<void(std::string const&)>& callback,
+                               const std::vector<surf_model_description_t>& model_description, const std::string& type,
+                               const std::string& descr)
 {
-  result[0] = '\0';
-  char *p = result;
-  p += snprintf(result,resultsize-1, "%s. Possible values: %s", description,
-            model_description[0].name ? model_description[0].name : "n/a");
-  for (int i = 1; model_description[i].name; i++)
-    p += snprintf(p,resultsize-(p-result)-1, ", %s", model_description[i].name);
-  p += snprintf(p,resultsize-(p-result)-1, ".\n       (use 'help' as a value to see the long description of each %s)", name);
-
-  xbt_assert(p<result+resultsize-1,"Buffer too small to display the model description of %s",name);
+  std::string description = descr + ". Possible values: ";
+  std::string sep         = "";
+  for (auto const& item : model_description) {
+    description += sep + item.name;
+    sep = ", ";
+  }
+  description += ".\n       (use 'help' as a value to see the long description of each " + type + ")";
+  simgrid::config::declare_flag<std::string>(name, description, value, callback);
 }
 
 /* create the config set, register what should be and parse the command line*/
 void sg_config_init(int *argc, char **argv)
 {
-  const int descsize = 1024;
-  char description[descsize];
-
   /* Create the configuration support */
   if (_sg_cfg_init_status != 0) { /* Only create stuff if not already inited */
     XBT_WARN("Call to sg_config_init() after initialization ignored");
@@ -253,24 +250,25 @@ void sg_config_init(int *argc, char **argv)
   }
 
   /* Plugins configuration */
-  describe_model(description, descsize, surf_plugin_description, "plugin", "The plugins");
-  simgrid::config::declare_flag<std::string>("plugin", description, "", &_sg_cfg_cb__plugin);
+  declare_model_flag("plugin", "", &_sg_cfg_cb__plugin, *surf_plugin_description, "plugin", "The plugins");
+
+  declare_model_flag("cpu/model", "Cas01", &_sg_cfg_cb__cpu_model, surf_cpu_model_description, "model",
+                     "The model to use for the CPU");
 
-  describe_model(description, descsize, surf_cpu_model_description, "model", "The model to use for the CPU");
-  simgrid::config::declare_flag<std::string>("cpu/model", description, "Cas01", &_sg_cfg_cb__cpu_model);
+  declare_model_flag("disk/model", "default", &_sg_cfg_cb__disk_model, surf_disk_model_description, "model",
+                     "The model to use for the disk");
 
-  describe_model(description, descsize, surf_storage_model_description, "model", "The model to use for the storage");
-  simgrid::config::declare_flag<std::string>("storage/model", description, "default", &_sg_cfg_cb__storage_mode);
+  declare_model_flag("storage/model", "default", &_sg_cfg_cb__storage_model, surf_storage_model_description, "model",
+                     "The model to use for the storage");
 
-  describe_model(description, descsize, surf_network_model_description, "model", "The model to use for the network");
-  simgrid::config::declare_flag<std::string>("network/model", description, "LV08", &_sg_cfg_cb__network_model);
+  declare_model_flag("network/model", "LV08", &_sg_cfg_cb__network_model, surf_network_model_description, "model",
+                     "The model to use for the network");
 
-  describe_model(description, descsize, surf_optimization_mode_description, "optimization mode",
-                 "The optimization modes to use for the network");
-  simgrid::config::declare_flag<std::string>("network/optim", description, "Lazy", &_sg_cfg_cb__optimization_mode);
+  declare_model_flag("network/optim", "Lazy", &_sg_cfg_cb__optimization_mode, surf_optimization_mode_description,
+                     "optimization mode", "The optimization modes to use for the network");
 
-  describe_model(description, descsize, surf_host_model_description, "model", "The model to use for the host");
-  simgrid::config::declare_flag<std::string>("host/model", description, "default", &_sg_cfg_cb__host_model);
+  declare_model_flag("host/model", "default", &_sg_cfg_cb__host_model, surf_host_model_description, "model",
+                     "The model to use for the host");
 
   simgrid::config::bind_flag(sg_surf_precision, "surf/precision",
                              "Numerical precision used when updating simulation times (in seconds)");
@@ -316,9 +314,6 @@ void sg_config_init(int *argc, char **argv)
                                       "no");
   simgrid::config::alias("network/maxmin-selective-update", {"network/maxmin_selective_update"});
 
-  extern bool _sg_do_verbose_exit;
-  simgrid::config::bind_flag(_sg_do_verbose_exit, "verbose-exit", "Activate the \"do nothing\" mode in Ctrl-C");
-
   simgrid::config::declare_flag<int>("contexts/stack-size", "Stack size of contexts in KiB (not with threads)",
                                      8 * 1024, [](int value) { smx_context_stack_size = value * 1024; });
   simgrid::config::alias("contexts/stack-size", {"contexts/stack_size"});
@@ -374,7 +369,9 @@ void sg_config_init(int *argc, char **argv)
 #if HAVE_SMPI
   simgrid::config::declare_flag<double>("smpi/host-speed", "Speed of the host running the simulation (in flop/s). "
                                                            "Used to bench the operations.",
-                                        20000.0);
+                                        20000.0, [](const double& val) {
+      xbt_assert(val > 0.0, "Invalid value (%f) for 'smpi/host-speed': it must be positive.", val);
+    });
   simgrid::config::alias("smpi/host-speed", {"smpi/running_power", "smpi/running-power"});
 
   simgrid::config::declare_flag<bool>("smpi/keep-temps", "Whether we should keep the generated temporary files.",
@@ -409,7 +406,8 @@ void sg_config_init(int *argc, char **argv)
 
   simgrid::config::declare_flag<bool>("smpi/trace-call-location",
                                       "Should filename and linenumber of MPI calls be traced?", false);
-
+  simgrid::config::declare_flag<bool>("smpi/trace-call-use-absolute-path",
+                                      "Should filenames for trace-call tracing be absolute or not?", false);
   simgrid::config::declare_flag<int>(
       "smpi/send-is-detached-thresh",
       "Threshold of message size where MPI_Send stops behaving like MPI_Isend and becomes MPI_Ssend", 65536);
@@ -473,10 +471,6 @@ void sg_config_init(int *argc, char **argv)
   simgrid::config::declare_flag<bool>(
       "exception/cutpath", "Whether to cut all path information from call traces, used e.g. in exceptions.", false);
 
-  extern bool _sg_do_clean_atexit;
-  simgrid::config::bind_flag(_sg_do_clean_atexit, "clean-atexit", {"clean_atexit"},
-                             "Whether to cleanup SimGrid at exit. Disable it if your code segfaults after its end.");
-
   if (surf_path.empty())
     simgrid::config::set_default<std::string>("path", "./");
 
@@ -489,9 +483,6 @@ void sg_config_init(int *argc, char **argv)
 
 void sg_config_finalize()
 {
-  if (not _sg_cfg_init_status)
-    return;                     /* Not initialized yet. Nothing to do */
-
   simgrid::config::finalize();
   _sg_cfg_init_status = 0;
 }
index 2840515..c25eee7 100644 (file)
@@ -21,8 +21,6 @@
 #include "src/mc/mc_replay.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix);
-
 #include "popping_bodies.cpp"
 
 /**
@@ -36,41 +34,30 @@ e_smx_state_t simcall_execution_wait(const smx_activity_t& execution)
   return (e_smx_state_t)simcall_BODY_execution_wait(static_cast<simgrid::kernel::activity::ExecImpl*>(execution.get()));
 }
 
-e_smx_state_t simcall_execution_test(const smx_activity_t& execution)
+bool simcall_execution_test(const smx_activity_t& execution)
+{
+  return simcall_BODY_execution_test(static_cast<simgrid::kernel::activity::ExecImpl*>(execution.get()));
+}
+
+unsigned int simcall_execution_waitany_for(simgrid::kernel::activity::ExecImpl* execs[], size_t count, double timeout)
 {
-  return (e_smx_state_t)simcall_BODY_execution_test(static_cast<simgrid::kernel::activity::ExecImpl*>(execution.get()));
+  return simcall_BODY_execution_waitany_for(execs, count, timeout);
 }
 
 void simcall_process_join(smx_actor_t process, double timeout)
 {
-  simcall_BODY_process_join(process, timeout);
+  SIMIX_process_self()->join(process, timeout);
 }
 
-/**
- * @ingroup simix_process_management
- * @brief Suspends an actor
- */
 void simcall_process_suspend(smx_actor_t process)
 {
-  simcall_BODY_process_suspend(process);
+  process->iface()->suspend();
 }
 
-/**
- * @ingroup simix_process_management
- * @brief Creates a new sleep SIMIX synchro.
- *
- * This function creates a SURF action and allocates the data necessary
- * to create the SIMIX synchro. It can raise a HostFailureException if the
- * host crashed. The default SIMIX name of the synchro is "sleep".
- *
- *   @param duration Time duration of the sleep.
- *   @return A result telling whether the sleep was successful
- */
 e_smx_state_t simcall_process_sleep(double duration)
 {
-  /* checking for infinite values */
-  xbt_assert(std::isfinite(duration), "duration is not finite!");
-  return (e_smx_state_t) simcall_BODY_process_sleep(duration);
+  SIMIX_process_self()->sleep(duration);
+  return SIMIX_DONE;
 }
 
 /**
@@ -97,8 +84,8 @@ void simcall_comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size,
     comm = nullptr;
   }
   else {
-    simcall_BODY_comm_send(sender, mbox, task_size, rate, src_buff, src_buff_size,
-                         match_fun, copy_data_fun, data, timeout);
+    simcall_BODY_comm_send(sender, mbox, task_size, rate, static_cast<unsigned char*>(src_buff), src_buff_size,
+                           match_fun, copy_data_fun, data, timeout);
   }
 }
 
@@ -110,7 +97,7 @@ smx_activity_t simcall_comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double
                                   int (*match_fun)(void*, void*, simgrid::kernel::activity::CommImpl*),
                                   void (*clean_fun)(void*),
                                   void (*copy_data_fun)(simgrid::kernel::activity::CommImpl*, void*, size_t),
-                                  void* data, int detached)
+                                  void* data, bool detached)
 {
   /* checking for infinite values */
   xbt_assert(std::isfinite(task_size), "task_size is not finite!");
@@ -118,9 +105,8 @@ smx_activity_t simcall_comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double
 
   xbt_assert(mbox, "No rendez-vous point defined for isend");
 
-  return simcall_BODY_comm_isend(sender, mbox, task_size, rate, src_buff,
-                                 src_buff_size, match_fun,
-                                 clean_fun, copy_data_fun, data, detached);
+  return simcall_BODY_comm_isend(sender, mbox, task_size, rate, static_cast<unsigned char*>(src_buff), src_buff_size,
+                                 match_fun, clean_fun, copy_data_fun, data, detached);
 }
 
 /**
@@ -143,8 +129,8 @@ void simcall_comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff,
     comm = nullptr;
   }
   else {
-    simcall_BODY_comm_recv(receiver, mbox, dst_buff, dst_buff_size,
-                           match_fun, copy_data_fun, data, timeout, rate);
+    simcall_BODY_comm_recv(receiver, mbox, static_cast<unsigned char*>(dst_buff), dst_buff_size, match_fun,
+                           copy_data_fun, data, timeout, rate);
   }
 }
 /**
@@ -157,8 +143,8 @@ smx_activity_t simcall_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void
 {
   xbt_assert(mbox, "No rendez-vous point defined for irecv");
 
-  return simcall_BODY_comm_irecv(receiver, mbox, dst_buff, dst_buff_size,
-                                 match_fun, copy_data_fun, data, rate);
+  return simcall_BODY_comm_irecv(receiver, mbox, static_cast<unsigned char*>(dst_buff), dst_buff_size, match_fun,
+                                 copy_data_fun, data, rate);
 }
 
 /**
@@ -169,7 +155,7 @@ smx_activity_t simcall_comm_iprobe(smx_mailbox_t mbox, int type,
 {
   xbt_assert(mbox, "No rendez-vous point defined for iprobe");
 
-  return simgrid::simix::simcall([mbox, type, match_fun, data] { return mbox->iprobe(type, match_fun, data); });
+  return simgrid::kernel::actor::simcall([mbox, type, match_fun, data] { return mbox->iprobe(type, match_fun, data); });
 }
 
 /**
@@ -223,7 +209,7 @@ void simcall_comm_wait(const smx_activity_t& comm, double timeout)
  * @ingroup simix_comm_management
  *
  */
-int simcall_comm_test(const smx_activity_t& comm)
+bool simcall_comm_test(const smx_activity_t& comm)
 {
   return simcall_BODY_comm_test(static_cast<simgrid::kernel::activity::CommImpl*>(comm.get()));
 }
@@ -239,7 +225,7 @@ smx_mutex_t simcall_mutex_init()
                                                                                  // get there before the initialization
     xbt_abort();
   }
-  return simgrid::simix::simcall([] { return new simgrid::kernel::activity::MutexImpl(); });
+  return simgrid::kernel::actor::simcall([] { return new simgrid::kernel::activity::MutexImpl(); });
 }
 
 /**
@@ -275,7 +261,7 @@ void simcall_mutex_unlock(smx_mutex_t mutex)
  */
 smx_cond_t simcall_cond_init()
 {
-  return simgrid::simix::simcall([] { return new simgrid::kernel::activity::ConditionVariableImpl(); });
+  return simgrid::kernel::actor::simcall([] { return new simgrid::kernel::activity::ConditionVariableImpl(); });
 }
 
 /**
@@ -321,13 +307,15 @@ e_smx_state_t simcall_io_wait(const smx_activity_t& io)
   return (e_smx_state_t)simcall_BODY_io_wait(static_cast<simgrid::kernel::activity::IoImpl*>(io.get()));
 }
 
-void simcall_run_kernel(std::function<void()> const& code)
+void simcall_run_kernel(std::function<void()> const& code, simgrid::mc::SimcallInspector* t)
 {
+  SIMIX_process_self()->simcall.inspector_ = t;
   simcall_BODY_run_kernel(&code);
 }
 
-void simcall_run_blocking(std::function<void()> const& code)
+void simcall_run_blocking(std::function<void()> const& code, simgrid::mc::SimcallInspector* t = nullptr)
 {
+  SIMIX_process_self()->simcall.inspector_ = t;
   simcall_BODY_run_blocking(&code);
 }
 
@@ -345,10 +333,10 @@ const char *SIMIX_simcall_name(e_smx_simcall_t kind) {
 namespace simgrid {
 namespace simix {
 
-void unblock(smx_actor_t process)
+void unblock(smx_actor_t actor)
 {
   xbt_assert(SIMIX_is_maestro());
-  SIMIX_simcall_answer(&process->simcall);
+  actor->simcall_answer();
 }
 } // namespace simix
 } // namespace simgrid
@@ -356,40 +344,36 @@ void unblock(smx_actor_t process)
 /* ****************************DEPRECATED CALLS******************************* */
 void simcall_process_set_kill_time(smx_actor_t process, double kill_time)
 {
-  simgrid::simix::simcall([process, kill_time] { process->set_kill_time(kill_time); });
+  simgrid::kernel::actor::simcall([process, kill_time] { process->set_kill_time(kill_time); });
 }
 void simcall_comm_cancel(smx_activity_t comm)
 {
-  simgrid::simix::simcall([comm] { boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(comm)->cancel(); });
+  simgrid::kernel::actor::simcall(
+      [comm] { boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(comm)->cancel(); });
 }
 void simcall_execution_cancel(smx_activity_t exec)
 {
-  simgrid::simix::simcall([exec] { boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(exec)->cancel(); });
-}
-void simcall_execution_set_priority(smx_activity_t exec, double priority)
-{
-  simgrid::simix::simcall([exec, priority] {
-    boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(exec)->set_priority(priority);
-  });
+  simgrid::kernel::actor::simcall(
+      [exec] { boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(exec)->cancel(); });
 }
 
 void simcall_execution_set_bound(smx_activity_t exec, double bound)
 {
-  simgrid::simix::simcall(
+  simgrid::kernel::actor::simcall(
       [exec, bound] { boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(exec)->set_bound(bound); });
 }
 
 // deprecated
 smx_activity_t simcall_execution_start(const std::string& name, const std::string& category, double flops_amount,
-                                       double priority, double bound, sg_host_t host)
+                                       double sharing_penalty, double bound, sg_host_t host)
 {
-  return simgrid::simix::simcall([name, category, flops_amount, priority, bound, host] {
+  return simgrid::kernel::actor::simcall([name, category, flops_amount, sharing_penalty, bound, host] {
     simgrid::kernel::activity::ExecImpl* exec = new simgrid::kernel::activity::ExecImpl();
     (*exec)
         .set_name(name)
         .set_tracing_category(category)
         .set_host(host)
-        .set_priority(priority)
+        .set_sharing_penalty(sharing_penalty)
         .set_bound(bound)
         .set_flops_amount(flops_amount)
         .start();
@@ -429,7 +413,7 @@ smx_activity_t simcall_execution_parallel_start(const std::string& name, int hos
     flops_parallel_amount = std::vector<double>(flops_amount, flops_amount + host_nb);
   if (bytes_amount != nullptr)
     bytes_parallel_amount = std::vector<double>(bytes_amount, bytes_amount + host_nb * host_nb);
-  return simgrid::simix::simcall([name, hosts, flops_parallel_amount, bytes_parallel_amount, timeout] {
+  return simgrid::kernel::actor::simcall([name, hosts, flops_parallel_amount, bytes_parallel_amount, timeout] {
     simgrid::kernel::activity::ExecImpl* exec = new simgrid::kernel::activity::ExecImpl();
     (*exec)
         .set_name(name)
index c482ab8..8babbe6 100644 (file)
@@ -8,26 +8,6 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_popping, simix,
                                 "Popping part of SIMIX (transmuting from user request into kernel handlers)");
 
-void SIMIX_simcall_answer(smx_simcall_t simcall)
-{
-  if (simcall->issuer != simix_global->maestro_process){
-    XBT_DEBUG("Answer simcall %s (%d) issued by %s (%p)", SIMIX_simcall_name(simcall->call), (int)simcall->call,
-              simcall->issuer->get_cname(), simcall->issuer);
-    simcall->issuer->simcall.call = SIMCALL_NONE;
-    xbt_assert(not XBT_LOG_ISENABLED(simix_popping, xbt_log_priority_debug) ||
-                   std::find(begin(simix_global->actors_to_run), end(simix_global->actors_to_run), simcall->issuer) ==
-                       end(simix_global->actors_to_run),
-               "Actor %p should not exist in actors_to_run!", simcall->issuer);
-    simix_global->actors_to_run.push_back(simcall->issuer);
-  }
-}
-
-void SIMIX_simcall_exit(smx_activity_t activity)
-{
-  if (activity != nullptr) // When migrating, the surf activity is disconnected from its simix activity before cancel
-    activity->post();
-}
-
 void SIMIX_run_kernel(std::function<void()> const* code)
 {
   (*code)();
@@ -35,10 +15,10 @@ void SIMIX_run_kernel(std::function<void()> const* code)
 
 /** Kernel code for run_blocking
  *
- * The implementtion looks a lot like SIMIX_run_kernel ^^
+ * The implementation looks a lot like SIMIX_run_kernel ^^
  *
  * However, this `run_blocking` is blocking so the process will not be woken
- * up until `SIMIX_simcall_answer(simcall)`` is called by the kernel.
+ * up until `ActorImpl::simcall_answer()`` is called by the kernel.
  * This means that `code` is responsible for doing this.
  */
 void SIMIX_run_blocking(std::function<void()> const* code)
index 0d92249..066b3ed 100644 (file)
  */
 
 #include "src/simix/popping_private.hpp"
-static inline smx_actor_t simcall_process_suspend__get__process(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
-}
-static inline smx_actor_t simcall_process_suspend__getraw__process(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
-}
-static inline void simcall_process_suspend__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_join__get__process(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
-}
-static inline smx_actor_t simcall_process_join__getraw__process(smx_simcall_t simcall)
-{
-  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
-}
-static inline void simcall_process_join__set__process(smx_simcall_t simcall, smx_actor_t arg)
-{
-  simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
-}
-static inline double simcall_process_join__get__timeout(smx_simcall_t simcall)
+static inline simgrid::kernel::activity::ExecImpl* simcall_execution_wait__get__execution(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<double>(simcall->args[1]);
+  return simgrid::simix::unmarshal<simgrid::kernel::activity::ExecImpl*>(simcall->args_[0]);
 }
-static inline double simcall_process_join__getraw__timeout(smx_simcall_t simcall)
+static inline simgrid::kernel::activity::ExecImpl* simcall_execution_wait__getraw__execution(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ExecImpl*>(simcall->args_[0]);
 }
-static inline void simcall_process_join__set__timeout(smx_simcall_t simcall, double arg)
+static inline void simcall_execution_wait__set__execution(smx_simcall_t simcall, simgrid::kernel::activity::ExecImpl* arg)
 {
-  simgrid::simix::marshal<double>(simcall->args[1], arg);
+  simgrid::simix::marshal<simgrid::kernel::activity::ExecImpl*>(simcall->args_[0], arg);
 }
-static inline int simcall_process_join__get__result(smx_simcall_t simcall)
+static inline int simcall_execution_wait__get__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<int>(simcall->result);
+  return simgrid::simix::unmarshal<int>(simcall->result_);
 }
-static inline int simcall_process_join__getraw__result(smx_simcall_t simcall)
+static inline int simcall_execution_wait__getraw__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+  return simgrid::simix::unmarshal_raw<int>(simcall->result_);
 }
-static inline void simcall_process_join__set__result(smx_simcall_t simcall, int result)
+static inline void simcall_execution_wait__set__result(smx_simcall_t simcall, int result)
 {
-  simgrid::simix::marshal<int>(simcall->result, result);
+  simgrid::simix::marshal<int>(simcall->result_, result);
 }
 
-static inline double simcall_process_sleep__get__duration(smx_simcall_t simcall)
+static inline simgrid::kernel::activity::ExecImpl** simcall_execution_waitany_for__get__execs(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<double>(simcall->args[0]);
+  return simgrid::simix::unmarshal<simgrid::kernel::activity::ExecImpl**>(simcall->args_[0]);
 }
-static inline double simcall_process_sleep__getraw__duration(smx_simcall_t simcall)
+static inline simgrid::kernel::activity::ExecImpl** simcall_execution_waitany_for__getraw__execs(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ExecImpl**>(simcall->args_[0]);
 }
-static inline void simcall_process_sleep__set__duration(smx_simcall_t simcall, double arg)
+static inline void simcall_execution_waitany_for__set__execs(smx_simcall_t simcall, simgrid::kernel::activity::ExecImpl** arg)
 {
-  simgrid::simix::marshal<double>(simcall->args[0], arg);
+  simgrid::simix::marshal<simgrid::kernel::activity::ExecImpl**>(simcall->args_[0], arg);
 }
-static inline int simcall_process_sleep__get__result(smx_simcall_t simcall)
+static inline size_t simcall_execution_waitany_for__get__count(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<int>(simcall->result);
+  return simgrid::simix::unmarshal<size_t>(simcall->args_[1]);
 }
-static inline int simcall_process_sleep__getraw__result(smx_simcall_t simcall)
+static inline size_t simcall_execution_waitany_for__getraw__count(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+  return simgrid::simix::unmarshal_raw<size_t>(simcall->args_[1]);
 }
-static inline void simcall_process_sleep__set__result(smx_simcall_t simcall, int result)
+static inline void simcall_execution_waitany_for__set__count(smx_simcall_t simcall, size_t arg)
 {
-  simgrid::simix::marshal<int>(simcall->result, result);
+  simgrid::simix::marshal<size_t>(simcall->args_[1], arg);
 }
-
-static inline simgrid::kernel::activity::ExecImpl* simcall_execution_wait__get__execution(smx_simcall_t simcall)
+static inline double simcall_execution_waitany_for__get__timeout(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<simgrid::kernel::activity::ExecImpl*>(simcall->args[0]);
+  return simgrid::simix::unmarshal<double>(simcall->args_[2]);
 }
-static inline simgrid::kernel::activity::ExecImpl* simcall_execution_wait__getraw__execution(smx_simcall_t simcall)
+static inline double simcall_execution_waitany_for__getraw__timeout(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ExecImpl*>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<double>(simcall->args_[2]);
 }
-static inline void simcall_execution_wait__set__execution(smx_simcall_t simcall,
-                                                          simgrid::kernel::activity::ExecImpl* arg)
+static inline void simcall_execution_waitany_for__set__timeout(smx_simcall_t simcall, double arg)
 {
-  simgrid::simix::marshal<simgrid::kernel::activity::ExecImpl*>(simcall->args[0], arg);
+  simgrid::simix::marshal<double>(simcall->args_[2], arg);
 }
-static inline int simcall_execution_wait__get__result(smx_simcall_t simcall)
+static inline int simcall_execution_waitany_for__get__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<int>(simcall->result);
+  return simgrid::simix::unmarshal<int>(simcall->result_);
 }
-static inline int simcall_execution_wait__getraw__result(smx_simcall_t simcall)
+static inline int simcall_execution_waitany_for__getraw__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+  return simgrid::simix::unmarshal_raw<int>(simcall->result_);
 }
-static inline void simcall_execution_wait__set__result(smx_simcall_t simcall, int result)
+static inline void simcall_execution_waitany_for__set__result(smx_simcall_t simcall, int result)
 {
-  simgrid::simix::marshal<int>(simcall->result, result);
+  simgrid::simix::marshal<int>(simcall->result_, result);
 }
 
 static inline simgrid::kernel::activity::ExecImpl* simcall_execution_test__get__execution(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<simgrid::kernel::activity::ExecImpl*>(simcall->args[0]);
+  return simgrid::simix::unmarshal<simgrid::kernel::activity::ExecImpl*>(simcall->args_[0]);
 }
 static inline simgrid::kernel::activity::ExecImpl* simcall_execution_test__getraw__execution(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ExecImpl*>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ExecImpl*>(simcall->args_[0]);
 }
-static inline void simcall_execution_test__set__execution(smx_simcall_t simcall,
-                                                          simgrid::kernel::activity::ExecImpl* arg)
+static inline void simcall_execution_test__set__execution(smx_simcall_t simcall, simgrid::kernel::activity::ExecImpl* arg)
 {
-  simgrid::simix::marshal<simgrid::kernel::activity::ExecImpl*>(simcall->args[0], arg);
+  simgrid::simix::marshal<simgrid::kernel::activity::ExecImpl*>(simcall->args_[0], arg);
 }
-static inline int simcall_execution_test__get__result(smx_simcall_t simcall)
+static inline bool simcall_execution_test__get__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<int>(simcall->result);
+  return simgrid::simix::unmarshal<bool>(simcall->result_);
 }
-static inline int simcall_execution_test__getraw__result(smx_simcall_t simcall)
+static inline bool simcall_execution_test__getraw__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+  return simgrid::simix::unmarshal_raw<bool>(simcall->result_);
 }
-static inline void simcall_execution_test__set__result(smx_simcall_t simcall, int result)
+static inline void simcall_execution_test__set__result(smx_simcall_t simcall, bool result)
 {
-  simgrid::simix::marshal<int>(simcall->result, result);
+  simgrid::simix::marshal<bool>(simcall->result_, result);
 }
 
 static inline smx_actor_t simcall_comm_send__get__sender(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<smx_actor_t>(simcall->args_[0]);
 }
 static inline smx_actor_t simcall_comm_send__getraw__sender(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args_[0]);
 }
 static inline void simcall_comm_send__set__sender(smx_simcall_t simcall, smx_actor_t arg)
 {
-  simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<smx_actor_t>(simcall->args_[0], arg);
 }
 static inline smx_mailbox_t simcall_comm_send__get__mbox(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]);
+  return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args_[1]);
 }
 static inline smx_mailbox_t simcall_comm_send__getraw__mbox(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<smx_mailbox_t>(simcall->args[1]);
+  return simgrid::simix::unmarshal_raw<smx_mailbox_t>(simcall->args_[1]);
 }
 static inline void simcall_comm_send__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg)
 {
-  simgrid::simix::marshal<smx_mailbox_t>(simcall->args[1], arg);
+  simgrid::simix::marshal<smx_mailbox_t>(simcall->args_[1], arg);
 }
 static inline double simcall_comm_send__get__task_size(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<double>(simcall->args[2]);
+  return simgrid::simix::unmarshal<double>(simcall->args_[2]);
 }
 static inline double simcall_comm_send__getraw__task_size(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[2]);
+  return simgrid::simix::unmarshal_raw<double>(simcall->args_[2]);
 }
 static inline void simcall_comm_send__set__task_size(smx_simcall_t simcall, double arg)
 {
-  simgrid::simix::marshal<double>(simcall->args[2], arg);
+  simgrid::simix::marshal<double>(simcall->args_[2], arg);
 }
 static inline double simcall_comm_send__get__rate(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<double>(simcall->args[3]);
+  return simgrid::simix::unmarshal<double>(simcall->args_[3]);
 }
 static inline double simcall_comm_send__getraw__rate(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[3]);
+  return simgrid::simix::unmarshal_raw<double>(simcall->args_[3]);
 }
 static inline void simcall_comm_send__set__rate(smx_simcall_t simcall, double arg)
 {
-  simgrid::simix::marshal<double>(simcall->args[3], arg);
+  simgrid::simix::marshal<double>(simcall->args_[3], arg);
 }
-static inline void* simcall_comm_send__get__src_buff(smx_simcall_t simcall)
+static inline unsigned char* simcall_comm_send__get__src_buff(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<void*>(simcall->args[4]);
+  return simgrid::simix::unmarshal<unsigned char*>(simcall->args_[4]);
 }
-static inline void* simcall_comm_send__getraw__src_buff(smx_simcall_t simcall)
+static inline unsigned char* simcall_comm_send__getraw__src_buff(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<void*>(simcall->args[4]);
+  return simgrid::simix::unmarshal_raw<unsigned char*>(simcall->args_[4]);
 }
-static inline void simcall_comm_send__set__src_buff(smx_simcall_t simcall, void* arg)
+static inline void simcall_comm_send__set__src_buff(smx_simcall_t simcall, unsigned char* arg)
 {
-  simgrid::simix::marshal<void*>(simcall->args[4], arg);
+  simgrid::simix::marshal<unsigned char*>(simcall->args_[4], arg);
 }
 static inline size_t simcall_comm_send__get__src_buff_size(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<size_t>(simcall->args[5]);
+  return simgrid::simix::unmarshal<size_t>(simcall->args_[5]);
 }
 static inline size_t simcall_comm_send__getraw__src_buff_size(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<size_t>(simcall->args[5]);
+  return simgrid::simix::unmarshal_raw<size_t>(simcall->args_[5]);
 }
 static inline void simcall_comm_send__set__src_buff_size(smx_simcall_t simcall, size_t arg)
 {
-  simgrid::simix::marshal<size_t>(simcall->args[5], arg);
+  simgrid::simix::marshal<size_t>(simcall->args_[5], arg);
 }
 static inline simix_match_func_t simcall_comm_send__get__match_fun(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]);
+  return simgrid::simix::unmarshal<simix_match_func_t>(simcall->args_[6]);
 }
 static inline simix_match_func_t simcall_comm_send__getraw__match_fun(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<simix_match_func_t>(simcall->args[6]);
+  return simgrid::simix::unmarshal_raw<simix_match_func_t>(simcall->args_[6]);
 }
 static inline void simcall_comm_send__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg)
 {
-  simgrid::simix::marshal<simix_match_func_t>(simcall->args[6], arg);
+  simgrid::simix::marshal<simix_match_func_t>(simcall->args_[6], arg);
 }
 static inline simix_copy_data_func_t simcall_comm_send__get__copy_data_fun(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[7]);
+  return simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args_[7]);
 }
 static inline simix_copy_data_func_t simcall_comm_send__getraw__copy_data_fun(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<simix_copy_data_func_t>(simcall->args[7]);
+  return simgrid::simix::unmarshal_raw<simix_copy_data_func_t>(simcall->args_[7]);
 }
 static inline void simcall_comm_send__set__copy_data_fun(smx_simcall_t simcall, simix_copy_data_func_t arg)
 {
-  simgrid::simix::marshal<simix_copy_data_func_t>(simcall->args[7], arg);
+  simgrid::simix::marshal<simix_copy_data_func_t>(simcall->args_[7], arg);
 }
 static inline void* simcall_comm_send__get__data(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<void*>(simcall->args[8]);
+  return simgrid::simix::unmarshal<void*>(simcall->args_[8]);
 }
 static inline void* simcall_comm_send__getraw__data(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<void*>(simcall->args[8]);
+  return simgrid::simix::unmarshal_raw<void*>(simcall->args_[8]);
 }
 static inline void simcall_comm_send__set__data(smx_simcall_t simcall, void* arg)
 {
-  simgrid::simix::marshal<void*>(simcall->args[8], arg);
+  simgrid::simix::marshal<void*>(simcall->args_[8], arg);
 }
 static inline double simcall_comm_send__get__timeout(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<double>(simcall->args[9]);
+  return simgrid::simix::unmarshal<double>(simcall->args_[9]);
 }
 static inline double simcall_comm_send__getraw__timeout(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[9]);
+  return simgrid::simix::unmarshal_raw<double>(simcall->args_[9]);
 }
 static inline void simcall_comm_send__set__timeout(smx_simcall_t simcall, double arg)
 {
-  simgrid::simix::marshal<double>(simcall->args[9], arg);
+  simgrid::simix::marshal<double>(simcall->args_[9], arg);
 }
 
 static inline smx_actor_t simcall_comm_isend__get__sender(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<smx_actor_t>(simcall->args_[0]);
 }
 static inline smx_actor_t simcall_comm_isend__getraw__sender(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args_[0]);
 }
 static inline void simcall_comm_isend__set__sender(smx_simcall_t simcall, smx_actor_t arg)
 {
-  simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<smx_actor_t>(simcall->args_[0], arg);
 }
 static inline smx_mailbox_t simcall_comm_isend__get__mbox(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]);
+  return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args_[1]);
 }
 static inline smx_mailbox_t simcall_comm_isend__getraw__mbox(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<smx_mailbox_t>(simcall->args[1]);
+  return simgrid::simix::unmarshal_raw<smx_mailbox_t>(simcall->args_[1]);
 }
 static inline void simcall_comm_isend__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg)
 {
-  simgrid::simix::marshal<smx_mailbox_t>(simcall->args[1], arg);
+  simgrid::simix::marshal<smx_mailbox_t>(simcall->args_[1], arg);
 }
 static inline double simcall_comm_isend__get__task_size(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<double>(simcall->args[2]);
+  return simgrid::simix::unmarshal<double>(simcall->args_[2]);
 }
 static inline double simcall_comm_isend__getraw__task_size(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[2]);
+  return simgrid::simix::unmarshal_raw<double>(simcall->args_[2]);
 }
 static inline void simcall_comm_isend__set__task_size(smx_simcall_t simcall, double arg)
 {
-  simgrid::simix::marshal<double>(simcall->args[2], arg);
+  simgrid::simix::marshal<double>(simcall->args_[2], arg);
 }
 static inline double simcall_comm_isend__get__rate(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<double>(simcall->args[3]);
+  return simgrid::simix::unmarshal<double>(simcall->args_[3]);
 }
 static inline double simcall_comm_isend__getraw__rate(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[3]);
+  return simgrid::simix::unmarshal_raw<double>(simcall->args_[3]);
 }
 static inline void simcall_comm_isend__set__rate(smx_simcall_t simcall, double arg)
 {
-  simgrid::simix::marshal<double>(simcall->args[3], arg);
+  simgrid::simix::marshal<double>(simcall->args_[3], arg);
 }
-static inline void* simcall_comm_isend__get__src_buff(smx_simcall_t simcall)
+static inline unsigned char* simcall_comm_isend__get__src_buff(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<void*>(simcall->args[4]);
+  return simgrid::simix::unmarshal<unsigned char*>(simcall->args_[4]);
 }
-static inline void* simcall_comm_isend__getraw__src_buff(smx_simcall_t simcall)
+static inline unsigned char* simcall_comm_isend__getraw__src_buff(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<void*>(simcall->args[4]);
+  return simgrid::simix::unmarshal_raw<unsigned char*>(simcall->args_[4]);
 }
-static inline void simcall_comm_isend__set__src_buff(smx_simcall_t simcall, void* arg)
+static inline void simcall_comm_isend__set__src_buff(smx_simcall_t simcall, unsigned char* arg)
 {
-  simgrid::simix::marshal<void*>(simcall->args[4], arg);
+  simgrid::simix::marshal<unsigned char*>(simcall->args_[4], arg);
 }
 static inline size_t simcall_comm_isend__get__src_buff_size(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<size_t>(simcall->args[5]);
+  return simgrid::simix::unmarshal<size_t>(simcall->args_[5]);
 }
 static inline size_t simcall_comm_isend__getraw__src_buff_size(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<size_t>(simcall->args[5]);
+  return simgrid::simix::unmarshal_raw<size_t>(simcall->args_[5]);
 }
 static inline void simcall_comm_isend__set__src_buff_size(smx_simcall_t simcall, size_t arg)
 {
-  simgrid::simix::marshal<size_t>(simcall->args[5], arg);
+  simgrid::simix::marshal<size_t>(simcall->args_[5], arg);
 }
 static inline simix_match_func_t simcall_comm_isend__get__match_fun(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]);
+  return simgrid::simix::unmarshal<simix_match_func_t>(simcall->args_[6]);
 }
 static inline simix_match_func_t simcall_comm_isend__getraw__match_fun(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<simix_match_func_t>(simcall->args[6]);
+  return simgrid::simix::unmarshal_raw<simix_match_func_t>(simcall->args_[6]);
 }
 static inline void simcall_comm_isend__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg)
 {
-  simgrid::simix::marshal<simix_match_func_t>(simcall->args[6], arg);
+  simgrid::simix::marshal<simix_match_func_t>(simcall->args_[6], arg);
 }
 static inline simix_clean_func_t simcall_comm_isend__get__clean_fun(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<simix_clean_func_t>(simcall->args[7]);
+  return simgrid::simix::unmarshal<simix_clean_func_t>(simcall->args_[7]);
 }
 static inline simix_clean_func_t simcall_comm_isend__getraw__clean_fun(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<simix_clean_func_t>(simcall->args[7]);
+  return simgrid::simix::unmarshal_raw<simix_clean_func_t>(simcall->args_[7]);
 }
 static inline void simcall_comm_isend__set__clean_fun(smx_simcall_t simcall, simix_clean_func_t arg)
 {
-  simgrid::simix::marshal<simix_clean_func_t>(simcall->args[7], arg);
+  simgrid::simix::marshal<simix_clean_func_t>(simcall->args_[7], arg);
 }
 static inline simix_copy_data_func_t simcall_comm_isend__get__copy_data_fun(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[8]);
+  return simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args_[8]);
 }
 static inline simix_copy_data_func_t simcall_comm_isend__getraw__copy_data_fun(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<simix_copy_data_func_t>(simcall->args[8]);
+  return simgrid::simix::unmarshal_raw<simix_copy_data_func_t>(simcall->args_[8]);
 }
 static inline void simcall_comm_isend__set__copy_data_fun(smx_simcall_t simcall, simix_copy_data_func_t arg)
 {
-  simgrid::simix::marshal<simix_copy_data_func_t>(simcall->args[8], arg);
+  simgrid::simix::marshal<simix_copy_data_func_t>(simcall->args_[8], arg);
 }
 static inline void* simcall_comm_isend__get__data(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<void*>(simcall->args[9]);
+  return simgrid::simix::unmarshal<void*>(simcall->args_[9]);
 }
 static inline void* simcall_comm_isend__getraw__data(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<void*>(simcall->args[9]);
+  return simgrid::simix::unmarshal_raw<void*>(simcall->args_[9]);
 }
 static inline void simcall_comm_isend__set__data(smx_simcall_t simcall, void* arg)
 {
-  simgrid::simix::marshal<void*>(simcall->args[9], arg);
+  simgrid::simix::marshal<void*>(simcall->args_[9], arg);
 }
-static inline int simcall_comm_isend__get__detached(smx_simcall_t simcall)
+static inline bool simcall_comm_isend__get__detached(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<int>(simcall->args[10]);
+  return simgrid::simix::unmarshal<bool>(simcall->args_[10]);
 }
-static inline int simcall_comm_isend__getraw__detached(smx_simcall_t simcall)
+static inline bool simcall_comm_isend__getraw__detached(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<int>(simcall->args[10]);
+  return simgrid::simix::unmarshal_raw<bool>(simcall->args_[10]);
 }
-static inline void simcall_comm_isend__set__detached(smx_simcall_t simcall, int arg)
+static inline void simcall_comm_isend__set__detached(smx_simcall_t simcall, bool arg)
 {
-  simgrid::simix::marshal<int>(simcall->args[10], arg);
+  simgrid::simix::marshal<bool>(simcall->args_[10], arg);
 }
 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);
+  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result_);
 }
 static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_isend__getraw__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->result);
+  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)
 {
-  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, result);
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result_, result);
 }
 
 static inline smx_actor_t simcall_comm_recv__get__receiver(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<smx_actor_t>(simcall->args_[0]);
 }
 static inline smx_actor_t simcall_comm_recv__getraw__receiver(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args_[0]);
 }
 static inline void simcall_comm_recv__set__receiver(smx_simcall_t simcall, smx_actor_t arg)
 {
-  simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<smx_actor_t>(simcall->args_[0], arg);
 }
 static inline smx_mailbox_t simcall_comm_recv__get__mbox(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]);
+  return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args_[1]);
 }
 static inline smx_mailbox_t simcall_comm_recv__getraw__mbox(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<smx_mailbox_t>(simcall->args[1]);
+  return simgrid::simix::unmarshal_raw<smx_mailbox_t>(simcall->args_[1]);
 }
 static inline void simcall_comm_recv__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg)
 {
-  simgrid::simix::marshal<smx_mailbox_t>(simcall->args[1], arg);
+  simgrid::simix::marshal<smx_mailbox_t>(simcall->args_[1], arg);
 }
-static inline void* simcall_comm_recv__get__dst_buff(smx_simcall_t simcall)
+static inline unsigned char* simcall_comm_recv__get__dst_buff(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<void*>(simcall->args[2]);
+  return simgrid::simix::unmarshal<unsigned char*>(simcall->args_[2]);
 }
-static inline void* simcall_comm_recv__getraw__dst_buff(smx_simcall_t simcall)
+static inline unsigned char* simcall_comm_recv__getraw__dst_buff(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<void*>(simcall->args[2]);
+  return simgrid::simix::unmarshal_raw<unsigned char*>(simcall->args_[2]);
 }
-static inline void simcall_comm_recv__set__dst_buff(smx_simcall_t simcall, void* arg)
+static inline void simcall_comm_recv__set__dst_buff(smx_simcall_t simcall, unsigned char* arg)
 {
-  simgrid::simix::marshal<void*>(simcall->args[2], arg);
+  simgrid::simix::marshal<unsigned char*>(simcall->args_[2], arg);
 }
 static inline size_t* simcall_comm_recv__get__dst_buff_size(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<size_t*>(simcall->args[3]);
+  return simgrid::simix::unmarshal<size_t*>(simcall->args_[3]);
 }
 static inline size_t* simcall_comm_recv__getraw__dst_buff_size(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<size_t*>(simcall->args[3]);
+  return simgrid::simix::unmarshal_raw<size_t*>(simcall->args_[3]);
 }
 static inline void simcall_comm_recv__set__dst_buff_size(smx_simcall_t simcall, size_t* arg)
 {
-  simgrid::simix::marshal<size_t*>(simcall->args[3], arg);
+  simgrid::simix::marshal<size_t*>(simcall->args_[3], arg);
 }
 static inline simix_match_func_t simcall_comm_recv__get__match_fun(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]);
+  return simgrid::simix::unmarshal<simix_match_func_t>(simcall->args_[4]);
 }
 static inline simix_match_func_t simcall_comm_recv__getraw__match_fun(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<simix_match_func_t>(simcall->args[4]);
+  return simgrid::simix::unmarshal_raw<simix_match_func_t>(simcall->args_[4]);
 }
 static inline void simcall_comm_recv__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg)
 {
-  simgrid::simix::marshal<simix_match_func_t>(simcall->args[4], arg);
+  simgrid::simix::marshal<simix_match_func_t>(simcall->args_[4], arg);
 }
 static inline simix_copy_data_func_t simcall_comm_recv__get__copy_data_fun(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]);
+  return simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args_[5]);
 }
 static inline simix_copy_data_func_t simcall_comm_recv__getraw__copy_data_fun(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<simix_copy_data_func_t>(simcall->args[5]);
+  return simgrid::simix::unmarshal_raw<simix_copy_data_func_t>(simcall->args_[5]);
 }
 static inline void simcall_comm_recv__set__copy_data_fun(smx_simcall_t simcall, simix_copy_data_func_t arg)
 {
-  simgrid::simix::marshal<simix_copy_data_func_t>(simcall->args[5], arg);
+  simgrid::simix::marshal<simix_copy_data_func_t>(simcall->args_[5], arg);
 }
 static inline void* simcall_comm_recv__get__data(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<void*>(simcall->args[6]);
+  return simgrid::simix::unmarshal<void*>(simcall->args_[6]);
 }
 static inline void* simcall_comm_recv__getraw__data(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<void*>(simcall->args[6]);
+  return simgrid::simix::unmarshal_raw<void*>(simcall->args_[6]);
 }
 static inline void simcall_comm_recv__set__data(smx_simcall_t simcall, void* arg)
 {
-  simgrid::simix::marshal<void*>(simcall->args[6], arg);
+  simgrid::simix::marshal<void*>(simcall->args_[6], arg);
 }
 static inline double simcall_comm_recv__get__timeout(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<double>(simcall->args[7]);
+  return simgrid::simix::unmarshal<double>(simcall->args_[7]);
 }
 static inline double simcall_comm_recv__getraw__timeout(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[7]);
+  return simgrid::simix::unmarshal_raw<double>(simcall->args_[7]);
 }
 static inline void simcall_comm_recv__set__timeout(smx_simcall_t simcall, double arg)
 {
-  simgrid::simix::marshal<double>(simcall->args[7], arg);
+  simgrid::simix::marshal<double>(simcall->args_[7], arg);
 }
 static inline double simcall_comm_recv__get__rate(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<double>(simcall->args[8]);
+  return simgrid::simix::unmarshal<double>(simcall->args_[8]);
 }
 static inline double simcall_comm_recv__getraw__rate(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[8]);
+  return simgrid::simix::unmarshal_raw<double>(simcall->args_[8]);
 }
 static inline void simcall_comm_recv__set__rate(smx_simcall_t simcall, double arg)
 {
-  simgrid::simix::marshal<double>(simcall->args[8], arg);
+  simgrid::simix::marshal<double>(simcall->args_[8], arg);
 }
 
 static inline smx_actor_t simcall_comm_irecv__get__receiver(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<smx_actor_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<smx_actor_t>(simcall->args_[0]);
 }
 static inline smx_actor_t simcall_comm_irecv__getraw__receiver(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<smx_actor_t>(simcall->args_[0]);
 }
 static inline void simcall_comm_irecv__set__receiver(smx_simcall_t simcall, smx_actor_t arg)
 {
-  simgrid::simix::marshal<smx_actor_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<smx_actor_t>(simcall->args_[0], arg);
 }
 static inline smx_mailbox_t simcall_comm_irecv__get__mbox(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]);
+  return simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args_[1]);
 }
 static inline smx_mailbox_t simcall_comm_irecv__getraw__mbox(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<smx_mailbox_t>(simcall->args[1]);
+  return simgrid::simix::unmarshal_raw<smx_mailbox_t>(simcall->args_[1]);
 }
 static inline void simcall_comm_irecv__set__mbox(smx_simcall_t simcall, smx_mailbox_t arg)
 {
-  simgrid::simix::marshal<smx_mailbox_t>(simcall->args[1], arg);
+  simgrid::simix::marshal<smx_mailbox_t>(simcall->args_[1], arg);
 }
-static inline void* simcall_comm_irecv__get__dst_buff(smx_simcall_t simcall)
+static inline unsigned char* simcall_comm_irecv__get__dst_buff(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<void*>(simcall->args[2]);
+  return simgrid::simix::unmarshal<unsigned char*>(simcall->args_[2]);
 }
-static inline void* simcall_comm_irecv__getraw__dst_buff(smx_simcall_t simcall)
+static inline unsigned char* simcall_comm_irecv__getraw__dst_buff(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<void*>(simcall->args[2]);
+  return simgrid::simix::unmarshal_raw<unsigned char*>(simcall->args_[2]);
 }
-static inline void simcall_comm_irecv__set__dst_buff(smx_simcall_t simcall, void* arg)
+static inline void simcall_comm_irecv__set__dst_buff(smx_simcall_t simcall, unsigned char* arg)
 {
-  simgrid::simix::marshal<void*>(simcall->args[2], arg);
+  simgrid::simix::marshal<unsigned char*>(simcall->args_[2], arg);
 }
 static inline size_t* simcall_comm_irecv__get__dst_buff_size(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<size_t*>(simcall->args[3]);
+  return simgrid::simix::unmarshal<size_t*>(simcall->args_[3]);
 }
 static inline size_t* simcall_comm_irecv__getraw__dst_buff_size(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<size_t*>(simcall->args[3]);
+  return simgrid::simix::unmarshal_raw<size_t*>(simcall->args_[3]);
 }
 static inline void simcall_comm_irecv__set__dst_buff_size(smx_simcall_t simcall, size_t* arg)
 {
-  simgrid::simix::marshal<size_t*>(simcall->args[3], arg);
+  simgrid::simix::marshal<size_t*>(simcall->args_[3], arg);
 }
 static inline simix_match_func_t simcall_comm_irecv__get__match_fun(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]);
+  return simgrid::simix::unmarshal<simix_match_func_t>(simcall->args_[4]);
 }
 static inline simix_match_func_t simcall_comm_irecv__getraw__match_fun(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<simix_match_func_t>(simcall->args[4]);
+  return simgrid::simix::unmarshal_raw<simix_match_func_t>(simcall->args_[4]);
 }
 static inline void simcall_comm_irecv__set__match_fun(smx_simcall_t simcall, simix_match_func_t arg)
 {
-  simgrid::simix::marshal<simix_match_func_t>(simcall->args[4], arg);
+  simgrid::simix::marshal<simix_match_func_t>(simcall->args_[4], arg);
 }
 static inline simix_copy_data_func_t simcall_comm_irecv__get__copy_data_fun(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]);
+  return simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args_[5]);
 }
 static inline simix_copy_data_func_t simcall_comm_irecv__getraw__copy_data_fun(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<simix_copy_data_func_t>(simcall->args[5]);
+  return simgrid::simix::unmarshal_raw<simix_copy_data_func_t>(simcall->args_[5]);
 }
 static inline void simcall_comm_irecv__set__copy_data_fun(smx_simcall_t simcall, simix_copy_data_func_t arg)
 {
-  simgrid::simix::marshal<simix_copy_data_func_t>(simcall->args[5], arg);
+  simgrid::simix::marshal<simix_copy_data_func_t>(simcall->args_[5], arg);
 }
 static inline void* simcall_comm_irecv__get__data(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<void*>(simcall->args[6]);
+  return simgrid::simix::unmarshal<void*>(simcall->args_[6]);
 }
 static inline void* simcall_comm_irecv__getraw__data(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<void*>(simcall->args[6]);
+  return simgrid::simix::unmarshal_raw<void*>(simcall->args_[6]);
 }
 static inline void simcall_comm_irecv__set__data(smx_simcall_t simcall, void* arg)
 {
-  simgrid::simix::marshal<void*>(simcall->args[6], arg);
+  simgrid::simix::marshal<void*>(simcall->args_[6], arg);
 }
 static inline double simcall_comm_irecv__get__rate(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<double>(simcall->args[7]);
+  return simgrid::simix::unmarshal<double>(simcall->args_[7]);
 }
 static inline double simcall_comm_irecv__getraw__rate(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[7]);
+  return simgrid::simix::unmarshal_raw<double>(simcall->args_[7]);
 }
 static inline void simcall_comm_irecv__set__rate(smx_simcall_t simcall, double arg)
 {
-  simgrid::simix::marshal<double>(simcall->args[7], arg);
+  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)
 {
-  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result);
+  return simgrid::simix::unmarshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result_);
 }
 static inline simgrid::kernel::activity::ActivityImpl* simcall_comm_irecv__getraw__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::ActivityImpl*>(simcall->result);
+  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)
 {
-  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result, result);
+  simgrid::simix::marshal<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>>(simcall->result_, result);
 }
 
 static inline simgrid::kernel::activity::CommImpl** simcall_comm_waitany__get__comms(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl**>(simcall->args[0]);
+  return simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl**>(simcall->args_[0]);
 }
 static inline simgrid::kernel::activity::CommImpl** simcall_comm_waitany__getraw__comms(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::CommImpl**>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::CommImpl**>(simcall->args_[0]);
 }
 static inline void simcall_comm_waitany__set__comms(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl** arg)
 {
-  simgrid::simix::marshal<simgrid::kernel::activity::CommImpl**>(simcall->args[0], arg);
+  simgrid::simix::marshal<simgrid::kernel::activity::CommImpl**>(simcall->args_[0], arg);
 }
 static inline size_t simcall_comm_waitany__get__count(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<size_t>(simcall->args[1]);
+  return simgrid::simix::unmarshal<size_t>(simcall->args_[1]);
 }
 static inline size_t simcall_comm_waitany__getraw__count(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<size_t>(simcall->args[1]);
+  return simgrid::simix::unmarshal_raw<size_t>(simcall->args_[1]);
 }
 static inline void simcall_comm_waitany__set__count(smx_simcall_t simcall, size_t arg)
 {
-  simgrid::simix::marshal<size_t>(simcall->args[1], arg);
+  simgrid::simix::marshal<size_t>(simcall->args_[1], arg);
 }
 static inline double simcall_comm_waitany__get__timeout(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<double>(simcall->args[2]);
+  return simgrid::simix::unmarshal<double>(simcall->args_[2]);
 }
 static inline double simcall_comm_waitany__getraw__timeout(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[2]);
+  return simgrid::simix::unmarshal_raw<double>(simcall->args_[2]);
 }
 static inline void simcall_comm_waitany__set__timeout(smx_simcall_t simcall, double arg)
 {
-  simgrid::simix::marshal<double>(simcall->args[2], arg);
+  simgrid::simix::marshal<double>(simcall->args_[2], arg);
 }
 static inline int simcall_comm_waitany__get__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<int>(simcall->result);
+  return simgrid::simix::unmarshal<int>(simcall->result_);
 }
 static inline int simcall_comm_waitany__getraw__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+  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);
+  simgrid::simix::marshal<int>(simcall->result_, result);
 }
 
 static inline simgrid::kernel::activity::CommImpl* simcall_comm_wait__get__comm(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl*>(simcall->args[0]);
+  return simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl*>(simcall->args_[0]);
 }
 static inline simgrid::kernel::activity::CommImpl* simcall_comm_wait__getraw__comm(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::CommImpl*>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::CommImpl*>(simcall->args_[0]);
 }
 static inline void simcall_comm_wait__set__comm(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl* arg)
 {
-  simgrid::simix::marshal<simgrid::kernel::activity::CommImpl*>(simcall->args[0], arg);
+  simgrid::simix::marshal<simgrid::kernel::activity::CommImpl*>(simcall->args_[0], arg);
 }
 static inline double simcall_comm_wait__get__timeout(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<double>(simcall->args[1]);
+  return simgrid::simix::unmarshal<double>(simcall->args_[1]);
 }
 static inline double simcall_comm_wait__getraw__timeout(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
+  return simgrid::simix::unmarshal_raw<double>(simcall->args_[1]);
 }
 static inline void simcall_comm_wait__set__timeout(smx_simcall_t simcall, double arg)
 {
-  simgrid::simix::marshal<double>(simcall->args[1], arg);
+  simgrid::simix::marshal<double>(simcall->args_[1], arg);
 }
 
 static inline simgrid::kernel::activity::CommImpl* simcall_comm_test__get__comm(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl*>(simcall->args[0]);
+  return simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl*>(simcall->args_[0]);
 }
 static inline simgrid::kernel::activity::CommImpl* simcall_comm_test__getraw__comm(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::CommImpl*>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::CommImpl*>(simcall->args_[0]);
 }
 static inline void simcall_comm_test__set__comm(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl* arg)
 {
-  simgrid::simix::marshal<simgrid::kernel::activity::CommImpl*>(simcall->args[0], arg);
+  simgrid::simix::marshal<simgrid::kernel::activity::CommImpl*>(simcall->args_[0], arg);
 }
-static inline int simcall_comm_test__get__result(smx_simcall_t simcall)
+static inline bool simcall_comm_test__get__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<int>(simcall->result);
+  return simgrid::simix::unmarshal<bool>(simcall->result_);
 }
-static inline int simcall_comm_test__getraw__result(smx_simcall_t simcall)
+static inline bool simcall_comm_test__getraw__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+  return simgrid::simix::unmarshal_raw<bool>(simcall->result_);
 }
-static inline void simcall_comm_test__set__result(smx_simcall_t simcall, int result)
+static inline void simcall_comm_test__set__result(smx_simcall_t simcall, bool result)
 {
-  simgrid::simix::marshal<int>(simcall->result, result);
+  simgrid::simix::marshal<bool>(simcall->result_, result);
 }
 
 static inline simgrid::kernel::activity::CommImpl** simcall_comm_testany__get__comms(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl**>(simcall->args[0]);
+  return simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl**>(simcall->args_[0]);
 }
 static inline simgrid::kernel::activity::CommImpl** simcall_comm_testany__getraw__comms(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::CommImpl**>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::CommImpl**>(simcall->args_[0]);
 }
 static inline void simcall_comm_testany__set__comms(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl** arg)
 {
-  simgrid::simix::marshal<simgrid::kernel::activity::CommImpl**>(simcall->args[0], arg);
+  simgrid::simix::marshal<simgrid::kernel::activity::CommImpl**>(simcall->args_[0], arg);
 }
 static inline size_t simcall_comm_testany__get__count(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<size_t>(simcall->args[1]);
+  return simgrid::simix::unmarshal<size_t>(simcall->args_[1]);
 }
 static inline size_t simcall_comm_testany__getraw__count(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<size_t>(simcall->args[1]);
+  return simgrid::simix::unmarshal_raw<size_t>(simcall->args_[1]);
 }
 static inline void simcall_comm_testany__set__count(smx_simcall_t simcall, size_t arg)
 {
-  simgrid::simix::marshal<size_t>(simcall->args[1], arg);
+  simgrid::simix::marshal<size_t>(simcall->args_[1], arg);
 }
 static inline int simcall_comm_testany__get__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<int>(simcall->result);
+  return simgrid::simix::unmarshal<int>(simcall->result_);
 }
 static inline int simcall_comm_testany__getraw__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+  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);
+  simgrid::simix::marshal<int>(simcall->result_, result);
 }
 
 static inline smx_mutex_t simcall_mutex_lock__get__mutex(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args_[0]);
 }
 static inline smx_mutex_t simcall_mutex_lock__getraw__mutex(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args_[0]);
 }
 static inline void simcall_mutex_lock__set__mutex(smx_simcall_t simcall, smx_mutex_t arg)
 {
-  simgrid::simix::marshal<smx_mutex_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<smx_mutex_t>(simcall->args_[0], arg);
 }
 
 static inline smx_mutex_t simcall_mutex_trylock__get__mutex(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args_[0]);
 }
 static inline smx_mutex_t simcall_mutex_trylock__getraw__mutex(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args_[0]);
 }
 static inline void simcall_mutex_trylock__set__mutex(smx_simcall_t simcall, smx_mutex_t arg)
 {
-  simgrid::simix::marshal<smx_mutex_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<smx_mutex_t>(simcall->args_[0], arg);
 }
 static inline int simcall_mutex_trylock__get__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<int>(simcall->result);
+  return simgrid::simix::unmarshal<int>(simcall->result_);
 }
 static inline int simcall_mutex_trylock__getraw__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+  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);
+  simgrid::simix::marshal<int>(simcall->result_, result);
 }
 
 static inline smx_mutex_t simcall_mutex_unlock__get__mutex(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args_[0]);
 }
 static inline smx_mutex_t simcall_mutex_unlock__getraw__mutex(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args_[0]);
 }
 static inline void simcall_mutex_unlock__set__mutex(smx_simcall_t simcall, smx_mutex_t arg)
 {
-  simgrid::simix::marshal<smx_mutex_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<smx_mutex_t>(simcall->args_[0], arg);
 }
 
 static inline smx_cond_t simcall_cond_wait__get__cond(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<smx_cond_t>(simcall->args_[0]);
 }
 static inline smx_cond_t simcall_cond_wait__getraw__cond(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<smx_cond_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<smx_cond_t>(simcall->args_[0]);
 }
 static inline void simcall_cond_wait__set__cond(smx_simcall_t simcall, smx_cond_t arg)
 {
-  simgrid::simix::marshal<smx_cond_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<smx_cond_t>(simcall->args_[0], arg);
 }
 static inline smx_mutex_t simcall_cond_wait__get__mutex(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]);
+  return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args_[1]);
 }
 static inline smx_mutex_t simcall_cond_wait__getraw__mutex(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args[1]);
+  return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args_[1]);
 }
 static inline void simcall_cond_wait__set__mutex(smx_simcall_t simcall, smx_mutex_t arg)
 {
-  simgrid::simix::marshal<smx_mutex_t>(simcall->args[1], arg);
+  simgrid::simix::marshal<smx_mutex_t>(simcall->args_[1], arg);
 }
 
 static inline smx_cond_t simcall_cond_wait_timeout__get__cond(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<smx_cond_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<smx_cond_t>(simcall->args_[0]);
 }
 static inline smx_cond_t simcall_cond_wait_timeout__getraw__cond(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<smx_cond_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<smx_cond_t>(simcall->args_[0]);
 }
 static inline void simcall_cond_wait_timeout__set__cond(smx_simcall_t simcall, smx_cond_t arg)
 {
-  simgrid::simix::marshal<smx_cond_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<smx_cond_t>(simcall->args_[0], arg);
 }
 static inline smx_mutex_t simcall_cond_wait_timeout__get__mutex(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[1]);
+  return simgrid::simix::unmarshal<smx_mutex_t>(simcall->args_[1]);
 }
 static inline smx_mutex_t simcall_cond_wait_timeout__getraw__mutex(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args[1]);
+  return simgrid::simix::unmarshal_raw<smx_mutex_t>(simcall->args_[1]);
 }
 static inline void simcall_cond_wait_timeout__set__mutex(smx_simcall_t simcall, smx_mutex_t arg)
 {
-  simgrid::simix::marshal<smx_mutex_t>(simcall->args[1], arg);
+  simgrid::simix::marshal<smx_mutex_t>(simcall->args_[1], arg);
 }
 static inline double simcall_cond_wait_timeout__get__timeout(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<double>(simcall->args[2]);
+  return simgrid::simix::unmarshal<double>(simcall->args_[2]);
 }
 static inline double simcall_cond_wait_timeout__getraw__timeout(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[2]);
+  return simgrid::simix::unmarshal_raw<double>(simcall->args_[2]);
 }
 static inline void simcall_cond_wait_timeout__set__timeout(smx_simcall_t simcall, double arg)
 {
-  simgrid::simix::marshal<double>(simcall->args[2], arg);
+  simgrid::simix::marshal<double>(simcall->args_[2], arg);
 }
 static inline int simcall_cond_wait_timeout__get__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<int>(simcall->result);
+  return simgrid::simix::unmarshal<int>(simcall->result_);
 }
 static inline int simcall_cond_wait_timeout__getraw__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+  return simgrid::simix::unmarshal_raw<int>(simcall->result_);
 }
 static inline void simcall_cond_wait_timeout__set__result(smx_simcall_t simcall, int result)
 {
-  simgrid::simix::marshal<int>(simcall->result, 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]);
+  return simgrid::simix::unmarshal<smx_sem_t>(simcall->args_[0]);
 }
 static inline smx_sem_t simcall_sem_acquire__getraw__sem(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args_[0]);
 }
 static inline void simcall_sem_acquire__set__sem(smx_simcall_t simcall, smx_sem_t arg)
 {
-  simgrid::simix::marshal<smx_sem_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<smx_sem_t>(simcall->args_[0], arg);
 }
 
 static inline smx_sem_t simcall_sem_acquire_timeout__get__sem(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<smx_sem_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal<smx_sem_t>(simcall->args_[0]);
 }
 static inline smx_sem_t simcall_sem_acquire_timeout__getraw__sem(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<smx_sem_t>(simcall->args_[0]);
 }
 static inline void simcall_sem_acquire_timeout__set__sem(smx_simcall_t simcall, smx_sem_t arg)
 {
-  simgrid::simix::marshal<smx_sem_t>(simcall->args[0], arg);
+  simgrid::simix::marshal<smx_sem_t>(simcall->args_[0], arg);
 }
 static inline double simcall_sem_acquire_timeout__get__timeout(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<double>(simcall->args[1]);
+  return simgrid::simix::unmarshal<double>(simcall->args_[1]);
 }
 static inline double simcall_sem_acquire_timeout__getraw__timeout(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<double>(simcall->args[1]);
+  return simgrid::simix::unmarshal_raw<double>(simcall->args_[1]);
 }
 static inline void simcall_sem_acquire_timeout__set__timeout(smx_simcall_t simcall, double arg)
 {
-  simgrid::simix::marshal<double>(simcall->args[1], arg);
+  simgrid::simix::marshal<double>(simcall->args_[1], arg);
 }
 static inline int simcall_sem_acquire_timeout__get__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<int>(simcall->result);
+  return simgrid::simix::unmarshal<int>(simcall->result_);
 }
 static inline int simcall_sem_acquire_timeout__getraw__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+  return simgrid::simix::unmarshal_raw<int>(simcall->result_);
 }
 static inline void simcall_sem_acquire_timeout__set__result(smx_simcall_t simcall, int result)
 {
-  simgrid::simix::marshal<int>(simcall->result, result);
+  simgrid::simix::marshal<int>(simcall->result_, result);
 }
 
 static inline simgrid::kernel::activity::IoImpl* simcall_io_wait__get__io(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<simgrid::kernel::activity::IoImpl*>(simcall->args[0]);
+  return simgrid::simix::unmarshal<simgrid::kernel::activity::IoImpl*>(simcall->args_[0]);
 }
 static inline simgrid::kernel::activity::IoImpl* simcall_io_wait__getraw__io(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::IoImpl*>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<simgrid::kernel::activity::IoImpl*>(simcall->args_[0]);
 }
 static inline void simcall_io_wait__set__io(smx_simcall_t simcall, simgrid::kernel::activity::IoImpl* arg)
 {
-  simgrid::simix::marshal<simgrid::kernel::activity::IoImpl*>(simcall->args[0], arg);
+  simgrid::simix::marshal<simgrid::kernel::activity::IoImpl*>(simcall->args_[0], arg);
 }
 static inline sg_size_t simcall_io_wait__get__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<sg_size_t>(simcall->result);
+  return simgrid::simix::unmarshal<sg_size_t>(simcall->result_);
 }
 static inline sg_size_t simcall_io_wait__getraw__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<sg_size_t>(simcall->result);
+  return simgrid::simix::unmarshal_raw<sg_size_t>(simcall->result_);
 }
 static inline void simcall_io_wait__set__result(smx_simcall_t simcall, sg_size_t result)
 {
-  simgrid::simix::marshal<sg_size_t>(simcall->result, result);
+  simgrid::simix::marshal<sg_size_t>(simcall->result_, result);
 }
 
 static inline int simcall_mc_random__get__min(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<int>(simcall->args[0]);
+  return simgrid::simix::unmarshal<int>(simcall->args_[0]);
 }
 static inline int simcall_mc_random__getraw__min(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<int>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<int>(simcall->args_[0]);
 }
 static inline void simcall_mc_random__set__min(smx_simcall_t simcall, int arg)
 {
-  simgrid::simix::marshal<int>(simcall->args[0], arg);
+  simgrid::simix::marshal<int>(simcall->args_[0], arg);
 }
 static inline int simcall_mc_random__get__max(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<int>(simcall->args[1]);
+  return simgrid::simix::unmarshal<int>(simcall->args_[1]);
 }
 static inline int simcall_mc_random__getraw__max(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<int>(simcall->args[1]);
+  return simgrid::simix::unmarshal_raw<int>(simcall->args_[1]);
 }
 static inline void simcall_mc_random__set__max(smx_simcall_t simcall, int arg)
 {
-  simgrid::simix::marshal<int>(simcall->args[1], arg);
+  simgrid::simix::marshal<int>(simcall->args_[1], arg);
 }
 static inline int simcall_mc_random__get__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<int>(simcall->result);
+  return simgrid::simix::unmarshal<int>(simcall->result_);
 }
 static inline int simcall_mc_random__getraw__result(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<int>(simcall->result);
+  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);
+  simgrid::simix::marshal<int>(simcall->result_, result);
 }
 
 static inline std::function<void()> const* simcall_run_kernel__get__code(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]);
+  return simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args_[0]);
 }
 static inline std::function<void()> const* simcall_run_kernel__getraw__code(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<std::function<void()> const*>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<std::function<void()> const*>(simcall->args_[0]);
 }
 static inline void simcall_run_kernel__set__code(smx_simcall_t simcall, std::function<void()> const* arg)
 {
-  simgrid::simix::marshal<std::function<void()> const*>(simcall->args[0], arg);
+  simgrid::simix::marshal<std::function<void()> const*>(simcall->args_[0], arg);
 }
 
 static inline std::function<void()> const* simcall_run_blocking__get__code(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args[0]);
+  return simgrid::simix::unmarshal<std::function<void()> const*>(simcall->args_[0]);
 }
 static inline std::function<void()> const* simcall_run_blocking__getraw__code(smx_simcall_t simcall)
 {
-  return simgrid::simix::unmarshal_raw<std::function<void()> const*>(simcall->args[0]);
+  return simgrid::simix::unmarshal_raw<std::function<void()> const*>(simcall->args_[0]);
 }
 static inline void simcall_run_blocking__set__code(smx_simcall_t simcall, std::function<void()> const* arg)
 {
-  simgrid::simix::marshal<std::function<void()> const*>(simcall->args[0], arg);
+  simgrid::simix::marshal<std::function<void()> const*>(simcall->args_[0], arg);
 }
 
 /* The prototype of all simcall handlers, automatically generated for you */
 
-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 void simcall_HANDLER_execution_wait(smx_simcall_t simcall, simgrid::kernel::activity::ExecImpl* execution);
+XBT_PRIVATE void simcall_HANDLER_execution_waitany_for(smx_simcall_t simcall, simgrid::kernel::activity::ExecImpl** execs, size_t count, double timeout);
 XBT_PRIVATE void simcall_HANDLER_execution_test(smx_simcall_t simcall, simgrid::kernel::activity::ExecImpl* execution);
-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 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 void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl** comms,
-                                              size_t count, double timeout);
-XBT_PRIVATE void simcall_HANDLER_comm_wait(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl* comm,
-                                           double timeout);
+XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, unsigned char* 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, unsigned char* 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, bool detached);
+XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_actor_t receiver, smx_mailbox_t mbox, unsigned char* 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, unsigned char* 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, simgrid::kernel::activity::CommImpl** comms, size_t count, double timeout);
+XBT_PRIVATE void simcall_HANDLER_comm_wait(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl* comm, double timeout);
 XBT_PRIVATE void simcall_HANDLER_comm_test(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl* comm);
-XBT_PRIVATE void simcall_HANDLER_comm_testany(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl** comms,
-                                              size_t count);
+XBT_PRIVATE void simcall_HANDLER_comm_testany(smx_simcall_t simcall, simgrid::kernel::activity::CommImpl** 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);
@@ -1051,4 +1018,4 @@ XBT_PRIVATE void simcall_HANDLER_cond_wait_timeout(smx_simcall_t simcall, smx_co
 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 void simcall_HANDLER_io_wait(smx_simcall_t simcall, simgrid::kernel::activity::IoImpl* io);
-XBT_PRIVATE int simcall_HANDLER_mc_random(smx_simcall_t simcall, int min, int max);
\ No newline at end of file
+XBT_PRIVATE int simcall_HANDLER_mc_random(smx_simcall_t simcall, int min, int max);
index 17dfef1..fcb408d 100644 (file)
 #include "xbt/ex.h"
 #include <functional>
 #include <simgrid/simix.hpp>
+#include <xbt/log.h>
 /** @cond */ // Please Doxygen, don't look at this
 
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix);
+
 template<class R, class... T>
 inline static R simcall(e_smx_simcall_t call, T const&... t)
 {
   smx_actor_t self = SIMIX_process_self();
   simgrid::simix::marshal(&self->simcall, call, t...);
   if (self != simix_global->maestro_process) {
-    XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->get_cname(), SIMIX_simcall_name(self->simcall.call),
-              (int)self->simcall.call);
+    XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->get_cname(), SIMIX_simcall_name(self->simcall.call_),
+              (int)self->simcall.call_);
     self->yield();
   } else {
-    SIMIX_simcall_handle(&self->simcall, 0);
+    self->simcall_handle(0);
   }
-  return simgrid::simix::unmarshal<R>(self->simcall.result);
-}
-
-inline static void simcall_BODY_process_suspend(smx_actor_t process)
-{
-  if (0) /* Go to that function to follow the code flow through the simcall barrier */
-    simcall_HANDLER_process_suspend(&SIMIX_process_self()->simcall, process);
-  return simcall<void, smx_actor_t>(SIMCALL_PROCESS_SUSPEND, process);
-}
-
-inline static int simcall_BODY_process_join(smx_actor_t process, double timeout)
-{
-  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);
+  return simgrid::simix::unmarshal<R>(self->simcall.result_);
 }
 
-inline static int simcall_BODY_process_sleep(double duration)
+inline static int simcall_BODY_execution_wait(simgrid::kernel::activity::ExecImpl* execution)
 {
   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);
+    simcall_HANDLER_execution_wait(&SIMIX_process_self()->simcall, execution);
+  return simcall<int, simgrid::kernel::activity::ExecImpl*>(SIMCALL_EXECUTION_WAIT, execution);
 }
 
-inline static int simcall_BODY_execution_wait(simgrid::kernel::activity::ExecImpl* execution)
+inline static int simcall_BODY_execution_waitany_for(simgrid::kernel::activity::ExecImpl** execs, size_t count, double timeout)
 {
   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, simgrid::kernel::activity::ExecImpl*>(SIMCALL_EXECUTION_WAIT, execution);
+    simcall_HANDLER_execution_waitany_for(&SIMIX_process_self()->simcall, execs, count, timeout);
+  return simcall<int, simgrid::kernel::activity::ExecImpl**, size_t, double>(SIMCALL_EXECUTION_WAITANY_FOR, execs, count, timeout);
 }
 
-inline static int simcall_BODY_execution_test(simgrid::kernel::activity::ExecImpl* execution)
+inline static bool simcall_BODY_execution_test(simgrid::kernel::activity::ExecImpl* execution)
 {
   if (0) /* Go to that function to follow the code flow through the simcall barrier */
     simcall_HANDLER_execution_test(&SIMIX_process_self()->simcall, execution);
-  return simcall<int, simgrid::kernel::activity::ExecImpl*>(SIMCALL_EXECUTION_TEST, execution);
+  return simcall<bool, simgrid::kernel::activity::ExecImpl*>(SIMCALL_EXECUTION_TEST, execution);
 }
 
-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)
+inline static void simcall_BODY_comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, unsigned char* 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);
+  return simcall<void, smx_actor_t, smx_mailbox_t, double, double, unsigned char*, size_t, simix_match_func_t, simix_copy_data_func_t, void*, double>(SIMCALL_COMM_SEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout);
 }
 
-inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_BODY_comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached)
+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, unsigned char* 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, bool 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);
+  return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, smx_actor_t, smx_mailbox_t, double, double, unsigned char*, size_t, simix_match_func_t, simix_clean_func_t, simix_copy_data_func_t, void*, bool>(SIMCALL_COMM_ISEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached);
 }
 
-inline static void simcall_BODY_comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate)
+inline static void simcall_BODY_comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, unsigned char* 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);
+  return simcall<void, smx_actor_t, smx_mailbox_t, unsigned char*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double, double>(SIMCALL_COMM_RECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
 }
 
-inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_BODY_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate)
+inline static boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> simcall_BODY_comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, unsigned char* 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);
+  return simcall<boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl>, smx_actor_t, smx_mailbox_t, unsigned char*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double>(SIMCALL_COMM_IRECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
 }
 
 inline static int simcall_BODY_comm_waitany(simgrid::kernel::activity::CommImpl** comms, size_t count, 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, count, timeout);
-  return simcall<int, simgrid::kernel::activity::CommImpl**, size_t, double>(SIMCALL_COMM_WAITANY, comms, count,
-                                                                             timeout);
+  return simcall<int, simgrid::kernel::activity::CommImpl**, size_t, double>(SIMCALL_COMM_WAITANY, comms, count, timeout);
 }
 
 inline static void simcall_BODY_comm_wait(simgrid::kernel::activity::CommImpl* comm, double timeout)
@@ -114,11 +102,11 @@ inline static void simcall_BODY_comm_wait(simgrid::kernel::activity::CommImpl* c
   return simcall<void, simgrid::kernel::activity::CommImpl*, double>(SIMCALL_COMM_WAIT, comm, timeout);
 }
 
-inline static int simcall_BODY_comm_test(simgrid::kernel::activity::CommImpl* comm)
+inline static bool simcall_BODY_comm_test(simgrid::kernel::activity::CommImpl* 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, simgrid::kernel::activity::CommImpl*>(SIMCALL_COMM_TEST, comm);
+  return simcall<bool, simgrid::kernel::activity::CommImpl*>(SIMCALL_COMM_TEST, comm);
 }
 
 inline static int simcall_BODY_comm_testany(simgrid::kernel::activity::CommImpl** comms, size_t count)
@@ -203,4 +191,5 @@ 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 */
+}
+/** @endcond */
index 692b303..f2182ee 100644 (file)
  */
 typedef enum {
   SIMCALL_NONE,
-  SIMCALL_PROCESS_SUSPEND,
-  SIMCALL_PROCESS_JOIN,
-  SIMCALL_PROCESS_SLEEP,
   SIMCALL_EXECUTION_WAIT,
+  SIMCALL_EXECUTION_WAITANY_FOR,
   SIMCALL_EXECUTION_TEST,
   SIMCALL_COMM_SEND,
   SIMCALL_COMM_ISEND,
index 9306f6c..c014307 100644 (file)
@@ -26,10 +26,8 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_popping);
 /** @brief Simcalls' names (generated from src/simix/simcalls.in) */
 const char* simcall_names[] = {
     "SIMCALL_NONE",
-    "SIMCALL_PROCESS_SUSPEND",
-    "SIMCALL_PROCESS_JOIN",
-    "SIMCALL_PROCESS_SLEEP",
     "SIMCALL_EXECUTION_WAIT",
+    "SIMCALL_EXECUTION_WAITANY_FOR",
     "SIMCALL_EXECUTION_TEST",
     "SIMCALL_COMM_SEND",
     "SIMCALL_COMM_ISEND",
@@ -57,125 +55,112 @@ const char* simcall_names[] = {
  *
  * This function is generated from src/simix/simcalls.in
  */
-void SIMIX_simcall_handle(smx_simcall_t simcall, int value) {
-  XBT_DEBUG("Handling simcall %p: %s", simcall, SIMIX_simcall_name(simcall->call));
+void simgrid::kernel::actor::ActorImpl::simcall_handle(int value) {
+  XBT_DEBUG("Handling simcall %p: %s", &simcall, SIMIX_simcall_name(simcall.call_));
   SIMCALL_SET_MC_VALUE(simcall, value);
-  if (simcall->issuer->context_->iwannadie)
+  if (context_->iwannadie)
     return;
-  switch (simcall->call) {
-case SIMCALL_PROCESS_SUSPEND:
-  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;
-
-case SIMCALL_PROCESS_SLEEP:
-  simcall_HANDLER_process_sleep(simcall, simgrid::simix::unmarshal<double>(simcall->args[0]));
-  break;
-
-case SIMCALL_EXECUTION_WAIT:
-  simcall_HANDLER_execution_wait(simcall,
-                                 simgrid::simix::unmarshal<simgrid::kernel::activity::ExecImpl*>(simcall->args[0]));
-  break;
-
-case SIMCALL_EXECUTION_TEST:
-  simcall_HANDLER_execution_test(simcall,
-                                 simgrid::simix::unmarshal<simgrid::kernel::activity::ExecImpl*>(simcall->args[0]));
-  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;
-
-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])));
-  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;
-
-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])));
-  SIMIX_simcall_answer(simcall);
-  break;
-
-case SIMCALL_COMM_WAITANY:
-  simcall_HANDLER_comm_waitany(
-      simcall, simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl**>(simcall->args[0]),
-      simgrid::simix::unmarshal<size_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]));
-  break;
-
-case SIMCALL_COMM_WAIT:
-  simcall_HANDLER_comm_wait(simcall, simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl*>(simcall->args[0]),
-                            simgrid::simix::unmarshal<double>(simcall->args[1]));
-  break;
-
-case SIMCALL_COMM_TEST:
-  simcall_HANDLER_comm_test(simcall, simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl*>(simcall->args[0]));
-  break;
-
-case SIMCALL_COMM_TESTANY:
-  simcall_HANDLER_comm_testany(simcall,
-                               simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl**>(simcall->args[0]),
-                               simgrid::simix::unmarshal<size_t>(simcall->args[1]));
-  break;
-
-case SIMCALL_MUTEX_LOCK:
-  simcall_HANDLER_mutex_lock(simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall->args[0]));
-  break;
-
-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;
-
-case SIMCALL_MUTEX_UNLOCK:
-  simcall_HANDLER_mutex_unlock(simcall, simgrid::simix::unmarshal<smx_mutex_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;
-
-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;
-
-case SIMCALL_SEM_ACQUIRE:
-  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_IO_WAIT:
-  simcall_HANDLER_io_wait(simcall, simgrid::simix::unmarshal<simgrid::kernel::activity::IoImpl*>(simcall->args[0]));
-  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;
-
-case SIMCALL_RUN_KERNEL:
-  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;
+  switch (simcall.call_) {
+    case SIMCALL_EXECUTION_WAIT:
+      simcall_HANDLER_execution_wait(&simcall, simgrid::simix::unmarshal<simgrid::kernel::activity::ExecImpl*>(simcall.args_[0]));
+      break;
+
+    case SIMCALL_EXECUTION_WAITANY_FOR:
+      simcall_HANDLER_execution_waitany_for(&simcall, simgrid::simix::unmarshal<simgrid::kernel::activity::ExecImpl**>(simcall.args_[0]), simgrid::simix::unmarshal<size_t>(simcall.args_[1]), simgrid::simix::unmarshal<double>(simcall.args_[2]));
+      break;
+
+    case SIMCALL_EXECUTION_TEST:
+      simcall_HANDLER_execution_test(&simcall, simgrid::simix::unmarshal<simgrid::kernel::activity::ExecImpl*>(simcall.args_[0]));
+      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<unsigned char*>(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<unsigned char*>(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<bool>(simcall.args_[10])));
+      simcall_answer();
+      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<unsigned char*>(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<unsigned char*>(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])));
+      simcall_answer();
+      break;
+
+    case SIMCALL_COMM_WAITANY:
+      simcall_HANDLER_comm_waitany(&simcall, simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl**>(simcall.args_[0]), simgrid::simix::unmarshal<size_t>(simcall.args_[1]), simgrid::simix::unmarshal<double>(simcall.args_[2]));
+      break;
+
+    case SIMCALL_COMM_WAIT:
+      simcall_HANDLER_comm_wait(&simcall, simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl*>(simcall.args_[0]), simgrid::simix::unmarshal<double>(simcall.args_[1]));
+      break;
+
+    case SIMCALL_COMM_TEST:
+      simcall_HANDLER_comm_test(&simcall, simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl*>(simcall.args_[0]));
+      break;
+
+    case SIMCALL_COMM_TESTANY:
+      simcall_HANDLER_comm_testany(&simcall, simgrid::simix::unmarshal<simgrid::kernel::activity::CommImpl**>(simcall.args_[0]), simgrid::simix::unmarshal<size_t>(simcall.args_[1]));
+      break;
+
+    case SIMCALL_MUTEX_LOCK:
+      simcall_HANDLER_mutex_lock(&simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall.args_[0]));
+      break;
+
+    case SIMCALL_MUTEX_TRYLOCK:
+      simgrid::simix::marshal<int>(simcall.result_, simcall_HANDLER_mutex_trylock(&simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall.args_[0])));
+      simcall_answer();
+      break;
+
+    case SIMCALL_MUTEX_UNLOCK:
+      simcall_HANDLER_mutex_unlock(&simcall, simgrid::simix::unmarshal<smx_mutex_t>(simcall.args_[0]));
+      simcall_answer();
+      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;
+
+    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;
+
+    case SIMCALL_SEM_ACQUIRE:
+      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_IO_WAIT:
+      simcall_HANDLER_io_wait(&simcall, simgrid::simix::unmarshal<simgrid::kernel::activity::IoImpl*>(simcall.args_[0]));
+      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])));
+      simcall_answer();
+      break;
+
+    case SIMCALL_RUN_KERNEL:
+      SIMIX_run_kernel(simgrid::simix::unmarshal<std::function<void()> const*>(simcall.args_[0]));
+      simcall_answer();
+      break;
+
+    case SIMCALL_RUN_BLOCKING:
+      SIMIX_run_blocking(simgrid::simix::unmarshal<std::function<void()> const*>(simcall.args_[0]));
+      break;
+
     case NUM_SIMCALLS:
       break;
     case SIMCALL_NONE:
-      THROWF(arg_error, 0, "Asked to do the noop syscall on %s@%s", simcall->issuer->get_cname(),
-             sg_host_get_name(simcall->issuer->get_host()));
+      throw std::invalid_argument(simgrid::xbt::string_printf("Asked to do the noop syscall on %s@%s",
+                                                              get_cname(),
+                                                              sg_host_get_name(get_host())));
     default:
       THROW_IMPOSSIBLE;
   }
index c20bd04..fce643c 100644 (file)
 #include <boost/intrusive_ptr.hpp>
 
 /********************************* Simcalls *********************************/
-XBT_PUBLIC_DATA const char* simcall_names[]; /* Name of each simcall */
-
 #include "popping_enum.h" /* Definition of e_smx_simcall_t, with one value per simcall */
 
+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)(simgrid::kernel::activity::CommImpl*, void*, size_t);
 typedef void (*simix_clean_func_t)(void*);
@@ -23,6 +23,7 @@ typedef void (*FPtr)(void); // Hide the ugliness
 
 /* Pack all possible scalar types in an union */
 union u_smx_scalar {
+  bool b;
   char c;
   short s;
   int i;
@@ -42,22 +43,20 @@ union u_smx_scalar {
  * @brief Represents a simcall to the kernel.
  */
 struct s_smx_simcall {
-  e_smx_simcall_t call;
-  smx_actor_t issuer;
-  smx_timer_t timer;
-  int mc_value;
-  u_smx_scalar args[11];
-  u_smx_scalar result;
+  e_smx_simcall_t call_                     = SIMCALL_NONE;
+  smx_actor_t issuer_                       = nullptr;
+  smx_timer_t timeout_cb_                   = nullptr; // Callback to timeouts
+  simgrid::mc::SimcallInspector* inspector_ = nullptr; // makes that simcall observable by the MC
+  int mc_value_                             = 0;
+  u_smx_scalar args_[11]                    = {{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}};
+  u_smx_scalar result_                      = {0};
 };
 
-#define SIMCALL_SET_MC_VALUE(simcall, value) ((simcall)->mc_value = (value))
-#define SIMCALL_GET_MC_VALUE(simcall) ((simcall)->mc_value)
+#define SIMCALL_SET_MC_VALUE(simcall, value) ((simcall).mc_value_ = (value))
+#define SIMCALL_GET_MC_VALUE(simcall) ((simcall).mc_value_)
 
 /******************************** General *************************************/
 
-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 void SIMIX_run_kernel(std::function<void()> const* code);
 XBT_PRIVATE void SIMIX_run_blocking(std::function<void()> const* code);
@@ -94,6 +93,7 @@ template <typename T> struct marshal_t {
   inline T unmarshal_raw(type<T>, u_smx_scalar const& simcall)                                                         \
   { /* Exactly same as unmarshal. It differs only for intrusive_ptr */ return simcall.field; }
 
+SIMIX_MARSHAL(bool, b);
 SIMIX_MARSHAL(char, c);
 SIMIX_MARSHAL(short, s);
 SIMIX_MARSHAL(int, i);
@@ -177,29 +177,29 @@ 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 marshal_args(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 marshal_args(smx_simcall_t simcall, A const& a)
 {
-  marshal(simcall->args[I], 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 marshal_args(smx_simcall_t simcall, A const& a, B const&... b)
 {
-  marshal(simcall->args[I], a);
-  marshalArgs<I + 1>(simcall, b...);
+  marshal(simcall->args_[I], a);
+  marshal_args<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)
 {
-  simcall->call = call;
-  memset(&simcall->result, 0, sizeof(simcall->result));
-  memset(simcall->args, 0, sizeof(simcall->args));
-  marshalArgs<0>(simcall, a...);
+  simcall->call_ = call;
+  memset(&simcall->result_, 0, sizeof(simcall->result_));
+  memset(simcall->args_, 0, sizeof(simcall->args_));
+  marshal_args<0>(simcall, a...);
 }
 }
 }
index a657616..05a4c06 100644 (file)
 # 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_suspend(smx_actor_t process) [[block]];
-int  process_join(smx_actor_t process, double timeout) [[block]];
-int  process_sleep(double duration) [[block]];
-
 int           execution_wait(simgrid::kernel::activity::ExecImpl* execution) [[block]];
-int           execution_test(simgrid::kernel::activity::ExecImpl* execution) [[block]];
+int           execution_waitany_for(simgrid::kernel::activity::ExecImpl** execs, size_t count, double timeout) [[block]];
+bool          execution_test(simgrid::kernel::activity::ExecImpl* execution) [[block]];
 
-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]];
-boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> 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);
-void           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) [[block]];
-boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> 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);
+void           comm_send(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, unsigned char* 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]];
+boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm_isend(smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, unsigned char* 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, bool detached);
+void           comm_recv(smx_actor_t receiver, smx_mailbox_t mbox, unsigned char* 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) [[block]];
+boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> comm_irecv(smx_actor_t receiver, smx_mailbox_t mbox, unsigned char* 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);
 int            comm_waitany(simgrid::kernel::activity::CommImpl** comms, size_t count, double timeout) [[block]];
 void           comm_wait(simgrid::kernel::activity::CommImpl* comm, double timeout) [[block]];
-int            comm_test(simgrid::kernel::activity::CommImpl* comm) [[block]];
+bool           comm_test(simgrid::kernel::activity::CommImpl* comm) [[block]];
 int            comm_testany(simgrid::kernel::activity::CommImpl** comms, size_t count) [[block]];
 
 void        mutex_lock(smx_mutex_t mutex) [[block]];
index c25d519..01cca20 100755 (executable)
@@ -8,7 +8,7 @@
 
 import re
 import glob
-
+import sys
 
 class Arg(object):
 
@@ -54,7 +54,7 @@ class Simcall(object):
         # smx_host_t h)
         if self.simcalls_pre is None:
             self.simcalls_pre = set()
-            for fn in glob.glob('smx_*') + glob.glob('ActorImpl*') + \
+            for fn in glob.glob('smx_*') + glob.glob('../kernel/actor/ActorImpl*') + \
                     glob.glob('../mc/*cpp') + glob.glob('../kernel/activity/*cpp'):
                 f = open(fn)
                 self.simcalls_pre |= set(re.findall(r'simcall_HANDLER_(.*?)\(', f.read()))
@@ -95,17 +95,17 @@ class Simcall(object):
             res.append('static inline %s simcall_%s__get__%s(smx_simcall_t simcall)' % (
                 arg.rettype(), self.name, arg.name))
             res.append('{')
-            res.append('  return simgrid::simix::unmarshal<%s>(simcall->args[%i]);' % (arg.rettype(), i))
+            res.append('  return simgrid::simix::unmarshal<%s>(simcall->args_[%i]);' % (arg.rettype(), i))
             res.append('}')
             res.append('static inline %s simcall_%s__getraw__%s(smx_simcall_t simcall)' % (
                 rawtype, self.name, arg.name))
             res.append('{')
-            res.append('  return simgrid::simix::unmarshal_raw<%s>(simcall->args[%i]);' % (rawtype, i))
+            res.append('  return simgrid::simix::unmarshal_raw<%s>(simcall->args_[%i]);' % (rawtype, i))
             res.append('}')
             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
@@ -114,37 +114,38 @@ 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('{')
-            res.append('  return simgrid::simix::unmarshal_raw<%s>(simcall->result);' % rawtype)
+            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('{')
-            res.append('  simgrid::simix::marshal<%s>(simcall->result, result);' % (self.res.rettype()))
+            res.append('  simgrid::simix::marshal<%s>(simcall->result_, result);' % (self.res.rettype()))
             res.append('}')
         return '\n'.join(res)
 
     def case(self):
         res = []
-        args = ["simgrid::simix::unmarshal<%s>(simcall->args[%d])" % (arg.rettype(), i)
+        indent = '    '
+        args = ["simgrid::simix::unmarshal<%s>(simcall.args_[%d])" % (arg.rettype(), i)
                 for i, arg in enumerate(self.args)]
-        res.append('case SIMCALL_%s:' % (self.name.upper()))
+        res.append(indent + 'case SIMCALL_%s:' % (self.name.upper()))
         if self.need_handler:
-            call = "simcall_HANDLER_%s(simcall%s%s)" % (self.name,
+            call = "simcall_HANDLER_%s(&simcall%s%s)" % (self.name,
                                                         ", " if len(args) > 0 else "",
                                                         ', '.join(args))
         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(indent + "  simgrid::simix::marshal<%s>(simcall.result_, %s);" % (self.res.rettype(), call))
         else:
-            res.append("  " + call + ";")
+            res.append(indent + "  " + call + ";")
         if self.call_kind != 'Blck':
-            res.append('  SIMIX_simcall_answer(simcall);')
-        res.append('  break;')
+            res.append(indent + '  simcall_answer();')
+        res.append(indent + '  break;')
         res.append('')
         return '\n'.join(res)
 
@@ -193,7 +194,8 @@ def parse(fn):
             continue
         match = re.match(
             r'^(\S+)\s+([^\)\(\s]+)\s*\(*(.*)\)\s*(\[\[.*\]\])?\s*;\s*?$', line)
-        assert match, line
+        if not match:
+            raise AssertionError(line)
         ret, name, args, attrs = match.groups()
         sargs = []
         if not re.match(r"^\s*$", args):
@@ -217,7 +219,7 @@ def parse(fn):
                 elif attr == "nohandler":
                     handler = False
                 else:
-                    assert False, "Unknown attribute %s in: %s" % (attr, line)
+                    raise AssertionError("Unknown attribute %s in: %s" % (attr, line))
         sim = Simcall(name, handler, Arg('result', ret), sargs, ans)
         if resdi is None:
             simcalls.append(sim)
@@ -264,8 +266,9 @@ def handle(fd, func, simcalls, guarded_simcalls):
     for guard, ll in guarded_simcalls.items():
         fd.write('\n#if %s\n' % (guard))
         fd.write('\n'.join(func(simcall) for simcall in ll))
-        fd.write('\n#endif\n')
+        fd.write('\n#endif')
 
+    fd.write('\n')
 
 if __name__ == '__main__':
     simcalls, simcalls_dict = parse('simcalls.in')
@@ -274,10 +277,9 @@ if __name__ == '__main__':
     ok &= all(map(Simcall.check, simcalls))
     for k, v in simcalls_dict.items():
         ok &= all(map(Simcall.check, v))
-    # FIXME: we should not hide it
-    # if not ok:
-    #  print ("Some checks fail!")
-    #  sys.exit(1)
+    if not ok:
+      print ("Some checks fail!")
+      sys.exit(1)
 
     #
     # popping_accessors.hpp
@@ -286,7 +288,7 @@ if __name__ == '__main__':
     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")
+        "\n/* The prototype of all simcall handlers, automatically generated for you */\n\n")
     handle(fd, Simcall.handler_prototype, simcalls, simcalls_dict)
     fd.close()
 
@@ -302,7 +304,6 @@ if __name__ == '__main__':
 
     handle(fd, Simcall.enum, simcalls, simcalls_dict)
 
-    fd.write('\n')
     fd.write('  NUM_SIMCALLS\n')
     fd.write('} e_smx_simcall_t;\n')
     fd.close()
@@ -330,7 +331,7 @@ if __name__ == '__main__':
     fd.write('    "SIMCALL_NONE",\n')
     handle(fd, Simcall.string, simcalls, simcalls_dict)
 
-    fd.write('\n};\n\n')
+    fd.write('};\n\n')
 
     fd.write('/** @private\n')
     fd.write(
@@ -339,22 +340,23 @@ if __name__ == '__main__':
     fd.write(' * This function is generated from src/simix/simcalls.in\n')
     fd.write(' */\n')
     fd.write(
-        'void SIMIX_simcall_handle(smx_simcall_t simcall, int value) {\n')
+        'void simgrid::kernel::actor::ActorImpl::simcall_handle(int value) {\n')
     fd.write(
-        '  XBT_DEBUG("Handling simcall %p: %s", simcall, SIMIX_simcall_name(simcall->call));\n')
+        '  XBT_DEBUG("Handling simcall %p: %s", &simcall, SIMIX_simcall_name(simcall.call_));\n')
     fd.write('  SIMCALL_SET_MC_VALUE(simcall, value);\n')
     fd.write(
-        '  if (simcall->issuer->context_->iwannadie)\n')
+        '  if (context_->iwannadie)\n')
     fd.write('    return;\n')
-    fd.write('  switch (simcall->call) {\n')
+    fd.write('  switch (simcall.call_) {\n')
 
     handle(fd, Simcall.case, simcalls, simcalls_dict)
 
     fd.write('    case NUM_SIMCALLS:\n')
     fd.write('      break;\n')
     fd.write('    case SIMCALL_NONE:\n')
-    fd.write('      THROWF(arg_error, 0, "Asked to do the noop syscall on %s@%s", simcall->issuer->get_cname(),\n')
-    fd.write('             sg_host_get_name(simcall->issuer->get_host()));\n')
+    fd.write('      throw std::invalid_argument(simgrid::xbt::string_printf("Asked to do the noop syscall on %s@%s",\n')
+    fd.write('                                                              get_cname(),\n')
+    fd.write('                                                              sg_host_get_name(get_host())));\n')
     fd.write('    default:\n')
     fd.write('      THROW_IMPOSSIBLE;\n')
     fd.write('  }\n')
@@ -371,24 +373,27 @@ if __name__ == '__main__':
     fd.write('#include "xbt/ex.h"\n')
     fd.write('#include <functional>\n')
     fd.write('#include <simgrid/simix.hpp>\n')
+    fd.write('#include <xbt/log.h>\n')
 
     fd.write("/** @cond */ // Please Doxygen, don't look at this\n")
     fd.write('''
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix);
+
 template<class R, class... T>
 inline static R simcall(e_smx_simcall_t call, T const&... t)
 {
   smx_actor_t self = SIMIX_process_self();
   simgrid::simix::marshal(&self->simcall, call, t...);
   if (self != simix_global->maestro_process) {
-    XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->get_cname(), SIMIX_simcall_name(self->simcall.call),
-              (int)self->simcall.call);
+    XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->get_cname(), SIMIX_simcall_name(self->simcall.call_),
+              (int)self->simcall.call_);
     self->yield();
   } else {
-    SIMIX_simcall_handle(&self->simcall, 0);
+    self->simcall_handle(0);
   }
-  return simgrid::simix::unmarshal<R>(self->simcall.result);
+  return simgrid::simix::unmarshal<R>(self->simcall.result_);
 }
 ''')
     handle(fd, Simcall.body, simcalls, simcalls_dict)
-    fd.write(" /** @endcond */\n")
+    fd.write("/** @endcond */\n")
     fd.close()
index f79f6c3..422f0a8 100644 (file)
@@ -48,8 +48,7 @@ void SIMIX_launch_application(const std::string& file)
     parse_status = surf_parse();
     surf_parse_close();
     xbt_assert(not parse_status, "Parse error at %s:%d", file.c_str(), surf_parse_lineno);
-  }
-  catch (xbt_ex& e) {
+  } catch (const simgrid::Exception&) {
     XBT_ERROR(
         "Unrecoverable error at %s:%d. The full exception stack follows, in case it helps you to diagnose the problem.",
         file.c_str(), surf_parse_lineno);
@@ -57,11 +56,6 @@ void SIMIX_launch_application(const std::string& file)
   }
 }
 
-void SIMIX_launch_application(const char* file) // deprecated
-{
-  simgrid_load_deployment(file);
-}
-
 // Wrap a main() function into a ActorCodeFactory:
 static simgrid::simix::ActorCodeFactory toActorCodeFactory(xbt_main_func_t code)
 {
@@ -89,11 +83,6 @@ void SIMIX_function_register(const std::string& name, void (*code)(std::vector<s
   simix_global->registered_functions[name] = toActorCodeFactory(code);
 }
 
-void SIMIX_function_register(const char* name, xbt_main_func_t code) // deprecated
-{
-  simgrid_register_function(name, code);
-}
-
 /**
  * @brief Registers a #xbt_main_func_t code as default value.
  *
@@ -136,7 +125,7 @@ void SIMIX_process_set_function(const char* process_host, const char* process_fu
 
   sg_host_t host = sg_host_by_name(process_host);
   if (not host)
-    THROWF(arg_error, 0, "Host '%s' unknown", process_host);
+    throw std::invalid_argument(simgrid::xbt::string_printf("Host '%s' unknown", process_host));
   actor.host = process_host;
   actor.args.push_back(process_function);
   /* add arguments */
diff --git a/src/simix/smx_environment.cpp b/src/simix/smx_environment.cpp
deleted file mode 100644 (file)
index e7f2c29..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
-
-/* This program is 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/engine.h>
-#include <simgrid/simix.h>
-
-void SIMIX_create_environment(const char* file) // XBT_ATTRIB_DEPRECATED_v324
-{
-  simgrid_load_platform(file);
-}
index b44d2c8..7414de1 100644 (file)
@@ -32,15 +32,21 @@ std::unique_ptr<simgrid::simix::Global> simix_global;
 
 void (*SMPI_switch_data_segment)(simgrid::s4u::ActorPtr) = nullptr;
 
-bool _sg_do_verbose_exit = true;
-static void inthandler(int)
+namespace simgrid {
+namespace simix {
+simgrid::config::Flag<double> cfg_verbose_exit{
+    "debug/verbose-exit", {"verbose-exit"}, "Display the actor status at exit", true};
+}
+} // namespace simgrid
+XBT_ATTRIB_NORETURN 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').");
-     SIMIX_display_process_status();
+  if (simgrid::simix::cfg_verbose_exit) {
+    XBT_INFO("CTRL-C pressed. The current status will be displayed before exit (disable that behavior with option "
+             "'debug/verbose-exit').");
+    SIMIX_display_process_status();
   }
   else {
-     XBT_INFO("CTRL-C pressed, exiting. Hiding the current process status since 'verbose-exit' is set to false.");
+    XBT_INFO("CTRL-C pressed, exiting. Hiding the current process status since 'debug/verbose-exit' is set to false.");
   }
   exit(1);
 }
@@ -48,19 +54,20 @@ static void inthandler(int)
 #ifndef _WIN32
 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 %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"
-                    "Failing hardware can sometimes generate such errors too.\n"
-                    "\n"
-                    "If you think you've found a bug in SimGrid, please report it along with a\n"
-                    "Minimal Working Example (MWE) reproducing your problem and a full backtrace\n"
-                    "of the fault captured with gdb or valgrind.\n",
+  if ((siginfo->si_signo == SIGSEGV && siginfo->si_code == SEGV_ACCERR) || siginfo->si_signo == SIGBUS) {
+    fprintf(stderr,
+            "Access violation or Bus error 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 %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"
+            "Failing hardware can sometimes generate such errors too.\n"
+            "\n"
+            "If you think you've found a bug in SimGrid, please report it along with a\n"
+            "Minimal Working Example (MWE) reproducing your problem and a full backtrace\n"
+            "of the fault captured with gdb or valgrind.\n",
             smx_context_stack_size / 1024);
   } else  if (siginfo->si_signo == SIGSEGV) {
     fprintf(stderr, "Segmentation fault.\n");
@@ -107,14 +114,17 @@ static void install_segvhandler()
   action.sa_flags = SA_ONSTACK | SA_RESETHAND | SA_SIGINFO;
   sigemptyset(&action.sa_mask);
 
-  if (sigaction(SIGSEGV, &action, &old_action) == -1) {
-    XBT_WARN("Failed to register signal handler for SIGSEGV: %s", strerror(errno));
-    return;
-  }
-  if ((old_action.sa_flags & SA_SIGINFO) || old_action.sa_handler != SIG_DFL) {
-    XBT_DEBUG("A signal handler was already installed for SIGSEGV (%p). Restore it.",
-             (old_action.sa_flags & SA_SIGINFO) ? (void*)old_action.sa_sigaction : (void*)old_action.sa_handler);
-    sigaction(SIGSEGV, &old_action, nullptr);
+  /* Linux tend to raise only SIGSEGV where other systems also raise SIGBUS on severe error */
+  for (int sig : {SIGSEGV, SIGBUS}) {
+    if (sigaction(sig, &action, &old_action) == -1) {
+      XBT_WARN("Failed to register signal handler for signal %d: %s", sig, strerror(errno));
+      continue;
+    }
+    if ((old_action.sa_flags & SA_SIGINFO) || old_action.sa_handler != SIG_DFL) {
+      XBT_DEBUG("A signal handler was already installed for signal %d (%p). Restore it.", sig,
+                (old_action.sa_flags & SA_SIGINFO) ? (void*)old_action.sa_sigaction : (void*)old_action.sa_handler);
+      sigaction(sig, &old_action, nullptr);
+    }
   }
 }
 
@@ -138,35 +148,57 @@ void Timer::remove()
   delete this;
 }
 
+/** Execute all the tasks that are queued, e.g. `.then()` callbacks of futures. */
+bool Global::execute_tasks()
+{
+  xbt_assert(tasksTemp.empty());
+
+  if (tasks.empty())
+    return false;
+
+  do {
+    // We don't want the callbacks to modify the vector we are iterating over:
+    tasks.swap(tasksTemp);
+
+    // Execute all the queued tasks:
+    for (auto& task : tasksTemp)
+      task();
+
+    tasksTemp.clear();
+  } while (not tasks.empty());
+
+  return true;
+}
+
 void Global::empty_trash()
 {
   while (not actors_to_destroy.empty()) {
     smx_actor_t actor = &actors_to_destroy.front();
     actors_to_destroy.pop_front();
-    XBT_DEBUG("Getting rid of %p", actor);
+    XBT_DEBUG("Getting rid of %s (refcount: %d)", actor->get_cname(), actor->get_refcount());
     intrusive_ptr_release(actor);
   }
 #if SIMGRID_HAVE_MC
-  xbt_dynar_reset(simix_global->dead_actors_vector);
+  xbt_dynar_reset(dead_actors_vector);
 #endif
 }
 /**
- * @brief Executes the actors in simix_global->actors_to_run.
+ * @brief Executes the actors in actors_to_run.
  *
- * The actors in simix_global->actors_to_run are run (in parallel if  possible). On exit, simix_global->actors_to_run
- * is empty, and simix_global->actors_that_ran contains the list of actors that just ran.
- * The two lists are swapped so, be careful when using them before and after a call to this function.
+ * The actors in actors_to_run are run (in parallel if possible). On exit, actors_to_run is empty, and actors_that_ran
+ * contains the list of actors that just ran.  The two lists are swapped so, be careful when using them before and after
+ * a call to this function.
  */
 void Global::run_all_actors()
 {
-  SIMIX_context_runall();
+  simix_global->context_factory->run_all();
 
-  simix_global->actors_to_run.swap(simix_global->actors_that_ran);
-  simix_global->actors_to_run.clear();
+  actors_to_run.swap(actors_that_ran);
+  actors_to_run.clear();
 }
 
-simgrid::config::Flag<double> breakpoint{"simix/breakpoint",
-                                         "When non-negative, raise a SIGTRAP after given (simulated) time", -1.0};
+simgrid::config::Flag<double> cfg_breakpoint{
+    "debug/breakpoint", {"simix/breakpoint"}, "When non-negative, raise a SIGTRAP after given (simulated) time", -1.0};
 }
 }
 
@@ -192,10 +224,10 @@ void SIMIX_global_init(int *argc, char **argv)
 #endif
 
   if (simix_global == nullptr) {
+    surf_init(argc, argv); /* Initialize SURF structures */
+
     simix_global.reset(new simgrid::simix::Global());
     simix_global->maestro_process = nullptr;
-
-    surf_init(argc, argv);      /* Initialize SURF structures */
     SIMIX_context_mod_init();
 
     // Either create a new context with maestro or create
@@ -210,7 +242,7 @@ void SIMIX_global_init(int *argc, char **argv)
 #endif
     /* register a function to be called by SURF after the environment creation */
     sg_platf_init();
-    simgrid::s4u::on_platform_created.connect(surf_presolve);
+    simgrid::s4u::Engine::on_platform_created.connect(surf_presolve);
 
     simgrid::s4u::Storage::on_creation.connect([](simgrid::s4u::Storage const& storage) {
       sg_storage_t s = simgrid::s4u::Storage::by_name(storage.get_name());
@@ -218,11 +250,8 @@ void SIMIX_global_init(int *argc, char **argv)
     });
   }
 
-  if (simgrid::config::get_value<bool>("clean-atexit"))
+  if (simgrid::config::get_value<bool>("debug/clean-atexit"))
     atexit(SIMIX_clean);
-
-  if (_sg_cfg_exit_asap)
-    exit(0);
 }
 
 int smx_cleaned = 0;
@@ -259,7 +288,7 @@ void SIMIX_clean()
 
   /* Kill all processes (but maestro) */
   simix_global->maestro_process->kill_all();
-  SIMIX_context_runall();
+  simix_global->context_factory->run_all();
   simix_global->empty_trash();
 
   /* Exit the SIMIX network module */
@@ -313,23 +342,24 @@ static void SIMIX_wake_processes()
   for (auto const& model : all_existing_models) {
     simgrid::kernel::resource::Action* action;
 
-    XBT_DEBUG("Handling the processes whose action failed (if any)");
+    XBT_DEBUG("Handling the failed actions (if any)");
     while ((action = model->extract_failed_action())) {
       XBT_DEBUG("   Handling Action %p",action);
-      SIMIX_simcall_exit(static_cast<simgrid::kernel::activity::ActivityImpl*>(action->get_data()));
+      if (action->get_activity() != nullptr)
+        simgrid::kernel::activity::ActivityImplPtr(action->get_activity())->post();
     }
-    XBT_DEBUG("Handling the processes whose action terminated normally (if any)");
+    XBT_DEBUG("Handling the terminated actions (if any)");
     while ((action = model->extract_done_action())) {
       XBT_DEBUG("   Handling Action %p",action);
-      if (action->get_data() == nullptr)
+      if (action->get_activity() == nullptr)
         XBT_DEBUG("probably vcpu's action %p, skip", action);
       else
-        SIMIX_simcall_exit(static_cast<simgrid::kernel::activity::ActivityImpl*>(action->get_data()));
+        simgrid::kernel::activity::ActivityImplPtr(action->get_activity())->post();
     }
   }
 }
 
-/** Handle any pending timer */
+/** Handle any pending timer. Returns if something was actually run. */
 static bool SIMIX_execute_timers()
 {
   bool result = false;
@@ -338,48 +368,19 @@ static bool SIMIX_execute_timers()
     // FIXME: make the timers being real callbacks (i.e. provide dispatchers that read and expand the args)
     smx_timer_t timer = simgrid::simix::simix_timers.top().second;
     simgrid::simix::simix_timers.pop();
-    try {
-      timer->callback();
-    } catch (...) {
-      xbt_die("Exception thrown ouf of timer callback");
-    }
+    timer->callback();
     delete timer;
   }
   return result;
 }
 
-/** Execute all the tasks that are queued
- *
- *  e.g. `.then()` callbacks of futures.
- **/
-static bool SIMIX_execute_tasks()
-{
-  xbt_assert(simix_global->tasksTemp.empty());
-
-  if (simix_global->tasks.empty())
-    return false;
-
-  do {
-    // We don't want the callbacks to modify the vector we are iterating over:
-    simix_global->tasks.swap(simix_global->tasksTemp);
-
-    // Execute all the queued tasks:
-    for (auto& task : simix_global->tasksTemp)
-      task();
-
-    simix_global->tasksTemp.clear();
-  } while (not simix_global->tasks.empty());
-
-  return true;
-}
-
 /**
  * @ingroup SIMIX_API
  * @brief Run the main simulation loop.
  */
 void SIMIX_run()
 {
-  if (not MC_record_path.empty()) {
+  if (MC_record_replay_is_active()) {
     simgrid::mc::replay(MC_record_path);
     return;
   }
@@ -389,9 +390,9 @@ void SIMIX_run()
   do {
     XBT_DEBUG("New Schedule Round; size(queue)=%zu", simix_global->actors_to_run.size());
 
-    if (simgrid::simix::breakpoint >= 0.0 && surf_get_clock() >= simgrid::simix::breakpoint) {
-      XBT_DEBUG("Breakpoint reached (%g)", simgrid::simix::breakpoint.get());
-      simgrid::simix::breakpoint = -1.0;
+    if (simgrid::simix::cfg_breakpoint >= 0.0 && surf_get_clock() >= simgrid::simix::cfg_breakpoint) {
+      XBT_DEBUG("Breakpoint reached (%g)", simgrid::simix::cfg_breakpoint.get());
+      simgrid::simix::cfg_breakpoint = -1.0;
 #ifdef SIGTRAP
       std::raise(SIGTRAP);
 #else
@@ -399,7 +400,7 @@ void SIMIX_run()
 #endif
     }
 
-    SIMIX_execute_tasks();
+    simix_global->execute_tasks();
 
     while (not simix_global->actors_to_run.empty()) {
       XBT_DEBUG("New Sub-Schedule Round; size(queue)=%zu", simix_global->actors_to_run.size());
@@ -429,7 +430,7 @@ void SIMIX_run()
        *        - If a process is added because it's getting killed, its subsequent actions shouldn't matter
        *        - If a process gets added to actors_to_run because one of their blocking action constituting the meat
        *          of a simcall terminates, we're still good. Proof:
-       *          - You are added from SIMIX_simcall_answer() only. When this function is called depends on the resource
+       *          - You are added from ActorImpl::simcall_answer() only. When this function is called depends on the resource
        *            kind (network, cpu, disk, whatever), but the same arguments hold. Let's take communications as an
        *            example.
        *          - For communications, this function is called from SIMIX_comm_finish().
@@ -470,15 +471,15 @@ void SIMIX_run()
        */
 
       for (smx_actor_t const& process : simix_global->actors_that_ran) {
-        if (process->simcall.call != SIMCALL_NONE) {
-          SIMIX_simcall_handle(&process->simcall, 0);
+        if (process->simcall.call_ != SIMCALL_NONE) {
+          process->simcall_handle(0);
         }
       }
 
-      SIMIX_execute_tasks();
+      simix_global->execute_tasks();
       do {
         SIMIX_wake_processes();
-      } while (SIMIX_execute_tasks());
+      } while (simix_global->execute_tasks());
 
       /* 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())
@@ -503,7 +504,7 @@ void SIMIX_run()
     bool again = false;
     do {
       again = SIMIX_execute_timers();
-      if (SIMIX_execute_tasks())
+      if (simix_global->execute_tasks())
         again = true;
       SIMIX_wake_processes();
     } while (again);
@@ -525,10 +526,10 @@ void SIMIX_run()
       XBT_CRITICAL("Oops! Deadlock or code not perfectly clean.");
     }
     SIMIX_display_process_status();
-    simgrid::s4u::on_deadlock();
+    simgrid::s4u::Engine::on_deadlock();
     xbt_abort();
   }
-  simgrid::s4u::on_simulation_end();
+  simgrid::s4u::Engine::on_simulation_end();
 }
 
 double SIMIX_timer_next()
@@ -564,34 +565,38 @@ void SIMIX_display_process_status()
   /*  List the process and their state */
   XBT_INFO("Legend of the following listing: \"Process <pid> (<name>@<host>): <status>\"");
   for (auto const& kv : simix_global->process_list) {
-    smx_actor_t process = kv.second;
+    smx_actor_t actor = kv.second;
 
-    if (process->waiting_synchro) {
+    if (actor->waiting_synchro) {
 
       const char* synchro_description = "unknown";
+      // we don't care about the Activity type to get its name, use RawImpl
+      const char* name =
+          boost::static_pointer_cast<simgrid::kernel::activity::ActivityImpl_T<simgrid::kernel::activity::RawImpl>>(
+              actor->waiting_synchro)
+              ->get_cname();
 
-      if (boost::dynamic_pointer_cast<simgrid::kernel::activity::ExecImpl>(process->waiting_synchro) != nullptr)
+      if (boost::dynamic_pointer_cast<simgrid::kernel::activity::ExecImpl>(actor->waiting_synchro) != nullptr)
         synchro_description = "execution";
 
-      if (boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(process->waiting_synchro) != nullptr)
+      if (boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(actor->waiting_synchro) != nullptr)
         synchro_description = "communication";
 
-      if (boost::dynamic_pointer_cast<simgrid::kernel::activity::SleepImpl>(process->waiting_synchro) != nullptr)
+      if (boost::dynamic_pointer_cast<simgrid::kernel::activity::SleepImpl>(actor->waiting_synchro) != nullptr)
         synchro_description = "sleeping";
 
-      if (boost::dynamic_pointer_cast<simgrid::kernel::activity::RawImpl>(process->waiting_synchro) != nullptr)
+      if (boost::dynamic_pointer_cast<simgrid::kernel::activity::RawImpl>(actor->waiting_synchro) != nullptr)
         synchro_description = "synchronization";
 
-      if (boost::dynamic_pointer_cast<simgrid::kernel::activity::IoImpl>(process->waiting_synchro) != nullptr)
+      if (boost::dynamic_pointer_cast<simgrid::kernel::activity::IoImpl>(actor->waiting_synchro) != nullptr)
         synchro_description = "I/O";
 
-      XBT_INFO("Process %ld (%s@%s): waiting for %s synchro %p (%s) in state %d to finish", process->get_pid(),
-               process->get_cname(), process->get_host()->get_cname(), synchro_description,
-               process->waiting_synchro.get(), process->waiting_synchro->get_cname(),
-               (int)process->waiting_synchro->state_);
+      XBT_INFO("Actor %ld (%s@%s): waiting for %s activity %p (%s) in state %d to finish", actor->get_pid(),
+               actor->get_cname(), actor->get_host()->get_cname(), synchro_description, actor->waiting_synchro.get(),
+               name, (int)actor->waiting_synchro->state_);
     }
     else {
-      XBT_INFO("Process %ld (%s@%s)", process->get_pid(), process->get_cname(), process->get_host()->get_cname());
+      XBT_INFO("Actor %ld (%s@%s)", actor->get_pid(), actor->get_cname(), actor->get_host()->get_cname());
     }
   }
 }
index d6a15bb..2689334 100644 (file)
@@ -24,6 +24,7 @@ class Global {
   friend XBT_PUBLIC bool simgrid::s4u::this_actor::is_maestro();
 
 public:
+  bool execute_tasks();
   /**
    * Garbage collection
    *
@@ -74,16 +75,4 @@ XBT_PUBLIC_DATA std::unique_ptr<simgrid::simix::Global> simix_global;
 
 XBT_PUBLIC void SIMIX_clean();
 
-/******************************** Exceptions *********************************/
-/** @brief Ask to the provided ActorImpl to raise the provided exception */
-#define SMX_EXCEPTION(issuer, cat, val, msg)                                                                           \
-  if (1) {                                                                                                             \
-    simgrid::kernel::actor::ActorImpl* _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 9f3ce44..9e96429 100644 (file)
@@ -6,6 +6,7 @@
 #include "private.hpp"
 #include "smpi_comm.hpp"
 #include "smpi_datatype.hpp"
+#include "smpi_errhandler.hpp"
 #include "smpi_op.hpp"
 #include "smpi_request.hpp"
 #include "smpi_win.hpp"
@@ -33,8 +34,8 @@ void smpi_init_fortran_types(){
      MPI_REAL4->add_f();//MPI_REAL4
      MPI_REAL8->add_f();//MPI_REAL8
      MPI_DOUBLE->add_f();//MPI_DOUBLE_PRECISION
-     MPI_C_FLOAT_COMPLEX->add_f();//MPI_COMPLEX
-     MPI_C_DOUBLE_COMPLEX->add_f();//MPI_DOUBLE_COMPLEX
+     MPI_COMPLEX8->add_f();//MPI_COMPLEX
+     MPI_COMPLEX16->add_f();//MPI_DOUBLE_COMPLEX
 #if defined(__alpha__) || defined(__sparc64__) || defined(__x86_64__) || defined(__ia64__)
      MPI_2INT->add_f();//MPI_2INTEGER
 #else
@@ -51,6 +52,9 @@ void smpi_init_fortran_types(){
      MPI_AINT->add_f();//MPI_COUNT
      MPI_REAL16->add_f();//MPI_REAL16
      MPI_PACKED->add_f();//MPI_PACKED
+     MPI_COMPLEX8->add_f();//MPI_COMPLEX8
+     MPI_COMPLEX16->add_f();//MPI_COMPLEX16
+     MPI_COMPLEX32->add_f();//MPI_COMPLEX32
 
      MPI_MAX->add_f();
      MPI_MIN->add_f();
@@ -64,6 +68,9 @@ void smpi_init_fortran_types(){
      MPI_BAND->add_f();
      MPI_BOR->add_f();
      MPI_BXOR->add_f();
+
+     MPI_ERRORS_RETURN->add_f();
+     MPI_ERRORS_ARE_FATAL->add_f();
    }
 }
 
@@ -98,7 +105,7 @@ void mpi_group_incl_(int* group, int* n, int* ranks, int* group_out, int* ierr)
 
   *ierr = MPI_Group_incl(simgrid::smpi::Group::f2c(*group), *n, ranks, &tmp);
   if(*ierr == MPI_SUCCESS) {
-    *group_out = tmp->add_f();
+    *group_out = tmp->c2f();
   }
 }
 
@@ -107,6 +114,8 @@ void mpi_initialized_(int* flag, int* ierr){
 }
 
 void mpi_get_processor_name_(char *name, int *resultlen, int* ierr){
+  //fortran does not handle string endings cleanly, so initialize everything before
+  memset(name, 0, MPI_MAX_PROCESSOR_NAME);
   *ierr = MPI_Get_processor_name(name, resultlen);
 }
 
@@ -226,15 +235,15 @@ void mpi_win_get_group_(int*  win, int* group, int* ierr){
  }
 }
 
-void mpi_win_get_attr_(int* win, int* type_keyval, int* attribute_val, int* flag, int* ierr){
-   int* value = nullptr;
+void mpi_win_get_attr_(int* win, int* type_keyval, MPI_Aint* attribute_val, int* flag, int* ierr){
+   MPI_Aint* value = nullptr;
   *ierr = MPI_Win_get_attr(simgrid::smpi::Win::f2c(*win), *type_keyval, &value, flag);
   if (*flag == 1)
     *attribute_val = *value;
 }
 
-void mpi_win_set_attr_(int* win, int* type_keyval, int* att, int* ierr){
int* val = (int*)xbt_malloc(sizeof(int));
+void mpi_win_set_attr_(int* win, int* type_keyval, MPI_Aint* att, int* ierr){
MPI_Aint* val = (MPI_Aint*)xbt_malloc(sizeof(MPI_Aint));
  *val=*att;
   *ierr = MPI_Win_set_attr(simgrid::smpi::Win::f2c(*win), *type_keyval, val);
 }
@@ -284,6 +293,21 @@ void mpi_win_flush_local_all_(int* win, int* ierr){
   *ierr = MPI_Win_flush_local_all(simgrid::smpi::Win::f2c(*win));
 }
 
+void mpi_win_null_copy_fn_(int* /*win*/, int* /*keyval*/, int* /*extrastate*/, MPI_Aint* /*valin*/,
+                           MPI_Aint* /*valout*/, int* flag, int* ierr)
+{
+  *flag=0;
+  *ierr=MPI_SUCCESS;
+}
+
+void mpi_win_dup_fn_(int* /*win*/, int* /*keyval*/, int* /*extrastate*/, MPI_Aint* valin, MPI_Aint* valout, int* flag,
+                     int* ierr)
+{
+  *flag=1;
+  *valout=*valin;
+  *ierr=MPI_SUCCESS;
+}
+
 void mpi_info_create_( int *info, int* ierr){
   MPI_Info tmp;
   *ierr =  MPI_Info_create(&tmp);
@@ -493,11 +517,12 @@ void mpi_op_commutative_ (int* op, int* commute, int* ierr){
 }
 
 void mpi_group_free_ (int* group, int* ierr){
- MPI_Group tmp = simgrid::smpi::Group::f2c(*group);
- *ierr = MPI_Group_free(&tmp);
- if(*ierr == MPI_SUCCESS) {
-   simgrid::smpi::F2C::free_f(*group);
- }
+  MPI_Group tmp = simgrid::smpi::Group::f2c(*group);
+  if(tmp != MPI_COMM_WORLD->group() && tmp != MPI_GROUP_EMPTY){
+    simgrid::smpi::Group::unref(tmp);
+    simgrid::smpi::F2C::free_f(*group);
+  }
+  *ierr = MPI_SUCCESS;
 }
 
 void mpi_group_size_ (int* group, int *size, int* ierr){
@@ -659,20 +684,32 @@ void mpi_error_class_ (int* errorcode, int* errorclass, int* ierr) {
  *ierr = MPI_Error_class(*errorcode, errorclass);
 }
 
-void mpi_errhandler_create_ (void* function, void* errhandler, int* ierr) {
- *ierr = MPI_Errhandler_create(reinterpret_cast<MPI_Handler_function*>(function), static_cast<MPI_Errhandler*>(errhandler));
+void mpi_errhandler_create_ (void* function, int* errhandler, int* ierr) {
+ MPI_Errhandler tmp;
+ *ierr = MPI_Errhandler_create( reinterpret_cast<MPI_Handler_function*>(function), &tmp);
+ if(*ierr==MPI_SUCCESS){
+   *errhandler = tmp->c2f();
+ }
 }
 
-void mpi_errhandler_free_ (void* errhandler, int* ierr) {
- *ierr = MPI_Errhandler_free(static_cast<MPI_Errhandler*>(errhandler));
+void mpi_errhandler_free_ (int* errhandler, int* ierr) {
+  MPI_Errhandler tmp = simgrid::smpi::Errhandler::f2c(*errhandler);
+  *ierr =  MPI_Errhandler_free(&tmp);
+  if(*ierr == MPI_SUCCESS) {
+    simgrid::smpi::F2C::free_f(*errhandler);
+  }
 }
 
-void mpi_errhandler_get_ (int* comm, void* errhandler, int* ierr) {
- *ierr = MPI_Errhandler_get(simgrid::smpi::Comm::f2c(*comm), static_cast<MPI_Errhandler*>(errhandler));
+void mpi_errhandler_get_ (int* comm, int* errhandler, int* ierr) {
+ MPI_Errhandler tmp;
+ *ierr = MPI_Errhandler_get(simgrid::smpi::Comm::f2c(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *errhandler = tmp->c2f();
+ }
 }
 
-void mpi_errhandler_set_ (int* comm, void* errhandler, int* ierr) {
- *ierr = MPI_Errhandler_set(simgrid::smpi::Comm::f2c(*comm), *static_cast<MPI_Errhandler*>(errhandler));
+void mpi_errhandler_set_ (int* comm, int* errhandler, int* ierr) {
+ *ierr = MPI_Errhandler_set(simgrid::smpi::Comm::f2c(*comm), simgrid::smpi::Errhandler::f2c(*errhandler));
 }
 
 void mpi_cancel_ (int* request, int* ierr) {
@@ -833,19 +870,19 @@ void mpi_status_set_elements_ ( MPI_Status* status, int* datatype, int* count, i
 }
 
 void mpi_publish_name_ ( char *service_name, int* info, char *port_name, int* ierr){
- *ierr = MPI_Publish_name( service_name, *reinterpret_cast<MPI_Info*>(info), port_name);
+ *ierr = MPI_Publish_name( service_name, simgrid::smpi::Info::f2c(*info), port_name);
 }
 
 void mpi_unpublish_name_ ( char *service_name, int* info, char *port_name, int* ierr){
- *ierr = MPI_Unpublish_name( service_name, *reinterpret_cast<MPI_Info*>(info), port_name);
+ *ierr = MPI_Unpublish_name( service_name, simgrid::smpi::Info::f2c(*info), port_name);
 }
 
 void mpi_lookup_name_ ( char *service_name, int* info, char *port_name, int* ierr){
- *ierr = MPI_Lookup_name( service_name, *reinterpret_cast<MPI_Info*>(info), port_name);
+ *ierr = MPI_Lookup_name( service_name, simgrid::smpi::Info::f2c(*info), port_name);
 }
 
 void mpi_open_port_ ( int* info, char *port_name, int* ierr){
- *ierr = MPI_Open_port( *reinterpret_cast<MPI_Info*>(info),port_name);
+ *ierr = MPI_Open_port( simgrid::smpi::Info::f2c(*info),port_name);
 }
 
 void mpi_close_port_ ( char *port_name, int* ierr){
index e9e63ff..761ed29 100644 (file)
@@ -8,6 +8,7 @@
 #include "smpi_comm.hpp"
 #include "smpi_datatype.hpp"
 #include "smpi_op.hpp"
+#include "smpi_request.hpp"
 
 extern "C" { // This should really use the C linkage to be usable from Fortran
 
@@ -84,18 +85,21 @@ void mpi_allgatherv_(void* sendbuf, int* sendcount, int* sendtype,
 }
 
 void mpi_scan_(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* comm, int* ierr) {
+  sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
   *ierr = MPI_Scan(sendbuf, recvbuf, *count, simgrid::smpi::Datatype::f2c(*datatype),
                    simgrid::smpi::Op::f2c(*op), simgrid::smpi::Comm::f2c(*comm));
 }
 
 void mpi_alltoall_(void* sendbuf, int* sendcount, int* sendtype,
                     void* recvbuf, int* recvcount, int* recvtype, int* comm, int* ierr) {
+  sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
   *ierr = MPI_Alltoall(sendbuf, *sendcount, simgrid::smpi::Datatype::f2c(*sendtype),
                        recvbuf, *recvcount, simgrid::smpi::Datatype::f2c(*recvtype), simgrid::smpi::Comm::f2c(*comm));
 }
 
 void mpi_alltoallv_(void* sendbuf, int* sendcounts, int* senddisps, int* sendtype,
                     void* recvbuf, int* recvcounts, int* recvdisps, int* recvtype, int* comm, int* ierr) {
+  sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
   *ierr = MPI_Alltoallv(sendbuf, sendcounts, senddisps, simgrid::smpi::Datatype::f2c(*sendtype),
                        recvbuf, recvcounts, recvdisps, simgrid::smpi::Datatype::f2c(*recvtype), simgrid::smpi::Comm::f2c(*comm));
 }
@@ -113,14 +117,215 @@ void mpi_reduce_scatter_block_ (void *sendbuf, void *recvbuf, int* recvcount, in
                                   simgrid::smpi::Comm::f2c(*comm));
 }
 
-void mpi_alltoallw_ ( void *sendbuf, int *sendcnts, int *sdispls, int* sendtypes, void *recvbuf, int *recvcnts,
-                      int *rdispls, int* recvtypes, int* comm, int* ierr){
- *ierr = MPI_Alltoallw( sendbuf, sendcnts, sdispls, reinterpret_cast<MPI_Datatype*>(sendtypes), recvbuf, recvcnts, rdispls,
-                        reinterpret_cast<MPI_Datatype*>(recvtypes), simgrid::smpi::Comm::f2c(*comm));
+void mpi_alltoallw_ ( void *sendbuf, int *sendcnts, int *sdispls, int* old_sendtypes, void *recvbuf, int *recvcnts,
+                      int *rdispls, int* old_recvtypes, int* comm, int* ierr){
+  int size = simgrid::smpi::Comm::f2c(*comm)->size();
+  MPI_Datatype* sendtypes = new MPI_Datatype[size];
+  MPI_Datatype* recvtypes = new MPI_Datatype[size];
+  for(int i=0; i< size; i++){
+    if(FORT_IN_PLACE(sendbuf)!=MPI_IN_PLACE)
+      sendtypes[i] = simgrid::smpi::Datatype::f2c(old_sendtypes[i]);
+    recvtypes[i] = simgrid::smpi::Datatype::f2c(old_recvtypes[i]);
+  }
+  sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
+ *ierr = MPI_Alltoallw( sendbuf, sendcnts, sdispls, sendtypes, recvbuf, recvcnts, rdispls,
+                        recvtypes, simgrid::smpi::Comm::f2c(*comm));
+  delete[] sendtypes;
+  delete[] recvtypes;
 }
 
 void mpi_exscan_ (void *sendbuf, void *recvbuf, int* count, int* datatype, int* op, int* comm, int* ierr){
  *ierr = MPI_Exscan(sendbuf, recvbuf, *count, simgrid::smpi::Datatype::f2c(*datatype), simgrid::smpi::Op::f2c(*op), simgrid::smpi::Comm::f2c(*comm));
 }
 
+void mpi_ibarrier_(int* comm, int* request, int* ierr) {
+  MPI_Request req;
+  *ierr = MPI_Ibarrier(simgrid::smpi::Comm::f2c(*comm), &req);
+  if(*ierr == MPI_SUCCESS) {
+    *request = req->add_f();
+  }
+}
+
+void mpi_ibcast_(void *buf, int* count, int* datatype, int* root, int* comm, int* request, int* ierr) {
+  MPI_Request req;
+  *ierr = MPI_Ibcast(buf, *count, simgrid::smpi::Datatype::f2c(*datatype), *root, simgrid::smpi::Comm::f2c(*comm), &req);
+  if(*ierr == MPI_SUCCESS) {
+    *request = req->add_f();
+  }
+}
+
+void mpi_ireduce_(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* root, int* comm, int* request, int* ierr) {
+  MPI_Request req;
+  sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
+  sendbuf = static_cast<char *>( FORT_BOTTOM(sendbuf));
+  recvbuf = static_cast<char *>( FORT_BOTTOM(recvbuf));
+  *ierr = MPI_Ireduce(sendbuf, recvbuf, *count, simgrid::smpi::Datatype::f2c(*datatype), simgrid::smpi::Op::f2c(*op), *root, simgrid::smpi::Comm::f2c(*comm), &req);
+  if(*ierr == MPI_SUCCESS) {
+    *request = req->add_f();
+  }
+}
+
+void mpi_iallreduce_(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* comm, int* request, int* ierr) {
+  MPI_Request req;
+  sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
+  *ierr = MPI_Iallreduce(sendbuf, recvbuf, *count, simgrid::smpi::Datatype::f2c(*datatype), simgrid::smpi::Op::f2c(*op), simgrid::smpi::Comm::f2c(*comm), &req);
+  if(*ierr == MPI_SUCCESS) {
+    *request = req->add_f();
+  }
+}
+
+void mpi_ireduce_scatter_(void* sendbuf, void* recvbuf, int* recvcounts, int* datatype, int* op, int* comm, int* request, int* ierr) {
+  MPI_Request req;
+  sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
+  *ierr = MPI_Ireduce_scatter(sendbuf, recvbuf, recvcounts, simgrid::smpi::Datatype::f2c(*datatype),
+                        simgrid::smpi::Op::f2c(*op), simgrid::smpi::Comm::f2c(*comm), &req);
+  if(*ierr == MPI_SUCCESS) {
+    *request = req->add_f();
+  }
+}
+
+void mpi_iscatter_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype,
+                   int* root, int* comm, int* request, int* ierr) {
+  MPI_Request req;
+  recvbuf = static_cast<char *>( FORT_IN_PLACE(recvbuf));
+  *ierr = MPI_Iscatter(sendbuf, *sendcount, simgrid::smpi::Datatype::f2c(*sendtype),
+                      recvbuf, *recvcount, simgrid::smpi::Datatype::f2c(*recvtype), *root, simgrid::smpi::Comm::f2c(*comm), &req);
+  if(*ierr == MPI_SUCCESS) {
+    *request = req->add_f();
+  }
+}
+
+void mpi_iscatterv_(void* sendbuf, int* sendcounts, int* displs, int* sendtype,
+                   void* recvbuf, int* recvcount, int* recvtype, int* root, int* comm, int* request, int* ierr) {
+  MPI_Request req;
+  recvbuf = static_cast<char *>( FORT_IN_PLACE(recvbuf));
+  *ierr = MPI_Iscatterv(sendbuf, sendcounts, displs, simgrid::smpi::Datatype::f2c(*sendtype),
+                      recvbuf, *recvcount, simgrid::smpi::Datatype::f2c(*recvtype), *root, simgrid::smpi::Comm::f2c(*comm), &req);
+  if(*ierr == MPI_SUCCESS) {
+    *request = req->add_f();
+  }
+}
+
+void mpi_igather_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype,
+                  int* root, int* comm, int* request, int* ierr) {
+  MPI_Request req;
+  sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
+  sendbuf = sendbuf!=MPI_IN_PLACE ? static_cast<char *>( FORT_BOTTOM(sendbuf)) : MPI_IN_PLACE;
+  recvbuf = static_cast<char *>( FORT_BOTTOM(recvbuf));
+  *ierr = MPI_Igather(sendbuf, *sendcount, simgrid::smpi::Datatype::f2c(*sendtype),
+                     recvbuf, *recvcount, simgrid::smpi::Datatype::f2c(*recvtype), *root, simgrid::smpi::Comm::f2c(*comm), &req);
+  if(*ierr == MPI_SUCCESS) {
+    *request = req->add_f();
+  }
+}
+
+void mpi_igatherv_(void* sendbuf, int* sendcount, int* sendtype,
+                  void* recvbuf, int* recvcounts, int* displs, int* recvtype, int* root, int* comm, int* request, int* ierr) {
+  MPI_Request req;
+  sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
+  sendbuf = sendbuf!=MPI_IN_PLACE ? static_cast<char *>( FORT_BOTTOM(sendbuf)) : MPI_IN_PLACE;
+  recvbuf = static_cast<char *>( FORT_BOTTOM(recvbuf));
+  *ierr = MPI_Igatherv(sendbuf, *sendcount, simgrid::smpi::Datatype::f2c(*sendtype),
+                     recvbuf, recvcounts, displs, simgrid::smpi::Datatype::f2c(*recvtype), *root, simgrid::smpi::Comm::f2c(*comm), &req);
+  if(*ierr == MPI_SUCCESS) {
+    *request = req->add_f();
+  }
+}
+
+void mpi_iallgather_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype,
+                     int* comm, int* request, int* ierr) {
+  MPI_Request req;
+  sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
+  *ierr = MPI_Iallgather(sendbuf, *sendcount, simgrid::smpi::Datatype::f2c(*sendtype),
+                        recvbuf, *recvcount, simgrid::smpi::Datatype::f2c(*recvtype), simgrid::smpi::Comm::f2c(*comm), &req);
+  if(*ierr == MPI_SUCCESS) {
+    *request = req->add_f();
+  }
+}
+
+void mpi_iallgatherv_(void* sendbuf, int* sendcount, int* sendtype,
+                     void* recvbuf, int* recvcounts,int* displs, int* recvtype, int* comm, int* request, int* ierr) {
+  MPI_Request req;
+  sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
+  *ierr = MPI_Iallgatherv(sendbuf, *sendcount, simgrid::smpi::Datatype::f2c(*sendtype),
+                        recvbuf, recvcounts, displs, simgrid::smpi::Datatype::f2c(*recvtype), simgrid::smpi::Comm::f2c(*comm), &req);
+  if(*ierr == MPI_SUCCESS) {
+    *request = req->add_f();
+  }
+}
+
+void mpi_iscan_(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* comm, int* request, int* ierr) {
+  MPI_Request req;
+  sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
+  *ierr = MPI_Iscan(sendbuf, recvbuf, *count, simgrid::smpi::Datatype::f2c(*datatype),
+                   simgrid::smpi::Op::f2c(*op), simgrid::smpi::Comm::f2c(*comm), &req);
+  if(*ierr == MPI_SUCCESS) {
+    *request = req->add_f();
+  }
+}
+
+void mpi_ialltoall_(void* sendbuf, int* sendcount, int* sendtype,
+                    void* recvbuf, int* recvcount, int* recvtype, int* comm, int* request, int* ierr) {
+  MPI_Request req;
+  sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
+  *ierr = MPI_Ialltoall(sendbuf, *sendcount, simgrid::smpi::Datatype::f2c(*sendtype),
+                       recvbuf, *recvcount, simgrid::smpi::Datatype::f2c(*recvtype), simgrid::smpi::Comm::f2c(*comm), &req);
+  if(*ierr == MPI_SUCCESS) {
+    *request = req->add_f();
+  }
+}
+
+void mpi_ialltoallv_(void* sendbuf, int* sendcounts, int* senddisps, int* sendtype,
+                    void* recvbuf, int* recvcounts, int* recvdisps, int* recvtype, int* comm, int* request, int* ierr) {
+  MPI_Request req;
+  sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
+  *ierr = MPI_Ialltoallv(sendbuf, sendcounts, senddisps, simgrid::smpi::Datatype::f2c(*sendtype),
+                       recvbuf, recvcounts, recvdisps, simgrid::smpi::Datatype::f2c(*recvtype), simgrid::smpi::Comm::f2c(*comm), &req);
+  if(*ierr == MPI_SUCCESS) {
+    *request = req->add_f();
+  }
+}
+
+void mpi_ireduce_scatter_block_ (void *sendbuf, void *recvbuf, int* recvcount, int* datatype, int* op, int* comm,
+                                 int* request, int* ierr)
+{
+  MPI_Request req;
+  sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
+ *ierr = MPI_Ireduce_scatter_block(sendbuf, recvbuf, *recvcount, simgrid::smpi::Datatype::f2c(*datatype), simgrid::smpi::Op::f2c(*op),
+                                  simgrid::smpi::Comm::f2c(*comm), &req);
+  if(*ierr == MPI_SUCCESS) {
+    *request = req->add_f();
+  }
+}
+
+void mpi_ialltoallw_ ( void *sendbuf, int *sendcnts, int *sdispls, int* old_sendtypes, void *recvbuf, int *recvcnts,
+                      int *rdispls, int* old_recvtypes, int* comm, int* request, int* ierr){
+  MPI_Request req;
+  int size = simgrid::smpi::Comm::f2c(*comm)->size();
+  MPI_Datatype* sendtypes = new MPI_Datatype[size];
+  MPI_Datatype* recvtypes = new MPI_Datatype[size];
+  for(int i=0; i< size; i++){
+    if(FORT_IN_PLACE(sendbuf)!=MPI_IN_PLACE)
+      sendtypes[i] = simgrid::smpi::Datatype::f2c(old_sendtypes[i]);
+    recvtypes[i] = simgrid::smpi::Datatype::f2c(old_recvtypes[i]);
+  }
+  sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
+ *ierr = MPI_Ialltoallw( sendbuf, sendcnts, sdispls, sendtypes, recvbuf, recvcnts, rdispls,
+                        recvtypes, simgrid::smpi::Comm::f2c(*comm), &req);
+  if(*ierr == MPI_SUCCESS) {
+    *request = req->add_f();
+  }
+  delete[] sendtypes;
+  delete[] recvtypes;
+}
+
+void mpi_iexscan_ (void *sendbuf, void *recvbuf, int* count, int* datatype, int* op, int* comm, int* request, int* ierr){
+  MPI_Request req;
+  sendbuf = static_cast<char *>( FORT_IN_PLACE(sendbuf));
+ *ierr = MPI_Iexscan(sendbuf, recvbuf, *count, simgrid::smpi::Datatype::f2c(*datatype), simgrid::smpi::Op::f2c(*op), simgrid::smpi::Comm::f2c(*comm), &req);
+  if(*ierr == MPI_SUCCESS) {
+    *request = req->add_f();
+  }
+}
+
 }
index 1332fdc..afca786 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "private.hpp"
 #include "smpi_comm.hpp"
+#include "smpi_errhandler.hpp"
 #include "smpi_info.hpp"
 
 extern "C" { // This should really use the C linkage to be usable from Fortran
@@ -37,12 +38,11 @@ void mpi_comm_create_(int* comm, int* group, int* newcomm, int* ierr) {
 
 void mpi_comm_free_(int* comm, int* ierr) {
   MPI_Comm tmp = simgrid::smpi::Comm::f2c(*comm);
-
-  *ierr = MPI_Comm_free(&tmp);
-
-  if(*ierr == MPI_SUCCESS) {
+  if(tmp != MPI_COMM_WORLD && tmp != MPI_COMM_NULL) {
+    simgrid::smpi::Comm::destroy(tmp);
     simgrid::smpi::Comm::free_f(*comm);
   }
+  *ierr = MPI_SUCCESS;
 }
 
 void mpi_comm_split_(int* comm, int* color, int* key, int* comm_out, int* ierr) {
@@ -101,8 +101,8 @@ void mpi_comm_free_keyval_ (int* keyval, int* ierr) {
 
 void mpi_comm_get_name_ (int* comm, char* name, int* len, int* ierr){
  *ierr = MPI_Comm_get_name(simgrid::smpi::Comm::f2c(*comm), name, len);
-  if(*len>0)
-    name[*len]=' ';
+  for(int i = *len; i<MPI_MAX_OBJECT_NAME+1; i++)
+    name[i]=' ';
 }
 
 void mpi_comm_compare_ (int* comm1, int* comm2, int *result, int* ierr){
@@ -118,12 +118,16 @@ void mpi_comm_disconnect_ (int* comm, int* ierr){
  }
 }
 
-void mpi_comm_set_errhandler_ (int* comm, void* errhandler, int* ierr) {
- *ierr = MPI_Errhandler_set(simgrid::smpi::Comm::f2c(*comm), *static_cast<MPI_Errhandler*>(errhandler));
+void mpi_comm_set_errhandler_ (int* comm, int* errhandler, int* ierr) {
+ *ierr = MPI_Errhandler_set(simgrid::smpi::Comm::f2c(*comm), simgrid::smpi::Errhandler::f2c(*errhandler));
 }
 
-void mpi_comm_get_errhandler_ (int* comm, void* errhandler, int* ierr) {
- *ierr = MPI_Errhandler_set(simgrid::smpi::Comm::f2c(*comm), static_cast<MPI_Errhandler*>(errhandler));
+void mpi_comm_get_errhandler_ (int* comm, int* errhandler, int* ierr) {
+ MPI_Errhandler tmp;
+ *ierr = MPI_Errhandler_get(simgrid::smpi::Comm::f2c(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+   *errhandler = tmp->c2f();
+ }
 }
 
 void mpi_comm_test_inter_ (int* comm, int* flag, int* ierr) {
@@ -142,10 +146,13 @@ void mpi_comm_remote_size_ (int* comm, int* size, int* ierr) {
  *ierr = MPI_Comm_remote_size(simgrid::smpi::Comm::f2c(*comm), size);
 }
 
-void mpi_comm_set_name_ (int* comm, char* name, int* ierr, int size){
- char* tname = xbt_new(char, size+1);
- strncpy(tname, name, size);
- tname[size]='\0';
+void mpi_comm_set_name_ (int* comm, char* name, int* ierr){
+ int count;
+ for(count=MPI_MAX_OBJECT_NAME-1; count>=0 && name[count]==' '; count--);
+ count+=1;
+ char* tname = xbt_new(char, count+1);
+ strncpy(tname, name, count);
+ tname[count]='\0';
  *ierr = MPI_Comm_set_name (simgrid::smpi::Comm::f2c(*comm), tname);
  xbt_free(tname);
 }
@@ -178,8 +185,12 @@ void mpi_comm_get_info_ (int* comm, int* info, int* ierr){
  }
 }
 
-void mpi_comm_create_errhandler_ ( void *function, void *errhandler, int* ierr){
- *ierr = MPI_Comm_create_errhandler( reinterpret_cast<MPI_Comm_errhandler_fn*>(function), static_cast<MPI_Errhandler*>(errhandler));
+void mpi_comm_create_errhandler_ ( void *function, int *errhandler, int* ierr){
+ MPI_Errhandler tmp;
+ *ierr = MPI_Comm_create_errhandler( reinterpret_cast<MPI_Comm_errhandler_fn*>(function), &tmp);
+ if(*ierr==MPI_SUCCESS){
+   *errhandler = tmp->c2f();
+ }
 }
 
 void mpi_comm_call_errhandler_ (int* comm,int* errorcode, int* ierr){
@@ -188,7 +199,7 @@ void mpi_comm_call_errhandler_ (int* comm,int* errorcode, int* ierr){
 
 void mpi_comm_connect_ ( char *port_name, int* info, int* root, int* comm, int*newcomm, int* ierr){
   MPI_Comm tmp;
-  *ierr = MPI_Comm_connect( port_name, *reinterpret_cast<MPI_Info*>(info), *root, simgrid::smpi::Comm::f2c(*comm), &tmp);
+  *ierr = MPI_Comm_connect( port_name, simgrid::smpi::Info::f2c(*info), *root, simgrid::smpi::Comm::f2c(*comm), &tmp);
   if(*ierr == MPI_SUCCESS) {
     *newcomm = tmp->add_f();
   }
@@ -205,7 +216,7 @@ void mpi_comm_join_ ( int* fd, int* intercomm, int* ierr){
 
 void mpi_comm_accept_ ( char *port_name, int* info, int* root, int* comm, int*newcomm, int* ierr){
   MPI_Comm tmp;
-  *ierr = MPI_Comm_accept( port_name, *reinterpret_cast<MPI_Info*>(info), *root, simgrid::smpi::Comm::f2c(*comm), &tmp);
+  *ierr = MPI_Comm_accept( port_name, simgrid::smpi::Info::f2c(*info), *root, simgrid::smpi::Comm::f2c(*comm), &tmp);
   if(*ierr == MPI_SUCCESS) {
     *newcomm = tmp->add_f();
   }
@@ -214,7 +225,7 @@ void mpi_comm_accept_ ( char *port_name, int* info, int* root, int* comm, int*ne
 void mpi_comm_spawn_ ( char *command, char *argv, int* maxprocs, int* info, int* root, int* comm, int* intercomm,
                        int* array_of_errcodes, int* ierr){
   MPI_Comm tmp;
-  *ierr = MPI_Comm_spawn( command, &argv, *maxprocs, *reinterpret_cast<MPI_Info*>(info), *root, simgrid::smpi::Comm::f2c(*comm), &tmp,
+  *ierr = MPI_Comm_spawn( command, &argv, *maxprocs, simgrid::smpi::Info::f2c(*info), *root, simgrid::smpi::Comm::f2c(*comm), &tmp,
                           array_of_errcodes);
   if(*ierr == MPI_SUCCESS) {
     *intercomm = tmp->add_f();
index ec705b2..7e128bc 100644 (file)
@@ -215,6 +215,7 @@ void mpi_waitsome_ (int* incount, int* requests, int *outcount, int *indices, MP
         simgrid::smpi::Request::free_f(requests[indices[i]]);
         requests[indices[i]]=MPI_FORTRAN_REQUEST_NULL;
     }
+    indices[i]++;
   }
   xbt_free(reqs);
 }
@@ -275,10 +276,11 @@ void mpi_testsome_ (int* incount, int*  requests, int* outcount, int* indices, M
   }
   *ierr = MPI_Testsome(*incount, reqs, outcount, indices, FORT_STATUSES_IGNORE(statuses));
   for(i=0;i<*incount;i++){
-    if(indices[i] && reqs[indices[i]]==MPI_REQUEST_NULL){
+    if(reqs[indices[i]]==MPI_REQUEST_NULL){
       simgrid::smpi::Request::free_f(requests[indices[i]]);
       requests[indices[i]]=MPI_FORTRAN_REQUEST_NULL;
     }
+    indices[i]++;
   }
   xbt_free(reqs);
 }
index 307bf6a..e7207ff 100644 (file)
@@ -52,8 +52,8 @@ 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){
  *ierr = MPI_Type_get_name(simgrid::smpi::Datatype::f2c(*datatype),name,len);
-  if(*len>0)
-    name[*len]=' ';
+  for(int i = *len; i<MPI_MAX_OBJECT_NAME+1; i++)
+    name[i]=' ';
 }
 
 void mpi_type_get_attr_ (int* type, int* type_keyval, int *attribute_val, int* flag, int* ierr){
@@ -131,12 +131,16 @@ void mpi_type_create_hvector_(int* count, int* blocklen, MPI_Aint* stride, int*
   }
 }
 
-void mpi_type_hindexed_ (int* count, int* blocklens, MPI_Aint* indices, int* old_type, int*  newtype, int* ierr) {
+void mpi_type_hindexed_ (int* count, int* blocklens, int* indices, int* old_type, int*  newtype, int* ierr) {
   MPI_Datatype tmp;
-  *ierr = MPI_Type_hindexed(*count, blocklens, indices, simgrid::smpi::Datatype::f2c(*old_type), &tmp);
+  MPI_Aint* indices_aint=new MPI_Aint[*count];
+  for(int i=0; i<*count; i++)
+    indices_aint[i]=indices[i];
+  *ierr = MPI_Type_hindexed(*count, blocklens, indices_aint, simgrid::smpi::Datatype::f2c(*old_type), &tmp);
   if(*ierr == MPI_SUCCESS) {
     *newtype = tmp->add_f();
   }
+  delete[] indices_aint;
 }
 
 void mpi_type_create_hindexed_(int* count, int* blocklens, MPI_Aint* indices, int* old_type, int*  newtype, int* ierr){
@@ -181,18 +185,21 @@ void mpi_type_create_indexed_block_ (int* count, int* blocklength, int* indices,
   }
 }
 
-void mpi_type_struct_ (int* count, int* blocklens, MPI_Aint* indices, int* old_types, int*  newtype, int* ierr) {
+void mpi_type_struct_ (int* count, int* blocklens, int* indices, int* old_types, int*  newtype, int* ierr) {
   MPI_Datatype tmp;
   int i=0;
   MPI_Datatype* types = static_cast<MPI_Datatype*>(xbt_malloc(*count*sizeof(MPI_Datatype)));
+  MPI_Aint* indices_aint=new MPI_Aint[*count];
   for(i=0; i< *count; i++){
+    indices_aint[i]=indices[i];
     types[i] = simgrid::smpi::Datatype::f2c(old_types[i]);
   }
-  *ierr = MPI_Type_struct(*count, blocklens, indices, types, &tmp);
+  *ierr = MPI_Type_struct(*count, blocklens, indices_aint, types, &tmp);
   if(*ierr == MPI_SUCCESS) {
     *newtype = tmp->add_f();
   }
   xbt_free(types);
+  delete[] indices_aint;
 }
 
 void mpi_type_create_struct_(int* count, int* blocklens, MPI_Aint* indices, int*  old_types, int*  newtype, int* ierr){
index 96e2fd3..8a44988 100644 (file)
@@ -4,7 +4,11 @@
  * under the terms of the license ,(GNU LGPL) which comes with this package. */
 
 #include "private.hpp"
+#include "simgrid/modelchecker.h"
 #include "simgrid/sg_config.hpp"
+#include "smpi_comm.hpp"
+#include "smpi_file.hpp"
+#include "smpi_win.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_mpi, smpi, "Logging specific to SMPI ,(mpi)");
 
@@ -26,156 +30,178 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_mpi, smpi, "Logging specific to SMPI ,(mpi)
     return MPI_SUCCESS;                                                                                                \
   }
 
-#define WRAPPED_PMPI_CALL(type, name, args, args2)                                                                     \
+#define WRAPPED_PMPI_CALL_ERRHANDLER(type, name, args, args2, errhan)                                                  \
   type name args                                                                                                       \
   {                                                                                                                    \
     XBT_VERB("SMPI - Entering %s", __func__);                                                                          \
-    type ret = P##name args2;                                                                                         \
-    if(ret!=MPI_SUCCESS) {                                                                                             \
+    type ret = _XBT_CONCAT(P, name) args2;                                                                             \
+    if (ret != MPI_SUCCESS) {                                                                                          \
       char error_string[MPI_MAX_ERROR_STRING];                                                                         \
       int error_size;                                                                                                  \
       PMPI_Error_string(ret, error_string, &error_size);                                                               \
-      XBT_WARN("%s - returned %.*s instead of MPI_SUCCESS", __func__, error_size,error_string);                       \
+      if ((errhan) == nullptr || (errhan)->errhandler() == MPI_ERRORS_RETURN)                                          \
+        XBT_WARN("%s - returned %.*s instead of MPI_SUCCESS", __func__, error_size, error_string);                     \
+      else if ((errhan)->errhandler() == MPI_ERRORS_ARE_FATAL)                                                         \
+        xbt_die("%s - returned %.*s instead of MPI_SUCCESS", __func__, error_size, error_string);                      \
+      else                                                                                                             \
+        (errhan)->errhandler()->call((errhan), ret);                                                                   \
+      MC_assert(not MC_is_active()); /* Only fail in MC mode */                                                        \
     }                                                                                                                  \
     XBT_VERB("SMPI - Leaving %s", __func__);                                                                           \
     return ret;                                                                                                        \
   }
 
+#define WRAPPED_PMPI_CALL_ERRHANDLER_COMM(type, name, args, args2) WRAPPED_PMPI_CALL_ERRHANDLER(type, name, args, args2, comm)
+#define WRAPPED_PMPI_CALL_ERRHANDLER_WIN(type, name, args, args2) WRAPPED_PMPI_CALL_ERRHANDLER(type, name, args, args2, win)
+#define WRAPPED_PMPI_CALL_ERRHANDLER_FILE(type, name, args, args2) WRAPPED_PMPI_CALL_ERRHANDLER(type, name, args, args2, fh)
+#define WRAPPED_PMPI_CALL(type, name, args, args2) WRAPPED_PMPI_CALL_ERRHANDLER(type, name, args, args2, MPI_COMM_WORLD)
+
 #define WRAPPED_PMPI_CALL_NORETURN(type, name, args, args2)                                                            \
   type name args                                                                                                       \
   {                                                                                                                    \
     XBT_VERB("SMPI - Entering %s", __func__);                                                                          \
-    type ret = P##name args2;                                                                                          \
+    type ret = _XBT_CONCAT(P, name) args2;                                                                             \
     XBT_VERB("SMPI - Leaving %s", __func__);                                                                           \
     return ret;                                                                                                        \
   }
 
-#define UNIMPLEMENTED_WRAPPED_PMPI_CALL(type,name,args,args2) \
-type P##name args { \
-NOT_YET_IMPLEMENTED \
-}\
-type name args { \
-return P##name args2 ; \
-}\
-
-#define UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(type,name,args,args2) \
-type P##name args { \
-NOT_YET_IMPLEMENTED_NOFAIL \
-}\
-type name args { \
-return P##name args2 ; \
-}\
+#define UNIMPLEMENTED_WRAPPED_PMPI_CALL(type, name, args, args2)                                                       \
+  type _XBT_CONCAT(P, name) args { NOT_YET_IMPLEMENTED }                                                               \
+  type name args { return _XBT_CONCAT(P, name) args2; }
 
+#define UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(type, name, args, args2)                                                \
+  type _XBT_CONCAT(P, name) args { NOT_YET_IMPLEMENTED_NOFAIL }                                                        \
+  type name args { return _XBT_CONCAT(P, name) args2; }
 
 /* MPI User level calls */
 
 WRAPPED_PMPI_CALL_NORETURN(double, MPI_Wtick,(void),())
 WRAPPED_PMPI_CALL_NORETURN(double, MPI_Wtime,(void),())
-WRAPPED_PMPI_CALL(int,MPI_Abort,(MPI_Comm comm, int errorcode),(comm, errorcode))
-WRAPPED_PMPI_CALL(int,MPI_Accumulate,( 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_Op op, MPI_Win win),( origin_addr,origin_count, origin_datatype,target_rank,target_disp, target_count,target_datatype,op, win))
-WRAPPED_PMPI_CALL(int,MPI_Address,(void *location, MPI_Aint * address),(location, address))
-WRAPPED_PMPI_CALL(int,MPI_Allgather,(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm))
-WRAPPED_PMPI_CALL(int,MPI_Allgatherv,(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs,MPI_Datatype recvtype, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Abort,(MPI_Comm comm, int errorcode),(comm, errorcode))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Accumulate,(const 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_Op op, MPI_Win win),( origin_addr,origin_count, origin_datatype,target_rank,target_disp, target_count,target_datatype,op, win))
+WRAPPED_PMPI_CALL(int, MPI_Address, (const void* location, MPI_Aint* address), (location, address))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Allgather,(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Allgatherv,(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs,MPI_Datatype recvtype, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm))
 WRAPPED_PMPI_CALL(int,MPI_Alloc_mem,(MPI_Aint size, MPI_Info info, void *baseptr),(size, info, baseptr))
-WRAPPED_PMPI_CALL(int,MPI_Allreduce,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm),(sendbuf, recvbuf, count, datatype, op, comm))
-WRAPPED_PMPI_CALL(int,MPI_Alltoall,(void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount,MPI_Datatype recvtype, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm))
-WRAPPED_PMPI_CALL(int,MPI_Alltoallv,(void *sendbuf, int *sendcounts, int *senddisps, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm),(sendbuf, sendcounts, senddisps, sendtype, recvbuf, recvcounts, recvdisps, recvtype, comm))
-WRAPPED_PMPI_CALL(int,MPI_Alltoallw,( void *sendbuf, int *sendcnts, int *sdispls, MPI_Datatype *sendtypes, void *recvbuf, int *recvcnts, int *rdispls, MPI_Datatype *recvtypes, MPI_Comm comm),( sendbuf, sendcnts, sdispls, sendtypes, recvbuf, recvcnts, rdispls, recvtypes, comm))
-WRAPPED_PMPI_CALL(int,MPI_Attr_delete,(MPI_Comm comm, int keyval) ,(comm, keyval))
-WRAPPED_PMPI_CALL(int,MPI_Attr_get,(MPI_Comm comm, int keyval, void* attr_value, int* flag) ,(comm, keyval, attr_value, flag))
-WRAPPED_PMPI_CALL(int,MPI_Attr_put,(MPI_Comm comm, int keyval, void* attr_value) ,(comm, keyval, attr_value))
-WRAPPED_PMPI_CALL(int,MPI_Barrier,(MPI_Comm comm),(comm))
-WRAPPED_PMPI_CALL(int,MPI_Bcast,(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm),(buf, count, datatype, root, comm))
-WRAPPED_PMPI_CALL(int,MPI_Cart_coords,(MPI_Comm comm, int rank, int maxdims, int* coords) ,(comm, rank, maxdims, coords))
-WRAPPED_PMPI_CALL(int,MPI_Cart_create,(MPI_Comm comm_old, int ndims, int* dims, int* periods, int reorder, MPI_Comm* comm_cart) ,(comm_old, ndims, dims, periods, reorder, comm_cart))
-WRAPPED_PMPI_CALL(int,MPI_Cartdim_get,(MPI_Comm comm, int* ndims) ,(comm, ndims))
-WRAPPED_PMPI_CALL(int,MPI_Cart_get,(MPI_Comm comm, int maxdims, int* dims, int* periods, int* coords) ,(comm, maxdims, dims, periods, coords))
-WRAPPED_PMPI_CALL(int,MPI_Cart_rank,(MPI_Comm comm, int* coords, int* rank) ,(comm, coords, rank))
-WRAPPED_PMPI_CALL(int,MPI_Cart_shift,(MPI_Comm comm, int direction, int displ, int* source, int* dest) ,(comm, direction, displ, source, dest))
-WRAPPED_PMPI_CALL(int,MPI_Cart_sub,(MPI_Comm comm, int* remain_dims, MPI_Comm* comm_new) ,(comm, remain_dims, comm_new))
-WRAPPED_PMPI_CALL(int,MPI_Comm_compare,(MPI_Comm comm1, MPI_Comm comm2, int *result),(comm1, comm2, result))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Allreduce,(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm),(sendbuf, recvbuf, count, datatype, op, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Alltoall,(const void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount,MPI_Datatype recvtype, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Alltoallv,(const void *sendbuf, const int *sendcounts, const int *senddisps, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm),(sendbuf, sendcounts, senddisps, sendtype, recvbuf, recvcounts, recvdisps, recvtype, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Alltoallw,(const void *sendbuf, const int *sendcnts, const int *sdispls, const MPI_Datatype *sendtypes, void *recvbuf, const int *recvcnts, const int *rdispls, const MPI_Datatype *recvtypes, MPI_Comm comm),( sendbuf, sendcnts, sdispls, sendtypes, recvbuf, recvcnts, rdispls, recvtypes, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Attr_delete,(MPI_Comm comm, int keyval) ,(comm, keyval))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Attr_get,(MPI_Comm comm, int keyval, void* attr_value, int* flag) ,(comm, keyval, attr_value, flag))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Attr_put,(MPI_Comm comm, int keyval, void* attr_value) ,(comm, keyval, attr_value))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Barrier,(MPI_Comm comm),(comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Bcast,(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm),(buf, count, datatype, root, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Bsend_init,(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request),(buf, count, datatype, dest, tag, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Bsend,(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) ,(buf, count, datatype, dest, tag, comm))
+WRAPPED_PMPI_CALL(int,MPI_Buffer_attach,(void* buffer, int size) ,(buffer, size))
+WRAPPED_PMPI_CALL(int,MPI_Buffer_detach,(void* buffer, int* size) ,(buffer, size))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Cart_coords,(MPI_Comm comm, int rank, int maxdims, int* coords) ,(comm, rank, maxdims, coords))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Cart_create,(MPI_Comm comm, int ndims, const int* dims, const int* periods, int reorder, MPI_Comm* comm_cart) ,(comm, ndims, dims, periods, reorder, comm_cart))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Cartdim_get,(MPI_Comm comm, int* ndims) ,(comm, ndims))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Cart_get,(MPI_Comm comm, int maxdims, int* dims, int* periods, int* coords) ,(comm, maxdims, dims, periods, coords))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Cart_rank,(MPI_Comm comm, const int* coords, int* rank) ,(comm, coords, rank))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Cart_shift,(MPI_Comm comm, int direction, int displ, int* source, int* dest) ,(comm, direction, displ, source, dest))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Cart_sub,(MPI_Comm comm, const int* remain_dims, MPI_Comm* comm_new) ,(comm, remain_dims, comm_new))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_compare,(MPI_Comm comm, MPI_Comm comm2, int *result),(comm, comm2, result))
 WRAPPED_PMPI_CALL(int,MPI_Comm_create_keyval,(MPI_Comm_copy_attr_function* copy_fn, MPI_Comm_delete_attr_function* delete_fn, int* keyval, void* extra_state),(copy_fn,delete_fn,keyval,extra_state))
-WRAPPED_PMPI_CALL(int,MPI_Comm_create,(MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm),(comm, group, newcomm))
-WRAPPED_PMPI_CALL(int,MPI_Comm_delete_attr ,(MPI_Comm comm, int comm_keyval),(comm,comm_keyval))
-WRAPPED_PMPI_CALL(int,MPI_Comm_disconnect,(MPI_Comm * comm),(comm))
-WRAPPED_PMPI_CALL(int,MPI_Comm_dup,(MPI_Comm comm, MPI_Comm * newcomm),(comm, newcomm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_create,(MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm),(comm, group, newcomm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_delete_attr ,(MPI_Comm comm, int comm_keyval),(comm,comm_keyval))
+WRAPPED_PMPI_CALL_ERRHANDLER(int,MPI_Comm_disconnect,(MPI_Comm * comm),(comm), (*comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_dup,(MPI_Comm comm, MPI_Comm * newcomm),(comm, newcomm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_dup_with_info,(MPI_Comm comm, MPI_Info info, MPI_Comm * newcomm),(comm,info,newcomm))
 WRAPPED_PMPI_CALL(int,MPI_Comm_free_keyval,(int* keyval) ,( keyval))
-WRAPPED_PMPI_CALL(int,MPI_Comm_free,(MPI_Comm * comm),(comm))
-WRAPPED_PMPI_CALL(int,MPI_Comm_get_attr ,(MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag),(comm, comm_keyval, attribute_val, flag))
-WRAPPED_PMPI_CALL(int,MPI_Comm_get_name ,(MPI_Comm comm, char* name, int* len),(comm, name, len))
-WRAPPED_PMPI_CALL(int,MPI_Comm_group,(MPI_Comm comm, MPI_Group * group),(comm, group))
-WRAPPED_PMPI_CALL(int,MPI_Comm_rank,(MPI_Comm comm, int *rank),(comm, rank))
-WRAPPED_PMPI_CALL(int,MPI_Comm_set_attr ,(MPI_Comm comm, int comm_keyval, void *attribute_val),( comm, comm_keyval, attribute_val))
-WRAPPED_PMPI_CALL(int,MPI_Comm_size,(MPI_Comm comm, int *size),(comm, size))
-WRAPPED_PMPI_CALL(int,MPI_Comm_split,(MPI_Comm comm, int color, int key, MPI_Comm* comm_out),(comm, color, key, comm_out))
-WRAPPED_PMPI_CALL(int,MPI_Comm_split_type,(MPI_Comm comm, int split_type, int key, MPI_Info info, MPI_Comm *newcomm),(comm, split_type, key, info, newcomm))
-WRAPPED_PMPI_CALL(int,MPI_Comm_create_group,(MPI_Comm comm, MPI_Group group, int tag, MPI_Comm* comm_out),(comm, group, tag, comm_out))
-WRAPPED_PMPI_CALL(int,MPI_Compare_and_swap,(void *origin_addr, void *compare_addr,
+WRAPPED_PMPI_CALL_ERRHANDLER(int,MPI_Comm_free,(MPI_Comm * comm),(comm), (*comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_get_attr ,(MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag),(comm, comm_keyval, attribute_val, flag))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_get_info ,(MPI_Comm comm, MPI_Info* info),(comm, info))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_get_name ,(MPI_Comm comm, char* name, int* len),(comm, name, len))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_set_name ,(MPI_Comm comm, const char* name),(comm, name))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_group,(MPI_Comm comm, MPI_Group * group),(comm, group))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_rank,(MPI_Comm comm, int *rank),(comm, rank))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_set_attr ,(MPI_Comm comm, int comm_keyval, void *attribute_val),( comm, comm_keyval, attribute_val))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_set_info ,(MPI_Comm comm, MPI_Info info),(comm, info))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_size,(MPI_Comm comm, int *size),(comm, size))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_split,(MPI_Comm comm, int color, int key, MPI_Comm* comm_out),(comm, color, key, comm_out))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_split_type,(MPI_Comm comm, int split_type, int key, MPI_Info info, MPI_Comm *newcomm),(comm, split_type, key, info, newcomm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_create_group,(MPI_Comm comm, MPI_Group group, int tag, MPI_Comm* comm_out),(comm, group, tag, comm_out))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_call_errhandler,(MPI_Comm comm,int errorcode),(comm, errorcode))
+WRAPPED_PMPI_CALL(int,MPI_Comm_create_errhandler,( MPI_Comm_errhandler_fn *function, MPI_Errhandler *errhandler),( function, errhandler))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_get_errhandler,(MPI_Comm comm, MPI_Errhandler* errhandler) ,(comm, errhandler))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Comm_set_errhandler,(MPI_Comm comm, MPI_Errhandler errhandler) ,(comm, errhandler))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Compare_and_swap,(const void *origin_addr, void *compare_addr,
         void *result_addr, MPI_Datatype datatype, int target_rank, MPI_Aint target_disp, MPI_Win win), (origin_addr, compare_addr, result_addr, datatype, target_rank, target_disp, win))
 WRAPPED_PMPI_CALL(int,MPI_Dims_create,(int nnodes, int ndims, int* dims) ,(nnodes, ndims, dims))
+WRAPPED_PMPI_CALL(int,MPI_Errhandler_free,(MPI_Errhandler* errhandler) ,(errhandler))
+WRAPPED_PMPI_CALL(int,MPI_Errhandler_create,(MPI_Handler_function* function, MPI_Errhandler* errhandler) ,(function, errhandler))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Errhandler_get,(MPI_Comm comm, MPI_Errhandler* errhandler) ,(comm, errhandler))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Errhandler_set,(MPI_Comm comm, MPI_Errhandler errhandler) ,(comm, errhandler))
+WRAPPED_PMPI_CALL_NORETURN(MPI_Errhandler, MPI_Errhandler_f2c,(MPI_Fint errhandler),(errhandler))
+WRAPPED_PMPI_CALL_NORETURN(MPI_Fint, MPI_Errhandler_c2f,(MPI_Errhandler errhandler),(errhandler))
 WRAPPED_PMPI_CALL(int,MPI_Error_class,(int errorcode, int* errorclass) ,(errorcode, errorclass))
 WRAPPED_PMPI_CALL_NORETURN(int,MPI_Error_string,(int errorcode, char* string, int* resultlen) ,(errorcode, string, resultlen))
-WRAPPED_PMPI_CALL(int,MPI_Exscan,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm),(sendbuf, recvbuf, count, datatype, op, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Exscan,(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm),(sendbuf, recvbuf, count, datatype, op, comm))
 WRAPPED_PMPI_CALL(int,MPI_Finalized,(int * flag),(flag))
 WRAPPED_PMPI_CALL(int,MPI_Finalize,(void),())
 WRAPPED_PMPI_CALL(int,MPI_Free_mem,(void *baseptr),(baseptr))
-WRAPPED_PMPI_CALL(int,MPI_Gather,(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm))
-WRAPPED_PMPI_CALL(int,MPI_Gatherv,(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs,MPI_Datatype recvtype, int root, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm))
-WRAPPED_PMPI_CALL(int,MPI_Get_address,(void *location, MPI_Aint * address),(location, address))
-WRAPPED_PMPI_CALL(int,MPI_Get_count,(MPI_Status * status, MPI_Datatype datatype, int *count),(status, datatype, count))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Gather,(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Gatherv,(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs,MPI_Datatype recvtype, int root, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm))
+WRAPPED_PMPI_CALL(int,MPI_Get_address,(const void *location, MPI_Aint * address),(location, address))
+WRAPPED_PMPI_CALL(int,MPI_Get_count,(const MPI_Status * status, MPI_Datatype datatype, int *count),(status, datatype, count))
 WRAPPED_PMPI_CALL(int,MPI_Get_library_version ,(char *version,int *len),(version,len))
 WRAPPED_PMPI_CALL(int,MPI_Get_processor_name,(char *name, int *resultlen),(name, resultlen))
 WRAPPED_PMPI_CALL(int,MPI_Get_version ,(int *version,int *subversion),(version,subversion))
-WRAPPED_PMPI_CALL(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),(origin_addr,origin_count, origin_datatype,target_rank, target_disp, target_count,target_datatype,win))
-WRAPPED_PMPI_CALL(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),(origin_addr, origin_count, origin_datatype, result_addr, result_count, result_datatype, target_rank, target_disp, target_count, target_datatype, op, win))
-WRAPPED_PMPI_CALL(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),(origin_addr, result_addr, datatype, target_rank, target_disp, op, win))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(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),(origin_addr,origin_count, origin_datatype,target_rank, target_disp, target_count,target_datatype,win))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Get_accumulate, (const 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),(origin_addr, origin_count, origin_datatype, result_addr, result_count, result_datatype, target_rank, target_disp, target_count, target_datatype, op, win))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Fetch_and_op, (const void *origin_addr, void *result_addr, MPI_Datatype datatype, int target_rank, MPI_Aint target_disp, MPI_Op op, MPI_Win win),(origin_addr, result_addr, datatype, target_rank, target_disp, op, win))
 WRAPPED_PMPI_CALL(int,MPI_Group_compare,(MPI_Group group1, MPI_Group group2, int *result),(group1, group2, result))
 WRAPPED_PMPI_CALL(int,MPI_Group_difference,(MPI_Group group1, MPI_Group group2, MPI_Group * newgroup),(group1, group2, newgroup))
-WRAPPED_PMPI_CALL(int,MPI_Group_excl,(MPI_Group group, int n, int *ranks, MPI_Group * newgroup),(group, n, ranks, newgroup))
+WRAPPED_PMPI_CALL(int,MPI_Group_excl,(MPI_Group group, int n, const int *ranks, MPI_Group * newgroup),(group, n, ranks, newgroup))
 WRAPPED_PMPI_CALL(int,MPI_Group_free,(MPI_Group * group),(group))
-WRAPPED_PMPI_CALL(int,MPI_Group_incl,(MPI_Group group, int n, int *ranks, MPI_Group * newgroup),(group, n, ranks, newgroup))
+WRAPPED_PMPI_CALL(int,MPI_Group_incl,(MPI_Group group, int n, const int *ranks, MPI_Group * newgroup),(group, n, ranks, newgroup))
 WRAPPED_PMPI_CALL(int,MPI_Group_intersection,(MPI_Group group1, MPI_Group group2, MPI_Group * newgroup),(group1, group2, newgroup))
 WRAPPED_PMPI_CALL(int,MPI_Group_range_excl,(MPI_Group group, int n, int ranges[][3], MPI_Group * newgroup),(group, n, ranges, newgroup))
 WRAPPED_PMPI_CALL(int,MPI_Group_range_incl,(MPI_Group group, int n, int ranges[][3], MPI_Group * newgroup),(group, n, ranges, newgroup))
 WRAPPED_PMPI_CALL(int,MPI_Group_rank,(MPI_Group group, int *rank),(group, rank))
 WRAPPED_PMPI_CALL(int,MPI_Group_size,(MPI_Group group, int *size),(group, size))
-WRAPPED_PMPI_CALL(int,MPI_Group_translate_ranks,(MPI_Group group1, int n, int *ranks1, MPI_Group group2, int *ranks2),(group1, n, ranks1, group2, ranks2))
+WRAPPED_PMPI_CALL(int,MPI_Group_translate_ranks,(MPI_Group group1, int n, const int *ranks1, MPI_Group group2, int *ranks2),(group1, n, ranks1, group2, ranks2))
 WRAPPED_PMPI_CALL(int,MPI_Group_union,(MPI_Group group1, MPI_Group group2, MPI_Group * newgroup),(group1, group2, newgroup))
-WRAPPED_PMPI_CALL(int,MPI_Ibarrier,(MPI_Comm comm, MPI_Request *request),(comm,request))
-WRAPPED_PMPI_CALL(int,MPI_Ibcast,(void* buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm, MPI_Request *request),(buf, count, datatype, root, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Ibarrier,(MPI_Comm comm, MPI_Request *request),(comm,request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Ibcast,(void* buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm, MPI_Request *request),(buf, count, datatype, root, comm, request))
 
-WRAPPED_PMPI_CALL(int,MPI_Iallgather,(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Iallgatherv,(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs,MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Iallreduce,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request),(sendbuf, recvbuf, count, datatype, op, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Ialltoall,(void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount,MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Ialltoallv,(void *sendbuf, int *sendcounts, int *senddisps, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcounts, senddisps, sendtype, recvbuf, recvcounts, recvdisps, recvtype, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Ialltoallw,( void *sendbuf, int *sendcnts, int *sdispls, MPI_Datatype *sendtypes, void *recvbuf, int *recvcnts, int *rdispls, MPI_Datatype *recvtypes, MPI_Comm comm, MPI_Request *request),( sendbuf, sendcnts, sdispls, sendtypes, recvbuf, recvcnts, rdispls, recvtypes, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Igather,(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Igatherv,(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs,MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Ireduce_scatter_block,(void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op,MPI_Comm comm, MPI_Request *request),(sendbuf, recvbuf, recvcount, datatype, op, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Ireduce_scatter,(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request),(sendbuf, recvbuf, recvcounts, datatype, op, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Ireduce,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request *request),(sendbuf, recvbuf, count, datatype, op, root, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Iexscan,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request),(sendbuf, recvbuf, count, datatype, op, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Iscan,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request),(sendbuf, recvbuf, count, datatype, op, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Iscatter,(void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount, MPI_Datatype recvtype,int root, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Iscatterv,(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount,MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Iallgather,(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Iallgatherv,(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs,MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Iallreduce,(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request),(sendbuf, recvbuf, count, datatype, op, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Ialltoall,(const void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount,MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Ialltoallv,(const void *sendbuf, const int *sendcounts, const int *senddisps, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcounts, senddisps, sendtype, recvbuf, recvcounts, recvdisps, recvtype, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Ialltoallw,(const void *sendbuf, const int *sendcnts, const int *sdispls, const MPI_Datatype *sendtypes, void *recvbuf, const int *recvcnts, const int *rdispls, const MPI_Datatype *recvtypes, MPI_Comm comm, MPI_Request *request),( sendbuf, sendcnts, sdispls, sendtypes, recvbuf, recvcnts, rdispls, recvtypes, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Igather,(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Igatherv,(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs,MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Ireduce_scatter_block,(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op,MPI_Comm comm, MPI_Request *request),(sendbuf, recvbuf, recvcount, datatype, op, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Ireduce_scatter,(const void *sendbuf, void *recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request),(sendbuf, recvbuf, recvcounts, datatype, op, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Ireduce,(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request *request),(sendbuf, recvbuf, count, datatype, op, root, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Iexscan,(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request),(sendbuf, recvbuf, count, datatype, op, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Iscan,(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request),(sendbuf, recvbuf, count, datatype, op, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Iscatter,(const void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount, MPI_Datatype recvtype,int root, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Iscatterv,(const void *sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount,MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request))
 
 WRAPPED_PMPI_CALL(int,MPI_Info_create,( MPI_Info *info),( info))
-WRAPPED_PMPI_CALL(int,MPI_Info_delete,(MPI_Info info, char *key),(info, key))
+WRAPPED_PMPI_CALL(int,MPI_Info_delete,(MPI_Info info, const char *key),(info, key))
 WRAPPED_PMPI_CALL(int,MPI_Info_dup,(MPI_Info info, MPI_Info *newinfo),(info, newinfo))
 WRAPPED_PMPI_CALL(int,MPI_Info_free,( MPI_Info *info),( info))
-WRAPPED_PMPI_CALL(int,MPI_Info_get,(MPI_Info info,char *key,int valuelen, char *value, int *flag),(info,key,valuelen, value, flag))
+WRAPPED_PMPI_CALL(int,MPI_Info_get,(MPI_Info info,const char *key,int valuelen, char *value, int *flag),(info,key,valuelen, value, flag))
 WRAPPED_PMPI_CALL(int,MPI_Info_get_nkeys,( MPI_Info info, int *nkeys),(info, nkeys))
 WRAPPED_PMPI_CALL(int,MPI_Info_get_nthkey,( MPI_Info info, int n, char *key),( info, n, key))
-WRAPPED_PMPI_CALL(int,MPI_Info_get_valuelen,( MPI_Info info, char *key, int *valuelen, int *flag),( info, key, valuelen, flag))
-WRAPPED_PMPI_CALL(int,MPI_Info_set,( MPI_Info info, char *key, char *value),( info, key, value))
+WRAPPED_PMPI_CALL(int,MPI_Info_get_valuelen,( MPI_Info info, const char *key, int *valuelen, int *flag),( info, key, valuelen, flag))
+WRAPPED_PMPI_CALL(int,MPI_Info_set,( MPI_Info info, const char *key, const char *value),( info, key, value))
 WRAPPED_PMPI_CALL(int,MPI_Initialized,(int* flag) ,(flag))
 WRAPPED_PMPI_CALL(int,MPI_Init,(int *argc, char ***argv),(argc, argv))
 WRAPPED_PMPI_CALL(int,MPI_Init_thread,(int *argc, char ***argv, int required, int *provided),(argc, argv, required, provided))
-WRAPPED_PMPI_CALL(int,MPI_Iprobe,(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* status) ,(source, tag, comm, flag, status))
-WRAPPED_PMPI_CALL(int,MPI_Irecv,(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Request * request),(buf, count, datatype, src, tag, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Isend,(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request * request),(buf, count, datatype, dst, tag, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Issend,(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) ,(buf, count, datatype, dest, tag, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Iprobe,(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* status) ,(source, tag, comm, flag, status))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Irecv,(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Request * request),(buf, count, datatype, src, tag, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Isend,(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request * request),(buf, count, datatype, dst, tag, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Ibsend,(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) ,(buf, count, datatype, dest, tag, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Issend,(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) ,(buf, count, datatype, dest, tag, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Irsend,(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request),(buf, count, datatype, dest, tag, comm, request))
 WRAPPED_PMPI_CALL(int,MPI_Is_thread_main,(int *flag),(flag))
 WRAPPED_PMPI_CALL(int,MPI_Keyval_create,(MPI_Copy_function* copy_fn, MPI_Delete_function* delete_fn, int* keyval, void* extra_state) ,(copy_fn, delete_fn, keyval, extra_state))
 WRAPPED_PMPI_CALL(int,MPI_Keyval_free,(int* keyval) ,(keyval))
@@ -183,30 +209,32 @@ WRAPPED_PMPI_CALL(int,MPI_Op_create,(MPI_User_function * function, int commute,
 WRAPPED_PMPI_CALL(int,MPI_Op_free,(MPI_Op * op),(op))
 WRAPPED_PMPI_CALL(int,MPI_Op_commutative,(MPI_Op op, int *commute), (op, commute))
 WRAPPED_PMPI_CALL(int,MPI_Pack_size,(int incount, MPI_Datatype datatype, MPI_Comm comm, int* size) ,(incount, datatype, comm, size))
-WRAPPED_PMPI_CALL(int,MPI_Pack,(void* inbuf, int incount, MPI_Datatype type, void* outbuf, int outcount, int* position, MPI_Comm comm) ,(inbuf, incount, type, outbuf, outcount, position, comm))
-WRAPPED_PMPI_CALL(int,MPI_Probe,(int source, int tag, MPI_Comm comm, MPI_Status* status) ,(source, tag, comm, status))
-WRAPPED_PMPI_CALL(int,MPI_Put,( 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),(origin_addr,origin_count, origin_datatype,target_rank,target_disp, target_count,target_datatype, win))
+WRAPPED_PMPI_CALL(int,MPI_Pack,(const void* inbuf, int incount, MPI_Datatype type, void* outbuf, int outcount, int* position, MPI_Comm comm) ,(inbuf, incount, type, outbuf, outcount, position, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Probe,(int source, int tag, MPI_Comm comm, MPI_Status* status) ,(source, tag, comm, status))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Put,(const 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),(origin_addr,origin_count, origin_datatype,target_rank,target_disp, target_count,target_datatype, win))
 WRAPPED_PMPI_CALL(int,MPI_Query_thread,(int *provided),(provided))
-WRAPPED_PMPI_CALL(int,MPI_Raccumulate,( 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_Op op, MPI_Win win, MPI_Request* request),( origin_addr,origin_count, origin_datatype,target_rank,target_disp, target_count,target_datatype,op, win, request))
-WRAPPED_PMPI_CALL(int,MPI_Recv_init,(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Request * request),(buf, count, datatype, src, tag, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Recv,(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status * status),(buf, count, datatype, src, tag, comm, status))
-WRAPPED_PMPI_CALL(int,MPI_Reduce_local,(void *inbuf, void *inoutbuf, int count, MPI_Datatype datatype, MPI_Op op),(inbuf, inoutbuf, count, datatype, op))
-WRAPPED_PMPI_CALL(int,MPI_Reduce_scatter_block,(void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op,MPI_Comm comm),(sendbuf, recvbuf, recvcount, datatype, op, comm))
-WRAPPED_PMPI_CALL(int,MPI_Reduce_scatter,(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm),(sendbuf, recvbuf, recvcounts, datatype, op, comm))
-WRAPPED_PMPI_CALL(int,MPI_Reduce,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm),(sendbuf, recvbuf, count, datatype, op, root, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Raccumulate,(const 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_Op op, MPI_Win win, MPI_Request* request),( origin_addr,origin_count, origin_datatype,target_rank,target_disp, target_count,target_datatype,op, win, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Recv_init,(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Request * request),(buf, count, datatype, src, tag, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Recv,(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status * status),(buf, count, datatype, src, tag, comm, status))
+WRAPPED_PMPI_CALL(int,MPI_Reduce_local,(const void *inbuf, void *inoutbuf, int count, MPI_Datatype datatype, MPI_Op op),(inbuf, inoutbuf, count, datatype, op))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Reduce_scatter_block,(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op,MPI_Comm comm),(sendbuf, recvbuf, recvcount, datatype, op, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Reduce_scatter,(const void *sendbuf, void *recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm),(sendbuf, recvbuf, recvcounts, datatype, op, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Reduce,(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm),(sendbuf, recvbuf, count, datatype, op, root, comm))
 WRAPPED_PMPI_CALL(int,MPI_Request_free,(MPI_Request * request),(request))
-WRAPPED_PMPI_CALL(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),(origin_addr,origin_count, origin_datatype,target_rank, target_disp, target_count,target_datatype,win, request))
-WRAPPED_PMPI_CALL(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),(origin_addr, origin_count, origin_datatype, result_addr, result_count, result_datatype, target_rank, target_disp, target_count, target_datatype, op, win, request))
-WRAPPED_PMPI_CALL(int,MPI_Rput,( 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),(origin_addr,origin_count, origin_datatype,target_rank,target_disp, target_count,target_datatype, win, request))
-WRAPPED_PMPI_CALL(int,MPI_Scan,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm),(sendbuf, recvbuf, count, datatype, op, comm))
-WRAPPED_PMPI_CALL(int,MPI_Scatter,(void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount, MPI_Datatype recvtype,int root, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm))
-WRAPPED_PMPI_CALL(int,MPI_Scatterv,(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount,MPI_Datatype recvtype, int root, MPI_Comm comm),(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm))
-WRAPPED_PMPI_CALL(int,MPI_Send_init,(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request * request),(buf, count, datatype, dst, tag, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Sendrecv_replace,(void *buf, int count, MPI_Datatype datatype, int dst, int sendtag, int src, int recvtag,MPI_Comm comm, MPI_Status * status),(buf, count, datatype, dst, sendtag, src, recvtag, comm, status))
-WRAPPED_PMPI_CALL(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),(sendbuf, sendcount, sendtype, dst, sendtag, recvbuf, recvcount, recvtype, src, recvtag,comm, status))
-WRAPPED_PMPI_CALL(int,MPI_Send,(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm),(buf, count, datatype, dst, tag, comm))
-WRAPPED_PMPI_CALL(int,MPI_Ssend_init,(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request),(buf, count, datatype, dest, tag, comm, request))
-WRAPPED_PMPI_CALL(int,MPI_Ssend,(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) ,(buf, count, datatype, dest, tag, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(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),(origin_addr,origin_count, origin_datatype,target_rank, target_disp, target_count,target_datatype,win, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Rget_accumulate, (const 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),(origin_addr, origin_count, origin_datatype, result_addr, result_count, result_datatype, target_rank, target_disp, target_count, target_datatype, op, win, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Rput,(const 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),(origin_addr,origin_count, origin_datatype,target_rank,target_disp, target_count,target_datatype, win, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Scan,(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm),(sendbuf, recvbuf, count, datatype, op, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Scatter,(const void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount, MPI_Datatype recvtype,int root, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Scatterv,(const void *sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount,MPI_Datatype recvtype, int root, MPI_Comm comm),(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Send_init,(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request * request),(buf, count, datatype, dst, tag, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Sendrecv_replace,(void *buf, int count, MPI_Datatype datatype, int dst, int sendtag, int src, int recvtag,MPI_Comm comm, MPI_Status * status),(buf, count, datatype, dst, sendtag, src, recvtag, comm, status))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Sendrecv,(const 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),(sendbuf, sendcount, sendtype, dst, sendtag, recvbuf, recvcount, recvtype, src, recvtag,comm, status))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Send,(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm),(buf, count, datatype, dst, tag, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Ssend_init,(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request),(buf, count, datatype, dest, tag, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Ssend,(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) ,(buf, count, datatype, dest, tag, comm))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Rsend_init,(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request),(buf, count, datatype, dest, tag, comm, request))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Rsend,(const void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) ,(buf, count, datatype, dest, tag, comm))
 WRAPPED_PMPI_CALL(int,MPI_Startall,(int count, MPI_Request * requests),(count, requests))
 WRAPPED_PMPI_CALL(int,MPI_Start,(MPI_Request * request),(request))
 WRAPPED_PMPI_CALL(int,MPI_Testall,(int count, MPI_Request* requests, int* flag, MPI_Status* statuses) ,(count, requests, flag, statuses))
@@ -218,15 +246,15 @@ WRAPPED_PMPI_CALL(int,MPI_Grequest_complete,( MPI_Request request),( request))
 WRAPPED_PMPI_CALL(int,MPI_Grequest_start,(MPI_Grequest_query_function *query_fn, MPI_Grequest_free_function *free_fn,MPI_Grequest_cancel_function *cancel_fn, void *extra_state, MPI_Request *request),( query_fn, free_fn, cancel_fn, extra_state, request))
 WRAPPED_PMPI_CALL(int,MPI_Type_commit,(MPI_Datatype* datatype) ,(datatype))
 WRAPPED_PMPI_CALL(int,MPI_Type_contiguous,(int count, MPI_Datatype old_type, MPI_Datatype* newtype) ,(count, old_type, newtype))
-WRAPPED_PMPI_CALL(int,MPI_Type_create_hindexed_block,(int count, int blocklength, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype) ,(count, blocklength, indices, old_type, newtype))
-WRAPPED_PMPI_CALL(int,MPI_Type_create_hindexed,(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type,MPI_Datatype* new_type) ,(count, blocklens,indices,old_type,new_type))
+WRAPPED_PMPI_CALL(int,MPI_Type_create_hindexed_block,(int count, int blocklength, const MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype) ,(count, blocklength, indices, old_type, newtype))
+WRAPPED_PMPI_CALL(int,MPI_Type_create_hindexed,(int count, const int* blocklens, const MPI_Aint* indices, MPI_Datatype old_type,MPI_Datatype* new_type) ,(count, blocklens,indices,old_type,new_type))
 WRAPPED_PMPI_CALL(int,MPI_Type_create_hvector,(int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* new_type) ,(count, blocklen, stride, old_type, new_type))
-WRAPPED_PMPI_CALL(int,MPI_Type_create_indexed_block,(int count, int blocklength, int* indices,MPI_Datatype old_type,MPI_Datatype *newtype),(count, blocklength, indices, old_type, newtype))
-WRAPPED_PMPI_CALL(int,MPI_Type_create_indexed,(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* newtype) ,(count, blocklens, indices, old_type, newtype))
+WRAPPED_PMPI_CALL(int,MPI_Type_create_indexed_block,(int count, int blocklength, const int* indices,MPI_Datatype old_type,MPI_Datatype *newtype),(count, blocklength, indices, old_type, newtype))
+WRAPPED_PMPI_CALL(int,MPI_Type_create_indexed,(int count, const int* blocklens, const int* indices, MPI_Datatype old_type, MPI_Datatype* newtype) ,(count, blocklens, indices, old_type, newtype))
 WRAPPED_PMPI_CALL(int,MPI_Type_create_keyval,(MPI_Type_copy_attr_function* copy_fn, MPI_Type_delete_attr_function* delete_fn, int* keyval,void* extra_state),(copy_fn,delete_fn,keyval,extra_state))
 WRAPPED_PMPI_CALL(int,MPI_Type_create_resized,(MPI_Datatype oldtype,MPI_Aint lb, MPI_Aint extent, MPI_Datatype *newtype),(oldtype,lb, extent, newtype))
-WRAPPED_PMPI_CALL(int,MPI_Type_create_struct,(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types,MPI_Datatype* newtype) ,(count, blocklens, indices, old_types, newtype))
-WRAPPED_PMPI_CALL(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),(ndims,array_of_sizes, array_of_subsizes, array_of_starts, order, oldtype, newtype))
+WRAPPED_PMPI_CALL(int,MPI_Type_create_struct,(int count, const int* blocklens, const MPI_Aint* indices, const MPI_Datatype* old_types,MPI_Datatype* newtype) ,(count, blocklens, indices, old_types, newtype))
+WRAPPED_PMPI_CALL(int,MPI_Type_create_subarray,(int ndims,const int *array_of_sizes, const int *array_of_subsizes, const int *array_of_starts, int order,MPI_Datatype oldtype, MPI_Datatype *newtype),(ndims,array_of_sizes, array_of_subsizes, array_of_starts, order, oldtype, newtype))
 WRAPPED_PMPI_CALL(int,MPI_Type_delete_attr ,(MPI_Datatype type, int type_keyval),(type,type_keyval))
 WRAPPED_PMPI_CALL(int,MPI_Type_dup,(MPI_Datatype datatype, MPI_Datatype * newdatatype),(datatype, newdatatype))
 WRAPPED_PMPI_CALL(int,MPI_Type_extent,(MPI_Datatype datatype, MPI_Aint * extent),(datatype, extent))
@@ -236,54 +264,58 @@ WRAPPED_PMPI_CALL(int,MPI_Type_get_attr ,(MPI_Datatype type, int type_keyval, vo
 WRAPPED_PMPI_CALL(int,MPI_Type_get_extent,(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent),(datatype, lb, extent))
 WRAPPED_PMPI_CALL(int,MPI_Type_get_name,(MPI_Datatype datatype, char * name, int* len),(datatype,name,len))
 WRAPPED_PMPI_CALL(int,MPI_Type_get_true_extent,(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent),(datatype, lb, extent))
-WRAPPED_PMPI_CALL(int,MPI_Type_hindexed,(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype) ,(count, blocklens, indices, old_type, newtype))
+WRAPPED_PMPI_CALL(int,MPI_Type_hindexed,(int count, const int* blocklens, const MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype) ,(count, blocklens, indices, old_type, newtype))
 WRAPPED_PMPI_CALL(int,MPI_Type_hvector,(int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* newtype) ,(count, blocklen, stride, old_type, newtype))
-WRAPPED_PMPI_CALL(int,MPI_Type_indexed,(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* newtype) ,(count, blocklens, indices, old_type, newtype))
+WRAPPED_PMPI_CALL(int,MPI_Type_indexed,(int count, const int* blocklens, const int* indices, MPI_Datatype old_type, MPI_Datatype* newtype) ,(count, blocklens, indices, old_type, newtype))
 WRAPPED_PMPI_CALL(int,MPI_Type_lb,(MPI_Datatype datatype, MPI_Aint * disp),(datatype, disp))
 WRAPPED_PMPI_CALL(int,MPI_Type_set_attr ,(MPI_Datatype type, int type_keyval, void *attribute_val),( type, type_keyval, attribute_val))
-WRAPPED_PMPI_CALL(int,MPI_Type_set_name,(MPI_Datatype datatype, char * name),(datatype, name))
+WRAPPED_PMPI_CALL(int,MPI_Type_set_name,(MPI_Datatype datatype, const char * name),(datatype, name))
 WRAPPED_PMPI_CALL(int,MPI_Type_size,(MPI_Datatype datatype, int *size),(datatype, size))
 WRAPPED_PMPI_CALL(int,MPI_Type_size_x,(MPI_Datatype datatype, MPI_Count *size),(datatype, size))
-WRAPPED_PMPI_CALL(int,MPI_Type_struct,(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* newtype) ,(count, blocklens, indices, old_types, newtype))
+WRAPPED_PMPI_CALL(int,MPI_Type_struct,(int count, const int* blocklens, const MPI_Aint* indices, const MPI_Datatype* old_types, MPI_Datatype* newtype) ,(count, blocklens, indices, old_types, newtype))
 WRAPPED_PMPI_CALL(int,MPI_Type_ub,(MPI_Datatype datatype, MPI_Aint * disp),(datatype, disp))
 WRAPPED_PMPI_CALL(int,MPI_Type_vector,(int count, int blocklen, int stride, MPI_Datatype old_type, MPI_Datatype* newtype) ,(count, blocklen, stride, old_type, newtype))
-WRAPPED_PMPI_CALL(int,MPI_Unpack,(void* inbuf, int insize, int* position, void* outbuf, int outcount, MPI_Datatype type, MPI_Comm comm) ,(inbuf, insize, position, outbuf, outcount, type, comm))
+WRAPPED_PMPI_CALL(int,MPI_Unpack,(const void* inbuf, int insize, int* position, void* outbuf, int outcount, MPI_Datatype type, MPI_Comm comm) ,(inbuf, insize, position, outbuf, outcount, type, comm))
 WRAPPED_PMPI_CALL(int,MPI_Waitall,(int count, MPI_Request requests[], MPI_Status status[]),(count, requests, status))
 WRAPPED_PMPI_CALL(int,MPI_Waitany,(int count, MPI_Request requests[], int *index, MPI_Status * status),(count, requests, index, status))
 WRAPPED_PMPI_CALL(int,MPI_Wait,(MPI_Request * request, MPI_Status * status),(request, status))
 WRAPPED_PMPI_CALL(int,MPI_Waitsome,(int incount, MPI_Request requests[], int *outcount, int *indices, MPI_Status status[]),(incount, requests, outcount, indices, status))
-WRAPPED_PMPI_CALL(int,MPI_Win_complete,(MPI_Win win),(win))
-WRAPPED_PMPI_CALL(int,MPI_Win_create,( void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win),( base, size, disp_unit, info, comm,win))
-WRAPPED_PMPI_CALL(int,MPI_Win_allocate,(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void *base, MPI_Win *win),(size, disp_unit, info, comm, base, win))
-WRAPPED_PMPI_CALL(int,MPI_Win_allocate_shared,(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void *base, MPI_Win *win),(size, disp_unit, info, comm, base, win))
-WRAPPED_PMPI_CALL(int,MPI_Win_attach,(MPI_Win win, void *base, MPI_Aint size),(win, base, size))
-WRAPPED_PMPI_CALL(int,MPI_Win_detach,(MPI_Win win, void *base),(win, base))
-WRAPPED_PMPI_CALL(int,MPI_Win_create_dynamic,( MPI_Info info, MPI_Comm comm, MPI_Win *win),(info, comm,win))
-WRAPPED_PMPI_CALL(int,MPI_Win_fence,( int assert,MPI_Win win),( assert, win))
-WRAPPED_PMPI_CALL(int,MPI_Win_free,( MPI_Win* win),(win))
-WRAPPED_PMPI_CALL(int,MPI_Win_get_group,(MPI_Win win, MPI_Group * group),(win, group))
-WRAPPED_PMPI_CALL(int,MPI_Win_get_name,(MPI_Win win, char * name, int* len),(win,name,len))
-WRAPPED_PMPI_CALL(int,MPI_Win_get_info,(MPI_Win win, MPI_Info * info),(win,info))
-WRAPPED_PMPI_CALL(int,MPI_Win_post,(MPI_Group group, int assert, MPI_Win win),(group, assert, win))
-WRAPPED_PMPI_CALL(int,MPI_Win_set_name,(MPI_Win win, char * name),(win, name))
-WRAPPED_PMPI_CALL(int,MPI_Win_set_info,(MPI_Win win, MPI_Info info),(win,info))
-WRAPPED_PMPI_CALL(int,MPI_Win_start,(MPI_Group group, int assert, MPI_Win win),(group, assert, win))
-WRAPPED_PMPI_CALL(int,MPI_Win_wait,(MPI_Win win),(win))
-WRAPPED_PMPI_CALL(int,MPI_Win_lock,(int lock_type, int rank, int assert, MPI_Win win) ,(lock_type, rank, assert, win))
-WRAPPED_PMPI_CALL(int,MPI_Win_unlock,(int rank, MPI_Win win),(rank, win))
-WRAPPED_PMPI_CALL(int,MPI_Win_lock_all,(int assert, MPI_Win win) ,(assert, win))
-WRAPPED_PMPI_CALL(int,MPI_Win_unlock_all,(MPI_Win win),(win))
-WRAPPED_PMPI_CALL(int,MPI_Win_flush,(int rank, MPI_Win win),(rank, win))
-WRAPPED_PMPI_CALL(int,MPI_Win_flush_local,(int rank, MPI_Win win),(rank, win))
-WRAPPED_PMPI_CALL(int,MPI_Win_flush_all,(MPI_Win win),(win))
-WRAPPED_PMPI_CALL(int,MPI_Win_flush_local_all,(MPI_Win win),(win))
-WRAPPED_PMPI_CALL(int,MPI_Win_get_attr, (MPI_Win type, int type_keyval, void *attribute_val, int* flag), (type, type_keyval, attribute_val, flag))
-WRAPPED_PMPI_CALL(int,MPI_Win_set_attr, (MPI_Win type, int type_keyval, void *att), (type, type_keyval, att))
-WRAPPED_PMPI_CALL(int,MPI_Win_delete_attr, (MPI_Win type, int comm_keyval), (type, comm_keyval))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_complete,(MPI_Win win),(win))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Win_create,( void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win *win),( base, size, disp_unit, info, comm,win))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Win_allocate,(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void *base, MPI_Win *win),(size, disp_unit, info, comm, base, win))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Win_allocate_shared,(MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void *base, MPI_Win *win),(size, disp_unit, info, comm, base, win))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_attach,(MPI_Win win, void *base, MPI_Aint size),(win, base, size))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_detach,(MPI_Win win, const void *base),(win, base))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int,MPI_Win_create_dynamic,( MPI_Info info, MPI_Comm comm, MPI_Win *win),(info, comm,win))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_fence,( int assert,MPI_Win win),( assert, win))
+WRAPPED_PMPI_CALL_ERRHANDLER(int,MPI_Win_free,( MPI_Win* win),(win), (*win))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_get_group,(MPI_Win win, MPI_Group * group),(win, group))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_get_name,(MPI_Win win, char * name, int* len),(win,name,len))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_get_info,(MPI_Win win, MPI_Info * info),(win,info))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_post,(MPI_Group group, int assert, MPI_Win win),(group, assert, win))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_set_name,(MPI_Win win, const char * name),(win, name))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_set_info,(MPI_Win win, MPI_Info info),(win,info))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_start,(MPI_Group group, int assert, MPI_Win win),(group, assert, win))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_wait,(MPI_Win win),(win))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_lock,(int lock_type, int rank, int assert, MPI_Win win) ,(lock_type, rank, assert, win))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_unlock,(int rank, MPI_Win win),(rank, win))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_lock_all,(int assert, MPI_Win win) ,(assert, win))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_unlock_all,(MPI_Win win),(win))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_flush,(int rank, MPI_Win win),(rank, win))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_flush_local,(int rank, MPI_Win win),(rank, win))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_flush_all,(MPI_Win win),(win))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_flush_local_all,(MPI_Win win),(win))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_get_attr, (MPI_Win win, int type_keyval, void *attribute_val, int* flag), (win, type_keyval, attribute_val, flag))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_set_attr, (MPI_Win win, int type_keyval, void *att), (win, type_keyval, att))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_delete_attr, (MPI_Win win, int comm_keyval), (win, comm_keyval))
 WRAPPED_PMPI_CALL(int,MPI_Win_create_keyval,(MPI_Win_copy_attr_function* copy_fn,
                               MPI_Win_delete_attr_function* delete_fn, int* keyval, void* extra_state), (copy_fn, delete_fn, keyval, extra_state))
 WRAPPED_PMPI_CALL(int,MPI_Win_free_keyval,(int* keyval), (keyval))
-WRAPPED_PMPI_CALL(int,MPI_Win_shared_query,(MPI_Win win, int rank, MPI_Aint* size, int* disp_unit, void* baseptr),(win, rank, size, disp_unit, baseptr))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_shared_query,(MPI_Win win, int rank, MPI_Aint* size, int* disp_unit, void* baseptr),(win, rank, size, disp_unit, baseptr))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_set_errhandler,(MPI_Win win, MPI_Errhandler errhandler) ,(win, errhandler))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_call_errhandler,(MPI_Win win,int errorcode),(win, errorcode))
+WRAPPED_PMPI_CALL(int,MPI_Win_create_errhandler,( MPI_Win_errhandler_function *function, MPI_Errhandler *errhandler),( function, errhandler))
+WRAPPED_PMPI_CALL_ERRHANDLER_WIN(int,MPI_Win_get_errhandler,(MPI_Win win, MPI_Errhandler* errhandler) ,(win, errhandler))
 WRAPPED_PMPI_CALL_NORETURN(MPI_Comm, MPI_Comm_f2c,(MPI_Fint comm),(comm))
 WRAPPED_PMPI_CALL_NORETURN(MPI_Datatype, MPI_Type_f2c,(MPI_Fint datatype),(datatype))
 WRAPPED_PMPI_CALL_NORETURN(MPI_Fint, MPI_Comm_c2f,(MPI_Comm comm),(comm))
@@ -299,9 +331,39 @@ WRAPPED_PMPI_CALL_NORETURN(MPI_Op, MPI_Op_f2c,(MPI_Fint op),(op))
 WRAPPED_PMPI_CALL_NORETURN(MPI_Request, MPI_Request_f2c,(MPI_Fint request),(request))
 WRAPPED_PMPI_CALL_NORETURN(MPI_Win, MPI_Win_f2c,(MPI_Fint win),(win))
 WRAPPED_PMPI_CALL(int, MPI_Cancel,(MPI_Request* request) ,(request))
-WRAPPED_PMPI_CALL(int, MPI_Test_cancelled,(MPI_Status* status, int* flag) ,(status, flag))
+WRAPPED_PMPI_CALL(int, MPI_Test_cancelled,(const MPI_Status* status, int* flag) ,(status, flag))
 WRAPPED_PMPI_CALL(int, MPI_Status_set_cancelled,(MPI_Status *status,int flag),(status,flag))
-WRAPPED_PMPI_CALL(int,MPI_Status_set_elements,( MPI_Status *status, MPI_Datatype datatype, int count),( status, datatype, count))
+WRAPPED_PMPI_CALL(int, MPI_Status_set_elements,( MPI_Status *status, MPI_Datatype datatype, int count),( status, datatype, count))
+WRAPPED_PMPI_CALL_ERRHANDLER_COMM(int, MPI_File_open,(MPI_Comm comm, const char *filename, int amode, MPI_Info info, MPI_File *fh),(comm, filename, amode, info, fh))
+WRAPPED_PMPI_CALL_ERRHANDLER(int, MPI_File_close,(MPI_File *fh), (fh), (*fh))
+WRAPPED_PMPI_CALL(int, MPI_File_delete,(const char *filename, MPI_Info info), (filename, info))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_set_info,(MPI_File fh, MPI_Info info), (fh, info))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_get_info,(MPI_File fh, MPI_Info *info_used), (fh, info_used))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_read_at,(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status), (fh, offset, buf, count, datatype, status))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_read_at_all,(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status), (fh, offset, buf, count, datatype, status))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_write_at,(MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status), (fh, offset, buf, count, datatype, status))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_write_at_all,(MPI_File fh, MPI_Offset offset, const void *buf,int count, MPI_Datatype datatype, MPI_Status *status), (fh, offset, buf, count, datatype, status))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_read,(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status), (fh, buf, count, datatype, status))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_read_all,(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status), (fh, buf, count, datatype, status))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_write,(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status), (fh, buf, count, datatype, status))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_write_all,(MPI_File fh, const void *buf, int count,MPI_Datatype datatype, MPI_Status *status), (fh, buf, count, datatype, status))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_seek,(MPI_File fh, MPI_Offset offset, int whenace), (fh, offset, whenace))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_get_position,(MPI_File fh, MPI_Offset *offset), (fh, offset))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_read_shared,(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status), (fh, buf, count, datatype, status))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_write_shared,(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status), (fh, buf, count, datatype, status))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_read_ordered,(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status), (fh, buf, count, datatype, status))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_write_ordered,(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status), (fh, buf, count, datatype, status))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_seek_shared,(MPI_File fh, MPI_Offset offset, int whence), (fh, offset, whence))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_get_position_shared,(MPI_File fh, MPI_Offset *offset), (fh, offset))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_get_size,(MPI_File fh, MPI_Offset *size), (fh, size))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_get_group,(MPI_File fh, MPI_Group *group), (fh, group))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_get_amode,(MPI_File fh, int *amode), (fh, amode))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_sync,(MPI_File fh), (fh))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_call_errhandler,(MPI_File fh, int errorcode), (fh, errorcode))
+WRAPPED_PMPI_CALL(int, MPI_File_create_errhandler,(MPI_File_errhandler_function *function, MPI_Errhandler *errhandler),(function, errhandler))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_set_errhandler,( MPI_File fh, MPI_Errhandler errhandler), (fh, errhandler))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_get_errhandler,( MPI_File fh, MPI_Errhandler *errhandler), (fh, errhandler))
+
 /*
   Unimplemented Calls - both PMPI and MPI calls are generated.
   When implementing, please move ahead, swap UNIMPLEMENTED_WRAPPED_PMPI_CALL for WRAPPED_PMPI_CALL,
@@ -312,114 +374,65 @@ WRAPPED_PMPI_CALL(int,MPI_Status_set_elements,( MPI_Status *status, MPI_Datatype
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Add_error_class,( int *errorclass),( errorclass))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Add_error_code,(int errorclass, int *errorcode),(errorclass, errorcode))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Add_error_string,( int errorcode, char *string),(errorcode, string))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Bsend_init,(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request),(buf, count, datatype, dest, tag, comm, request))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Bsend,(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) ,(buf, count, datatype, dest, tag, comm))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Buffer_attach,(void* buffer, int size) ,(buffer, size))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Buffer_detach,(void* buffer, int* size) ,(buffer, size))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Cart_map,(MPI_Comm comm_old, int ndims, int* dims, int* periods, int* newrank) ,(comm_old, ndims, dims, periods, newrank))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Close_port,( char *port_name),( port_name))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_accept,( char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm),( port_name, info, root, comm, newcomm))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(int,MPI_Comm_call_errhandler,(MPI_Comm comm,int errorcode),(comm, errorcode))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_connect,( char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm),( port_name, info, root, comm, newcomm))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(int,MPI_Comm_create_errhandler,( MPI_Comm_errhandler_fn *function, MPI_Errhandler *errhandler),( function, errhandler))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_dup_with_info,(MPI_Comm comm, MPI_Info info, MPI_Comm * newcomm),(comm,info,newcomm))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(int,MPI_Comm_get_errhandler,(MPI_Comm comm, MPI_Errhandler* errhandler) ,(comm, errhandler))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_get_info ,(MPI_Comm comm, MPI_Info* info),(comm, info))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Cart_map,(MPI_Comm comm_old, int ndims, const int* dims, const int* periods, int* newrank) ,(comm_old, ndims, dims, periods, newrank))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Close_port,(const char *port_name),( port_name))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_accept,(const char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm),( port_name, info, root, comm, newcomm))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_connect,(const char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm),( port_name, info, root, comm, newcomm))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_get_parent,( MPI_Comm *parent),( parent))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_join,( int fd, MPI_Comm *intercomm),( fd, intercomm))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_remote_group,(MPI_Comm comm, MPI_Group* group) ,(comm, group))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_remote_size,(MPI_Comm comm, int* size) ,(comm, size))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(int,MPI_Comm_set_errhandler,(MPI_Comm comm, MPI_Errhandler errhandler) ,(comm, errhandler))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(int,MPI_Comm_set_info ,(MPI_Comm comm, MPI_Info info),(comm, info))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(int,MPI_Comm_set_name ,(MPI_Comm comm, char* name),(comm, name))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_spawn,( char *command, char **argv, int maxprocs, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *intercomm, int* array_of_errcodes),( command, argv, maxprocs, info, root, comm, intercomm, array_of_errcodes))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_spawn,(const char *command, char **argv, int maxprocs, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *intercomm, int* array_of_errcodes),( command, argv, maxprocs, info, root, comm, intercomm, array_of_errcodes))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_spawn_multiple,(int count, char **array_of_commands, char*** array_of_argv, int* array_of_maxprocs, MPI_Info* array_of_info, int root, MPI_Comm comm, MPI_Comm *intercomm, int* array_of_errcodes), (count, array_of_commands, array_of_argv, array_of_maxprocs, array_of_info, root, comm, intercomm, array_of_errcodes))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_test_inter,(MPI_Comm comm, int* flag) ,(comm, flag))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(int,MPI_Errhandler_create,(MPI_Handler_function* function, MPI_Errhandler* errhandler) ,(function, errhandler))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(int,MPI_Errhandler_free,(MPI_Errhandler* errhandler) ,(errhandler))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(int,MPI_Errhandler_get,(MPI_Comm comm, MPI_Errhandler* errhandler) ,(comm, errhandler))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(int,MPI_Errhandler_set,(MPI_Comm comm, MPI_Errhandler errhandler) ,(comm, errhandler))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Register_datarep, (char *datarep, MPI_Datarep_conversion_function *read_conversion_fn, MPI_Datarep_conversion_function *write_conversion_fn, MPI_Datarep_extent_function *dtype_file_extent_fn, void *extra_state) ,(datarep, read_conversion_fn, write_conversion_fn, dtype_file_extent_fn, extra_state))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(MPI_Fint, MPI_File_c2f,(MPI_File file), (file))
 //UNIMPLEMENTED_WRAPPED_PMPI_CALL(MPI_File, MPI_File_f2c,(MPI_Fint file), (file))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_call_errhandler,(MPI_File fh, int errorcode), (fh, errorcode))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_create_errhandler,(MPI_File_errhandler_function *function, MPI_Errhandler *errhandler),(function, errhandler))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(int, MPI_File_set_errhandler,( MPI_File file, MPI_Errhandler errhandler), (file, errhandler))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(int, MPI_File_get_errhandler,( MPI_File file, MPI_Errhandler *errhandler), (file, errhandler))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_open,(MPI_Comm comm, char *filename, int amode, MPI_Info info, MPI_File *fh),(comm, filename, amode, info, fh))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_close,(MPI_File *fh), (fh))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_delete,(char *filename, MPI_Info info), (filename, info))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_set_size,(MPI_File fh, MPI_Offset size), (fh, size))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_preallocate,(MPI_File fh, MPI_Offset size), (fh, size))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_get_size,(MPI_File fh, MPI_Offset *size), (fh, size))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_get_group,(MPI_File fh, MPI_Group *group), (fh, group))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_get_amode,(MPI_File fh, int *amode), (fh, amode))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_set_info,(MPI_File fh, MPI_Info info), (fh, info))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_get_info,(MPI_File fh, MPI_Info *info_used), (fh, info_used))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_set_view,(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, char *datarep, MPI_Info info), (fh, disp, etype, filetype, datarep, info))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_set_view,(MPI_File fh, MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, const char *datarep, MPI_Info info), (fh, disp, etype, filetype, datarep, info))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_get_view,(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, MPI_Datatype *filetype, char *datarep), (fh, disp, etype, filetype, datarep))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_read_at,(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status), (fh, offset, buf, count, datatype, status))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_read_at_all,(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status), (fh, offset, buf, count, datatype, status))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_write_at,(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status), (fh, offset, buf, count, datatype, status))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_write_at_all,(MPI_File fh, MPI_Offset offset, void *buf,int count, MPI_Datatype datatype, MPI_Status *status), (fh, offset, buf, count, datatype, status))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_iread_at,(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request), (fh, offset, buf, count, datatype, request))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_iwrite_at,(MPI_File fh, MPI_Offset offset, void *buf,int count, MPI_Datatype datatype, MPI_Request *request), (fh, offset, buf, count, datatype, request))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_iwrite_at,(MPI_File fh, MPI_Offset offset, const void *buf,int count, MPI_Datatype datatype, MPI_Request *request), (fh, offset, buf, count, datatype, request))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_iread_at_all,(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request), (fh, offset, buf, count, datatype, request))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_iwrite_at_all,(MPI_File fh, MPI_Offset offset, void *buf,int count, MPI_Datatype datatype, MPI_Request *request), (fh, offset, buf, count, datatype, request))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_read,(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status), (fh, buf, count, datatype, status))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_read_all,(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status), (fh, buf, count, datatype, status))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_write,(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status), (fh, buf, count, datatype, status))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_write_all,(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status), (fh, buf, count, datatype, status))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_iwrite_at_all,(MPI_File fh, MPI_Offset offset, const void *buf,int count, MPI_Datatype datatype, MPI_Request *request), (fh, offset, buf, count, datatype, request))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_iread,(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request), (fh, buf, count, datatype, request))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_iwrite,(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request), (fh, buf, count, datatype, request))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_iwrite,(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request), (fh, buf, count, datatype, request))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_iread_all,(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request), (fh, buf, count, datatype, request))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_iwrite_all,(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request), (fh, buf, count, datatype, request))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_seek,(MPI_File fh, MPI_Offset offset, int whenace), (fh, offset, whenace))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_get_position,(MPI_File fh, MPI_Offset *offset), (fh, offset))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_iwrite_all,(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request), (fh, buf, count, datatype, request))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_get_byte_offset,(MPI_File fh, MPI_Offset offset, MPI_Offset *disp), (fh, offset, disp))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_read_shared,(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status), (fh, buf, count, datatype, status))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_write_shared,(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status), (fh, buf, count, datatype, status))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_iread_shared,(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Request *request), (fh, buf, count, datatype, request))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_iwrite_shared,(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request), (fh, buf, count, datatype, request))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_read_ordered,(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status), (fh, buf, count, datatype, status))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_write_ordered,(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status), (fh, buf, count, datatype, status))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_seek_shared,(MPI_File fh, MPI_Offset offset, int whence), (fh, offset, whence))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_get_position_shared,(MPI_File fh, MPI_Offset *offset), (fh, offset))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_iwrite_shared,(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request), (fh, buf, count, datatype, request))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_read_at_all_begin,(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype), (fh, offset, buf, count, datatype))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_read_at_all_end,(MPI_File fh, void *buf, MPI_Status *status), (fh, buf, status))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_write_at_all_begin,(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype), (fh, offset, buf, count, datatype))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_write_at_all_end,(MPI_File fh, void *buf, MPI_Status *status), (fh, buf, status))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_write_at_all_begin,(MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype), (fh, offset, buf, count, datatype))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_write_at_all_end,(MPI_File fh, const void *buf, MPI_Status *status), (fh, buf, status))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_read_all_begin,(MPI_File fh, void *buf, int count, MPI_Datatype datatype), (fh, buf, count, datatype))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_read_all_end,(MPI_File fh, void *buf, MPI_Status *status), (fh, buf, status))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_write_all_begin,(MPI_File fh, void *buf, int count, MPI_Datatype datatype), (fh, buf, count, datatype))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_write_all_end,(MPI_File fh, void *buf, MPI_Status *status), (fh, buf, status))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_write_all_begin,(MPI_File fh, const void *buf, int count, MPI_Datatype datatype), (fh, buf, count, datatype))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_write_all_end,(MPI_File fh, const void *buf, MPI_Status *status), (fh, buf, status))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_read_ordered_begin,(MPI_File fh, void *buf, int count, MPI_Datatype datatype), (fh, buf, count, datatype))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_read_ordered_end,(MPI_File fh, void *buf, MPI_Status *status), (fh, buf, status))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_write_ordered_begin,(MPI_File fh, void *buf, int count, MPI_Datatype datatype), (fh, buf, count, datatype))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_write_ordered_end,(MPI_File fh, void *buf, MPI_Status *status), (fh, buf, status))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_write_ordered_begin,(MPI_File fh, const void *buf, int count, MPI_Datatype datatype), (fh, buf, count, datatype))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_write_ordered_end,(MPI_File fh, const void *buf, MPI_Status *status), (fh, buf, status))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_get_type_extent,(MPI_File fh, MPI_Datatype datatype, MPI_Aint *extent), (fh, datatype, extent))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_set_atomicity,(MPI_File fh, int flag), (fh, flag))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_get_atomicity,(MPI_File fh, int *flag), (fh, flag))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_sync,(MPI_File fh), (fh))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Get_elements,(MPI_Status* status, MPI_Datatype datatype, int* elements) ,(status, datatype, elements))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Graph_create,(MPI_Comm comm_old, int nnodes, int* index, int* edges, int reorder, MPI_Comm* comm_graph) ,(comm_old, nnodes, index, edges, reorder, comm_graph))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Graph_create,(MPI_Comm comm_old, int nnodes, const int* index, const int* edges, int reorder, MPI_Comm* comm_graph) ,(comm_old, nnodes, index, edges, reorder, comm_graph))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Graphdims_get,(MPI_Comm comm, int* nnodes, int* nedges) ,(comm, nnodes, nedges))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Graph_get,(MPI_Comm comm, int maxindex, int maxedges, int* index, int* edges) ,(comm, maxindex, maxedges, index, edges))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Graph_map,(MPI_Comm comm_old, int nnodes, int* index, int* edges, int* newrank) ,(comm_old, nnodes, index, edges, newrank))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Graph_map,(MPI_Comm comm_old, int nnodes, const int* index, const int* edges, int* newrank) ,(comm_old, nnodes, index, edges, newrank))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Graph_neighbors_count,(MPI_Comm comm, int rank, int* nneighbors) ,(comm, rank, nneighbors))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Graph_neighbors,(MPI_Comm comm, int rank, int maxneighbors, int* neighbors) ,(comm, rank, maxneighbors, neighbors))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Ibsend,(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) ,(buf, count, datatype, dest, tag, comm, request))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Intercomm_create,(MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm, int remote_leader, int tag,MPI_Comm* comm_out) ,(local_comm, local_leader, peer_comm, remote_leader, tag, comm_out))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Intercomm_merge,(MPI_Comm comm, int high, MPI_Comm* comm_out) ,(comm, high, comm_out))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Irsend,(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) ,(buf, count, datatype, dest, tag, comm, request))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Lookup_name,( char *service_name, MPI_Info info, char *port_name),( service_name, info, port_name))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Open_port,( MPI_Info info, char *port_name),( info,port_name))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Pack_external,(char *datarep, void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outcount, MPI_Aint *position),(datarep, inbuf, incount, datatype, outbuf, outcount, position))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Pack_external_size,(char *datarep, int incount, MPI_Datatype datatype, MPI_Aint *size),(datarep, incount, datatype, size))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Pcontrol,(const int level, ... ),(level))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Publish_name,( char *service_name, MPI_Info info, char *port_name),( service_name, info, port_name))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Rsend_init,(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request),(buf, count, datatype, dest, tag, comm, request))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Rsend,(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) ,(buf, count, datatype, dest, tag, comm))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Topo_test,(MPI_Comm comm, int* top_type) ,(comm, top_type))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Type_create_darray,(int size, int rank, int ndims, int* array_of_gsizes, int* array_of_distribs, int* array_of_dargs, int* array_of_psizes,int order, MPI_Datatype oldtype, MPI_Datatype *newtype) ,(size, rank, ndims, array_of_gsizes,array_of_distribs, array_of_dargs, array_of_psizes,order,oldtype, newtype))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Type_get_contents,(MPI_Datatype datatype, int max_integers, int max_addresses, int max_datatypes, int* array_of_integers, MPI_Aint* array_of_addresses, MPI_Datatype *array_of_datatypes),(datatype, max_integers, max_addresses,max_datatypes, array_of_integers, array_of_addresses, array_of_datatypes))
@@ -427,8 +440,9 @@ UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Type_get_envelope,( MPI_Datatype datatyp
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Type_match_size,(int typeclass,int size,MPI_Datatype *datatype),(typeclass,size,datatype))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Unpack_external,(char *datarep, void *inbuf, MPI_Aint insize, MPI_Aint *position, void *outbuf, int outcount, MPI_Datatype datatype),( datarep, inbuf, insize, position, outbuf, outcount, datatype))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Unpublish_name,( char *service_name, MPI_Info info, char *port_name),( service_name, info, port_name))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(int,MPI_Win_set_errhandler,(MPI_Win win, MPI_Errhandler errhandler) ,(win, errhandler))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Win_test,(MPI_Win win, int *flag),(win, flag))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(int,MPI_Win_sync,(MPI_Win win),(win))
-//UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(MPI_Errhandler, MPI_Errhandler_f2c,(MPI_Fint errhandler),(errhandler))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(MPI_Fint, MPI_Errhandler_c2f,(MPI_Errhandler errhandler),(errhandler))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Mprobe,(int source, int tag, MPI_Comm comm, MPI_Message *message, MPI_Status* status) ,(source, tag, comm, message, status))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Mrecv,(void *buf, int count, MPI_Datatype datatype, MPI_Message *message, MPI_Status* status),(buf, count, datatype, message, status))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Improbe,(int source, int tag, MPI_Comm comm, int* flag, MPI_Message *message, MPI_Status* status) ,(source, tag, comm, flag, message, status))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Imrecv,(void *buf, int count, MPI_Datatype datatype, MPI_Message *message, MPI_Request *request),(buf, count, datatype, message, request))
index 6b831d5..7b40665 100644 (file)
@@ -31,25 +31,23 @@ void TRACE_smpi_set_category(const char *category)
 
 /* PMPI User level calls */
 
-int PMPI_Init(int *argc, char ***argv)
+int PMPI_Init(int*, char***)
 {
   xbt_assert(simgrid::s4u::Engine::is_initialized(),
              "Your MPI program was not properly initialized. The easiest is to use smpirun to start it.");
 
-  // Init is called only once per SMPI process
-  if (not smpi_process()->initializing()){
-    simgrid::smpi::ActorExt::init();
-  }
-  if (not smpi_process()->initialized()){
-    int rank_traced = simgrid::s4u::this_actor::get_pid();
-    TRACE_smpi_init(rank_traced);
-    TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::NoOpTIData("init"));
-    TRACE_smpi_comm_out(rank_traced);
-    TRACE_smpi_computing_init(rank_traced);
-    TRACE_smpi_sleeping_init(rank_traced);
-    smpi_bench_begin();
-    smpi_process()->mark_as_initialized();
-  }
+  xbt_assert(not smpi_process()->initializing());
+  xbt_assert(not smpi_process()->initialized());
+
+  simgrid::smpi::ActorExt::init();
+  int rank_traced = simgrid::s4u::this_actor::get_pid();
+  TRACE_smpi_init(rank_traced);
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::NoOpTIData("init"));
+  TRACE_smpi_comm_out(rank_traced);
+  TRACE_smpi_computing_init(rank_traced);
+  TRACE_smpi_sleeping_init(rank_traced);
+  smpi_bench_begin();
+  smpi_process()->mark_as_initialized();
 
   smpi_mpi_init();
 
@@ -65,7 +63,6 @@ int PMPI_Finalize()
   smpi_process()->finalize();
 
   TRACE_smpi_comm_out(rank_traced);
-  TRACE_smpi_finalize(rank_traced);
   return MPI_SUCCESS;
 }
 
@@ -127,7 +124,7 @@ int PMPI_Abort(MPI_Comm /*comm*/, int /*errorcode*/)
   smpi_bench_end();
   // FIXME: should kill all processes in comm instead
   smx_actor_t actor = SIMIX_process_self();
-  simgrid::simix::simcall([actor] { actor->exit(); });
+  simgrid::kernel::actor::simcall([actor] { actor->exit(); });
   return MPI_SUCCESS;
 }
 
@@ -142,7 +139,7 @@ double PMPI_Wtick()
   return sg_maxmin_precision;
 }
 
-int PMPI_Address(void *location, MPI_Aint * address)
+int PMPI_Address(const void* location, MPI_Aint* address)
 {
   if (address==nullptr) {
     return MPI_ERR_ARG;
@@ -152,7 +149,7 @@ int PMPI_Address(void *location, MPI_Aint * address)
   }
 }
 
-int PMPI_Get_address(void *location, MPI_Aint * address)
+int PMPI_Get_address(const void *location, MPI_Aint * address)
 {
   return PMPI_Address(location, address);
 }
@@ -167,7 +164,7 @@ int PMPI_Get_processor_name(char *name, int *resultlen)
   return MPI_SUCCESS;
 }
 
-int PMPI_Get_count(MPI_Status * status, MPI_Datatype datatype, int *count)
+int PMPI_Get_count(const MPI_Status * status, MPI_Datatype datatype, int *count)
 {
   if (status == nullptr || count == nullptr) {
     return MPI_ERR_ARG;
@@ -214,17 +211,16 @@ int PMPI_Error_class(int errorcode, int* errorclass) {
   return MPI_SUCCESS;
 }
 
-int PMPI_Error_string(int errorcode, char* string, int* resultlen){
-  if (errorcode<0 || errorcode>= MPI_MAX_ERROR_STRING || string ==nullptr){
+int PMPI_Error_string(int errorcode, char* string, int* resultlen)
+{
+  static const char* smpi_error_string[] = {FOREACH_ERROR(GENERATE_STRING)};
+  constexpr int nerrors                  = (sizeof smpi_error_string) / (sizeof smpi_error_string[0]);
+  if (errorcode < 0 || errorcode >= nerrors || string == nullptr)
     return MPI_ERR_ARG;
-  } else {
-    static const char *smpi_error_string[] = {
-      FOREACH_ERROR(GENERATE_STRING)
-    };
-    *resultlen = strlen(smpi_error_string[errorcode]);
-    strncpy(string, smpi_error_string[errorcode], *resultlen);
-    return MPI_SUCCESS;  
-  }
+
+  int len    = snprintf(string, MPI_MAX_ERROR_STRING, "%s", smpi_error_string[errorcode]);
+  *resultlen = std::min(len, MPI_MAX_ERROR_STRING - 1);
+  return MPI_SUCCESS;
 }
 
 int PMPI_Keyval_create(MPI_Copy_function* copy_fn, MPI_Delete_function* delete_fn, int* keyval, void* extra_state) {
@@ -236,3 +232,30 @@ int PMPI_Keyval_create(MPI_Copy_function* copy_fn, MPI_Delete_function* delete_f
 int PMPI_Keyval_free(int* keyval) {
   return simgrid::smpi::Keyval::keyval_free<simgrid::smpi::Comm>(keyval);
 }
+
+MPI_Errhandler PMPI_Errhandler_f2c(MPI_Fint errhan){
+  if(errhan==-1)
+    return MPI_ERRHANDLER_NULL;
+  return static_cast<MPI_Errhandler>(simgrid::smpi::Errhandler::f2c(errhan));
+}
+
+MPI_Fint PMPI_Errhandler_c2f(MPI_Errhandler errhan){
+  if(errhan==MPI_ERRHANDLER_NULL)
+    return -1;
+  return errhan->c2f();
+}
+
+int PMPI_Buffer_attach(void *buf, int size){
+  if(buf==nullptr)
+    return MPI_ERR_BUFFER;
+  if(size<0)
+    return MPI_ERR_ARG;
+  smpi_process()->set_bsend_buffer(buf, size);
+  return MPI_SUCCESS;
+}
+
+int PMPI_Buffer_detach(void* buffer, int* size){
+  smpi_process()->bsend_buffer((void**)buffer, size);
+  smpi_process()->set_bsend_buffer(nullptr, 0);
+  return MPI_SUCCESS;
+}
index 66df954..7f6f627 100644 (file)
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
 
-/* PMPI User level calls */
+#define CHECK_ARGS(test, errcode, ...)                                                                                 \
+  if (test) {                                                                                                          \
+    XBT_WARN(__VA_ARGS__);                                                                                             \
+    return (errcode);                                                                                                  \
+  }
 
-int PMPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
-{
-  return PMPI_Ibcast(buf, count, datatype, root, comm, MPI_REQUEST_IGNORED);
-}
+/* PMPI User level calls */
 
 int PMPI_Barrier(MPI_Comm comm)
 {
@@ -27,891 +28,923 @@ int PMPI_Barrier(MPI_Comm comm)
 
 int PMPI_Ibarrier(MPI_Comm comm, MPI_Request *request)
 {
-  int retval = 0;
+  if (comm == MPI_COMM_NULL)
+    return MPI_ERR_COMM;
+  if (request == nullptr)
+    return MPI_ERR_ARG;
+
   smpi_bench_end();
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if(request == nullptr){
-    retval = MPI_ERR_ARG;
-  }else{
-    int rank = simgrid::s4u::this_actor::get_pid();
-    TRACE_smpi_comm_in(rank, request==MPI_REQUEST_IGNORED? "PMPI_Barrier" : "PMPI_Ibarrier", new simgrid::instr::NoOpTIData(request==MPI_REQUEST_IGNORED? "barrier" : "ibarrier"));
-    if(request==MPI_REQUEST_IGNORED){
-      simgrid::smpi::Colls::barrier(comm);
-      //Barrier can be used to synchronize RMA calls. Finish all requests from comm before.
-      comm->finish_rma_calls();
-    } else
-      simgrid::smpi::Colls::ibarrier(comm, request);
-    TRACE_smpi_comm_out(rank);
-  }    
+  int rank = simgrid::s4u::this_actor::get_pid();
+  TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Barrier" : "PMPI_Ibarrier",
+                     new simgrid::instr::NoOpTIData(request == MPI_REQUEST_IGNORED ? "barrier" : "ibarrier"));
+  if (request == MPI_REQUEST_IGNORED) {
+    simgrid::smpi::Colls::barrier(comm);
+    // Barrier can be used to synchronize RMA calls. Finish all requests from comm before.
+    comm->finish_rma_calls();
+  } else
+    simgrid::smpi::Colls::ibarrier(comm, request);
+
+  TRACE_smpi_comm_out(rank);
   smpi_bench_begin();
-  return retval;
+  return MPI_SUCCESS;
+}
+
+int PMPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
+{
+  return PMPI_Ibcast(buf, count, datatype, root, comm, MPI_REQUEST_IGNORED);
 }
 
 int PMPI_Ibcast(void *buf, int count, MPI_Datatype datatype, 
                    int root, MPI_Comm comm, MPI_Request* request)
 {
-  int retval = 0;
+  if (comm == MPI_COMM_NULL)
+    return MPI_ERR_COMM;
+  if (buf == nullptr && count > 0)
+    return MPI_ERR_BUFFER;
+  if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid())
+    return MPI_ERR_TYPE;
+  if (count < 0)
+    return MPI_ERR_COUNT;
+  if (root < 0 || root >= comm->size())
+    return MPI_ERR_ROOT;
+  if (request == nullptr)
+    return MPI_ERR_ARG;
+
   smpi_bench_end();
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if (not datatype->is_valid()) {
-    retval = MPI_ERR_ARG;
-  } else if(request == nullptr){
-    retval = MPI_ERR_ARG;
+  int rank = simgrid::s4u::this_actor::get_pid();
+  TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Bcast" : "PMPI_Ibcast",
+                     new simgrid::instr::CollTIData(request == MPI_REQUEST_IGNORED ? "bcast" : "ibcast", root, -1.0,
+                                                    datatype->is_replayable() ? count : count * datatype->size(), -1,
+                                                    simgrid::smpi::Datatype::encode(datatype), ""));
+  if (comm->size() > 1) {
+    if (request == MPI_REQUEST_IGNORED)
+      simgrid::smpi::Colls::bcast(buf, count, datatype, root, comm);
+    else
+      simgrid::smpi::Colls::ibcast(buf, count, datatype, root, comm, request);
   } else {
-    int rank = simgrid::s4u::this_actor::get_pid();
-    TRACE_smpi_comm_in(rank, request==MPI_REQUEST_IGNORED?"PMPI_Bcast":"PMPI_Ibcast",
-                       new simgrid::instr::CollTIData(request==MPI_REQUEST_IGNORED?"bcast":"ibcast", root, -1.0,
-                                                      datatype->is_replayable() ? count : count * datatype->size(), -1,
-                                                      simgrid::smpi::Datatype::encode(datatype), ""));
-    if (comm->size() > 1){
-      if(request==MPI_REQUEST_IGNORED)
-        simgrid::smpi::Colls::bcast(buf, count, datatype, root, comm);
-      else
-        simgrid::smpi::Colls::ibcast(buf, count, datatype, root, comm, request);
-    } else {
-      if(request!=MPI_REQUEST_IGNORED)
-        *request = MPI_REQUEST_NULL;
-    }
-    retval = MPI_SUCCESS;
-
-    TRACE_smpi_comm_out(rank);
+    if (request != MPI_REQUEST_IGNORED)
+      *request = MPI_REQUEST_NULL;
   }
+
+  TRACE_smpi_comm_out(rank);
   smpi_bench_begin();
-  return retval;
+  return MPI_SUCCESS;
 }
 
-int PMPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount, MPI_Datatype recvtype,
+int PMPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount, MPI_Datatype recvtype,
                 int root, MPI_Comm comm){
   return PMPI_Igather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, MPI_REQUEST_IGNORED);
 }
 
-int PMPI_Igather(void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount, MPI_Datatype recvtype,
-                int root, MPI_Comm comm, MPI_Request *request)
+int PMPI_Igather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+                 MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request)
 {
-  int retval = 0;
+  if (comm == MPI_COMM_NULL)
+    return MPI_ERR_COMM;
+  if ((sendbuf == nullptr && sendcount > 0) || ((comm->rank() == root) && recvbuf == nullptr && recvcount > 0))
+    return MPI_ERR_BUFFER;
+  if (((sendbuf != MPI_IN_PLACE && sendcount > 0) && (sendtype == MPI_DATATYPE_NULL)) ||
+      ((comm->rank() == root) && (recvtype == MPI_DATATYPE_NULL)))
+    return MPI_ERR_TYPE;
+  if (((sendbuf != MPI_IN_PLACE) && (sendcount < 0)) || ((comm->rank() == root) && (recvcount < 0)))
+    return MPI_ERR_COUNT;
+  if (root < 0 || root >= comm->size())
+    return MPI_ERR_ROOT;
+  if (request == nullptr)
+    return MPI_ERR_ARG;
 
   smpi_bench_end();
-
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if ((( sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL)) ||
-            ((comm->rank() == root) && (recvtype == MPI_DATATYPE_NULL))){
-    retval = MPI_ERR_TYPE;
-  } else if ((( sendbuf != MPI_IN_PLACE) && (sendcount <0)) || ((comm->rank() == root) && (recvcount <0))){
-    retval = MPI_ERR_COUNT;
-  } else if (request == nullptr){
-    retval = MPI_ERR_ARG;
-  }  else {
-
-    char* sendtmpbuf = static_cast<char*>(sendbuf);
-    int sendtmpcount = sendcount;
-    MPI_Datatype sendtmptype = sendtype;
-    if( (comm->rank() == root) && (sendbuf == MPI_IN_PLACE )) {
-      sendtmpcount=0;
-      sendtmptype=recvtype;
-    }
-    int rank = simgrid::s4u::this_actor::get_pid();
-
-    TRACE_smpi_comm_in(
-        rank, request==MPI_REQUEST_IGNORED?"PMPI_Gather":"PMPI_Igather",
-        new simgrid::instr::CollTIData(
-            request==MPI_REQUEST_IGNORED ? "gather":"igather", root, -1.0, sendtmptype->is_replayable() ? sendtmpcount : sendtmpcount * sendtmptype->size(),
-            (comm->rank() != root || recvtype->is_replayable()) ? recvcount : recvcount * recvtype->size(),
-            simgrid::smpi::Datatype::encode(sendtmptype), simgrid::smpi::Datatype::encode(recvtype)));
-    if(request == MPI_REQUEST_IGNORED)
-      simgrid::smpi::Colls::gather(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcount, recvtype, root, comm);
-    else
-      simgrid::smpi::Colls::igather(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcount, recvtype, root, comm, request);
-
-    retval = MPI_SUCCESS;
-    TRACE_smpi_comm_out(rank);
+  const void* real_sendbuf   = sendbuf;
+  int real_sendcount         = sendcount;
+  MPI_Datatype real_sendtype = sendtype;
+  if ((comm->rank() == root) && (sendbuf == MPI_IN_PLACE)) {
+    real_sendcount = 0;
+    real_sendtype  = recvtype;
   }
-
+  int rank = simgrid::s4u::this_actor::get_pid();
+
+  TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Gather" : "PMPI_Igather",
+                     new simgrid::instr::CollTIData(
+                         request == MPI_REQUEST_IGNORED ? "gather" : "igather", root, -1.0,
+                         real_sendtype->is_replayable() ? real_sendcount : real_sendcount * real_sendtype->size(),
+                         (comm->rank() != root || recvtype->is_replayable()) ? recvcount : recvcount * recvtype->size(),
+                         simgrid::smpi::Datatype::encode(real_sendtype), simgrid::smpi::Datatype::encode(recvtype)));
+  if (request == MPI_REQUEST_IGNORED)
+    simgrid::smpi::Colls::gather(real_sendbuf, real_sendcount, real_sendtype, recvbuf, recvcount, recvtype, root, comm);
+  else
+    simgrid::smpi::Colls::igather(real_sendbuf, real_sendcount, real_sendtype, recvbuf, recvcount, recvtype, root, comm,
+                                  request);
+
+  TRACE_smpi_comm_out(rank);
   smpi_bench_begin();
-  return retval;
+  return MPI_SUCCESS;
 }
 
-int PMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs,
+int PMPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs,
                 MPI_Datatype recvtype, int root, MPI_Comm comm){
   return PMPI_Igatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, MPI_REQUEST_IGNORED);
 }
 
-int PMPI_Igatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs,
-                MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request)
+int PMPI_Igatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, const int* displs,
+                  MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request)
 {
-  int retval = 0;
+  if (comm == MPI_COMM_NULL)
+    return MPI_ERR_COMM;
+  if ((sendbuf == nullptr && sendcount > 0) || ((comm->rank() == root) && recvbuf == nullptr))
+    return MPI_ERR_BUFFER;
+  if (((sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL)) ||
+      ((comm->rank() == root) && (recvtype == MPI_DATATYPE_NULL)))
+    return MPI_ERR_TYPE;
+  if ((sendbuf != MPI_IN_PLACE) && (sendcount < 0))
+    return MPI_ERR_COUNT;
+  if ((comm->rank() == root) && (recvcounts == nullptr || displs == nullptr))
+    return MPI_ERR_ARG;
+  if (root < 0 || root >= comm->size())
+    return MPI_ERR_ROOT;
+  if (request == nullptr)
+    return MPI_ERR_ARG;
+
+  for (int i = 0; i < comm->size(); i++) {
+    if ((comm->rank() == root) && (recvcounts[i] < 0))
+      return MPI_ERR_COUNT;
+  }
 
   smpi_bench_end();
+  const void* real_sendbuf   = sendbuf;
+  int real_sendcount         = sendcount;
+  MPI_Datatype real_sendtype = sendtype;
+  if ((comm->rank() == root) && (sendbuf == MPI_IN_PLACE)) {
+    real_sendcount = 0;
+    real_sendtype  = recvtype;
+  }
 
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if ((( sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL)) ||
-            ((comm->rank() == root) && (recvtype == MPI_DATATYPE_NULL))){
-    retval = MPI_ERR_TYPE;
-  } else if (( sendbuf != MPI_IN_PLACE) && (sendcount <0)){
-    retval = MPI_ERR_COUNT;
-  } else if ((comm->rank() == root) && (recvcounts == nullptr || displs == nullptr)) {
-    retval = MPI_ERR_ARG;
-  } else if (request == nullptr){
-    retval = MPI_ERR_ARG;
-  }  else {
-    char* sendtmpbuf = static_cast<char*>(sendbuf);
-    int sendtmpcount = sendcount;
-    MPI_Datatype sendtmptype = sendtype;
-    if( (comm->rank() == root) && (sendbuf == MPI_IN_PLACE )) {
-      sendtmpcount=0;
-      sendtmptype=recvtype;
-    }
-
-    int rank         = simgrid::s4u::this_actor::get_pid();
-    int dt_size_recv = recvtype->is_replayable() ? 1 : recvtype->size();
-
-    std::vector<int>* trace_recvcounts = new std::vector<int>;
-    if (comm->rank() == root) {
-      for (int i = 0; i < comm->size(); i++) // copy data to avoid bad free
-        trace_recvcounts->push_back(recvcounts[i] * dt_size_recv);
-    }
+  int rank         = simgrid::s4u::this_actor::get_pid();
+  int dt_size_recv = recvtype->is_replayable() ? 1 : recvtype->size();
 
-    TRACE_smpi_comm_in(rank, request==MPI_REQUEST_IGNORED?"PMPI_Gatherv":"PMPI_Igatherv",
-                       new simgrid::instr::VarCollTIData(
-                           request==MPI_REQUEST_IGNORED ? "gatherv":"igatherv", root,
-                           sendtmptype->is_replayable() ? sendtmpcount : sendtmpcount * sendtmptype->size(), nullptr,
-                           dt_size_recv, trace_recvcounts, simgrid::smpi::Datatype::encode(sendtmptype),
-                           simgrid::smpi::Datatype::encode(recvtype)));
-    if(request == MPI_REQUEST_IGNORED)
-      retval = simgrid::smpi::Colls::gatherv(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcounts, displs, recvtype, root, comm);
-    else
-      retval = simgrid::smpi::Colls::igatherv(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcounts, displs, recvtype, root, comm, request);
-    TRACE_smpi_comm_out(rank);
+  std::vector<int>* trace_recvcounts = new std::vector<int>;
+  if (comm->rank() == root) {
+    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, request == MPI_REQUEST_IGNORED ? "PMPI_Gatherv" : "PMPI_Igatherv",
+                     new simgrid::instr::VarCollTIData(
+                         request == MPI_REQUEST_IGNORED ? "gatherv" : "igatherv", root,
+                         real_sendtype->is_replayable() ? real_sendcount : real_sendcount * real_sendtype->size(),
+                         nullptr, dt_size_recv, trace_recvcounts, simgrid::smpi::Datatype::encode(real_sendtype),
+                         simgrid::smpi::Datatype::encode(recvtype)));
+  if (request == MPI_REQUEST_IGNORED)
+    simgrid::smpi::Colls::gatherv(real_sendbuf, real_sendcount, real_sendtype, recvbuf, recvcounts, displs, recvtype,
+                                  root, comm);
+  else
+    simgrid::smpi::Colls::igatherv(real_sendbuf, real_sendcount, real_sendtype, recvbuf, recvcounts, displs, recvtype,
+                                   root, comm, request);
+
+  TRACE_smpi_comm_out(rank);
   smpi_bench_begin();
-  return retval;
+  return MPI_SUCCESS;
 }
 
-int PMPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
+int PMPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                    void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm){
   return PMPI_Iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, MPI_REQUEST_IGNORED);
 }
-              
-int PMPI_Iallgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
-                   void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request)
+
+int PMPI_Iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+                    MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request)
 {
-  int retval = MPI_SUCCESS;
+  CHECK_ARGS(comm == MPI_COMM_NULL, MPI_ERR_COMM, "Iallgather: the communicator cannot be MPI_COMM_NULL");
+  CHECK_ARGS(recvbuf == nullptr && recvcount > 0, MPI_ERR_BUFFER, "Iallgather: param 4 recvbuf cannot be NULL");
+  CHECK_ARGS(sendbuf == nullptr && sendcount > 0, MPI_ERR_BUFFER,
+             "Iallgather: param 1 sendbuf cannot be NULL when sendcound > 0");
+  CHECK_ARGS((sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL), MPI_ERR_TYPE,
+             "Iallgather: param 3 sendtype cannot be MPI_DATATYPE_NULL when sendbuff is not MPI_IN_PLACE");
+  CHECK_ARGS(recvtype == MPI_DATATYPE_NULL, MPI_ERR_TYPE, "Iallgather: param 6 recvtype cannot be MPI_DATATYPE_NULL");
+  CHECK_ARGS(recvcount < 0, MPI_ERR_COUNT, "Iallgather: param 5 recvcount cannot be negative");
+  CHECK_ARGS((sendbuf != MPI_IN_PLACE) && (sendcount < 0), MPI_ERR_COUNT,
+             "Iallgather: param 2 sendcount cannot be negative when sendbuf is not MPI_IN_PLACE");
+  CHECK_ARGS(request == nullptr, MPI_ERR_ARG, "Iallgather: param 8 request cannot be NULL");
 
   smpi_bench_end();
-
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if ((( sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL)) ||
-            (recvtype == MPI_DATATYPE_NULL)){
-    retval = MPI_ERR_TYPE;
-  } else if ((( sendbuf != MPI_IN_PLACE) && (sendcount <0)) ||
-            (recvcount <0)){
-    retval = MPI_ERR_COUNT;
-  } else if (request == nullptr){
-    retval = MPI_ERR_ARG;
-  }  else {
-    if(sendbuf == MPI_IN_PLACE) {
-      sendbuf=static_cast<char*>(recvbuf)+recvtype->get_extent()*recvcount*comm->rank();
-      sendcount=recvcount;
-      sendtype=recvtype;
-    }
-    int rank = simgrid::s4u::this_actor::get_pid();
-
-    TRACE_smpi_comm_in(rank, request==MPI_REQUEST_IGNORED?"PMPI_Allgather":"PMPI_Iallggather",
-                       new simgrid::instr::CollTIData(
-                           request==MPI_REQUEST_IGNORED ? "allgather" : "iallgather", -1, -1.0, sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(),
-                           recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
-                           simgrid::smpi::Datatype::encode(sendtype), simgrid::smpi::Datatype::encode(recvtype)));
-    if(request == MPI_REQUEST_IGNORED)
-      simgrid::smpi::Colls::allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
-    else
-      simgrid::smpi::Colls::iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request);
-    TRACE_smpi_comm_out(rank);
+  if (sendbuf == MPI_IN_PLACE) {
+    sendbuf   = static_cast<char*>(recvbuf) + recvtype->get_extent() * recvcount * comm->rank();
+    sendcount = recvcount;
+    sendtype  = recvtype;
   }
+  int rank = simgrid::s4u::this_actor::get_pid();
+
+  TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Allgather" : "PMPI_Iallggather",
+                     new simgrid::instr::CollTIData(
+                         request == MPI_REQUEST_IGNORED ? "allgather" : "iallgather", -1, -1.0,
+                         sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(),
+                         recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
+                         simgrid::smpi::Datatype::encode(sendtype), simgrid::smpi::Datatype::encode(recvtype)));
+  if (request == MPI_REQUEST_IGNORED)
+    simgrid::smpi::Colls::allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
+  else
+    simgrid::smpi::Colls::iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request);
+
+  TRACE_smpi_comm_out(rank);
   smpi_bench_begin();
-  return retval;
+  return MPI_SUCCESS;
 }
 
-int PMPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
-                   void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm){
+int PMPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
+                   void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, MPI_Comm comm){
   return PMPI_Iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, MPI_REQUEST_IGNORED);
 }
 
-int PMPI_Iallgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
-                   void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request)
+int PMPI_Iallgatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, const int* displs,
+                     MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request)
 {
-  int retval = 0;
+  if (comm == MPI_COMM_NULL)
+    return MPI_ERR_COMM;
+  if (sendbuf == nullptr && sendcount > 0)
+    return MPI_ERR_BUFFER;
+  if (((sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL)) || (recvtype == MPI_DATATYPE_NULL))
+    return MPI_ERR_TYPE;
+  if ((sendbuf != MPI_IN_PLACE) && (sendcount < 0))
+    return MPI_ERR_COUNT;
+  if (recvcounts == nullptr || displs == nullptr)
+    return MPI_ERR_ARG;
+  if (request == nullptr)
+    return MPI_ERR_ARG;
+
+  for (int i = 0; i < comm->size(); i++) {
+    if (recvcounts[i] < 0)
+      return MPI_ERR_COUNT;
+    else if (recvcounts[i] > 0 && recvbuf == nullptr)
+      return MPI_ERR_BUFFER;
+  }
 
   smpi_bench_end();
+  if (sendbuf == MPI_IN_PLACE) {
+    sendbuf   = static_cast<char*>(recvbuf) + recvtype->get_extent() * displs[comm->rank()];
+    sendcount = recvcounts[comm->rank()];
+    sendtype  = recvtype;
+  }
+  int rank         = simgrid::s4u::this_actor::get_pid();
+  int dt_size_recv = recvtype->is_replayable() ? 1 : recvtype->size();
 
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if (((sendbuf != MPI_IN_PLACE) && (sendtype == MPI_DATATYPE_NULL)) || (recvtype == MPI_DATATYPE_NULL)) {
-    retval = MPI_ERR_TYPE;
-  } else if (( sendbuf != MPI_IN_PLACE) && (sendcount <0)){
-    retval = MPI_ERR_COUNT;
-  } else if (recvcounts == nullptr || displs == nullptr) {
-    retval = MPI_ERR_ARG;
-  } else if (request == nullptr){
-    retval = MPI_ERR_ARG;
-  }  else {
-
-    if(sendbuf == MPI_IN_PLACE) {
-      sendbuf=static_cast<char*>(recvbuf)+recvtype->get_extent()*displs[comm->rank()];
-      sendcount=recvcounts[comm->rank()];
-      sendtype=recvtype;
-    }
-    int rank               = simgrid::s4u::this_actor::get_pid();
-    int dt_size_recv       = recvtype->is_replayable() ? 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, request==MPI_REQUEST_IGNORED?"PMPI_Allgatherv":"PMPI_Iallgatherv",
-                       new simgrid::instr::VarCollTIData(
-                           request==MPI_REQUEST_IGNORED ? "allgatherv" : "iallgatherv", -1, sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(),
-                           nullptr, dt_size_recv, trace_recvcounts, simgrid::smpi::Datatype::encode(sendtype),
-                           simgrid::smpi::Datatype::encode(recvtype)));
-    if(request == MPI_REQUEST_IGNORED)
-      simgrid::smpi::Colls::allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm);
-    else
-      simgrid::smpi::Colls::iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, request);
-    retval = MPI_SUCCESS;
-    TRACE_smpi_comm_out(rank);
+  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, request == MPI_REQUEST_IGNORED ? "PMPI_Allgatherv" : "PMPI_Iallgatherv",
+      new simgrid::instr::VarCollTIData(request == MPI_REQUEST_IGNORED ? "allgatherv" : "iallgatherv", -1,
+                                        sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(), nullptr,
+                                        dt_size_recv, trace_recvcounts, simgrid::smpi::Datatype::encode(sendtype),
+                                        simgrid::smpi::Datatype::encode(recvtype)));
+  if (request == MPI_REQUEST_IGNORED)
+    simgrid::smpi::Colls::allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm);
+  else
+    simgrid::smpi::Colls::iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm,
+                                      request);
+
+  TRACE_smpi_comm_out(rank);
   smpi_bench_begin();
-  return retval;
+  return MPI_SUCCESS;
 }
 
-int PMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
+int PMPI_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                 void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm){
   return PMPI_Iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, MPI_REQUEST_IGNORED);
 }
 
-int PMPI_Iscatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
-                void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request)
+int PMPI_Iscatter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+                  MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request)
 {
-  int retval = 0;
+  if (comm == MPI_COMM_NULL)
+    return MPI_ERR_COMM;
+  if (((comm->rank() == root) && (sendtype == MPI_DATATYPE_NULL || not sendtype->is_valid())) ||
+      ((recvbuf != MPI_IN_PLACE) && (recvtype == MPI_DATATYPE_NULL || not recvtype->is_valid())))
+    return MPI_ERR_TYPE;
+  if (((comm->rank() == root) && (sendcount < 0)) || ((recvbuf != MPI_IN_PLACE) && (recvcount < 0)))
+    return MPI_ERR_COUNT;
+  if ((sendbuf == recvbuf) || ((comm->rank() == root) && sendcount > 0 && (sendbuf == nullptr)) ||
+      (recvcount > 0 && recvbuf == nullptr))
+    return MPI_ERR_BUFFER;
+  if (root < 0 || root >= comm->size())
+    return MPI_ERR_ROOT;
+  if (request == nullptr)
+    return MPI_ERR_ARG;
 
   smpi_bench_end();
-
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if (((comm->rank() == root) && (not sendtype->is_valid())) ||
-             ((recvbuf != MPI_IN_PLACE) && (not recvtype->is_valid()))) {
-    retval = MPI_ERR_TYPE;
-  } else if ((sendbuf == recvbuf) ||
-      ((comm->rank()==root) && sendcount>0 && (sendbuf == nullptr))){
-    retval = MPI_ERR_BUFFER;
-  }else if (request == nullptr){
-    retval = MPI_ERR_ARG;
-  } else {
-
-    if (recvbuf == MPI_IN_PLACE) {
-      recvtype  = sendtype;
-      recvcount = sendcount;
-    }
-    int rank = simgrid::s4u::this_actor::get_pid();
-
-    TRACE_smpi_comm_in(
-        rank, request==MPI_REQUEST_IGNORED?"PMPI_Scatter":"PMPI_Iscatter",
-        new simgrid::instr::CollTIData(
-            request==MPI_REQUEST_IGNORED ? "scatter" : "iscatter", root, -1.0,
-            (comm->rank() != root || sendtype->is_replayable()) ? sendcount : sendcount * sendtype->size(),
-            recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
-            simgrid::smpi::Datatype::encode(sendtype), simgrid::smpi::Datatype::encode(recvtype)));
-    if(request == MPI_REQUEST_IGNORED)
-      simgrid::smpi::Colls::scatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm);
-    else
-      simgrid::smpi::Colls::iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request);
-    retval = MPI_SUCCESS;
-    TRACE_smpi_comm_out(rank);
+  if (recvbuf == MPI_IN_PLACE) {
+    recvtype  = sendtype;
+    recvcount = sendcount;
   }
-
+  int rank = simgrid::s4u::this_actor::get_pid();
+
+  TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Scatter" : "PMPI_Iscatter",
+                     new simgrid::instr::CollTIData(
+                         request == MPI_REQUEST_IGNORED ? "scatter" : "iscatter", root, -1.0,
+                         (comm->rank() != root || sendtype->is_replayable()) ? sendcount : sendcount * sendtype->size(),
+                         recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
+                         simgrid::smpi::Datatype::encode(sendtype), simgrid::smpi::Datatype::encode(recvtype)));
+  if (request == MPI_REQUEST_IGNORED)
+    simgrid::smpi::Colls::scatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm);
+  else
+    simgrid::smpi::Colls::iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request);
+
+  TRACE_smpi_comm_out(rank);
   smpi_bench_begin();
-  return retval;
+  return MPI_SUCCESS;
 }
 
-int PMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs,
+int PMPI_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
                  MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm){
   return PMPI_Iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, MPI_REQUEST_IGNORED);
 }
 
-int PMPI_Iscatterv(void *sendbuf, int *sendcounts, int *displs,
-                 MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request)
+int PMPI_Iscatterv(const void* sendbuf, const int* sendcounts, const int* displs, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+                   MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request)
 {
-  int retval = 0;
-
-  smpi_bench_end();
-
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if (sendcounts == nullptr || displs == nullptr) {
-    retval = MPI_ERR_ARG;
-  } else if (((comm->rank() == root) && (sendtype == MPI_DATATYPE_NULL)) ||
-             ((recvbuf != MPI_IN_PLACE) && (recvtype == MPI_DATATYPE_NULL))) {
-    retval = MPI_ERR_TYPE;
-  } else if (request == nullptr){
-    retval = MPI_ERR_ARG;
-  } else {
+  CHECK_ARGS(comm == MPI_COMM_NULL, MPI_ERR_COMM, "Iscatterv: the communicator cannot be MPI_COMM_NULL");
+  CHECK_ARGS((comm->rank() == root) && (sendcounts == nullptr), MPI_ERR_ARG,
+             "Iscatterv: param 2 sendcounts cannot be NULL on the root rank");
+  CHECK_ARGS((comm->rank() == root) && (displs == nullptr), MPI_ERR_ARG,
+             "Iscatterv: param 3 displs cannot be NULL on the root rank");
+  CHECK_ARGS((comm->rank() == root) && (sendtype == MPI_DATATYPE_NULL), MPI_ERR_TYPE,
+             "Iscatterv: The sendtype cannot be NULL on the root rank");
+  CHECK_ARGS((recvbuf != MPI_IN_PLACE) && (recvtype == MPI_DATATYPE_NULL), MPI_ERR_TYPE,
+             "Iscatterv: the recvtype cannot be NULL when not receiving in place");
+  CHECK_ARGS(request == nullptr, MPI_ERR_ARG, "Iscatterv: param 10 request cannot be NULL");
+  CHECK_ARGS(recvbuf != MPI_IN_PLACE && recvcount < 0, MPI_ERR_COUNT,
+             "Iscatterv: When not receiving in place, the recvcound cannot be negative");
+  CHECK_ARGS(root < 0, MPI_ERR_ROOT, "Iscatterv: root cannot be negative");
+  CHECK_ARGS(root >= comm->size(), MPI_ERR_ROOT, "Iscatterv: root (=%d) is larger than communicator size (=%d)", root,
+             comm->size());
+
+  if (comm->rank() == root) {
     if (recvbuf == MPI_IN_PLACE) {
       recvtype  = sendtype;
       recvcount = sendcounts[comm->rank()];
     }
-    int rank               = simgrid::s4u::this_actor::get_pid();
-    int dt_size_send       = sendtype->is_replayable() ? 1 : sendtype->size();
+    for (int i = 0; i < comm->size(); i++)
+      CHECK_ARGS(sendcounts[i] < 0, MPI_ERR_COUNT, "Iscatterv: sendcounts[%d]=%d but this cannot be negative", i,
+                 sendcounts[i]);
+  }
 
-    std::vector<int>* trace_sendcounts = new std::vector<int>;
-    if (comm->rank() == root) {
-      for (int i = 0; i < comm->size(); i++) // copy data to avoid bad free
-        trace_sendcounts->push_back(sendcounts[i] * dt_size_send);
-    }
+  smpi_bench_end();
 
-    TRACE_smpi_comm_in(rank, request==MPI_REQUEST_IGNORED?"PMPI_Scatterv":"PMPI_Iscatterv",
-                       new simgrid::instr::VarCollTIData(
-                           request==MPI_REQUEST_IGNORED ? "scatterv":"iscatterv", root, dt_size_send, trace_sendcounts,
-                           recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(), nullptr,
-                           simgrid::smpi::Datatype::encode(sendtype), simgrid::smpi::Datatype::encode(recvtype)));
-    if(request == MPI_REQUEST_IGNORED)
-      retval = simgrid::smpi::Colls::scatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm);
-    else
-     retval = simgrid::smpi::Colls::iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request);
+  int rank         = simgrid::s4u::this_actor::get_pid();
+  int dt_size_send = sendtype->is_replayable() ? 1 : sendtype->size();
 
-    TRACE_smpi_comm_out(rank);
+  std::vector<int>* trace_sendcounts = new std::vector<int>;
+  if (comm->rank() == root) {
+    for (int i = 0; i < comm->size(); i++) { // copy data to avoid bad free
+      trace_sendcounts->push_back(sendcounts[i] * dt_size_send);
+    }
   }
 
+  TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Scatterv" : "PMPI_Iscatterv",
+                     new simgrid::instr::VarCollTIData(
+                         request == MPI_REQUEST_IGNORED ? "scatterv" : "iscatterv", root, dt_size_send,
+                         trace_sendcounts, recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
+                         nullptr, simgrid::smpi::Datatype::encode(sendtype),
+                         simgrid::smpi::Datatype::encode(recvtype)));
+  if (request == MPI_REQUEST_IGNORED)
+    simgrid::smpi::Colls::scatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm);
+  else
+    simgrid::smpi::Colls::iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm,
+                                    request);
+
+  TRACE_smpi_comm_out(rank);
   smpi_bench_begin();
-  return retval;
+  return MPI_SUCCESS;
 }
 
-int PMPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
+int PMPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
 {
   return PMPI_Ireduce(sendbuf, recvbuf, count, datatype, op, root, comm, MPI_REQUEST_IGNORED);
 }
 
-int PMPI_Ireduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request* request)
+int PMPI_Ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request* request)
 {
-  int retval = 0;
+  if (comm == MPI_COMM_NULL)
+    return MPI_ERR_COMM;
+  if ((sendbuf == nullptr && count > 0) || ((comm->rank() == root) && recvbuf == nullptr))
+    return MPI_ERR_BUFFER;
+  if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid())
+    return MPI_ERR_TYPE;
+  if (op == MPI_OP_NULL)
+    return MPI_ERR_OP;
+  if (request == nullptr)
+    return MPI_ERR_ARG;
+  if (root < 0 || root >= comm->size())
+    return MPI_ERR_ROOT;
+  if (count < 0)
+    return MPI_ERR_COUNT;
 
   smpi_bench_end();
-
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if (not datatype->is_valid() || op == MPI_OP_NULL) {
-    retval = MPI_ERR_ARG;
-  } else if (request == nullptr){
-    retval = MPI_ERR_ARG;
-  } else {
-    int rank = simgrid::s4u::this_actor::get_pid();
-
-    TRACE_smpi_comm_in(rank, request==MPI_REQUEST_IGNORED ? "PMPI_Reduce":"PMPI_Ireduce",
-                       new simgrid::instr::CollTIData(request==MPI_REQUEST_IGNORED ? "reduce":"ireduce", root, 0,
-                                                      datatype->is_replayable() ? count : count * datatype->size(), -1,
-                                                      simgrid::smpi::Datatype::encode(datatype), ""));
-    if(request == MPI_REQUEST_IGNORED)
-      simgrid::smpi::Colls::reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
-    else
-      simgrid::smpi::Colls::ireduce(sendbuf, recvbuf, count, datatype, op, root, comm, request);
-
-
-    retval = MPI_SUCCESS;
-    TRACE_smpi_comm_out(rank);
-  }
-
+  int rank = simgrid::s4u::this_actor::get_pid();
+
+  TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Reduce" : "PMPI_Ireduce",
+                     new simgrid::instr::CollTIData(request == MPI_REQUEST_IGNORED ? "reduce" : "ireduce", root, 0,
+                                                    datatype->is_replayable() ? count : count * datatype->size(), -1,
+                                                    simgrid::smpi::Datatype::encode(datatype), ""));
+  if (request == MPI_REQUEST_IGNORED)
+    simgrid::smpi::Colls::reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
+  else
+    simgrid::smpi::Colls::ireduce(sendbuf, recvbuf, count, datatype, op, root, comm, request);
+
+  TRACE_smpi_comm_out(rank);
   smpi_bench_begin();
-  return retval;
+  return MPI_SUCCESS;
 }
 
-int PMPI_Reduce_local(void *inbuf, void *inoutbuf, int count, MPI_Datatype datatype, MPI_Op op){
-  int retval = 0;
+int PMPI_Reduce_local(const void* inbuf, void* inoutbuf, int count, MPI_Datatype datatype, MPI_Op op)
+{
+  if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid())
+    return MPI_ERR_TYPE;
+  if (op == MPI_OP_NULL)
+    return MPI_ERR_OP;
+  if (count < 0)
+    return MPI_ERR_COUNT;
 
   smpi_bench_end();
-  if (not datatype->is_valid() || op == MPI_OP_NULL) {
-    retval = MPI_ERR_ARG;
-  } else {
-    op->apply(inbuf, inoutbuf, &count, datatype);
-    retval = MPI_SUCCESS;
-  }
+  op->apply(inbuf, inoutbuf, &count, datatype);
   smpi_bench_begin();
-  return retval;
+  return MPI_SUCCESS;
 }
 
-int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+int PMPI_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
   return PMPI_Iallreduce(sendbuf, recvbuf, count, datatype, op, comm, MPI_REQUEST_IGNORED);
 }
 
-int PMPI_Iallreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request)
+int PMPI_Iallreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request)
 {
-  int retval = 0;
+  if (comm == MPI_COMM_NULL)
+    return MPI_ERR_COMM;
+  if ((sendbuf == nullptr && count > 0) || (recvbuf == nullptr))
+    return MPI_ERR_BUFFER;
+  if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid())
+    return MPI_ERR_TYPE;
+  if (count < 0)
+    return MPI_ERR_COUNT;
+  if (op == MPI_OP_NULL)
+    return MPI_ERR_OP;
+  if (request == nullptr)
+    return MPI_ERR_ARG;
 
   smpi_bench_end();
+  const void* real_sendbuf = sendbuf;
+  std::unique_ptr<unsigned char[]> tmp_sendbuf;
+  if (sendbuf == MPI_IN_PLACE) {
+    tmp_sendbuf.reset(new unsigned char[count * datatype->get_extent()]);
+    simgrid::smpi::Datatype::copy(recvbuf, count, datatype, tmp_sendbuf.get(), count, datatype);
+    real_sendbuf = tmp_sendbuf.get();
+  }
+  int rank = simgrid::s4u::this_actor::get_pid();
 
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if (not datatype->is_valid()) {
-    retval = MPI_ERR_TYPE;
-  } else if (op == MPI_OP_NULL) {
-    retval = MPI_ERR_OP;
-  } else if (request == nullptr){
-    retval = MPI_ERR_ARG;
-  } else {
-    char* sendtmpbuf = static_cast<char*>(sendbuf);
-    if( sendbuf == MPI_IN_PLACE ) {
-      sendtmpbuf = static_cast<char*>(xbt_malloc(count*datatype->get_extent()));
-      simgrid::smpi::Datatype::copy(recvbuf, count, datatype,sendtmpbuf, count, datatype);
-    }
-    int rank = simgrid::s4u::this_actor::get_pid();
-
-    TRACE_smpi_comm_in(rank, request==MPI_REQUEST_IGNORED ?"PMPI_Allreduce":"PMPI_Iallreduce",
-                       new simgrid::instr::CollTIData(request==MPI_REQUEST_IGNORED ? "allreduce":"iallreduce", -1, 0,
-                                                      datatype->is_replayable() ? count : count * datatype->size(), -1,
-                                                      simgrid::smpi::Datatype::encode(datatype), ""));
-
-    if(request == MPI_REQUEST_IGNORED)
-      simgrid::smpi::Colls::allreduce(sendtmpbuf, recvbuf, count, datatype, op, comm);
-    else
-      simgrid::smpi::Colls::iallreduce(sendtmpbuf, recvbuf, count, datatype, op, comm, request);
-
-    if( sendbuf == MPI_IN_PLACE )
-      xbt_free(sendtmpbuf);
+  TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Allreduce" : "PMPI_Iallreduce",
+                     new simgrid::instr::CollTIData(request == MPI_REQUEST_IGNORED ? "allreduce" : "iallreduce", -1, 0,
+                                                    datatype->is_replayable() ? count : count * datatype->size(), -1,
+                                                    simgrid::smpi::Datatype::encode(datatype), ""));
 
-    retval = MPI_SUCCESS;
-    TRACE_smpi_comm_out(rank);
-  }
+  if (request == MPI_REQUEST_IGNORED)
+    simgrid::smpi::Colls::allreduce(real_sendbuf, recvbuf, count, datatype, op, comm);
+  else
+    simgrid::smpi::Colls::iallreduce(real_sendbuf, recvbuf, count, datatype, op, comm, request);
 
+  TRACE_smpi_comm_out(rank);
   smpi_bench_begin();
-  return retval;
+  return MPI_SUCCESS;
 }
 
-int PMPI_Scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+int PMPI_Scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
   return PMPI_Iscan(sendbuf, recvbuf, count, datatype, op, comm, MPI_REQUEST_IGNORED);
 }
 
-int PMPI_Iscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request)
+int PMPI_Iscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request)
 {
-  int retval = 0;
+  if (comm == MPI_COMM_NULL)
+    return MPI_ERR_COMM;
+  if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid())
+    return MPI_ERR_TYPE;
+  if (op == MPI_OP_NULL)
+    return MPI_ERR_OP;
+  if (request == nullptr)
+    return MPI_ERR_ARG;
+  if (count < 0)
+    return MPI_ERR_COUNT;
+  if (sendbuf == nullptr || recvbuf == nullptr)
+    return MPI_ERR_BUFFER;
 
   smpi_bench_end();
-
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if (not datatype->is_valid()) {
-    retval = MPI_ERR_TYPE;
-  } else if (op == MPI_OP_NULL) {
-    retval = MPI_ERR_OP;
-  } else if (request == nullptr){
-    retval = MPI_ERR_ARG;
-  } else {
-    int rank = simgrid::s4u::this_actor::get_pid();
-    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_comm_in(rank, request==MPI_REQUEST_IGNORED ? "PMPI_Scan" : "PMPI_Iscan", new simgrid::instr::Pt2PtTIData(
-                                           request==MPI_REQUEST_IGNORED ? "scan":"iscan", -1, 
-                                           datatype->is_replayable() ? count : count * datatype->size(),
-                                           simgrid::smpi::Datatype::encode(datatype)));
-
-    if(request == MPI_REQUEST_IGNORED)
-      retval = simgrid::smpi::Colls::scan(sendtmpbuf, recvbuf, count, datatype, op, comm);
-    else
-      retval = simgrid::smpi::Colls::iscan(sendtmpbuf, recvbuf, count, datatype, op, comm, request);
-
-    TRACE_smpi_comm_out(rank);
-    if (sendbuf == MPI_IN_PLACE)
-      xbt_free(sendtmpbuf);
+  int rank         = simgrid::s4u::this_actor::get_pid();
+  const void* real_sendbuf = sendbuf;
+  std::unique_ptr<unsigned char[]> tmp_sendbuf;
+  if (sendbuf == MPI_IN_PLACE) {
+    tmp_sendbuf.reset(new unsigned char[count * datatype->size()]);
+    real_sendbuf = memcpy(tmp_sendbuf.get(), recvbuf, count * datatype->size());
   }
+  TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Scan" : "PMPI_Iscan",
+                     new simgrid::instr::Pt2PtTIData(request == MPI_REQUEST_IGNORED ? "scan" : "iscan", -1,
+                                                     datatype->is_replayable() ? count : count * datatype->size(),
+                                                     simgrid::smpi::Datatype::encode(datatype)));
 
+  int retval;
+  if (request == MPI_REQUEST_IGNORED)
+    retval = simgrid::smpi::Colls::scan(real_sendbuf, recvbuf, count, datatype, op, comm);
+  else
+    retval = simgrid::smpi::Colls::iscan(real_sendbuf, recvbuf, count, datatype, op, comm, request);
+
+  TRACE_smpi_comm_out(rank);
   smpi_bench_begin();
   return retval;
 }
 
-int PMPI_Exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+int PMPI_Exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
   return PMPI_Iexscan(sendbuf, recvbuf, count, datatype, op, comm, MPI_REQUEST_IGNORED);
 }
 
-int PMPI_Iexscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request){
-  int retval = 0;
+int PMPI_Iexscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request){
+  if (comm == MPI_COMM_NULL)
+    return MPI_ERR_COMM;
+  if (not datatype->is_valid())
+    return MPI_ERR_TYPE;
+  if (op == MPI_OP_NULL)
+    return MPI_ERR_OP;
+  if (request == nullptr)
+    return MPI_ERR_ARG;
+  if (count < 0)
+    return MPI_ERR_COUNT;
+  if (sendbuf == nullptr || recvbuf == nullptr)
+    return MPI_ERR_BUFFER;
 
   smpi_bench_end();
+  int rank         = simgrid::s4u::this_actor::get_pid();
+  const void* real_sendbuf = sendbuf;
+  std::unique_ptr<unsigned char[]> tmp_sendbuf;
+  if (sendbuf == MPI_IN_PLACE) {
+    tmp_sendbuf.reset(new unsigned char[count * datatype->size()]);
+    real_sendbuf = memcpy(tmp_sendbuf.get(), recvbuf, count * datatype->size());
+  }
 
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if (not datatype->is_valid()) {
-    retval = MPI_ERR_TYPE;
-  } else if (op == MPI_OP_NULL) {
-    retval = MPI_ERR_OP;
-  } else if (request == nullptr){
-    retval = MPI_ERR_ARG;
-  } else {
-    int rank         = simgrid::s4u::this_actor::get_pid();
-    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_comm_in(rank, request==MPI_REQUEST_IGNORED ? "PMPI_Exscan" : "PMPI_Iexscan", new simgrid::instr::Pt2PtTIData(
-                                           request==MPI_REQUEST_IGNORED ? "exscan":"iexscan", -1, datatype->is_replayable() ? count : count * datatype->size(),
-                                           simgrid::smpi::Datatype::encode(datatype)));
-
-    if(request == MPI_REQUEST_IGNORED)
-      retval = simgrid::smpi::Colls::exscan(sendtmpbuf, recvbuf, count, datatype, op, comm);
-    else
-      retval = simgrid::smpi::Colls::iexscan(sendtmpbuf, recvbuf, count, datatype, op, comm, request);
+  TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Exscan" : "PMPI_Iexscan",
+                     new simgrid::instr::Pt2PtTIData(request == MPI_REQUEST_IGNORED ? "exscan" : "iexscan", -1,
+                                                     datatype->is_replayable() ? count : count * datatype->size(),
+                                                     simgrid::smpi::Datatype::encode(datatype)));
 
-    TRACE_smpi_comm_out(rank);
-    if (sendbuf == MPI_IN_PLACE)
-      xbt_free(sendtmpbuf);
-  }
+  int retval;
+  if (request == MPI_REQUEST_IGNORED)
+    retval = simgrid::smpi::Colls::exscan(real_sendbuf, recvbuf, count, datatype, op, comm);
+  else
+    retval = simgrid::smpi::Colls::iexscan(real_sendbuf, recvbuf, count, datatype, op, comm, request);
 
+  TRACE_smpi_comm_out(rank);
   smpi_bench_begin();
   return retval;
 }
 
-int PMPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+int PMPI_Reduce_scatter(const void *sendbuf, void *recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
   return PMPI_Ireduce_scatter(sendbuf, recvbuf, recvcounts, datatype, op, comm, MPI_REQUEST_IGNORED);
 }
 
-int PMPI_Ireduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request)
+int PMPI_Ireduce_scatter(const void *sendbuf, void *recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request)
 {
-  int retval = 0;
-  smpi_bench_end();
-
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if (not datatype->is_valid()) {
-    retval = MPI_ERR_TYPE;
-  } else if (op == MPI_OP_NULL) {
-    retval = MPI_ERR_OP;
-  } else if (recvcounts == nullptr) {
-    retval = MPI_ERR_ARG;
-  }  else if (request == nullptr){
-    retval = MPI_ERR_ARG;
-  } else {
-    int rank                           = simgrid::s4u::this_actor::get_pid();
-    std::vector<int>* trace_recvcounts = new std::vector<int>;
-    int dt_send_size                   = datatype->is_replayable() ? 1 : datatype->size();
-    int totalcount    = 0;
-
-    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());
-    }
+  if (comm == MPI_COMM_NULL)
+    return MPI_ERR_COMM;
+  if ((sendbuf == nullptr) || (recvbuf == nullptr))
+    return MPI_ERR_BUFFER;
+  if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid())
+    return MPI_ERR_TYPE;
+  if (op == MPI_OP_NULL)
+    return MPI_ERR_OP;
+  if (recvcounts == nullptr)
+    return MPI_ERR_ARG;
+  if (request == nullptr)
+    return MPI_ERR_ARG;
+
+  for (int i = 0; i < comm->size(); i++) { // copy data to avoid bad free
+    if (recvcounts[i] < 0)
+      return MPI_ERR_COUNT;
+  }
 
-    TRACE_smpi_comm_in(rank, request==MPI_REQUEST_IGNORED ? "PMPI_Reduce_scatter": "PMPI_Ireduce_scatter", new simgrid::instr::VarCollTIData(
-                                           request==MPI_REQUEST_IGNORED ? "reducescatter":"ireducescatter", -1, dt_send_size, nullptr, -1, trace_recvcounts,
-                                           simgrid::smpi::Datatype::encode(datatype), ""));
+  smpi_bench_end();
+  int rank                           = simgrid::s4u::this_actor::get_pid();
+  std::vector<int>* trace_recvcounts = new std::vector<int>;
+  int dt_send_size                   = datatype->is_replayable() ? 1 : datatype->size();
+  int totalcount                     = 0;
+
+  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];
+  }
 
-    if(request == MPI_REQUEST_IGNORED)
-      simgrid::smpi::Colls::reduce_scatter(sendtmpbuf, recvbuf, recvcounts, datatype, op, comm);
-    else
-      simgrid::smpi::Colls::ireduce_scatter(sendtmpbuf, recvbuf, recvcounts, datatype, op, comm, request);
+  const void* real_sendbuf = sendbuf;
+  std::unique_ptr<unsigned char[]> tmp_sendbuf;
+  if (sendbuf == MPI_IN_PLACE) {
+    tmp_sendbuf.reset(new unsigned char[totalcount * datatype->size()]);
+    real_sendbuf = memcpy(tmp_sendbuf.get(), recvbuf, totalcount * datatype->size());
+  }
 
-    retval = MPI_SUCCESS;
-    TRACE_smpi_comm_out(rank);
+  TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Reduce_scatter" : "PMPI_Ireduce_scatter",
+                     new simgrid::instr::VarCollTIData(
+                         request == MPI_REQUEST_IGNORED ? "reducescatter" : "ireducescatter", -1, dt_send_size, nullptr,
+                         -1, trace_recvcounts, simgrid::smpi::Datatype::encode(datatype), ""));
 
-    if (sendbuf == MPI_IN_PLACE)
-      xbt_free(sendtmpbuf);
-  }
+  if (request == MPI_REQUEST_IGNORED)
+    simgrid::smpi::Colls::reduce_scatter(real_sendbuf, recvbuf, recvcounts, datatype, op, comm);
+  else
+    simgrid::smpi::Colls::ireduce_scatter(real_sendbuf, recvbuf, recvcounts, datatype, op, comm, request);
 
+  TRACE_smpi_comm_out(rank);
   smpi_bench_begin();
-  return retval;
+  return MPI_SUCCESS;
 }
 
-int PMPI_Reduce_scatter_block(void *sendbuf, void *recvbuf, int recvcount,
+int PMPI_Reduce_scatter_block(const void *sendbuf, void *recvbuf, int recvcount,
                               MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
   return PMPI_Ireduce_scatter_block(sendbuf, recvbuf, recvcount, datatype, op, comm, MPI_REQUEST_IGNORED);
 }
 
-int PMPI_Ireduce_scatter_block(void *sendbuf, void *recvbuf, int recvcount,
-                              MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request)
+int PMPI_Ireduce_scatter_block(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op,
+                               MPI_Comm comm, MPI_Request* request)
 {
-  int retval;
-  smpi_bench_end();
-
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if (not datatype->is_valid()) {
-    retval = MPI_ERR_TYPE;
-  } else if (op == MPI_OP_NULL) {
-    retval = MPI_ERR_OP;
-  } else if (recvcount < 0) {
-    retval = MPI_ERR_ARG;
-  } else if (request == nullptr){
-    retval = MPI_ERR_ARG;
-  }  else {
-    int count = comm->size();
-
-    int rank                           = simgrid::s4u::this_actor::get_pid();
-    int dt_send_size                   = datatype->is_replayable() ? 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());
-    }
+  if (comm == MPI_COMM_NULL)
+    return MPI_ERR_COMM;
+  if (not datatype->is_valid())
+    return MPI_ERR_TYPE;
+  if (op == MPI_OP_NULL)
+    return MPI_ERR_OP;
+  if (recvcount < 0)
+    return MPI_ERR_ARG;
+  if (request == nullptr)
+    return MPI_ERR_ARG;
 
-    TRACE_smpi_comm_in(rank, request==MPI_REQUEST_IGNORED ? "PMPI_Reduce_scatter_block":"PMPI_Ireduce_scatter_block",
-                       new simgrid::instr::VarCollTIData(request==MPI_REQUEST_IGNORED ? "reducescatter":"ireducescatter", -1, 0, nullptr, -1, trace_recvcounts,
-                                                         simgrid::smpi::Datatype::encode(datatype), ""));
-
-    int* recvcounts = new int[count];
-    for (int i      = 0; i < count; i++)
-      recvcounts[i] = recvcount;
-    if(request == MPI_REQUEST_IGNORED)
-      simgrid::smpi::Colls::reduce_scatter(sendtmpbuf, recvbuf, recvcounts, datatype, op, comm);
-    else
-      simgrid::smpi::Colls::ireduce_scatter(sendtmpbuf, recvbuf, recvcounts, datatype, op, comm, request);
-    delete[] recvcounts;
-    retval = MPI_SUCCESS;
+  smpi_bench_end();
+  int count = comm->size();
 
-    TRACE_smpi_comm_out(rank);
+  int rank                           = simgrid::s4u::this_actor::get_pid();
+  int dt_send_size                   = datatype->is_replayable() ? 1 : datatype->size();
+  std::vector<int>* trace_recvcounts = new std::vector<int>(recvcount * dt_send_size); // copy data to avoid bad free
 
-    if (sendbuf == MPI_IN_PLACE)
-      xbt_free(sendtmpbuf);
+  const void* real_sendbuf = sendbuf;
+  std::unique_ptr<unsigned char[]> tmp_sendbuf;
+  if (sendbuf == MPI_IN_PLACE) {
+    tmp_sendbuf.reset(new unsigned char[recvcount * count * datatype->size()]);
+    real_sendbuf = memcpy(tmp_sendbuf.get(), recvbuf, recvcount * count * datatype->size());
   }
 
+  TRACE_smpi_comm_in(
+      rank, request == MPI_REQUEST_IGNORED ? "PMPI_Reduce_scatter_block" : "PMPI_Ireduce_scatter_block",
+      new simgrid::instr::VarCollTIData(request == MPI_REQUEST_IGNORED ? "reducescatter" : "ireducescatter", -1, 0,
+                                        nullptr, -1, trace_recvcounts, simgrid::smpi::Datatype::encode(datatype), ""));
+
+  int* recvcounts = new int[count];
+  for (int i      = 0; i < count; i++)
+    recvcounts[i] = recvcount;
+  if (request == MPI_REQUEST_IGNORED)
+    simgrid::smpi::Colls::reduce_scatter(real_sendbuf, recvbuf, recvcounts, datatype, op, comm);
+  else
+    simgrid::smpi::Colls::ireduce_scatter(real_sendbuf, recvbuf, recvcounts, datatype, op, comm, request);
+  delete[] recvcounts;
+
+  TRACE_smpi_comm_out(rank);
   smpi_bench_begin();
-  return retval;
+  return MPI_SUCCESS;
 }
-int PMPI_Alltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+
+int PMPI_Alltoall(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
                   MPI_Datatype recvtype, MPI_Comm comm){
   return PMPI_Ialltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, MPI_REQUEST_IGNORED);
 }
-                  
-int PMPI_Ialltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
-                  MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request)
-{
-  int retval = 0;
-  smpi_bench_end();
 
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if ((sendbuf != MPI_IN_PLACE && sendtype == MPI_DATATYPE_NULL) || recvtype == MPI_DATATYPE_NULL) {
-    retval = MPI_ERR_TYPE;
-  } else if (request == nullptr){
-    retval = MPI_ERR_ARG;
-  } else {
-    int rank                 = simgrid::s4u::this_actor::get_pid();
-    void* sendtmpbuf         = static_cast<char*>(sendbuf);
-    int sendtmpcount         = sendcount;
-    MPI_Datatype sendtmptype = sendtype;
-    if (sendbuf == MPI_IN_PLACE) {
-      sendtmpbuf = static_cast<void*>(xbt_malloc(recvcount * comm->size() * recvtype->size()));
-      memcpy(sendtmpbuf, recvbuf, recvcount * comm->size() * recvtype->size());
-      sendtmpcount = recvcount;
-      sendtmptype  = recvtype;
-    }
-
-    TRACE_smpi_comm_in(rank, request==MPI_REQUEST_IGNORED?"PMPI_Alltoall":"PMPI_Ialltoall",
-                       new simgrid::instr::CollTIData(
-                           request==MPI_REQUEST_IGNORED ? "alltoall" : "ialltoall", -1, -1.0,
-                           sendtmptype->is_replayable() ? sendtmpcount : sendtmpcount * sendtmptype->size(),
-                           recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
-                           simgrid::smpi::Datatype::encode(sendtmptype), simgrid::smpi::Datatype::encode(recvtype)));
-    if(request == MPI_REQUEST_IGNORED)
-      retval = simgrid::smpi::Colls::alltoall(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcount, recvtype, comm);
-    else
-      retval = simgrid::smpi::Colls::ialltoall(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcount, recvtype, comm, request);
-
-    TRACE_smpi_comm_out(rank);
+int PMPI_Ialltoall(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+                   MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request)
+{
+  if (comm == MPI_COMM_NULL)
+    return MPI_ERR_COMM;
+  if ((sendbuf == nullptr && sendcount > 0) || (recvbuf == nullptr && recvcount > 0))
+    return MPI_ERR_BUFFER;
+  if ((sendbuf != MPI_IN_PLACE && sendtype == MPI_DATATYPE_NULL) || recvtype == MPI_DATATYPE_NULL)
+    return MPI_ERR_TYPE;
+  if ((sendbuf != MPI_IN_PLACE && sendcount < 0) || recvcount < 0)
+    return MPI_ERR_COUNT;
+  if (request == nullptr)
+    return MPI_ERR_ARG;
 
-    if (sendbuf == MPI_IN_PLACE)
-      xbt_free(sendtmpbuf);
+  smpi_bench_end();
+  int rank                 = simgrid::s4u::this_actor::get_pid();
+  const void* real_sendbuf = sendbuf;
+  int real_sendcount         = sendcount;
+  MPI_Datatype real_sendtype = sendtype;
+  std::unique_ptr<unsigned char[]> tmp_sendbuf;
+  if (sendbuf == MPI_IN_PLACE) {
+    tmp_sendbuf.reset(new unsigned char[recvcount * comm->size() * recvtype->size()]);
+    // memcpy(??,nullptr,0) is actually undefined behavor, even if harmless.
+    if (recvbuf != nullptr)
+      memcpy(tmp_sendbuf.get(), recvbuf, recvcount * comm->size() * recvtype->size());
+    real_sendbuf = tmp_sendbuf.get();
+    real_sendcount = recvcount;
+    real_sendtype  = recvtype;
   }
 
+  TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Alltoall" : "PMPI_Ialltoall",
+                     new simgrid::instr::CollTIData(
+                         request == MPI_REQUEST_IGNORED ? "alltoall" : "ialltoall", -1, -1.0,
+                         real_sendtype->is_replayable() ? real_sendcount : real_sendcount * real_sendtype->size(),
+                         recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
+                         simgrid::smpi::Datatype::encode(real_sendtype), simgrid::smpi::Datatype::encode(recvtype)));
+  int retval;
+  if (request == MPI_REQUEST_IGNORED)
+    retval =
+        simgrid::smpi::Colls::alltoall(real_sendbuf, real_sendcount, real_sendtype, recvbuf, recvcount, recvtype, comm);
+  else
+    retval = simgrid::smpi::Colls::ialltoall(real_sendbuf, real_sendcount, real_sendtype, recvbuf, recvcount, recvtype,
+                                             comm, request);
+
+  TRACE_smpi_comm_out(rank);
   smpi_bench_begin();
   return retval;
 }
 
-int PMPI_Alltoallv(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype sendtype, void* recvbuf,
-                   int* recvcounts, int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm)
+int PMPI_Alltoallv(const void* sendbuf, const int* sendcounts, const int* senddisps, MPI_Datatype sendtype, void* recvbuf,
+                   const int* recvcounts, const int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm)
 {
   return PMPI_Ialltoallv(sendbuf, sendcounts, senddisps, sendtype, recvbuf, recvcounts, recvdisps, recvtype, comm, MPI_REQUEST_IGNORED);
 }
 
-int PMPI_Ialltoallv(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype sendtype, void* recvbuf,
-                   int* recvcounts, int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request)
+int PMPI_Ialltoallv(const void* sendbuf, const int* sendcounts, const int* senddisps, MPI_Datatype sendtype, void* recvbuf,
+                    const int* recvcounts, const int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request)
 {
-  int retval = 0;
+  if (comm == MPI_COMM_NULL)
+    return MPI_ERR_COMM;
+  if (sendbuf == nullptr || recvbuf == nullptr)
+    return MPI_ERR_BUFFER;
+  if ((sendbuf != MPI_IN_PLACE && sendtype == MPI_DATATYPE_NULL) || recvtype == MPI_DATATYPE_NULL)
+    return MPI_ERR_TYPE;
+  if ((sendbuf != MPI_IN_PLACE && (sendcounts == nullptr || senddisps == nullptr)) || recvcounts == nullptr ||
+      recvdisps == nullptr)
+    return MPI_ERR_ARG;
+  if (request == nullptr)
+    return MPI_ERR_ARG;
+
+  int rank = simgrid::s4u::this_actor::get_pid();
+  int size = comm->size();
+  for (int i = 0; i < size; i++) {
+    if (recvcounts[i] < 0 || (sendbuf != MPI_IN_PLACE && sendcounts[i] < 0))
+      return MPI_ERR_COUNT;
+  }
 
   smpi_bench_end();
+  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();
+
+  const void* real_sendbuf   = sendbuf;
+  const int* real_sendcounts = sendcounts;
+  const int* real_senddisps  = senddisps;
+  MPI_Datatype real_sendtype = sendtype;
+  int maxsize              = 0;
+  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;
+  }
 
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if ((sendbuf != MPI_IN_PLACE && sendtype == MPI_DATATYPE_NULL)  || recvtype == MPI_DATATYPE_NULL) {
-    retval = MPI_ERR_TYPE;
-  } else if ((sendbuf != MPI_IN_PLACE && (sendcounts == nullptr || senddisps == nullptr)) || recvcounts == nullptr ||
-             recvdisps == nullptr) {
-    retval = MPI_ERR_ARG;
-  } else if (request == nullptr){
-    retval = MPI_ERR_ARG;
-  }  else {
-    int rank                           = simgrid::s4u::this_actor::get_pid();
-    int size               = comm->size();
-    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);
-    int* sendtmpcounts       = sendcounts;
-    int* sendtmpdisps        = senddisps;
-    MPI_Datatype sendtmptype = sendtype;
-    int maxsize              = 0;
-    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;
-    }
-
-    if (sendbuf == MPI_IN_PLACE) {
-      sendtmpbuf = static_cast<void*>(xbt_malloc(maxsize));
-      memcpy(sendtmpbuf, recvbuf, maxsize);
-      sendtmpcounts = static_cast<int*>(xbt_malloc(size * sizeof(int)));
-      memcpy(sendtmpcounts, recvcounts, size * sizeof(int));
-      sendtmpdisps = static_cast<int*>(xbt_malloc(size * sizeof(int)));
-      memcpy(sendtmpdisps, recvdisps, size * sizeof(int));
-      sendtmptype = recvtype;
-    }
-
-    int dt_size_send = sendtmptype->size();
-
-    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);
-    }
+  std::unique_ptr<unsigned char[]> tmp_sendbuf;
+  std::unique_ptr<int[]> tmp_sendcounts;
+  std::unique_ptr<int[]> tmp_senddisps;
+  if (sendbuf == MPI_IN_PLACE) {
+    tmp_sendbuf.reset(new unsigned char[maxsize]);
+    real_sendbuf = memcpy(tmp_sendbuf.get(), recvbuf, maxsize);
+    tmp_sendcounts.reset(new int[size]);
+    std::copy(recvcounts, recvcounts + size, tmp_sendcounts.get());
+    real_sendcounts = tmp_sendcounts.get();
+    tmp_senddisps.reset(new int[size]);
+    std::copy(recvdisps, recvdisps + size, tmp_senddisps.get());
+    real_senddisps = tmp_senddisps.get();
+    real_sendtype  = recvtype;
+  }
 
-    TRACE_smpi_comm_in(rank, request==MPI_REQUEST_IGNORED?"PMPI_Alltoallv":"PMPI_Ialltoallv",
-                       new simgrid::instr::VarCollTIData(request==MPI_REQUEST_IGNORED ? "alltoallv":"ialltoallv", -1, send_size, trace_sendcounts, recv_size,
-                                                         trace_recvcounts, simgrid::smpi::Datatype::encode(sendtype),
-                                                         simgrid::smpi::Datatype::encode(recvtype)));
+  int dt_size_send = real_sendtype->size();
 
-    if(request == MPI_REQUEST_IGNORED)
-      retval = simgrid::smpi::Colls::alltoallv(sendtmpbuf, sendtmpcounts, sendtmpdisps, sendtmptype, recvbuf, recvcounts,
-                                    recvdisps, recvtype, comm);
-    else
-      retval = simgrid::smpi::Colls::ialltoallv(sendtmpbuf, sendtmpcounts, sendtmpdisps, sendtmptype, recvbuf, recvcounts,
-                                    recvdisps, recvtype, comm, request);
-    TRACE_smpi_comm_out(rank);
-
-    if (sendbuf == MPI_IN_PLACE) {
-      xbt_free(sendtmpbuf);
-      xbt_free(sendtmpcounts);
-      xbt_free(sendtmpdisps);
-    }
+  for (int i = 0; i < size; i++) { // copy data to avoid bad free
+    send_size += real_sendcounts[i] * dt_size_send;
+    trace_sendcounts->push_back(real_sendcounts[i] * dt_size_send);
   }
 
+  TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Alltoallv" : "PMPI_Ialltoallv",
+                     new simgrid::instr::VarCollTIData(request == MPI_REQUEST_IGNORED ? "alltoallv" : "ialltoallv", -1,
+                                                       send_size, trace_sendcounts, recv_size, trace_recvcounts,
+                                                       simgrid::smpi::Datatype::encode(real_sendtype),
+                                                       simgrid::smpi::Datatype::encode(recvtype)));
+
+  int retval;
+  if (request == MPI_REQUEST_IGNORED)
+    retval = simgrid::smpi::Colls::alltoallv(real_sendbuf, real_sendcounts, real_senddisps, real_sendtype, recvbuf,
+                                             recvcounts, recvdisps, recvtype, comm);
+  else
+    retval = simgrid::smpi::Colls::ialltoallv(real_sendbuf, real_sendcounts, real_senddisps, real_sendtype, recvbuf,
+                                              recvcounts, recvdisps, recvtype, comm, request);
+
+  TRACE_smpi_comm_out(rank);
   smpi_bench_begin();
   return retval;
 }
 
-int PMPI_Alltoallw(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype* sendtypes, void* recvbuf,
-                   int* recvcounts, int* recvdisps, MPI_Datatype* recvtypes, MPI_Comm comm)
+int PMPI_Alltoallw(const void* sendbuf, const int* sendcounts, const int* senddisps, const MPI_Datatype* sendtypes, void* recvbuf,
+                   const int* recvcounts, const int* recvdisps, const MPI_Datatype* recvtypes, MPI_Comm comm)
 {
   return PMPI_Ialltoallw(sendbuf, sendcounts, senddisps, sendtypes, recvbuf, recvcounts, recvdisps, recvtypes, comm, MPI_REQUEST_IGNORED);
 }
 
-int PMPI_Ialltoallw(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype* sendtypes, void* recvbuf,
-                   int* recvcounts, int* recvdisps, MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request *request)
+int PMPI_Ialltoallw(const void* sendbuf, const int* sendcounts, const int* senddisps, const MPI_Datatype* sendtypes, void* recvbuf,
+                    const int* recvcounts, const int* recvdisps, const MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request* request)
 {
-  int retval = 0;
+  if (comm == MPI_COMM_NULL)
+    return MPI_ERR_COMM;
+  if (sendbuf == nullptr || recvbuf == nullptr)
+    return MPI_ERR_BUFFER;
+  if ((sendbuf != MPI_IN_PLACE && sendtypes == nullptr) || recvtypes == nullptr)
+    return MPI_ERR_TYPE;
+  if ((sendbuf != MPI_IN_PLACE && (sendcounts == nullptr || senddisps == nullptr)) || recvcounts == nullptr ||
+      recvdisps == nullptr)
+    return MPI_ERR_ARG;
+  if (request == nullptr)
+    return MPI_ERR_ARG;
 
   smpi_bench_end();
-
-  if (comm == MPI_COMM_NULL) {
-    retval = MPI_ERR_COMM;
-  } else if ((sendbuf != MPI_IN_PLACE && sendtypes == nullptr)  || recvtypes == nullptr) {
-    retval = MPI_ERR_TYPE;
-  } else if ((sendbuf != MPI_IN_PLACE && (sendcounts == nullptr || senddisps == nullptr)) || recvcounts == nullptr ||
-             recvdisps == nullptr) {
-    retval = MPI_ERR_ARG;
-  } else if (request == nullptr){
-    retval = MPI_ERR_ARG;
-  }  else {
-    int rank                           = simgrid::s4u::this_actor::get_pid();
-    int size                           = comm->size();
-    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>;
-
-    void* sendtmpbuf           = static_cast<char*>(sendbuf);
-    int* sendtmpcounts         = sendcounts;
-    int* sendtmpdisps          = senddisps;
-    MPI_Datatype* sendtmptypes = sendtypes;
-    unsigned long maxsize                = 0;
-    for (int i = 0; i < size; i++) { // copy data to avoid bad free
-      if(recvtypes[i]==MPI_DATATYPE_NULL){
-        delete trace_recvcounts;
-        delete trace_sendcounts;
-        return MPI_ERR_TYPE;
-      }
-      recv_size += recvcounts[i] * recvtypes[i]->size();
-      trace_recvcounts->push_back(recvcounts[i] * recvtypes[i]->size());
-      if ((recvdisps[i] + (recvcounts[i] * recvtypes[i]->size())) > maxsize)
-        maxsize = recvdisps[i] + (recvcounts[i] * recvtypes[i]->size());
-    }
-
-    if (sendbuf == MPI_IN_PLACE) {
-      sendtmpbuf = static_cast<void*>(xbt_malloc(maxsize));
-      memcpy(sendtmpbuf, recvbuf, maxsize);
-      sendtmpcounts = static_cast<int*>(xbt_malloc(size * sizeof(int)));
-      memcpy(sendtmpcounts, recvcounts, size * sizeof(int));
-      sendtmpdisps = static_cast<int*>(xbt_malloc(size * sizeof(int)));
-      memcpy(sendtmpdisps, recvdisps, size * sizeof(int));
-      sendtmptypes = static_cast<MPI_Datatype*>(xbt_malloc(size * sizeof(MPI_Datatype)));
-      memcpy(sendtmptypes, recvtypes, size * sizeof(MPI_Datatype));
-    }
-
-    for (int i = 0; i < size; i++) { // copy data to avoid bad free
-      send_size += sendtmpcounts[i] * sendtmptypes[i]->size();
-      trace_sendcounts->push_back(sendtmpcounts[i] * sendtmptypes[i]->size());
+  int rank = simgrid::s4u::this_actor::get_pid();
+  int size = comm->size();
+  for (int i = 0; i < size; i++) {
+    if (recvcounts[i] < 0 || (sendbuf != MPI_IN_PLACE && sendcounts[i] < 0))
+      return MPI_ERR_COUNT;
+  }
+  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>;
+
+  const void* real_sendbuf           = sendbuf;
+  const int* real_sendcounts         = sendcounts;
+  const int* real_senddisps          = senddisps;
+  const MPI_Datatype* real_sendtypes = sendtypes;
+  unsigned long maxsize      = 0;
+  for (int i = 0; i < size; i++) { // copy data to avoid bad free
+    if (recvtypes[i] == MPI_DATATYPE_NULL) {
+      delete trace_recvcounts;
+      delete trace_sendcounts;
+      return MPI_ERR_TYPE;
     }
+    recv_size += recvcounts[i] * recvtypes[i]->size();
+    trace_recvcounts->push_back(recvcounts[i] * recvtypes[i]->size());
+    if ((recvdisps[i] + (recvcounts[i] * recvtypes[i]->size())) > maxsize)
+      maxsize = recvdisps[i] + (recvcounts[i] * recvtypes[i]->size());
+  }
 
-    TRACE_smpi_comm_in(rank, request==MPI_REQUEST_IGNORED?"PMPI_Alltoallw":"PMPI_Ialltoallw",
-                       new simgrid::instr::VarCollTIData(request==MPI_REQUEST_IGNORED ? "alltoallv":"ialltoallv", -1, send_size, trace_sendcounts, recv_size,
-                                                         trace_recvcounts, simgrid::smpi::Datatype::encode(sendtmptypes[0]),
-                                                         simgrid::smpi::Datatype::encode(recvtypes[0])));
+  std::unique_ptr<unsigned char[]> tmp_sendbuf;
+  std::unique_ptr<int[]> tmp_sendcounts;
+  std::unique_ptr<int[]> tmp_senddisps;
+  std::unique_ptr<MPI_Datatype[]> tmp_sendtypes;
+  if (sendbuf == MPI_IN_PLACE) {
+    tmp_sendbuf.reset(new unsigned char[maxsize]);
+    real_sendbuf = memcpy(tmp_sendbuf.get(), recvbuf, maxsize);
+    tmp_sendcounts.reset(new int[size]);
+    std::copy(recvcounts, recvcounts + size, tmp_sendcounts.get());
+    real_sendcounts = tmp_sendcounts.get();
+    tmp_senddisps.reset(new int[size]);
+    std::copy(recvdisps, recvdisps + size, tmp_senddisps.get());
+    real_senddisps = tmp_senddisps.get();
+    tmp_sendtypes.reset(new MPI_Datatype[size]);
+    std::copy(recvtypes, recvtypes + size, tmp_sendtypes.get());
+    real_sendtypes = tmp_sendtypes.get();
+  }
 
-    if(request == MPI_REQUEST_IGNORED)
-      retval = simgrid::smpi::Colls::alltoallw(sendtmpbuf, sendtmpcounts, sendtmpdisps, sendtmptypes, recvbuf, recvcounts,
-                                    recvdisps, recvtypes, comm);
-    else
-      retval = simgrid::smpi::Colls::ialltoallw(sendtmpbuf, sendtmpcounts, sendtmpdisps, sendtmptypes, recvbuf, recvcounts,
-                                    recvdisps, recvtypes, comm, request);
-    TRACE_smpi_comm_out(rank);
-
-    if (sendbuf == MPI_IN_PLACE) {
-      xbt_free(sendtmpbuf);
-      xbt_free(sendtmpcounts);
-      xbt_free(sendtmpdisps);
-      xbt_free(sendtmptypes);
-    }
+  for (int i = 0; i < size; i++) { // copy data to avoid bad free
+    send_size += real_sendcounts[i] * real_sendtypes[i]->size();
+    trace_sendcounts->push_back(real_sendcounts[i] * real_sendtypes[i]->size());
   }
 
+  TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Alltoallw" : "PMPI_Ialltoallw",
+                     new simgrid::instr::VarCollTIData(request == MPI_REQUEST_IGNORED ? "alltoallv" : "ialltoallv", -1,
+                                                       send_size, trace_sendcounts, recv_size, trace_recvcounts,
+                                                       simgrid::smpi::Datatype::encode(real_sendtypes[0]),
+                                                       simgrid::smpi::Datatype::encode(recvtypes[0])));
+
+  int retval;
+  if (request == MPI_REQUEST_IGNORED)
+    retval = simgrid::smpi::Colls::alltoallw(real_sendbuf, real_sendcounts, real_senddisps, real_sendtypes, recvbuf,
+                                             recvcounts, recvdisps, recvtypes, comm);
+  else
+    retval = simgrid::smpi::Colls::ialltoallw(real_sendbuf, real_sendcounts, real_senddisps, real_sendtypes, recvbuf,
+                                              recvcounts, recvdisps, recvtypes, comm, request);
+
+  TRACE_smpi_comm_out(rank);
   smpi_bench_begin();
   return retval;
 }
index 8916ec9..19d511a 100644 (file)
@@ -7,6 +7,8 @@
 
 #include "private.hpp"
 #include "smpi_comm.hpp"
+#include "smpi_info.hpp"
+#include "smpi_errhandler.hpp"
 #include "src/smpi/include/smpi_actor.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
@@ -49,6 +51,18 @@ int PMPI_Comm_get_name (MPI_Comm comm, char* name, int* len)
   }
 }
 
+int PMPI_Comm_set_name (MPI_Comm comm, const char* name)
+{
+  if (comm == MPI_COMM_NULL)  {
+    return MPI_ERR_COMM;
+  } else if (name == nullptr)  {
+    return MPI_ERR_ARG;
+  } else {
+    comm->set_name(name);
+    return MPI_SUCCESS;
+  }
+}
+
 int PMPI_Comm_group(MPI_Comm comm, MPI_Group * group)
 {
   if (comm == MPI_COMM_NULL) {
@@ -93,6 +107,18 @@ int PMPI_Comm_dup(MPI_Comm comm, MPI_Comm * newcomm)
   }
 }
 
+int PMPI_Comm_dup_with_info(MPI_Comm comm, MPI_Info info, MPI_Comm * newcomm)
+{
+  if (comm == MPI_COMM_NULL) {
+    return MPI_ERR_COMM;
+  } else if (newcomm == nullptr) {
+    return MPI_ERR_ARG;
+  } else {
+    comm->dup_with_info(info, newcomm);
+    return MPI_SUCCESS;
+  }
+}
+
 int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm)
 {
   if (comm == MPI_COMM_NULL) {
@@ -192,10 +218,14 @@ int PMPI_Comm_create_group(MPI_Comm comm, MPI_Group group, int, MPI_Comm* comm_o
 }
 
 MPI_Comm PMPI_Comm_f2c(MPI_Fint comm){
+  if(comm==-1)
+    return MPI_COMM_NULL;
   return static_cast<MPI_Comm>(simgrid::smpi::Comm::f2c(comm));
 }
 
 MPI_Fint PMPI_Comm_c2f(MPI_Comm comm){
+  if(comm==MPI_COMM_NULL)
+    return -1;
   return comm->c2f();
 }
 
@@ -209,6 +239,26 @@ int PMPI_Comm_set_attr (MPI_Comm comm, int comm_keyval, void *attribute_val)
   return PMPI_Attr_put(comm, comm_keyval, attribute_val);
 }
 
+int PMPI_Comm_get_info(MPI_Comm comm, MPI_Info* info)
+{
+  if (comm == MPI_COMM_NULL)  {
+    return MPI_ERR_WIN;
+  } else {
+    *info = comm->info();
+    return MPI_SUCCESS;
+  }
+}
+
+int PMPI_Comm_set_info(MPI_Comm  comm, MPI_Info info)
+{
+  if (comm == MPI_COMM_NULL)  {
+    return MPI_ERR_TYPE;
+  } else {
+    comm->set_info(info);
+    return MPI_SUCCESS;
+  }
+}
+
 int PMPI_Comm_delete_attr (MPI_Comm comm, int comm_keyval)
 {
   return PMPI_Attr_delete(comm, comm_keyval);
@@ -239,6 +289,7 @@ int PMPI_Attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag) {
   static int zero = 0;
   static int tag_ub = INT_MAX;
   static int last_used_code = MPI_ERR_LASTCODE;
+  static int universe_size;
 
   if (comm==MPI_COMM_NULL){
     *flag = 0;
@@ -254,7 +305,8 @@ int PMPI_Attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag) {
     return MPI_SUCCESS;
   case MPI_UNIVERSE_SIZE:
     *flag = 1;
-    *static_cast<int**>(attr_value) = &smpi_universe_size;
+    universe_size                   = smpi_get_universe_size();
+    *static_cast<int**>(attr_value) = &universe_size;
     return MPI_SUCCESS;
   case MPI_LASTUSEDCODE:
     *flag = 1;
@@ -282,3 +334,54 @@ int PMPI_Attr_put(MPI_Comm comm, int keyval, void* attr_value) {
   else
   return comm->attr_put<simgrid::smpi::Comm>(keyval, attr_value);
 }
+
+int PMPI_Errhandler_free(MPI_Errhandler* errhandler){
+  if (errhandler==nullptr){
+    return MPI_ERR_ARG;
+  }
+  simgrid::smpi::Errhandler::unref(*errhandler);
+  return MPI_SUCCESS;
+}
+
+int PMPI_Errhandler_create(MPI_Handler_function* function, MPI_Errhandler* errhandler){
+  *errhandler=new simgrid::smpi::Errhandler(function);
+  return MPI_SUCCESS;
+}
+
+int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler* errhandler){
+  if (comm == nullptr) {
+    return MPI_ERR_COMM;
+  } else if (errhandler==nullptr){
+    return MPI_ERR_ARG;
+  }
+  *errhandler=comm->errhandler();
+  return MPI_SUCCESS;
+}
+
+int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler){
+  if (comm == nullptr) {
+    return MPI_ERR_COMM;
+  } else if (errhandler==nullptr){
+    return MPI_ERR_ARG;
+  }
+  comm->set_errhandler(errhandler);
+  return MPI_SUCCESS;
+}
+
+int PMPI_Comm_call_errhandler(MPI_Comm comm,int errorcode){
+  if (comm == nullptr) {
+    return MPI_ERR_COMM;
+  }
+  comm->errhandler()->call(comm, errorcode);
+  return MPI_SUCCESS;
+}
+
+int PMPI_Comm_create_errhandler( MPI_Comm_errhandler_fn *function, MPI_Errhandler *errhandler){
+  return MPI_Errhandler_create(function, errhandler);
+}
+int PMPI_Comm_get_errhandler(MPI_Comm comm, MPI_Errhandler* errhandler){
+  return PMPI_Errhandler_get(comm, errhandler);
+}
+int PMPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler){
+  return PMPI_Errhandler_set(comm, errhandler);
+}
diff --git a/src/smpi/bindings/smpi_pmpi_file.cpp b/src/smpi/bindings/smpi_pmpi_file.cpp
new file mode 100644 (file)
index 0000000..3680ca9
--- /dev/null
@@ -0,0 +1,419 @@
+/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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 "smpi_file.hpp"
+#include "smpi_datatype.hpp"
+
+extern MPI_Errhandler SMPI_default_File_Errhandler;
+
+int PMPI_File_open(MPI_Comm comm, const char *filename, int amode, MPI_Info info, MPI_File *fh){
+  if (comm == MPI_COMM_NULL)
+    return MPI_ERR_COMM;
+  if (filename == nullptr)
+    return MPI_ERR_FILE;
+  if (amode < 0)
+    return MPI_ERR_AMODE;
+  smpi_bench_end();
+  *fh =  new simgrid::smpi::File(comm, filename, amode, info);
+  smpi_bench_begin();
+  if ((*fh)->size() != 0 && (amode & MPI_MODE_EXCL)){
+    delete fh;
+    return MPI_ERR_AMODE;
+  }
+  if(amode & MPI_MODE_APPEND)
+    (*fh)->seek(0,MPI_SEEK_END);
+  return MPI_SUCCESS;
+}
+
+int PMPI_File_close(MPI_File *fh){
+  if (fh==nullptr)
+    return MPI_ERR_ARG;
+  smpi_bench_end();
+  int ret = simgrid::smpi::File::close(fh);
+  *fh = MPI_FILE_NULL;
+  smpi_bench_begin();
+  return ret;
+}
+#define CHECK_FILE(fh)                                                                                                 \
+  if ((fh) == MPI_FILE_NULL)                                                                                           \
+    return MPI_ERR_FILE;
+#define CHECK_BUFFER(buf, count)                                                                                       \
+  if ((buf) == nullptr && (count) > 0)                                                                                 \
+    return MPI_ERR_BUFFER;
+#define CHECK_COUNT(count)                                                                                             \
+  if ((count) < 0)                                                                                                     \
+    return MPI_ERR_COUNT;
+#define CHECK_OFFSET(offset)                                                                                           \
+  if ((offset) < 0)                                                                                                    \
+    return MPI_ERR_DISP;
+#define CHECK_DATATYPE(datatype, count)                                                                                \
+  if ((datatype) == MPI_DATATYPE_NULL && (count) > 0)                                                                  \
+    return MPI_ERR_TYPE;
+#define CHECK_STATUS(status)                                                                                           \
+  if ((status) == nullptr)                                                                                             \
+    return MPI_ERR_ARG;
+#define CHECK_FLAGS(fh)                                                                                                \
+  if ((fh)->flags() & MPI_MODE_SEQUENTIAL)                                                                             \
+    return MPI_ERR_AMODE;
+#define CHECK_RDONLY(fh)                                                                                               \
+  if ((fh)->flags() & MPI_MODE_RDONLY)                                                                                 \
+    return MPI_ERR_AMODE;
+
+#define PASS_ZEROCOUNT(count)                                                                                          \
+  if ((count) == 0) {                                                                                                  \
+    status->count = 0;                                                                                                 \
+    return MPI_SUCCESS;                                                                                                \
+  }
+
+int PMPI_File_seek(MPI_File fh, MPI_Offset offset, int whence){
+  CHECK_FILE(fh);
+  smpi_bench_end();
+  int ret = fh->seek(offset,whence);
+  smpi_bench_begin();
+  return ret;
+
+}
+
+int PMPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence){
+  CHECK_FILE(fh)
+  smpi_bench_end();
+  int ret = fh->seek_shared(offset,whence);
+  smpi_bench_begin();
+  return ret;
+
+}
+
+int PMPI_File_get_position(MPI_File fh, MPI_Offset* offset){
+  if (offset==nullptr)
+    return MPI_ERR_DISP;
+  smpi_bench_end();
+  int ret = fh->get_position(offset);
+  smpi_bench_begin();
+  return ret;
+}
+
+int PMPI_File_get_position_shared(MPI_File fh, MPI_Offset* offset){
+  CHECK_FILE(fh)
+  if (offset==nullptr)
+    return MPI_ERR_DISP;
+  smpi_bench_end();
+  int ret = fh->get_position_shared(offset);
+  smpi_bench_begin();
+  return ret;
+}
+
+int PMPI_File_read(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status){
+  CHECK_FILE(fh)
+  CHECK_BUFFER(buf, count)
+  CHECK_COUNT(count)
+  CHECK_DATATYPE(datatype, count)
+  CHECK_STATUS(status)
+  CHECK_FLAGS(fh)
+  PASS_ZEROCOUNT(count)
+  smpi_bench_end();
+  int rank_traced = simgrid::s4u::this_actor::get_pid();
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - read", count * datatype->size()));
+  int ret = simgrid::smpi::File::read(fh, buf, count, datatype, status);
+  TRACE_smpi_comm_out(rank_traced);
+  smpi_bench_begin();
+  return ret;
+}
+
+int PMPI_File_read_shared(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status){
+  CHECK_FILE(fh)
+  CHECK_BUFFER(buf, count)
+  CHECK_COUNT(count)
+  CHECK_DATATYPE(datatype, count)
+  CHECK_STATUS(status)
+  CHECK_FLAGS(fh)
+  PASS_ZEROCOUNT(count)
+  smpi_bench_end();
+  int rank_traced = simgrid::s4u::this_actor::get_pid();
+  TRACE_smpi_comm_in(rank_traced, __func__,
+                     new simgrid::instr::CpuTIData("IO - read_shared", count * datatype->size()));
+  int ret = simgrid::smpi::File::read_shared(fh, buf, count, datatype, status);
+  TRACE_smpi_comm_out(rank_traced);
+  smpi_bench_begin();
+  return ret;
+}
+
+int PMPI_File_write(MPI_File fh, const void *buf, int count,MPI_Datatype datatype, MPI_Status *status){
+  CHECK_FILE(fh)
+  CHECK_BUFFER(buf, count)
+  CHECK_COUNT(count)
+  CHECK_DATATYPE(datatype, count)
+  CHECK_STATUS(status)
+  CHECK_FLAGS(fh)
+  CHECK_RDONLY(fh)
+  PASS_ZEROCOUNT(count)
+  smpi_bench_end();
+  int rank_traced = simgrid::s4u::this_actor::get_pid();
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - write", count * datatype->size()));
+  int ret = simgrid::smpi::File::write(fh, const_cast<void*>(buf), count, datatype, status);
+  TRACE_smpi_comm_out(rank_traced);
+  smpi_bench_begin();
+  return ret;
+}
+
+int PMPI_File_write_shared(MPI_File fh, const void *buf, int count,MPI_Datatype datatype, MPI_Status *status){
+  CHECK_FILE(fh)
+  CHECK_BUFFER(buf, count)
+  CHECK_COUNT(count)
+  CHECK_DATATYPE(datatype, count)
+  CHECK_STATUS(status)
+  CHECK_FLAGS(fh)
+  CHECK_RDONLY(fh)
+  PASS_ZEROCOUNT(count)
+  smpi_bench_end();
+  int rank_traced = simgrid::s4u::this_actor::get_pid();
+  TRACE_smpi_comm_in(rank_traced, __func__,
+                     new simgrid::instr::CpuTIData("IO - write_shared", count * datatype->size()));
+  int ret = simgrid::smpi::File::write_shared(fh, buf, count, datatype, status);
+  TRACE_smpi_comm_out(rank_traced);
+  smpi_bench_begin();
+  return ret;
+}
+
+int PMPI_File_read_all(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status){
+  CHECK_FILE(fh)
+  CHECK_BUFFER(buf, count)
+  CHECK_COUNT(count)
+  CHECK_DATATYPE(datatype, count)
+  CHECK_STATUS(status)
+  CHECK_FLAGS(fh)
+  smpi_bench_end();
+  int rank_traced = simgrid::s4u::this_actor::get_pid();
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - read_all", count * datatype->size()));
+  int ret = fh->op_all<simgrid::smpi::File::read>(buf, count, datatype, status);
+  TRACE_smpi_comm_out(rank_traced);
+  smpi_bench_begin();
+  return ret;
+}
+
+int PMPI_File_read_ordered(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status){
+  CHECK_FILE(fh)
+  CHECK_BUFFER(buf, count)
+  CHECK_COUNT(count)
+  CHECK_DATATYPE(datatype, count)
+  CHECK_STATUS(status)
+  CHECK_FLAGS(fh)
+  smpi_bench_end();
+  int rank_traced = simgrid::s4u::this_actor::get_pid();
+  TRACE_smpi_comm_in(rank_traced, __func__,
+                     new simgrid::instr::CpuTIData("IO - read_ordered", count * datatype->size()));
+  int ret = simgrid::smpi::File::read_ordered(fh, buf, count, datatype, status);
+  TRACE_smpi_comm_out(rank_traced);
+  smpi_bench_begin();
+  return ret;
+}
+
+int PMPI_File_write_all(MPI_File fh, const void *buf, int count,MPI_Datatype datatype, MPI_Status *status){
+  CHECK_FILE(fh)
+  CHECK_BUFFER(buf, count)
+  CHECK_COUNT(count)
+  CHECK_DATATYPE(datatype, count)
+  CHECK_STATUS(status)
+  CHECK_FLAGS(fh)
+  CHECK_RDONLY(fh)
+  smpi_bench_end();
+  int rank_traced = simgrid::s4u::this_actor::get_pid();
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - write_all", count * datatype->size()));
+  int ret = fh->op_all<simgrid::smpi::File::write>(const_cast<void*>(buf), count, datatype, status);
+  TRACE_smpi_comm_out(rank_traced);
+  smpi_bench_begin();
+  return ret;
+}
+
+int PMPI_File_write_ordered(MPI_File fh, const void *buf, int count,MPI_Datatype datatype, MPI_Status *status){
+  CHECK_FILE(fh)
+  CHECK_BUFFER(buf, count)
+  CHECK_COUNT(count)
+  CHECK_DATATYPE(datatype, count)
+  CHECK_STATUS(status)
+  CHECK_FLAGS(fh)
+  CHECK_RDONLY(fh)
+  smpi_bench_end();
+  int rank_traced = simgrid::s4u::this_actor::get_pid();
+  TRACE_smpi_comm_in(rank_traced, __func__,
+                     new simgrid::instr::CpuTIData("IO - write_ordered", count * datatype->size()));
+  int ret = simgrid::smpi::File::write_ordered(fh, buf, count, datatype, status);
+  TRACE_smpi_comm_out(rank_traced);
+  smpi_bench_begin();
+  return ret;
+}
+
+int PMPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count,MPI_Datatype datatype, MPI_Status *status){
+  CHECK_FILE(fh)
+  CHECK_BUFFER(buf, count)
+  CHECK_OFFSET(offset)
+  CHECK_COUNT(count)
+  CHECK_DATATYPE(datatype, count)
+  CHECK_STATUS(status)
+  CHECK_FLAGS(fh)
+  PASS_ZEROCOUNT(count);
+  smpi_bench_end();
+  int rank_traced = simgrid::s4u::this_actor::get_pid();
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - read", count * datatype->size()));
+  int ret = fh->seek(offset,MPI_SEEK_SET);
+  if(ret!=MPI_SUCCESS)
+    return ret;
+  ret = simgrid::smpi::File::read(fh, buf, count, datatype, status);
+  TRACE_smpi_comm_out(rank_traced);
+  smpi_bench_begin();
+  return ret;
+}
+
+int PMPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count,MPI_Datatype datatype, MPI_Status *status){
+  CHECK_FILE(fh)
+  CHECK_BUFFER(buf, count)
+  CHECK_OFFSET(offset)
+  CHECK_COUNT(count)
+  CHECK_DATATYPE(datatype, count)
+  CHECK_STATUS(status)
+  CHECK_FLAGS(fh)
+  smpi_bench_end();
+  int rank_traced = simgrid::s4u::this_actor::get_pid();
+  TRACE_smpi_comm_in(rank_traced, __func__,
+                     new simgrid::instr::CpuTIData("IO - read_at_all", count * datatype->size()));
+  int ret = fh->seek(offset,MPI_SEEK_SET);
+  if(ret!=MPI_SUCCESS)
+    return ret;
+  ret = fh->op_all<simgrid::smpi::File::read>(buf, count, datatype, status);
+  TRACE_smpi_comm_out(rank_traced);
+  smpi_bench_begin();
+  return ret;
+}
+
+int PMPI_File_write_at(MPI_File fh, MPI_Offset offset, const void *buf, int count,MPI_Datatype datatype, MPI_Status *status){
+  CHECK_FILE(fh)
+  CHECK_BUFFER(buf, count)
+  CHECK_OFFSET(offset)
+  CHECK_COUNT(count)
+  CHECK_DATATYPE(datatype, count)
+  CHECK_STATUS(status)
+  CHECK_FLAGS(fh)
+  CHECK_RDONLY(fh)
+  PASS_ZEROCOUNT(count);
+  smpi_bench_end();
+  int rank_traced = simgrid::s4u::this_actor::get_pid();
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - write", count * datatype->size()));
+  int ret = fh->seek(offset,MPI_SEEK_SET);
+  if(ret!=MPI_SUCCESS)
+    return ret;
+  ret = simgrid::smpi::File::write(fh, const_cast<void*>(buf), count, datatype, status);
+  TRACE_smpi_comm_out(rank_traced);
+  smpi_bench_begin();
+  return ret;
+}
+
+int PMPI_File_write_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int count,MPI_Datatype datatype, MPI_Status *status){
+  CHECK_FILE(fh)
+  CHECK_BUFFER(buf, count)
+  CHECK_OFFSET(offset)
+  CHECK_COUNT(count)
+  CHECK_DATATYPE(datatype, count)
+  CHECK_STATUS(status)
+  CHECK_FLAGS(fh)
+  CHECK_RDONLY(fh)
+  smpi_bench_end();
+  int rank_traced = simgrid::s4u::this_actor::get_pid();
+  TRACE_smpi_comm_in(rank_traced, __func__,
+                     new simgrid::instr::CpuTIData("IO - write_at_all", count * datatype->size()));
+  int ret = fh->seek(offset,MPI_SEEK_SET);
+  if(ret!=MPI_SUCCESS)
+    return ret;
+  ret = fh->op_all<simgrid::smpi::File::write>(const_cast<void*>(buf), count, datatype, status);
+  TRACE_smpi_comm_out(rank_traced);
+  smpi_bench_begin();
+  return ret;
+}
+
+int PMPI_File_delete(const char *filename, MPI_Info info){
+  if (filename == nullptr)
+    return MPI_ERR_FILE;
+  smpi_bench_end();
+  int ret = simgrid::smpi::File::del(filename, info);
+  smpi_bench_begin();
+  return ret;
+}
+
+int PMPI_File_get_info(MPI_File  fh, MPI_Info* info)
+{
+  CHECK_FILE(fh)
+  *info = fh->info();
+  return MPI_SUCCESS;
+}
+
+int PMPI_File_set_info(MPI_File  fh, MPI_Info info)
+{
+  CHECK_FILE(fh)
+  fh->set_info(info);
+  return MPI_SUCCESS;
+}
+
+int PMPI_File_get_size(MPI_File  fh, MPI_Offset* size)
+{
+  CHECK_FILE(fh)
+  *size = fh->size();
+  return MPI_SUCCESS;
+}
+
+int PMPI_File_get_amode(MPI_File  fh, int* amode)
+{
+  CHECK_FILE(fh)
+  *amode = fh->flags();
+  return MPI_SUCCESS;
+}
+
+int PMPI_File_get_group(MPI_File  fh, MPI_Group* group)
+{
+  CHECK_FILE(fh)
+  *group = fh->comm()->group();
+  return MPI_SUCCESS;
+}
+
+int PMPI_File_sync(MPI_File  fh)
+{
+  CHECK_FILE(fh)
+  fh->sync();
+  return MPI_SUCCESS;
+}
+
+int PMPI_File_create_errhandler(MPI_File_errhandler_function* function, MPI_Errhandler* errhandler){
+  *errhandler=new simgrid::smpi::Errhandler(function);
+  return MPI_SUCCESS;
+}
+
+int PMPI_File_get_errhandler(MPI_File file, MPI_Errhandler* errhandler){
+  if (errhandler==nullptr){
+    return MPI_ERR_ARG;
+  } else if (file == MPI_FILE_NULL) {
+    *errhandler = SMPI_default_File_Errhandler;
+    return MPI_SUCCESS;
+  }
+  *errhandler=file->errhandler();
+  return MPI_SUCCESS;
+}
+
+int PMPI_File_set_errhandler(MPI_File file, MPI_Errhandler errhandler){
+  if (errhandler==nullptr){
+    return MPI_ERR_ARG;
+  } else if (file == MPI_FILE_NULL) {
+    SMPI_default_File_Errhandler = errhandler;
+    return MPI_SUCCESS;
+  }
+  file->set_errhandler(errhandler);
+  return MPI_SUCCESS;
+}
+
+int PMPI_File_call_errhandler(MPI_File file,int errorcode){
+  if (file == nullptr) {
+    return MPI_ERR_WIN;
+  }
+  file->errhandler()->call(file, errorcode);
+  return MPI_SUCCESS;
+}
index 5abc6eb..e038ca7 100644 (file)
@@ -50,7 +50,7 @@ int PMPI_Group_rank(MPI_Group group, int *rank)
   }
 }
 
-int PMPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1, MPI_Group group2, int *ranks2)
+int PMPI_Group_translate_ranks(MPI_Group group1, int n, const int *ranks1, MPI_Group group2, int *ranks2)
 {
   if (group1 == MPI_GROUP_NULL || group2 == MPI_GROUP_NULL) {
     return MPI_ERR_GROUP;
@@ -59,7 +59,7 @@ int PMPI_Group_translate_ranks(MPI_Group group1, int n, int *ranks1, MPI_Group g
       if(ranks1[i]==MPI_PROC_NULL){
         ranks2[i]=MPI_PROC_NULL;
       }else{
-        simgrid::s4u::ActorPtr actor = group1->actor(ranks1[i]);
+        simgrid::s4u::Actor* actor = group1->actor(ranks1[i]);
         ranks2[i] = group2->rank(actor);
       }
     }
@@ -114,7 +114,7 @@ int PMPI_Group_difference(MPI_Group group1, MPI_Group group2, MPI_Group * newgro
   }
 }
 
-int PMPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
+int PMPI_Group_incl(MPI_Group group, int n, const int *ranks, MPI_Group * newgroup)
 {
   if (group == MPI_GROUP_NULL) {
     return MPI_ERR_GROUP;
@@ -125,7 +125,7 @@ int PMPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
   }
 }
 
-int PMPI_Group_excl(MPI_Group group, int n, int *ranks, MPI_Group * newgroup)
+int PMPI_Group_excl(MPI_Group group, int n, const int *ranks, MPI_Group * newgroup)
 {
   if (group == MPI_GROUP_NULL) {
     return MPI_ERR_GROUP;
@@ -182,9 +182,13 @@ int PMPI_Group_range_excl(MPI_Group group, int n, int ranges[][3], MPI_Group * n
 }
 
 MPI_Group PMPI_Group_f2c(MPI_Fint group){
+  if(group==-1)
+    return MPI_GROUP_NULL;
   return simgrid::smpi::Group::f2c(group);
 }
 
 MPI_Fint PMPI_Group_c2f(MPI_Group group){
+  if(group==MPI_GROUP_NULL)
+    return -1;
   return group->c2f();
 }
index f9fb0c2..0a694f2 100644 (file)
@@ -17,7 +17,7 @@ int PMPI_Info_create( MPI_Info *info){
   return MPI_SUCCESS;
 }
 
-int PMPI_Info_set( MPI_Info info, char *key, char *value){
+int PMPI_Info_set( MPI_Info info, const char *key, const char *value){
   if (info == nullptr || key == nullptr || value == nullptr)
     return MPI_ERR_ARG;
   info->set(key, value);
@@ -32,10 +32,12 @@ int PMPI_Info_free( MPI_Info *info){
   return MPI_SUCCESS;
 }
 
-int PMPI_Info_get(MPI_Info info,char *key,int valuelen, char *value, int *flag){
+int PMPI_Info_get(MPI_Info info, const char *key,int valuelen, char *value, int *flag){
   *flag=false;
-  if (info == nullptr || key == nullptr || valuelen <0)
+  if (info == nullptr || valuelen <0)
     return MPI_ERR_ARG;
+  if (key == nullptr)
+    return MPI_ERR_INFO_KEY;
   if (value == nullptr)
     return MPI_ERR_INFO_VALUE;
   return info->get(key, valuelen, value, flag);
@@ -48,7 +50,7 @@ int PMPI_Info_dup(MPI_Info info, MPI_Info *newinfo){
   return MPI_SUCCESS;
 }
 
-int PMPI_Info_delete(MPI_Info info, char *key){
+int PMPI_Info_delete(MPI_Info info, const char *key){
   if (info == nullptr || key==nullptr)
     return MPI_ERR_ARG;
   return info->remove(key);
@@ -66,17 +68,25 @@ int PMPI_Info_get_nthkey( MPI_Info info, int n, char *key){
   return info->get_nthkey(n, key);
 }
 
-int PMPI_Info_get_valuelen( MPI_Info info, char *key, int *valuelen, int *flag){
+int PMPI_Info_get_valuelen( MPI_Info info, const char *key, int *valuelen, int *flag){
   *flag=false;
-  if (info == nullptr || key == nullptr || valuelen==nullptr)
+  if (info == nullptr)
     return MPI_ERR_ARG;
+  if (key == nullptr)
+    return MPI_ERR_INFO_KEY;
+  if (valuelen == nullptr)
+    return MPI_ERR_INFO_VALUE;
   return info->get_valuelen(key, valuelen, flag);
 }
 
 MPI_Info PMPI_Info_f2c(MPI_Fint info){
+  if(info==-1)
+    return MPI_INFO_NULL;
   return static_cast<MPI_Info>(simgrid::smpi::Info::f2c(info));
 }
 
 MPI_Fint PMPI_Info_c2f(MPI_Info info){
+  if(info==MPI_INFO_NULL)
+    return -1;
   return info->c2f();
 }
index 505914e..b52c518 100644 (file)
@@ -45,9 +45,13 @@ int PMPI_Op_commutative(MPI_Op op, int* commute){
 }
 
 MPI_Op PMPI_Op_f2c(MPI_Fint op){
+  if(op==-1)
+    return MPI_OP_NULL;
   return static_cast<MPI_Op>(simgrid::smpi::Op::f2c(op));
 }
 
 MPI_Fint PMPI_Op_c2f(MPI_Op op){
+  if(op==MPI_OP_NULL)
+    return -1;
   return op->c2f();
 }
index 790d371..af333ec 100644 (file)
@@ -20,7 +20,7 @@ static int getPid(MPI_Comm comm, int id)
 
 /* PMPI User level calls */
 
-int PMPI_Send_init(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request * request)
+int PMPI_Send_init(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request * request)
 {
   int retval = 0;
 
@@ -29,7 +29,7 @@ int PMPI_Send_init(void *buf, int count, MPI_Datatype datatype, int dst, int tag
     retval = MPI_ERR_ARG;
   } else if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
-  } else if (not datatype->is_valid()) {
+  } else if (datatype==MPI_DATATYPE_NULL || not datatype->is_valid()) {
     retval = MPI_ERR_TYPE;
   } else if (dst == MPI_PROC_NULL) {
     retval = MPI_SUCCESS;
@@ -52,7 +52,7 @@ int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int src, int tag
     retval = MPI_ERR_ARG;
   } else if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
-  } else if (not datatype->is_valid()) {
+  } else if (datatype==MPI_DATATYPE_NULL || not datatype->is_valid()) {
     retval = MPI_ERR_TYPE;
   } else if (src == MPI_PROC_NULL) {
     retval = MPI_SUCCESS;
@@ -66,7 +66,13 @@ int PMPI_Recv_init(void *buf, int count, MPI_Datatype datatype, int src, int tag
   return retval;
 }
 
-int PMPI_Ssend_init(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request)
+int PMPI_Rsend_init(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm,
+                    MPI_Request* request)
+{
+  return PMPI_Send_init(buf, count, datatype, dst, tag, comm, request);
+}
+
+int PMPI_Ssend_init(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request)
 {
   int retval = 0;
 
@@ -75,7 +81,7 @@ int PMPI_Ssend_init(void* buf, int count, MPI_Datatype datatype, int dst, int ta
     retval = MPI_ERR_ARG;
   } else if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
-  } else if (not datatype->is_valid()) {
+  } else if (datatype==MPI_DATATYPE_NULL || not datatype->is_valid()) {
     retval = MPI_ERR_TYPE;
   } else if (dst == MPI_PROC_NULL) {
     retval = MPI_SUCCESS;
@@ -167,10 +173,9 @@ int PMPI_Request_free(MPI_Request * request)
   int retval = 0;
 
   smpi_bench_end();
-  if (*request == MPI_REQUEST_NULL) {
-    retval = MPI_ERR_ARG;
-  } else {
+  if (*request != MPI_REQUEST_NULL) {
     simgrid::smpi::Request::unref(request);
+    *request = MPI_REQUEST_NULL;
     retval = MPI_SUCCESS;
   }
   smpi_bench_begin();
@@ -194,7 +199,7 @@ int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MP
     retval = MPI_ERR_RANK;
   } else if ((count < 0) || (buf==nullptr && count > 0)) {
     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 if(tag<0 && tag !=  MPI_ANY_TAG){
     retval = MPI_ERR_TAG;
@@ -220,7 +225,7 @@ int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MP
 }
 
 
-int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request * request)
+int PMPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request * request)
 {
   int retval = 0;
 
@@ -236,7 +241,7 @@ int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MP
     retval = MPI_ERR_RANK;
   } else if ((count < 0) || (buf==nullptr && count > 0)) {
     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 if(tag<0 && tag !=  MPI_ANY_TAG){
     retval = MPI_ERR_TAG;
@@ -262,7 +267,13 @@ int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MP
   return retval;
 }
 
-int PMPI_Issend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request)
+int PMPI_Irsend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm,
+                MPI_Request* request)
+{
+  return PMPI_Isend(buf, count, datatype, dst, tag, comm, request);
+}
+
+int PMPI_Issend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request)
 {
   int retval = 0;
 
@@ -278,7 +289,7 @@ int PMPI_Issend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, M
     retval = MPI_ERR_RANK;
   } else if ((count < 0)|| (buf==nullptr && count > 0)) {
     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 if(tag<0 && tag !=  MPI_ANY_TAG){
     retval = MPI_ERR_TAG;
@@ -320,7 +331,7 @@ int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI
     retval = MPI_ERR_RANK;
   } else if ((count < 0) || (buf==nullptr && count > 0)) {
     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 if(tag<0 && tag !=  MPI_ANY_TAG){
     retval = MPI_ERR_TAG;
@@ -351,7 +362,7 @@ int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI
   return retval;
 }
 
-int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
+int PMPI_Send(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
 {
   int retval = 0;
 
@@ -365,7 +376,7 @@ int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI
     retval = MPI_ERR_RANK;
   } else if ((count < 0) || (buf == nullptr && count > 0)) {
     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 if(tag < 0 && tag !=  MPI_ANY_TAG){
     retval = MPI_ERR_TAG;
@@ -390,7 +401,13 @@ int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI
   return retval;
 }
 
-int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm) {
+int PMPI_Rsend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
+{
+  return PMPI_Send(buf, count, datatype, dst, tag, comm);
+}
+
+int PMPI_Bsend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
+{
   int retval = 0;
 
   smpi_bench_end();
@@ -401,9 +418,132 @@ int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MP
     retval = MPI_SUCCESS;
   } else if (dst >= comm->group()->size() || dst <0){
     retval = MPI_ERR_RANK;
+  } else if ((count < 0) || (buf == nullptr && count > 0)) {
+    retval = MPI_ERR_COUNT;
+  } else if (datatype==MPI_DATATYPE_NULL || not datatype->is_valid()) {
+    retval = MPI_ERR_TYPE;
+  } else if(tag < 0 && tag !=  MPI_ANY_TAG){
+    retval = MPI_ERR_TAG;
+  } else {
+    int my_proc_id         = simgrid::s4u::this_actor::get_pid();
+    int dst_traced         = getPid(comm, dst);
+    int bsend_buf_size = 0;
+    void* bsend_buf = nullptr;
+    smpi_process()->bsend_buffer(&bsend_buf, &bsend_buf_size);
+    int size = datatype->get_extent() * count;
+    if(bsend_buf==nullptr || bsend_buf_size < size + MPI_BSEND_OVERHEAD )
+      return MPI_ERR_BUFFER;
+    TRACE_smpi_comm_in(my_proc_id, __func__,
+                       new simgrid::instr::Pt2PtTIData("bsend", dst,
+                                                       datatype->is_replayable() ? count : count * datatype->size(),
+                                                       tag, simgrid::smpi::Datatype::encode(datatype)));
+    if (not TRACE_smpi_view_internals()) {
+      TRACE_smpi_send(my_proc_id, my_proc_id, dst_traced, tag, count * datatype->size());
+    }
+
+    simgrid::smpi::Request::bsend(buf, count, datatype, dst, tag, comm);
+    retval = MPI_SUCCESS;
+
+    TRACE_smpi_comm_out(my_proc_id);
+  }
+
+  smpi_bench_begin();
+  return retval;
+}
+
+int PMPI_Ibsend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request)
+{
+  int retval = 0;
+
+  smpi_bench_end();
+  if (request == nullptr) {
+    retval = MPI_ERR_ARG;
+  } else if (comm == MPI_COMM_NULL) {
+    retval = MPI_ERR_COMM;
+  } else if (dst == MPI_PROC_NULL) {
+    *request = MPI_REQUEST_NULL;
+    retval = MPI_SUCCESS;
+  } else if (dst >= comm->group()->size() || dst <0){
+    retval = MPI_ERR_RANK;
   } else if ((count < 0) || (buf==nullptr && count > 0)) {
     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 if(tag<0 && tag !=  MPI_ANY_TAG){
+    retval = MPI_ERR_TAG;
+  } else {
+    int my_proc_id = simgrid::s4u::this_actor::get_pid();
+    int trace_dst = getPid(comm, dst);
+    int bsend_buf_size = 0;
+    void* bsend_buf = nullptr;
+    smpi_process()->bsend_buffer(&bsend_buf, &bsend_buf_size);
+    int size = datatype->get_extent() * count;
+    if(bsend_buf==nullptr || bsend_buf_size < size + MPI_BSEND_OVERHEAD )
+      return MPI_ERR_BUFFER;
+    TRACE_smpi_comm_in(my_proc_id, __func__,
+                       new simgrid::instr::Pt2PtTIData("ibsend", dst,
+                                                       datatype->is_replayable() ? count : count * datatype->size(),
+                                                       tag, simgrid::smpi::Datatype::encode(datatype)));
+
+    TRACE_smpi_send(my_proc_id, my_proc_id, trace_dst, tag, count * datatype->size());
+
+    *request = simgrid::smpi::Request::ibsend(buf, count, datatype, dst, tag, comm);
+    retval = MPI_SUCCESS;
+
+    TRACE_smpi_comm_out(my_proc_id);
+  }
+
+  smpi_bench_begin();
+  if (retval != MPI_SUCCESS && request!=nullptr)
+    *request = MPI_REQUEST_NULL;
+  return retval;
+}
+
+int PMPI_Bsend_init(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request)
+{
+
+  int retval = 0;
+
+  smpi_bench_end();
+  if (request == nullptr) {
+    retval = MPI_ERR_ARG;
+  } else if (comm == MPI_COMM_NULL) {
+    retval = MPI_ERR_COMM;
+  } else if (datatype==MPI_DATATYPE_NULL || not datatype->is_valid()) {
+    retval = MPI_ERR_TYPE;
+  } else if (dst == MPI_PROC_NULL) {
+    retval = MPI_SUCCESS;
+  } else {
+    int bsend_buf_size = 0;
+    void* bsend_buf = nullptr;
+    smpi_process()->bsend_buffer(&bsend_buf, &bsend_buf_size);
+    if( bsend_buf==nullptr || bsend_buf_size < datatype->get_extent() * count + MPI_BSEND_OVERHEAD ) {
+      retval = MPI_ERR_BUFFER;
+    } else {
+      *request = simgrid::smpi::Request::bsend_init(buf, count, datatype, dst, tag, comm);
+      retval   = MPI_SUCCESS;
+    }
+  }
+  smpi_bench_begin();
+  if (retval != MPI_SUCCESS && request != nullptr)
+    *request = MPI_REQUEST_NULL;
+  return retval;
+}
+
+int PMPI_Ssend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm) {
+  int retval = 0;
+
+  smpi_bench_end();
+
+  if (comm == MPI_COMM_NULL) {
+    retval = MPI_ERR_COMM;
+  } else if (dst == MPI_PROC_NULL) {
+    retval = MPI_SUCCESS;
+  } else if (dst >= comm->group()->size() || dst <0){
+    retval = MPI_ERR_RANK;
+  } else if ((count < 0) || (buf==nullptr && count > 0)) {
+    retval = MPI_ERR_COUNT;
+  } else if (datatype==MPI_DATATYPE_NULL || not datatype->is_valid()) {
     retval = MPI_ERR_TYPE;
   } else if(tag<0 && tag !=  MPI_ANY_TAG){
     retval = MPI_ERR_TAG;
@@ -426,7 +566,7 @@ int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MP
   return retval;
 }
 
-int PMPI_Sendrecv(void* sendbuf, int sendcount, MPI_Datatype sendtype, int dst, int sendtag, void* recvbuf,
+int PMPI_Sendrecv(const 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;
@@ -490,7 +630,7 @@ int PMPI_Sendrecv_replace(void* buf, int count, MPI_Datatype datatype, int dst,
                           MPI_Comm comm, MPI_Status* status)
 {
   int retval = 0;
-  if (not datatype->is_valid()) {
+  if (datatype==MPI_DATATYPE_NULL || not datatype->is_valid()) {
     return MPI_ERR_TYPE;
   } else if (count < 0) {
     return MPI_ERR_COUNT;
@@ -702,7 +842,7 @@ int PMPI_Waitany(int count, MPI_Request requests[], int *index, MPI_Status * sta
   }
 
   int rank_traced = simgrid::s4u::this_actor::get_pid(); // FIXME: In PMPI_Wait, we check if the comm is null?
-  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("waitAny", static_cast<double>(count)));
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("waitAny", count));
 
   *index = simgrid::smpi::Request::waitany(count, requests, status);
 
@@ -733,7 +873,7 @@ int PMPI_Waitall(int count, MPI_Request requests[], MPI_Status status[])
   }
 
   int rank_traced = simgrid::s4u::this_actor::get_pid(); // FIXME: In PMPI_Wait, we check if the comm is null?
-  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("waitall", static_cast<double>(count)));
+  TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("waitall", count));
 
   int retval = simgrid::smpi::Request::waitall(count, requests, status);
 
@@ -780,7 +920,7 @@ int PMPI_Cancel(MPI_Request* request)
   return retval;
 }
 
-int PMPI_Test_cancelled(MPI_Status* status, int* flag){
+int PMPI_Test_cancelled(const MPI_Status* status, int* flag){
   if(status==MPI_STATUS_IGNORE){
     *flag=0;
     return MPI_ERR_ARG;
@@ -813,12 +953,11 @@ int PMPI_Grequest_complete( MPI_Request request){
   return simgrid::smpi::Request::grequest_complete(request);
 }
 
-
 int PMPI_Request_get_status( MPI_Request request, int *flag, MPI_Status *status){
   if(request==MPI_REQUEST_NULL){
     *flag=1;
     simgrid::smpi::Status::empty(status);
-    return MPI_ERR_REQUEST;
+    return MPI_SUCCESS;
   } else if (flag==NULL || status ==NULL){
     return MPI_ERR_ARG;
   }
@@ -826,9 +965,13 @@ int PMPI_Request_get_status( MPI_Request request, int *flag, MPI_Status *status)
 }
 
 MPI_Request PMPI_Request_f2c(MPI_Fint request){
+  if(request==-1)
+    return MPI_REQUEST_NULL;
   return static_cast<MPI_Request>(simgrid::smpi::Request::f2c(request));
 }
 
 MPI_Fint PMPI_Request_c2f(MPI_Request request) {
+  if(request==MPI_REQUEST_NULL)
+    return -1;
   return request->c2f();
 }
index a3b94ba..9b0779b 100644 (file)
@@ -14,12 +14,16 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
  * check if the topology is nullptr, but we should check if it is the good topology type (so we have to add a
  *  MPIR_Topo_Type field, and replace the MPI_Topology field by an union)*/
 
-int PMPI_Cart_create(MPI_Comm comm_old, int ndims, int* dims, int* periodic, int reorder, MPI_Comm* comm_cart) {
+int PMPI_Cart_create(MPI_Comm comm_old, int ndims, const int* dims, const int* periodic, int reorder, MPI_Comm* comm_cart) {
   if (comm_old == MPI_COMM_NULL){
     return MPI_ERR_COMM;
   } else if (ndims < 0 || (ndims > 0 && (dims == nullptr || periodic == nullptr)) || comm_cart == nullptr) {
     return MPI_ERR_ARG;
-  } else{
+  } else {
+    for (int i = 0; i < ndims; i++)
+      if (dims[i] < 0)
+        return MPI_ERR_ARG;
+
     simgrid::smpi::Topo_Cart* topo = new simgrid::smpi::Topo_Cart(comm_old, ndims, dims, periodic, reorder, comm_cart);
     if (*comm_cart == MPI_COMM_NULL) {
       delete topo;
@@ -30,12 +34,12 @@ int PMPI_Cart_create(MPI_Comm comm_old, int ndims, int* dims, int* periodic, int
   }
 }
 
-int PMPI_Cart_rank(MPI_Comm comm, int* coords, int* rank) {
+int PMPI_Cart_rank(MPI_Comm comm, const int* coords, int* rank) {
   if(comm == MPI_COMM_NULL || comm->topo() == nullptr) {
     return MPI_ERR_TOPOLOGY;
   }
   if (coords == nullptr) {
-    return MPI_ERR_ARG;
+    return MPI_SUCCESS;
   }
   MPIR_Cart_Topology topo = static_cast<MPIR_Cart_Topology>(comm->topo());
   if (topo==nullptr) {
@@ -65,11 +69,11 @@ int PMPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int* coords) {
   if (rank < 0 || rank >= comm->size()) {
     return MPI_ERR_RANK;
   }
-  if (maxdims <= 0) {
+  if (maxdims < 0) {
     return MPI_ERR_ARG;
   }
-  if(coords == nullptr) {
-    return MPI_ERR_ARG;
+  if(maxdims==0 || coords == nullptr) {
+    return MPI_SUCCESS;
   }
   MPIR_Cart_Topology topo = static_cast<MPIR_Cart_Topology>(comm->topo());
   if (topo==nullptr) {
@@ -79,10 +83,13 @@ int PMPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int* coords) {
 }
 
 int PMPI_Cart_get(MPI_Comm comm, int maxdims, int* dims, int* periods, int* coords) {
+  if(dims == nullptr || periods == nullptr || coords == nullptr){
+    return MPI_SUCCESS;
+  }
   if(comm == nullptr || comm->topo() == nullptr) {
     return MPI_ERR_TOPOLOGY;
   }
-  if(maxdims <= 0 || dims == nullptr || periods == nullptr || coords == nullptr) {
+  if(maxdims <= 0) {
     return MPI_ERR_ARG;
   }
   MPIR_Cart_Topology topo = static_cast<MPIR_Cart_Topology>(comm->topo());
@@ -108,7 +115,7 @@ int PMPI_Cartdim_get(MPI_Comm comm, int* ndims) {
 
 int PMPI_Dims_create(int nnodes, int ndims, int* dims) {
   if(dims == nullptr) {
-    return MPI_ERR_ARG;
+    return MPI_SUCCESS;
   }
   if (ndims < 1 || nnodes < 1) {
     return MPI_ERR_DIMS;
@@ -116,7 +123,7 @@ int PMPI_Dims_create(int nnodes, int ndims, int* dims) {
   return simgrid::smpi::Topo_Cart::Dims_create(nnodes, ndims, dims);
 }
 
-int PMPI_Cart_sub(MPI_Comm comm, int* remain_dims, MPI_Comm* comm_new) {
+int PMPI_Cart_sub(MPI_Comm comm, const int* remain_dims, MPI_Comm* comm_new) {
   if(comm == MPI_COMM_NULL || comm->topo() == nullptr) {
     return MPI_ERR_TOPOLOGY;
   }
index 344b038..5e35a9d 100644 (file)
@@ -13,8 +13,8 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
 int PMPI_Type_free(MPI_Datatype * datatype)
 {
   /* Free a predefined datatype is an error according to the standard, and should be checked for */
-  if (*datatype == MPI_DATATYPE_NULL) {
-    return MPI_ERR_ARG;
+  if (*datatype == MPI_DATATYPE_NULL || (*datatype)->flags() & DT_FLAG_PREDEFINED) {
+    return MPI_ERR_TYPE;
   } else {
     simgrid::smpi::Datatype::unref(*datatype);
     return MPI_SUCCESS;
@@ -134,8 +134,10 @@ int PMPI_Type_commit(MPI_Datatype* datatype) {
 int PMPI_Type_vector(int count, int blocklen, int stride, MPI_Datatype old_type, MPI_Datatype* new_type) {
   if (old_type == MPI_DATATYPE_NULL) {
     return MPI_ERR_TYPE;
-  } else if (count<0 || blocklen<0){
+  } else if (count<0){
     return MPI_ERR_COUNT;
+  } else if(blocklen<0){
+    return MPI_ERR_ARG;
   } else {
     return simgrid::smpi::Datatype::create_vector(count, blocklen, stride, old_type, new_type);
   }
@@ -144,8 +146,10 @@ int PMPI_Type_vector(int count, int blocklen, int stride, MPI_Datatype old_type,
 int PMPI_Type_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype old_type, MPI_Datatype* new_type) {
   if (old_type == MPI_DATATYPE_NULL) {
     return MPI_ERR_TYPE;
-  } else if (count<0 || blocklen<0){
+  } else if (count<0){
     return MPI_ERR_COUNT;
+  } else if(blocklen<0){
+    return MPI_ERR_ARG;
   } else {
     return simgrid::smpi::Datatype::create_hvector(count, blocklen, stride, old_type, new_type);
   }
@@ -155,7 +159,7 @@ int PMPI_Type_create_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datat
   return MPI_Type_hvector(count, blocklen, stride, old_type, new_type);
 }
 
-int PMPI_Type_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
+int PMPI_Type_indexed(int count, const int* blocklens, const int* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
   if (old_type == MPI_DATATYPE_NULL) {
     return MPI_ERR_TYPE;
   } else if (count<0){
@@ -165,7 +169,7 @@ int PMPI_Type_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_
   }
 }
 
-int PMPI_Type_create_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
+int PMPI_Type_create_indexed(int count, const int* blocklens, const int* indices, MPI_Datatype old_type, MPI_Datatype* new_type) {
   if (old_type == MPI_DATATYPE_NULL) {
     return MPI_ERR_TYPE;
   } else if (count<0){
@@ -175,7 +179,7 @@ int PMPI_Type_create_indexed(int count, int* blocklens, int* indices, MPI_Dataty
   }
 }
 
-int PMPI_Type_create_indexed_block(int count, int blocklength, int* indices, MPI_Datatype old_type,
+int PMPI_Type_create_indexed_block(int count, int blocklength, const int* indices, MPI_Datatype old_type,
                                    MPI_Datatype* new_type)
 {
   if (old_type == MPI_DATATYPE_NULL) {
@@ -192,7 +196,8 @@ int PMPI_Type_create_indexed_block(int count, int blocklength, int* indices, MPI
   }
 }
 
-int PMPI_Type_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* new_type)
+int PMPI_Type_hindexed(int count, const int* blocklens, const MPI_Aint* indices, MPI_Datatype old_type,
+                       MPI_Datatype* new_type)
 {
   if (old_type == MPI_DATATYPE_NULL) {
     return MPI_ERR_TYPE;
@@ -203,12 +208,12 @@ int PMPI_Type_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatyp
   }
 }
 
-int PMPI_Type_create_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type,
+int PMPI_Type_create_hindexed(int count, const int* blocklens, const MPI_Aint* indices, MPI_Datatype old_type,
                               MPI_Datatype* new_type) {
-  return PMPI_Type_hindexed(count, blocklens,indices,old_type,new_type);
+  return PMPI_Type_hindexed(count, blocklens, indices, old_type, new_type);
 }
 
-int PMPI_Type_create_hindexed_block(int count, int blocklength, MPI_Aint* indices, MPI_Datatype old_type,
+int PMPI_Type_create_hindexed_block(int count, int blocklength, const MPI_Aint* indices, MPI_Datatype old_type,
                                     MPI_Datatype* new_type) {
   if (old_type == MPI_DATATYPE_NULL) {
     return MPI_ERR_TYPE;
@@ -224,22 +229,27 @@ int PMPI_Type_create_hindexed_block(int count, int blocklength, MPI_Aint* indice
   }
 }
 
-int PMPI_Type_struct(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* new_type) {
+int PMPI_Type_struct(int count, const int* blocklens, const MPI_Aint* indices, const MPI_Datatype* old_types,
+                     MPI_Datatype* new_type)
+{
   if (count<0){
     return MPI_ERR_COUNT;
   } else {
+    for(int i=0; i<count; i++)
+      if(old_types[i]==MPI_DATATYPE_NULL)
+        return MPI_ERR_TYPE;
     return simgrid::smpi::Datatype::create_struct(count, blocklens, indices, old_types, new_type);
   }
 }
 
-int PMPI_Type_create_struct(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype* old_types,
+int PMPI_Type_create_struct(int count, const int* blocklens, const MPI_Aint* indices, const MPI_Datatype* old_types,
                             MPI_Datatype* new_type) {
   return PMPI_Type_struct(count, blocklens, indices, old_types, new_type);
 }
 
 
-int PMPI_Type_create_subarray(int ndims, int* array_of_sizes,
-                             int* array_of_subsizes, int* array_of_starts,
+int PMPI_Type_create_subarray(int ndims, const int* array_of_sizes,
+                             const int* array_of_subsizes, const int* array_of_starts,
                              int order, MPI_Datatype oldtype, MPI_Datatype *newtype) {
   if (ndims<0){
     return MPI_ERR_COUNT;
@@ -266,7 +276,7 @@ int PMPI_Type_create_resized(MPI_Datatype oldtype,MPI_Aint lb, MPI_Aint extent,
 }
 
 
-int PMPI_Type_set_name(MPI_Datatype  datatype, char * name)
+int PMPI_Type_set_name(MPI_Datatype  datatype, const char * name)
 {
   if (datatype == MPI_DATATYPE_NULL)  {
     return MPI_ERR_TYPE;
@@ -291,10 +301,14 @@ int PMPI_Type_get_name(MPI_Datatype  datatype, char * name, int* len)
 }
 
 MPI_Datatype PMPI_Type_f2c(MPI_Fint datatype){
+  if(datatype==-1)
+    return MPI_DATATYPE_NULL;
   return static_cast<MPI_Datatype>(simgrid::smpi::F2C::f2c(datatype));
 }
 
 MPI_Fint PMPI_Type_c2f(MPI_Datatype datatype){
+  if(datatype==MPI_DATATYPE_NULL)
+    return -1;
   return datatype->c2f();
 }
 
@@ -334,35 +348,43 @@ int PMPI_Type_free_keyval(int* keyval) {
   return simgrid::smpi::Keyval::keyval_free<simgrid::smpi::Datatype>(keyval);
 }
 
-int PMPI_Unpack(void* inbuf, int incount, int* position, void* outbuf, int outcount, MPI_Datatype type, MPI_Comm comm) {
-  if(incount<0 || outcount < 0 || inbuf==nullptr || outbuf==nullptr)
+int PMPI_Unpack(const void* inbuf, int incount, int* position, void* outbuf, int outcount, MPI_Datatype type, MPI_Comm comm) {
+  if(incount<0 || outcount < 0){
+    return MPI_ERR_COUNT;
+  } else if (inbuf==nullptr || outbuf==nullptr){
     return MPI_ERR_ARG;
-  if (not type->is_valid())
+  } else if (type == MPI_DATATYPE_NULL || not type->is_valid()){
     return MPI_ERR_TYPE;
-  if(comm==MPI_COMM_NULL)
+  } else if(comm==MPI_COMM_NULL){
     return MPI_ERR_COMM;
-  return type->unpack(inbuf, incount, position, outbuf,outcount, comm);
+  } else{
+    return type->unpack(inbuf, incount, position, outbuf,outcount, comm);
+  }
 }
 
-int PMPI_Pack(void* inbuf, int incount, MPI_Datatype type, void* outbuf, int outcount, int* position, MPI_Comm comm) {
-  if(incount<0 || outcount < 0|| inbuf==nullptr || outbuf==nullptr)
+int PMPI_Pack(const void* inbuf, int incount, MPI_Datatype type, void* outbuf, int outcount, int* position, MPI_Comm comm) {
+  if(incount<0){
+    return MPI_ERR_COUNT;
+  } else if(inbuf==nullptr || outbuf==nullptr || outcount < 0){
     return MPI_ERR_ARG;
-  if (not type->is_valid())
+  } else if (type == MPI_DATATYPE_NULL || not type->is_valid()){
     return MPI_ERR_TYPE;
-  if(comm==MPI_COMM_NULL)
+  } else if(comm==MPI_COMM_NULL){
     return MPI_ERR_COMM;
-  return type->pack(inbuf == MPI_BOTTOM ? nullptr : inbuf, incount, outbuf, outcount, position, comm);
+  } else {
+    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) {
-  if(incount<0)
-    return MPI_ERR_ARG;
-  if (not datatype->is_valid())
+  if(incount<0){
+    return MPI_ERR_COUNT;
+  } else if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid()){
     return MPI_ERR_TYPE;
-  if(comm==MPI_COMM_NULL)
+  } else if(comm==MPI_COMM_NULL){
     return MPI_ERR_COMM;
-
-  *size=incount*datatype->size();
-
-  return MPI_SUCCESS;
+  } else {
+    *size=incount*datatype->size();
+    return MPI_SUCCESS;
+  }
 }
index 455dbf5..32abd4e 100644 (file)
@@ -103,7 +103,7 @@ 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, const void* base)
 {
   int retval = 0;
   smpi_bench_end();
@@ -132,7 +132,7 @@ int PMPI_Win_free( MPI_Win* win){
   return retval;
 }
 
-int PMPI_Win_set_name(MPI_Win  win, char * name)
+int PMPI_Win_set_name(MPI_Win  win, const char * name)
 {
   if (win == MPI_WIN_NULL)  {
     return MPI_ERR_TYPE;
@@ -280,7 +280,7 @@ int PMPI_Rget( void *origin_addr, int origin_count, MPI_Datatype origin_datatype
   return retval;
 }
 
-int PMPI_Put( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
+int PMPI_Put(const 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){
   int retval = 0;
   smpi_bench_end();
@@ -320,7 +320,7 @@ int PMPI_Put( void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
   return retval;
 }
 
-int PMPI_Rput( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
+int PMPI_Rput(const 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){
   int retval = 0;
   smpi_bench_end();
@@ -363,7 +363,7 @@ int PMPI_Rput( void *origin_addr, int origin_count, MPI_Datatype origin_datatype
   return retval;
 }
 
-int PMPI_Accumulate( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
+int PMPI_Accumulate(const 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_Op op, MPI_Win win){
   int retval = 0;
   smpi_bench_end();
@@ -402,7 +402,7 @@ int PMPI_Accumulate( void *origin_addr, int origin_count, MPI_Datatype origin_da
   return retval;
 }
 
-int PMPI_Raccumulate( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
+int PMPI_Raccumulate(const 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_Op op, MPI_Win win, MPI_Request* request){
   int retval = 0;
   smpi_bench_end();
@@ -445,7 +445,7 @@ int PMPI_Raccumulate( void *origin_addr, int origin_count, MPI_Datatype origin_d
   return retval;
 }
 
-int PMPI_Get_accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, void *result_addr,
+int PMPI_Get_accumulate(const 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){
   int retval = 0;
@@ -489,7 +489,7 @@ MPI_Datatype target_datatype, MPI_Op op, MPI_Win win){
 }
 
 
-int PMPI_Rget_accumulate(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, void *result_addr,
+int PMPI_Rget_accumulate(const 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){
   int retval = 0;
@@ -535,11 +535,11 @@ MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request* request){
   return retval;
 }
 
-int PMPI_Fetch_and_op(void *origin_addr, void *result_addr, MPI_Datatype dtype, int target_rank, MPI_Aint target_disp, MPI_Op op, MPI_Win win){
+int PMPI_Fetch_and_op(const void *origin_addr, void *result_addr, MPI_Datatype dtype, int target_rank, MPI_Aint target_disp, MPI_Op op, MPI_Win win){
   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 PMPI_Compare_and_swap(const 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;
@@ -784,7 +784,7 @@ int PMPI_Win_shared_query (MPI_Win win, int rank, MPI_Aint* size, int* disp_unit
 int PMPI_Win_get_attr (MPI_Win win, int keyval, void *attribute_val, int* flag)
 {
   static MPI_Aint size;
-  static int disp_unit;
+  static MPI_Aint disp_unit;
   if (win==MPI_WIN_NULL)
     return MPI_ERR_TYPE;
   else{
@@ -800,7 +800,7 @@ int PMPI_Win_get_attr (MPI_Win win, int keyval, void *attribute_val, int* flag)
       return MPI_SUCCESS;
     case MPI_WIN_DISP_UNIT :
       disp_unit=win->disp_unit();
-      *static_cast<int**>(attribute_val)  = &disp_unit;
+      *static_cast<MPI_Aint**>(attribute_val)  = &disp_unit;
       *flag = 1;
       return MPI_SUCCESS;
     default:
@@ -839,9 +839,46 @@ int PMPI_Win_free_keyval(int* keyval) {
 }
 
 MPI_Win PMPI_Win_f2c(MPI_Fint win){
+  if(win==-1)
+    return MPI_WIN_NULL;
   return static_cast<MPI_Win>(simgrid::smpi::Win::f2c(win));
 }
 
 MPI_Fint PMPI_Win_c2f(MPI_Win win){
+  if(win==MPI_WIN_NULL)
+    return -1;
   return win->c2f();
 }
+
+int PMPI_Win_create_errhandler(MPI_Win_errhandler_function* function, MPI_Errhandler* errhandler){
+  *errhandler=new simgrid::smpi::Errhandler(function);
+  return MPI_SUCCESS;
+}
+
+int PMPI_Win_get_errhandler(MPI_Win win, MPI_Errhandler* errhandler){
+  if (win == nullptr) {
+    return MPI_ERR_WIN;
+  } else if (errhandler==nullptr){
+    return MPI_ERR_ARG;
+  }
+  *errhandler=win->errhandler();
+  return MPI_SUCCESS;
+}
+
+int PMPI_Win_set_errhandler(MPI_Win win, MPI_Errhandler errhandler){
+  if (win == nullptr) {
+    return MPI_ERR_WIN;
+  } else if (errhandler==nullptr){
+    return MPI_ERR_ARG;
+  }
+  win->set_errhandler(errhandler);
+  return MPI_SUCCESS;
+}
+
+int PMPI_Win_call_errhandler(MPI_Win win,int errorcode){
+  if (win == nullptr) {
+    return MPI_ERR_WIN;
+  }
+  win->errhandler()->call(win, errorcode);
+  return MPI_SUCCESS;
+}
index 2b49ff3..b6b06fc 100644 (file)
@@ -69,7 +69,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 static int is_2dmesh(int num, int *i, int *j)
 {
   int x, max = num / 2;
-  x = sqrt(num);
+  x = sqrt(double(num));
 
   while (x <= max) {
     if ((num % x) == 0) {
@@ -111,11 +111,10 @@ namespace smpi{
 
 
 int
-Coll_allgather_2dmesh::allgather(void *send_buff, int send_count, MPI_Datatype
+Coll_allgather_2dmesh::allgather(const void *send_buff, int send_count, MPI_Datatype
                                  send_type, void *recv_buff, int recv_count,
                                  MPI_Datatype recv_type, MPI_Comm comm)
 {
-  MPI_Request *req, *req_ptr;
   MPI_Aint extent;
 
   int i, src, dst, rank, num_procs;
@@ -131,7 +130,7 @@ Coll_allgather_2dmesh::allgather(void *send_buff, int send_count, MPI_Datatype
   block_size = extent * send_count;
 
   if (not is_2dmesh(num_procs, &X, &Y))
-    THROWF(arg_error,0, "allgather_2dmesh algorithm can't be used with this number of processes! ");
+    throw std::invalid_argument("allgather_2dmesh algorithm can't be used with this number of processes!");
 
   my_row_base = (rank / Y) * Y;
   my_col_base = rank % Y;
@@ -140,9 +139,8 @@ Coll_allgather_2dmesh::allgather(void *send_buff, int send_count, MPI_Datatype
   if (Y > X)
     num_reqs = Y;
 
-  req = (MPI_Request *) xbt_malloc(num_reqs * sizeof(MPI_Request));
-
-  req_ptr = req;
+  MPI_Request* req     = new MPI_Request[num_reqs];
+  MPI_Request* req_ptr = req;
 
   // do local allgather/local copy
   recv_offset = rank * block_size;
@@ -193,7 +191,7 @@ Coll_allgather_2dmesh::allgather(void *send_buff, int send_count, MPI_Datatype
 
   Request::waitall(X - 1, req, MPI_STATUSES_IGNORE);
 
-  free(req);
+  delete[] req;
 
   return MPI_SUCCESS;
 }
index e27aa4b..b189670 100644 (file)
@@ -96,12 +96,11 @@ namespace simgrid{
 namespace smpi{
 
 
-int Coll_allgather_3dmesh::allgather(void *send_buff, int send_count,
+int Coll_allgather_3dmesh::allgather(const void *send_buff, int send_count,
                                      MPI_Datatype send_type, void *recv_buff,
                                      int recv_count, MPI_Datatype recv_type,
                                      MPI_Comm comm)
 {
-  MPI_Request *req, *req_ptr;
   MPI_Aint extent;
 
   int i, src, dst, rank, num_procs, block_size, my_z_base;
@@ -114,8 +113,7 @@ int Coll_allgather_3dmesh::allgather(void *send_buff, int send_count,
   extent = send_type->get_extent();
 
   if (not is_3dmesh(num_procs, &X, &Y, &Z))
-    THROWF(arg_error,0, "allgather_3dmesh algorithm can't be used with this number of processes! ");
-
+    throw std::invalid_argument("allgather_3dmesh algorithm can't be used with this number of processes!");
 
   num_reqs = X;
 
@@ -133,9 +131,8 @@ int Coll_allgather_3dmesh::allgather(void *send_buff, int send_count,
 
   block_size = extent * send_count;
 
-  req = (MPI_Request *) xbt_malloc(num_reqs * sizeof(MPI_Request));
-
-  req_ptr = req;
+  MPI_Request* req     = new MPI_Request[num_reqs];
+  MPI_Request* req_ptr = req;
 
   // do local allgather/local copy
   recv_offset = rank * block_size;
@@ -206,7 +203,7 @@ int Coll_allgather_3dmesh::allgather(void *send_buff, int send_count,
   }
   Request::waitall(Z - 1, req, MPI_STATUSES_IGNORE);
 
-  free(req);
+  delete[] req;
 
   return MPI_SUCCESS;
 }
index ee859c6..26ded0b 100644 (file)
@@ -9,7 +9,7 @@
 namespace simgrid{
 namespace smpi{
 // Allgather - gather/bcast algorithm
-int Coll_allgather_GB::allgather(void *send_buff, int send_count,
+int Coll_allgather_GB::allgather(const void *send_buff, int send_count,
                                  MPI_Datatype send_type, void *recv_buff,
                                  int recv_count, MPI_Datatype recv_type,
                                  MPI_Comm comm)
index a636040..f05db0c 100644 (file)
@@ -12,7 +12,7 @@ namespace smpi{
 
 // Allgather-Non-Topoloty-Scecific-Logical-Ring algorithm
 int
-Coll_allgather_NTSLR_NB::allgather(void *sbuf, int scount, MPI_Datatype stype,
+Coll_allgather_NTSLR_NB::allgather(const void *sbuf, int scount, MPI_Datatype stype,
                                    void *rbuf, int rcount, MPI_Datatype rtype,
                                    MPI_Comm comm)
 {
@@ -26,10 +26,8 @@ Coll_allgather_NTSLR_NB::allgather(void *sbuf, int scount, MPI_Datatype stype,
   size = comm->size();
   rextent = rtype->get_extent();
   sextent = stype->get_extent();
-  MPI_Request *rrequest_array;
-  MPI_Request *srequest_array;
-  rrequest_array = (MPI_Request *) xbt_malloc(size * sizeof(MPI_Request));
-  srequest_array = (MPI_Request *) xbt_malloc(size * sizeof(MPI_Request));
+  MPI_Request* rrequest_array = new MPI_Request[size];
+  MPI_Request* srequest_array = new MPI_Request[size];
 
   // irregular case use default MPI fucntions
   if (scount * sextent != rcount * rextent) {
@@ -66,8 +64,8 @@ Coll_allgather_NTSLR_NB::allgather(void *sbuf, int scount, MPI_Datatype stype,
     Request::wait(&srequest_array[i], &status2);
   }
 
-  free(rrequest_array);
-  free(srequest_array);
+  delete[] rrequest_array;
+  delete[] srequest_array;
 
   return MPI_SUCCESS;
 }
index 27c5b70..3aa5365 100644 (file)
@@ -13,7 +13,7 @@ namespace smpi{
 
 // Allgather-Non-Topoloty-Scecific-Logical-Ring algorithm
 int
-Coll_allgather_NTSLR::allgather(void *sbuf, int scount, MPI_Datatype stype,
+Coll_allgather_NTSLR::allgather(const void *sbuf, int scount, MPI_Datatype stype,
                                 void *rbuf, int rcount, MPI_Datatype rtype,
                                 MPI_Comm comm)
 {
index bce3f6e..cb1acff 100644 (file)
@@ -10,7 +10,7 @@ namespace simgrid{
 namespace smpi{
 
 
-int Coll_allgather_SMP_NTS::allgather(void *sbuf, int scount,
+int Coll_allgather_SMP_NTS::allgather(const void *sbuf, int scount,
                                       MPI_Datatype stype, void *rbuf,
                                       int rcount, MPI_Datatype rtype,
                                       MPI_Comm comm)
@@ -41,7 +41,8 @@ int Coll_allgather_SMP_NTS::allgather(void *sbuf, int scount,
   int num_core_in_current_smp = num_core;
 
   if(comm_size%num_core)
-    THROWF(arg_error,0, "allgather SMP NTS algorithm can't be used with non multiple of NUM_CORE=%d number of processes ! ", num_core);
+    throw std::invalid_argument(xbt::string_printf(
+        "allgather SMP NTS algorithm can't be used with non multiple of NUM_CORE=%d number of processes!", num_core));
 
   /* for too small number of processes, use default implementation */
   if (comm_size <= num_core) {
@@ -84,8 +85,8 @@ int Coll_allgather_SMP_NTS::allgather(void *sbuf, int scount,
 
   // root of each SMP
   if (intra_rank == 0) {
-    MPI_Request *rrequest_array = xbt_new(MPI_Request, inter_comm_size - 1);
-    MPI_Request *srequest_array = xbt_new(MPI_Request, inter_comm_size - 1);
+    MPI_Request* rrequest_array = new MPI_Request[inter_comm_size - 1];
+    MPI_Request* srequest_array = new MPI_Request[inter_comm_size - 1];
 
     src = ((inter_rank - 1 + inter_comm_size) % inter_comm_size) * num_core;
     dst = ((inter_rank + 1) % inter_comm_size) * num_core;
@@ -133,8 +134,8 @@ int Coll_allgather_SMP_NTS::allgather(void *sbuf, int scount,
     }
 
     Request::waitall(inter_comm_size - 1, srequest_array, MPI_STATUSES_IGNORE);
-    xbt_free(rrequest_array);
-    xbt_free(srequest_array);
+    delete[] rrequest_array;
+    delete[] srequest_array;
   }
   // last rank of each SMP
   else if (intra_rank == (num_core_in_current_smp - 1)) {
index 44578b2..0aa067c 100644 (file)
@@ -73,7 +73,7 @@ namespace smpi{
 
 
 
-int Coll_allgather_bruck::allgather(void *send_buff, int send_count,
+int Coll_allgather_bruck::allgather(const void *send_buff, int send_count,
                                     MPI_Datatype send_type, void *recv_buff,
                                     int recv_count, MPI_Datatype recv_type,
                                     MPI_Comm comm)
@@ -88,7 +88,6 @@ int Coll_allgather_bruck::allgather(void *send_buff, int send_count,
   int pof2 = 1;
 
   // local string variables
-  char *tmp_buff;
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
 
@@ -101,7 +100,7 @@ int Coll_allgather_bruck::allgather(void *send_buff, int send_count,
 
   count = recv_count;
 
-  tmp_buff = (char *) smpi_get_tmp_sendbuffer(num_procs * recv_count * recv_extent);
+  unsigned char* tmp_buff = smpi_get_tmp_sendbuffer(num_procs * recv_count * recv_extent);
 
   // perform a local copy
   Datatype::copy(send_ptr, send_count, send_type, tmp_buff, recv_count, recv_type);
index 575356a..5596db8 100644 (file)
@@ -10,7 +10,7 @@ namespace simgrid{
 namespace smpi{
 
 
-int Coll_allgather_loosely_lr::allgather(void *sbuf, int scount,
+int Coll_allgather_loosely_lr::allgather(const void *sbuf, int scount,
                                          MPI_Datatype stype, void *rbuf,
                                          int rcount, MPI_Datatype rtype,
                                          MPI_Comm comm)
@@ -32,7 +32,9 @@ if(comm->get_leaders_comm()==MPI_COMM_NULL){
   }
 
   if(comm_size%num_core)
-    THROWF(arg_error,0, "allgather loosely lr algorithm can't be used with non multiple of NUM_CORE=%d number of processes ! ",num_core);
+    throw std::invalid_argument(xbt::string_printf(
+        "allgather loosely lr algorithm can't be used with non multiple of NUM_CORE=%d number of processes!",
+        num_core));
 
   rank = comm->rank();
   MPI_Aint rextent, sextent;
index 0d641c6..1a73c48 100644 (file)
@@ -38,7 +38,7 @@
 namespace simgrid{
 namespace smpi{
 
-int Coll_allgather_mvapich2_smp::allgather(void *sendbuf,int sendcnt, MPI_Datatype sendtype,
+int Coll_allgather_mvapich2_smp::allgather(const void *sendbuf,int sendcnt, MPI_Datatype sendtype,
                             void *recvbuf, int recvcnt,MPI_Datatype recvtype,
                             MPI_Comm  comm)
 {
@@ -54,10 +54,12 @@ int Coll_allgather_mvapich2_smp::allgather(void *sendbuf,int sendcnt, MPI_Dataty
   }
 
   if (not comm->is_uniform() || not comm->is_blocked())
-    THROWF(arg_error,0, "allgather MVAPICH2 smp algorithm can't be used with irregular deployment. Please insure that processes deployed on the same node are contiguous and that each node has the same number of processes");
+    throw std::invalid_argument("allgather MVAPICH2 smp algorithm can't be used with irregular deployment. Please "
+                                "insure that processes deployed on the same node are contiguous and that each node has "
+                                "the same number of processes");
 
-    if (recvcnt == 0) {
-        return MPI_SUCCESS;
+  if (recvcnt == 0) {
+    return MPI_SUCCESS;
     }
 
     rank = comm->rank();
@@ -105,18 +107,13 @@ int Coll_allgather_mvapich2_smp::allgather(void *sendbuf,int sendcnt, MPI_Dataty
         /*When data in each socket is different*/
         if (comm->is_uniform() != 1) {
 
-            int *displs = NULL;
-            int *recvcnts = NULL;
             int *node_sizes = NULL;
             int i = 0;
 
             node_sizes = comm->get_non_uniform_map();
 
-            displs =  static_cast<int *>(xbt_malloc(sizeof (int) * leader_comm_size));
-            recvcnts =  static_cast<int *>(xbt_malloc(sizeof (int) * leader_comm_size));
-            if (not displs || not recvcnts) {
-              return MPI_ERR_OTHER;
-            }
+            int* displs   = new int[leader_comm_size];
+            int* recvcnts = new int[leader_comm_size];
             recvcnts[0] = node_sizes[0] * recvcnt;
             displs[0] = 0;
 
@@ -134,8 +131,8 @@ int Coll_allgather_mvapich2_smp::allgather(void *sendbuf,int sendcnt, MPI_Dataty
                                        recvbuf, recvcnts,
                                        displs, recvtype,
                                        leader_comm);
-            xbt_free(displs);
-            xbt_free(recvcnts);
+            delete[] displs;
+            delete[] recvcnts;
         } else {
         void* sendtmpbuf=((char*)recvbuf)+recvtype->get_extent()*(recvcnt*local_size)*leader_comm->rank();
 
index f9bc2b9..0b0a0b2 100644 (file)
@@ -68,7 +68,7 @@ namespace simgrid{
 namespace smpi{
 
 int
-Coll_allgather_ompi_neighborexchange::allgather(void *sbuf, int scount,
+Coll_allgather_ompi_neighborexchange::allgather(const void *sbuf, int scount,
                                                  MPI_Datatype sdtype,
                                                  void* rbuf, int rcount,
                                                  MPI_Datatype rdtype,
index 51c0364..5794d95 100644 (file)
@@ -70,7 +70,7 @@ namespace smpi{
 
 
 int
-Coll_allgather_pair::allgather(void *send_buff, int send_count,
+Coll_allgather_pair::allgather(const void *send_buff, int send_count,
                                MPI_Datatype send_type, void *recv_buff,
                                int recv_count, MPI_Datatype recv_type,
                                MPI_Comm comm)
@@ -88,7 +88,7 @@ Coll_allgather_pair::allgather(void *send_buff, int send_count,
   unsigned int num_procs = comm->size();
 
   if((num_procs&(num_procs-1)))
-    THROWF(arg_error,0, "allgather pair algorithm can't be used with non power of two number of processes ! ");
+    throw std::invalid_argument("allgather pair algorithm can't be used with non power of two number of processes!");
 
   extent = send_type->get_extent();
 
index e580aca..5811d72 100644 (file)
@@ -10,7 +10,7 @@ namespace simgrid{
 namespace smpi{
 
 int
-Coll_allgather_rdb::allgather(void *sbuf, int send_count,
+Coll_allgather_rdb::allgather(const void *sbuf, int send_count,
                               MPI_Datatype send_type, void *rbuf,
                               int recv_count, MPI_Datatype recv_type,
                               MPI_Comm comm)
index e4b504e..9673350 100644 (file)
@@ -13,7 +13,7 @@ namespace smpi{
 // now only work with power of two processes
 
 int
-Coll_allgather_rhv::allgather(void *sbuf, int send_count,
+Coll_allgather_rhv::allgather(const void *sbuf, int send_count,
                               MPI_Datatype send_type, void *rbuf,
                               int recv_count, MPI_Datatype recv_type,
                               MPI_Comm comm)
@@ -32,7 +32,7 @@ Coll_allgather_rhv::allgather(void *sbuf, int send_count,
   unsigned int num_procs = comm->size();
 
   if((num_procs&(num_procs-1)))
-    THROWF(arg_error,0, "allgather rhv algorithm can't be used with non power of two number of processes ! ");
+    throw std::invalid_argument("allgather rhv algorithm can't be used with non power of two number of processes!");
 
   unsigned int rank = comm->rank();
 
index f6537a5..26e369d 100644 (file)
@@ -69,7 +69,7 @@ namespace smpi{
 
 
 int
-Coll_allgather_ring::allgather(void *send_buff, int send_count,
+Coll_allgather_ring::allgather(const void *send_buff, int send_count,
                                MPI_Datatype send_type, void *recv_buff,
                                int recv_count, MPI_Datatype recv_type,
                                MPI_Comm comm)
index b559ba4..c11d643 100644 (file)
@@ -10,7 +10,7 @@ namespace simgrid{
 namespace smpi{
 
 
-int Coll_allgather_smp_simple::allgather(void *send_buf, int scount,
+int Coll_allgather_smp_simple::allgather(const void *send_buf, int scount,
                                          MPI_Datatype stype, void *recv_buf,
                                          int rcount, MPI_Datatype rtype,
                                          MPI_Comm comm)
@@ -27,7 +27,9 @@ int Coll_allgather_smp_simple::allgather(void *send_buf, int scount,
   }
 
   if(comm_size%num_core)
-     THROWF(arg_error,0, "allgather SMP simple algorithm can't be used with non multiple of NUM_CORE=%d number of processes ! ", num_core);
+    throw std::invalid_argument(xbt::string_printf(
+        "allgather SMP simple algorithm can't be used with non multiple of NUM_CORE=%d number of processes!",
+        num_core));
 
   rank = comm->rank();
   MPI_Aint rextent, sextent;
@@ -73,12 +75,10 @@ int Coll_allgather_smp_simple::allgather(void *send_buf, int scount,
 
 
   if (intra_rank == 0) {
-    MPI_Request *reqs, *req_ptr;
     int num_req = (inter_comm_size - 1) * 2;
-    reqs = (MPI_Request *) xbt_malloc(num_req * sizeof(MPI_Request));
-    req_ptr = reqs;
-    MPI_Status *stat;
-    stat = (MPI_Status *) xbt_malloc(num_req * sizeof(MPI_Status));
+    MPI_Request* reqs    = new MPI_Request[num_req];
+    MPI_Request* req_ptr = reqs;
+    MPI_Status* stat     = new MPI_Status[num_req];
 
     for (i = 1; i < inter_comm_size; i++) {
 
@@ -105,9 +105,8 @@ int Coll_allgather_smp_simple::allgather(void *send_buf, int scount,
       //MPIC_Irecv((recv_buf+recv_offset), (rcount * num_core), rtype, src, tag, comm, req_ptr++);
     }
     Request::waitall(num_req, reqs, stat);
-    free(reqs);
-    free(stat);
-
+    delete[] reqs;
+    delete[] stat;
   }
   //INTRA-BCAST (use flat tree)
 
index e500907..a1f55ca 100644 (file)
@@ -72,13 +72,12 @@ namespace smpi{
 
 
 int
-Coll_allgather_spreading_simple::allgather(void *send_buff, int send_count,
+Coll_allgather_spreading_simple::allgather(const void *send_buff, int send_count,
                                            MPI_Datatype send_type,
                                            void *recv_buff, int recv_count,
                                            MPI_Datatype recv_type,
                                            MPI_Comm comm)
 {
-  MPI_Request *reqs, *req_ptr;
   MPI_Aint extent;
   int i, src, dst, rank, num_procs, num_reqs;
   int tag = COLL_TAG_ALLGATHER;
@@ -90,14 +89,8 @@ Coll_allgather_spreading_simple::allgather(void *send_buff, int send_count,
   extent = send_type->get_extent();
 
   num_reqs = (2 * num_procs) - 2;
-  reqs = (MPI_Request *) xbt_malloc(num_reqs * sizeof(MPI_Request));
-  if (not reqs) {
-    printf("allgather-spreading-simple.c:40: cannot allocate memory\n");
-    MPI_Finalize();
-    exit(0);
-  }
-
-  req_ptr = reqs;
+  MPI_Request* reqs    = new MPI_Request[num_reqs];
+  MPI_Request* req_ptr = reqs;
   Request::sendrecv(send_buff, send_count, send_type, rank, tag,
                (char *) recv_buff + rank * recv_count * extent, recv_count,
                recv_type, rank, tag, comm, &status);
@@ -118,7 +111,7 @@ Coll_allgather_spreading_simple::allgather(void *send_buff, int send_count,
   }
 
   Request::waitall(num_reqs, reqs, MPI_STATUSES_IGNORE);
-  free(reqs);
+  delete[] reqs;
 
   return MPI_SUCCESS;
 }
index 39b4406..d3de949 100644 (file)
@@ -10,9 +10,9 @@ namespace simgrid{
 namespace smpi{
 
 // Allgather - gather/bcast algorithm
-int Coll_allgatherv_GB::allgatherv(void *send_buff, int send_count,
+int Coll_allgatherv_GB::allgatherv(const void *send_buff, int send_count,
                                  MPI_Datatype send_type, void *recv_buff,
-                                 int *recv_counts, int *recv_disps, MPI_Datatype recv_type,
+                                 const int *recv_counts, const int *recv_disps, MPI_Datatype recv_type,
                                  MPI_Comm comm)
 {
   Colls::gatherv(send_buff, send_count, send_type, recv_buff, recv_counts, recv_disps, recv_type, 0, comm);
index df72733..1434b0e 100644 (file)
@@ -14,12 +14,12 @@ namespace simgrid{
 namespace smpi{
 
 int Coll_allgatherv_mpich_rdb::allgatherv (
-  void *sendbuf,
+  const void *sendbuf,
   int sendcount,
   MPI_Datatype sendtype,
   void *recvbuf,
-  int *recvcounts,
-  int *displs,
+  const int *recvcounts,
+  const int *displs,
   MPI_Datatype recvtype,
   MPI_Comm comm)
 {
@@ -27,7 +27,6 @@ int Coll_allgatherv_mpich_rdb::allgatherv (
   MPI_Status status;
   MPI_Aint  recvtype_extent, recvtype_true_extent, recvtype_true_lb;
   unsigned int curr_cnt, dst, total_count;
-  void *tmp_buf, *tmp_buf_rl;
   unsigned int mask, dst_tree_root, my_tree_root, position,
     send_offset, recv_offset, last_recv_cnt=0, nprocs_completed, k,
     offset, tmp_mask, tree_root;
@@ -49,10 +48,10 @@ int Coll_allgatherv_mpich_rdb::allgatherv (
 
   recvtype->extent(&recvtype_true_lb, &recvtype_true_extent);
 
-  tmp_buf_rl = (void*)smpi_get_tmp_sendbuffer(total_count * std::max(recvtype_true_extent, recvtype_extent));
+  unsigned char* tmp_buf_rl = 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);
+  unsigned char* tmp_buf = tmp_buf_rl - recvtype_true_lb;
 
   /* copy local data into right location in tmp_buf */
   position = 0;
@@ -60,20 +59,13 @@ int Coll_allgatherv_mpich_rdb::allgatherv (
     position += recvcounts[i];
   if (sendbuf != MPI_IN_PLACE)
   {
-    Datatype::copy(sendbuf, sendcount, sendtype,
-                       ((char *)tmp_buf + position*
-                        recvtype_extent),
-                       recvcounts[rank], recvtype);
+    Datatype::copy(sendbuf, sendcount, sendtype, tmp_buf + position * recvtype_extent, recvcounts[rank], recvtype);
   }
   else
   {
     /* if in_place specified, local data is found in recvbuf */
-    Datatype::copy(((char *)recvbuf +
-                        displs[rank]*recvtype_extent),
-                       recvcounts[rank], recvtype,
-                       ((char *)tmp_buf + position*
-                        recvtype_extent),
-                       recvcounts[rank], recvtype);
+    Datatype::copy(static_cast<char*>(recvbuf) + displs[rank] * recvtype_extent, recvcounts[rank], recvtype,
+                   tmp_buf + position * recvtype_extent, recvcounts[rank], recvtype);
   }
   curr_cnt = recvcounts[rank];
 
@@ -102,13 +94,9 @@ int Coll_allgatherv_mpich_rdb::allgatherv (
       for (j=0; j<dst_tree_root; j++)
         recv_offset += recvcounts[j];
 
-      Request::sendrecv(((char *)tmp_buf + send_offset * recvtype_extent),
-                        curr_cnt, recvtype, dst,
-                        COLL_TAG_ALLGATHERV,
-                        ((char *)tmp_buf + recv_offset * recvtype_extent),
-                        total_count - recv_offset, recvtype, dst,
-                        COLL_TAG_ALLGATHERV,
-                        comm, &status);
+      Request::sendrecv(tmp_buf + send_offset * recvtype_extent, curr_cnt, recvtype, dst, COLL_TAG_ALLGATHERV,
+                        tmp_buf + recv_offset * recvtype_extent, total_count - recv_offset, recvtype, dst,
+                        COLL_TAG_ALLGATHERV, comm, &status);
       /* for convenience, recv is posted for a bigger amount
          than will be sent */
       last_recv_cnt=Status::get_count(&status, recvtype);
@@ -166,10 +154,7 @@ int Coll_allgatherv_mpich_rdb::allgatherv (
             offset += recvcounts[j];
           offset *= recvtype_extent;
 
-          Request::send(((char *)tmp_buf + offset),
-                        last_recv_cnt,
-                        recvtype, dst,
-                        COLL_TAG_ALLGATHERV, comm);
+          Request::send(tmp_buf + offset, last_recv_cnt, recvtype, dst, COLL_TAG_ALLGATHERV, comm);
           /* last_recv_cnt was set in the previous
              receive. that's the amount of data to be
              sent now. */
@@ -184,9 +169,7 @@ int Coll_allgatherv_mpich_rdb::allgatherv (
           for (j=0; j<(my_tree_root+mask); j++)
             offset += recvcounts[j];
 
-          Request::recv(((char *)tmp_buf + offset * recvtype_extent),
-                        total_count - offset, recvtype,
-                        dst, COLL_TAG_ALLGATHERV,
+          Request::recv(tmp_buf + offset * recvtype_extent, total_count - offset, recvtype, dst, COLL_TAG_ALLGATHERV,
                         comm, &status);
           /* for convenience, recv is posted for a
              bigger amount than will be sent */
@@ -209,10 +192,8 @@ int Coll_allgatherv_mpich_rdb::allgatherv (
     if ((sendbuf != MPI_IN_PLACE) || (j != rank)) {
       /* not necessary to copy if in_place and
          j==rank. otherwise copy. */
-      Datatype::copy(((char *)tmp_buf + position*recvtype_extent),
-                         recvcounts[j], recvtype,
-                         ((char *)recvbuf + displs[j]*recvtype_extent),
-                         recvcounts[j], recvtype);
+      Datatype::copy(tmp_buf + position * recvtype_extent, recvcounts[j], recvtype,
+                     static_cast<char*>(recvbuf) + displs[j] * recvtype_extent, recvcounts[j], recvtype);
     }
     position += recvcounts[j];
   }
index c0d9dc9..155b24f 100644 (file)
@@ -29,9 +29,9 @@ namespace simgrid{
 namespace smpi{
 
 int
-Coll_allgatherv_mpich_ring::allgatherv(void *sendbuf, int sendcount,
+Coll_allgatherv_mpich_ring::allgatherv(const void *sendbuf, int sendcount,
     MPI_Datatype send_type, void *recvbuf,
-    int *recvcounts, int *displs, MPI_Datatype recvtype,
+    const int *recvcounts, const int *displs, MPI_Datatype recvtype,
     MPI_Comm comm)
 {
 
index b4c2b03..91d9977 100644 (file)
 namespace simgrid{
 namespace smpi{
 
-int Coll_allgatherv_ompi_bruck::allgatherv(void *sbuf, int scount,
+int Coll_allgatherv_ompi_bruck::allgatherv(const void *sbuf, int scount,
                                            MPI_Datatype sdtype,
-                                           void *rbuf, int *rcounts,
-                                           int *rdispls,
+                                           void *rbuf, const int *rcounts,
+                                           const int *rdispls,
                                            MPI_Datatype rdtype,
                                            MPI_Comm comm)
 {
index bdeacab..74542de 100644 (file)
@@ -69,9 +69,9 @@ namespace simgrid{
 namespace smpi{
 
 int
-Coll_allgatherv_ompi_neighborexchange::allgatherv(void *sbuf, int scount,
+Coll_allgatherv_ompi_neighborexchange::allgatherv(const void *sbuf, int scount,
                                                   MPI_Datatype sdtype,
-                                                  void* rbuf, int *rcounts, int *rdispls,
+                                                  void* rbuf, const int *rcounts, const int *rdispls,
                                                   MPI_Datatype rdtype,
                                                   MPI_Comm comm)
 {
index ae5fbde..1e490a8 100644 (file)
@@ -69,9 +69,9 @@ namespace simgrid{
 namespace smpi{
 
 int
-Coll_allgatherv_pair::allgatherv(void *send_buff, int send_count,
+Coll_allgatherv_pair::allgatherv(const void *send_buff, int send_count,
                                MPI_Datatype send_type, void *recv_buff,
-                               int *recv_counts, int *recv_disps, MPI_Datatype recv_type,
+                               const int *recv_counts, const int *recv_disps, MPI_Datatype recv_type,
                                MPI_Comm comm)
 {
 
@@ -87,7 +87,7 @@ Coll_allgatherv_pair::allgatherv(void *send_buff, int send_count,
   unsigned int num_procs = comm->size();
 
   if((num_procs&(num_procs-1)))
-    THROWF(arg_error,0, "allgatherv pair algorithm can't be used with non power of two number of processes ! ");
+    throw std::invalid_argument("allgatherv pair algorithm can't be used with non power of two number of processes!");
 
   extent = send_type->get_extent();
 
index 8d0a65d..b092435 100644 (file)
@@ -68,9 +68,9 @@ namespace simgrid{
 namespace smpi{
 
 int
-Coll_allgatherv_ring::allgatherv(void *send_buff, int send_count,
+Coll_allgatherv_ring::allgatherv(const void *send_buff, int send_count,
                                MPI_Datatype send_type, void *recv_buff,
-                               int *recv_counts, int *recv_disps, MPI_Datatype recv_type,
+                               const int *recv_counts, const int *recv_disps, MPI_Datatype recv_type,
                                MPI_Comm comm)
 {
 
index 9d92883..380e093 100644 (file)
@@ -21,7 +21,7 @@
 namespace simgrid{
 namespace smpi{
 int
-Coll_allreduce_lr::allreduce(void *sbuf, void *rbuf, int rcount,
+Coll_allreduce_lr::allreduce(const void *sbuf, void *rbuf, int rcount,
                              MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
 {
   int tag = COLL_TAG_ALLREDUCE;
index 669c347..4fc72fe 100644 (file)
@@ -26,7 +26,7 @@
 
 namespace simgrid{
 namespace smpi{
-int Coll_allreduce_mvapich2_rs::allreduce(void *sendbuf,
+int Coll_allreduce_mvapich2_rs::allreduce(const void *sendbuf,
                             void *recvbuf,
                             int count,
                             MPI_Datatype datatype,
@@ -35,10 +35,8 @@ int Coll_allreduce_mvapich2_rs::allreduce(void *sendbuf,
     int mpi_errno = MPI_SUCCESS;
     int newrank = 0;
     int mask, pof2, i, send_idx, recv_idx, last_idx, send_cnt;
-    int dst, is_commutative, rem, newdst,
-        recv_cnt, *cnts, *disps;
+    int dst, is_commutative, rem, newdst, recv_cnt;
     MPI_Aint true_lb, true_extent, extent;
-    void *tmp_buf, *tmp_buf_free;
 
     if (count == 0) {
         return MPI_SUCCESS;
@@ -55,10 +53,10 @@ 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 * std::max(extent, true_extent));
+    unsigned char* 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);
+    unsigned char* tmp_buf = tmp_buf_free - true_lb;
 
     /* copy local data into recvbuf */
     if (sendbuf != MPI_IN_PLACE) {
@@ -152,8 +150,8 @@ int Coll_allreduce_mvapich2_rs::allreduce(void *sendbuf,
             /* for the reduce-scatter, calculate the count that
                each process receives and the displacement within
                the buffer */
-            cnts = (int *)xbt_malloc(pof2 * sizeof (int));
-            disps = (int *)xbt_malloc(pof2 * sizeof (int));
+            int* cnts  = new int[pof2];
+            int* disps = new int[pof2];
 
             for (i = 0; i < (pof2 - 1); i++) {
                 cnts[i] = count / pof2;
@@ -189,15 +187,9 @@ int Coll_allreduce_mvapich2_rs::allreduce(void *sendbuf,
                 }
 
                 /* Send data from recvbuf. Recv into tmp_buf */
-                Request::sendrecv((char *) recvbuf +
-                                             disps[send_idx] * extent,
-                                             send_cnt, datatype,
-                                             dst, COLL_TAG_ALLREDUCE,
-                                             (char *) tmp_buf +
-                                             disps[recv_idx] * extent,
-                                             recv_cnt, datatype, dst,
-                                             COLL_TAG_ALLREDUCE, comm,
-                                             MPI_STATUS_IGNORE);
+                Request::sendrecv(static_cast<char*>(recvbuf) + disps[send_idx] * extent, send_cnt, datatype, dst,
+                                  COLL_TAG_ALLREDUCE, tmp_buf + disps[recv_idx] * extent, recv_cnt, datatype, dst,
+                                  COLL_TAG_ALLREDUCE, comm, MPI_STATUS_IGNORE);
 
                 /* tmp_buf contains data received in this step.
                    recvbuf contains data accumulated so far */
@@ -205,9 +197,9 @@ int Coll_allreduce_mvapich2_rs::allreduce(void *sendbuf,
                 /* This algorithm is used only for predefined ops
                    and predefined ops are always commutative. */
 
-                if(op!=MPI_OP_NULL) op->apply( (char *) tmp_buf + disps[recv_idx] * extent,
-                        (char *) recvbuf + disps[recv_idx] * extent,
-                        &recv_cnt, datatype);
+                if (op != MPI_OP_NULL)
+                  op->apply(tmp_buf + disps[recv_idx] * extent, static_cast<char*>(recvbuf) + disps[recv_idx] * extent,
+                            &recv_cnt, datatype);
 
                 /* update send_idx for next iteration */
                 send_idx = recv_idx;
@@ -267,8 +259,8 @@ int Coll_allreduce_mvapich2_rs::allreduce(void *sendbuf,
 
                 mask >>= 1;
             }
-            xbt_free(disps);
-            xbt_free(cnts);
+            delete[] disps;
+            delete[] cnts;
         }
     }
 
index 4c206c4..3250168 100644 (file)
 #define MPIR_Allreduce_pt2pt_rd_MV2 Coll_allreduce_rdb::allreduce
 #define MPIR_Allreduce_pt2pt_rs_MV2 Coll_allreduce_mvapich2_rs::allreduce
 
-extern int (*MV2_Allreducection)(void *sendbuf,
+extern int (*MV2_Allreducection)(const void *sendbuf,
     void *recvbuf,
     int count,
     MPI_Datatype datatype,
     MPI_Op op, MPI_Comm comm);
 
 
-extern int (*MV2_Allreduce_intra_function)( void *sendbuf,
+extern int (*MV2_Allreduce_intra_function)(const void *sendbuf,
     void *recvbuf,
     int count,
     MPI_Datatype datatype,
@@ -56,7 +56,7 @@ extern int (*MV2_Allreduce_intra_function)( void *sendbuf,
 
 namespace simgrid{
 namespace smpi{
-static  int MPIR_Allreduce_reduce_p2p_MV2( void *sendbuf,
+static  int MPIR_Allreduce_reduce_p2p_MV2(const void *sendbuf,
     void *recvbuf,
     int count,
     MPI_Datatype datatype,
@@ -66,7 +66,7 @@ static  int MPIR_Allreduce_reduce_p2p_MV2( void *sendbuf,
   return MPI_SUCCESS;
 }
 
-static  int MPIR_Allreduce_reduce_shmem_MV2( void *sendbuf,
+static  int MPIR_Allreduce_reduce_shmem_MV2(const void *sendbuf,
     void *recvbuf,
     int count,
     MPI_Datatype datatype,
@@ -78,7 +78,7 @@ static  int MPIR_Allreduce_reduce_shmem_MV2( void *sendbuf,
 
 
 /* general two level allreduce helper function */
-int Coll_allreduce_mvapich2_two_level::allreduce(void *sendbuf,
+int Coll_allreduce_mvapich2_two_level::allreduce(const void *sendbuf,
                              void *recvbuf,
                              int count,
                              MPI_Datatype datatype,
@@ -135,7 +135,7 @@ int Coll_allreduce_mvapich2_two_level::allreduce(void *sendbuf,
         }
 
         if (local_size != total_size) {
-          void* sendtmpbuf = (char *)smpi_get_tmp_sendbuffer(count*datatype->get_extent());
+          unsigned char* sendtmpbuf = smpi_get_tmp_sendbuffer(count * datatype->get_extent());
           Datatype::copy(recvbuf, count, datatype,sendtmpbuf, count, datatype);
             /* inter-node allreduce */
             if(MV2_Allreducection == &MPIR_Allreduce_pt2pt_rd_MV2){
index cea8087..946a409 100644 (file)
 namespace simgrid{
 namespace smpi{
 int
-Coll_allreduce_ompi_ring_segmented::allreduce(void *sbuf, void *rbuf, int count,
+Coll_allreduce_ompi_ring_segmented::allreduce(const void *sbuf, void *rbuf, int count,
                                                MPI_Datatype dtype,
                                                MPI_Op op,
                                                MPI_Comm comm)
@@ -173,7 +173,7 @@ Coll_allreduce_ompi_ring_segmented::allreduce(void *sbuf, void *rbuf, int count,
    unsigned int inbi;
    size_t typelng;
    char *tmpsend = NULL, *tmprecv = NULL;
-   char *inbuf[2] = {NULL, NULL};
+   unsigned char* inbuf[2] = {nullptr, nullptr};
    ptrdiff_t true_extent, extent;
    ptrdiff_t block_offset, max_real_segsize;
    MPI_Request reqs[2] = {NULL, NULL};
@@ -232,11 +232,15 @@ Coll_allreduce_ompi_ring_segmented::allreduce(void *sbuf, void *rbuf, int count,
    max_real_segsize = true_extent + (max_segcount - 1) * extent;
 
    /* Allocate and initialize temporary buffers */
-   inbuf[0] = (char*)smpi_get_tmp_sendbuffer(max_real_segsize);
+   inbuf[0] = smpi_get_tmp_sendbuffer(max_real_segsize);
    if (NULL == inbuf[0]) { ret = -1; line = __LINE__; goto error_hndl; }
    if (size > 2) {
-      inbuf[1] = (char*)smpi_get_tmp_recvbuffer(max_real_segsize);
-      if (NULL == inbuf[1]) { ret = -1; line = __LINE__; goto error_hndl; }
+     inbuf[1] = smpi_get_tmp_recvbuffer(max_real_segsize);
+     if (nullptr == inbuf[1]) {
+       ret  = -1;
+       line = __LINE__;
+       goto error_hndl;
+     }
    }
 
    /* Handle MPI_IN_PLACE */
@@ -378,16 +382,16 @@ Coll_allreduce_ompi_ring_segmented::allreduce(void *sbuf, void *rbuf, int count,
 
    }
 
-   if (NULL != inbuf[0]) smpi_free_tmp_buffer(inbuf[0]);
-   if (NULL != inbuf[1]) smpi_free_tmp_buffer(inbuf[1]);
+   smpi_free_tmp_buffer(inbuf[0]);
+   smpi_free_tmp_buffer(inbuf[1]);
 
    return MPI_SUCCESS;
 
  error_hndl:
    XBT_DEBUG("%s:%4d\tRank %d Error occurred %d\n",
                 __FILE__, line, rank, ret);
-   if (NULL != inbuf[0]) smpi_free_tmp_buffer(inbuf[0]);
-   if (NULL != inbuf[1]) smpi_free_tmp_buffer(inbuf[1]);
+   smpi_free_tmp_buffer(inbuf[0]);
+   smpi_free_tmp_buffer(inbuf[1]);
    return ret;
 }
 }
index 60f093f..48b583c 100644 (file)
@@ -7,23 +7,21 @@
 #include "../colls_private.hpp"
 namespace simgrid{
 namespace smpi{
-int Coll_allreduce_rab_rdb::allreduce(void *sbuff, void *rbuff, int count,
+int Coll_allreduce_rab_rdb::allreduce(const void *sbuff, void *rbuff, int count,
                                       MPI_Datatype dtype, MPI_Op op,
                                       MPI_Comm comm)
 {
   int tag = COLL_TAG_ALLREDUCE;
   unsigned int mask, pof2, i, recv_idx, last_idx, send_idx, send_cnt;
-  int dst, newrank, rem, newdst,
-      recv_cnt, *cnts, *disps;
+  int dst, newrank, rem, newdst, recv_cnt;
   MPI_Aint extent;
   MPI_Status status;
-  void *tmp_buf = NULL;
 
   unsigned int nprocs = comm->size();
   int rank = comm->rank();
 
   extent = dtype->get_extent();
-  tmp_buf = (void *) smpi_get_tmp_sendbuffer(count * extent);
+  unsigned char* tmp_buf = smpi_get_tmp_sendbuffer(count * extent);
 
   Datatype::copy(sbuff, count, dtype, rbuff, count, dtype);
 
@@ -81,8 +79,8 @@ int Coll_allreduce_rab_rdb::allreduce(void *sbuff, void *rbuff, int count,
     // reduce-scatter, calculate the count that each process receives
     // and the displacement within the buffer
 
-    cnts = (int *) xbt_malloc(pof2 * sizeof(int));
-    disps = (int *) xbt_malloc(pof2 * sizeof(int));
+    int* cnts  = new int[pof2];
+    int* disps = new int[pof2];
 
     for (i = 0; i < (pof2 - 1); i++)
       cnts[i] = count / pof2;
@@ -116,18 +114,17 @@ int Coll_allreduce_rab_rdb::allreduce(void *sbuff, void *rbuff, int count,
       }
 
       // Send data from recvbuf. Recv into tmp_buf
-      Request::sendrecv((char *) rbuff + disps[send_idx] * extent, send_cnt,
-                   dtype, dst, tag,
-                   (char *) tmp_buf + disps[recv_idx] * extent, recv_cnt,
-                   dtype, dst, tag, comm, &status);
+      Request::sendrecv(static_cast<char*>(rbuff) + disps[send_idx] * extent, send_cnt, dtype, dst, tag,
+                        tmp_buf + disps[recv_idx] * extent, recv_cnt, dtype, dst, tag, comm, &status);
 
       // tmp_buf contains data received in this step.
       // recvbuf contains data accumulated so far
 
       // This algorithm is used only for predefined ops
       // and predefined ops are always commutative.
-      if(op!=MPI_OP_NULL) op->apply( (char *) tmp_buf + disps[recv_idx] * extent,
-                        (char *) rbuff + disps[recv_idx] * extent, &recv_cnt, dtype);
+      if (op != MPI_OP_NULL)
+        op->apply(tmp_buf + disps[recv_idx] * extent, static_cast<char*>(rbuff) + disps[recv_idx] * extent, &recv_cnt,
+                  dtype);
 
       // update send_idx for next iteration
       send_idx = recv_idx;
@@ -177,9 +174,8 @@ int Coll_allreduce_rab_rdb::allreduce(void *sbuff, void *rbuff, int count,
       mask >>= 1;
     }
 
-    free(cnts);
-    free(disps);
-
+    delete[] cnts;
+    delete[] disps;
   }
   // In the non-power-of-two case, all odd-numbered processes of
   // rank < 2 * rem send the result to (rank-1), the ranks who didn't
index 9563c03..34be1cd 100644 (file)
@@ -9,7 +9,7 @@
 namespace simgrid{
 namespace smpi{
 // NP pow of 2 for now
-int Coll_allreduce_rab1::allreduce(void *sbuff, void *rbuff,
+int Coll_allreduce_rab1::allreduce(const void *sbuff, void *rbuff,
                                    int count, MPI_Datatype dtype,
                                    MPI_Op op, MPI_Comm comm)
 {
@@ -19,13 +19,11 @@ int Coll_allreduce_rab1::allreduce(void *sbuff, void *rbuff,
   unsigned int pof2 = 1, mask;
   int send_idx, recv_idx, dst, send_cnt, recv_cnt;
 
-  void *recv, *tmp_buf;
-
   int rank = comm->rank();
   unsigned int nprocs = comm->size();
 
   if((nprocs&(nprocs-1)))
-    THROWF(arg_error,0, "allreduce rab1 algorithm can't be used with non power of two number of processes ! ");
+    throw std::invalid_argument("allreduce rab1 algorithm can't be used with non power of two number of processes!");
 
   extent = dtype->get_extent();
 
@@ -41,8 +39,8 @@ int Coll_allreduce_rab1::allreduce(void *sbuff, void *rbuff,
     send_size = (count + nprocs) / nprocs;
     newcnt = send_size * nprocs;
 
-    recv = (void *) smpi_get_tmp_recvbuffer(extent * newcnt);
-    tmp_buf = (void *) smpi_get_tmp_sendbuffer(extent * newcnt);
+    unsigned char* recv    = smpi_get_tmp_recvbuffer(extent * newcnt);
+    unsigned char* tmp_buf = smpi_get_tmp_sendbuffer(extent * newcnt);
     memcpy(recv, sbuff, extent * count);
 
 
@@ -57,18 +55,18 @@ int Coll_allreduce_rab1::allreduce(void *sbuff, void *rbuff,
       else
         recv_idx = send_idx + (mask * share);
 
-      Request::sendrecv((char *) recv + send_idx * extent, send_cnt, dtype, dst, tag,
-                   tmp_buf, recv_cnt, dtype, dst, tag, comm, &status);
+      Request::sendrecv(recv + send_idx * extent, send_cnt, dtype, dst, tag, tmp_buf, recv_cnt, dtype, dst, tag, comm,
+                        &status);
 
-      if(op!=MPI_OP_NULL) op->apply( tmp_buf, (char *) recv + recv_idx * extent, &recv_cnt,
-                     dtype);
+      if (op != MPI_OP_NULL)
+        op->apply(tmp_buf, recv + recv_idx * extent, &recv_cnt, dtype);
 
       // update send_idx for next iteration
       send_idx = recv_idx;
       mask >>= 1;
     }
 
-    memcpy(tmp_buf, (char *) recv + recv_idx * extent, recv_cnt * extent);
+    memcpy(tmp_buf, recv + recv_idx * extent, recv_cnt * extent);
     Colls::allgather(tmp_buf, recv_cnt, dtype, recv, recv_cnt, dtype, comm);
 
     memcpy(rbuff, recv, count * extent);
@@ -78,7 +76,7 @@ int Coll_allreduce_rab1::allreduce(void *sbuff, void *rbuff,
   }
 
   else {
-    tmp_buf = (void *) smpi_get_tmp_sendbuffer(extent * count);
+    unsigned char* tmp_buf = smpi_get_tmp_sendbuffer(extent * count);
     memcpy(rbuff, sbuff, count * extent);
     mask = pof2 / 2;
     share = count / pof2;
index bad546c..ae9f3a2 100644 (file)
 namespace simgrid{
 namespace smpi{
 // this requires that count >= NP
-int Coll_allreduce_rab2::allreduce(void *sbuff, void *rbuff,
+int Coll_allreduce_rab2::allreduce(const void *sbuff, void *rbuff,
                                    int count, MPI_Datatype dtype,
                                    MPI_Op op, MPI_Comm comm)
 {
   MPI_Aint s_extent;
   int i, rank, nprocs;
   int nbytes, send_size, s_offset, r_offset;
-  void *recv, *send, *tmp;
   /*
      #ifdef MPICH2_REDUCTION
      MPI_User_function * uop = MPIR_Op_table[op % 16 - 1];
@@ -42,9 +41,9 @@ int Coll_allreduce_rab2::allreduce(void *sbuff, void *rbuff,
       send_size = (count + nprocs) / nprocs;
     nbytes = send_size * s_extent;
 
-    send = (void *) smpi_get_tmp_sendbuffer(s_extent * send_size * nprocs);
-    recv = (void *) smpi_get_tmp_recvbuffer(s_extent * send_size * nprocs);
-    tmp = (void *) smpi_get_tmp_sendbuffer(nbytes);
+    unsigned char* send = smpi_get_tmp_sendbuffer(s_extent * send_size * nprocs);
+    unsigned char* recv = smpi_get_tmp_recvbuffer(s_extent * send_size * nprocs);
+    unsigned char* tmp  = smpi_get_tmp_sendbuffer(nbytes);
 
     memcpy(send, sbuff, s_extent * count);
 
@@ -53,7 +52,8 @@ int Coll_allreduce_rab2::allreduce(void *sbuff, void *rbuff,
     memcpy(tmp, recv, nbytes);
 
     for (i = 1, s_offset = nbytes; i < nprocs; i++, s_offset = i * nbytes)
-      if(op!=MPI_OP_NULL) op->apply( (char *) recv + s_offset, tmp, &send_size, dtype);
+      if (op != MPI_OP_NULL)
+        op->apply(recv + s_offset, tmp, &send_size, dtype);
 
     Colls::allgather(tmp, send_size, dtype, recv, send_size, dtype, comm);
     memcpy(rbuff, recv, count * s_extent);
@@ -62,20 +62,20 @@ int Coll_allreduce_rab2::allreduce(void *sbuff, void *rbuff,
     smpi_free_tmp_buffer(tmp);
     smpi_free_tmp_buffer(send);
   } else {
-    send = sbuff;
+    const void* send = sbuff;
     send_size = count / nprocs;
     nbytes = send_size * s_extent;
     r_offset = rank * nbytes;
 
-    recv = (void *) smpi_get_tmp_recvbuffer(s_extent * send_size * nprocs);
+    unsigned char* recv = smpi_get_tmp_recvbuffer(s_extent * send_size * nprocs);
 
     Colls::alltoall(send, send_size, dtype, recv, send_size, dtype, comm);
 
     memcpy((char *) rbuff + r_offset, recv, nbytes);
 
     for (i = 1, s_offset = nbytes; i < nprocs; i++, s_offset = i * nbytes)
-      if(op!=MPI_OP_NULL) op->apply( (char *) recv + s_offset, (char *) rbuff + r_offset,
-                     &send_size, dtype);
+      if (op != MPI_OP_NULL)
+        op->apply(recv + s_offset, static_cast<char*>(rbuff) + r_offset, &send_size, dtype);
 
     Colls::allgather((char *) rbuff + r_offset, send_size, dtype, rbuff, send_size,
                   dtype, comm);
index 1916341..6041a42 100644 (file)
@@ -8,14 +8,13 @@
 //#include <star-reduction.c>
 namespace simgrid{
 namespace smpi{
-int Coll_allreduce_rdb::allreduce(void *sbuff, void *rbuff, int count,
+int Coll_allreduce_rdb::allreduce(const void *sbuff, void *rbuff, int count,
                                   MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
 {
   int nprocs, rank, tag = COLL_TAG_ALLREDUCE;
   int mask, dst, pof2, newrank, rem, newdst;
   MPI_Aint extent, lb;
   MPI_Status status;
-  void *tmp_buf = NULL;
   /*
      #ifdef MPICH2_REDUCTION
      MPI_User_function * uop = MPIR_Op_table[op % 16 - 1];
@@ -30,7 +29,7 @@ int Coll_allreduce_rdb::allreduce(void *sbuff, void *rbuff, int count,
   rank=comm->rank();
 
   dtype->extent(&lb, &extent);
-  tmp_buf = (void *) smpi_get_tmp_sendbuffer(count * extent);
+  unsigned char* tmp_buf = smpi_get_tmp_sendbuffer(count * extent);
 
   Request::sendrecv(sbuff, count, dtype, rank, 500,
                rbuff, count, dtype, rank, 500, comm, &status);
index b389899..1f5863c 100644 (file)
@@ -7,7 +7,7 @@
 #include "../colls_private.hpp"
 namespace simgrid{
 namespace smpi{
-int Coll_allreduce_redbcast::allreduce(void *buf, void *buf2, int count,
+int Coll_allreduce_redbcast::allreduce(const void *buf, void *buf2, int count,
                                        MPI_Datatype datatype, MPI_Op op,
                                        MPI_Comm comm)
 {
index 723eb42..d9156b3 100644 (file)
@@ -40,13 +40,12 @@ This fucntion performs all-reduce operation as follow. ** in a pipeline fashion
 */
 namespace simgrid{
 namespace smpi{
-int Coll_allreduce_smp_binomial_pipeline::allreduce(void *send_buf,
+int Coll_allreduce_smp_binomial_pipeline::allreduce(const void *send_buf,
                                                     void *recv_buf, int count,
                                                     MPI_Datatype dtype,
                                                     MPI_Op op, MPI_Comm comm)
 {
   int comm_size, rank;
-  void *tmp_buf;
   int tag = COLL_TAG_ALLREDUCE;
   int mask, src, dst;
   MPI_Status status;
@@ -62,7 +61,7 @@ int Coll_allreduce_smp_binomial_pipeline::allreduce(void *send_buf,
   rank = comm->rank();
   MPI_Aint extent;
   extent = dtype->get_extent();
-  tmp_buf = (void *) smpi_get_tmp_sendbuffer(count * extent);
+  unsigned char* tmp_buf = smpi_get_tmp_sendbuffer(count * extent);
 
   int intra_rank, inter_rank;
   intra_rank = rank % num_core;
index c9b0076..16f60d6 100644 (file)
@@ -29,12 +29,11 @@ This fucntion performs all-reduce operation as follow.
 */
 namespace simgrid{
 namespace smpi{
-int Coll_allreduce_smp_binomial::allreduce(void *send_buf, void *recv_buf,
+int Coll_allreduce_smp_binomial::allreduce(const void *send_buf, void *recv_buf,
                                            int count, MPI_Datatype dtype,
                                            MPI_Op op, MPI_Comm comm)
 {
   int comm_size, rank;
-  void *tmp_buf;
   int tag = COLL_TAG_ALLREDUCE;
   int mask, src, dst;
 
@@ -51,7 +50,7 @@ int Coll_allreduce_smp_binomial::allreduce(void *send_buf, void *recv_buf,
   rank=comm->rank();
   MPI_Aint extent, lb;
   dtype->extent(&lb, &extent);
-  tmp_buf = (void *) smpi_get_tmp_sendbuffer(count * extent);
+  unsigned char* tmp_buf = smpi_get_tmp_sendbuffer(count * extent);
 
   /* compute intra and inter ranking */
   int intra_rank, inter_rank;
index 1c8d99d..1e7504c 100644 (file)
@@ -28,12 +28,11 @@ This fucntion performs all-reduce operation as follow.
 */
 namespace simgrid{
 namespace smpi{
-int Coll_allreduce_smp_rdb::allreduce(void *send_buf, void *recv_buf, int count,
+int Coll_allreduce_smp_rdb::allreduce(const void *send_buf, void *recv_buf, int count,
                                       MPI_Datatype dtype, MPI_Op op,
                                       MPI_Comm comm)
 {
   int comm_size, rank;
-  void *tmp_buf;
   int tag = COLL_TAG_ALLREDUCE;
   int mask, src, dst;
   MPI_Status status;
@@ -58,7 +57,7 @@ int Coll_allreduce_smp_rdb::allreduce(void *send_buf, void *recv_buf, int count,
   rank = comm->rank();
   MPI_Aint extent;
   extent = dtype->get_extent();
-  tmp_buf = (void *) smpi_get_tmp_sendbuffer(count * extent);
+  unsigned char* tmp_buf = smpi_get_tmp_sendbuffer(count * extent);
 
   /* compute intra and inter ranking */
   int intra_rank, inter_rank;
index e2753d1..fd5718f 100644 (file)
@@ -16,12 +16,11 @@ This fucntion performs all-reduce operation as follow.
 */
 namespace simgrid{
 namespace smpi{
-int Coll_allreduce_smp_rsag_lr::allreduce(void *send_buf, void *recv_buf,
+int Coll_allreduce_smp_rsag_lr::allreduce(const void *send_buf, void *recv_buf,
                                           int count, MPI_Datatype dtype,
                                           MPI_Op op, MPI_Comm comm)
 {
   int comm_size, rank;
-  void *tmp_buf;
   int tag = COLL_TAG_ALLREDUCE;
   int mask, src, dst;
   MPI_Status status;
@@ -46,7 +45,7 @@ int Coll_allreduce_smp_rsag_lr::allreduce(void *send_buf, void *recv_buf,
   rank = comm->rank();
   MPI_Aint extent;
   extent = dtype->get_extent();
-  tmp_buf = (void *) smpi_get_tmp_sendbuffer(count * extent);
+  unsigned char* tmp_buf = smpi_get_tmp_sendbuffer(count * extent);
 
   int intra_rank, inter_rank;
   intra_rank = rank % num_core;
index 2286a05..b4bfacc 100644 (file)
@@ -20,12 +20,11 @@ This fucntion performs all-reduce operation as follow.
 */
 namespace simgrid{
 namespace smpi{
-int Coll_allreduce_smp_rsag_rab::allreduce(void *sbuf, void *rbuf, int count,
+int Coll_allreduce_smp_rsag_rab::allreduce(const void *sbuf, void *rbuf, int count,
                                            MPI_Datatype dtype, MPI_Op op,
                                            MPI_Comm comm)
 {
   int comm_size, rank;
-  void *tmp_buf;
   int tag = COLL_TAG_ALLREDUCE;
   int mask, src, dst;
   MPI_Status status;
@@ -40,12 +39,13 @@ int Coll_allreduce_smp_rsag_rab::allreduce(void *sbuf, void *rbuf, int count,
   comm_size = comm->size();
 
   if((comm_size&(comm_size-1)))
-    THROWF(arg_error,0, "allreduce smp rsag rab algorithm can't be used with non power of two number of processes ! ");
+    throw std::invalid_argument(
+        "allreduce smp rsag rab algorithm can't be used with non power of two number of processes!");
 
   rank = comm->rank();
   MPI_Aint extent;
   extent = dtype->get_extent();
-  tmp_buf = (void *) smpi_get_tmp_sendbuffer(count * extent);
+  unsigned char* tmp_buf = smpi_get_tmp_sendbuffer(count * extent);
 
   int intra_rank, inter_rank;
   intra_rank = rank % num_core;
index d53d29e..06d5e41 100644 (file)
@@ -15,12 +15,11 @@ This fucntion performs all-reduce operation as follow.
 */
 namespace simgrid{
 namespace smpi{
-int Coll_allreduce_smp_rsag::allreduce(void *send_buf, void *recv_buf,
+int Coll_allreduce_smp_rsag::allreduce(const void *send_buf, void *recv_buf,
                                        int count, MPI_Datatype dtype, MPI_Op op,
                                        MPI_Comm comm)
 {
   int comm_size, rank;
-  void *tmp_buf;
   int tag = COLL_TAG_ALLREDUCE;
   int mask, src, dst;
   MPI_Status status;
@@ -45,7 +44,7 @@ int Coll_allreduce_smp_rsag::allreduce(void *send_buf, void *recv_buf,
   rank = comm->rank();
   MPI_Aint extent;
   extent = dtype->get_extent();
-  tmp_buf = (void *) smpi_get_tmp_sendbuffer(count * extent);
+  unsigned char* tmp_buf = smpi_get_tmp_sendbuffer(count * extent);
 
   int intra_rank, inter_rank;
   intra_rank = rank % num_core;
index 03f0a87..7d9a906 100644 (file)
@@ -33,7 +33,7 @@
 static int alltoall_check_is_2dmesh(int num, int *i, int *j)
 {
   int x, max = num / 2;
-  x = sqrt(num);
+  x = sqrt(double(num));
 
   while (x <= max) {
     if ((num % x) == 0) {
@@ -55,16 +55,14 @@ static int alltoall_check_is_2dmesh(int num, int *i, int *j)
 namespace simgrid{
 namespace smpi{
 
-int Coll_alltoall_2dmesh::alltoall(void *send_buff, int send_count,
+int Coll_alltoall_2dmesh::alltoall(const void *send_buff, int send_count,
                                     MPI_Datatype send_type,
                                     void *recv_buff, int recv_count,
                                     MPI_Datatype recv_type, MPI_Comm comm)
 {
-  MPI_Status *statuses, s;
-  MPI_Request *reqs, *req_ptr;;
+  MPI_Status s;
   MPI_Aint extent;
 
-  char *tmp_buff1, *tmp_buff2;
   int i, j, src, dst, rank, num_procs, count, num_reqs;
   int X, Y, send_offset, recv_offset;
   int my_row_base, my_col_base, src_row_base, block_size;
@@ -82,17 +80,16 @@ int Coll_alltoall_2dmesh::alltoall(void *send_buff, int send_count,
 
   block_size = extent * send_count;
 
-  tmp_buff1 = (char *) smpi_get_tmp_sendbuffer(block_size * num_procs * Y);
-  tmp_buff2 = (char *) smpi_get_tmp_recvbuffer(block_size * Y);
+  unsigned char* tmp_buff1 = smpi_get_tmp_sendbuffer(block_size * num_procs * Y);
+  unsigned char* tmp_buff2 = smpi_get_tmp_recvbuffer(block_size * Y);
 
   num_reqs = X;
   if (Y > X)
     num_reqs = Y;
 
-  statuses = (MPI_Status *) xbt_malloc(num_reqs * sizeof(MPI_Status));
-  reqs = (MPI_Request *) xbt_malloc(num_reqs * sizeof(MPI_Request));
-
-  req_ptr = reqs;
+  MPI_Status* statuses = new MPI_Status[num_reqs];
+  MPI_Request* reqs    = new MPI_Request[num_reqs];
+  MPI_Request* req_ptr = reqs;
 
   count = send_count * num_procs;
 
@@ -168,8 +165,8 @@ int Coll_alltoall_2dmesh::alltoall(void *send_buff, int send_count,
     Request::send(tmp_buff2, send_count * Y, send_type, dst, tag, comm);
   }
   Request::waitall(X - 1, reqs, statuses);
-  free(reqs);
-  free(statuses);
+  delete[] reqs;
+  delete[] statuses;
   smpi_free_tmp_buffer(tmp_buff1);
   smpi_free_tmp_buffer(tmp_buff2);
   return MPI_SUCCESS;
index 258058d..24f9def 100644 (file)
@@ -47,20 +47,17 @@ static int alltoall_check_is_3dmesh(int num, int *i, int *j, int *k)
 }
 namespace simgrid{
 namespace smpi{
-int Coll_alltoall_3dmesh::alltoall(void *send_buff, int send_count,
+int Coll_alltoall_3dmesh::alltoall(const void *send_buff, int send_count,
                                     MPI_Datatype send_type,
                                     void *recv_buff, int recv_count,
                                     MPI_Datatype recv_type, MPI_Comm comm)
 {
-  MPI_Request *reqs, *req_ptr;
   MPI_Aint extent;
-  MPI_Status status, *statuses;
+  MPI_Status status;
   int i, j, src, dst, rank, num_procs, num_reqs, X, Y, Z, block_size, count;
   int my_z, two_dsize, my_row_base, my_col_base, my_z_base, src_row_base;
   int src_z_base, send_offset, recv_offset, tag = COLL_TAG_ALLTOALL;
 
-  char *tmp_buff1, *tmp_buff2;
-
   rank = comm->rank();
   num_procs = comm->size();
   extent = send_type->get_extent();
@@ -83,13 +80,12 @@ int Coll_alltoall_3dmesh::alltoall(void *send_buff, int send_count,
 
   block_size = extent * send_count;
 
-  tmp_buff1 = (char *) smpi_get_tmp_sendbuffer(block_size * num_procs * two_dsize);
-  tmp_buff2 = (char *) smpi_get_tmp_recvbuffer(block_size * two_dsize);
-
-  statuses = (MPI_Status *) xbt_malloc(num_reqs * sizeof(MPI_Status));
-  reqs = (MPI_Request *) xbt_malloc(num_reqs * sizeof(MPI_Request));
+  unsigned char* tmp_buff1 = smpi_get_tmp_sendbuffer(block_size * num_procs * two_dsize);
+  unsigned char* tmp_buff2 = smpi_get_tmp_recvbuffer(block_size * two_dsize);
 
-  req_ptr = reqs;
+  MPI_Status* statuses = new MPI_Status[num_reqs];
+  MPI_Request* reqs    = new MPI_Request[num_reqs];
+  MPI_Request* req_ptr = reqs;
 
   recv_offset = (rank % two_dsize) * block_size * num_procs;
 
@@ -179,8 +175,8 @@ int Coll_alltoall_3dmesh::alltoall(void *send_buff, int send_count,
 
   Request::waitall(Z - 1, reqs, statuses);
 
-  free(reqs);
-  free(statuses);
+  delete[] reqs;
+  delete[] statuses;
   smpi_free_tmp_buffer(tmp_buff1);
   smpi_free_tmp_buffer(tmp_buff2);
   return MPI_SUCCESS;
index 39c764e..c8aeff2 100644 (file)
@@ -13,14 +13,13 @@ namespace simgrid{
 namespace smpi{
 
 
-int Coll_alltoall_basic_linear::alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype,
+int Coll_alltoall_basic_linear::alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                                           void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm)
 {
   int system_tag = COLL_TAG_ALLTOALL;
   int i;
   int count;
   MPI_Aint lb = 0, sendext = 0, recvext = 0;
-  MPI_Request *requests;
 
   /* Initialize. */
   int rank = comm->rank();
@@ -29,11 +28,11 @@ int Coll_alltoall_basic_linear::alltoall(void *sendbuf, int sendcount, MPI_Datat
   sendtype->extent(&lb, &sendext);
   recvtype->extent(&lb, &recvext);
   /* simple optimization */
-  int err = Datatype::copy(static_cast<char *>(sendbuf) + rank * sendcount * sendext, sendcount, sendtype,
+  int err = Datatype::copy(static_cast<const char *>(sendbuf) + rank * sendcount * sendext, sendcount, sendtype,
                                static_cast<char *>(recvbuf) + rank * recvcount * recvext, recvcount, recvtype);
   if (err == MPI_SUCCESS && size > 1) {
     /* Initiate all send/recv to/from others. */
-    requests = xbt_new(MPI_Request, 2 * (size - 1));
+    MPI_Request* requests = new MPI_Request[2 * (size - 1)];
     /* Post all receives first -- a simple optimization */
     count = 0;
     for (i = (rank + 1) % size; i != rank; i = (i + 1) % size) {
@@ -47,7 +46,7 @@ int Coll_alltoall_basic_linear::alltoall(void *sendbuf, int sendcount, MPI_Datat
      * TODO: check the previous assertion
      */
     for (i = (rank + size - 1) % size; i != rank; i = (i + size - 1) % size) {
-      requests[count] = Request::isend_init(static_cast<char *>(sendbuf) + i * sendcount * sendext, sendcount,
+      requests[count] = Request::isend_init(static_cast<const char *>(sendbuf) + i * sendcount * sendext, sendcount,
                                         sendtype, i, system_tag, comm);
       count++;
     }
@@ -59,7 +58,7 @@ int Coll_alltoall_basic_linear::alltoall(void *sendbuf, int sendcount, MPI_Datat
       if(requests[i]!=MPI_REQUEST_NULL)
         Request::unref(&requests[i]);
     }
-    xbt_free(requests);
+    delete[] requests;
   }
   return err;
 }
index 0d971d8..cd52444 100644 (file)
@@ -32,7 +32,7 @@ namespace smpi{
 
 
 int
-Coll_alltoall_bruck::alltoall(void *send_buff, int send_count,
+Coll_alltoall_bruck::alltoall(const void *send_buff, int send_count,
                                MPI_Datatype send_type, void *recv_buff,
                                int recv_count, MPI_Datatype recv_type,
                                MPI_Comm comm)
@@ -41,12 +41,9 @@ Coll_alltoall_bruck::alltoall(void *send_buff, int send_count,
   MPI_Aint extent;
   MPI_Datatype new_type;
 
-  int *blocks_length, *disps;
   int i, src, dst, rank, num_procs, count, block, position;
   int pack_size, tag = COLL_TAG_ALLTOALL, pof2 = 1;
 
-
-  char *tmp_buff;
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
 
@@ -55,9 +52,9 @@ Coll_alltoall_bruck::alltoall(void *send_buff, int send_count,
 
   extent = recv_type->get_extent();
 
-  tmp_buff = (char *) smpi_get_tmp_sendbuffer(num_procs * recv_count * extent);
-  disps = (int *) xbt_malloc(sizeof(int) * num_procs);
-  blocks_length = (int *) xbt_malloc(sizeof(int) * num_procs);
+  unsigned char* tmp_buff = smpi_get_tmp_sendbuffer(num_procs * recv_count * extent);
+  int* disps         = new int[num_procs];
+  int* blocks_length = new int[num_procs];
 
   Request::sendrecv(send_ptr + rank * send_count * extent,
                (num_procs - rank) * send_count, send_type, rank, tag,
@@ -98,8 +95,8 @@ Coll_alltoall_bruck::alltoall(void *send_buff, int send_count,
     pof2 *= 2;
   }
 
-  free(disps);
-  free(blocks_length);
+  delete[] disps;
+  delete[] blocks_length;
 
   Request::sendrecv(recv_ptr + (rank + 1) * recv_count * extent,
                (num_procs - rank - 1) * recv_count, send_type,
index 6fc2d7d..e4dc8a0 100644 (file)
@@ -45,7 +45,7 @@
 namespace simgrid{
 namespace smpi{
 int Coll_alltoall_mvapich2_scatter_dest::alltoall(
-                            void *sendbuf,
+                            const void *sendbuf,
                             int sendcount,
                             MPI_Datatype sendtype,
                             void *recvbuf,
@@ -57,8 +57,6 @@ int Coll_alltoall_mvapich2_scatter_dest::alltoall(
     MPI_Aint     sendtype_extent = 0, recvtype_extent = 0;
     int mpi_errno=MPI_SUCCESS;
     int dst, rank;
-    MPI_Request *reqarray;
-    MPI_Status *starray;
 
     if (recvcount == 0) return MPI_SUCCESS;
 
@@ -93,9 +91,9 @@ int Coll_alltoall_mvapich2_scatter_dest::alltoall(
 
     /* FIXME: This should use the memory macros (there are storage
      leaks here if there is an error, for example) */
-    reqarray= (MPI_Request*)xbt_malloc(2*bblock*sizeof(MPI_Request));
+    MPI_Request* reqarray = new MPI_Request[2 * bblock];
 
-    starray=(MPI_Status *)xbt_malloc(2*bblock*sizeof(MPI_Status));
+    MPI_Status* starray = new MPI_Status[2 * bblock];
 
     for (ii=0; ii<comm_size; ii+=bblock) {
         ss = comm_size-ii < bblock ? comm_size-ii : bblock;
@@ -131,8 +129,8 @@ int Coll_alltoall_mvapich2_scatter_dest::alltoall(
         }
     }
     /* --END ERROR HANDLING-- */
-    xbt_free(starray);
-    xbt_free(reqarray);
+    delete[] starray;
+    delete[] reqarray;
     return (mpi_errno);
 
 }
index 8e823e1..35bc293 100644 (file)
@@ -30,7 +30,7 @@
 namespace simgrid{
 namespace smpi{
 int
-Coll_alltoall_pair_light_barrier::alltoall(void *send_buff, int send_count,
+Coll_alltoall_pair_light_barrier::alltoall(const void *send_buff, int send_count,
                                             MPI_Datatype send_type,
                                             void *recv_buff, int recv_count,
                                             MPI_Datatype recv_type,
@@ -49,7 +49,7 @@ Coll_alltoall_pair_light_barrier::alltoall(void *send_buff, int send_count,
   num_procs = comm->size();
 
   if((num_procs&(num_procs-1)))
-    THROWF(arg_error,0, "alltoall pair algorithm can't be used with non power of two number of processes ! ");
+    throw std::invalid_argument("alltoall pair algorithm can't be used with non power of two number of processes!");
 
   send_chunk = send_type->get_extent();
   recv_chunk = recv_type->get_extent();
index 14ea779..2e9e926 100644 (file)
@@ -30,7 +30,7 @@
 namespace simgrid{
 namespace smpi{
 int
-Coll_alltoall_pair_mpi_barrier::alltoall(void *send_buff, int send_count,
+Coll_alltoall_pair_mpi_barrier::alltoall(const void *send_buff, int send_count,
                                           MPI_Datatype send_type,
                                           void *recv_buff, int recv_count,
                                           MPI_Datatype recv_type, MPI_Comm comm)
@@ -46,7 +46,7 @@ Coll_alltoall_pair_mpi_barrier::alltoall(void *send_buff, int send_count,
   num_procs = comm->size();
 
   if((num_procs&(num_procs-1)))
-    THROWF(arg_error,0, "alltoall pair algorithm can't be used with non power of two number of processes ! ");
+    throw std::invalid_argument("alltoall pair algorithm can't be used with non power of two number of processes!");
 
   send_chunk = send_type->get_extent();
   recv_chunk = recv_type->get_extent();
index 914d19c..b427fca 100644 (file)
@@ -29,7 +29,7 @@
 namespace simgrid{
 namespace smpi{
 int
-Coll_alltoall_pair_one_barrier::alltoall(void *send_buff, int send_count,
+Coll_alltoall_pair_one_barrier::alltoall(const void *send_buff, int send_count,
                                           MPI_Datatype send_type,
                                           void *recv_buff, int recv_count,
                                           MPI_Datatype recv_type, MPI_Comm comm)
@@ -47,7 +47,7 @@ Coll_alltoall_pair_one_barrier::alltoall(void *send_buff, int send_count,
   num_procs = comm->size();
 
   if((num_procs&(num_procs-1)))
-    THROWF(arg_error,0, "alltoall pair algorithm can't be used with non power of two number of processes ! ");
+    throw std::invalid_argument("alltoall pair algorithm can't be used with non power of two number of processes!");
 
   send_chunk = send_type->get_extent();
   recv_chunk = recv_type->get_extent();
index 1d3b4cf..bd1095d 100644 (file)
@@ -30,7 +30,7 @@
  ****************************************************************************/
 namespace simgrid{
 namespace smpi{
-int Coll_alltoall_pair_rma::alltoall(void *send_buff, int send_count, MPI_Datatype send_type,
+int Coll_alltoall_pair_rma::alltoall(const void *send_buff, int send_count, MPI_Datatype send_type,
                   void *recv_buff, int recv_count, MPI_Datatype recv_type,
                   MPI_Comm comm)
 {
@@ -64,7 +64,7 @@ int Coll_alltoall_pair_rma::alltoall(void *send_buff, int send_count, MPI_Dataty
 }
 
 
-int Coll_alltoall_pair::alltoall(void *send_buff, int send_count,
+int Coll_alltoall_pair::alltoall(const void *send_buff, int send_count,
                                   MPI_Datatype send_type,
                                   void *recv_buff, int recv_count,
                                   MPI_Datatype recv_type, MPI_Comm comm)
@@ -81,7 +81,7 @@ int Coll_alltoall_pair::alltoall(void *send_buff, int send_count,
   num_procs = comm->size();
 
   if((num_procs&(num_procs-1)))
-    THROWF(arg_error,0, "alltoall pair algorithm can't be used with non power of two number of processes ! ");
+    throw std::invalid_argument("alltoall pair algorithm can't be used with non power of two number of processes!");
 
   send_chunk = send_type->get_extent();
   recv_chunk = recv_type->get_extent();
index e52cbc7..f2a0c32 100644 (file)
@@ -30,7 +30,7 @@
  ****************************************************************************/
 namespace simgrid{
 namespace smpi{
-int Coll_alltoall_rdb::alltoall(void *send_buff, int send_count,
+int Coll_alltoall_rdb::alltoall(const void *send_buff, int send_count,
                                  MPI_Datatype send_type,
                                  void *recv_buff, int recv_count,
                                  MPI_Datatype recv_type, MPI_Comm comm)
@@ -44,7 +44,6 @@ int Coll_alltoall_rdb::alltoall(void *send_buff, int send_count,
   int last_recv_count = 0, tmp_mask, tree_root, num_procs_completed;
   int tag = COLL_TAG_ALLTOALL, mask = 1, i = 0;
 
-  char *tmp_buff;
   char *send_ptr = (char *) send_buff;
   char *recv_ptr = (char *) recv_buff;
 
@@ -59,7 +58,7 @@ int Coll_alltoall_rdb::alltoall(void *send_buff, int send_count,
 
   max_size = num_procs * recv_increment;
 
-  tmp_buff = (char *) smpi_get_tmp_sendbuffer(max_size);
+  unsigned char* tmp_buff = smpi_get_tmp_sendbuffer(max_size);
 
   curr_size = send_count * num_procs;
 
index adbbccc..7aa92f9 100644 (file)
@@ -30,7 +30,7 @@
 namespace simgrid{
 namespace smpi{
 int
-Coll_alltoall_ring_light_barrier::alltoall(void *send_buff, int send_count,
+Coll_alltoall_ring_light_barrier::alltoall(const void *send_buff, int send_count,
                                             MPI_Datatype send_type,
                                             void *recv_buff, int recv_count,
                                             MPI_Datatype recv_type,
index e6a35bd..c8e4c34 100644 (file)
@@ -29,7 +29,7 @@
 namespace simgrid{
 namespace smpi{
 int
-Coll_alltoall_ring_mpi_barrier::alltoall(void *send_buff, int send_count,
+Coll_alltoall_ring_mpi_barrier::alltoall(const void *send_buff, int send_count,
                                           MPI_Datatype send_type,
                                           void *recv_buff, int recv_count,
                                           MPI_Datatype recv_type, MPI_Comm comm)
index 459c77b..be7e089 100644 (file)
@@ -28,7 +28,7 @@
 namespace simgrid{
 namespace smpi{
 int
-Coll_alltoall_ring_one_barrier::alltoall(void *send_buff, int send_count,
+Coll_alltoall_ring_one_barrier::alltoall(const void *send_buff, int send_count,
                                           MPI_Datatype send_type,
                                           void *recv_buff, int recv_count,
                                           MPI_Datatype recv_type, MPI_Comm comm)
index 620e2ac..8144198 100644 (file)
@@ -28,7 +28,7 @@
 namespace simgrid{
 namespace smpi{
 int
-Coll_alltoall_ring::alltoall(void *send_buff, int send_count,
+Coll_alltoall_ring::alltoall(const void *send_buff, int send_count,
                               MPI_Datatype send_type, void *recv_buff,
                               int recv_count, MPI_Datatype recv_type,
                               MPI_Comm comm)
index c80bffe..8b3794f 100644 (file)
@@ -15,9 +15,9 @@
  **/
 namespace simgrid{
 namespace smpi{
-int Coll_alltoallv_bruck::alltoallv(void *sendbuf, int *sendcounts, int *senddisps,
+int Coll_alltoallv_bruck::alltoallv(const void *sendbuf, const int *sendcounts, const int *senddisps,
                                    MPI_Datatype sendtype, void *recvbuf,
-                                   int *recvcounts, int *recvdisps, MPI_Datatype recvtype,
+                                   const int *recvcounts,const int *recvdisps, MPI_Datatype recvtype,
                                    MPI_Comm comm)
 {
   int system_tag = COLL_TAG_ALLTOALLV;
@@ -25,7 +25,6 @@ int Coll_alltoallv_bruck::alltoallv(void *sendbuf, int *sendcounts, int *senddis
   MPI_Aint lb;
   MPI_Aint sendext = 0;
   MPI_Aint recvext = 0;
-  MPI_Request *requests;
 
   // FIXME: check implementation
   rank = comm->rank();
@@ -43,52 +42,47 @@ int Coll_alltoallv_bruck::alltoallv(void *sendbuf, int *sendcounts, int *senddis
   if (err == MPI_SUCCESS && size > 1) {
     /* Initiate all send/recv to/from others. */
 
-      int bblock = 4;//MPIR_PARAM_ALLTOALL_THROTTLE
-      //if (bblock == 0) bblock = comm_size;
+    int bblock = 4; // MPIR_PARAM_ALLTOALL_THROTTLE
+    // if (bblock == 0) bblock = comm_size;
 
+    // MPI_Request* requests = new MPI_Request[2 * (bblock - 1)];
+    int ii, ss, dst;
+    /* post only bblock isends/irecvs at a time as suggested by Tony Ladd */
+    for (ii = 0; ii < size; ii += bblock) {
+      MPI_Request* requests = new MPI_Request[2 * bblock];
 
-     // requests = xbt_new(MPI_Request, 2 * (bblock - 1));
-      int ii, ss, dst;
-      /* post only bblock isends/irecvs at a time as suggested by Tony Ladd */
-      for (ii=0; ii<size; ii+=bblock) {
-          requests = xbt_new(MPI_Request, 2 * (bblock ));
+      ss    = size - ii < bblock ? size - ii : bblock;
+      count = 0;
 
-          ss = size-ii < bblock ? size-ii : bblock;
-          count = 0;
-
-          /* do the communication -- post ss sends and receives: */
-          for ( i=0; i<ss; i++ ) {
-            dst = (rank+i+ii) % size;
-              if (dst == rank) {
-                XBT_DEBUG("<%d> skip request creation [src = %d, recvcount = %d]",
-                       rank, i, recvcounts[dst]);
-                continue;
-              }
-
-              requests[count]=Request::irecv((char *)recvbuf + recvdisps[dst] * recvext, recvcounts[dst],
-                                  recvtype, dst, system_tag, comm );
-              count++;
-            }
-            /* Now create all sends  */
-          for ( i=0; i<ss; i++ ) {
-              dst = (rank-i-ii+size) % size;
-              if (dst == rank) {
-                XBT_DEBUG("<%d> skip request creation [dst = %d, sendcount = %d]",
-                       rank, i, sendcounts[dst]);
-                continue;
-              }
-              requests[count]=Request::isend((char *)sendbuf + senddisps[dst] * sendext, sendcounts[dst],
-                                  sendtype, dst, system_tag, comm);
-              count++;
-            }
-            /* Wait for them all. */
-            //Colls::startall(count, requests);
-            XBT_DEBUG("<%d> wait for %d requests", rank, count);
-            Request::waitall(count, requests, MPI_STATUSES_IGNORE);
-            xbt_free(requests);
-
-          }
+      /* do the communication -- post ss sends and receives: */
+      for (i = 0; i < ss; i++) {
+        dst = (rank + i + ii) % size;
+        if (dst == rank) {
+          XBT_DEBUG("<%d> skip request creation [src = %d, recvcount = %d]", rank, i, recvcounts[dst]);
+          continue;
+        }
 
+        requests[count] =
+            Request::irecv((char*)recvbuf + recvdisps[dst] * recvext, recvcounts[dst], recvtype, dst, system_tag, comm);
+        count++;
+      }
+      /* Now create all sends  */
+      for (i = 0; i < ss; i++) {
+        dst = (rank - i - ii + size) % size;
+        if (dst == rank) {
+          XBT_DEBUG("<%d> skip request creation [dst = %d, sendcount = %d]", rank, i, sendcounts[dst]);
+          continue;
+        }
+        requests[count] =
+            Request::isend((char*)sendbuf + senddisps[dst] * sendext, sendcounts[dst], sendtype, dst, system_tag, comm);
+        count++;
+      }
+      /* Wait for them all. */
+      // Colls::startall(count, requests);
+      XBT_DEBUG("<%d> wait for %d requests", rank, count);
+      Request::waitall(count, requests, MPI_STATUSES_IGNORE);
+      delete[] requests;
+    }
   }
   return MPI_SUCCESS;
 }
index 501d15e..de140a3 100644 (file)
@@ -17,9 +17,9 @@
 namespace simgrid{
 namespace smpi{
 int
-Coll_alltoallv_ompi_basic_linear::alltoallv(void *sbuf, int *scounts, int *sdisps,
+Coll_alltoallv_ompi_basic_linear::alltoallv(const void *sbuf, const int *scounts, const int *sdisps,
                                             MPI_Datatype sdtype,
-                                            void *rbuf, int *rcounts, int *rdisps,
+                                            void *rbuf, const int *rcounts, const int *rdisps,
                                             MPI_Datatype rdtype,
                                             MPI_Comm comm)
 {
@@ -30,7 +30,7 @@ Coll_alltoallv_ompi_basic_linear::alltoallv(void *sbuf, int *scounts, int *sdisp
     MPI_Request *preq;
     size = comm->size();
     rank = comm->rank();
-    MPI_Request *ireqs= static_cast<MPI_Request*>(xbt_malloc(sizeof(MPI_Request) * size * 2));
+    MPI_Request* ireqs = new MPI_Request[size * 2];
     XBT_DEBUG(
                  "coll:tuned:alltoallv_intra_basic_linear rank %d", rank);
 
@@ -101,7 +101,7 @@ Coll_alltoallv_ompi_basic_linear::alltoallv(void *sbuf, int *scounts, int *sdisp
       if(ireqs[i]!=MPI_REQUEST_NULL)
         Request::unref(&ireqs[i]);
     }
-    free(ireqs);
+    delete[] ireqs;
 
     return MPI_SUCCESS;
 }
index 4a529a6..b5d4073 100644 (file)
@@ -30,9 +30,9 @@
 namespace simgrid{
 namespace smpi{
 int
-Coll_alltoallv_pair_light_barrier::alltoallv(void *send_buff, int *send_counts, int *send_disps,
+Coll_alltoallv_pair_light_barrier::alltoallv(const void *send_buff, const int *send_counts, const int *send_disps,
                                             MPI_Datatype send_type,
-                                            void *recv_buff, int *recv_counts, int *recv_disps,
+                                            void *recv_buff, const int *recv_counts, const int *recv_disps,
                                             MPI_Datatype recv_type,
                                             MPI_Comm comm)
 {
@@ -49,7 +49,7 @@ Coll_alltoallv_pair_light_barrier::alltoallv(void *send_buff, int *send_counts,
   num_procs = comm->size();
 
   if((num_procs&(num_procs-1)))
-    THROWF(arg_error,0, "alltoallv pair algorithm can't be used with non power of two number of processes ! ");
+    throw std::invalid_argument("alltoallv pair algorithm can't be used with non power of two number of processes!");
 
   send_chunk = send_type->get_extent();
   recv_chunk = recv_type->get_extent();
index 4624cb0..d942226 100644 (file)
@@ -30,9 +30,9 @@
 namespace simgrid{
 namespace smpi{
 int
-Coll_alltoallv_pair_mpi_barrier::alltoallv(void *send_buff, int *send_counts, int *send_disps,
+Coll_alltoallv_pair_mpi_barrier::alltoallv(const void *send_buff, const int *send_counts, const int *send_disps,
                                           MPI_Datatype send_type,
-                                          void *recv_buff, int *recv_counts, int *recv_disps,
+                                          void *recv_buff, const int *recv_counts, const int *recv_disps,
                                           MPI_Datatype recv_type, MPI_Comm comm)
 {
   MPI_Status s;
@@ -46,7 +46,7 @@ Coll_alltoallv_pair_mpi_barrier::alltoallv(void *send_buff, int *send_counts, in
   num_procs = comm->size();
 
   if((num_procs&(num_procs-1)))
-    THROWF(arg_error,0, "alltoallv pair algorithm can't be used with non power of two number of processes ! ");
+    throw std::invalid_argument("alltoallv pair algorithm can't be used with non power of two number of processes!");
 
   send_chunk = send_type->get_extent();
   recv_chunk = recv_type->get_extent();
index 135afd0..f2298f4 100644 (file)
@@ -29,9 +29,9 @@
 namespace simgrid{
 namespace smpi{
 int
-Coll_alltoallv_pair_one_barrier::alltoallv(void *send_buff, int *send_counts, int *send_disps,
+Coll_alltoallv_pair_one_barrier::alltoallv(const void *send_buff, const int *send_counts, const int *send_disps,
                                           MPI_Datatype send_type,
-                                          void *recv_buff,  int *recv_counts, int *recv_disps,                                                                                  MPI_Datatype recv_type, MPI_Comm comm)
+                                          void *recv_buff,  const int *recv_counts, const int *recv_disps,                                                                                  MPI_Datatype recv_type, MPI_Comm comm)
 {
 
   MPI_Aint send_chunk, recv_chunk;
@@ -46,7 +46,7 @@ Coll_alltoallv_pair_one_barrier::alltoallv(void *send_buff, int *send_counts, in
   num_procs = comm->size();
 
   if((num_procs&(num_procs-1)))
-    THROWF(arg_error,0, "alltoallv pair algorithm can't be used with non power of two number of processes ! ");
+    throw std::invalid_argument("alltoallv pair algorithm can't be used with non power of two number of processes!");
 
   send_chunk = send_type->get_extent();
   recv_chunk = recv_type->get_extent();
index 78fef83..8dfd02f 100644 (file)
@@ -29,9 +29,9 @@
  ****************************************************************************/
 namespace simgrid{
 namespace smpi{
-int Coll_alltoallv_pair::alltoallv(void *send_buff, int *send_counts, int *send_disps,
+int Coll_alltoallv_pair::alltoallv(const void *send_buff, const int *send_counts, const int *send_disps,
                                   MPI_Datatype send_type,
-                                  void *recv_buff, int *recv_counts, int *recv_disps,
+                                  void *recv_buff, const int *recv_counts, const int *recv_disps,
                                   MPI_Datatype recv_type, MPI_Comm comm)
 {
 
@@ -46,7 +46,7 @@ int Coll_alltoallv_pair::alltoallv(void *send_buff, int *send_counts, int *send_
   num_procs = comm->size();
 
   if((num_procs&(num_procs-1)))
-    THROWF(arg_error,0, "alltoallv pair algorithm can't be used with non power of two number of processes ! ");
+    throw std::invalid_argument("alltoallv pair algorithm can't be used with non power of two number of processes!");
 
   send_chunk = send_type->get_extent();
   recv_chunk = recv_type->get_extent();
index ef6d087..a1773f1 100644 (file)
@@ -30,9 +30,9 @@
 namespace simgrid{
 namespace smpi{
 int
-Coll_alltoallv_ring_light_barrier::alltoallv(void *send_buff, int *send_counts, int *send_disps,
+Coll_alltoallv_ring_light_barrier::alltoallv(const void *send_buff, const int *send_counts, const int *send_disps,
                                             MPI_Datatype send_type,
-                                            void *recv_buff, int *recv_counts, int *recv_disps,
+                                            void *recv_buff, const int *recv_counts, const int *recv_disps,
                                             MPI_Datatype recv_type,
                                             MPI_Comm comm)
 {
index 8bcf2f4..211347b 100644 (file)
@@ -29,9 +29,9 @@
 namespace simgrid{
 namespace smpi{
 int
-Coll_alltoallv_ring_mpi_barrier::alltoallv(void *send_buff, int *send_counts, int *send_disps,
+Coll_alltoallv_ring_mpi_barrier::alltoallv(const void *send_buff, const int *send_counts, const int *send_disps,
                                           MPI_Datatype send_type,
-                                          void *recv_buff, int *recv_counts, int *recv_disps,
+                                          void *recv_buff, const int *recv_counts, const int *recv_disps,
                                           MPI_Datatype recv_type, MPI_Comm comm)
 {
   MPI_Status s;
index cb8e063..de58b9f 100644 (file)
@@ -28,9 +28,9 @@
 namespace simgrid{
 namespace smpi{
 int
-Coll_alltoallv_ring_one_barrier::alltoallv(void *send_buff, int *send_counts, int *send_disps,
+Coll_alltoallv_ring_one_barrier::alltoallv(const void *send_buff, const int *send_counts, const int *send_disps,
                                           MPI_Datatype send_type,
-                                          void *recv_buff, int *recv_counts, int *recv_disps,
+                                          void *recv_buff, const int *recv_counts, const int *recv_disps,
                                           MPI_Datatype recv_type, MPI_Comm comm)
 {
   MPI_Status s;
index 35bc4c7..88e27c0 100644 (file)
@@ -27,8 +27,8 @@
  ****************************************************************************/
 namespace simgrid{
 namespace smpi{
-int Coll_alltoallv_ring::alltoallv(void* send_buff, int* send_counts, int* send_disps, MPI_Datatype send_type,
-                                   void* recv_buff, int* recv_counts, int* recv_disps, MPI_Datatype recv_type,
+int Coll_alltoallv_ring::alltoallv(const void* send_buff, const int* send_counts, const int* send_disps, MPI_Datatype send_type,
+                                   void* recv_buff, const int* recv_counts, const int* recv_disps, MPI_Datatype recv_type,
                                    MPI_Comm comm)
 {
   MPI_Status s;
index 6d48490..500d37a 100644 (file)
@@ -267,9 +267,7 @@ int Coll_barrier_ompi_basic_linear::barrier(MPI_Comm comm)
 
         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
-                                     );
+          requests[i] = Request::irecv(NULL, 0, MPI_BYTE, i, COLL_TAG_BARRIER, comm);
         }
         Request::waitall( size-1, requests+1, MPI_STATUSES_IGNORE );
 
index 545705b..9a112c3 100644 (file)
@@ -17,11 +17,6 @@ int Coll_bcast_NTSB::bcast(void *buf, int count, MPI_Datatype datatype,
   int rank, size;
   int i;
 
-  MPI_Request *send_request_array;
-  MPI_Request *recv_request_array;
-  MPI_Status *send_status_array;
-  MPI_Status *recv_status_array;
-
   MPI_Aint extent;
   extent = datatype->get_extent();
 
@@ -97,16 +92,10 @@ int Coll_bcast_NTSB::bcast(void *buf, int count, MPI_Datatype datatype,
   // pipelining
   else {
 
-    send_request_array =
-        (MPI_Request *) xbt_malloc(2 * (size + pipe_length) * sizeof(MPI_Request));
-    recv_request_array =
-        (MPI_Request *) xbt_malloc((size + pipe_length) * sizeof(MPI_Request));
-    send_status_array =
-        (MPI_Status *) xbt_malloc(2 * (size + pipe_length) * sizeof(MPI_Status));
-    recv_status_array =
-        (MPI_Status *) xbt_malloc((size + pipe_length) * sizeof(MPI_Status));
-
-
+    MPI_Request* send_request_array = new MPI_Request[2 * (size + pipe_length)];
+    MPI_Request* recv_request_array = new MPI_Request[size + pipe_length];
+    MPI_Status* send_status_array   = new MPI_Status[2 * (size + pipe_length)];
+    MPI_Status* recv_status_array   = new MPI_Status[size + pipe_length];
 
     /* case: root */
     if (rank == 0) {
@@ -169,10 +158,10 @@ int Coll_bcast_NTSB::bcast(void *buf, int count, MPI_Datatype datatype,
       Request::waitall((2 * pipe_length), send_request_array, send_status_array);
     }
 
-    free(send_request_array);
-    free(recv_request_array);
-    free(send_status_array);
-    free(recv_status_array);
+    delete[] send_request_array;
+    delete[] recv_request_array;
+    delete[] send_status_array;
+    delete[] recv_status_array;
   }                             /* end pipeline */
 
   /* when count is not divisible by block size, use default BCAST for the remainder */
index f480649..57857c0 100644 (file)
@@ -19,10 +19,6 @@ int Coll_bcast_NTSL_Isend::bcast(void *buf, int count, MPI_Datatype datatype,
   int tag = COLL_TAG_BCAST;
   MPI_Status status;
   MPI_Request request;
-  MPI_Request *send_request_array;
-  MPI_Request *recv_request_array;
-  MPI_Status *send_status_array;
-  MPI_Status *recv_status_array;
   int rank, size;
   int i;
   MPI_Aint extent;
@@ -76,14 +72,10 @@ int Coll_bcast_NTSL_Isend::bcast(void *buf, int count, MPI_Datatype datatype,
 
   /* pipeline bcast */
   else {
-    send_request_array =
-        (MPI_Request *) xbt_malloc((size + pipe_length) * sizeof(MPI_Request));
-    recv_request_array =
-        (MPI_Request *) xbt_malloc((size + pipe_length) * sizeof(MPI_Request));
-    send_status_array =
-        (MPI_Status *) xbt_malloc((size + pipe_length) * sizeof(MPI_Status));
-    recv_status_array =
-        (MPI_Status *) xbt_malloc((size + pipe_length) * sizeof(MPI_Status));
+    MPI_Request* send_request_array = new MPI_Request[size + pipe_length];
+    MPI_Request* recv_request_array = new MPI_Request[size + pipe_length];
+    MPI_Status* send_status_array   = new MPI_Status[size + pipe_length];
+    MPI_Status* recv_status_array   = new MPI_Status[size + pipe_length];
 
     /* root send data */
     if (rank == 0) {
@@ -117,10 +109,10 @@ int Coll_bcast_NTSL_Isend::bcast(void *buf, int count, MPI_Datatype datatype,
       Request::waitall((pipe_length), send_request_array, send_status_array);
     }
 
-    free(send_request_array);
-    free(recv_request_array);
-    free(send_status_array);
-    free(recv_status_array);
+    delete[] send_request_array;
+    delete[] recv_request_array;
+    delete[] send_status_array;
+    delete[] recv_status_array;
   }                             /* end pipeline */
 
   /* when count is not divisible by block size, use default BCAST for the remainder */
index 56a5886..97e55c8 100644 (file)
@@ -19,10 +19,6 @@ int Coll_bcast_NTSL::bcast(void *buf, int count, MPI_Datatype datatype,
   int tag = COLL_TAG_BCAST;
   MPI_Status status;
   MPI_Request request;
-  MPI_Request *send_request_array;
-  MPI_Request *recv_request_array;
-  MPI_Status *send_status_array;
-  MPI_Status *recv_status_array;
   int rank, size;
   int i;
   MPI_Aint extent;
@@ -76,14 +72,10 @@ int Coll_bcast_NTSL::bcast(void *buf, int count, MPI_Datatype datatype,
 
   /* pipeline bcast */
   else {
-    send_request_array =
-        (MPI_Request *) xbt_malloc((size + pipe_length) * sizeof(MPI_Request));
-    recv_request_array =
-        (MPI_Request *) xbt_malloc((size + pipe_length) * sizeof(MPI_Request));
-    send_status_array =
-        (MPI_Status *) xbt_malloc((size + pipe_length) * sizeof(MPI_Status));
-    recv_status_array =
-        (MPI_Status *) xbt_malloc((size + pipe_length) * sizeof(MPI_Status));
+    MPI_Request* send_request_array = new MPI_Request[size + pipe_length];
+    MPI_Request* recv_request_array = new MPI_Request[size + pipe_length];
+    MPI_Status* send_status_array   = new MPI_Status[size + pipe_length];
+    MPI_Status* recv_status_array   = new MPI_Status[size + pipe_length];
 
     /* root send data */
     if (rank == 0) {
@@ -117,10 +109,10 @@ int Coll_bcast_NTSL::bcast(void *buf, int count, MPI_Datatype datatype,
       Request::waitall((pipe_length), send_request_array, send_status_array);
     }
 
-    free(send_request_array);
-    free(recv_request_array);
-    free(send_status_array);
-    free(recv_status_array);
+    delete[] send_request_array;
+    delete[] recv_request_array;
+    delete[] send_status_array;
+    delete[] recv_status_array;
   }                             /* end pipeline */
 
   /* when count is not divisible by block size, use default BCAST for the remainder */
index 3b7d4eb..3ce7918 100644 (file)
@@ -16,8 +16,6 @@ int Coll_bcast_SMP_binary::bcast(void *buf, int count,
   int tag = COLL_TAG_BCAST;
   MPI_Status status;
   MPI_Request request;
-  MPI_Request *request_array;
-  MPI_Status *status_array;
   int rank, size;
   int i;
   MPI_Aint extent;
@@ -123,10 +121,8 @@ int Coll_bcast_SMP_binary::bcast(void *buf, int count,
 
   // pipeline bcast
   else {
-    request_array =
-        (MPI_Request *) xbt_malloc((size + pipe_length) * sizeof(MPI_Request));
-    status_array =
-        (MPI_Status *) xbt_malloc((size + pipe_length) * sizeof(MPI_Status));
+    MPI_Request* request_array = new MPI_Request[size + pipe_length];
+    MPI_Status* status_array   = new MPI_Status[size + pipe_length];
 
     // case ROOT-of-each-SMP
     if (rank % host_num_core == 0) {
@@ -215,8 +211,8 @@ int Coll_bcast_SMP_binary::bcast(void *buf, int count,
       }
     }
 
-    free(request_array);
-    free(status_array);
+    delete[] request_array;
+    delete[] status_array;
   }
 
   // when count is not divisible by block size, use default BCAST for the remainder
index 4f1a90e..a8c6bec 100644 (file)
@@ -16,8 +16,6 @@ int Coll_bcast_SMP_linear::bcast(void *buf, int count,
   int tag = COLL_TAG_BCAST;
   MPI_Status status;
   MPI_Request request;
-  MPI_Request *request_array;
-  MPI_Status *status_array;
   int rank, size;
   int i;
   MPI_Aint extent;
@@ -99,10 +97,8 @@ int Coll_bcast_SMP_linear::bcast(void *buf, int count,
   }
   // pipeline bcast
   else {
-    request_array =
-        (MPI_Request *) xbt_malloc((size + pipe_length) * sizeof(MPI_Request));
-    status_array =
-        (MPI_Status *) xbt_malloc((size + pipe_length) * sizeof(MPI_Status));
+    MPI_Request* request_array = new MPI_Request[size + pipe_length];
+    MPI_Status* status_array   = new MPI_Status[size + pipe_length];
 
     // case ROOT of each SMP
     if (rank % num_core == 0) {
@@ -164,8 +160,8 @@ int Coll_bcast_SMP_linear::bcast(void *buf, int count,
         }
       }
     }
-    free(request_array);
-    free(status_array);
+    delete[] request_array;
+    delete[] status_array;
   }
 
   // when count is not divisible by block size, use default BCAST for the remainder
index e764c4b..46e6125 100644 (file)
@@ -24,11 +24,6 @@ int Coll_bcast_arrival_pattern_aware_wait::bcast(void *buf, int count,
 {
   MPI_Status status;
   MPI_Request request;
-  MPI_Request *send_request_array;
-  MPI_Request *recv_request_array;
-  MPI_Status *send_status_array;
-  MPI_Status *recv_status_array;
-
 
   MPI_Status temp_status_array[BCAST_ARRIVAL_PATTERN_AWARE_MAX_NODE];
 
@@ -98,14 +93,10 @@ int Coll_bcast_arrival_pattern_aware_wait::bcast(void *buf, int count,
 
   /* start pipeline bcast */
 
-  send_request_array =
-      (MPI_Request *) xbt_malloc((size + pipe_length) * sizeof(MPI_Request));
-  recv_request_array =
-      (MPI_Request *) xbt_malloc((size + pipe_length) * sizeof(MPI_Request));
-  send_status_array =
-      (MPI_Status *) xbt_malloc((size + pipe_length) * sizeof(MPI_Status));
-  recv_status_array =
-      (MPI_Status *) xbt_malloc((size + pipe_length) * sizeof(MPI_Status));
+  MPI_Request* send_request_array = new MPI_Request[size + pipe_length];
+  MPI_Request* recv_request_array = new MPI_Request[size + pipe_length];
+  MPI_Status* send_status_array   = new MPI_Status[size + pipe_length];
+  MPI_Status* recv_status_array   = new MPI_Status[size + pipe_length];
 
   /* root */
   if (rank == 0) {
@@ -239,10 +230,10 @@ int Coll_bcast_arrival_pattern_aware_wait::bcast(void *buf, int count,
     }
   }
 
-  free(send_request_array);
-  free(recv_request_array);
-  free(send_status_array);
-  free(recv_status_array);
+  delete[] send_request_array;
+  delete[] recv_request_array;
+  delete[] send_status_array;
+  delete[] recv_status_array;
   /* end pipeline */
 
   /* when count is not divisible by block size, use default BCAST for the remainder */
index 7783792..1552b72 100644 (file)
@@ -21,10 +21,6 @@ int Coll_bcast_arrival_pattern_aware::bcast(void *buf, int count,
   int tag = -COLL_TAG_BCAST;
   MPI_Status status;
   MPI_Request request;
-  MPI_Request *send_request_array;
-  MPI_Request *recv_request_array;
-  MPI_Status *send_status_array;
-  MPI_Status *recv_status_array;
 
   MPI_Status temp_status_array[MAX_NODE];
 
@@ -163,14 +159,10 @@ int Coll_bcast_arrival_pattern_aware::bcast(void *buf, int count,
   }
   /* pipeline bcast */
   else {
-    send_request_array =
-        (MPI_Request *) xbt_malloc((size + pipe_length) * sizeof(MPI_Request));
-    recv_request_array =
-        (MPI_Request *) xbt_malloc((size + pipe_length) * sizeof(MPI_Request));
-    send_status_array =
-        (MPI_Status *) xbt_malloc((size + pipe_length) * sizeof(MPI_Status));
-    recv_status_array =
-        (MPI_Status *) xbt_malloc((size + pipe_length) * sizeof(MPI_Status));
+    MPI_Request* send_request_array = new MPI_Request[size + pipe_length];
+    MPI_Request* recv_request_array = new MPI_Request[size + pipe_length];
+    MPI_Status* send_status_array   = new MPI_Status[size + pipe_length];
+    MPI_Status* recv_status_array   = new MPI_Status[size + pipe_length];
 
     if (rank == 0) {
       //double start2 = MPI_Wtime();
@@ -350,10 +342,10 @@ int Coll_bcast_arrival_pattern_aware::bcast(void *buf, int count,
 
     }
 
-    free(send_request_array);
-    free(recv_request_array);
-    free(send_status_array);
-    free(recv_status_array);
+    delete[] send_request_array;
+    delete[] recv_request_array;
+    delete[] send_status_array;
+    delete[] recv_status_array;
   }                             /* end pipeline */
 
   /* when count is not divisible by block size, use default BCAST for the remainder */
index 7d51422..7891c76 100644 (file)
@@ -21,7 +21,7 @@ int Coll_bcast_arrival_scatter::bcast(void *buf, int count,
                                           MPI_Comm comm)
 {
   int tag = -COLL_TAG_BCAST;//in order to use ANY_TAG, make this one positive
-  int header_tag = 10;
+  int header_tag = -10;
   MPI_Status status;
 
   int curr_remainder;
index 81406c8..07e4384 100644 (file)
@@ -31,11 +31,8 @@ Coll_bcast_flattree_pipeline::bcast(void *buff, int count,
   rank = comm->rank();
   num_procs = comm->size();
 
-  MPI_Request *request_array;
-  MPI_Status *status_array;
-
-  request_array = (MPI_Request *) xbt_malloc(pipe_length * sizeof(MPI_Request));
-  status_array = (MPI_Status *) xbt_malloc(pipe_length * sizeof(MPI_Status));
+  MPI_Request* request_array = new MPI_Request[pipe_length];
+  MPI_Status* status_array   = new MPI_Status[pipe_length];
 
   if (rank != root) {
     for (i = 0; i < pipe_length; i++) {
@@ -58,8 +55,8 @@ Coll_bcast_flattree_pipeline::bcast(void *buff, int count,
 
   }
 
-  free(request_array);
-  free(status_array);
+  delete[] request_array;
+  delete[] status_array;
   return MPI_SUCCESS;
 }
 
index 7178f2a..175c875 100644 (file)
@@ -11,9 +11,6 @@ int
 Coll_bcast_flattree::bcast(void *buff, int count, MPI_Datatype data_type,
                                int root, MPI_Comm comm)
 {
-  MPI_Request *req_ptr;
-  MPI_Request *reqs;
-
   int i, rank, num_procs;
   int tag = COLL_TAG_BCAST;
 
@@ -25,8 +22,8 @@ Coll_bcast_flattree::bcast(void *buff, int count, MPI_Datatype data_type,
   }
 
   else {
-    reqs = (MPI_Request *) xbt_malloc((num_procs - 1) * sizeof(MPI_Request));
-    req_ptr = reqs;
+    MPI_Request* reqs    = new MPI_Request[num_procs - 1];
+    MPI_Request* req_ptr = reqs;
 
     // Root sends data to all others
     for (i = 0; i < num_procs; i++) {
@@ -38,7 +35,7 @@ Coll_bcast_flattree::bcast(void *buff, int count, MPI_Datatype data_type,
     // wait on all requests
     Request::waitall(num_procs - 1, reqs, MPI_STATUSES_IGNORE);
 
-    free(reqs);
+    delete[] reqs;
   }
   return MPI_SUCCESS;
 }
index b65ef8e..8abda57 100644 (file)
@@ -177,8 +177,6 @@ int Coll_bcast_mvapich2_knomial_intra_node::bcast(void *buffer,
 {
     int local_size = 0, rank;
     int mpi_errno = MPI_SUCCESS;
-    MPI_Request *reqarray = NULL;
-    MPI_Status *starray = NULL;
     int src, dst, mask, relative_rank;
     int k;
     if (MV2_Bcast_function==NULL){
@@ -196,10 +194,9 @@ int Coll_bcast_mvapich2_knomial_intra_node::bcast(void *buffer,
     local_size = comm->size();
     rank = comm->rank();
 
+    MPI_Request* reqarray = new MPI_Request[2 * mv2_intra_node_knomial_factor];
 
-    reqarray=(MPI_Request *)xbt_malloc(2 * mv2_intra_node_knomial_factor * sizeof (MPI_Request));
-
-    starray=(MPI_Status *)xbt_malloc(2 * mv2_intra_node_knomial_factor * sizeof (MPI_Status));
+    MPI_Status* starray = new MPI_Status[2 * mv2_intra_node_knomial_factor];
 
     /* intra-node k-nomial bcast  */
     if (local_size > 1) {
@@ -240,8 +237,8 @@ int Coll_bcast_mvapich2_knomial_intra_node::bcast(void *buffer,
             mask /= mv2_intra_node_knomial_factor;
         }
     }
-    xbt_free(reqarray);
-    xbt_free(starray);
+    delete[] reqarray;
+    delete[] starray;
     return mpi_errno;
 }
 
@@ -257,7 +254,7 @@ int Coll_bcast_mvapich2_intra_node::bcast(void *buffer,
     size_t nbytes = 0;
     int is_homogeneous, is_contig;
     MPI_Aint type_size;
-    void *tmp_buf = NULL;
+    unsigned char* tmp_buf = nullptr;
     MPI_Comm shmem_comm;
 
     if (count == 0)
@@ -319,7 +316,7 @@ int Coll_bcast_mvapich2_intra_node::bcast(void *buffer,
         ) {
 
       if (not is_contig || not is_homogeneous) {
-        tmp_buf = (void*)smpi_get_tmp_sendbuffer(nbytes);
+        tmp_buf = smpi_get_tmp_sendbuffer(nbytes);
 
         /* TODO: Pipeline the packing and communication */
         // position = 0;
index 88c6b7d..1a3cb9b 100644 (file)
@@ -78,7 +78,7 @@ Coll_bcast_scatter_LR_allgather::bcast(void *buff, int count,
   MPI_Status status;
   int i, src, dst, rank, num_procs;
   int mask, relative_rank, curr_size, recv_size, send_size, nbytes;
-  int scatter_size, left, right, next_src, *recv_counts, *disps;
+  int scatter_size, left, right, next_src;
   int tag = COLL_TAG_BCAST;
 
   rank = comm->rank();
@@ -139,8 +139,8 @@ Coll_bcast_scatter_LR_allgather::bcast(void *buff, int count,
   }
 
   // done scatter now do allgather
-  recv_counts = (int *) xbt_malloc(sizeof(int) * num_procs);
-  disps = (int *) xbt_malloc(sizeof(int) * num_procs);
+  int* recv_counts = new int[num_procs];
+  int* disps       = new int[num_procs];
 
   for (i = 0; i < num_procs; i++) {
     recv_counts[i] = nbytes - i * scatter_size;
@@ -172,9 +172,8 @@ Coll_bcast_scatter_LR_allgather::bcast(void *buff, int count,
     next_src = (num_procs + next_src - 1) % num_procs;
   }
 
-
-  free(recv_counts);
-  free(disps);
+  delete[] recv_counts;
+  delete[] disps;
 
   return MPI_SUCCESS;
 }
index 2bd91df..d8cb946 100644 (file)
@@ -162,15 +162,15 @@ Coll_bcast_scatter_rdb_allgather::bcast (
     }
     else
     {
-        tmp_buf=(void*)xbt_malloc(nbytes);
-
-        /* TODO: Pipeline the packing and communication */
-        position = 0;
-        if (rank == root) {
-            mpi_errno = datatype->pack(buffer, count, tmp_buf, nbytes,
-                                       &position, comm);
-            if (mpi_errno) xbt_die("crash while packing %d", mpi_errno);
-        }
+      tmp_buf = new unsigned char[nbytes];
+
+      /* TODO: Pipeline the packing and communication */
+      position = 0;
+      if (rank == root) {
+        mpi_errno = datatype->pack(buffer, count, tmp_buf, nbytes, &position, comm);
+        if (mpi_errno)
+          xbt_die("crash while packing %d", mpi_errno);
+      }
     }
 
 
@@ -334,8 +334,8 @@ Coll_bcast_scatter_rdb_allgather::bcast (
     }
 
 fn_exit:
-/*    xbt_free(tmp_buf);*/
-    return mpi_errno;
+  /* delete[] static_cast<unsigned char*>(tmp_buf); */
+  return mpi_errno;
 }
 
 }
index d4cdf81..adeb3ce 100644 (file)
@@ -41,7 +41,7 @@
 #define MPIR_Gather_MV2_Direct Coll_gather_ompi_basic_linear::gather
 #define MPIR_Gather_MV2_two_level_Direct Coll_gather_ompi_basic_linear::gather
 #define MPIR_Gather_intra Coll_gather_mpich::gather
-typedef int (*MV2_Gather_function_ptr) (void *sendbuf,
+typedef int (*MV2_Gather_function_ptr) (const void *sendbuf,
     int sendcnt,
     MPI_Datatype sendtype,
     void *recvbuf,
@@ -80,7 +80,7 @@ namespace smpi{
  *                      intra node gather function
  * errflag           - (out) to record errors
  */
-static int MPIR_pt_pt_intra_gather( void *sendbuf, int sendcnt, MPI_Datatype sendtype,
+static int MPIR_pt_pt_intra_gather( const void *sendbuf, int sendcnt, MPI_Datatype sendtype,
                             void *recvbuf, int recvcnt, MPI_Datatype recvtype,
                             int root, int rank,
                             void *tmp_buf, int nbytes,
@@ -127,7 +127,7 @@ static int MPIR_pt_pt_intra_gather( void *sendbuf, int sendcnt, MPI_Datatype sen
 
 
 
-int Coll_gather_mvapich2_two_level::gather(void *sendbuf,
+int Coll_gather_mvapich2_two_level::gather(const void *sendbuf,
                                             int sendcnt,
                                             MPI_Datatype sendtype,
                                             void *recvbuf,
@@ -136,26 +136,25 @@ int Coll_gather_mvapich2_two_level::gather(void *sendbuf,
                                             int root,
                                             MPI_Comm comm)
 {
-    void *leader_gather_buf = NULL;
-    int comm_size, rank;
-    int local_rank, local_size;
-    int leader_comm_rank = -1, leader_comm_size = 0;
-    int mpi_errno = MPI_SUCCESS;
-    int recvtype_size = 0, sendtype_size = 0, nbytes=0;
-    int leader_root, leader_of_root;
-    MPI_Status status;
-    MPI_Aint sendtype_extent = 0, recvtype_extent = 0;  /* Datatype extent */
-    MPI_Aint true_lb = 0, sendtype_true_extent = 0, recvtype_true_extent = 0;
-    MPI_Comm shmem_comm, leader_comm;
-    void* tmp_buf = NULL;
-
-
-    //if not set (use of the algo directly, without mvapich2 selector)
-    if(MV2_Gather_intra_node_function==NULL)
-      MV2_Gather_intra_node_function= Coll_gather_mpich::gather;
-
-    if(comm->get_leaders_comm()==MPI_COMM_NULL){
-      comm->init_smp();
+  unsigned char* leader_gather_buf = NULL;
+  int comm_size, rank;
+  int local_rank, local_size;
+  int leader_comm_rank = -1, leader_comm_size = 0;
+  int mpi_errno     = MPI_SUCCESS;
+  int recvtype_size = 0, sendtype_size = 0, nbytes = 0;
+  int leader_root, leader_of_root;
+  MPI_Status status;
+  MPI_Aint sendtype_extent = 0, recvtype_extent = 0; /* Datatype extent */
+  MPI_Aint true_lb = 0, sendtype_true_extent = 0, recvtype_true_extent = 0;
+  MPI_Comm shmem_comm, leader_comm;
+  unsigned char* tmp_buf = NULL;
+
+  // if not set (use of the algo directly, without mvapich2 selector)
+  if (MV2_Gather_intra_node_function == NULL)
+    MV2_Gather_intra_node_function = Coll_gather_mpich::gather;
+
+  if (comm->get_leaders_comm() == MPI_COMM_NULL) {
+    comm->init_smp();
     }
     comm_size = comm->size();
     rank = comm->rank();
@@ -303,12 +302,8 @@ int Coll_gather_mvapich2_two_level::gather(void *sendbuf,
         node_sizes = comm->get_non_uniform_map();
 
         if (leader_comm_rank == leader_root) {
-          displs   = static_cast<int*>(xbt_malloc(sizeof(int) * leader_comm_size));
-          recvcnts = static_cast<int*>(xbt_malloc(sizeof(int) * leader_comm_size));
-          if (not displs || not recvcnts) {
-            mpi_errno = MPI_ERR_OTHER;
-            return mpi_errno;
-          }
+          displs   = new int[leader_comm_size];
+          recvcnts = new int[leader_comm_size];
         }
 
         if (root == leader_of_root) {
@@ -342,8 +337,8 @@ int Coll_gather_mvapich2_two_level::gather(void *sendbuf,
                          leader_root, leader_comm);
         }
         if (leader_comm_rank == leader_root) {
-          xbt_free(displs);
-          xbt_free(recvcnts);
+          delete[] displs;
+          delete[] recvcnts;
         }
       }
     } else {
index 7ee16c2..812ec45 100644 (file)
@@ -25,7 +25,7 @@
 namespace simgrid{
 namespace smpi{
 
-int Coll_gather_ompi_binomial::gather(void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount,
+int Coll_gather_ompi_binomial::gather(const void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount,
                                       MPI_Datatype rdtype, int root, MPI_Comm comm)
 {
     int line = -1;
@@ -34,8 +34,9 @@ int Coll_gather_ompi_binomial::gather(void* sbuf, int scount, MPI_Datatype sdtyp
     int vrank;
     int size;
     int total_recv = 0;
-    char *ptmp     = NULL;
-    char *tempbuf  = NULL;
+    unsigned char* ptmp    = nullptr;
+    unsigned char* tempbuf = nullptr;
+    const unsigned char* src_buf;
     int err;
     ompi_coll_tree_t* bmtree;
     MPI_Status status;
@@ -63,7 +64,7 @@ int Coll_gather_ompi_binomial::gather(void* sbuf, int scount, MPI_Datatype sdtyp
         rdtype->extent(&rtrue_lb, &rtrue_extent);
         if (0 == root) {
           /* root on 0, just use the recv buffer */
-          ptmp = (char*)rbuf;
+          ptmp = static_cast<unsigned char*>(rbuf);
           if (sbuf != MPI_IN_PLACE) {
             err = Datatype::copy(sbuf, scount, sdtype, ptmp, rcount, rdtype);
             if (MPI_SUCCESS != err) {
@@ -74,7 +75,7 @@ int Coll_gather_ompi_binomial::gather(void* sbuf, int scount, MPI_Datatype sdtyp
         } else {
           /* root is not on 0, allocate temp buffer for recv,
            * rotate data at the end */
-          tempbuf = (char*)smpi_get_tmp_recvbuffer(rtrue_extent + (rcount * size - 1) * rextent);
+          tempbuf = smpi_get_tmp_recvbuffer(rtrue_extent + (rcount * size - 1) * rextent);
           if (NULL == tempbuf) {
             err  = MPI_ERR_OTHER;
             line = __LINE__;
@@ -99,11 +100,12 @@ int Coll_gather_ompi_binomial::gather(void* sbuf, int scount, MPI_Datatype sdtyp
           }
         }
         total_recv = rcount;
+        src_buf    = ptmp;
     } else if (!(vrank % 2)) {
       /* other non-leaf nodes, allocate temp buffer for data received from
        * children, the most we need is half of the total data elements due
        * to the property of binimoal tree */
-      tempbuf = (char*)smpi_get_tmp_sendbuffer(strue_extent + (scount * size - 1) * sextent);
+      tempbuf = smpi_get_tmp_sendbuffer(strue_extent + (scount * size - 1) * sextent);
       if (NULL == tempbuf) {
         err  = MPI_ERR_OTHER;
         line = __LINE__;
@@ -124,11 +126,12 @@ int Coll_gather_ompi_binomial::gather(void* sbuf, int scount, MPI_Datatype sdtyp
       rcount     = scount;
       rextent    = sextent;
       total_recv = rcount;
+      src_buf    = ptmp;
     } else {
       /* leaf nodes, no temp buffer needed, use sdtype,scount as
        * rdtype,rdcount since they are ignored on non-root procs */
-      ptmp       = (char*)sbuf;
       total_recv = scount;
+      src_buf    = static_cast<const unsigned char*>(sbuf);
     }
 
     if (!(vrank % 2)) {
@@ -156,7 +159,7 @@ int Coll_gather_ompi_binomial::gather(void* sbuf, int scount, MPI_Datatype sdtyp
       /* all nodes except root send to parents */
       XBT_DEBUG("smpi_coll_tuned_gather_ompi_binomial rank %d send %d count %d\n", rank, bmtree->tree_prev, total_recv);
 
-      Request::send(ptmp, total_recv, sdtype, bmtree->tree_prev, COLL_TAG_GATHER, comm);
+      Request::send(src_buf, total_recv, sdtype, bmtree->tree_prev, COLL_TAG_GATHER, comm);
   }
     if (rank == root) {
       if (root != 0) {
@@ -199,7 +202,7 @@ int Coll_gather_ompi_binomial::gather(void* sbuf, int scount, MPI_Datatype sdtyp
  *  Accepts:  - same arguments as MPI_Gather(), first segment size
  *  Returns:  - MPI_SUCCESS or error code
  */
-int Coll_gather_ompi_linear_sync::gather(void *sbuf, int scount,
+int Coll_gather_ompi_linear_sync::gather(const void *sbuf, int scount,
                                          MPI_Datatype sdtype,
                                          void *rbuf, int rcount,
                                          MPI_Datatype rdtype,
@@ -247,7 +250,7 @@ int Coll_gather_ompi_linear_sync::gather(void *sbuf, int scount,
        first_segment_count = scount;
        COLL_TUNED_COMPUTED_SEGCOUNT((size_t)first_segment_size, typelng, first_segment_count);
 
-       Request::recv(sbuf, 0, MPI_BYTE, root, COLL_TAG_GATHER, comm, MPI_STATUS_IGNORE);
+       Request::recv(nullptr, 0, MPI_BYTE, root, COLL_TAG_GATHER, comm, MPI_STATUS_IGNORE);
 
        Request::send(sbuf, first_segment_count, sdtype, root, COLL_TAG_GATHER, comm);
 
@@ -352,7 +355,7 @@ int Coll_gather_ompi_linear_sync::gather(void *sbuf, int scount,
  *  Accepts:  - same arguments as MPI_Gather()
  *  Returns:  - MPI_SUCCESS or error code
  */
-int Coll_gather_ompi_basic_linear::gather(void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount,
+int Coll_gather_ompi_basic_linear::gather(const void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount,
                                           MPI_Datatype rdtype, int root, MPI_Comm comm)
 {
     int i;
index 3f48c44..b341762 100644 (file)
@@ -14,16 +14,12 @@ int reduce_NTSL_segment_size_in_byte = 8192;
 */
 namespace simgrid{
 namespace smpi{
-int Coll_reduce_NTSL::reduce(void *buf, void *rbuf, int count,
+int Coll_reduce_NTSL::reduce(const void *buf, void *rbuf, int count,
                                 MPI_Datatype datatype, MPI_Op op, int root,
                                 MPI_Comm comm)
 {
   int tag = COLL_TAG_REDUCE;
   MPI_Status status;
-  MPI_Request *send_request_array;
-  MPI_Request *recv_request_array;
-  MPI_Status *send_status_array;
-  MPI_Status *recv_status_array;
   int rank, size;
   int i;
   MPI_Aint extent;
@@ -64,8 +60,7 @@ int Coll_reduce_NTSL::reduce(void *buf, void *rbuf, int count,
      }
    */
 
-  char *tmp_buf;
-  tmp_buf = (char *) smpi_get_tmp_sendbuffer(count * extent);
+  unsigned char* tmp_buf = smpi_get_tmp_sendbuffer(count * extent);
 
   Request::sendrecv(buf, count, datatype, rank, tag, rbuf, count, datatype, rank,
                tag, comm, &status);
@@ -88,20 +83,15 @@ int Coll_reduce_NTSL::reduce(void *buf, void *rbuf, int count,
 
   /* pipeline */
   else {
-    send_request_array =
-        (MPI_Request *) xbt_malloc((size + pipe_length) * sizeof(MPI_Request));
-    recv_request_array =
-        (MPI_Request *) xbt_malloc((size + pipe_length) * sizeof(MPI_Request));
-    send_status_array =
-        (MPI_Status *) xbt_malloc((size + pipe_length) * sizeof(MPI_Status));
-    recv_status_array =
-        (MPI_Status *) xbt_malloc((size + pipe_length) * sizeof(MPI_Status));
+    MPI_Request* send_request_array = new MPI_Request[size + pipe_length];
+    MPI_Request* recv_request_array = new MPI_Request[size + pipe_length];
+    MPI_Status* send_status_array   = new MPI_Status[size + pipe_length];
+    MPI_Status* recv_status_array   = new MPI_Status[size + pipe_length];
 
     /* root recv data */
     if (rank == root) {
       for (i = 0; i < pipe_length; i++) {
-        recv_request_array[i] = Request::irecv((char *) tmp_buf + (i * increment), segment, datatype, from,
-                  (tag + i), comm);
+        recv_request_array[i] = Request::irecv(tmp_buf + (i * increment), segment, datatype, from, (tag + i), comm);
       }
       for (i = 0; i < pipe_length; i++) {
         Request::wait(&recv_request_array[i], &status);
@@ -122,8 +112,7 @@ int Coll_reduce_NTSL::reduce(void *buf, void *rbuf, int count,
     /* intermediate nodes relay (receive, reduce, then send) data */
     else {
       for (i = 0; i < pipe_length; i++) {
-        recv_request_array[i] = Request::irecv((char *) tmp_buf + (i * increment), segment, datatype, from,
-                  (tag + i), comm);
+        recv_request_array[i] = Request::irecv(tmp_buf + (i * increment), segment, datatype, from, (tag + i), comm);
       }
       for (i = 0; i < pipe_length; i++) {
         Request::wait(&recv_request_array[i], &status);
@@ -135,10 +124,10 @@ int Coll_reduce_NTSL::reduce(void *buf, void *rbuf, int count,
       Request::waitall((pipe_length), send_request_array, send_status_array);
     }
 
-    free(send_request_array);
-    free(recv_request_array);
-    free(send_status_array);
-    free(recv_status_array);
+    delete[] send_request_array;
+    delete[] recv_request_array;
+    delete[] send_status_array;
+    delete[] recv_status_array;
   }                             /* end pipeline */
 
   /* when count is not divisible by block size, use default BCAST for the remainder */
index d5a03ba..1ff8bd4 100644 (file)
@@ -19,7 +19,7 @@ int reduce_arrival_pattern_aware_segment_size_in_byte = 8192;
 namespace simgrid{
 namespace smpi{
 /* Non-topology-specific pipelined linear-reduce function */
-int Coll_reduce_arrival_pattern_aware::reduce(void *buf, void *rbuf,
+int Coll_reduce_arrival_pattern_aware::reduce(const void *buf, void *rbuf,
                                                  int count,
                                                  MPI_Datatype datatype,
                                                  MPI_Op op, int root,
@@ -29,10 +29,6 @@ int Coll_reduce_arrival_pattern_aware::reduce(void *buf, void *rbuf,
   int tag = -COLL_TAG_REDUCE;
   MPI_Status status;
   MPI_Request request;
-  MPI_Request *send_request_array;
-  MPI_Request *recv_request_array;
-  MPI_Status *send_status_array;
-  MPI_Status *recv_status_array;
 
   MPI_Status temp_status_array[MAX_NODE];
 
@@ -72,8 +68,7 @@ int Coll_reduce_arrival_pattern_aware::reduce(void *buf, void *rbuf,
     already_received[i] = 0;
   }
 
-  char *tmp_buf;
-  tmp_buf = (char *) smpi_get_tmp_sendbuffer(count * extent);
+  unsigned char* tmp_buf = smpi_get_tmp_sendbuffer(count * extent);
 
   Request::sendrecv(buf, count, datatype, rank, tag, rbuf, count, datatype, rank,
                tag, comm, &status);
@@ -90,11 +85,10 @@ int Coll_reduce_arrival_pattern_aware::reduce(void *buf, void *rbuf,
 
         for (i = 1; i < size; i++) {
           if (already_received[i] == 0) {
-            Request::iprobe(i, MPI_ANY_TAG, comm, &flag_array[i],
-                             MPI_STATUSES_IGNORE);
-            simcall_process_sleep(0.0001);
+            Request::iprobe(i, MPI_ANY_TAG, comm, &flag_array[i], MPI_STATUSES_IGNORE);
+            simgrid::s4u::this_actor::sleep_for(0.0001);
+          }
             }
-        }
 
         header_index = 0;
         /* recv 1-byte message */
@@ -190,14 +184,10 @@ int Coll_reduce_arrival_pattern_aware::reduce(void *buf, void *rbuf,
   else {
     //    printf("node %d start\n",rank);
 
-    send_request_array =
-        (MPI_Request *) xbt_malloc((size + pipe_length) * sizeof(MPI_Request));
-    recv_request_array =
-        (MPI_Request *) xbt_malloc((size + pipe_length) * sizeof(MPI_Request));
-    send_status_array =
-        (MPI_Status *) xbt_malloc((size + pipe_length) * sizeof(MPI_Status));
-    recv_status_array =
-        (MPI_Status *) xbt_malloc((size + pipe_length) * sizeof(MPI_Status));
+    MPI_Request* send_request_array = new MPI_Request[size + pipe_length];
+    MPI_Request* recv_request_array = new MPI_Request[size + pipe_length];
+    MPI_Status* send_status_array   = new MPI_Status[size + pipe_length];
+    MPI_Status* recv_status_array   = new MPI_Status[size + pipe_length];
 
     if (rank == 0) {
       sent_count = 0;
@@ -319,13 +309,10 @@ int Coll_reduce_arrival_pattern_aware::reduce(void *buf, void *rbuf,
       }
     }                           /* non-root */
 
-
-
-
-    free(send_request_array);
-    free(recv_request_array);
-    free(send_status_array);
-    free(recv_status_array);
+    delete[] send_request_array;
+    delete[] recv_request_array;
+    delete[] send_status_array;
+    delete[] recv_status_array;
 
     //printf("node %d done\n",rank);
   }                             /* end pipeline */
index 76dc6b6..3525231 100644 (file)
@@ -10,7 +10,7 @@
 //#include <star-reduction.c>
 namespace simgrid{
 namespace smpi{
-int Coll_reduce_binomial::reduce(void *sendbuf, void *recvbuf, int count,
+int Coll_reduce_binomial::reduce(const void *sendbuf, void *recvbuf, int count,
                                     MPI_Datatype datatype, MPI_Op op, int root,
                                     MPI_Comm comm)
 {
@@ -20,7 +20,6 @@ int Coll_reduce_binomial::reduce(void *sendbuf, void *recvbuf, int count,
   int dst;
   int tag = COLL_TAG_REDUCE;
   MPI_Aint extent;
-  void *tmp_buf;
   MPI_Aint true_lb, true_extent;
   if (count == 0)
     return 0;
@@ -29,7 +28,7 @@ int Coll_reduce_binomial::reduce(void *sendbuf, void *recvbuf, int count,
 
   extent = datatype->get_extent();
 
-  tmp_buf = (void *) smpi_get_tmp_sendbuffer(count * extent);
+  unsigned char* tmp_buf = smpi_get_tmp_sendbuffer(count * extent);
   int is_commutative =  (op==MPI_OP_NULL || op->is_commutative());
   mask = 1;
 
@@ -43,7 +42,7 @@ int Coll_reduce_binomial::reduce(void *sendbuf, void *recvbuf, int count,
   datatype->extent(&true_lb, &true_extent);
 
   /* adjust for potential negative lower bound in datatype */
-  tmp_buf = (void *)((char*)tmp_buf - true_lb);
+  tmp_buf = tmp_buf - true_lb;
 
   /* If I'm not the root, then my recvbuf may not be valid, therefore
      I have to allocate a temporary one */
@@ -87,7 +86,7 @@ int Coll_reduce_binomial::reduce(void *sendbuf, void *recvbuf, int count,
   }
 
   if (rank != root) {
-    smpi_free_tmp_buffer(recvbuf);
+    smpi_free_tmp_buffer(static_cast<unsigned char*>(recvbuf));
   }
   smpi_free_tmp_buffer(tmp_buf);
 
index 46b0496..e9ffc8a 100644 (file)
@@ -9,7 +9,7 @@
 namespace simgrid{
 namespace smpi{
 int
-Coll_reduce_flat_tree::reduce(void *sbuf, void *rbuf, int count,
+Coll_reduce_flat_tree::reduce(const void *sbuf, void *rbuf, int count,
                                  MPI_Datatype dtype, MPI_Op op,
                                  int root, MPI_Comm comm)
 {
@@ -17,8 +17,8 @@ Coll_reduce_flat_tree::reduce(void *sbuf, void *rbuf, int count,
   int size;
   int rank;
   MPI_Aint extent;
-  char *origin = 0;
-  char *inbuf;
+  unsigned char* origin = nullptr;
+  const unsigned char* inbuf;
   MPI_Status status;
 
   rank = comm->rank();
@@ -36,8 +36,7 @@ Coll_reduce_flat_tree::reduce(void *sbuf, void *rbuf, int count,
      messages. */
 
   if (size > 1)
-    origin = (char *) smpi_get_tmp_recvbuffer(count * extent);
-
+    origin = smpi_get_tmp_recvbuffer(count * extent);
 
   /* Initialize the receive buffer. */
   if (rank == (size - 1))
@@ -50,7 +49,7 @@ Coll_reduce_flat_tree::reduce(void *sbuf, void *rbuf, int count,
 
   for (i = size - 2; i >= 0; --i) {
     if (rank == i)
-      inbuf = static_cast<char*>(sbuf);
+      inbuf = static_cast<const unsigned char*>(sbuf);
     else {
       Request::recv(origin, count, dtype, i, tag, comm, &status);
       inbuf = origin;
@@ -61,8 +60,7 @@ Coll_reduce_flat_tree::reduce(void *sbuf, void *rbuf, int count,
 
   }
 
-  if (origin)
-    smpi_free_tmp_buffer(origin);
+  smpi_free_tmp_buffer(origin);
 
   /* All done */
   return 0;
index 13454c2..57069b0 100644 (file)
@@ -119,7 +119,7 @@ static int MPIR_Reduce_knomial_trace(int root, int reduce_knomial_factor,
 namespace simgrid{
 namespace smpi{
 int Coll_reduce_mvapich2_knomial::reduce (
-        void *sendbuf,
+        const void *sendbuf,
         void *recvbuf,
         int count,
         MPI_Datatype datatype,
@@ -136,9 +136,6 @@ int Coll_reduce_mvapich2_knomial::reduce (
     MPI_Status status;
     int recv_iter=0, dst=-1, expected_send_count, expected_recv_count;
     int *src_array=NULL;
-    void **tmp_buf=NULL;
-    MPI_Request *requests=NULL;
-
 
     if (count == 0) return MPI_SUCCESS;
 
@@ -176,11 +173,11 @@ int Coll_reduce_mvapich2_knomial::reduce (
            &dst, &expected_send_count, &expected_recv_count, &src_array);
 
     if(expected_recv_count > 0 ) {
-        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 * std::max(extent, true_extent));
-            tmp_buf[k] = (void *)((char*)tmp_buf[k] - true_lb);
+      unsigned char** tmp_buf = new unsigned char*[expected_recv_count];
+      MPI_Request* requests = new MPI_Request[expected_recv_count];
+      for (k = 0; k < expected_recv_count; k++) {
+        tmp_buf[k] = smpi_get_tmp_sendbuffer(count * std::max(extent, true_extent));
+        tmp_buf[k] = tmp_buf[k] - true_lb;
         }
 
         while(recv_iter  < expected_recv_count) {
@@ -206,8 +203,8 @@ int Coll_reduce_mvapich2_knomial::reduce (
         for(k=0; k < expected_recv_count; k++ ) {
             smpi_free_tmp_buffer(tmp_buf[k]);
         }
-        xbt_free(tmp_buf);
-        xbt_free(requests);
+        delete[] tmp_buf;
+        delete[] requests;
     }
 
     if(src_array != NULL) {
@@ -220,7 +217,7 @@ int Coll_reduce_mvapich2_knomial::reduce (
 
         Request::waitall(1, &send_request, &status);
 
-        smpi_free_tmp_buffer((void *)((char*)recvbuf + true_lb));
+        smpi_free_tmp_buffer(static_cast<unsigned char*>(recvbuf) + true_lb);
     }
 
     /* --END ERROR HANDLING-- */
index a10160d..4d47d23 100644 (file)
@@ -50,7 +50,7 @@
 #define MPIR_Reduce_redscat_gather_MV2 Coll_reduce_scatter_gather::reduce
 #define MPIR_Reduce_shmem_MV2 Coll_reduce_ompi_basic_linear::reduce
 
-extern int (*MV2_Reduce_function)( void *sendbuf,
+extern int (*MV2_Reduce_function)( const void *sendbuf,
     void *recvbuf,
     int count,
     MPI_Datatype datatype,
@@ -58,7 +58,7 @@ extern int (*MV2_Reduce_function)( void *sendbuf,
     int root,
     MPI_Comm  comm_ptr);
 
-extern int (*MV2_Reduce_intra_function)( void *sendbuf,
+extern int (*MV2_Reduce_intra_function)( const void *sendbuf,
     void *recvbuf,
     int count,
     MPI_Datatype datatype,
@@ -68,14 +68,14 @@ extern int (*MV2_Reduce_intra_function)( void *sendbuf,
 
 
 /*Fn pointers for collectives */
-static int (*reduce_fn)(void *sendbuf,
+static int (*reduce_fn)(const void *sendbuf,
                              void *recvbuf,
                              int count,
                              MPI_Datatype datatype,
                              MPI_Op op, int root, MPI_Comm  comm);
 namespace simgrid{
 namespace smpi{
-int Coll_reduce_mvapich2_two_level::reduce( void *sendbuf,
+int Coll_reduce_mvapich2_two_level::reduce( const void *sendbuf,
                                      void *recvbuf,
                                      int count,
                                      MPI_Datatype datatype,
@@ -88,7 +88,8 @@ int Coll_reduce_mvapich2_two_level::reduce( void *sendbuf,
     int leader_comm_rank = -1, leader_comm_size = 0;
     MPI_Comm shmem_comm, leader_comm;
     int leader_root, leader_of_root;
-    void *in_buf = NULL, *out_buf = NULL, *tmp_buf = NULL;
+    const unsigned char* in_buf = nullptr;
+    unsigned char *out_buf = nullptr, *tmp_buf = nullptr;
     MPI_Aint true_lb, true_extent, extent;
     int is_commutative = 0, stride = 0;
     int intra_node_root=0;
@@ -126,29 +127,29 @@ int Coll_reduce_mvapich2_two_level::reduce( void *sendbuf,
         if (stride <= MV2_INTRA_SHMEM_REDUCE_MSG &&
             is_commutative == 1) {
             if (local_rank == 0 ) {
-                tmp_buf = (void*)smpi_get_tmp_sendbuffer(count * std::max(extent, true_extent));
-                tmp_buf = (void *) ((char *) tmp_buf - true_lb);
+              tmp_buf = smpi_get_tmp_sendbuffer(count * std::max(extent, true_extent));
+              tmp_buf = tmp_buf - true_lb;
             }
 
             if (sendbuf != MPI_IN_PLACE) {
-                in_buf = (void *)sendbuf;
+              in_buf = static_cast<const unsigned char*>(sendbuf);
             } else {
-                in_buf = recvbuf;
+              in_buf = static_cast<const unsigned char*>(recvbuf);
             }
 
             if (local_rank == 0) {
                  if( my_rank != root) {
                      out_buf = tmp_buf;
                  } else {
-                     out_buf = recvbuf;
-                     if(in_buf == out_buf) {
-                        in_buf = MPI_IN_PLACE;
-                        out_buf = recvbuf;
+                   out_buf = static_cast<unsigned char*>(recvbuf);
+                   if (in_buf == out_buf) {
+                     in_buf  = static_cast<const unsigned char*>(MPI_IN_PLACE);
+                     out_buf = static_cast<unsigned char*>(recvbuf);
                      }
                  }
             } else {
-                in_buf  = (void *)sendbuf;
-                out_buf = NULL;
+              in_buf  = static_cast<const unsigned char*>(sendbuf);
+              out_buf = nullptr;
             }
 
             if (count * (std::max(extent, true_extent)) < SHMEM_COLL_BLOCK_SIZE) {
@@ -177,8 +178,8 @@ int Coll_reduce_mvapich2_two_level::reduce( void *sendbuf,
                                   root, comm);
         }
         /* We are done */
-        if(tmp_buf!=NULL)
-          smpi_free_tmp_buffer((void *) ((char *) tmp_buf + true_lb));
+        if (tmp_buf != nullptr)
+          smpi_free_tmp_buffer(tmp_buf + true_lb);
         goto fn_exit;
     }
 
@@ -190,18 +191,18 @@ 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 * std::max(extent, true_extent));
-        tmp_buf = (void *) ((char *) tmp_buf - true_lb);
+        tmp_buf          = smpi_get_tmp_sendbuffer(count * std::max(extent, true_extent));
+        tmp_buf          = tmp_buf - true_lb;
     }
     if (sendbuf != MPI_IN_PLACE) {
-        in_buf = (void *)sendbuf;
+      in_buf = static_cast<const unsigned char*>(sendbuf);
     } else {
-        in_buf = recvbuf;
+      in_buf = static_cast<const unsigned char*>(recvbuf);
     }
     if (local_rank == 0) {
-        out_buf = tmp_buf;
+      out_buf = static_cast<unsigned char*>(tmp_buf);
     } else {
-        out_buf = NULL;
+      out_buf = nullptr;
     }
 
 
@@ -228,8 +229,8 @@ int Coll_reduce_mvapich2_two_level::reduce( void *sendbuf,
                                       intra_node_root, shmem_comm);
         }
     } else {
-        smpi_free_tmp_buffer((void *) ((char *) tmp_buf + true_lb));
-        tmp_buf = in_buf;
+      smpi_free_tmp_buffer(tmp_buf + true_lb);
+      tmp_buf = (unsigned char*)in_buf; // xxx
     }
 
     /* Now work on the inter-leader phase. Data is in tmp_buf */
@@ -243,28 +244,26 @@ int Coll_reduce_mvapich2_two_level::reduce( void *sendbuf,
                  * root of the reduce op. So, I will write the
                  * final result directly into my recvbuf */
                 if(tmp_buf != recvbuf) {
-                    in_buf = tmp_buf;
-                    out_buf = recvbuf;
+                  in_buf  = tmp_buf;
+                  out_buf = static_cast<unsigned char*>(recvbuf);
                 } else {
 
-                     in_buf = (char *)smpi_get_tmp_sendbuffer(count*
-                                       datatype->get_extent());
-                     Datatype::copy(tmp_buf, count, datatype,
-                                        in_buf, count, datatype);
-                    //in_buf = MPI_IN_PLACE;
-                    out_buf = recvbuf;
+                  unsigned char* buf = smpi_get_tmp_sendbuffer(count * datatype->get_extent());
+                  Datatype::copy(tmp_buf, count, datatype, buf, count, datatype);
+                  // in_buf = MPI_IN_PLACE;
+                  in_buf  = buf;
+                  out_buf = static_cast<unsigned char*>(recvbuf);
                 }
             } else {
-                in_buf = (char *)smpi_get_tmp_sendbuffer(count*
-                                       datatype->get_extent());
-                Datatype::copy(tmp_buf, count, datatype,
-                                        in_buf, count, datatype);
-                //in_buf = MPI_IN_PLACE;
-                out_buf = tmp_buf;
+              unsigned char* buf = smpi_get_tmp_sendbuffer(count * datatype->get_extent());
+              Datatype::copy(tmp_buf, count, datatype, buf, count, datatype);
+              // in_buf = MPI_IN_PLACE;
+              in_buf  = buf;
+              out_buf = tmp_buf;
             }
         } else {
             in_buf = tmp_buf;
-            out_buf = NULL;
+            out_buf = nullptr;
         }
 
         /* inter-leader communication  */
@@ -275,20 +274,15 @@ int Coll_reduce_mvapich2_two_level::reduce( void *sendbuf,
     }
 
     if (local_size > 1) {
-        /* Send the message to the root if the leader is not the
-         * root of the reduce operation. The reduced data is in tmp_buf */
-        if ((local_rank == 0) && (root != my_rank)
-            && (leader_root == leader_comm_rank)) {
-            Request::send(tmp_buf, count, datatype, root,
-                                     COLL_TAG_REDUCE+1, comm);
-        }
-        if ((local_rank != 0) && (root == my_rank)) {
-            Request::recv(recvbuf, count, datatype,
-                                     leader_of_root,
-                                     COLL_TAG_REDUCE+1, comm,
-                                     MPI_STATUS_IGNORE);
-        }
-      smpi_free_tmp_buffer((void *) ((char *) tmp_buf + true_lb));
+      /* Send the message to the root if the leader is not the
+       * root of the reduce operation. The reduced data is in tmp_buf */
+      if ((local_rank == 0) && (root != my_rank) && (leader_root == leader_comm_rank)) {
+        Request::send(tmp_buf, count, datatype, root, COLL_TAG_REDUCE + 1, comm);
+      }
+      if ((local_rank != 0) && (root == my_rank)) {
+        Request::recv(recvbuf, count, datatype, leader_of_root, COLL_TAG_REDUCE + 1, comm, MPI_STATUS_IGNORE);
+      }
+      smpi_free_tmp_buffer(tmp_buf + true_lb);
 
       if (leader_comm_rank == leader_root) {
         if (my_rank != root || (my_rank == root && tmp_buf == recvbuf)) {
index d6f2a85..ce4d8d5 100644 (file)
@@ -25,7 +25,7 @@
 namespace simgrid{
 namespace smpi{
 
-int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int original_count,
+int smpi_coll_tuned_ompi_reduce_generic(const void* sendbuf, void* recvbuf, int original_count,
                                     MPI_Datatype datatype, MPI_Op  op,
                                     int root, MPI_Comm comm,
                                     ompi_coll_tree_t* tree, int count_by_segment,
@@ -41,31 +41,31 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
  * for the first block: thus we must copy sendbuf to accumbuf on intermediate
  * to keep the optimized loop happy.
  */
-int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int original_count,
+int smpi_coll_tuned_ompi_reduce_generic(const void* sendbuf, void* recvbuf, int original_count,
                                     MPI_Datatype datatype, MPI_Op  op,
                                     int root, MPI_Comm comm,
                                     ompi_coll_tree_t* tree, int count_by_segment,
                                     int max_outstanding_reqs )
 {
-    char *inbuf[2] = {NULL, NULL}, *inbuf_free[2] = {NULL, NULL};
-    char *accumbuf = NULL, *accumbuf_free = NULL;
-    char *local_op_buffer = NULL, *sendtmpbuf = NULL;
-    ptrdiff_t extent, lower_bound, segment_increment;
-    MPI_Request  reqs[2] = {MPI_REQUEST_NULL, MPI_REQUEST_NULL};
-    int num_segments, line, ret, segindex, i, rank;
-    int recvcount, prevcount, inbi;
-
-    /**
-     * Determine number of segments and number of elements
-     * sent per operation
-     */
-    datatype->extent(&lower_bound, &extent);
-    num_segments = (original_count + count_by_segment - 1) / count_by_segment;
-    segment_increment = count_by_segment * extent;
-
-    sendtmpbuf = (char*) sendbuf;
-    if( sendbuf == MPI_IN_PLACE ) {
-        sendtmpbuf = (char *)recvbuf;
+  unsigned char *inbuf[2] = {nullptr, nullptr}, *inbuf_free[2] = {nullptr, nullptr};
+  unsigned char *accumbuf = nullptr, *accumbuf_free = nullptr;
+  const unsigned char *local_op_buffer = nullptr, *sendtmpbuf = nullptr;
+  ptrdiff_t extent, lower_bound, segment_increment;
+  MPI_Request reqs[2] = {MPI_REQUEST_NULL, MPI_REQUEST_NULL};
+  int num_segments, line, ret, segindex, i, rank;
+  int recvcount, prevcount, inbi;
+
+  /**
+   * Determine number of segments and number of elements
+   * sent per operation
+   */
+  datatype->extent(&lower_bound, &extent);
+  num_segments      = (original_count + count_by_segment - 1) / count_by_segment;
+  segment_increment = count_by_segment * extent;
+
+  sendtmpbuf = static_cast<const unsigned char*>(sendbuf);
+  if (sendbuf == MPI_IN_PLACE) {
+    sendtmpbuf = static_cast<const unsigned char*>(recvbuf);
     }
 
     XBT_DEBUG("coll:tuned:reduce_generic count %d, msg size %lu, segsize %lu, max_requests %d", original_count,
@@ -82,35 +82,40 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
 
         /* handle non existant recv buffer (i.e. its NULL) and
            protect the recv buffer on non-root nodes */
-        accumbuf = (char*)recvbuf;
-        if( (NULL == accumbuf) || (root != rank) ) {
-            /* Allocate temporary accumulator buffer. */
-            accumbuf_free = (char*)smpi_get_tmp_sendbuffer(true_extent +
-                                          (original_count - 1) * extent);
-            if (accumbuf_free == NULL) {
-                line = __LINE__; ret = -1; goto error_hndl;
-            }
-            accumbuf = accumbuf_free - lower_bound;
+        accumbuf = static_cast<unsigned char*>(recvbuf);
+        if (nullptr == accumbuf || root != rank) {
+          /* Allocate temporary accumulator buffer. */
+          accumbuf_free = smpi_get_tmp_sendbuffer(true_extent + (original_count - 1) * extent);
+          if (accumbuf_free == nullptr) {
+            line = __LINE__;
+            ret  = -1;
+            goto error_hndl;
+          }
+          accumbuf = accumbuf_free - lower_bound;
         }
 
         /* If this is a non-commutative operation we must copy
            sendbuf to the accumbuf, in order to simplfy the loops */
         if ((op != MPI_OP_NULL && not op->is_commutative())) {
-          Datatype::copy((char*)sendtmpbuf, original_count, datatype, (char*)accumbuf, original_count, datatype);
+          Datatype::copy(sendtmpbuf, original_count, datatype, accumbuf, original_count, datatype);
         }
         /* Allocate two buffers for incoming segments */
         real_segment_size = true_extent + (count_by_segment - 1) * extent;
-        inbuf_free[0] = (char*) smpi_get_tmp_recvbuffer(real_segment_size);
-        if( inbuf_free[0] == NULL ) {
-            line = __LINE__; ret = -1; goto error_hndl;
+        inbuf_free[0]     = smpi_get_tmp_recvbuffer(real_segment_size);
+        if (inbuf_free[0] == nullptr) {
+          line = __LINE__;
+          ret  = -1;
+          goto error_hndl;
         }
         inbuf[0] = inbuf_free[0] - lower_bound;
         /* if there is chance to overlap communication -
            allocate second buffer */
         if( (num_segments > 1) || (tree->tree_nextsize > 1) ) {
-            inbuf_free[1] = (char*) smpi_get_tmp_recvbuffer(real_segment_size);
-            if( inbuf_free[1] == NULL ) {
-                line = __LINE__; ret = -1; goto error_hndl;
+          inbuf_free[1] = smpi_get_tmp_recvbuffer(real_segment_size);
+          if (inbuf_free[1] == nullptr) {
+            line = __LINE__;
+            ret  = -1;
+            goto error_hndl;
             }
             inbuf[1] = inbuf_free[1] - lower_bound;
         }
@@ -323,7 +328,7 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi
 */
 
 
-int Coll_reduce_ompi_chain::reduce( void *sendbuf, void *recvbuf, int count,
+int Coll_reduce_ompi_chain::reduce(const void *sendbuf, void *recvbuf, int count,
                                         MPI_Datatype datatype,
                                         MPI_Op  op, int root,
                                         MPI_Comm  comm
@@ -351,7 +356,7 @@ int Coll_reduce_ompi_chain::reduce( void *sendbuf, void *recvbuf, int count,
 }
 
 
-int Coll_reduce_ompi_pipeline::reduce( void *sendbuf, void *recvbuf,
+int Coll_reduce_ompi_pipeline::reduce(const void *sendbuf, void *recvbuf,
                                            int count, MPI_Datatype datatype,
                                            MPI_Op  op, int root,
                                            MPI_Comm  comm  )
@@ -395,7 +400,7 @@ int Coll_reduce_ompi_pipeline::reduce( void *sendbuf, void *recvbuf,
                                            segcount, 0);
 }
 
-int Coll_reduce_ompi_binary::reduce( void *sendbuf, void *recvbuf,
+int Coll_reduce_ompi_binary::reduce(const void *sendbuf, void *recvbuf,
                                          int count, MPI_Datatype datatype,
                                          MPI_Op  op, int root,
                                          MPI_Comm  comm)
@@ -425,7 +430,7 @@ int Coll_reduce_ompi_binary::reduce( void *sendbuf, void *recvbuf,
                                            segcount, 0);
 }
 
-int Coll_reduce_ompi_binomial::reduce( void *sendbuf, void *recvbuf,
+int Coll_reduce_ompi_binomial::reduce(const void *sendbuf, void *recvbuf,
                                            int count, MPI_Datatype datatype,
                                            MPI_Op  op, int root,
                                            MPI_Comm  comm)
@@ -472,7 +477,7 @@ int Coll_reduce_ompi_binomial::reduce( void *sendbuf, void *recvbuf,
  * Acecpts:       same as MPI_Reduce()
  * Returns:       MPI_SUCCESS or error code
  */
-int Coll_reduce_ompi_in_order_binary::reduce( void *sendbuf, void *recvbuf,
+int Coll_reduce_ompi_in_order_binary::reduce(const void *sendbuf, void *recvbuf,
                                                   int count,
                                                   MPI_Datatype datatype,
                                                   MPI_Op  op, int root,
@@ -482,7 +487,6 @@ int Coll_reduce_ompi_in_order_binary::reduce( void *sendbuf, void *recvbuf,
     int ret;
     int rank, size, io_root;
     int segcount = count;
-    void *use_this_sendbuf = NULL, *use_this_recvbuf = NULL;
     size_t typelng;
 
     rank = comm->rank();
@@ -504,30 +508,29 @@ int Coll_reduce_ompi_in_order_binary::reduce( void *sendbuf, void *recvbuf,
        operations for non-commutative ops.
     */
     io_root = size - 1;
-    use_this_sendbuf = sendbuf;
-    use_this_recvbuf = recvbuf;
+    const void* use_this_sendbuf = sendbuf;
+    void* use_this_recvbuf       = recvbuf;
+    unsigned char* tmp_sendbuf   = nullptr;
+    unsigned char* tmp_recvbuf   = nullptr;
     if (io_root != root) {
         ptrdiff_t text, ext;
-        char *tmpbuf = NULL;
 
         ext=datatype->get_extent();
         text=datatype->get_extent();
 
         if ((root == rank) && (MPI_IN_PLACE == sendbuf)) {
-            tmpbuf = (char *) smpi_get_tmp_sendbuffer(text + (count - 1) * ext);
-            if (NULL == tmpbuf) {
-                return MPI_ERR_INTERN;
-            }
-            Datatype::copy (
-                                                (char*)recvbuf, count, datatype,
-                                                (char*)tmpbuf, count, datatype);
-            use_this_sendbuf = tmpbuf;
+          tmp_sendbuf = smpi_get_tmp_sendbuffer(text + (count - 1) * ext);
+          if (NULL == tmp_sendbuf) {
+            return MPI_ERR_INTERN;
+          }
+          Datatype::copy(recvbuf, count, datatype, tmp_sendbuf, count, datatype);
+          use_this_sendbuf = tmp_sendbuf;
         } else if (io_root == rank) {
-            tmpbuf = (char *) smpi_get_tmp_recvbuffer(text + (count - 1) * ext);
-            if (NULL == tmpbuf) {
-                return MPI_ERR_INTERN;
-            }
-            use_this_recvbuf = tmpbuf;
+          tmp_recvbuf = smpi_get_tmp_recvbuffer(text + (count - 1) * ext);
+          if (NULL == tmp_recvbuf) {
+            return MPI_ERR_INTERN;
+          }
+          use_this_recvbuf = tmp_recvbuf;
         }
     }
 
@@ -546,7 +549,7 @@ int Coll_reduce_ompi_in_order_binary::reduce( void *sendbuf, void *recvbuf,
                                     COLL_TAG_REDUCE, comm,
                                     MPI_STATUS_IGNORE);
             if (MPI_IN_PLACE == sendbuf) {
-              smpi_free_tmp_buffer(use_this_sendbuf);
+              smpi_free_tmp_buffer(tmp_sendbuf);
             }
 
         } else if (io_root == rank) {
@@ -554,7 +557,7 @@ int Coll_reduce_ompi_in_order_binary::reduce( void *sendbuf, void *recvbuf,
             Request::send(use_this_recvbuf, count, datatype, root,
                                     COLL_TAG_REDUCE,
                                     comm);
-            smpi_free_tmp_buffer(use_this_recvbuf);
+            smpi_free_tmp_buffer(tmp_recvbuf);
         }
     }
 
@@ -584,7 +587,7 @@ int Coll_reduce_ompi_in_order_binary::reduce( void *sendbuf, void *recvbuf,
  */
 
 int
-Coll_reduce_ompi_basic_linear::reduce(void *sbuf, void *rbuf, int count,
+Coll_reduce_ompi_basic_linear::reduce(const void *sbuf, void *rbuf, int count,
                                           MPI_Datatype dtype,
                                           MPI_Op op,
                                           int root,
@@ -592,10 +595,10 @@ Coll_reduce_ompi_basic_linear::reduce(void *sbuf, void *rbuf, int count,
 {
     int i, rank, size;
     ptrdiff_t true_extent, lb, extent;
-    char *free_buffer = NULL;
-    char *pml_buffer = NULL;
-    char *inplace_temp = NULL;
-    char *inbuf;
+    unsigned char* free_buffer  = nullptr;
+    unsigned char* pml_buffer   = nullptr;
+    unsigned char* inplace_temp = nullptr;
+    const unsigned char* inbuf;
 
     /* Initialize */
 
@@ -622,16 +625,16 @@ Coll_reduce_ompi_basic_linear::reduce(void *sbuf, void *rbuf, int count,
 
     if (MPI_IN_PLACE == sbuf) {
         sbuf = rbuf;
-        inplace_temp = (char*)smpi_get_tmp_recvbuffer(true_extent + (count - 1) * extent);
-        if (NULL == inplace_temp) {
-            return -1;
+        inplace_temp = smpi_get_tmp_recvbuffer(true_extent + (count - 1) * extent);
+        if (nullptr == inplace_temp) {
+          return -1;
         }
         rbuf = inplace_temp - lb;
     }
 
     if (size > 1) {
-        free_buffer = (char*)smpi_get_tmp_recvbuffer(true_extent + (count - 1) * extent);
-        pml_buffer = free_buffer - lb;
+      free_buffer = smpi_get_tmp_recvbuffer(true_extent + (count - 1) * extent);
+      pml_buffer  = free_buffer - lb;
     }
 
     /* Initialize the receive buffer. */
@@ -648,7 +651,7 @@ Coll_reduce_ompi_basic_linear::reduce(void *sbuf, void *rbuf, int count,
 
     for (i = size - 2; i >= 0; --i) {
         if (rank == i) {
-            inbuf = (char*)sbuf;
+          inbuf = static_cast<const unsigned char*>(sbuf);
         } else {
             Request::recv(pml_buffer, count, dtype, i,
                                     COLL_TAG_REDUCE, comm,
@@ -660,13 +663,12 @@ Coll_reduce_ompi_basic_linear::reduce(void *sbuf, void *rbuf, int count,
         if(op!=MPI_OP_NULL) op->apply( inbuf, rbuf, &count, dtype);
     }
 
-    if (NULL != inplace_temp) {
-        Datatype::copy(inplace_temp, count, dtype,(char*)sbuf
-                                                  ,count , dtype);
-        smpi_free_tmp_buffer(inplace_temp);
+    if (nullptr != inplace_temp) {
+      Datatype::copy(inplace_temp, count, dtype, (char*)sbuf, count, dtype);
+      smpi_free_tmp_buffer(inplace_temp);
     }
-    if (NULL != free_buffer) {
-        smpi_free_tmp_buffer(free_buffer);
+    if (nullptr != free_buffer) {
+      smpi_free_tmp_buffer(free_buffer);
     }
 
     /* All done */
index 5b2f4b2..351979c 100644 (file)
@@ -517,7 +517,7 @@ static void MPI_I_do_op(void* b1, void* b2, void* rslt, int cnt,
 REDUCE_LIMITS
 namespace simgrid{
 namespace smpi{
-static int MPI_I_anyReduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype mpi_datatype, MPI_Op mpi_op, int root, MPI_Comm comm, int is_all)
+static int MPI_I_anyReduce(const void* Sendbuf, void* Recvbuf, int count, MPI_Datatype mpi_datatype, MPI_Op mpi_op, int root, MPI_Comm comm, int is_all)
 {
   char *scr1buf, *scr2buf, *scr3buf, *xxx, *sendbuf, *recvbuf;
   int myrank, size, x_base, x_size, computed, idx;
@@ -540,7 +540,7 @@ static int MPI_I_anyReduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype
   else if(mpi_datatype==MPI_DOUBLE        ) datatype=MPIM_DOUBLE;
   else if(mpi_datatype==MPI_BYTE          ) datatype=MPIM_BYTE;
   else
-   THROWF(arg_error,0, "reduce rab algorithm can't be used with this datatype ! ");
+    throw std::invalid_argument("reduce rab algorithm can't be used with this datatype!");
 
   if     (mpi_op==MPI_MAX     ) op=MPIM_MAX;
   else if(mpi_op==MPI_MIN     ) op=MPIM_MIN;
@@ -949,12 +949,12 @@ static int MPI_I_anyReduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype
 #endif /*REDUCE_LIMITS*/
 
 
-int Coll_reduce_rab::reduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
+int Coll_reduce_rab::reduce(const void* Sendbuf, void* Recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
 {
   return( MPI_I_anyReduce(Sendbuf, Recvbuf, count, datatype, op, root, comm, 0) );
 }
 
-int Coll_allreduce_rab::allreduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+int Coll_allreduce_rab::allreduce(const void* Sendbuf, void* Recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
   return( MPI_I_anyReduce(Sendbuf, Recvbuf, count, datatype, op,   -1, comm, 1) );
 }
index 196fa20..2c2eead 100644 (file)
@@ -12,7 +12,7 @@
  */
 namespace simgrid{
 namespace smpi{
-int Coll_reduce_scatter_gather::reduce(void *sendbuf, void *recvbuf,
+int Coll_reduce_scatter_gather::reduce(const void *sendbuf, void *recvbuf,
                                           int count, MPI_Datatype datatype,
                                           MPI_Op op, int root, MPI_Comm comm)
 {
@@ -23,7 +23,7 @@ int Coll_reduce_scatter_gather::reduce(void *sendbuf, void *recvbuf,
   int dst, send_cnt, recv_cnt, newroot, newdst_tree_root;
   int newroot_tree_root, new_count;
   int tag = COLL_TAG_REDUCE,temporary_buffer=0;
-  void *send_ptr, *recv_ptr, *tmp_buf;
+  unsigned char *send_ptr, *recv_ptr, *tmp_buf;
 
   cnts = NULL;
   disps = NULL;
@@ -52,9 +52,9 @@ int Coll_reduce_scatter_gather::reduce(void *sendbuf, void *recvbuf,
 
   if (count < comm_size) {
     new_count = comm_size;
-    send_ptr = (void *) smpi_get_tmp_sendbuffer(new_count * extent);
-    recv_ptr = (void *) smpi_get_tmp_recvbuffer(new_count * extent);
-    tmp_buf = (void *) smpi_get_tmp_sendbuffer(new_count * extent);
+    send_ptr  = smpi_get_tmp_sendbuffer(new_count * extent);
+    recv_ptr  = smpi_get_tmp_recvbuffer(new_count * extent);
+    tmp_buf   = smpi_get_tmp_sendbuffer(new_count * extent);
     memcpy(send_ptr, sendbuf != MPI_IN_PLACE ? sendbuf : recvbuf, extent * count);
 
     //if ((rank != root))
@@ -75,8 +75,8 @@ int Coll_reduce_scatter_gather::reduce(void *sendbuf, void *recvbuf,
     } else                      /* rank >= 2*rem */
       newrank = rank - rem;
 
-    cnts = (int *) xbt_malloc(pof2 * sizeof(int));
-    disps = (int *) xbt_malloc(pof2 * sizeof(int));
+    cnts  = new int[pof2];
+    disps = new int[pof2];
 
     if (newrank != -1) {
       for (i = 0; i < (pof2 - 1); i++)
@@ -111,20 +111,14 @@ int Coll_reduce_scatter_gather::reduce(void *sendbuf, void *recvbuf,
         }
 
         /* Send data from recvbuf. Recv into tmp_buf */
-        Request::sendrecv((char *) recv_ptr +
-                     disps[send_idx] * extent,
-                     send_cnt, datatype,
-                     dst, tag,
-                     (char *) tmp_buf +
-                     disps[recv_idx] * extent,
-                     recv_cnt, datatype, dst, tag, comm, &status);
+        Request::sendrecv(recv_ptr + disps[send_idx] * extent, send_cnt, datatype, dst, tag,
+                          tmp_buf + disps[recv_idx] * extent, recv_cnt, datatype, dst, tag, comm, &status);
 
         /* tmp_buf contains data received in this step.
            recvbuf contains data accumulated so far */
 
-        if(op!=MPI_OP_NULL) op->apply( (char *) tmp_buf + disps[recv_idx] * extent,
-                       (char *) recv_ptr + disps[recv_idx] * extent,
-                       &recv_cnt, datatype);
+        if (op != MPI_OP_NULL)
+          op->apply(tmp_buf + disps[recv_idx] * extent, recv_ptr + disps[recv_idx] * extent, &recv_cnt, datatype);
 
         /* update send_idx for next iteration */
         send_idx = recv_idx;
@@ -207,14 +201,10 @@ int Coll_reduce_scatter_gather::reduce(void *sendbuf, void *recvbuf,
         }
 
         if (newdst_tree_root == newroot_tree_root) {
-          Request::send((char *) recv_ptr +
-                   disps[send_idx] * extent,
-                   send_cnt, datatype, dst, tag, comm);
+          Request::send(recv_ptr + disps[send_idx] * extent, send_cnt, datatype, dst, tag, comm);
           break;
         } else {
-          Request::recv((char *) recv_ptr +
-                   disps[recv_idx] * extent,
-                   recv_cnt, datatype, dst, tag, comm, &status);
+          Request::recv(recv_ptr + disps[recv_idx] * extent, recv_cnt, datatype, dst, tag, comm, &status);
         }
 
         if (newrank > newdst)
@@ -231,7 +221,7 @@ int Coll_reduce_scatter_gather::reduce(void *sendbuf, void *recvbuf,
 
 
   else /* (count >= comm_size) */ {
-    tmp_buf = (void *) smpi_get_tmp_sendbuffer(count * extent);
+    tmp_buf = smpi_get_tmp_sendbuffer(count * extent);
 
     //if ((rank != root))
     Request::sendrecv(sendbuf != MPI_IN_PLACE ? sendbuf : recvbuf, count, datatype, rank, tag,
@@ -252,8 +242,8 @@ int Coll_reduce_scatter_gather::reduce(void *sendbuf, void *recvbuf,
     } else                      /* rank >= 2*rem */
       newrank = rank - rem;
 
-    cnts = (int *) xbt_malloc(pof2 * sizeof(int));
-    disps = (int *) xbt_malloc(pof2 * sizeof(int));
+    cnts  = new int[pof2];
+    disps = new int[pof2];
 
     if (newrank != -1) {
       for (i = 0; i < (pof2 - 1); i++)
@@ -288,20 +278,15 @@ int Coll_reduce_scatter_gather::reduce(void *sendbuf, void *recvbuf,
         }
 
         /* Send data from recvbuf. Recv into tmp_buf */
-        Request::sendrecv((char *) recvbuf +
-                     disps[send_idx] * extent,
-                     send_cnt, datatype,
-                     dst, tag,
-                     (char *) tmp_buf +
-                     disps[recv_idx] * extent,
-                     recv_cnt, datatype, dst, tag, comm, &status);
+        Request::sendrecv(static_cast<char*>(recvbuf) + disps[send_idx] * extent, send_cnt, datatype, dst, tag,
+                          tmp_buf + disps[recv_idx] * extent, recv_cnt, datatype, dst, tag, comm, &status);
 
         /* tmp_buf contains data received in this step.
            recvbuf contains data accumulated so far */
 
-        if(op!=MPI_OP_NULL) op->apply( (char *) tmp_buf + disps[recv_idx] * extent,
-                       (char *) recvbuf + disps[recv_idx] * extent,
-                       &recv_cnt, datatype);
+        if (op != MPI_OP_NULL)
+          op->apply(tmp_buf + disps[recv_idx] * extent, static_cast<char*>(recvbuf) + disps[recv_idx] * extent,
+                    &recv_cnt, datatype);
 
         /* update send_idx for next iteration */
         send_idx = recv_idx;
@@ -403,11 +388,10 @@ int Coll_reduce_scatter_gather::reduce(void *sendbuf, void *recvbuf,
   }
   if (tmp_buf)
     smpi_free_tmp_buffer(tmp_buf);
-  if(temporary_buffer==1) smpi_free_tmp_buffer(recvbuf);
-  if (cnts)
-    free(cnts);
-  if (disps)
-    free(disps);
+  if (temporary_buffer == 1)
+    smpi_free_tmp_buffer(static_cast<unsigned char*>(recvbuf));
+  delete[] cnts;
+  delete[] disps;
 
   return 0;
 }
index 5134808..3679390 100644 (file)
@@ -24,13 +24,12 @@ static inline int MPIU_Mirror_permutation(unsigned int x, int bits)
 namespace simgrid{
 namespace smpi{
 
-int Coll_reduce_scatter_mpich_pair::reduce_scatter(void *sendbuf, void *recvbuf, int recvcounts[],
+int Coll_reduce_scatter_mpich_pair::reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[],
                               MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
     int   rank, comm_size, i;
     MPI_Aint extent, true_extent, true_lb;
-    int  *disps;
-    void *tmp_recvbuf;
+    unsigned char* tmp_recvbuf;
     int mpi_errno = MPI_SUCCESS;
     int total_count, dst, src;
     int is_commutative;
@@ -44,7 +43,7 @@ int Coll_reduce_scatter_mpich_pair::reduce_scatter(void *sendbuf, void *recvbuf,
         is_commutative = 1;
     }
 
-    disps = (int*)xbt_malloc( comm_size * sizeof(int));
+    int* disps = new int[comm_size];
 
     total_count = 0;
     for (i=0; i<comm_size; i++) {
@@ -53,8 +52,8 @@ int Coll_reduce_scatter_mpich_pair::reduce_scatter(void *sendbuf, void *recvbuf,
     }
 
     if (total_count == 0) {
-        xbt_free(disps);
-        return MPI_ERR_COUNT;
+      delete[] disps;
+      return MPI_ERR_COUNT;
     }
 
         if (sendbuf != MPI_IN_PLACE) {
@@ -65,9 +64,9 @@ 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] * std::max(true_extent, extent) + 1);
+        tmp_recvbuf = 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);
+        tmp_recvbuf = tmp_recvbuf - true_lb;
 
         for (i=1; i<comm_size; i++) {
             src = (rank - i + comm_size) % comm_size;
@@ -138,14 +137,14 @@ int Coll_reduce_scatter_mpich_pair::reduce_scatter(void *sendbuf, void *recvbuf,
             if (mpi_errno) return(mpi_errno);
         }
 
-        xbt_free(disps);
+        delete[] disps;
         smpi_free_tmp_buffer(tmp_recvbuf);
 
         return MPI_SUCCESS;
 }
 
 
-int Coll_reduce_scatter_mpich_noncomm::reduce_scatter(void *sendbuf, void *recvbuf, int recvcounts[],
+int Coll_reduce_scatter_mpich_noncomm::reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[],
                               MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
     int mpi_errno = MPI_SUCCESS;
@@ -158,9 +157,9 @@ int Coll_reduce_scatter_mpich_noncomm::reduce_scatter(void *sendbuf, void *recvb
     int block_size, total_count, size;
     MPI_Aint true_extent, true_lb;
     int buf0_was_inout;
-    void *tmp_buf0;
-    void *tmp_buf1;
-    void *result_ptr;
+    unsigned char* tmp_buf0;
+    unsigned char* tmp_buf1;
+    unsigned char* result_ptr;
 
     datatype->extent(&true_lb, &true_extent);
 
@@ -183,21 +182,24 @@ int Coll_reduce_scatter_mpich_noncomm::reduce_scatter(void *sendbuf, void *recvb
     block_size = recvcounts[0];
     total_count = block_size * comm_size;
 
-    tmp_buf0=( void *)smpi_get_tmp_sendbuffer( true_extent * total_count);
-    tmp_buf1=( void *)smpi_get_tmp_recvbuffer( true_extent * total_count);
-    void *tmp_buf0_save=tmp_buf0;
-    void *tmp_buf1_save=tmp_buf1;
+    tmp_buf0                     = smpi_get_tmp_sendbuffer(true_extent * total_count);
+    tmp_buf1                     = smpi_get_tmp_recvbuffer(true_extent * total_count);
+    unsigned char* tmp_buf0_save = tmp_buf0;
+    unsigned char* tmp_buf1_save = tmp_buf1;
 
     /* adjust for potential negative lower bound in datatype */
-    tmp_buf0 = (void *)((char*)tmp_buf0 - true_lb);
-    tmp_buf1 = (void *)((char*)tmp_buf1 - true_lb);
+    tmp_buf0 = tmp_buf0 - true_lb;
+    tmp_buf1 = tmp_buf1 - true_lb;
 
     /* Copy our send data to tmp_buf0.  We do this one block at a time and
        permute the blocks as we go according to the mirror permutation. */
     for (i = 0; i < comm_size; ++i) {
-        mpi_errno = Datatype::copy((char *)(sendbuf == MPI_IN_PLACE ? recvbuf : sendbuf) + (i * true_extent * block_size), block_size, datatype,
-                                   (char *)tmp_buf0 + (MPIU_Mirror_permutation(i, log2_comm_size) * true_extent * block_size), block_size, datatype);
-        if (mpi_errno) return(mpi_errno);
+      mpi_errno = Datatype::copy(
+          static_cast<const char*>(sendbuf == MPI_IN_PLACE ? recvbuf : sendbuf) + (i * true_extent * block_size), block_size,
+          datatype, tmp_buf0 + (MPIU_Mirror_permutation(i, log2_comm_size) * true_extent * block_size), block_size,
+          datatype);
+      if (mpi_errno)
+        return mpi_errno;
     }
     buf0_was_inout = 1;
 
@@ -206,8 +208,8 @@ int Coll_reduce_scatter_mpich_noncomm::reduce_scatter(void *sendbuf, void *recvb
     size = total_count;
     for (k = 0; k < log2_comm_size; ++k) {
         /* use a double-buffering scheme to avoid local copies */
-        char *incoming_data = static_cast<char*>(buf0_was_inout ? tmp_buf1 : tmp_buf0);
-        char *outgoing_data = static_cast<char*>(buf0_was_inout ? tmp_buf0 : tmp_buf1);
+        unsigned char* incoming_data = buf0_was_inout ? tmp_buf1 : tmp_buf0;
+        unsigned char* outgoing_data = buf0_was_inout ? tmp_buf0 : tmp_buf1;
         int peer = rank ^ (0x1 << k);
         size /= 2;
 
@@ -251,7 +253,7 @@ int Coll_reduce_scatter_mpich_noncomm::reduce_scatter(void *sendbuf, void *recvb
     xbt_assert(size == recvcounts[rank]);
 
     /* copy the reduced data to the recvbuf */
-    result_ptr = (char *)(buf0_was_inout ? tmp_buf0 : tmp_buf1) + recv_offset * true_extent;
+    result_ptr = (buf0_was_inout ? tmp_buf0 : tmp_buf1) + recv_offset * true_extent;
     mpi_errno = Datatype::copy(result_ptr, size, datatype,
                                recvbuf, size, datatype);
     smpi_free_tmp_buffer(tmp_buf0_save);
@@ -262,13 +264,11 @@ int Coll_reduce_scatter_mpich_noncomm::reduce_scatter(void *sendbuf, void *recvb
 
 
 
-int Coll_reduce_scatter_mpich_rdb::reduce_scatter(void *sendbuf, void *recvbuf, int recvcounts[],
+int Coll_reduce_scatter_mpich_rdb::reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[],
                               MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
     int   rank, comm_size, i;
     MPI_Aint extent, true_extent, true_lb;
-    int  *disps;
-    void *tmp_recvbuf, *tmp_results;
     int mpi_errno = MPI_SUCCESS;
     int dis[2], blklens[2], total_count, dst;
     int mask, dst_tree_root, my_tree_root, j, k;
@@ -285,7 +285,7 @@ int Coll_reduce_scatter_mpich_rdb::reduce_scatter(void *sendbuf, void *recvbuf,
         is_commutative = 1;
     }
 
-    disps = (int*)xbt_malloc( comm_size * sizeof(int));
+    int* disps = new int[comm_size];
 
     total_count = 0;
     for (i=0; i<comm_size; i++) {
@@ -296,196 +296,182 @@ 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 * 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 * std::max(true_extent, extent));
-            /* adjust for potential negative lower bound in datatype */
-            tmp_results = (void *)((char*)tmp_results - true_lb);
-
-            /* copy sendbuf into tmp_results */
-            if (sendbuf != MPI_IN_PLACE)
-                mpi_errno = Datatype::copy(sendbuf, total_count, datatype,
-                                           tmp_results, total_count, datatype);
-            else
-                mpi_errno = Datatype::copy(recvbuf, total_count, datatype,
-                                           tmp_results, total_count, datatype);
-
-            if (mpi_errno) return(mpi_errno);
-
-            mask = 0x1;
-            i = 0;
-            while (mask < comm_size) {
-                dst = rank ^ mask;
-
-                dst_tree_root = dst >> i;
-                dst_tree_root <<= i;
-
-                my_tree_root = rank >> i;
-                my_tree_root <<= i;
-
-                /* At step 1, processes exchange (n-n/p) amount of
-                   data; at step 2, (n-2n/p) amount of data; at step 3, (n-4n/p)
-                   amount of data, and so forth. We use derived datatypes for this.
-
-                   At each step, a process does not need to send data
-                   indexed from my_tree_root to
-                   my_tree_root+mask-1. Similarly, a process won't receive
-                   data indexed from dst_tree_root to dst_tree_root+mask-1. */
-
-                /* calculate sendtype */
-                blklens[0] = blklens[1] = 0;
-                for (j=0; j<my_tree_root; j++)
-                    blklens[0] += recvcounts[j];
-                for (j=my_tree_root+mask; j<comm_size; j++)
-                    blklens[1] += recvcounts[j];
-
-                dis[0] = 0;
-                dis[1] = blklens[0];
-                for (j=my_tree_root; (j<my_tree_root+mask) && (j<comm_size); j++)
-                    dis[1] += recvcounts[j];
-
-                mpi_errno = Datatype::create_indexed(2, blklens, dis, datatype, &sendtype);
-                if (mpi_errno) return(mpi_errno);
-
-                sendtype->commit();
-
-                /* calculate recvtype */
-                blklens[0] = blklens[1] = 0;
-                for (j=0; j<dst_tree_root && j<comm_size; j++)
-                    blklens[0] += recvcounts[j];
-                for (j=dst_tree_root+mask; j<comm_size; j++)
-                    blklens[1] += recvcounts[j];
-
-                dis[0] = 0;
-                dis[1] = blklens[0];
-                for (j=dst_tree_root; (j<dst_tree_root+mask) && (j<comm_size); j++)
-                    dis[1] += recvcounts[j];
-
-                mpi_errno = Datatype::create_indexed(2, blklens, dis, datatype, &recvtype);
-                if (mpi_errno) return(mpi_errno);
-
-                recvtype->commit();
-
-                received = 0;
-                if (dst < comm_size) {
-                    /* tmp_results contains data to be sent in each step. Data is
-                       received in tmp_recvbuf and then accumulated into
-                       tmp_results. accumulation is done later below.   */
-
-                    Request::sendrecv(tmp_results, 1, sendtype, dst,
-                                                 COLL_TAG_SCATTER,
-                                                 tmp_recvbuf, 1, recvtype, dst,
-                                                 COLL_TAG_SCATTER, comm,
-                                                 MPI_STATUS_IGNORE);
-                    received = 1;
-                }
-
-                /* if some processes in this process's subtree in this step
-                   did not have any destination process to communicate with
-                   because of non-power-of-two, we need to send them the
-                   result. We use a logarithmic recursive-halfing algorithm
-                   for this. */
-
-                if (dst_tree_root + mask > comm_size) {
-                    nprocs_completed = comm_size - my_tree_root - mask;
-                    /* nprocs_completed is the number of processes in this
-                       subtree that have all the data. Send data to others
-                       in a tree fashion. First find root of current tree
-                       that is being divided into two. k is the number of
-                       least-significant bits in this process's rank that
-                       must be zeroed out to find the rank of the root */
-                    j = mask;
-                    k = 0;
-                    while (j) {
-                        j >>= 1;
-                        k++;
-                    }
-                    k--;
-
-                    tmp_mask = mask >> 1;
-                    while (tmp_mask) {
-                        dst = rank ^ tmp_mask;
-
-                        tree_root = rank >> k;
-                        tree_root <<= k;
-
-                        /* send only if this proc has data and destination
-                           doesn't have data. at any step, multiple processes
-                           can send if they have the data */
-                        if ((dst > rank) &&
-                            (rank < tree_root + nprocs_completed)
-                            && (dst >= tree_root + nprocs_completed)) {
-                            /* send the current result */
-                            Request::send(tmp_recvbuf, 1, recvtype,
-                                                     dst, COLL_TAG_SCATTER,
-                                                     comm);
-                        }
-                        /* recv only if this proc. doesn't have data and sender
-                           has data */
-                        else if ((dst < rank) &&
-                                 (dst < tree_root + nprocs_completed) &&
-                                 (rank >= tree_root + nprocs_completed)) {
-                            Request::recv(tmp_recvbuf, 1, recvtype, dst,
-                                                     COLL_TAG_SCATTER,
-                                                     comm, MPI_STATUS_IGNORE);
-                            received = 1;
-                        }
-                        tmp_mask >>= 1;
-                        k--;
-                    }
-                }
+    unsigned char* tmp_recvbuf = smpi_get_tmp_recvbuffer(total_count * std::max(true_extent, extent));
+    /* adjust for potential negative lower bound in datatype */
+    tmp_recvbuf = tmp_recvbuf - true_lb;
 
-                /* The following reduction is done here instead of after
-                   the MPIC_Sendrecv_ft or MPIC_Recv_ft above. This is
-                   because to do it above, in the noncommutative
-                   case, we would need an extra temp buffer so as not to
-                   overwrite temp_recvbuf, because temp_recvbuf may have
-                   to be communicated to other processes in the
-                   non-power-of-two case. To avoid that extra allocation,
-                   we do the reduce here. */
-                if (received) {
-                    if (is_commutative || (dst_tree_root < my_tree_root)) {
-                        {
-                          if (op != MPI_OP_NULL)
-                            op->apply(tmp_recvbuf, tmp_results, &blklens[0], datatype);
-                          if (op != MPI_OP_NULL)
-                            op->apply(((char*)tmp_recvbuf + dis[1] * extent), ((char*)tmp_results + dis[1] * extent),
-                                      &blklens[1], datatype);
-                        }
-                    }
-                    else {
-                        {
-                          if (op != MPI_OP_NULL)
-                            op->apply(tmp_results, tmp_recvbuf, &blklens[0], datatype);
-                          if (op != MPI_OP_NULL)
-                            op->apply(((char*)tmp_results + dis[1] * extent), ((char*)tmp_recvbuf + dis[1] * extent),
-                                      &blklens[1], datatype);
-                        }
-                        /* copy result back into tmp_results */
-                        mpi_errno = Datatype::copy(tmp_recvbuf, 1, recvtype,
-                                                   tmp_results, 1, recvtype);
-                        if (mpi_errno) return(mpi_errno);
-                    }
-                }
+    /* need to allocate another temporary buffer to accumulate
+       results */
+    unsigned char* tmp_results = smpi_get_tmp_sendbuffer(total_count * std::max(true_extent, extent));
+    /* adjust for potential negative lower bound in datatype */
+    tmp_results = tmp_results - true_lb;
+
+    /* copy sendbuf into tmp_results */
+    if (sendbuf != MPI_IN_PLACE)
+      mpi_errno = Datatype::copy(sendbuf, total_count, datatype, tmp_results, total_count, datatype);
+    else
+      mpi_errno = Datatype::copy(recvbuf, total_count, datatype, tmp_results, total_count, datatype);
+
+    if (mpi_errno)
+      return (mpi_errno);
+
+    mask = 0x1;
+    i    = 0;
+    while (mask < comm_size) {
+      dst = rank ^ mask;
+
+      dst_tree_root = dst >> i;
+      dst_tree_root <<= i;
+
+      my_tree_root = rank >> i;
+      my_tree_root <<= i;
+
+      /* At step 1, processes exchange (n-n/p) amount of
+         data; at step 2, (n-2n/p) amount of data; at step 3, (n-4n/p)
+         amount of data, and so forth. We use derived datatypes for this.
+
+         At each step, a process does not need to send data
+         indexed from my_tree_root to
+         my_tree_root+mask-1. Similarly, a process won't receive
+         data indexed from dst_tree_root to dst_tree_root+mask-1. */
+
+      /* calculate sendtype */
+      blklens[0] = blklens[1] = 0;
+      for (j = 0; j < my_tree_root; j++)
+        blklens[0] += recvcounts[j];
+      for (j = my_tree_root + mask; j < comm_size; j++)
+        blklens[1] += recvcounts[j];
+
+      dis[0] = 0;
+      dis[1] = blklens[0];
+      for (j = my_tree_root; (j < my_tree_root + mask) && (j < comm_size); j++)
+        dis[1] += recvcounts[j];
+
+      mpi_errno = Datatype::create_indexed(2, blklens, dis, datatype, &sendtype);
+      if (mpi_errno)
+        return (mpi_errno);
+
+      sendtype->commit();
+
+      /* calculate recvtype */
+      blklens[0] = blklens[1] = 0;
+      for (j = 0; j < dst_tree_root && j < comm_size; j++)
+        blklens[0] += recvcounts[j];
+      for (j = dst_tree_root + mask; j < comm_size; j++)
+        blklens[1] += recvcounts[j];
+
+      dis[0] = 0;
+      dis[1] = blklens[0];
+      for (j = dst_tree_root; (j < dst_tree_root + mask) && (j < comm_size); j++)
+        dis[1] += recvcounts[j];
+
+      mpi_errno = Datatype::create_indexed(2, blklens, dis, datatype, &recvtype);
+      if (mpi_errno)
+        return (mpi_errno);
+
+      recvtype->commit();
+
+      received = 0;
+      if (dst < comm_size) {
+        /* tmp_results contains data to be sent in each step. Data is
+           received in tmp_recvbuf and then accumulated into
+           tmp_results. accumulation is done later below.   */
+
+        Request::sendrecv(tmp_results, 1, sendtype, dst, COLL_TAG_SCATTER, tmp_recvbuf, 1, recvtype, dst,
+                          COLL_TAG_SCATTER, comm, MPI_STATUS_IGNORE);
+        received = 1;
+      }
+
+      /* if some processes in this process's subtree in this step
+         did not have any destination process to communicate with
+         because of non-power-of-two, we need to send them the
+         result. We use a logarithmic recursive-halfing algorithm
+         for this. */
+
+      if (dst_tree_root + mask > comm_size) {
+        nprocs_completed = comm_size - my_tree_root - mask;
+        /* nprocs_completed is the number of processes in this
+           subtree that have all the data. Send data to others
+           in a tree fashion. First find root of current tree
+           that is being divided into two. k is the number of
+           least-significant bits in this process's rank that
+           must be zeroed out to find the rank of the root */
+        j = mask;
+        k = 0;
+        while (j) {
+          j >>= 1;
+          k++;
+        }
+        k--;
+
+        tmp_mask = mask >> 1;
+        while (tmp_mask) {
+          dst = rank ^ tmp_mask;
+
+          tree_root = rank >> k;
+          tree_root <<= k;
+
+          /* send only if this proc has data and destination
+             doesn't have data. at any step, multiple processes
+             can send if they have the data */
+          if ((dst > rank) && (rank < tree_root + nprocs_completed) && (dst >= tree_root + nprocs_completed)) {
+            /* send the current result */
+            Request::send(tmp_recvbuf, 1, recvtype, dst, COLL_TAG_SCATTER, comm);
+          }
+          /* recv only if this proc. doesn't have data and sender
+             has data */
+          else if ((dst < rank) && (dst < tree_root + nprocs_completed) && (rank >= tree_root + nprocs_completed)) {
+            Request::recv(tmp_recvbuf, 1, recvtype, dst, COLL_TAG_SCATTER, comm, MPI_STATUS_IGNORE);
+            received = 1;
+          }
+          tmp_mask >>= 1;
+          k--;
+        }
+      }
+
+      /* The following reduction is done here instead of after
+         the MPIC_Sendrecv_ft or MPIC_Recv_ft above. This is
+         because to do it above, in the noncommutative
+         case, we would need an extra temp buffer so as not to
+         overwrite temp_recvbuf, because temp_recvbuf may have
+         to be communicated to other processes in the
+         non-power-of-two case. To avoid that extra allocation,
+         we do the reduce here. */
+      if (received) {
+        if (is_commutative || (dst_tree_root < my_tree_root)) {
+          {
+            if (op != MPI_OP_NULL)
+              op->apply(tmp_recvbuf, tmp_results, &blklens[0], datatype);
+            if (op != MPI_OP_NULL)
+              op->apply(tmp_recvbuf + dis[1] * extent, tmp_results + dis[1] * extent, &blklens[1], datatype);
+          }
+        } else {
+          {
+            if (op != MPI_OP_NULL)
+              op->apply(tmp_results, tmp_recvbuf, &blklens[0], datatype);
+            if (op != MPI_OP_NULL)
+              op->apply(tmp_results + dis[1] * extent, tmp_recvbuf + dis[1] * extent, &blklens[1], datatype);
+          }
+          /* copy result back into tmp_results */
+          mpi_errno = Datatype::copy(tmp_recvbuf, 1, recvtype, tmp_results, 1, recvtype);
+          if (mpi_errno)
+            return (mpi_errno);
+        }
+      }
 
-                Datatype::unref(sendtype);
-                Datatype::unref(recvtype);
+      Datatype::unref(sendtype);
+      Datatype::unref(recvtype);
 
-                mask <<= 1;
-                i++;
+      mask <<= 1;
+      i++;
             }
 
             /* now copy final results from tmp_results to recvbuf */
-            mpi_errno = Datatype::copy(((char *)tmp_results+disps[rank]*extent),
-                                       recvcounts[rank], datatype, recvbuf,
+            mpi_errno = Datatype::copy(tmp_results + disps[rank] * extent, recvcounts[rank], datatype, recvbuf,
                                        recvcounts[rank], datatype);
             if (mpi_errno) return(mpi_errno);
 
-    xbt_free(disps);
+    delete[] disps;
     smpi_free_tmp_buffer(tmp_recvbuf);
     smpi_free_tmp_buffer(tmp_results);
     return MPI_SUCCESS;
index 850fe90..905d637 100644 (file)
 namespace simgrid{
 namespace smpi{
 int
-Coll_reduce_scatter_ompi_basic_recursivehalving::reduce_scatter(void *sbuf,
+Coll_reduce_scatter_ompi_basic_recursivehalving::reduce_scatter(const void *sbuf,
                                                             void *rbuf,
-                                                            int *rcounts,
+                                                            const int *rcounts,
                                                             MPI_Datatype dtype,
                                                             MPI_Op op,
                                                             MPI_Comm comm
                                                             )
 {
     int i, rank, size, count, err = MPI_SUCCESS;
-    int tmp_size=1, remain = 0, tmp_rank, *disps = NULL;
+    int tmp_size = 1, remain = 0, tmp_rank;
     ptrdiff_t true_lb, true_extent, lb, extent, buf_size;
-    char *recv_buf = NULL, *recv_buf_free = NULL;
-    char *result_buf = NULL, *result_buf_free = NULL;
+    unsigned char *result_buf = nullptr, *result_buf_free = nullptr;
 
     /* Initialize */
     rank = comm->rank();
@@ -64,11 +63,11 @@ Coll_reduce_scatter_ompi_basic_recursivehalving::reduce_scatter(void *sbuf,
 
     XBT_DEBUG("coll:tuned:reduce_scatter_ompi_basic_recursivehalving, rank %d", rank);
     if ((op != MPI_OP_NULL && not op->is_commutative()))
-      THROWF(arg_error,0, " reduce_scatter ompi_basic_recursivehalving can only be used for commutative operations! ");
+      throw std::invalid_argument(
+          "reduce_scatter ompi_basic_recursivehalving can only be used for commutative operations!");
 
     /* Find displacements and the like */
-    disps = (int*) xbt_malloc(sizeof(int) * size);
-    if (NULL == disps) return MPI_ERR_OTHER;
+    int* disps = new int[size];
 
     disps[0] = 0;
     for (i = 0; i < (size - 1); ++i) {
@@ -78,8 +77,8 @@ Coll_reduce_scatter_ompi_basic_recursivehalving::reduce_scatter(void *sbuf,
 
     /* short cut the trivial case */
     if (0 == count) {
-        xbt_free(disps);
-        return MPI_SUCCESS;
+      delete[] disps;
+      return MPI_SUCCESS;
     }
 
     /* get datatype information */
@@ -93,17 +92,15 @@ Coll_reduce_scatter_ompi_basic_recursivehalving::reduce_scatter(void *sbuf,
     }
 
     /* Allocate temporary receive buffer. */
-    recv_buf_free = (char*) smpi_get_tmp_recvbuffer(buf_size);
-
-    recv_buf = recv_buf_free - lb;
+    unsigned char* recv_buf_free = smpi_get_tmp_recvbuffer(buf_size);
+    unsigned char* recv_buf      = recv_buf_free - lb;
     if (NULL == recv_buf_free) {
         err = MPI_ERR_OTHER;
         goto cleanup;
     }
 
     /* allocate temporary buffer for results */
-    result_buf_free = (char*) smpi_get_tmp_sendbuffer(buf_size);
-
+    result_buf_free = smpi_get_tmp_sendbuffer(buf_size);
     result_buf = result_buf_free - lb;
 
     /* copy local buffer into the temporary results */
@@ -147,23 +144,13 @@ Coll_reduce_scatter_ompi_basic_recursivehalving::reduce_scatter(void *sbuf,
     /* For ranks not kicked out by the above code, perform the
        recursive halving */
     if (tmp_rank >= 0) {
-        int *tmp_disps = NULL, *tmp_rcounts = NULL;
         int mask, send_index, recv_index, last_index;
 
         /* recalculate disps and rcounts to account for the
            special "remainder" processes that are no longer doing
            anything */
-        tmp_rcounts = (int*) xbt_malloc(tmp_size * sizeof(int));
-        if (NULL == tmp_rcounts) {
-            err = MPI_ERR_OTHER;
-            goto cleanup;
-        }
-        tmp_disps = (int*) xbt_malloc(tmp_size * sizeof(int));
-        if (NULL == tmp_disps) {
-            xbt_free(tmp_rcounts);
-            err = MPI_ERR_OTHER;
-            goto cleanup;
-        }
+        int* tmp_rcounts = new int[tmp_size];
+        int* tmp_disps   = new int[tmp_size];
 
         for (i = 0 ; i < tmp_size ; ++i) {
             if (i < remain) {
@@ -221,9 +208,9 @@ Coll_reduce_scatter_ompi_basic_recursivehalving::reduce_scatter(void *sbuf,
                                          COLL_TAG_REDUCE_SCATTER,
                                          comm);
                 if (MPI_SUCCESS != err) {
-                    xbt_free(tmp_rcounts);
-                    xbt_free(tmp_disps);
-                    goto cleanup;
+                  delete[] tmp_rcounts;
+                  delete[] tmp_disps;
+                  goto cleanup;
                 }
             }
             if (recv_count > 0 && send_count != 0) {
@@ -232,9 +219,9 @@ Coll_reduce_scatter_ompi_basic_recursivehalving::reduce_scatter(void *sbuf,
                                         COLL_TAG_REDUCE_SCATTER,
                                         comm);
                 if (MPI_SUCCESS != err) {
-                    xbt_free(tmp_rcounts);
-                    xbt_free(tmp_disps);
-                    goto cleanup;
+                  delete[] tmp_rcounts;
+                  delete[] tmp_disps;
+                  goto cleanup;
                 }
             }
             if (send_count > 0 && recv_count != 0) {
@@ -262,14 +249,14 @@ Coll_reduce_scatter_ompi_basic_recursivehalving::reduce_scatter(void *sbuf,
                                        rcounts[rank], dtype,
                                        rbuf, rcounts[rank], dtype);
             if (MPI_SUCCESS != err) {
-                xbt_free(tmp_rcounts);
-                xbt_free(tmp_disps);
-                goto cleanup;
+              delete[] tmp_rcounts;
+              delete[] tmp_disps;
+              goto cleanup;
             }
         }
 
-        xbt_free(tmp_rcounts);
-        xbt_free(tmp_disps);
+        delete[] tmp_rcounts;
+        delete[] tmp_disps;
     }
 
     /* Now fix up the non-power of two case, by having the odd
@@ -292,7 +279,7 @@ Coll_reduce_scatter_ompi_basic_recursivehalving::reduce_scatter(void *sbuf,
     }
 
  cleanup:
-    if (NULL != disps) xbt_free(disps);
+    delete[] disps;
     if (NULL != recv_buf_free) smpi_free_tmp_buffer(recv_buf_free);
     if (NULL != result_buf_free) smpi_free_tmp_buffer(result_buf_free);
 
@@ -362,16 +349,16 @@ Coll_reduce_scatter_ompi_basic_recursivehalving::reduce_scatter(void *sbuf,
  *
  */
 int
-Coll_reduce_scatter_ompi_ring::reduce_scatter(void *sbuf, void *rbuf, int *rcounts,
+Coll_reduce_scatter_ompi_ring::reduce_scatter(const void *sbuf, void *rbuf, const int *rcounts,
                                           MPI_Datatype dtype,
                                           MPI_Op op,
                                           MPI_Comm comm
                                           )
 {
     int ret, line, rank, size, i, k, recv_from, send_to, total_count, max_block_count;
-    int inbi, *displs = NULL;
-    char *tmpsend = NULL, *tmprecv = NULL, *accumbuf = NULL, *accumbuf_free = NULL;
-    char *inbuf_free[2] = {NULL, NULL}, *inbuf[2] = {NULL, NULL};
+    int inbi;
+    unsigned char *tmpsend = NULL, *tmprecv = NULL, *accumbuf = NULL, *accumbuf_free = NULL;
+    unsigned char *inbuf_free[2] = {NULL, NULL}, *inbuf[2] = {NULL, NULL};
     ptrdiff_t true_lb, true_extent, lb, extent, max_real_segsize;
     MPI_Request reqs[2] = {NULL, NULL};
 
@@ -384,8 +371,8 @@ Coll_reduce_scatter_ompi_ring::reduce_scatter(void *sbuf, void *rbuf, int *rcoun
     /* Determine the maximum number of elements per node,
        corresponding block size, and displacements array.
     */
-    displs = (int*) xbt_malloc(size * sizeof(int));
-    if (NULL == displs) { ret = -1; line = __LINE__; goto error_hndl; }
+    int* displs = new int[size];
+
     displs[0] = 0;
     total_count = rcounts[0];
     max_block_count = rcounts[0];
@@ -401,7 +388,7 @@ Coll_reduce_scatter_ompi_ring::reduce_scatter(void *sbuf, void *rbuf, int *rcoun
             ret = Datatype::copy((char*)sbuf, total_count, dtype, (char*)rbuf, total_count, dtype);
             if (ret < 0) { line = __LINE__; goto error_hndl; }
         }
-        xbt_free(displs);
+        delete[] displs;
         return MPI_SUCCESS;
     }
 
@@ -415,17 +402,21 @@ Coll_reduce_scatter_ompi_ring::reduce_scatter(void *sbuf, void *rbuf, int *rcoun
 
     max_real_segsize = true_extent + (ptrdiff_t)(max_block_count - 1) * extent;
 
-    accumbuf_free = (char*)smpi_get_tmp_recvbuffer(true_extent + (ptrdiff_t)(total_count - 1) * extent);
+    accumbuf_free = smpi_get_tmp_recvbuffer(true_extent + (ptrdiff_t)(total_count - 1) * extent);
     if (NULL == accumbuf_free) { ret = -1; line = __LINE__; goto error_hndl; }
     accumbuf = accumbuf_free - lb;
 
-    inbuf_free[0] = (char*)smpi_get_tmp_sendbuffer(max_real_segsize);
+    inbuf_free[0] = smpi_get_tmp_sendbuffer(max_real_segsize);
     if (NULL == inbuf_free[0]) { ret = -1; line = __LINE__; goto error_hndl; }
     inbuf[0] = inbuf_free[0] - lb;
     if (size > 2) {
-        inbuf_free[1] = (char*)smpi_get_tmp_sendbuffer(max_real_segsize);
-        if (NULL == inbuf_free[1]) { ret = -1; line = __LINE__; goto error_hndl; }
-        inbuf[1] = inbuf_free[1] - lb;
+      inbuf_free[1] = smpi_get_tmp_sendbuffer(max_real_segsize);
+      if (NULL == inbuf_free[1]) {
+        ret  = -1;
+        line = __LINE__;
+        goto error_hndl;
+      }
+      inbuf[1] = inbuf_free[1] - lb;
     }
 
     /* Handle MPI_IN_PLACE for size > 1 */
@@ -483,7 +474,8 @@ Coll_reduce_scatter_ompi_ring::reduce_scatter(void *sbuf, void *rbuf, int *rcoun
            rbuf[prevblock] = inbuf[inbi ^ 0x1] (op) rbuf[prevblock]
         */
         tmprecv = accumbuf + (ptrdiff_t)displs[prevblock] * extent;
-        if(op!=MPI_OP_NULL) op->apply( inbuf[inbi ^ 0x1], tmprecv, &(rcounts[prevblock]), dtype);
+        if (op != MPI_OP_NULL)
+          op->apply(inbuf[inbi ^ 0x1], tmprecv, &rcounts[prevblock], dtype);
 
         /* send previous block to send_to */
         Request::send(tmprecv, rcounts[prevblock], dtype, send_to,
@@ -497,13 +489,14 @@ Coll_reduce_scatter_ompi_ring::reduce_scatter(void *sbuf, void *rbuf, int *rcoun
     /* Apply operation on the last block (my block)
        rbuf[rank] = inbuf[inbi] (op) rbuf[rank] */
     tmprecv = accumbuf + (ptrdiff_t)displs[rank] * extent;
-    if(op!=MPI_OP_NULL) op->apply( inbuf[inbi], tmprecv, &(rcounts[rank]), dtype);
+    if (op != MPI_OP_NULL)
+      op->apply(inbuf[inbi], tmprecv, &rcounts[rank], dtype);
 
     /* Copy result from tmprecv to rbuf */
     ret = Datatype::copy(tmprecv, rcounts[rank], dtype, (char*)rbuf, rcounts[rank], dtype);
     if (ret < 0) { line = __LINE__; goto error_hndl; }
 
-    if (NULL != displs) xbt_free(displs);
+    delete[] displs;
     if (NULL != accumbuf_free) smpi_free_tmp_buffer(accumbuf_free);
     if (NULL != inbuf_free[0]) smpi_free_tmp_buffer(inbuf_free[0]);
     if (NULL != inbuf_free[1]) smpi_free_tmp_buffer(inbuf_free[1]);
@@ -513,7 +506,7 @@ Coll_reduce_scatter_ompi_ring::reduce_scatter(void *sbuf, void *rbuf, int *rcoun
  error_hndl:
     XBT_DEBUG( "%s:%4d\tRank %d Error occurred %d\n",
                  __FILE__, line, rank, ret);
-    if (NULL != displs) xbt_free(displs);
+    delete[] displs;
     if (NULL != accumbuf_free) smpi_free_tmp_buffer(accumbuf_free);
     if (NULL != inbuf_free[0]) smpi_free_tmp_buffer(inbuf_free[0]);
     if (NULL != inbuf_free[1]) smpi_free_tmp_buffer(inbuf_free[1]);
index 3cb8003..35e57e4 100644 (file)
 #define MPIR_Scatter_MV2_Binomial Coll_scatter_ompi_binomial::scatter
 #define MPIR_Scatter_MV2_Direct Coll_scatter_ompi_basic_linear::scatter
 
-extern int (*MV2_Scatter_intra_function) (void *sendbuf, int sendcount, MPI_Datatype sendtype,
+extern int (*MV2_Scatter_intra_function) (const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     void *recvbuf, int recvcount, MPI_Datatype recvtype,
     int root, MPI_Comm comm);
 
 namespace simgrid{
 namespace smpi{
 
-int Coll_scatter_mvapich2_two_level_direct::scatter(void *sendbuf,
+int Coll_scatter_mvapich2_two_level_direct::scatter(const void *sendbuf,
                                       int sendcnt,
                                       MPI_Datatype sendtype,
                                       void *recvbuf,
@@ -59,8 +59,8 @@ int Coll_scatter_mvapich2_two_level_direct::scatter(void *sendbuf,
     int leader_comm_rank = -1, leader_comm_size = -1;
     int mpi_errno = MPI_SUCCESS;
     int recvtype_size, sendtype_size, nbytes;
-    void *tmp_buf = NULL;
-    void *leader_scatter_buf = NULL;
+    unsigned char* tmp_buf            = nullptr;
+    unsigned char* leader_scatter_buf = nullptr;
     MPI_Status status;
     int leader_root, leader_of_root = -1;
     MPI_Comm shmem_comm, leader_comm;
@@ -150,8 +150,8 @@ int Coll_scatter_mvapich2_two_level_direct::scatter(void *sendbuf,
 
             if (root != leader_of_root) {
               if (leader_comm_rank == leader_root) {
-                displs      = static_cast<int*>(xbt_malloc(sizeof(int) * leader_comm_size));
-                sendcnts    = static_cast<int*>(xbt_malloc(sizeof(int) * leader_comm_size));
+                displs      = new int[leader_comm_size];
+                sendcnts    = new int[leader_comm_size];
                 sendcnts[0] = node_sizes[0] * nbytes;
                 displs[0]   = 0;
 
@@ -164,8 +164,8 @@ int Coll_scatter_mvapich2_two_level_direct::scatter(void *sendbuf,
                               leader_root, leader_comm);
             } else {
               if (leader_comm_rank == leader_root) {
-                displs      = static_cast<int*>(xbt_malloc(sizeof(int) * leader_comm_size));
-                sendcnts    = static_cast<int*>(xbt_malloc(sizeof(int) * leader_comm_size));
+                displs      = new int[leader_comm_size];
+                sendcnts    = new int[leader_comm_size];
                 sendcnts[0] = node_sizes[0] * sendcnt;
                 displs[0]   = 0;
 
@@ -178,8 +178,8 @@ int Coll_scatter_mvapich2_two_level_direct::scatter(void *sendbuf,
                               leader_comm);
             }
             if (leader_comm_rank == leader_root) {
-              xbt_free(displs);
-              xbt_free(sendcnts);
+              delete[] displs;
+              delete[] sendcnts;
             }
             } else {
                 if (leader_of_root != root) {
@@ -223,7 +223,7 @@ int Coll_scatter_mvapich2_two_level_direct::scatter(void *sendbuf,
 }
 
 
-int Coll_scatter_mvapich2_two_level_binomial::scatter(void *sendbuf,
+int Coll_scatter_mvapich2_two_level_binomial::scatter(const void *sendbuf,
                                         int sendcnt,
                                         MPI_Datatype sendtype,
                                         void *recvbuf,
@@ -236,8 +236,8 @@ int Coll_scatter_mvapich2_two_level_binomial::scatter(void *sendbuf,
     int leader_comm_rank = -1, leader_comm_size = -1;
     int mpi_errno = MPI_SUCCESS;
     int recvtype_size, sendtype_size, nbytes;
-    void *tmp_buf = NULL;
-    void *leader_scatter_buf = NULL;
+    unsigned char* tmp_buf            = nullptr;
+    unsigned char* leader_scatter_buf = nullptr;
     MPI_Status status;
     int leader_root = -1, leader_of_root = -1;
     MPI_Comm shmem_comm, leader_comm;
@@ -326,8 +326,8 @@ int Coll_scatter_mvapich2_two_level_binomial::scatter(void *sendbuf,
 
             if (root != leader_of_root) {
               if (leader_comm_rank == leader_root) {
-                displs      = static_cast<int*>(xbt_malloc(sizeof(int) * leader_comm_size));
-                sendcnts    = static_cast<int*>(xbt_malloc(sizeof(int) * leader_comm_size));
+                displs      = new int[leader_comm_size];
+                sendcnts    = new int[leader_comm_size];
                 sendcnts[0] = node_sizes[0] * nbytes;
                 displs[0]   = 0;
 
@@ -340,8 +340,8 @@ int Coll_scatter_mvapich2_two_level_binomial::scatter(void *sendbuf,
                               leader_root, leader_comm);
             } else {
               if (leader_comm_rank == leader_root) {
-                displs      = static_cast<int*>(xbt_malloc(sizeof(int) * leader_comm_size));
-                sendcnts    = static_cast<int*>(xbt_malloc(sizeof(int) * leader_comm_size));
+                displs      = new int[leader_comm_size];
+                sendcnts    = new int[leader_comm_size];
                 sendcnts[0] = node_sizes[0] * sendcnt;
                 displs[0]   = 0;
 
@@ -354,8 +354,8 @@ int Coll_scatter_mvapich2_two_level_binomial::scatter(void *sendbuf,
                               leader_comm);
             }
             if (leader_comm_rank == leader_root) {
-              xbt_free(displs);
-              xbt_free(sendcnts);
+              delete[] displs;
+              delete[] sendcnts;
             }
             } else {
                 if (leader_of_root != root) {
index c4c41b0..3138569 100644 (file)
@@ -25,7 +25,7 @@
 namespace simgrid{
 namespace smpi{
 
-int Coll_scatter_ompi_binomial::scatter(void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount,
+int Coll_scatter_ompi_binomial::scatter(const void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount,
                                         MPI_Datatype rdtype, int root, MPI_Comm comm)
 {
     int line = -1;
@@ -34,8 +34,9 @@ int Coll_scatter_ompi_binomial::scatter(void* sbuf, int scount, MPI_Datatype sdt
     int vrank;
     int size;
     int total_send = 0;
-    char *ptmp     = NULL;
-    char *tempbuf  = NULL;
+    unsigned char* ptmp    = nullptr;
+    unsigned char* tempbuf = nullptr;
+    const unsigned char* cptmp; // const ptmp
     int err;
     ompi_coll_tree_t* bmtree;
     MPI_Status status;
@@ -63,7 +64,8 @@ int Coll_scatter_ompi_binomial::scatter(void* sbuf, int scount, MPI_Datatype sdt
     if (rank == root) {
       if (0 == root) {
         /* root on 0, just use the send buffer */
-        ptmp = (char*)sbuf;
+        ptmp  = nullptr; // unused
+        cptmp = static_cast<const unsigned char*>(sbuf);
         if (rbuf != MPI_IN_PLACE) {
           /* local copy to rbuf */
           err = Datatype::copy(sbuf, scount, sdtype, rbuf, rcount, rdtype);
@@ -74,14 +76,15 @@ int Coll_scatter_ompi_binomial::scatter(void* sbuf, int scount, MPI_Datatype sdt
         }
       } else {
         /* root is not on 0, allocate temp buffer for send */
-        tempbuf = (char*)smpi_get_tmp_sendbuffer(strue_extent + (scount * size - 1) * sextent);
-        if (NULL == tempbuf) {
+        tempbuf = smpi_get_tmp_sendbuffer(strue_extent + (scount * size - 1) * sextent);
+        if (nullptr == tempbuf) {
           err  = MPI_ERR_OTHER;
           line = __LINE__;
           goto err_hndl;
         }
 
-        ptmp = tempbuf - slb;
+        ptmp  = tempbuf - slb;
+        cptmp = ptmp;
 
         /* and rotate data so they will eventually in the right place */
         err = Datatype::copy((char*)sbuf + sextent * root * scount, scount * (size - root), sdtype, ptmp,
@@ -111,14 +114,15 @@ int Coll_scatter_ompi_binomial::scatter(void* sbuf, int scount, MPI_Datatype sdt
     } else if (not(vrank % 2)) {
       /* non-root, non-leaf nodes, allocate temp buffer for recv
        * the most we need is rcount*size/2 */
-      tempbuf = (char*)smpi_get_tmp_recvbuffer(rtrue_extent + (rcount * size - 1) * rextent);
-      if (NULL == tempbuf) {
+      tempbuf = smpi_get_tmp_recvbuffer(rtrue_extent + (rcount * size - 1) * rextent);
+      if (nullptr == tempbuf) {
         err  = MPI_ERR_OTHER;
         line = __LINE__;
         goto err_hndl;
       }
 
-      ptmp = tempbuf - rlb;
+      ptmp  = tempbuf - rlb;
+      cptmp = ptmp;
 
       sdtype     = rdtype;
       scount     = rcount;
@@ -126,7 +130,8 @@ int Coll_scatter_ompi_binomial::scatter(void* sbuf, int scount, MPI_Datatype sdt
       total_send = scount;
     } else {
       /* leaf nodes, just use rbuf */
-      ptmp = (char*)rbuf;
+      ptmp  = static_cast<unsigned char*>(rbuf);
+      cptmp = ptmp;
     }
 
     if (not(vrank % 2)) {
@@ -146,7 +151,7 @@ int Coll_scatter_ompi_binomial::scatter(void* sbuf, int scount, MPI_Datatype sdt
           mycount = size - vkid;
         mycount *= scount;
 
-        Request::send(ptmp + total_send * sextent, mycount, sdtype, bmtree->tree_next[i], COLL_TAG_SCATTER, comm);
+        Request::send(cptmp + total_send * sextent, mycount, sdtype, bmtree->tree_next[i], COLL_TAG_SCATTER, comm);
 
         total_send += mycount;
       }
@@ -156,16 +161,14 @@ int Coll_scatter_ompi_binomial::scatter(void* sbuf, int scount, MPI_Datatype sdt
       Request::recv(ptmp, rcount, rdtype, bmtree->tree_prev, COLL_TAG_SCATTER, comm, &status);
     }
 
-    if (NULL != tempbuf)
-      smpi_free_tmp_buffer(tempbuf);
+    smpi_free_tmp_buffer(tempbuf);
     // not FIXME : store the tree, as done in ompi, instead of calculating it each time ?
     ompi_coll_tuned_topo_destroy_tree(&bmtree);
 
     return MPI_SUCCESS;
 
  err_hndl:
-    if (NULL != tempbuf)
-      smpi_free_tmp_buffer(tempbuf);
+    smpi_free_tmp_buffer(tempbuf);
 
     XBT_DEBUG("%s:%4d\tError occurred %d, rank %2d", __FILE__, line, err, rank);
     return err;
@@ -191,7 +194,7 @@ int Coll_scatter_ompi_binomial::scatter(void* sbuf, int scount, MPI_Datatype sdt
  *  Accepts:  - same arguments as MPI_Scatter()
  *  Returns:  - MPI_SUCCESS or error code
  */
-int Coll_scatter_ompi_basic_linear::scatter(void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount,
+int Coll_scatter_ompi_basic_linear::scatter(const void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount,
                                             MPI_Datatype rdtype, int root, MPI_Comm comm)
 {
     int i, rank, size, err;
index 35b6f72..2772069 100644 (file)
 #define TRACE_AUTO_COLL(cat)                                                                                           \
   if (TRACE_is_enabled()) {                                                                                            \
     simgrid::instr::EventType* type =                                                                                  \
-        simgrid::instr::Container::get_root()->type_->by_name_or_create<simgrid::instr::EventType>(#cat);              \
+        simgrid::instr::Container::get_root()->type_->by_name_or_create<simgrid::instr::EventType>(                    \
+            _XBT_STRINGIFY(cat));                                                                                      \
                                                                                                                        \
     std::string cont_name = std::string("rank-" + std::to_string(simgrid::s4u::this_actor::get_pid()));                \
-    type->add_entity_value(Colls::mpi_coll_##cat##_description[i].name, "1.0 1.0 1.0");                                \
+    type->add_entity_value(Colls::_XBT_CONCAT3(mpi_coll_, cat, _description)[i].name, "1.0 1.0 1.0");                  \
     new simgrid::instr::NewEvent(SIMIX_get_clock(), simgrid::instr::Container::by_name(cont_name), type,               \
-                                 type->get_entity_value(Colls::mpi_coll_##cat##_description[i].name));                 \
+                                 type->get_entity_value(Colls::_XBT_CONCAT3(mpi_coll_, cat, _description)[i].name));   \
   }
 
 #define AUTOMATIC_COLL_BENCH(cat, ret, args, args2)                                                                    \
-  ret Coll_##cat##_automatic::cat(COLL_UNPAREN args)                                                                   \
+  ret _XBT_CONCAT3(Coll_, cat, _automatic)::cat(COLL_UNPAREN args)                                                     \
   {                                                                                                                    \
     double time1, time2, time_min = DBL_MAX;                                                                           \
     int min_coll = -1, global_coll = -1;                                                                               \
     int i;                                                                                                             \
     double buf_in, buf_out, max_min = DBL_MAX;                                                                         \
-    for (i = 0; not Colls::mpi_coll_##cat##_description[i].name.empty(); i++) {                                        \
-      if (Colls::mpi_coll_##cat##_description[i].name == "automatic")                                                  \
+    for (i = 0; not Colls::_XBT_CONCAT3(mpi_coll_, cat, _description)[i].name.empty(); i++) {                          \
+      if (Colls::_XBT_CONCAT3(mpi_coll_, cat, _description)[i].name == "automatic")                                    \
         continue;                                                                                                      \
-      if (Colls::mpi_coll_##cat##_description[i].name == "default")                                                    \
+      if (Colls::_XBT_CONCAT3(mpi_coll_, cat, _description)[i].name == "default")                                      \
         continue;                                                                                                      \
       Coll_barrier_default::barrier(comm);                                                                             \
       TRACE_AUTO_COLL(cat)                                                                                             \
       time1 = SIMIX_get_clock();                                                                                       \
       try {                                                                                                            \
-        ((int(*) args)Colls::mpi_coll_##cat##_description[i].coll) args2;                                              \
+        ((int(*) args)Colls::_XBT_CONCAT3(mpi_coll_, cat, _description)[i].coll) args2;                                \
       } catch (std::exception & ex) {                                                                                  \
         continue;                                                                                                      \
       }                                                                                                                \
     }                                                                                                                  \
     if (comm->rank() == 0) {                                                                                           \
       XBT_WARN("For rank 0, the quickest was %s : %f , but global was %s : %f at max",                                 \
-               Colls::mpi_coll_##cat##_description[min_coll].name.c_str(), time_min,                                           \
-               Colls::mpi_coll_##cat##_description[global_coll].name.c_str(), max_min);                                        \
+               Colls::_XBT_CONCAT3(mpi_coll_, cat, _description)[min_coll].name.c_str(), time_min,                     \
+               Colls::_XBT_CONCAT3(mpi_coll_, cat, _description)[global_coll].name.c_str(), max_min);                  \
     } else                                                                                                             \
-      XBT_WARN("The quickest %s was %s on rank %d and took %f", #cat,                                                  \
-               Colls::mpi_coll_##cat##_description[min_coll].name.c_str(), comm->rank(), time_min);                            \
+      XBT_WARN("The quickest " _XBT_STRINGIFY(cat) " was %s on rank %d and took %f",                                   \
+               Colls::_XBT_CONCAT3(mpi_coll_, cat, _description)[min_coll].name.c_str(), comm->rank(), time_min);      \
     return (min_coll != -1) ? MPI_SUCCESS : MPI_ERR_INTERN;                                                            \
   }
 
index 4f16a56..2978f86 100644 (file)
@@ -17,12 +17,12 @@ 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 std::string& name)                                                                       \
+  void Colls::_XBT_CONCAT(set_, cat)(const 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);                                     \
+    int id = find_coll_description(_XBT_CONCAT3(mpi_coll_, cat, _description), name, _XBT_STRINGIFY(cat));             \
+    cat    = reinterpret_cast<ret(*) args>(_XBT_CONCAT3(mpi_coll_, cat, _description)[id].coll);                       \
     if (cat == nullptr)                                                                                                \
-      xbt_die("Collective " #cat " set to nullptr!");                                                                  \
+      xbt_die("Collective " _XBT_STRINGIFY(cat) " set to nullptr!");                                                   \
   }
 
 namespace simgrid{
@@ -115,27 +115,27 @@ void Colls::set_collectives(){
   }
 }
 
-//Implementations of the single algorith collectives
+//Implementations of the single algorithm collectives
 
-int Colls::gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs,
+int Colls::gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs,
                       MPI_Datatype recvtype, int root, MPI_Comm comm)
 {
   MPI_Request request;
-  Colls::igatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, &request);
+  Colls::igatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, &request, 0);
   return Request::wait(&request, MPI_STATUS_IGNORE);
 }
 
 
-int Colls::scatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount,
+int Colls::scatterv(const void *sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount,
                        MPI_Datatype recvtype, int root, MPI_Comm comm)
 {
   MPI_Request request;
-  Colls::iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, &request);
+  Colls::iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, &request, 0);
   return Request::wait(&request, MPI_STATUS_IGNORE);
 }
 
 
-int Colls::scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+int Colls::scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
   int system_tag = -888;
   MPI_Aint lb      = 0;
@@ -150,8 +150,8 @@ int Colls::scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
   Datatype::copy(sendbuf, count, datatype, recvbuf, count, datatype);
 
   // Send/Recv buffers to/from others
-  MPI_Request *requests = xbt_new(MPI_Request, size - 1);
-  void **tmpbufs = xbt_new(void *, rank);
+  MPI_Request* requests = new MPI_Request[size - 1];
+  unsigned char** tmpbufs = new unsigned char*[rank];
   int index = 0;
   for (int other = 0; other < rank; other++) {
     tmpbufs[index] = smpi_get_tmp_sendbuffer(count * dataext);
@@ -191,12 +191,12 @@ int Colls::scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
   for(index = 0; index < size-1; index++) {
     Request::unref(&requests[index]);
   }
-  xbt_free(tmpbufs);
-  xbt_free(requests);
+  delete[] tmpbufs;
+  delete[] requests;
   return MPI_SUCCESS;
 }
 
-int Colls::exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+int Colls::exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
   int system_tag = -888;
   MPI_Aint lb         = 0;
@@ -208,8 +208,8 @@ int Colls::exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype
   datatype->extent(&lb, &dataext);
 
   // Send/Recv buffers to/from others
-  MPI_Request *requests = xbt_new(MPI_Request, size - 1);
-  void **tmpbufs = xbt_new(void *, rank);
+  MPI_Request* requests = new MPI_Request[size - 1];
+  unsigned char** tmpbufs = new unsigned char*[rank];
   int index = 0;
   for (int other = 0; other < rank; other++) {
     tmpbufs[index] = smpi_get_tmp_sendbuffer(count * dataext);
@@ -258,16 +258,16 @@ int Colls::exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype
   for(index = 0; index < size-1; index++) {
     Request::unref(&requests[index]);
   }
-  xbt_free(tmpbufs);
-  xbt_free(requests);
+  delete[] tmpbufs;
+  delete[] requests;
   return MPI_SUCCESS;
 }
 
-int Colls::alltoallw(void *sendbuf, int *sendcounts, int *senddisps, MPI_Datatype* sendtypes,
-                              void *recvbuf, int *recvcounts, int *recvdisps, MPI_Datatype* recvtypes, MPI_Comm comm)
+int Colls::alltoallw(const void *sendbuf, const int *sendcounts, const int *senddisps, const MPI_Datatype* sendtypes,
+                              void *recvbuf, const int *recvcounts, const int *recvdisps, const MPI_Datatype* recvtypes, MPI_Comm comm)
 {
   MPI_Request request;
-  Colls::ialltoallw(sendbuf, sendcounts, senddisps, sendtypes, recvbuf, recvcounts, recvdisps, recvtypes, comm, &request);  
+  Colls::ialltoallw(sendbuf, sendcounts, senddisps, sendtypes, recvbuf, recvcounts, recvdisps, recvtypes, comm, &request, 0);
   return Request::wait(&request, MPI_STATUS_IGNORE);
 }
 
index 1aebcf6..6ae0e42 100644 (file)
@@ -22,15 +22,15 @@ int Coll_barrier_default::barrier(MPI_Comm comm)
 }
 
 
-int Coll_gather_default::gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
+int Coll_gather_default::gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                      void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
 {
   MPI_Request request;
-  Colls::igather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, &request);
+  Colls::igather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, &request, 0);
   return Request::wait(&request, MPI_STATUS_IGNORE);
 }
 
-int Coll_reduce_scatter_default::reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op,
+int Coll_reduce_scatter_default::reduce_scatter(const void *sendbuf, void *recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op,
                              MPI_Comm comm)
 {
   int rank = comm->rank();
@@ -38,23 +38,23 @@ int Coll_reduce_scatter_default::reduce_scatter(void *sendbuf, void *recvbuf, in
   /* arbitrarily choose root as rank 0 */
   int size = comm->size();
   int count = 0;
-  int *displs = xbt_new(int, size);
+  int* displs = new int[size];
   for (int i = 0; i < size; i++) {
     displs[i] = count;
     count += recvcounts[i];
   }
-  void *tmpbuf = static_cast<void*>(smpi_get_tmp_sendbuffer(count*datatype->get_extent()));
+  unsigned char* tmpbuf = smpi_get_tmp_sendbuffer(count * datatype->get_extent());
 
   int ret = Coll_reduce_default::reduce(sendbuf, tmpbuf, count, datatype, op, 0, comm);
   if(ret==MPI_SUCCESS)
     ret = Colls::scatterv(tmpbuf, recvcounts, displs, datatype, recvbuf, recvcounts[rank], datatype, 0, comm);
-  xbt_free(displs);
+  delete[] displs;
   smpi_free_tmp_buffer(tmpbuf);
   return ret;
 }
 
 
-int Coll_allgather_default::allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
+int Coll_allgather_default::allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                         void *recvbuf,int recvcount, MPI_Datatype recvtype, MPI_Comm comm)
 {
   MPI_Request request;
@@ -62,11 +62,11 @@ int Coll_allgather_default::allgather(void *sendbuf, int sendcount, MPI_Datatype
   return Request::wait(&request, MPI_STATUS_IGNORE);
 }
 
-int Coll_allgatherv_default::allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
-                         int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm)
+int Coll_allgatherv_default::allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
+                         const int *recvcounts, const int *displs, MPI_Datatype recvtype, MPI_Comm comm)
 {
   MPI_Request request;
-  Colls::iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, &request);
+  Colls::iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, &request, 0);
   MPI_Request* requests = request->get_nbc_requests();
   int count = request->get_nbc_requests_size();
   Request::waitall(count, requests, MPI_STATUS_IGNORE);
@@ -78,28 +78,31 @@ int Coll_allgatherv_default::allgatherv(void *sendbuf, int sendcount, MPI_Dataty
   return MPI_SUCCESS;
 }
 
-int Coll_scatter_default::scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
+int Coll_scatter_default::scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                       void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
 {
   MPI_Request request;
-  Colls::iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, &request);
+  Colls::iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, &request, 0);
   return Request::wait(&request, MPI_STATUS_IGNORE);
 }
 
-int Coll_reduce_default::reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root,
+int Coll_reduce_default::reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root,
                      MPI_Comm comm)
 {
   //non commutative case, use a working algo from openmpi
-  if (op != MPI_OP_NULL && not op->is_commutative()) {
+  if (op != MPI_OP_NULL && (datatype->flags() & DT_FLAG_DERIVED || not op->is_commutative())) {
     return Coll_reduce_ompi_basic_linear::reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
   }
   MPI_Request request;
-  Colls::ireduce(sendbuf, recvbuf, count, datatype, op, root, comm, &request);
+  Colls::ireduce(sendbuf, recvbuf, count, datatype, op, root, comm, &request, 0);
   return Request::wait(&request, MPI_STATUS_IGNORE);
 }
 
-int Coll_allreduce_default::allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+int Coll_allreduce_default::allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
 {
+  //FIXME: have mpi_ireduce and iallreduce handle derived datatypes correctly
+  if(datatype->flags() & DT_FLAG_DERIVED)
+    return Coll_allreduce_ompi::allreduce(sendbuf, recvbuf, count, datatype, op, comm);
   int ret;
   ret = Coll_reduce_default::reduce(sendbuf, recvbuf, count, datatype, op, 0, comm);
   if(ret==MPI_SUCCESS)
@@ -107,16 +110,16 @@ int Coll_allreduce_default::allreduce(void *sendbuf, void *recvbuf, int count, M
   return ret;
 }
 
-int Coll_alltoall_default::alltoall( void *sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, MPI_Comm comm)
+int Coll_alltoall_default::alltoall(const void *sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, MPI_Comm comm)
 {
   return Coll_alltoall_ompi::alltoall(sbuf, scount, sdtype, rbuf, rcount, rdtype, comm);
 }
 
-int Coll_alltoallv_default::alltoallv(void *sendbuf, int *sendcounts, int *senddisps, MPI_Datatype sendtype,
-                              void *recvbuf, int *recvcounts, int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm)
+int Coll_alltoallv_default::alltoallv(const void *sendbuf, const int *sendcounts, const int *senddisps, MPI_Datatype sendtype,
+                              void *recvbuf, const int *recvcounts, const int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm)
 {
   MPI_Request request;
-  Colls::ialltoallv(sendbuf, sendcounts, senddisps, sendtype, recvbuf, recvcounts, recvdisps, recvtype, comm, &request);
+  Colls::ialltoallv(sendbuf, sendcounts, senddisps, sendtype, recvbuf, recvcounts, recvdisps, recvtype, comm, &request, 0);
   return Request::wait(&request, MPI_STATUS_IGNORE);
 }
 
index 5166533..a126d72 100644 (file)
@@ -50,7 +50,7 @@ MPI_Allreduce
 namespace simgrid{
 namespace smpi{
 
-int (*intel_allreduce_functions_table[])(void *sendbuf,
+int (*intel_allreduce_functions_table[])(const void *sendbuf,
       void *recvbuf,
       int count,
       MPI_Datatype datatype,
@@ -634,7 +634,7 @@ intel_tuning_table_element intel_alltoall_table[] =
   }
   }
 };
-int (*intel_alltoall_functions_table[])(void *sbuf, int scount,
+int (*intel_alltoall_functions_table[])(const void *sbuf, int scount,
                                              MPI_Datatype sdtype,
                                              void* rbuf, int rcount,
                                              MPI_Datatype rdtype,
@@ -967,7 +967,7 @@ MPI_Reduce
 
 */
 
-int (*intel_reduce_functions_table[])(void *sendbuf, void *recvbuf,
+int (*intel_reduce_functions_table[])(const void *sendbuf, void *recvbuf,
                                             int count, MPI_Datatype  datatype,
                                             MPI_Op   op, int root,
                                             MPI_Comm   comm) ={
@@ -1055,8 +1055,8 @@ MPI_Reduce_scatter
 5. Topology aware Reduce + Scatterv algorithm
 
 */
-static  int intel_reduce_scatter_reduce_scatterv(void *sbuf, void *rbuf,
-                                                    int *rcounts,
+static  int intel_reduce_scatter_reduce_scatterv(const void *sbuf, void *rbuf,
+                                                    const int *rcounts,
                                                     MPI_Datatype dtype,
                                                     MPI_Op  op,
                                                     MPI_Comm  comm)
@@ -1065,8 +1065,8 @@ static  int intel_reduce_scatter_reduce_scatterv(void *sbuf, void *rbuf,
   return MPI_SUCCESS;
 }
 
-static  int  intel_reduce_scatter_recursivehalving(void *sbuf, void *rbuf,
-                                                    int *rcounts,
+static  int  intel_reduce_scatter_recursivehalving(const void *sbuf, void *rbuf,
+                                                    const int *rcounts,
                                                     MPI_Datatype dtype,
                                                     MPI_Op  op,
                                                     MPI_Comm  comm)
@@ -1077,8 +1077,8 @@ static  int  intel_reduce_scatter_recursivehalving(void *sbuf, void *rbuf,
     return Coll_reduce_scatter_mvapich2::reduce_scatter(sbuf, rbuf, rcounts,dtype, op,comm);
 }
 
-int (*intel_reduce_scatter_functions_table[])( void *sbuf, void *rbuf,
-                                                    int *rcounts,
+int (*intel_reduce_scatter_functions_table[])( const void *sbuf, void *rbuf,
+                                                    const int *rcounts,
                                                     MPI_Datatype dtype,
                                                     MPI_Op  op,
                                                     MPI_Comm  comm
@@ -1487,7 +1487,7 @@ MPI_Allgather
 
 */
 
-int (*intel_allgather_functions_table[])(void *sbuf, int scount,
+int (*intel_allgather_functions_table[])(const void *sbuf, int scount,
                                               MPI_Datatype sdtype,
                                               void* rbuf, int rcount,
                                               MPI_Datatype rdtype,
@@ -1656,10 +1656,10 @@ MPI_Allgatherv
 
 */
 
-int (*intel_allgatherv_functions_table[])(void *sbuf, int scount,
+int (*intel_allgatherv_functions_table[])(const void *sbuf, int scount,
                                                MPI_Datatype sdtype,
-                                               void* rbuf, int *rcounts,
-                                               int *rdispls,
+                                               void* rbuf, const int *rcounts,
+                                               const int *rdispls,
                                                MPI_Datatype rdtype,
                                                MPI_Comm  comm
                                                     ) ={
@@ -1867,7 +1867,7 @@ MPI_Gather
 
 */
 
-int (*intel_gather_functions_table[])(void *sbuf, int scount,
+int (*intel_gather_functions_table[])(const void *sbuf, int scount,
                                            MPI_Datatype sdtype,
                                            void* rbuf, int rcount,
                                            MPI_Datatype rdtype,
@@ -1971,7 +1971,7 @@ MPI_Scatter
 
 */
 
-int (*intel_scatter_functions_table[])(void *sbuf, int scount,
+int (*intel_scatter_functions_table[])(const void *sbuf, int scount,
                                             MPI_Datatype sdtype,
                                             void* rbuf, int rcount,
                                             MPI_Datatype rdtype,
@@ -2145,9 +2145,9 @@ MPI_Alltoallv
 
 */
 
-int (*intel_alltoallv_functions_table[])(void *sbuf, int *scounts, int *sdisps,
+int (*intel_alltoallv_functions_table[])(const void *sbuf, const int *scounts, const int *sdisps,
                                               MPI_Datatype sdtype,
-                                              void *rbuf, int *rcounts, int *rdisps,
+                                              void *rbuf, const int *rcounts, const int *rdisps,
                                               MPI_Datatype rdtype,
                                               MPI_Comm  comm
                                                     ) ={
@@ -2262,35 +2262,33 @@ intel_tuning_table_element intel_alltoallv_table[] =
 #define SIZECOMP_alltoallv\
   size_t block_dsize = 1;
 
-#define IMPI_COLL_SELECT(cat, ret, args, args2)\
-ret Coll_ ## cat ## _impi:: cat (COLL_UNPAREN args)\
-{\
-    int comm_size = comm->size();\
-    int i =0;\
-    SIZECOMP_ ## cat\
-    i=0;\
-    int j =0, k=0;\
-    if(comm->get_leaders_comm()==MPI_COMM_NULL){\
-      comm->init_smp();\
-    }\
-    int local_size=1;\
-    if (comm->is_uniform()) {\
-        local_size = comm->get_intra_comm()->size();\
-    }\
-    while(i < INTEL_MAX_NB_PPN &&\
-    local_size!=intel_ ## cat ## _table[i].ppn)\
-      i++;\
-    if(i==INTEL_MAX_NB_PPN) i=0;\
-    while(comm_size>intel_ ## cat ## _table[i].elems[j].max_num_proc\
-        && j < INTEL_MAX_NB_THRESHOLDS)\
-      j++;\
-    while(block_dsize >=intel_ ## cat ## _table[i].elems[j].elems[k].max_size\
-         && k< intel_ ## cat ## _table[i].elems[j].num_elems)\
-      k++;\
-    return (intel_ ## cat ## _functions_table[intel_ ## cat ## _table[i].elems[j].elems[k].algo-1]\
-    args2);\
-}
-
+#define IMPI_COLL_SELECT(cat, ret, args, args2)                                                                        \
+  ret _XBT_CONCAT3(Coll_, cat, _impi)::cat(COLL_UNPAREN args)                                                          \
+  {                                                                                                                    \
+    int comm_size = comm->size();                                                                                      \
+    int i         = 0;                                                                                                 \
+    _XBT_CONCAT(SIZECOMP_, cat)                                                                                        \
+    i     = 0;                                                                                                         \
+    int j = 0, k = 0;                                                                                                  \
+    if (comm->get_leaders_comm() == MPI_COMM_NULL) {                                                                   \
+      comm->init_smp();                                                                                                \
+    }                                                                                                                  \
+    int local_size = 1;                                                                                                \
+    if (comm->is_uniform()) {                                                                                          \
+      local_size = comm->get_intra_comm()->size();                                                                     \
+    }                                                                                                                  \
+    while (i < INTEL_MAX_NB_PPN && local_size != _XBT_CONCAT3(intel_, cat, _table)[i].ppn)                             \
+      i++;                                                                                                             \
+    if (i == INTEL_MAX_NB_PPN)                                                                                         \
+      i = 0;                                                                                                           \
+    while (comm_size > _XBT_CONCAT3(intel_, cat, _table)[i].elems[j].max_num_proc && j < INTEL_MAX_NB_THRESHOLDS)      \
+      j++;                                                                                                             \
+    while (block_dsize >= _XBT_CONCAT3(intel_, cat, _table)[i].elems[j].elems[k].max_size &&                           \
+           k < _XBT_CONCAT3(intel_, cat, _table)[i].elems[j].num_elems)                                                \
+      k++;                                                                                                             \
+    return (_XBT_CONCAT3(intel_, cat,                                                                                  \
+                         _functions_table)[_XBT_CONCAT3(intel_, cat, _table)[i].elems[j].elems[k].algo - 1] args2);    \
+  }
 
 COLL_APPLY(IMPI_COLL_SELECT, COLL_ALLGATHERV_SIG, (send_buff, send_count, send_type, recv_buff, recv_count, recv_disps, recv_type, comm));
 COLL_APPLY(IMPI_COLL_SELECT, COLL_ALLREDUCE_SIG, (sbuf, rbuf, rcount, dtype, op, comm));
index 6cf26f2..11de914 100644 (file)
@@ -58,7 +58,7 @@
 */
 namespace simgrid{
 namespace smpi{
-int Coll_allreduce_mpich::allreduce(void *sbuf, void *rbuf, int count,
+int Coll_allreduce_mpich::allreduce(const void *sbuf, void *rbuf, int count,
                         MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
 {
     size_t dsize, block_dsize;
@@ -138,7 +138,7 @@ int Coll_allreduce_mpich::allreduce(void *sbuf, void *rbuf, int count,
    End Algorithm: MPI_Alltoall
 */
 
-int Coll_alltoall_mpich::alltoall( void *sbuf, int scount,
+int Coll_alltoall_mpich::alltoall(const void *sbuf, int scount,
                                              MPI_Datatype sdtype,
                                              void* rbuf, int rcount,
                                              MPI_Datatype rdtype,
@@ -187,9 +187,9 @@ int Coll_alltoall_mpich::alltoall( void *sbuf, int scount,
                                                     comm);
 }
 
-int Coll_alltoallv_mpich::alltoallv(void *sbuf, int *scounts, int *sdisps,
+int Coll_alltoallv_mpich::alltoallv(const void *sbuf, const int *scounts, const int *sdisps,
                                               MPI_Datatype sdtype,
-                                              void *rbuf, int *rcounts, int *rdisps,
+                                              void *rbuf, const int *rcounts, const int *rdisps,
                                               MPI_Datatype rdtype,
                                               MPI_Comm  comm
                                               )
@@ -353,7 +353,7 @@ int Coll_bcast_mpich::bcast(void *buff, int count,
 */
 
 
-int Coll_reduce_mpich::reduce( void *sendbuf, void *recvbuf,
+int Coll_reduce_mpich::reduce(const void *sendbuf, void *recvbuf,
                                             int count, MPI_Datatype  datatype,
                                             MPI_Op   op, int root,
                                             MPI_Comm   comm
@@ -436,8 +436,8 @@ int Coll_reduce_mpich::reduce( void *sendbuf, void *recvbuf,
 */
 
 
-int Coll_reduce_scatter_mpich::reduce_scatter( void *sbuf, void *rbuf,
-                                                    int *rcounts,
+int Coll_reduce_scatter_mpich::reduce_scatter(const void *sbuf, void *rbuf,
+                                                    const int *rcounts,
                                                     MPI_Datatype dtype,
                                                     MPI_Op  op,
                                                     MPI_Comm  comm
@@ -532,7 +532,7 @@ int Coll_reduce_scatter_mpich::reduce_scatter( void *sbuf, void *rbuf,
    End Algorithm: MPI_Allgather
 */
 
-int Coll_allgather_mpich::allgather(void *sbuf, int scount,
+int Coll_allgather_mpich::allgather(const void *sbuf, int scount,
                                               MPI_Datatype sdtype,
                                               void* rbuf, int rcount,
                                               MPI_Datatype rdtype,
@@ -610,10 +610,10 @@ int Coll_allgather_mpich::allgather(void *sbuf, int scount,
 
    End Algorithm: MPI_Allgatherv
 */
-int Coll_allgatherv_mpich::allgatherv(void *sbuf, int scount,
+int Coll_allgatherv_mpich::allgatherv(const void *sbuf, int scount,
                                                MPI_Datatype sdtype,
-                                               void* rbuf, int *rcounts,
-                                               int *rdispls,
+                                               void* rbuf, const int *rcounts,
+                                               const int *rdispls,
                                                MPI_Datatype rdtype,
                                                MPI_Comm  comm
                                                )
@@ -668,7 +668,7 @@ int Coll_allgatherv_mpich::allgatherv(void *sbuf, int scount,
    End Algorithm: MPI_Gather
 */
 
-int Coll_gather_mpich::gather(void *sbuf, int scount,
+int Coll_gather_mpich::gather(const void *sbuf, int scount,
                                            MPI_Datatype sdtype,
                                            void* rbuf, int rcount,
                                            MPI_Datatype rdtype,
@@ -703,25 +703,21 @@ int Coll_gather_mpich::gather(void *sbuf, int scount,
 */
 
 
-int Coll_scatter_mpich::scatter(void *sbuf, int scount,
+int Coll_scatter_mpich::scatter(const void *sbuf, int scount,
                                             MPI_Datatype sdtype,
                                             void* rbuf, int rcount,
                                             MPI_Datatype rdtype,
                                             int root, MPI_Comm  comm
                                             )
 {
+  std::unique_ptr<unsigned char[]> tmp_buf;
   if(comm->rank()!=root){
-      sbuf=xbt_malloc(rcount*rdtype->get_extent());
-      scount=rcount;
-      sdtype=rdtype;
+    tmp_buf.reset(new unsigned char[rcount * rdtype->get_extent()]);
+    sbuf   = tmp_buf.get();
+    scount = rcount;
+    sdtype = rdtype;
   }
-  int ret= Coll_scatter_ompi_binomial::scatter (sbuf, scount, sdtype,
-                                                       rbuf, rcount, rdtype,
-                                                       root, comm);
-  if(comm->rank()!=root){
-      xbt_free(sbuf);
-  }
-  return ret;
+  return Coll_scatter_ompi_binomial::scatter(sbuf, scount, sdtype, rbuf, rcount, rdtype, root, comm);
 }
 }
 }
index 549f5a9..bc6c2c5 100644 (file)
@@ -14,7 +14,7 @@ namespace simgrid{
 namespace smpi{
 
 
-int Coll_alltoall_mvapich2::alltoall( void *sendbuf, int sendcount,
+int Coll_alltoall_mvapich2::alltoall( const void *sendbuf, int sendcount,
     MPI_Datatype sendtype,
     void* recvbuf, int recvcount,
     MPI_Datatype recvtype,
@@ -25,7 +25,6 @@ int Coll_alltoall_mvapich2::alltoall( void *sendbuf, int sendcount,
     init_mv2_alltoall_tables_stampede();
 
   int sendtype_size, recvtype_size, comm_size;
-  char * tmp_buf = NULL;
   int mpi_errno=MPI_SUCCESS;
   int range = 0;
   int range_threshold = 0;
@@ -63,16 +62,11 @@ int Coll_alltoall_mvapich2::alltoall( void *sendbuf, int sendcount,
           mv2_alltoall_thresholds_table[conf_index][range].in_place_algo_table[range_threshold].min
           ||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 );
-          Datatype::copy((char *)recvbuf,
-              comm_size*recvcount, recvtype,
-              (char *)tmp_buf,
-              comm_size*recvcount, recvtype);
+        unsigned char* tmp_buf = smpi_get_tmp_sendbuffer(comm_size * recvcount * recvtype_size);
+        Datatype::copy(recvbuf, comm_size * recvcount, recvtype, tmp_buf, comm_size * recvcount, recvtype);
 
-          mpi_errno = MV2_Alltoall_function(tmp_buf, recvcount, recvtype,
-              recvbuf, recvcount, recvtype,
-              comm );
-          smpi_free_tmp_buffer(tmp_buf);
+        mpi_errno = MV2_Alltoall_function(tmp_buf, recvcount, recvtype, recvbuf, recvcount, recvtype, comm);
+        smpi_free_tmp_buffer(tmp_buf);
       } else {
           mpi_errno = MPIR_Alltoall_inplace_MV2(sendbuf, sendcount, sendtype,
               recvbuf, recvcount, recvtype,
@@ -84,7 +78,7 @@ int Coll_alltoall_mvapich2::alltoall( void *sendbuf, int sendcount,
   return (mpi_errno);
 }
 
-int Coll_allgather_mvapich2::allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
+int Coll_allgather_mvapich2::allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
     void *recvbuf, int recvcount, MPI_Datatype recvtype,
     MPI_Comm comm)
 {
@@ -185,7 +179,7 @@ int Coll_allgather_mvapich2::allgather(void *sendbuf, int sendcount, MPI_Datatyp
   return mpi_errno;
 }
 
-int Coll_gather_mvapich2::gather(void *sendbuf,
+int Coll_gather_mvapich2::gather(const void *sendbuf,
     int sendcnt,
     MPI_Datatype sendtype,
     void *recvbuf,
@@ -259,8 +253,8 @@ int Coll_gather_mvapich2::gather(void *sendbuf,
   return mpi_errno;
 }
 
-int Coll_allgatherv_mvapich2::allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
-    void *recvbuf, int *recvcounts, int *displs,
+int Coll_allgatherv_mvapich2::allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
+    void *recvbuf, const int *recvcounts, const int *displs,
     MPI_Datatype recvtype, MPI_Comm  comm )
 {
   int mpi_errno = MPI_SUCCESS;
@@ -321,7 +315,7 @@ int Coll_allgatherv_mvapich2::allgatherv(void *sendbuf, int sendcount, MPI_Datat
 
 
 
-int Coll_allreduce_mvapich2::allreduce(void *sendbuf,
+int Coll_allreduce_mvapich2::allreduce(const void *sendbuf,
     void *recvbuf,
     int count,
     MPI_Datatype datatype,
@@ -440,9 +434,9 @@ int Coll_allreduce_mvapich2::allreduce(void *sendbuf,
 }
 
 
-int Coll_alltoallv_mvapich2::alltoallv(void *sbuf, int *scounts, int *sdisps,
+int Coll_alltoallv_mvapich2::alltoallv(const void *sbuf, const int *scounts, const int *sdisps,
     MPI_Datatype sdtype,
-    void *rbuf, int *rcounts, int *rdisps,
+    void *rbuf, const int *rcounts, const int *rdisps,
     MPI_Datatype rdtype,
     MPI_Comm  comm
 )
@@ -482,7 +476,7 @@ int Coll_bcast_mvapich2::bcast(void *buffer,
     // int is_homogeneous, is_contig;
     MPI_Aint type_size;
     //, position;
-    // void *tmp_buf = NULL;
+    // unsigned char *tmp_buf = NULL;
     MPI_Comm shmem_comm;
     //MPID_Datatype *dtp;
 
@@ -593,16 +587,16 @@ int Coll_bcast_mvapich2::bcast(void *buffer,
 #endif
      if (two_level_bcast == 1) {
        // if (not is_contig || not is_homogeneous) {
-       //   tmp_buf = (void*)smpi_get_tmp_sendbuffer(nbytes);
-
-         /*            position = 0;*/
-         /*            if (rank == root) {*/
-         /*                mpi_errno =*/
-         /*                    MPIR_Pack_impl(buffer, count, datatype, tmp_buf, nbytes, &position);*/
-         /*                if (mpi_errno)*/
-         /*                    MPIU_ERR_POP(mpi_errno);*/
-         /*            }*/
-       // }
+//   tmp_buf = smpi_get_tmp_sendbuffer(nbytes);
+
+/*            position = 0;*/
+/*            if (rank == root) {*/
+/*                mpi_errno =*/
+/*                    MPIR_Pack_impl(buffer, count, datatype, tmp_buf, nbytes, &position);*/
+/*                if (mpi_errno)*/
+/*                    MPIU_ERR_POP(mpi_errno);*/
+/*            }*/
+// }
 #ifdef CHANNEL_MRAIL_GEN2
         if ((mv2_enable_zcpy_bcast == 1) &&
               (&MPIR_Pipelined_Bcast_Zcpy_MV2 == MV2_Bcast_function)) {
@@ -662,7 +656,7 @@ int Coll_bcast_mvapich2::bcast(void *buffer,
 
 
 
-int Coll_reduce_mvapich2::reduce( void *sendbuf,
+int Coll_reduce_mvapich2::reduce(const void *sendbuf,
     void *recvbuf,
     int count,
     MPI_Datatype datatype,
@@ -780,7 +774,7 @@ int Coll_reduce_mvapich2::reduce( void *sendbuf,
 }
 
 
-int Coll_reduce_scatter_mvapich2::reduce_scatter(void *sendbuf, void *recvbuf, int *recvcnts,
+int Coll_reduce_scatter_mvapich2::reduce_scatter(const void *sendbuf, void *recvbuf, const int *recvcnts,
     MPI_Datatype datatype, MPI_Op op,
     MPI_Comm comm)
 {
@@ -855,7 +849,7 @@ int Coll_reduce_scatter_mvapich2::reduce_scatter(void *sendbuf, void *recvbuf, i
 
 
 
-int Coll_scatter_mvapich2::scatter(void *sendbuf,
+int Coll_scatter_mvapich2::scatter(const void *sendbuf,
     int sendcnt,
     MPI_Datatype sendtype,
     void *recvbuf,
index e6dfc43..9762cf2 100644 (file)
@@ -21,7 +21,7 @@ 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,
+  int (*MV2_pt_Alltoall_function)(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
                                   MPI_Datatype recvtype, MPI_Comm comm_ptr);
 };
 
@@ -32,7 +32,7 @@ struct mv2_alltoall_tuning_table {
   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,
+int (*MV2_Alltoall_function)(const 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 */
@@ -333,7 +333,7 @@ static void init_mv2_alltoall_tables_stampede()
 struct mv2_allgather_tuning_element {
   int min;
   int max;
-  int (*MV2_pt_Allgatherction)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+  int (*MV2_pt_Allgatherction)(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
                                MPI_Datatype recvtype, MPI_Comm comm_ptr);
 };
 
@@ -344,7 +344,7 @@ struct mv2_allgather_tuning_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,
+int (*MV2_Allgatherction)(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
                           MPI_Datatype recvtype, MPI_Comm comm);
 
 int* mv2_allgather_table_ppn_conf                           = NULL;
@@ -352,7 +352,7 @@ 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,
+static int MPIR_Allgather_RD_Allgather_Comm_MV2(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
                                                 int recvcount, MPI_Datatype recvtype, MPI_Comm comm_ptr)
 {
   return 0;
@@ -562,7 +562,7 @@ static void init_mv2_allgather_tables_stampede()
 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,
+  int (*MV2_pt_Gather_function)(const void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt,
                                 MPI_Datatype recvtype, int root, MPI_Comm comm_ptr);
 };
 
@@ -577,7 +577,7 @@ struct 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,
+typedef int (*MV2_Gather_function_ptr)(const 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;
@@ -652,8 +652,8 @@ static void init_mv2_gather_tables_stampede()
 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);
+  int (*MV2_pt_Allgatherv_function)(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int* recvcounts,
+                                    const int* displs, MPI_Datatype recvtype, MPI_Comm commg);
 };
 
 struct mv2_allgatherv_tuning_table {
@@ -662,8 +662,8 @@ struct mv2_allgatherv_tuning_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_Allgatherv_function)(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int* recvcounts,
+                               const int* displs, MPI_Datatype recvtype, MPI_Comm comm);
 
 int mv2_size_allgatherv_tuning_table                         = 0;
 mv2_allgatherv_tuning_table* mv2_allgatherv_thresholds_table = NULL;
@@ -731,7 +731,7 @@ static void init_mv2_allgatherv_tables_stampede()
 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,
+  int (*MV2_pt_Allreducection)(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
                                MPI_Comm comm);
 };
 
@@ -745,35 +745,35 @@ struct mv2_allreduce_tuning_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,
+int (*MV2_Allreducection)(const 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,
+int (*MV2_Allreduce_intra_function)(const 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,
+static int MPIR_Allreduce_mcst_reduce_two_level_helper_MV2(const 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,
+static int MPIR_Allreduce_mcst_reduce_redscat_gather_MV2(const 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,
+static int MPIR_Allreduce_reduce_p2p_MV2(const 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,
+static int MPIR_Allreduce_reduce_shmem_MV2(const 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);
@@ -1149,7 +1149,7 @@ static void init_mv2_bcast_tables_stampede()
 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,
+  int (*MV2_pt_Reduce_function)(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root,
                                 MPI_Comm comm_ptr);
 };
 
@@ -1170,10 +1170,10 @@ 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,
+int (*MV2_Reduce_function)(const 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,
+int (*MV2_Reduce_intra_function)(const 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
@@ -1381,7 +1381,7 @@ static void init_mv2_reduce_tables_stampede()
 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,
+  int (*MV2_pt_Red_scat_function)(const void* sendbuf, void* recvbuf, const int* recvcnts, MPI_Datatype datatype, MPI_Op op,
                                   MPI_Comm comm_ptr);
 };
 
@@ -1394,10 +1394,10 @@ struct 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,
+int (*MV2_Red_scat_function)(const void* sendbuf, void* recvbuf, const 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,
+static int MPIR_Reduce_Scatter_Basic_MV2(const void* sendbuf, void* recvbuf, const 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);
@@ -1473,7 +1473,7 @@ static void init_mv2_reduce_scatter_tables_stampede()
 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,
+  int (*MV2_pt_Scatter_function)(const void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt,
                                  MPI_Datatype recvtype, int root, MPI_Comm comm);
 };
 
@@ -1490,15 +1490,15 @@ 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,
+int (*MV2_Scatter_function)(const 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,
+int (*MV2_Scatter_intra_function)(const 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,
+int MPIR_Scatter_mcst_wrap_MV2(const 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,
+int MPIR_Scatter_mcst_wrap_MV2(const void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt,
                                MPI_Datatype recvtype, int root, MPI_Comm comm_ptr)
 {
   return 0;
index 6c234e6..22301c0 100644 (file)
@@ -12,62 +12,55 @@ namespace simgrid{
 namespace smpi{
 
 
-int Colls::ibarrier(MPI_Comm comm, MPI_Request* request)
+int Colls::ibarrier(MPI_Comm comm, MPI_Request* request, int external)
 {
-  int i;
   int size = comm->size();
   int rank = comm->rank();
-  MPI_Request* requests;
+  int system_tag=COLL_TAG_BARRIER-external;
   (*request) = new Request( nullptr, 0, MPI_BYTE,
-                         rank,rank, COLL_TAG_BARRIER, comm, MPI_REQ_PERSISTENT);
+                         rank,rank, system_tag, comm, MPI_REQ_PERSISTENT);
   if (rank > 0) {
-    requests = new MPI_Request[2];
+    MPI_Request* requests = new MPI_Request[2];
     requests[0] = Request::isend (nullptr, 0, MPI_BYTE, 0,
-                             COLL_TAG_BARRIER,
+                             system_tag,
                              comm);
     requests[1] = Request::irecv (nullptr, 0, MPI_BYTE, 0,
-                             COLL_TAG_BARRIER,
+                             system_tag,
                              comm);
     (*request)->set_nbc_requests(requests, 2);
   }
   else {
-    requests = new MPI_Request[(size-1)*2];
-    for (i = 1; i < 2*size-1; i+=2) {
-        requests[i-1] = Request::irecv(nullptr, 0, MPI_BYTE, MPI_ANY_SOURCE,
-                                 COLL_TAG_BARRIER, comm
-                                 );
-        requests[i] = Request::isend(nullptr, 0, MPI_BYTE, (i+1)/2,
-                                 COLL_TAG_BARRIER,
-                                 comm
-                                 );
+    MPI_Request* requests = new MPI_Request[(size - 1) * 2];
+    for (int i = 1; i < 2 * size - 1; i += 2) {
+      requests[i - 1] = Request::irecv(nullptr, 0, MPI_BYTE, MPI_ANY_SOURCE, system_tag, comm);
+      requests[i]     = Request::isend(nullptr, 0, MPI_BYTE, (i + 1) / 2, system_tag, comm);
     }
     (*request)->set_nbc_requests(requests, 2*(size-1));
   }
   return MPI_SUCCESS;
 }
 
-int Colls::ibcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm, MPI_Request* request)
+int Colls::ibcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm, MPI_Request* request, int external)
 {
-  int i;
   int size = comm->size();
   int rank = comm->rank();
-  MPI_Request* requests;
+  int system_tag=COLL_TAG_BCAST-external;
   (*request) = new Request( nullptr, 0, MPI_BYTE,
-                         rank,rank, COLL_TAG_BCAST, comm, MPI_REQ_PERSISTENT);
+                         rank,rank, system_tag, comm, MPI_REQ_PERSISTENT);
   if (rank != root) {
-    requests = new MPI_Request[1];
+    MPI_Request* requests = new MPI_Request[1];
     requests[0] = Request::irecv (buf, count, datatype, root,
-                             COLL_TAG_BCAST,
+                             system_tag,
                              comm);
     (*request)->set_nbc_requests(requests, 1);
   }
   else {
-    requests = new MPI_Request[size-1];
+    MPI_Request* requests = new MPI_Request[size - 1];
     int n = 0;
-    for (i = 0; i < size; i++) {
+    for (int i = 0; i < size; i++) {
       if(i!=root){
         requests[n] = Request::isend(buf, count, datatype, i,
-                                 COLL_TAG_BCAST,
+                                 system_tag,
                                  comm
                                  );
         n++;
@@ -78,14 +71,13 @@ int Colls::ibcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Com
   return MPI_SUCCESS;
 }
 
-int Colls::iallgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
-                        void *recvbuf,int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request)
+int Colls::iallgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
+                        void *recvbuf,int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request, int external)
 {
 
-  const int system_tag = COLL_TAG_ALLGATHER;
+  const int system_tag = COLL_TAG_ALLGATHER-external;
   MPI_Aint lb = 0;
   MPI_Aint recvext = 0;
-  MPI_Request *requests;
 
   int rank = comm->rank();
   int size = comm->size();
@@ -97,7 +89,7 @@ int Colls::iallgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
   Datatype::copy(sendbuf, sendcount, sendtype, static_cast<char *>(recvbuf) + rank * recvcount * recvext, recvcount,
                      recvtype);
   // Send/Recv buffers to/from others;
-  requests = new MPI_Request[2 * (size - 1)];
+  MPI_Request* requests = new MPI_Request[2 * (size - 1)];
   int index = 0;
   for (int other = 0; other < size; other++) {
     if(other != rank) {
@@ -113,20 +105,19 @@ int Colls::iallgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
   return MPI_SUCCESS;
 }
 
-int Colls::iscatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
-                      void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request)
+int Colls::iscatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
+                      void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request, int external)
 {
-  const int system_tag = COLL_TAG_SCATTER;
+  const int system_tag = COLL_TAG_SCATTER-external;
   MPI_Aint lb = 0;
   MPI_Aint sendext = 0;
-  MPI_Request *requests;
 
   int rank = comm->rank();
   int size = comm->size();
   (*request) = new Request( nullptr, 0, MPI_BYTE,
                          rank,rank, system_tag, comm, MPI_REQ_PERSISTENT);
   if(rank != root) {
-    requests = new MPI_Request[1];
+    MPI_Request* requests = new MPI_Request[1];
     // Recv buffer from root
     requests[0] = Request::irecv(recvbuf, recvcount, recvtype, root, system_tag, comm);
     (*request)->set_nbc_requests(requests, 1);
@@ -134,15 +125,15 @@ int Colls::iscatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
     sendtype->extent(&lb, &sendext);
     // Local copy from root
     if(recvbuf!=MPI_IN_PLACE){
-        Datatype::copy(static_cast<char *>(sendbuf) + root * sendcount * sendext,
+        Datatype::copy(static_cast<const char *>(sendbuf) + root * sendcount * sendext,
                            sendcount, sendtype, recvbuf, recvcount, recvtype);
     }
     // Send buffers to receivers
-    requests = new MPI_Request[size - 1];
+    MPI_Request* requests = new MPI_Request[size - 1];
     int index = 0;
     for(int dst = 0; dst < size; dst++) {
       if(dst != root) {
-        requests[index] = Request::isend_init(static_cast<char *>(sendbuf) + dst * sendcount * sendext, sendcount, sendtype,
+        requests[index] = Request::isend_init(static_cast<const char *>(sendbuf) + dst * sendcount * sendext, sendcount, sendtype,
                                           dst, system_tag, comm);
         index++;
       }
@@ -154,10 +145,10 @@ int Colls::iscatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
   return MPI_SUCCESS;
 }
 
-int Colls::iallgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
-                         int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request)
+int Colls::iallgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
+                         const int *recvcounts, const int *displs, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request, int external)
 {
-  const int system_tag = COLL_TAG_ALLGATHERV;
+  const int system_tag = COLL_TAG_ALLGATHERV-external;
   MPI_Aint lb = 0;
   MPI_Aint recvext = 0;
 
@@ -188,12 +179,11 @@ int Colls::iallgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void
   return MPI_SUCCESS;
 }
 
-int Colls::ialltoall( void *sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request){
-int system_tag = COLL_TAG_ALLTOALL;
-  int i;
-  int count;
-  MPI_Aint lb = 0, sendext = 0, recvext = 0;
-  MPI_Request *requests;
+int Colls::ialltoall( const void *sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request, int external){
+  int system_tag   = COLL_TAG_ALLTOALL-external;
+  MPI_Aint lb      = 0;
+  MPI_Aint sendext = 0;
+  MPI_Aint recvext = 0;
 
   /* Initialize. */
   int rank = comm->rank();
@@ -203,14 +193,14 @@ int system_tag = COLL_TAG_ALLTOALL;
   sendtype->extent(&lb, &sendext);
   recvtype->extent(&lb, &recvext);
   /* simple optimization */
-  int err = Datatype::copy(static_cast<char *>(sendbuf) + rank * sendcount * sendext, sendcount, sendtype,
+  int err = Datatype::copy(static_cast<const char *>(sendbuf) + rank * sendcount * sendext, sendcount, sendtype,
                                static_cast<char *>(recvbuf) + rank * recvcount * recvext, recvcount, recvtype);
   if (err == MPI_SUCCESS && size > 1) {
     /* Initiate all send/recv to/from others. */
-    requests = new MPI_Request[2 * (size - 1)];
+    MPI_Request* requests = new MPI_Request[2 * (size - 1)];
     /* Post all receives first -- a simple optimization */
-    count = 0;
-    for (i = (rank + 1) % size; i != rank; i = (i + 1) % size) {
+    int count = 0;
+    for (int i = (rank + 1) % size; i != rank; i = (i + 1) % size) {
       requests[count] = Request::irecv_init(static_cast<char *>(recvbuf) + i * recvcount * recvext, recvcount,
                                         recvtype, i, system_tag, comm);
       count++;
@@ -220,8 +210,8 @@ int system_tag = COLL_TAG_ALLTOALL;
      *     when messages actually arrive in the order in which they were posted.
      * TODO: check the previous assertion
      */
-    for (i = (rank + size - 1) % size; i != rank; i = (i + size - 1) % size) {
-      requests[count] = Request::isend_init(static_cast<char *>(sendbuf) + i * sendcount * sendext, sendcount,
+    for (int i = (rank + size - 1) % size; i != rank; i = (i + size - 1) % size) {
+      requests[count] = Request::isend_init(static_cast<const char *>(sendbuf) + i * sendcount * sendext, sendcount,
                                         sendtype, i, system_tag, comm);
       count++;
     }
@@ -232,13 +222,12 @@ int system_tag = COLL_TAG_ALLTOALL;
   return MPI_SUCCESS;
 }
 
-int Colls::ialltoallv(void *sendbuf, int *sendcounts, int *senddisps, MPI_Datatype sendtype,
-                              void *recvbuf, int *recvcounts, int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request){
-  const int system_tag = COLL_TAG_ALLTOALLV;
+int Colls::ialltoallv(const void *sendbuf, const int *sendcounts, const int *senddisps, MPI_Datatype sendtype,
+                              void *recvbuf, const int *recvcounts, const int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request, int external){
+  const int system_tag = COLL_TAG_ALLTOALLV-external;
   MPI_Aint lb = 0;
   MPI_Aint sendext = 0;
   MPI_Aint recvext = 0;
-  MPI_Request *requests;
 
   /* Initialize. */
   int rank = comm->rank();
@@ -248,11 +237,11 @@ int Colls::ialltoallv(void *sendbuf, int *sendcounts, int *senddisps, MPI_Dataty
   sendtype->extent(&lb, &sendext);
   recvtype->extent(&lb, &recvext);
   /* Local copy from self */
-  int err = Datatype::copy(static_cast<char *>(sendbuf) + senddisps[rank] * sendext, sendcounts[rank], sendtype,
+  int err = Datatype::copy(static_cast<const char *>(sendbuf) + senddisps[rank] * sendext, sendcounts[rank], sendtype,
                                static_cast<char *>(recvbuf) + recvdisps[rank] * recvext, recvcounts[rank], recvtype);
   if (err == MPI_SUCCESS && size > 1) {
     /* Initiate all send/recv to/from others. */
-    requests = new MPI_Request[2 * (size - 1)];
+    MPI_Request* requests = new MPI_Request[2 * (size - 1)];
     int count = 0;
     /* Create all receives that will be posted first */
     for (int i = 0; i < size; ++i) {
@@ -267,7 +256,7 @@ int Colls::ialltoallv(void *sendbuf, int *sendcounts, int *senddisps, MPI_Dataty
     /* Now create all sends  */
     for (int i = 0; i < size; ++i) {
       if (i != rank) {
-      requests[count] = Request::isend_init(static_cast<char *>(sendbuf) + senddisps[i] * sendext,
+      requests[count] = Request::isend_init(static_cast<const char *>(sendbuf) + senddisps[i] * sendext,
                                         sendcounts[i], sendtype, i, system_tag, comm);
       count++;
       }else{
@@ -281,10 +270,9 @@ int Colls::ialltoallv(void *sendbuf, int *sendcounts, int *senddisps, MPI_Dataty
   return err;
 }
 
-int Colls::ialltoallw(void *sendbuf, int *sendcounts, int *senddisps, MPI_Datatype* sendtypes,
-                              void *recvbuf, int *recvcounts, int *recvdisps, MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request *request){
-  const int system_tag = COLL_TAG_ALLTOALLV;
-  MPI_Request *requests;
+int Colls::ialltoallw(const void *sendbuf, const int *sendcounts, const int *senddisps, const MPI_Datatype* sendtypes,
+                              void *recvbuf, const int *recvcounts, const int *recvdisps, const MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request *request, int external){
+  const int system_tag = COLL_TAG_ALLTOALLW-external;
 
   /* Initialize. */
   int rank = comm->rank();
@@ -292,11 +280,11 @@ int Colls::ialltoallw(void *sendbuf, int *sendcounts, int *senddisps, MPI_Dataty
   (*request) = new Request( nullptr, 0, MPI_BYTE,
                          rank,rank, system_tag, comm, MPI_REQ_PERSISTENT);
   /* Local copy from self */
-  int err = (sendcounts[rank]>0 && recvcounts[rank]) ? Datatype::copy(static_cast<char *>(sendbuf) + senddisps[rank], sendcounts[rank], sendtypes[rank],
+  int err = (sendcounts[rank]>0 && recvcounts[rank]) ? Datatype::copy(static_cast<const char *>(sendbuf) + senddisps[rank], sendcounts[rank], sendtypes[rank],
                                static_cast<char *>(recvbuf) + recvdisps[rank], recvcounts[rank], recvtypes[rank]): MPI_SUCCESS;
   if (err == MPI_SUCCESS && size > 1) {
     /* Initiate all send/recv to/from others. */
-    requests = new MPI_Request[2 * (size - 1)];
+    MPI_Request* requests = new MPI_Request[2 * (size - 1)];
     int count = 0;
     /* Create all receives that will be posted first */
     for (int i = 0; i < size; ++i) {
@@ -311,7 +299,7 @@ int Colls::ialltoallw(void *sendbuf, int *sendcounts, int *senddisps, MPI_Dataty
     /* Now create all sends  */
     for (int i = 0; i < size; ++i) {
       if (i != rank) {
-      requests[count] = Request::isend_init(static_cast<char *>(sendbuf) + senddisps[i] ,
+      requests[count] = Request::isend_init(static_cast<const char *>(sendbuf) + senddisps[i] ,
                                         sendcounts[i], sendtypes[i], i, system_tag, comm);
       count++;
       }else{
@@ -325,13 +313,12 @@ int Colls::ialltoallw(void *sendbuf, int *sendcounts, int *senddisps, MPI_Dataty
   return err;
 }
 
-int Colls::igather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
-                     void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request)
+int Colls::igather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
+                     void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request, int external)
 {
-  const int system_tag = COLL_TAG_GATHER;
+  const int system_tag = COLL_TAG_GATHER-external;
   MPI_Aint lb = 0;
   MPI_Aint recvext = 0;
-  MPI_Request *requests;
 
   int rank = comm->rank();
   int size = comm->size();
@@ -339,7 +326,7 @@ int Colls::igather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                          rank,rank, system_tag, comm, MPI_REQ_PERSISTENT);
   if(rank != root) {
     // Send buffer to root
-    requests = new MPI_Request[1];
+    MPI_Request* requests = new MPI_Request[1];
     requests[0]=Request::isend(sendbuf, sendcount, sendtype, root, system_tag, comm);
     (*request)->set_nbc_requests(requests, 1);
   } else {
@@ -348,7 +335,7 @@ int Colls::igather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
     Datatype::copy(sendbuf, sendcount, sendtype, static_cast<char*>(recvbuf) + root * recvcount * recvext,
                        recvcount, recvtype);
     // Receive buffers from senders
-    requests = new MPI_Request[size - 1];
+    MPI_Request* requests = new MPI_Request[size - 1];
     int index = 0;
     for (int src = 0; src < size; src++) {
       if(src != root) {
@@ -364,13 +351,12 @@ int Colls::igather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
   return MPI_SUCCESS;
 }
 
-int Colls::igatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs,
-                      MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request)
+int Colls::igatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs,
+                      MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request, int external)
 {
-  int system_tag = COLL_TAG_GATHERV;
+  int system_tag = COLL_TAG_GATHERV-external;
   MPI_Aint lb = 0;
   MPI_Aint recvext = 0;
-  MPI_Request *requests;
   
   int rank = comm->rank();
   int size = comm->size();
@@ -378,7 +364,7 @@ int Colls::igatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *r
                          rank,rank, system_tag, comm, MPI_REQ_PERSISTENT);
   if (rank != root) {
     // Send buffer to root
-    requests = new MPI_Request[1];
+    MPI_Request* requests = new MPI_Request[1];
     requests[0]=Request::isend(sendbuf, sendcount, sendtype, root, system_tag, comm);
     (*request)->set_nbc_requests(requests, 1);
   } else {
@@ -387,7 +373,7 @@ int Colls::igatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *r
     Datatype::copy(sendbuf, sendcount, sendtype, static_cast<char*>(recvbuf) + displs[root] * recvext,
                        recvcounts[root], recvtype);
     // Receive buffers from senders
-    requests = new MPI_Request[size - 1];
+    MPI_Request* requests = new MPI_Request[size - 1];
     int index = 0;
     for (int src = 0; src < size; src++) {
       if(src != root) {
@@ -402,13 +388,12 @@ int Colls::igatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *r
   }
   return MPI_SUCCESS;
 }
-int Colls::iscatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount,
-                       MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request)
+int Colls::iscatterv(const void *sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount,
+                       MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request, int external)
 {
-  int system_tag = COLL_TAG_SCATTERV;
+  int system_tag = COLL_TAG_SCATTERV-external;
   MPI_Aint lb = 0;
   MPI_Aint sendext = 0;
-  MPI_Request* requests;
 
   int rank = comm->rank();
   int size = comm->size();
@@ -416,14 +401,14 @@ int Colls::iscatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype s
                          rank,rank, system_tag, comm, MPI_REQ_PERSISTENT);
   if(rank != root) {
     // Recv buffer from root
-    requests = new MPI_Request[1];
+    MPI_Request* requests = new MPI_Request[1];
     requests[0]=Request::irecv(recvbuf, recvcount, recvtype, root, system_tag, comm);
     (*request)->set_nbc_requests(requests, 1);
   } else {
     sendtype->extent(&lb, &sendext);
     // Local copy from root
     if(recvbuf!=MPI_IN_PLACE){
-      Datatype::copy(static_cast<char *>(sendbuf) + displs[root] * sendext, sendcounts[root],
+      Datatype::copy(static_cast<const char *>(sendbuf) + displs[root] * sendext, sendcounts[root],
                        sendtype, recvbuf, recvcount, recvtype);
     }
     // Send buffers to receivers
@@ -431,7 +416,7 @@ int Colls::iscatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype s
     int index = 0;
     for (int dst = 0; dst < size; dst++) {
       if (dst != root) {
-        requests[index] = Request::isend_init(static_cast<char *>(sendbuf) + displs[dst] * sendext, sendcounts[dst],
+        requests[index] = Request::isend_init(static_cast<const char *>(sendbuf) + displs[dst] * sendext, sendcounts[dst],
                             sendtype, dst, system_tag, comm);
         index++;
       }
@@ -443,15 +428,14 @@ int Colls::iscatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype s
   return MPI_SUCCESS;
 }
 
-int Colls::ireduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root,
-                     MPI_Comm comm, MPI_Request* request)
+int Colls::ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root,
+                     MPI_Comm comm, MPI_Request* request, int external)
 {
-  const int system_tag = COLL_TAG_REDUCE;
+  const int system_tag = COLL_TAG_REDUCE-external;
   MPI_Aint lb = 0;
   MPI_Aint dataext = 0;
-  MPI_Request* requests;
 
-  char* sendtmpbuf = static_cast<char *>(sendbuf);
+  const void* real_sendbuf = sendbuf;
 
   int rank = comm->rank();
   int size = comm->size();
@@ -459,9 +443,11 @@ int Colls::ireduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp
   if (size <= 0)
     return MPI_ERR_COMM;
 
+  unsigned char* tmp_sendbuf = nullptr;
   if( sendbuf == MPI_IN_PLACE ) {
-    sendtmpbuf = static_cast<char *>(smpi_get_tmp_sendbuffer(count*datatype->get_extent()));
-    Datatype::copy(recvbuf, count, datatype,sendtmpbuf, count, datatype);
+    tmp_sendbuf = smpi_get_tmp_sendbuffer(count * datatype->get_extent());
+    Datatype::copy(recvbuf, count, datatype, tmp_sendbuf, count, datatype);
+    real_sendbuf = tmp_sendbuf;
   }
 
   if(rank == root){
@@ -474,14 +460,14 @@ int Colls::ireduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp
 
   if(rank != root) {
     // Send buffer to root
-    requests = new MPI_Request[1];
-    requests[0]=Request::isend(sendtmpbuf, count, datatype, root, system_tag, comm);
+    MPI_Request* requests = new MPI_Request[1];
+    requests[0]           = Request::isend(real_sendbuf, count, datatype, root, system_tag, comm);
     (*request)->set_nbc_requests(requests, 1);
   } else {
     datatype->extent(&lb, &dataext);
     // Local copy from root
-    if (sendtmpbuf != nullptr && recvbuf != nullptr)
-      Datatype::copy(sendtmpbuf, count, datatype, recvbuf, count, datatype);
+    if (real_sendbuf != nullptr && recvbuf != nullptr)
+      Datatype::copy(real_sendbuf, count, datatype, recvbuf, count, datatype);
     // Receive buffers from senders
     MPI_Request *requests = new MPI_Request[size - 1];
     int index = 0;
@@ -497,19 +483,18 @@ int Colls::ireduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp
     (*request)->set_nbc_requests(requests, size - 1);
   }    
   if( sendbuf == MPI_IN_PLACE ) {
-    smpi_free_tmp_buffer(sendtmpbuf);
+    smpi_free_tmp_buffer(tmp_sendbuf);
   }
   return MPI_SUCCESS;
 }
 
-int Colls::iallreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
-                      MPI_Op op, MPI_Comm comm, MPI_Request* request)
+int Colls::iallreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
+                      MPI_Op op, MPI_Comm comm, MPI_Request* request, int external)
 {
 
-  const int system_tag = COLL_TAG_ALLREDUCE;
+  const int system_tag = COLL_TAG_ALLREDUCE-external;
   MPI_Aint lb = 0;
   MPI_Aint dataext = 0;
-  MPI_Request *requests;
 
   int rank = comm->rank();
   int size = comm->size();
@@ -520,7 +505,7 @@ int Colls::iallreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype data
   // Local copy from self
   Datatype::copy(sendbuf, count, datatype, recvbuf, count, datatype);
   // Send/Recv buffers to/from others;
-  requests = new MPI_Request[2 * (size - 1)];
+  MPI_Request* requests = new MPI_Request[2 * (size - 1)];
   int index = 0;
   for (int other = 0; other < size; other++) {
     if(other != rank) {
@@ -536,9 +521,9 @@ int Colls::iallreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype data
   return MPI_SUCCESS;
 }
 
-int Colls::iscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request)
+int Colls::iscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request, int external)
 {
-  int system_tag = -888;
+  int system_tag = -888-external;
   MPI_Aint lb      = 0;
   MPI_Aint dataext = 0;
 
@@ -553,11 +538,9 @@ int Colls::iscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
 
   // Send/Recv buffers to/from others
   MPI_Request *requests = new MPI_Request[size - 1];
-  void **tmpbufs = xbt_new(void *, rank);
   int index = 0;
   for (int other = 0; other < rank; other++) {
-    tmpbufs[index] = smpi_get_tmp_sendbuffer(count * dataext);
-    requests[index] = Request::irecv_init(tmpbufs[index], count, datatype, other, system_tag, comm);
+    requests[index] = Request::irecv_init(smpi_get_tmp_sendbuffer(count * dataext), count, datatype, other, system_tag, comm);
     index++;
   }
   for (int other = rank + 1; other < size; other++) {
@@ -570,9 +553,9 @@ int Colls::iscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
   return MPI_SUCCESS;
 }
 
-int Colls::iexscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request)
+int Colls::iexscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request, int external)
 {
-  int system_tag = -888;
+  int system_tag = -888-external;
   MPI_Aint lb         = 0;
   MPI_Aint dataext    = 0;
   int rank = comm->rank();
@@ -585,11 +568,9 @@ int Colls::iexscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp
 
   // Send/Recv buffers to/from others
   MPI_Request *requests = new MPI_Request[size - 1];
-  void **tmpbufs = xbt_new(void *, rank);
   int index = 0;
   for (int other = 0; other < rank; other++) {
-    tmpbufs[index] = smpi_get_tmp_sendbuffer(count * dataext);
-    requests[index] = Request::irecv_init(tmpbufs[index], count, datatype, other, system_tag, comm);
+    requests[index] = Request::irecv_init(smpi_get_tmp_sendbuffer(count * dataext), count, datatype, other, system_tag, comm);
     index++;
   }
   for (int other = rank + 1; other < size; other++) {
@@ -602,13 +583,12 @@ int Colls::iexscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp
   return MPI_SUCCESS;
 }
 
-int Colls::ireduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op,
-                             MPI_Comm comm, MPI_Request* request){
+int Colls::ireduce_scatter(const void *sendbuf, void *recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op,
+                             MPI_Comm comm, MPI_Request* request, int external){
 //Version where each process performs the reduce for its own part. Alltoall pattern for comms.
-  const int system_tag = COLL_TAG_REDUCE_SCATTER;
+  const int system_tag = COLL_TAG_REDUCE_SCATTER-external;
   MPI_Aint lb = 0;
   MPI_Aint dataext = 0;
-  MPI_Request *requests;
 
   int rank = comm->rank();
   int size = comm->size();
@@ -618,19 +598,19 @@ int Colls::ireduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Da
   datatype->extent(&lb, &dataext);
 
   // Send/Recv buffers to/from others;
-  requests = new MPI_Request[2 * (size - 1)];
+  MPI_Request* requests = new MPI_Request[2 * (size - 1)];
   int index = 0;
   int recvdisp=0;
   for (int other = 0; other < size; other++) {
     if(other != rank) {
-      requests[index] = Request::isend_init(static_cast<char *>(sendbuf) + recvdisp * dataext, recvcounts[other], datatype, other, system_tag,comm);
+      requests[index] = Request::isend_init(static_cast<const char *>(sendbuf) + recvdisp * dataext, recvcounts[other], datatype, other, system_tag,comm);
       XBT_VERB("sending with recvdisp %d", recvdisp);
       index++;
       requests[index] = Request::irecv_init(smpi_get_tmp_sendbuffer(count * dataext), count, datatype,
                                         other, system_tag, comm);
       index++;
     }else{
-      Datatype::copy(static_cast<char *>(sendbuf) + recvdisp * dataext, count, datatype, recvbuf, count, datatype);
+      Datatype::copy(static_cast<const char *>(sendbuf) + recvdisp * dataext, count, datatype, recvbuf, count, datatype);
     }
     recvdisp+=recvcounts[other];
   }
index 1464d17..3461709 100644 (file)
@@ -11,7 +11,7 @@
 namespace simgrid{
 namespace smpi{
 
-int Coll_allreduce_ompi::allreduce(void *sbuf, void *rbuf, int count,
+int Coll_allreduce_ompi::allreduce(const void *sbuf, void *rbuf, int count,
                         MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
 {
     size_t dsize, block_dsize;
@@ -55,7 +55,7 @@ int Coll_allreduce_ompi::allreduce(void *sbuf, void *rbuf, int count,
 
 
 
-int Coll_alltoall_ompi::alltoall( void *sbuf, int scount,
+int Coll_alltoall_ompi::alltoall(const void *sbuf, int scount,
                                              MPI_Datatype sdtype,
                                              void* rbuf, int rcount,
                                              MPI_Datatype rdtype,
@@ -88,9 +88,9 @@ int Coll_alltoall_ompi::alltoall( void *sbuf, int scount,
                                                     comm);
 }
 
-int Coll_alltoallv_ompi::alltoallv(void *sbuf, int *scounts, int *sdisps,
+int Coll_alltoallv_ompi::alltoallv(const void *sbuf, const int *scounts, const int *sdisps,
                                               MPI_Datatype sdtype,
-                                              void *rbuf, int *rcounts, int *rdisps,
+                                              void *rbuf, const int *rcounts, const int *rdisps,
                                               MPI_Datatype rdtype,
                                               MPI_Comm  comm
                                               )
@@ -224,7 +224,7 @@ int Coll_bcast_ompi::bcast(void *buff, int count,
 #endif  /* 0 */
 }
 
-int Coll_reduce_ompi::reduce( void *sendbuf, void *recvbuf,
+int Coll_reduce_ompi::reduce(const void *sendbuf, void *recvbuf,
                                             int count, MPI_Datatype  datatype,
                                             MPI_Op   op, int root,
                                             MPI_Comm   comm
@@ -327,8 +327,8 @@ int Coll_reduce_ompi::reduce( void *sendbuf, void *recvbuf,
 #endif  /* 0 */
 }
 
-int Coll_reduce_scatter_ompi::reduce_scatter( void *sbuf, void *rbuf,
-                                                    int *rcounts,
+int Coll_reduce_scatter_ompi::reduce_scatter(const void *sbuf, void *rbuf,
+                                                    const int *rcounts,
                                                     MPI_Datatype dtype,
                                                     MPI_Op  op,
                                                     MPI_Comm  comm
@@ -381,7 +381,7 @@ int Coll_reduce_scatter_ompi::reduce_scatter( void *sbuf, void *rbuf,
 
 }
 
-int Coll_allgather_ompi::allgather(void *sbuf, int scount,
+int Coll_allgather_ompi::allgather(const void *sbuf, int scount,
                                               MPI_Datatype sdtype,
                                               void* rbuf, int rcount,
                                               MPI_Datatype rdtype,
@@ -461,10 +461,10 @@ int Coll_allgather_ompi::allgather(void *sbuf, int scount,
 #endif  /* defined(USE_MPICH2_DECISION) */
 }
 
-int Coll_allgatherv_ompi::allgatherv(void *sbuf, int scount,
+int Coll_allgatherv_ompi::allgatherv(const void *sbuf, int scount,
                                                MPI_Datatype sdtype,
-                                               void* rbuf, int *rcounts,
-                                               int *rdispls,
+                                               void* rbuf, const int *rcounts,
+                                               const int *rdispls,
                                                MPI_Datatype rdtype,
                                                MPI_Comm  comm
                                                )
@@ -508,7 +508,7 @@ int Coll_allgatherv_ompi::allgatherv(void *sbuf, int scount,
     }
 }
 
-int Coll_gather_ompi::gather(void *sbuf, int scount,
+int Coll_gather_ompi::gather(const void *sbuf, int scount,
                                            MPI_Datatype sdtype,
                                            void* rbuf, int rcount,
                                            MPI_Datatype rdtype,
@@ -568,7 +568,7 @@ int Coll_gather_ompi::gather(void *sbuf, int scount,
 }
 
 
-int Coll_scatter_ompi::scatter(void *sbuf, int scount,
+int Coll_scatter_ompi::scatter(const void *sbuf, int scount,
                                             MPI_Datatype sdtype,
                                             void* rbuf, int rcount,
                                             MPI_Datatype rdtype,
@@ -595,18 +595,14 @@ int Coll_scatter_ompi::scatter(void *sbuf, int scount,
 
     if ((communicator_size > small_comm_size) &&
         (block_size < small_block_size)) {
-        if(rank!=root){
-            sbuf=xbt_malloc(rcount*rdtype->get_extent());
-            scount=rcount;
-            sdtype=rdtype;
-        }
-        int ret=Coll_scatter_ompi_binomial::scatter (sbuf, scount, sdtype,
-            rbuf, rcount, rdtype,
-            root, comm);
-        if(rank!=root){
-            xbt_free(sbuf);
-        }
-        return ret;
+      std::unique_ptr<unsigned char[]> tmp_buf;
+      if (rank != root) {
+        tmp_buf.reset(new unsigned char[rcount * rdtype->get_extent()]);
+        sbuf   = tmp_buf.get();
+        scount = rcount;
+        sdtype = rdtype;
+      }
+      return Coll_scatter_ompi_binomial::scatter(sbuf, scount, sdtype, rbuf, rcount, rdtype, root, comm);
     }
     return Coll_scatter_ompi_basic_linear::scatter (sbuf, scount, sdtype,
                                                        rbuf, rcount, rdtype,
index fbf827a..ca7e3ab 100644 (file)
@@ -26,8 +26,9 @@ constexpr unsigned MPI_REQ_RMA            = 0x200;
 constexpr unsigned MPI_REQ_ACCUMULATE     = 0x400;
 constexpr unsigned MPI_REQ_GENERALIZED    = 0x800;
 constexpr unsigned MPI_REQ_COMPLETE       = 0x1000;
+constexpr unsigned MPI_REQ_BSEND          = 0x2000;
 
-enum class SmpiProcessState { UNINITIALIZED, INITIALIZING, INITIALIZED, FINALIZED };
+enum class SmpiProcessState { UNINITIALIZED, INITIALIZING, INITIALIZED /*(=MPI_Init called)*/, FINALIZED };
 
 constexpr int COLL_TAG_REDUCE         = -112;
 constexpr int COLL_TAG_SCATTER        = -223;
@@ -38,21 +39,31 @@ constexpr int COLL_TAG_ALLGATHERV     = -667;
 constexpr int COLL_TAG_BARRIER        = -778;
 constexpr int COLL_TAG_REDUCE_SCATTER = -889;
 constexpr int COLL_TAG_ALLTOALLV      = -1000;
+constexpr int COLL_TAG_ALLTOALLW      = -1020;
 constexpr int COLL_TAG_ALLTOALL       = -1112;
 constexpr int COLL_TAG_GATHERV        = -2223;
 constexpr int COLL_TAG_BCAST          = -3334;
 constexpr int COLL_TAG_ALLREDUCE      = -4445;
+
 // SMPI_RMA_TAG has to be the smallest one, as it will be decremented for accumulate ordering.
 constexpr int SMPI_RMA_TAG            = -6666;
 
 #define MPI_REQUEST_IGNORED ((MPI_Request*)-100)
 
+/* Bindings for MPI special values */
+extern XBT_PUBLIC int mpi_in_place_;
+extern XBT_PUBLIC int mpi_bottom_;
+extern XBT_PUBLIC int mpi_status_ignore_;
+extern XBT_PUBLIC int mpi_statuses_ignore_; 
 /* 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))
+#define FORT_ADDR(addr, val, val2)                                         \
+  (((void *)(addr) == (void*) &(val2))                  \
+   ? (val) : (void *)(addr))
+#define FORT_BOTTOM(addr) FORT_ADDR((addr), MPI_BOTTOM, mpi_bottom_)
+#define FORT_IN_PLACE(addr) FORT_ADDR((addr), MPI_IN_PLACE, mpi_in_place_)
+#define FORT_STATUS_IGNORE(addr) static_cast<MPI_Status*>(FORT_ADDR((addr), MPI_STATUS_IGNORE, mpi_status_ignore_))
+#define FORT_STATUSES_IGNORE(addr)                                                                                     \
+  static_cast<MPI_Status*>(FORT_ADDR((addr), MPI_STATUSES_IGNORE, mpi_statuses_ignore_))
 
 extern XBT_PRIVATE MPI_Comm MPI_COMM_UNINITIALIZED;
 
@@ -64,12 +75,12 @@ typedef SMPI_Dist_Graph_topology* MPIR_Dist_Graph_Topology;
 
 XBT_PRIVATE simgrid::smpi::ActorExt* smpi_process();
 XBT_PRIVATE simgrid::smpi::ActorExt* smpi_process_remote(simgrid::s4u::ActorPtr actor);
-XBT_PRIVATE int smpi_process_count();
+XBT_PRIVATE int smpi_get_universe_size();
+
+XBT_PRIVATE void smpi_deployment_register_process(const std::string& instance_id, int rank, simgrid::s4u::Actor* actor);
+XBT_PRIVATE void smpi_deployment_unregister_process(const std::string& instance_id);
 
-XBT_PRIVATE void smpi_deployment_register_process(const std::string& instance_id, int rank,
-                                                  simgrid::s4u::ActorPtr actor);
 XBT_PRIVATE MPI_Comm* smpi_deployment_comm_world(const std::string& instance_id);
-XBT_PRIVATE simgrid::s4u::Barrier* smpi_deployment_finalization_barrier(const std::string& instance_id);
 XBT_PRIVATE void smpi_deployment_cleanup_instances();
 
 XBT_PRIVATE void smpi_comm_copy_buffer_callback(simgrid::kernel::activity::CommImpl* comm, void* buff,
@@ -79,8 +90,6 @@ XBT_PRIVATE void smpi_comm_null_copy_buffer_callback(simgrid::kernel::activity::
                                                      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();
 
@@ -94,8 +103,6 @@ enum class SharedMallocType { NONE, LOCAL, GLOBAL };
 extern XBT_PRIVATE SharedMallocType smpi_cfg_shared_malloc; // Whether to activate shared malloc
 
 XBT_PRIVATE void smpi_switch_data_segment(simgrid::s4u::ActorPtr actor);
-XBT_PRIVATE void smpi_really_switch_data_segment(simgrid::s4u::ActorPtr actor);
-XBT_PRIVATE int smpi_is_privatization_file(char* file);
 
 XBT_PRIVATE void smpi_prepare_global_memory_segment();
 XBT_PRIVATE void smpi_backup_global_memory_segment();
@@ -104,10 +111,11 @@ 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 double smpi_adjust_comp_speed();
 
-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);
+XBT_PRIVATE unsigned char* smpi_get_tmp_sendbuffer(size_t size);
+XBT_PRIVATE unsigned char* smpi_get_tmp_recvbuffer(size_t size);
+XBT_PRIVATE void smpi_free_tmp_buffer(const unsigned char* buf);
 XBT_PRIVATE void smpi_free_replay_tmp_buffers();
 
 extern "C" {
@@ -148,6 +156,8 @@ void mpi_bcast_(void* buf, int* count, int* datatype, int* root, int* comm, int*
 void mpi_reduce_(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* root, int* comm, int* ierr);
 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_reduce_scatter_block_(void* sendbuf, void* recvbuf, int* recvcount, 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,
@@ -160,13 +170,44 @@ void mpi_allgather_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf,
                     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_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_ibarrier_(int* comm, int* request, int* ierr);
+void mpi_ibcast_(void* buf, int* count, int* datatype, int* root, int* comm, int* request, int* ierr);
+void mpi_ireduce_(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* root, int* comm, int* request, int* ierr);
+void mpi_iallreduce_(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* comm, int* request, int* ierr);
+void mpi_ireduce_scatter_(void* sendbuf, void* recvbuf, int* recvcounts, int* datatype, int* op, int* comm, int* request, int* ierr);
+void mpi_ireduce_scatter_block_(void* sendbuf, void* recvbuf, int* recvcount, int* datatype, int* op, int* comm, int* request ,
+                               int* ierr);
+void mpi_iscatter_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype, int* root,
+                  int* comm, int* request, int* ierr);
+void mpi_iscatterv_(void* sendbuf, int* sendcounts, int* displs, int* sendtype, void* recvbuf, int* recvcount,
+                   int* recvtype, int* root, int* comm, int* request, int* ierr);
+void mpi_igather_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype, int* root,
+                 int* comm, int* request, int* ierr);
+void mpi_igatherv_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcounts, int* displs,
+                  int* recvtype, int* root, int* comm, int* request, int* ierr);
+void mpi_iallgather_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype,
+                    int* comm, int* request, int* ierr);
+void mpi_iallgatherv_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* displs,
+                     int* recvtype, int* comm, int* request, int* ierr);
+void mpi_iscan_(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* comm, int* request, int* ierr);
+void mpi_ialltoall_(void* sendbuf, int* sendcount, int* sendtype, void* recvbuf, int* recvcount, int* recvtype,
+                   int* comm, int* request, int* ierr);
+void mpi_ialltoallv_(void* sendbuf, int* sendcounts, int* senddisps, int* sendtype, void* recvbuf, int* recvcounts,
+                    int* recvdisps, int* recvtype, int* comm, int* request, int* ierr);
+void mpi_ialltoallw_(void* sendbuf, int* sendcnts, int* sdispls, int* sendtypes, void* recvbuf, int* recvcnts,
+                    int* rdispls, int* recvtypes, int* comm, int* request, int* ierr);
+void mpi_iexscan_(void* sendbuf, void* recvbuf, int* count, int* datatype, int* op, int* comm, int* request, int* ierr);
+
+void mpi_type_size_(int* datatype, int* size, 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);
@@ -196,8 +237,8 @@ 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, int* attribute_val, int* flag, int* ierr);
-void mpi_win_set_attr_(int* win, int* type_keyval, int* att, int* ierr);
+void mpi_win_get_attr_(int* win, int* type_keyval, MPI_Aint* attribute_val, int* flag, int* ierr);
+void mpi_win_set_attr_(int* win, int* type_keyval, MPI_Aint* 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);
@@ -209,6 +250,8 @@ 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_win_dup_fn_( int* win, int* keyval, int* extrastate, MPI_Aint* valin, MPI_Aint* valout, int* flag, int* ierr );
+void mpi_win_null_copy_fn_( int* win, int* keyval, int* extrastate, MPI_Aint* valin, MPI_Aint* valout, int* flag, 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);
@@ -284,8 +327,6 @@ void mpi_sendrecv_replace_(void* buf, int* count, int* datatype, int* dst, int*
 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);
@@ -303,12 +344,12 @@ 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_errhandler_create_(void* function, int* errhandler, int* ierr);
+void mpi_errhandler_free_(int* errhandler, int* ierr);
+void mpi_errhandler_get_(int* comm, int* errhandler, int* ierr);
+void mpi_errhandler_set_(int* comm, int* errhandler, int* ierr);
+void mpi_comm_set_errhandler_(int* comm, int* errhandler, int* ierr);
+void mpi_comm_get_errhandler_(int* comm, int* 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);
@@ -321,14 +362,14 @@ void mpi_pack_external_(char* datarep, void* inbuf, int* incount, int* datatype,
                         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_hindexed_(int* count, int* blocklens, int* 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_struct_(int* count, int* blocklens, int* 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);
@@ -363,16 +404,13 @@ void mpi_type_create_resized_(int* oldtype, MPI_Aint* lb, MPI_Aint* extent, int*
 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_set_name_(int* comm, char* name, int* ierr);
 void mpi_comm_dup_with_info_(int* comm, int* info, int* newcomm, int* ierr);
 void mpi_comm_split_type_(int* comm, int* split_type, int* key, int* info, int* newcomm, int* ierr);
 void mpi_comm_set_info_(int* comm, int* info, int* ierr);
 void mpi_comm_get_info_(int* comm, int* info, int* ierr);
 void mpi_info_get_(int* info, char* key, int* valuelen, char* value, int* flag, int* ierr, unsigned int keylen);
-void mpi_comm_create_errhandler_(void* function, void* errhandler, int* ierr);
+void mpi_comm_create_errhandler_(void* function, int* 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);
@@ -419,7 +457,6 @@ struct s_smpi_privatization_region_t {
 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();
 
 /**
@@ -447,4 +484,6 @@ enum class SmpiPrivStrategies { NONE = 0, MMAP = 1, DLOPEN = 2, DEFAULT = DLOPEN
 
 extern XBT_PRIVATE SmpiPrivStrategies smpi_privatize_global_variables;
 
+XBT_PRIVATE void private_execute_flops(double flops);
+
 #endif
index 264507b..de11f68 100644 (file)
@@ -27,24 +27,31 @@ class ActorExt {
   int sampling_ = 0; /* inside an SMPI_SAMPLE_ block? */
   std::string instance_id_;
   bool replaying_ = false; /* is the process replaying a trace */
-  s4u::Barrier* finalization_barrier_;
   smpi_trace_call_location_t trace_call_loc_;
-  s4u::ActorPtr actor_                           = nullptr;
+  s4u::Actor* actor_                             = nullptr;
   smpi_privatization_region_t privatized_region_ = nullptr;
-  int optind                                     = 0; /*for getopt replacement */
+#ifdef __linux__
+  int optind_                                     = 0; /*for getopt replacement */
+#else
+  int optind_                                     = 1; /*for getopt replacement */
+#endif
   std::string tracing_category_                  = "";
-
+  MPI_Info info_env_;
+  void* bsend_buffer_ = nullptr; 
+  int bsend_buffer_size_ = 0; 
+  
 #if HAVE_PAPI
   /** Contains hardware data as read by PAPI **/
   int papi_event_set_;
   papi_counter_t papi_counter_data_;
 #endif
 public:
-  explicit ActorExt(s4u::ActorPtr actor, s4u::Barrier* barrier);
+  static simgrid::xbt::Extension<simgrid::s4u::Actor, ActorExt> EXTENSION_ID;
+
+  explicit ActorExt(s4u::Actor* actor);
   ActorExt(const ActorExt&) = delete;
   ActorExt& operator=(const ActorExt&) = delete;
   ~ActorExt();
-  void set_data(const char* instance_id);
   void finalize();
   int finalized();
   int initializing();
@@ -77,6 +84,9 @@ public:
   s4u::ActorPtr get_actor();
   int get_optind();
   void set_optind(int optind);
+  MPI_Info info_env();
+  void bsend_buffer(void** buf, int* size);
+  void set_bsend_buffer(void* buf, int size);
 };
 
 } // namespace smpi
index e4c5df3..537510b 100644 (file)
 /** @brief MPI collective description */
 
 #define COLL_DEFS(cat, ret, args, args2)                                                                               \
-  static void set_##cat(const std::string& name);                                                                      \
-  static s_mpi_coll_description_t mpi_coll_##cat##_description[];                                                      \
+  static void _XBT_CONCAT(set_, cat)(const std::string& name);                                                         \
+  static s_mpi_coll_description_t _XBT_CONCAT3(mpi_coll_, cat, _description)[];                                        \
   static int(*cat) args;
 
 #define COLL_SIG(cat, ret, args, args2)\
     static int cat args;
 
+#define COLL_DESCRIPTION(cat, ret, args, name)                                                                         \
+  {                                                                                                                    \
+    _XBT_STRINGIFY(name)                                                                                               \
+    , _XBT_STRINGIFY(cat) " " _XBT_STRINGIFY(name) " collective", (void*)_XBT_CONCAT4(Coll_, cat, _, name)::cat        \
+  }
 
-#define COLL_DESCRIPTION(cat, ret, args, name) \
-  {# name,\
-   # cat " " # name " collective",\
-   (void*) Coll_ ## cat ## _ ## name::cat }
-
-#define COLL_PROTO(cat, ret, args, name) \
-class Coll_ ## cat ## _ ## name : public Coll { \
-public: \
-static ret cat  (COLL_UNPAREN args); \
-};
+#define COLL_PROTO(cat, ret, args, name)                                                                               \
+  class _XBT_CONCAT4(Coll_, cat, _, name) : public Coll {                                                              \
+  public:                                                                                                              \
+    static ret cat(COLL_UNPAREN args);                                                                                 \
+  };
 
 #define COLL_UNPAREN(...)  __VA_ARGS__
 
@@ -41,39 +41,39 @@ static ret cat  (COLL_UNPAREN args); \
 #define COLL_NOTHING(...)
 
 #define COLL_GATHER_SIG gather, int, \
-                      (void *send_buff, int send_count, MPI_Datatype send_type, \
+                      (const void *send_buff, int send_count, MPI_Datatype send_type, \
                        void *recv_buff, int recv_count, MPI_Datatype recv_type, \
                            int root, MPI_Comm comm)
 #define COLL_ALLGATHER_SIG allgather, int, \
-                      (void *send_buff, int send_count, MPI_Datatype send_type, \
+                      (const void *send_buff, int send_count, MPI_Datatype send_type, \
                        void *recv_buff, int recv_count, MPI_Datatype recv_type, \
                            MPI_Comm comm)
 #define COLL_ALLGATHERV_SIG allgatherv, int, \
-                      (void *send_buff, int send_count, MPI_Datatype send_type, \
-                       void *recv_buff, int *recv_count, int *recv_disps, \
+                      (const void *send_buff, int send_count, MPI_Datatype send_type, \
+                       void *recv_buff, const int *recv_count, const int *recv_disps, \
                MPI_Datatype recv_type, MPI_Comm comm)
 #define COLL_ALLTOALL_SIG alltoall, int, \
-                     (void *send_buff, int send_count, MPI_Datatype send_type, \
+                     (const void *send_buff, int send_count, MPI_Datatype send_type, \
                       void *recv_buff, int recv_count, MPI_Datatype recv_type, \
                           MPI_Comm comm)
 #define COLL_ALLTOALLV_SIG alltoallv, int, \
-                     (void *send_buff, int *send_counts, int *send_disps, MPI_Datatype send_type, \
-                      void *recv_buff, int *recv_counts, int *recv_disps, MPI_Datatype recv_type, \
+                     (const void *send_buff, const int *send_counts, const int *send_disps, MPI_Datatype send_type, \
+                      void *recv_buff, const int *recv_counts, const int *recv_disps, MPI_Datatype recv_type, \
                           MPI_Comm comm)
 #define COLL_BCAST_SIG bcast, int, \
                   (void *buf, int count, MPI_Datatype datatype, \
                    int root, MPI_Comm comm)
 #define COLL_REDUCE_SIG reduce, int, \
-                   (void *buf, void *rbuf, int count, MPI_Datatype datatype, \
+                   (const void *buf, void *rbuf, int count, MPI_Datatype datatype, \
                         MPI_Op op, int root, MPI_Comm comm)
 #define COLL_ALLREDUCE_SIG allreduce, int, \
-                      (void *sbuf, void *rbuf, int rcount, \
+                      (const void *sbuf, void *rbuf, int rcount, \
                            MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
 #define COLL_REDUCE_SCATTER_SIG reduce_scatter, int, \
-                      (void *sbuf, void *rbuf, int *rcounts,\
+                      (const void *sbuf, void *rbuf, const int *rcounts,\
                     MPI_Datatype dtype,MPI_Op  op,MPI_Comm  comm)
 #define COLL_SCATTER_SIG scatter, int, \
-                (void *sendbuf, int sendcount, MPI_Datatype sendtype,\
+                (const void *sendbuf, int sendcount, MPI_Datatype sendtype,\
                 void *recvbuf, int recvcount, MPI_Datatype recvtype,\
                 int root, MPI_Comm comm)
 #define COLL_BARRIER_SIG barrier, int, \
@@ -96,65 +96,65 @@ public:
   static void set_collectives();
 
   // for each collective type, create the set_* prototype, the description array and the function pointer
-  COLL_APPLY(COLL_DEFS, COLL_GATHER_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_ALLGATHER_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_ALLGATHERV_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_REDUCE_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_ALLREDUCE_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_REDUCE_SCATTER_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_SCATTER_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_BARRIER_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_BCAST_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_ALLTOALL_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_ALLTOALLV_SIG, "");
+  COLL_APPLY(COLL_DEFS, COLL_GATHER_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_ALLGATHER_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_ALLGATHERV_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_REDUCE_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_ALLREDUCE_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_REDUCE_SCATTER_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_SCATTER_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_BARRIER_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_BCAST_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_ALLTOALL_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_ALLTOALLV_SIG, "")
 
   // These fairly unused collectives only have one implementation in SMPI
-  static int gatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int* recvcounts, int* displs,
+  static int gatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, const int* displs,
                      MPI_Datatype recvtype, int root, MPI_Comm comm);
-  static int scatterv(void* sendbuf, int* sendcounts, int* displs, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+  static int scatterv(const void* sendbuf, const int* sendcounts, const int* displs, MPI_Datatype sendtype, void* recvbuf, int recvcount,
                       MPI_Datatype recvtype, int root, MPI_Comm comm);
-  static int scan(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
-  static int exscan(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
+  static int scan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
+  static int exscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
   static int alltoallw
-         (void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype* sendtypes, void* recvbuf, int* recvcounts,
-          int* recvdisps, MPI_Datatype* recvtypes, MPI_Comm comm);
+         (const void* sendbuf, const int* sendcounts, const int* senddisps, const MPI_Datatype* sendtypes, void* recvbuf, const int* recvcounts,
+          const int* recvdisps, const MPI_Datatype* recvtypes, MPI_Comm comm);
 
   //async collectives
-  static int ibarrier(MPI_Comm comm, MPI_Request* request);
+  static int ibarrier(MPI_Comm comm, MPI_Request* request, int external=1);
   static int ibcast(void *buf, int count, MPI_Datatype datatype, 
-                   int root, MPI_Comm comm, MPI_Request* request);
-  static int igather (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
-                                      MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request);
-  static int igatherv (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
-                                       int* recvcounts, int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request);
-  static int iallgather (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
-                                         int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request);
-  static int iallgatherv (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
-                                          int* recvcounts, int* displs, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request);
-  static int iscatter (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
-                                       int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request);
-  static int iscatterv (void* sendbuf, int* sendcounts, int* displs, MPI_Datatype sendtype,
-                                        void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request);
+                   int root, MPI_Comm comm, MPI_Request* request, int external=1);
+  static int igather (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+                                      MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request, int external=1);
+  static int igatherv (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+                                       const int* recvcounts, const int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request, int external=1);
+  static int iallgather (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+                                         int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request, int external=1);
+  static int iallgatherv (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+                                          const int* recvcounts, const int* displs, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request, int external=1);
+  static int iscatter (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+                                       int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request, int external=1);
+  static int iscatterv (const void* sendbuf, const int* sendcounts, const int* displs, MPI_Datatype sendtype,
+                                        void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request, int external=1);
   static int ireduce
-         (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request *request);
+         (const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request *request, int external=1);
   static int iallreduce
-         (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request);
+         (const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request, int external=1);
   static int iscan
-         (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request);
+         (const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request, int external=1);
   static int iexscan
-         (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request);
+         (const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request, int external=1);
   static int ireduce_scatter
-         (void* sendbuf, void* recvbuf, int* recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request);
+         (const void* sendbuf, void* recvbuf, const int* recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request, int external=1);
   static int ireduce_scatter_block
-         (void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request);
-  static int ialltoall (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
-                                        int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request);
+         (const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request, int external=1);
+  static int ialltoall (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+                                        int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request, int external=1);
   static int ialltoallv
-         (void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype sendtype, void* recvbuf, int* recvcounts,
-          int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request);
+         (const void* sendbuf, const int* sendcounts, const int* senddisps, MPI_Datatype sendtype, void* recvbuf, const int* recvcounts,
+          const int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request, int external=1);
   static int ialltoallw
-         (void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype* sendtypes, void* recvbuf, int* recvcounts,
-          int* recvdisps, MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request *request);
+         (const void* sendbuf, const int* sendcounts, const int* senddisps, const MPI_Datatype* sendtypes, void* recvbuf, const int* recvcounts,
+          const int* recvdisps, const MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request *request, int external=1);
 
 
   static void (*smpi_coll_cleanup_callback)();
@@ -163,17 +163,17 @@ public:
 class Coll {
 public:
   // for each collective type, create a function member
-  COLL_APPLY(COLL_SIG, COLL_GATHER_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_ALLGATHER_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_ALLGATHERV_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_REDUCE_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_ALLREDUCE_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_REDUCE_SCATTER_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_SCATTER_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_BARRIER_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_BCAST_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_ALLTOALL_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_ALLTOALLV_SIG, "");
+  COLL_APPLY(COLL_SIG, COLL_GATHER_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_ALLGATHER_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_ALLGATHERV_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_REDUCE_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_ALLREDUCE_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_REDUCE_SCATTER_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_SCATTER_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_BARRIER_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_BCAST_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_ALLTOALL_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_ALLTOALLV_SIG, "")
 };
 
 /*************
index e43c5b3..828b752 100644 (file)
@@ -7,6 +7,8 @@
 #define SMPI_COMM_HPP_INCLUDED
 
 #include <list>
+#include <string>
+#include "smpi_errhandler.hpp"
 #include "smpi_keyvals.hpp"
 #include "smpi_group.hpp"
 #include "smpi_topo.hpp"
@@ -28,25 +30,37 @@ class Comm : public F2C, public Keyval{
   int is_blocked_;              // are ranks allocated on the same smp node contiguous ?
   int is_smp_comm_;             // set to 0 in case this is already an intra-comm or a leader-comm to avoid recursivity
   std::list<MPI_Win> rma_wins_; // attached windows for synchronization.
+  std::string name_;
+  MPI_Info info_;
+  int id_;
+  MPI_Errhandler errhandler_;
 
 public:
   static std::unordered_map<int, smpi_key_elem> keyvals_;
   static int keyval_id_;
 
   Comm() = default;
-  Comm(MPI_Group group, MPI_Topology topo, int smp = 0);
+  Comm(MPI_Group group, MPI_Topology topo, int smp = 0, int id=MPI_UNDEFINED);
   int dup(MPI_Comm* newcomm);
+  int dup_with_info(MPI_Info info, MPI_Comm* newcomm);
   MPI_Group group();
   MPI_Topology topo() { return topo_; }
   int size();
   int rank();
+  int id();
   void get_name(char* name, int* len);
+  void set_name(const char* name);
+  MPI_Info info();
+  void set_info( MPI_Info info);
+  MPI_Errhandler errhandler();
+  void set_errhandler( MPI_Errhandler errhandler);
   void set_leaders_comm(MPI_Comm leaders);
   void set_intra_comm(MPI_Comm leaders) { intra_comm_ = leaders; };
   int* get_non_uniform_map();
   int* get_leaders_map();
   MPI_Comm get_leaders_comm();
   MPI_Comm get_intra_comm();
+  MPI_Comm find_intra_comm(int* leader);
   int is_uniform();
   int is_blocked();
   int is_smp_comm();
@@ -57,7 +71,6 @@ public:
   static void destroy(MPI_Comm comm);
   void init_smp();
 
-  int add_f() override;
   static void free_f(int id);
   static Comm* f2c(int);
 
index 3b00c7e..01206ea 100644 (file)
@@ -121,27 +121,27 @@ public:
   int extent(MPI_Aint* lb, MPI_Aint* extent);
   MPI_Aint get_extent() { return ub_ - lb_; };
   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,
+  void set_name(const char* name);
+  static int copy(const 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);
+  virtual void serialize(const void* noncontiguous, void* contiguous, int count);
+  virtual void unserialize(const 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);
+  int pack(const void* inbuf, int incount, void* outbuf, int outcount, int* position, MPI_Comm comm);
+  int unpack(const 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,
+  static int create_indexed(int count, const int* blocklens, const int* indices, MPI_Datatype old_type, MPI_Datatype* new_type);
+  static int create_hindexed(int count, const int* blocklens, const 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,
+  static int create_struct(int count, const int* blocklens, const MPI_Aint* indices, const MPI_Datatype* old_types,
                            MPI_Datatype* new_type);
-  static int create_subarray(int ndims, int* array_of_sizes,
-                             int* array_of_subsizes, int* array_of_starts,
+  static int create_subarray(int ndims, const int* array_of_sizes,
+                             const int* array_of_subsizes, const int* array_of_starts,
                              int order, MPI_Datatype oldtype, MPI_Datatype *newtype);
   static int create_resized(MPI_Datatype oldtype,MPI_Aint lb, MPI_Aint extent,
                              MPI_Datatype *newtype);
index e986197..890b4eb 100644 (file)
@@ -21,8 +21,8 @@ public:
   Type_Contiguous(const Type_Contiguous&) = delete;
   Type_Contiguous& operator=(const Type_Contiguous&) = delete;
   ~Type_Contiguous();
-  void serialize(void* noncontiguous, void* contiguous, int count);
-  void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
+  void serialize(const void* noncontiguous, void* contiguous, int count);
+  void unserialize(const void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
 };
 
 class Type_Hvector: public Datatype{
@@ -37,8 +37,8 @@ public:
   Type_Hvector(const Type_Hvector&) = delete;
   Type_Hvector& operator=(const Type_Hvector&) = delete;
   ~Type_Hvector();
-  void serialize(void* noncontiguous, void* contiguous, int count);
-  void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
+  void serialize(const void* noncontiguous, void* contiguous, int count);
+  void unserialize(const void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
 };
 
 class Type_Vector : public Type_Hvector {
@@ -54,20 +54,20 @@ class Type_Hindexed: public Datatype{
   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,
+  Type_Hindexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, const int* block_lengths,
+                const MPI_Aint* block_indices, MPI_Datatype old_type);
+  Type_Hindexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, const int* block_lengths, const int* block_indices,
                 MPI_Datatype old_type, MPI_Aint factor);
   Type_Hindexed(const Type_Hindexed&) = delete;
   Type_Hindexed& operator=(const Type_Hindexed&) = delete;
   ~Type_Hindexed();
-  void serialize(void* noncontiguous, void* contiguous, int count);
-  void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
+  void serialize(const void* noncontiguous, void* contiguous, int count);
+  void unserialize(const 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,
+  Type_Indexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, const int* block_lengths, const int* block_indices,
                MPI_Datatype old_type);
 };
 
@@ -78,13 +78,13 @@ class Type_Struct: public Datatype{
   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(int size, MPI_Aint lb, MPI_Aint ub, int flags, int block_count, const int* block_lengths,
+              const MPI_Aint* block_indices, const MPI_Datatype* old_types);
   Type_Struct(const Type_Struct&) = delete;
   Type_Struct& operator=(const Type_Struct&) = delete;
   ~Type_Struct();
-  void serialize(void* noncontiguous, void* contiguous, int count);
-  void unserialize(void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
+  void serialize(const void* noncontiguous, void* contiguous, int count);
+  void unserialize(const void* contiguous_vector, void* noncontiguous_vector, int count, MPI_Op op);
 };
 
 } // namespace smpi
diff --git a/src/smpi/include/smpi_errhandler.hpp b/src/smpi/include/smpi_errhandler.hpp
new file mode 100644 (file)
index 0000000..61750ed
--- /dev/null
@@ -0,0 +1,39 @@
+/* Copyright (c) 2010-2019. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program 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_ERRHANDLER_HPP_INCLUDED
+#define SMPI_ERRHANDLER_HPP_INCLUDED
+#include "smpi_f2c.hpp"
+#include <smpi/smpi.h>
+
+
+namespace simgrid{
+namespace smpi{
+
+class Errhandler: public F2C {
+  private:
+    int refcount_ = 1;
+    MPI_Comm_errhandler_fn* comm_func_=nullptr;
+    MPI_File_errhandler_fn* file_func_=nullptr;
+    MPI_Win_errhandler_fn* win_func_=nullptr;
+  public:
+  Errhandler() = default;
+  explicit Errhandler(MPI_Comm_errhandler_fn *function):comm_func_(function){};
+  explicit Errhandler(MPI_File_errhandler_fn *function):file_func_(function){};
+  explicit Errhandler(MPI_Win_errhandler_fn *function):win_func_(function){};
+  void ref();
+  void call(MPI_Comm comm, int errorcode);
+  void call(MPI_Win win, int errorcode);
+  void call(MPI_File file, int errorcode);
+  static void unref(Errhandler* errhandler);
+  static Errhandler* f2c(int id);
+
+};
+  
+}
+}
+
+#endif
\ No newline at end of file
index f28c8fb..455973c 100644 (file)
@@ -10,6 +10,7 @@
 #define SMPI_F2C_HPP_INCLUDED
 
 #include <unordered_map>
+#include <string>
 
 #define KEY_SIZE (sizeof(int) * 2 + 1)
 
@@ -22,24 +23,27 @@ class F2C {
     // Beware of collisions if id in mpif.h is not unique
     static std::unordered_map<std::string, F2C*>* f2c_lookup_;
     static int f2c_id_;
+    int my_f2c_id_;
+
   protected:
     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:
+    char* get_my_key(char* key);
     static char* get_key(char* key, int id);
-    static char* get_key_id(char* key, int id);
     static void delete_lookup();
     static std::unordered_map<std::string, F2C*>* lookup();
-
+    F2C() : my_f2c_id_(-1){}
     virtual ~F2C() = default;
 
     //Override these to handle specific values.
     virtual int add_f();
     static void free_f(int id);
     virtual int c2f();
-
+    static void print_f2c_lookup();
     // 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);
diff --git a/src/smpi/include/smpi_file.hpp b/src/smpi/include/smpi_file.hpp
new file mode 100644 (file)
index 0000000..3feb57f
--- /dev/null
@@ -0,0 +1,196 @@
+/* Copyright (c) 2010-2019. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program 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_FILE_HPP_INCLUDED
+#define SMPI_FILE_HPP_INCLUDED
+#include "simgrid/plugins/file_system.h"
+#include "smpi_comm.hpp"
+#include "smpi_coll.hpp"
+#include "smpi_datatype.hpp"
+#include "smpi_errhandler.hpp"
+#include "smpi_info.hpp"
+#include  <algorithm>
+
+XBT_LOG_EXTERNAL_CATEGORY(smpi_pmpi);
+
+namespace simgrid{
+namespace smpi{
+class File{
+  MPI_Comm comm_;
+  int flags_;
+  simgrid::s4u::File* file_;
+  MPI_Info info_;
+  MPI_Offset* shared_file_pointer_;
+  s4u::MutexPtr shared_mutex_;
+  MPI_Win win_;
+  char* list_;
+  MPI_Errhandler errhandler_;
+
+  public:
+  File(MPI_Comm comm, const char *filename, int amode, MPI_Info info);
+  File(const File&) = delete;
+  File& operator=(const File&) = delete;
+  ~File();
+  int size();
+  int get_position(MPI_Offset* offset);
+  int get_position_shared(MPI_Offset* offset);
+  int flags();
+  MPI_Comm comm();
+  int sync();
+  int seek(MPI_Offset offset, int whence);
+  int seek_shared(MPI_Offset offset, int whence);
+  MPI_Info info();
+  void set_info( MPI_Info info);
+  static int read(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
+  static int read_shared(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
+  static int read_ordered(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
+  static int write(MPI_File fh, void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
+  static int write_shared(MPI_File fh, const void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
+  static int write_ordered(MPI_File fh, const void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
+  template <int (*T)(MPI_File, void *, int, MPI_Datatype, MPI_Status *)> int op_all(void *buf, int count,MPI_Datatype datatype, MPI_Status *status);
+  static int close(MPI_File *fh);
+  static int del(const char *filename, MPI_Info info);
+  MPI_Errhandler errhandler();
+  void set_errhandler( MPI_Errhandler errhandler);
+};
+
+  /* Read_all, Write_all : loosely based on */
+  /* @article{Thakur:1996:ETM:245875.245879,*/
+  /* author = {Thakur, Rajeev and Choudhary, Alok},*/
+  /* title = {An Extended Two-phase Method for Accessing Sections of Out-of-core Arrays},*/
+  /* journal = {Sci. Program.},*/
+  /* issue_date = {Winter 1996},*/
+  /* pages = {301--317},*/
+  /* }*/ 
+  template <int (*T)(MPI_File, void *, int, MPI_Datatype, MPI_Status *)>
+  int File::op_all(void *buf, int count, MPI_Datatype datatype, MPI_Status *status){
+    //get min and max offsets from everyone.
+    int size =  comm_->size();
+    int rank = comm_-> rank();
+    MPI_Offset min_offset = file_->tell();
+    MPI_Offset max_offset = (min_offset + count * datatype->size());//cheating, as we don't care about exact data location, we can skip extent
+    MPI_Offset* min_offsets = new MPI_Offset[size];
+    MPI_Offset* max_offsets = new MPI_Offset[size];
+    simgrid::smpi::Colls::allgather(&min_offset, 1, MPI_OFFSET, min_offsets, 1, MPI_OFFSET, comm_);
+    simgrid::smpi::Colls::allgather(&max_offset, 1, MPI_OFFSET, max_offsets, 1, MPI_OFFSET, comm_);
+    MPI_Offset min=min_offset;
+    MPI_Offset max=max_offset;
+    MPI_Offset tot= 0;
+    int empty=1;
+    for(int i=0;i<size;i++){
+      if(min_offsets[i]!=max_offsets[i])
+        empty=0;
+      tot+=(max_offsets[i]-min_offsets[i]);
+      if(min_offsets[i]<min)
+        min=min_offsets[i];
+      if(max_offsets[i]>max)
+        max=max_offsets[i];
+    }
+    
+    XBT_CDEBUG(smpi_pmpi, "my offsets to read : %lld:%lld, global min and max %lld:%lld", min_offset, max_offset, min, max);
+    if(empty==1){
+      delete[] min_offsets;
+      delete[] max_offsets;
+      status->count=0;
+      return MPI_SUCCESS;
+    }
+    MPI_Offset total = max-min;
+    if(total==tot && (datatype->flags() & DT_FLAG_CONTIGUOUS)){
+      delete[] min_offsets;
+      delete[] max_offsets;
+      //contiguous. Just have each proc perform its read
+      status->count=count * datatype->size();
+      return T(this,buf,count,datatype, status);
+    }
+
+    //Interleaved case : How much do I need to read, and whom to send it ?
+    MPI_Offset my_chunk_start=(max-min+1)/size*rank;
+    MPI_Offset my_chunk_end=((max-min+1)/size*(rank+1));
+    XBT_CDEBUG(smpi_pmpi, "my chunks to read : %lld:%lld", my_chunk_start, my_chunk_end);
+    int* send_sizes = new int[size];
+    int* recv_sizes = new int[size];
+    int* send_disps = new int[size];
+    int* recv_disps = new int[size];
+    int total_sent=0;
+    for(int i=0;i<size;i++){
+      send_sizes[i]=0;
+      send_disps[i]=0;//cheat to avoid issues when send>recv as we use recv buffer
+      if((my_chunk_start>=min_offsets[i] && my_chunk_start < max_offsets[i])||
+          ((my_chunk_end<=max_offsets[i]) && my_chunk_end> min_offsets[i])){
+        send_sizes[i]=(std::min(max_offsets[i]-1, my_chunk_end-1)-std::max(min_offsets[i], my_chunk_start));
+        //store min and max offest to actually read
+        min_offset=std::min(min_offset, min_offsets[i]);
+        total_sent+=send_sizes[i];
+        XBT_CDEBUG(smpi_pmpi, "will have to send %d bytes to %d", send_sizes[i], i);
+      }
+    }
+    min_offset=std::max(min_offset, my_chunk_start);
+
+    //merge the ranges of every process
+    std::vector<std::pair<MPI_Offset, MPI_Offset>> ranges;
+    for(int i=0; i<size; ++i)
+      ranges.push_back(std::make_pair(min_offsets[i],max_offsets[i]));
+    std::sort(ranges.begin(), ranges.end());
+    std::vector<std::pair<MPI_Offset, MPI_Offset>> chunks;
+    chunks.push_back(ranges[0]);
+
+    unsigned int nchunks=0;
+    unsigned int i=1;
+    while(i < ranges.size()){
+      if(ranges[i].second>chunks[nchunks].second){
+        // else range included - ignore
+        if(ranges[i].first>chunks[nchunks].second){
+          //new disjoint range
+          chunks.push_back(ranges[i]);
+          nchunks++;
+        } else {
+          //merge ranges
+          chunks[nchunks].second=ranges[i].second;
+        }
+      }
+      i++;
+    }
+    //what do I need to read ?
+    MPI_Offset totreads=0;
+    for(i=0; i<chunks.size();i++){
+      if(chunks[i].second < my_chunk_start)
+        continue;
+      else if (chunks[i].first > my_chunk_end)
+        continue;
+      else
+        totreads += (std::min(chunks[i].second, my_chunk_end-1)-std::max(chunks[i].first, my_chunk_start));
+    }
+    XBT_CDEBUG(smpi_pmpi, "will have to access %lld from my chunk", totreads);
+
+    unsigned char* sendbuf = smpi_get_tmp_sendbuffer(total_sent);
+
+    if(totreads>0){
+      seek(min_offset, MPI_SEEK_SET);
+      T(this,sendbuf,totreads/datatype->size(),datatype, status);
+    }
+    simgrid::smpi::Colls::alltoall(send_sizes, 1, MPI_INT, recv_sizes, 1, MPI_INT, comm_);
+    int total_recv=0;
+    for(int i=0;i<size;i++){
+      recv_disps[i]=total_recv;
+      total_recv+=recv_sizes[i];
+    }
+    //Set buf value to avoid copying dumb data
+    simgrid::smpi::Colls::alltoallv(sendbuf, send_sizes, send_disps, MPI_BYTE,
+                              buf, recv_sizes, recv_disps, MPI_BYTE, comm_);
+    status->count=count * datatype->size();
+    smpi_free_tmp_buffer(sendbuf);
+    delete[] send_sizes;
+    delete[] recv_sizes;
+    delete[] send_disps;
+    delete[] recv_disps;
+    delete[] min_offsets;
+    delete[] max_offsets;
+    return MPI_SUCCESS;
+  }
+}
+}
+
+#endif
index cdbf4b8..c0fa3fe 100644 (file)
@@ -20,8 +20,8 @@ class Group : public F2C{
   /* 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<s4u::ActorPtr> rank_to_actor_map_;
-  std::map<s4u::ActorPtr, int> actor_to_rank_map_;
+  std::vector<s4u::Actor*> rank_to_actor_map_;
+  std::map<s4u::Actor*, int> actor_to_rank_map_;
   std::vector<int> index_to_rank_map_;
 
   int refcount_ = 1; /* refcount_: start > 0 so that this group never gets freed */
@@ -30,16 +30,16 @@ public:
   explicit Group(int size) : size_(size), rank_to_actor_map_(size, nullptr), index_to_rank_map_(size, MPI_UNDEFINED) {}
   explicit Group(Group* origin);
 
-  void set_mapping(s4u::ActorPtr actor, int rank);
+  void set_mapping(s4u::Actor* actor, int rank);
   int rank(int index);
-  s4u::ActorPtr actor(int rank);
-  int rank(const s4u::ActorPtr process);
+  s4u::Actor* actor(int rank);
+  int rank(s4u::Actor* process);
   void ref();
   static void unref(MPI_Group group);
   int size() { return size_; }
   int compare(MPI_Group group2);
-  int incl(int n, int* ranks, MPI_Group* newgroup);
-  int excl(int n, int* ranks, MPI_Group* newgroup);
+  int incl(int n, const int* ranks, MPI_Group* newgroup);
+  int excl(int n, const int* ranks, MPI_Group* newgroup);
   int group_union(MPI_Group group2, MPI_Group* newgroup);
   int intersection(MPI_Group group2, MPI_Group* newgroup);
   int difference(MPI_Group group2, MPI_Group* newgroup);
index 01062cc..1fb206a 100644 (file)
@@ -25,12 +25,12 @@ public:
   ~Info() = default;
   void ref();
   static void unref(MPI_Info info);
-  void set(char* key, char* value) { map_[key] = value; }
-  int get(char* key, int valuelen, char* value, int* flag);
-  int remove(char* key);
+  void set(const char* key, const char* value) { map_[key] = value; }
+  int get(const char* key, int valuelen, char* value, int* flag);
+  int remove(const char* key);
   int get_nkeys(int* nkeys);
   int get_nthkey(int n, char* key);
-  int get_valuelen(char* key, int* valuelen, int* flag);
+  int get_valuelen(const char* key, int* valuelen, int* flag);
   static Info* f2c(int id);
 };
 
index dc7dd35..a23be10 100644 (file)
@@ -158,7 +158,7 @@ template <typename T> void Keyval::cleanup_attr(){
           call_deleter<T>((T*)this, elem, it.first,it.second,&flag);
         }
       } else {
-        //already deleted, not a problem;
+        // already deleted, not a problem
         flag=0;
       }
     }
index c0eb212..bae3055 100644 (file)
@@ -17,14 +17,15 @@ class Op : public F2C{
   bool is_commutative_;
   bool is_fortran_op_ = false;
   int refcount_ = 1;
+  bool predefined_;
 
 public:
-  Op(MPI_User_function* function, bool commutative) : func_(function), is_commutative_(commutative) {}
+  Op(MPI_User_function* function, bool commutative, bool predefined=false) : func_(function), is_commutative_(commutative), predefined_(predefined) {}
   bool is_commutative() { return is_commutative_; }
   bool is_fortran_op() { return is_fortran_op_; }
   // tell that we were created from fortran, so we need to translate the type to fortran when called
   void set_fortran_op() { is_fortran_op_ = true; }
-  void apply(void* invec, void* inoutvec, int* len, MPI_Datatype datatype);
+  void apply(const void* invec, void* inoutvec, const int* len, MPI_Datatype datatype);
   static Op* f2c(int id);
   void ref();
   static void unref(MPI_Op* op);
index a4fa0d5..cc64583 100644 (file)
@@ -38,23 +38,23 @@ class Request : public F2C {
   // We can't override src, tag, and size, because the request may be reused later
   int real_src_;
   int real_tag_;
-  int truncated_;
+  bool truncated_;
   size_t real_size_;
   MPI_Comm comm_;
   smx_activity_t action_;
   unsigned flags_;
-  int detached_;
+  bool detached_;
   MPI_Request detached_sender_;
   int refcount_;
   MPI_Op op_;
-  int cancelled_;
+  int cancelled_; // tri-state
   smpi_mpi_generalized_request_funcs generalized_funcs;
   MPI_Request* nbc_requests_;
   int nbc_requests_size_;
 
 public:
   Request() = default;
-  Request(void* buf, int count, MPI_Datatype datatype, int src, int dst, int tag, MPI_Comm comm, unsigned flags, MPI_Op op = MPI_REPLACE);
+  Request(const void* buf, int count, MPI_Datatype datatype, int src, int dst, int tag, MPI_Comm comm, unsigned flags, MPI_Op op = MPI_REPLACE);
   MPI_Comm comm() { return comm_; }
   size_t size() { return size_; }
   size_t real_size() { return real_size_; }
@@ -62,7 +62,7 @@ public:
   int dst() { return dst_; }
   int tag() { return tag_; }
   int flags() { return flags_; }
-  int detached() { return detached_; }
+  bool detached() { return detached_; }
   MPI_Datatype type() { return old_type_; }
   void print_request(const char* message);
   void start();
@@ -74,24 +74,27 @@ public:
   static void finish_wait(MPI_Request* request, MPI_Status* status);
   static void unref(MPI_Request* request);
   static int wait(MPI_Request* req, MPI_Status* status);
-  static MPI_Request send_init(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
-  static MPI_Request isend_init(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
-  static MPI_Request ssend_init(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
-  static MPI_Request rma_send_init(void* buf, int count, MPI_Datatype datatype, int src, int dst, int tag,
+  static MPI_Request bsend_init(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
+  static MPI_Request send_init(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
+  static MPI_Request isend_init(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
+  static MPI_Request ssend_init(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
+  static MPI_Request rma_send_init(const void* buf, int count, MPI_Datatype datatype, int src, int dst, int tag,
                                    MPI_Comm comm, MPI_Op op);
   static MPI_Request recv_init(void* buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm);
   static MPI_Request rma_recv_init(void* buf, int count, MPI_Datatype datatype, int src, int dst, int tag,
                                    MPI_Comm comm, MPI_Op op);
   static MPI_Request irecv_init(void* buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm);
-  static MPI_Request isend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
-  static MPI_Request issend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
+  static MPI_Request ibsend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
+  static MPI_Request isend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
+  static MPI_Request issend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
   static MPI_Request irecv(void* buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm);
 
   static void recv(void* buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status* status);
-  static void send(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
-  static void ssend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
+  static void bsend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
+  static void send(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
+  static void ssend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
 
-  static void sendrecv(void* sendbuf, int sendcount, MPI_Datatype sendtype, int dst, int sendtag, void* recvbuf,
+  static void sendrecv(const 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);
 
   static void startall(int count, MPI_Request* requests);
@@ -115,7 +118,6 @@ public:
   static int grequest_complete( MPI_Request request);
   static int get_status(MPI_Request req, int* flag, MPI_Status * status);
 
-  int add_f() override;
   static void free_f(int id);
   static Request* f2c(int);
 };
index 4018f9e..b5c6736 100644 (file)
@@ -17,10 +17,10 @@ namespace smpi{
 class Status{
 public:
 static void empty(MPI_Status * status);
-static int cancelled (MPI_Status * status);
+static int cancelled (const MPI_Status * status);
 static void set_cancelled (MPI_Status * status, int flag);
 static void set_elements (MPI_Status * status, MPI_Datatype , int count);
-static int get_count(MPI_Status * status, MPI_Datatype datatype);
+static int get_count(const MPI_Status * status, MPI_Datatype datatype);
 };
 
 
index be11c32..a0d55ad 100644 (file)
@@ -26,20 +26,17 @@ public:
 class Topo_Cart: public Topo {
   int nnodes_ = 0;
   int ndims_;
-  int* dims_;
-  int* periodic_;
-  int* position_;
+  std::vector<int> dims_;
+  std::vector<int> periodic_;
+  std::vector<int> position_;
 
 public:
   explicit Topo_Cart(int ndims);
-  Topo_Cart(const Topo_Cart&) = delete;
-  Topo_Cart& operator=(const Topo_Cart&) = delete;
-  ~Topo_Cart();
-  Topo_Cart(MPI_Comm comm_old, int ndims, int dims[], int periods[], int reorder, MPI_Comm* comm_cart);
+  Topo_Cart(MPI_Comm comm_old, int ndims, const int dims[], const int periods[], int reorder, MPI_Comm* comm_cart);
   Topo_Cart* sub(const int remain_dims[], MPI_Comm* newcomm);
   int coords(int rank, int maxdims, int coords[]);
   int get(int maxdims, int* dims, int* periods, int* coords);
-  int rank(int* coords, int* rank);
+  int rank(const int* coords, int* rank);
   int shift(int direction, int disp, int* rank_source, int* rank_dest);
   int dim_get(int* ndims);
   static int Dims_create(int nnodes, int ndims, int dims[]);
@@ -47,28 +44,15 @@ public:
 
 
 class Topo_Graph: public Topo {
-  int nnodes_;
-  int* index_;
-  int* edges_;
-
-public:
-  Topo_Graph();
-  Topo_Graph(const Topo_Graph&) = delete;
-  Topo_Graph& operator=(const Topo_Graph&) = delete;
-  ~Topo_Graph();
+  std::vector<int> index_;
+  std::vector<int> edges_;
 };
 
 class Topo_Dist_Graph: public Topo {
-  int* in_;
-  int* in_weights_;
-  int* out_;
-  int* out_weights_;
-
-public:
-  Topo_Dist_Graph();
-  Topo_Dist_Graph(const Topo_Dist_Graph&) = delete;
-  Topo_Dist_Graph& operator=(const Topo_Dist_Graph&) = delete;
-  ~Topo_Dist_Graph();
+  std::vector<int> in_;
+  std::vector<int> in_weights_;
+  std::vector<int> out_;
+  std::vector<int> out_weights_;
 };
 
 }
index c32499f..5486297 100644 (file)
@@ -8,6 +8,7 @@
 #define SMPI_WIN_HPP_INCLUDED
 
 #include "simgrid/s4u/Barrier.hpp"
+#include "smpi_errhandler.hpp"
 #include "smpi_f2c.hpp"
 #include "smpi_keyvals.hpp"
 #include "xbt/synchro.h"
@@ -40,6 +41,7 @@ class Win : public F2C, public Keyval {
   int mode_; // exclusive or shared lock
   int allocated_;
   int dynamic_;
+  MPI_Errhandler errhandler_;
 
 public:
   static std::unordered_map<int, smpi_key_elem> keyvals_;
@@ -51,10 +53,10 @@ public:
   Win& operator=(const Win&) = delete;
   ~Win();
   int attach (void *base, MPI_Aint size);
-  int detach (void *base);
+  int detach (const void *base);
   void get_name( char* name, int* length);
   void get_group( MPI_Group* group);
-  void set_name( char* name);
+  void set_name(const char* name);
   int rank();
   int dynamic();
   int start(MPI_Group group, int assert);
@@ -67,16 +69,16 @@ public:
   void* base();
   int disp_unit();
   int fence(int assert);
-  int put( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
+  int put(const 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_Request* request=nullptr);
   int 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_Request* request=nullptr);
-  int accumulate( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
+  int accumulate(const 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_Op op, MPI_Request* request=nullptr);
-  int get_accumulate( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, void *result_addr,
+  int get_accumulate(const 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_Request* request=nullptr);
-  int compare_and_swap(void *origin_addr, void *compare_addr,
+  int compare_and_swap(const void *origin_addr, void *compare_addr,
         void *result_addr, MPI_Datatype datatype, int target_rank,
         MPI_Aint target_disp);
   static Win* f2c(int id);
@@ -92,6 +94,8 @@ public:
   int finish_comms();
   int finish_comms(int rank);
   int shared_query(int rank, MPI_Aint* size, int* disp_unit, void* baseptr);
+  MPI_Errhandler errhandler();
+  void set_errhandler( MPI_Errhandler errhandler);
 };
 
 
index 4d3ab5a..30b9bf1 100644 (file)
@@ -74,7 +74,9 @@ static std::map<std::string, std::string> smpi_colors = {{"recv", "1 0 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"}
+  {"win_flush_local_all", "1 0 0.3"},
+  
+  {"file_read", "1 1 0.3"}
 };
 
 static const char* instr_find_color(const char* c_state)
@@ -149,7 +151,10 @@ void TRACE_smpi_init(int rank)
   if (not TRACE_smpi_is_enabled())
     return;
 
+  auto self = simgrid::s4u::Actor::self();
+
   TRACE_smpi_setup_container(rank, sg_host_self());
+  simgrid::s4u::this_actor::on_exit([self](bool) { smpi_container(self->get_pid())->remove_from_parent(); });
 #if HAVE_PAPI
   container_t container   = smpi_container(rank);
   papi_counter_t counters = smpi_process()->papi_counters();
@@ -164,14 +169,6 @@ void TRACE_smpi_init(int rank)
 #endif
 }
 
-void TRACE_smpi_finalize(int rank)
-{
-  if (not TRACE_smpi_is_enabled())
-    return;
-
-  smpi_container(rank)->remove_from_parent();
-}
-
 void TRACE_smpi_computing_init(int rank)
 {
  //first use, initialize the color in the trace
index e657ab9..eae4244 100644 (file)
@@ -6,6 +6,7 @@
 #include "src/smpi/include/smpi_actor.hpp"
 #include "mc/mc.h"
 #include "smpi_comm.hpp"
+#include "smpi_info.hpp"
 #include "src/mc/mc_replay.hpp"
 #include "src/simix/smx_private.hpp"
 
@@ -18,15 +19,19 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_process, smpi, "Logging specific to SMPI (k
 
 namespace simgrid {
 namespace smpi {
+simgrid::xbt::Extension<simgrid::s4u::Actor, ActorExt> ActorExt::EXTENSION_ID;
 
-ActorExt::ActorExt(s4u::ActorPtr actor, s4u::Barrier* finalization_barrier)
-    : finalization_barrier_(finalization_barrier), actor_(actor)
+ActorExt::ActorExt(s4u::Actor* actor) : actor_(actor)
 {
+  if (not simgrid::smpi::ActorExt::EXTENSION_ID.valid())
+    simgrid::smpi::ActorExt::EXTENSION_ID = simgrid::s4u::Actor::extension_create<simgrid::smpi::ActorExt>();
+
   mailbox_         = s4u::Mailbox::by_name("SMPI-" + std::to_string(actor_->get_pid()));
   mailbox_small_   = s4u::Mailbox::by_name("small-" + std::to_string(actor_->get_pid()));
   mailboxes_mutex_ = s4u::Mutex::create();
   timer_           = xbt_os_timer_new();
   state_           = SmpiProcessState::UNINITIALIZED;
+  info_env_        = MPI_INFO_NULL;
   if (MC_is_active())
     MC_ignore_heap(timer_, xbt_os_timer_size());
 
@@ -57,30 +62,13 @@ ActorExt::~ActorExt()
   xbt_os_timer_free(timer_);
 }
 
-void ActorExt::set_data(const char* instance_id)
-{
-  instance_id_                   = std::string(instance_id);
-  comm_world_                    = smpi_deployment_comm_world(instance_id_);
-  simgrid::s4u::Barrier* barrier = smpi_deployment_finalization_barrier(instance_id_);
-  if (barrier != nullptr) // don't overwrite the current one if the instance has none
-    finalization_barrier_ = barrier;
-
-  // set the process attached to the mailbox
-  mailbox_small_->set_receiver(actor_);
-  XBT_DEBUG("<%ld> SMPI process has been initialized: %p", actor_->get_pid(), actor_.get());
-}
-
 /** @brief Prepares the current process for termination. */
 void ActorExt::finalize()
 {
   state_ = SmpiProcessState::FINALIZED;
   XBT_DEBUG("<%ld> Process left the game", actor_->get_pid());
 
-  // This leads to an explosion of the search graph which cannot be reduced:
-  if (MC_is_active() || MC_record_replay_is_active())
-    return;
-  // wait for all pending asynchronous comms to finish
-  finalization_barrier_->wait();
+  smpi_deployment_unregister_process(instance_id_);
 }
 
 /** @brief Check if a process is finalized */
@@ -193,6 +181,13 @@ MPI_Comm ActorExt::comm_self()
   return comm_self_;
 }
 
+MPI_Info ActorExt::info_env()
+{
+  if (info_env_==MPI_INFO_NULL)
+    info_env_=new Info();
+  return info_env_;
+}
+
 MPI_Comm ActorExt::comm_intra()
 {
   return comm_intra_;
@@ -215,42 +210,57 @@ int ActorExt::sampling()
 
 void ActorExt::init()
 {
-  if (smpi_process_count() == 0) {
-    xbt_die("SimGrid was not initialized properly before entering MPI_Init. Aborting, please check compilation process "
-            "and use smpirun\n");
-  }
+  xbt_assert(smpi_get_universe_size() != 0, "SimGrid was not initialized properly before entering MPI_Init. "
+                                            "Aborting, please check compilation process and use smpirun.");
 
-  simgrid::s4u::ActorPtr proc = simgrid::s4u::Actor::self();
+  simgrid::s4u::Actor* self = simgrid::s4u::Actor::self();
   // 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.
-  ActorExt* process = smpi_process_remote(proc);
+  ActorExt* ext = smpi_process();
   // if we are in MPI_Init and argc handling has already been done.
-  if (process->initialized())
+  if (ext->initialized())
     return;
 
   if (smpi_privatize_global_variables == SmpiPrivStrategies::MMAP) {
     /* Now using the segment index of this process  */
-    process->set_privatized_region(smpi_init_global_memory_segment_process());
+    ext->set_privatized_region(smpi_init_global_memory_segment_process());
     /* Done at the process's creation */
-    SMPI_switch_data_segment(proc);
+    SMPI_switch_data_segment(self);
   }
 
-  const char* instance_id = simgrid::s4u::Actor::self()->get_property("instance_id");
-  const int rank          = xbt_str_parse_int(simgrid::s4u::Actor::self()->get_property("rank"), "Cannot parse rank");
+  ext->instance_id_ = self->get_property("instance_id");
+  const int rank    = xbt_str_parse_int(self->get_property("rank"), "Cannot parse rank");
+
+  ext->state_ = SmpiProcessState::INITIALIZING;
+  smpi_deployment_register_process(ext->instance_id_, rank, self);
 
-  process->state_ = SmpiProcessState::INITIALIZING;
-  smpi_deployment_register_process(instance_id, rank, proc);
+  ext->comm_world_ = smpi_deployment_comm_world(ext->instance_id_);
 
-  process->set_data(instance_id);
+  // set the process attached to the mailbox
+  ext->mailbox_small_->set_receiver(ext->actor_);
+  XBT_DEBUG("<%ld> SMPI process has been initialized: %p", ext->actor_->get_pid(), ext->actor_);
 }
 
 int ActorExt::get_optind()
 {
-  return optind;
+  return optind_;
 }
+
 void ActorExt::set_optind(int new_optind)
 {
-  optind = new_optind;
+  optind_ = new_optind;
+}
+
+void ActorExt::bsend_buffer(void** buf, int* size)
+{
+  *buf  = bsend_buffer_;
+  *size = bsend_buffer_size_;
+}
+
+void ActorExt::set_bsend_buffer(void* buf, int size)
+{
+  bsend_buffer_     = buf;
+  bsend_buffer_size_= size;
 }
 
 } // namespace smpi
index af6cf78..84fbe20 100644 (file)
@@ -12,6 +12,7 @@
 #include "src/internal_config.h"
 #include "src/mc/mc_replay.hpp"
 #include "xbt/config.hpp"
+#include "xbt/file.hpp"
 
 #include "src/smpi/include/smpi_actor.hpp"
 #include <unordered_map>
@@ -38,20 +39,8 @@ double smpi_host_speed;
 SharedMallocType smpi_cfg_shared_malloc = SharedMallocType::GLOBAL;
 double smpi_total_benched_time = 0;
 
-extern "C" XBT_PUBLIC void smpi_execute_flops_(double* flops);
-
-void smpi_execute_flops_(double *flops)
-{
-  smpi_execute_flops(*flops);
-}
-
-extern "C" XBT_PUBLIC void smpi_execute_(double* duration);
-void smpi_execute_(double *duration)
-{
-  smpi_execute(*duration);
-}
-
-void smpi_execute_flops(double flops) {
+// Private execute_flops used by smpi_execute and spmi_execute_benched
+void private_execute_flops(double flops) {
   xbt_assert(flops >= 0, "You're trying to execute a negative amount of flops (%f)!", flops);
   XBT_DEBUG("Handle real computation time: %f flops", flops);
   simgrid::s4u::this_actor::exec_init(flops)
@@ -62,6 +51,15 @@ void smpi_execute_flops(double flops) {
   smpi_switch_data_segment(simgrid::s4u::Actor::self());
 }
 
+void smpi_execute_flops(double flops) {
+  int rank     = simgrid::s4u::this_actor::get_pid();
+  TRACE_smpi_computing_in(rank, flops);
+
+  private_execute_flops(flops);
+
+  TRACE_smpi_computing_out(rank);
+}
+
 void smpi_execute(double duration)
 {
   if (duration >= smpi_cpu_threshold) {
@@ -70,7 +68,7 @@ void smpi_execute(double duration)
     int rank     = simgrid::s4u::this_actor::get_pid();
     TRACE_smpi_computing_in(rank, flops);
 
-    smpi_execute_flops(flops);
+    private_execute_flops(flops);
 
     TRACE_smpi_computing_out(rank);
 
@@ -111,12 +109,25 @@ void smpi_bench_begin()
   xbt_os_threadtimer_start(smpi_process()->timer());
 }
 
+double smpi_adjust_comp_speed(){
+  double speedup=1;
+  if (simgrid::config::get_value<std::string>("smpi/comp-adjustment-file")[0] != '\0') {
+
+    smpi_trace_call_location_t* loc                            = smpi_process()->call_location();
+    std::string key                                            = loc->get_composed_key();
+    std::unordered_map<std::string, double>::const_iterator it = location2speedup.find(key);
+    if (it != location2speedup.end()) {
+      speedup = it->second;
+    }
+  }
+  return speedup;
+}
+
 void smpi_bench_end()
 {
   if (MC_is_active() || MC_record_replay_is_active())
     return;
 
-  double speedup = 1;
   xbt_os_timer_t timer = smpi_process()->timer();
   xbt_os_threadtimer_stop(timer);
 
@@ -149,19 +160,9 @@ void smpi_bench_end()
   }
 
   // Maybe we need to artificially speed up or slow down our computation based on our statistical analysis.
-  if (simgrid::config::get_value<std::string>("smpi/comp-adjustment-file")[0] != '\0') {
-
-    smpi_trace_call_location_t* loc                            = smpi_process()->call_location();
-    std::string key                                            = loc->get_composed_key();
-    std::unordered_map<std::string, double>::const_iterator it = location2speedup.find(key);
-    if (it != location2speedup.end()) {
-      speedup = it->second;
-    }
-  }
-
   // Simulate the benchmarked computation unless disabled via command-line argument
   if (simgrid::config::get_value<bool>("smpi/simulate-computation")) {
-    smpi_execute(xbt_os_timer_elapsed(timer)/speedup);
+    smpi_execute(xbt_os_timer_elapsed(timer)/smpi_adjust_comp_speed());
   }
 
 #if HAVE_PAPI
@@ -189,7 +190,7 @@ static unsigned int private_sleep(double secs)
   int rank = simgrid::s4u::this_actor::get_pid();
   TRACE_smpi_sleeping_in(rank, secs);
 
-  simcall_process_sleep(secs);
+  simgrid::s4u::this_actor::sleep_for(secs);
 
   TRACE_smpi_sleeping_out(rank);
 
@@ -201,14 +202,14 @@ unsigned int smpi_sleep(unsigned int secs)
 {
   if (not smpi_process())
     return sleep(secs);
-  return private_sleep(static_cast<double>(secs));
+  return private_sleep(secs);
 }
 
 int smpi_usleep(useconds_t usecs)
 {
   if (not smpi_process())
     return usleep(usecs);
-  return static_cast<int>(private_sleep(static_cast<double>(usecs) / 1000000.0));
+  return static_cast<int>(private_sleep(usecs / 1000000.0));
 }
 
 #if _POSIX_TIMERS > 0
@@ -216,7 +217,7 @@ int smpi_nanosleep(const struct timespec* tp, struct timespec* t)
 {
   if (not smpi_process())
     return nanosleep(tp,t);
-  return static_cast<int>(private_sleep(static_cast<double>(tp->tv_sec + tp->tv_nsec / 1000000000.0)));
+  return static_cast<int>(private_sleep(tp->tv_sec + tp->tv_nsec / 1000000000.0));
 }
 #endif
 
@@ -236,7 +237,7 @@ int smpi_gettimeofday(struct timeval* tv, struct timezone* tz)
 #endif
   }
   if (smpi_wtime_sleep > 0)
-    simcall_process_sleep(smpi_wtime_sleep);
+    simgrid::s4u::this_actor::sleep_for(smpi_wtime_sleep);
   smpi_bench_begin();
   return 0;
 }
@@ -254,7 +255,7 @@ int smpi_clock_gettime(clockid_t clk_id, struct timespec* tp)
     tp->tv_nsec = static_cast<long int>((now - tp->tv_sec) * 1e9);
   }
   if (smpi_wtime_sleep > 0)
-    simcall_process_sleep(smpi_wtime_sleep);
+    simgrid::s4u::this_actor::sleep_for(smpi_wtime_sleep);
   smpi_bench_begin();
   return 0;
 }
@@ -267,7 +268,7 @@ double smpi_mpi_wtime()
     smpi_bench_end();
     time = SIMIX_get_clock();
     if (smpi_wtime_sleep > 0)
-      simcall_process_sleep(smpi_wtime_sleep);
+      simgrid::s4u::this_actor::sleep_for(smpi_wtime_sleep);
     smpi_bench_begin();
   } else {
     time = SIMIX_get_clock();
@@ -429,7 +430,7 @@ void smpi_sample_3(int global, const char *file, int line)
   double period  = xbt_os_timer_elapsed(smpi_process()->timer());
   data.sum      += period;
   data.sum_pow2 += period * period;
-  double n       = static_cast<double>(data.count);
+  double n       = data.count;
   data.mean      = data.sum / n;
   data.relstderr = sqrt((data.sum_pow2 / n - data.mean * data.mean) / n) / data.mean;
 
@@ -470,8 +471,11 @@ void smpi_trace_set_call_location(const char* file, const int line)
 
   loc->previous_filename   = loc->filename;
   loc->previous_linenumber = loc->linenumber;
-  loc->filename            = file;
-  loc->linenumber          = line;
+  if(not simgrid::config::get_value<bool>("smpi/trace-call-use-absolute-path"))
+    loc->filename = simgrid::xbt::Path(file).get_base_name();
+  else
+    loc->filename = file;
+  loc->linenumber = line;
 }
 
 /** Required for Fortran bindings */
index c73ed55..5cf91eb 100644 (file)
 #include "smpi_comm.hpp"
 #include <map>
 
+XBT_LOG_EXTERNAL_CATEGORY(smpi);
+
 namespace simgrid {
 namespace smpi {
 namespace app {
 
+static int universe_size = 0;
+
 class Instance {
 public:
-  Instance(const std::string& name, int max_no_processes, MPI_Comm comm, simgrid::s4u::Barrier* finalization_barrier)
-      : name(name)
-      , size(max_no_processes)
-      , present_processes(0)
-      , comm_world(comm)
-      , finalization_barrier(finalization_barrier)
-  { }
-
-  const std::string name;
-  int size;
-  int present_processes;
-  MPI_Comm comm_world;
-  simgrid::s4u::Barrier* finalization_barrier;
+  Instance(const std::string& name, int max_no_processes, MPI_Comm comm)
+      : name_(name), size_(max_no_processes), comm_world_(comm)
+  {
+    MPI_Group group = new simgrid::smpi::Group(size_);
+    comm_world_     = new simgrid::smpi::Comm(group, nullptr, 0, -1);
+    //  FIXME : using MPI_Attr_put with MPI_UNIVERSE_SIZE is forbidden and we make it a no-op (which triggers a warning
+    //  as MPI_ERR_ARG is returned). Directly calling Comm::attr_put breaks for now, as MPI_UNIVERSE_SIZE,is <0
+    //  instance.comm_world->attr_put<simgrid::smpi::Comm>(MPI_UNIVERSE_SIZE, reinterpret_cast<void*>(instance.size));
+
+    universe_size += max_no_processes;
+  }
+
+  const std::string name_;
+  unsigned int size_;
+  unsigned int finalized_ranks_ = 0;
+  MPI_Comm comm_world_;
 };
 }
 }
@@ -37,7 +44,6 @@ public:
 using simgrid::smpi::app::Instance;
 
 static std::map<std::string, Instance> smpi_instances;
-extern int process_count; // How many processes have been allocated over all instances?
 
 /** @ingroup smpi_simulation
  * @brief Registers a running instance of a MPI program.
@@ -51,62 +57,51 @@ extern int process_count; // How many processes have been allocated over all ins
  */
 void SMPI_app_instance_register(const char *name, xbt_main_func_t code, int num_processes)
 {
-  if (code != nullptr) // When started with smpirun, we will not execute a function
+  if (code != nullptr) // When started with smpirun, we will not execute a function
     simgrid::s4u::Engine::get_instance()->register_function(name, code);
-  }
 
-  static int already_called = 0;
-  if (not already_called) {
-    already_called = 1;
-    std::vector<simgrid::s4u::Host*> list = simgrid::s4u::Engine::get_instance()->get_all_hosts();
-    for (auto const& host : list) {
-      host->extension_set(new simgrid::smpi::Host(host));
-    }
-  }
-
-  Instance instance(std::string(name), num_processes, MPI_COMM_NULL, new simgrid::s4u::Barrier(num_processes));
-  MPI_Group group     = new simgrid::smpi::Group(instance.size);
-  instance.comm_world = new simgrid::smpi::Comm(group, nullptr);
-//  FIXME : using MPI_Attr_put with MPI_UNIVERSE_SIZE is forbidden and we make it a no-op (which triggers a warning as MPI_ERR_ARG is returned). 
-//  Directly calling Comm::attr_put breaks for now, as MPI_UNIVERSE_SIZE,is <0
-//  instance.comm_world->attr_put<simgrid::smpi::Comm>(MPI_UNIVERSE_SIZE, reinterpret_cast<void*>(instance.size));
-
-  process_count+=num_processes;
+  Instance instance(std::string(name), num_processes, MPI_COMM_NULL);
 
   smpi_instances.insert(std::pair<std::string, Instance>(name, instance));
 }
 
-void smpi_deployment_register_process(const std::string& instance_id, int rank, simgrid::s4u::ActorPtr actor)
+void smpi_deployment_register_process(const std::string& instance_id, int rank, simgrid::s4u::Actor* actor)
 {
   Instance& instance = smpi_instances.at(instance_id);
-
-  instance.present_processes++;
-  instance.comm_world->group()->set_mapping(actor, rank);
+  instance.comm_world_->group()->set_mapping(actor, rank);
 }
 
-MPI_Comm* smpi_deployment_comm_world(const std::string& instance_id)
+void smpi_deployment_unregister_process(const std::string& instance_id)
 {
-  if (smpi_instances.empty()) { // no instance registered, we probably used smpirun.
-    return nullptr;
-  }
   Instance& instance = smpi_instances.at(instance_id);
-  return &instance.comm_world;
+  instance.finalized_ranks_++;
+
+  if (instance.finalized_ranks_ == instance.size_) {
+    simgrid::smpi::Comm::destroy(instance.comm_world_);
+    smpi_instances.erase(instance_id);
+  }
 }
 
-simgrid::s4u::Barrier* smpi_deployment_finalization_barrier(const std::string& instance_id)
+MPI_Comm* smpi_deployment_comm_world(const std::string& instance_id)
 {
-  if (smpi_instances.empty()) { // no instance registered, we probably used smpirun.
+  if (smpi_instances
+          .empty()) { // no instance registered, we probably used smpirun. (FIXME: I guess this never happens for real)
     return nullptr;
   }
   Instance& instance = smpi_instances.at(instance_id);
-  return instance.finalization_barrier;
+  return &instance.comm_world_;
 }
 
 void smpi_deployment_cleanup_instances(){
   for (auto const& item : smpi_instances) {
+    XBT_CINFO(smpi, "Stalling SMPI instance: %s. Do all your MPI ranks call MPI_Finalize()?", item.first.c_str());
     Instance instance = item.second;
-    delete instance.finalization_barrier;
-    simgrid::smpi::Comm::destroy(instance.comm_world);
+    simgrid::smpi::Comm::destroy(instance.comm_world_);
   }
   smpi_instances.clear();
 }
+
+int smpi_get_universe_size()
+{
+  return simgrid::smpi::app::universe_size;
+}
diff --git a/src/smpi/internals/smpi_dvfs.cpp b/src/smpi/internals/smpi_dvfs.cpp
deleted file mode 100644 (file)
index 85a4cc1..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/* Copyright (c) 2013-2019. The SimGrid Team. All rights reserved.          */
-
-/* This program is 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/log.h>
-
-// FIXME: this plugin should be separated from the core
-#include "simgrid/s4u/Host.hpp"
-#include <simgrid/plugins/energy.h>
-#include <simgrid/simix.h>
-
-#include <smpi/smpi.h>
-
-#include "src/internal_config.h"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_dvfs, smpi, "Logging specific to SMPI (experimental DVFS support)");
-
-/**
- * @brief Return the speed of the processor (in flop/s) at a given pstate
- *
- * @param pstate_index pstate to test
- * @return Returns the processor speed associated with pstate_index
- */
-double smpi_get_host_power_peak_at(int pstate_index)
-{
-  return sg_host_self()->get_pstate_speed(pstate_index);
-}
-
-/**
- * @brief Return the current speed of the processor (in flop/s)
- *
- * @return Returns the current processor speed
- */
-double smpi_get_host_current_power_peak()
-{
-  return sg_host_self()->get_speed();
-}
-
-/**
- * @brief Return the number of pstates defined for the current host
- */
-int smpi_get_host_nb_pstates()
-{
-  return sg_host_get_nb_pstates(sg_host_self());
-}
-
-/**
- * @brief Sets the pstate at which the processor should run
- *
- * @param pstate_index pstate to switch to
- */
-void smpi_set_host_pstate(int pstate_index)
-{
-  sg_host_set_pstate(sg_host_self(), pstate_index);
-}
-/** @brief Gets the pstate at which the processor currently running */
-int smpi_get_host_pstate() {
-  return sg_host_get_pstate(sg_host_self());
-}
-
-/**
- * @brief Return the total energy consumed by a host (in Joules)
- *
- * @return Returns the consumed energy
- */
-double smpi_get_host_consumed_energy() {
-  return sg_host_get_consumed_energy(sg_host_self());
-}
-
-#if SMPI_FORTRAN
-
-#if defined(__alpha__) || defined(__sparc64__) || defined(__x86_64__) || defined(__ia64__)
-typedef int integer;
-#else
-typedef long int integer;
-#endif
-typedef double doublereal;
-
-extern "C" XBT_PUBLIC doublereal smpi_get_host_power_peak_at_(integer* pstate_index);
-doublereal smpi_get_host_power_peak_at_(integer *pstate_index)
-{
-  return static_cast<doublereal>(sg_host_self()->get_pstate_speed((int)*pstate_index));
-}
-
-extern "C" XBT_PUBLIC doublereal smpi_get_host_current_power_peak_();
-doublereal smpi_get_host_current_power_peak_()
-{
-  return sg_host_self()->get_speed();
-}
-
-extern "C" XBT_PUBLIC integer smpi_get_host_nb_pstates_();
-integer smpi_get_host_nb_pstates_()
-{
-  return static_cast<integer>(sg_host_self()->get_pstate_count());
-}
-
-extern "C" XBT_PUBLIC void smpi_set_host_pstate_(integer* pstate_index);
-void smpi_set_host_pstate_(integer *pstate_index)
-{
-  sg_host_set_pstate(sg_host_self(), (static_cast<int>(*pstate_index)));
-}
-
-extern "C" XBT_PUBLIC doublereal smpi_get_host_consumed_energy_();
-doublereal smpi_get_host_consumed_energy_()
-{
-  return static_cast<doublereal>(sg_host_get_consumed_energy(sg_host_self()));
-}
-
-#endif
index 26aafa4..c1d5476 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "mc/mc.h"
 #include "simgrid/s4u/Engine.hpp"
+#include "simgrid/plugins/file_system.h"
 #include "smpi_coll.hpp"
 #include "smpi_f2c.hpp"
 #include "smpi_host.hpp"
 #include "xbt/config.hpp"
 
 #include <algorithm>
+#include <boost/algorithm/string.hpp> /* trim_right / trim_left */
+#include <boost/tokenizer.hpp>
 #include <cfloat> /* DBL_MAX */
 #include <cinttypes>
 #include <cstdint> /* intmax_t */
 #include <dlfcn.h>
 #include <fcntl.h>
 #include <fstream>
+#include <sys/stat.h>
+
+#if SIMGRID_HAVE_MC
+#include "src/mc/mc_config.hpp"
+#endif
+
+#if SG_HAVE_SENDFILE
+#include <sys/sendfile.h>
+#endif
 
-#if not defined(__APPLE__)
+#if HAVE_PAPI
+#include "papi.h"
+#endif
+
+#if not defined(__APPLE__) && not defined(__HAIKU__)
 #include <link.h>
 #endif
 
 #   define MAC_OS_X_VERSION_10_12 101200
 # endif
 constexpr bool HAVE_WORKING_MMAP = (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12);
-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__sun) || defined(__HAIKU__)
 constexpr bool HAVE_WORKING_MMAP = false;
 #else
 constexpr bool HAVE_WORKING_MMAP = true;
 #endif
 
-#if SG_HAVE_SENDFILE
-#include <sys/sendfile.h>
-#endif
-
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_kernel, smpi, "Logging specific to SMPI (kernel)");
-#include <boost/tokenizer.hpp>
-#include <boost/algorithm/string.hpp> /* trim_right / trim_left */
 
 #if SMPI_IFORT
   extern "C" void for_rtl_init_ (int *, char **);
@@ -66,17 +76,13 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_kernel, smpi, "Logging specific to SMPI (ke
 #endif
 
 #if HAVE_PAPI
-#include "papi.h"
 std::string papi_default_config_name = "default";
 std::map</* computation unit name */ std::string, papi_process_data> units2papi_setup;
 #endif
 
 std::unordered_map<std::string, double> location2speedup;
 
-static std::map</*process_id*/ simgrid::s4u::Actor const*, simgrid::smpi::ActorExt*> process_data;
-int process_count = 0;
 static int smpi_exit_status = 0;
-int smpi_universe_size = 0;
 extern double smpi_total_benched_time;
 xbt_os_timer_t global_timer;
 static std::vector<std::string> privatize_libs_paths;
@@ -91,9 +97,6 @@ static std::vector<std::string> privatize_libs_paths;
  * 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 std::string smpi_default_instance_name("smpirun");
@@ -103,11 +106,6 @@ static simgrid::config::Flag<double> smpi_init_sleep(
 void (*smpi_comm_copy_data_callback)(simgrid::kernel::activity::CommImpl*, void*,
                                      size_t) = &smpi_comm_copy_buffer_callback;
 
-int smpi_process_count()
-{
-  return process_count;
-}
-
 simgrid::smpi::ActorExt* smpi_process()
 {
   simgrid::s4u::ActorPtr me = simgrid::s4u::Actor::self();
@@ -115,20 +113,22 @@ simgrid::smpi::ActorExt* smpi_process()
   if (me == nullptr) // This happens sometimes (eg, when linking against NS3 because it pulls openMPI...)
     return nullptr;
 
-  return process_data.at(me.get());
+  return me->extension<simgrid::smpi::ActorExt>();
 }
 
 simgrid::smpi::ActorExt* smpi_process_remote(simgrid::s4u::ActorPtr actor)
 {
-  return process_data.at(actor.get());
+  if (actor.get() == nullptr)
+    return nullptr;
+  return actor->extension<simgrid::smpi::ActorExt>();
 }
 
 MPI_Comm smpi_process_comm_self(){
   return smpi_process()->comm_self();
 }
 
-void smpi_process_init(int *argc, char ***argv){
-  simgrid::smpi::ActorExt::init();
+MPI_Info smpi_process_info_env(){
+  return smpi_process()->info_env();
 }
 
 void * smpi_process_get_user_data(){
@@ -139,15 +139,6 @@ void smpi_process_set_user_data(void *data){
   simgrid::s4u::Actor::self()->get_impl()->set_user_data(data);
 }
 
-
-int smpi_global_size()
-{
-  char *value = getenv("SMPI_GLOBAL_SIZE");
-  xbt_assert(value,"Please set env var SMPI_GLOBAL_SIZE to the expected number of processes.");
-
-  return xbt_str_parse_int(value, "SMPI_GLOBAL_SIZE contains a non-numerical value: %s");
-}
-
 void smpi_comm_set_copy_data_callback(void (*callback) (smx_activity_t, void*, size_t))
 {
   static void (*saved_callback)(smx_activity_t, void*, size_t);
@@ -170,14 +161,12 @@ static void check_blocks(std::vector<std::pair<size_t, size_t>> &private_blocks,
 
 void smpi_comm_copy_buffer_callback(simgrid::kernel::activity::CommImpl* comm, void* buff, size_t buff_size)
 {
-  int src_shared                        = 0;
-  int dst_shared                        = 0;
   size_t src_offset                     = 0;
   size_t dst_offset                     = 0;
   std::vector<std::pair<size_t, size_t>> src_private_blocks;
   std::vector<std::pair<size_t, size_t>> dst_private_blocks;
   XBT_DEBUG("Copy the data over");
-  if((src_shared=smpi_is_shared(buff, src_private_blocks, &src_offset))) {
+  if(smpi_is_shared(buff, src_private_blocks, &src_offset)) {
     XBT_DEBUG("Sender %p is shared. Let's ignore it.", buff);
     src_private_blocks = shift_and_frame_private_blocks(src_private_blocks, src_offset, buff_size);
   }
@@ -185,7 +174,7 @@ void smpi_comm_copy_buffer_callback(simgrid::kernel::activity::CommImpl* comm, v
     src_private_blocks.clear();
     src_private_blocks.push_back(std::make_pair(0, buff_size));
   }
-  if ((dst_shared = smpi_is_shared((char*)comm->dst_buff_, dst_private_blocks, &dst_offset))) {
+  if (smpi_is_shared((char*)comm->dst_buff_, dst_private_blocks, &dst_offset)) {
     XBT_DEBUG("Receiver %p is shared. Let's ignore it.", (char*)comm->dst_buff_);
     dst_private_blocks = shift_and_frame_private_blocks(dst_private_blocks, dst_offset, buff_size);
   }
@@ -216,7 +205,7 @@ void smpi_comm_copy_buffer_callback(simgrid::kernel::activity::CommImpl* comm, v
   XBT_DEBUG("Copying %zu bytes from %p to %p", buff_size, tmpbuff, comm->dst_buff_);
   memcpy_private(comm->dst_buff_, tmpbuff, private_blocks);
 
-  if (comm->detached) {
+  if (comm->detached()) {
     // if this is a detached send, the source buffer was duplicated by SMPI
     // sender to make the original buffer available to the application ASAP
     xbt_free(buff);
@@ -235,16 +224,30 @@ void smpi_comm_null_copy_buffer_callback(simgrid::kernel::activity::CommImpl*, v
 
 static void smpi_check_options()
 {
-  //check correctness of MPI parameters
+#if SIMGRID_HAVE_MC
+  if (MC_is_active()) {
+    if (_sg_mc_buffering == "zero")
+      simgrid::config::set_value<int>("smpi/send-is-detached-thresh", 0);
+    else if (_sg_mc_buffering == "infty")
+      simgrid::config::set_value<int>("smpi/send-is-detached-thresh", INT_MAX);
+    else
+      THROW_IMPOSSIBLE;
+  }
+#endif
 
   xbt_assert(simgrid::config::get_value<int>("smpi/async-small-thresh") <=
+                 simgrid::config::get_value<int>("smpi/send-is-detached-thresh"),
+             "smpi/async-small-thresh (=%d) should be smaller or equal to smpi/send-is-detached-thresh (=%d)",
+             simgrid::config::get_value<int>("smpi/async-small-thresh"),
              simgrid::config::get_value<int>("smpi/send-is-detached-thresh"));
 
-  if (simgrid::config::is_default("smpi/host-speed")) {
+  if (simgrid::config::is_default("smpi/host-speed") && not MC_is_active()) {
     XBT_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.");
+             "Use the option \"--cfg=smpi/host-speed:<flops>\" to set its value.  "
+             "Check "
+             "https://simgrid.org/doc/latest/Configuring_SimGrid.html#automatic-benchmarking-of-smpi-code for more "
+             "information.");
   }
 
   xbt_assert(simgrid::config::get_value<double>("smpi/cpu-threshold") >= 0,
@@ -253,37 +256,11 @@ static void smpi_check_options()
 }
 
 int smpi_enabled() {
-  return not process_data.empty();
+  return MPI_COMM_WORLD != MPI_COMM_UNINITIALIZED;
 }
 
-void smpi_global_init()
+static void smpi_init_papi()
 {
-  if (not MC_is_active()) {
-    global_timer = xbt_os_timer_new();
-    xbt_os_walltimer_start(global_timer);
-  }
-
-  std::string filename = simgrid::config::get_value<std::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());
-    }
-
-    std::string line;
-    typedef boost::tokenizer< boost::escaped_list_separator<char>> Tokenizer;
-    std::getline(fstream, line); // Skip the header line
-    while (std::getline(fstream, line)) {
-      Tokenizer tok(line);
-      Tokenizer::iterator it  = tok.begin();
-      Tokenizer::iterator end = std::next(tok.begin());
-
-      std::string location = *it;
-      boost::trim(location);
-      location2speedup.insert(std::pair<std::string, double>(location, std::stod(*end)));
-    }
-  }
-
 #if HAVE_PAPI
   // This map holds for each computation unit (such as "default" or "process1" etc.)
   // the configuration as given by the user (counter data as a pair of (counter_name, counter_counter))
@@ -349,28 +326,6 @@ void smpi_global_init()
 #endif
 }
 
-void smpi_global_destroy()
-{
-  smpi_bench_destroy();
-  smpi_shared_destroy();
-  smpi_deployment_cleanup_instances();
-
-  if (simgrid::smpi::Colls::smpi_coll_cleanup_callback != nullptr)
-    simgrid::smpi::Colls::smpi_coll_cleanup_callback();
-
-  MPI_COMM_WORLD = MPI_COMM_NULL;
-
-  if (not MC_is_active()) {
-    xbt_os_timer_free(global_timer);
-  }
-
-  if (smpi_privatize_global_variables == SmpiPrivStrategies::MMAP)
-    smpi_destroy_global_memory_segments();
-  smpi_free_static();
-  if(simgrid::smpi::F2C::lookup() != nullptr)
-    simgrid::smpi::F2C::delete_lookup();
-}
-
 static void smpi_init_options(){
   // return if already called
   if (smpi_cpu_threshold > -1)
@@ -378,8 +333,10 @@ static void smpi_init_options(){
   simgrid::smpi::Colls::set_collectives();
   simgrid::smpi::Colls::smpi_coll_cleanup_callback = nullptr;
   smpi_cpu_threshold                               = simgrid::config::get_value<double>("smpi/cpu-threshold");
-  smpi_host_speed                                  = simgrid::config::get_value<double>("smpi/host-speed");
-  xbt_assert(smpi_host_speed > 0.0, "You're trying to set the host_speed to a non-positive value (given: %f)", smpi_host_speed);
+  if (smpi_cpu_threshold < 0)
+    smpi_cpu_threshold = DBL_MAX;
+
+  smpi_host_speed                   = simgrid::config::get_value<double>("smpi/host-speed");
   std::string smpi_privatize_option = simgrid::config::get_value<std::string>("smpi/privatization");
   if (smpi_privatize_option == "no" || smpi_privatize_option == "0")
     smpi_privatize_global_variables = SmpiPrivStrategies::NONE;
@@ -401,9 +358,6 @@ static void smpi_init_options(){
     smpi_privatize_global_variables = SmpiPrivStrategies::DLOPEN;
   }
 
-  if (smpi_cpu_threshold < 0)
-    smpi_cpu_threshold = DBL_MAX;
-
   std::string val = simgrid::config::get_value<std::string>("smpi/shared-malloc");
   if ((val == "yes") || (val == "1") || (val == "on") || (val == "global")) {
     smpi_cfg_shared_malloc = SharedMallocType::GLOBAL;
@@ -421,8 +375,8 @@ typedef std::function<int(int argc, char *argv[])> smpi_entry_point_type;
 typedef int (* smpi_c_entry_point_type)(int argc, char **argv);
 typedef void (*smpi_fortran_entry_point_type)();
 
-static int smpi_run_entry_point(const smpi_entry_point_type& entry_point, const std::string& executable_path,
-                                std::vector<std::string> args)
+template <typename F>
+static int smpi_run_entry_point(const F& entry_point, const std::string& executable_path, std::vector<std::string> args)
 {
   // copy C strings, we need them writable
   std::vector<char*>* args4argv = new std::vector<char*>(args.size());
@@ -440,7 +394,6 @@ static int smpi_run_entry_point(const smpi_entry_point_type& entry_point, const
   args4argv->push_back(nullptr);
   char** argv = args4argv->data();
 
-  simgrid::smpi::ActorExt::init();
 #if SMPI_IFORT
   for_rtl_init_ (&argc, argv);
 #elif SMPI_FLANG
@@ -473,7 +426,7 @@ static smpi_entry_point_type smpi_resolve_function(void* handle)
 {
   smpi_fortran_entry_point_type entry_point_fortran = (smpi_fortran_entry_point_type)dlsym(handle, "user_main_");
   if (entry_point_fortran != nullptr) {
-    return [entry_point_fortran](int argc, char** argv) {
+    return [entry_point_fortran](int, char**) {
       entry_point_fortran();
       return 0;
     };
@@ -508,7 +461,7 @@ static void smpi_copy_file(const std::string& src, const std::string& target, of
 #endif
   // If this point is reached, sendfile() actually is not available.  Copy file by hand.
   const int bufsize = 1024 * 1024 * 4;
-  char buf[bufsize];
+  char* buf         = new char[bufsize];
   while (int got = read(fdin, buf, bufsize)) {
     if (got == -1) {
       xbt_assert(errno == EINTR, "Cannot read from %s", src.c_str());
@@ -525,11 +478,12 @@ static void smpi_copy_file(const std::string& src, const std::string& target, of
       }
     }
   }
+  delete[] buf;
   close(fdin);
   close(fdout);
 }
 
-#if not defined(__APPLE__)
+#if not defined(__APPLE__) && not defined(__HAIKU__)
 static int visit_libs(struct dl_phdr_info* info, size_t, void* data)
 {
   char* libname = (char*)(data);
@@ -562,14 +516,12 @@ static void smpi_init_privatization_dlopen(const std::string& executable)
       // get library name from path
       char fullpath[512] = {'\0'};
       strncpy(fullpath, libname.c_str(), 511);
-#if not defined(__APPLE__)
-      int ret = dl_iterate_phdr(visit_libs, fullpath);
-      if (ret == 0)
-        xbt_die("Can't find a linked %s - check the setting you gave to smpi/privatize-libs", fullpath);
-      else
-        XBT_DEBUG("Extra lib to privatize found : %s", fullpath);
+#if not defined(__APPLE__) && not defined(__HAIKU__)
+      xbt_assert(0 != dl_iterate_phdr(visit_libs, fullpath),
+                 "Can't find a linked %s - check your settings in smpi/privatize-libs", fullpath);
+      XBT_DEBUG("Extra lib to privatize '%s' found", fullpath);
 #else
-      xbt_die("smpi/privatize-libs is not (yet) compatible with OSX");
+      xbt_die("smpi/privatize-libs is not (yet) compatible with OSX nor with Haiku");
 #endif
       privatize_libs_paths.push_back(fullpath);
       dlclose(libhandle);
@@ -611,9 +563,7 @@ static void smpi_init_privatization_dlopen(const std::string& executable)
           smpi_copy_file(libpath, target_lib, fdin_size2);
 
           std::string sedcommand = "sed -i -e 's/" + libname + "/" + target_lib + "/g' " + target_executable;
-          int ret                = system(sedcommand.c_str());
-          if (ret != 0)
-            xbt_die("error while applying sed command %s \n", sedcommand.c_str());
+          xbt_assert(system(sedcommand.c_str()) == 0, "error while applying sed command %s \n", sedcommand.c_str());
         }
       }
 
@@ -626,11 +576,11 @@ static void smpi_init_privatization_dlopen(const std::string& executable)
         for (const std::string& target_lib : target_libs)
           unlink(target_lib.c_str());
       }
-      if (handle == nullptr)
-        xbt_die("dlopen failed: %s (errno: %d -- %s)", dlerror(), saved_errno, strerror(saved_errno));
+      xbt_assert(handle != nullptr, "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");
+      xbt_assert(entry_point, "Could not resolve entry point");
       smpi_run_entry_point(entry_point, executable, args);
     });
   };
@@ -640,13 +590,14 @@ static void smpi_init_privatization_no_dlopen(const std::string& executable)
 {
   if (smpi_privatize_global_variables == SmpiPrivStrategies::MMAP)
     smpi_prepare_global_memory_segment();
+
   // Load the dynamic library and resolve the entry point:
   void* handle = dlopen(executable.c_str(), RTLD_LAZY | RTLD_LOCAL);
-  if (handle == nullptr)
-    xbt_die("dlopen failed for %s: %s (errno: %d -- %s)", executable.c_str(), dlerror(), errno, strerror(errno));
+  xbt_assert(handle != nullptr, "dlopen failed for %s: %s (errno: %d -- %s)", executable.c_str(), dlerror(), errno,
+             strerror(errno));
   smpi_entry_point_type entry_point = smpi_resolve_function(handle);
-  if (not entry_point)
-    xbt_die("main not found in %s", executable.c_str());
+  xbt_assert(entry_point, "main not found in %s", executable.c_str());
+
   if (smpi_privatize_global_variables == SmpiPrivStrategies::MMAP)
     smpi_backup_global_memory_segment();
 
@@ -668,10 +619,11 @@ int smpi_main(const char* executable, int argc, char* argv[])
   TRACE_global_init();
   SIMIX_global_init(&argc, argv);
 
+  auto engine              = simgrid::s4u::Engine::get_instance();
   SMPI_switch_data_segment = &smpi_switch_data_segment;
-
+  sg_storage_file_system_init();
   // parse the platform file: get the host list
-  simgrid::s4u::Engine::get_instance()->load_platform(argv[1]);
+  engine->load_platform(argv[1]);
   SIMIX_comm_set_copy_data_callback(smpi_comm_copy_buffer_callback);
 
   smpi_init_options();
@@ -681,12 +633,17 @@ int smpi_main(const char* executable, int argc, char* argv[])
     smpi_init_privatization_no_dlopen(executable);
 
   SMPI_init();
-  simgrid::s4u::Engine::get_instance()->load_deployment(argv[2]);
-  SMPI_app_instance_register(smpi_default_instance_name.c_str(), nullptr,
-                             process_data.size()); // 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;
 
+  /* This is a ... heavy way to count the MPI ranks */
+  int rank_counts = 0;
+  simgrid::s4u::Actor::on_creation.connect([&rank_counts](simgrid::s4u::Actor& actor) {
+    if (not actor.is_daemon())
+      rank_counts++;
+  });
+  engine->load_deployment(argv[2]);
+
+  SMPI_app_instance_register(smpi_default_instance_name.c_str(), nullptr, rank_counts);
+  MPI_COMM_WORLD = *smpi_deployment_comm_world(smpi_default_instance_name);
 
   /* Clean IO before the run */
   fflush(stdout);
@@ -711,7 +668,7 @@ int smpi_main(const char* executable, int argc, char* argv[])
       "You may want to use sampling functions or trace replay to reduce this.");
     }
   }
-  smpi_global_destroy();
+  SMPI_finalize();
 
   return smpi_exit_status;
 }
@@ -719,31 +676,65 @@ int smpi_main(const char* executable, int argc, char* argv[])
 // Called either directly from the user code, or from the code called by smpirun
 void SMPI_init(){
   simgrid::s4u::Actor::on_creation.connect([](simgrid::s4u::Actor& actor) {
-    if (not actor.is_daemon()) {
-      process_data.insert({&actor, new simgrid::smpi::ActorExt(&actor, nullptr)});
-    }
-  });
-  simgrid::s4u::Actor::on_destruction.connect([](simgrid::s4u::Actor const& actor) {
-    auto it = process_data.find(&actor);
-    if (it != process_data.end()) {
-      delete it->second;
-      process_data.erase(it);
-    }
+    if (not actor.is_daemon())
+      actor.extension_set<simgrid::smpi::ActorExt>(new simgrid::smpi::ActorExt(&actor));
   });
   simgrid::s4u::Host::on_creation.connect(
       [](simgrid::s4u::Host& host) { host.extension_set(new simgrid::smpi::Host(&host)); });
+  for (auto const& host : simgrid::s4u::Engine::get_instance()->get_all_hosts())
+    host->extension_set(new simgrid::smpi::Host(host));
 
   smpi_init_options();
-  smpi_global_init();
+  if (not MC_is_active()) {
+    global_timer = xbt_os_timer_new();
+    xbt_os_walltimer_start(global_timer);
+  }
+
+  std::string filename = simgrid::config::get_value<std::string>("smpi/comp-adjustment-file");
+  if (not filename.empty()) {
+    std::ifstream fstream(filename);
+    xbt_assert(fstream.is_open(), "Could not open file %s. Does it exist?", filename.c_str());
+
+    std::string line;
+    typedef boost::tokenizer<boost::escaped_list_separator<char>> Tokenizer;
+    std::getline(fstream, line); // Skip the header line
+    while (std::getline(fstream, line)) {
+      Tokenizer tok(line);
+      Tokenizer::iterator it  = tok.begin();
+      Tokenizer::iterator end = std::next(tok.begin());
+
+      std::string location = *it;
+      boost::trim(location);
+      location2speedup.insert(std::pair<std::string, double>(location, std::stod(*end)));
+    }
+  }
+  smpi_init_papi();
   smpi_check_options();
 }
 
-void SMPI_finalize(){
-  smpi_global_destroy();
+void SMPI_finalize()
+{
+  smpi_bench_destroy();
+  smpi_shared_destroy();
+  smpi_deployment_cleanup_instances();
+
+  if (simgrid::smpi::Colls::smpi_coll_cleanup_callback != nullptr)
+    simgrid::smpi::Colls::smpi_coll_cleanup_callback();
+
+  MPI_COMM_WORLD = MPI_COMM_NULL;
+
+  if (not MC_is_active()) {
+    xbt_os_timer_free(global_timer);
+  }
+
+  if (smpi_privatize_global_variables == SmpiPrivStrategies::MMAP)
+    smpi_destroy_global_memory_segments();
+  if (simgrid::smpi::F2C::lookup() != nullptr)
+    simgrid::smpi::F2C::delete_lookup();
 }
 
 void smpi_mpi_init() {
   smpi_init_fortran_types();
   if(smpi_init_sleep > 0)
-    simcall_process_sleep(smpi_init_sleep);
+    simgrid::s4u::this_actor::sleep_for(smpi_init_sleep);
 }
index 49e4ab1..18cdacb 100644 (file)
@@ -57,8 +57,7 @@ static void smpi_get_executable_global_size()
 {
   char buffer[PATH_MAX];
   char* full_name = realpath(xbt_binary_name, buffer);
-  if (full_name == nullptr)
-    xbt_die("Could not resolve binary file name");
+  xbt_assert(full_name != nullptr, "Could not resolve real path of binary file '%s'", xbt_binary_name);
 
   std::vector<simgrid::xbt::VmMap> map = simgrid::xbt::get_memory_map(getpid());
   for (auto i = map.begin(); i != map.end() ; ++i) {
@@ -75,11 +74,12 @@ static void smpi_get_executable_global_size()
       ++i;
       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) {
-        // Only count this region if it was not already present in the initial map.
-        auto found = std::find_if(begin(initial_vm_map), end(initial_vm_map),
-                                  [&i](const simgrid::xbt::VmMap& m) { return m.start_addr == i->start_addr; });
-        if (found == end(initial_vm_map))
-          smpi_data_exe_size = (char*)i->end_addr - smpi_data_exe_start;
+        // Only count the portion of this region not present in the initial map.
+        auto found = std::find_if(initial_vm_map.begin(), initial_vm_map.end(), [&i](const simgrid::xbt::VmMap& m) {
+          return i->start_addr <= m.start_addr && m.start_addr < i->end_addr;
+        });
+        auto end_addr      = (found == initial_vm_map.end() ? i->end_addr : found->start_addr);
+        smpi_data_exe_size = (char*)end_addr - smpi_data_exe_start;
       }
       return;
     }
@@ -107,26 +107,19 @@ static void* asan_safe_memcpy(void* dest, void* src, size_t n)
   return dest;
 }
 #else
-#define asan_safe_memcpy(dest, src, n) memcpy(dest, src, n)
+#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(simgrid::s4u::ActorPtr actor)
-{
-  if (smpi_loaded_page == actor->get_pid()) // no need to switch, we've already loaded the one we want
-    return;
-
-  // So the job:
-  smpi_really_switch_data_segment(actor);
-}
-
-/** Map a given SMPI privatization segment (make a SMPI process active)  even if SMPI thinks it is already active
+/** Map a given SMPI privatization segment (make a SMPI process active)
  *
  *  When doing a state restoration, the state of the restored variables  might not be consistent with the state of the
  *  virtual memory. In this case, we to change the data segment.
  */
-void smpi_really_switch_data_segment(simgrid::s4u::ActorPtr actor)
+void smpi_switch_data_segment(simgrid::s4u::ActorPtr actor)
 {
+  if (smpi_loaded_page == actor->get_pid()) // no need to switch, we've already loaded the one we want
+    return;
+
   if (smpi_data_exe_size == 0) // no need to switch
     return;
 
@@ -142,12 +135,6 @@ void smpi_really_switch_data_segment(simgrid::s4u::ActorPtr actor)
 #endif
 }
 
-int smpi_is_privatization_file(char* file)
-{
-  const std::string buffer_path("/dev/shm/my-buffer-");
-  return buffer_path.compare(0, std::string::npos, file, buffer_path.length()) == 0;
-}
-
 /**
  * @brief Makes a backup of the segment in memory that stores the global variables of a process.
  *        This backup is then used to initialize the global variables for every single
@@ -249,40 +236,39 @@ void smpi_destroy_global_memory_segments(){
 #endif
 }
 
-static int sendbuffer_size = 0;
-static char* sendbuffer    = nullptr;
-static int recvbuffer_size = 0;
-static char* recvbuffer    = nullptr;
+static std::vector<unsigned char> sendbuffer;
+static std::vector<unsigned char> recvbuffer;
 
 //allocate a single buffer for all sends, growing it if needed
-void* smpi_get_tmp_sendbuffer(int size)
+unsigned char* smpi_get_tmp_sendbuffer(size_t size)
 {
   if (not smpi_process()->replaying())
-    return xbt_malloc(size);
-  if (sendbuffer_size<size){
-    sendbuffer=static_cast<char*>(xbt_realloc(sendbuffer,size));
-    sendbuffer_size=size;
-  }
-  return sendbuffer;
+    return new unsigned char[size];
+  // FIXME: a resize() may invalidate a previous pointer. Maybe we need to handle a queue of buffers with a reference
+  // counter. The same holds for smpi_get_tmp_recvbuffer.
+  if (sendbuffer.size() < size)
+    sendbuffer.resize(size);
+  return sendbuffer.data();
 }
 
 //allocate a single buffer for all recv
-void* smpi_get_tmp_recvbuffer(int size){
+unsigned char* smpi_get_tmp_recvbuffer(size_t size)
+{
   if (not smpi_process()->replaying())
-    return xbt_malloc(size);
-  if (recvbuffer_size<size){
-    recvbuffer=static_cast<char*>(xbt_realloc(recvbuffer,size));
-    recvbuffer_size=size;
-  }
-  return recvbuffer;
+    return new unsigned char[size];
+  if (recvbuffer.size() < size)
+    recvbuffer.resize(size);
+  return recvbuffer.data();
 }
 
-void smpi_free_tmp_buffer(void* buf){
+void smpi_free_tmp_buffer(const unsigned char* buf)
+{
   if (not smpi_process()->replaying())
-    xbt_free(buf);
+    delete[] buf;
 }
 
-void smpi_free_replay_tmp_buffers(){
-  xbt_free(sendbuffer);
-  xbt_free(recvbuffer);
+void smpi_free_replay_tmp_buffers()
+{
+  std::vector<unsigned char>().swap(sendbuffer);
+  std::vector<unsigned char>().swap(recvbuffer);
 }
index 9d3aae3..0142abd 100644 (file)
@@ -165,6 +165,19 @@ void ComputeParser::parse(simgrid::xbt::ReplayAction& action, const std::string&
   flops = parse_double(action[2]);
 }
 
+void SleepParser::parse(simgrid::xbt::ReplayAction& action, const std::string&)
+{
+  CHECK_ACTION_PARAMS(action, 1, 0)
+  time = parse_double(action[2]);
+}
+
+void LocationParser::parse(simgrid::xbt::ReplayAction& action, const std::string&)
+{
+  CHECK_ACTION_PARAMS(action, 2, 0)
+  filename = std::string(action[2]);
+  line = std::stoi(action[3]);
+}
+
 void BcastArgParser::parse(simgrid::xbt::ReplayAction& action, const std::string&)
 {
   CHECK_ACTION_PARAMS(action, 1, 2)
@@ -477,9 +490,23 @@ void RecvAction::kernel(simgrid::xbt::ReplayAction&)
 
 void ComputeAction::kernel(simgrid::xbt::ReplayAction&)
 {
-  TRACE_smpi_computing_in(my_proc_id, args.flops);
-  smpi_execute_flops(args.flops);
-  TRACE_smpi_computing_out(my_proc_id);
+  if (simgrid::config::get_value<bool>("smpi/simulate-computation")) {
+    smpi_execute_flops(args.flops/smpi_adjust_comp_speed());
+  }
+}
+
+void SleepAction::kernel(simgrid::xbt::ReplayAction&)
+{
+  XBT_DEBUG("Sleep for: %lf secs", args.time);
+  int rank = simgrid::s4u::this_actor::get_pid();
+  TRACE_smpi_sleeping_in(rank, args.time);
+  simgrid::s4u::this_actor::sleep_for(args.time/smpi_adjust_comp_speed());
+  TRACE_smpi_sleeping_out(rank);
+}
+
+void LocationAction::kernel(simgrid::xbt::ReplayAction&)
+{
+  smpi_trace_set_call_location(args.filename.c_str(), args.line);
 }
 
 void TestAction::kernel(simgrid::xbt::ReplayAction&)
@@ -575,7 +602,7 @@ void ReduceAction::kernel(simgrid::xbt::ReplayAction&)
 
   Colls::reduce(send_buffer(args.comm_size * args.datatype1->size()),
       recv_buffer(args.comm_size * args.datatype1->size()), args.comm_size, args.datatype1, MPI_OP_NULL, args.root, MPI_COMM_WORLD);
-  smpi_execute_flops(args.comp_size);
+  private_execute_flops(args.comp_size);
 
   TRACE_smpi_comm_out(my_proc_id);
 }
@@ -587,7 +614,7 @@ void AllReduceAction::kernel(simgrid::xbt::ReplayAction&)
 
   Colls::allreduce(send_buffer(args.comm_size * args.datatype1->size()),
       recv_buffer(args.comm_size * args.datatype1->size()), args.comm_size, args.datatype1, MPI_OP_NULL, MPI_COMM_WORLD);
-  smpi_execute_flops(args.comp_size);
+  private_execute_flops(args.comp_size);
 
   TRACE_smpi_comm_out(my_proc_id);
 }
@@ -684,7 +711,7 @@ void ReduceScatterAction::kernel(simgrid::xbt::ReplayAction&)
       recv_buffer(args.recv_size_sum * args.datatype1->size()), args.recvcounts->data(),
       args.datatype1, MPI_OP_NULL, MPI_COMM_WORLD);
 
-  smpi_execute_flops(args.comp_size);
+  private_execute_flops(args.comp_size);
   TRACE_smpi_comm_out(my_proc_id);
 }
 
@@ -707,11 +734,12 @@ static std::unordered_map<aid_t, simgrid::smpi::replay::RequestStorage> storage;
 /** @brief Only initialize the replay, don't do it for real */
 void smpi_replay_init(const char* instance_id, int rank, double start_delay_flops)
 {
-  if (not smpi_process()->initializing()){
-    simgrid::s4u::Actor::self()->set_property("instance_id", instance_id);
-    simgrid::s4u::Actor::self()->set_property("rank", std::to_string(rank));
-    simgrid::smpi::ActorExt::init();
-  }
+  xbt_assert(not smpi_process()->initializing());
+
+  simgrid::s4u::Actor::self()->set_property("instance_id", instance_id);
+  simgrid::s4u::Actor::self()->set_property("rank", std::to_string(rank));
+  simgrid::smpi::ActorExt::init();
+
   smpi_process()->mark_as_initialized();
   smpi_process()->set_replaying(true);
 
@@ -747,11 +775,13 @@ void smpi_replay_init(const char* instance_id, int rank, double start_delay_flop
   xbt_replay_action_register("allgatherv", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::GatherVAction("allgatherv").execute(action); });
   xbt_replay_action_register("reducescatter", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::ReduceScatterAction().execute(action); });
   xbt_replay_action_register("compute", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::ComputeAction().execute(action); });
+  xbt_replay_action_register("sleep", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::SleepAction().execute(action); });
+  xbt_replay_action_register("location", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::LocationAction().execute(action); });
 
   //if we have a delayed start, sleep here.
   if (start_delay_flops > 0) {
     XBT_VERB("Delayed start for instance - Sleeping for %f flops ", start_delay_flops);
-    smpi_execute_flops(start_delay_flops);
+    private_execute_flops(start_delay_flops);
   } else {
     // Wait for the other actors to initialize also
     simgrid::s4u::this_actor::yield();
@@ -796,7 +826,6 @@ void smpi_replay_main(int rank, const char* trace_filename)
   smpi_process()->finalize();
 
   TRACE_smpi_comm_out(simgrid::s4u::this_actor::get_pid());
-  TRACE_smpi_finalize(simgrid::s4u::this_actor::get_pid());
 }
 
 /** @brief chain a replay initialization and a replay start */
index 77d7bfd..defbbba 100644 (file)
@@ -129,12 +129,13 @@ static void* shm_map(int fd, size_t size, shared_data_key_type* data) {
 
   void* mem = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
   if(mem == MAP_FAILED) {
-    xbt_die(
-        "Failed to map fd %d with size %zu: %s\n"
-        "If you are running a lot of ranks, you may be exceeding the amount of mappings allowed per process.\n"
-        "On Linux systems, change this value with sudo sysctl -w vm.max_map_count=newvalue (default value: 65536)\n"
-        "Please see http://simgrid.gforge.inria.fr/simgrid/latest/doc/html/options.html#options_virt for more info.",
-        fd, size, strerror(errno));
+    xbt_die("Failed to map fd %d with size %zu: %s\n"
+            "If you are running a lot of ranks, you may be exceeding the amount of mappings allowed per process.\n"
+            "On Linux systems, change this value with sudo sysctl -w vm.max_map_count=newvalue (default value: 65536)\n"
+            "Please see "
+            "https://simgrid.org/doc/latest/Configuring_SimGrid.html#configuring-the-user-code-virtualization for more "
+            "information.",
+            fd, size, strerror(errno));
   }
   snprintf(loc, PTR_STRLEN, "%p", mem);
   meta.size = size;
@@ -281,7 +282,7 @@ void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int
       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 "
-                             "size of the mapped file using --cfg=smpi/shared-malloc-blocksize=newvalue (default 1048576) ? "
+                             "size of the mapped file using --cfg=smpi/shared-malloc-blocksize:newvalue (default 1048576) ? "
                              "You can also try using  the sysctl vm.max_map_count. "
                              "If you are using huge pages, check that you have at least one huge page (/proc/sys/vm/nr_hugepages) "
                              "and that the directory you are passing is mounted correctly (mount /path/to/huge -t hugetlbfs -o rw,mode=0777).",
@@ -295,7 +296,7 @@ void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int
       void* res = mmap(pos, low_page_stop_offset-low_page_start_offset, PROT_READ | PROT_WRITE, mmap_base_flag, // not a full huge page
                        smpi_shared_malloc_bogusfile, 0);
       xbt_assert(res == pos, "Could not map folded virtual memory (%s). Do you perhaps need to increase the "
-                             "size of the mapped file using --cfg=smpi/shared-malloc-blocksize=newvalue (default 1048576) ?"
+                             "size of the mapped file using --cfg=smpi/shared-malloc-blocksize:newvalue (default 1048576) ?"
                              "You can also try using  the sysctl vm.max_map_count",
                  strerror(errno));
     }
@@ -307,7 +308,7 @@ void* smpi_shared_malloc_partial(size_t size, size_t* shared_block_offsets, int
         void* res = mmap(pos, high_page_stop_offset-stop_block_offset, PROT_READ | PROT_WRITE, mmap_base_flag, // not a full huge page
                          smpi_shared_malloc_bogusfile, 0);
         xbt_assert(res == pos, "Could not map folded virtual memory (%s). Do you perhaps need to increase the "
-                               "size of the mapped file using --cfg=smpi/shared-malloc-blocksize=newvalue (default 1048576) ?"
+                               "size of the mapped file using --cfg=smpi/shared-malloc-blocksize:newvalue (default 1048576) ?"
                                "You can also try using  the sysctl vm.max_map_count",
                    strerror(errno));
       }
@@ -438,9 +439,9 @@ void smpi_shared_free(void *ptr)
       close(data->fd);
       allocs.erase(allocs.find(meta->second.data->first));
       allocs_metadata.erase(ptr);
-      XBT_DEBUG("Shared free - with removal - of %p", ptr);
+      XBT_DEBUG("Shared free - Local - with removal - of %p", ptr);
     } else {
-      XBT_DEBUG("Shared free - no removal - of %p, count = %d", ptr, data->count);
+      XBT_DEBUG("Shared free - Local - no removal - of %p, count = %d", ptr, data->count);
     }
 
   } else if (smpi_cfg_shared_malloc == SharedMallocType::GLOBAL) {
@@ -450,7 +451,7 @@ void smpi_shared_free(void *ptr)
       if(meta->second.data->second.count==0)
         delete meta->second.data;
     }
-
+    XBT_DEBUG("Shared free - Global - of %p", ptr);
     munmap(ptr, meta->second.size);
   } else {
     XBT_DEBUG("Classic deallocation of %p", ptr);
diff --git a/src/smpi/internals/smpi_static_variables.cpp b/src/smpi/internals/smpi_static_variables.cpp
deleted file mode 100644 (file)
index c7edae0..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (c) 2011-2019. The SimGrid Team. All rights reserved.          */
-
-/* This program is 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>
-
-struct s_smpi_static_t {
-  void *ptr;
-  void_f_pvoid_t free_fn;
-};
-
-/**
- * @brief Holds a reference to all static variables that were registered
- *        via smpi_register_static(). This helps to free them when
- *        SMPI shuts down.
- */
-static std::stack<s_smpi_static_t> registered_static_variables_stack;
-
-void smpi_register_static(void* arg, void_f_pvoid_t free_fn) {
-  s_smpi_static_t elm { arg, free_fn };
-  registered_static_variables_stack.push(elm);
-}
-
-void smpi_free_static() {
-  while (not registered_static_variables_stack.empty()) {
-    s_smpi_static_t elm = registered_static_variables_stack.top();
-    elm.free_fn(elm.ptr);
-    registered_static_variables_stack.pop();
-  }
-}
index ddde90d..7e029ad 100644 (file)
@@ -8,6 +8,7 @@
 #include "xbt/log.h"
 #include "xbt/sysdep.h"
 #include <boost/tokenizer.hpp>
+#include "src/surf/xml/platf_private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_utils, smpi, "Logging specific to SMPI (utils)");
 
@@ -42,14 +43,14 @@ std::vector<s_smpi_factor_t> parse_factor(const std::string& smpi_coef_string)
       if (factor_iter == factor_values.begin()) { /* first element */
         try {
           fact.factor = std::stoi(*factor_iter);
-        } catch (std::invalid_argument& ia) {
+        } catch (const std::invalid_argument&) {
           throw std::invalid_argument(std::string("Invalid factor in chunk ") + std::to_string(smpi_factor.size() + 1) +
                                       ": " + *factor_iter);
         }
       } else {
         try {
-          fact.values.push_back(std::stod(*factor_iter));
-        } catch (std::invalid_argument& ia) {
+          fact.values.push_back(surf_parse_get_time((*factor_iter).c_str(), "smpi factor", ""));
+        } catch (const std::invalid_argument&) {
           throw std::invalid_argument(std::string("Invalid factor value ") + std::to_string(iteration) + " in chunk " +
                                       std::to_string(smpi_factor.size() + 1) + ": " + *factor_iter);
         }
index b2ca92d..ed24882 100644 (file)
@@ -8,6 +8,7 @@
 #include "smpi_datatype.hpp"
 #include "smpi_request.hpp"
 #include "smpi_win.hpp"
+#include "smpi_info.hpp"
 #include "src/smpi/include/smpi_actor.hpp"
 #include "src/surf/HostImpl.hpp"
 
@@ -27,7 +28,7 @@ namespace smpi{
 std::unordered_map<int, smpi_key_elem> Comm::keyvals_;
 int Comm::keyval_id_=0;
 
-Comm::Comm(MPI_Group group, MPI_Topology topo, int smp) : group_(group), topo_(topo),is_smp_comm_(smp)
+Comm::Comm(MPI_Group group, MPI_Topology topo, int smp, int in_id) : group_(group), topo_(topo),is_smp_comm_(smp), id_(in_id)
 {
   refcount_        = 1;
   topoType_        = MPI_INVALID_TOPO;
@@ -37,6 +38,21 @@ Comm::Comm(MPI_Group group, MPI_Topology topo, int smp) : group_(group), topo_(t
   non_uniform_map_ = nullptr;
   leaders_map_     = nullptr;
   is_blocked_      = 0;
+  info_            = MPI_INFO_NULL;
+  errhandler_      = MPI_ERRORS_ARE_FATAL;
+  //First creation of comm is done before SIMIX_run, so only do comms for others
+  if(in_id==MPI_UNDEFINED && smp==0 && this->rank()!=MPI_UNDEFINED ){
+    int id;
+    if(this->rank()==0){
+      static int global_id_ = 0;
+      id=global_id_;
+      global_id_++;
+    }
+    Colls::bcast(&id, 1, MPI_INT, 0, this);
+    XBT_DEBUG("Communicator %p has id %d", this, id);
+    id_=id;//only set here, as we don't want to change it in the middle of the bcast
+    Colls::barrier(this);
+  }
 }
 
 void Comm::destroy(Comm* comm)
@@ -88,6 +104,25 @@ int Comm::dup(MPI_Comm* newcomm){
       }
     }
   }
+  //duplicate info if present
+  if(info_!=MPI_INFO_NULL)
+    (*newcomm)->info_ = new simgrid::smpi::Info(info_);
+  //duplicate errhandler
+  (*newcomm)->set_errhandler(errhandler_);
+  return ret;
+}
+
+int Comm::dup_with_info(MPI_Info info, MPI_Comm* newcomm){
+  int ret = dup(newcomm);
+  if(ret != MPI_SUCCESS)
+    return ret;
+  if((*newcomm)->info_!=MPI_INFO_NULL){
+    simgrid::smpi::Info::unref((*newcomm)->info_);
+    (*newcomm)->info_=MPI_INFO_NULL;
+  }
+  if(info != MPI_INFO_NULL){
+    (*newcomm)->info_=info;
+  }
   return ret;
 }
 
@@ -112,20 +147,38 @@ int Comm::rank()
   return group_->rank(s4u::Actor::self());
 }
 
+int Comm::id()
+{
+  return id_;
+}
+
 void Comm::get_name (char* name, int* len)
 {
   if (this == MPI_COMM_UNINITIALIZED){
     smpi_process()->comm_world()->get_name(name, len);
     return;
   }
-  if(this == MPI_COMM_WORLD) {
-    strncpy(name, "WORLD", 6);
-    *len = 5;
+  if(this == MPI_COMM_WORLD && name_.empty()) {
+    strncpy(name, "MPI_COMM_WORLD", 15);
+    *len = 14;
+  } else if(this == MPI_COMM_SELF && name_.empty()) {
+    strncpy(name, "MPI_COMM_SELF", 14);
+    *len = 13;
   } else {
-    *len = snprintf(name, MPI_MAX_NAME_STRING, "%p", this);
+    *len = snprintf(name, MPI_MAX_NAME_STRING+1, "%s", name_.c_str());
   }
 }
 
+void Comm::set_name (const char* name)
+{
+  if (this == MPI_COMM_UNINITIALIZED){
+    smpi_process()->comm_world()->set_name(name);
+    return;
+  }
+  name_.replace (0, MPI_MAX_NAME_STRING+1, name);
+}
+
+
 void Comm::set_leaders_comm(MPI_Comm leaders){
   if (this == MPI_COMM_UNINITIALIZED){
     smpi_process()->comm_world()->set_leaders_comm(leaders);
@@ -180,7 +233,7 @@ MPI_Comm Comm::split(int color, int key)
 {
   if (this == MPI_COMM_UNINITIALIZED)
     return smpi_process()->comm_world()->split(color, key);
-  int system_tag = 123;
+  int system_tag = -123;
   int* recvbuf;
 
   MPI_Group group_root = nullptr;
@@ -222,7 +275,7 @@ MPI_Comm Comm::split(int color, int key)
           group_root = group_out; /* Save root's group */
         }
         for (unsigned j = 0; j < rankmap.size(); j++) {
-          s4u::ActorPtr actor = group->actor(rankmap[j].second);
+          s4u::Actor* actor = group->actor(rankmap[j].second);
           group_out->set_mapping(actor, j);
         }
         MPI_Request* requests = xbt_new(MPI_Request, rankmap.size());
@@ -285,9 +338,35 @@ void Comm::unref(Comm* comm){
   }
 }
 
+MPI_Comm Comm::find_intra_comm(int * leader){
+  //get the indices of all processes sharing the same simix host
+  auto& process_list      = sg_host_self()->pimpl_->process_list_;
+  int intra_comm_size     = 0;
+  int min_index           = INT_MAX; // the minimum index will be the leader
+  for (auto& actor : process_list) {
+    int index = actor.get_pid();
+    if (this->group()->rank(actor.ciface()) != MPI_UNDEFINED) { // Is this process in the current group?
+      intra_comm_size++;
+      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);
+  int i = 0;
+  for (auto& actor : process_list) {
+    if (this->group()->rank(actor.ciface()) != MPI_UNDEFINED) {
+      group_intra->set_mapping(actor.ciface(), i);
+      i++;
+    }
+  }
+  *leader=min_index;
+  return new  Comm(group_intra, nullptr, 1);
+}
+
 void Comm::init_smp(){
   int leader = -1;
-
+  int i = 0;
   if (this == MPI_COMM_UNINITIALIZED)
     smpi_process()->comm_world()->init_smp();
 
@@ -306,30 +385,8 @@ void Comm::init_smp(){
     smpi_switch_data_segment(s4u::Actor::self());
   }
   //identify neighbours in comm
-  //get the indices of all processes sharing the same simix host
-  auto& process_list      = sg_host_self()->pimpl_->process_list_;
-  int intra_comm_size     = 0;
-  int min_index           = INT_MAX; // the minimum index will be the leader
-  for (auto& actor : process_list) {
-    int index = actor.get_pid();
-    if (this->group()->rank(actor.iface()) != MPI_UNDEFINED) { // Is this process in the current group?
-      intra_comm_size++;
-      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);
-  int i = 0;
-  for (auto& actor : process_list) {
-    if (this->group()->rank(actor.iface()) != MPI_UNDEFINED) {
-      group_intra->set_mapping(actor.iface(), i);
-      i++;
-    }
-  }
+  MPI_Comm comm_intra = find_intra_comm(&leader);
 
-  MPI_Comm comm_intra = new  Comm(group_intra, nullptr, 1);
-  leader=min_index;
 
   int* leaders_map = new int[comm_size];
   int* leader_list = new int[comm_size];
@@ -369,7 +426,7 @@ void Comm::init_smp(){
   if(MPI_COMM_WORLD!=MPI_COMM_UNINITIALIZED && this!=MPI_COMM_WORLD){
     //create leader_communicator
     for (i=0; i< leader_group_size;i++)
-      leaders_group->set_mapping(s4u::Actor::by_pid(leader_list[i]), i);
+      leaders_group->set_mapping(s4u::Actor::by_pid(leader_list[i]).get(), i);
     leader_comm = new  Comm(leaders_group, nullptr,1);
     this->set_leaders_comm(leader_comm);
     this->set_intra_comm(comm_intra);
@@ -377,7 +434,7 @@ void Comm::init_smp(){
     // create intracommunicator
   }else{
     for (i=0; i< leader_group_size;i++)
-      leaders_group->set_mapping(s4u::Actor::by_pid(leader_list[i]), i);
+      leaders_group->set_mapping(s4u::Actor::by_pid(leader_list[i]).get(), i);
 
     if(this->get_leaders_comm()==MPI_COMM_NULL){
       leader_comm = new  Comm(leaders_group, nullptr,1);
@@ -451,7 +508,7 @@ MPI_Comm Comm::f2c(int id) {
   } else if(F2C::f2c_lookup() != nullptr && id >= 0) {
     char key[KEY_SIZE];
     const auto& lookup = F2C::f2c_lookup();
-    auto comm          = lookup->find(get_key_id(key, id));
+    auto comm          = lookup->find(get_key(key, id));
     return comm == lookup->end() ? MPI_COMM_NULL : static_cast<MPI_Comm>(comm->second);
   } else {
     return MPI_COMM_NULL;
@@ -460,17 +517,7 @@ MPI_Comm Comm::f2c(int id) {
 
 void Comm::free_f(int id) {
   char key[KEY_SIZE];
-  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(new std::unordered_map<std::string, F2C*>);
-  }
-  char key[KEY_SIZE];
-  (*(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;
+  F2C::f2c_lookup()->erase(get_key(key, id));
 }
 
 void Comm::add_rma_win(MPI_Win win){
@@ -490,15 +537,43 @@ void Comm::finish_rma_calls(){
   }
 }
 
-MPI_Comm Comm::split_type(int type, int key, MPI_Info info)
+MPI_Info Comm::info(){
+  if(info_== MPI_INFO_NULL)
+    info_ = new Info();
+  info_->ref();
+  return info_;
+}
+
+void Comm::set_info(MPI_Info info){
+  if(info_!= MPI_INFO_NULL)
+    info->ref();
+  info_=info;
+}
+
+MPI_Errhandler Comm::errhandler(){
+  return errhandler_;
+}
+
+void Comm::set_errhandler(MPI_Errhandler errhandler){
+  errhandler_=errhandler;
+  if(errhandler_!= MPI_ERRHANDLER_NULL)
+    errhandler->ref();
+}
+
+MPI_Comm Comm::split_type(int type, int /*key*/, MPI_Info)
 {
-  if(type != MPI_COMM_TYPE_SHARED){
+  //MPI_UNDEFINED can be given to some nodes... but we need them to still perform the smp part which is collective
+  if(type != MPI_COMM_TYPE_SHARED && type != MPI_UNDEFINED){
+    return MPI_COMM_NULL;
+  }
+  int leader=0;
+  MPI_Comm res= this->find_intra_comm(&leader);
+  if(type != MPI_UNDEFINED)
+    return res;
+  else{
+    Comm::destroy(res);
     return MPI_COMM_NULL;
   }
-  this->init_smp();
-  this->ref();
-  this->get_intra_comm()->ref();
-  return this->get_intra_comm();
 }
 
 } // namespace smpi
index 8d7a457..d4257b1 100644 (file)
@@ -18,20 +18,20 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_datatype, smpi, "Logging specific to SMPI (
 static std::unordered_map<std::string, simgrid::smpi::Datatype*> id2type_lookup;
 
 #define CREATE_MPI_DATATYPE(name, id, type)                                                                            \
-  static simgrid::smpi::Datatype mpi_##name((char*)#name, id, sizeof(type), /* size */                                 \
-                                            0,                              /* lb */                                   \
-                                            sizeof(type),                   /* ub = lb + size */                       \
-                                            DT_FLAG_BASIC                   /* flags */                                \
-                                            );                                                                         \
-  const MPI_Datatype name = &mpi_##name;
+  static simgrid::smpi::Datatype _XBT_CONCAT(mpi_, name)((char*)_XBT_STRINGIFY(name), (id), sizeof(type), /* size */   \
+                                                         0,                                               /* lb */     \
+                                                         sizeof(type), /* ub = lb + size */                            \
+                                                         DT_FLAG_BASIC /* flags */                                     \
+                                                         );                                                            \
+  const MPI_Datatype name = &_XBT_CONCAT(mpi_, name);
 
 #define CREATE_MPI_DATATYPE_NULL(name, id)                                                                             \
-  static simgrid::smpi::Datatype mpi_##name((char*)#name, id, 0, /* size */                                            \
-                                            0,                   /* lb */                                              \
-                                            0,                   /* ub = lb + size */                                  \
-                                            DT_FLAG_BASIC        /* flags */                                           \
-                                            );                                                                         \
-  const MPI_Datatype name = &mpi_##name;
+  static simgrid::smpi::Datatype _XBT_CONCAT(mpi_, name)((char*)_XBT_STRINGIFY(name), (id), 0, /* size */              \
+                                                         0,                                    /* lb */                \
+                                                         0,                                    /* ub = lb + size */    \
+                                                         DT_FLAG_BASIC                         /* flags */             \
+                                                         );                                                            \
+  const MPI_Datatype name = &_XBT_CONCAT(mpi_, name);
 
 // Predefined data types
 CREATE_MPI_DATATYPE(MPI_CHAR, 2, char);
@@ -79,9 +79,9 @@ CREATE_MPI_DATATYPE(MPI_REAL4, 39, float);
 CREATE_MPI_DATATYPE(MPI_REAL8, 40, double);
 CREATE_MPI_DATATYPE(MPI_REAL16, 41, long double);
 CREATE_MPI_DATATYPE_NULL(MPI_DATATYPE_NULL, -1);
-CREATE_MPI_DATATYPE_NULL(MPI_COMPLEX8, 42);
-CREATE_MPI_DATATYPE_NULL(MPI_COMPLEX16, 43);
-CREATE_MPI_DATATYPE_NULL(MPI_COMPLEX32, 44);
+CREATE_MPI_DATATYPE(MPI_COMPLEX8, 42, float_float);
+CREATE_MPI_DATATYPE(MPI_COMPLEX16, 43, double_double);
+CREATE_MPI_DATATYPE(MPI_COMPLEX32, 44, double_double);
 CREATE_MPI_DATATYPE(MPI_INTEGER1, 45, int);
 CREATE_MPI_DATATYPE(MPI_INTEGER2, 46, int16_t);
 CREATE_MPI_DATATYPE(MPI_INTEGER4, 47, int32_t);
@@ -95,6 +95,8 @@ CREATE_MPI_DATATYPE_NULL(MPI_LB, 52);
 CREATE_MPI_DATATYPE(MPI_PACKED, 53, char);
 // Internal use only
 CREATE_MPI_DATATYPE(MPI_PTR, 54, void*);
+CREATE_MPI_DATATYPE(MPI_COUNT, 55, long long);
+
 
 namespace simgrid{
 namespace smpi{
@@ -127,8 +129,6 @@ Datatype::Datatype(Datatype *datatype, int* ret) : name_(nullptr), size_(datatyp
 {
   flags_ &= ~DT_FLAG_PREDEFINED;
   *ret = MPI_SUCCESS;
-  if(datatype->name_)
-    name_ = xbt_strdup(datatype->name_);
     
   if (not datatype->attributes()->empty()) {
     int flag=0;
@@ -238,33 +238,39 @@ int Datatype::extent(MPI_Aint * lb, MPI_Aint * extent){
 }
 
 void Datatype::get_name(char* name, int* length){
-  *length = strlen(name_);
-  strncpy(name, name_, *length+1);
+  if(name_!=nullptr){
+    *length = strlen(name_);
+    strncpy(name, name_, *length+1);
+  }else{
+    *length = 0;
+  }
 }
 
-void Datatype::set_name(char* name){
+void Datatype::set_name(const char* name){
   if(name_!=nullptr &&  (flags_ & DT_FLAG_PREDEFINED) == 0)
     xbt_free(name_);
   name_ = xbt_strdup(name);
 }
 
-int Datatype::pack(void* inbuf, int incount, void* outbuf, int outcount, int* position,MPI_Comm comm){
+int Datatype::pack(const void* inbuf, int incount, void* outbuf, int outcount, int* position, MPI_Comm)
+{
   if (outcount - *position < incount*static_cast<int>(size_))
-    return MPI_ERR_BUFFER;
+    return MPI_ERR_OTHER;
   Datatype::copy(inbuf, incount, this, static_cast<char*>(outbuf) + *position, outcount, MPI_CHAR);
   *position += incount * size_;
   return MPI_SUCCESS;
 }
 
-int Datatype::unpack(void* inbuf, int insize, int* position, void* outbuf, int outcount,MPI_Comm comm){
+int Datatype::unpack(const void* inbuf, int insize, int* position, void* outbuf, int outcount, MPI_Comm)
+{
   if (outcount*static_cast<int>(size_)> insize)
-    return MPI_ERR_BUFFER;
-  Datatype::copy(static_cast<char*>(inbuf) + *position, insize, MPI_CHAR, outbuf, outcount, this);
+    return MPI_ERR_OTHER;
+  Datatype::copy(static_cast<const char*>(inbuf) + *position, insize, MPI_CHAR, outbuf, outcount, this);
   *position += outcount * size_;
   return MPI_SUCCESS;
 }
 
-int Datatype::copy(void *sendbuf, int sendcount, MPI_Datatype sendtype,
+int Datatype::copy(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
                        void *recvbuf, int recvcount, MPI_Datatype recvtype){
 
 // FIXME Handle the case of a partial shared malloc.
@@ -277,7 +283,7 @@ int Datatype::copy(void *sendbuf, int sendcount, MPI_Datatype sendtype,
     sendcount *= sendtype->size();
     recvcount *= recvtype->size();
     int count = sendcount < recvcount ? sendcount : recvcount;
-
+    XBT_DEBUG("Copying %d bytes from %p to %p", count, sendbuf, recvbuf);
     if (not(sendtype->flags() & DT_FLAG_DERIVED) && not(recvtype->flags() & DT_FLAG_DERIVED)) {
       if (not smpi_process()->replaying())
         memcpy(recvbuf, sendbuf, count);
@@ -300,15 +306,15 @@ int Datatype::copy(void *sendbuf, int sendcount, MPI_Datatype sendtype,
 }
 
 //Default serialization method : memcpy.
-void Datatype::serialize(void* noncontiguous_buf, void* contiguous_buf, int count)
+void Datatype::serialize(const 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_;
+  const char* noncontiguous_buf_char = static_cast<const char*>(noncontiguous_buf)+lb_;
   memcpy(contiguous_buf_char, noncontiguous_buf_char, count*size_);
 }
 
-void Datatype::unserialize( void* contiguous_buf, void *noncontiguous_buf, int count, MPI_Op op){
-  char* contiguous_buf_char = static_cast<char*>(contiguous_buf);
+void Datatype::unserialize(const void* contiguous_buf, void *noncontiguous_buf, int count, MPI_Op op){
+  const char* contiguous_buf_char = static_cast<const char*>(contiguous_buf);
   char* noncontiguous_buf_char = static_cast<char*>(noncontiguous_buf)+lb_;
   int n=count;
   if(op!=MPI_OP_NULL)
@@ -376,7 +382,7 @@ int Datatype::create_hvector(int count, int block_length, MPI_Aint stride, MPI_D
   return retval;
 }
 
-int Datatype::create_indexed(int count, int* block_lengths, int* indices, MPI_Datatype old_type, MPI_Datatype* new_type){
+int Datatype::create_indexed(int count, const int* block_lengths, const int* indices, MPI_Datatype old_type, MPI_Datatype* new_type){
   int size = 0;
   bool contiguous=true;
   MPI_Aint lb = 0;
@@ -411,7 +417,7 @@ int Datatype::create_indexed(int count, int* block_lengths, int* indices, MPI_Da
   return MPI_SUCCESS;
 }
 
-int Datatype::create_hindexed(int count, int* block_lengths, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* new_type){
+int Datatype::create_hindexed(int count, const int* block_lengths, const MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* new_type){
   int size = 0;
   bool contiguous=true;
   MPI_Aint lb = 0;
@@ -445,7 +451,7 @@ int Datatype::create_hindexed(int count, int* block_lengths, MPI_Aint* indices,
   return MPI_SUCCESS;
 }
 
-int Datatype::create_struct(int count, int* block_lengths, MPI_Aint* indices, MPI_Datatype* old_types, MPI_Datatype* new_type){
+int Datatype::create_struct(int count, const int* block_lengths, const MPI_Aint* indices, const MPI_Datatype* old_types, MPI_Datatype* new_type){
   size_t size = 0;
   bool contiguous=true;
   size = 0;
@@ -490,8 +496,8 @@ int Datatype::create_struct(int count, int* block_lengths, MPI_Aint* indices, MP
   return MPI_SUCCESS;
 }
 
-int Datatype::create_subarray(int ndims, int* array_of_sizes,
-                             int* array_of_subsizes, int* array_of_starts,
+int Datatype::create_subarray(int ndims, const int* array_of_sizes,
+                             const int* array_of_subsizes, const int* array_of_starts,
                              int order, MPI_Datatype oldtype, MPI_Datatype *newtype){
   MPI_Datatype tmp;
 
index ba6c632..9b1140d 100644 (file)
@@ -24,16 +24,16 @@ Type_Contiguous::~Type_Contiguous()
   Datatype::unref(old_type_);
 }
 
-void Type_Contiguous::serialize(void* noncontiguous_buf, void* contiguous_buf, int count)
+void Type_Contiguous::serialize(const 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();
+  const char* noncontiguous_buf_char = static_cast<const 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(const void* contiguous_buf, void* noncontiguous_buf, int count, MPI_Op op)
 {
-  char* contiguous_buf_char = static_cast<char*>(contiguous_buf);
+  const char* contiguous_buf_char = static_cast<const char*>(contiguous_buf);
   char* noncontiguous_buf_char = static_cast<char*>(noncontiguous_buf)+lb();
   int n= count*block_count_;
   if(op!=MPI_OP_NULL)
@@ -47,10 +47,10 @@ Type_Hvector::~Type_Hvector(){
   Datatype::unref(old_type_);
 }
 
-void Type_Hvector::serialize( void* noncontiguous_buf, void *contiguous_buf,
+void Type_Hvector::serialize(const 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);
+  const char* noncontiguous_buf_char = static_cast<const char*>(noncontiguous_buf);
 
   for (int i = 0; i < block_count_ * count; i++) {
     if (not(old_type_->flags() & DT_FLAG_DERIVED))
@@ -66,9 +66,9 @@ void Type_Hvector::serialize( void* noncontiguous_buf, void *contiguous_buf,
   }
 }
 
-void Type_Hvector::unserialize( void* contiguous_buf, void *noncontiguous_buf,
+void Type_Hvector::unserialize(const void* contiguous_buf, void *noncontiguous_buf,
                               int count, MPI_Op op){
-  char* contiguous_buf_char = static_cast<char*>(contiguous_buf);
+  const char* contiguous_buf_char = static_cast<const char*>(contiguous_buf);
   char* noncontiguous_buf_char = static_cast<char*>(noncontiguous_buf);
 
   for (int i = 0; i < block_count_ * count; i++) {
@@ -91,8 +91,8 @@ Type_Vector::Type_Vector(int size, MPI_Aint lb, MPI_Aint ub, int flags, int coun
 {
 }
 
-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)
+Type_Hindexed::Type_Hindexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int count, const int* block_lengths,
+                             const MPI_Aint* block_indices, MPI_Datatype old_type)
     : Datatype(size, lb, ub, flags), block_count_(count), old_type_(old_type)
 {
   old_type_->ref();
@@ -104,8 +104,8 @@ Type_Hindexed::Type_Hindexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int
   }
 }
 
-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)
+Type_Hindexed::Type_Hindexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int count, const int* block_lengths,
+                             const 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();
@@ -126,10 +126,11 @@ Type_Hindexed::~Type_Hindexed()
   }
 }
 
-void Type_Hindexed::serialize( void* noncontiguous_buf, void *contiguous_buf,
+void Type_Hindexed::serialize(const 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];
+  const char* noncontiguous_buf_iter = static_cast<const char*>(noncontiguous_buf);
+  const char* noncontiguous_buf_char = noncontiguous_buf_iter + block_indices_[0];
   for (int j = 0; j < count; j++) {
     for (int i = 0; i < block_count_; i++) {
       if (not(old_type_->flags() & DT_FLAG_DERIVED))
@@ -139,17 +140,17 @@ void Type_Hindexed::serialize( void* noncontiguous_buf, void *contiguous_buf,
 
       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];
+        noncontiguous_buf_char = noncontiguous_buf_iter + block_indices_[i+1];
       else
         noncontiguous_buf_char += block_lengths_[i]*old_type_->get_extent();
     }
-    noncontiguous_buf=static_cast<void*>(noncontiguous_buf_char);
+    noncontiguous_buf_iter=noncontiguous_buf_char;
   }
 }
 
-void Type_Hindexed::unserialize( void* contiguous_buf, void *noncontiguous_buf,
+void Type_Hindexed::unserialize(const void* contiguous_buf, void *noncontiguous_buf,
                           int count, MPI_Op op){
-  char* contiguous_buf_char = static_cast<char*>(contiguous_buf);
+  const char* contiguous_buf_char = static_cast<const char*>(contiguous_buf);
   char* noncontiguous_buf_char = static_cast<char*>(noncontiguous_buf)+ block_indices_[0];
   for (int j = 0; j < count; j++) {
     for (int i = 0; i < block_count_; i++) {
@@ -170,13 +171,13 @@ 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_Indexed::Type_Indexed(int size, MPI_Aint lb, MPI_Aint ub, int flags, int count, const int* block_lengths,
+                           const 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){
+Type_Struct::Type_Struct(int size,MPI_Aint lb, MPI_Aint ub, int flags, int count, const int* block_lengths, const MPI_Aint* block_indices, const MPI_Datatype* old_types): Datatype(size, lb, ub, flags), block_count_(count){
   block_lengths_= new int[count];
   block_indices_= new MPI_Aint[count];
   old_types_=  new MPI_Datatype[count];
@@ -200,10 +201,11 @@ Type_Struct::~Type_Struct(){
 }
 
 
-void Type_Struct::serialize( void* noncontiguous_buf, void *contiguous_buf,
+void Type_Struct::serialize(const 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];
+  const char* noncontiguous_buf_iter = static_cast<const char*>(noncontiguous_buf);
+  const char* noncontiguous_buf_char = noncontiguous_buf_iter + block_indices_[0];
   for (int j = 0; j < count; j++) {
     for (int i = 0; i < block_count_; i++) {
       if (not(old_types_[i]->flags() & DT_FLAG_DERIVED))
@@ -214,17 +216,17 @@ void Type_Struct::serialize( void* noncontiguous_buf, void *contiguous_buf,
 
       contiguous_buf_char += block_lengths_[i]*old_types_[i]->size();
       if (i<block_count_-1)
-        noncontiguous_buf_char = static_cast<char*>(noncontiguous_buf) + block_indices_[i+1];
+        noncontiguous_buf_char = noncontiguous_buf_iter + block_indices_[i+1];
       else //let's hope this is MPI_UB ?
         noncontiguous_buf_char += block_lengths_[i]*old_types_[i]->get_extent();
     }
-    noncontiguous_buf=static_cast<void*>(noncontiguous_buf_char);
+    noncontiguous_buf_iter=noncontiguous_buf_char;
   }
 }
 
-void Type_Struct::unserialize( void* contiguous_buf, void *noncontiguous_buf,
+void Type_Struct::unserialize(const void* contiguous_buf, void *noncontiguous_buf,
                               int count, MPI_Op op){
-  char* contiguous_buf_char = static_cast<char*>(contiguous_buf);
+  const char* contiguous_buf_char = static_cast<const char*>(contiguous_buf);
   char* noncontiguous_buf_char = static_cast<char*>(noncontiguous_buf)+ block_indices_[0];
   for (int j = 0; j < count; j++) {
     for (int i = 0; i < block_count_; i++) {
diff --git a/src/smpi/mpi/smpi_errhandler.cpp b/src/smpi/mpi/smpi_errhandler.cpp
new file mode 100644 (file)
index 0000000..43df91e
--- /dev/null
@@ -0,0 +1,53 @@
+/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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_errhandler.hpp"
+#include "private.hpp"
+
+#include <cstdio>
+
+simgrid::smpi::Errhandler mpi_MPI_ERRORS_RETURN;
+MPI_Errhandler MPI_ERRORS_RETURN=&mpi_MPI_ERRORS_RETURN;
+simgrid::smpi::Errhandler mpi_MPI_ERRORS_ARE_FATAL;
+MPI_Errhandler MPI_ERRORS_ARE_FATAL=&mpi_MPI_ERRORS_ARE_FATAL;
+
+namespace simgrid{
+namespace smpi{
+
+MPI_Errhandler Errhandler::f2c(int id) {
+  if(F2C::f2c_lookup() != nullptr && id >= 0) {
+    char key[KEY_SIZE];
+    return static_cast<MPI_Errhandler>(F2C::f2c_lookup()->at(get_key(key, id)));
+  } else {
+    return static_cast<MPI_Errhandler>(MPI_ERRHANDLER_NULL);
+  }
+}
+
+void Errhandler::call(MPI_Comm comm, int errorcode){
+  comm_func_(&comm, &errorcode);
+}
+
+void Errhandler::call(MPI_Win win, int errorcode){
+  win_func_(&win, &errorcode);
+}
+
+void Errhandler::call(MPI_File file, int errorcode){
+  file_func_(&file, &errorcode);
+}
+
+void Errhandler::ref()
+{
+  refcount_++;
+}
+
+void Errhandler::unref(Errhandler* errhandler){
+  errhandler->refcount_--;
+  if(errhandler->refcount_==0){
+    delete errhandler;
+  }
+}
+
+}
+}
index 93510ae..5fd2657 100644 (file)
@@ -9,6 +9,11 @@
 
 #include <cstdio>
 
+int mpi_in_place_;
+int mpi_bottom_;
+int mpi_status_ignore_;
+int mpi_statuses_ignore_;
+
 namespace simgrid{
 namespace smpi{
 
@@ -33,13 +38,13 @@ int F2C::f2c_id(){
   return f2c_id_;
 };
 
-char* F2C::get_key(char* key, int id) {
-  std::snprintf(key, KEY_SIZE, "%x", static_cast<unsigned>(id));
+char* F2C::get_my_key(char* key) {
+  std::snprintf(key, KEY_SIZE, "%d", my_f2c_id_);
   return key;
 }
 
-char* F2C::get_key_id(char* key, int id) {
-  std::snprintf(key, KEY_SIZE, "%x_%ld", static_cast<unsigned>(id), simgrid::s4u::this_actor::get_pid());
+char* F2C::get_key(char* key, int id) {
+  std::snprintf(key, KEY_SIZE, "%d", id);
   return key;
 }
 
@@ -55,7 +60,7 @@ std::unordered_map<std::string, F2C*>* F2C::lookup()
 void F2C::free_f(int id)
 {
   char key[KEY_SIZE];
-  f2c_lookup_->erase(get_key(key, id));
+  f2c_lookup_->erase(get_key(key,id));
 }
 
 int F2C::add_f()
@@ -64,9 +69,10 @@ int F2C::add_f()
     f2c_lookup_ = new std::unordered_map<std::string, F2C*>;
 
   char key[KEY_SIZE];
-  (*f2c_lookup_)[get_key(key, f2c_id_)] = this;
+  my_f2c_id_=f2c_id_;
+  (*f2c_lookup_)[get_my_key(key)] = this;
   f2c_id_increment();
-  return f2c_id_-1;
+  return my_f2c_id_;
 }
 
 int F2C::c2f()
@@ -75,12 +81,11 @@ int F2C::c2f()
     f2c_lookup_ = new std::unordered_map<std::string, F2C*>;
   }
 
-  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();
+  if(my_f2c_id_==-1)
+    /* this function wasn't found, add it */
+    return this->add_f();
+  else
+    return my_f2c_id_;
 }
 
 F2C* F2C::f2c(int id)
@@ -90,7 +95,7 @@ F2C* F2C::f2c(int id)
 
   if(id >= 0){
     char key[KEY_SIZE];
-    auto comm = f2c_lookup_->find(get_key(key, id));
+    auto comm = f2c_lookup_->find(get_key(key,id));
     return comm == f2c_lookup_->end() ? nullptr : comm->second;
   }else
     return nullptr;
diff --git a/src/smpi/mpi/smpi_file.cpp b/src/smpi/mpi/smpi_file.cpp
new file mode 100644 (file)
index 0000000..b47984e
--- /dev/null
@@ -0,0 +1,261 @@
+/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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 "smpi_comm.hpp"
+#include "smpi_coll.hpp"
+#include "smpi_datatype.hpp"
+#include "smpi_info.hpp"
+#include "smpi_win.hpp"
+#include "smpi_request.hpp"
+
+#include "smpi_file.hpp"
+#include "smpi_status.hpp"
+#include "simgrid/plugins/file_system.h"
+
+#define FP_SIZE sizeof(MPI_Offset)
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_io, smpi, "Logging specific to SMPI (RMA operations)");
+
+MPI_Errhandler SMPI_default_File_Errhandler = MPI_ERRORS_RETURN;
+
+namespace simgrid{
+namespace smpi{
+
+  File::File(MPI_Comm comm, const char *filename, int amode, MPI_Info info): comm_(comm), flags_(amode), info_(info) {
+    file_= new simgrid::s4u::File(filename, nullptr);
+    list_=nullptr;
+    if (comm_->rank() == 0) {
+      int size= comm_->size() + FP_SIZE;
+      list_ = new char[size];
+      errhandler_= SMPI_default_File_Errhandler;
+      memset(list_, 0, size);
+      shared_file_pointer_ = new MPI_Offset();
+      shared_mutex_ = s4u::Mutex::create();
+      *shared_file_pointer_ = 0;
+      win_=new Win(list_, size, 1, MPI_INFO_NULL, comm_);
+    }else{
+      win_=new Win(list_, 0, 1, MPI_INFO_NULL, comm_);
+    }
+    simgrid::smpi::Colls::bcast(&shared_file_pointer_, 1, MPI_AINT, 0, comm);
+    simgrid::smpi::Colls::bcast(&shared_mutex_, 1, MPI_AINT, 0, comm);
+    if(comm_->rank() != 0)
+      intrusive_ptr_add_ref(&*shared_mutex_);
+  }
+
+  File::~File(){
+    if(comm_->rank() == 0){
+      delete shared_file_pointer_;
+      delete[] list_;
+    }
+    delete win_;
+    delete file_;
+  }
+
+  int File::close(MPI_File *fh){
+    XBT_DEBUG("Closing MPI_File %s", (*fh)->file_->get_path());
+    (*fh)->sync();
+    if((*fh)->flags() & MPI_MODE_DELETE_ON_CLOSE)
+      (*fh)->file_->unlink();
+    delete (*fh);
+    return MPI_SUCCESS;
+  }
+
+  int File::del(const char* filename, MPI_Info)
+  {
+    //get the file with MPI_MODE_DELETE_ON_CLOSE and then close it
+    File* f = new File(MPI_COMM_SELF,filename,MPI_MODE_DELETE_ON_CLOSE|MPI_MODE_RDWR, nullptr);
+    close(&f);
+    return MPI_SUCCESS;
+  }
+
+  int File::get_position(MPI_Offset* offset){
+    *offset=file_->tell();
+    return MPI_SUCCESS;
+  }
+
+  int File::get_position_shared(MPI_Offset* offset){
+    shared_mutex_->lock();
+    *offset=*shared_file_pointer_;
+    shared_mutex_->unlock();
+    return MPI_SUCCESS;
+  }
+
+  int File::seek(MPI_Offset offset, int whence){
+    switch(whence){
+      case(MPI_SEEK_SET):
+        XBT_VERB("Seeking in MPI_File %s, setting offset %lld", file_->get_path(), offset);
+        file_->seek(offset,SEEK_SET);
+        break;
+      case(MPI_SEEK_CUR):
+        XBT_VERB("Seeking in MPI_File %s, current offset + %lld", file_->get_path(), offset);
+        file_->seek(offset,SEEK_CUR);
+        break;
+      case(MPI_SEEK_END):
+        XBT_VERB("Seeking in MPI_File %s, end offset + %lld", file_->get_path(), offset);
+        file_->seek(offset,SEEK_END);
+        break;
+      default:
+        return MPI_ERR_FILE;
+    }
+    return MPI_SUCCESS;
+  }
+
+  int File::seek_shared(MPI_Offset offset, int whence){
+    shared_mutex_->lock();
+    seek(offset,whence);
+    *shared_file_pointer_=offset;
+    shared_mutex_->unlock();
+    return MPI_SUCCESS;
+  }
+
+  int File::read(MPI_File fh, void* /*buf*/, int count, MPI_Datatype datatype, MPI_Status* status)
+  {
+    //get position first as we may be doing non contiguous reads and it will probably be updated badly
+    MPI_Offset position = fh->file_->tell();
+    MPI_Offset movesize = datatype->get_extent()*count;
+    MPI_Offset readsize = datatype->size()*count;
+    XBT_DEBUG("Position before read in MPI_File %s : %llu",fh->file_->get_path(),fh->file_->tell());
+    MPI_Offset read = fh->file_->read(readsize);
+    XBT_VERB("Read in MPI_File %s, %lld bytes read, readsize %lld bytes, movesize %lld", fh->file_->get_path(), read, readsize, movesize);
+    if(readsize!=movesize){
+      fh->file_->seek(position+movesize, SEEK_SET);
+    }
+    XBT_VERB("Position after read in MPI_File %s : %llu",fh->file_->get_path(), fh->file_->tell());
+    status->count=count*datatype->size();
+    return MPI_SUCCESS;
+  }
+
+  /*Ordered and Shared Versions, with RMA-based locks : Based on the model described in :*/
+  /* @InProceedings{10.1007/11557265_15,*/
+  /* author="Latham, Robert and Ross, Robert and Thakur, Rajeev and Toonen, Brian",*/ 
+  /* title="Implementing MPI-IO Shared File Pointers Without File System Support",*/
+  /* booktitle="Recent Advances in Parallel Virtual Machine and Message Passing Interface",*/
+  /* year="2005",*/
+  /* publisher="Springer Berlin Heidelberg",*/
+  /* address="Berlin, Heidelberg",*/
+  /* pages="84--93"*/
+  /* }*/
+  int File::read_shared(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status){
+    fh->shared_mutex_->lock();
+    fh->seek(*(fh->shared_file_pointer_),MPI_SEEK_SET);
+    read(fh, buf, count, datatype, status);
+    *(fh->shared_file_pointer_)=fh->file_->tell();
+    fh->shared_mutex_->unlock();
+    return MPI_SUCCESS;
+  }
+
+  int File::read_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status){
+    //0 needs to get the shared pointer value
+    MPI_Offset val;
+    if(fh->comm_->rank()==0){
+      val=*(fh->shared_file_pointer_);
+    }else{
+      val=count*datatype->size();
+    }
+
+    MPI_Offset result;
+    simgrid::smpi::Colls::scan(&val, &result, 1, MPI_OFFSET, MPI_SUM, fh->comm_);
+    fh->seek(result, MPI_SEEK_SET);
+    int ret = fh->op_all<simgrid::smpi::File::read>(buf, count, datatype, status);
+    if(fh->comm_->rank()==fh->comm_->size()-1){
+      fh->shared_mutex_->lock();
+      *(fh->shared_file_pointer_)=fh->file_->tell();
+      fh->shared_mutex_->unlock();
+    }
+    char c;
+    simgrid::smpi::Colls::bcast(&c, 1, MPI_BYTE, fh->comm_->size()-1, fh->comm_);
+    return ret;
+  }
+
+  int File::write(MPI_File fh, void* /*buf*/, int count, MPI_Datatype datatype, MPI_Status* status)
+  {
+    //get position first as we may be doing non contiguous reads and it will probably be updated badly
+    MPI_Offset position = fh->file_->tell();
+    MPI_Offset movesize = datatype->get_extent()*count;
+    MPI_Offset writesize = datatype->size()*count;
+    XBT_DEBUG("Position before write in MPI_File %s : %llu",fh->file_->get_path(),fh->file_->tell());
+    MPI_Offset write = fh->file_->write(writesize, 1);
+    XBT_VERB("Write in MPI_File %s, %lld bytes written, readsize %lld bytes, movesize %lld", fh->file_->get_path(), write, writesize, movesize);
+    if(writesize!=movesize){
+      fh->file_->seek(position+movesize, SEEK_SET);
+    }
+    XBT_VERB("Position after write in MPI_File %s : %llu",fh->file_->get_path(), fh->file_->tell());
+    status->count=count*datatype->size();
+    return MPI_SUCCESS;
+  }
+
+  int File::write_shared(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status){
+    fh->shared_mutex_->lock();
+    fh->seek(*(fh->shared_file_pointer_),MPI_SEEK_SET);
+    write(fh, const_cast<void*>(buf), count, datatype, status);
+    *(fh->shared_file_pointer_)=fh->file_->tell();
+    fh->shared_mutex_->unlock();
+    return MPI_SUCCESS;
+  }
+
+  int File::write_ordered(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Status *status){
+    //0 needs to get the shared pointer value
+    MPI_Offset val;
+    if(fh->comm_->rank()==0){
+      val=*(fh->shared_file_pointer_);
+    }else{
+      val=count*datatype->size();
+    }
+    MPI_Offset result;
+    simgrid::smpi::Colls::scan(&val, &result, 1, MPI_OFFSET, MPI_SUM, fh->comm_);
+    fh->seek(result, MPI_SEEK_SET);
+    int ret = fh->op_all<simgrid::smpi::File::write>(const_cast<void*>(buf), count, datatype, status);
+    if(fh->comm_->rank()==fh->comm_->size()-1){
+      fh->shared_mutex_->lock();
+      *(fh->shared_file_pointer_)=fh->file_->tell();
+      fh->shared_mutex_->unlock();
+    }
+    char c;
+    simgrid::smpi::Colls::bcast(&c, 1, MPI_BYTE, fh->comm_->size()-1, fh->comm_);
+    return ret;
+  }
+
+  int File::size(){
+    return file_->size();
+  }
+
+  int File::flags(){
+    return flags_;
+  }
+
+  int File::sync(){
+    //no idea
+    return simgrid::smpi::Colls::barrier(comm_);
+  }
+
+  MPI_Info File::info(){
+    if(info_== MPI_INFO_NULL)
+      info_ = new Info();
+    info_->ref();
+    return info_;
+  }
+
+  void File::set_info(MPI_Info info){
+    if(info_!= MPI_INFO_NULL)
+      info->ref();
+    info_=info;
+  }
+
+  MPI_Comm File::comm(){
+    return comm_;
+  }
+
+  MPI_Errhandler File::errhandler(){
+    return errhandler_;
+  }
+
+  void File::set_errhandler(MPI_Errhandler errhandler){
+    errhandler_=errhandler;
+    if(errhandler_!= MPI_ERRHANDLER_NULL)
+      errhandler->ref();
+  }
+}
+}
index f8eb81c..cbd973a 100644 (file)
@@ -28,7 +28,7 @@ Group::Group(Group* origin)
   }
 }
 
-void Group::set_mapping(s4u::ActorPtr actor, int rank)
+void Group::set_mapping(s4u::Actor* actor, int rank)
 {
   if (0 <= rank && rank < size_) {
     int index                = actor->get_pid();
@@ -39,9 +39,7 @@ void Group::set_mapping(s4u::ActorPtr actor, int rank)
     }
 
     rank_to_actor_map_[rank] = actor;
-    if (actor != nullptr) {
-      actor_to_rank_map_.insert({actor, rank});
-    }
+    actor_to_rank_map_.insert({actor, rank});
   }
 }
 
@@ -56,7 +54,7 @@ int Group::rank(int index)
   return rank;
 }
 
-s4u::ActorPtr Group::actor(int rank)
+s4u::Actor* Group::actor(int rank)
 {
   if (0 <= rank && rank < size_)
     return rank_to_actor_map_[rank];
@@ -64,7 +62,7 @@ s4u::ActorPtr Group::actor(int rank)
     return nullptr;
 }
 
-int Group::rank(const s4u::ActorPtr actor)
+int Group::rank(s4u::Actor* actor)
 {
   auto iterator = actor_to_rank_map_.find(actor);
   return (iterator == actor_to_rank_map_.end()) ? MPI_UNDEFINED : (*iterator).second;
@@ -92,7 +90,7 @@ int Group::compare(MPI_Group group2)
     result = MPI_UNEQUAL;
   } else {
     for (int i = 0; i < size_; i++) {
-      s4u::ActorPtr actor = this->actor(i);
+      s4u::Actor* actor = this->actor(i);
       int rank = group2->rank(actor);
       if (rank == MPI_UNDEFINED) {
         result = MPI_UNEQUAL;
@@ -106,7 +104,7 @@ int Group::compare(MPI_Group group2)
   return result;
 }
 
-int Group::incl(int n, int* ranks, MPI_Group* newgroup)
+int Group::incl(int n, const int* ranks, MPI_Group* newgroup)
 {
   int i=0;
   if (n == 0) {
@@ -118,7 +116,7 @@ int Group::incl(int n, int* ranks, MPI_Group* newgroup)
   } else {
     *newgroup = new Group(n);
     for (i = 0; i < n; i++) {
-      s4u::ActorPtr actor = this->actor(ranks[i]); // ranks[] was passed as a param!
+      s4u::Actor* actor = this->actor(ranks[i]); // ranks[] was passed as a param!
       (*newgroup)->set_mapping(actor, i);
     }
   }
@@ -130,7 +128,7 @@ int Group::group_union(MPI_Group group2, MPI_Group* newgroup)
   int size1 = size_;
   int size2 = group2->size();
   for (int i = 0; i < size2; i++) {
-    s4u::ActorPtr actor = group2->actor(i);
+    s4u::Actor* actor = group2->actor(i);
     int proc1 = this->rank(actor);
     if (proc1 == MPI_UNDEFINED) {
       size1++;
@@ -142,11 +140,11 @@ int Group::group_union(MPI_Group group2, MPI_Group* newgroup)
     *newgroup = new  Group(size1);
     size2 = this->size();
     for (int i = 0; i < size2; i++) {
-      s4u::ActorPtr actor1 = this->actor(i);
+      s4u::Actor* actor1 = this->actor(i);
       (*newgroup)->set_mapping(actor1, i);
     }
     for (int i = size2; i < size1; i++) {
-      s4u::ActorPtr actor = group2->actor(i - size2);
+      s4u::Actor* actor = group2->actor(i - size2);
       (*newgroup)->set_mapping(actor, i);
     }
   }
@@ -157,7 +155,7 @@ int Group::intersection(MPI_Group group2, MPI_Group* newgroup)
 {
   int size2 = group2->size();
   for (int i = 0; i < size2; i++) {
-    s4u::ActorPtr actor = group2->actor(i);
+    s4u::Actor* actor = group2->actor(i);
     int proc1 = this->rank(actor);
     if (proc1 == MPI_UNDEFINED) {
       size2--;
@@ -169,7 +167,7 @@ int Group::intersection(MPI_Group group2, MPI_Group* newgroup)
     *newgroup = new  Group(size2);
     int j=0;
     for (int i = 0; i < group2->size(); i++) {
-      s4u::ActorPtr actor = group2->actor(i);
+      s4u::Actor* actor = group2->actor(i);
       int proc1 = this->rank(actor);
       if (proc1 != MPI_UNDEFINED) {
         (*newgroup)->set_mapping(actor, j);
@@ -185,7 +183,7 @@ int Group::difference(MPI_Group group2, MPI_Group* newgroup)
   int newsize = size_;
   int size2 = size_;
   for (int i = 0; i < size2; i++) {
-    s4u::ActorPtr actor = this->actor(i);
+    s4u::Actor* actor = this->actor(i);
     int proc2 = group2->rank(actor);
     if (proc2 != MPI_UNDEFINED) {
       newsize--;
@@ -196,7 +194,7 @@ int Group::difference(MPI_Group group2, MPI_Group* newgroup)
   } else {
     *newgroup = new  Group(newsize);
     for (int i = 0; i < size2; i++) {
-      s4u::ActorPtr actor = this->actor(i);
+      s4u::Actor* actor = this->actor(i);
       int proc2 = group2->rank(actor);
       if (proc2 == MPI_UNDEFINED) {
         (*newgroup)->set_mapping(actor, i);
@@ -206,7 +204,7 @@ int Group::difference(MPI_Group group2, MPI_Group* newgroup)
   return MPI_SUCCESS;
 }
 
-int Group::excl(int n, int *ranks, MPI_Group * newgroup){
+int Group::excl(int n, const int *ranks, MPI_Group * newgroup){
   int oldsize = size_;
   int newsize = oldsize - n;
   *newgroup = new  Group(newsize);
@@ -218,7 +216,7 @@ int Group::excl(int n, int *ranks, MPI_Group * newgroup){
   int j = 0;
   for (int i = 0; i < oldsize; i++) {
     if(to_exclude[i]==0){
-      s4u::ActorPtr actor = this->actor(i);
+      s4u::Actor* actor = this->actor(i);
       (*newgroup)->set_mapping(actor, j);
       j++;
     }
@@ -257,7 +255,7 @@ int Group::range_incl(int n, int ranges[][3], MPI_Group * newgroup){
     for (int rank = ranges[i][0];                    /* First */
          rank >= 0 && rank < size_; /* Last */
          ) {
-      s4u::ActorPtr actor = this->actor(rank);
+      s4u::Actor* actor = this->actor(rank);
       (*newgroup)->set_mapping(actor, j);
       j++;
       if(rank == ranges[i][1]){/*already last ?*/
@@ -309,7 +307,7 @@ int Group::range_excl(int n, int ranges[][3], MPI_Group * newgroup){
         }
       }
       if(add==1){
-        s4u::ActorPtr actor = this->actor(oldrank);
+        s4u::Actor* actor = this->actor(oldrank);
         (*newgroup)->set_mapping(actor, newrank);
         newrank++;
       }
index 7b3efad..c20ae58 100644 (file)
@@ -21,7 +21,7 @@ void Info::unref(Info* info){
   }
 }
 
-int Info::get(char *key, int valuelen, char *value, int *flag){
+int Info::get(const char *key, int valuelen, char *value, int *flag){
   *flag=false;
   auto val = map_.find(key);
   if (val != map_.end()) {
@@ -31,13 +31,11 @@ int Info::get(char *key, int valuelen, char *value, int *flag){
     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){
+int Info::remove(const char *key){
   if (map_.erase(key) == 0)
     return MPI_ERR_INFO_NOKEY;
   else
@@ -61,16 +59,14 @@ int Info::get_nthkey(int n, char *key){
   return MPI_ERR_ARG;
 }
 
-int Info::get_valuelen(char *key, int *valuelen, int *flag){
+int Info::get_valuelen(const char *key, int *valuelen, int *flag){
   *flag=false;
   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){
index 219c555..d22bbf2 100644 (file)
@@ -14,8 +14,8 @@ std::unordered_map<int, void*>* Keyval::attributes(){
   return &attributes_;
 };
 
-
-template <> int Keyval::call_deleter<Comm>(Comm* obj, smpi_key_elem elem, int keyval, void * value, int* flag){
+template <> int Keyval::call_deleter<Comm>(Comm* obj, smpi_key_elem elem, int keyval, void* value, int* /*flag*/)
+{
   int ret = MPI_SUCCESS;
   if(elem->delete_fn.comm_delete_fn!=MPI_NULL_DELETE_FN)
     ret = elem->delete_fn.comm_delete_fn(obj, keyval, value, elem->extra_state);
@@ -24,7 +24,8 @@ template <> int Keyval::call_deleter<Comm>(Comm* obj, smpi_key_elem elem, int ke
   return ret;
 }
 
-template <> int Keyval::call_deleter<Win>(Win* obj, smpi_key_elem elem, int keyval, void * value, int* flag){
+template <> int Keyval::call_deleter<Win>(Win* obj, smpi_key_elem elem, int keyval, void* value, int* /*flag*/)
+{
   int ret = MPI_SUCCESS;
   if(elem->delete_fn.win_delete_fn!=MPI_NULL_DELETE_FN)
     ret = elem->delete_fn.win_delete_fn(obj, keyval, value, elem->extra_state);
@@ -33,7 +34,9 @@ template <> int Keyval::call_deleter<Win>(Win* obj, smpi_key_elem elem, int keyv
   return ret;
 }
 
-template <> int Keyval::call_deleter<Datatype>(Datatype* obj, smpi_key_elem elem, int keyval, void * value, int* flag){
+template <>
+int Keyval::call_deleter<Datatype>(Datatype* obj, smpi_key_elem elem, int keyval, void* value, int* /*flag*/)
+{
   int ret = MPI_SUCCESS;
   if(elem->delete_fn.type_delete_fn!=MPI_NULL_DELETE_FN)
     ret = elem->delete_fn.type_delete_fn(obj, keyval, value, elem->extra_state);
index bb52d0e..4a18f6e 100644 (file)
@@ -13,15 +13,27 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_op, smpi, "Logging specific to SMPI (op)");
 #define MAX_OP(a, b)  (b) = (a) < (b) ? (b) : (a)
 #define MIN_OP(a, b)  (b) = (a) < (b) ? (a) : (b)
 #define SUM_OP(a, b)  (b) += (a)
+#define SUM_OP_COMPLEX(a, b)                                                                                           \
+  {                                                                                                                    \
+    ((b).value) += ((a).value);                                                                                        \
+    ((b).index) += ((a).index);                                                                                        \
+  }
 #define PROD_OP(a, b) (b) *= (a)
+#define PROD_OP_COMPLEX(a, b)                                                                                          \
+  {                                                                                                                    \
+    ((b).value) *= ((a).value);                                                                                        \
+    ((b).index) *= ((a).index);                                                                                        \
+  }
 #define LAND_OP(a, b) (b) = (a) && (b)
 #define LOR_OP(a, b)  (b) = (a) || (b)
 #define LXOR_OP(a, b) (b) = (not(a) && (b)) || ((a) && not(b))
 #define BAND_OP(a, b) (b) &= (a)
 #define BOR_OP(a, b)  (b) |= (a)
 #define BXOR_OP(a, b) (b) ^= (a)
-#define MAXLOC_OP(a, b)  (b) = (a.value) < (b.value) ? (b) : ((a.value) == (b.value) ? ((a.index) < (b.index) ? (a) : (b)) : (a))
-#define MINLOC_OP(a, b)  (b) = (a.value) < (b.value) ? (a) : ((a.value) == (b.value) ? ((a.index) < (b.index) ? (a) : (b)) : (b))
+#define MAXLOC_OP(a, b)                                                                                                \
+  (b) = ((a).value) < ((b).value) ? (b) : (((a).value) == ((b).value) ? (((a).index) < ((b).index) ? (a) : (b)) : (a))
+#define MINLOC_OP(a, b)                                                                                                \
+  (b) = ((a).value) < ((b).value) ? (a) : (((a).value) == ((b).value) ? (((a).index) < ((b).index) ? (a) : (b)) : (b))
 
 #define APPLY_FUNC(a, b, length, type, func) \
 {                                          \
@@ -33,11 +45,10 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_op, smpi, "Logging specific to SMPI (op)");
   }                                        \
 }
 
-#define APPLY_OP_LOOP(dtype, type, op) \
-  if (*datatype == dtype) {\
-    APPLY_FUNC(a, b, length, type, op)\
-  } else \
-
+#define APPLY_OP_LOOP(dtype, type, op)                                                                                 \
+  if (*datatype == (dtype)) {                                                                                          \
+    APPLY_FUNC(a, b, length, type, op)                                                                                 \
+  } else
 
 #define APPLY_BASIC_OP_LOOP(op)\
 APPLY_OP_LOOP(MPI_CHAR, char,op)\
@@ -66,7 +77,9 @@ APPLY_OP_LOOP(MPI_OFFSET, MPI_Offset,op)\
 APPLY_OP_LOOP(MPI_INTEGER1, int,op)\
 APPLY_OP_LOOP(MPI_INTEGER2, int16_t,op)\
 APPLY_OP_LOOP(MPI_INTEGER4, int32_t,op)\
-APPLY_OP_LOOP(MPI_INTEGER8, int64_t,op)
+APPLY_OP_LOOP(MPI_INTEGER8, int64_t,op)\
+APPLY_OP_LOOP(MPI_COUNT, long long,op)
+
 
 #define APPLY_BOOL_OP_LOOP(op)\
 APPLY_OP_LOOP(MPI_C_BOOL, bool,op)
@@ -94,11 +107,14 @@ APPLY_OP_LOOP(MPI_2INT, int_int,op)\
 APPLY_OP_LOOP(MPI_2FLOAT, float_float,op)\
 APPLY_OP_LOOP(MPI_2DOUBLE, double_double,op)\
 APPLY_OP_LOOP(MPI_LONG_DOUBLE_INT, long_double_int,op)\
-APPLY_OP_LOOP(MPI_2LONG, long_long,op)
-
-#define APPLY_END_OP_LOOP(op)\
-  {\
-    xbt_die("Failed to apply " #op " to type %s", (*datatype)->name());\
+APPLY_OP_LOOP(MPI_2LONG, long_long,op)\
+APPLY_OP_LOOP(MPI_COMPLEX8, float_float,op)\
+APPLY_OP_LOOP(MPI_COMPLEX16, double_double,op)\
+APPLY_OP_LOOP(MPI_COMPLEX32, double_double,op)
+
+#define APPLY_END_OP_LOOP(op)                                                                                          \
+  {                                                                                                                    \
+    xbt_die("Failed to apply " _XBT_STRINGIFY(op) " to type %s", (*datatype)->name());                                 \
   }
 
 static void max_func(void *a, void *b, int *length, MPI_Datatype * datatype)
@@ -120,6 +136,7 @@ static void sum_func(void *a, void *b, int *length, MPI_Datatype * datatype)
   APPLY_BASIC_OP_LOOP(SUM_OP)
   APPLY_FLOAT_OP_LOOP(SUM_OP)
   APPLY_COMPLEX_OP_LOOP(SUM_OP)
+  APPLY_PAIR_OP_LOOP(SUM_OP_COMPLEX)
   APPLY_END_OP_LOOP(SUM_OP)
 }
 
@@ -128,12 +145,14 @@ static void prod_func(void *a, void *b, int *length, MPI_Datatype * datatype)
   APPLY_BASIC_OP_LOOP(PROD_OP)
   APPLY_FLOAT_OP_LOOP(PROD_OP)
   APPLY_COMPLEX_OP_LOOP(PROD_OP)
+  APPLY_PAIR_OP_LOOP(PROD_OP_COMPLEX)
   APPLY_END_OP_LOOP(PROD_OP)
 }
 
 static void land_func(void *a, void *b, int *length, MPI_Datatype * datatype)
 {
   APPLY_BASIC_OP_LOOP(LAND_OP)
+  APPLY_FLOAT_OP_LOOP(LAND_OP)
   APPLY_BOOL_OP_LOOP(LAND_OP)
   APPLY_END_OP_LOOP(LAND_OP)
 }
@@ -141,6 +160,7 @@ static void land_func(void *a, void *b, int *length, MPI_Datatype * datatype)
 static void lor_func(void *a, void *b, int *length, MPI_Datatype * datatype)
 {
   APPLY_BASIC_OP_LOOP(LOR_OP)
+  APPLY_FLOAT_OP_LOOP(LOR_OP)
   APPLY_BOOL_OP_LOOP(LOR_OP)
   APPLY_END_OP_LOOP(LOR_OP)
 }
@@ -148,6 +168,7 @@ static void lor_func(void *a, void *b, int *length, MPI_Datatype * datatype)
 static void lxor_func(void *a, void *b, int *length, MPI_Datatype * datatype)
 {
   APPLY_BASIC_OP_LOOP(LXOR_OP)
+  APPLY_FLOAT_OP_LOOP(LXOR_OP)
   APPLY_BOOL_OP_LOOP(LXOR_OP)
   APPLY_END_OP_LOOP(LXOR_OP)
 }
@@ -195,9 +216,9 @@ static void no_func(void*, void*, int*, MPI_Datatype*)
   /* obviously a no-op */
 }
 
-#define CREATE_MPI_OP(name, func)                             \
-  static SMPI_Op mpi_##name (&(func) /* func */, true ); \
-MPI_Op name = &mpi_##name;
+#define CREATE_MPI_OP(name, func)                                                                                      \
+  static SMPI_Op _XBT_CONCAT(mpi_, name)(&(func) /* func */, true, true);                                              \
+  MPI_Op name = &_XBT_CONCAT(mpi_, name);
 
 CREATE_MPI_OP(MPI_MAX, max_func);
 CREATE_MPI_OP(MPI_MIN, min_func);
@@ -217,7 +238,7 @@ CREATE_MPI_OP(MPI_NO_OP, no_func);
 namespace simgrid{
 namespace smpi{
 
-void Op::apply(void *invec, void *inoutvec, int *len, MPI_Datatype datatype)
+void Op::apply(const void* invec, void* inoutvec, const int* len, MPI_Datatype datatype)
 {
   if (smpi_privatize_global_variables == SmpiPrivStrategies::MMAP) {
     // we need to switch as the called function may silently touch global variables
@@ -227,13 +248,13 @@ void Op::apply(void *invec, void *inoutvec, int *len, MPI_Datatype datatype)
 
   if (not smpi_process()->replaying() && *len > 0) {
     if (not is_fortran_op_)
-      this->func_(invec, inoutvec, len, &datatype);
+      this->func_(const_cast<void*>(invec), inoutvec, const_cast<int*>(len), &datatype);
     else{
       XBT_DEBUG("Applying operation of length %d from %p and from/to %p", *len, invec, inoutvec);
       int tmp = datatype->c2f();
       /* Unfortunately, the C and Fortran version of the MPI standard do not agree on the type here,
          thus the reinterpret_cast. */
-      this->func_(invec, inoutvec, len, reinterpret_cast<MPI_Datatype*>(&tmp) );
+      this->func_(const_cast<void*>(invec), inoutvec, const_cast<int*>(len), reinterpret_cast<MPI_Datatype*>(&tmp));
     }
   }
 }
@@ -249,7 +270,7 @@ void Op::ref(){
 void Op::unref(MPI_Op* op){
   if((*op)!=MPI_OP_NULL){
     (*op)->refcount_--;
-    if((*op)->refcount_==0)
+    if((*op)->refcount_==0 && (*op)->predefined_==false)
       delete(*op);
   }
 }
index 47b37fe..c5e7c52 100644 (file)
@@ -2,8 +2,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 "simgrid/s4u/Mutex.hpp"
-#include "simgrid/s4u/ConditionVariable.hpp"
+
 #include "smpi_request.hpp"
 
 #include "mc/mc.h"
@@ -17,8 +16,6 @@
 #include "src/kernel/activity/CommImpl.hpp"
 #include "src/mc/mc_replay.hpp"
 #include "src/smpi/include/smpi_actor.hpp"
-#include "xbt/config.hpp"
-
 
 #include <algorithm>
 
@@ -36,14 +33,14 @@ extern void (*smpi_comm_copy_data_callback)(simgrid::kernel::activity::CommImpl*
 namespace simgrid{
 namespace smpi{
 
-Request::Request(void* buf, int count, MPI_Datatype datatype, int src, int dst, int tag, MPI_Comm comm, unsigned flags, MPI_Op op)
-    : buf_(buf), old_type_(datatype), src_(src), dst_(dst), tag_(tag), comm_(comm), flags_(flags), op_(op)
+Request::Request(const void* buf, int count, MPI_Datatype datatype, int src, int dst, int tag, MPI_Comm comm, unsigned flags, MPI_Op op)
+    : buf_(const_cast<void*>(buf)), old_type_(datatype), src_(src), dst_(dst), tag_(tag), comm_(comm), flags_(flags), op_(op)
 {
   void *old_buf = nullptr;
 // FIXME Handle the case of a partial shared malloc.
   if ((((flags & MPI_REQ_RECV) != 0) && ((flags & MPI_REQ_ACCUMULATE) != 0)) || (datatype->flags() & DT_FLAG_DERIVED)) {
     // This part handles the problem of non-contiguous memory
-    old_buf = buf;
+    old_buf = const_cast<void*>(buf);
     if (count==0){
       buf_ = nullptr;
     }else {
@@ -61,10 +58,10 @@ Request::Request(void* buf, int count, MPI_Datatype datatype, int src, int dst,
   if(op != MPI_REPLACE && op != MPI_OP_NULL)
     op_->ref();
   action_          = nullptr;
-  detached_        = 0;
+  detached_        = false;
   detached_sender_ = nullptr;
   real_src_        = 0;
-  truncated_       = 0;
+  truncated_       = false;
   real_size_       = 0;
   real_tag_        = 0;
   if (flags & MPI_REQ_PERSISTENT)
@@ -92,6 +89,7 @@ void Request::unref(MPI_Request* request)
     if((*request)->refcount_==0){
       if ((*request)->flags_ & MPI_REQ_GENERALIZED){
         ((*request)->generalized_funcs)->free_fn(((*request)->generalized_funcs)->extra_state);
+        delete (*request)->generalized_funcs;
       }else{
         Comm::unref((*request)->comm_);
         Datatype::unref((*request)->old_type_);
@@ -114,11 +112,12 @@ int Request::match_recv(void* a, void* b, simgrid::kernel::activity::CommImpl*)
 {
   MPI_Request ref = static_cast<MPI_Request>(a);
   MPI_Request req = static_cast<MPI_Request>(b);
-  XBT_DEBUG("Trying to match a recv of src %d against %d, tag %d against %d",ref->src_,req->src_, ref->tag_, req->tag_);
+  XBT_DEBUG("Trying to match a recv of src %d against %d, tag %d against %d, id %d against %d",ref->src_,req->src_, ref->tag_, req->tag_,ref->comm_->id(),req->comm_->id());
 
   xbt_assert(ref, "Cannot match recv against null reference");
   xbt_assert(req, "Cannot match recv against null request");
-  if((ref->src_ == MPI_ANY_SOURCE || req->src_ == ref->src_)
+  if((ref->comm_->id()==MPI_UNDEFINED || req->comm_->id() == MPI_UNDEFINED || (ref->comm_->id()==req->comm_->id()))
+    && ((ref->src_ == MPI_ANY_SOURCE  && (ref->comm_->group()->rank(req->src_) != MPI_UNDEFINED)) || req->src_ == ref->src_)
     && ((ref->tag_ == MPI_ANY_TAG && req->tag_ >=0) || req->tag_ == ref->tag_)){
     //we match, we can transfer some values
     if(ref->src_ == MPI_ANY_SOURCE)
@@ -126,8 +125,8 @@ int Request::match_recv(void* a, void* b, simgrid::kernel::activity::CommImpl*)
     if(ref->tag_ == MPI_ANY_TAG)
       ref->real_tag_ = req->tag_;
     if(ref->real_size_ < req->real_size_)
-      ref->truncated_ = 1;
-    if(req->detached_==1)
+      ref->truncated_ = true;
+    if (req->detached_)
       ref->detached_sender_=req; //tie the sender to the receiver, as it is detached and has to be freed in the receiver
     if(req->cancelled_==0)
       req->cancelled_=-1;//mark as uncancellable
@@ -140,19 +139,20 @@ int Request::match_send(void* a, void* b, simgrid::kernel::activity::CommImpl*)
 {
   MPI_Request ref = static_cast<MPI_Request>(a);
   MPI_Request req = static_cast<MPI_Request>(b);
-  XBT_DEBUG("Trying to match a send of src %d against %d, tag %d against %d",ref->src_,req->src_, ref->tag_, req->tag_);
+  XBT_DEBUG("Trying to match a send of src %d against %d, tag %d against %d, id %d against %d",ref->src_,req->src_, ref->tag_, req->tag_,ref->comm_->id(),req->comm_->id());
   xbt_assert(ref, "Cannot match send against null reference");
   xbt_assert(req, "Cannot match send against null request");
 
-  if((req->src_ == MPI_ANY_SOURCE || req->src_ == ref->src_)
+  if((ref->comm_->id()==MPI_UNDEFINED || req->comm_->id() == MPI_UNDEFINED || (ref->comm_->id()==req->comm_->id()))
+      && ((req->src_ == MPI_ANY_SOURCE  && (req->comm_->group()->rank(ref->src_) != MPI_UNDEFINED)) || req->src_ == ref->src_)
       && ((req->tag_ == MPI_ANY_TAG && ref->tag_ >=0)|| req->tag_ == ref->tag_)){
     if(req->src_ == MPI_ANY_SOURCE)
       req->real_src_ = ref->src_;
     if(req->tag_ == MPI_ANY_TAG)
       req->real_tag_ = ref->tag_;
     if(req->real_size_ < ref->real_size_)
-      req->truncated_ = 1;
-    if(ref->detached_==1)
+      req->truncated_ = true;
+    if (ref->detached_)
       req->detached_sender_=ref; //tie the sender to the receiver, as it is detached and has to be freed in the receiver
     if(req->cancelled_==0)
       req->cancelled_=-1;//mark as uncancellable
@@ -170,7 +170,15 @@ void Request::print_request(const char *message)
 
 
 /* factories, to hide the internal flags from the caller */
-MPI_Request Request::send_init(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
+MPI_Request Request::bsend_init(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
+{
+
+  return new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, simgrid::s4u::this_actor::get_pid(),
+                     comm->group()->actor(dst)->get_pid(), tag, comm,
+                     MPI_REQ_PERSISTENT | MPI_REQ_SEND | MPI_REQ_PREPARED | MPI_REQ_BSEND);
+}
+
+MPI_Request Request::send_init(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
 {
 
   return new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, simgrid::s4u::this_actor::get_pid(),
@@ -178,14 +186,14 @@ MPI_Request Request::send_init(void *buf, int count, MPI_Datatype datatype, int
                      MPI_REQ_PERSISTENT | MPI_REQ_SEND | MPI_REQ_PREPARED);
 }
 
-MPI_Request Request::ssend_init(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
+MPI_Request Request::ssend_init(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
 {
   return new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, simgrid::s4u::this_actor::get_pid(),
                      comm->group()->actor(dst)->get_pid(), tag, comm,
                      MPI_REQ_PERSISTENT | MPI_REQ_SSEND | MPI_REQ_SEND | MPI_REQ_PREPARED);
 }
 
-MPI_Request Request::isend_init(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
+MPI_Request Request::isend_init(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
 {
   return new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, simgrid::s4u::this_actor::get_pid(),
                      comm->group()->actor(dst)->get_pid(), tag, comm,
@@ -193,7 +201,7 @@ MPI_Request Request::isend_init(void *buf, int count, MPI_Datatype datatype, int
 }
 
 
-MPI_Request Request::rma_send_init(void *buf, int count, MPI_Datatype datatype, int src, int dst, int tag, MPI_Comm comm,
+MPI_Request Request::rma_send_init(const void *buf, int count, MPI_Datatype datatype, int src, int dst, int tag, MPI_Comm comm,
                                MPI_Op op)
 {
   MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
@@ -242,7 +250,17 @@ MPI_Request Request::irecv_init(void *buf, int count, MPI_Datatype datatype, int
                      MPI_REQ_PERSISTENT | MPI_REQ_RECV | MPI_REQ_PREPARED);
 }
 
-MPI_Request Request::isend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
+MPI_Request Request::ibsend(const 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, simgrid::s4u::this_actor::get_pid(),
+                        comm->group()->actor(dst)->get_pid(), tag, comm,
+                        MPI_REQ_NON_PERSISTENT | MPI_REQ_ISEND | MPI_REQ_SEND | MPI_REQ_BSEND);
+  request->start();
+  return request;
+}
+
+MPI_Request Request::isend(const 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, simgrid::s4u::this_actor::get_pid(),
@@ -252,7 +270,7 @@ MPI_Request Request::isend(void *buf, int count, MPI_Datatype datatype, int dst,
   return request;
 }
 
-MPI_Request Request::issend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
+MPI_Request Request::issend(const 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, simgrid::s4u::this_actor::get_pid(),
@@ -281,7 +299,18 @@ void Request::recv(void *buf, int count, MPI_Datatype datatype, int src, int tag
   request = nullptr;
 }
 
-void Request::send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
+void Request::bsend(const 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, simgrid::s4u::this_actor::get_pid(),
+                        comm->group()->actor(dst)->get_pid(), tag, comm, MPI_REQ_NON_PERSISTENT | MPI_REQ_SEND | MPI_REQ_BSEND);
+
+  request->start();
+  wait(&request, MPI_STATUS_IGNORE);
+  request = nullptr;
+}
+
+void Request::send(const 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, simgrid::s4u::this_actor::get_pid(),
@@ -292,7 +321,7 @@ void Request::send(void *buf, int count, MPI_Datatype datatype, int dst, int tag
   request = nullptr;
 }
 
-void Request::ssend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
+void Request::ssend(const 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, simgrid::s4u::this_actor::get_pid(),
@@ -304,7 +333,7 @@ void Request::ssend(void *buf, int count, MPI_Datatype datatype, int dst, int ta
   request = nullptr;
 }
 
-void Request::sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,int dst, int sendtag,
+void Request::sendrecv(const 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)
 {
@@ -398,6 +427,7 @@ void Request::start()
       mut->unlock();
   } else { /* the RECV flag was not set, so this is a send */
     simgrid::smpi::ActorExt* process = smpi_process_remote(simgrid::s4u::Actor::by_pid(dst_));
+    xbt_assert(process, "Actor pid=%d is gone??", dst_);
     int rank = src_;
     if (TRACE_smpi_view_internals()) {
       TRACE_smpi_send(rank, rank, dst_, tag_, size_);
@@ -406,10 +436,10 @@ void Request::start()
 
     void* buf = buf_;
     if ((flags_ & MPI_REQ_SSEND) == 0 &&
-        ((flags_ & MPI_REQ_RMA) != 0 ||
+        ((flags_ & MPI_REQ_RMA) != 0 || (flags_ & MPI_REQ_BSEND) != 0 ||
          static_cast<int>(size_) < simgrid::config::get_value<int>("smpi/send-is-detached-thresh"))) {
       void *oldbuf = nullptr;
-      detached_ = 1;
+      detached_    = true;
       XBT_DEBUG("Send request %p is detached", this);
       this->ref();
       if (not(old_type_->flags() & DT_FLAG_DERIVED)) {
@@ -421,6 +451,8 @@ void Request::start()
             XBT_DEBUG("Privatization : We are sending from a zone inside global memory. Switch data segment ");
             smpi_switch_data_segment(simgrid::s4u::Actor::by_pid(src_));
           }
+          //we need this temporary buffer even for bsend, as it will be released in the copy callback and we don't have a way to differentiate it
+          //so actually ... don't use manually attached buffer space.
           buf = xbt_malloc(size_);
           memcpy(buf,oldbuf,size_);
           XBT_DEBUG("buf %p copied into %p",oldbuf,buf);
@@ -430,7 +462,7 @@ void Request::start()
 
     //if we are giving back the control to the user without waiting for completion, we have to inject timings
     double sleeptime = 0.0;
-    if (detached_ != 0 || ((flags_ & (MPI_REQ_ISEND | MPI_REQ_SSEND)) != 0)) { // issend should be treated as isend
+    if (detached_ || ((flags_ & (MPI_REQ_ISEND | MPI_REQ_SSEND)) != 0)) { // issend should be treated as isend
       // isend and send timings may be different
       sleeptime = ((flags_ & MPI_REQ_ISEND) != 0)
                       ? simgrid::s4u::Actor::self()->get_host()->extension<simgrid::smpi::Host>()->oisend(size_)
@@ -438,7 +470,7 @@ void Request::start()
     }
 
     if(sleeptime > 0.0){
-      simcall_process_sleep(sleeptime);
+      simgrid::s4u::this_actor::sleep_for(sleeptime);
       XBT_DEBUG("sending size of %zu : sleep %f ", size_, sleeptime);
     }
 
@@ -490,8 +522,8 @@ void Request::start()
 
     /* FIXME: detached sends are not traceable (action_ == nullptr) */
     if (action_ != nullptr) {
-      std::string category = smpi_process()->get_tracing_category();
-      simgrid::simix::simcall([this, category] { this->action_->set_category(category); });
+      boost::static_pointer_cast<kernel::activity::CommImpl>(action_)->set_tracing_category(
+          smpi_process()->get_tracing_category());
     }
 
     if (async_small_thresh != 0 || ((flags_ & MPI_REQ_RMA) != 0))
@@ -539,16 +571,15 @@ int Request::test(MPI_Request * request, MPI_Status * status, int* flag) {
   }
   
   if(smpi_test_sleep > 0)
-    simcall_process_sleep(nsleeps*smpi_test_sleep);
+    simgrid::s4u::this_actor::sleep_for(nsleeps * smpi_test_sleep);
 
-  MPI_Status* mystatus;
   Status::empty(status);
   *flag = 1;
   if (((*request)->flags_ & MPI_REQ_PREPARED) == 0) {
-    if ((*request)->action_ != nullptr){
+    if ((*request)->action_ != nullptr && (*request)->cancelled_ != 1){
       try{
         *flag = simcall_comm_test((*request)->action_);
-      }catch (xbt_ex& e) {
+      } catch (const Exception&) {
         *flag = 0;
         return ret;
       }
@@ -560,6 +591,7 @@ int Request::test(MPI_Request * request, MPI_Status * status, int* flag) {
     if (*flag) {
       finish_wait(request,status);
       if (*request != MPI_REQUEST_NULL && ((*request)->flags_ & MPI_REQ_GENERALIZED)){
+        MPI_Status* mystatus;
         if(status==MPI_STATUS_IGNORE){
           mystatus=new MPI_Status();
           Status::empty(mystatus);
@@ -591,15 +623,15 @@ int Request::testsome(int incount, MPI_Request requests[], int *count, int *indi
 
   *count = 0;
   for (int i = 0; i < incount; i++) {
-    if (requests[i] != MPI_REQUEST_NULL) {
+    if (requests[i] != MPI_REQUEST_NULL && not (requests[i]->flags_ & MPI_REQ_FINISHED)) {
       ret = test(&requests[i], pstat, &flag);
       if(ret!=MPI_SUCCESS)
         error = 1;
       if(flag) {
-        indices[i] = 1;
-        (*count)++;
+        indices[*count] = i;
         if (status != MPI_STATUSES_IGNORE)
-          status[i] = *pstat;
+          status[*count] = *pstat;
+        (*count)++;
         if ((requests[i] != MPI_REQUEST_NULL) && (requests[i]->flags_ & MPI_REQ_NON_PERSISTENT))
           requests[i] = MPI_REQUEST_NULL;
       }
@@ -622,7 +654,6 @@ int Request::testany(int count, MPI_Request requests[], int *index, int* flag, M
   int i;
   *flag = 0;
   int ret = MPI_SUCCESS;
-  MPI_Status* mystatus;
   *index = MPI_UNDEFINED;
 
   std::vector<int> map; /** Maps all matching comms back to their location in requests **/
@@ -636,10 +667,11 @@ int Request::testany(int count, MPI_Request requests[], int *index, int* flag, M
     //multiplier to the sleeptime, to increase speed of execution, each failed testany will increase it
     static int nsleeps = 1;
     if(smpi_test_sleep > 0)
-      simcall_process_sleep(nsleeps*smpi_test_sleep);
+      simgrid::s4u::this_actor::sleep_for(nsleeps * smpi_test_sleep);
     try{
       i = simcall_comm_testany(comms.data(), comms.size()); // The i-th element in comms matches!
-    }catch (xbt_ex& e) {
+    } catch (const Exception&) {
+      XBT_DEBUG("Exception in testany");
       return 0;
     }
     
@@ -652,6 +684,7 @@ int Request::testany(int count, MPI_Request requests[], int *index, int* flag, M
       } else {
         finish_wait(&requests[*index],status);
       if (requests[*index] != MPI_REQUEST_NULL && (requests[*index]->flags_ & MPI_REQ_GENERALIZED)){
+        MPI_Status* mystatus;
         if(status==MPI_STATUS_IGNORE){
           mystatus=new MPI_Status();
           Status::empty(mystatus);
@@ -665,6 +698,7 @@ int Request::testany(int count, MPI_Request requests[], int *index, int* flag, M
 
         if (requests[*index] != MPI_REQUEST_NULL && (requests[*index]->flags_ & MPI_REQ_NON_PERSISTENT)) 
           requests[*index] = MPI_REQUEST_NULL;
+        XBT_DEBUG("Testany - returning with index %d", *index);
         *flag=1;
       }
       nsleeps = 1;
@@ -672,8 +706,10 @@ int Request::testany(int count, MPI_Request requests[], int *index, int* flag, M
       nsleeps++;
     }
   } else {
+      XBT_DEBUG("Testany on inactive handles, returning flag=1 but empty status");
       //all requests are null or inactive, return true
       *flag = 1;
+      *index = MPI_UNDEFINED;
       Status::empty(status);
   }
 
@@ -684,7 +720,8 @@ int Request::testall(int count, MPI_Request requests[], int* outflag, MPI_Status
 {
   MPI_Status stat;
   MPI_Status *pstat = status == MPI_STATUSES_IGNORE ? MPI_STATUS_IGNORE : &stat;
-  int flag, error=0;
+  int flag;
+  int error = 0;
   int ret=MPI_SUCCESS;
   *outflag = 1;
   for(int i=0; i<count; i++){
@@ -750,7 +787,7 @@ void Request::iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
   s4u::Mailbox* mailbox;
 
   request->print_request("New iprobe");
-  // We have to test both mailboxes as we don't know if we will receive one one or another
+  // We have to test both mailboxes as we don't know if we will receive one or another
   if (simgrid::config::get_value<int>("smpi/async-small-thresh") > 0) {
     mailbox = smpi_process()->mailbox_small();
     XBT_DEBUG("Trying to probe the perm recv mailbox");
@@ -781,6 +818,7 @@ void Request::iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
       nsleeps++;
   }
   unref(&request);
+  xbt_assert(request == MPI_REQUEST_NULL);
 }
 
 void Request::finish_wait(MPI_Request* request, MPI_Status * status)
@@ -797,43 +835,43 @@ void Request::finish_wait(MPI_Request* request, MPI_Status * status)
     return;
   }
 
-  if (not((req->detached_ != 0) && ((req->flags_ & MPI_REQ_SEND) != 0)) 
-  && ((req->flags_ & MPI_REQ_PREPARED) == 0)
-  && ((req->flags_ & MPI_REQ_GENERALIZED) == 0)) {
+  if ((req->flags_ & (MPI_REQ_PREPARED | MPI_REQ_GENERALIZED | MPI_REQ_FINISHED)) == 0) {
     if(status != MPI_STATUS_IGNORE) {
       int src = req->src_ == MPI_ANY_SOURCE ? req->real_src_ : req->src_;
       status->MPI_SOURCE = req->comm_->group()->rank(src);
       status->MPI_TAG = req->tag_ == MPI_ANY_TAG ? req->real_tag_ : req->tag_;
-      status->MPI_ERROR = req->truncated_ != 0 ? MPI_ERR_TRUNCATE : MPI_SUCCESS;
+      status->MPI_ERROR  = req->truncated_ ? MPI_ERR_TRUNCATE : MPI_SUCCESS;
       // this handles the case were size in receive differs from size in send
       status->count = req->real_size_;
     }
+    //detached send will be finished at the other end
+    if (not(req->detached_ && ((req->flags_ & MPI_REQ_SEND) != 0))) {
+      req->print_request("Finishing");
+      MPI_Datatype datatype = req->old_type_;
+
+      // FIXME Handle the case of a partial shared malloc.
+      if (((req->flags_ & MPI_REQ_ACCUMULATE) != 0) ||
+          (datatype->flags() & DT_FLAG_DERIVED)) { // && (not smpi_is_shared(req->old_buf_))){
+
+        if (not smpi_process()->replaying() && smpi_privatize_global_variables != SmpiPrivStrategies::NONE &&
+            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(simgrid::s4u::Actor::self());
+        }
 
-    req->print_request("Finishing");
-    MPI_Datatype datatype = req->old_type_;
-
-// FIXME Handle the case of a partial shared malloc.
-    if (((req->flags_ & MPI_REQ_ACCUMULATE) != 0) ||
-        (datatype->flags() & DT_FLAG_DERIVED)) { // && (not smpi_is_shared(req->old_buf_))){
-
-      if (not smpi_process()->replaying() && smpi_privatize_global_variables != SmpiPrivStrategies::NONE &&
-          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(simgrid::s4u::Actor::self());
-      }
-
-      if(datatype->flags() & DT_FLAG_DERIVED){
-        // This part handles the problem of non-contignous memory the unserialization at the reception
-        if ((req->flags_ & MPI_REQ_RECV) && datatype->size() != 0)
-          datatype->unserialize(req->buf_, req->old_buf_, req->real_size_/datatype->size() , req->op_);
-        xbt_free(req->buf_);
-      } else if (req->flags_ & MPI_REQ_RECV) { // apply op on contiguous buffer for accumulate
-        if (datatype->size() != 0) {
-          int n = req->real_size_ / datatype->size();
-          req->op_->apply(req->buf_, req->old_buf_, &n, datatype);
+        if(datatype->flags() & DT_FLAG_DERIVED){
+          // This part handles the problem of non-contignous memory the unserialization at the reception
+          if ((req->flags_ & MPI_REQ_RECV) && datatype->size() != 0)
+            datatype->unserialize(req->buf_, req->old_buf_, req->real_size_/datatype->size() , req->op_);
+          xbt_free(req->buf_);
+        } else if (req->flags_ & MPI_REQ_RECV) { // apply op on contiguous buffer for accumulate
+          if (datatype->size() != 0) {
+            int n = req->real_size_ / datatype->size();
+            req->op_->apply(req->buf_, req->old_buf_, &n, datatype);
+          }
+          xbt_free(req->buf_);
         }
-        xbt_free(req->buf_);
       }
     }
   }
@@ -847,8 +885,8 @@ void Request::finish_wait(MPI_Request* request, MPI_Status * status)
     //integrate pseudo-timing for buffering of small messages, do not bother to execute the simcall if 0
     double sleeptime =
         simgrid::s4u::Actor::self()->get_host()->extension<simgrid::smpi::Host>()->orecv(req->real_size());
-    if(sleeptime > 0.0){
-      simcall_process_sleep(sleeptime);
+    if (sleeptime > 0.0) {
+      simgrid::s4u::this_actor::sleep_for(sleeptime);
       XBT_DEBUG("receiving size of %zu : sleep %f ", req->real_size_, sleeptime);
     }
     unref(&(req->detached_sender_));
@@ -876,7 +914,7 @@ int Request::wait(MPI_Request * request, MPI_Status * status)
             int count=(*request)->size_/ (*request)->old_type_->size();
             (*request)->op_->apply(buf, (*request)->buf_, &count, (*request)->old_type_);
           }
-          smpi_free_tmp_buffer(buf);
+          smpi_free_tmp_buffer(static_cast<unsigned char*>(buf));
         }
       }
       if((*request)->nbc_requests_[i]!=MPI_REQUEST_NULL)
@@ -885,6 +923,7 @@ int Request::wait(MPI_Request * request, MPI_Status * status)
     delete[] (*request)->nbc_requests_;
     (*request)->nbc_requests_size_=0;
     unref(request);
+    (*request)=MPI_REQUEST_NULL;
     return ret;
   }
 
@@ -898,7 +937,7 @@ int Request::wait(MPI_Request * request, MPI_Status * status)
       try{
         // this is not a detached send
         simcall_comm_wait((*request)->action_, -1.0);
-      }catch (xbt_ex& e) {
+      } catch (const Exception&) {
         XBT_VERB("Request cancelled");
       }
   }
@@ -961,8 +1000,8 @@ int Request::waitany(int count, MPI_Request requests[], MPI_Status * status)
       try{
         // this is not a detached send
         i = simcall_comm_waitany(comms.data(), comms.size(), -1);
-      }catch (xbt_ex& e) {
-      XBT_INFO("request %d cancelled ",i);
+      } catch (const Exception&) {
+        XBT_INFO("request %d cancelled ", i);
         return i;
       }
 
@@ -1050,7 +1089,6 @@ int Request::waitsome(int incount, MPI_Request requests[], int *indices, MPI_Sta
   int index = 0;
   MPI_Status stat;
   MPI_Status *pstat = status == MPI_STATUSES_IGNORE ? MPI_STATUS_IGNORE : &stat;
-
   index = waitany(incount, (MPI_Request*)requests, pstat);
   if(index==MPI_UNDEFINED) return MPI_UNDEFINED;
   if(status != MPI_STATUSES_IGNORE) {
@@ -1059,7 +1097,8 @@ int Request::waitsome(int incount, MPI_Request requests[], int *indices, MPI_Sta
   indices[count] = index;
   count++;
   for (int i = 0; i < incount; i++) {
-    if((requests[i] != MPI_REQUEST_NULL)) {
+    if (i!=index && requests[i] != MPI_REQUEST_NULL 
+        && not(requests[i]->flags_ & MPI_REQ_FINISHED)) {
       test(&requests[i], pstat,&flag);
       if (flag==1){
         indices[count] = i;
@@ -1079,29 +1118,17 @@ 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>(F2C::f2c_lookup()->at(get_key_id(key, id)));
-}
-
-int Request::add_f()
-{
-  if (F2C::f2c_lookup() == nullptr) {
-    F2C::set_f2c_lookup(new std::unordered_map<std::string, F2C*>);
-  }
-  char key[KEY_SIZE];
-  (*(F2C::f2c_lookup()))[get_key_id(key, F2C::f2c_id())] = this;
-  F2C::f2c_id_increment();
-  return F2C::f2c_id()-1;
+  return static_cast<MPI_Request>(F2C::f2c_lookup()->at(get_key(key,id)));
 }
 
 void Request::free_f(int id)
 {
   if (id != MPI_FORTRAN_REQUEST_NULL) {
     char key[KEY_SIZE];
-    F2C::f2c_lookup()->erase(get_key_id(key, id));
+    F2C::f2c_lookup()->erase(get_key(key, id));
   }
 }
 
-
 int Request::get_status(MPI_Request req, int* flag, MPI_Status * status){
   *flag=0;
 
@@ -1135,7 +1162,7 @@ int Request::grequest_start( MPI_Grequest_query_function *query_fn, MPI_Grequest
   (*request)->flags_ |= MPI_REQ_GENERALIZED;
   (*request)->flags_ |= MPI_REQ_PERSISTENT;
   (*request)->refcount_ = 1;
-  ((*request)->generalized_funcs)=xbt_new0(s_smpi_mpi_generalized_request_funcs_t ,1);
+  ((*request)->generalized_funcs) = new s_smpi_mpi_generalized_request_funcs_t;
   ((*request)->generalized_funcs)->query_fn=query_fn;
   ((*request)->generalized_funcs)->free_fn=free_fn;
   ((*request)->generalized_funcs)->cancel_fn=cancel_fn;
@@ -1156,8 +1183,13 @@ int Request::grequest_complete( MPI_Request request){
 }
 
 void Request::set_nbc_requests(MPI_Request* reqs, int size){
-  nbc_requests_=reqs;
-  nbc_requests_size_=size;
+  nbc_requests_size_ = size;
+  if (size > 0) {
+    nbc_requests_ = reqs;
+  } else {
+    delete[] reqs;
+    nbc_requests_ = nullptr;
+  }
 }
 
 int Request::get_nbc_requests_size(){
index 22690e2..7c8d6e1 100644 (file)
@@ -22,7 +22,7 @@ void Status::empty(MPI_Status * status)
   }
 }
 
-int Status::cancelled(MPI_Status * status)
+int Status::cancelled(const MPI_Status * status)
 {
   return status->cancelled!=0;
 }
@@ -36,7 +36,7 @@ void Status::set_elements (MPI_Status * status, MPI_Datatype , int count){
   status->count=count;
 }
 
-int Status::get_count(MPI_Status * status, MPI_Datatype datatype)
+int Status::get_count(const MPI_Status * status, MPI_Datatype datatype)
 {
   return status->count / datatype->size();
 }
index 8af2975..3376a52 100644 (file)
@@ -19,40 +19,19 @@ static int getfactors(int num, int *nfators, int **factors);
 namespace simgrid{
 namespace smpi{
 
-Topo_Graph::~Topo_Graph()
-{
-  delete[] index_;
-  delete[] edges_;
-}
-
-Topo_Dist_Graph::~Topo_Dist_Graph()
-{
-  delete[] in_;
-  delete[] in_weights_;
-  delete[] out_;
-  delete[] out_weights_;
-}
-
 /*******************************************************************************
  * Cartesian topologies
  ******************************************************************************/
-Topo_Cart::~Topo_Cart()
-{
-  delete[] dims_;
-  delete[] periodic_;
-  delete[] position_;
-}
 
-Topo_Cart::Topo_Cart(int ndims) : ndims_(ndims)
+Topo_Cart::Topo_Cart(int ndims) : ndims_(ndims), dims_(ndims), periodic_(ndims), position_(ndims)
 {
-  dims_ = new int[ndims];
-  periodic_ = new int[ndims];
-  position_ = new int[ndims];
 }
 
 /* reorder is ignored, don't know what would be the consequences of a dumb reordering but neither do I see the point of
  * reordering*/
-Topo_Cart::Topo_Cart(MPI_Comm comm_old, int ndims, int dims[], int periods[], int reorder, MPI_Comm *comm_cart) : Topo_Cart(ndims) {
+Topo_Cart::Topo_Cart(MPI_Comm comm_old, int ndims, const int dims[], const int periods[], int /*reorder*/, MPI_Comm* comm_cart)
+    : Topo_Cart(ndims)
+{
   MPI_Group newGroup;
   MPI_Group oldGroup;
 
@@ -131,7 +110,8 @@ Topo_Cart* Topo_Cart::sub(const int remain_dims[], MPI_Comm *newcomm) {
   return res;
 }
 
-int Topo_Cart::coords(int rank, int maxdims, int coords[]) {
+int Topo_Cart::coords(int rank, int /*maxdims*/, int coords[])
+{
   int nnodes = nnodes_;
   for (int i = 0; i< ndims_; i++ ) {
     nnodes    = nnodes /dims_[i];
@@ -151,7 +131,7 @@ int Topo_Cart::get(int maxdims, int* dims, int* periods, int* coords) {
   return MPI_SUCCESS;
 }
 
-int Topo_Cart::rank(int* coords, int* rank) {
+int Topo_Cart::rank(const int* coords, int* rank) {
   int ndims =ndims_;
   *rank = 0;
   int multiplier = 1;
@@ -407,8 +387,8 @@ static int getfactors(int num, int *nfactors, int **factors) {
     return MPI_SUCCESS;
   }
   /* Allocate the array of prime factors which cannot exceed log_2(num) entries */
-  int sqrtnum = ceil(sqrt(num));
-  int size = ceil(log(num) / log(2));
+  int sqrtnum = ceil(sqrt(double(num)));
+  int size = ceil(log(double(num)) / log(2.0));
   *factors = new int[size];
 
   int i = 0;
index 84d748a..953584f 100644 (file)
@@ -42,7 +42,7 @@ Win::Win(void *base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm,
     bar_ = new s4u::Barrier(comm_size);
   }
   mode_=0;
-
+  errhandler_=MPI_ERRORS_ARE_FATAL;
   comm->add_rma_win(this);
   comm->ref();
 
@@ -84,7 +84,8 @@ Win::~Win(){
   cleanup_attr<Win>();
 }
 
-int Win::attach (void *base, MPI_Aint size){
+int Win::attach(void* /*base*/, MPI_Aint size)
+{
   if (not(base_ == MPI_BOTTOM || base_ == 0))
     return MPI_ERR_ARG;
   base_=0;//actually the address will be given in the RMA calls, as being the disp.
@@ -92,7 +93,8 @@ int Win::attach (void *base, MPI_Aint size){
   return MPI_SUCCESS;
 }
 
-int Win::detach (void *base){
+int Win::detach(const void* /*base*/)
+{
   base_=MPI_BOTTOM;
   size_=-1;
   return MPI_SUCCESS;
@@ -149,7 +151,7 @@ void Win::set_info(MPI_Info info){
   info_=info;
 }
 
-void Win::set_name(char* name){
+void Win::set_name(const char* name){
   name_ = xbt_strdup(name);
 }
 
@@ -187,7 +189,7 @@ int Win::fence(int assert)
   return MPI_SUCCESS;
 }
 
-int Win::put( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
+int Win::put(const 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_Request* request)
 {
   //get receiver pointer
@@ -309,7 +311,7 @@ int Win::get( void *origin_addr, int origin_count, MPI_Datatype origin_datatype,
 }
 
 
-int Win::accumulate( void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,
+int Win::accumulate(const 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_Op op, MPI_Request* request)
 {
   XBT_DEBUG("Entering MPI_Win_Accumulate");
@@ -364,10 +366,10 @@ int Win::accumulate( void *origin_addr, int origin_count, MPI_Datatype origin_da
   return MPI_SUCCESS;
 }
 
-int Win::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_Request* request){
-
+int Win::get_accumulate(const 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_Request*)
+{
   //get sender pointer
   MPI_Win send_win = connected_wins_[target_rank];
 
@@ -402,7 +404,7 @@ int Win::get_accumulate( void *origin_addr, int origin_count, MPI_Datatype origi
 
 }
 
-int Win::compare_and_swap(void *origin_addr, void *compare_addr,
+int Win::compare_and_swap(const void *origin_addr, void *compare_addr,
         void *result_addr, MPI_Datatype datatype, int target_rank,
         MPI_Aint target_disp){
   //get sender pointer
@@ -433,7 +435,8 @@ int Win::compare_and_swap(void *origin_addr, void *compare_addr,
   return MPI_SUCCESS;
 }
 
-int Win::start(MPI_Group group, int assert){
+int Win::start(MPI_Group group, int /*assert*/)
+{
   /* From MPI forum advices
   The call to MPI_WIN_COMPLETE does not return until the put call has completed at the origin; and the target window
   will be accessed by the put operation only after the call to MPI_WIN_START has matched a call to MPI_WIN_POST by
@@ -475,7 +478,8 @@ int Win::start(MPI_Group group, int assert){
   return MPI_SUCCESS;
 }
 
-int Win::post(MPI_Group group, int assert){
+int Win::post(MPI_Group group, int /*assert*/)
+{
   //let's make a synchronous send here
   int i             = 0;
   int j             = 0;
@@ -574,7 +578,8 @@ int Win::wait(){
   return MPI_SUCCESS;
 }
 
-int Win::lock(int lock_type, int rank, int assert){
+int Win::lock(int lock_type, int rank, int /*assert*/)
+{
   MPI_Win target_win = connected_wins_[rank];
 
   if ((lock_type == MPI_LOCK_EXCLUSIVE && target_win->mode_ != MPI_LOCK_SHARED)|| target_win->mode_ == MPI_LOCK_EXCLUSIVE){
@@ -732,5 +737,16 @@ int Win::shared_query(int rank, MPI_Aint* size, int* disp_unit, void* baseptr)
   }
   return MPI_SUCCESS;
 }
+
+MPI_Errhandler Win::errhandler(){
+  return errhandler_;
+}
+
+void Win::set_errhandler(MPI_Errhandler errhandler){
+  errhandler_=errhandler;
+  if(errhandler_!= MPI_ERRHANDLER_NULL)
+    errhandler->ref();
+}
+
 }
 }
index e0e44e0..852bf1c 100644 (file)
@@ -19,10 +19,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(plugin_pampi, smpi, "Logging specific to the AMP
 
 static std::vector<size_t> memory_size(500, 0); // FIXME cheinrich This needs to be dynamic
 static std::map</*address*/ void*, size_t> alloc_table; // Keep track of all allocations
-extern "C" XBT_PUBLIC void* _sampi_malloc(size_t); // FIXME Use declarations from sampi.h instead
-extern "C" XBT_PUBLIC void _sampi_free(void* ptr);
-extern "C" XBT_PUBLIC void* _sampi_calloc(size_t num_elm, size_t elem_size);
-extern "C" XBT_PUBLIC void* _sampi_realloc(void* ptr, size_t size);
+
 extern "C" void* _sampi_malloc(size_t size)
 {
   void* result = xbt_malloc(size);
index 987ce39..cc67e00 100644 (file)
@@ -42,14 +42,6 @@ bool compare_hosts::operator()(simgrid::s4u::Host* const a, simgrid::s4u::Host*
 }
 
 
-LoadBalancer::LoadBalancer()
-{
-}
-
-LoadBalancer::~LoadBalancer()
-{
-}
-
 void LoadBalancer::run()
 {
   simgrid::s4u::Engine* engine                     = simgrid::s4u::Engine::get_instance();
@@ -144,9 +136,9 @@ simgrid::s4u::Host* LoadBalancer::get_mapping(simgrid::s4u::ActorPtr actor)
   return new_mapping.get_host(actor);
 }
 
-void LoadBalancer::record_actor_computation(simgrid::s4u::ActorPtr actor, double load)
+void LoadBalancer::record_actor_computation(simgrid::s4u::Actor const& actor, double load)
 {
-  actor_computation[actor->get_pid()] += load;
+  actor_computation[actor.get_pid()] += load;
 }
 }
 }
index 69b2dae..4924337 100644 (file)
@@ -14,8 +14,6 @@ namespace loadbalancer {
 
 class XBT_PRIVATE Mapping {
 public:
-  Mapping() = default;
-  ~Mapping() = default;
   /** Each host can have an arbitrary number of actors -> multimap **/
   typedef std::unordered_multimap<simgrid::s4u::Host*, simgrid::s4u::ActorPtr> host_to_actors_map_t;
   host_to_actors_map_t host_to_actors;
@@ -62,8 +60,6 @@ class XBT_PRIVATE LoadBalancer
   std::map</*proc id*/int, double> actor_computation;
 
 public:
-  LoadBalancer();
-  ~LoadBalancer();
   void run();
   void assign(simgrid::s4u::ActorPtr actor, simgrid::s4u::Host* host);
   
@@ -71,7 +67,7 @@ public:
    * FIXME These are functions used for testing and should be re-written or removed
    */
   simgrid::s4u::Host* get_mapping(simgrid::s4u::ActorPtr);
-  void record_actor_computation(simgrid::s4u::ActorPtr actor, double load);
+  void record_actor_computation(simgrid::s4u::Actor const& actor, double load);
 };
 
 }
index 72a68ca..c58d907 100644 (file)
@@ -50,7 +50,7 @@ public:
   void kernel(simgrid::xbt::ReplayAction&)
   {
     static std::map<simgrid::s4u::ActorPtr, int> migration_call_counter;
-    static simgrid::s4u::Barrier smpilb_bar(smpi_process_count());
+    static simgrid::s4u::Barrier smpilb_bar(smpi_get_universe_size());
     simgrid::s4u::Host* cur_host = simgrid::s4u::this_actor::get_host();
     simgrid::s4u::Host* migrate_to_host;
 
@@ -136,9 +136,9 @@ void sg_load_balancer_plugin_init()
   static bool done = false;
   if (!done) {
     done = true;
-    simgrid::kernel::activity::ExecImpl::on_completion.connect([](simgrid::kernel::activity::ExecImpl const& activity) {
-      simgrid::smpi::plugin::lb.record_actor_computation(activity.simcalls_.front()->issuer->iface(),
-                                                         activity.surf_action_->get_cost());
+    simgrid::s4u::Exec::on_completion.connect([](simgrid::s4u::Actor const& actor, simgrid::s4u::Exec const& exec) {
+
+      simgrid::smpi::plugin::lb.record_actor_computation(actor, exec.get_cost());
     });
 
     xbt_replay_action_register(
index 72898c5..f12a751 100644 (file)
@@ -4,16 +4,18 @@
 #include "xbt/replay.hpp"
 #include "xbt/str.h"
 
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_replay);
+
 int main(int argc, char* argv[])
 {
-  if (simgrid::s4u::Actor::self().get() == nullptr) {
-    printf("smpireplaymain should not be called directly. Please use smpirun -replay instead.\n");
+  if (simgrid::s4u::Actor::self() == nullptr) {
+    XBT_ERROR("smpireplaymain should not be called directly. Please use smpirun -replay instead.");
     return 1;
   }
 
   auto properties = simgrid::s4u::Actor::self()->get_properties();
   if (properties->find("smpi_replay") == properties->end()) {
-    printf("invalid smpireplaymain execution. Please use smpirun -replay instead.\n");
+    XBT_ERROR("invalid smpireplaymain execution. Please use smpirun -replay instead.");
     return 1;
   }
 
index 3cc7a6a..e609cea 100755 (executable)
@@ -23,14 +23,14 @@ else
     LINKER_UNDEFINED_ERROR="1"
 fi
 
-list_set CFLAGS
-list_set LINKARGS "-lm"
+list_set CFLAGS @SMPI_C_FLAGS@
+list_add LINKARGS
 if [ "x@WIN32@" = "x1" ]; then
     list_add CFLAGS "-include" "@includedir@/smpi/smpi_main.h"
     list_add LINKARGS "@libdir@\libsimgrid.dll"
 elif [ "x@APPLE@" = "x1" ]; then
     list_add CFLAGS "-include" "@includedir@/smpi/smpi_helpers.h"
-    list_add CFLAGS "-fpic"
+    list_add CFLAGS "-fPIC"
     if [ "x${SMPI_PRETEND_CC}" = "x" ]; then
        list_add LINKARGS "-shared"
     else
@@ -39,7 +39,7 @@ elif [ "x@APPLE@" = "x1" ]; then
     list_add LINKARGS "-lsimgrid" ${LINKER_UNDEFINED_ERROR:+"-Wl,-undefined,error"}
 else
     list_add CFLAGS "-include" "@includedir@/smpi/smpi_helpers.h"
-    list_add CFLAGS "-fpic"
+    list_add CFLAGS "-fPIC"
     if [ "x${SMPI_PRETEND_CC}" = "x" ]; then
        list_add LINKARGS "-shared"
     else
@@ -48,6 +48,8 @@ else
     list_add LINKARGS "-lsimgrid" ${LINKER_UNDEFINED_ERROR:+"-Wl,-z,defs"}
 fi
 
+# By default, we execute the commands instead of only showing them to cmake
+Show=
 
 list_set CMDARGS
 while [ $# -gt 0 ]; do
@@ -80,7 +82,11 @@ while [ $# -gt 0 ]; do
         '-compiler-version' | '--compiler-version')
             ${CC} --version
             ;;
-        *)
+       '-show'|'-compile-info'|'-link-info')
+            # Dry run displaying commands instead of executing them. Useful to cmake
+           Show=echo
+           ;;
+        *)
             list_add CMDARGS "${ARG}"
             ;;
     esac
@@ -94,4 +100,4 @@ list_add_not_empty CMDLINE "${CMDARGS}"
 list_add_not_empty CMDLINE "${LINKARGS}"
 
 eval $(list_get CMDLINE)
-"$@"
+$Show "$@"
index 9b45519..b8d6d40 100755 (executable)
@@ -16,11 +16,11 @@ CMAKE_LINKARGS="-L@libdir@"
 
 @SMPITOOLS_SH@
 
-list_set CXXFLAGS "-std=gnu++11"
+list_set CXXFLAGS "-std=gnu++11" @SMPI_CXX_FLAGS@
 list_set LINKARGS
 if [ "@WIN32@" != "1" ]; then
     list_add CXXFLAGS "-include" "@includedir@/smpi/smpi_helpers.h"
-    list_add CXXFLAGS "-fpic"
+    list_add CXXFLAGS "-fPIC"
     if [ "x${SMPI_PRETEND_CC}" = "x" ]; then
        list_add LINKARGS "-shared"
     else
@@ -32,6 +32,9 @@ else
     list_add LINKARGS "@libdir@\libsimgrid.dll"
 fi
 
+# By default, we execute the commands instead of only showing them to cmake
+show=
+
 list_set CMDARGS
 while [ $# -gt 0 ]; do
     ARG="$1"
@@ -60,6 +63,10 @@ while [ $# -gt 0 ]; do
         '-compiler-version' | '--compiler-version')
             ${CXX} --version
             ;;
+       '-show'|'-compile-info'|'-link-info')
+            # Dry run displaying commands instead of executing them. Useful to cmake
+           show=1
+           ;;
         *)
             list_add CMDARGS "${ARG}"
       ;;
@@ -74,4 +81,8 @@ list_add_not_empty CMDLINE "${CMDARGS}"
 list_add_not_empty CMDLINE "${LINKARGS}"
 
 eval $(list_get CMDLINE)
+if [ "x$VERBOSE" = x1 -o "x$show" = x1 ] ; then
+  echo "$@"
+  [ "x$show" = x1 ] && exit 0
+fi
 "$@"
index aa51d8b..68928b5 100644 (file)
@@ -41,6 +41,9 @@ filter_and_compile() {
 
 NEEDS_OUTPUT=1
 
+# By default, we execute the commands instead of only showing them to cmake
+Show=
+
 list_set CMDLINE "${REAL_FORTRAN_COMPILER}"
 list_add_not_empty CMDLINE "${FFLAGS}"
 while [ $# -gt 0 ]; do
@@ -80,6 +83,10 @@ while [ $# -gt 0 ]; do
             NEEDS_OUTPUT=0
             shift
             ;;
+       '-show'|'-compile-info'|'-link-info')
+            # Dry run displaying commands instead of executing them. Useful to cmake
+           Show=echo
+           ;;
         *)
             list_add CMDLINE "${ARG}"
             ;;
@@ -95,4 +102,4 @@ list_add_not_empty CMDLINE ${CMAKE_LINKARGS}
 list_add_not_empty CMDLINE "${LINKARGS}"
 
 eval $(list_get CMDLINE)
-"$@"
+$Show "$@"
index ea270a4..6b23f7c 100644 (file)
@@ -56,6 +56,9 @@ filter_and_compile_f90() {
 TRACE_CALL_LOCATION=0
 NEEDS_OUTPUT=1
 
+# By default, we execute the commands instead of only showing them to cmake
+Show=
+
 list_set CMDLINE "${REAL_FORTRAN_COMPILER}"
 list_add_not_empty CMDLINE "${FFLAGS}"
 while [ $# -gt 0 ]; do
@@ -113,6 +116,10 @@ while [ $# -gt 0 ]; do
             NEEDS_OUTPUT=0
             shift
             ;;
+       '-show'|'-compile-info'|'-link-info')
+            # Dry run displaying commands instead of executing them. Useful to cmake
+           Show=echo
+           ;;
         *)
             list_add CMDLINE "${ARG}"
             ;;
@@ -128,4 +135,4 @@ list_add_not_empty CMDLINE ${CMAKE_LINKARGS}
 list_add_not_empty CMDLINE "${LINKARGS}"
 
 eval $(list_get CMDLINE)
-"$@"
+$Show "$@"
index 03c6264..466610e 100755 (executable)
@@ -72,6 +72,7 @@ HOSTFILE=""
 HOSTFILETMP=0
 MAPOPT=0
 REPLAY=0
+QUIET=""
 
 unset pid
 
@@ -202,6 +203,10 @@ while true; do
             SIMOPTS="$SIMOPTS --cfg=smpi/keep-temps:yes"
             shift 1
             ;;
+       "-quiet")
+           QUIET="true"
+           shift 1
+           ;;
         "-wrapper")
             WRAPPER="$2"
             shift 2
@@ -273,7 +278,7 @@ else
     shift
 fi
 
-# steel --cfg and --logs options
+# steal --cfg and --logs options
 while [ $# -gt 0 ]; do
     case "$1" in
         "--cfg="*|"--log="*)
@@ -299,32 +304,47 @@ fi
 if [ -z "${HOSTFILE}" ] ; then
     HOSTFILETMP=1
     HOSTFILE="$(mktemp smpitmp-hostfXXXXXX)"
-    perl -ne 'print "$1\n" if /.*<host.*?id="(.*?)".*?\/>.*/' ${PLATFORM} > ${HOSTFILE}
-    # put all <cluster tag on its own line.
-    cat ${PLATFORM} | tr '\n' ' ' | sed 's/<cluster/\n<cluster/' | \
-      perl -ne 'if (m/.*<cluster.*?prefix="(.*?)".*?radical="(.*?)".*?suffix="(.*?)".*/s) {
-                my ($pre,$rad,$post)=($1,$2,$3);
-               for my $elm (split(",",$rad)) {
-                 if ($elm=~/^([^-]*?)-([^-]*)$/) {
-                    for (my $i=$1; $i<=$2;$i++) {
-                       print "$pre$i$post\n";
-                    }
-                 } else {
-                    print "$pre$elm$post\n";
-                 }
-               }
-             } elsif (/<cluster/) {
-            die ("Unparsable cluster tag. smpirun uses a primitive regular expression to parse cluster tags. Either provide a hostfile yourself or give the attributes prefix, radical and suffix IN THAT ORDER.");
-             }' ${PLATFORM} >> ${HOSTFILE}
+    @PYTHON_EXECUTABLE@ -c '
+import xml.etree.ElementTree as ET
+import sys
+import re
+
+tree = ET.parse(sys.stdin)
+
+for elem in tree.findall(".//host"):
+    print(elem.attrib["id"])
+
+for elem in tree.findall(".//cluster"):
+    prefix = elem.attrib["prefix"]
+    radical = elem.attrib["radical"]
+    suffix = elem.attrib["suffix"]
+    for r in radical.split(","):
+        m = re.match("^([^-]*?)-([^-]*)$", r)
+        if m:
+            for i in range(int(m.group(1)), int(m.group(2))):
+                print(prefix + str(i) + suffix)
+        else:
+            print(prefix + r + suffix)
+            ' < ${PLATFORM} > ${HOSTFILE}
 fi
 UNROLLEDHOSTFILETMP=0
 
-#parse if our lines are terminated by :num_process
-multiple_processes=$(grep -c ":" $HOSTFILE)
-if [ "${multiple_processes}" -gt 0 ] ; then
+# parse if our lines are terminated by :num_process
+if grep -q ':' $HOSTFILE ; then
     UNROLLEDHOSTFILETMP=1
     UNROLLEDHOSTFILE="$(mktemp smpitmp-hostfXXXXXX)"
-    perl -ne ' do{ for ( 1 .. $2 ) { print "$1\n" } } if /(.*?):(\d+).*/'  ${HOSTFILE}  > ${UNROLLEDHOSTFILE}
+    @PYTHON_EXECUTABLE@ -c '
+import sys
+import re
+
+for line in sys.stdin:
+    m = re.match("(.*):(.*)", line)
+    if m:
+        for i in range(0, int(m.group(2))):
+            print(m.group(1))
+    else:
+        print(line.strip())
+' < ${HOSTFILE}  > ${UNROLLEDHOSTFILE}
     if [ ${HOSTFILETMP} = 1 ] ; then
         rm ${HOSTFILE}
         HOSTFILETMP=0
@@ -505,6 +525,7 @@ if [ -n "${TRACE_ACTIVE}" ]; then
 fi
 ##---------------------- end SMPI TRACING OPTIONS ---------------------------------
 
+# Do not remove, this variable may be used by user code (e.g. StarPU)
 export SMPI_GLOBAL_SIZE=${NUMPROCS}
 if [ -n "${KEEP}" ] ; then
     echo ${EXEC} ${PRIVATIZE} ${TRACEOPTIONS} ${SIMOPTS} ${PLATFORMTMP} ${APPLICATIONTMP}
@@ -543,7 +564,7 @@ pid=""
 # Keep temporary files on failures to help debugging
 #
 if [ ${status} -ne 0 ] ; then
-    if [ -z "${KEEP}" ]; then
+    if [ -z "${KEEP}" -a -z "${QUIET}" ]; then
         echo ${EXEC} ${PRIVATIZE} ${TRACEOPTIONS} ${SIMOPTS} ${PLATFORMTMP} ${APPLICATIONTMP}
         if [ ${HOSTFILETMP} = 1 ] ; then
             echo "Generated hostfile ${HOSTFILE} kept."
@@ -551,9 +572,9 @@ if [ ${status} -ne 0 ] ; then
         if [ ${UNROLLEDHOSTFILETMP} = 1 ] ; then
             echo "Generated unrolled hostfile ${UNROLLEDHOSTFILE} kept."
         fi
+        KEEP=true
     fi
     echo "Execution failed with code ${status}."
-    KEEP=true
 fi
 
 smpirun_cleanup
index 65ef772..9aa0a2a 100644 (file)
@@ -12,42 +12,41 @@ LISTSEP="$(printf '\b')"
 # Create a temporary file, with its name of the form $1_XXX$2, where XXX is replaced by an unique string.
 # $1: prefix, $2: suffix
 mymktemp () {
-    tmp=$(mktemp --suffix="$2" "$1_XXXXXXXXXX" 2> /dev/null)
-    if [ -z "$tmp" ]; then
+    local_tmp=$(mktemp --suffix="$2" "$1_XXXXXXXXXX" 2> /dev/null)
+    if [ -z "$local_tmp" ]; then
         # mktemp failed (unsupported --suffix ?), try unsafe mode
-        tmp=$(mktemp -u "$1_XXXXXXXXXX" 2> /dev/null)
-        if [ -z "$tmp" ]; then
+        local_tmp=$(mktemp -u "$1_XXXXXXXXXX" 2> /dev/null)
+        if [ -z "$local_tmp" ]; then
             # mktemp failed again (doesn't exist ?), try very unsafe mode
             if [ -z "${mymktemp_seq}" ]; then
                 mymktemp_seq=$(date +%d%H%M%S)
             fi
-            tmp="$1_$$x${mymktemp_seq}"
+            local_tmp="$1_$$x${mymktemp_seq}"
             mymktemp_seq=$((mymktemp_seq + 1))
         fi
-        tmp="${tmp}$2"
+        local_tmp="${local_tmp}$2"
         # create temp file, and exit if it existed before
-        sh -C -c "true > \"${tmp}\"" || exit 1
+        sh -C -c "true > \"${local_tmp}\"" || exit 1
     fi
-    echo "${tmp}"
+    echo "${local_tmp}"
 }
 
 # Add a word to the end of a list (words separated by LISTSEP)
 # $1: list, $2...: words to add
 list_add () {
-    local list content newcontent
-    list="$1"
+    local_list="$1"
     shift
     if [ $# -gt 0 ]; then
-        eval content=\"\${$list}\"
+        eval local_content=\"\${$local_list}\"
         IFS="$LISTSEP"
-        newcontent="$*"
+        local_newcontent="$*"
         IFS="$SAVEIFS"
-        if [ -z "$content" ]; then
-            content="$newcontent"
+        if [ -z "$local_content" ]; then
+            local_content="$local_newcontent"
         else
-            content="$content${LISTSEP}$newcontent"
+            local_content="$local_content${LISTSEP}$local_newcontent"
         fi
-        eval $list=\"\${content}\"
+        eval $local_list=\"\${local_content}\"
     fi
 }
 
index 088e848..c5817fe 100644 (file)
@@ -27,8 +27,7 @@ static inline double has_cost(const double* array, size_t pos)
 {
   if (array)
     return array[pos];
-  else
-    return -1.0;
+  return -1.0;
 }
 
 kernel::resource::Action* HostModel::execute_parallel(const std::vector<s4u::Host*>& host_list,
@@ -88,11 +87,14 @@ HostImpl::~HostImpl()
       msg += "\n\t" + std::string(process.get_name());
 
     SIMIX_display_process_status();
-    THROWF(arg_error, 0, "%s", msg.c_str());
+    xbt_die("%s", msg.c_str());
   }
   for (auto const& arg : actors_at_boot_)
     delete arg;
   actors_at_boot_.clear();
+
+  for (auto const& d : disks_)
+    d->destroy();
 }
 
 /** Re-starts all the actors that are marked as restartable.
@@ -104,7 +106,9 @@ void HostImpl::turn_on()
   for (auto const& arg : actors_at_boot_) {
     XBT_DEBUG("Booting Actor %s(%s) right now", arg->name.c_str(), arg->host->get_cname());
     simgrid::kernel::actor::ActorImplPtr actor = simgrid::kernel::actor::ActorImpl::create(
-        arg->name.c_str(), arg->code, nullptr, arg->host, arg->properties.get(), nullptr);
+        arg->name, arg->code, nullptr, arg->host, arg->properties.get(), nullptr);
+    if (arg->on_exit)
+      *actor->on_exit = *arg->on_exit;
     if (arg->kill_time >= 0)
       actor->set_kill_time(arg->kill_time);
     if (arg->auto_restart)
@@ -146,14 +150,40 @@ size_t HostImpl::get_actor_count()
 {
   return process_list_.size();
 }
+
+std::vector<s4u::Disk*> HostImpl::get_disks()
+{
+  std::vector<s4u::Disk*> disks;
+  for (auto const& d : disks_)
+    disks.push_back(&d->piface_);
+  return disks;
+}
+
+void HostImpl::add_disk(s4u::Disk* disk)
+{
+  disks_.push_back(disk->get_impl());
+}
+
+void HostImpl::remove_disk(const std::string& disk_name)
+{
+  auto position = disks_.begin();
+  for (auto const& d : disks_) {
+    if (d->get_name() == disk_name) {
+      disks_.erase(position);
+      break;
+    }
+    position++;
+  }
+}
+
 std::vector<const char*> HostImpl::get_attached_storages()
 {
   std::vector<const char*> storages;
   for (auto const& s : storage_)
-    if (s.second->getHost() == piface_->get_cname())
+    if (s.second->get_host() == piface_->get_cname())
       storages.push_back(s.second->piface_.get_cname());
   return storages;
 }
 
-}
-}
+} // namespace surf
+} // namespace simgrid
index 628569b..6583e66 100644 (file)
@@ -7,6 +7,7 @@
 #define SURF_HOST_INTERFACE_HPP_
 
 #include "src/kernel/actor/ActorImpl.hpp"
+#include "src/kernel/resource/DiskImpl.hpp"
 #include "src/surf/PropertyHolder.hpp"
 #include "src/surf/StorageImpl.hpp"
 #include "src/surf/cpu_interface.hpp"
@@ -47,10 +48,16 @@ public:
   explicit HostImpl(s4u::Host* host);
   virtual ~HostImpl();
 
+  std::vector<s4u::Disk*> get_disks();
+  void add_disk(s4u::Disk* disk);
+  void remove_disk(const std::string& disk_name);
+
   /** @brief Get the vector of storages (by names) attached to the Host */
   virtual std::vector<const char*> get_attached_storages();
 
   std::map<std::string, kernel::resource::StorageImpl*> storage_;
+  std::vector<kernel::resource::DiskImpl*> disks_;
+
   s4u::Host* piface_ = nullptr;
 
   void turn_on();
index 39be42b..bf262b9 100644 (file)
@@ -5,17 +5,15 @@
 
 #include "PropertyHolder.hpp"
 
+#include <map>
+
 namespace simgrid {
 namespace surf {
 
-PropertyHolder::~PropertyHolder() {
-  delete properties_;
-}
-
 /** @brief Return the property associated to the provided key (or nullptr if not existing) */
-const char* PropertyHolder::get_property(const std::string& key)
+const char* PropertyHolder::get_property(const std::string& key) const
 {
-  if (properties_ == nullptr)
+  if (not properties_)
     return nullptr;
   auto prop = properties_->find(key);
   return prop == properties_->end() ? nullptr : prop->second.c_str();
@@ -25,17 +23,34 @@ const char* PropertyHolder::get_property(const std::string& key)
 void PropertyHolder::set_property(const std::string& key, const std::string& value)
 {
   if (not properties_)
-    properties_ = new std::unordered_map<std::string, std::string>;
+    properties_.reset(new std::unordered_map<std::string, std::string>);
   (*properties_)[key] = value;
 }
 
 /** @brief Return the whole set of properties. Don't mess with it, dude! */
-std::unordered_map<std::string, std::string>* PropertyHolder::get_properties()
+const std::unordered_map<std::string, std::string>* PropertyHolder::get_properties()
 {
   if (not properties_)
-    properties_ = new std::unordered_map<std::string, std::string>;
-  return properties_;
+    properties_.reset(new std::unordered_map<std::string, std::string>);
+  return properties_.get();
 }
 
+/** @brief Change the value of the given keys in the property set */
+template <class Assoc> void PropertyHolder::set_properties(const Assoc& properties)
+{
+  if (not properties_)
+    properties_.reset(new std::unordered_map<std::string, std::string>);
+  std::unordered_map<std::string, std::string> props(properties.cbegin(), properties.cend());
+#if __cplusplus >= 201703L
+  props.merge(properties_);
+#else
+  props.insert(properties_->cbegin(), properties_->cend());
+#endif
+  properties_->swap(props);
+}
+
+template void PropertyHolder::set_properties(const std::map<std::string, std::string>& properties);
+template void PropertyHolder::set_properties(const std::unordered_map<std::string, std::string>& properties);
+
 } /* namespace surf */
 } /* namespace simgrid */
index 95d7987..2c7cdce 100644 (file)
@@ -5,6 +5,8 @@
 
 #ifndef SRC_SURF_PROPERTYHOLDER_HPP_
 #define SRC_SURF_PROPERTYHOLDER_HPP_
+
+#include <memory>
 #include <string>
 #include <unordered_map>
 
@@ -21,18 +23,15 @@ public:
   PropertyHolder() = default;
   PropertyHolder(const PropertyHolder&) = delete;
   PropertyHolder& operator=(const PropertyHolder&) = delete;
-  ~PropertyHolder();
 
-  const char* get_property(const std::string& key);
+  const char* get_property(const std::string& key) const;
   void set_property(const std::string& id, const std::string& value);
 
-  /* FIXME: This should not be exposed, as users may do bad things with the map they got (it's not a copy).
-   * But some user API expose this call so removing it is not so easy.
-   */
-  std::unordered_map<std::string, std::string>* get_properties();
+  const std::unordered_map<std::string, std::string>* get_properties();
+  template <class Assoc> void set_properties(const Assoc& properties);
 
 private:
-  std::unordered_map<std::string, std::string>* properties_ = nullptr;
+  std::unique_ptr<std::unordered_map<std::string, std::string>> properties_ = nullptr;
 };
 
 } /* namespace surf */
index 9cdc554..8821467 100644 (file)
@@ -41,19 +41,19 @@ StorageImpl::StorageImpl(kernel::resource::Model* model, const std::string& name
     : Resource(model, name, maxminSystem->constraint_new(this, std::max(bread, bwrite)))
     , piface_(name, this)
     , typeId_(type_id)
-    , content_name(content_name)
+    , content_name_(content_name)
     , size_(size)
     , attach_(attach)
 {
   StorageImpl::turn_on();
   XBT_DEBUG("Create resource with Bread '%f' Bwrite '%f' and Size '%llu'", bread, bwrite, size);
-  constraintRead_  = maxminSystem->constraint_new(this, bread);
-  constraintWrite_ = maxminSystem->constraint_new(this, bwrite);
+  constraint_read_  = maxminSystem->constraint_new(this, bread);
+  constraint_write_ = maxminSystem->constraint_new(this, bwrite);
 }
 
 StorageImpl::~StorageImpl()
 {
-  xbt_assert(currentlyDestroying_, "Don't delete Storages directly. Call destroy() instead.");
+  xbt_assert(currently_destroying_, "Don't delete Storages directly. Call destroy() instead.");
 }
 
 /** @brief Fire the required callbacks and destroy the object
@@ -62,8 +62,8 @@ StorageImpl::~StorageImpl()
  */
 void StorageImpl::destroy()
 {
-  if (not currentlyDestroying_) {
-    currentlyDestroying_ = true;
+  if (not currently_destroying_) {
+    currently_destroying_ = true;
     s4u::Storage::on_destruction(this->piface_);
     delete this;
   }
index ff68774..3590cae 100644 (file)
@@ -8,7 +8,6 @@
 #include "simgrid/kernel/resource/Resource.hpp"
 #include "simgrid/s4u/Io.hpp"
 #include "simgrid/s4u/Storage.hpp"
-#include "src/kernel/resource/profile/trace_mgr.hpp"
 #include "src/surf/PropertyHolder.hpp"
 #include "surf_interface.hpp"
 
@@ -82,7 +81,7 @@ public:
   void turn_off() override;
 
   void destroy(); // Must be called instead of the destructor
-  virtual Action* io_start(sg_size_t size, s4u::Io::OpType type) = 0;
+  virtual StorageAction* io_start(sg_size_t size, s4u::Io::OpType type) = 0;
   /**
    * @brief Read a file
    *
@@ -98,17 +97,17 @@ public:
    * @return The StorageAction corresponding to the writing
    */
   virtual StorageAction* write(sg_size_t size) = 0;
-  virtual std::string getHost() { return attach_; }
+  const std::string& get_host() const { return attach_; }
 
-  lmm::Constraint* constraintWrite_; /* Constraint for maximum write bandwidth*/
-  lmm::Constraint* constraintRead_;  /* Constraint for maximum write bandwidth*/
+  lmm::Constraint* constraint_write_; /* Constraint for maximum write bandwidth*/
+  lmm::Constraint* constraint_read_;  /* Constraint for maximum write bandwidth*/
 
   std::string typeId_;
-  std::string content_name; // Only used at parsing time then goes to the FileSystemExtension
+  std::string content_name_; // Only used at parsing time then goes to the FileSystemExtension
   sg_size_t size_;          // Only used at parsing time then goes to the FileSystemExtension
 
 private:
-  bool currentlyDestroying_ = false;
+  bool currently_destroying_ = false;
   // 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_;
index 114e9e1..e947415 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "cpu_cas01.hpp"
 #include "simgrid/sg_config.hpp"
+#include "src/kernel/resource/profile/Event.hpp"
 #include "src/surf/cpu_ti.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "surf/surf.hpp"
@@ -39,7 +40,7 @@ void surf_cpu_model_init_Cas01()
   xbt_assert(surf_cpu_model_vm == nullptr, "CPU model already initialized. This should not happen.");
 
   if (cpu_optim_opt == "TI") {
-    simgrid::surf::CpuTiModel::create_pm_vm_models();
+    simgrid::kernel::resource::CpuTiModel::create_pm_vm_models();
     return;
   }
 
@@ -49,26 +50,27 @@ void surf_cpu_model_init_Cas01()
   else
     algo = simgrid::kernel::resource::Model::UpdateAlgo::FULL;
 
-  surf_cpu_model_pm = new simgrid::surf::CpuCas01Model(algo);
-  surf_cpu_model_vm = new simgrid::surf::CpuCas01Model(algo);
+  surf_cpu_model_pm = new simgrid::kernel::resource::CpuCas01Model(algo);
+  surf_cpu_model_vm = new simgrid::kernel::resource::CpuCas01Model(algo);
 }
 
 namespace simgrid {
-namespace surf {
+namespace kernel {
+namespace resource {
 
-CpuCas01Model::CpuCas01Model(kernel::resource::Model::UpdateAlgo algo) : simgrid::surf::CpuModel(algo)
+CpuCas01Model::CpuCas01Model(Model::UpdateAlgo algo) : CpuModel(algo)
 {
   all_existing_models.push_back(this);
 
-  bool select = simgrid::config::get_value<bool>("cpu/maxmin-selective-update");
+  bool select = config::get_value<bool>("cpu/maxmin-selective-update");
 
   if (algo == Model::UpdateAlgo::LAZY) {
-    xbt_assert(select || simgrid::config::is_default("cpu/maxmin-selective-update"),
+    xbt_assert(select || config::is_default("cpu/maxmin-selective-update"),
                "You cannot disable cpu selective update when using the lazy update mechanism");
     select = true;
   }
 
-  set_maxmin_system(new simgrid::kernel::lmm::System(select));
+  set_maxmin_system(new lmm::System(select));
 }
 
 CpuCas01Model::~CpuCas01Model()
@@ -76,7 +78,7 @@ CpuCas01Model::~CpuCas01Model()
   surf_cpu_model_pm = nullptr;
 }
 
-Cpu* CpuCas01Model::create_cpu(simgrid::s4u::Host* host, const std::vector<double>& speed_per_pstate, int core)
+Cpu* CpuCas01Model::create_cpu(s4u::Host* host, const std::vector<double>& speed_per_pstate, int core)
 {
   return new CpuCas01(this, host, speed_per_pstate, core);
 }
@@ -84,8 +86,7 @@ Cpu* CpuCas01Model::create_cpu(simgrid::s4u::Host* host, const std::vector<doubl
 /************
  * Resource *
  ************/
-CpuCas01::CpuCas01(CpuCas01Model* model, simgrid::s4u::Host* host, const std::vector<double>& speed_per_pstate,
-                   int core)
+CpuCas01::CpuCas01(CpuCas01Model* model, s4u::Host* host, const std::vector<double>& speed_per_pstate, int core)
     : Cpu(model, host, model->get_maxmin_system()->constraint_new(this, core * speed_per_pstate.front()),
           speed_per_pstate, core)
 {
@@ -101,13 +102,13 @@ bool CpuCas01::is_used()
 /** @brief take into account changes of speed (either load or max) */
 void CpuCas01::on_speed_change()
 {
-  kernel::lmm::Variable* var = nullptr;
-  const kernel::lmm::Element* elem = nullptr;
+  lmm::Variable* var       = nullptr;
+  const lmm::Element* elem = nullptr;
 
   get_model()->get_maxmin_system()->update_constraint_bound(get_constraint(),
                                                             get_core_count() * speed_.scale * speed_.peak);
   while ((var = get_constraint()->get_variable(&elem))) {
-    CpuCas01Action* action = static_cast<CpuCas01Action*>(var->get_id());
+    auto* action = static_cast<CpuCas01Action*>(var->get_id());
 
     get_model()->get_maxmin_system()->update_variable_bound(action->get_variable(),
                                                             action->requested_core() * speed_.scale * speed_.peak);
@@ -116,7 +117,7 @@ void CpuCas01::on_speed_change()
   Cpu::on_speed_change();
 }
 
-void CpuCas01::apply_event(kernel::profile::Event* event, double value)
+void CpuCas01::apply_event(profile::Event* event, double value)
 {
   if (event == speed_.event) {
     /* TODO (Hypervisor): do the same thing for constraint_core[i] */
@@ -136,21 +137,20 @@ void CpuCas01::apply_event(kernel::profile::Event* event, double value)
         get_host()->turn_on();
       }
     } else {
-      kernel::lmm::Constraint* cnst = get_constraint();
-      kernel::lmm::Variable* var    = nullptr;
-      const kernel::lmm::Element* elem = nullptr;
+      lmm::Constraint* cnst    = get_constraint();
+      lmm::Variable* var       = nullptr;
+      const lmm::Element* elem = nullptr;
       double date              = surf_get_clock();
 
       get_host()->turn_off();
 
       while ((var = cnst->get_variable(&elem))) {
-        kernel::resource::Action* action = static_cast<kernel::resource::Action*>(var->get_id());
+        auto* action = static_cast<Action*>(var->get_id());
 
-        if (action->get_state() == kernel::resource::Action::State::INITED ||
-            action->get_state() == kernel::resource::Action::State::STARTED ||
-            action->get_state() == kernel::resource::Action::State::IGNORED) {
+        if (action->get_state() == Action::State::INITED || action->get_state() == Action::State::STARTED ||
+            action->get_state() == Action::State::IGNORED) {
           action->set_finish_time(date);
-          action->set_state(kernel::resource::Action::State::FAILED);
+          action->set_state(Action::State::FAILED);
         }
       }
     }
@@ -179,17 +179,16 @@ CpuAction* CpuCas01::sleep(double duration)
     duration = std::max(duration, sg_surf_precision);
 
   XBT_IN("(%s,%g)", get_cname(), duration);
-  CpuCas01Action* action =
-      new CpuCas01Action(get_model(), 1.0, not is_on(), speed_.scale * speed_.peak, get_constraint());
+  auto* action = new CpuCas01Action(get_model(), 1.0, not is_on(), speed_.scale * speed_.peak, get_constraint());
 
   // FIXME: sleep variables should not consume 1.0 in System::expand()
   action->set_max_duration(duration);
-  action->suspended_ = kernel::resource::Action::SuspendStates::sleeping;
+  action->set_suspend_state(Action::SuspendStates::SLEEPING);
   if (duration == NO_MAX_DURATION)
-    action->set_state(simgrid::kernel::resource::Action::State::IGNORED);
+    action->set_state(Action::State::IGNORED);
 
-  get_model()->get_maxmin_system()->update_variable_weight(action->get_variable(), 0.0);
-  if (get_model()->get_update_algorithm() == kernel::resource::Model::UpdateAlgo::LAZY) { // remove action from the heap
+  get_model()->get_maxmin_system()->update_variable_penalty(action->get_variable(), 0.0);
+  if (get_model()->get_update_algorithm() == Model::UpdateAlgo::LAZY) { // remove action from the heap
     get_model()->get_action_heap().remove(action);
     // this is necessary for a variable with weight 0 since such variables are ignored in lmm and we need to set its
     // max_duration correctly at the next call to share_resources
@@ -203,19 +202,18 @@ CpuAction* CpuCas01::sleep(double duration)
 /**********
  * Action *
  **********/
-CpuCas01Action::CpuCas01Action(kernel::resource::Model* model, double cost, bool failed, double speed,
-                               kernel::lmm::Constraint* constraint, int requested_core)
+CpuCas01Action::CpuCas01Action(Model* model, double cost, bool failed, double speed, lmm::Constraint* constraint,
+                               int requested_core)
     : CpuAction(model, cost, failed,
                 model->get_maxmin_system()->variable_new(this, 1.0 / requested_core, requested_core * speed, 1))
     , requested_core_(requested_core)
 {
-  if (model->get_update_algorithm() == kernel::resource::Model::UpdateAlgo::LAZY)
+  if (model->get_update_algorithm() == Model::UpdateAlgo::LAZY)
     set_last_update();
   model->get_maxmin_system()->expand(constraint, get_variable(), 1.0);
 }
 
-CpuCas01Action::CpuCas01Action(kernel::resource::Model* model, double cost, bool failed, double speed,
-                               kernel::lmm::Constraint* constraint)
+CpuCas01Action::CpuCas01Action(Model* model, double cost, bool failed, double speed, lmm::Constraint* constraint)
     : CpuCas01Action(model, cost, failed, speed, constraint, /* requested_core */ 1)
 {
 }
@@ -227,5 +225,6 @@ int CpuCas01Action::requested_core()
 
 CpuCas01Action::~CpuCas01Action()=default;
 
-}
-}
+} // namespace resource
+} // namespace kernel
+} // namespace simgrid
index 67ed574..11cdd36 100644 (file)
@@ -11,7 +11,8 @@
  ***********/
 
 namespace simgrid {
-namespace surf {
+namespace kernel {
+namespace resource {
 
 class XBT_PRIVATE CpuCas01Model;
 class XBT_PRIVATE CpuCas01;
@@ -21,14 +22,14 @@ class XBT_PRIVATE CpuCas01Action;
  * Model *
  *********/
 
-class CpuCas01Model : public simgrid::surf::CpuModel {
+class CpuCas01Model : public CpuModel {
 public:
-  explicit CpuCas01Model(kernel::resource::Model::UpdateAlgo algo);
+  explicit CpuCas01Model(Model::UpdateAlgo algo);
   CpuCas01Model(const CpuCas01Model&) = delete;
   CpuCas01Model& operator=(const CpuCas01Model&) = delete;
   ~CpuCas01Model() override;
 
-  Cpu* create_cpu(simgrid::s4u::Host* host, const std::vector<double>& speed_per_pstate, int core) override;
+  Cpu* create_cpu(s4u::Host* host, const std::vector<double>& speed_per_pstate, int core) override;
 };
 
 /************
@@ -37,11 +38,11 @@ public:
 
 class CpuCas01 : public Cpu {
 public:
-  CpuCas01(CpuCas01Model* model, simgrid::s4u::Host* host, const std::vector<double>& speed_per_pstate, int core);
+  CpuCas01(CpuCas01Model* model, s4u::Host* host, const std::vector<double>& speed_per_pstate, int core);
   CpuCas01(const CpuCas01&) = delete;
   CpuCas01& operator=(const CpuCas01&) = delete;
   ~CpuCas01() override;
-  void apply_event(simgrid::kernel::profile::Event* event, double value) override;
+  void apply_event(profile::Event* event, double value) override;
   CpuAction* execution_start(double size) override;
   CpuAction* execution_start(double size, int requested_cores) override;
   CpuAction* sleep(double duration) override;
@@ -55,14 +56,13 @@ protected:
 /**********
  * Action *
  **********/
-class CpuCas01Action: public CpuAction {
-  friend CpuAction *CpuCas01::execution_start(double size);
-  friend CpuAction *CpuCas01::sleep(double duration);
+class CpuCas01Action : public CpuAction {
+  friend CpuAction* CpuCas01::execution_start(double size);
+  friend CpuAction* CpuCas01::sleep(double duration);
+
 public:
-  CpuCas01Action(kernel::resource::Model* model, double cost, bool failed, double speed,
-                 kernel::lmm::Constraint* constraint, int core_count);
-  CpuCas01Action(kernel::resource::Model* model, double cost, bool failed, double speed,
-                 kernel::lmm::Constraint* constraint);
+  CpuCas01Action(Model* model, double cost, bool failed, double speed, lmm::Constraint* constraint, int core_count);
+  CpuCas01Action(Model* model, double cost, bool failed, double speed, lmm::Constraint* constraint);
   CpuCas01Action(const CpuCas01Action&) = delete;
   CpuCas01Action& operator=(const CpuCas01Action&) = delete;
   ~CpuCas01Action() override;
@@ -72,5 +72,6 @@ private:
   int requested_core_ = 1;
 };
 
-}
-}
+} // namespace resource
+} // namespace kernel
+} // namespace simgrid
index 4452435..606961a 100644 (file)
@@ -4,17 +4,19 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "cpu_interface.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "surf/surf.hpp"
 
 XBT_LOG_EXTERNAL_CATEGORY(surf_kernel);
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf, "Logging specific to the SURF cpu module");
 
-simgrid::surf::CpuModel *surf_cpu_model_pm;
-simgrid::surf::CpuModel *surf_cpu_model_vm;
+simgrid::kernel::resource::CpuModel* surf_cpu_model_pm;
+simgrid::kernel::resource::CpuModel* surf_cpu_model_vm;
 
 namespace simgrid {
-namespace surf {
+namespace kernel {
+namespace resource {
 
 /*********
  * Model *
@@ -24,7 +26,7 @@ void CpuModel::update_actions_state_lazy(double now, double /*delta*/)
 {
   while (not get_action_heap().empty() && double_equals(get_action_heap().top_date(), now, sg_surf_precision)) {
 
-    CpuAction* action = static_cast<CpuAction*>(get_action_heap().pop());
+    auto* action = static_cast<CpuAction*>(get_action_heap().pop());
     XBT_CDEBUG(surf_kernel, "Something happened to action %p", action);
 
     action->finish(kernel::resource::Action::State::FINISHED);
@@ -35,15 +37,15 @@ void CpuModel::update_actions_state_lazy(double now, double /*delta*/)
 void CpuModel::update_actions_state_full(double /*now*/, double delta)
 {
   for (auto it = std::begin(*get_started_action_set()); it != std::end(*get_started_action_set());) {
-    CpuAction& action = static_cast<CpuAction&>(*it);
+    auto& action = static_cast<CpuAction&>(*it);
     ++it; // increment iterator here since the following calls to action.finish() may invalidate it
 
     action.update_remains(action.get_variable()->get_value() * delta);
     action.update_max_duration(delta);
 
-    if (((action.get_remains_no_update() <= 0) && (action.get_variable()->get_weight() > 0)) ||
+    if (((action.get_remains_no_update() <= 0) && (action.get_variable()->get_penalty() > 0)) ||
         ((action.get_max_duration() != NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
-      action.finish(kernel::resource::Action::State::FINISHED);
+      action.finish(Action::State::FINISHED);
     }
   }
 }
@@ -51,14 +53,13 @@ void CpuModel::update_actions_state_full(double /*now*/, double delta)
 /************
  * Resource *
  ************/
-Cpu::Cpu(kernel::resource::Model* model, simgrid::s4u::Host* host, const std::vector<double>& speed_per_pstate,
-         int core)
+Cpu::Cpu(Model* model, s4u::Host* host, const std::vector<double>& speed_per_pstate, int core)
     : Cpu(model, host, nullptr /*constraint*/, speed_per_pstate, core)
 {
 }
 
-Cpu::Cpu(kernel::resource::Model* model, simgrid::s4u::Host* host, kernel::lmm::Constraint* constraint,
-         const std::vector<double>& speed_per_pstate, int core)
+Cpu::Cpu(Model* model, s4u::Host* host, lmm::Constraint* constraint, const std::vector<double>& speed_per_pstate,
+         int core)
     : Resource(model, host->get_cname(), constraint)
     , core_count_(core)
     , host_(host)
@@ -129,7 +130,7 @@ void Cpu::set_speed_profile(kernel::profile::Profile* profile)
 {
   xbt_assert(speed_.event == nullptr, "Cannot set a second speed trace to Host %s", host_->get_cname());
 
-  speed_.event = profile->schedule(&future_evt_set, this);
+  speed_.event = profile->schedule(&profile::future_evt_set, this);
 }
 
 
@@ -141,7 +142,7 @@ void CpuAction::update_remains_lazy(double now)
 {
   xbt_assert(get_state_set() == get_model()->get_started_action_set(),
              "You're updating an action that is not running.");
-  xbt_assert(get_priority() > 0, "You're updating an action that seems suspended.");
+  xbt_assert(get_sharing_penalty() > 0, "You're updating an action that seems suspended.");
 
   double delta = now - get_last_update();
 
@@ -157,7 +158,7 @@ void CpuAction::update_remains_lazy(double now)
   set_last_value(get_variable()->get_value());
 }
 
-simgrid::xbt::signal<void(simgrid::surf::CpuAction const&, kernel::resource::Action::State)> CpuAction::on_state_change;
+xbt::signal<void(CpuAction const&, Action::State)> CpuAction::on_state_change;
 
 void CpuAction::suspend(){
   Action::State previous = get_state();
@@ -187,8 +188,7 @@ std::list<Cpu*> CpuAction::cpus() const
   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*...
-    kernel::resource::Resource* resource =
-        static_cast<kernel::resource::Resource*>(get_variable()->get_constraint(i)->get_id());
+    Resource* resource = get_variable()->get_constraint(i)->get_id();
     Cpu* cpu           = dynamic_cast<Cpu*>(resource);
     if (cpu != nullptr)
       retlist.push_back(cpu);
@@ -196,6 +196,6 @@ std::list<Cpu*> CpuAction::cpus() const
 
   return retlist;
 }
-
-}
-}
+} // namespace resource
+} // namespace kernel
+} // namespace simgrid
index 7ae6e58..10a4cf4 100644 (file)
@@ -10,7 +10,6 @@
 #include "simgrid/kernel/resource/Resource.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "src/kernel/lmm/maxmin.hpp"
-#include "src/kernel/resource/profile/trace_mgr.hpp"
 
 #include <list>
 
  ***********/
 
 namespace simgrid {
-namespace surf {
+namespace kernel {
+namespace resource {
 
- /** @ingroup SURF_cpu_interface
+/** @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
  */
-class XBT_PUBLIC CpuModel : public kernel::resource::Model {
+class XBT_PUBLIC CpuModel : public Model {
 public:
-  explicit CpuModel(kernel::resource::Model::UpdateAlgo algo) : Model(algo) {}
+  explicit CpuModel(Model::UpdateAlgo algo) : Model(algo) {}
 
   /**
    * @brief Create a Cpu
@@ -37,7 +37,7 @@ public:
    *                         This ignores any potential external load coming from a trace.
    * @param core The number of core of this Cpu
    */
-  virtual Cpu* create_cpu(simgrid::s4u::Host* host, const std::vector<double>& speed_per_pstate, int core) = 0;
+  virtual Cpu* create_cpu(s4u::Host* host, const std::vector<double>& speed_per_pstate, int core) = 0;
 
   void update_actions_state_lazy(double now, double delta) override;
   void update_actions_state_full(double now, double delta) override;
@@ -47,11 +47,18 @@ public:
  * Resource *
  ************/
 
+class CpuAction;
+
 /** @ingroup SURF_cpu_interface
 * @brief SURF cpu resource interface class
 * @details A Cpu represent a cpu associated to a host
 */
-class XBT_PUBLIC Cpu : public simgrid::kernel::resource::Resource {
+class XBT_PUBLIC Cpu : public Resource {
+  int core_count_ = 1;
+  s4u::Host* host_;
+  int pstate_ = 0;                             /*< Current pstate (index in the speed_per_pstate_)*/
+  const std::vector<double> speed_per_pstate_; /*< List of supported CPU capacities (pstate related) */
+
 public:
   /**
    * @brief Cpu constructor
@@ -62,8 +69,8 @@ public:
    * @param speedPerPstate Processor speed (in flop per second) for each pstate
    * @param core The number of core of this Cpu
    */
-  Cpu(simgrid::kernel::resource::Model* model, simgrid::s4u::Host* host, kernel::lmm::Constraint* constraint,
-      const std::vector<double>& speed_per_pstate, int core);
+  Cpu(Model* model, s4u::Host* host, lmm::Constraint* constraint, const std::vector<double>& speed_per_pstate,
+      int core);
 
   /**
    * @brief Cpu constructor
@@ -73,8 +80,7 @@ public:
    * @param speedPerPstate Processor speed (in flop per second) for each pstate
    * @param core The number of core of this Cpu
    */
-  Cpu(simgrid::kernel::resource::Model* model, simgrid::s4u::Host* host, const std::vector<double>& speed_per_pstate,
-      int core);
+  Cpu(Model* model, s4u::Host* host, const std::vector<double>& speed_per_pstate, int core);
 
   Cpu(const Cpu&) = delete;
   Cpu& operator=(const Cpu&) = delete;
@@ -85,7 +91,7 @@ public:
    * @param size The value of the processing amount (in flop) needed to process
    * @return The CpuAction corresponding to the processing
    */
-  virtual simgrid::kernel::resource::Action* execution_start(double size) = 0;
+  virtual CpuAction* execution_start(double size) = 0;
 
   /**
    * @brief Execute some quantity of computation on more than one core
@@ -94,7 +100,7 @@ public:
    * @param requested_cores The desired amount of cores. Must be >= 1
    * @return The CpuAction corresponding to the processing
    */
-  virtual simgrid::kernel::resource::Action* execution_start(double size, int requested_cores) = 0;
+  virtual CpuAction* execution_start(double size, int requested_cores) = 0;
 
   /**
    * @brief Make a process sleep for duration (in seconds)
@@ -102,7 +108,7 @@ public:
    * @param duration The number of seconds to sleep
    * @return The CpuAction corresponding to the sleeping
    */
-  virtual simgrid::kernel::resource::Action* sleep(double duration) = 0;
+  virtual CpuAction* sleep(double duration) = 0;
 
   /** @brief Get the amount of cores */
   virtual int get_core_count();
@@ -136,20 +142,12 @@ public:
   virtual void set_pstate(int pstate_index);
   virtual int get_pstate() const;
 
-  simgrid::s4u::Host* get_host() { return host_; }
-
-private:
-  int core_count_ = 1;
-  simgrid::s4u::Host* host_;
+  s4u::Host* get_host() { return host_; }
 
-  int pstate_ = 0;                       /*< Current pstate (index in the speed_per_pstate_)*/
-  const std::vector<double> speed_per_pstate_; /*< List of supported CPU capacities (pstate related) */
-
-public:
   /*< @brief Setup the trace file with availability events (peak speed changes due to external load).
    * Trace must contain relative values (ratio between 0 and 1)
    */
-  virtual void set_speed_profile(kernel::profile::Profile* profile);
+  virtual void set_speed_profile(profile::Profile* profile);
 
 protected:
   Metric speed_                  = {1.0, 0, nullptr};
@@ -162,21 +160,17 @@ protected:
  /** @ingroup SURF_cpu_interface
  * @brief A CpuAction represents the execution of code on one or several Cpus
  */
-class XBT_PUBLIC CpuAction : public simgrid::kernel::resource::Action {
+class XBT_PUBLIC CpuAction : public Action {
 public:
   /** @brief Signal emitted when the action state changes (ready/running/done, etc)
    *  Signature: `void(CpuAction const& action, simgrid::kernel::resource::Action::State previous)`
    */
-  static simgrid::xbt::signal<void(simgrid::surf::CpuAction const&, simgrid::kernel::resource::Action::State)>
-      on_state_change;
+  static xbt::signal<void(CpuAction const&, Action::State)> on_state_change;
 
-  CpuAction(simgrid::kernel::resource::Model * model, double cost, bool failed) : Action(model, cost, failed) {}
-  CpuAction(simgrid::kernel::resource::Model * model, double cost, bool failed, kernel::lmm::Variable* var)
-      : Action(model, cost, failed, var)
-  {
-  }
+  CpuAction(Model* model, double cost, bool failed) : Action(model, cost, failed) {}
+  CpuAction(Model* model, double cost, bool failed, lmm::Variable* var) : Action(model, cost, failed, var) {}
 
-  void set_state(simgrid::kernel::resource::Action::State state) override;
+  void set_state(Action::State state) override;
 
   void update_remains_lazy(double now) override;
   std::list<Cpu*> cpus() const;
@@ -184,8 +178,8 @@ public:
   void suspend() override;
   void resume() override;
 };
-
-}
-}
+} // namespace resource
+} // namespace kernel
+} // namespace simgrid
 
 #endif /* SURF_CPU_INTERFACE_HPP_ */
index 2ef2169..765354b 100644 (file)
@@ -4,49 +4,40 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "cpu_ti.hpp"
-#include "src/kernel/resource/profile/trace_mgr.hpp"
+#include "src/kernel/resource/profile/Event.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "surf/surf.hpp"
 
+#include <algorithm>
+
 constexpr double EPSILON = 0.000000001;
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_ti, surf_cpu, "Logging specific to the SURF CPU TRACE INTEGRATION module");
 
 namespace simgrid {
-namespace surf {
+namespace kernel {
+namespace resource {
 
 /*********
  * Trace *
  *********/
 
-CpuTiProfile::CpuTiProfile(kernel::profile::Profile* profile)
+CpuTiProfile::CpuTiProfile(profile::Profile* profile)
 {
   double integral = 0;
   double time = 0;
-  int i = 0;
-  nb_points_      = profile->event_list.size() + 1;
-  time_points_    = new double[nb_points_];
-  integral_       = new double[nb_points_];
+  unsigned nb_points = profile->event_list.size() + 1;
+  time_points_.reserve(nb_points);
+  integral_.reserve(nb_points);
   for (auto const& val : profile->event_list) {
-    time_points_[i] = time;
-    integral_[i] = integral;
-    integral += val.date_ * val.value_;
+    time_points_.push_back(time);
+    integral_.push_back(integral);
     time += val.date_;
-    i++;
+    integral += val.date_ * val.value_;
   }
-  time_points_[i] = time;
-  integral_[i] = integral;
-}
-
-CpuTiProfile::~CpuTiProfile()
-{
-  delete[] time_points_;
-  delete [] integral_;
-}
-
-CpuTiTmgr::~CpuTiTmgr()
-{
-  delete profile_;
+  time_points_.push_back(time);
+  integral_.push_back(integral);
 }
 
 /**
@@ -112,7 +103,7 @@ double CpuTiProfile::integrate_simple_point(double a)
 {
   double integral = 0;
   double a_aux = a;
-  int ind         = binary_search(time_points_, a, 0, nb_points_ - 1);
+  int ind         = binary_search(time_points_, a);
   integral += integral_[ind];
 
   XBT_DEBUG("a %f ind %d integral %f ind + 1 %f ind %f time +1 %f time %f", a, ind, integral, integral_[ind + 1],
@@ -194,7 +185,7 @@ double CpuTiTmgr::solve(double a, double amount)
 double CpuTiProfile::solve_simple(double a, double amount)
 {
   double integral_a = integrate_simple_point(a);
-  int ind           = binary_search(integral_, integral_a + amount, 0, nb_points_ - 1);
+  int ind           = binary_search(integral_, integral_a + amount);
   double time       = time_points_[ind];
   time += (integral_a + amount - integral_[ind]) /
           ((integral_[ind + 1] - integral_[ind]) / (time_points_[ind + 1] - time_points_[ind]));
@@ -212,7 +203,7 @@ double CpuTiProfile::solve_simple(double a, double amount)
 double CpuTiTmgr::get_power_scale(double a)
 {
   double reduced_a          = a - floor(a / last_time_) * last_time_;
-  int point                 = profile_->binary_search(profile_->time_points_, reduced_a, 0, profile_->nb_points_ - 1);
+  int point                       = CpuTiProfile::binary_search(profile_->time_points_, reduced_a);
   kernel::profile::DatedValue val = speed_profile_->event_list.at(point);
   return val.value_;
 }
@@ -227,7 +218,7 @@ double CpuTiTmgr::get_power_scale(double a)
 CpuTiTmgr::CpuTiTmgr(kernel::profile::Profile* speed_profile, double value) : speed_profile_(speed_profile)
 {
   double total_time = 0.0;
-  profile_          = 0;
+  profile_.reset(nullptr);
 
   /* no availability file, fixed trace */
   if (not speed_profile) {
@@ -250,7 +241,7 @@ CpuTiTmgr::CpuTiTmgr(kernel::profile::Profile* speed_profile, double value) : sp
   for (auto const& val : speed_profile->event_list)
     total_time += val.date_;
 
-  profile_   = new CpuTiProfile(speed_profile);
+  profile_.reset(new CpuTiProfile(speed_profile));
   last_time_ = total_time;
   total_     = profile_->integrate_simple(0, total_time);
 
@@ -259,47 +250,30 @@ CpuTiTmgr::CpuTiTmgr(kernel::profile::Profile* speed_profile, double value) : sp
 
 /**
  * @brief Binary search in array.
- *  It returns the first point of the interval in which "a" is.
+ *  It returns the last point of the interval in which "a" is.
  * @param array    Array
  * @param a        Value to search
- * @param low     Low bound to search in array
- * @param high    Upper bound to search in array
  * @return Index of point
  */
-int CpuTiProfile::binary_search(double* array, double a, int low, int high)
+int CpuTiProfile::binary_search(const std::vector<double>& array, double a)
 {
-  xbt_assert(low < high, "Wrong parameters: low (%d) should be smaller than high (%d)", low, high);
-
-  do {
-    int mid = low + (high - low) / 2;
-    XBT_DEBUG("a %f low %d high %d mid %d value %f", a, low, high, mid, array[mid]);
-
-    if (array[mid] > a)
-      high = mid;
-    else
-      low = mid;
-  }
-  while (low < high - 1);
-
-  return low;
-}
-
-}
+  if (array[0] > a)
+    return 0;
+  auto pos = std::upper_bound(begin(array), end(array), a);
+  return std::distance(begin(array), pos) - 1;
 }
 
 /*********
  * Model *
  *********/
-namespace simgrid {
-namespace surf {
 
 void CpuTiModel::create_pm_vm_models()
 {
   xbt_assert(surf_cpu_model_pm == nullptr, "CPU model already initialized. This should not happen.");
   xbt_assert(surf_cpu_model_vm == nullptr, "CPU model already initialized. This should not happen.");
 
-  surf_cpu_model_pm = new simgrid::surf::CpuTiModel();
-  surf_cpu_model_vm = new simgrid::surf::CpuTiModel();
+  surf_cpu_model_pm = new simgrid::kernel::resource::CpuTiModel();
+  surf_cpu_model_vm = new simgrid::kernel::resource::CpuTiModel();
 }
 
 CpuTiModel::CpuTiModel() : CpuModel(Model::UpdateAlgo::FULL)
@@ -312,7 +286,7 @@ CpuTiModel::~CpuTiModel()
   surf_cpu_model_pm = nullptr;
 }
 
-Cpu* CpuTiModel::create_cpu(simgrid::s4u::Host* host, const std::vector<double>& speed_per_pstate, int core)
+kernel::resource::Cpu* CpuTiModel::create_cpu(s4u::Host* host, const std::vector<double>& speed_per_pstate, int core)
 {
   return new CpuTi(this, host, speed_per_pstate, core);
 }
@@ -340,7 +314,7 @@ double CpuTiModel::next_occuring_event(double now)
 void CpuTiModel::update_actions_state(double now, double /*delta*/)
 {
   while (not get_action_heap().empty() && double_equals(get_action_heap().top_date(), now, sg_surf_precision)) {
-    CpuTiAction* action = static_cast<CpuTiAction*>(get_action_heap().pop());
+    auto* action = static_cast<CpuTiAction*>(get_action_heap().pop());
     XBT_DEBUG("Action %p: finish", action);
     action->finish(kernel::resource::Action::State::FINISHED);
     /* update remaining amount of all actions */
@@ -376,8 +350,8 @@ void CpuTi::set_speed_profile(kernel::profile::Profile* profile)
   if (profile && profile->event_list.size() > 1) {
     kernel::profile::DatedValue val = profile->event_list.back();
     if (val.date_ < 1e-12) {
-      simgrid::kernel::profile::Profile* prof = new simgrid::kernel::profile::Profile();
-      speed_.event                            = prof->schedule(&future_evt_set, this);
+      auto* prof   = new simgrid::kernel::profile::Profile();
+      speed_.event = prof->schedule(&profile::future_evt_set, this);
     }
   }
 }
@@ -440,14 +414,14 @@ void CpuTi::update_actions_finish_time(double now)
       continue;
 
     /* bogus priority, skip it */
-    if (action.get_priority() <= 0)
+    if (action.get_sharing_penalty() <= 0)
       continue;
 
     /* action suspended, skip it */
-    if (action.suspended_ != kernel::resource::Action::SuspendStates::not_suspended)
+    if (not action.is_running())
       continue;
 
-    sum_priority_ += 1.0 / action.get_priority();
+    sum_priority_ += 1.0 / action.get_sharing_penalty();
   }
 
   for (CpuTiAction& action : action_set_) {
@@ -457,9 +431,9 @@ void CpuTi::update_actions_finish_time(double now)
       continue;
 
     /* verify if the action is really running on cpu */
-    if (action.suspended_ == kernel::resource::Action::SuspendStates::not_suspended && action.get_priority() > 0) {
+    if (action.is_running() && action.get_sharing_penalty() > 0) {
       /* total area needed to finish the action. Used in trace integration */
-      double total_area = (action.get_remains() * sum_priority_ * action.get_priority()) / speed_.peak;
+      double total_area = (action.get_remains() * sum_priority_ * action.get_sharing_penalty()) / speed_.peak;
 
       action.set_finish_time(speed_integrated_trace_->solve(now, total_area));
       /* verify which event will happen before (max_duration or finish time) */
@@ -513,11 +487,11 @@ void CpuTi::update_remaining_amount(double now)
       continue;
 
     /* bogus priority, skip it */
-    if (action.get_priority() <= 0)
+    if (action.get_sharing_penalty() <= 0)
       continue;
 
     /* action suspended, skip it */
-    if (action.suspended_ != kernel::resource::Action::SuspendStates::not_suspended)
+    if (not action.is_running())
       continue;
 
     /* action don't need update */
@@ -529,16 +503,16 @@ void CpuTi::update_remaining_amount(double now)
       continue;
 
     /* update remaining */
-    action.update_remains(area_total / (sum_priority_ * action.get_priority()));
+    action.update_remains(area_total / (sum_priority_ * action.get_sharing_penalty()));
     XBT_DEBUG("Update remaining action(%p) remaining %f", &action, action.get_remains_no_update());
   }
   last_update_ = now;
 }
 
-CpuAction *CpuTi::execution_start(double size)
+kernel::resource::CpuAction* CpuTi::execution_start(double size)
 {
   XBT_IN("(%s,%g)", get_cname(), size);
-  CpuTiAction* action = new CpuTiAction(this, size);
+  auto* action = new CpuTiAction(this, size);
 
   action_set_.push_back(*action); // Actually start the action
 
@@ -546,17 +520,16 @@ CpuAction *CpuTi::execution_start(double size)
   return action;
 }
 
-
-CpuAction *CpuTi::sleep(double duration)
+kernel::resource::CpuAction* CpuTi::sleep(double duration)
 {
   if (duration > 0)
     duration = std::max(duration, sg_surf_precision);
 
   XBT_IN("(%s,%g)", get_cname(), duration);
-  CpuTiAction* action = new CpuTiAction(this, 1.0);
+  auto* action = new CpuTiAction(this, 1.0);
 
   action->set_max_duration(duration);
-  action->suspended_ = kernel::resource::Action::SuspendStates::sleeping;
+  action->set_suspend_state(kernel::resource::Action::SuspendStates::SLEEPING);
   if (duration == NO_MAX_DURATION)
     action->set_state(simgrid::kernel::resource::Action::State::IGNORED);
 
@@ -613,8 +586,8 @@ void CpuTiAction::cancel()
 void CpuTiAction::suspend()
 {
   XBT_IN("(%p)", this);
-  if (suspended_ != Action::SuspendStates::sleeping) {
-    suspended_ = Action::SuspendStates::suspended;
+  if (is_running()) {
+    set_suspend_state(Action::SuspendStates::SUSPENDED);
     get_model()->get_action_heap().remove(this);
     cpu_->set_modified(true);
   }
@@ -624,8 +597,8 @@ void CpuTiAction::suspend()
 void CpuTiAction::resume()
 {
   XBT_IN("(%p)", this);
-  if (suspended_ != Action::SuspendStates::sleeping) {
-    suspended_ = Action::SuspendStates::not_suspended;
+  if (is_suspended()) {
+    set_suspend_state(Action::SuspendStates::RUNNING);
     cpu_->set_modified(true);
   }
   XBT_OUT();
@@ -651,10 +624,10 @@ void CpuTiAction::set_max_duration(double duration)
   XBT_OUT();
 }
 
-void CpuTiAction::set_priority(double priority)
+void CpuTiAction::set_sharing_penalty(double sharing_penalty)
 {
-  XBT_IN("(%p,%g)", this, priority);
-  set_priority_no_update(priority);
+  XBT_IN("(%p,%g)", this, sharing_penalty);
+  set_sharing_penalty_no_update(sharing_penalty);
   cpu_->set_modified(true);
   XBT_OUT();
 }
@@ -667,5 +640,6 @@ double CpuTiAction::get_remains()
   return get_remains_no_update();
 }
 
-}
-}
+} // namespace resource
+} // namespace kernel
+} // namespace simgrid
index f3cafa7..7ad6573 100644 (file)
@@ -6,13 +6,15 @@
 #ifndef SURF_MODEL_CPUTI_H_
 #define SURF_MODEL_CPUTI_H_
 
-#include "src/kernel/resource/profile/trace_mgr.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/cpu_interface.hpp"
 
 #include <boost/intrusive/list.hpp>
+#include <memory>
 
 namespace simgrid {
-namespace surf {
+namespace kernel {
+namespace resource {
 
 /***********
  * Classes *
@@ -25,19 +27,15 @@ class XBT_PRIVATE CpuTi;
  *********/
 class CpuTiProfile {
 public:
-  explicit CpuTiProfile(kernel::profile::Profile* profile);
-  CpuTiProfile(const CpuTiProfile&) = delete;
-  CpuTiProfile& operator=(const CpuTiProfile&) = delete;
-  ~CpuTiProfile();
+  explicit CpuTiProfile(profile::Profile* profile);
 
   double integrate_simple(double a, double b);
   double integrate_simple_point(double a);
   double solve_simple(double a, double amount);
 
-  double* time_points_;
-  double *integral_;
-  int nb_points_;
-  int binary_search(double* array, double a, int low, int high);
+  std::vector<double> time_points_;
+  std::vector<double> integral_;
+  static int binary_search(const std::vector<double>& array, double a);
 };
 
 class CpuTiTmgr {
@@ -48,10 +46,9 @@ class CpuTiTmgr {
 
 public:
   explicit CpuTiTmgr(double value) : type_(Type::FIXED), value_(value){};
-  CpuTiTmgr(kernel::profile::Profile* speed_profile, double value);
+  CpuTiTmgr(profile::Profile* speed_profile, double value);
   CpuTiTmgr(const CpuTiTmgr&) = delete;
   CpuTiTmgr& operator=(const CpuTiTmgr&) = delete;
-  ~CpuTiTmgr();
 
   double integrate(double a, double b);
   double solve(double a, double amount);
@@ -65,8 +62,8 @@ private:
   double last_time_ = 0.0;             /*< Integral interval last point (discrete time) */
   double total_    = 0.0;             /*< Integral total between 0 and last_pointn */
 
-  CpuTiProfile* profile_                   = nullptr;
-  kernel::profile::Profile* speed_profile_ = nullptr;
+  std::unique_ptr<CpuTiProfile> profile_ = nullptr;
+  profile::Profile* speed_profile_       = nullptr;
 };
 
 /**********
@@ -81,12 +78,12 @@ public:
   CpuTiAction& operator=(const CpuTiAction&) = delete;
   ~CpuTiAction();
 
-  void set_state(kernel::resource::Action::State state) override;
+  void set_state(Action::State state) override;
   void cancel() override;
   void suspend() override;
   void resume() override;
   void set_max_duration(double duration) override;
-  void set_priority(double priority) override;
+  void set_sharing_penalty(double sharing_penalty) override;
   double get_remains() override;
 
   CpuTi *cpu_;
@@ -102,25 +99,25 @@ typedef boost::intrusive::list<CpuTiAction, ActionTiListOptions > ActionTiList;
  ************/
 class CpuTi : public Cpu {
 public:
-  CpuTi(CpuTiModel* model, simgrid::s4u::Host* host, const std::vector<double>& speed_per_pstate, int core);
+  CpuTi(CpuTiModel* model, s4u::Host* host, const std::vector<double>& speed_per_pstate, int core);
   CpuTi(const CpuTi&)            = delete;
   CpuTi& operator&(const CpuTi&) = delete;
   ~CpuTi() override;
 
-  void set_speed_profile(kernel::profile::Profile* profile) override;
+  void set_speed_profile(profile::Profile* profile) override;
 
-  void apply_event(kernel::profile::Event* event, double value) override;
+  void apply_event(profile::Event* event, double value) override;
   void update_actions_finish_time(double now);
   void update_remaining_amount(double now);
 
   bool is_used() override;
-  CpuAction *execution_start(double size) override;
-  kernel::resource::Action* execution_start(double, int) override
+  CpuActionexecution_start(double size) override;
+  CpuAction* execution_start(double, int) override
   {
     THROW_UNIMPLEMENTED;
     return nullptr;
   }
-  CpuAction *sleep(double duration) override;
+  CpuActionsleep(double duration) override;
   double get_speed_ratio() override;
 
   void set_modified(bool modified);
@@ -147,14 +144,15 @@ public:
   CpuTiModel(const CpuTiModel&) = delete;
   CpuTiModel& operator=(const CpuTiModel&) = delete;
   ~CpuTiModel() override;
-  Cpu* create_cpu(simgrid::s4u::Host* host, const std::vector<double>& speed_per_pstate, int core) override;
+  Cpu* create_cpu(s4u::Host* host, const std::vector<double>& speed_per_pstate, int core) override;
   double next_occuring_event(double now) override;
   void update_actions_state(double now, double delta) override;
 
   CpuTiList modified_cpus_;
 };
 
-}
-}
+} // namespace resource
+} // namespace kernel
+} // namespace simgrid
 
 #endif /* SURF_MODEL_CPUTI_H_ */
diff --git a/src/surf/disk_s19.cpp b/src/surf/disk_s19.cpp
new file mode 100644 (file)
index 0000000..4198e10
--- /dev/null
@@ -0,0 +1,145 @@
+/* Copyright (c) 2013-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "disk_s19.hpp"
+#include "simgrid/kernel/routing/NetPoint.hpp"
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Host.hpp"
+#include "src/kernel/lmm/maxmin.hpp"
+#include "src/surf/xml/platf.hpp"
+#include "surf/surf.hpp"
+
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(disk_kernel);
+
+/*********
+ * Model *
+ *********/
+
+void surf_disk_model_init_default()
+{
+  surf_disk_model = new simgrid::kernel::resource::DiskS19Model();
+}
+
+namespace simgrid {
+namespace kernel {
+namespace resource {
+
+DiskS19Model::DiskS19Model()
+{
+  all_existing_models.push_back(this);
+}
+
+DiskImpl* DiskS19Model::createDisk(const std::string& id, double read_bw, double write_bw)
+{
+  XBT_DEBUG("SURF disk create resource\n\t\tid '%s'\n\t\tread_bw '%f'\n", id.c_str(), read_bw);
+
+  return new DiskS19(this, id, get_maxmin_system(), read_bw, write_bw);
+}
+
+double DiskS19Model::next_occuring_event(double now)
+{
+  return DiskModel::next_occuring_event_full(now);
+}
+
+void DiskS19Model::update_actions_state(double /*now*/, double delta)
+{
+  for (auto it = std::begin(*get_started_action_set()); it != std::end(*get_started_action_set());) {
+    auto& action = *it;
+    ++it; // increment iterator here since the following calls to action.finish() may invalidate it
+    action.update_remains(lrint(action.get_variable()->get_value() * delta));
+    action.update_max_duration(delta);
+
+    if (((action.get_remains_no_update() <= 0) && (action.get_variable()->get_penalty() > 0)) ||
+        ((action.get_max_duration() != NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
+      action.finish(Action::State::FINISHED);
+    }
+  }
+}
+
+/************
+ * Resource *
+ ************/
+
+DiskS19::DiskS19(DiskModel* model, const std::string& name, lmm::System* maxminSystem, double read_bw, double write_bw)
+    : DiskImpl(model, name, maxminSystem, read_bw, write_bw)
+{
+  XBT_DEBUG("Create resource with read_bw '%f' write_bw '%f'", read_bw, write_bw);
+}
+
+DiskAction* DiskS19::io_start(sg_size_t size, s4u::Io::OpType type)
+{
+  return new DiskS19Action(get_model(), size, not is_on(), this, type);
+}
+
+DiskAction* DiskS19::read(sg_size_t size)
+{
+  return new DiskS19Action(get_model(), size, not is_on(), this, s4u::Io::OpType::READ);
+}
+
+DiskAction* DiskS19::write(sg_size_t size)
+{
+  return new DiskS19Action(get_model(), size, not is_on(), this, s4u::Io::OpType::WRITE);
+}
+
+/**********
+ * Action *
+ **********/
+
+DiskS19Action::DiskS19Action(Model* model, double cost, bool failed, DiskImpl* disk, s4u::Io::OpType type)
+    : DiskAction(model, cost, failed, model->get_maxmin_system()->variable_new(this, 1.0, -1.0, 3), disk, type)
+{
+  XBT_IN("(%s,%g", disk->get_cname(), cost);
+
+  // Must be less than the max bandwidth for all actions
+  model->get_maxmin_system()->expand(disk->get_constraint(), get_variable(), 1.0);
+  switch (type) {
+    case s4u::Io::OpType::READ:
+      model->get_maxmin_system()->expand(disk->constraint_read_, get_variable(), 1.0);
+      break;
+    case s4u::Io::OpType::WRITE:
+      model->get_maxmin_system()->expand(disk->constraint_write_, get_variable(), 1.0);
+      break;
+    default:
+      THROW_UNIMPLEMENTED;
+  }
+  XBT_OUT();
+}
+
+void DiskS19Action::cancel()
+{
+  set_state(Action::State::FAILED);
+}
+
+void DiskS19Action::suspend()
+{
+  XBT_IN("(%p)", this);
+  if (is_running()) {
+    get_model()->get_maxmin_system()->update_variable_penalty(get_variable(), 0.0);
+    set_suspend_state(Action::SuspendStates::SUSPENDED);
+  }
+  XBT_OUT();
+}
+
+void DiskS19Action::resume()
+{
+  THROW_UNIMPLEMENTED;
+}
+
+void DiskS19Action::set_max_duration(double /*duration*/)
+{
+  THROW_UNIMPLEMENTED;
+}
+
+void DiskS19Action::set_sharing_penalty(double)
+{
+  THROW_UNIMPLEMENTED;
+}
+void DiskS19Action::update_remains_lazy(double /*now*/)
+{
+  THROW_IMPOSSIBLE;
+}
+} // namespace resource
+} // namespace kernel
+} // namespace simgrid
diff --git a/src/surf/disk_s19.hpp b/src/surf/disk_s19.hpp
new file mode 100644 (file)
index 0000000..5b537ef
--- /dev/null
@@ -0,0 +1,69 @@
+/* Copyright (c) 2013-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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/base.h>
+
+#include "src/kernel/resource/DiskImpl.hpp"
+
+#ifndef DISK_S19_HPP_
+#define DISK_S19_HPP_
+
+namespace simgrid {
+namespace kernel {
+namespace resource {
+
+/***********
+ * Classes *
+ ***********/
+
+class XBT_PRIVATE DiskS19Model;
+class XBT_PRIVATE DiskS19;
+class XBT_PRIVATE DiskS19Action;
+
+/*********
+ * Model *
+ *********/
+
+class DiskS19Model : public DiskModel {
+public:
+  DiskS19Model();
+  DiskImpl* createDisk(const std::string& id, double read_bw, double write_bw) override;
+  double next_occuring_event(double now) override;
+  void update_actions_state(double now, double delta) override;
+};
+
+/************
+ * Resource *
+ ************/
+
+class DiskS19 : public DiskImpl {
+public:
+  DiskS19(DiskModel* model, const std::string& name, kernel::lmm::System* maxminSystem, double read_bw,
+          double write_bw);
+  virtual ~DiskS19() = default;
+  DiskAction* io_start(sg_size_t size, s4u::Io::OpType type) override;
+  DiskAction* read(sg_size_t size) override;
+  DiskAction* write(sg_size_t size) override;
+};
+
+/**********
+ * Action *
+ **********/
+
+class DiskS19Action : public DiskAction {
+public:
+  DiskS19Action(Model* model, double cost, bool failed, DiskImpl* disk, s4u::Io::OpType type);
+  void suspend() override;
+  void cancel() override;
+  void resume() override;
+  void set_max_duration(double duration) override;
+  void set_sharing_penalty(double sharing_penalty) override;
+  void update_remains_lazy(double now) override;
+};
+
+} // namespace resource
+} // namespace kernel
+} // namespace simgrid
+#endif /* DISK_S19_HPP_ */
index 5b64047..955e6b8 100644 (file)
@@ -36,17 +36,19 @@ double HostCLM03Model::next_occuring_event(double now)
   double min_by_net =
       surf_network_model->next_occuring_event_is_idempotent() ? surf_network_model->next_occuring_event(now) : -1;
   double min_by_sto = surf_storage_model->next_occuring_event(now);
+  double min_by_dsk = surf_disk_model->next_occuring_event(now);
 
-  XBT_DEBUG("model %p, %s min_by_cpu %f, %s min_by_net %f, %s min_by_sto %f",
-      this, typeid(surf_cpu_model_pm).name(), min_by_cpu,
-      typeid(surf_network_model).name(), min_by_net,
-      typeid(surf_storage_model).name(), min_by_sto);
+  XBT_DEBUG("model %p, %s min_by_cpu %f, %s min_by_net %f, %s min_by_sto %f, %s min_by_dsk %f", this,
+            typeid(surf_cpu_model_pm).name(), min_by_cpu, typeid(surf_network_model).name(), min_by_net,
+            typeid(surf_storage_model).name(), min_by_sto, typeid(surf_disk_model).name(), min_by_dsk);
 
   double res = min_by_cpu;
   if (res < 0 || (min_by_net >= 0.0 && min_by_net < res))
     res = min_by_net;
   if (res < 0 || (min_by_sto >= 0.0 && min_by_sto < res))
     res = min_by_sto;
+  if (res < 0 || (min_by_dsk >= 0.0 && min_by_dsk < res))
+    res = min_by_dsk;
   return res;
 }
 
@@ -55,5 +57,5 @@ void HostCLM03Model::update_actions_state(double /*now*/, double /*delta*/)
   /* I've no action to update */
 }
 
-}
-}
+} // namespace surf
+} // namespace simgrid
index 5bc6070..9945dbd 100644 (file)
@@ -3,15 +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. */
 
-#include <algorithm>
-#include <numeric>
-
 #include "network_cm02.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/sg_config.hpp"
+#include "src/kernel/resource/profile/Event.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "surf/surf.hpp"
 
+#include <algorithm>
+#include <numeric>
+
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 
 double sg_latency_factor = 1.0; /* default value; can be set by model or from command line */
@@ -65,59 +66,6 @@ void surf_network_model_init_CM02()
   surf_network_model = new simgrid::kernel::resource::NetworkCm02Model();
 }
 
-/***************************************************************************/
-/* The models from Steven H. Low                                           */
-/***************************************************************************/
-/* @article{Low03,                                                         */
-/*   author={Steven H. Low},                                               */
-/*   title={A Duality Model of {TCP} and Queue Management Algorithms},     */
-/*   year={2003},                                                          */
-/*   journal={{IEEE/ACM} Transactions on Networking},                      */
-/*    volume={11}, number={4},                                             */
-/*  }                                                                      */
-void surf_network_model_init_Reno()
-{
-  xbt_assert(surf_network_model == nullptr, "Cannot set the network model twice");
-
-  namespace lmm = simgrid::kernel::lmm;
-  lmm::Lagrange::set_default_protocol_function(lmm::func_reno_f, lmm::func_reno_fp, lmm::func_reno_fpi);
-
-  simgrid::config::set_default<double>("network/latency-factor", 13.01);
-  simgrid::config::set_default<double>("network/bandwidth-factor", 0.97);
-  simgrid::config::set_default<double>("network/weight-S", 20537);
-
-  surf_network_model = new simgrid::kernel::resource::NetworkCm02Model(&simgrid::kernel::lmm::make_new_lagrange_system);
-}
-
-
-void surf_network_model_init_Reno2()
-{
-  xbt_assert(surf_network_model == nullptr, "Cannot set the network model twice");
-
-  namespace lmm = simgrid::kernel::lmm;
-  lmm::Lagrange::set_default_protocol_function(lmm::func_reno2_f, lmm::func_reno2_fp, lmm::func_reno2_fpi);
-
-  simgrid::config::set_default<double>("network/latency-factor", 13.01);
-  simgrid::config::set_default<double>("network/bandwidth-factor", 0.97);
-  simgrid::config::set_default<double>("network/weight-S", 20537);
-
-  surf_network_model = new simgrid::kernel::resource::NetworkCm02Model(&simgrid::kernel::lmm::make_new_lagrange_system);
-}
-
-void surf_network_model_init_Vegas()
-{
-  xbt_assert(surf_network_model == nullptr, "Cannot set the network model twice");
-
-  namespace lmm = simgrid::kernel::lmm;
-  lmm::Lagrange::set_default_protocol_function(lmm::func_vegas_f, lmm::func_vegas_fp, lmm::func_vegas_fpi);
-
-  simgrid::config::set_default<double>("network/latency-factor", 13.01);
-  simgrid::config::set_default<double>("network/bandwidth-factor", 0.97);
-  simgrid::config::set_default<double>("network/weight-S", 20537);
-
-  surf_network_model = new simgrid::kernel::resource::NetworkCm02Model(&simgrid::kernel::lmm::make_new_lagrange_system);
-}
-
 namespace simgrid {
 namespace kernel {
 namespace resource {
@@ -138,26 +86,31 @@ NetworkCm02Model::NetworkCm02Model(kernel::lmm::System* (*make_new_lmm_system)(b
   }
 
   set_maxmin_system(make_new_lmm_system(select));
-  loopback_ = NetworkCm02Model::create_link("__loopback__", 498000000, 0.000015, s4u::Link::SharingPolicy::FATPIPE);
+  loopback_ = NetworkCm02Model::create_link("__loopback__", std::vector<double>(1, 498000000), 0.000015,
+                                            s4u::Link::SharingPolicy::FATPIPE);
 }
 
-LinkImpl* NetworkCm02Model::create_link(const std::string& name, double bandwidth, double latency,
+LinkImpl* NetworkCm02Model::create_link(const std::string& name, const std::vector<double>& bandwidths, double latency,
                                         s4u::Link::SharingPolicy policy)
 {
-  return new NetworkCm02Link(this, name, bandwidth, latency, policy, get_maxmin_system());
+  if (policy == s4u::Link::SharingPolicy::WIFI) {
+    return (new NetworkWifiLink(this, name, bandwidths, policy, get_maxmin_system()));
+  }
+  xbt_assert(bandwidths.size() == 1, "Non WIFI links must use only 1 bandwidth.");
+  return new NetworkCm02Link(this, name, bandwidths[0], latency, policy, get_maxmin_system());
 }
 
 void NetworkCm02Model::update_actions_state_lazy(double now, double /*delta*/)
 {
   while (not get_action_heap().empty() && double_equals(get_action_heap().top_date(), now, sg_surf_precision)) {
 
-    NetworkCm02Action* action = static_cast<NetworkCm02Action*>(get_action_heap().pop());
+    auto* action = static_cast<NetworkCm02Action*>(get_action_heap().pop());
     XBT_DEBUG("Something happened to action %p", action);
 
     // if I am wearing a latency hat
     if (action->get_type() == ActionHeap::Type::latency) {
       XBT_DEBUG("Latency paid for action %p. Activating", action);
-      get_maxmin_system()->update_variable_weight(action->get_variable(), action->weight_);
+      get_maxmin_system()->update_variable_penalty(action->get_variable(), action->sharing_penalty_);
       get_action_heap().remove(action);
       action->set_last_update();
 
@@ -188,7 +141,7 @@ void NetworkCm02Model::update_actions_state_full(double /*now*/, double delta)
         action.latency_ = 0.0;
       }
       if (action.latency_ <= 0.0 && not action.is_suspended())
-        get_maxmin_system()->update_variable_weight(action.get_variable(), action.weight_);
+        get_maxmin_system()->update_variable_penalty(action.get_variable(), action.sharing_penalty_);
     }
 
     if (not action.get_variable()->get_number_of_constraint()) {
@@ -202,7 +155,7 @@ void NetworkCm02Model::update_actions_state_full(double /*now*/, double delta)
     if (action.get_max_duration() != NO_MAX_DURATION)
       action.update_max_duration(delta);
 
-    if (((action.get_remains() <= 0) && (action.get_variable()->get_weight() > 0)) ||
+    if (((action.get_remains() <= 0) && (action.get_variable()->get_penalty() > 0)) ||
         ((action.get_max_duration() != NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
       action.finish(Action::State::FINISHED);
     }
@@ -231,17 +184,18 @@ Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double siz
           std::any_of(back_route.begin(), back_route.end(), [](const LinkImpl* link) { return not link->is_on(); });
   }
 
-  NetworkCm02Action *action = new NetworkCm02Action(this, size, failed);
-  action->weight_ = latency;
+  auto* action              = new NetworkCm02Action(this, size, failed);
+  action->sharing_penalty_  = latency;
   action->latency_ = latency;
   action->rate_ = rate;
+
   if (get_update_algorithm() == Model::UpdateAlgo::LAZY) {
     action->set_last_update();
   }
 
   if (sg_weight_S_parameter > 0) {
-    action->weight_ =
-        std::accumulate(route.begin(), route.end(), action->weight_, [](double total, LinkImpl* const& link) {
+    action->sharing_penalty_ =
+        std::accumulate(route.begin(), route.end(), action->sharing_penalty_, [](double total, LinkImpl* const& link) {
           return total + sg_weight_S_parameter / link->get_bandwidth();
         });
   }
@@ -282,13 +236,49 @@ Action* NetworkCm02Model::communicate(s4u::Host* src, s4u::Host* dst, double siz
                                     : action->rate_);
   }
 
-  for (auto const& link : route)
-    get_maxmin_system()->expand(link->get_constraint(), action->get_variable(), 1.0);
+  for (auto const& link : route) {
+    // Handle WIFI links
+    if (link->get_sharing_policy() == s4u::Link::SharingPolicy::WIFI) {
+      NetworkWifiLink* wifi_link = static_cast<NetworkWifiLink*>(link);
+
+      double src_rate = wifi_link->get_host_rate(src);
+      double dst_rate = wifi_link->get_host_rate(dst);
+      xbt_assert(
+          !(src_rate == -1 && dst_rate == -1),
+          "Some Stations are not associated to any Access Point. Make sure to call set_host_rate on all Stations.");
+      if (src_rate != -1)
+        get_maxmin_system()->expand(link->get_constraint(), action->get_variable(), 1.0 / src_rate);
+      else
+        get_maxmin_system()->expand(link->get_constraint(), action->get_variable(), 1.0 / dst_rate);
+
+    } else {
+      get_maxmin_system()->expand(link->get_constraint(), action->get_variable(), 1.0);
+    }
+  }
 
   if (cfg_crosstraffic) {
     XBT_DEBUG("Crosstraffic active: adding backward flow using 5%% of the available bandwidth");
-    for (auto const& link : back_route)
-      get_maxmin_system()->expand(link->get_constraint(), action->get_variable(), .05);
+    bool wifi_dst_assigned = false; // Used by wifi crosstraffic
+    for (auto const& link : back_route) {
+      if (link->get_sharing_policy() == s4u::Link::SharingPolicy::WIFI) {
+        NetworkWifiLink* wifi_link = static_cast<NetworkWifiLink*>(link);
+        /**
+         * For wifi links we should add 0.05/rate.
+         * However since we are using the "back_route" we should encounter in
+         * the first place the dst wifi link.
+         */
+        if (!wifi_dst_assigned && (wifi_link->get_host_rate(dst) != -1)) {
+          get_maxmin_system()->expand(link->get_constraint(), action->get_variable(),
+                                      .05 / wifi_link->get_host_rate(dst));
+          wifi_dst_assigned = true;
+        } else {
+          get_maxmin_system()->expand(link->get_constraint(), action->get_variable(),
+                                      .05 / wifi_link->get_host_rate(src));
+        }
+      } else {
+        get_maxmin_system()->expand(link->get_constraint(), action->get_variable(), .05);
+      }
+    }
 
     // Change concurrency_share here, if you want that cross-traffic is included in the SURF concurrency
     // (You would also have to change simgrid::kernel::lmm::Element::get_concurrency())
@@ -334,19 +324,7 @@ void NetworkCm02Link::apply_event(kernel::profile::Event* triggered, double valu
     if (value > 0)
       turn_on();
     else {
-      kernel::lmm::Variable* var = nullptr;
-      const kernel::lmm::Element* elem = nullptr;
-      double now               = surf_get_clock();
-
       turn_off();
-      while ((var = get_constraint()->get_variable(&elem))) {
-        Action* action = static_cast<Action*>(var->get_id());
-
-        if (action->get_state() == Action::State::INITED || action->get_state() == Action::State::STARTED) {
-          action->set_finish_time(now);
-          action->set_state(Action::State::FAILED);
-        }
-      }
     }
     tmgr_trace_event_unref(&state_event_);
   } else {
@@ -374,10 +352,10 @@ void NetworkCm02Link::set_bandwidth(double value)
     const kernel::lmm::Element* nextelem = nullptr;
     int numelem                  = 0;
     while ((var = get_constraint()->get_variable_safe(&elem, &nextelem, &numelem))) {
-      NetworkCm02Action* action = static_cast<NetworkCm02Action*>(var->get_id());
-      action->weight_ += delta;
+      auto* action = static_cast<NetworkCm02Action*>(var->get_id());
+      action->sharing_penalty_ += delta;
       if (not action->is_suspended())
-        get_model()->get_maxmin_system()->update_variable_weight(action->get_variable(), action->weight_);
+        get_model()->get_maxmin_system()->update_variable_penalty(action->get_variable(), action->sharing_penalty_);
     }
   }
 }
@@ -393,9 +371,9 @@ void NetworkCm02Link::set_latency(double value)
   latency_.peak = value;
 
   while ((var = get_constraint()->get_variable_safe(&elem, &nextelem, &numelem))) {
-    NetworkCm02Action* action = static_cast<NetworkCm02Action*>(var->get_id());
+    auto* action = static_cast<NetworkCm02Action*>(var->get_id());
     action->lat_current_ += delta;
-    action->weight_ += delta;
+    action->sharing_penalty_ += delta;
     if (action->rate_ < 0)
       get_model()->get_maxmin_system()->update_variable_bound(action->get_variable(), NetworkModel::cfg_tcp_gamma /
                                                                                           (2.0 * action->lat_current_));
@@ -410,20 +388,59 @@ void NetworkCm02Link::set_latency(double value)
       }
     }
     if (not action->is_suspended())
-      get_model()->get_maxmin_system()->update_variable_weight(action->get_variable(), action->weight_);
+      get_model()->get_maxmin_system()->update_variable_penalty(action->get_variable(), action->sharing_penalty_);
   }
 }
 
+NetworkWifiLink::NetworkWifiLink(NetworkCm02Model* model, const std::string& name, std::vector<double> bandwidths,
+                                 s4u::Link::SharingPolicy policy, lmm::System* system)
+    : NetworkCm02Link(
+          model, name, 1 / sg_bandwidth_factor, 0, policy,
+          system) // Since link use bw*sg_bandwidth_factor we should divise in order to as 1 as bound in the lmm system
+{
+  for (auto bandwidth : bandwidths) {
+    bandwidths_.push_back({bandwidth, 1.0, nullptr});
+  }
+}
+
+void NetworkWifiLink::set_host_rate(s4u::Host* host, int rate_level)
+{
+  auto insert_done = host_rates_.insert(std::make_pair(host->get_name(), rate_level));
+  if (insert_done.second == false)
+    insert_done.first->second = rate_level;
+}
+
+double NetworkWifiLink::get_host_rate(sg_host_t host)
+{
+  std::map<xbt::string, int>::iterator host_rates_it;
+  host_rates_it = host_rates_.find(host->get_name());
+
+  if (host_rates_it == host_rates_.end())
+    return -1;
+
+  int rate_id = host_rates_it->second;
+  xbt_assert(rate_id >= 0 && rate_id < (int)bandwidths_.size(), "Host \"%s\" has an invalid rate \"%d\"",
+             host->get_name().c_str(), rate_id);
+
+  Metric rate = bandwidths_[rate_id];
+  return rate.peak * rate.scale;
+}
+
+s4u::Link::SharingPolicy NetworkWifiLink::get_sharing_policy()
+{
+  return s4u::Link::SharingPolicy::WIFI;
+}
+
 /**********
  * Action *
  **********/
 
 void NetworkCm02Action::update_remains_lazy(double now)
 {
-  if (suspended_ != Action::SuspendStates::not_suspended)
+  if (not is_running())
     return;
 
-  double delta        = now - get_last_update();
+  double delta = now - get_last_update();
 
   if (get_remains_no_update() > 0) {
     XBT_DEBUG("Updating action(%p): remains was %f, last_update was: %f", this, get_remains_no_update(),
@@ -435,7 +452,7 @@ void NetworkCm02Action::update_remains_lazy(double now)
 
   update_max_duration(delta);
 
-  if ((get_remains_no_update() <= 0 && (get_variable()->get_weight() > 0)) ||
+  if ((get_remains_no_update() <= 0 && (get_variable()->get_penalty() > 0)) ||
       ((get_max_duration() != NO_MAX_DURATION) && (get_max_duration() <= 0))) {
     finish(Action::State::FINISHED);
     get_model()->get_action_heap().remove(this);
@@ -445,6 +462,6 @@ void NetworkCm02Action::update_remains_lazy(double now)
   set_last_value(get_variable()->get_value());
 }
 
-}
-}
+} // namespace resource
+} // namespace kernel
 } // namespace simgrid
index cd576d6..01a34f9 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "network_interface.hpp"
 #include "xbt/graph.h"
-
+#include "xbt/string.hpp"
 
 /***********
  * Classes *
@@ -32,7 +32,7 @@ class NetworkCm02Model : public NetworkModel {
 public:
   explicit NetworkCm02Model(lmm::System* (*make_new_sys)(bool) = &lmm::make_new_maxmin_system);
   virtual ~NetworkCm02Model() = default;
-  LinkImpl* create_link(const std::string& name, double bandwidth, double latency,
+  LinkImpl* create_link(const std::string& name, const std::vector<double>& bandwidths, double latency,
                         s4u::Link::SharingPolicy policy) override;
   void update_actions_state_lazy(double now, double delta) override;
   void update_actions_state_full(double now, double delta) override;
@@ -47,12 +47,29 @@ class NetworkCm02Link : public LinkImpl {
 public:
   NetworkCm02Link(NetworkCm02Model* model, const std::string& name, double bandwidth, double latency,
                   s4u::Link::SharingPolicy policy, lmm::System* system);
-  virtual ~NetworkCm02Link() = default;
+  ~NetworkCm02Link() override = default;
   void apply_event(kernel::profile::Event* event, double value) override;
   void set_bandwidth(double value) override;
   void set_latency(double value) override;
 };
 
+class NetworkWifiLink : public NetworkCm02Link {
+  /** @brief Hold every rates association between host and links (host name, rates id) */
+  std::map<xbt::string, int> host_rates_;
+
+  /** @brief A link can have several bandwith attach to it (mostly use by wifi model) */
+  std::vector<Metric> bandwidths_;
+
+public:
+  NetworkWifiLink(NetworkCm02Model* model, const std::string& name, std::vector<double> bandwidths,
+                  s4u::Link::SharingPolicy policy, lmm::System* system);
+
+  void set_host_rate(s4u::Host* host, int rate_level);
+  /** @brief Get the AP rate associated to the host (or -1 if not associated to the AP) */
+  double get_host_rate(s4u::Host* host);
+  s4u::Link::SharingPolicy get_sharing_policy() override;
+};
+
 /**********
  * Action *
  **********/
index 26ae955..849b015 100644 (file)
@@ -21,12 +21,14 @@ void surf_network_model_init_Constant()
 namespace simgrid {
 namespace kernel {
 namespace resource {
+
 NetworkConstantModel::NetworkConstantModel() : NetworkModel(Model::UpdateAlgo::FULL)
 {
   all_existing_models.push_back(this);
 }
 
-LinkImpl* NetworkConstantModel::create_link(const std::string& name, double, double, s4u::Link::SharingPolicy)
+LinkImpl* NetworkConstantModel::create_link(const std::string& name, const std::vector<double>& /*bandwidth*/,
+                                            double /*latency*/, s4u::Link::SharingPolicy)
 {
 
   xbt_die("Refusing to create the link %s: there is no link in the Constant network model. "
@@ -39,7 +41,7 @@ double NetworkConstantModel::next_occuring_event(double /*now*/)
 {
   double min = -1.0;
   for (kernel::resource::Action const& action : *get_started_action_set()) {
-    const NetworkConstantAction& net_action = static_cast<const NetworkConstantAction&>(action);
+    const auto& net_action = static_cast<const NetworkConstantAction&>(action);
     if (net_action.latency_ > 0 && (min < 0 || net_action.latency_ < min))
       min = net_action.latency_;
   }
@@ -49,7 +51,7 @@ double NetworkConstantModel::next_occuring_event(double /*now*/)
 void NetworkConstantModel::update_actions_state(double /*now*/, double delta)
 {
   for (auto it = std::begin(*get_started_action_set()); it != std::end(*get_started_action_set());) {
-    NetworkConstantAction& action = static_cast<NetworkConstantAction&>(*it);
+    auto& 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) {
@@ -63,16 +65,16 @@ void NetworkConstantModel::update_actions_state(double /*now*/, double delta)
 
     if ((action.get_remains_no_update() <= 0) ||
         ((action.get_max_duration() != NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
-      action.finish(kernel::resource::Action::State::FINISHED);
+      action.finish(Action::State::FINISHED);
     }
   }
 }
 
-kernel::resource::Action* NetworkConstantModel::communicate(s4u::Host* src, s4u::Host* dst, double size, double)
+Action* NetworkConstantModel::communicate(s4u::Host* src, s4u::Host* dst, double size, double)
 {
-  NetworkConstantAction* action = new NetworkConstantAction(this, size, sg_latency_factor);
+  auto* action = new NetworkConstantAction(this, size, sg_latency_factor);
 
-  simgrid::s4u::Link::on_communicate(*action, src, dst);
+  s4u::Link::on_communicate(*action, src, dst);
   return action;
 }
 
@@ -93,6 +95,7 @@ void NetworkConstantAction::update_remains_lazy(double /*now*/)
 {
   THROW_IMPOSSIBLE;
 }
-}
+
+} // namespace resource
 } // namespace kernel
-}
+} // namespace simgrid
index eed41ed..624b34b 100644 (file)
@@ -17,11 +17,12 @@ namespace resource {
 class NetworkConstantModel : public NetworkModel {
 public:
   NetworkConstantModel();
-  Action* communicate(simgrid::s4u::Host* src, simgrid::s4u::Host* dst, double size, double rate) override;
+  Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
   double next_occuring_event(double now) override;
   void update_actions_state(double now, double delta) override;
 
-  LinkImpl* create_link(const std::string& name, double bw, double lat, s4u::Link::SharingPolicy policy) override;
+  LinkImpl* create_link(const std::string& name, const std::vector<double>& bws, double lat,
+                        s4u::Link::SharingPolicy policy) override;
 };
 
 class NetworkConstantAction : public NetworkAction {
index afdd570..1e62ea1 100644 (file)
@@ -20,12 +20,9 @@ static void IB_create_host_callback(simgrid::s4u::Host const& host)
   using simgrid::kernel::resource::NetworkIBModel;
 
   static int id=0;
-  // pour t->id -> rajouter une nouvelle struct dans le dict, pour stocker les comms actives
-
-  IBNode* act = new IBNode(id);
 
+  ((NetworkIBModel*)surf_network_model)->active_nodes.emplace(host.get_name(), IBNode(id));
   id++;
-  ((NetworkIBModel*)surf_network_model)->active_nodes.insert({host.get_name(), act});
 }
 
 static void IB_action_state_changed_callback(simgrid::kernel::resource::NetworkAction& action,
@@ -48,25 +45,10 @@ static void IB_action_init_callback(simgrid::kernel::resource::NetworkAction& ac
                                     simgrid::s4u::Host* dst)
 {
   simgrid::kernel::resource::NetworkIBModel* ibModel = (simgrid::kernel::resource::NetworkIBModel*)surf_network_model;
-  simgrid::kernel::resource::IBNode* act_src;
-  simgrid::kernel::resource::IBNode* act_dst;
-
-  auto asrc = ibModel->active_nodes.find(src->get_name());
-  if (asrc != ibModel->active_nodes.end()) {
-    act_src = asrc->second;
-  } else {
-    throw std::out_of_range(std::string("Could not find '") + src->get_cname() + "' active comms !");
-  }
-
-  auto adst = ibModel->active_nodes.find(dst->get_name());
-  if (adst != ibModel->active_nodes.end()) {
-    act_dst = adst->second;
-  } else {
-    throw std::out_of_range(std::string("Could not find '") + dst->get_cname() + "' active comms !");
-  }
+  simgrid::kernel::resource::IBNode* act_src         = &ibModel->active_nodes.at(src->get_name());
+  simgrid::kernel::resource::IBNode* act_dst         = &ibModel->active_nodes.at(dst->get_name());
 
   ibModel->active_comms[&action] = std::make_pair(act_src, act_dst);
-
   ibModel->updateIBfactors(&action, act_src, act_dst, 0);
 }
 
@@ -103,7 +85,7 @@ NetworkIBModel::NetworkIBModel() : NetworkSmpiModel()
 {
   /* Do not add this into all_existing_models: our ancestor already does so */
 
-  std::string IB_factors_string = simgrid::config::get_value<std::string>("smpi/IB-penalty-factors");
+  std::string IB_factors_string = config::get_value<std::string>("smpi/IB-penalty-factors");
   std::vector<std::string> radical_elements;
   boost::split(radical_elements, IB_factors_string, boost::is_any_of(";"));
 
@@ -129,15 +111,9 @@ NetworkIBModel::NetworkIBModel() : NetworkSmpiModel()
   }
 }
 
-NetworkIBModel::~NetworkIBModel()
-{
-  for (auto const& instance : active_nodes)
-    delete instance.second;
-}
-
 void NetworkIBModel::computeIBfactors(IBNode* root)
 {
-  double num_comm_out    = static_cast<double>(root->ActiveCommsUp.size());
+  double num_comm_out    = 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) {
@@ -234,6 +210,6 @@ void NetworkIBModel::updateIBfactors(NetworkAction* action, IBNode* from, IBNode
   updateIBfactors_rec(from, updated);
   XBT_DEBUG("IB - Finished updating %d", from->id);
 }
-}
-}
+} // namespace resource
+} // namespace kernel
 } // namespace simgrid
index f15fcfd..ee33677 100644 (file)
@@ -42,7 +42,9 @@ public:
 };
 
 class XBT_PRIVATE NetworkIBModel : public NetworkSmpiModel {
-private:
+  double Bs;
+  double Be;
+  double ys;
   void updateIBfactors_rec(IBNode* root, std::vector<bool>& updatedlist);
   void computeIBfactors(IBNode* root);
 
@@ -51,17 +53,13 @@ public:
   explicit NetworkIBModel(const char* name);
   NetworkIBModel(const NetworkIBModel&) = delete;
   NetworkIBModel& operator=(const NetworkIBModel&) = delete;
-  ~NetworkIBModel() override;
   void updateIBfactors(NetworkAction* action, IBNode* from, IBNode* to, int remove);
 
-  std::unordered_map<std::string, IBNode*> active_nodes;
+  std::unordered_map<std::string, IBNode> active_nodes;
   std::unordered_map<NetworkAction*, std::pair<IBNode*, IBNode*>> active_comms;
 
-  double Bs;
-  double Be;
-  double ys;
 };
-}
+} // namespace resource
 } // namespace kernel
 } // namespace simgrid
 #endif
index 530b483..54f8229 100644 (file)
@@ -6,6 +6,7 @@
 #include "network_interface.hpp"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/sg_config.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "surf/surf.hpp"
 
@@ -137,6 +138,17 @@ void LinkImpl::turn_off()
   if (is_on()) {
     Resource::turn_off();
     s4u::Link::on_state_change(this->piface_);
+
+    kernel::lmm::Variable* var       = nullptr;
+    const kernel::lmm::Element* elem = nullptr;
+    double now                       = surf_get_clock();
+    while ((var = get_constraint()->get_variable(&elem))) {
+      Action* action = static_cast<Action*>(var->get_id());
+      if (action->get_state() == Action::State::INITED || action->get_state() == Action::State::STARTED) {
+        action->set_finish_time(now);
+        action->set_state(Action::State::FAILED);
+      }
+    }
   }
 }
 
@@ -148,13 +160,13 @@ void LinkImpl::on_bandwidth_change()
 void LinkImpl::set_bandwidth_profile(profile::Profile* profile)
 {
   xbt_assert(bandwidth_.event == nullptr, "Cannot set a second bandwidth profile to Link %s", get_cname());
-  bandwidth_.event = profile->schedule(&future_evt_set, this);
+  bandwidth_.event = profile->schedule(&profile::future_evt_set, this);
 }
 
 void LinkImpl::set_latency_profile(profile::Profile* profile)
 {
   xbt_assert(latency_.event == nullptr, "Cannot set a second latency profile to Link %s", get_cname());
-  latency_.event = profile->schedule(&future_evt_set, this);
+  latency_.event = profile->schedule(&profile::future_evt_set, this);
 }
 
 /**********
@@ -178,7 +190,7 @@ std::list<LinkImpl*> NetworkAction::links() const
   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*>(get_variable()->get_constraint(i)->get_id());
+    Resource* resource = get_variable()->get_constraint(i)->get_id();
     LinkImpl* link     = dynamic_cast<LinkImpl*>(resource);
     if (link != nullptr)
       retlist.push_back(link);
index c3dbfc0..c473874 100644 (file)
@@ -10,7 +10,6 @@
 #include "simgrid/kernel/resource/Resource.hpp"
 #include "simgrid/s4u/Link.hpp"
 #include "src/kernel/lmm/maxmin.hpp"
-#include "src/kernel/resource/profile/trace_mgr.hpp"
 #include "src/surf/PropertyHolder.hpp"
 
 #include <list>
@@ -33,8 +32,8 @@ namespace resource {
  */
 class NetworkModel : public Model {
 public:
-  static simgrid::config::Flag<double> cfg_tcp_gamma;
-  static simgrid::config::Flag<bool> cfg_crosstraffic;
+  static config::Flag<double> cfg_tcp_gamma;
+  static config::Flag<bool> cfg_crosstraffic;
 
   explicit NetworkModel(Model::UpdateAlgo algo) : Model(algo) {}
   NetworkModel(const NetworkModel&) = delete;
@@ -49,29 +48,26 @@ public:
    * @param latency The initial latency of the Link in seconds
    * @param policy The sharing policy of the Link
    */
-  virtual LinkImpl* create_link(const std::string& name, double bandwidth, double latency,
+  virtual LinkImpl* create_link(const std::string& name, const std::vector<double>& bandwidths, double latency,
                                 s4u::Link::SharingPolicy policy) = 0;
 
   /**
    * @brief Create a communication between two hosts.
-   * @details It makes calls to the routing part, and execute the communication
-   *          between the two end points.
+   * @details It makes calls to the routing part, and execute the communication between the two end points.
    *
    * @param src The source of the communication
    * @param dst The destination of the communication
    * @param size The size of the communication in bytes
-   * @param rate Allows to limit the transfer rate. Negative value means
-   * unlimited.
+   * @param rate Allows to limit the transfer rate. Negative value means unlimited.
    * @return The action representing the communication
    */
   virtual Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) = 0;
 
   /**
    * @brief Get the right multiplicative factor for the latency.
-   * @details Depending on the model, the effective latency when sending
-   * a message might be different from the theoretical latency of the link,
-   * in function of the message size. In order to account for this, this
-   * function gets this factor.
+   * @details Depending on the model, the effective latency when sending a message might be different from the
+   * theoretical latency of the link, in function of the message size. In order to account for this, this function gets
+   * this factor.
    *
    * @param size The size of the message.
    * @return The latency factor.
@@ -80,10 +76,9 @@ public:
 
   /**
    * @brief Get the right multiplicative factor for the bandwidth.
-   * @details Depending on the model, the effective bandwidth when sending
-   * a message might be different from the theoretical bandwidth of the link,
-   * in function of the message size. In order to account for this, this
-   * function gets this factor.
+   * @details Depending on the model, the effective bandwidth when sending a message might be different from the
+   * theoretical bandwidth of the link, in function of the message size. In order to account for this, this function
+   * gets this factor.
    *
    * @param size The size of the message.
    * @return The bandwidth factor.
@@ -92,8 +87,8 @@ public:
 
   /**
    * @brief Get definitive bandwidth.
-   * @details It gives the minimum bandwidth between the one that would
-   * occur if no limitation was enforced, and the one arbitrary limited.
+   * @details It gives the minimum bandwidth between the one that would occur if no limitation was enforced, and the
+   * one arbitrary limited.
    * @param rate The desired maximum bandwidth.
    * @param bound The bandwidth with only the network taken into account.
    * @param size The size of the message.
@@ -112,7 +107,9 @@ public:
  * @brief SURF network link interface class
  * @details A Link represents the link between two [hosts](@ref simgrid::surf::HostImpl)
  */
-class LinkImpl : public Resource, public simgrid::surf::PropertyHolder {
+class LinkImpl : public Resource, public surf::PropertyHolder {
+  bool currently_destroying_ = false;
+
 protected:
   LinkImpl(NetworkModel* model, const std::string& name, lmm::Constraint* constraint);
   LinkImpl(const LinkImpl&) = delete;
@@ -121,10 +118,7 @@ protected:
 
 public:
   void destroy(); // Must be called instead of the destructor
-private:
-  bool currently_destroying_ = false;
 
-public:
   /** @brief Public interface */
   s4u::Link piface_;
 
@@ -163,11 +157,6 @@ public:
   Metric latency_                   = {1.0, 0, nullptr};
   Metric bandwidth_                 = {1.0, 0, nullptr};
 
-  /* User data */
-  void* get_data() { return userdata_; }
-  void set_data(void* d) { userdata_ = d; }
-private:
-  void* userdata_ = nullptr;
 };
 
 /**********
@@ -202,12 +191,13 @@ public:
 
   double latency_    = {};
   double lat_current_ = {};
-  double weight_     = {};
+  double sharing_penalty_ = {};
   double rate_       = {};
 };
-}
-}
+} // namespace resource
+} // namespace kernel
 } // namespace simgrid
+
 /** @ingroup SURF_models
  *  @brief The network model
  */
index 63c4a27..d5a4ecc 100644 (file)
@@ -17,6 +17,8 @@
 #include <ns3/ipv4-address-helper.h>
 #include <ns3/packet-sink-helper.h>
 #include <ns3/point-to-point-helper.h>
+#include <ns3/application-container.h>
+#include <ns3/event-id.h>
 
 #include "network_ns3.hpp"
 #include "ns3/ns3_simulator.hpp"
@@ -30,7 +32,7 @@
 #include "src/surf/xml/platf_private.hpp"
 #include "surf/surf.hpp"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ns3, surf, "Logging specific to the SURF network NS3 module");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ns3, surf, "Logging specific to the SURF network ns-3 module");
 
 std::vector<std::string> IPV4addr;
 
@@ -39,6 +41,7 @@ std::vector<std::string> IPV4addr;
  *****************/
 
 extern std::map<std::string, SgFlow*> flow_from_sock;
+extern std::map<std::string, ns3::ApplicationContainer> sink_from_sock;
 
 static ns3::InternetStackHelper stack;
 static ns3::NodeContainer nodes;
@@ -69,14 +72,14 @@ static void clusterCreation_cb(simgrid::kernel::routing::ClusterCreationArgs con
   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();
+    auto* host_dst = new NetPointNs3();
 
     // Create private link
-    std::string host_id   = cluster.prefix + std::to_string(i) + cluster.suffix;
-    NetPointNs3* host_src = simgrid::s4u::Host::by_name(host_id)->pimpl_netpoint->extension<NetPointNs3>();
-    xbt_assert(host_src, "Cannot find a NS3 host of name %s", host_id.c_str());
+    std::string host_id = cluster.prefix + std::to_string(i) + cluster.suffix;
+    auto* host_src      = simgrid::s4u::Host::by_name(host_id)->pimpl_netpoint->extension<NetPointNs3>();
+    xbt_assert(host_src, "Cannot find a ns-3 host of name %s", host_id.c_str());
 
-    // Any NS3 route is symmetrical
+    // Any ns-3 route is symmetrical
     ns3_add_link(host_src, host_dst, cluster.bw, cluster.lat);
 
     delete host_dst;
@@ -92,7 +95,7 @@ static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoin
                              std::vector<simgrid::kernel::resource::LinkImpl*> const& link_list)
 {
   if (link_list.size() == 1) {
-    simgrid::kernel::resource::LinkNS3* link = static_cast<simgrid::kernel::resource::LinkNS3*>(link_list[0]);
+    auto* link = static_cast<simgrid::kernel::resource::LinkNS3*>(link_list[0]);
 
     XBT_DEBUG("Route from '%s' to '%s' with link '%s' %s", src->get_cname(), dst->get_cname(), link->get_cname(),
               (symmetrical ? "(symmetrical)" : "(not symmetrical)"));
@@ -101,18 +104,18 @@ static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoin
     XBT_DEBUG("\tLink (%s) bw:%fbps lat:%fs", link->get_cname(), link->get_bandwidth(), link->get_latency());
 
     // create link ns3
-    NetPointNs3* host_src = src->extension<NetPointNs3>();
-    NetPointNs3* host_dst = dst->extension<NetPointNs3>();
+    auto* host_src = src->extension<NetPointNs3>();
+    auto* host_dst = dst->extension<NetPointNs3>();
 
-    xbt_assert(host_src != nullptr, "Network element %s does not seem to be NS3-ready", src->get_cname());
-    xbt_assert(host_dst != nullptr, "Network element %s does not seem to be NS3-ready", dst->get_cname());
+    xbt_assert(host_src != nullptr, "Network element %s does not seem to be ns-3-ready", src->get_cname());
+    xbt_assert(host_dst != nullptr, "Network element %s does not seem to be ns-3-ready", dst->get_cname());
 
     ns3_add_link(host_src, host_dst, link->get_bandwidth(), link->get_latency());
   } else {
     static bool warned_about_long_routes = false;
 
     if (not warned_about_long_routes)
-      XBT_WARN("Ignoring a route between %s and %s of length %zu: Only routes of length 1 are considered with NS3.\n"
+      XBT_WARN("Ignoring a route between %s and %s of length %zu: Only routes of length 1 are considered with ns-3.\n"
                "WARNING: You can ignore this warning if your hosts can still communicate when only considering routes "
                "of length 1.\n"
                "WARNING: Remove long routes to avoid this harmless message; subsequent long routes will be silently "
@@ -142,7 +145,7 @@ void surf_network_model_init_NS3()
 }
 
 static simgrid::config::Flag<std::string>
-    ns3_tcp_model("ns3/TcpModel", "The ns3 tcp model can be : NewReno or Reno or Tahoe", "default");
+    ns3_tcp_model("ns3/TcpModel", "The ns-3 tcp model can be : NewReno or Reno or Tahoe", "default");
 
 namespace simgrid {
 namespace kernel {
@@ -151,53 +154,65 @@ namespace resource {
 NetworkNS3Model::NetworkNS3Model() : NetworkModel(Model::UpdateAlgo::FULL)
 {
   xbt_assert(not sg_link_energy_is_inited(),
-             "LinkEnergy plugin and NS3 network models are not compatible. Are you looking for Ecofen, maybe?");
+             "LinkEnergy plugin and ns-3 network models are not compatible. Are you looking for Ecofen, maybe?");
 
   all_existing_models.push_back(this);
 
-  NetPointNs3::EXTENSION_ID = simgrid::kernel::routing::NetPoint::extension_create<NetPointNs3>();
+  NetPointNs3::EXTENSION_ID = routing::NetPoint::extension_create<NetPointNs3>();
 
-  ns3_initialize(ns3_tcp_model.get().c_str());
+  ns3_initialize(ns3_tcp_model.get());
 
-  simgrid::kernel::routing::NetPoint::on_creation.connect([](simgrid::kernel::routing::NetPoint& pt) {
+  routing::NetPoint::on_creation.connect([](routing::NetPoint& pt) {
     pt.extension_set<NetPointNs3>(new NetPointNs3());
-    XBT_VERB("SimGrid's %s is known as node %d within NS3", pt.get_cname(), pt.extension<NetPointNs3>()->node_num);
+    XBT_VERB("SimGrid's %s is known as node %d within ns-3", pt.get_cname(), pt.extension<NetPointNs3>()->node_num);
   });
-  simgrid::surf::on_cluster.connect(&clusterCreation_cb);
+  surf::on_cluster.connect(&clusterCreation_cb);
 
-  simgrid::s4u::on_platform_created.connect(&postparse_cb);
-  simgrid::s4u::NetZone::on_route_creation.connect(&routeCreation_cb);
+  s4u::Engine::on_platform_created.connect(&postparse_cb);
+  s4u::NetZone::on_route_creation.connect(&routeCreation_cb);
 }
 
 NetworkNS3Model::~NetworkNS3Model() {
   IPV4addr.clear();
 }
 
-LinkImpl* NetworkNS3Model::create_link(const std::string& name, double bandwidth, double latency,
-                                       s4u::Link::SharingPolicy policy)
+LinkImpl* NetworkNS3Model::create_link(const std::string& name, const std::vector<double>& bandwidths, double latency,
+                                       s4u::Link::SharingPolicy)
 {
-  return new LinkNS3(this, name, bandwidth, latency);
+  xbt_assert(bandwidths.size() == 1, "ns-3 links must use only 1 bandwidth.");
+  return new LinkNS3(this, name, bandwidths[0], latency);
 }
 
-kernel::resource::Action* NetworkNS3Model::communicate(s4u::Host* src, s4u::Host* dst, double size, double rate)
+Action* NetworkNS3Model::communicate(s4u::Host* src, s4u::Host* dst, double size, double rate)
 {
+  xbt_assert(rate == -1,
+             "Communication over ns-3 links cannot specify a specific rate. Please use -1 as a value instead of %f.",
+             rate);
   return new NetworkNS3Action(this, size, src, dst);
 }
 
 double NetworkNS3Model::next_occuring_event(double now)
 {
-  double time_to_next_flow_completion;
+  double time_to_next_flow_completion = 0.0;
   XBT_DEBUG("ns3_next_occuring_event");
 
   //get the first relevant value from the running_actions list
-  if (not get_started_action_set()->size() || now == 0.0)
+
+  // If there is no comms in NS-3, then we do not move it forward.
+  // We will synchronize NS-3 with SimGrid when starting a new communication.
+  // (see NetworkNS3Action::NetworkNS3Action() for more details on this point)
+  if (get_started_action_set()->empty() || now == 0.0)
     return -1.0;
-  else
-    do {
-      ns3_simulator(now);
-      time_to_next_flow_completion = ns3::Simulator::Now().GetSeconds() - surf_get_clock();
-    } while(double_equals(time_to_next_flow_completion, 0, sg_surf_precision));
 
+  XBT_DEBUG("doing a ns3 simulation for a duration of %f", now);
+  ns3_simulator(now);  
+  time_to_next_flow_completion = ns3::Simulator::Now().GetSeconds() - surf_get_clock();
+  // NS-3 stops as soon as a flow ends,
+  // but it does not process the other flows that may finish at the same (simulated) time.
+  // If another flow ends at the same time, time_to_next_flow_completion = 0
+  if(double_equals(time_to_next_flow_completion, 0, sg_surf_precision))
+    time_to_next_flow_completion = 0.0; 
   XBT_DEBUG("min       : %f", now);
   XBT_DEBUG("ns3  time : %f", ns3::Simulator::Now().GetSeconds());
   XBT_DEBUG("surf time : %f", surf_get_clock());
@@ -210,22 +225,19 @@ void NetworkNS3Model::update_actions_state(double now, double delta)
 {
   static std::vector<std::string> socket_to_destroy;
 
-  /* If there are no running flows, advance the NS3 simulator and return */
-  if (get_started_action_set()->empty()) {
-
-    while(double_positive(now - ns3::Simulator::Now().GetSeconds(), sg_surf_precision))
-      ns3_simulator(now-ns3::Simulator::Now().GetSeconds());
-
-    return;
-  }
-
   std::string ns3_socket;
-  for (auto elm : flow_from_sock) {
+  for (const auto& elm : flow_from_sock) {
     ns3_socket                = elm.first;
     SgFlow* sgFlow            = elm.second;
     NetworkNS3Action * action = sgFlow->action_;
     XBT_DEBUG("Processing socket %p (action %p)",sgFlow,action);
-    action->set_remains(action->get_cost() - sgFlow->sent_bytes_);
+    // Because NS3 stops as soon as a flow is finished, the other flows that ends at the same time may remains in an inconsistant state
+    // (i.e. remains_ == 0 but finished_ == false).
+    // However, SimGrid considers sometimes that an action with remains_ == 0 is finished.
+    // Thus, to avoid inconsistencies between SimGrid and NS3, set remains to 0 only when the flow is finished in NS3
+    int remains = action->get_cost() - sgFlow->sent_bytes_;
+    if(remains > 0)
+      action->set_remains(remains);
 
     if (TRACE_is_enabled() && action->get_state() == kernel::resource::Action::State::STARTED) {
       double data_delta_sent = sgFlow->sent_bytes_ - action->last_sent_;
@@ -243,6 +255,7 @@ void NetworkNS3Model::update_actions_state(double now, double delta)
     if(sgFlow->finished_){
       socket_to_destroy.push_back(ns3_socket);
       XBT_DEBUG("Destroy socket %p of action %p", ns3_socket.c_str(), action);
+      action->set_remains(0);
       action->finish(kernel::resource::Action::State::FINISHED);
     } else {
       XBT_DEBUG("Socket %p sent %u bytes out of %u (%u remaining)", ns3_socket.c_str(), sgFlow->sent_bytes_,
@@ -259,6 +272,7 @@ void NetworkNS3Model::update_actions_state(double now, double delta)
     }
     delete flow;
     flow_from_sock.erase(ns3_socket);
+    sink_from_sock.erase(ns3_socket);
   }
 }
 
@@ -277,26 +291,35 @@ LinkNS3::LinkNS3(NetworkNS3Model* model, const std::string& name, double bandwid
 
 LinkNS3::~LinkNS3() = default;
 
-void LinkNS3::apply_event(profile::Event* event, double value)
+void LinkNS3::apply_event(profile::Event*, double)
 {
   THROW_UNIMPLEMENTED;
 }
-void LinkNS3::set_bandwidth_profile(profile::Profile* profile)
+void LinkNS3::set_bandwidth_profile(profile::Profile*)
 {
-  xbt_die("The NS3 network model doesn't support bandwidth profiles");
+  xbt_die("The ns-3 network model doesn't support bandwidth profiles");
 }
-void LinkNS3::set_latency_profile(profile::Profile* profile)
+void LinkNS3::set_latency_profile(profile::Profile*)
 {
-  xbt_die("The NS3 network model doesn't support latency profiles");
+  xbt_die("The ns-3 network model doesn't support latency profiles");
 }
 
 /**********
  * Action *
  **********/
 
-NetworkNS3Action::NetworkNS3Action(kernel::resource::Model* model, double totalBytes, s4u::Host* src, s4u::Host* dst)
+NetworkNS3Action::NetworkNS3Action(Model* model, double totalBytes, s4u::Host* src, s4u::Host* dst)
     : NetworkAction(model, totalBytes, false), src_(src), dst_(dst)
 {
+  
+  // If there is no other started actions, we need to move NS-3 forward to be sync with SimGrid
+  if (model->get_started_action_set()->size()==1){
+    while(double_positive(surf_get_clock() - ns3::Simulator::Now().GetSeconds(), sg_surf_precision)){
+      XBT_DEBUG("Synchronizing NS-3 (time %f) with SimGrid (time %f)", ns3::Simulator::Now().GetSeconds(), surf_get_clock());
+      ns3_simulator(surf_get_clock() - ns3::Simulator::Now().GetSeconds());
+    }
+  }
+
   XBT_DEBUG("Communicate from %s to %s", src->get_cname(), dst->get_cname());
 
   static int port_number = 1025; // Port number is limited from 1025 to 65 000
@@ -307,25 +330,30 @@ NetworkNS3Action::NetworkNS3Action(kernel::resource::Model* model, double totalB
   ns3::Ptr<ns3::Node> src_node = src->pimpl_netpoint->extension<NetPointNs3>()->ns3_node_;
   ns3::Ptr<ns3::Node> dst_node = dst->pimpl_netpoint->extension<NetPointNs3>()->ns3_node_;
 
-  xbt_assert(node2 < IPV4addr.size(), "Element %s is unknown to NS3. Is it connected to any one-hop link?",
+  xbt_assert(node2 < IPV4addr.size(), "Element %s is unknown to ns-3. Is it connected to any one-hop link?",
              dst->pimpl_netpoint->get_cname());
   std::string& addr = IPV4addr[node2];
-  xbt_assert(not addr.empty(), "Element %s is unknown to NS3. Is it connected to any one-hop link?",
+  xbt_assert(not addr.empty(), "Element %s is unknown to ns-3. Is it connected to any one-hop link?",
              dst->pimpl_netpoint->get_cname());
 
   XBT_DEBUG("ns3: Create flow of %.0f 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::ApplicationContainer apps = sink.Install(dst_node);
 
   ns3::Ptr<ns3::Socket> sock = ns3::Socket::CreateSocket(src_node, ns3::TcpSocketFactory::GetTypeId());
 
   flow_from_sock.insert({transform_socket_ptr(sock), new SgFlow(totalBytes, this)});
+  sink_from_sock.insert({transform_socket_ptr(sock), apps});
 
   sock->Bind(ns3::InetSocketAddress(port_number));
 
   ns3::Simulator::ScheduleNow(&start_flow, sock, addr.c_str(), port_number);
 
   port_number++;
+  if(port_number > 65000){
+    port_number = 1025;
+    XBT_WARN("Too many connections! Port number is saturated. Trying to use the oldest ports.");
+  }
   xbt_assert(port_number <= 65000, "Too many connections! Port number is saturated.");
 
   s4u::Link::on_communicate(*this, src, dst);
@@ -349,19 +377,24 @@ void NetworkNS3Action::update_remains_lazy(double /*now*/)
 }
 
 } // namespace resource
-}
-}
+} // namespace kernel
+} // namespace simgrid
 
 void ns3_simulator(double maxSeconds)
 {
+  ns3::EventId id; 
   if (maxSeconds > 0.0) // If there is a maximum amount of time to run
-    ns3::Simulator::Stop(ns3::Seconds(maxSeconds));
+    id = ns3::Simulator::Schedule(ns3::Seconds(maxSeconds), &ns3::Simulator::Stop);
+
   XBT_DEBUG("Start simulator for at most %fs (current time: %f)", maxSeconds, surf_get_clock());
   ns3::Simulator::Run ();
-}
+  XBT_DEBUG("Simulator stopped at %fs", ns3::Simulator::Now().GetSeconds());
 
+  if(maxSeconds > 0.0)
+    id.Cancel();
+}
 
-// initialize the NS3 interface and environment
+// initialize the ns-3 interface and environment
 void ns3_initialize(std::string TcpProtocol)
 {
   //  tcpModel are:
@@ -405,9 +438,9 @@ void ns3_add_cluster(const char* id, double bw, double lat) {
   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");
+  xbt_assert(Nodes.GetN() <= 65000, "Cluster with ns-3 is limited to 65000 nodes");
   ns3::CsmaHelper csma;
-  csma.SetChannelAttribute("DataRate", ns3::DataRateValue(ns3::DataRate(bw * 8))); // NS3 takes bps, but we provide Bps
+  csma.SetChannelAttribute("DataRate", ns3::DataRateValue(ns3::DataRate(bw * 8))); // ns-3 takes bps, but we provide Bps
   csma.SetChannelAttribute("Delay", ns3::TimeValue(ns3::Seconds(lat)));
   ns3::NetDeviceContainer devices = csma.Install(Nodes);
   XBT_DEBUG("Create CSMA");
@@ -448,7 +481,7 @@ void ns3_add_link(NetPointNs3* src, NetPointNs3* dst, double bw, double lat) {
 
   XBT_DEBUG("\tAdd PTP from %d to %d bw:'%f Bps' lat:'%fs'", srcNum, dstNum, bw, lat);
   pointToPoint.SetDeviceAttribute("DataRate",
-                                  ns3::DataRateValue(ns3::DataRate(bw * 8))); // NS3 takes bps, but we provide Bps
+                                  ns3::DataRateValue(ns3::DataRate(bw * 8))); // ns-3 takes bps, but we provide Bps
   pointToPoint.SetChannelAttribute("Delay", ns3::TimeValue(ns3::Seconds(lat)));
 
   ns3::NetDeviceContainer netA;
index af200b8..b565c97 100644 (file)
@@ -18,9 +18,9 @@ class NetworkNS3Model : public NetworkModel {
 public:
   NetworkNS3Model();
   ~NetworkNS3Model();
-  LinkImpl* create_link(const std::string& name, double bandwidth, double latency,
+  LinkImpl* create_link(const std::string& name, const std::vector<double>& bandwidth, double latency,
                         s4u::Link::SharingPolicy policy) override;
-  kernel::resource::Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
+  Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
   double next_occuring_event(double now) override;
   bool next_occuring_event_is_idempotent() override { return false; }
   void update_actions_state(double now, double delta) override;
@@ -34,7 +34,7 @@ public:
   explicit LinkNS3(NetworkNS3Model* model, const std::string& name, double bandwidth, double latency);
   ~LinkNS3();
 
-  void apply_event(simgrid::kernel::profile::Event* event, double value) override;
+  void apply_event(profile::Event* event, double value) override;
   void set_bandwidth(double value) override { THROW_UNIMPLEMENTED; }
   void set_latency(double value) override { THROW_UNIMPLEMENTED; }
   void set_bandwidth_profile(profile::Profile* profile) override;
@@ -46,7 +46,7 @@ public:
  **********/
 class XBT_PRIVATE NetworkNS3Action : public NetworkAction {
 public:
-  NetworkNS3Action(kernel::resource::Model* model, double cost, s4u::Host* src, s4u::Host* dst);
+  NetworkNS3Action(Model* model, double cost, s4u::Host* src, s4u::Host* dst);
 
   void suspend() override;
   void resume() override;
@@ -60,7 +60,7 @@ public:
 };
 
 } // namespace resource
-}
-}
+} // namespace kernel
+} // namespace simgrid
 
 #endif /* NETWORK_NS3_HPP_ */
index 9a14001..f96bc1a 100644 (file)
@@ -47,12 +47,10 @@ NetworkSmpiModel::NetworkSmpiModel() : NetworkCm02Model()
   /* Do not add this into all_existing_models: our ancestor already does so */
 }
 
-NetworkSmpiModel::~NetworkSmpiModel() = default;
-
 double NetworkSmpiModel::get_bandwidth_factor(double size)
 {
   if (smpi_bw_factor.empty())
-    smpi_bw_factor = parse_factor(simgrid::config::get_value<std::string>("smpi/bw-factor"));
+    smpi_bw_factor = parse_factor(config::get_value<std::string>("smpi/bw-factor"));
 
   double current = 1.0;
   for (auto const& fact : smpi_bw_factor) {
@@ -70,7 +68,7 @@ double NetworkSmpiModel::get_bandwidth_factor(double size)
 double NetworkSmpiModel::get_latency_factor(double size)
 {
   if (smpi_lat_factor.empty())
-    smpi_lat_factor = parse_factor(simgrid::config::get_value<std::string>("smpi/lat-factor"));
+    smpi_lat_factor = parse_factor(config::get_value<std::string>("smpi/lat-factor"));
 
   double current = 1.0;
   for (auto const& fact : smpi_lat_factor) {
@@ -89,14 +87,6 @@ double NetworkSmpiModel::get_bandwidth_constraint(double rate, double bound, dou
 {
   return rate < 0 ? bound : std::min(bound, rate * get_bandwidth_factor(size));
 }
-
-/************
- * Resource *
- ************/
-
-/**********
- * Action *
- **********/
-}
-}
+} // namespace resource
+} // namespace kernel
 } // namespace simgrid
index e92f784..2864fc1 100644 (file)
@@ -15,7 +15,7 @@ namespace resource {
 class XBT_PRIVATE NetworkSmpiModel : public NetworkCm02Model {
 public:
   NetworkSmpiModel();
-  ~NetworkSmpiModel();
+  ~NetworkSmpiModel() = default;
 
   double get_latency_factor(double size);
   double get_bandwidth_factor(double size);
index 19297c6..72171b3 100644 (file)
@@ -9,10 +9,15 @@
 
 #include <ns3/ipv4-address-helper.h>
 #include <ns3/point-to-point-helper.h>
+#include <ns3/application-container.h>
+#include <ns3/ptr.h>
+#include <ns3/callback.h>
+#include <ns3/packet-sink.h>
 
 #include <algorithm>
 
 std::map<std::string, SgFlow*> flow_from_sock; // ns3::sock -> SgFlow
+std::map<std::string, ns3::ApplicationContainer> sink_from_sock; // ns3::sock -> ns3::PacketSink
 
 static void receive_callback(ns3::Ptr<ns3::Socket> socket);
 static void datasent_cb(ns3::Ptr<ns3::Socket> socket, uint32_t dataSent);
@@ -32,6 +37,12 @@ static SgFlow* getFlowFromSocket(ns3::Ptr<ns3::Socket> socket)
   return (it == flow_from_sock.end()) ? nullptr : it->second;
 }
 
+static ns3::ApplicationContainer* getSinkFromSocket(ns3::Ptr<ns3::Socket> socket)
+{
+  auto it = sink_from_sock.find(transform_socket_ptr(socket));
+  return (it == sink_from_sock.end()) ? nullptr : &(it->second);
+}
+
 static void receive_callback(ns3::Ptr<ns3::Socket> socket)
 {
   SgFlow* flow = getFlowFromSocket(socket);
@@ -41,14 +52,14 @@ static void receive_callback(ns3::Ptr<ns3::Socket> socket)
     flow->finished_ = true;
     XBT_DEBUG("recv_cb of F[%p, %p, %u]", flow, flow->action_, flow->total_bytes_);
     XBT_DEBUG("Stop simulator at %f seconds", ns3::Simulator::Now().GetSeconds());
-    ns3::Simulator::Stop(ns3::Seconds(0.0));
-    ns3::Simulator::Run();
+    ns3::Simulator::Stop();
   }
 }
 
 static void send_cb(ns3::Ptr<ns3::Socket> sock, uint32_t txSpace)
 {
   SgFlow* flow = getFlowFromSocket(sock);
+  ns3::ApplicationContainer* sink = getSinkFromSocket(sock);
   XBT_DEBUG("Asked to write on F[%p, total: %u, remain: %u]", flow, flow->total_bytes_, flow->remaining_);
 
   if (flow->remaining_ == 0) // all data was already buffered (and socket was already closed)
@@ -57,7 +68,7 @@ static void send_cb(ns3::Ptr<ns3::Socket> sock, uint32_t txSpace)
   /* While not all is buffered and there remain space in the buffers */
   while (flow->buffered_bytes_ < flow->total_bytes_ && sock->GetTxAvailable() > 0) {
 
-    // Send at most 1040 bytes (data size in a TCP packet), as NS3 seems to not split correctly by itself
+    // Send at most 1040 bytes (data size in a TCP packet), as ns-3 seems to not split correctly by itself
     uint32_t toWrite = std::min({flow->remaining_, sock->GetTxAvailable(), std::uint32_t(1040)});
     if (toWrite == 0) { // buffer full
       XBT_DEBUG("%f: buffer full on flow %p (still %u to go)", ns3::Simulator::Now().GetSeconds(), flow,
@@ -74,8 +85,18 @@ static void send_cb(ns3::Ptr<ns3::Socket> sock, uint32_t txSpace)
               flow->remaining_);
   }
 
-  if (flow->buffered_bytes_ >= flow->total_bytes_)
+  if (flow->buffered_bytes_ >= flow->total_bytes_){
+    XBT_DEBUG("Closing Sockets of flow %p", flow);
+    // Closing the sockets of the receiving application
+    ns3::Ptr<ns3::PacketSink> app = ns3::DynamicCast<ns3::PacketSink, ns3::Application>(sink->Get(0));
+    ns3::Ptr<ns3::Socket> listening_sock = app->GetListeningSocket();
+    listening_sock->Close();
+    listening_sock->SetRecvCallback(ns3::MakeNullCallback<void, ns3::Ptr<ns3::Socket>>());
+    for(ns3::Ptr<ns3::Socket> accepted_sock : app->GetAcceptedSockets())
+      accepted_sock->Close();
+    // Closing the socket of the sender
     sock->Close();
+  }
 }
 
 static void datasent_cb(ns3::Ptr<ns3::Socket> socket, uint32_t dataSent)
@@ -102,7 +123,7 @@ static void errorClose_callback(ns3::Ptr<ns3::Socket> socket)
 {
   SgFlow* flow = getFlowFromSocket(socket);
   XBT_DEBUG("errorClose_cb of F[%p, %p, %u]", flow, flow->action_, flow->total_bytes_);
-  xbt_die("NS3: a socket was closed anormally");
+  xbt_die("ns-3: a socket was closed anormally");
 }
 
 static void succeededConnect_callback(ns3::Ptr<ns3::Socket> socket)
@@ -115,7 +136,7 @@ static void failedConnect_callback(ns3::Ptr<ns3::Socket> socket)
 {
   SgFlow* mysocket = getFlowFromSocket(socket);
   XBT_DEBUG("failedConnect_cb of F[%p, %p, %u]", mysocket, mysocket->action_, mysocket->total_bytes_);
-  xbt_die("NS3: a socket failed to connect");
+  xbt_die("ns-3: a socket failed to connect");
 }
 
 void start_flow(ns3::Ptr<ns3::Socket> sock, const char* to, uint16_t port_number)
@@ -127,8 +148,6 @@ void start_flow(ns3::Ptr<ns3::Socket> sock, const char* to, uint16_t port_number
   // tell the tcp implementation to call send_cb again
   // if we blocked and new tx buffer space becomes available
   sock->SetSendCallback(MakeCallback(&send_cb));
-  // Notice when the send is over
-  sock->SetRecvCallback(MakeCallback(&receive_callback));
   // Notice when we actually sent some data (mostly for the TRACING module)
   sock->SetDataSentCallback(MakeCallback(&datasent_cb));
 
index e296241..85c2bc3 100644 (file)
@@ -4,6 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "ptask_L07.hpp"
+#include "src/kernel/resource/profile/Event.hpp"
 #include "surf/surf.hpp"
 #include "xbt/config.hpp"
 
@@ -56,7 +57,8 @@ NetworkL07Model::NetworkL07Model(HostL07Model* hmodel, kernel::lmm::System* sys)
     : NetworkModel(Model::UpdateAlgo::FULL), hostModel_(hmodel)
 {
   set_maxmin_system(sys);
-  loopback_ = NetworkL07Model::create_link("__loopback__", 498000000, 0.000015, s4u::Link::SharingPolicy::FATPIPE);
+  loopback_ = NetworkL07Model::create_link("__loopback__", std::vector<double>{498000000}, 0.000015,
+                                           s4u::Link::SharingPolicy::FATPIPE);
 }
 
 NetworkL07Model::~NetworkL07Model()
@@ -92,7 +94,7 @@ void HostL07Model::update_actions_state(double /*now*/, double delta)
       }
       if ((action.latency_ <= 0.0) && (action.is_suspended() == 0)) {
         action.updateBound();
-        get_maxmin_system()->update_variable_weight(action.get_variable(), 1.0);
+        get_maxmin_system()->update_variable_penalty(action.get_variable(), 1.0);
         action.set_last_update();
       }
     }
@@ -109,7 +111,7 @@ void HostL07Model::update_actions_state(double /*now*/, double delta)
      * If it's not done, it may have failed.
      */
 
-    if (((action.get_remains() <= 0) && (action.get_variable()->get_weight() > 0)) ||
+    if (((action.get_remains() <= 0) && (action.get_variable()->get_penalty() > 0)) ||
         ((action.get_max_duration() != NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
       action.finish(kernel::resource::Action::State::FINISHED);
       continue;
@@ -120,8 +122,8 @@ void HostL07Model::update_actions_state(double /*now*/, double delta)
     kernel::lmm::Constraint* cnst = action.get_variable()->get_constraint(i);
     while (cnst != nullptr) {
       i++;
-      void* constraint_id = cnst->get_id();
-      if (not static_cast<simgrid::kernel::resource::Resource*>(constraint_id)->is_on()) {
+      kernel::resource::Resource* constraint_id = cnst->get_id();
+      if (not constraint_id->is_on()) {
         XBT_DEBUG("Action (%p) Failed!!", &action);
         action.finish(kernel::resource::Action::State::FAILED);
         break;
@@ -131,9 +133,9 @@ void HostL07Model::update_actions_state(double /*now*/, double delta)
   }
 }
 
-kernel::resource::Action* HostL07Model::execute_parallel(const std::vector<s4u::Host*>& host_list,
-                                                         const double* flops_amount, const double* bytes_amount,
-                                                         double rate)
+kernel::resource::CpuAction* HostL07Model::execute_parallel(const std::vector<s4u::Host*>& host_list,
+                                                            const double* flops_amount, const double* bytes_amount,
+                                                            double rate)
 {
   return new L07Action(this, host_list, flops_amount, bytes_amount, rate);
 }
@@ -179,7 +181,7 @@ L07Action::L07Action(kernel::resource::Model* model, const std::vector<s4u::Host
       model->get_maxmin_system()->variable_new(this, 1.0, (rate > 0 ? rate : -1.0), host_list.size() + link_nb));
 
   if (latency_ > 0)
-    model->get_maxmin_system()->update_variable_weight(get_variable(), 0.0);
+    model->get_maxmin_system()->update_variable_penalty(get_variable(), 0.0);
 
   /* Expand it for the CPUs even if there is nothing to compute, to make sure that it gets expended even if there is no
    * communication either */
@@ -218,15 +220,16 @@ kernel::resource::Action* NetworkL07Model::communicate(s4u::Host* src, s4u::Host
   return res;
 }
 
-Cpu* CpuL07Model::create_cpu(simgrid::s4u::Host* host, const std::vector<double>& speed_per_pstate, int core)
+kernel::resource::Cpu* CpuL07Model::create_cpu(s4u::Host* host, const std::vector<double>& speed_per_pstate, int core)
 {
   return new CpuL07(this, host, speed_per_pstate, core);
 }
 
-kernel::resource::LinkImpl* NetworkL07Model::create_link(const std::string& name, double bandwidth, double latency,
-                                                         s4u::Link::SharingPolicy policy)
+kernel::resource::LinkImpl* NetworkL07Model::create_link(const std::string& name, const std::vector<double>& bandwidths,
+                                                         double latency, s4u::Link::SharingPolicy policy)
 {
-  return new LinkL07(this, name, bandwidth, latency, policy);
+  xbt_assert(bandwidths.size() == 1, "Non WIFI link must have only 1 bandwidth.");
+  return new LinkL07(this, name, bandwidths[0], latency, policy);
 }
 
 /************
@@ -254,25 +257,25 @@ LinkL07::LinkL07(NetworkL07Model* model, const std::string& name, double bandwid
   s4u::Link::on_creation(this->piface_);
 }
 
-kernel::resource::Action* CpuL07::execution_start(double size)
+kernel::resource::CpuAction* CpuL07::execution_start(double size)
 {
   std::vector<s4u::Host*> host_list = {get_host()};
 
   double* flops_amount = new double[host_list.size()]();
   flops_amount[0] = size;
 
-  kernel::resource::Action* res =
+  kernel::resource::CpuAction* res =
       static_cast<CpuL07Model*>(get_model())->hostModel_->execute_parallel(host_list, flops_amount, nullptr, -1);
   static_cast<L07Action*>(res)->free_arrays_ = true;
   return res;
 }
 
-kernel::resource::Action* CpuL07::sleep(double duration)
+kernel::resource::CpuAction* CpuL07::sleep(double duration)
 {
   L07Action *action = static_cast<L07Action*>(execution_start(1.0));
   action->set_max_duration(duration);
-  action->suspended_ = kernel::resource::Action::SuspendStates::sleeping;
-  get_model()->get_maxmin_system()->update_variable_weight(action->get_variable(), 0.0);
+  action->set_suspend_state(kernel::resource::Action::SuspendStates::SLEEPING);
+  get_model()->get_maxmin_system()->update_variable_penalty(action->get_variable(), 0.0);
 
   return action;
 }
@@ -405,7 +408,7 @@ void L07Action::updateBound()
   }
   double lat_bound = kernel::resource::NetworkModel::cfg_tcp_gamma / (2.0 * lat_current);
   XBT_DEBUG("action (%p) : lat_bound = %g", this, lat_bound);
-  if ((latency_ <= 0.0) && (suspended_ == Action::SuspendStates::not_suspended)) {
+  if ((latency_ <= 0.0) && is_running()) {
     if (rate_ < 0)
       get_model()->get_maxmin_system()->update_variable_bound(get_variable(), lat_bound);
     else
index edc2fb2..c96ca41 100644 (file)
@@ -42,18 +42,18 @@ public:
 
   double next_occuring_event(double now) override;
   void update_actions_state(double now, double delta) override;
-  kernel::resource::Action* execute_parallel(const std::vector<s4u::Host*>& host_list, const double* flops_amount,
-                                             const double* bytes_amount, double rate) override;
+  kernel::resource::CpuAction* execute_parallel(const std::vector<s4u::Host*>& host_list, const double* flops_amount,
+                                                const double* bytes_amount, double rate) override;
 };
 
-class CpuL07Model : public CpuModel {
+class CpuL07Model : public kernel::resource::CpuModel {
 public:
   CpuL07Model(HostL07Model* hmodel, kernel::lmm::System* sys);
   CpuL07Model(const CpuL07Model&) = delete;
   CpuL07Model& operator=(const CpuL07Model&) = delete;
   ~CpuL07Model();
 
-  Cpu* create_cpu(simgrid::s4u::Host* host, const std::vector<double>& speed_per_pstate, int core) override;
+  kernel::resource::Cpu* create_cpu(s4u::Host* host, const std::vector<double>& speed_per_pstate, int core) override;
   HostL07Model *hostModel_;
 };
 
@@ -63,8 +63,8 @@ public:
   NetworkL07Model(const NetworkL07Model&) = delete;
   NetworkL07Model& operator=(const NetworkL07Model&) = delete;
   ~NetworkL07Model();
-  kernel::resource::LinkImpl* create_link(const std::string& name, double bandwidth, double latency,
-                                          s4u::Link::SharingPolicy policy) override;
+  kernel::resource::LinkImpl* create_link(const std::string& name, const std::vector<double>& bandwidths,
+                                          double latency, s4u::Link::SharingPolicy policy) override;
 
   kernel::resource::Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
 
@@ -75,7 +75,7 @@ public:
  * Resource *
  ************/
 
-class CpuL07 : public Cpu {
+class CpuL07 : public kernel::resource::Cpu {
 public:
   CpuL07(CpuL07Model* model, s4u::Host* host, const std::vector<double>& speed_per_pstate, int core);
   CpuL07(const CpuL07&) = delete;
@@ -83,13 +83,13 @@ public:
   ~CpuL07() override;
   bool is_used() override;
   void apply_event(kernel::profile::Event* event, double value) override;
-  kernel::resource::Action* execution_start(double size) override;
-  kernel::resource::Action* execution_start(double, int) override
+  kernel::resource::CpuAction* execution_start(double size) override;
+  kernel::resource::CpuAction* execution_start(double, int) override
   {
     THROW_UNIMPLEMENTED;
     return nullptr;
   }
-  kernel::resource::Action* sleep(double duration) override;
+  kernel::resource::CpuAction* sleep(double duration) override;
 
 protected:
   void on_speed_change() override;
@@ -111,11 +111,11 @@ public:
 /**********
  * Action *
  **********/
-class L07Action : public CpuAction {
-  friend Action *CpuL07::execution_start(double size);
-  friend Action *CpuL07::sleep(double duration);
-  friend Action* HostL07Model::execute_parallel(const std::vector<s4u::Host*>& host_list, const double* flops_amount,
-                                                const double* bytes_amount, double rate);
+class L07Action : public kernel::resource::CpuAction {
+  friend CpuAction* CpuL07::execution_start(double size);
+  friend CpuAction* CpuL07::sleep(double duration);
+  friend CpuAction* HostL07Model::execute_parallel(const std::vector<s4u::Host*>& host_list, const double* flops_amount,
+                                                   const double* bytes_amount, double rate);
   friend Action* NetworkL07Model::communicate(s4u::Host* src, s4u::Host* dst, double size, double rate);
 
 public:
@@ -140,7 +140,7 @@ private:
                              // exec and regular comms
 };
 
-}
-}
+} // namespace surf
+} // namespace simgrid
 
 #endif /* HOST_L07_HPP_ */
index bbea348..67a3538 100644 (file)
@@ -19,6 +19,8 @@
 #include "src/include/simgrid/sg_config.hpp"
 #include "src/include/surf/surf.hpp"
 #include "src/kernel/EngineImpl.hpp"
+#include "src/kernel/resource/DiskImpl.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/simix/smx_private.hpp"
 #include "src/surf/HostImpl.hpp"
 #include "src/surf/xml/platf_private.hpp"
@@ -50,13 +52,13 @@ static simgrid::kernel::routing::NetZoneImpl* routing_get_current()
 /** Module management function: creates all internal data structures */
 void sg_platf_init()
 {
-  simgrid::s4u::on_platform_created.connect(check_disk_attachment);
+  simgrid::s4u::Engine::on_platform_created.connect(check_disk_attachment);
 }
 
 /** Module management function: frees all internal data structures */
 void sg_platf_exit() {
   simgrid::surf::on_cluster.disconnect_slots();
-  simgrid::s4u::on_platform_created.disconnect_slots();
+  simgrid::s4u::Engine::on_platform_created.disconnect_slots();
 
   /* make sure that we will reinit the models while loading the platf once reinited */
   surf_parse_models_setup_already_called = 0;
@@ -79,6 +81,10 @@ void sg_platf_new_host(simgrid::kernel::routing::HostCreationArgs* args)
   host->pimpl_->storage_ = mount_list;
   mount_list.clear();
 
+  host->pimpl_->disks_ = std::move(args->disks);
+  for (auto d : host->pimpl_->disks_)
+    d->set_host(host);
+
   /* Change from the defaults */
   if (args->state_trace)
     host->pimpl_cpu->set_state_profile(args->state_trace);
@@ -86,7 +92,7 @@ void sg_platf_new_host(simgrid::kernel::routing::HostCreationArgs* args)
     host->pimpl_cpu->set_speed_profile(args->speed_trace);
   if (args->pstate != 0)
     host->pimpl_cpu->set_pstate(args->pstate);
-  if (args->coord && strcmp(args->coord, ""))
+  if (not args->coord.empty())
     new simgrid::kernel::routing::vivaldi::Coords(host->pimpl_netpoint, args->coord);
 }
 
@@ -112,11 +118,10 @@ simgrid::kernel::routing::NetPoint* sg_platf_new_router(const std::string& name,
 static void sg_platf_new_link(simgrid::kernel::routing::LinkCreationArgs* link, const std::string& link_name)
 {
   simgrid::kernel::resource::LinkImpl* l =
-      surf_network_model->create_link(link_name, link->bandwidth, link->latency, link->policy);
+      surf_network_model->create_link(link_name, link->bandwidths, link->latency, link->policy);
 
   if (link->properties) {
-    for (auto const& elm : *link->properties)
-      l->set_property(elm.first, elm.second);
+    l->set_properties(*link->properties);
   }
 
   if (link->latency_trace)
@@ -167,6 +172,9 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster
   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->properties != nullptr)
+    for (auto const& elm : *cluster->properties)
+      current_as->get_iface()->set_property(elm.first, elm.second);
 
   if(cluster->loopback_bw > 0 || cluster->loopback_lat > 0){
     current_as->num_links_per_node_++;
@@ -217,7 +225,7 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster
 
       simgrid::kernel::routing::LinkCreationArgs link;
       link.id        = tmp_link;
-      link.bandwidth = cluster->loopback_bw;
+      link.bandwidths.push_back(cluster->loopback_bw);
       link.latency   = cluster->loopback_lat;
       link.policy    = simgrid::s4u::Link::SharingPolicy::FATPIPE;
       sg_platf_new_link(&link);
@@ -237,7 +245,7 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster
 
       simgrid::kernel::routing::LinkCreationArgs link;
       link.id        = tmp_link;
-      link.bandwidth = cluster->limiter_link;
+      link.bandwidths.push_back(cluster->limiter_link);
       link.latency = 0;
       link.policy    = simgrid::s4u::Link::SharingPolicy::SHARED;
       sg_platf_new_link(&link);
@@ -272,7 +280,7 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster
 
     simgrid::kernel::routing::LinkCreationArgs link;
     link.id        = std::string(cluster->id)+ "_backbone";
-    link.bandwidth = cluster->bb_bw;
+    link.bandwidths.push_back(cluster->bb_bw);
     link.latency   = cluster->bb_lat;
     link.policy    = cluster->bb_sharing_policy;
 
@@ -315,7 +323,7 @@ void sg_platf_new_cabinet(simgrid::kernel::routing::CabinetCreationArgs* cabinet
     simgrid::kernel::routing::LinkCreationArgs link;
     link.policy    = simgrid::s4u::Link::SharingPolicy::SPLITDUPLEX;
     link.latency   = cabinet->lat;
-    link.bandwidth = cabinet->bw;
+    link.bandwidths.push_back(cabinet->bw);
     link.id        = "link_" + hostname;
     sg_platf_new_link(&link);
 
@@ -328,6 +336,17 @@ void sg_platf_new_cabinet(simgrid::kernel::routing::CabinetCreationArgs* cabinet
   delete cabinet->radicals;
 }
 
+simgrid::kernel::resource::DiskImpl* sg_platf_new_disk(simgrid::kernel::routing::DiskCreationArgs* disk)
+{
+  simgrid::kernel::resource::DiskImpl* d = surf_disk_model->createDisk(disk->id, disk->read_bw, disk->write_bw);
+  if (disk->properties) {
+    d->set_properties(*disk->properties);
+    delete disk->properties;
+  }
+  simgrid::s4u::Disk::on_creation(*d->get_iface());
+  return d;
+}
+
 void sg_platf_new_storage(simgrid::kernel::routing::StorageCreationArgs* storage)
 {
   xbt_assert(std::find(known_storages.begin(), known_storages.end(), storage->id) == known_storages.end(),
@@ -362,8 +381,7 @@ void sg_platf_new_storage(simgrid::kernel::routing::StorageCreationArgs* storage
   auto s = surf_storage_model->createStorage(storage->id, stype->id, storage->content, storage->attach);
 
   if (storage->properties) {
-    for (auto const& elm : *storage->properties)
-      s->set_property(elm.first, elm.second);
+    s->set_properties(*storage->properties);
     delete storage->properties;
   }
 }
@@ -450,12 +468,12 @@ void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* actor)
 
     XBT_DEBUG("Process %s@%s will be started at time %f", arg->name.c_str(), arg->host->get_cname(), start_time);
     simgrid::simix::Timer::set(start_time, [arg, auto_restart]() {
-      simgrid::kernel::actor::ActorImplPtr actor = simgrid::kernel::actor::ActorImpl::create(
+      simgrid::kernel::actor::ActorImplPtr new_actor = simgrid::kernel::actor::ActorImpl::create(
           arg->name.c_str(), std::move(arg->code), arg->data, arg->host, arg->properties.get(), nullptr);
       if (arg->kill_time >= 0)
-        actor->set_kill_time(arg->kill_time);
+        new_actor->set_kill_time(arg->kill_time);
       if (auto_restart)
-        actor->set_auto_restart(auto_restart);
+        new_actor->set_auto_restart(auto_restart);
       delete arg;
     });
   } else {                      // start_time <= SIMIX_get_clock()
@@ -500,6 +518,7 @@ static void surf_config_models_setup()
   std::string host_model_name    = simgrid::config::get_value<std::string>("host/model");
   std::string network_model_name = simgrid::config::get_value<std::string>("network/model");
   std::string cpu_model_name     = simgrid::config::get_value<std::string>("cpu/model");
+  std::string disk_model_name    = simgrid::config::get_value<std::string>("disk/model");
   std::string storage_model_name = simgrid::config::get_value<std::string>("storage/model");
 
   /* The compound host model is needed when using non-default net/cpu models */
@@ -528,6 +547,10 @@ static void surf_config_models_setup()
   XBT_DEBUG("Call vm_model_init");
   surf_vm_model_init_HL13();
 
+  XBT_DEBUG("Call disk_model_init");
+  int disk_id = find_model_description(surf_disk_model_description, disk_model_name);
+  surf_disk_model_description[disk_id].model_init_preparse();
+
   XBT_DEBUG("Call storage_model_init");
   int storage_id = find_model_description(surf_storage_model_description, storage_model_name);
   surf_storage_model_description[storage_id].model_init_preparse();
@@ -546,7 +569,7 @@ static void surf_config_models_setup()
 simgrid::kernel::routing::NetZoneImpl* sg_platf_new_Zone_begin(simgrid::kernel::routing::ZoneCreationArgs* zone)
 {
   if (not surf_parse_models_setup_already_called) {
-    simgrid::s4u::on_platform_creation();
+    simgrid::s4u::Engine::on_platform_creation();
 
     /* Initialize the surf models. That must be done after we got all config, and before we need the models.
      * That is, after the last <config> tag, if any, and before the first of cluster|peer|zone|trace|trace_connect
index f550883..668366d 100644 (file)
@@ -22,12 +22,12 @@ void check_disk_attachment()
 {
   for (auto const& s : simgrid::s4u::Engine::get_instance()->get_all_storages()) {
     simgrid::kernel::routing::NetPoint* host_elm =
-        simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(s->get_impl()->getHost());
+        simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(s->get_impl()->get_host());
     if (not host_elm)
       surf_parse_error(std::string("Unable to attach storage ") + s->get_cname() + ": host " +
-                       s->get_impl()->getHost() + " does not exist.");
+                       s->get_impl()->get_host() + " does not exist.");
     else
-      s->set_host(simgrid::s4u::Host::by_name(s->get_impl()->getHost()));
+      s->set_host(simgrid::s4u::Host::by_name(s->get_impl()->get_host()));
   }
 }
 
@@ -54,10 +54,10 @@ StorageImpl* StorageN11Model::createStorage(const std::string& id, const std::st
 {
   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.c_str());
+  double Bread =
+      surf_parse_get_bandwidth(storage_type->model_properties->at("Bread").c_str(), "property Bread, storage", type_id);
   double Bwrite = surf_parse_get_bandwidth(storage_type->model_properties->at("Bwrite").c_str(),
-                                           "property Bwrite, storage", type_id.c_str());
+                                           "property Bwrite, storage", type_id);
 
   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);
@@ -74,12 +74,12 @@ double StorageN11Model::next_occuring_event(double now)
 void StorageN11Model::update_actions_state(double /*now*/, double delta)
 {
   for (auto it = std::begin(*get_started_action_set()); it != std::end(*get_started_action_set());) {
-    StorageAction& action = static_cast<StorageAction&>(*it);
+    auto& action = *it;
     ++it; // increment iterator here since the following calls to action.finish() may invalidate it
     action.update_remains(lrint(action.get_variable()->get_value() * delta));
     action.update_max_duration(delta);
 
-    if (((action.get_remains_no_update() <= 0) && (action.get_variable()->get_weight() > 0)) ||
+    if (((action.get_remains_no_update() <= 0) && (action.get_variable()->get_penalty() > 0)) ||
         ((action.get_max_duration() != NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
       action.finish(Action::State::FINISHED);
     }
@@ -127,10 +127,10 @@ StorageN11Action::StorageN11Action(Model* model, double cost, bool failed, Stora
   model->get_maxmin_system()->expand(storage->get_constraint(), get_variable(), 1.0);
   switch(type) {
     case s4u::Io::OpType::READ:
-      model->get_maxmin_system()->expand(storage->constraintRead_, get_variable(), 1.0);
+      model->get_maxmin_system()->expand(storage->constraint_read_, get_variable(), 1.0);
       break;
     case s4u::Io::OpType::WRITE:
-      model->get_maxmin_system()->expand(storage->constraintWrite_, get_variable(), 1.0);
+      model->get_maxmin_system()->expand(storage->constraint_write_, get_variable(), 1.0);
       break;
     default:
       THROW_UNIMPLEMENTED;
@@ -146,9 +146,9 @@ void StorageN11Action::cancel()
 void StorageN11Action::suspend()
 {
   XBT_IN("(%p)", this);
-  if (suspended_ != Action::SuspendStates::sleeping) {
-    get_model()->get_maxmin_system()->update_variable_weight(get_variable(), 0.0);
-    suspended_ = Action::SuspendStates::suspended;
+  if (is_running()) {
+    get_model()->get_maxmin_system()->update_variable_penalty(get_variable(), 0.0);
+    set_suspend_state(Action::SuspendStates::SUSPENDED);
   }
   XBT_OUT();
 }
@@ -163,7 +163,7 @@ void StorageN11Action::set_max_duration(double /*duration*/)
   THROW_UNIMPLEMENTED;
 }
 
-void StorageN11Action::set_priority(double /*priority*/)
+void StorageN11Action::set_sharing_penalty(double)
 {
   THROW_UNIMPLEMENTED;
 }
index 4d4f67c..6ac7cc7 100644 (file)
@@ -45,9 +45,9 @@ public:
              double bwrite, const std::string& type_id, const std::string& content_name, sg_size_t size,
              const std::string& attach);
   virtual ~StorageN11() = default;
-  StorageAction* io_start(sg_size_t size, s4u::Io::OpType type);
-  StorageAction* read(sg_size_t size);
-  StorageAction* write(sg_size_t size);
+  StorageAction* io_start(sg_size_t size, s4u::Io::OpType type) override;
+  StorageAction* read(sg_size_t size) override;
+  StorageAction* write(sg_size_t size) override;
 };
 
 /**********
@@ -61,7 +61,7 @@ public:
   void cancel() override;
   void resume() override;
   void set_max_duration(double duration) override;
-  void set_priority(double priority) override;
+  void set_sharing_penalty(double sharing_penalty) override;
   void update_remains_lazy(double now) override;
 };
 
index 0a12d85..f559bb2 100644 (file)
@@ -6,6 +6,8 @@
 #include "simgrid/s4u/Engine.hpp"
 #include "src/include/surf/surf.hpp"
 #include "src/instr/instr_private.hpp"
+#include "src/kernel/resource/DiskImpl.hpp"
+#include "src/kernel/resource/profile/FutureEvtSet.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 
 #include <algorithm>
@@ -26,11 +28,11 @@ void surf_presolve()
   simgrid::kernel::resource::Resource* resource = nullptr;
 
   XBT_DEBUG ("Consume all trace events occurring before the starting time.");
-  while ((next_event_date = future_evt_set.next_date()) != -1.0) {
+  while ((next_event_date = simgrid::kernel::profile::future_evt_set.next_date()) != -1.0) {
     if (next_event_date > NOW)
       break;
 
-    while ((event = future_evt_set.pop_leq(next_event_date, &value, &resource))) {
+    while ((event = simgrid::kernel::profile::future_evt_set.pop_leq(next_event_date, &value, &resource))) {
       if (value >= 0)
         resource->apply_event(event, value);
     }
@@ -70,7 +72,7 @@ double surf_solve(double max_date)
 
   for (auto const& model : all_existing_models) {
     if (model != surf_host_model && model != surf_vm_model && model != surf_network_model &&
-        model != surf_storage_model) {
+        model != surf_storage_model && model != surf_disk_model) {
       double next_event_model = model->next_occuring_event(NOW);
       if ((time_delta < 0.0 || next_event_model < time_delta) && next_event_model >= 0.0)
         time_delta = next_event_model;
@@ -82,7 +84,7 @@ double surf_solve(double max_date)
   XBT_DEBUG("Looking for next trace event");
 
   while (1) { // Handle next occurring events until none remains
-    double next_event_date = future_evt_set.next_date();
+    double next_event_date = simgrid::kernel::profile::future_evt_set.next_date();
     XBT_DEBUG("Next TRACE event: %f", next_event_date);
 
     if (not surf_network_model->next_occuring_event_is_idempotent()) { // NS3, I see you
@@ -109,7 +111,7 @@ double surf_solve(double max_date)
 
     XBT_DEBUG("Updating models (min = %g, NOW = %g, next_event_date = %g)", time_delta, NOW, next_event_date);
 
-    while ((event = future_evt_set.pop_leq(next_event_date, &value, &resource))) {
+    while ((event = simgrid::kernel::profile::future_evt_set.pop_leq(next_event_date, &value, &resource))) {
       if (resource->is_used() || (watched_hosts.find(resource->get_cname()) != 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);
@@ -142,7 +144,7 @@ double surf_solve(double max_date)
   for (auto const& model : all_existing_models)
     model->update_actions_state(NOW, time_delta);
 
-  simgrid::s4u::on_time_advance(time_delta);
+  simgrid::s4u::Engine::on_time_advance(time_delta);
 
   TRACE_paje_dump_buffer(false);
 
index 8beb759..0b2ea3c 100644 (file)
@@ -7,10 +7,12 @@
 #include "mc/mc.h"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/sg_config.hpp"
-#include "src/internal_config.h"
+#include "src/kernel/resource/profile/FutureEvtSet.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/simgrid/version.h"
 #include "src/surf/HostImpl.hpp"
 #include "src/surf/xml/platf.hpp"
+#include "src/xbt_modinter.h" /* whether initialization was already done */
 #include "surf/surf.hpp"
 #include "xbt/module.h"
 
@@ -36,49 +38,43 @@ std::vector<std::string> surf_path;
 std::set<std::string> watched_hosts;
 extern std::map<std::string, simgrid::kernel::resource::StorageType*> storage_types;
 
-s_surf_model_description_t* surf_plugin_description = nullptr;
-XBT_PUBLIC void simgrid_add_plugin_description(const char* name, const char* description, void_f_void_t init_fun)
-{
-  static int plugin_amount = 0;
-
-  /* no need to check for plugin name conflict: the compiler already ensures that the generated
-   * simgrid_##id##_plugin_register() is unique */
+std::vector<surf_model_description_t>* surf_plugin_description = nullptr;
 
-  plugin_amount++;
-  surf_plugin_description = static_cast<s_surf_model_description_t*>(
-      xbt_realloc(surf_plugin_description, sizeof(s_surf_model_description_t) * (plugin_amount + 2)));
+static void XBT_ATTRIB_DESTRUCTOR(800) simgrid_free_plugin_description()
+{
+  delete surf_plugin_description;
+  surf_plugin_description = nullptr;
+}
 
-  surf_plugin_description[plugin_amount - 1] = {name, description, init_fun};
-  surf_plugin_description[plugin_amount]     = {nullptr, nullptr, nullptr}; // this array must be null terminated
+XBT_PUBLIC void simgrid_add_plugin_description(const char* name, const char* description, void_f_void_t init_fun)
+{
+  if (not surf_plugin_description)
+    surf_plugin_description = new std::vector<surf_model_description_t>;
+  surf_plugin_description->emplace_back(surf_model_description_t{name, description, init_fun});
 }
 
 /* Don't forget to update the option description in smx_config when you change this */
-s_surf_model_description_t surf_network_model_description[] = {
-    {"LV08", "Realistic network analytic model (slow-start modeled by multiplying latency by 13.01, bandwidth by .97; "
-             "bottleneck sharing uses a payload of S=20537 for evaluating RTT). ",
+const std::vector<surf_model_description_t> surf_network_model_description = {
+    {"LV08",
+     "Realistic network analytic model (slow-start modeled by multiplying latency by 13.01, bandwidth by .97; "
+     "bottleneck sharing uses a payload of S=20537 for evaluating RTT). ",
      &surf_network_model_init_LegrandVelho},
-    {"Constant", "Simplistic network model where all communication take a constant time (one second). This model "
-                 "provides the lowest realism, but is (marginally) faster.",
+    {"Constant",
+     "Simplistic network model where all communication take a constant time (one second). This model "
+     "provides the lowest realism, but is (marginally) faster.",
      &surf_network_model_init_Constant},
-    {"SMPI", "Realistic network model specifically tailored for HPC settings (accurate modeling of slow start with "
-             "correction factors on three intervals: < 1KiB, < 64 KiB, >= 64 KiB)",
+    {"SMPI",
+     "Realistic network model specifically tailored for HPC settings (accurate modeling of slow start with "
+     "correction factors on three intervals: < 1KiB, < 64 KiB, >= 64 KiB)",
      &surf_network_model_init_SMPI},
     {"IB", "Realistic network model specifically tailored for HPC settings, with Infiniband contention model",
      &surf_network_model_init_IB},
-    {"CM02", "Legacy network analytic model (Very similar to LV08, but without corrective factors. The timings of "
-             "small messages are thus poorly modeled).",
+    {"CM02",
+     "Legacy network analytic model (Very similar to LV08, but without corrective factors. The timings of "
+     "small messages are thus poorly modeled).",
      &surf_network_model_init_CM02},
-    {"NS3", "Network pseudo-model using the NS3 tcp model instead of an analytic model", &surf_network_model_init_NS3},
-    {"Reno",
-     "Model from Steven H. Low using lagrange_solve instead of lmm_solve (experts only; check the code for more info).",
-     &surf_network_model_init_Reno},
-    {"Reno2",
-     "Model from Steven H. Low using lagrange_solve instead of lmm_solve (experts only; check the code for more info).",
-     &surf_network_model_init_Reno2},
-    {"Vegas",
-     "Model from Steven H. Low using lagrange_solve instead of lmm_solve (experts only; check the code for more info).",
-     &surf_network_model_init_Vegas},
-    {nullptr, nullptr, nullptr} /* this array must be nullptr terminated */
+    {"ns-3", "Network pseudo-model using the ns-3 tcp model instead of an analytic model",
+     &surf_network_model_init_NS3},
 };
 
 #if ! HAVE_SMPI
@@ -91,32 +87,37 @@ void surf_network_model_init_IB() {
 #endif
 #if !SIMGRID_HAVE_NS3
 void surf_network_model_init_NS3() {
-  xbt_die("Please activate NS3 support in cmake and install the dependencies to use the NS3 network model.");
+  xbt_die("Please activate ns-3 support in cmake and install the dependencies to use the NS3 network model.");
 }
 #endif
 
-s_surf_model_description_t surf_cpu_model_description[] = {
-  {"Cas01", "Simplistic CPU model (time=size/power).", &surf_cpu_model_init_Cas01},
-  {nullptr, nullptr,  nullptr}      /* this array must be nullptr terminated */
+const std::vector<surf_model_description_t> surf_cpu_model_description = {
+    {"Cas01", "Simplistic CPU model (time=size/power).", &surf_cpu_model_init_Cas01},
+};
+
+const std::vector<surf_model_description_t> surf_host_model_description = {
+    {"default", "Default host model. Currently, CPU:Cas01 and network:LV08 (with cross traffic enabled)",
+     &surf_host_model_init_current_default},
+    {"compound", "Host model that is automatically chosen if you change the network and CPU models",
+     &surf_host_model_init_compound},
+    {"ptask_L07", "Host model somehow similar to Cas01+CM02 but allowing parallel tasks",
+     &surf_host_model_init_ptask_L07},
 };
 
-s_surf_model_description_t surf_host_model_description[] = {
-  {"default",   "Default host model. Currently, CPU:Cas01 and network:LV08 (with cross traffic enabled)", &surf_host_model_init_current_default},
-  {"compound",  "Host model that is automatically chosen if you change the network and CPU models", &surf_host_model_init_compound},
-  {"ptask_L07", "Host model somehow similar to Cas01+CM02 but allowing parallel tasks", &surf_host_model_init_ptask_L07},
-  {nullptr, nullptr, nullptr}      /* this array must be nullptr terminated */
+const std::vector<surf_model_description_t> surf_optimization_mode_description = {
+    {"Lazy", "Lazy action management (partial invalidation in lmm + heap in action remaining).", nullptr},
+    {"TI", "Trace integration. Highly optimized mode when using availability traces (only available for the Cas01 CPU "
+           "model for now).",
+     nullptr},
+    {"Full", "Full update of remaining and variables. Slow but may be useful when debugging.", nullptr},
 };
 
-s_surf_model_description_t surf_optimization_mode_description[] = {
-  {"Lazy", "Lazy action management (partial invalidation in lmm + heap in action remaining).", nullptr},
-  {"TI",   "Trace integration. Highly optimized mode when using availability traces (only available for the Cas01 CPU model for now).", nullptr},
-  {"Full", "Full update of remaining and variables. Slow but may be useful when debugging.", nullptr},
-  {nullptr, nullptr, nullptr}      /* this array must be nullptr terminated */
+const std::vector<surf_model_description_t> surf_disk_model_description = {
+    {"default", "Simplistic disk model.", &surf_disk_model_init_default},
 };
 
-s_surf_model_description_t surf_storage_model_description[] = {
-  {"default", "Simplistic storage model.", &surf_storage_model_init_default},
-  {nullptr, nullptr,  nullptr}      /* this array must be nullptr terminated */
+const std::vector<surf_model_description_t> surf_storage_model_description = {
+    {"default", "Simplistic storage model.", &surf_storage_model_init_default},
 };
 
 double NOW = 0;
@@ -185,25 +186,29 @@ FILE* surf_fopen(const std::string& name, const char* mode)
 }
 
 /** Displays the long description of all registered models, and quit */
-void model_help(const char *category, s_surf_model_description_t * table)
+void model_help(const char* category, const std::vector<surf_model_description_t>& table)
 {
-  printf("Long description of the %s models accepted by this simulator:\n", category);
-  for (int i = 0; table[i].name; i++)
-    printf("  %s: %s\n", table[i].name, table[i].description);
+  XBT_HELP("Long description of the %s models accepted by this simulator:", category);
+  for (auto const& item : table)
+    XBT_HELP("  %s: %s", item.name, item.description);
 }
 
-int find_model_description(s_surf_model_description_t* table, const std::string& name)
+int find_model_description(const std::vector<surf_model_description_t>& table, const std::string& name)
 {
-  for (int i = 0; table[i].name; i++)
-    if (name == table[i].name)
-      return i;
+  auto pos = std::find_if(table.begin(), table.end(),
+                          [&name](const surf_model_description_t& item) { return item.name == name; });
+  if (pos != table.end())
+    return std::distance(table.begin(), pos);
 
-  if (not table[0].name)
+  if (table.empty())
     xbt_die("No model is valid! This is a bug.");
 
-  std::string name_list = std::string(table[0].name);
-  for (int i = 1; table[i].name; i++)
-    name_list = name_list + ", " + table[i].name;
+  std::string sep;
+  std::string name_list;
+  for (auto const& item : table) {
+    name_list += sep + item.name;
+    sep = ", ";
+  }
 
   xbt_die("Model '%s' is invalid! Valid models are: %s.", name.c_str(), name_list.c_str());
   return -1;
@@ -245,54 +250,51 @@ void sg_version_get(int* ver_major, int* ver_minor, int* ver_patch)
 
 void sg_version()
 {
-  std::printf("This program was linked against %s (git: %s), found in %s.\n",
-              SIMGRID_VERSION_STRING, SIMGRID_GIT_VERSION, SIMGRID_INSTALL_PREFIX);
+  XBT_HELP("This program was linked against %s (git: %s), found in %s.", SIMGRID_VERSION_STRING, SIMGRID_GIT_VERSION,
+           SIMGRID_INSTALL_PREFIX);
 
 #if SIMGRID_HAVE_MC
-  std::printf("   Model-checking support compiled in.\n");
+  XBT_HELP("   Model-checking support compiled in.");
 #else
-  std::printf("   Model-checking support disabled at compilation.\n");
+  XBT_HELP("   Model-checking support disabled at compilation.");
 #endif
 
 #if SIMGRID_HAVE_NS3
-  std::printf("   NS3 support compiled in.\n");
+  XBT_HELP("   ns-3 support compiled in.");
 #else
-  std::printf("   NS3 support disabled at compilation.\n");
+  XBT_HELP("   ns-3 support disabled at compilation.");
 #endif
 
 #if SIMGRID_HAVE_JEDULE
-  std::printf("   Jedule support compiled in.\n");
+  XBT_HELP("   Jedule support compiled in.");
 #else
-  std::printf("   Jedule support disabled at compilation.\n");
+  XBT_HELP("   Jedule support disabled at compilation.");
 #endif
 
 #if SIMGRID_HAVE_LUA
-  std::printf("   Lua support compiled in.\n");
+  XBT_HELP("   Lua support compiled in.");
 #else
-  std::printf("   Lua support disabled at compilation.\n");
+  XBT_HELP("   Lua support disabled at compilation.");
 #endif
 
 #if SIMGRID_HAVE_MALLOCATOR
-  std::printf("   Mallocator support compiled in.\n");
+  XBT_HELP("   Mallocator support compiled in.");
 #else
-  std::printf("   Mallocator support disabled at compilation.\n");
+  XBT_HELP("   Mallocator support disabled at compilation.");
 #endif
 
-  std::printf("\nTo cite SimGrid in a publication, please use:\n"
-              "   Henri Casanova, Arnaud Giersch, Arnaud Legrand, Martin Quinson, Frédéric Suter. \n"
-              "   Versatile, Scalable, and Accurate Simulation of Distributed Applications and Platforms. \n"
-              "   Journal of Parallel and Distributed Computing, Elsevier, 2014, 74 (10), pp.2899-2917.\n");
-  std::printf("The pdf file and a BibTeX entry for LaTeX users can be found at http://hal.inria.fr/hal-01017319\n");
+  XBT_HELP("\nTo cite SimGrid in a publication, please use:\n"
+           "   Henri Casanova, Arnaud Giersch, Arnaud Legrand, Martin Quinson, Frédéric Suter. \n"
+           "   Versatile, Scalable, and Accurate Simulation of Distributed Applications and Platforms. \n"
+           "   Journal of Parallel and Distributed Computing, Elsevier, 2014, 74 (10), pp.2899-2917.\n"
+           "The pdf file and a BibTeX entry for LaTeX users can be found at http://hal.inria.fr/hal-01017319");
 }
 
 void surf_init(int *argc, char **argv)
 {
-  if (USER_HOST_LEVEL != -1) // Already initialized
+  if (xbt_initialized > 0)
     return;
 
-  XBT_DEBUG("Create all Libs");
-  USER_HOST_LEVEL = simgrid::s4u::Host::extension_create(nullptr);
-
   xbt_init(argc, argv);
 
   sg_config_init(argc, argv);
@@ -314,8 +316,6 @@ void surf_exit()
   for (auto const& model : all_existing_models)
     delete model;
 
-  xbt_free(surf_plugin_description);
-
   tmgr_finalize();
   sg_platf_exit();
 
index 6a602cc..ca08c21 100644 (file)
@@ -6,6 +6,7 @@
 #ifndef SURF_MODEL_H_
 #define SURF_MODEL_H_
 
+#include "src/internal_config.h"
 #include "src/surf/surf_private.hpp"
 
 #include <cmath>
@@ -72,6 +73,9 @@ XBT_PUBLIC void surf_cpu_model_init_Cas01();
  *
  *  @see surf_host_model_init_SMPI()
  */
+#if !HAVE_SMPI
+XBT_ATTRIB_NORETURN
+#endif
 XBT_PUBLIC void surf_network_model_init_SMPI();
 
 /** @ingroup SURF_models
@@ -82,6 +86,9 @@ XBT_PUBLIC void surf_network_model_init_SMPI();
  *
  *  @see surf_host_model_init_IB()
  */
+#if !HAVE_SMPI
+XBT_ATTRIB_NORETURN
+#endif
 XBT_PUBLIC void surf_network_model_init_IB();
 
 /** @ingroup SURF_models
@@ -121,47 +128,11 @@ XBT_PUBLIC void surf_network_model_init_CM02();
  *
  *  @see surf_host_model_init_NS3()
  */
+#if !SIMGRID_HAVE_NS3
+XBT_ATTRIB_NORETURN
+#endif
 XBT_PUBLIC void surf_network_model_init_NS3();
 
-/** @ingroup SURF_models
- *  @brief Initializes the platform with the network model Reno
- *
- *  The problem is related to max( sum( arctan(C * Df * xi) ) ).
- *
- *  Reference:
- *  [LOW03] S. H. Low. A duality model of TCP and queue management algorithms.
- *  IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
- *
- *  Call this function only if you plan using surf_host_model_init_compound.
- */
-XBT_PUBLIC void surf_network_model_init_Reno();
-
-/** @ingroup SURF_models
- *  @brief Initializes the platform with the network model Reno2
- *
- *  The problem is related to max( sum( arctan(C * Df * xi) ) ).
- *
- *  Reference:
- *  [LOW01] S. H. Low. A duality model of TCP and queue management algorithms.
- *  IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
- *
- *  Call this function only if you plan using surf_host_model_init_compound.
- */
-XBT_PUBLIC void surf_network_model_init_Reno2();
-
-/** @ingroup SURF_models
- *  @brief Initializes the platform with the network model Vegas
- *
- *  This problem is related to max( sum( a * Df * ln(xi) ) ) which is equivalent  to the proportional fairness.
- *
- *  Reference:
- *  [LOW03] S. H. Low. A duality model of TCP and queue management algorithms.
- *  IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
- *
- *  Call this function only if you plan using surf_host_model_init_compound.
- */
-XBT_PUBLIC void surf_network_model_init_Vegas();
-
 /** @ingroup SURF_models
  *  @brief Initializes the platform with the current best network and cpu models at hand
  *
@@ -202,41 +173,44 @@ XBT_PUBLIC void surf_host_model_init_ptask_L07();
  */
 XBT_PUBLIC void surf_storage_model_init_default();
 
+XBT_PUBLIC void surf_disk_model_init_default();
+
 /* --------------------
  *  Model Descriptions
  * -------------------- */
 /** @brief Resource model description */
-struct surf_model_description {
+struct surf_model_description_t {
   const char* name;
   const char* description;
   void_f_void_t model_init_preparse;
 };
-typedef struct surf_model_description s_surf_model_description_t;
 
-XBT_PUBLIC int find_model_description(s_surf_model_description_t* table, const std::string& name);
-XBT_PUBLIC void model_help(const char* category, s_surf_model_description_t* table);
+XBT_PUBLIC int find_model_description(const std::vector<surf_model_description_t>& table, const std::string& name);
+XBT_PUBLIC void model_help(const char* category, const std::vector<surf_model_description_t>& table);
 
-#define SIMGRID_REGISTER_PLUGIN(id, desc, init)                       \
-  void simgrid_##id##_plugin_register();                              \
-  void XBT_ATTRIB_CONSTRUCTOR(800) simgrid_##id##_plugin_register() { \
-    simgrid_add_plugin_description(#id, desc, init);                  \
+#define SIMGRID_REGISTER_PLUGIN(id, desc, init)                                                                        \
+  static void XBT_ATTRIB_CONSTRUCTOR(800) _XBT_CONCAT3(simgrid_, id, _plugin_register)()                               \
+  {                                                                                                                    \
+    simgrid_add_plugin_description(_XBT_STRINGIFY(id), (desc), (init));                                                \
   }
 
 XBT_PUBLIC void simgrid_add_plugin_description(const char* name, const char* description, void_f_void_t init_fun);
 
 /** @brief The list of all available plugins */
-XBT_PUBLIC_DATA s_surf_model_description_t* surf_plugin_description;
+XBT_PUBLIC_DATA std::vector<surf_model_description_t>* surf_plugin_description;
 /** @brief The list of all available optimization modes (both for cpu and networks).
  *  These optimization modes can be set using --cfg=cpu/optim:... and --cfg=network/optim:... */
-XBT_PUBLIC_DATA s_surf_model_description_t surf_optimization_mode_description[];
+XBT_PUBLIC_DATA const std::vector<surf_model_description_t> surf_optimization_mode_description;
 /** @brief The list of all cpu models (pick one with --cfg=cpu/model) */
-XBT_PUBLIC_DATA s_surf_model_description_t surf_cpu_model_description[];
+XBT_PUBLIC_DATA const std::vector<surf_model_description_t> surf_cpu_model_description;
 /** @brief The list of all network models (pick one with --cfg=network/model) */
-XBT_PUBLIC_DATA s_surf_model_description_t surf_network_model_description[];
+XBT_PUBLIC_DATA const std::vector<surf_model_description_t> surf_network_model_description;
+/** @brief The list of all disk models (pick one with --cfg=disk/model) */
+XBT_PUBLIC_DATA const std::vector<surf_model_description_t> surf_disk_model_description;
 /** @brief The list of all storage models (pick one with --cfg=storage/model) */
-XBT_PUBLIC_DATA s_surf_model_description_t surf_storage_model_description[];
+XBT_PUBLIC_DATA const std::vector<surf_model_description_t> surf_storage_model_description;
 /** @brief The list of all host models (pick one with --cfg=host/model:) */
-XBT_PUBLIC_DATA s_surf_model_description_t surf_host_model_description[];
+XBT_PUBLIC_DATA const std::vector<surf_model_description_t> surf_host_model_description;
 
 /**********
  * Action *
index 4160d86..35d4bca 100644 (file)
@@ -24,6 +24,8 @@ XBT_PUBLIC int surf_parse_get_int(const std::string& s);
 XBT_PUBLIC double surf_parse_get_time(const char* string, const char* entity_kind, const std::string& name);
 XBT_PUBLIC double surf_parse_get_size(const char* string, const char* entity_kind, const std::string& name);
 XBT_PUBLIC double surf_parse_get_bandwidth(const char* string, const char* entity_kind, const std::string& name);
+XBT_PUBLIC std::vector<double> surf_parse_get_bandwidths(const char* string, const char* entity_kind,
+                                                         const std::string& name);
 XBT_PUBLIC double surf_parse_get_speed(const char* string, const char* entity_kind, const std::string& name);
 
 XBT_PUBLIC int surf_parse(); /* Entry-point to the parser */
index 0ab1fa2..679a312 100644 (file)
@@ -39,8 +39,9 @@ struct HostCreationArgs {
   int core_amount          = 0;
   profile::Profile* speed_trace                            = nullptr;
   profile::Profile* state_trace                            = nullptr;
-  const char* coord        = nullptr;
+  std::string coord                                        = "";
   std::unordered_map<std::string, std::string>* properties = nullptr;
+  std::vector<simgrid::kernel::resource::DiskImpl*> disks;
 };
 
 class HostLinkCreationArgs {
@@ -53,7 +54,7 @@ public:
 class LinkCreationArgs {
 public:
   std::string id;
-  double bandwidth                    = 0;
+  std::vector<double> bandwidths;
   profile::Profile* bandwidth_trace                        = nullptr;
   double latency                      = 0;
   profile::Profile* latency_trace                          = nullptr;
@@ -138,6 +139,14 @@ public:
   sg_size_t size;
 };
 
+class DiskCreationArgs {
+public:
+  std::string id;
+  std::unordered_map<std::string, std::string>* properties;
+  double read_bw;
+  double write_bw;
+};
+
 class MountCreationArgs {
 public:
   std::string storageId;
@@ -203,6 +212,9 @@ XBT_PUBLIC void sg_platf_new_bypassRoute(simgrid::kernel::routing::RouteCreation
 
 XBT_PUBLIC void sg_platf_new_trace(simgrid::kernel::routing::ProfileCreationArgs* trace);
 
+XBT_PUBLIC simgrid::kernel::resource::DiskImpl*
+sg_platf_new_disk(simgrid::kernel::routing::DiskCreationArgs* disk); // Add a disk to the current host
+
 XBT_PUBLIC void sg_platf_new_storage(simgrid::kernel::routing::StorageCreationArgs* storage); // Add a storage to the current Zone
 XBT_PUBLIC void sg_platf_new_storage_type(simgrid::kernel::routing::StorageTypeCreationArgs* storage_type);
 XBT_PUBLIC void sg_platf_new_mount(simgrid::kernel::routing::MountCreationArgs* mount);
index 65543dc..ba78c64 100644 (file)
@@ -1,7 +1,7 @@
 <!--
              DTD of SimGrid platform and deployment files.
 
-More info: http://simgrid.gforge.inria.fr/simgrid/latest/doc/platform.html
+More info: https://simgrid.org/doc/latest/platform.html
 To upgrade your files, use the tool simgrid_update_xml
 
 * Things that will change in upcoming version 5 (TODO):
@@ -135,7 +135,7 @@ To upgrade your files, use the tool simgrid_update_xml
 <!ATTLIST mount storageId CDATA #REQUIRED>
 <!ATTLIST mount name CDATA #REQUIRED>
 
-<!ELEMENT host (prop|mount)*>
+<!ELEMENT host (disk|prop|mount)*>
 <!ATTLIST host id CDATA #REQUIRED>
 <!ATTLIST host speed CDATA #REQUIRED>
 <!ATTLIST host core  CDATA "1">
@@ -145,6 +145,11 @@ To upgrade your files, use the tool simgrid_update_xml
 <!ATTLIST host coordinates  CDATA "">
 <!ATTLIST host pstate CDATA "0.0">
 
+<!ELEMENT disk (prop*)>
+<!ATTLIST disk id CDATA "/">
+<!ATTLIST disk read_bw CDATA #REQUIRED>
+<!ATTLIST disk write_bw CDATA #REQUIRED>
+
 <!ELEMENT storage (prop*)>
 <!ATTLIST storage id CDATA #REQUIRED>
 <!ATTLIST storage typeId CDATA #REQUIRED>
@@ -212,7 +217,7 @@ To upgrade your files, use the tool simgrid_update_xml
 <!ATTLIST link latency CDATA "0">
 <!ATTLIST link latency_file CDATA "">
 <!ATTLIST link state_file CDATA "">
-<!ATTLIST link sharing_policy (SHARED|SPLITDUPLEX|FULLDUPLEX|FATPIPE) "SHARED">
+<!ATTLIST link sharing_policy (SHARED|SPLITDUPLEX|FULLDUPLEX|FATPIPE|WIFI) "SHARED">
 
 <!ELEMENT route (link_ctn*)>
 <!ATTLIST route src CDATA #REQUIRED>
index 9456793..8f59eb2 100644 (file)
@@ -630,8 +630,8 @@ static void yynoreturn yy_fatal_error ( const char* msg  );
        (yy_hold_char) = *yy_cp; \
        *yy_cp = '\0'; \
        (yy_c_buf_p) = yy_cp;
-#define YY_NUM_RULES 668
-#define YY_END_OF_BUFFER 669
+#define YY_NUM_RULES 685
+#define YY_END_OF_BUFFER 686
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
@@ -639,7 +639,7 @@ struct yy_trans_info
        flex_int32_t yy_verify;
        flex_int32_t yy_nxt;
        };
-static const flex_int16_t yy_accept[4108] =
+static const flex_int16_t yy_accept[4193] =
     {   0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
@@ -676,16 +676,17 @@ static const flex_int16_t yy_accept[4108] =
 
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,  669,  667,   16,   10,   10,   16,   16,  647,
-       10,  647,    5,    6,    5,    8,    9,    8,  663,  655,
-      656,  664,  661,  664,  662,  666,  655,  656,  666,   43,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,  686,  684,   16,   10,   10,   16,   16,  664,
+       10,  664,    5,    6,    5,    8,    9,    8,  680,  672,
+      673,  681,  678,  681,  679,  683,  672,  673,  683,   43,
        10,   43,   43,   43,   41,   43,   43,   47,   10,   47,
-       47,  667,   47,  667,   47,   47,  667,  667,   47,  667,
-       47,  667,   47,   68,   10,   68,   68,   68,   66,   68,
-       68,   68,   72,   10,   72,  667,   72,   89,   10,   89,
-       89,   89,   87,   89,   89,   89,   89,   89,   93,   10,
+       47,  684,   47,  684,   47,   47,  684,  684,   47,  684,
+       47,  684,   47,   68,   10,   68,   68,   68,   66,   68,
+       68,   68,   72,   10,   72,  684,   72,   89,   10,   89,
 
-       93,  667,   93,  100,   10,  100,  100,  100,   98,  100,
+       89,   89,   87,   89,   89,   89,   89,   89,   93,   10,
+       93,  684,   93,  100,   10,  100,  100,  100,   98,  100,
       104,   10,  104,  115,   10,  115,  115,  115,  113,  115,
       115,  115,  119,   10,  119,  132,   10,  132,  132,  132,
       130,  132,  132,  132,  136,   10,  136,  136,  145,   10,
@@ -694,387 +695,397 @@ static const flex_int16_t yy_accept[4108] =
        10,  166,  166,  185,   10,  185,  185,  185,  183,  185,
       185,  185,  185,  185,  185,  189,   10,  189,  244,   10,
       244,  244,  244,  242,  244,  244,  244,  244,  244,  244,
-      244,  244,  248,   10,  248,  248,  255,   10,  255,  255,
-
-      255,  253,  255,  259,   10,  259,  259,  280,   10,  280,
-      280,  280,  278,  280,  280,  280,  280,  280,  284,   10,
-      284,  667,  284,  295,   10,  295,  295,  295,  293,  295,
-      295,  295,  299,   10,  299,  306,   10,  306,  306,  306,
-      304,  306,  310,   10,  310,  667,  310,  335,   10,  335,
-      335,  335,  333,  335,  335,  335,  335,  339,   10,  339,
-      339,  352,   10,  352,  352,  352,  350,  352,  352,  356,
-       10,  356,  365,   10,  365,  365,  365,  363,  365,  365,
-      369,   10,  369,  378,   10,  378,  378,  378,  376,  378,
-      378,  382,   10,  382,  405,   10,  405,  405,  405,  403,
-
-      405,  405,  405,  405,  405,  405,  409,   10,  409,  667,
-      416,   10,  416,  416,  416,  414,  416,  420,   10,  420,
-      420,  667,  420,  667,  420,  437,   10,  437,  437,  437,
-      435,  437,  437,  437,  437,  437,  441,   10,  441,  441,
-      450,   10,  450,  450,  450,  448,  450,  450,  454,   10,
-      454,  481,   10,  481,  481,  481,  479,  481,  481,  481,
-      481,  481,  485,   10,  485,  502,   10,  502,  502,  502,
-      500,  502,  502,  506,   10,  506,  506,  515,   10,  515,
-      515,  515,  513,  515,  515,  519,   10,  519,  532,   10,
-      532,  532,  532,  530,  532,  532,  532,  532,  536,   10,
-
-      536,  536,  549,   10,  549,  549,  549,  547,  549,  549,
-      549,  549,  553,   10,  553,  667,  553,  564,   10,  564,
-      564,  564,  562,  564,  564,  564,  664,  663,  586,   10,
-      586,  586,  586,  584,  586,  586,  586,  590,   10,  590,
-      617,   10,  617,  617,  617,  615,  617,  617,  621,   10,
-      621,  621,  621,  667,  621,  621,  621,  621,  621,  642,
-       10,  642,  642,  642,  640,  642,  642,  642,  646,   10,
-      646,  646,   10,    0,    2,    2,    0,    4,    7,  658,
-      657,    0,    0,    0,    0,    0,    0,   42,   44,   44,
-       44,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
+      244,  244,  248,   10,  248,  248,  255,   10,  255,  255,
+      255,  253,  255,  259,   10,  259,  259,  270,   10,  270,
+      270,  270,  268,  270,  270,  270,  274,   10,  274,  274,
+      295,   10,  295,  295,  295,  293,  295,  295,  295,  295,
+      295,  299,   10,  299,  684,  299,  310,   10,  310,  310,
+      310,  308,  310,  310,  310,  314,   10,  314,  321,   10,
+      321,  321,  321,  319,  321,  325,   10,  325,  684,  325,
+      352,   10,  352,  352,  352,  350,  352,  352,  352,  352,
+      356,   10,  356,  356,  369,   10,  369,  369,  369,  367,
+      369,  369,  373,   10,  373,  382,   10,  382,  382,  382,
+
+      380,  382,  382,  386,   10,  386,  395,   10,  395,  395,
+      395,  393,  395,  395,  399,   10,  399,  422,   10,  422,
+      422,  422,  420,  422,  422,  422,  422,  422,  422,  426,
+       10,  426,  684,  433,   10,  433,  433,  433,  431,  433,
+      437,   10,  437,  437,  684,  437,  684,  437,  454,   10,
+      454,  454,  454,  452,  454,  454,  454,  454,  454,  458,
+       10,  458,  458,  467,   10,  467,  467,  467,  465,  467,
+      467,  471,   10,  471,  498,   10,  498,  498,  498,  496,
+      498,  498,  498,  498,  498,  502,   10,  502,  519,   10,
+      519,  519,  519,  517,  519,  519,  523,   10,  523,  523,
+
+      532,   10,  532,  532,  532,  530,  532,  532,  536,   10,
+      536,  549,   10,  549,  549,  549,  547,  549,  549,  549,
+      549,  553,   10,  553,  553,  566,   10,  566,  566,  566,
+      564,  566,  566,  566,  566,  570,   10,  570,  684,  570,
+      581,   10,  581,  581,  581,  579,  581,  581,  581,  681,
+      680,  603,   10,  603,  603,  603,  601,  603,  603,  603,
+      607,   10,  607,  634,   10,  634,  634,  634,  632,  634,
+      634,  638,   10,  638,  638,  638,  684,  638,  638,  638,
+      638,  638,  659,   10,  659,  659,  659,  657,  659,  659,
+      659,  663,   10,  663,  663,   10,    0,    2,    2,    0,
+
+        4,    7,  675,  674,    0,    0,    0,    0,    0,    0,
+       42,   44,   44,   44,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-       67,   69,   69,   69,   69,   69,    0,    0,   88,   90,
-       90,   90,   90,   90,   90,    0,    0,   99,  101,  101,
-        0,  114,  116,  116,  116,  116,    0,  131,  133,  133,
-      133,  133,    0,  144,  146,  146,  146,    0,  161,  163,
-      163,  163,  163,    0,  184,  186,  186,  186,  186,  186,
-      186,  186,  186,    0,  243,  245,  245,  245,  245,  245,
+        0,    0,    0,    0,   67,   69,   69,   69,   69,   69,
+        0,    0,   88,   90,   90,   90,   90,   90,   90,    0,
+        0,   99,  101,  101,    0,  114,  116,  116,  116,  116,
+        0,  131,  133,  133,  133,  133,    0,  144,  146,  146,
+      146,    0,  161,  163,  163,  163,  163,    0,  184,  186,
+
+      186,  186,  186,  186,  186,  186,  186,    0,  243,  245,
       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
+      245,  245,  245,  245,    0,  254,  256,  256,    0,  269,
+      271,  271,  271,  271,    0,  294,  296,  296,  296,  296,
+      296,  296,  296,    0,    0,    0,  309,  311,  311,  311,
+      311,    0,  320,  322,  322,    0,  351,  353,  353,  353,
+      353,  353,  353,    0,  368,  370,  370,  370,    0,  381,
+      383,  383,  383,    0,  394,  396,  396,  396,    0,  421,
+      423,  423,  423,  423,  423,  423,  423,  423,    0,    0,
+      432,  434,  434,    0,    0,    0,    0,    0,    0,    0,
+
+      453,  455,  455,  455,  455,  455,  455,    0,  466,  468,
+      468,  468,    0,  497,  499,  499,  499,  499,  499,  499,
+      499,  499,  499,    0,  518,  520,  520,  520,  520,    0,
+      531,  533,  533,  533,    0,  548,  550,  550,  550,  550,
+      550,    0,  565,  567,  567,  567,  567,  567,    0,    0,
+      580,  582,  582,  582,  582,    0,    0,    0,  602,  604,
+      604,  604,  604,    0,  633,  635,  635,  635,    0,    0,
+      658,  660,  660,  660,  660,  660,    0,    0,    0,    0,
+        0,    3,    0,    0,    0,    0,    0,    0,    0,  682,
+        0,    0,   44,    0,    0,   18,    0,    0,    0,    0,
 
-        0,  254,  256,  256,    0,  279,  281,  281,  281,  281,
-      281,  281,  281,    0,    0,  294,  296,  296,  296,  296,
-        0,  305,  307,  307,    0,  334,  336,  336,  336,  336,
-      336,  336,    0,  351,  353,  353,  353,    0,  364,  366,
-      366,  366,    0,  377,  379,  379,  379,    0,  404,  406,
-      406,  406,  406,  406,  406,  406,  406,    0,    0,  415,
-      417,  417,    0,    0,    0,    0,    0,    0,    0,  436,
-      438,  438,  438,  438,  438,  438,    0,  449,  451,  451,
-      451,    0,  480,  482,  482,  482,  482,  482,  482,  482,
-      482,  482,    0,  501,  503,  503,  503,  503,    0,  514,
-
-      516,  516,  516,    0,  531,  533,  533,  533,  533,  533,
-        0,  548,  550,  550,  550,  550,  550,    0,    0,  563,
-      565,  565,  565,  565,    0,    0,    0,  585,  587,  587,
-      587,  587,    0,  616,  618,  618,  618,    0,    0,  641,
-      643,  643,  643,  643,  643,    0,    0,    0,    0,    0,
-        3,    0,    0,    0,    0,    0,    0,    0,  665,    0,
-        0,   44,    0,    0,   18,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,   17,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,   17,    0,
-
-        0,   18,    0,    0,    0,    0,   69,   69,   69,   69,
-        0,    0,    0,   90,   90,   90,   90,   90,    0,    0,
-        0,  101,    0,    0,  116,    0,    0,  116,    0,    0,
-      133,  133,  133,    0,    0,  146,  146,    0,    0,  163,
-      163,  163,    0,    0,    0,    0,    0,    0,  186,  186,
-      186,  186,  186,    0,    0,  245,    0,    0,  245,    0,
-        0,  245,  245,  245,  245,  245,  245,  245,  245,  245,
-      245,    0,    0,    0,    0,    0,    0,  281,  281,  281,
-        0,    0,  281,  281,  281,    0,    0,    0,  296,    0,
-        0,    0,    0,    0,    0,  307,    0,    0,  336,    0,
-
-        0,  336,  336,  336,    0,    0,  353,    0,    0,    0,
-        0,    0,    0,  366,    0,    0,  379,  379,    0,    0,
-      406,  406,  406,    0,    0,  406,  406,  406,    0,    0,
-        0,  417,    0,    0,    0,    0,    0,    0,  438,  438,
-      438,  438,  438,    0,    0,    0,    0,  451,    0,    0,
-      482,    0,    0,  482,  482,  482,  482,  482,  482,    0,
-        0,  503,  503,  503,    0,    0,  516,    0,    0,    0,
-        0,  533,  533,    0,    0,  533,    0,    0,  550,    0,
-        0,  550,  550,    0,    0,    0,  565,    0,    0,  565,
-        0,    0,    0,  660,  587,  587,  587,    0,    0,    0,
-
-        0,  618,    0,    0,  643,  643,  643,  643,    0,    0,
-        0,   15,    1,    0,    0,  653,    0,    0,    0,  650,
-      649,    0,    0,   20,   19,   44,    0,    0,   46,    0,
-       18,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,   17,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       17,    0,    0,   18,    0,    0,    0,    0,   69,   69,
+       69,   69,    0,    0,    0,   90,   90,   90,   90,   90,
+        0,    0,    0,  101,    0,    0,  116,    0,    0,  116,
+        0,    0,  133,  133,  133,    0,    0,  146,  146,    0,
+        0,  163,  163,  163,    0,    0,    0,    0,    0,    0,
+      186,  186,  186,  186,  186,    0,    0,  245,    0,    0,
+      245,    0,    0,  245,  245,  245,  245,  245,  245,  245,
+
+      245,  245,  245,    0,    0,    0,    0,    0,    0,    0,
+        0,  271,  271,    0,    0,  296,  296,  296,    0,    0,
+      296,  296,  296,    0,    0,    0,    0,  311,    0,    0,
+        0,    0,    0,    0,  322,    0,    0,  353,    0,    0,
+      353,  353,  353,    0,    0,  370,    0,    0,    0,    0,
+        0,    0,  383,    0,    0,  396,  396,    0,    0,  423,
+      423,  423,    0,    0,  423,  423,  423,    0,    0,    0,
+      434,    0,    0,    0,    0,    0,    0,  455,  455,  455,
+      455,  455,    0,    0,    0,    0,  468,    0,    0,  499,
+        0,    0,  499,  499,  499,  499,  499,  499,    0,    0,
+
+      520,  520,  520,    0,    0,  533,    0,    0,    0,    0,
+      550,  550,    0,    0,  550,    0,    0,  567,    0,    0,
+      567,  567,    0,    0,    0,  582,    0,    0,  582,    0,
+        0,    0,  677,  604,  604,  604,    0,    0,    0,    0,
+      635,    0,    0,  660,  660,  660,  660,    0,    0,    0,
+       15,    1,    0,    0,  670,    0,    0,    0,  667,  666,
+        0,    0,   20,   19,   44,    0,    0,   46,    0,   18,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,   17,    0,    0,    0,    0,    0,    0,
+
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,   69,   69,    0,    0,   69,
         0,    0,   71,    0,    0,   90,   90,   90,   90,   90,
         0,    0,   92,    0,    0,  101,    0,    0,  103,    0,
-
       116,    0,  110,  109,  116,    0,    0,  118,    0,    0,
         0,  133,  133,    0,    0,    0,    0,  135,    0,    0,
         0,    0,    0,    0,    0,  148,    0,    0,    0,  163,
       163,    0,    0,    0,    0,  165,    0,    0,  170,  169,
         0,  172,  171,    0,    0,  186,  186,  186,  186,    0,
         0,  188,    0,  245,  245,  245,    0,  201,  200,  245,
+
         0,  205,  204,    0,    0,  245,  245,  245,  245,  245,
       245,  245,  245,  245,    0,    0,  247,    0,    0,  252,
-      251,    0,    0,  258,    0,  281,  281,  281,    0,  269,
-      268,  281,  281,  281,    0,    0,  283,    0,    0,  296,
-
-        0,  290,  289,    0,  292,  291,    0,    0,  298,    0,
-      307,    0,    0,  309,    0,  336,    0,  318,  317,  336,
-      336,  336,    0,    0,  338,    0,  353,    0,  349,  348,
-        0,    0,  355,    0,    0,  360,  359,  366,    0,    0,
-      368,    0,  379,  379,    0,    0,  381,    0,  406,  406,
-      406,  406,    0,  394,  393,    0,    0,  406,  406,    0,
-        0,  408,    0,    0,  417,    0,    0,  419,    0,    0,
-        0,    0,    0,  438,  438,  438,  438,  438,    0,    0,
-      440,    0,    0,  445,  444,  451,    0,    0,  453,    0,
-      482,    0,  466,  465,    0,    0,  482,    0,    0,  482,
-
-      482,  482,    0,    0,  484,    0,    0,    0,    0,    0,
-      503,    0,    0,  505,    0,  516,    0,  512,  511,    0,
-        0,  518,    0,  533,  533,    0,  527,  526,  533,    0,
-        0,  535,    0,  550,    0,  542,  541,  550,  550,    0,
-        0,  552,    0,    0,  565,    0,  559,  558,  565,    0,
-        0,    0,  567,    0,  587,  587,  587,    0,    0,  589,
-        0,    0,  594,  593,  618,    0,    0,  620,    0,    0,
-        0,  643,  643,    0,    0,  643,    0,    0,  645,    0,
-        0,    0,  654,  648,    0,    0,   44,    0,   45,    0,
-        0,    0,    0,    0,    0,    0,    0,  261,    0,  312,
-
-        0,    0,  384,    0,    0,  443,    0,    0,    0,    0,
-      592,  442,    0,    0,    0,    0,    0,  260,    0,  311,
-      383,    0,    0,    0,  591,    0,  591,  592,    0,    0,
-        0,    0,   51,   50,   69,   69,    0,   57,   56,   69,
-        0,  311,   90,    0,    0,   90,   90,   90,    0,    0,
-      101,    0,  116,  116,    0,    0,  123,  122,  133,  133,
-        0,  129,  128,    0,    0,  140,  139,    0,  142,  141,
-        0,    0,  153,  152,  163,  163,    0,  159,  158,    0,
-        0,  174,  173,  186,  186,  186,  186,    0,  245,  245,
-      245,    0,    0,    0,  207,  206,  245,  245,  245,  245,
-
-      245,  245,  245,  245,  245,  245,    0,    0,  281,  281,
-        0,    0,  281,  281,  281,    0,    0,    0,    0,    0,
-        0,    0,    0,  336,  336,  336,  336,    0,  353,    0,
-      366,    0,    0,    0,  379,    0,  406,  406,  406,  406,
-        0,  396,  395,  406,  406,    0,    0,  417,    0,    0,
-        0,    0,    0,  438,    0,    0,  438,  438,  438,    0,
-      451,    0,  482,    0,  468,  467,    0,    0,    0,  472,
-      471,  482,    0,    0,  482,    0,    0,  489,  488,    0,
-      491,  490,  503,    0,  516,    0,  533,  533,  533,    0,
-      550,  550,    0,    0,    0,    0,    0,    0,  565,    0,
-
-        0,  587,    0,    0,  587,    0,  618,    0,    0,  625,
-      624,  643,  643,    0,  631,  630,  643,    0,    0,    0,
-        0,   12,    0,  651,  652,   44,    0,   73,    0,    0,
-        0,    0,    0,    0,  261,    0,    0,  312,    0,    0,
-      370,  384,    0,    0,  443,    0,  487,    0,  555,  592,
-        0,  442,    0,    0,    0,    0,    0,  260,    0,    0,
-      311,  383,  486,    0,  554,  591,    0,    0,    0,  487,
-      486,   69,   69,   69,    0,    0,   90,    0,   78,   77,
-       90,   90,   90,    0,    0,    0,    0,    0,  116,  116,
-        0,  133,  133,    0,    0,  163,  163,    0,  186,  186,
-
-        0,    0,  186,    0,    0,    0,  245,  245,    0,  203,
-      202,  245,  245,  245,  245,  245,  245,    0,    0,  245,
-      245,  245,    0,    0,  281,  281,    0,  267,  266,  281,
-        0,    0,  281,  281,    0,  371,    0,  288,  287,    0,
-        0,  303,  302,    0,  336,  336,  336,  336,    0,  353,
-        0,    0,    0,    0,    0,  373,  372,  379,    0,  406,
-        0,    0,  406,  406,    0,    0,  406,  406,    0,    0,
-      417,    0,   74,    0,    0,    0,  438,    0,  426,  425,
-      438,  438,  438,    0,    0,    0,    0,  482,    0,  470,
-      469,  482,    0,  476,  475,  482,    0,  503,    0,  516,
-
-        0,  533,  533,  533,    0,  550,    0,    0,    0,  546,
-      545,    0,    0,    0,  557,  556,  565,    0,    0,  587,
-        0,    0,    0,    0,    0,    0,  618,    0,  643,  643,
-      643,    0,    0,    0,    0,   11,   44,    0,   73,    0,
-        0,    0,    0,    0,  249,    0,    0,    0,    0,  370,
-        0,    0,  455,  487,  508,    0,  555,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,  486,  507,    0,  554,
+      251,    0,    0,  258,    0,    0,  263,  262,  271,  271,
+        0,    0,  273,    0,  296,  296,  296,    0,  284,  283,
+      296,  296,  296,    0,    0,  298,    0,    0,    0,  311,
+        0,  305,  304,    0,  307,  306,    0,    0,  313,    0,
+      322,    0,    0,  324,    0,  353,    0,  333,  332,  353,
+      353,  353,    0,    0,  355,    0,  370,    0,  366,  365,
+        0,    0,  372,    0,    0,  377,  376,  383,    0,    0,
+      385,    0,  396,  396,    0,    0,  398,    0,  423,  423,
+
+      423,  423,    0,  411,  410,    0,    0,  423,  423,    0,
+        0,  425,    0,    0,  434,    0,    0,  436,    0,    0,
+        0,    0,    0,  455,  455,  455,  455,  455,    0,    0,
+      457,    0,    0,  462,  461,  468,    0,    0,  470,    0,
+      499,    0,  483,  482,    0,    0,  499,    0,    0,  499,
+      499,  499,    0,    0,  501,    0,    0,    0,    0,    0,
+      520,    0,    0,  522,    0,  533,    0,  529,  528,    0,
+        0,  535,    0,  550,  550,    0,  544,  543,  550,    0,
+        0,  552,    0,  567,    0,  559,  558,  567,  567,    0,
+        0,  569,    0,    0,  582,    0,  576,  575,  582,    0,
+
+        0,    0,  584,    0,  604,  604,  604,    0,    0,  606,
+        0,    0,  611,  610,  635,    0,    0,  637,    0,    0,
+        0,  660,  660,    0,    0,  660,    0,    0,  662,    0,
+        0,    0,  671,  665,    0,    0,   44,    0,   45,    0,
+        0,    0,    0,    0,    0,    0,    0,  260,  276,    0,
+      327,    0,    0,  401,    0,    0,  460,    0,    0,    0,
+        0,  609,  459,    0,    0,    0,    0,    0,  275,    0,
+      326,  400,    0,    0,    0,  608,    0,  608,  609,    0,
+        0,    0,    0,   51,   50,   69,   69,    0,   57,   56,
+       69,    0,  326,   90,    0,    0,   90,   90,   90,    0,
+
+        0,  101,    0,  116,  116,    0,    0,  123,  122,  133,
+      133,    0,  129,  128,    0,    0,  140,  139,    0,  142,
+      141,    0,    0,  153,  152,  163,  163,    0,  159,  158,
+        0,    0,  174,  173,  186,  186,  186,  186,    0,  245,
+      245,  245,    0,    0,    0,  207,  206,  245,  245,  245,
+      245,  245,  245,  245,  245,  245,  245,    0,    0,  271,
+      271,    0,  296,  296,    0,    0,  296,  296,  296,    0,
+      261,    0,    0,    0,    0,    0,    0,    0,  353,  353,
+      353,  353,    0,  370,    0,  383,    0,    0,    0,  396,
+        0,  423,  423,  423,  423,    0,  413,  412,  423,  423,
+
+        0,    0,  434,    0,    0,    0,    0,    0,  455,    0,
+        0,  455,  455,  455,    0,  468,    0,  499,    0,  485,
+      484,    0,    0,    0,  489,  488,  499,    0,    0,  499,
+        0,    0,  506,  505,    0,  508,  507,  520,    0,  533,
+        0,  550,  550,  550,    0,  567,  567,    0,    0,    0,
+        0,    0,    0,  582,    0,    0,  604,    0,    0,  604,
+        0,  635,    0,    0,  642,  641,  660,  660,    0,  648,
+      647,  660,    0,    0,    0,    0,   12,    0,  668,  669,
+       44,    0,   73,    0,    0,    0,    0,    0,    0,  260,
+      276,    0,    0,  327,    0,    0,  387,  401,    0,    0,
+
+      460,    0,  504,    0,  572,  609,    0,  459,    0,    0,
+        0,    0,    0,  275,    0,    0,  326,  400,  503,    0,
+      571,  608,    0,    0,    0,  504,  503,   69,   69,   69,
+        0,    0,   90,    0,   78,   77,   90,   90,   90,    0,
+        0,    0,    0,    0,  116,  116,    0,  133,  133,    0,
+        0,  163,  163,    0,  186,  186,    0,    0,  186,    0,
+        0,    0,  245,  245,    0,  203,  202,  245,  245,  245,
+      245,  245,  245,    0,    0,  245,  245,  245,    0,    0,
+      271,  271,    0,  296,  296,    0,  282,  281,  296,    0,
+        0,  296,  296,    0,  261,  388,    0,  303,  302,    0,
+
+        0,  318,  317,    0,  353,  353,  353,  353,    0,  370,
+        0,    0,    0,    0,    0,  390,  389,  396,    0,  423,
+        0,    0,  423,  423,    0,    0,  423,  423,    0,    0,
+      434,    0,   74,    0,    0,    0,  455,    0,  443,  442,
+      455,  455,  455,    0,    0,    0,    0,  499,    0,  487,
+      486,  499,    0,  493,  492,  499,    0,  520,    0,  533,
+        0,  550,  550,  550,    0,  567,    0,    0,    0,  563,
+      562,    0,    0,    0,  574,  573,  582,    0,    0,  604,
+        0,    0,    0,    0,    0,    0,  635,    0,  660,  660,
+      660,    0,    0,    0,    0,   11,   44,    0,   73,    0,
+
+        0,    0,    0,    0,  249,    0,    0,    0,    0,  387,
+        0,    0,  472,  504,  525,    0,  572,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,  503,  524,    0,  571,
         0,    0,    0,    0,    0,    0,    0,    0,   69,    0,
         0,   90,   90,   90,   90,    0,    0,    0,   97,   96,
         0,  116,  116,    0,    0,    0,    0,    0,    0,    0,
-
         0,    0,    0,    0,    0,    0,    0,  186,    0,  180,
       179,    0,    0,    0,    0,  193,  192,    0,    0,  245,
       245,  245,    0,    0,  245,  245,  245,    0,  229,  228,
-        0,    0,  245,  245,    0,    0,  281,  281,    0,    0,
-        0,  273,  272,  281,  281,    0,  282,  371,    0,    0,
-      336,  336,  336,  336,    0,  337,  353,    0,    0,  362,
-      361,    0,  379,    0,  406,    0,  388,  387,    0,    0,
-      406,    0,  398,  397,  406,  406,    0,  407,    0,  417,
-        0,   74,  250,    0,  456,  438,  438,  438,  438,    0,
-        0,  447,  446,    0,  452,  482,  482,  482,    0,  503,
-
-        0,  516,    0,    0,    0,  533,    0,    0,    0,  550,
-        0,  544,  543,    0,    0,  565,    0,    0,  587,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,  583,  582,
-        0,  618,    0,  619,    0,    0,    0,    0,  643,    0,
-        0,    0,    0,    0,    0,   49,    0,    0,    0,    0,
-        0,  168,  191,  249,    0,  301,    0,    0,    0,  421,
-      455,  508,  521,    0,    0,   48,    0,    0,    0,    0,
-      167,  190,    0,  300,  507,  520,    0,    0,    0,   53,
-       52,    0,   55,   54,   69,    0,    0,   90,   90,   90,
-       90,    0,   91,    0,    0,  116,    0,    0,    0,    0,
-
-      125,  124,    0,  127,  126,    0,    0,    0,  155,  154,
-        0,  157,  156,    0,    0,  176,  175,    0,    0,    0,
-      182,  181,    0,    0,  195,  194,  245,  245,  245,    0,
-      215,  214,    0,    0,  245,  245,    0,  231,  230,  245,
-      245,    0,    0,  281,  281,    0,  271,  270,  281,  281,
-        0,    0,  336,    0,    0,  336,  336,  336,  353,    0,
-        0,  379,    0,  380,  406,    0,  390,  389,  406,  406,
-      406,    0,    0,    0,    0,  250,  422,  456,  438,  438,
-      438,  438,    0,  482,    0,    0,  482,    0,  503,    0,
-      504,  516,    0,    0,  523,  522,    0,    0,    0,  529,
-
-      528,    0,    0,    0,    0,    0,  565,    0,    0,  566,
+        0,    0,  245,  245,    0,    0,  271,  271,    0,  272,
+
+      296,  296,    0,    0,    0,  288,  287,  296,  296,    0,
+      297,  388,    0,    0,  353,  353,  353,  353,    0,  354,
+      370,    0,    0,  379,  378,    0,  396,    0,  423,    0,
+      405,  404,    0,    0,  423,    0,  415,  414,  423,  423,
+        0,  424,    0,  434,    0,   74,  250,    0,  473,  455,
+      455,  455,  455,    0,    0,  464,  463,    0,  469,  499,
+      499,  499,    0,  520,    0,  533,    0,    0,    0,  550,
+        0,    0,    0,  567,    0,  561,  560,    0,    0,  582,
+        0,    0,  604,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,  600,  599,    0,  635,    0,  636,    0,    0,
+
+        0,    0,  660,    0,    0,    0,    0,    0,    0,   49,
+        0,    0,    0,    0,    0,  168,  191,  249,    0,  316,
+        0,    0,    0,  438,  472,  525,  538,    0,    0,   48,
+        0,    0,    0,    0,  167,  190,    0,  315,  524,  537,
+        0,    0,    0,   53,   52,    0,   55,   54,   69,    0,
+        0,   90,   90,   90,   90,    0,   91,    0,    0,  116,
+        0,    0,    0,    0,  125,  124,    0,  127,  126,    0,
+        0,    0,  155,  154,    0,  157,  156,    0,    0,  176,
+      175,    0,    0,    0,  182,  181,    0,    0,  195,  194,
+      245,  245,  245,    0,  215,  214,    0,    0,  245,  245,
+
+        0,  231,  230,  245,  245,    0,    0,    0,    0,  271,
+      296,  296,    0,  286,  285,  296,  296,    0,    0,  353,
+        0,    0,  353,  353,  353,  370,    0,    0,  396,    0,
+      397,  423,    0,  407,  406,  423,  423,  423,    0,    0,
+        0,    0,  250,  439,  473,  455,  455,  455,  455,    0,
+      499,    0,    0,  499,    0,  520,    0,  521,  533,    0,
+        0,  540,  539,    0,    0,    0,  546,  545,    0,    0,
+        0,    0,    0,  582,    0,    0,  583,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,  627,  626,    0,  629,
-      628,  643,    0,    0,    0,    0,    0,    0,    0,   49,
-       94,  106,    0,    0,    0,  168,  191,    0,  301,  340,
-        0,  410,  421,  521,    0,    0,    0,   48,  105,    0,
-        0,    0,  167,  190,    0,  300,  520,    0,    0,    0,
-       69,    0,  341,    0,    0,   90,   90,   90,   95,    0,
-      116,    0,  112,  111,    0,    0,    0,    0,    0,  178,
-      177,    0,  245,  245,  245,    0,  217,  216,  245,  245,
-
-      245,    0,    0,    0,    0,  257,  281,  281,  281,  281,
-        0,    0,  336,    0,  320,  319,  336,  336,  336,  353,
-        0,    0,  379,  406,  406,  406,  406,  411,    0,  413,
-      412,    0,  422,    0,    0,  438,  438,  438,    0,  482,
-        0,  474,  473,  482,    0,  483,  503,  516,    0,  517,
-        0,  525,  524,    0,    0,  540,  539,    0,    0,  565,
-      659,    0,  571,  570,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,  643,    0,
+        0,    0,    0,  644,  643,    0,  646,  645,  660,    0,
+
+        0,    0,    0,    0,    0,    0,   49,   94,  106,    0,
+        0,    0,  168,  191,    0,  316,  357,    0,  427,  438,
+      538,    0,    0,    0,   48,  105,    0,    0,    0,  167,
+      190,    0,  315,  537,    0,    0,    0,   69,    0,  358,
+        0,    0,   90,   90,   90,   95,    0,  116,    0,  112,
+      111,    0,    0,    0,    0,    0,  178,  177,    0,  245,
+      245,  245,    0,  217,  216,  245,  245,  245,    0,    0,
+        0,    0,  257,    0,  265,  264,    0,    0,  296,  296,
+      296,  296,    0,    0,  353,    0,  335,  334,  353,  353,
+      353,  370,    0,    0,  396,  423,  423,  423,  423,  428,
+
+        0,  430,  429,    0,  439,    0,    0,  455,  455,  455,
+        0,  499,    0,  491,  490,  499,    0,  500,  520,  533,
+        0,  534,    0,  542,  541,    0,    0,  557,  556,    0,
+        0,  582,  676,    0,  588,  587,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,   94,  106,    0,    0,    0,  286,  340,
-
-        0,  410,    0,    0,  623,  105,    0,    0,    0,  285,
-        0,    0,  622,   69,    0,   70,  341,    0,   76,   75,
-        0,    0,   90,   90,   95,    0,    0,    0,    0,    0,
-        0,    0,    0,  187,  245,  245,  245,  245,    0,    0,
-      245,  245,    0,    0,    0,    0,  246,  281,  281,  281,
-      281,    0,    0,  308,    0,    0,  336,  336,  336,  336,
-        0,    0,    0,    0,    0,    0,  406,  406,  406,  406,
-      411,    0,    0,  424,  423,    0,    0,  438,  438,    0,
-      439,    0,    0,  482,  503,  516,    0,  534,    0,    0,
-      565,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-
+      660,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,   94,  106,    0,    0,    0,
+      301,  357,    0,  427,    0,    0,  640,  105,    0,    0,
+        0,  300,    0,    0,  639,   69,    0,   70,  358,    0,
+       76,   75,    0,    0,   90,   90,   95,    0,    0,    0,
+
+        0,    0,    0,    0,    0,  187,  245,  245,  245,  245,
+        0,    0,  245,  245,    0,    0,    0,    0,  246,    0,
+      267,  266,  296,  296,  296,  296,    0,    0,  323,    0,
+        0,  353,  353,  353,  353,    0,    0,    0,    0,    0,
+        0,  423,  423,  423,  423,  428,    0,    0,  441,  440,
+        0,    0,  455,  455,    0,  456,    0,    0,  499,  520,
+      533,    0,  551,    0,    0,  582,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,  643,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,  660,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,  286,  357,    0,    0,  623,    0,    0,    0,
-      285,    0,    0,  622,   69,    0,   80,   79,    0,    0,
-        0,    0,    0,  102,    0,  108,  107,    0,  117,    0,
-        0,    0,  245,  245,  245,  245,    0,  219,  218,  245,
-      245,    0,    0,    0,    0,    0,    0,  281,  281,    0,
-        0,    0,    0,    0,    0,  314,  313,  336,  336,  336,
-        0,    0,    0,    0,    0,    0,  354,    0,    0,  375,
-
-      374,  406,  406,    0,    0,    0,    0,    0,  418,    0,
-      428,  427,    0,    0,    0,    0,    0,    0,    0,  482,
-      503,  516,    0,  358,  565,    0,    0,    0,    0,    0,
+
+        0,    0,    0,    0,    0,    0,    0,  301,  374,    0,
+        0,  640,    0,    0,    0,  300,    0,    0,  639,   69,
+        0,   80,   79,    0,    0,    0,    0,    0,  102,    0,
+      108,  107,    0,  117,    0,    0,    0,  245,  245,  245,
+      245,    0,  219,  218,  245,  245,    0,    0,    0,    0,
+        0,    0,  296,  296,    0,    0,    0,    0,    0,    0,
+      329,  328,  353,  353,  353,    0,    0,    0,    0,    0,
+        0,  371,    0,    0,  392,  391,  423,  423,    0,    0,
+        0,    0,    0,  435,    0,  445,  444,    0,    0,    0,
+        0,    0,    0,    0,  499,  520,  533,    0,  375,  582,
+
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,  643,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,  138,    0,  357,    0,
-        0,    0,  137,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,   86,   85,    0,    0,    0,  245,  245,    0,
-        0,  245,  245,  245,    0,    0,    0,    0,    0,    0,
-
-        0,    0,  281,    0,    0,    0,  275,  274,    0,  277,
-      276,    0,  297,  336,  336,  336,    0,  332,  331,    0,
-        0,    0,    0,    0,    0,    0,  406,    0,    0,    0,
-      400,  399,    0,  402,  401,    0,    0,    0,    0,  434,
-      433,    0,    0,    0,    0,    0,    0,  482,    0,    0,
-        0,    0,    0,  358,    0,    0,    0,    0,    0,    0,
-      575,    0,    0,    0,    0,  574,    0,    0,    0,    0,
+        0,    0,    0,  660,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,  644,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,  138,
-
-        0,  538,    0,    0,  137,    0,  537,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,  245,    0,
-        0,    0,  211,  210,    0,    0,  245,  245,    0,    0,
-        0,    0,    0,    0,    0,    0,  281,    0,  265,  264,
-      336,    0,    0,  336,    0,    0,    0,    0,    0,    0,
-        0,  367,  406,    0,  392,  391,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,  482,    0,
-        0,    0,    0,  510,  509,    0,    0,  561,  560,    0,
+        0,  138,    0,  374,    0,    0,    0,  137,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,   86,   85,    0,
+        0,    0,  245,  245,    0,    0,  245,  245,  245,    0,
+        0,    0,    0,    0,    0,    0,    0,  296,    0,    0,
+        0,  290,  289,    0,  292,  291,    0,  312,  353,  353,
+      353,    0,  349,  348,    0,    0,    0,    0,    0,    0,
+
+        0,  423,    0,    0,    0,  417,  416,    0,  419,  418,
+        0,    0,    0,    0,  451,  450,    0,    0,    0,    0,
+        0,    0,  499,    0,    0,    0,    0,    0,  375,    0,
+        0,    0,    0,    0,    0,  592,    0,    0,    0,    0,
+      591,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,  661,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,  138,    0,  555,    0,    0,  137,
+        0,  554,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,  245,    0,    0,    0,  211,  210,    0,
+
+        0,  245,  245,    0,    0,    0,    0,    0,    0,    0,
+        0,  296,    0,  280,  279,  353,    0,    0,  353,    0,
+        0,    0,    0,    0,    0,    0,  384,  423,    0,  409,
+      408,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,  499,    0,    0,    0,    0,  527,  526,
+        0,    0,  578,  577,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-       22,   30,    0,    0,    0,    0,   21,   29,    0,  121,
-        0,  538,  569,  120,    0,  537,  568,    0,    0,    0,
+        0,    0,    0,    0,    0,   22,   30,    0,    0,    0,
+        0,   21,   29,    0,  121,    0,  555,  586,  120,    0,
+
+      554,  585,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,  147,    0,  245,    0,
+      209,  208,    0,  213,  212,  245,  245,    0,    0,    0,
+        0,    0,    0,    0,    0,  296,  353,    0,  337,  336,
+      353,    0,    0,  360,    0,    0,  359,  423,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,  147,    0,  245,    0,  209,  208,    0,  213,  212,
-      245,  245,    0,    0,    0,    0,    0,    0,    0,    0,
-      281,  336,    0,  322,  321,  336,    0,    0,  343,    0,
-        0,  342,  406,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,  581,    0,
+        0,    0,    0,  598,    0,    0,    0,  597,    0,    0,
+        0,    0,    0,  613,  621,    0,    0,    0,    0,  612,
+      620,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 
-        0,    0,  580,    0,    0,    0,    0,    0,  596,  604,
-        0,    0,    0,    0,  595,  603,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,   24,    0,
+        0,    0,   23,    0,  121,    0,  586,  120,    0,  585,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,   24,    0,    0,    0,   23,    0,  121,
-        0,  569,  120,    0,  568,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,  245,
-        0,    0,  245,    0,    0,  235,    0,    0,    0,  234,
-        0,  281,    0,    0,    0,    0,    0,    0,    0,    0,
-      406,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,  478,  477,    0,    0,    0,    0,
-
-        0,    0,    0,    0,    0,  551,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,  598,    0,    0,    0,  597,
+        0,    0,    0,    0,  245,    0,    0,  245,    0,    0,
+      235,    0,    0,    0,  234,    0,  296,    0,    0,    0,
+        0,    0,    0,    0,    0,  423,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,  495,
+      494,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+      568,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+      615,    0,    0,    0,  614,    0,    0,    0,    0,    0,
+
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,  151,  150,   61,    0,
+       65,    0,   60,    0,   64,    0,   82,    0,   81,    0,
+        0,  134,    0,  245,    0,    0,    0,    0,    0,    0,
+        0,  237,    0,    0,  236,  296,    0,  331,  330,    0,
+        0,    0,  362,  364,  361,  363,  423,  447,    0,  446,
+        0,    0,  481,  477,    0,    0,  480,  476,    0,  512,
+        0,  516,    0,  511,    0,  515,    0,  596,    0,    0,
+      595,    0,    0,    0,  605,    0,    0,    0,    0,    0,
+        0,  652,    0,  656,    0,  651,    0,  655,    0,    0,
+
+        0,    0,   12,    0,   12,    0,   34,    0,    0,    0,
+        0,   32,   33,    0,    0,    0,    0,   31,  151,  150,
+       59,   63,   58,   62,    0,    0,    0,  245,    0,    0,
+        0,    0,    0,  233,  232,    0,    0,    0,    0,  296,
+        0,    0,    0,    0,    0,    0,  423,    0,    0,    0,
+        0,    0,    0,  510,  514,  509,  513,  590,  594,  589,
+      593,  625,    0,    0,    0,    0,  623,  624,    0,    0,
+        0,    0,  622,  650,  654,  649,  653,    0,    0,    0,
+        0,    0,    0,    0,    0,   26,    0,    0,    0,    0,
+       25,    0,    0,    0,    0,  164,    0,    0,    0,    0,
+
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,  151,  150,   61,    0,   65,    0,   60,    0,   64,
-        0,   82,    0,   81,    0,    0,  134,    0,  245,    0,
-        0,    0,    0,    0,    0,    0,  237,    0,    0,  236,
-      281,    0,  316,  315,    0,    0,    0,  345,  347,  344,
-      346,  406,  430,    0,  429,    0,    0,  464,  460,    0,
-        0,  463,  459,    0,  495,    0,  499,    0,  494,    0,
-
-      498,    0,  579,    0,    0,  578,    0,    0,    0,  588,
-        0,    0,    0,    0,    0,    0,  635,    0,  639,    0,
-      634,    0,  638,    0,    0,    0,    0,   12,    0,   12,
-        0,   34,    0,    0,    0,    0,   32,   33,    0,    0,
-        0,    0,   31,  151,  150,   59,   63,   58,   62,    0,
-        0,    0,  245,    0,    0,    0,    0,    0,  233,  232,
-        0,    0,    0,    0,  281,    0,    0,    0,    0,  406,
-        0,    0,    0,    0,    0,    0,  493,  497,  492,  496,
-      573,  577,  572,  576,  608,    0,    0,    0,    0,  606,
-      607,    0,    0,    0,    0,  605,  633,  637,  632,  636,
-
-        0,    0,    0,    0,    0,    0,    0,    0,   26,    0,
-        0,    0,    0,   25,    0,    0,    0,    0,  164,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,  617,    0,    0,    0,    0,  616,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,  600,    0,    0,    0,    0,  599,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,  239,    0,  238,    0,  278,  277,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,  239,    0,  238,    0,  263,
-      262,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,  403,  402,    0,    0,  475,    0,  474,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,   11,    0,
 
-      386,  385,    0,    0,  458,    0,  457,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,   11,    0,    0,
-        0,    0,    0,    0,    0,    0,   84,   83,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,   84,   83,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-      241,  240,    0,    0,    0,    0,    0,    0,    0,    0,
-      432,  431,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,  241,  240,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,  449,  448,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,  462,  461,    0,    0,    0,    0,    0,    0,    0,
+      347,    0,    0,    0,    0,  346,  479,  478,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,   36,
+        0,    0,    0,   35,    0,    0,    0,    0,    0,    0,
 
-        0,    0,    0,    0,   36,    0,    0,    0,   35,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,  610,    0,    0,    0,  609,    0,    0,    0,
-        0,   28,    0,    0,   27,    0,    0,    0,    0,    0,
-        0,  221,    0,    0,    0,  220,    0,    0,    0,  324,
-        0,    0,    0,  323,    0,    0,    0,  602,    0,    0,
-      601,    0,    0,   38,    0,   37,    0,    0,    0,    0,
-      227,    0,    0,  226,    0,    0,  330,    0,    0,  329,
-        0,    0,    0,  612,    0,  611,    0,    0,    0,    0,
-
+        0,    0,    0,    0,    0,    0,    0,  627,    0,    0,
+        0,  626,    0,    0,    0,    0,   28,    0,    0,   27,
+        0,    0,    0,    0,    0,    0,  221,    0,    0,    0,
+      220,    0,    0,    0,  339,    0,    0,    0,  338,    0,
+        0,    0,  619,    0,    0,  618,    0,    0,   38,    0,
+       37,    0,    0,    0,    0,  227,    0,    0,  226,    0,
+        0,  345,    0,    0,  344,    0,    0,    0,  629,    0,
+      628,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,    0,    0,    0,    0,    0,   40,
+
+       39,    0,  197,    0,  196,    0,    0,    0,    0,    0,
+        0,    0,    0,  631,  630,    0,    0,  199,  198,  225,
+        0,  224,    0,  343,    0,  342,    0,    0,    0,  223,
+      222,  341,  340,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,   40,   39,    0,  197,    0,  196,
-        0,    0,    0,    0,    0,    0,    0,    0,  614,  613,
-        0,    0,  199,  198,  225,    0,  224,    0,  328,    0,
-      327,    0,    0,    0,  223,  222,  326,  325,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
@@ -1086,13 +1097,12 @@ static const flex_int16_t yy_accept[4108] =
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-        0,    0,    0,    0,    0,    0,    0,   14,    0,    0,
+        0,    0,   14,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+       13,    0
 
-        0,    0,    0,    0,    0,   13,    0
     } ;
 
 static const YY_CHAR yy_ec[256] =
@@ -1139,7 +1149,7 @@ static const YY_CHAR yy_meta[76] =
         5,    5,    5,    5,    5
     } ;
 
-static const flex_int16_t yy_base[4660] =
+static const flex_int16_t yy_base[4760] =
     {   0,
         0,    0,    0,    3,    6,    9,   12,   29,   16,   19,
        14,   17,   33,   36,   49,   55,   45,   61,  109,  176,
@@ -1155,4152 +1165,4256 @@ static const flex_int16_t yy_base[4660] =
       793,  796,  799,  804, 1167, 1235,  854,  857,  860,  865,
       915,  918,  921,  926, 1303, 1371,  943,  983, 1439, 1508,
       986,  989,  994, 1011, 1051, 1054, 1057, 1062, 1577, 1635,
-     1079, 1119, 1122, 1125, 1130, 1147, 1187, 1190, 1693, 1761,
-     1193, 1198, 1215, 1255, 1258, 1261, 1266, 1283, 1829, 1899,
-     1323, 1326, 1969, 2024, 1329, 1334, 1391, 1394, 1397, 1402,
-     1459, 1462, 2079, 2147, 1465, 1470, 1528, 1531, 1534, 1539,
-     1597, 1600, 2215, 2273, 1603, 1608, 2331, 2402, 1655, 1658,
-     2473, 2541, 1661, 1666, 2609, 2677, 1713, 1716, 1719, 1724,
-     2745, 2816, 1781, 1784, 1787, 1792, 1849, 1852, 1855, 1860,
-
-     1877, 1919, 1922, 1925, 1930, 1947, 1989, 1992, 1995, 2000,
-     2044, 2047, 2887, 2955, 2050, 2055, 2099, 2102, 2105, 2110,
-     2167, 2170, 3023, 3094, 2173, 2178, 3165, 3233, 2235, 2238,
-     3301, 3369, 2241, 2246, 2293, 2296, 2299, 2304, 2351, 2354,
-     3437, 3495, 2357, 2362, 3553, 3622, 2379, 2382, 2422, 2425,
-     2428, 2433, 2450, 2453, 3691, 3759, 2493, 2496, 2499, 2504,
-     2521, 2561, 2564, 2567, 3827, 3892,  204, 2583, 3957, 4026,
-     2572, 2590, 4095, 4162, 2630, 2633, 2636, 2640, 2697, 2700,
-     2703, 2708, 2765, 2768, 2771, 2776, 2793, 2796, 2836, 2839,
-     2842, 2847, 2864, 2867, 2907, 2910, 2913, 2918, 2935, 2975,
-
-     2978, 2981, 2986, 3003, 3043, 3046, 3049, 3054, 3071, 3074,
-     4229, 4297, 3114, 3117, 3120, 3125, 3142, 3145, 3185, 3188,
-        0,    0,11011,14106,14106,   96,  100,   29,   41,14106,
-      103,   51,14106,14106,11000,14106,14106,10987,14106,11002,
-    11002,  762,14106,14106,14106,14106,10996,10996,10950,14106,
-      160,10975,    0,   87,14106,10941,10929,14106,  166, 4361,
-    10923, 4432, 3142, 4503,  278,   76,10975,   26,  279, 3203,
-      392,10974,   31,14106,  169,10963,    0,  144,14106,10914,
-    10909,   81,14106,  347,  154,  188,  204,14106,  414,10956,
-        0,  268,14106,10905,10910,10913,10907,10900,14106,  417,
-
-       16,10914,  325,14106,  420,10943,    0,  305,14106,10912,
-    14106,  482,  393,14106,  485,10939,    0,  370,14106,10908,
-    10904,10902,14106,  488,  461,14106,  554,10931,    0,  506,
-    14106,10882,10875,10879,14106,  622,  541,  469,14106,  685,
-    10925,    0,  527,14106,10872,10872,14106,  688,  609,  514,
-    14106,  691,10918,    0,  530,14106,10867,10862,10866,14106,
-      756,  754,  529,14106,  759,10908,    0,  533,14106,10855,
-    10873,10873,10855,10871,   81,14106,  823,  865,14106,  885,
-    10896,    0,  595,14106,  141,10851,10861,  545,10844,   90,
-      606,10846,14106,  950,10897,  801,14106,  953,10884,    0,
-
-      713,14106,10850,14106,  956,10890,  861,14106, 1018,10879,
-        0,  743,14106,10827,10833,10839,10823,  330,14106, 1021,
-      295,10828,  862,14106, 1024,10867,    0,  784,14106,10822,
-    10832,10815,14106, 1083,  929,14106, 1086,10859,    0,  811,
-    14106,10820,14106, 1089,  616,  219,  867,14106, 1092,10855,
-        0,  974,14106,10824,10820,10818,   20,14106, 1151,10855,
-      872,14106, 1154,10846,    0,  997,14106,10805,10809,14106,
-     1157, 1201,14106, 1160,10841,    0, 1042,14106,10803,10805,
-    14106, 1222, 1269,14106, 1225,10834,    0, 1110,14106,10801,
-    10781,14106, 1228, 1334,14106, 1290,10829,    0, 1178,14106,
-
-    10773,10771,10778,10786,10788,  398,14106, 1293, 1337, 1338,
-    14106, 1296,10817,    0, 1246,14106,10778,14106, 1363, 3149,
-      166, 1356, 1405,  597,  997,14106, 1422,10811,    0, 1314,
-    14106,10760,10763,10768,10762,10751,14106, 1431,  297, 1005,
-    14106, 1490,10799,    0, 1335,14106,10765,10765,14106, 1499,
-     1348,14106, 1559,10794,    0, 1406,14106,10759,10755, 1421,
-    10757,  796,14106, 1568, 1477,14106, 1625,10786,    0, 1409,
-    14106,10735,  671,14106, 1628, 1483, 1065,14106, 1683,10782,
-        0, 1519,14106,10737,10743,14106, 1686, 1546,14106, 1744,
-    10775,    0, 1588,14106,10725,10727,10737,10715,14106, 1750,
-
-    10772, 1133,14106, 1753,10763,    0, 1612,14106,10718,10726,
-    10714,10719,14106, 1812,  340,10710, 1322,14106, 1818,10751,
-        0, 1646,14106,10712,10714,10712, 1863,10717,14106, 1821,
-    10740,    0, 1670,14106,10698,10700,10688,14106, 1886, 1933,
-    14106, 1889,10734,    0, 1704,14106,10700,10684,14106, 1894,
-     3207,10682, 3208,10694, 3272, 1416, 1864, 3275, 1345,14106,
-     1956,10723,    0, 1728,14106,10674,10669,  698,14106, 1959,
-     1732, 1351, 1964,  866,10663,14106,10717,10706,14106,14106,
-    14106, 2061,  179,10656,10651,10649,10698,14106,    0, 2643,
-    10643,10690,10672, 1432,  420,  408,10642,10642,10646,10635,
-
-     1947,  555,10629,10630,10628, 2002,10652,  759,  683,10626,
-    10622,10626, 2057,  558,10614,10611,10613,10637,  861, 2068,
-    10607,10631,  888,10605,  956, 1024,  830,  944, 1157, 1092,
-    14106,    0,10595,10614,10610,10595,10634,10597,14106,    0,
-    10587,10581,10587,10594,10592,10591, 1487,14106,    0,10575,
-    10585,14106,    0,10571, 3326,10560,10577,14106,    0,10558,
-    10573,10569,10569,14106,    0,10546,10562,10562,14106,    0,
-    10539,10558,10554,10550,14106,    0, 3332, 3339,10531,10545,
-    10541,10539,10537,10535,14106,    0,10537, 3389,10518, 3392,
-    10511,10517,10514,10519,10519,10501,10516,10511,10509,10494,
-
-    10506,14106,    0, 3395,10505,14106,    0,10502,  214, 3399,
-    10482,10496,10495,10487,10479,14106,    0,10466, 3402, 3457,
-    10480,14106,    0,10475,10473,14106,    0,10467, 3460,10460,
-    10474,10473,10461,14106,    0,10450, 3463,10455,14106,    0,
-     3467,10454, 9827,14106,    0, 9826, 9822, 9823,14106,    0,
-     9834, 9834, 9818, 3471, 9812, 9826, 9828, 9812, 9814,14106,
-        0, 9800, 9801, 1498, 1216, 2071, 1225, 1558, 2125,14106,
-        0, 9801, 9788, 9794, 9804, 9794, 9777,14106,    0, 3515,
-     9776, 9771,14106,    0, 9771, 3518, 9756, 9778, 9758, 9767,
-     9764, 9764, 9736,14106,    0, 9733, 9748, 9729, 9722,14106,
-
-        0, 9721, 3521, 9716,14106,    0, 9713, 9717, 3525, 9714,
-     9705,14106,    0, 9709, 3529, 9717, 9694, 9684, 9686,14106,
-        0, 9686, 3573, 9677,   13, 9673, 9703,14106,    0, 9668,
-     9657, 9665, 9645,14106,    0, 3576, 9642, 9631, 1616,14106,
-        0, 9635, 9651, 9637, 9626, 9597, 9651, 9659, 1781, 9602,
-    14106, 2006,    0, 9598, 9597, 9629, 9624, 9576,14106, 3579,
-     2197, 9560, 3259, 3582, 2140, 9559, 9570, 9573, 9553, 9566,
-     9545, 9544, 9538, 9552, 9540,  265, 9547, 9537, 9522, 9507,
-     9499, 9502, 9514, 9496, 9494, 2263, 9504, 9479, 9492, 9471,
-     9471, 9486, 9460, 9467, 9450, 9454, 9466, 9452, 2321, 9448,
-
-     9430, 2325, 9429, 9419, 9405, 9403, 3585, 3654, 3642, 3662,
-     3335, 3647, 9409, 9407, 9389, 9395, 9400, 9382, 3651, 3730,
-     9391, 9373, 3711, 3716, 9384, 3723, 2392, 9377, 3726, 3793,
-     3782, 3796, 3785, 3788, 3848, 3851, 3854, 3857, 3863, 3912,
-     3926, 3915, 3921, 3978, 3981, 2460, 3984, 2524, 3987, 3993,
-     4005, 4057, 4062, 4047, 4068, 1954, 4075, 2593, 9376, 4117,
-     2662, 4120, 9370, 9352, 9361, 9356, 9340, 9341, 9352, 9350,
-     9339, 4124, 4127, 4130, 2728, 4182, 4187, 9343, 9333, 9344,
-     4192, 2799, 9328, 9323, 9291, 4195, 4201,  285, 9294, 4250,
-     2870, 4253, 3081, 4258, 4264, 9302, 4271, 4317, 9301, 4277,
-
-     3153, 9299, 9284, 9270, 4320, 4323, 9284, 4327, 3284, 4331,
-     4352, 4345, 3357, 9262, 4355, 4367, 9273, 9259, 4358, 4382,
-     9266,  473, 9249, 4386, 3421, 4389, 9259, 9239, 4394, 4397,
-     9257, 9233, 4430, 4437, 9227, 9232, 9229, 9222, 9232, 9212,
-     9219, 9223, 9210, 4440, 4445, 4459, 3604, 9205, 4465, 4468,
-     9212, 4472, 3673, 4477, 9201, 4500, 9201, 9205, 9207, 4507,
-     4512, 4518, 4526, 4537, 4546, 4555, 9181, 4577, 3681, 4580,
-     4583, 9197, 9176, 4586, 3816, 9186, 4589, 4604, 9169, 4608,
-     3940, 9183, 9181, 4611, 4614,  343, 9178, 4618, 4012, 9172,
-     9188, 4626, 4636,14106, 9148, 9153, 9152, 4639, 4646, 4649,
-
-     4081, 9128, 4658, 4661, 4667, 4673, 4685, 4691, 4694, 4697,
-     9163,14106,14106,  979, 9117,14106, 9159, 9158, 9105,14106,
-    14106, 9096, 4148,14106,14106, 9106, 4703, 4716,14106, 4725,
-     2207, 9094, 9093, 9085, 9080, 9089, 9071, 9060, 9071, 9049,
-     9056, 9055, 9056, 9046, 9040, 9033,  497, 9048, 9030, 9027,
-     9039, 9031,  565, 2210, 9020, 9014, 9023, 9009, 8998, 8995,
-     8991, 8991, 8982, 8975, 8974, 8979, 8960, 8963, 8942, 8925,
-     8926, 8875, 8845, 4728, 4210, 8840, 8834, 4731, 4284, 8846,
-     4735, 4740,14106, 4754, 8795, 8767, 4760, 8704, 8694, 8654,
-     4763, 4766,14106, 4769, 8629, 8629, 4773, 4778,14106, 4788,
-
-     8592, 4793,14106,14106, 8550, 4802, 4807,14106, 4810, 4813,
-     4822, 8505, 8493, 4816, 4837, 4845, 4848,14106, 4851, 4854,
-     4857, 4872, 4875, 4883, 4886,14106, 4890, 4893, 4896, 8479,
-     8479, 4905, 4911, 4919, 4923,14106, 4926, 4929,14106,14106,
-     4938,14106,14106, 4946, 4950, 8486, 8437, 8417, 8409, 4958,
-     4964,14106, 4967, 8392, 8348, 8255, 4970,14106,14106, 4978,
-     4986,14106,14106, 4996, 4999, 8148, 8078, 8055, 8059, 8056,
-     7977, 7979, 7886, 1675, 5007, 5010,14106, 5017, 5020,14106,
-    14106, 5029, 5032,14106, 5036, 7686, 7689, 5039, 5042,14106,
-    14106, 7671, 7670, 7665, 5051, 5057,14106, 5060, 7521, 5063,
-
-     5066,14106,14106, 5082,14106,14106, 5090, 5093,14106, 5098,
-     5101, 5104, 5112,14106, 5119, 7433, 5127,14106,14106, 7441,
-     7430, 7381, 5123, 5138,14106, 5142, 7377, 5145,14106,14106,
-     5153, 5157,14106, 5161, 5166,14106,14106, 7374, 5176, 5180,
-    14106, 5183, 5187, 5190, 5195, 5208,14106, 5214, 7350, 7347,
-        1,   72, 5217,14106,14106, 5227, 5235,   99,  120, 5245,
-     5248,14106, 5251,  152,  174, 5254, 5257,14106, 5260,  186,
-      206, 1809,  219,  229, 5279,  257,  277,  289, 5283, 5286,
-    14106, 5289, 5293,14106,14106,  347, 5309, 5312,14106, 5315,
-      359, 5318,14106,14106, 5335, 5338, 5346, 5353, 5357,  412,
-
-     5365,  487, 5371, 5374,14106, 5378, 5383, 5386, 5397, 5401,
-      506, 5409, 5415,14106, 5418,  546, 5421,14106,14106, 5429,
-     5440,14106, 5443,  616,  619, 5448,14106,14106,  666, 5462,
-     5465,14106, 5469,  644, 5472,14106,14106,  638, 5488, 5491,
-     5494,14106, 5497,  647, 5500, 5506,14106,14106, 5518,  714,
-     5521, 5524,14106, 5527,  687, 5532,  688, 5536, 5546,14106,
-     5550, 5556,14106,14106,  709, 5565, 5569,14106, 5572, 5576,
-     5584,  702,  737, 5594, 5599,  756, 5607, 5612,14106, 5616,
-     1456, 5619,14106,14106,  812,  813,  808, 5622,14106,  820,
-      826,  869,  889,  881,  937,  998, 1010, 2267, 1001, 2603,
-
-     1012, 1007, 2670, 1080, 1082, 2737, 1074, 1085, 1091, 1090,
-     3193, 2740, 1133, 1153, 1141, 1147, 1143, 2946, 1164, 3014,
-     3263, 1217, 1222, 1224, 3329, 1234, 3430, 3614, 1277, 1294,
-     1308, 5641,14106,14106, 1333, 1355, 5649,14106,14106, 1344,
-     5626, 3489, 1373, 5657, 5660, 1368, 1420, 1456, 5668, 1483,
-     5678, 5671, 1489, 1501, 5682, 5690,14106,14106, 1495, 1516,
-     5701,14106,14106, 5709, 5712,14106,14106, 5721,14106,14106,
-     5731, 5734,14106,14106, 1505, 1561, 5743,14106,14106, 5751,
-     5754,14106,14106, 1541, 1566, 5763, 1547, 5766, 5770, 5773,
-     5776, 5781, 5800, 5808,14106,14106, 5794, 5816, 5819, 5825,
-
-     5828, 5837, 5848, 5851, 5855, 5858, 5861, 5876, 1573, 1576,
-     5869, 5880, 1617, 5895, 1623, 5899, 1605, 5902, 5906, 5914,
-     5923, 5934, 5943, 1620, 1629, 1629, 1680, 5946, 1661, 5949,
-     5952, 5956, 5970, 5975, 1676, 5983, 1685, 5988, 1669, 1681,
-     5991,14106,14106, 6009, 1701, 6012, 1704, 1696, 6015, 1710,
-     1734, 1744, 1736, 1745, 6018, 6021, 1735, 1748, 1758, 6036,
-     6040, 6045, 1762, 6048,14106,14106, 6058, 6064, 6072,14106,
-    14106, 1768, 6083, 6087, 1773, 6095, 6102,14106,14106, 6110,
-    14106,14106, 1759, 6118, 1787, 6121, 1803, 1802, 1813, 6124,
-     1806, 6127, 6130, 6133, 6148, 1810, 6151, 6154, 1819, 1861,
-
-     6162, 1822, 6169, 6172, 6181, 6190, 1831, 6193, 6199,14106,
-    14106, 1861, 1883, 6214,14106,14106, 1867, 6223, 2050, 1921,
-     6226,14106, 1922,14106,14106, 1888, 1884, 3547, 1901, 1892,
-     1896, 1931, 1946, 1950, 3752, 1948, 1958, 3876, 1960, 1991,
-     3884, 3887, 1991, 1992, 3949, 1999, 3952, 2008, 4089, 4051,
-     2002, 4054, 1998, 2013, 2010, 2056, 2061, 4156, 2055, 2066,
-     4220, 4223, 6229, 2065, 6232, 4540, 2067, 2065, 2068, 6235,
-     6246, 6249, 6252, 6255, 6258, 2087, 2077, 6261,14106,14106,
-     2087, 2085, 2094, 6280, 2124, 6284, 6289, 6303, 2130, 2110,
-     6306, 6312, 6315, 6333, 6336, 6339, 6342, 6346, 6360, 6365,
-
-     6368, 6371, 6379, 6386, 6389, 6393, 6408, 6413, 6416,14106,
-    14106, 6426, 6431, 6434, 6437, 6440, 6444, 6458, 6462, 6471,
-     6482, 6492, 6500, 6503, 2136, 2126, 6506,14106,14106, 6514,
-     6522, 6525, 2135, 2138, 6533, 6536, 6540,14106,14106, 6548,
-     6553,14106,14106, 6561, 2144, 2128, 2148, 2176, 6568, 2188,
-     6571, 6574, 6580, 6592, 6596,14106,14106, 2193, 6604, 2200,
-     6607, 6612, 6625, 2189, 6630, 6633, 2199, 2200, 6643, 2193,
-     2195, 6648, 6652, 2204, 2193, 2210, 2225, 6655,14106,14106,
-     2246, 2244, 2240, 6663, 6667, 6672, 6685, 2241, 6688,14106,
-    14106, 2251, 6698,14106,14106, 2242, 6706, 2248, 6709, 2255,
-
-     6712, 6716, 6719, 6737, 6740, 2250, 6743, 6746, 6755,14106,
-    14106, 6765, 2298, 6769,14106,14106, 2304, 2323, 6777, 2298,
-     6780, 3323, 3712, 6789, 6792, 6800, 2312, 6803, 6807, 6810,
-     6814, 6832, 2350, 2370, 2418,14106, 6836, 2317, 6839, 2310,
-     2311, 2396, 2307, 2310, 6842, 2333, 2339, 2330, 2374, 6845,
-     2374, 2376, 6854, 6857, 6860, 2391, 6863, 2395, 2378, 2404,
-     2396, 2467, 2392, 2398, 2409, 2416, 6869, 6872, 2450, 6875,
-     2457, 2440, 2494, 2535, 6880, 6883, 6891, 6894, 2454, 6902,
-     2446, 2455, 2457, 2459, 2473, 6905, 2471, 6909,14106,14106,
-     6924, 2466, 6917, 6927, 6930, 6936, 6948, 6951, 6959, 6962,
-
-     6966, 6971, 6984, 6990, 6998, 7002, 7005, 7013, 7020,14106,
-    14106, 7031, 7034, 7042, 7045,14106,14106, 7053, 7061, 2479,
-     2489, 2512, 7056, 7074, 7082, 2519, 2529, 7085,14106,14106,
-     7095, 7100, 2513, 2509, 7108, 7113, 2526, 2548, 7116, 7120,
-     7128,14106,14106, 2542, 2545, 7136,14106, 7139, 7143, 7146,
-     2556, 7149, 2592, 2591, 7155,14106, 2586, 7168, 7174,14106,
-    14106, 7182, 2623, 7187, 2597, 7191,14106,14106, 7206, 7209,
-     2613, 7220,14106,14106, 2611, 2617, 7230,14106, 2609, 7233,
-     7236, 7239, 7242, 2625, 7245, 2645, 2647, 2643, 2656, 7251,
-     7255,14106,14106, 7263,14106, 2652, 7266, 2659, 7270, 2661,
-
-     7273, 2670, 7276, 7284, 7295, 7303, 7306, 7309, 7324, 7327,
-     7331,14106,14106, 7345, 2657, 2671, 2711, 7348, 7351, 2714,
-     2725, 2754, 2740, 2759, 2746, 2782, 2748, 7354,14106,14106,
-     7369, 7372, 7375,14106, 7379, 7384, 7400, 7403, 2729, 7411,
-     2787, 2795, 2786, 7418, 7421, 7430, 2719, 2736, 2752, 2745,
-     2746, 7436, 7439, 7442, 2769, 7445, 2785, 2785, 2793, 7448,
-     7451, 7454, 7457, 2792, 2789, 7460, 2805, 2822, 2798, 2811,
-     7463, 7466, 2814, 7469, 7474, 7477, 2814, 2811, 7480,14106,
-    14106, 7488,14106,14106, 2829, 7496, 2820, 7499, 7505, 7508,
-     7511, 7517,14106, 2815, 7529, 2829, 7532, 7536, 7544, 7551,
-
-    14106,14106, 7559,14106,14106, 7567, 7574, 7577,14106,14106,
-     7593,14106,14106, 7601, 7607,14106,14106, 7615, 7620, 7629,
-    14106,14106, 7637, 7640,14106,14106, 2840, 2857, 2870, 7649,
-    14106,14106, 7657, 7660, 2870, 2859, 7668,14106,14106, 2876,
-     7676, 7679, 7682, 2866, 2860, 7685,14106,14106, 2869, 2871,
-     7694, 7701, 2876, 7705, 7709, 2885, 2876, 2882, 2882, 7723,
-     7728, 2893, 7731,14106, 2891, 7735,14106,14106, 2885, 2910,
-     2925, 2925, 7754, 7757, 7765, 7768, 7772, 7775, 7778, 7784,
-     7787, 7796, 7792, 2924, 7805, 7814, 2942, 7823, 2942, 7826,
-    14106, 2928, 7831, 7838,14106,14106, 7846, 7853, 7864,14106,
-
-    14106, 7872, 7875, 7878, 7886, 2931, 2942, 2954, 7893,14106,
-     7896, 7899, 2973, 2970, 2971, 2978, 2988, 2985, 2983, 2999,
-     3019, 3029, 7907, 7914, 7919, 7928,14106,14106, 7939,14106,
-    14106, 3007, 7947, 7950, 3046, 3062, 7954, 4431, 5301, 7962,
-     7969, 7972, 2993, 2992, 3002, 7975, 7978, 3008, 7981, 7984,
-     3005, 7987, 7990, 7993, 3010, 3017, 3032, 7996, 7999, 3021,
-     3021, 3030, 8002, 8005, 3065, 8008, 8011, 3057, 3068, 3079,
-     3084, 8016, 8019, 8022, 8025, 8035, 8040, 8043, 8046, 8049,
-     8053, 8061,14106,14106, 8071, 8075, 8078, 8081, 8084,14106,
-    14106, 8100, 3080, 3079, 3089, 8103,14106,14106, 8113, 3075,
-
-     3089, 8119, 8124, 8132, 8137,14106, 3095, 3104, 3127, 3140,
-     8144, 8147, 8151, 8156,14106,14106, 8169, 8172, 8175, 8178,
-     8181, 8200, 8206, 3140, 3148, 3150, 3151, 8209, 8212,14106,
-    14106, 8220, 8228, 8231, 8239, 8235, 8249, 8253, 8256, 8259,
-     8271,14106,14106, 8262, 8267,14106, 3158, 3155, 8281,14106,
-     8286,14106,14106, 8294, 8302,14106,14106, 8313, 3151, 3149,
-    14106, 8316,14106,14106, 3197, 3184, 3200, 3196, 3223, 3231,
-     3217, 3243, 3244, 3259, 8324, 8332, 5940, 7566, 3242, 8343,
-     8346, 3400, 3468, 3235, 3240, 3283, 3235, 3259, 3264, 3299,
-     3339, 3300, 3307, 8349, 8352, 3304, 3316, 3353, 8355, 8365,
-
-     3345, 8368, 3338, 3350, 8371, 8374, 3351, 3350, 3372, 8377,
-     3354, 3366, 8380, 3370, 8383,14106, 8387, 8390,14106,14106,
-     8398, 8404, 8412, 8416, 8419, 8422, 8425, 8430, 8443, 8446,
-     8449, 8452, 8455,14106, 3386, 3373, 3400, 3427, 8458, 8476,
-     3417, 3426, 8484, 3569, 3572, 8492,14106, 3412, 3415, 8495,
-     8498, 8501, 8504,14106, 8507, 8525, 3432, 3433, 3450, 8533,
-     8536, 8539, 8547, 8554, 8560, 8566, 3461, 3467, 8574, 8578,
-     8581, 8584, 8592,14106,14106, 8587, 8605, 8613, 8617, 8620,
-    14106, 8623, 8635, 3478, 3478, 3473, 8626,14106, 8631, 3480,
-     3472, 3509, 3520, 3555, 3542, 3568, 3571, 3566, 3584, 3571,
-
-     3613, 8645, 3586, 3590, 3598, 3596, 3604, 3602, 3620, 3687,
-     3624, 3631, 3655, 8650, 3697, 3717, 3856, 3651, 3664, 3676,
-     3683, 3684, 3681, 3711, 3734, 3730, 3741, 3740, 3734, 3739,
-     3756, 3774, 8653, 8656, 3749, 3762, 8659, 3753, 3770, 3788,
-     8664, 3797, 3809, 8669, 8672, 8675,14106,14106, 8683, 8686,
-     8694, 8703, 8712,14106, 8715,14106,14106, 8723,14106, 8726,
-     8731, 8734, 3804, 3811, 8737, 3803, 8746,14106,14106, 3823,
-     3815, 3870, 3899, 3890, 3889, 3977, 3897, 3861, 8755, 8758,
-     8761, 8776, 8780, 8789, 8795,14106,14106, 3878, 3884, 3890,
-     8803, 8808, 8817, 4100, 4120, 8825,14106, 8828, 8831,14106,
-
-    14106, 3899, 8839, 8847, 8850, 8858, 8861, 8869,14106, 8872,
-    14106,14106, 8880, 8888, 8883, 8901, 8909, 4369, 4400, 3928,
-     8917, 8920, 8923, 8769, 8926, 3963, 3979, 3978, 3991, 4014,
-     3992, 4001, 4001, 4020, 4053, 8929, 3998, 4010, 4011, 4021,
-     4026, 4066, 4070, 4087, 4084, 4095, 4115, 4116, 8938, 8944,
-     4208, 4250, 4269, 4124, 4133, 4126, 4140, 4152, 4158, 4149,
-     4158, 4171, 4198, 4209, 4214, 4202, 8948, 4219, 8951, 4238,
-     4242, 4226, 8956, 4272, 4284, 4287, 8959, 8963, 8971, 4338,
-     4378, 8979,14106,14106, 8987, 8991, 8996, 4277, 8999, 9002,
-     9006, 9020, 4290, 4298, 4345, 4328, 4352, 4339, 4357, 4355,
-
-     4384, 4371, 4366, 9023, 9026, 9034,14106,14106, 9044,14106,
-    14106, 9052,14106, 4359, 9056, 4369, 9059,14106,14106, 4388,
-     4391, 4408, 4416, 4423, 4427, 9067, 4428, 9074, 9077, 9086,
-    14106,14106, 9094,14106,14106, 9102, 4467, 4488, 9110,14106,
-    14106, 4448, 4451, 4496, 4457, 4470, 4501, 4454, 9118, 9121,
-     9129, 9132, 9140, 9143, 9147, 9150, 4508, 4492, 4493, 4504,
-    14106, 4522, 4509, 4507, 4521,14106, 9159, 4499, 4509, 4499,
-     4513, 4522, 4527, 4526, 4535, 4523, 4537, 4547, 4552, 9165,
-     9168, 9178,14106, 4603, 4624, 9183, 4535, 4557, 4573, 4626,
-     4627, 4574, 4567, 4577, 4601, 4646, 4648, 4597, 4613, 9186,
-
-     4604, 9189, 4610, 4628, 9192, 4614, 9197, 4616, 9205, 4677,
-     5169, 4660, 4665, 4672, 4682, 9213, 9216, 9219, 4648, 9222,
-     9225, 9240,14106,14106, 9248, 9251, 4637, 4648, 4688, 4672,
-     4684, 4705, 4720, 4700, 4712, 4713, 4704, 9259,14106,14106,
-     4724, 9267, 9270, 4710, 4742, 4752, 4782, 4751, 4765, 4792,
-     9285,14106, 4748, 9288,14106,14106, 4777, 4797, 4799, 4807,
-     4812, 4801, 4802, 4814, 4823, 4829, 4832, 4841, 9296, 9300,
-     5288, 5442, 9308,14106,14106, 9316, 9319,14106,14106, 4830,
-     4850, 4874, 4860, 4843, 4879, 4895, 4889, 9327, 4849, 4851,
-     4881, 4930, 4931, 4884, 4882, 4889, 4905, 4954, 4955, 4914,
-
-     9331, 5632, 7129, 4973, 9339, 9342, 9346, 4923, 4914, 4979,
-    14106,14106, 4933, 4940, 4927, 4995,14106,14106, 4953, 9361,
-     4938, 9365, 9369, 9372, 4947, 9378, 9381, 4981, 4999, 4983,
-     4996, 5021, 5047, 5010, 5022, 5052, 5040, 5055, 5044, 9384,
-     9387,14106, 9390, 5031, 9393,14106,14106, 9409,14106,14106,
-     9417, 5022, 5062, 5069, 5105, 5073, 5081, 5079, 5125, 5096,
-     5079, 9420, 9423,14106,14106, 9431, 5103, 5124,14106, 5117,
-     5127,14106, 5109, 5148, 5137, 5162, 5156, 5166, 5176, 5182,
-     5169, 5178, 5196, 5200, 5188, 9438, 9442, 5197, 5209, 5178,
-     5191, 5230, 5241, 5205, 5216, 9450, 5243, 5243,14106, 5245,
-
-     5247, 5248,14106, 5249, 9459, 5240, 5231, 5295,14106,14106,
-     5251, 5253, 5239, 5321,14106,14106, 5278, 5298, 5319, 5282,
-     5298, 5322, 5338, 5306, 5317, 5373, 9462, 9465, 9474, 9528,
-     9576, 5316, 5329,14106, 5339, 5339, 5341,14106, 5351, 9484,
-     5360, 9487, 9493, 5361, 9496, 5420, 5389, 5428, 5368, 5430,
-     5401, 5439, 5385, 5449, 5416, 5449, 5419, 9499, 9502, 5409,
-     9505, 9508, 9523, 5427, 5432,14106, 5473, 5445, 5445,14106,
-     5475, 5425, 9548, 9551, 9570, 9559, 5500, 5512, 5523, 5533,
-     5482, 5539, 5506, 5546, 5517, 5538, 5558, 5575, 5543, 5559,
-     5582, 5585, 5559, 9596,14106,14106, 5598, 5567, 5601, 5544,
-
-     5608, 5592, 5624, 5566, 9588,14106, 5631, 5605, 5608, 5639,
-     5616, 5621, 9607, 5589, 5590,14106, 5607, 5601, 5611,14106,
-     5625, 5681, 5650, 5692, 5632, 5692, 5669, 5700, 5649, 5724,
-     9610, 5742, 5711, 9630, 9678, 5809, 5669, 5716, 6055, 5676,
-     5719, 9618, 9641,14106, 5733,14106, 5744,14106, 5752,14106,
-     5755,14106, 5765,14106, 5766, 9650,14106, 9653, 5716, 9656,
-     5766, 5798, 9672, 9699, 5767, 5773,14106, 5780, 5782,14106,
-     5762, 9707,14106,14106, 9715, 5806, 5884,14106,14106,14106,
-    14106, 5789,14106, 5824,14106, 5846, 5855,14106,14106, 5838,
-     5871,14106,14106, 5849,14106, 5884,14106, 5885,14106, 5884,
-
-    14106, 5885,14106, 5901, 5907,14106, 5919, 5921, 9725,14106,
-     6451, 5882, 5927, 6442, 5885, 5930,14106, 5935,14106, 5951,
-    14106, 5952,14106, 5953, 5979, 5982, 6013, 5964, 6063, 5971,
-     9728,14106, 5929, 5948, 5937, 6002,14106,14106, 5938, 5979,
-     5967, 6083,14106, 9664, 9690,14106,14106,14106,14106, 5998,
-     6007, 9731, 9734, 6118, 6026, 6121, 6072, 9737,14106,14106,
-     6020, 6043, 6038, 6068, 9752, 6139, 6140, 6145, 6169, 9755,
-     6062, 6065, 6102, 6092, 6130, 6121,14106,14106,14106,14106,
-    14106,14106,14106,14106,14106, 6112, 6139, 6135, 6198,14106,
-    14106, 6140, 6159, 6147, 6266,14106,14106,14106,14106,14106,
-
-     9758, 6206, 6198, 6212, 9761, 6174, 6171, 6174,14106, 6194,
-     6195, 6197, 6202,14106, 6222, 6233, 6236, 9764,14106, 9773,
-     9784, 6239, 6252, 6267, 6261, 6259, 6268, 6282, 6278, 6267,
-     6314, 6276, 6315, 9792, 9795, 6285, 6294, 6307, 6297, 6292,
-     6300, 6329, 6319, 9803, 9810, 6314, 6315, 6353, 6338, 6367,
-     6356, 6335, 6317, 6327,14106, 6350, 6353, 6336, 6340,14106,
-     6359, 9806, 6393, 6365, 6383, 6354, 6379, 6396, 6414, 6385,
-     6406, 6464, 6463, 9821, 6460, 6527, 6442, 6448, 6450, 6462,
-     6460, 6480, 6476, 6489, 6515,14106, 6513,14106, 9829,14106,
-    14106, 6493, 6512, 6509, 6528, 6523, 6534, 6541, 6550, 9837,
-
-    14106,14106, 6579, 6578,14106, 6556,14106, 6558, 6545, 6563,
-     6534, 6561, 6561, 6579, 6552, 6571, 6640,14106, 6561, 6563,
-     6570, 6583, 6577, 6576, 6580, 6605,14106,14106, 6650, 6648,
-     6657, 6651, 6652, 6659, 6667, 6655, 6666, 6673, 6673, 6666,
-    14106,14106, 6694, 6700, 6701, 6688, 6700, 6706, 6707, 6694,
-    14106,14106, 6730, 6728, 6687, 6686, 6686, 6708, 6710, 6709,
-     6709, 6730, 6780, 6736, 6767, 6816, 6770, 6762, 6773, 6819,
-     6776, 6792, 6815, 6810, 6829, 6816, 6827, 6844, 6855, 6851,
-     6849, 6866, 6876, 6865, 6873, 6891, 6892, 6886, 6883, 6910,
-     6912,14106,14106, 6878, 6889, 6940, 6894, 6893, 6904, 6950,
-
-     6918, 6970, 6921, 6927,14106, 6977, 6929, 6935,14106, 6986,
-     6960, 6960, 6975, 6975, 6993, 6983, 7019, 6987, 7005, 7002,
-     7032, 7001, 7026, 7016, 7055, 7027, 7043, 7034, 7064, 7033,
-     7024, 7027,14106, 7076, 7035, 7038,14106, 7084, 7087, 7034,
-     7094,14106, 7044, 7099,14106, 7091, 7099, 7097, 7110, 7138,
-     7121,14106, 7118, 7151, 7128,14106, 7128, 7161, 7140,14106,
-     7142, 7172, 7149,14106, 7150, 7135, 7195,14106, 7144, 7197,
-    14106, 7194, 7142,14106, 7143,14106, 7182, 7196, 7190, 7205,
-    14106, 7225, 7227,14106, 7236, 7230,14106, 7255, 7249,14106,
-     7258, 7256, 7217,14106, 7218,14106, 9845, 7288, 7286, 7276,
-
-     7308, 7290, 7308, 7276, 7295, 7279, 7298, 7292, 7312, 7295,
-     7315, 7336, 7336, 9848,14106,14106, 7353,14106, 7352,14106,
-     7356, 7320, 7357, 7323, 7363, 7340, 7376, 7348,14106,14106,
-     7379, 7465,14106,14106,14106, 7388,14106, 7387,14106, 7391,
-    14106, 7391, 7454, 7475,14106,14106,14106,14106, 7497, 7505,
-     7476, 7523, 7733, 7734, 7396, 7536, 7586, 7634, 7608, 7625,
-     7636, 7653, 7547, 7655, 7562, 7680, 7670, 7648, 7725, 7697,
-     7467, 7764, 7538, 7794, 7673, 7552, 7816, 7565, 7744, 7851,
-     7819, 7863, 7811, 7871, 7904, 7894, 7784, 8010, 7915, 8013,
-     7406, 7916, 7690, 8046, 7873, 7799, 8020, 7935, 7473, 7996,
-
-     7865, 8080, 8099, 8041, 8104, 8076, 8179, 8136, 8227, 8149,
-     8170, 7793, 8273, 7833, 8038, 7844, 8141, 8069, 8176, 8266,
-     8178, 8279, 8282, 7700, 8303, 7801, 7841, 8384, 8186, 8385,
-     8293, 8417, 8451, 8453, 8410, 8418, 8423, 8472, 8259, 8166,
-     8271, 8290, 8319, 8454, 8505, 8512, 8111, 8312, 8173, 8344,
-     8533, 8502, 8545, 8534, 7927, 8513, 8471, 8539, 8582, 7716,
-     8625, 7616, 8585, 9856, 8611, 8280, 9859,14106, 8660, 8691,
-     8725, 8746, 8748, 8662, 8711, 8722, 8765, 8782, 8796, 8756,
-     8776, 8767, 8837, 8818, 8826, 8783, 8878, 8849, 8889, 8848,
-     8859, 8915, 8917, 8683, 8690, 8918, 8964, 8827, 9013, 8966,
-
-     8967, 8389, 8590, 9867, 9870,14106,14106, 9890, 9899, 9908,
-     9917, 9926, 9935, 9944, 9953, 9962, 9971, 9980, 9989, 9998,
-    10007,10016,10025,10034,10043,10052,10061,10070,10079,10088,
-    10097,10106,10115,10124,10133,10142,10151,10160,10169,10178,
-    10187,10196,10205,10214,10223,10232,10241,10250,10259,10268,
-    10277,10286,10295,10304,10313,10322,10331,10340,10349,10358,
-    10367,10376,10385,10394,10403,10412,10421,10430,10439,10448,
-    10457,10466,10475,10484,10493,10502,10509,10516,10523,10530,
-    10537,10544,10551,10558,10565,10572,10579,10586,10593,10600,
-    10607,10614,10621,10628,10635,10642,10649,10656,10663,10670,
-
-    10677,10684,10691,10698,10705,10712,10719,10728,10735,10740,
-    10747,10752,10759,10764,10771,10776,10783,10788,10795,10800,
-    10807,10812,10819,10824,10831,10836,10843,10848,10855,10860,
-    10867,10872,10879,10884,10891,10896,10903,10908,10915,10920,
-    10927,10932,10939,10944,10951,10956,10963,10968,10975,10980,
-    10987,10992,10999,11004,11011,11016,11023,11028,11035,11040,
-    11047,11052,11059,11064,11071,11076,11083,11088,11095,11100,
-    11109,11115,11122,11130,11138,11146,11153,11161,11168,11176,
-    11183,11191,11199,11207,11215,11223,11231,11239,11247,11255,
-    11262,11270,11278,11285,11293,11300,11308,11315,11323,11330,
-
-    11338,11345,11353,11360,11368,11375,11383,11390,11398,11405,
-    11413,11420,11428,11435,11443,11450,11458,11466,11474,11481,
-    11489,11496,11504,11511,11519,11526,11534,11541,11549,11556,
-    11564,11572,11580,11589,11595,11602,11610,11617,11625,11632,
-    11640,11647,11655,11662,11670,11677,11685,11693,11700,11708,
-    11715,11723,11730,11738,11746,11753,11761,11769,11777,11785,
-    11793,11800,11808,11815,11823,11830,11838,11846,11854,11861,
-    11869,11876,11884,11891,11899,11906,11914,11921,11929,11936,
-    11944,11951,11959,11966,11974,11981,11989,11997,12005,12012,
-    12020,12027,12035,12042,12050,12059,12068,12075,12082,12090,
-
-    12097,12105,12113,12121,12128,12136,12143,12151,12159,12166,
-    12174,12181,12189,12197,12205,12213,12220,12228,12236,12244,
-    12251,12259,12266,12274,12282,12290,12297,12305,12312,12320,
-    12327,12335,12342,12350,12358,12366,12373,12381,12388,12396,
-    12403,12411,12418,12426,12433,12441,12448,12456,12463,12471,
-    12478,12486,12493,12501,12510,12519,12526,12534,12542,12549,
-    12557,12565,12572,12580,12588,12596,12604,12612,12620,12628,
-    12636,12644,12652,12660,12667,12675,12683,12691,12698,12706,
-    12713,12721,12729,12736,12744,12751,12759,12766,12774,12781,
-    12789,12797,12804,12812,12819,12827,12834,12842,12850,12858,
-
-    12865,12873,12880,12888,12895,12903,12910,12918,12926,12934,
-    12943,12952,12960,12967,12975,12982,12990,12998,13005,13013,
-    13021,13029,13037,13045,13053,13060,13068,13076,13083,13091,
-    13099,13106,13113,13121,13129,13136,13144,13151,13159,13167,
-    13174,13182,13189,13197,13204,13212,13219,13227,13235,13243,
-    13251,13259,13266,13274,13282,13290,13298,13305,13313,13322,
-    13331,13338,13346,13354,13362,13369,13377,13385,13393,13401,
-    13409,13416,13424,13432,13439,13447,13455,13462,13469,13477,
-    13485,13492,13499,13507,13515,13523,13530,13538,13545,13552,
-    13560,13568,13576,13583,13591,13598,13606,13615,13624,13631,
-
-    13639,13647,13655,13663,13671,13679,13687,13695,13703,13710,
-    13718,13725,13733,13741,13749,13757,13765,13773,13781,13788,
-    13796,13804,13812,13820,13827,13834,13842,13850,13857,13865,
-    13872,13880,13889,13898,13905,13913,13921,13929,13937,13945,
-    13953,13960,13967,13975,13982,13990,13998,14005,14013,14021,
-    14028,14035,14042,14051,14060,14069,14078,14087,14096
+     1079, 1119, 1122, 1125, 1130, 1147, 1187, 1190, 1693, 1765,
+     1193, 1198, 1215, 1255, 1258, 1261, 1266, 1283, 1837, 1905,
+     1323, 1326, 1329, 1334, 1391, 1394, 1397, 1402, 1973, 2043,
+     1459, 1462, 2113, 2168, 1465, 1470, 1528, 1531, 1534, 1539,
+     1597, 1600, 2223, 2291, 1603, 1608, 1655, 1658, 1661, 1666,
+     1713, 1716, 2359, 2417, 1719, 1724, 2475, 2546, 1741, 1744,
+     2617, 2685, 1785, 1788, 2753, 2821, 1791, 1796, 1813, 1816,
+
+     2889, 2960, 1857, 1860, 1863, 1868, 1925, 1928, 1931, 1936,
+     1993, 1996, 1999, 2004, 2021, 2063, 2066, 2069, 2074, 2091,
+     2133, 2136, 3031, 3099, 2139, 2144, 2188, 2191, 2194, 2199,
+     2243, 2246, 3167, 3238, 2249, 2254, 3309, 3377, 2311, 2314,
+     3445, 3513, 2317, 2322, 2379, 2382, 2385, 2390, 2437, 2440,
+     3581, 3639, 2443, 2448, 3697, 3766, 2495, 2498, 2501, 2506,
+     2523, 2526, 2566, 2569, 3835, 3903, 2572, 2577, 2594, 2597,
+     2637, 2640, 2643, 2648, 3971, 4036,  204, 2659, 4101, 4170,
+     2666, 2706, 4239, 4306, 2709, 2712, 2716, 2719, 2773, 2776,
+     2779, 2784, 2841, 2844, 2847, 2852, 2909, 2912, 2915, 2920,
+
+     2937, 2940, 2980, 2983, 2986, 2991, 3008, 3011, 3051, 3054,
+     3057, 3062, 3079, 3119, 3122, 3125, 3130, 3147, 3187, 3190,
+     4373, 4441, 3193, 3198, 3215, 3218, 3258, 3261, 3264, 3269,
+        0,    0,11222,14483,14483,   96,  100,   29,   41,14483,
+      103,   51,14483,14483,11207,14483,14483,11196,14483,11211,
+    11209,  762,14483,14483,14483,14483,11207,11207,11157,14483,
+      160,11184,    0,   87,14483,11150,11136,14483,  166, 4505,
+    11134, 4576, 3280, 3232,  278,   76,11186,   26,  279, 3283,
+      392,11181,   31,14483,  169,11172,    0,  144,14483,11123,
+    11116,   81,14483,  347,  154,  188,  204,14483,  414,11167,
+
+        0,  268,14483,11116,11117,11122,11116,11107,14483,  417,
+       16,11125,  325,14483,  420,11154,    0,  305,14483,11119,
+    14483,  482,  393,14483,  485,11148,    0,  370,14483,11117,
+    11111,11113,14483,  488,  461,14483,  554,11142,    0,  506,
+    14483,11089,11084,11088,14483,  622,  541,  469,14483,  685,
+    11132,    0,  527,14483,11083,11083,14483,  688,  609,  514,
+    14483,  691,11125,    0,  530,14483,11076,11071,11073,14483,
+      756,  754,  529,14483,  759,11119,    0,  533,14483,11066,
+    11080,11082,11064,11078,   81,14483,  823,  865,14483,  885,
+    11107,    0,  595,14483,  141,11062,11068,  545,11053,   90,
+
+      606,11055,14483,  950,11104,  801,14483,  953,11095,    0,
+      713,14483,11061,14483,  956,11097,  861,14483, 1018,11088,
+        0,  743,14483,11054,11050,11036,14483, 1021,11090,  862,
+    14483, 1024,11077,    0,  784,14483,11025,11031,11039,11023,
+      330,14483, 1083,  818,  179,  867,14483, 1086,11070,    0,
+      811,14483,11021,11031,11018,14483, 1089,  929,14483, 1092,
+    11060,    0,  974,14483,11021,14483, 1151,  616,  219,  872,
+    14483, 1154,11058,    0,  997,14483,11023,11019,11021,   20,
+    14483, 1157,11056,  982,14483, 1160,11047,    0, 1110,14483,
+    11008,11008,14483, 1222, 1201,14483, 1225,11040,    0, 1178,
+
+    14483,11006,11006,14483, 1228, 1269,14483, 1290,11035,    0,
+     1246,14483,11004,10980,14483, 1293, 1334,14483, 1296,11028,
+        0, 1314,14483,10976,10972,10979,10989,10987,  398,14483,
+     1354, 1348, 1338,14483, 1363,11016,    0, 1402,14483,10981,
+    14483, 1422, 3349,  166, 1427, 1337,  597,  997,14483, 1431,
+    11012,    0, 1406,14483,10961,10966,10967,10953,10946,14483,
+     1499,  297, 1005,14483, 1559,10994,    0, 1409,14483,10956,
+    10958,14483, 1568, 1416,14483, 1625,10987,    0, 1450,14483,
+    10948,10948, 1013,10950,  796,14483, 1628, 1477,14483, 1683,
+    10975,    0, 1519,14483,10926,  671,14483, 1686, 1483, 1065,
+
+    14483, 1750,10973,    0, 1546,14483,10924,10934,14483, 1753,
+     1553,14483, 1822,10966,    0, 1588,14483,10912,10916,10926,
+    10900,14483, 1825,10961, 1133,14483, 1888,10952,    0, 1612,
+    14483,10903,10913,10901,10902,14483, 1894,  295,10897, 1277,
+    14483, 1897,10938,    0, 1646,14483,10895,10899,10897, 1939,
+    10898,14483, 1962,10925,    0, 1670,14483,10883,10881,10871,
+    14483, 1965, 2007,14483, 2030,10917,    0, 1704,14483,10879,
+    10867,14483, 2033, 3352,10865, 3410,10873, 3416, 1876, 2008,
+     3419, 1351,14483, 2038,10904,    0, 1728,14483,10855,10846,
+      698,14483, 2095, 1746, 1405, 2100,  866,10844,14483,10906,
+
+    10891,14483,14483,14483, 2092,  216,10841,10840,10834,10883,
+    14483,    0, 3334,10832,10875,10857, 1426,  352,  408,10837,
+    10826,10826,10830,10819, 1743,  288,10813,10814,10812, 1815,
+    10836,  420,  558,10810,10806,10810, 2091,  683,10798,10795,
+    10797,10821,  759, 2146,10791,10815,  861,10789,  888,  956,
+     1157, 1216, 1284, 1024,14483,    0,10779,10798,10794,10779,
+    10818,10781,14483,    0,10771,10765,10771,10778,10776,10775,
+     1429,14483,    0,10759,10769,14483,    0,10755, 3340,10744,
+    10761,14483,    0,10742,10757,10753,10753,14483,    0,10730,
+    10746,10746,14483,    0,10084,10103,10098,10098,14483,    0,
+
+     3402, 3470,10079,10093,10093,10091,10089,10090,14483,    0,
+    10092, 3478,10072, 3484,10062,10068,10064,10066,10066,10047,
+    10058,10052,10046,10035,10046,14483,    0, 3533,10041,14483,
+        0, 3536,10042,10027,10031,14483,    0,10032,  291, 3539,
+    10012,10013,10016,10007, 9997, 9989,14483,    0, 9977, 3543,
+     3546, 9990,14483,    0, 9985, 9986,14483,    0, 9980, 3601,
+     9968, 9986, 9984, 9972,14483,    0, 9949, 3604, 9953,14483,
+        0, 3607, 9950, 9946,14483,    0, 9944, 9923, 9924,14483,
+        0, 9934, 9930, 9914, 3611, 9907, 9916, 9918, 9899, 9892,
+    14483,    0, 9885, 9871, 1432, 1489, 2201, 1504, 1558, 2212,
+
+    14483,    0, 9872, 9865, 9867, 9878, 9875, 9845,14483,    0,
+     3615, 9844, 9839,14483,    0, 9830, 3659, 9819, 9840, 9826,
+     9829, 9827, 9826, 9804,14483,    0, 9801, 9816, 9805, 9798,
+    14483,    0, 9787, 3662, 9783,14483,    0, 9765, 9770, 3665,
+     9765, 9760,14483,    0, 9760, 3669, 9769, 9745, 9740, 9743,
+    14483,    0, 9744, 3673, 9736,   13, 9733, 9767,14483,    0,
+     9731, 9721, 9732, 9711,14483,    0, 3717, 9709, 9702, 1616,
+    14483,    0, 9688, 9707, 9696, 9677, 9662, 9716, 9713, 1785,
+     9660,14483, 2205,    0, 9655, 9655, 9696, 9694, 9643,14483,
+     3720, 2274, 9632, 3409, 3723, 2283, 9626, 9638, 9640, 9616,
+
+     9629, 9608, 9610, 9604, 9602, 9617, 9604,  191, 9611, 9614,
+     9598, 9579, 9571, 9560, 9571, 9557, 9554, 2286, 9565, 9550,
+     9552, 9532, 9528, 9539, 9527, 9534, 9510, 9513, 9522, 9508,
+     2342, 9500, 9497, 2465, 9496, 9492, 9479, 9478, 3727, 3738,
+     3731, 3796, 3790, 3857, 9482, 9492, 9473, 9480, 9484, 9463,
+     3799, 3805, 9472, 9453, 3860, 3864, 9469, 3786, 2533, 9466,
+     3868, 3937, 3793, 3940, 3871, 3925, 3932, 3944, 3992, 3995,
+     4000, 4056, 4074, 4060, 4010, 4065, 4068, 2604, 4078, 2669,
+     4121, 4131, 4134, 4141, 4200, 4126, 4211, 2098, 4197, 2736,
+     9458, 4203, 2804, 4206, 9453, 9444, 9449, 9444, 9432, 9432,
+
+     9442, 9439, 9412, 4260, 4268, 4263, 2872, 4271, 4274, 4281,
+     2943, 9421, 9401, 4328, 4331, 9410, 9394, 9393, 4337, 3014,
+     9392, 9386, 9370, 4340, 4343, 9369,  265, 9366, 4393, 3225,
+     4396, 3366, 4399, 4402, 9374, 4407, 4414, 9369, 4421, 3498,
+     9367, 9352, 9335, 4461, 4465, 9349, 4468, 3565, 4471, 4476,
+     4480, 3750, 9323, 4498, 4501, 9338, 9323, 4504, 4511, 9324,
+      473, 9314, 4526, 3824, 4533, 9325, 9305, 4539, 4581, 9323,
+     9303, 4544, 4575, 9297, 9302, 9299, 9295, 9303, 9280, 9287,
+     9291, 9271, 4584, 4587, 4590, 4019, 9267, 4610, 4619, 9277,
+     4613, 4086, 4644, 9267, 4653, 9270, 9263, 9266, 4656, 4662,
+
+     4665, 4671, 4675, 4685, 4689, 9246, 4694, 4160, 4697, 4700,
+     9258, 9236, 4704, 4363, 9243, 4712, 4722, 9226, 4725, 4429,
+     9230, 9229, 4731, 4736,  343, 9227, 4743, 4746, 9220, 9253,
+     4755, 4763,14483, 9198, 9198, 9198, 4766, 4769, 4774, 4778,
+     9179, 4792, 4795, 4798, 4804, 4807, 4816, 4825, 4829, 9223,
+    14483,14483,  870, 9179,14483, 9218, 9217, 9164,14483,14483,
+     9151, 4835,14483,14483, 9150, 4844, 4848,14483, 4851, 2108,
+     9138, 9137, 9129, 9138, 9131, 9122, 9110, 9118, 9112, 9101,
+     9104, 9104, 9108, 9097, 9092, 9083,  497, 9091, 9074, 9066,
+     9080, 9067,  565, 2352, 9055, 9051, 9060, 9050, 9035, 9033,
+
+     9028, 9028, 9012, 8991, 8978, 8980, 8954, 8908, 8889, 8838,
+     8838, 8784, 8759, 4858, 4877, 8723, 8703, 4863, 4885, 8706,
+     4872, 4893,14483, 4896, 8688, 8666, 4899, 8665, 8607, 8500,
+     4902, 4905,14483, 4908, 8486, 8420, 4917, 4927,14483, 4930,
+     8348, 4936,14483,14483, 8306, 4949, 4952,14483, 4955, 4962,
+     4976, 8195, 8193, 4985, 4988, 4996, 4999,14483, 5006, 5009,
+     5018, 5027, 5030, 5038, 5041,14483, 5045, 5048, 5051, 8174,
+     8100, 5060, 5066, 5074, 5078,14483, 5081, 5084,14483,14483,
+     5093,14483,14483, 5101, 5105, 8086, 8089, 8013, 7955, 5113,
+     5119,14483, 5122, 7884, 7904, 7711, 5125,14483,14483, 5133,
+
+     5141,14483,14483, 5151, 5154, 7684, 7700, 7642, 7632, 7577,
+     7551, 7541, 7519, 1675, 5162, 5165,14483, 5172, 5175,14483,
+    14483, 5184, 5187,14483, 5191, 5194,14483,14483,   22,   71,
+     5206, 5210,14483, 5213,   91,  121, 5216, 5219,14483,14483,
+      152,  197,  218, 5235, 5241,14483, 5244,  238,  243, 5247,
+     5254,14483,14483, 5265,14483,14483, 5273, 5276,14483, 5280,
+     5283, 5286, 5295,14483, 5301,  255, 5305,14483,14483,  338,
+      406,  486, 5314, 5320,14483, 5323,  508, 5326,14483,14483,
+     5334, 5342,14483, 5347, 5354,14483,14483,  545, 5362, 5367,
+    14483, 5370, 5373, 5376, 5381, 5394,14483, 5400,  544,  605,
+
+      603,  643, 5403,14483,14483, 5413, 5425,  645,  645, 5433,
+     5436,14483, 5439,  632,  681, 5442, 5445,14483, 5448,  677,
+      687, 1698,  691,  698, 5469,  721,  754,  741, 5472, 5475,
+    14483, 5479, 5498,14483,14483,  775, 5483, 5506,14483, 5509,
+      826, 5512,14483,14483, 5487, 5521, 5529, 5532, 5535,  879,
+     5543,  887, 5550, 5554,14483, 5557, 5561, 5579, 5565, 5587,
+      895, 5595, 5598,14483, 5601,  946, 5604,14483,14483, 5620,
+     5623,14483, 5626,  948,  949, 5629,14483,14483,  975, 5645,
+     5648,14483, 5652,  954, 5655,14483,14483, 1007, 5671, 5674,
+     5677,14483, 5680, 1019, 5683, 5689,14483,14483, 5701, 1051,
+
+     5704, 5707,14483, 5710, 1081, 5715, 1082, 5719, 5729,14483,
+     5733, 5739,14483,14483, 1080, 5748, 5752,14483, 5755, 5759,
+     5767, 1071, 1074, 5777, 5782, 1088, 5790, 5795,14483, 5799,
+     1465, 5802,14483,14483, 1127, 1149, 1140, 5805,14483, 1134,
+     1142, 1148, 1161, 1166, 1208, 1203, 1217, 2411, 2469, 1208,
+     2679, 1241, 1271, 2747, 1290, 1308, 2813, 1344, 1356, 1363,
+     1377, 2882, 2816, 1405, 1425, 1477, 1484, 1495, 3090, 1543,
+     3158, 3296, 1560, 1566, 1566, 3474, 1555, 3506, 3574, 1566,
+     1617, 1618, 5824,14483,14483, 1605, 1626, 5832,14483,14483,
+     1612, 5809, 3633, 1634, 5840, 5843, 1660, 1672, 1683, 5851,
+
+     1673, 5861, 5854, 1680, 1687, 5865, 5873,14483,14483, 1692,
+     1712, 5884,14483,14483, 5892, 5895,14483,14483, 5904,14483,
+    14483, 5914, 5917,14483,14483, 1712, 1744, 5926,14483,14483,
+     5934, 5937,14483,14483, 1728, 1752, 5946, 1735, 5949, 5953,
+     5956, 5959, 5964, 5983, 5991,14483,14483, 5977, 5999, 6002,
+     6008, 6011, 6020, 6031, 6034, 6038, 6041, 6044, 6059, 1771,
+     1781, 6064, 1783, 1777, 6052, 6083, 1782, 6078, 1804, 6070,
+     3330, 1799, 6091, 6113, 6098, 6126, 6129, 6138, 1815, 1822,
+     1814, 1830, 6144, 1811, 6148, 6151, 6157, 6169, 6172, 1827,
+     6180, 1843, 6183, 1825, 1845, 6187,14483,14483, 6203, 1855,
+
+     6210, 1866, 1872, 6213, 1870, 1884, 1893, 1884, 1892, 6216,
+     6222, 1887, 1900, 1910, 6234, 6237, 6242, 1911, 6255,14483,
+    14483, 6246, 6264, 6272,14483,14483, 1912, 6281, 6285, 1917,
+     6293, 6299,14483,14483, 6308,14483,14483, 1903, 6316, 1931,
+     6319, 1947, 1942, 1956, 6322, 1947, 6325, 6328, 6331, 6346,
+     1952, 6349, 6352, 1962, 1994, 6360, 1955, 6367, 6370, 6379,
+     6388, 1964, 6391, 6397,14483,14483, 1960, 1986, 6412,14483,
+    14483, 2005, 6421, 2194, 2059, 6424,14483, 2060,14483,14483,
+     2026, 2016, 3691, 2032, 2024, 2021, 2046, 2054, 2073, 3761,
+     3818, 2083, 2097, 3896, 2101, 2106, 3964, 4029, 2092, 2095,
+
+     4096, 2102, 4154, 2111, 4230, 4194, 2120, 4224, 2130, 2140,
+     2137, 2154, 2156, 4233, 2150, 2168, 4299, 4355, 4536, 2198,
+     4547, 4616, 2195, 2192, 2195, 4958, 6427, 6430, 6433, 6444,
+     6451, 2213, 2205, 6455,14483,14483, 2217, 2221, 2238, 6463,
+     2268, 6466, 6470, 6478, 2270, 2253, 6484, 6487, 6497, 6505,
+     6511, 6515, 6520, 6524, 6534, 6539, 6543, 6546, 6557, 6561,
+     6564, 6568, 6582, 6585, 6593,14483,14483, 6603, 6606, 6609,
+     6612, 6615, 6634, 6637, 6640, 6657, 6663, 6675, 6681, 6684,
+     2256, 2279, 6689, 2280, 2270, 6693,14483,14483, 6703, 6708,
+     6712, 2279, 2281, 6721, 6726, 6730, 6734,14483,14483, 6742,
+
+     6745,14483,14483, 6753, 2284, 2267, 2287, 2292, 6756, 2290,
+     6761, 6764, 6768, 6776, 6783,14483,14483, 2297, 6791, 2306,
+     6795, 6798, 6813, 2295, 6816, 6822, 2320, 2335, 6836, 2327,
+     2332, 6839, 6842, 2340, 2330, 2337, 2337, 6845,14483,14483,
+     2344, 2343, 2336, 6859, 6862, 6865, 6873, 2341, 6880,14483,
+    14483, 2350, 6893,14483,14483, 2345, 6888, 2366, 6901, 2385,
+     6907, 6912, 6915, 6920, 6926, 2380, 6934, 6938, 6954,14483,
+    14483, 6946, 2404, 6965,14483,14483, 2396, 2416, 6975, 2388,
+     6979, 2702, 3856, 6987, 6995, 6990, 2403, 7005, 7009, 7012,
+     7015, 7018, 2454, 2443, 2491,14483, 7033, 2406, 7037, 2399,
+
+     2444, 2540, 2443, 2447, 7043, 2457, 2463, 2451, 2456, 7046,
+     2464, 2466, 7051, 7055, 7058, 2484, 7061, 2488, 2473, 2523,
+     2519, 2611, 2514, 2518, 2530, 2535, 7064, 7067, 2537, 7070,
+     2540, 2532, 2747, 2815, 7073, 7077, 7085, 7091, 2545, 7099,
+     2536, 2546, 2549, 2544, 2558, 7103, 2585, 7106,14483,14483,
+     7118, 2584, 7114, 7122, 7125, 7128, 7137, 7143, 7151, 7155,
+     7158, 7161, 7176, 7179, 7187, 7190, 7194, 7202, 7208,14483,
+    14483, 7222, 7225, 7233, 7236,14483,14483, 7244, 7248, 2596,
+     2607, 2599, 7256, 7262, 7270, 2602, 2625, 7274,14483,14483,
+     7282, 7288, 2609, 2605, 7296, 7300, 7303, 7306, 7309,14483,
+
+     2643, 2667, 7315, 7324, 7333,14483,14483, 2668, 2671, 7341,
+    14483, 7344, 7349, 7355, 2667, 7360, 2694, 2686, 7363,14483,
+     2682, 7368, 7378,14483,14483, 7387, 2717, 7391, 2694, 7394,
+    14483,14483, 7402, 7410, 2734, 7420,14483,14483, 2731, 2732,
+     7428,14483, 2725, 7431, 7435, 7438, 7441, 2727, 7449, 2733,
+     2736, 2729, 2751, 7454, 7457,14483,14483, 7465,14483, 2748,
+     7468, 2794, 7473, 2799, 7476, 2808, 7480, 7486, 7500, 7508,
+     7511, 7514, 7522, 7529, 7534,14483,14483, 7542, 2795, 2811,
+     2842, 7547, 7550, 2844, 2831, 2858, 2840, 2861, 2851, 2899,
+     2868, 7554,14483,14483, 7562, 7568, 7571,14483, 7577, 7586,
+
+     7581, 7599, 2867, 7610, 2906, 2939, 2930, 7613, 7616, 7624,
+     2859, 2877, 2895, 2871, 2884, 7631, 7634, 7637, 2888, 7640,
+     2890, 2887, 2894, 7643, 7646, 7649, 7652, 2893, 2907, 7655,
+     2938, 2957, 2935, 2936, 7658, 7661, 2939, 7664, 7667, 7673,
+     2939, 2936, 7676,14483,14483, 7684,14483,14483, 2954, 7692,
+     2956, 7695, 7700, 7704, 7707, 7713,14483, 2952, 7725, 2965,
+     7728, 7732, 7740, 7746,14483,14483, 7755,14483,14483, 7763,
+     7770, 7773,14483,14483, 7789,14483,14483, 7797, 7803,14483,
+    14483, 7811, 7816, 7825,14483,14483, 7833, 7836,14483,14483,
+     2961, 2964, 2978, 7845,14483,14483, 7853, 7856, 2975, 2965,
+
+     7864,14483,14483, 2997, 7872, 7875, 7878, 7881, 7884, 7901,
+     3001, 2994, 7904,14483,14483, 3006, 3007, 7912, 7915, 3013,
+     7919, 7922, 3016, 3008, 3013, 3013, 7937, 7942, 3024, 7945,
+    14483, 3023, 7949,14483,14483, 3016, 3026, 3028, 3028, 7957,
+     7969, 7964, 7977, 7983, 7986, 7989, 7992, 7995, 7998, 8001,
+     3029, 8016, 8020, 3048, 8030, 3063, 8034,14483, 3061, 8037,
+     8049,14483,14483, 8040, 8061, 8069,14483,14483, 8077, 8080,
+     8083, 8091, 3064, 3077, 3089, 8098,14483, 8101, 8104, 3103,
+     3102, 3102, 3109, 3119, 3117, 3114, 3115, 3122, 3132, 8112,
+     8119, 8124, 8133,14483,14483, 8144,14483,14483, 3112, 8152,
+
+     8155, 3146, 3206, 8159, 3253, 7762, 8045, 8167, 8174, 3116,
+     3128, 3136, 8177, 8180, 3143, 8183, 8186, 3140, 8189, 8192,
+     8195, 3137, 3146, 3158, 8198, 8201, 3146, 3153, 3161, 8204,
+     8207, 3170, 8210, 8213, 3163, 3172, 3183, 3219, 8216, 8221,
+     8224, 8228, 8236, 8242, 8245, 8248, 8254, 8263, 8266,14483,
+    14483, 8274, 8277, 8281, 8284, 8289,14483,14483, 8304, 3214,
+     3217, 3230, 8308,14483,14483, 8316, 3225, 3232, 8323, 8327,
+     8335, 8347,14483, 8350,14483,14483, 8358, 8362, 3245, 3250,
+     3252, 3254, 8370, 8376, 8379, 8382,14483,14483, 8390, 8397,
+     8400, 8403, 8409, 8421, 8428, 3267, 3285, 3287, 3292, 8432,
+
+     8436,14483,14483, 8447, 8453, 8456, 8460, 8474, 8477, 8480,
+     8483, 8487, 8498,14483,14483, 8508, 8512,14483, 3297, 3298,
+     8515,14483, 8519,14483,14483, 8534, 8537,14483,14483, 8545,
+     3290, 3291,14483, 8549,14483,14483, 3337, 3323, 3340, 3341,
+     3367, 3377, 3367, 3382, 3383, 3392, 8558, 8564, 8547, 8556,
+     3373, 8582, 8593, 3416, 3539, 3365, 3372, 3370, 3370, 3379,
+     3381, 3385, 3429, 3419, 3437, 8597, 8601, 3432, 3436, 3452,
+     8604, 8607, 3446, 8612, 3455, 3488, 8615, 8621, 3489, 3485,
+     3502, 8624, 3483, 3500, 8627, 3503, 8630,14483, 8633, 8636,
+    14483,14483, 8644, 8650, 8658, 8662, 8665, 8668, 8671, 8676,
+
+     8689, 8692, 8695, 8698, 8701,14483, 3521, 3509, 3501, 3525,
+     8704, 8722, 3518, 3526, 8730, 3851, 3929, 8738,14483, 8741,
+    14483,14483, 3547, 3553, 8749, 8752, 8760, 8770,14483, 8773,
+     8779, 3567, 3563, 3564, 8791, 8794, 8797, 8805, 8812, 8815,
+     8820, 3558, 3563, 8833, 8836, 8839, 8842, 8845,14483,14483,
+     8854, 8857, 8865, 8868, 8875,14483, 8878, 8887, 3574, 3577,
+     3587, 8896,14483, 8899, 3605, 3600, 3636, 3631, 3648, 3636,
+     3664, 3647, 3647, 3678, 3679, 3707, 8902, 3676, 3680, 3690,
+     3684, 3700, 3700, 3724, 3762, 3740, 3753, 3756, 8905, 3831,
+     3811, 3861, 3759, 3775, 3801, 3825, 3831, 3830, 3832, 3860,
+
+     3862, 3869, 3869, 3862, 3867, 3884, 3911, 8908, 8911, 3888,
+     3904, 8924, 3890, 3908, 3926, 8927, 3905, 3946, 8930, 8933,
+     8936,14483,14483, 8944, 8947, 8958, 8967, 8976,14483, 8979,
+    14483,14483, 8987,14483, 8990, 8995, 8998, 3936, 3945, 9001,
+     3938, 9010,14483,14483, 3951, 3941, 3978, 4002, 3981, 3989,
+     4119, 3998, 3978, 9019, 9022, 9025, 9040, 9044, 9053, 9059,
+    14483,14483, 4003, 4011, 4008, 9067, 9072, 9081, 4264, 4327,
+     9089,14483, 9092, 9095,14483,14483, 3999, 9103, 9111, 9114,
+     9122, 9125, 9133,14483, 9136,14483,14483, 9144, 9152, 9147,
+     9165, 9173, 4487, 4615, 4022, 9181, 9184, 9187, 9033, 9190,
+
+     4066, 4095, 4102, 4109, 4126, 4117, 4129, 4130, 4137, 4156,
+     9193, 4097, 4109, 4129, 4133, 4148, 4141, 4150, 4164, 4165,
+     4177, 4205, 4198, 9202, 9208, 4272, 4273, 4308, 4213, 4230,
+     4221, 4235, 4244, 4254, 4269, 4289, 4276, 4294, 4307, 4320,
+     4339, 9212, 4349, 9215, 4360, 4376, 4361, 9220, 4372, 4383,
+     4387, 9223, 9227, 9235, 4473, 4494, 9243,14483,14483, 9251,
+     9255, 9260, 4393, 9263, 9266, 9270, 9284, 4424, 4432, 4468,
+     4452, 4471, 4457, 4494, 4480, 4511, 4506, 4504, 9287, 9290,
+     9298,14483,14483, 9308,14483,14483, 9316,14483, 4493, 9320,
+     4508, 9323,14483,14483, 4525, 4532, 4532, 4535, 4540, 4545,
+
+     9331, 4550, 9338, 9341, 9350,14483,14483, 9358,14483,14483,
+     9366, 4586, 4624, 9374,14483,14483, 4562, 4566, 4648, 4567,
+     4570, 4696, 4545, 9382, 9385, 9393, 9396, 9404, 9407, 9411,
+     9414, 4585, 4583, 4586, 4600,14483, 4627, 4619, 4626, 4638,
+    14483, 9423, 4613, 4625, 4621, 4649, 4657, 4669, 4653, 4662,
+     4656, 4675, 4687, 4693, 9429, 9432, 9442,14483, 4734, 4765,
+     9447, 4691, 4693, 4710, 4768, 4773, 4727, 4721, 4724, 4751,
+     4804, 4805, 4755, 4768, 9450, 4754, 9453, 4756, 4780, 9456,
+     4770, 9461, 4773, 9469, 5196, 5625, 4813, 4830, 4828, 4837,
+     9477, 9480, 9483, 4808, 9486, 9489, 9504,14483,14483, 9512,
+
+     9515, 4796, 4806, 4856, 4836, 4850, 4873, 4887, 4868, 4883,
+     4883, 4871, 9523,14483,14483, 4873, 9531, 9534, 4861, 4893,
+     4906, 4937, 4901, 4911, 4939, 9549,14483, 4894, 9552,14483,
+    14483, 4937, 4942, 4940, 4945, 4951, 4939, 4941, 4955, 4962,
+     4958, 4960, 4968, 9560, 9564, 5815, 6063, 9572,14483,14483,
+     9580, 9583,14483,14483, 4965, 4984, 5008, 4993, 4977, 4996,
+     5014, 5013, 9591, 4968, 4970, 5003, 5053, 5060, 5012, 5005,
+     5021, 5038, 5083, 5091, 5045, 9595, 6197, 6558, 5093, 9603,
+     9606, 9610, 5058, 5049, 5113,14483,14483, 5077, 5078, 5069,
+     5131,14483,14483, 5088, 9625, 5080, 9629, 9633, 9636, 5082,
+
+     9642, 9645, 5123, 5135, 5098, 5117, 5136, 5154, 5119, 5145,
+     5175, 5163, 5179, 5167, 9648, 9651,14483, 9654, 5166, 9657,
+    14483,14483, 9673,14483,14483, 9681, 5159, 5193, 5192, 5228,
+     5197, 5204, 5212, 5244, 5223, 5207, 9684, 9687,14483,14483,
+     9695, 5237, 5247,14483, 5256, 5266,14483, 5236, 5269, 5262,
+     5284, 5274, 5284, 5294, 5306, 5294, 5304, 5315, 5317, 5308,
+     9702, 9706, 5316, 5329, 5295, 5307, 5332, 5355, 5324, 5335,
+     9714, 5362, 5363,14483, 5364, 5370, 5370,14483, 5378, 9723,
+     5357, 5344, 5412,14483,14483, 5366, 5367, 5353, 5415,14483,
+    14483, 5372, 5394, 5407, 5390, 5401, 5421, 5432, 5396, 5407,
+
+     5464, 9726, 9729, 9738, 9792, 9840, 5396, 5397,14483, 5408,
+     5400, 5402,14483, 5422, 9748, 5440, 9751, 9757, 5442, 9760,
+     5491, 5466, 5511, 5451, 5511, 5483, 5531, 5474, 5543, 5510,
+     5546, 5526, 9763, 9766, 5519, 9769, 9772, 9787, 5537, 5537,
+    14483, 5570, 5543, 5541,14483, 5577, 5526, 9812, 9815, 9834,
+     9823, 5586, 5588, 5586, 5600, 5550, 5606, 5574, 5607, 5577,
+     5594, 5628, 5630, 5597, 5614, 5632, 5633, 5604, 9860,14483,
+    14483, 5639, 5614, 5656, 5595, 5657, 5628, 5660, 5621, 9852,
+    14483, 5695, 5682, 5692, 5717, 5695, 5696, 9871, 5671, 5673,
+    14483, 5688, 5680, 5697,14483, 5708, 5761, 5735, 5771, 5714,
+
+     5778, 5750, 5781, 5727, 5794, 9874, 5811, 5812, 9894, 9942,
+     5992, 5750, 5810, 6170, 5770, 5815, 9882, 9905,14483, 5831,
+    14483, 5833,14483, 5831,14483, 5839,14483, 5829,14483, 5844,
+     9914,14483, 9917, 5796, 9920, 5845, 5864, 9936, 9963, 5854,
+     5857,14483, 5865, 5874,14483, 5848, 9971,14483,14483, 9979,
+     6082, 6551,14483,14483,14483,14483, 5851,14483, 5887,14483,
+     5889, 5900,14483,14483, 5884, 5913,14483,14483, 5893,14483,
+     5927,14483, 5938,14483, 5936,14483, 5938,14483, 5964, 5965,
+    14483, 5964, 5965, 9989,14483, 6623, 5926, 5971, 6781, 5932,
+     5979,14483, 5984,14483, 5985,14483, 5990,14483, 5999, 6008,
+
+     6045, 6056, 6010, 6079, 6011, 9992,14483, 5959, 5979, 5988,
+     6138,14483,14483, 5992, 6019, 6027, 6087,14483, 9928, 9954,
+    14483,14483,14483,14483, 6066, 6068, 9995, 9998, 6212, 6120,
+     6257, 6172,10001,14483,14483, 6080, 6094, 6090, 6108,10016,
+     6258, 6192, 6106, 6268, 6218, 6113,10019, 6118, 6125, 6150,
+     6140, 6154, 6154,14483,14483,14483,14483,14483,14483,14483,
+    14483,14483, 6125, 6144, 6134, 6245,14483,14483, 6136, 6173,
+     6163, 6336,14483,14483,14483,14483,14483,10022, 6257, 6251,
+     6283,10025, 6243, 6235, 6239,14483, 6265, 6266, 6269, 6274,
+    14483, 6293, 6317, 6319,10028,14483,10037,10048, 6325, 6334,
+
+     6353, 6344, 6338, 6351, 6365, 6363, 6352, 6396, 6359, 6396,
+    10056,10059, 6367, 6376, 6388, 6384, 6392, 6380, 6389, 6416,
+     6406, 6415,10067,10074, 6403, 6410, 6445, 6434, 6451, 6440,
+     6427, 6415, 6425,14483, 6443, 6446, 6428, 6435,14483, 6453,
+    10070, 6485, 6454, 6472, 6450, 6477, 6476, 6493, 6481, 6502,
+     6550, 6548,10085, 6596, 6606, 6532, 6542, 6542, 6552, 6554,
+     6565, 6582, 6596, 6621,14483, 6621,14483,10093,14483,14483,
+     6610, 6618, 6616, 6625, 6627, 6625, 6635, 6631, 6641, 6642,
+    10101,14483,14483, 6668, 6666,14483, 6646,14483, 6647, 6633,
+     6658, 6630, 6651, 6652, 6677, 6649, 6668, 6764,14483, 6662,
+
+     6668, 6671, 6695, 6689, 6694, 6701, 6718,14483,14483, 6760,
+     6759, 6781, 6776, 6782, 6788, 6796, 6787, 6799, 6805, 6807,
+     6794,14483,14483, 6806, 6825, 6826, 6813, 6849, 6827, 6833,
+     6844, 6832, 6864,14483,14483, 6872, 6871, 6821, 6820, 6820,
+     6841, 6836, 6834, 6838, 6850, 6906, 6849, 6866, 6919, 6878,
+     6870, 6881, 6934, 6897, 6914, 6937, 6922, 6942, 6928, 6929,
+     6947, 6948, 6938, 6939, 6961, 6962, 6963, 6961, 6978, 6980,
+    14483, 6986, 6983, 7001, 7002,14483,14483,14483, 6967, 6978,
+     7027, 6988, 6980, 6997, 7069, 7030, 7071, 7030, 7036,14483,
+     7090, 7043, 7045,14483, 7104, 7077, 7097, 7099, 7105, 7122,
+
+     7113, 7145, 7125, 7143, 7136, 7165, 7135, 7158, 7150, 7193,
+     7160, 7176, 7171, 7204, 7174, 7161, 7164,14483, 7214, 7167,
+     7176,14483, 7223, 7223, 7172, 7238,14483, 7195, 7252,14483,
+     7232, 7241, 7239, 7244, 7273, 7248,14483, 7245, 7279, 7260,
+    14483, 7258, 7290, 7281,14483, 7278, 7312, 7290,14483, 7287,
+     7270, 7326,14483, 7277, 7331,14483, 7321, 7275,14483, 7280,
+    14483, 7323, 7343, 7336, 7349,14483, 7350, 7344,14483, 7359,
+     7353,14483, 7366, 7366,14483, 7375, 7369, 7341,14483, 7343,
+    14483,10109, 7412, 7416, 7401, 7422, 7420, 7438, 7405, 7428,
+     7418, 7438, 7421, 7447, 7437, 7460, 7485, 7483,10112,14483,
+
+    14483, 7488,14483, 7486,14483, 7491, 7454, 7492, 7463, 7502,
+     7475, 7512, 7484,14483,14483, 7519, 7566,14483,14483,14483,
+     7523,14483, 7525,14483, 7535,14483, 7546, 7541, 7604,14483,
+    14483,14483,14483, 7652, 7671, 7539, 7672, 7764, 7914, 7587,
+     7577, 7609, 7704, 7669, 7693, 7750, 7782, 7743, 7804, 7758,
+     7821, 7548, 7776, 7698, 7801, 7663, 7803, 7719, 7843, 7790,
+     7830, 7877, 7832, 7844, 7907, 7869, 7954, 7851, 7876, 7879,
+     7963, 7992, 7892, 8008, 7957, 8005, 8056, 8057, 8071, 8078,
+     8129, 8215, 8132, 7909, 8109, 8070, 8209, 8239, 7989, 8270,
+     8007, 8099, 8233, 8154, 8285, 8301, 8076, 8302, 8221, 8097,
+
+     8092, 8289, 8234, 8397, 8242, 8407, 8312, 8356, 8327, 8395,
+     8375, 8324, 8390, 8432, 8474, 8377, 8401, 8406, 8477, 8450,
+     8506, 8530, 8629, 8509, 8293, 8513, 8445, 8601, 8699, 8700,
+     8702, 8320, 8504, 8600, 8522, 8525, 8423, 8663, 8451, 8493,
+     8623, 8567, 8664, 8295, 8570, 8573, 8707, 8709,10120, 8726,
+     8624,10123,14483, 8717, 8746, 8749, 8737, 8766, 8729, 8769,
+     8758, 8811, 8863, 8874, 8898, 8904, 8792, 8865, 8924, 8944,
+     8901, 8955, 8900, 9010, 8897, 8975, 8921, 8934, 8810, 8854,
+     8964, 9019, 8669, 8989, 9029, 9047, 9060, 9031,10131,10134,
+    14483,14483,10154,10163,10172,10181,10190,10199,10208,10217,
+
+    10226,10235,10244,10253,10262,10271,10280,10289,10298,10307,
+    10316,10325,10334,10343,10352,10361,10370,10379,10388,10397,
+    10406,10415,10424,10433,10442,10451,10460,10469,10478,10487,
+    10496,10505,10514,10523,10532,10541,10550,10559,10568,10577,
+    10586,10595,10604,10613,10622,10631,10640,10649,10658,10667,
+    10676,10685,10694,10703,10712,10721,10730,10739,10748,10757,
+    10766,10775,10784,10791,10798,10805,10812,10819,10826,10833,
+    10840,10847,10854,10861,10868,10875,10882,10889,10896,10903,
+    10910,10917,10924,10931,10938,10945,10952,10959,10966,10973,
+    10980,10987,10994,11001,11008,11017,11024,11029,11036,11041,
+
+    11048,11053,11060,11065,11072,11077,11084,11089,11096,11101,
+    11108,11113,11120,11125,11132,11137,11144,11149,11156,11161,
+    11168,11173,11180,11185,11192,11197,11204,11209,11216,11221,
+    11228,11233,11240,11245,11252,11257,11264,11269,11276,11281,
+    11288,11293,11300,11305,11312,11317,11324,11329,11336,11341,
+    11348,11353,11360,11365,11372,11377,11384,11389,11396,11401,
+    11410,11416,11423,11431,11439,11447,11454,11462,11469,11477,
+    11484,11492,11500,11508,11516,11524,11532,11540,11548,11556,
+    11563,11571,11579,11586,11594,11601,11609,11616,11624,11631,
+    11639,11646,11654,11661,11669,11676,11684,11691,11699,11706,
+
+    11714,11721,11729,11736,11744,11751,11759,11766,11774,11782,
+    11790,11797,11805,11812,11820,11827,11835,11842,11850,11857,
+    11865,11872,11880,11888,11896,11905,11911,11918,11926,11933,
+    11941,11948,11956,11963,11971,11978,11986,11993,12001,12009,
+    12016,12024,12031,12039,12046,12054,12062,12069,12077,12084,
+    12092,12100,12108,12116,12124,12131,12139,12146,12154,12161,
+    12169,12177,12185,12192,12200,12207,12215,12222,12230,12237,
+    12245,12252,12260,12267,12275,12282,12290,12297,12305,12312,
+    12320,12328,12336,12343,12351,12358,12366,12373,12381,12390,
+    12399,12406,12413,12421,12428,12436,12444,12452,12459,12467,
+
+    12474,12482,12490,12497,12505,12512,12520,12528,12536,12544,
+    12551,12559,12566,12574,12582,12590,12597,12605,12612,12620,
+    12628,12636,12643,12651,12658,12666,12673,12681,12688,12696,
+    12704,12712,12719,12727,12734,12742,12749,12757,12764,12772,
+    12779,12787,12794,12802,12809,12817,12824,12832,12839,12847,
+    12856,12865,12872,12880,12888,12895,12903,12911,12918,12926,
+    12934,12942,12950,12958,12966,12974,12982,12990,12998,13006,
+    13013,13021,13028,13036,13044,13052,13059,13067,13074,13082,
+    13090,13097,13105,13112,13120,13127,13135,13142,13150,13158,
+    13165,13173,13180,13188,13195,13203,13211,13219,13226,13234,
+
+    13241,13249,13256,13264,13271,13279,13287,13295,13304,13313,
+    13321,13328,13336,13343,13351,13359,13366,13374,13382,13390,
+    13398,13406,13414,13421,13429,13437,13445,13452,13460,13468,
+    13475,13482,13490,13498,13505,13513,13520,13528,13536,13543,
+    13551,13558,13566,13573,13581,13588,13596,13604,13612,13620,
+    13628,13635,13643,13651,13659,13667,13674,13682,13691,13700,
+    13707,13715,13723,13731,13738,13746,13754,13762,13770,13778,
+    13785,13793,13801,13809,13816,13824,13832,13839,13846,13854,
+    13862,13869,13876,13884,13892,13900,13907,13915,13922,13929,
+    13937,13945,13953,13960,13968,13975,13983,13992,14001,14008,
+
+    14016,14024,14032,14040,14048,14056,14064,14072,14080,14087,
+    14095,14102,14110,14118,14126,14134,14142,14150,14158,14165,
+    14173,14181,14189,14197,14204,14211,14219,14227,14234,14242,
+    14249,14257,14266,14275,14282,14290,14298,14306,14314,14322,
+    14330,14337,14344,14352,14359,14367,14375,14382,14390,14398,
+    14405,14412,14419,14428,14437,14446,14455,14464,14473
     } ;
 
-static const flex_int16_t yy_def[4660] =
+static const flex_int16_t yy_def[4760] =
     {   0,
-     4108, 4108, 4109, 4109, 4109, 4109, 4110, 4110, 4111, 4111,
-     4112, 4112, 4113, 4113, 4113, 4113, 4114, 4114, 4115, 4115,
-     4116, 4116, 4116, 4116, 4108, 4108, 4116, 4116, 4116, 4116,
-     4108, 4108, 4116, 4116, 4116, 4116, 4108, 4108, 4116, 4116,
-     4108, 4108, 4116, 4116, 4116, 4116, 4108, 4108, 4116, 4116,
-     4108, 4108, 4116, 4116, 4116, 4116, 4117, 4117, 4118, 4118,
-     4108, 4108, 4118, 4118, 4118, 4118, 4119, 4119, 4120, 4120,
-     4108, 4108, 4120, 4120, 4120, 4120, 4121, 4121, 4122, 4122,
-     4123, 4123, 4124, 4124, 4125, 4125, 4126, 4126, 4108, 4108,
-     4126, 4126, 4126, 4126, 4127, 4127, 4128, 4128, 4108, 4108,
-
-     4128, 4128, 4128, 4128, 4129, 4129, 4130, 4130, 4108, 4108,
-     4130, 4130, 4130, 4130, 4131, 4131, 4132, 4132, 4133, 4133,
-     4134, 4134, 4108, 4108, 4134, 4134, 4134, 4134, 4135, 4135,
-     4136, 4136, 4108, 4108, 4136, 4136, 4136, 4136, 4137, 4137,
-     4138, 4138, 4108, 4108, 4138, 4138, 4138, 4138, 4139, 4139,
-     4140, 4140, 4141, 4141, 4142, 4142, 4108, 4108, 4142, 4142,
-     4142, 4142, 4143, 4143, 4144, 4144, 4108, 4108, 4144, 4144,
-     4144, 4144, 4145, 4145, 4146, 4146, 4147, 4147, 4148, 4148,
-     4149, 4149, 4150, 4150, 4151, 4151, 4152, 4152, 4108, 4108,
-     4153, 4153, 4154, 4154, 4154, 4154, 4108, 4108, 4154, 4154,
-
-     4154, 4154, 4108, 4108, 4154, 4154, 4108, 4108, 4154, 4154,
-     4154, 4154, 4155, 4155, 4156, 4156, 4108, 4108, 4156, 4156,
-     4156, 4156, 4157, 4157, 4158, 4158, 4159, 4159, 4160, 4160,
-     4161, 4161, 4162, 4162, 4108, 4108, 4162, 4162, 4162, 4162,
-     4163, 4163, 4164, 4164, 4165, 4165, 4166, 4166, 4108, 4108,
-     4166, 4166, 4166, 4166, 4167, 4167, 4168, 4168, 4108, 4108,
-     4168, 4168, 4168, 4168, 4169, 4169, 4170, 4170, 4171, 4171,
-     4172, 4172, 4173, 4173, 4174, 4174, 4174, 4174, 4108, 4108,
-     4174, 4174, 4174, 4174, 4108, 4108, 4174, 4174, 4174, 4174,
-     4108, 4108, 4174, 4174, 4108, 4108, 4174, 4174, 4174, 4174,
-
-     4108, 4108, 4174, 4174, 4108, 4108, 4174, 4174, 4174, 4174,
-     4175, 4175, 4176, 4176, 4108, 4108, 4176, 4176, 4176, 4176,
-     4108, 4108, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4177, 4107, 4107, 4177, 4177, 4107, 4107, 4107,
-      360, 4107,  362, 4107,  364,  362,  363,  362,  363,  364,
-      370,  369,  362, 4107, 4107, 4107, 4178, 4107, 4107, 4178,
-     4178, 4178, 4107, 4107,  362,  362,  362, 4107, 4107, 4107,
-     4179, 4107, 4107, 4179, 4179, 4179, 4179, 4179, 4107, 4107,
-
-      362,  362,  362, 4107, 4107, 4107, 4180, 4107, 4107, 4180,
-     4107, 4107, 4107, 4107, 4107, 4107, 4181, 4107, 4107, 4181,
-     4181, 4181, 4107, 4107, 4107, 4107, 4107, 4107, 4182, 4107,
-     4107, 4182, 4182, 4182, 4107, 4107,  362,  362, 4107, 4107,
-     4107, 4183, 4107, 4107, 4183, 4183, 4107, 4107,  362,  362,
-     4107, 4107, 4107, 4184, 4107, 4107, 4184, 4184, 4184, 4107,
-     4107,  362,  362, 4107, 4107, 4107, 4185, 4107, 4107, 4185,
-     4185, 4185, 4185, 4185, 4185, 4107, 4107, 4107, 4107, 4107,
-     4107, 4186, 4107, 4107, 4186, 4186, 4186, 4186, 4186, 4186,
-     4186, 4186, 4107, 4107,  362,  362, 4107, 4107, 4107, 4187,
-
-     4107, 4107, 4187, 4107, 4107,  362,  362, 4107, 4107, 4107,
-     4188, 4107, 4107, 4188, 4188, 4188, 4188, 4188, 4107, 4107,
-      362,  362,  362, 4107, 4107, 4107, 4189, 4107, 4107, 4189,
-     4189, 4189, 4107, 4107, 4107, 4107, 4107, 4107, 4190, 4107,
-     4107, 4190, 4107, 4107,  364,  364,  362, 4107, 4107, 4107,
-     4191, 4107, 4107, 4191, 4191, 4191, 4191, 4107, 4107,  362,
-      362, 4107, 4107, 4107, 4192, 4107, 4107, 4192, 4192, 4107,
-     4107, 4107, 4107, 4107, 4107, 4193, 4107, 4107, 4193, 4193,
-     4107, 4107, 4107, 4107, 4107, 4107, 4194, 4107, 4107, 4194,
-     4194, 4107, 4107, 4107, 4107, 4107, 4107, 4195, 4107, 4107,
-
-     4195, 4195, 4195, 4195, 4195, 4195, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4196, 4107, 4107, 4196, 4107, 4107,  364,
-      620,  362,  362,  362,  362, 4107, 4107, 4107, 4197, 4107,
-     4107, 4197, 4197, 4197, 4197, 4197, 4107, 4107,  362,  362,
-     4107, 4107, 4107, 4198, 4107, 4107, 4198, 4198, 4107, 4107,
-     4107, 4107, 4107, 4107, 4199, 4107, 4107, 4199, 4199, 4199,
-     4199, 4199, 4107, 4107, 4107, 4107, 4107, 4107, 4200, 4107,
-     4107, 4200, 4200, 4107, 4107,  362,  362, 4107, 4107, 4107,
-     4201, 4107, 4107, 4201, 4201, 4107, 4107, 4107, 4107, 4107,
-     4107, 4202, 4107, 4107, 4202, 4202, 4202, 4202, 4107, 4107,
-
-      362,  362, 4107, 4107, 4107, 4203, 4107, 4107, 4203, 4203,
-     4203, 4203, 4107, 4107,  362,  362,  362, 4107, 4107, 4107,
-     4204, 4107, 4107, 4204, 4204, 4204, 4107, 4107, 4107, 4107,
-     4107, 4205, 4107, 4107, 4205, 4205, 4205, 4107, 4107, 4107,
-     4107, 4107, 4107, 4206, 4107, 4107, 4206, 4206, 4107, 4107,
-      364,  751,  362,  364,  364,  362,  753,  751,  362, 4107,
-     4107, 4107, 4207, 4107, 4107, 4207, 4207, 4207, 4107, 4107,
-      362,  362, 4107, 4208, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4209, 4209,
-     4209, 4210, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4211, 4211, 4211, 4211, 4211, 4212, 4107, 4107, 4213,
-     4213, 4213, 4213, 4213, 4213, 4214, 4107, 4107, 4215, 4215,
-     4216, 4107, 4217, 4217, 4217, 4217, 4218, 4107, 4219, 4219,
-     4219, 4219, 4220, 4107, 4221, 4221, 4221, 4222, 4107, 4223,
-     4223, 4223, 4223, 4224, 4107, 4225, 4225, 4225, 4225, 4225,
-     4225, 4225, 4225, 4226, 4107, 4227, 4227, 4227, 4227, 4227,
-     4227, 4227, 4227, 4227, 4227, 4227, 4227, 4227, 4227, 4227,
-
-     4228, 4107, 4229, 4229, 4230, 4107, 4231, 4231, 4231, 4231,
-     4231, 4231, 4231, 4232, 4107, 4107, 4233, 4233, 4233, 4233,
-     4234, 4107, 4235, 4235, 4236, 4107, 4237, 4237, 4237, 4237,
-     4237, 4237, 4238, 4107, 4239, 4239, 4239, 4240, 4107, 4241,
-     4241, 4241, 4242, 4107, 4243, 4243, 4243, 4244, 4107, 4245,
-     4245, 4245, 4245, 4245, 4245, 4245, 4245, 4246, 4107, 4107,
-     4247, 4247, 4248, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4249, 4249, 4249, 4249, 4249, 4249, 4250, 4107, 4251, 4251,
-     4251, 4252, 4107, 4253, 4253, 4253, 4253, 4253, 4253, 4253,
-     4253, 4253, 4254, 4107, 4255, 4255, 4255, 4255, 4256, 4107,
-
-     4257, 4257, 4257, 4258, 4107, 4259, 4259, 4259, 4259, 4259,
-     4260, 4107, 4261, 4261, 4261, 4261, 4261, 4262, 4107, 4107,
-     4263, 4263, 4263, 4263, 4107, 4264, 4107, 4107, 4265, 4265,
-     4265, 4265, 4266, 4107, 4267, 4267, 4267, 4268, 4107, 4107,
-     4269, 4269, 4269, 4269, 4269, 4270, 4271, 4107, 4271, 4107,
-     4107, 4107, 4272, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4273, 4274, 4274, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4107, 4107, 4107, 4107, 4107, 4107, 4275, 4275, 4275, 4275,
-     4276, 4276, 4107, 4277, 4277, 4277, 4277, 4277, 4278, 4278,
-     4107, 4279, 4280, 4280, 4281, 4107, 4107, 4281, 4282, 4282,
-     4283, 4283, 4283, 4284, 4284, 4285, 4285, 4286, 4286, 4287,
-     4287, 4287, 4288, 4288, 4107, 4107, 4107, 4107, 4289, 4289,
-     4289, 4289, 4289, 4290, 4290, 4291, 4107, 4107, 4291, 4107,
-     4107, 4291, 4291, 4291, 4291, 4291, 4291, 4291, 4291, 4291,
-     4291, 4292, 4292, 4107, 4107, 4293, 4293, 4294, 4294, 4294,
-     4107, 4107, 4294, 4294, 4294, 4295, 4295, 4107, 4296, 4107,
-     4107, 4107, 4107, 4297, 4297, 4298, 4299, 4299, 4300, 4107,
-
-     4107, 4300, 4300, 4300, 4301, 4301, 4302, 4107, 4107, 4303,
-     4303, 4107, 4107, 4304, 4305, 4305, 4306, 4306, 4307, 4307,
-     4308, 4308, 4308, 4107, 4107, 4308, 4308, 4308, 4309, 4309,
-     4107, 4310, 4311, 4311, 4107, 4107, 4107, 4107, 4312, 4312,
-     4312, 4312, 4312, 4313, 4313, 4107, 4107, 4314, 4315, 4315,
-     4316, 4107, 4107, 4316, 4316, 4316, 4316, 4316, 4316, 4317,
-     4317, 4318, 4318, 4318, 4319, 4319, 4320, 4107, 4107, 4321,
-     4321, 4322, 4322, 4107, 4107, 4322, 4323, 4323, 4324, 4107,
-     4107, 4324, 4324, 4325, 4325, 4107, 4326, 4107, 4107, 4326,
-     4107, 4327, 4327, 4107, 4328, 4328, 4328, 4329, 4329, 4107,
-
-     4107, 4330, 4331, 4331, 4332, 4332, 4332, 4332, 4333, 4333,
-     4334, 4107, 4107, 4334, 4107, 4107, 4335, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4336, 4107, 4337, 4107, 4337,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4338, 4338, 4107, 4107, 4338,
-     4107, 4339, 4107, 4339, 4107, 4340, 4340, 4340, 4340, 4340,
-     4107, 4341, 4107, 4341, 4107, 4342, 4107, 4343, 4107, 4343,
-
-     4344, 4107, 4107, 4107, 4344, 4107, 4345, 4107, 4345, 4107,
-     4107, 4346, 4346, 4107, 4107, 4107, 4347, 4107, 4347, 4107,
-     4107, 4107, 4107, 4107, 4348, 4107, 4348, 4107, 4107, 4349,
-     4349, 4107, 4107, 4107, 4350, 4107, 4350, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4351, 4351, 4351, 4351, 4107,
-     4352, 4107, 4352, 4353, 4353, 4353, 4107, 4107, 4107, 4353,
-     4107, 4107, 4107, 4107, 4107, 4353, 4353, 4353, 4353, 4353,
-     4353, 4353, 4353, 4353, 4107, 4354, 4107, 4354, 4107, 4107,
-     4107, 4107, 4355, 4107, 4355, 4356, 4356, 4356, 4107, 4107,
-     4107, 4356, 4356, 4356, 4107, 4357, 4107, 4357, 4107, 4358,
-
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4359, 4107, 4359,
-     4360, 4107, 4361, 4107, 4361, 4362, 4107, 4107, 4107, 4362,
-     4362, 4362, 4107, 4363, 4107, 4363, 4364, 4107, 4107, 4107,
-     4107, 4365, 4107, 4365, 4107, 4107, 4107, 4366, 4107, 4367,
-     4107, 4367, 4368, 4368, 4107, 4369, 4107, 4369, 4370, 4370,
-     4370, 4370, 4107, 4107, 4107, 4107, 4107, 4370, 4370, 4107,
-     4371, 4107, 4371, 4107, 4372, 4107, 4373, 4107, 4373, 4107,
-     4107, 4107, 4107, 4374, 4374, 4374, 4374, 4374, 4107, 4375,
-     4107, 4375, 4107, 4107, 4107, 4376, 4107, 4377, 4107, 4377,
-     4378, 4107, 4107, 4107, 4107, 4107, 4378, 4107, 4107, 4378,
-
-     4378, 4378, 4107, 4379, 4107, 4379, 4107, 4107, 4107, 4107,
-     4380, 4107, 4381, 4107, 4381, 4382, 4107, 4107, 4107, 4107,
-     4383, 4107, 4383, 4384, 4384, 4107, 4107, 4107, 4384, 4107,
-     4385, 4107, 4385, 4386, 4107, 4107, 4107, 4386, 4386, 4107,
-     4387, 4107, 4387, 4107, 4388, 4107, 4107, 4107, 4388, 4107,
-     4107, 4389, 4107, 4389, 4390, 4390, 4390, 4107, 4391, 4107,
-     4391, 4107, 4107, 4107, 4392, 4107, 4393, 4107, 4393, 4107,
-     4107, 4394, 4394, 4107, 4107, 4394, 4107, 4395, 4107, 4395,
-     4396, 4397, 4107, 4107, 4107, 4107, 4398, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4399, 4399, 4107, 4107, 4107, 4399,
-     4400, 4107, 4401, 4107, 4107, 4401, 4401, 4401, 4402, 4107,
-     4403, 4404, 4405, 4405, 4406, 4107, 4107, 4107, 4407, 4407,
-     4107, 4107, 4107, 4408, 4107, 4107, 4107, 4107, 4107, 4107,
-     4409, 4107, 4107, 4107, 4410, 4410, 4107, 4107, 4107, 4411,
-     4107, 4107, 4107, 4412, 4412, 4412, 4412, 4413, 4414, 4414,
-     4414, 4107, 4107, 4107, 4107, 4107, 4414, 4414, 4414, 4414,
-
-     4414, 4414, 4414, 4414, 4414, 4414, 4415, 4416, 4417, 4417,
-     4107, 4107, 4417, 4417, 4417, 4418, 4107, 4107, 4107, 4419,
-     4107, 4107, 4420, 4421, 4421, 4421, 4421, 4422, 4423, 4424,
-     4425, 4426, 4107, 4107, 4427, 4428, 4429, 4429, 4429, 4429,
-     4107, 4107, 4107, 4429, 4429, 4430, 4107, 4431, 4432, 4107,
-     4107, 4107, 4107, 4433, 4107, 4107, 4433, 4433, 4433, 4434,
-     4435, 4436, 4437, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4437, 4107, 4107, 4437, 4438, 4107, 4107, 4107, 4107,
-     4107, 4107, 4439, 4440, 4441, 4442, 4443, 4443, 4443, 4444,
-     4445, 4445, 4107, 4107, 4446, 4107, 4107, 4107, 4447, 4107,
-
-     4448, 4449, 4107, 4107, 4449, 4450, 4451, 4452, 4107, 4107,
-     4107, 4453, 4453, 4107, 4107, 4107, 4453, 4454, 4455, 4456,
-     4456, 4107, 4456, 4107, 4107, 4457, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4458, 4458, 4458, 4459, 4107, 4460, 4107, 4107, 4107,
-     4460, 4460, 4460, 4461, 4107, 4107, 4107, 4462, 4463, 4463,
-     4464, 4465, 4465, 4466, 4467, 4468, 4468, 4469, 4470, 4470,
-
-     4107, 4107, 4470, 4471, 4107, 4107, 4472, 4472, 4107, 4107,
-     4107, 4472, 4472, 4472, 4472, 4472, 4472, 4107, 4107, 4472,
-     4472, 4472, 4473, 4474, 4475, 4475, 4107, 4107, 4107, 4475,
-     4107, 4107, 4475, 4475, 4476, 4107, 4107, 4107, 4107, 4477,
-     4107, 4107, 4107, 4478, 4479, 4479, 4479, 4479, 4480, 4481,
-     4482, 4107, 4107, 4483, 4107, 4107, 4107, 4484, 4485, 4486,
-     4107, 4107, 4486, 4486, 4107, 4107, 4486, 4486, 4487, 4107,
-     4488, 4489, 4107, 4107, 4107, 4107, 4490, 4107, 4107, 4107,
-     4490, 4490, 4490, 4491, 4107, 4107, 4492, 4493, 4107, 4107,
-     4107, 4493, 4107, 4107, 4107, 4493, 4494, 4495, 4496, 4497,
-
-     4498, 4499, 4499, 4499, 4500, 4501, 4107, 4107, 4107, 4107,
-     4107, 4502, 4107, 4107, 4107, 4107, 4503, 4107, 4504, 4505,
-     4107, 4107, 4107, 4107, 4107, 4506, 4507, 4508, 4509, 4509,
-     4509, 4510, 4511, 4512, 4512, 4107, 4513, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4514, 4515,
-     4107, 4516, 4516, 4516, 4516, 4517, 4107, 4107, 4107, 4107,
-     4518, 4519, 4519, 4520, 4107, 4107, 4107, 4107, 4521, 4522,
-
-     4107, 4107, 4107, 4107, 4523, 4107, 4107, 4524, 4107, 4107,
-     4107, 4107, 4107, 4525, 4107, 4107, 4107, 4107, 4107, 4526,
-     4526, 4526, 4107, 4107, 4526, 4526, 4526, 4107, 4107, 4107,
-     4107, 4107, 4526, 4526, 4527, 4528, 4529, 4529, 4107, 4107,
-     4107, 4107, 4107, 4529, 4529, 4107, 4107, 4107, 4530, 4531,
-     4532, 4532, 4532, 4532, 4107, 4107, 4533, 4534, 4107, 4107,
-     4107, 4535, 4536, 4537, 4538, 4107, 4107, 4107, 4107, 4107,
-     4538, 4107, 4107, 4107, 4538, 4538, 4107, 4107, 4107, 4539,
-     4540, 4107, 4107, 4107, 4107, 4541, 4541, 4541, 4541, 4542,
-     4107, 4107, 4107, 4107, 4107, 4543, 4543, 4543, 4544, 4545,
-
-     4546, 4547, 4548, 4107, 4107, 4549, 4107, 4107, 4550, 4551,
-     4107, 4107, 4107, 4552, 4107, 4553, 4107, 4554, 4555, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4556, 4557, 4107, 4107, 4107, 4107, 4107, 4107, 4558, 4559,
-     4560, 4561, 4561, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4562, 4563, 4107, 4564, 4564, 4564,
-     4564, 4107, 4107, 4107, 4565, 4566, 4107, 4107, 4567, 4107,
-
-     4107, 4107, 4107, 4107, 4107, 4568, 4569, 4107, 4107, 4107,
-     4107, 4107, 4107, 4570, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4571, 4107, 4107, 4107, 4572, 4572, 4572, 4107,
-     4107, 4107, 4107, 4107, 4572, 4572, 4107, 4107, 4107, 4572,
-     4572, 4573, 4574, 4575, 4575, 4107, 4107, 4107, 4575, 4575,
-     4576, 4577, 4578, 4107, 4107, 4578, 4578, 4578, 4579, 4580,
-     4581, 4582, 4107, 4107, 4583, 4107, 4107, 4107, 4583, 4583,
-     4583, 4107, 4107, 4107, 4584, 4107, 4107, 4107, 4585, 4585,
-     4585, 4585, 4586, 4587, 4107, 4107, 4587, 4588, 4589, 4107,
-     4107, 4590, 4591, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4107, 4592, 4107, 4107, 4593, 4107, 4594, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4595, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4596, 4597, 4598, 4599, 4599, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4600, 4601, 4107, 4107, 4107, 4602, 4602, 4602, 4107, 4603,
-     4604, 4107, 4107, 4107, 4605, 4606, 4607, 4608, 4107, 4107,
-     4107, 4609, 4610, 4610, 4610, 4107, 4107, 4107, 4610, 4610,
-
-     4610, 4107, 4107, 4611, 4107, 4107, 4612, 4612, 4612, 4612,
-     4613, 4614, 4615, 4107, 4107, 4107, 4615, 4615, 4615, 4616,
-     4617, 4618, 4619, 4620, 4620, 4620, 4620, 4107, 4107, 4107,
-     4107, 4621, 4107, 4107, 4107, 4622, 4622, 4622, 4623, 4624,
-     4107, 4107, 4107, 4624, 4107, 4107, 4625, 4626, 4107, 4107,
-     4107, 4107, 4107, 4627, 4107, 4107, 4107, 4628, 4107, 4629,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4630, 4107, 4107, 4107, 4631, 4632,
-     4633, 4634, 4634, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4635, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4636, 4636, 4107, 4637, 4107, 4107, 4638, 4639,
-     4640, 4641, 4107, 4107, 4642, 4642, 4642, 4642, 4107, 4107,
-     4642, 4642, 4107, 4107, 4107, 4107, 4107, 4643, 4643, 4643,
-     4643, 4644, 4107, 4107, 4107, 4107, 4645, 4645, 4645, 4645,
-     4107, 4107, 4646, 4647, 4107, 4107, 4648, 4648, 4648, 4648,
-     4107, 4649, 4107, 4107, 4107, 4107, 4107, 4650, 4650, 4107,
-     4107, 4107, 4107, 4651, 4652, 4653, 4107, 4107, 4628, 4107,
-     4629, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4107, 4630, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4631, 4632, 4633, 4634, 4634, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4635, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4639,
-     4640, 4641, 4642, 4642, 4642, 4642, 4107, 4107, 4107, 4642,
-     4642, 4107, 4107, 4107, 4107, 4107, 4107, 4643, 4643, 4107,
-     4107, 4107, 4107, 4644, 4107, 4107, 4107, 4645, 4645, 4645,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4647, 4107, 4107,
-
-     4107, 4648, 4648, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4651,
-     4652, 4653, 4628, 4107, 4629, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4630, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4631, 4632,
-     4633, 4634, 4634, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4639, 4640, 4641, 4642, 4642, 4107,
-     4107, 4642, 4642, 4642, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4107, 4107, 4643, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4645, 4645, 4645, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4647, 4648, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4651, 4107, 4107,
-     4107, 4107, 4628, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4630, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4633, 4634, 4634, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4639, 4640, 4641, 4642, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4642, 4642, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4643, 4107, 4107, 4107,
-     4645, 4107, 4107, 4645, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4648, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4651, 4107,
-     4107, 4107, 4107, 4107, 4107, 4628, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4630, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4107, 4107, 4107, 4633, 4634, 4634, 4634, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4639,
-     4107, 4107, 4641, 4642, 4107, 4107, 4107, 4107, 4107, 4107,
-     4642, 4642, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4643, 4645, 4107, 4107, 4107, 4645, 4107, 4107, 4107, 4107,
-     4107, 4107, 4648, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4628, 4107, 4107, 4107, 4107,
-
-     4107, 4107, 4107, 4107, 4630, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4633, 4634, 4634, 4634, 4654,
-     4655, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4639, 4641, 4642,
-     4107, 4107, 4642, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4643, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4648, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4630, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4633,
-     4634, 4656, 4657, 4654, 4655, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4641, 4642, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4643, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4648, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4633, 4656, 4634, 4658, 4657, 4659,
-     4634, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4641, 4642, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4643, 4107, 4107, 4107, 4107, 4648,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4633, 4658, 4107, 4659, 4634, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4633, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4633, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4633, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4107, 4633, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4633, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4633, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4633, 4107, 4107, 4107,
-
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4633, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4633, 4633, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4633, 4633, 4107, 4107, 4107, 4107, 4633, 4633,
-     4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633,
-     4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633,
-     4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633,
-     4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633,
-     4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633,
-
-     4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633,
-     4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633,
-     4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633,
-     4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633,
-     4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633,
-     4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633,
-     4633, 4633, 4633, 4633, 4633, 4633, 4633, 4107, 4633, 4633,
-     4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633,
-     4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633,
-     4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633,
-
-     4633, 4633, 4633, 4633, 4633, 4107,    0, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107
+     4193, 4193, 4194, 4194, 4194, 4194, 4195, 4195, 4196, 4196,
+     4197, 4197, 4198, 4198, 4198, 4198, 4199, 4199, 4200, 4200,
+     4201, 4201, 4201, 4201, 4193, 4193, 4201, 4201, 4201, 4201,
+     4193, 4193, 4201, 4201, 4201, 4201, 4193, 4193, 4201, 4201,
+     4193, 4193, 4201, 4201, 4201, 4201, 4193, 4193, 4201, 4201,
+     4193, 4193, 4201, 4201, 4201, 4201, 4202, 4202, 4203, 4203,
+     4193, 4193, 4203, 4203, 4203, 4203, 4204, 4204, 4205, 4205,
+     4193, 4193, 4205, 4205, 4205, 4205, 4206, 4206, 4207, 4207,
+     4208, 4208, 4209, 4209, 4210, 4210, 4211, 4211, 4193, 4193,
+     4211, 4211, 4211, 4211, 4212, 4212, 4213, 4213, 4193, 4193,
+
+     4213, 4213, 4213, 4213, 4214, 4214, 4215, 4215, 4193, 4193,
+     4215, 4215, 4215, 4215, 4216, 4216, 4217, 4217, 4218, 4218,
+     4219, 4219, 4193, 4193, 4219, 4219, 4219, 4219, 4220, 4220,
+     4221, 4221, 4193, 4193, 4221, 4221, 4221, 4221, 4222, 4222,
+     4223, 4223, 4193, 4193, 4223, 4223, 4223, 4223, 4224, 4224,
+     4225, 4225, 4193, 4193, 4225, 4225, 4225, 4225, 4226, 4226,
+     4227, 4227, 4228, 4228, 4229, 4229, 4193, 4193, 4229, 4229,
+     4229, 4229, 4230, 4230, 4231, 4231, 4193, 4193, 4231, 4231,
+     4231, 4231, 4232, 4232, 4233, 4233, 4234, 4234, 4235, 4235,
+     4236, 4236, 4237, 4237, 4238, 4238, 4239, 4239, 4193, 4193,
+
+     4240, 4240, 4241, 4241, 4241, 4241, 4193, 4193, 4241, 4241,
+     4241, 4241, 4193, 4193, 4241, 4241, 4193, 4193, 4241, 4241,
+     4241, 4241, 4242, 4242, 4243, 4243, 4193, 4193, 4243, 4243,
+     4243, 4243, 4244, 4244, 4245, 4245, 4246, 4246, 4247, 4247,
+     4248, 4248, 4249, 4249, 4193, 4193, 4249, 4249, 4249, 4249,
+     4250, 4250, 4251, 4251, 4252, 4252, 4253, 4253, 4193, 4193,
+     4253, 4253, 4253, 4253, 4254, 4254, 4255, 4255, 4193, 4193,
+     4255, 4255, 4255, 4255, 4256, 4256, 4257, 4257, 4258, 4258,
+     4259, 4259, 4260, 4260, 4261, 4261, 4261, 4261, 4193, 4193,
+     4261, 4261, 4261, 4261, 4193, 4193, 4261, 4261, 4261, 4261,
+
+     4193, 4193, 4261, 4261, 4193, 4193, 4261, 4261, 4261, 4261,
+     4193, 4193, 4261, 4261, 4193, 4193, 4261, 4261, 4261, 4261,
+     4262, 4262, 4263, 4263, 4193, 4193, 4263, 4263, 4263, 4263,
+     4193, 4193, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4264, 4192, 4192, 4264, 4264, 4192, 4192, 4192,
+      370, 4192,  372,  372,  374,  372,  373,  372,  373,  374,
+      380,  379,  372, 4192, 4192, 4192, 4265, 4192, 4192, 4265,
+     4265, 4265, 4192, 4192,  372,  372,  372, 4192, 4192, 4192,
+
+     4266, 4192, 4192, 4266, 4266, 4266, 4266, 4266, 4192, 4192,
+      372,  372,  372, 4192, 4192, 4192, 4267, 4192, 4192, 4267,
+     4192, 4192, 4192, 4192, 4192, 4192, 4268, 4192, 4192, 4268,
+     4268, 4268, 4192, 4192, 4192, 4192, 4192, 4192, 4269, 4192,
+     4192, 4269, 4269, 4269, 4192, 4192,  372,  372, 4192, 4192,
+     4192, 4270, 4192, 4192, 4270, 4270, 4192, 4192,  372,  372,
+     4192, 4192, 4192, 4271, 4192, 4192, 4271, 4271, 4271, 4192,
+     4192,  372,  372, 4192, 4192, 4192, 4272, 4192, 4192, 4272,
+     4272, 4272, 4272, 4272, 4272, 4192, 4192, 4192, 4192, 4192,
+     4192, 4273, 4192, 4192, 4273, 4273, 4273, 4273, 4273, 4273,
+
+     4273, 4273, 4192, 4192,  372,  372, 4192, 4192, 4192, 4274,
+     4192, 4192, 4274, 4192, 4192,  372,  372, 4192, 4192, 4192,
+     4275, 4192, 4192, 4275, 4275, 4275, 4192, 4192,  372,  372,
+     4192, 4192, 4192, 4276, 4192, 4192, 4276, 4276, 4276, 4276,
+     4276, 4192, 4192,  372,  372,  372, 4192, 4192, 4192, 4277,
+     4192, 4192, 4277, 4277, 4277, 4192, 4192, 4192, 4192, 4192,
+     4192, 4278, 4192, 4192, 4278, 4192, 4192,  374,  374,  372,
+     4192, 4192, 4192, 4279, 4192, 4192, 4279, 4279, 4279, 4279,
+     4192, 4192,  372,  372, 4192, 4192, 4192, 4280, 4192, 4192,
+     4280, 4280, 4192, 4192, 4192, 4192, 4192, 4192, 4281, 4192,
+
+     4192, 4281, 4281, 4192, 4192, 4192, 4192, 4192, 4192, 4282,
+     4192, 4192, 4282, 4282, 4192, 4192, 4192, 4192, 4192, 4192,
+     4283, 4192, 4192, 4283, 4283, 4283, 4283, 4283, 4283, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4284, 4192, 4192, 4284,
+     4192, 4192,  374,  643,  372,  372,  372,  372, 4192, 4192,
+     4192, 4285, 4192, 4192, 4285, 4285, 4285, 4285, 4285, 4192,
+     4192,  372,  372, 4192, 4192, 4192, 4286, 4192, 4192, 4286,
+     4286, 4192, 4192, 4192, 4192, 4192, 4192, 4287, 4192, 4192,
+     4287, 4287, 4287, 4287, 4287, 4192, 4192, 4192, 4192, 4192,
+     4192, 4288, 4192, 4192, 4288, 4288, 4192, 4192,  372,  372,
+
+     4192, 4192, 4192, 4289, 4192, 4192, 4289, 4289, 4192, 4192,
+     4192, 4192, 4192, 4192, 4290, 4192, 4192, 4290, 4290, 4290,
+     4290, 4192, 4192,  372,  372, 4192, 4192, 4192, 4291, 4192,
+     4192, 4291, 4291, 4291, 4291, 4192, 4192,  372,  372,  372,
+     4192, 4192, 4192, 4292, 4192, 4192, 4292, 4292, 4292, 4192,
+     4192, 4192, 4192, 4192, 4293, 4192, 4192, 4293, 4293, 4293,
+     4192, 4192, 4192, 4192, 4192, 4192, 4294, 4192, 4192, 4294,
+     4294, 4192, 4192,  374,  774,  372,  374,  374,  372,  776,
+      774,  372, 4192, 4192, 4192, 4295, 4192, 4192, 4295, 4295,
+     4295, 4192, 4192,  372,  372, 4192, 4296, 4192, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4297, 4297, 4297, 4298, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4299, 4299, 4299, 4299, 4299,
+     4300, 4192, 4192, 4301, 4301, 4301, 4301, 4301, 4301, 4302,
+     4192, 4192, 4303, 4303, 4304, 4192, 4305, 4305, 4305, 4305,
+     4306, 4192, 4307, 4307, 4307, 4307, 4308, 4192, 4309, 4309,
+     4309, 4310, 4192, 4311, 4311, 4311, 4311, 4312, 4192, 4313,
+
+     4313, 4313, 4313, 4313, 4313, 4313, 4313, 4314, 4192, 4315,
+     4315, 4315, 4315, 4315, 4315, 4315, 4315, 4315, 4315, 4315,
+     4315, 4315, 4315, 4315, 4316, 4192, 4317, 4317, 4318, 4192,
+     4319, 4319, 4319, 4319, 4320, 4192, 4321, 4321, 4321, 4321,
+     4321, 4321, 4321, 4322, 4192, 4192, 4192, 4323, 4323, 4323,
+     4323, 4324, 4192, 4325, 4325, 4326, 4192, 4327, 4327, 4327,
+     4327, 4327, 4327, 4328, 4192, 4329, 4329, 4329, 4330, 4192,
+     4331, 4331, 4331, 4332, 4192, 4333, 4333, 4333, 4334, 4192,
+     4335, 4335, 4335, 4335, 4335, 4335, 4335, 4335, 4336, 4192,
+     4192, 4337, 4337, 4338, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4339, 4339, 4339, 4339, 4339, 4339, 4340, 4192, 4341,
+     4341, 4341, 4342, 4192, 4343, 4343, 4343, 4343, 4343, 4343,
+     4343, 4343, 4343, 4344, 4192, 4345, 4345, 4345, 4345, 4346,
+     4192, 4347, 4347, 4347, 4348, 4192, 4349, 4349, 4349, 4349,
+     4349, 4350, 4192, 4351, 4351, 4351, 4351, 4351, 4352, 4192,
+     4192, 4353, 4353, 4353, 4353, 4192, 4354, 4192, 4192, 4355,
+     4355, 4355, 4355, 4356, 4192, 4357, 4357, 4357, 4358, 4192,
+     4192, 4359, 4359, 4359, 4359, 4359, 4360, 4361, 4192, 4361,
+     4192, 4192, 4192, 4362, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4363, 4364, 4364, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4365, 4365,
+     4365, 4365, 4366, 4366, 4192, 4367, 4367, 4367, 4367, 4367,
+     4368, 4368, 4192, 4369, 4370, 4370, 4371, 4192, 4192, 4371,
+     4372, 4372, 4373, 4373, 4373, 4374, 4374, 4375, 4375, 4376,
+     4376, 4377, 4377, 4377, 4378, 4378, 4192, 4192, 4192, 4192,
+     4379, 4379, 4379, 4379, 4379, 4380, 4380, 4381, 4192, 4192,
+     4381, 4192, 4192, 4381, 4381, 4381, 4381, 4381, 4381, 4381,
+
+     4381, 4381, 4381, 4382, 4382, 4192, 4192, 4383, 4383, 4192,
+     4192, 4384, 4384, 4385, 4385, 4386, 4386, 4386, 4192, 4192,
+     4386, 4386, 4386, 4387, 4387, 4192, 4192, 4388, 4192, 4192,
+     4192, 4192, 4389, 4389, 4390, 4391, 4391, 4392, 4192, 4192,
+     4392, 4392, 4392, 4393, 4393, 4394, 4192, 4192, 4395, 4395,
+     4192, 4192, 4396, 4397, 4397, 4398, 4398, 4399, 4399, 4400,
+     4400, 4400, 4192, 4192, 4400, 4400, 4400, 4401, 4401, 4192,
+     4402, 4403, 4403, 4192, 4192, 4192, 4192, 4404, 4404, 4404,
+     4404, 4404, 4405, 4405, 4192, 4192, 4406, 4407, 4407, 4408,
+     4192, 4192, 4408, 4408, 4408, 4408, 4408, 4408, 4409, 4409,
+
+     4410, 4410, 4410, 4411, 4411, 4412, 4192, 4192, 4413, 4413,
+     4414, 4414, 4192, 4192, 4414, 4415, 4415, 4416, 4192, 4192,
+     4416, 4416, 4417, 4417, 4192, 4418, 4192, 4192, 4418, 4192,
+     4419, 4419, 4192, 4420, 4420, 4420, 4421, 4421, 4192, 4192,
+     4422, 4423, 4423, 4424, 4424, 4424, 4424, 4425, 4425, 4426,
+     4192, 4192, 4426, 4192, 4192, 4427, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4428, 4192, 4429, 4192, 4429, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4430, 4430, 4192, 4192, 4430,
+     4192, 4431, 4192, 4431, 4192, 4432, 4432, 4432, 4432, 4432,
+     4192, 4433, 4192, 4433, 4192, 4434, 4192, 4435, 4192, 4435,
+     4436, 4192, 4192, 4192, 4436, 4192, 4437, 4192, 4437, 4192,
+     4192, 4438, 4438, 4192, 4192, 4192, 4439, 4192, 4439, 4192,
+     4192, 4192, 4192, 4192, 4440, 4192, 4440, 4192, 4192, 4441,
+     4441, 4192, 4192, 4192, 4442, 4192, 4442, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4443, 4443, 4443, 4443, 4192,
+     4444, 4192, 4444, 4445, 4445, 4445, 4192, 4192, 4192, 4445,
+
+     4192, 4192, 4192, 4192, 4192, 4445, 4445, 4445, 4445, 4445,
+     4445, 4445, 4445, 4445, 4192, 4446, 4192, 4446, 4192, 4192,
+     4192, 4192, 4447, 4192, 4447, 4192, 4192, 4192, 4448, 4448,
+     4192, 4449, 4192, 4449, 4450, 4450, 4450, 4192, 4192, 4192,
+     4450, 4450, 4450, 4192, 4451, 4192, 4451, 4192, 4192, 4452,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4453, 4192, 4453,
+     4454, 4192, 4455, 4192, 4455, 4456, 4192, 4192, 4192, 4456,
+     4456, 4456, 4192, 4457, 4192, 4457, 4458, 4192, 4192, 4192,
+     4192, 4459, 4192, 4459, 4192, 4192, 4192, 4460, 4192, 4461,
+     4192, 4461, 4462, 4462, 4192, 4463, 4192, 4463, 4464, 4464,
+
+     4464, 4464, 4192, 4192, 4192, 4192, 4192, 4464, 4464, 4192,
+     4465, 4192, 4465, 4192, 4466, 4192, 4467, 4192, 4467, 4192,
+     4192, 4192, 4192, 4468, 4468, 4468, 4468, 4468, 4192, 4469,
+     4192, 4469, 4192, 4192, 4192, 4470, 4192, 4471, 4192, 4471,
+     4472, 4192, 4192, 4192, 4192, 4192, 4472, 4192, 4192, 4472,
+     4472, 4472, 4192, 4473, 4192, 4473, 4192, 4192, 4192, 4192,
+     4474, 4192, 4475, 4192, 4475, 4476, 4192, 4192, 4192, 4192,
+     4477, 4192, 4477, 4478, 4478, 4192, 4192, 4192, 4478, 4192,
+     4479, 4192, 4479, 4480, 4192, 4192, 4192, 4480, 4480, 4192,
+     4481, 4192, 4481, 4192, 4482, 4192, 4192, 4192, 4482, 4192,
+
+     4192, 4483, 4192, 4483, 4484, 4484, 4484, 4192, 4485, 4192,
+     4485, 4192, 4192, 4192, 4486, 4192, 4487, 4192, 4487, 4192,
+     4192, 4488, 4488, 4192, 4192, 4488, 4192, 4489, 4192, 4489,
+     4490, 4491, 4192, 4192, 4192, 4192, 4492, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4493, 4493, 4192, 4192, 4192,
+     4493, 4494, 4192, 4495, 4192, 4192, 4495, 4495, 4495, 4496,
+
+     4192, 4497, 4498, 4499, 4499, 4500, 4192, 4192, 4192, 4501,
+     4501, 4192, 4192, 4192, 4502, 4192, 4192, 4192, 4192, 4192,
+     4192, 4503, 4192, 4192, 4192, 4504, 4504, 4192, 4192, 4192,
+     4505, 4192, 4192, 4192, 4506, 4506, 4506, 4506, 4507, 4508,
+     4508, 4508, 4192, 4192, 4192, 4192, 4192, 4508, 4508, 4508,
+     4508, 4508, 4508, 4508, 4508, 4508, 4508, 4509, 4510, 4511,
+     4511, 4512, 4513, 4513, 4192, 4192, 4513, 4513, 4513, 4514,
+     4192, 4192, 4192, 4192, 4515, 4192, 4192, 4516, 4517, 4517,
+     4517, 4517, 4518, 4519, 4520, 4521, 4522, 4192, 4192, 4523,
+     4524, 4525, 4525, 4525, 4525, 4192, 4192, 4192, 4525, 4525,
+
+     4526, 4192, 4527, 4528, 4192, 4192, 4192, 4192, 4529, 4192,
+     4192, 4529, 4529, 4529, 4530, 4531, 4532, 4533, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4533, 4192, 4192, 4533,
+     4534, 4192, 4192, 4192, 4192, 4192, 4192, 4535, 4536, 4537,
+     4538, 4539, 4539, 4539, 4540, 4541, 4541, 4192, 4192, 4542,
+     4192, 4192, 4192, 4543, 4192, 4544, 4545, 4192, 4192, 4545,
+     4546, 4547, 4548, 4192, 4192, 4192, 4549, 4549, 4192, 4192,
+     4192, 4549, 4550, 4551, 4552, 4552, 4192, 4552, 4192, 4192,
+     4553, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4554, 4554, 4554,
+     4555, 4192, 4556, 4192, 4192, 4192, 4556, 4556, 4556, 4557,
+     4192, 4192, 4192, 4558, 4559, 4559, 4560, 4561, 4561, 4562,
+     4563, 4564, 4564, 4565, 4566, 4566, 4192, 4192, 4566, 4567,
+     4192, 4192, 4568, 4568, 4192, 4192, 4192, 4568, 4568, 4568,
+     4568, 4568, 4568, 4192, 4192, 4568, 4568, 4568, 4569, 4570,
+     4571, 4571, 4572, 4573, 4573, 4192, 4192, 4192, 4573, 4192,
+     4192, 4573, 4573, 4574, 4192, 4192, 4192, 4192, 4192, 4575,
+
+     4192, 4192, 4192, 4576, 4577, 4577, 4577, 4577, 4578, 4579,
+     4580, 4192, 4192, 4581, 4192, 4192, 4192, 4582, 4583, 4584,
+     4192, 4192, 4584, 4584, 4192, 4192, 4584, 4584, 4585, 4192,
+     4586, 4587, 4192, 4192, 4192, 4192, 4588, 4192, 4192, 4192,
+     4588, 4588, 4588, 4589, 4192, 4192, 4590, 4591, 4192, 4192,
+     4192, 4591, 4192, 4192, 4192, 4591, 4592, 4593, 4594, 4595,
+     4596, 4597, 4597, 4597, 4598, 4599, 4192, 4192, 4192, 4192,
+     4192, 4600, 4192, 4192, 4192, 4192, 4601, 4192, 4602, 4603,
+     4192, 4192, 4192, 4192, 4192, 4604, 4605, 4606, 4607, 4607,
+     4607, 4608, 4609, 4610, 4610, 4192, 4611, 4192, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4612, 4613,
+     4192, 4614, 4614, 4614, 4614, 4615, 4192, 4192, 4192, 4192,
+     4616, 4617, 4617, 4618, 4192, 4192, 4192, 4192, 4619, 4620,
+     4192, 4192, 4192, 4192, 4621, 4192, 4192, 4622, 4192, 4192,
+     4192, 4192, 4192, 4623, 4192, 4192, 4192, 4192, 4192, 4624,
+     4624, 4624, 4192, 4192, 4624, 4624, 4624, 4192, 4192, 4192,
+     4192, 4192, 4624, 4624, 4625, 4626, 4627, 4627, 4192, 4192,
+
+     4628, 4628, 4192, 4192, 4192, 4192, 4192, 4628, 4628, 4192,
+     4192, 4192, 4629, 4630, 4631, 4631, 4631, 4631, 4192, 4192,
+     4632, 4633, 4192, 4192, 4192, 4634, 4635, 4636, 4637, 4192,
+     4192, 4192, 4192, 4192, 4637, 4192, 4192, 4192, 4637, 4637,
+     4192, 4192, 4192, 4638, 4639, 4192, 4192, 4192, 4192, 4640,
+     4640, 4640, 4640, 4641, 4192, 4192, 4192, 4192, 4192, 4642,
+     4642, 4642, 4643, 4644, 4645, 4646, 4647, 4192, 4192, 4648,
+     4192, 4192, 4649, 4650, 4192, 4192, 4192, 4651, 4192, 4652,
+     4192, 4653, 4654, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4655, 4656, 4192, 4192, 4192, 4192,
+
+     4192, 4192, 4657, 4658, 4659, 4660, 4660, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4661, 4662,
+     4192, 4663, 4663, 4663, 4663, 4192, 4192, 4192, 4664, 4665,
+     4192, 4192, 4666, 4192, 4192, 4192, 4192, 4192, 4192, 4667,
+     4668, 4192, 4192, 4192, 4192, 4192, 4192, 4669, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4670, 4192, 4192, 4192,
+     4671, 4671, 4671, 4192, 4192, 4192, 4192, 4192, 4671, 4671,
+
+     4192, 4192, 4192, 4671, 4671, 4672, 4673, 4192, 4192, 4674,
+     4675, 4675, 4192, 4192, 4192, 4675, 4675, 4676, 4677, 4678,
+     4192, 4192, 4678, 4678, 4678, 4679, 4680, 4681, 4682, 4192,
+     4192, 4683, 4192, 4192, 4192, 4683, 4683, 4683, 4192, 4192,
+     4192, 4684, 4192, 4192, 4192, 4685, 4685, 4685, 4685, 4686,
+     4687, 4192, 4192, 4687, 4688, 4689, 4192, 4192, 4690, 4691,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4692, 4192,
+     4192, 4693, 4192, 4694, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4695,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4696, 4697,
+
+     4698, 4699, 4699, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4700, 4701, 4192,
+     4192, 4192, 4702, 4702, 4702, 4192, 4703, 4704, 4192, 4192,
+     4192, 4705, 4706, 4707, 4708, 4192, 4192, 4192, 4709, 4710,
+     4710, 4710, 4192, 4192, 4192, 4710, 4710, 4710, 4192, 4192,
+     4711, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4712, 4712,
+     4712, 4712, 4713, 4714, 4715, 4192, 4192, 4192, 4715, 4715,
+     4715, 4716, 4717, 4718, 4719, 4720, 4720, 4720, 4720, 4192,
+
+     4192, 4192, 4192, 4721, 4192, 4192, 4192, 4722, 4722, 4722,
+     4723, 4724, 4192, 4192, 4192, 4724, 4192, 4192, 4725, 4726,
+     4192, 4192, 4192, 4192, 4192, 4727, 4192, 4192, 4192, 4728,
+     4192, 4729, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4730, 4192, 4192, 4192,
+     4731, 4732, 4733, 4734, 4734, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4735, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4736, 4736, 4192, 4737, 4192, 4192,
+
+     4738, 4739, 4740, 4741, 4192, 4192, 4742, 4742, 4742, 4742,
+     4192, 4192, 4742, 4742, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4743, 4743, 4743, 4743, 4744, 4192, 4192, 4192,
+     4192, 4745, 4745, 4745, 4745, 4192, 4192, 4746, 4747, 4192,
+     4192, 4748, 4748, 4748, 4748, 4192, 4749, 4192, 4192, 4192,
+     4192, 4192, 4750, 4750, 4192, 4192, 4192, 4192, 4751, 4752,
+     4753, 4192, 4192, 4728, 4192, 4729, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4730, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4731, 4732, 4733,
+     4734, 4734, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4735,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4739, 4740, 4741, 4742, 4742, 4742,
+     4742, 4192, 4192, 4192, 4742, 4742, 4192, 4192, 4192, 4192,
+     4192, 4192, 4743, 4743, 4192, 4192, 4192, 4192, 4744, 4192,
+     4192, 4192, 4745, 4745, 4745, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4747, 4192, 4192, 4192, 4748, 4748, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4751, 4752, 4753, 4728, 4192, 4729,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4730, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4731, 4732, 4733, 4734, 4734, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4739,
+     4740, 4741, 4742, 4742, 4192, 4192, 4742, 4742, 4742, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4743, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4745, 4745,
+     4745, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4747, 4748, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4751, 4192, 4192, 4192, 4192, 4728, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4730, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4733, 4734,
+     4734, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4739, 4740, 4741, 4742, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4742, 4742, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4743, 4192, 4192, 4192, 4745, 4192, 4192, 4745, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4748, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4751, 4192, 4192, 4192, 4192, 4192, 4192,
+     4728, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4730, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4733, 4734,
+     4734, 4734, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4739, 4192, 4192, 4741, 4742, 4192,
+     4192, 4192, 4192, 4192, 4192, 4742, 4742, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4743, 4745, 4192, 4192, 4192,
+     4745, 4192, 4192, 4192, 4192, 4192, 4192, 4748, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4728, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4730,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4733, 4734, 4734, 4734, 4754, 4755, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4739, 4741, 4742, 4192, 4192, 4742, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4743, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4748, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4730, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4733, 4734, 4756, 4757, 4754, 4755,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4741, 4742, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4743, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4748, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4733,
+
+     4756, 4734, 4758, 4757, 4759, 4734, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4741, 4742, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4743,
+     4192, 4192, 4192, 4192, 4192, 4192, 4748, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4733, 4758, 4192,
+     4759, 4734, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4733, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4733, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4733, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4733, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4733, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4733, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4733, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4733, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4733, 4733, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4733, 4733, 4192,
+     4192, 4192, 4192, 4733, 4733, 4733, 4733, 4733, 4733, 4733,
+     4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733,
+     4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733,
+     4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733,
+     4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733,
+     4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733,
+     4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733,
+
+     4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733,
+     4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733,
+     4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733,
+     4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733,
+     4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733,
+     4733, 4733, 4192, 4733, 4733, 4733, 4733, 4733, 4733, 4733,
+     4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733,
+     4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733,
+     4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733, 4733,
+     4192,    0, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192
     } ;
 
-static const flex_int16_t yy_nxt[14182] =
+static const flex_int16_t yy_nxt[14559] =
     {   0,
-     4107,  326,  327,  326,  326,  327,  326,  326,  327,  326,
-      326,  327,  326,  331,  327,  331,  337,  328,  334,  337,
-      328,  334, 1048,  329, 4107,  335,  329,  846,  335,  332,
-      331,  327,  331,  774,  338,  340,  341,  338,  340,  341,
-      342,  343,  792,  342,  343,  774,  332,  347,  348,  775,
-      344,  340,  341,  344,  345,  777,  342,  340,  341, 1291,
-      345,  776,  342,  347,  348,  847,  344,  359,  327,  359,
-     1839,  776,  344,  359,  327,  359,  931,  359,  327,  359,
-      359,  327,  359,  360,  327,  327,  327,  792,  932,  360,
-      820,  777,  349,  361,  804,  820,  361,  773,  773,  773,
-
-      362,  773,  773,  773,  773,  773,  773,  776,  349,  350,
-      351,  327,  351,  350,  350,  350,  350,  350,  350,  350,
-      352,  350,  350,  350, 1840,  350,  354,  350,  355,  350,
-      327,  327,  327,  359,  327,  359,  359,  327,  359,  895,
-      820,  359,  327,  359,  804,  882,  362,  835,  777,  360,
-      883, 1844,  360,  896,  836,  350,  350,  363,  359,  327,
-      359,  773,  773,  773,  776,  837,  356,  773,  773,  773,
-      773,  773,  773, 1845,  363,  357,  350,  351,  327,  351,
-      350,  350,  350,  350,  350,  350,  350,  352,  350,  350,
-      350,  887,  350,  354,  350,  355,  350,  327,  327,  327,
-
-      327,  327,  327,  359,  327,  359,  340,  341,  359,  327,
-      359,  342,  888,  364,  838,  837,  364,  796,  820,  365,
-     1847,  727,  350,  350,  365,  359,  327,  359,  359,  327,
-      359, 1848,  814,  356,  327,  327,  327,  327,  327,  327,
-     1054,  366,  357, 1055,  366,  359,  327,  359,  838, 1850,
-      367,  728,  820,  367,  359,  327,  359,  327,  327,  327,
-     1851,  363,  327,  327,  327,  359,  327,  359,  820,  808,
-      363, 1853,  777,  368,  359,  327,  359, 1179,  368,  812,
-     1180,  366,  359,  327,  359,  359,  327,  359,  776,  792,
-      366,  327,  327,  327,  327,  327,  327, 1854,  369,  793,
-
-      807,  369,  359,  327,  359, 1857,  914,  370,  977,  777,
-      370,  359,  327,  359,  327,  327,  327, 1343,  371,  327,
-      327,  327,  359,  327,  359,  776, 1858,  371,  825,  826,
-      372,  359,  327,  359, 1344,  372,  846, 1343,  369,  359,
-      327,  359,  359,  327,  359,  827,  847,  369,  773,  773,
-      773, 1018,  805,  817, 1499,  373,  915, 1859,  373,  374,
-      375,  327,  375,  374,  374,  374,  374,  374,  374,  374,
-      376,  374,  374,  374,  777,  374,  378,  374,  379,  374,
-      384,  327,  384,  384,  327,  384,  327,  327,  327,  820,
-      776,  327,  327,  327,  912, 1644,  385,  777,  913,  385,
-
-     1861, 1019,  386,  792,  851,  374,  374,  386,  384,  327,
-      384,  380, 1344,  776,  381,  773,  773,  773,  773,  773,
-      773,  773,  773,  773,  385, 1863,  382,  374,  375,  327,
-      375,  374,  374,  374,  374,  374,  374,  374,  376,  374,
-      374,  374,  830,  374,  378,  374,  379,  374,  384,  327,
-      384,  384,  327,  384,  384,  327,  384, 1070,  802,  400,
-      327,  400,  956, 1872,  385,  777,  957,  387, 1071, 1068,
-      387, 1072,  857,  374,  374,  401,  400,  327,  400,  380,
-      863,  776,  381,  773,  773,  773,  773,  773,  773,  773,
-      773,  773,  401, 1069,  382,  388,  389,  327,  389,  388,
-
-      388,  388,  388,  388,  388,  388,  390,  388,  388,  388,
-      777,  388,  392,  388,  393,  388,  327,  327,  327,  327,
-      327,  327,  400,  327,  400,  868,  776,  400,  327,  400,
-     1550,  777,  402,  820,  777,  402, 1551,  777,  401, 1875,
-      874,  388,  388,  401,  400,  327,  400,  776, 1705,  394,
-      776,  395,  863,  776,  396,  773,  773,  773,  397, 1883,
-      403, 1706,  398,  388,  389,  327,  389,  388,  388,  388,
-      388,  388,  388,  388,  390,  388,  388,  388,  820,  388,
-      392,  388,  393,  388,  400,  327,  400,  412,  327,  412,
-      412,  327,  412,  820,  891,  424,  327,  424, 1885,  777,
-
-      403,  838,  892,  413, 1080,  820,  413, 1080,  893,  388,
-      388,  425,  424,  327,  424,  776, 1705,  394, 1081,  395,
-      868, 1095,  396,  773,  773,  773,  397,  925,  425, 1712,
-      398,  404,  405,  327,  405,  404,  404,  404,  404,  404,
-      404,  404,  406,  404,  404,  404,  964,  404,  408,  404,
-      409,  404,  436,  327,  436,  436,  327,  436,  327,  327,
-      327,  969,  897,  327,  327,  327,  808, 1887,  437,  838,
-      898,  437, 1888,  820,  386,  899,  812,  404,  404,  386,
-      436,  327,  436,  436,  327,  436,  773,  773,  773,  773,
-      773,  773,  773,  773,  773, 1889,  437, 1891, 1892,  437,
-
-     1896,  410,  404,  405,  327,  405,  404,  404,  404,  404,
-      404,  404,  404,  406,  404,  404,  404,  777,  404,  408,
-      404,  409,  404,  436,  327,  436,  436,  327,  436,  448,
-      327,  448, 1089,  776,  448,  327,  448,  997, 1900,  438,
-     1902, 1905,  438, 1090,  998,  449, 1072,  777,  404,  404,
-      449,  327,  327,  327,  327,  327,  327,  773,  773,  773,
-      773,  773,  773,  776, 1044,  874, 1907,  386,  782, 1912,
-      386, 1045,  410,  414,  415,  327,  415,  414,  414,  414,
-      414,  414,  414,  414,  416,  414,  414,  414,  777,  414,
-      418,  414,  419,  414,  448,  327,  448,  448,  327,  448,
-
-      448,  327,  448, 1913,  776,  448,  327,  448, 1087, 1917,
-      449,  783,  901,  449,  838,  777,  450,  784,  820,  414,
-      414,  450,  785,  420,  773,  773,  773,  786, 1924, 1925,
-      421,  776, 1088,  422,  414,  415,  327,  415,  414,  414,
-      414,  414,  414,  414,  414,  416,  414,  414,  414,  991,
-      414,  418,  414,  419,  414,  461,  327,  461,  461,  327,
-      461,  327,  327,  327,  992,  820,  327,  327,  327,  777,
-     1926,  462,  905,  914,  462, 1048,  884,  386,  925, 1080,
-      414,  414,  386,  933,  420,  776,  773,  773,  773, 1927,
-     1049,  421, 1928, 1105,  422,  426,  427,  327,  427,  426,
-
-      426,  426,  426,  426,  426,  426,  428,  426,  426,  426,
-     1087,  426,  430,  426,  431,  426,  461,  327,  461,  461,
-      327,  461,  461,  327,  461,  820,  820,  461,  327,  461,
-     1929,  820,  462,  777, 1100,  462,  820, 1068,  463, 1930,
-      921,  426,  426,  463,  477,  327,  477,  432, 1931,  776,
-      433,  773,  773,  773,  773,  773,  773,  773,  773,  773,
-      478, 1088,  434,  426,  427,  327,  427,  426,  426,  426,
-      426,  426,  426,  426,  428,  426,  426,  426,  777,  426,
-      430,  426,  431,  426,  477,  327,  477,  494,  327,  494,
-      494,  327,  494, 1070,  776,  327,  327,  327, 1312, 1932,
-
-      478,  777, 1681,  495, 1090, 1068,  495, 1072,  963,  426,
-      426,  362,  327,  327,  327,  432,  977,  776,  433,  773,
-      773,  773,  773,  773,  773,  773,  773,  773,  362, 1100,
-      434,  439,  440,  327,  440,  439,  439,  439,  439,  439,
-      439,  439,  441,  439,  439,  439,  777,  439,  443,  439,
-      444,  439,  494,  327,  494,  494,  327,  494,  494,  327,
-      494,  820,  776,  494,  327,  494, 1933, 1934,  495,  820,
-     1937,  495, 1940, 1087,  496, 1941,  999,  439,  439,  496,
-      505,  327,  505,  445,  773,  773,  773,  773,  773,  773,
-      773,  773,  773,  773,  773,  773,  506, 1104,  446,  439,
-
-      440,  327,  440,  439,  439,  439,  439,  439,  439,  439,
-      441,  439,  439,  439,  777,  439,  443,  439,  444,  439,
-      505,  327,  505,  327,  327,  327,  327,  327,  327,  820,
-      776,  505,  327,  505, 1943, 1944,  506, 1946, 1947,  362,
-     1948, 1068,  362, 1949, 1011,  439,  439,  506,  505,  327,
-      505,  445,  773,  773,  773,  773,  773,  773,  773,  773,
-      773,  773,  773,  773,  506, 1104,  446,  451,  452,  327,
-      452,  451,  451,  451,  451,  451,  451,  451,  453,  451,
-      451,  451,  777,  451,  455,  451,  456,  451,  505,  327,
-      505,  505,  327,  505,  520,  327,  520,  820,  776,  520,
-
-      327,  520, 1953, 1954,  507,  777, 1080,  507, 1955, 1956,
-      521, 1957,  938,  451,  451,  521,  327,  327,  327,  457,
-     1106,  776,  458,  773,  773,  773,  773,  773,  773,  773,
-      773,  773,  522, 1960,  459,  451,  452,  327,  452,  451,
-      451,  451,  451,  451,  451,  451,  453,  451,  451,  451,
-      777,  451,  455,  451,  456,  451,  327,  327,  327,  520,
-      327,  520,  520,  327,  520, 1070,  776,  520,  327,  520,
-     1963, 1964,  522,  777, 1238,  521, 1071, 1965,  521, 1236,
-      943,  451,  451,  523,  520,  327,  520,  457, 1095,  776,
-      458,  773,  773,  773,  773,  773,  773,  773,  773,  773,
-
-      523, 1968,  459,  464,  465,  327,  465,  464,  464,  464,
-      464,  464,  464,  464,  466,  464,  464,  464,  777,  464,
-      468,  464,  469,  464,  534,  327,  534,  534,  327,  534,
-      544,  327,  544, 1018,  776,  544,  327,  544,  777,  777,
-      535,  777,  777,  535, 1969,  948,  545, 1970,  958,  464,
-      464,  545,  777,  470,  776,  776, 1038,  776,  776,  982,
-      471, 1971, 1046,  472,  773,  773,  773,  473,  776,  474,
-      475,  464,  465,  327,  465,  464,  464,  464,  464,  464,
-      464,  464,  466,  464,  464,  464,  820,  464,  468,  464,
-      469,  464,  327,  327,  327,  327,  327,  327,  544,  327,
-
-      544, 1972,  959,  544,  327,  544, 1973,  968,  546,  820,
-      777,  546, 1974,  777,  545,  820,  963,  464,  464,  545,
-      820,  470,  967,  773,  773,  773,  776, 1038,  471,  776,
-     1977,  472,  773,  773,  773,  473, 1981,  474,  475,  479,
-      480,  327,  480,  479,  479,  479,  479,  479,  479,  479,
-      481,  479,  479,  479,  964,  479,  483,  479,  484,  479,
-      544,  327,  544,  544,  327,  544,  559,  327,  559,  969,
-      987,  559,  327,  559,  988, 1312,  547, 1982,  989,  547,
-      820,  777,  560, 1066,  804,  479,  479,  560,  993,  485,
-      486,  773,  773,  773,  999, 1919,  487,  776, 1067,  488,
-
-      773,  773,  773,  489, 1983,  490,  491,  492,  479,  480,
-      327,  480,  479,  479,  479,  479,  479,  479,  479,  481,
-      479,  479,  479,  777,  479,  483,  479,  484,  479,  327,
-      327,  327,  327,  327,  327,  559,  327,  559, 1066,  776,
-      559,  327,  559,  838, 1985,  362, 1989,  820,  362, 1235,
-      777,  560, 1990, 1121,  479,  479,  560, 1004,  485,  486,
-      773,  773,  773, 1992, 1067,  487,  776, 1993,  488,  773,
-      773,  773,  489, 1996,  490,  491,  492,  497,  498,  327,
-      498,  497,  497,  497,  497,  497,  497,  497,  499,  497,
-      497,  497,  777,  497,  501,  497,  502,  497,  559,  327,
-
-      559,  559,  327,  559,  571,  327,  571, 1089,  776,  571,
-      327,  571, 1997, 1999,  561, 2000,  777,  561, 1090, 2003,
-      572, 1236, 2025,  497,  497,  572,  773,  773,  773,  773,
-      773,  773,  776, 2026,  503,  497,  498,  327,  498,  497,
-      497,  497,  497,  497,  497,  497,  499,  497,  497,  497,
-      777,  497,  501,  497,  502,  497,  582,  327,  582,  582,
-      327,  582,  593,  327,  593, 1089,  776,  593,  327,  593,
-     2030, 2034,  583, 2036,  777,  583, 1071, 2045,  594, 1072,
-     2046,  497,  497,  594,  773,  773,  773,  773,  773,  773,
-      776, 2047,  503,  508,  509,  327,  509,  508,  508,  508,
-
-      508,  508,  508,  508,  510,  508,  508,  508,  777,  508,
-      512,  508,  513,  508,  608,  327,  608,  608,  327,  608,
-      327,  327,  327, 1805,  776,  327,  327,  327, 2048, 2050,
-      609, 2058,  777,  609, 2060, 1806,  610, 2063, 2064,  508,
-      508,  610,  514, 1046,  515,  773,  773,  773,  776, 2068,
-      516,  773,  773,  773,  773,  773,  773,  517, 2070, 2071,
-      518,  508,  509,  327,  509,  508,  508,  508,  508,  508,
-      508,  508,  510,  508,  508,  508, 2073,  508,  512,  508,
-      513,  508,  619,  327,  619,  619,  327,  619,  619,  327,
-      619, 2074,  838,  619,  327,  619,  820, 2075,  620, 2076,
-
-     1312,  620, 2077, 2081,  621, 2082, 2083,  508,  508,  621,
-      514, 2088,  515,  773,  773,  773, 1314, 2092,  516,  773,
-      773,  773,  773,  773,  773,  517, 2096, 2098,  518,  524,
-      525,  327,  525,  524,  524,  524,  524,  524,  524,  524,
-      526,  524,  524,  524, 2100,  524,  528,  524,  529,  524,
-      327,  327,  327,  327,  327,  327,  619,  327,  619, 2102,
-     1852,  619,  327,  619, 2103, 2104,  622, 1025, 2106,  622,
-     2113, 2117,  620, 1712, 1026,  524,  524,  620,  619,  327,
-      619,  530, 2118,  776, 2120,  807,  531,  773,  773,  773,
-      773,  773,  773, 2127,  623,  773,  773,  773,  532,  524,
-
-      525,  327,  525,  524,  524,  524,  524,  524,  524,  524,
-      526,  524,  524,  524,  826,  524,  528,  524,  529,  524,
-      619,  327,  619,  327,  327,  327,  327,  327,  327, 2129,
-      827,  619,  327,  619, 2130, 2131,  623,  777,  817,  546,
-     1922, 2136,  546, 2137, 1033,  524,  524,  621,  619,  327,
-      619,  530, 2138,  776, 2140, 2141,  531,  773,  773,  773,
-      773,  773,  773, 2142,  621,  773,  773,  773,  532,  536,
-      537,  327,  537,  536,  536,  536,  536,  536,  536,  536,
-      538,  536,  536,  536, 2143,  536,  540,  536,  541,  536,
-      327,  327,  327,  327,  327,  327,  619,  327,  619, 2144,
-
-     1077,  619,  327,  619, 1454, 2145,  624, 1078, 2146,  624,
-     2147, 2148,  623, 1079, 1455,  536,  536,  623, 1052, 1052,
-     1052, 1456, 1316,  542,  536,  537,  327,  537,  536,  536,
-      536,  536,  536,  536,  536,  538,  536,  536,  536, 2149,
-      536,  540,  536,  541,  536,  619,  327,  619,  619,  327,
-      619,  638,  327,  638, 2151, 1077,  638,  327,  638, 2152,
-     2153,  625, 1078, 2156,  625, 2159, 2160,  639, 1085, 1312,
-      536,  536,  639, 1052, 1052, 1052, 2161, 2162,  542,  548,
-      549,  327,  549,  548,  548,  548,  548,  548,  548,  548,
-      550,  548,  548,  548, 2133,  548,  552,  548,  553,  548,
-
-      327,  327,  327,  327,  327,  327,  638,  327,  638, 2163,
-     1094,  638,  327,  638, 2164, 2165,  402, 1078, 2166,  402,
-     2169, 1094,  639, 1079, 1077,  548,  548,  639, 1078,  554,
-     2172, 1078, 2173, 1053, 1085, 2174,  555, 1237, 2181,  556,
-     2182, 1331, 1331, 1331, 2183, 2184,  557,  548,  549,  327,
-      549,  548,  548,  548,  548,  548,  548,  548,  550,  548,
-      548,  548, 2185,  548,  552,  548,  553,  548,  638,  327,
-      638,  638,  327,  638,  650,  327,  650, 2187, 1094,  650,
-      327,  650, 2192, 2193,  640, 1078, 2237,  640, 2238, 2244,
-      651, 1237, 2245,  548,  548,  651, 2251,  554, 1323, 1323,
-
-     1323, 2252, 1324, 2253,  555, 1325, 1332,  556, 1331, 1331,
-     1331, 1354, 1354, 1354,  557,  562,  563,  327,  563,  562,
-      562,  562,  562,  562,  562,  562,  564,  562,  562,  562,
-     2254,  562,  566,  562,  567,  562,  664,  327,  664,  664,
-      327,  664,  675,  327,  675, 2257, 2263,  675,  327,  675,
-     2265, 2271,  665, 2275, 2276,  665, 2279, 2280,  676, 2283,
-     2284,  562,  562,  676, 1354, 1354, 1354,  568, 1935, 1935,
-     1935, 2285,  569,  562,  563,  327,  563,  562,  562,  562,
-      562,  562,  562,  562,  564,  562,  562,  562, 2286,  562,
-      566,  562,  567,  562,  327,  327,  327,  327,  327,  327,
-
-      675,  327,  675, 2287, 2288,  675,  327,  675, 2289, 2296,
-      386, 2297, 2298,  386, 2300, 1936,  676, 2302, 2310,  562,
-      562,  676, 1354, 1354, 1354,  568, 1331, 1331, 1331, 1355,
-      569,  573,  574,  327,  574,  573,  573,  573,  573,  573,
-      573,  573,  575,  573,  573,  573, 2315,  573,  577,  573,
-      578,  573,  675,  327,  675,  675,  327,  675,  687,  327,
-      687, 2316, 2317,  687,  327,  687, 2319, 2332,  677, 1312,
-     2346,  677, 2347, 2348,  688, 2352, 2353,  573,  573,  688,
-      700,  327,  700,  700,  327,  700, 2341, 1332,  579, 1922,
-     2355, 1355, 2356, 1402, 1402, 1402,  701, 1403, 2357,  701,
-
-     1404,  580,  573,  574,  327,  574,  573,  573,  573,  573,
-      573,  573,  573,  575,  573,  573,  573, 2349,  573,  577,
-      573,  578,  573,  327,  327,  327,  327,  327,  327,  700,
-      327,  700, 2342, 2350,  700,  327,  700, 1922, 2358,  362,
-     2359, 2351,  362, 2360, 2363,  701, 2364, 2365,  573,  573,
-      701,  700,  327,  700,  700,  327,  700, 2366, 2367,  579,
-     2371, 1438, 1438, 1438, 2372, 1439, 2373,  702, 1440, 2374,
-      702, 2343,  580,  584,  585,  327,  585,  584,  584,  584,
-      584,  584,  584,  584,  586,  584,  584,  584, 2368,  584,
-      588,  584,  589,  584,  714,  327,  714,  714,  327,  714,
-
-      327,  327,  327, 2376, 2369,  327,  327,  327, 2377, 2378,
-      715, 2385, 2370,  715, 2387, 2349,  716, 2388, 2389,  584,
-      584,  716,  714,  327,  714, 1441, 1441, 1441, 2390, 1442,
-     2391, 2369, 1443, 2394, 2396,  590, 2427, 2428,  715, 2351,
-      591,  584,  585,  327,  585,  584,  584,  584,  584,  584,
-      584,  584,  586,  584,  584,  584, 2368,  584,  588,  584,
-      589,  584,  714,  327,  714,  714,  327,  714,  714,  327,
-      714, 2429, 2350,  739,  327,  739, 2435, 2436,  715, 2440,
-     2370,  717, 2441, 2444,  717,  340,  341,  584,  584,  740,
-      342,  739,  327,  739, 1457, 1457, 1457, 2445, 1458, 2449,
-
-      727, 1459, 2450,  590, 1938, 1938, 1938,  740,  591,  595,
-      596,  327,  596,  595,  595,  595,  595,  595,  595,  595,
-      597,  595,  595,  595, 2453,  595,  599,  595,  600,  595,
-      728,  750,  327,  750,  750,  327,  750,  750,  327,  750,
-     2457,  750,  327,  750, 1060, 1060, 1060,  751, 2458, 2459,
-      751, 1939, 2462,  752, 2465,  595,  595,  752,  601,  602,
-      603, 1061, 2469, 1461, 1461, 1461,  604, 1462, 2470,  605,
-     1463, 1942, 1942, 1942, 2471, 2472,  606,  595,  596,  327,
-      596,  595,  595,  595,  595,  595,  595,  595,  597,  595,
-      595,  595, 2477,  595,  599,  595,  600,  595,  327,  327,
-
-      327,  327,  327,  327,  750,  327,  750, 2479, 2480,  750,
-      327,  750, 2481, 2482,  362, 2484, 2487,  362, 2489, 2492,
-      751, 2506, 2507,  595,  595,  751,  601,  602,  603, 1479,
-     1479, 1479, 2508, 1480,  604, 2513, 1481,  605, 1945, 1945,
-     1945, 1952, 1952, 1952,  606,  611,  612,  327,  612,  611,
-      611,  611,  611,  611,  611,  611,  613,  611,  611,  611,
-     2514,  611,  615,  611,  616,  611,  750,  327,  750,  750,
-      327,  750,  327,  327,  327, 2515, 2517,  327,  327,  327,
-     2518, 2519,  753, 2516, 2522,  753, 2532, 2541,  754, 2542,
-     2543,  611,  611,  754,  750,  327,  750,  750,  327,  750,
-
-     1489, 1489, 1489, 2520, 1490, 1922, 1312, 1491, 2544, 2545,
-      755, 2521, 2534,  755, 1922,  617,  611,  612,  327,  612,
-      611,  611,  611,  611,  611,  611,  611,  613,  611,  611,
-      611, 2548,  611,  615,  611,  616,  611,  750,  327,  750,
-      750,  327,  750,  327,  327,  327, 2535, 2550,  327,  327,
-      327, 2551, 2536,  756, 2552, 2556,  756, 2557, 2559,  367,
-     2560, 2561,  611,  611,  367,  750,  327,  750,  750,  327,
-      750, 1501, 1501, 1501, 2562, 1502, 2565, 2569, 1503, 2570,
-     2571,  753, 2573, 2579,  753, 2581,  617,  626,  627,  327,
-      627,  626,  626,  626,  626,  626,  626,  626,  628,  626,
-
-      626,  626, 2593,  626,  630,  626,  631,  626,  327,  327,
-      327,  327,  327,  327,  750,  327,  750, 2594, 2595,  750,
-      327,  750, 2599, 2600,  368, 2601, 2607,  368, 2608, 2609,
-      756, 2610, 2613,  626,  626,  756,  750,  327,  750, 2617,
-     2618,  632, 2619,  633, 2620, 2623,  634, 1958, 1958, 1958,
-      635, 2624,  757, 2625,  636,  626,  627,  327,  627,  626,
-      626,  626,  626,  626,  626,  626,  628,  626,  626,  626,
-     2626,  626,  630,  626,  631,  626,  750,  327,  750,  327,
-      327,  327,  327,  327,  327, 2627, 2628,  750,  327,  750,
-     2640, 2644,  757, 2647, 1959,  370, 2648, 2659,  370, 2660,
-
-     2661,  626,  626,  758,  750,  327,  750, 2665, 2666,  632,
-     2667,  633, 2668, 2669,  634, 1961, 1961, 1961,  635, 2670,
-      758, 2671,  636,  641,  642,  327,  642,  641,  641,  641,
-      641,  641,  641,  641,  643,  641,  641,  641, 2672,  641,
-      645,  641,  646,  641,  327,  327,  327,  327,  327,  327,
-      750,  327,  750, 2673, 2674,  750,  327,  750, 2679, 2696,
-      372, 2697, 1939,  372, 2698, 1922,  757, 2699, 2701,  641,
-      641,  757,  750,  327,  750,  750,  327,  750, 2703, 2704,
-      647, 1922, 1504, 1504, 1504, 2705, 1505, 2707,  759, 1506,
-     2708,  759, 2709,  648,  641,  642,  327,  642,  641,  641,
-
-      641,  641,  641,  641,  641,  643,  641,  641,  641, 2682,
-      641,  645,  641,  646,  641,  770,  327,  770,  770,  327,
-      770,  327,  327,  327, 2710, 2711,  327,  327,  327, 2683,
-     2712,  771, 2713, 2714,  771, 2735, 2736,  386, 2741, 2737,
-      641,  641,  386,  770,  327,  770,  770,  327,  770, 2738,
-     2742,  647, 2748,  792, 1517, 1517, 1517, 2749, 1518,  771,
-      963, 1519,  771,  818,  648,  652,  653,  327,  653,  652,
-      652,  652,  652,  652,  652,  652,  654,  652,  652,  652,
-     2750,  652,  656,  652,  657,  652,  770,  327,  770,  770,
-      327,  770,  819, 2751, 1950, 1950, 1950, 2767,  964,  808,
-
-      965, 2768,  772, 2769, 2770,  772,  820, 2785, 2786,  812,
-      804,  652,  652,  966, 2790,  967,  821, 2791, 1038, 1038,
-      658, 2792,  659, 2793,  807, 2794,  660, 2795,  793,  818,
-     1951,  661,  662,  652,  653,  327,  653,  652,  652,  652,
-      652,  652,  652,  652,  654,  652,  652,  652, 2796,  652,
-      656,  652,  657,  652,  828, 2797, 2798,  795,  819,  797,
-     1327, 1327, 1327,  797, 1962, 1962, 1962,  820, 2799,  829,
-      803,  801,  820,  802,  803, 2800,  804,  817, 1329,  652,
-      652,  805,  821, 1038, 2801, 1528, 1528, 1528,  658, 1529,
-      659, 2813, 1530,  793,  660, 2818,  807, 2819, 2822,  661,
-
-      662,  666,  667,  327,  667,  666,  666,  666,  666,  666,
-      666,  666,  668,  666,  666,  666, 2823,  666,  670,  666,
-      671,  666,  825, 1039, 2824,  830,  828, 1126, 1126, 1126,
-     1966, 1966, 1966, 1145, 1145, 1145, 1381, 1381, 1381,  820,
-     1147, 1147, 1147, 2820, 1127, 2320,  805,  666,  666,  817,
-     1146, 2321, 2821,  672, 1383, 2322, 2825, 1148, 1535, 1535,
-     1535, 2323, 1536, 2828, 2829, 1537, 1967, 2830,  673,  666,
-      667,  327,  667,  666,  666,  666,  666,  666,  666,  666,
-      668,  666,  666,  666, 2831,  666,  670,  666,  671,  666,
-     1157, 1157, 1157, 1160, 1160, 1160, 1174, 1174, 1174, 2826,
-
-     1181, 1181, 1181, 1190, 1190, 1190, 2832, 1158, 2827, 2834,
-     1161, 2835, 2836, 1175, 2838,  666,  666, 1182, 2839, 1922,
-     1191,  672, 1553, 1553, 1553, 2840, 1554, 2842, 2843, 1555,
-     2845, 1966, 1966, 1966, 2863, 2864,  673,  678,  679,  327,
-      679,  678,  678,  678,  678,  678,  678,  678,  680,  678,
-      678,  678, 2816,  678,  682,  678,  683,  678, 1192, 1192,
-     1192, 1200, 1200, 1200, 1208, 1208, 1208, 1951, 1212, 1212,
-     1212, 2865, 1224, 1224, 1224, 1193, 2866, 2870, 1201, 2871,
-     2878, 1209, 2879,  678,  678, 1213, 2888, 1922,  684, 1225,
-     1961, 1961, 1961, 2889,  685,  678,  679,  327,  679,  678,
-
-      678,  678,  678,  678,  678,  678,  680,  678,  678,  678,
-     2890,  678,  682,  678,  683,  678, 1246, 1246, 1246, 1252,
-     1252, 1252, 1268, 1268, 1268, 2817, 1274, 1274, 1274, 2902,
-     1280, 1280, 1280, 1247, 2903, 2920, 1253, 1976, 2921, 1269,
-     2922,  678,  678, 1275, 2924, 2925,  684, 1281, 2139, 2139,
-     2139, 2926,  685,  689,  690,  327,  690,  689,  689,  689,
-      689,  689,  689,  689,  691,  689,  689,  689, 2927,  689,
-      693,  689,  694,  689, 1288, 1288, 1288, 1300, 1300, 1300,
-     1060, 1060, 1060, 1327, 1327, 1327, 1374, 1374, 1374, 2928,
-     2929, 1289, 2930, 2872, 1301, 2873, 2875, 1061, 2876,  689,
-
-      689, 1329,  695, 1375,  696, 1583, 1583, 1583, 2874, 1584,
-      697, 2877, 1585, 2931, 2932, 1950, 1950, 1950, 2933, 2934,
-     1330,  698,  689,  690,  327,  690,  689,  689,  689,  689,
-      689,  689,  689,  691,  689,  689,  689, 2935,  689,  693,
-      689,  694,  689, 1378, 1378, 1378, 2937, 2938, 1381, 1381,
-     1381, 1967, 1391, 1391, 1391, 4107, 4107, 4107, 2939, 2941,
-     1379, 2942, 2943, 4107, 4107, 4107, 1383, 2940,  689,  689,
-     1393,  695, 4107,  696, 1592, 1592, 1592, 2944, 1593,  697,
-     4107, 1594, 1617, 1617, 1617, 1384, 1618, 2947, 2948, 1619,
-      698,  703,  704,  327,  704,  703,  703,  703,  703,  703,
-
-      703,  703,  705,  703,  703,  703, 1376,  703,  707,  703,
-      708,  703, 1397, 1397, 1397, 2949, 1312, 1397, 1397, 1397,
-     2954, 1377, 2955, 1380, 1126, 1126, 1126, 1406, 1406, 1406,
-     1399, 1391, 1391, 1391, 2324, 1399, 1922,  703,  703, 2956,
-     2325, 1127,  709, 2957, 2326, 1408, 2958, 2945,  710, 1393,
-     2327, 2959,  711, 1935, 1935, 1935, 2946, 2951,  712,  703,
-      704,  327,  704,  703,  703,  703,  703,  703,  703,  703,
-      705,  703,  703,  703, 2952,  703,  707,  703,  708,  703,
-     2960, 1394, 1400, 1410, 1410, 1410, 1414, 1414, 1414, 1416,
-     1416, 1416, 2961, 2962, 1406, 1406, 1406, 4107, 4107, 4107,
-
-     1411, 2963, 2964, 1415, 2965,  703,  703, 1418, 2966, 2967,
-      709, 2968, 1408, 2970, 4107, 2971,  710, 1626, 1626, 1626,
-      711, 1627, 2972, 2973, 1628, 2974,  712,  718,  719,  327,
-      719,  718,  718,  718,  718,  718,  718,  718,  720,  718,
-      718,  718, 1409,  718,  722,  718,  723,  718, 1412, 1416,
-     1416, 1416, 1420, 1420, 1420, 1422, 1422, 1422, 1424, 1424,
-     1424, 2975, 2976, 1413, 1424, 1424, 1424, 1418, 2988, 1421,
-     2989, 2992, 1423,  718,  718, 1922, 1426, 1938, 1938, 1938,
-     2993,  724, 1426, 2994,  725, 2150, 2150, 2150, 1942, 1942,
-     1942,  726,  718,  719,  327,  719,  718,  718,  718,  718,
-
-      718,  718,  718,  720,  718,  718,  718, 2995,  718,  722,
-      718,  723,  718, 1428, 1428, 1428, 1432, 1432, 1432, 2953,
-     2996, 1419, 1434, 1434, 1434, 2998, 2999, 4107, 4107, 4107,
-     1429, 2997, 3002, 1433, 3003, 3014, 1427, 3015,  718,  718,
-     1436, 1635, 1635, 1635, 4107, 1636,  724, 3016, 1637,  725,
-     1945, 1945, 1945, 2154, 2154, 2154,  726,  729,  730,  327,
-      730,  729,  729,  729,  729,  729,  729,  729,  731,  729,
-      729,  729, 3027,  729,  733,  729,  734,  729, 1430, 1434,
-     1434, 1434, 1145, 1145, 1145, 1147, 1147, 1147, 1444, 1444,
-     1444, 3048, 3057, 1431, 4107, 4107, 4107, 1436, 3000, 1146,
-
-     3058, 3059, 1148,  729,  729, 1445, 4107, 4107, 4107, 3001,
-      735, 4107, 3060, 1646, 1646, 1646,  736, 1647, 2155, 3061,
-     1648, 3062, 3063, 4107, 3064,  737,  729,  730,  327,  730,
-      729,  729,  729,  729,  729,  729,  729,  731,  729,  729,
-      729, 3065,  729,  733,  729,  734,  729, 1446, 1450, 1450,
-     1450, 1437, 1950, 1950, 1950, 1952, 1952, 1952, 4107, 4107,
-     4107, 3066, 1447, 4107, 4107, 4107, 1452, 3068, 3069, 1450,
-     1450, 1450,  729,  729, 3070, 4107, 1157, 1157, 1157,  735,
-     4107, 3071, 1662, 1662, 1662,  736, 1663, 1452, 3072, 1664,
-     2157, 2157, 2157, 1158,  737,  741,  742,  327,  742,  741,
-
-      741,  741,  741,  741,  741,  741,  743,  741,  741,  741,
-     1448,  741,  745,  741,  746,  741, 1449, 1453, 1160, 1160,
-     1160, 1464, 1464, 1464, 3020, 1475, 1475, 1475, 1475, 1475,
-     1475, 1174, 1174, 1174, 3021, 1161, 3073, 2158, 1465, 3074,
-     3022,  741,  741, 1477, 3023, 3075, 1477, 3076, 1175, 1323,
-     1323, 1323,  747, 1324, 3024, 3077, 1325, 1958, 1958, 1958,
-     3025,  748,  741,  742,  327,  742,  741,  741,  741,  741,
-      741,  741,  741,  743,  741,  741,  741, 3078,  741,  745,
-      741,  746,  741, 1482, 1482, 1482, 3079, 1478, 1482, 1482,
-     1482, 3087, 3088, 1181, 1181, 1181, 1495, 1495, 1495, 3089,
-
-     3090, 1484, 1495, 1495, 1495, 3091, 1484, 3092,  741,  741,
-     1182, 1732, 1732, 1732, 1497, 1733, 3093, 3094, 1734,  747,
-     1497, 1961, 1961, 1961, 1962, 1962, 1962, 1312,  748,  760,
-      761,  327,  761,  760,  760,  760,  760,  760,  760,  760,
-      762,  760,  760,  760, 3095,  760,  764,  760,  765,  760,
-     1485, 1190, 1190, 1190, 1192, 1192, 1192, 3084, 3096, 1507,
-     1507, 1507, 3097, 3098, 1498, 1507, 1507, 1507, 1191, 1922,
-     3099, 1193, 1512, 1512, 1512,  760,  760, 1509, 1200, 1200,
-     1200,  766, 3101, 1509,  767, 1737, 1737, 1737, 1922, 1738,
-     1514, 3102, 1739, 3103, 3104, 1201,  768,  760,  761,  327,
-
-      761,  760,  760,  760,  760,  760,  760,  760,  762,  760,
-      760,  760, 3085,  760,  764,  760,  765,  760, 1512, 1512,
-     1512, 1523, 1523, 1523, 1523, 1523, 1523, 1510, 1208, 1208,
-     1208, 3086, 1531, 1531, 1531, 3106, 1514, 3107, 3108, 1525,
-     3119, 3127, 1525,  760,  760, 1209, 1212, 1212, 1212,  766,
-     1533, 3128,  767, 1531, 1531, 1531, 1539, 1539, 1539, 1545,
-     1545, 1545, 3112, 1213,  768,  777, 3129, 3130, 1539, 1539,
-     1539, 1533,  792, 3131, 1541, 3113, 3132, 1547, 3133, 1515,
-     1526,  776,  793, 1545, 1545, 1545, 1541, 1224, 1224, 1224,
-     1556, 1556, 1556, 3042, 3134, 1560, 1560, 1560, 1560, 1560,
-
-     1560, 1547, 3114, 3043, 1225, 3135, 3044, 1557, 3136, 1534,
-      794,  795,  796, 1562, 3137, 3115, 1562,  797,  798, 3141,
-     3144,  799,  800, 3145, 3045,  801, 3146,  802,  803,  804,
-     1542, 1566, 1566, 1566, 3046,  805,  777, 3047, 1566, 1566,
-     1566, 1579, 1579, 1579, 3147, 1548, 1579, 1579, 1579, 1568,
-     1563, 3148,  776,  807, 2684, 2685, 1568, 2686, 3149, 1581,
-     1246, 1246, 1246, 3150, 1581, 2687, 1587, 1587, 1587, 1587,
-     1587, 1587, 2688, 1252, 1252, 1252, 3153, 1247, 1595, 1595,
-     1595,  794,  808,  809, 1589, 3161, 3162, 1589,  810,  811,
-     1253, 3157,  812,  800, 3165, 1596,  813, 1569,  814,  815,
-
-      816, 1598, 1598, 1598, 3158, 3166,  817,  777, 1603, 1603,
-     1603, 1582, 3159, 1603, 1603, 1603, 3169, 3163, 1599, 1607,
-     1607, 1607, 3167,  776,  822, 3160, 1605, 1609, 1609, 1609,
-     3164, 1605, 3180, 3181, 1590, 3168, 1608, 3182, 4107, 4107,
-     4107, 1966, 1966, 1966, 1610, 3183, 3184, 1612, 1612, 1612,
-     3185, 3186,  794,  823,  796, 4107, 1612, 1612, 1612,  810,
-      798, 1606, 3187,  799,  800, 1614, 3189,  806, 3190,  814,
-      815,  804, 3191, 3192, 1614, 3193, 3194,  824, 1268, 1268,
-     1268, 1620, 1620, 1620, 1620, 1620, 1620, 1274, 1274, 1274,
-     1630, 1630, 1630, 3195, 3196, 1269, 3197, 3198, 1611, 1622,
-
-     3199, 3200, 1622, 3208, 1275, 1630, 1630, 1630, 1632, 1280,
-     1280, 1280, 1640, 1640, 1640, 1640, 1640, 1640, 1615, 1288,
-     1288, 1288, 1312, 1632, 3209, 3210, 1281, 1651, 1651, 1651,
-     1642, 3211, 3212, 1642, 3213, 3214, 1289, 1651, 1651, 1651,
-     1658, 1658, 1658, 1922, 3215, 1653, 1623, 1658, 1658, 1658,
-     1300, 1300, 1300, 3216, 3217, 1653, 3218, 3219, 1660, 1666,
-     1666, 1666, 1666, 1666, 1666, 1660, 3220, 1301, 1670, 1670,
-     1670, 3204, 1633, 3221, 4107, 4107, 4107, 1668, 3223, 3205,
-     1668, 3224, 1643, 3225, 3227, 1671, 1674, 1674, 1674, 3236,
-     3237, 4107, 4107, 4107, 4107, 1677, 1677, 1677, 1677, 1677,
-
-     1677, 3238, 1654, 1675, 1327, 1327, 1327, 3239, 3244, 4107,
-     3251, 3228, 1661, 1679, 3252, 3253, 1679, 1327, 1327, 1327,
-     3254, 3229, 1329, 3255, 1669, 1672, 1688, 1688, 1688, 1374,
-     1374, 1374, 1378, 1378, 1378, 1329, 1381, 1381, 1381, 3230,
-     1673, 1381, 1381, 1381, 1689, 3256, 1375, 3257, 3258, 1379,
-     3231, 3259, 1676, 3260, 1383, 1381, 1381, 1381, 3261, 1383,
-     1680, 1744, 1744, 1744, 1391, 1391, 1391, 1391, 1391, 1391,
-     1391, 1391, 1391, 1383, 1397, 1397, 1397, 3262, 1745, 1397,
-     1397, 1397, 1393, 3266, 3267, 1393, 3268, 3269, 1393, 1397,
-     1397, 1397, 1399, 3270, 1402, 1402, 1402, 1399, 1403, 3271,
-
-     3272, 1404, 3273, 1406, 1406, 1406, 3274, 1399, 1406, 1406,
-     1406, 1406, 1406, 1406, 1410, 1410, 1410, 1414, 1414, 1414,
-     1741, 1408, 3275, 1756, 1756, 1756, 1408, 1757, 3276, 1408,
-     1758, 1411, 3277, 3278, 1415, 3279, 3280, 1749, 1761, 1761,
-     1761, 3281, 1762, 1752, 3282, 1763, 1416, 1416, 1416, 1416,
-     1416, 1416, 1416, 1416, 1416, 1420, 1420, 1420, 1765, 1765,
-     1765, 1755, 1766, 3283, 1418, 1767, 3284, 1418, 3285, 3297,
-     1418, 3298, 1421, 1422, 1422, 1422, 1768, 1768, 1768, 3299,
-     1769, 3300, 3301, 1770, 1424, 1424, 1424, 1424, 1424, 1424,
-     1423, 1424, 1424, 1424, 1428, 1428, 1428, 1772, 1772, 1772,
-
-     3302, 1773, 1426, 3303, 1774, 1426, 1432, 1432, 1432, 1426,
-     3304, 1429, 1777, 1777, 1777, 1764, 1778, 3306, 3307, 1779,
-     1434, 1434, 1434, 1433, 1434, 1434, 1434, 1434, 1434, 1434,
-     1438, 1438, 1438, 3308, 1439, 3309, 3310, 1440, 1436, 1441,
-     1441, 1441, 1436, 1442, 3311, 1436, 1443, 1444, 1444, 1444,
-     3312, 1781, 1781, 1781, 1771, 1782, 3313, 3314, 1783, 1450,
-     1450, 1450, 3315, 3316, 1445, 1450, 1450, 1450, 1450, 1450,
-     1450, 1457, 1457, 1457, 3317, 1458, 3332, 1452, 1459, 1792,
-     1792, 1792, 3333, 1452, 3334, 3335, 1452, 1461, 1461, 1461,
-     1780, 1462, 1312, 3336, 1463, 3337, 1793, 1464, 1464, 1464,
-
-     1794, 1794, 1794, 3338, 1795, 3339, 3341, 1796, 1475, 1475,
-     1475, 1475, 1475, 1475, 1465, 3344, 3346, 1788, 1475, 1475,
-     1475, 1479, 1479, 1479, 3347, 1480, 1477, 3326, 1481, 1477,
-     1482, 1482, 1482, 1482, 1482, 1482, 1477, 1482, 1482, 1482,
-     1811, 1811, 1811, 1489, 1489, 1489, 3348, 1490, 1484, 3349,
-     1491, 1484, 1495, 1495, 1495, 1484, 3350, 1812, 1495, 1495,
-     1495, 1495, 1495, 1495, 1818, 1818, 1818, 1501, 1501, 1501,
-     1497, 1502, 3351, 3352, 1503, 3353, 1497, 3354, 3355, 1497,
-     3356, 1819, 3357, 1504, 1504, 1504, 1807, 1505, 3360, 3363,
-     1506, 1507, 1507, 1507, 1507, 1507, 1507, 3364, 1808, 1507,
-
-     1507, 1507, 1821, 1821, 1821, 1512, 1512, 1512, 3365, 1509,
-     3366, 3367, 1509, 1512, 1512, 1512, 3368, 1509, 3369, 1822,
-     1512, 1512, 1512, 1514, 1523, 1523, 1523, 1816, 1517, 1517,
-     1517, 1514, 1518, 3370, 3371, 1519, 3372, 3377, 1514, 1523,
-     1523, 1523, 1525, 1523, 1523, 1523, 1528, 1528, 1528, 3378,
-     1529, 3379, 3380, 1530, 1531, 1531, 1531, 1525, 1531, 1531,
-     1531, 1525, 1531, 1531, 1531, 1820, 3381, 1535, 1535, 1535,
-     1823, 1536, 1533, 3382, 1537, 3383, 1533, 1539, 1539, 1539,
-     1533, 1539, 1539, 1539, 1539, 1539, 1539, 3384, 1833, 1833,
-     1833, 4107, 4107, 4107, 3385, 1541, 1545, 1545, 1545, 1541,
-
-     3386, 3387, 1541, 3232, 1828, 1834, 3388, 3389, 4107, 1545,
-     1545, 1545, 3390, 3233, 1547, 1545, 1545, 1545, 1553, 1553,
-     1553, 3391, 1554, 1830, 3392, 1555, 3393, 1547, 1556, 1556,
-     1556, 3234, 3397, 1547, 3398, 1832, 1841, 1841, 1841, 1835,
-     1842, 3399, 3235, 1843, 3400, 1557, 1560, 1560, 1560, 1560,
-     1560, 1560, 1560, 1560, 1560, 1566, 1566, 1566, 1566, 1566,
-     1566, 1566, 1566, 1566, 1562, 3401, 3402, 1562, 3403, 3404,
-     1562, 3407, 3408, 1568, 3409, 3410, 1568, 3411, 3412, 1568,
-     1855, 1855, 1855, 1836, 1579, 1579, 1579, 1579, 1579, 1579,
-     1579, 1579, 1579, 3414, 1583, 1583, 1583, 1856, 1584, 3415,
-
-     3416, 1585, 1581, 3417, 1846, 1581, 3418, 3419, 1581, 1849,
-     1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1587, 1592,
-     1592, 1592, 3288, 1593, 2689, 2690, 1594, 2691, 1589, 3420,
-     3421, 1589, 3289, 3422, 1589, 2692, 1595, 1595, 1595, 1864,
-     1864, 1864, 2693, 1865, 3423, 3424, 1866, 1867, 1867, 1867,
-     3290, 3425, 1860, 1596, 1598, 1598, 1598, 3426, 1869, 1869,
-     1869, 3291, 1870, 3427, 1868, 1871, 1873, 1873, 1873, 3428,
-     3429, 1599, 1603, 1603, 1603, 1603, 1603, 1603, 1862, 1603,
-     1603, 1603, 3436, 1874, 1607, 1607, 1607, 1877, 1877, 1877,
-     1605, 1878, 1312, 1605, 1879, 3437, 3438, 1605, 1609, 1609,
-
-     1609, 1608, 1880, 1880, 1880, 3439, 1881, 3440, 3441, 1882,
-     1612, 1612, 1612, 3442, 3443, 1610, 1612, 1612, 1612, 1612,
-     1612, 1612, 1617, 1617, 1617, 3444, 1618, 3445, 1614, 1619,
-     1620, 1620, 1620, 3446, 1614, 3447, 3430, 1614, 3448, 3449,
-     1876, 1620, 1620, 1620, 1620, 1620, 1620, 3450, 1622, 1626,
-     1626, 1626, 3451, 1627, 3452, 3453, 1628, 3454, 3455, 1622,
-     3459, 3465, 1622, 1630, 1630, 1630, 1630, 1630, 1630, 3466,
-     1630, 1630, 1630, 1635, 1635, 1635, 3292, 1636, 3467, 3468,
-     1637, 1632, 3469, 3470, 1632, 3471, 3293, 1884, 1632, 1893,
-     1893, 1893, 1640, 1640, 1640, 1640, 1640, 1640, 1640, 1640,
-
-     1640, 1897, 1897, 1897, 3294, 3478, 1894, 1646, 1646, 1646,
-     1642, 1647, 1886, 1642, 1648, 3295, 1642, 3479, 1898, 4107,
-     4107, 4107, 1651, 1651, 1651, 1651, 1651, 1651, 1651, 1651,
-     1651, 3480, 1890, 1903, 1903, 1903, 4107, 1658, 1658, 1658,
-     1653, 3481, 3482, 1653, 3483, 3484, 1653, 1658, 1658, 1658,
-     1904, 1658, 1658, 1658, 3485, 1660, 3486, 1662, 1662, 1662,
-     1895, 1663, 3487, 3488, 1664, 1660, 1666, 1666, 1666, 1660,
-     1666, 1666, 1666, 1666, 1666, 1666, 1901, 1670, 1670, 1670,
-     3489, 1899, 3490, 3491, 1668, 1909, 1909, 1909, 1668, 1910,
-     3492, 1668, 1911, 3493, 1671, 1674, 1674, 1674, 3494, 1906,
-
-     1914, 1914, 1914, 3495, 1915, 3496, 3497, 1916, 1677, 1677,
-     1677, 3498, 1675, 1677, 1677, 1677, 3499, 1677, 1677, 1677,
-     1921, 1921, 1921, 1688, 1688, 1688, 1679, 1381, 1381, 1381,
-     3500, 1679, 3501, 3502, 1908, 1679, 3503, 3504, 1922, 1923,
-     3505, 1689, 1732, 1732, 1732, 1383, 1733, 3506, 3507, 1734,
-     1737, 1737, 1737, 3508, 1738, 3511, 3512, 1739, 1744, 1744,
-     1744, 1978, 1978, 1978, 3513, 1979, 3318, 3514, 1980, 1391,
-     1391, 1391, 1397, 1397, 1397, 1745, 3319, 3515, 1918, 1986,
-     1986, 1986, 3516, 1406, 1406, 1406, 3517, 1393, 3518, 1975,
-     1399, 1756, 1756, 1756, 3320, 1757, 1987, 3519, 1758, 3520,
-
-     3521, 1408, 1761, 1761, 1761, 3321, 1762, 3522, 3523, 1763,
-     1416, 1416, 1416, 1765, 1765, 1765, 3524, 1766, 3536, 3527,
-     1767, 3537, 1768, 1768, 1768, 3542, 1769, 3543, 1418, 1770,
-     3530, 1984, 1424, 1424, 1424, 1772, 1772, 1772, 3546, 1773,
-     1988, 1991, 1774, 1312, 1777, 1777, 1777, 3527, 1778, 3547,
-     1426, 1779, 1434, 1434, 1434, 1781, 1781, 1781, 1994, 1782,
-     3548, 3528, 1783, 3549, 2001, 2001, 2001, 1450, 1450, 1450,
-     1436, 2005, 2005, 2005, 4107, 4107, 4107, 4107, 4107, 4107,
-     1995, 2002, 1792, 1792, 1792, 1452, 3550, 3551, 2006, 3553,
-     3525, 4107, 3554, 3561, 4107, 4107, 4107, 4107, 3562, 1793,
-
-     1998, 2009, 2009, 2009, 3555, 2010, 3563, 3564, 2011, 1794,
-     1794, 1794, 4107, 1795, 3532, 3565, 1796, 4107, 4107, 4107,
-     4107, 4107, 4107, 2004, 3556, 2008, 4107, 4107, 4107, 4107,
-     4107, 4107, 3566, 3533, 4107, 3534, 3557, 4107, 4107, 4107,
-     4107, 2007, 3570, 4107, 3567, 3571, 4107, 2012, 3535, 2018,
-     2018, 2018, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 1475, 1475, 1475, 2013, 2019, 3572, 3573, 4107,
-     1811, 1811, 1811, 4107, 2015, 3574, 4107, 1482, 1482, 1482,
-     1477, 2027, 2027, 2027, 3575, 2028, 3576, 1812, 2029, 3577,
-     3578, 2014, 3579, 3580, 2016, 1484, 2031, 2031, 2031, 2017,
-
-     1495, 1495, 1495, 1818, 1818, 1818, 3581, 2037, 2037, 2037,
-     3568, 2038, 3582, 2032, 2039, 1507, 1507, 1507, 1497, 2021,
-     1819, 2022, 3569, 2020, 1821, 1821, 1821, 3583, 2023, 3584,
-     2024, 3589, 3590, 1509, 3595, 2041, 2041, 2041, 3596, 2042,
-     3597, 1822, 2043, 2033, 1512, 1512, 1512, 1523, 1523, 1523,
-     1531, 1531, 1531, 2052, 2052, 2052, 3598, 1539, 1539, 1539,
-     3599, 3600, 1514, 2803, 2804, 1525, 2805, 2035, 1533, 3603,
-     2053, 1833, 1833, 1833, 2806, 1541, 2055, 2055, 2055, 3603,
-     2056, 2807, 2040, 2057, 1545, 1545, 1545, 3527, 1834, 2061,
-     2061, 2061, 1841, 1841, 1841, 3606, 1842, 3607, 1312, 1843,
-
-     3608, 3528, 1547, 2044, 3611, 2049, 2062, 3609, 2051, 2054,
-     2065, 2065, 2065, 1560, 1560, 1560, 1566, 1566, 1566, 1855,
-     1855, 1855, 2078, 2078, 2078, 3610, 2079, 2066, 3612, 2080,
-     3613, 1562, 1922, 1923, 1568, 3616, 1856, 1579, 1579, 1579,
-     3601, 2085, 2085, 2085, 3617, 2059, 1587, 1587, 1587, 1864,
-     1864, 1864, 3630, 1865, 3624, 1581, 1866, 2067, 2086, 1867,
-     1867, 1867, 3625, 3538, 1589, 2089, 2089, 2089, 3631, 2090,
-     3632, 3527, 2091, 1869, 1869, 1869, 1868, 1870, 2069, 3539,
-     1871, 3540, 3530, 2072, 1873, 1873, 1873, 2084, 2093, 2093,
-     2093, 3614, 2094, 3633, 3541, 2095, 1603, 1603, 1603, 3646,
-
-     3628, 1874, 3647, 1877, 1877, 1877, 3615, 1878, 3629, 2087,
-     1879, 1880, 1880, 1880, 1605, 1881, 3648, 3649, 1882, 1612,
-     1612, 1612, 1620, 1620, 1620, 1630, 1630, 1630, 2107, 2107,
-     2107, 1893, 1893, 1893, 2109, 2109, 2109, 1614, 2110, 3622,
-     1622, 2111, 3626, 1632, 3650, 2108, 3651, 2097, 1894, 1640,
-     1640, 1640, 1897, 1897, 1897, 2114, 2114, 2114, 3623, 2115,
-     3636, 3627, 2116, 1651, 1651, 1651, 3640, 1642, 3638, 1898,
-     1903, 1903, 1903, 2121, 2121, 2121, 3639, 2122, 3652, 3637,
-     2123, 1653, 2124, 2124, 2124, 3641, 2099, 1904, 3653, 2101,
-     2105, 1658, 1658, 1658, 1666, 1666, 1666, 3642, 3654, 2125,
-
-     1909, 1909, 1909, 3655, 1910, 3643, 3657, 1911, 3658, 1660,
-     3659, 3603, 1668, 2119, 2112, 1914, 1914, 1914, 3663, 1915,
-     3603, 3656, 1916, 3664, 1677, 1677, 1677, 1921, 1921, 1921,
-     2167, 2167, 2167, 2170, 2170, 2170, 2154, 2154, 2154, 3665,
-     3666, 2126, 1679, 3667, 3668, 1922, 2128, 2167, 2167, 2167,
-     2175, 2175, 2175, 2177, 2177, 2177, 4107, 4107, 4107, 1381,
-     1381, 1381, 1978, 1978, 1978, 3669, 1979, 2176, 3670, 1980,
-     2178, 3671, 3672, 4107, 3660, 3673, 2132, 1383, 3677, 2134,
-     2171, 1391, 1391, 1391, 3678, 1986, 1986, 1986, 3679, 3661,
-     2188, 2188, 2188, 3680, 2189, 2168, 2135, 2190, 3681, 1393,
-
-     3682, 2168, 1987, 3683, 1397, 1397, 1397, 1406, 1406, 1406,
-     3684, 3685, 2155, 2195, 2195, 2195, 2197, 2197, 2197, 3686,
-     3687, 2179, 1399, 3688, 3692, 1408, 3693, 2180, 3694, 3695,
-     2196, 3696, 3697, 2198, 1416, 1416, 1416, 1424, 1424, 1424,
-     2201, 2201, 2201, 2203, 2203, 2203, 2186, 1434, 1434, 1434,
-     3698, 3699, 1418, 3703, 3704, 1426, 2194, 2202, 3705, 3706,
-     2204, 2206, 2206, 2206, 2191, 1436, 4107, 4107, 4107, 2001,
-     2001, 2001, 2209, 2209, 2209, 3707, 2210, 3708, 2207, 2211,
-     2212, 2212, 2212, 4107, 3709, 3710, 2002, 1450, 1450, 1450,
-     2005, 2005, 2005, 3711, 2215, 2215, 2215, 2213, 2216, 3712,
-
-     2199, 2217, 3713, 2200, 3714, 1452, 3715, 2006, 3716, 2218,
-     2218, 2218, 3718, 2205, 4107, 4107, 4107, 2009, 2009, 2009,
-     3719, 2010, 3720, 3721, 2011, 2208, 2219, 4107, 4107, 4107,
-     3722, 4107, 4107, 4107, 4107, 2223, 2223, 2223, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 2214, 4107,
-     3591, 3723, 2224, 3724, 3725, 4107, 3585, 3726, 4107, 2018,
-     2018, 2018, 4107, 2228, 2228, 2228, 3592, 2229, 3593, 3727,
-     2230, 3728, 2231, 2231, 2231, 3586, 2019, 3587, 3733, 2220,
-     3734, 3594, 2222, 4107, 4107, 4107, 3729, 3735, 2226, 2232,
-     3588, 3736, 2221, 4107, 4107, 4107, 3737, 2225, 3730, 2227,
-
-     4107, 1475, 1475, 1475, 1482, 1482, 1482, 2027, 2027, 2027,
-     4107, 2028, 3738, 3739, 2029, 2239, 2239, 2239, 3740, 1477,
-     3741, 3742, 1484, 2031, 2031, 2031, 2241, 2241, 2241, 3743,
-     2242, 2233, 2240, 2243, 2246, 2246, 2246, 2248, 2248, 2248,
-     2032, 2037, 2037, 2037, 3744, 2038, 3745, 2234, 2039, 1507,
-     1507, 1507, 2247, 3731, 2041, 2041, 2041, 3746, 2042, 3747,
-     2236, 2043, 1512, 1512, 1512, 3732, 3748, 1509, 2235, 2255,
-     2255, 2255, 1531, 1531, 1531, 2052, 2052, 2052, 3749, 3750,
-     1514, 2259, 2259, 2259, 3751, 2260, 3752, 2256, 2261, 3753,
-     1533, 3754, 2053, 1539, 1539, 1539, 2249, 2055, 2055, 2055,
-
-     3755, 2056, 3756, 3757, 2057, 1545, 1545, 1545, 2061, 2061,
-     2061, 1541, 3758, 2266, 2266, 2266, 3759, 2267, 3760, 2258,
-     2268, 3761, 3762, 1547, 3764, 2062, 2269, 2269, 2269, 3765,
-     2250, 2065, 2065, 2065, 2272, 2272, 2272, 3766, 2273, 3767,
-     3768, 2274, 3769, 2270, 2277, 2277, 2277, 3770, 2066, 1566,
-     1566, 1566, 2262, 2282, 2282, 2282, 2078, 2078, 2078, 1312,
-     2079, 3771, 2278, 2080, 1579, 1579, 1579, 1568, 2085, 2085,
-     2085, 3772, 2264, 2291, 2291, 2291, 3773, 2292, 3774, 3775,
-     2293, 3776, 1581, 3777, 3763, 2086, 2294, 2294, 2294, 2089,
-     2089, 2089, 3778, 2090, 3779, 3780, 2091, 3781, 3782, 2093,
-
-     2093, 2093, 2281, 2094, 2295, 3783, 2095, 1603, 1603, 1603,
-     1612, 1612, 1612, 1620, 1620, 1620, 2290, 2304, 2304, 2304,
-     4107, 4107, 4107, 3784, 3785, 1605, 3786, 3787, 1614, 3788,
-     3789, 1622, 3790, 3791, 2305, 3792, 3793, 4107, 2307, 2307,
-     2307, 1630, 1630, 1630, 2107, 2107, 2107, 2311, 2311, 2311,
-     3794, 2312, 3795, 3796, 2313, 2308, 2109, 2109, 2109, 1632,
-     2110, 2108, 2301, 2111, 3797, 2303, 1640, 1640, 1640, 2299,
-     2114, 2114, 2114, 3798, 2115, 3799, 3800, 2116, 1651, 1651,
-     1651, 2121, 2121, 2121, 1642, 2122, 3801, 2306, 2123, 2309,
-     2124, 2124, 2124, 2328, 2328, 2328, 1653, 2329, 3803, 1312,
-
-     2330, 1658, 1658, 1658, 2333, 2333, 2333, 2125, 2335, 2335,
-     2335, 2337, 2337, 2337, 2314, 4107, 4107, 4107, 3802, 1660,
-     3804, 3805, 2334, 3806, 3807, 2336, 3808, 3809, 2338, 3810,
-     2318, 3811, 4107, 1677, 1677, 1677, 3812, 2344, 2344, 2344,
-     2139, 2139, 2139, 2354, 2354, 2354, 2150, 2150, 2150, 3813,
-     3814, 1679, 3815, 2331, 2345, 2361, 2361, 2361, 2154, 2154,
-     2154, 2362, 2362, 2362, 2157, 2157, 2157, 3816, 3817, 2340,
-     2167, 2167, 2167, 2375, 2375, 2375, 2170, 2170, 2170, 3818,
-     2339, 2175, 2175, 2175, 2379, 2379, 2379, 3819, 2380, 3820,
-     3821, 2381, 2177, 2177, 2177, 2382, 2382, 2382, 2176, 2383,
-
-     3822, 3823, 2384, 1381, 1381, 1381, 2392, 2392, 2392, 2178,
-     2188, 2188, 2188, 3824, 2189, 3825, 3826, 2190, 2397, 2397,
-     2397, 1383, 3827, 3828, 2393, 1397, 1397, 1397, 1406, 1406,
-     1406, 2195, 2195, 2195, 3829, 2398, 3830, 2400, 2400, 2400,
-     3831, 2401, 3832, 1399, 2402, 3833, 1408, 3834, 2196, 2197,
-     2197, 2197, 2403, 2403, 2403, 3835, 2404, 3836, 3837, 2405,
-     1416, 1416, 1416, 1424, 1424, 1424, 2198, 2201, 2201, 2201,
-     2386, 3838, 2408, 2408, 2408, 3840, 2409, 2395, 1418, 2410,
-     3841, 1426, 3842, 3843, 2202, 2203, 2203, 2203, 3844, 1312,
-     2399, 2411, 2411, 2411, 3845, 2412, 3846, 3847, 2413, 1434,
-
-     1434, 1434, 2204, 2206, 2206, 2206, 2415, 2415, 2415, 3839,
-     2416, 3848, 3849, 2417, 2418, 2418, 2418, 1436, 3850, 3851,
-     2207, 2209, 2209, 2209, 3852, 2210, 2406, 3853, 2211, 2407,
-     3854, 2419, 2212, 2212, 2212, 2420, 2420, 2420, 3855, 2421,
-     3856, 3857, 2422, 1450, 1450, 1450, 2215, 2215, 2215, 2213,
-     2216, 3858, 3859, 2217, 2218, 2218, 2218, 2223, 2223, 2223,
-     3860, 1452, 2424, 2424, 2424, 2414, 2425, 3861, 3862, 2426,
-     3863, 2219, 3864, 3865, 2224, 2430, 2430, 2430, 3866, 2431,
-     3867, 3868, 2432, 2433, 2433, 2433, 2228, 2228, 2228, 3869,
-     2229, 3870, 3871, 2230, 3873, 2423, 2231, 2231, 2231, 3874,
-
-     2434, 2437, 2437, 2437, 3875, 2438, 1312, 3876, 2439, 1475,
-     1475, 1475, 3872, 2232, 1482, 1482, 1482, 2239, 2239, 2239,
-     3877, 2446, 2446, 2446, 3878, 2447, 3879, 1477, 2448, 2241,
-     2241, 2241, 1484, 2242, 2240, 3880, 2243, 2246, 2246, 2246,
-     2248, 2248, 2248, 3881, 1507, 1507, 1507, 1512, 1512, 1512,
-     2454, 2454, 2454, 3882, 3883, 2247, 2255, 2255, 2255, 3884,
-     3885, 2442, 1509, 3322, 3886, 1514, 3887, 2455, 2443, 1531,
-     1531, 1531, 3888, 3323, 2256, 2259, 2259, 2259, 3889, 2260,
-     3890, 3891, 2261, 1539, 1539, 1539, 3892, 1533, 2463, 2463,
-     2463, 3324, 2266, 2266, 2266, 3893, 2267, 2456, 2452, 2268,
-
-     3894, 1541, 3325, 2451, 3895, 3896, 2464, 2269, 2269, 2269,
-     2466, 2466, 2466, 1312, 2467, 3898, 3899, 2468, 3900, 2460,
-     3901, 2272, 2272, 2272, 2270, 2273, 3902, 3897, 2274, 3903,
-     2461, 2277, 2277, 2277, 2473, 2473, 2473, 1566, 1566, 1566,
-     2282, 2282, 2282, 2476, 2476, 2476, 2478, 2478, 2478, 2278,
-     3904, 2474, 1579, 1579, 1579, 1568, 2291, 2291, 2291, 3905,
-     2292, 3906, 3907, 2293, 2294, 2294, 2294, 2485, 2485, 2485,
-     1581, 1603, 1603, 1603, 2490, 2490, 2490, 1620, 1620, 1620,
-     3908, 3909, 2295, 3910, 2486, 2304, 2304, 2304, 3911, 1605,
-     3912, 3913, 2491, 3915, 3916, 1622, 2494, 2494, 2494, 2475,
-
-     2495, 3917, 2305, 2496, 2497, 2497, 2497, 2307, 2307, 2307,
-     2499, 2499, 2499, 3918, 2500, 3919, 3920, 2501, 2483, 3921,
-     3922, 2498, 3923, 3924, 2308, 1630, 1630, 1630, 2503, 2503,
-     2503, 2488, 2311, 2311, 2311, 3925, 2312, 3926, 3927, 2313,
-     3928, 3929, 2493, 1632, 3930, 2504, 1640, 1640, 1640, 2509,
-     2509, 2509, 2511, 2511, 2511, 2328, 2328, 2328, 3933, 2329,
-     3934, 3935, 2330, 3936, 1642, 3937, 3938, 2510, 3939, 2512,
-     1658, 1658, 1658, 2524, 2524, 2524, 2333, 2333, 2333, 2502,
-     2335, 2335, 2335, 3940, 3941, 2526, 2526, 2526, 1660, 2527,
-     2525, 3942, 2528, 3945, 2334, 3946, 3947, 2336, 1312, 3948,
-
-     2505, 2337, 2337, 2337, 2529, 2529, 2529, 3959, 2530, 1838,
-     1837, 2531, 1677, 1677, 1677, 1312, 3995, 2523, 2338, 2344,
-     2344, 2344, 2537, 2537, 2537, 1312, 2538, 1831, 1829, 2539,
-     1679, 2540, 2540, 2540, 1827, 3943, 2345, 2546, 2546, 2546,
-     2547, 2547, 2547, 2354, 2354, 2354, 2549, 2549, 2549, 2553,
-     2553, 2553, 2361, 2361, 2361, 2362, 2362, 2362, 2554, 2554,
-     2554, 2558, 2558, 2558, 2563, 2563, 2563, 2564, 2564, 2564,
-     2566, 2566, 2566, 1312, 2533, 2375, 2375, 2375, 2567, 2567,
-     2567, 2379, 2379, 2379, 1312, 2380, 1312, 1826, 2381, 2382,
-     2382, 2382, 1312, 2383, 1312, 1312, 2384, 1381, 1381, 1381,
-
-     2574, 2574, 2574, 1825, 1824, 2555, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 1383, 1312, 2575, 2392, 2392,
-     2392, 3944, 3949, 4107, 1312, 2568, 4107, 4003, 3975, 4107,
-     1397, 1397, 1397, 2397, 2397, 2397, 2393, 2582, 2582, 2582,
-     3953, 2583, 1312, 3950, 2584, 1406, 1406, 1406, 1399, 2572,
-     2398, 3960, 2400, 2400, 2400, 1312, 2401, 1312, 2576, 2402,
-     2403, 2403, 2403, 1408, 2404, 3951, 1312, 2405, 1416, 1416,
-     1416, 1312, 2578, 3952, 2577, 1424, 1424, 1424, 2408, 2408,
-     2408, 1312, 2409, 1817, 1312, 2410, 1418, 3954, 2586, 2808,
-     2809, 2580, 2810, 1426, 2411, 2411, 2411, 3961, 2412, 3977,
-
-     2811, 2413, 1434, 1434, 1434, 1312, 2585, 2812, 2415, 2415,
-     2415, 2587, 2416, 3980, 3967, 2417, 2418, 2418, 2418, 3963,
-     1436, 2589, 2589, 2589, 4064, 2590, 3982, 1312, 2591, 3969,
-     2420, 2420, 2420, 2419, 2421, 1312, 3964, 2422, 1450, 1450,
-     1450, 2424, 2424, 2424, 1312, 2425, 2588, 3965, 2426, 3962,
-     2430, 2430, 2430, 1312, 2431, 1312, 1452, 2432, 2433, 2433,
-     2433, 2596, 2596, 2596, 3966, 2597, 3968, 1312, 2598, 2437,
-     2437, 2437, 1312, 2438, 1312, 2434, 2439, 2602, 2602, 2602,
-     1475, 1475, 1475, 2605, 2605, 2605, 2446, 2446, 2446, 1312,
-     2447, 3970, 1312, 2448, 2603, 1507, 1507, 1507, 1477, 1312,
-
-     3997, 2606, 1512, 1512, 1512, 2592, 2454, 2454, 2454, 1312,
-     2614, 2614, 2614, 1509, 2615, 3972, 1312, 2616, 1815, 1312,
-     1514, 4064, 1814, 2455, 1531, 1531, 1531, 3971, 3979, 1539,
-     1539, 1539, 2463, 2463, 2463, 1312, 2466, 2466, 2466, 1813,
-     2467, 1810, 1533, 2468, 1312, 2604, 1809, 1541, 3955, 3957,
-     2464, 2611, 1312, 1312, 2612, 2473, 2473, 2473, 2629, 2629,
-     2629, 4028, 2630, 1312, 3974, 2631, 1566, 1566, 1566, 2476,
-     2476, 2476, 2474, 2633, 2633, 2633, 2478, 2478, 2478, 2634,
-     2634, 2634, 3973, 1312, 1568, 4107, 4107, 4107, 4107, 4107,
-     4107, 2621, 2622, 1579, 1579, 1579, 2635, 4107, 4107, 4107,
-
-     3956, 3958, 4107, 1312, 4016, 4107, 2485, 2485, 2485, 4000,
-     3983, 1581, 1312, 1312, 4107, 2641, 2641, 2641, 1312, 2642,
-     1312, 3976, 2643, 2486, 2645, 2645, 2645, 2490, 2490, 2490,
-     1312, 2632, 2649, 2649, 2649, 1312, 3991, 2636, 1312, 2494,
-     2494, 2494, 2646, 2495, 4018, 2491, 2496, 2497, 2497, 2497,
-     2650, 3978, 1312, 2637, 2651, 2651, 2651, 2638, 2652, 2639,
-     1312, 2653, 4030, 1312, 2498, 2499, 2499, 2499, 3987, 2500,
-     1312, 3981, 2501, 1630, 1630, 1630, 2503, 2503, 2503, 2655,
-     2655, 2655, 1312, 2656, 1312, 3985, 2657, 1640, 1640, 1640,
-     1312, 1632, 1312, 2504, 2509, 2509, 2509, 2511, 2511, 2511,
-
-     2662, 2662, 2662, 4031, 2663, 1642, 3984, 2664, 1658, 1658,
-     1658, 4020, 2510, 1312, 2512, 2524, 2524, 2524, 3986, 4005,
-     2676, 2676, 2676, 1312, 2677, 2654, 1660, 2678, 3999, 2526,
-     2526, 2526, 2525, 2527, 1312, 1312, 2528, 3988, 4059, 2658,
-     2529, 2529, 2529, 1804, 2530, 4002, 1312, 2531, 1677, 1677,
-     1677, 2681, 2681, 2681, 1312, 2537, 2537, 2537, 2675, 2538,
-     3990, 3989, 2539, 2540, 2540, 2540, 1679, 3993, 3996, 1312,
-     2694, 2694, 2694, 2695, 2695, 2695, 2546, 2546, 2546, 2547,
-     2547, 2547, 2549, 2549, 2549, 2700, 2700, 2700, 2702, 2702,
-     2702, 2553, 2553, 2553, 2554, 2554, 2554, 2558, 2558, 2558,
-
-     2706, 2706, 2706, 2563, 2563, 2563, 2564, 2564, 2564, 2566,
-     2566, 2566, 2567, 2567, 2567, 1312, 2680, 2715, 2715, 2715,
-     2717, 2717, 2717, 2574, 2574, 2574, 2718, 2718, 2718, 1312,
-     2719, 1803, 1312, 2720, 1802, 2716, 2721, 2721, 2721, 1312,
-     2575, 4107, 4107, 4107, 4107, 4107, 4107, 2725, 2725, 2725,
-     1397, 1397, 1397, 2722, 2727, 2727, 2727, 1312, 4107, 4004,
-     1312, 4107, 2582, 2582, 2582, 1312, 2583, 3992, 1399, 2584,
-     3994, 2728, 1406, 1406, 1406, 4001, 1416, 1416, 1416, 1424,
-     1424, 1424, 1434, 1434, 1434, 2589, 2589, 2589, 1312, 2590,
-     1408, 4019, 2591, 2723, 1418, 1312, 2724, 1426, 3998, 1312,
-
-     1436, 2733, 2733, 2733, 2596, 2596, 2596, 4008, 2597, 1801,
-     1800, 2598, 1799, 2730, 2739, 2739, 2739, 2726, 1312, 2734,
-     2602, 2602, 2602, 1312, 2729, 2743, 2743, 2743, 1798, 2744,
-     1312, 2740, 2745, 2746, 2746, 2746, 4022, 2603, 2605, 2605,
-     2605, 2731, 4010, 4006, 2732, 1507, 1507, 1507, 2753, 2753,
-     2753, 2747, 2755, 2755, 2755, 1312, 2606, 2614, 2614, 2614,
-     1312, 2615, 4007, 1509, 2616, 4051, 2754, 4009, 1312, 2756,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 2761,
-     2761, 2761, 1531, 1531, 1531, 1312, 4023, 4107, 4025, 1312,
-     4107, 4012, 1312, 4107, 4021, 1312, 2762, 1312, 1312, 2757,
-
-     1533, 1539, 1539, 1539, 4014, 1312, 2752, 2765, 2765, 2765,
-     2771, 2771, 2771, 2629, 2629, 2629, 1797, 2630, 4044, 1541,
-     2631, 1566, 1566, 1566, 2766, 4015, 2758, 4053, 2760, 2633,
-     2633, 2633, 2634, 2634, 2634, 2759, 2776, 2776, 2776, 1568,
-     2773, 2773, 2773, 2763, 2774, 4011, 1312, 2775, 4033, 2635,
-     4107, 4107, 4107, 2777, 4107, 4107, 4107, 2780, 2780, 2780,
-     2782, 2782, 2782, 4107, 4107, 4107, 2764, 4107, 2645, 2645,
-     2645, 4107, 2641, 2641, 2641, 2781, 2642, 2783, 1312, 2643,
-     4107, 2772, 2649, 2649, 2649, 1312, 2646, 2651, 2651, 2651,
-     1312, 2652, 1312, 4013, 2653, 2787, 2787, 2787, 1312, 1312,
-
-     2650, 1312, 2778, 2655, 2655, 2655, 2779, 2656, 4043, 1312,
-     2657, 1791, 1312, 2788, 1640, 1640, 1640, 2662, 2662, 2662,
-     4045, 2663, 1312, 4024, 2664, 1658, 1658, 1658, 4017, 4047,
-     2784, 1312, 1642, 2676, 2676, 2676, 4026, 2677, 1312, 4027,
-     2678, 4070, 4046, 1660, 1677, 1677, 1677, 2681, 2681, 2681,
-     2694, 2694, 2694, 2695, 2695, 2695, 2833, 2833, 2833, 4035,
-     4029, 2789, 1679, 1312, 4052, 1312, 2700, 2700, 2700, 2702,
-     2702, 2702, 2837, 2837, 2837, 2706, 2706, 2706, 2841, 2841,
-     2841, 2844, 2844, 2844, 2715, 2715, 2715, 2802, 2717, 2717,
-     2717, 2718, 2718, 2718, 4104, 2719, 4054, 1790, 2720, 2721,
-
-     2721, 2721, 2716, 1312, 1312, 2846, 2846, 2846, 1312, 2847,
-     2815, 2814, 2848, 2849, 2849, 2849, 2722, 2851, 2851, 2851,
-     2725, 2725, 2725, 2853, 2853, 2853, 2727, 2727, 2727, 1312,
-     2850, 2855, 2855, 2855, 2852, 2856, 1312, 1312, 2857, 4032,
-     4034, 2854, 1312, 2728, 2858, 2858, 2858, 1416, 1416, 1416,
-     1424, 1424, 1424, 1434, 1434, 1434, 2733, 2733, 2733, 2739,
-     2739, 2739, 2859, 1789, 4048, 1418, 1787, 4039, 1426, 1786,
-     1312, 1436, 1312, 1312, 2734, 4040, 2740, 2867, 2867, 2867,
-     4041, 2868, 4061, 4036, 2869, 2743, 2743, 2743, 1785, 2744,
-     1312, 1312, 2745, 2746, 2746, 2746, 2880, 2880, 2880, 2882,
-
-     2882, 2882, 1507, 1507, 1507, 2753, 2753, 2753, 2755, 2755,
-     2755, 2747, 2860, 2881, 2862, 4049, 2883, 4037, 2861, 4038,
-     1509, 1312, 4050, 2754, 1312, 2756, 2885, 2885, 2885, 4042,
-     2886, 1312, 1312, 2887, 2891, 2891, 2891, 2761, 2761, 2761,
-     2893, 2893, 2893, 1784, 2894, 1776, 1775, 2895, 2896, 2896,
-     2896, 2892, 1312, 1312, 2762, 1539, 1539, 1539, 1312, 1760,
-     2884, 2765, 2765, 2765, 1312, 4060, 2897, 2899, 2899, 2899,
-     4056, 2900, 1759, 1541, 2901, 2904, 2904, 2904, 2766, 2906,
-     2906, 2906, 2771, 2771, 2771, 2908, 2908, 2908, 2776, 2776,
-     2776, 4062, 2905, 2773, 2773, 2773, 2907, 2774, 4104, 4055,
-
-     2775, 1312, 4058, 2909, 1312, 2777, 2910, 2910, 2910, 1312,
-     2911, 4057, 1754, 2912, 2913, 2913, 2913, 2898, 2915, 2915,
-     2915, 2780, 2780, 2780, 2782, 2782, 2782, 2787, 2787, 2787,
-     1312, 2914, 1640, 1640, 1640, 2916, 2917, 2917, 2917, 2781,
-     2918, 2783, 4066, 2919, 1312, 2788, 1658, 1658, 1658, 4063,
-     1642, 1677, 1677, 1677, 2833, 2833, 2833, 2969, 2969, 2969,
-     2837, 2837, 2837, 1753, 1660, 2841, 2841, 2841, 4069, 1679,
-     2844, 2844, 2844, 2977, 2977, 2977, 2846, 2846, 2846, 1312,
-     2847, 1312, 1751, 2848, 2849, 2849, 2849, 2979, 2979, 2979,
-     2978, 2980, 4065, 4096, 2981, 2851, 2851, 2851, 1750, 2923,
-
-     4097, 2850, 1312, 2950, 2982, 2982, 2982, 2936, 2983, 1312,
-     1312, 2984, 2852, 2853, 2853, 2853, 2855, 2855, 2855, 4076,
-     2856, 4071, 1748, 2857, 2858, 2858, 2858, 1416, 1416, 1416,
-     1312, 2854, 1424, 1424, 1424, 1434, 1434, 1434, 2990, 2990,
-     2990, 1312, 2859, 1747, 1312, 1418, 4072, 2867, 2867, 2867,
-     1426, 2868, 1746, 1436, 2869, 2991, 3004, 3004, 3004, 2880,
-     2880, 2880, 3006, 3006, 3006, 1312, 3007, 1312, 4077, 3008,
-     3054, 3054, 3054, 3005, 4078, 1312, 2881, 2882, 2882, 2882,
-     4073, 3009, 3009, 3009, 1312, 3010, 1312, 2987, 3011, 2985,
-     3012, 3012, 3012, 4080, 2883, 1312, 2885, 2885, 2885, 2986,
-
-     2886, 1312, 1312, 2887, 2891, 2891, 2891, 4081, 3013, 3017,
-     3017, 3017, 4074, 3018, 4075, 1312, 3019, 4079, 2893, 2893,
-     2893, 2892, 2894, 4082, 4084, 2895, 2896, 2896, 2896, 1539,
-     1539, 1539, 2899, 2899, 2899, 1743, 2900, 1312, 4088, 2901,
-     3028, 3028, 3028, 4083, 2897, 1312, 1312, 1541, 2904, 2904,
-     2904, 3030, 3030, 3030, 1742, 3031, 1312, 3029, 3032, 2906,
-     2906, 2906, 3033, 3033, 3033, 2905, 3034, 1312, 1312, 3035,
-     2908, 2908, 2908, 2910, 2910, 2910, 2907, 2911, 1312, 4086,
-     2912, 2913, 2913, 2913, 2915, 2915, 2915, 4087, 2909, 3036,
-     3036, 3036, 3026, 3037, 4085, 4100, 3038, 1312, 2914, 1740,
-
-     1736, 2916, 3039, 3039, 3039, 4092, 3040, 1735, 1312, 3041,
-     2917, 2917, 2917, 1731, 2918, 4090, 4093, 2919, 3049, 3049,
-     3049, 3051, 3051, 3051, 1640, 1640, 1640, 3055, 3055, 3055,
-     1658, 1658, 1658, 4089, 1312, 3050, 1312, 1312, 3052, 3080,
-     3080, 3080, 1642, 1730, 3056, 3082, 3082, 3082, 1660, 3100,
-     3100, 3100, 2969, 2969, 2969, 4091, 3081, 3105, 3105, 3105,
-     2977, 2977, 2977, 3083, 3109, 3109, 3109, 4094, 3110, 4095,
-     4098, 3111, 2979, 2979, 2979, 1729, 2980, 2978, 1728, 2981,
-     2982, 2982, 2982, 1312, 2983, 1312, 1312, 2984, 1416, 1416,
-     1416, 3067, 1424, 1424, 1424, 1727, 3053, 1434, 1434, 1434,
-
-     3120, 3120, 3120, 2990, 2990, 2990, 1418, 3122, 3122, 3122,
-     1426, 3123, 1726, 1725, 3124, 1436, 4099, 3121, 4102, 4103,
-     2991, 3125, 3125, 3125, 3004, 3004, 3004, 3138, 3138, 3138,
-     1724, 3139, 1312, 3118, 3140, 3006, 3006, 3006, 3126, 3007,
-     1723, 3005, 3008, 1722, 3117, 3009, 3009, 3009, 1721, 3010,
-     1720, 1719, 3011, 3012, 3012, 3012, 3116, 3142, 3142, 3142,
-     3017, 3017, 3017, 1718, 3018, 1717, 1716, 3019, 3151, 3151,
-     3151, 3013, 1715, 1714, 3143, 3028, 3028, 3028, 3154, 3154,
-     3154, 4101, 3155, 1713, 1711, 3156, 3152, 3030, 3030, 3030,
-     1710, 3031, 3029, 1709, 3032, 3033, 3033, 3033, 1708, 3034,
-
-     1707, 1704, 3035, 3036, 3036, 3036, 1703, 3037, 1702, 1701,
-     3038, 3039, 3039, 3039, 1700, 3040, 1699, 1698, 3041, 3049,
-     3049, 3049, 3170, 3170, 3170, 1697, 3171, 1696, 1695, 3172,
-     3051, 3051, 3051, 3173, 3173, 3173, 3050, 3174, 1694, 1693,
-     3175, 1640, 1640, 1640, 3054, 3054, 3054, 3052, 3055, 3055,
-     3055, 3177, 3177, 3177, 1692, 3178, 1691, 1690, 3179, 1642,
-     1658, 1658, 1658, 1687, 1686, 3056, 3080, 3080, 3080, 3201,
-     3201, 3201, 1685, 3202, 1684, 1683, 3203, 1682, 1660, 3082,
-     3082, 3082, 1312, 3081, 3206, 3206, 3206, 3100, 3100, 3100,
-     3222, 3222, 3222, 3105, 3105, 3105, 1665, 3083, 3226, 3226,
-
-     3226, 3207, 1922, 1657, 3176, 1656, 3109, 3109, 3109, 1655,
-     3110, 1650, 3188, 3111, 1416, 1416, 1416, 3241, 3241, 3241,
-     1434, 1434, 1434, 3120, 3120, 3120, 3245, 3245, 3245, 1649,
-     3246, 1645, 1418, 3247, 1639, 3242, 1638, 1634, 1436, 1629,
-     3121, 3122, 3122, 3122, 1625, 3123, 1624, 1616, 3124, 3125,
-     3125, 3125, 3248, 3248, 3248, 1602, 3249, 1601, 1600, 3250,
-     3138, 3138, 3138, 1597, 3139, 1591, 3126, 3140, 3142, 3142,
-     3142, 3263, 3263, 3263, 1586, 3264, 1578, 1577, 3265, 1576,
-     1575, 3240, 3243, 1574, 1573, 3143, 3151, 3151, 3151, 3154,
-     3154, 3154, 1572, 3155, 1571, 1570, 3156, 3286, 3286, 3286,
-
-     1565, 3170, 3170, 3170, 3152, 3171, 1564, 1559, 3172, 3173,
-     3173, 3173, 1558, 3174, 3287, 1552, 3175, 1640, 1640, 1640,
-     3177, 3177, 3177, 1549, 3178, 1544, 1543, 3179, 1658, 1658,
-     1658, 1538, 3201, 3201, 3201, 1642, 3202, 1527, 1522, 3203,
-     3327, 3327, 3327, 3206, 3206, 3206, 1660, 3329, 3329, 3329,
-     1521, 3330, 1520, 1516, 3331, 1511, 1500, 3328, 1922, 1494,
-     3207, 1922, 3340, 3340, 3340, 1922, 3222, 3222, 3222, 3296,
-     3342, 3342, 3342, 3343, 3343, 3343, 1493, 1492, 3305, 3226,
-     3226, 3226, 3345, 3345, 3345, 1416, 1416, 1416, 3241, 3241,
-     3241, 1434, 1434, 1434, 3245, 3245, 3245, 1488, 3246, 1487,
-
-     1486, 3247, 1474, 1418, 1473, 1472, 3242, 1471, 1470, 1436,
-     3248, 3248, 3248, 1469, 3249, 1468, 1467, 3250, 3361, 3361,
-     3361, 3373, 3373, 3373, 3263, 3263, 3263, 1466, 3264, 1460,
-     1405, 3265, 3375, 3375, 3375, 3362, 1401, 3358, 3374, 3286,
-     3286, 3286, 1396, 3394, 3394, 3394, 1395, 3395, 1390, 3376,
-     3396, 3405, 3405, 3405, 1389, 1388, 3287, 1387, 1386, 3359,
-     1658, 1658, 1658, 3327, 3327, 3327, 3431, 3431, 3431, 3406,
-     3432, 1385, 1373, 3433, 1372, 3329, 3329, 3329, 1660, 3330,
-     3328, 1922, 3331, 1371, 1922, 3340, 3340, 3340, 3342, 3342,
-     3342, 1370, 1369, 1922, 3343, 3343, 3343, 3345, 3345, 3345,
-
-     3456, 3456, 3456, 1434, 1434, 1434, 3361, 3361, 3361, 3460,
-     3460, 3460, 1368, 3461, 1367, 1366, 3462, 1365, 3457, 1364,
-     1363, 1436, 1362, 3362, 3463, 3463, 3463, 3413, 1920, 1920,
-     1920, 1920, 1920, 1920, 1920, 1920, 1920, 1361, 1360, 1920,
-     1359, 3464, 1358, 1357, 1920, 1920, 1920, 1922, 1920, 3373,
-     3373, 3373, 3472, 3472, 3472, 1356, 3473, 1353, 1352, 3474,
-     3475, 3475, 3475, 1351, 3476, 1350, 3374, 3477, 1349, 1348,
-     3458, 3375, 3375, 3375, 1920, 1920, 1920, 1920, 1920, 1920,
-     1920, 1920, 1920, 1920, 1920, 1347, 1346, 1920, 3376, 3405,
-     3405, 3405, 1920, 1920, 1920, 1922, 1920, 3394, 3394, 3394,
-
-     1345, 3395, 1342, 1341, 3396, 1340, 1339, 3406, 3509, 3509,
-     3509, 3431, 3431, 3431, 1338, 3432, 1337, 1336, 3433, 3544,
-     3544, 3544, 1920, 1920, 1335, 1334, 3510, 1333, 1326, 1922,
-     1920, 1920, 1920, 1920, 1920, 3531, 1920, 1920, 1920, 1322,
-     1321, 1920, 3545, 3545, 3545, 1320, 1920, 1920, 1920, 1922,
-     1920, 3456, 3456, 3456, 1434, 1434, 1434, 3460, 3460, 3460,
-     1319, 3461, 1318, 1315, 3462, 3544, 3544, 3544, 1313, 3457,
-     1312, 1310, 1436, 3463, 3463, 3463, 1920, 1920, 1920, 1920,
-     1920, 1920, 1920, 1920, 1920, 1920, 3531, 1308, 1307, 1920,
-     3464, 3545, 3545, 3545, 1920, 1920, 1920, 1922, 1920, 1306,
-
-     3558, 3558, 3558, 1305, 3559, 1304, 3552, 3560, 3472, 3472,
-     3472, 1302, 3473, 1299, 1297, 3474, 3475, 3475, 3475, 1296,
-     3476, 1295, 1294, 3477, 1920, 1920, 3509, 3509, 3509, 3605,
-     3605, 3605, 3618, 3618, 3618, 3620, 3620, 3620, 3558, 3558,
-     3558, 1293, 3559, 1290, 3510, 3560, 1287, 1922, 1923, 1286,
-     3619, 1285, 3621, 3634, 3634, 3634, 3644, 3644, 3644, 3662,
-     3662, 3662, 3605, 3605, 3605, 3618, 3618, 3618, 1283, 1282,
-     3635, 1279, 1278, 3645, 3620, 3620, 3620, 1312, 1276, 1273,
-     1922, 1272, 1271, 3619, 1267, 3674, 3674, 3674, 1266, 3675,
-     1264, 3621, 3676, 3634, 3634, 3634, 3689, 3689, 3689, 1263,
-
-     3690, 1262, 1261, 3691, 3644, 3644, 3644, 3662, 3662, 3662,
-     3635, 3700, 3700, 3700, 2134, 3701, 1259, 1258, 3702, 1257,
-     1256, 3645, 3674, 3674, 3674, 1312, 3675, 1255, 1254, 3676,
-     3689, 3689, 3689, 1251, 3690, 1250, 1248, 3691, 3700, 3700,
-     3700, 1245, 3701, 1243, 3717, 3702, 3914, 3914, 3914, 3914,
-     3914, 3914, 1242, 3931, 1241, 1240, 3932, 4067, 4067, 4067,
-     4067, 4067, 4067, 1239, 1312, 1234, 1232, 1312, 4105, 4105,
-     4105, 4105, 4105, 4105, 1231, 4068, 1230, 1228, 4068, 1227,
-     1226, 1223, 1222, 1221, 1220, 1218, 4106, 1217, 1216, 4106,
-      324,  324,  324,  324,  324,  324,  324,  324,  324,  325,
-
-      325,  325,  325,  325,  325,  325,  325,  325,  330,  330,
-      330,  330,  330,  330,  330,  330,  330,  333,  333,  333,
-      333,  333,  333,  333,  333,  333,  336,  336,  336,  336,
-      336,  336,  336,  336,  336,  339,  339,  339,  339,  339,
-      339,  339,  339,  339,  346,  346,  346,  346,  346,  346,
-      346,  346,  346,  353,  353,  353,  353,  353,  353,  353,
-      353,  353,  358,  358,  358,  358,  358,  358,  358,  358,
-      358,  377,  377,  377,  377,  377,  377,  377,  377,  377,
-      383,  383,  383,  383,  383,  383,  383,  383,  383,  391,
-      391,  391,  391,  391,  391,  391,  391,  391,  399,  399,
-
-      399,  399,  399,  399,  399,  399,  399,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  411,  411,  411,  411,
-      411,  411,  411,  411,  411,  417,  417,  417,  417,  417,
-      417,  417,  417,  417,  423,  423,  423,  423,  423,  423,
-      423,  423,  423,  429,  429,  429,  429,  429,  429,  429,
-      429,  429,  435,  435,  435,  435,  435,  435,  435,  435,
-      435,  442,  442,  442,  442,  442,  442,  442,  442,  442,
-      447,  447,  447,  447,  447,  447,  447,  447,  447,  454,
-      454,  454,  454,  454,  454,  454,  454,  454,  460,  460,
-      460,  460,  460,  460,  460,  460,  460,  467,  467,  467,
-
-      467,  467,  467,  467,  467,  467,  476,  476,  476,  476,
-      476,  476,  476,  476,  476,  482,  482,  482,  482,  482,
-      482,  482,  482,  482,  493,  493,  493,  493,  493,  493,
-      493,  493,  493,  500,  500,  500,  500,  500,  500,  500,
-      500,  500,  504,  504,  504,  504,  504,  504,  504,  504,
-      504,  511,  511,  511,  511,  511,  511,  511,  511,  511,
-      519,  519,  519,  519,  519,  519,  519,  519,  519,  527,
-      527,  527,  527,  527,  527,  527,  527,  527,  533,  533,
-      533,  533,  533,  533,  533,  533,  533,  539,  539,  539,
-      539,  539,  539,  539,  539,  539,  543,  543,  543,  543,
-
-      543,  543,  543,  543,  543,  551,  551,  551,  551,  551,
-      551,  551,  551,  551,  558,  558,  558,  558,  558,  558,
-      558,  558,  558,  565,  565,  565,  565,  565,  565,  565,
-      565,  565,  570,  570,  570,  570,  570,  570,  570,  570,
-      570,  576,  576,  576,  576,  576,  576,  576,  576,  576,
-      581,  581,  581,  581,  581,  581,  581,  581,  581,  587,
-      587,  587,  587,  587,  587,  587,  587,  587,  592,  592,
-      592,  592,  592,  592,  592,  592,  592,  598,  598,  598,
-      598,  598,  598,  598,  598,  598,  607,  607,  607,  607,
-      607,  607,  607,  607,  607,  614,  614,  614,  614,  614,
-
-      614,  614,  614,  614,  618,  618,  618,  618,  618,  618,
-      618,  618,  618,  629,  629,  629,  629,  629,  629,  629,
-      629,  629,  637,  637,  637,  637,  637,  637,  637,  637,
-      637,  644,  644,  644,  644,  644,  644,  644,  644,  644,
-      649,  649,  649,  649,  649,  649,  649,  649,  649,  655,
-      655,  655,  655,  655,  655,  655,  655,  655,  663,  663,
-      663,  663,  663,  663,  663,  663,  663,  669,  669,  669,
-      669,  669,  669,  669,  669,  669,  674,  674,  674,  674,
-      674,  674,  674,  674,  674,  681,  681,  681,  681,  681,
-      681,  681,  681,  681,  686,  686,  686,  686,  686,  686,
-
-      686,  686,  686,  692,  692,  692,  692,  692,  692,  692,
-      692,  692,  699,  699,  699,  699,  699,  699,  699,  699,
-      699,  706,  706,  706,  706,  706,  706,  706,  706,  706,
-      713,  713,  713,  713,  713,  713,  713,  713,  713,  721,
-      721,  721,  721,  721,  721,  721,  721,  721,  339,  339,
-      339,  339,  339,  339,  339,  339,  339,  732,  732,  732,
-      732,  732,  732,  732,  732,  732,  738,  738,  738,  738,
-      738,  738,  738,  738,  738,  744,  744,  744,  744,  744,
-      744,  744,  744,  744,  749,  749,  749,  749,  749,  749,
-      749,  749,  749,  763,  763,  763,  763,  763,  763,  763,
-
-      763,  763,  769,  769,  769,  769,  769,  769,  769,  769,
-      769,  789,  789,  789, 1214, 1211, 1207,  789,  832,  832,
-      832, 1206, 1204, 1203,  832,  840,  840,  840, 1202, 1199,
-     1198,  840,  849,  849,  849, 1196, 1195, 1189,  849,  853,
-      853,  853, 1188, 1187, 1185,  853,  859,  859,  859, 1184,
-     1183, 1178,  859,  865,  865,  865, 1177, 1173, 1171,  865,
-      870,  870,  870, 1170, 1169, 1168,  870,  876,  876,  876,
-     1167, 1166, 1165,  876,  886,  886,  886, 1164, 1163, 1162,
-      886,  903,  903,  903, 1159, 1156, 1155,  903,  907,  907,
-      907, 1153, 1152, 1151,  907,  917,  917,  917, 1150, 1149,
-
-     1144,  917,  923,  923,  923, 1142, 1141, 1140,  923,  927,
-      927,  927, 1139, 1137, 1136,  927,  935,  935,  935, 1135,
-     1133, 1132,  935,  940,  940,  940, 1131, 1130, 1128,  940,
-      945,  945,  945, 1125, 1124, 1122,  945,  950,  950,  950,
-     1120, 1118, 1117,  950,  961,  961,  961, 1116, 1115, 1114,
-      961,  971,  971,  971, 1113, 1112, 1110,  971,  979,  979,
-      979, 1109, 1108, 1107,  979,  984,  984,  984, 1103, 1102,
-     1101,  984,  995,  995,  995, 1099, 1098, 1097,  995, 1001,
-     1001, 1001, 1096, 1093, 1092, 1001, 1006, 1006, 1006, 1091,
-     1086, 1084, 1006, 1013, 1013, 1013, 1083, 1082, 1076, 1013,
-
-     1021, 1021, 1021, 1075, 1074, 1073, 1021, 1029, 1029, 1029,
-     1065, 1064, 1062, 1029, 1035, 1035, 1035, 1059, 1058, 1057,
-     1035, 1041, 1041, 1041, 1056, 1051, 1048, 1041, 1047, 1047,
-     1047, 1047, 1047, 1047, 1047, 1050, 1047,  789,  789,  789,
-     1043, 1042, 1040,  789, 1063, 1039,  806, 1037, 1063,  832,
-      832,  832, 1036, 1034, 1032,  832, 1111, 1031, 1030, 1028,
-     1111,  840,  840,  840, 1027, 1024, 1023,  840, 1119, 1022,
-     1020, 1019, 1119,  849,  849,  849, 1017, 1016, 1015,  849,
-     1123, 1014, 1012, 1011, 1123,  853,  853,  853, 1010, 1009,
-     1008,  853, 1129, 1007, 1005, 1003, 1129,  859,  859,  859,
-
-     1002, 1000,  996,  859, 1134,  994,  990,  986, 1134,  865,
-      865,  865,  985,  983,  981,  865, 1138,  980,  978,  976,
-     1138,  870,  870,  870,  975,  974,  973,  870, 1143,  972,
-      970,  962, 1143,  876,  876,  876,  960,  955,  954,  876,
-     1154,  953,  952,  951, 1154,  886,  886,  886,  949,  947,
-      946,  886, 1172,  944,  942,  941, 1172,  903,  903,  903,
-      939,  937,  936,  903, 1176,  934,  933,  930, 1176,  907,
-      907,  907,  929,  928,  926,  907, 1186,  924,  922,  920,
-     1186,  917,  917,  917,  919,  918,  916,  917, 1194,  915,
-      911,  910, 1194,  923,  923,  923,  909,  908,  906,  923,
-
-     1197,  905,  904,  902, 1197,  927,  927,  927,  901,  900,
-      894,  927, 1205,  890,  889,  885, 1205,  935,  935,  935,
-      881,  880,  879,  935, 1210,  878,  877,  875, 1210,  940,
-      940,  940,  873,  872,  871,  940, 1215,  869,  867,  866,
-     1215,  945,  945,  945,  864,  862,  861,  945, 1219,  860,
-      858,  856, 1219,  950,  950,  950,  855,  854,  852,  950,
-     1229,  850,  848,  847, 1229,  961,  961,  961,  845,  844,
-      843,  961, 1233,  842,  841,  839, 1233,  971,  971,  971,
-      834,  833,  831,  971, 1244, 4107, 4107,  806, 1244,  979,
-      979,  979,  791,  790,  788,  979, 1249,  787,  781,  780,
-
-     1249,  984,  984,  984,  781,  780,  779,  984, 1260,  778,
-     4107, 4107, 1260,  995,  995,  995, 4107, 4107, 4107,  995,
-     1265, 4107, 4107, 4107, 1265, 1001, 1001, 1001, 4107, 4107,
-     4107, 1001, 1270, 4107, 4107, 4107, 1270, 1006, 1006, 1006,
-     4107, 4107, 4107, 1006, 1277, 4107, 4107, 4107, 1277, 1013,
-     1013, 1013, 4107, 4107, 4107, 1013, 1284, 4107, 4107, 4107,
-     1284, 1021, 1021, 1021, 4107, 4107, 4107, 1021, 1292, 4107,
-     4107, 4107, 1292, 1029, 1029, 1029, 4107, 4107, 4107, 1029,
-     1298, 4107, 4107, 4107, 1298, 1035, 1035, 1035, 4107, 4107,
-     4107, 1035, 1303, 4107, 4107, 4107, 1303, 1041, 1041, 1041,
-
-     4107, 4107, 4107, 1041, 1309, 4107, 4107, 4107, 1309, 1311,
-     1311, 1311, 1311, 1311, 1311, 1311, 1311, 1311, 1317, 4107,
-     4107, 4107, 4107, 1317,  789,  789,  789, 4107, 4107, 4107,
-      789, 1328, 1328, 1328, 1328, 4107, 4107, 1328, 1328,  832,
-      832,  832,  832, 4107,  832, 4107,  832, 1382, 1382, 1382,
-     1382, 4107, 4107, 1382, 1382,  840,  840,  840, 4107, 4107,
-     4107,  840, 1392, 1392, 1392, 1392, 4107, 4107, 1392, 1392,
-      849,  849,  849, 4107, 4107, 4107,  849, 1398, 1398, 1398,
-     1398, 4107, 4107, 1398, 1398,  853,  853,  853, 4107, 4107,
-     4107,  853, 1407, 1407, 1407, 1407, 4107, 4107, 1407, 1407,
-
-      859,  859,  859,  859, 4107,  859, 4107,  859, 1417, 1417,
-     1417, 1417, 4107, 4107, 1417, 1417,  865,  865,  865,  865,
-     4107,  865, 4107,  865, 1425, 1425, 1425, 1425, 4107, 4107,
-     1425, 1425,  870,  870,  870,  870, 4107,  870, 4107,  870,
-     1435, 1435, 1435, 1435, 4107, 4107, 1435, 1435,  876,  876,
-      876,  876, 4107,  876, 4107,  876, 1451, 1451, 1451, 1451,
-     4107, 4107, 1451, 1451,  886,  886,  886, 4107, 4107, 4107,
-      886, 1476, 1476, 1476, 1476, 4107, 4107, 1476, 1476, 1483,
-     1483, 1483, 1483, 4107, 4107, 1483, 1483,  907,  907,  907,
-     4107, 4107, 4107,  907, 1496, 1496, 1496, 1496, 4107, 4107,
-
-     1496, 1496,  917,  917,  917, 4107, 4107, 4107,  917, 1508,
-     1508, 1508, 1508, 4107, 4107, 1508, 1508,  923,  923,  923,
-     4107, 4107, 4107,  923, 1513, 1513, 1513, 1513, 4107, 4107,
-     1513, 1513,  927,  927,  927, 4107, 4107, 4107,  927, 1524,
-     1524, 1524, 1524, 4107, 4107, 1524, 1524,  935,  935,  935,
-     4107, 4107, 4107,  935, 1532, 1532, 1532, 1532, 4107, 4107,
-     1532, 1532,  940,  940,  940, 4107, 4107, 4107,  940, 1540,
-     1540, 1540, 1540, 4107, 4107, 1540, 1540,  945,  945,  945,
-     4107, 4107, 4107,  945, 1546, 1546, 1546, 1546, 4107, 4107,
-     1546, 1546,  950,  950,  950, 4107, 4107, 4107,  950, 1561,
-
-     1561, 1561, 1561, 4107, 4107, 1561, 1561,  961,  961,  961,
-     4107, 4107, 4107,  961, 1567, 1567, 1567, 1567, 4107, 4107,
-     1567, 1567,  971,  971,  971, 4107, 4107, 4107,  971, 1580,
-     1580, 1580, 1580, 4107, 4107, 1580, 1580,  979,  979,  979,
-     4107, 4107, 4107,  979, 1588, 1588, 1588, 1588, 4107, 4107,
-     1588, 1588,  984,  984,  984, 4107, 4107, 4107,  984, 1604,
-     1604, 1604, 1604, 4107, 4107, 1604, 1604,  995,  995,  995,
-      995, 4107,  995, 4107,  995, 1613, 1613, 1613, 1613, 4107,
-     4107, 1613, 1613, 1001, 1001, 1001, 4107, 4107, 4107, 1001,
-     1621, 1621, 1621, 1621, 4107, 4107, 1621, 1621, 1006, 1006,
-
-     1006, 4107, 4107, 4107, 1006, 1631, 1631, 1631, 1631, 4107,
-     4107, 1631, 1631, 1013, 1013, 1013, 4107, 4107, 4107, 1013,
-     1641, 1641, 1641, 1641, 4107, 4107, 1641, 1641, 1021, 1021,
-     1021, 4107, 4107, 4107, 1021, 1652, 1652, 1652, 1652, 4107,
-     4107, 1652, 1652, 1029, 1029, 1029, 4107, 4107, 4107, 1029,
-     1659, 1659, 1659, 1659, 4107, 4107, 1659, 1659, 1035, 1035,
-     1035, 4107, 4107, 4107, 1035, 1667, 1667, 1667, 1667, 4107,
-     4107, 1667, 1667, 1041, 1041, 1041, 1041, 4107, 1041, 4107,
-     1041, 1678, 1678, 1678, 1678, 4107, 4107, 1678, 1678, 1311,
-     1311, 1311, 1311, 1311, 1311, 1311, 1311, 1311, 1317, 4107,
-
-     1317, 4107, 4107, 1317,  789,  789,  789, 4107, 4107, 4107,
-      789, 1328, 1328, 1328, 1328, 4107, 4107, 1328, 1328,  832,
-      832,  832, 4107, 4107, 4107,  832, 1382, 1382, 1382, 1382,
-     4107, 4107, 1382, 1382,  840,  840,  840, 4107, 4107, 4107,
-      840, 1392, 1392, 1392, 1392, 4107, 4107, 1392, 1392,  849,
-      849,  849, 4107, 4107, 4107,  849, 1398, 1398, 1398, 1398,
-     4107, 4107, 1398, 1398,  853,  853,  853, 4107, 4107, 4107,
-      853, 1407, 1407, 1407, 1407, 4107, 4107, 1407, 1407,  859,
-      859,  859, 4107, 4107, 4107,  859, 1417, 1417, 1417, 1417,
-     4107, 4107, 1417, 1417, 1425, 1425, 1425, 1425, 4107, 4107,
-
-     1425, 1425,  870,  870,  870, 4107, 4107, 4107,  870, 1435,
-     1435, 1435, 1435, 4107, 4107, 1435, 1435,  876,  876,  876,
-     4107, 4107, 4107,  876, 1451, 1451, 1451, 1451, 4107, 4107,
-     1451, 1451,  886,  886,  886, 4107, 4107, 4107,  886, 1476,
-     1476, 1476, 1476, 4107, 4107, 1476, 1476, 1483, 1483, 1483,
-     1483, 4107, 4107, 1483, 1483,  907,  907,  907, 4107, 4107,
-     4107,  907, 1496, 1496, 1496, 1496, 4107, 4107, 1496, 1496,
-      917,  917,  917,  917, 4107,  917, 4107,  917, 1508, 1508,
-     1508, 1508, 4107, 4107, 1508, 1508,  923,  923,  923,  923,
-     4107,  923, 4107,  923, 1513, 1513, 1513, 1513, 4107, 4107,
-
-     1513, 1513,  927,  927,  927, 4107, 4107, 4107,  927, 1524,
-     1524, 1524, 1524, 4107, 4107, 1524, 1524,  935,  935,  935,
-     4107, 4107, 4107,  935, 1532, 1532, 1532, 1532, 4107, 4107,
-     1532, 1532,  940,  940,  940, 4107, 4107, 4107,  940, 1540,
-     1540, 1540, 1540, 4107, 4107, 1540, 1540,  945,  945,  945,
-      945, 4107,  945, 4107,  945, 1546, 1546, 1546, 1546, 4107,
-     4107, 1546, 1546,  950,  950,  950, 4107, 4107, 4107,  950,
-     1561, 1561, 1561, 1561, 4107, 4107, 1561, 1561,  961,  961,
-      961, 4107, 4107, 4107,  961, 1567, 1567, 1567, 1567, 4107,
-     4107, 1567, 1567,  971,  971,  971, 4107, 4107, 4107,  971,
-
-     1580, 1580, 1580, 1580, 4107, 4107, 1580, 1580,  979,  979,
-      979, 4107, 4107, 4107,  979, 1588, 1588, 1588, 1588, 4107,
-     4107, 1588, 1588,  984,  984,  984, 4107, 4107, 4107,  984,
-     1604, 1604, 1604, 1604, 4107, 4107, 1604, 1604,  995,  995,
-      995, 4107, 4107, 4107,  995, 1613, 1613, 1613, 1613, 4107,
-     4107, 1613, 1613, 1001, 1001, 1001, 4107, 4107, 4107, 1001,
-     1621, 1621, 1621, 1621, 4107, 4107, 1621, 1621, 1006, 1006,
-     1006, 4107, 4107, 4107, 1006, 1631, 1631, 1631, 1631, 4107,
-     4107, 1631, 1631, 1013, 1013, 1013, 4107, 4107, 4107, 1013,
-     1641, 1641, 1641, 1641, 4107, 4107, 1641, 1641, 1021, 1021,
-
-     1021, 1021, 4107, 1021, 4107, 1021, 1652, 1652, 1652, 1652,
-     4107, 4107, 1652, 1652, 1029, 1029, 1029, 4107, 4107, 4107,
-     1029, 1659, 1659, 1659, 1659, 4107, 4107, 1659, 1659, 1035,
-     1035, 1035, 4107, 4107, 4107, 1035, 1667, 1667, 1667, 1667,
-     4107, 4107, 1667, 1667, 1041, 1041, 1041, 4107, 4107, 4107,
-     1041, 1678, 1678, 1678, 1678, 4107, 4107, 1678, 1678, 1311,
-     1311, 1311, 1311, 1311, 1311, 1311, 1311, 1311, 1920, 1920,
-     1920, 1920, 1920, 1920, 1920, 1920, 1920,  789,  789,  789,
-     4107, 4107, 4107,  789,  832,  832,  832, 4107, 4107, 4107,
-      832, 1382, 1382, 1382, 1382, 4107, 4107, 1382, 1382,  840,
-
-      840,  840, 4107, 4107, 4107,  840, 1392, 1392, 1392, 1392,
-     4107, 4107, 1392, 1392,  849,  849,  849,  849, 4107,  849,
-     4107,  849, 1398, 1398, 1398, 1398, 4107, 4107, 1398, 1398,
-      853,  853,  853, 4107, 4107, 4107,  853, 1407, 1407, 1407,
-     1407, 4107, 4107, 1407, 1407,  859,  859,  859, 4107, 4107,
-     4107,  859, 1417, 1417, 1417, 1417, 4107, 4107, 1417, 1417,
-     1425, 1425, 1425, 1425, 4107, 4107, 1425, 1425,  870,  870,
-      870, 4107, 4107, 4107,  870, 1435, 1435, 1435, 1435, 4107,
-     4107, 1435, 1435,  876,  876,  876, 4107, 4107, 4107,  876,
-     1451, 1451, 1451, 1451, 4107, 4107, 1451, 1451,  886,  886,
-
-      886,  886, 4107,  886, 4107,  886, 1476, 1476, 1476, 1476,
-     4107, 4107, 1476, 1476, 1483, 1483, 1483, 1483, 4107, 4107,
-     1483, 1483,  907,  907,  907, 4107, 4107, 4107,  907, 1496,
-     1496, 1496, 1496, 4107, 4107, 1496, 1496, 1508, 1508, 1508,
-     1508, 4107, 4107, 1508, 1508, 1513, 1513, 1513, 1513, 4107,
-     4107, 1513, 1513,  927,  927,  927, 4107, 4107, 4107,  927,
-     1524, 1524, 1524, 1524, 4107, 4107, 1524, 1524,  935,  935,
-      935, 4107, 4107, 4107,  935, 1532, 1532, 1532, 1532, 4107,
-     4107, 1532, 1532,  940,  940,  940,  940, 4107,  940, 4107,
-      940, 1540, 1540, 1540, 1540, 4107, 4107, 1540, 1540,  945,
-
-      945,  945, 4107, 4107, 4107,  945, 1546, 1546, 1546, 1546,
-     4107, 4107, 1546, 1546,  950,  950,  950, 4107, 4107, 4107,
-      950, 1561, 1561, 1561, 1561, 4107, 4107, 1561, 1561,  961,
-      961,  961, 4107, 4107, 4107,  961, 1567, 1567, 1567, 1567,
-     4107, 4107, 1567, 1567,  971,  971,  971, 4107, 4107, 4107,
-      971, 1580, 1580, 1580, 1580, 4107, 4107, 1580, 1580,  979,
-      979,  979,  979, 4107,  979, 4107,  979, 1588, 1588, 1588,
-     1588, 4107, 4107, 1588, 1588,  984,  984,  984, 4107, 4107,
-     4107,  984, 1604, 1604, 1604, 1604, 4107, 4107, 1604, 1604,
-      995,  995,  995, 4107, 4107, 4107,  995, 1613, 1613, 1613,
-
-     1613, 4107, 4107, 1613, 1613, 1001, 1001, 1001, 4107, 4107,
-     4107, 1001, 1621, 1621, 1621, 1621, 4107, 4107, 1621, 1621,
-     1006, 1006, 1006, 4107, 4107, 4107, 1006, 1631, 1631, 1631,
-     1631, 4107, 4107, 1631, 1631, 1013, 1013, 1013, 4107, 4107,
-     4107, 1013, 1641, 1641, 1641, 1641, 4107, 4107, 1641, 1641,
-     1021, 1021, 1021, 4107, 4107, 4107, 1021, 1652, 1652, 1652,
-     1652, 4107, 4107, 1652, 1652, 1029, 1029, 1029, 4107, 4107,
-     4107, 1029, 1659, 1659, 1659, 1659, 4107, 4107, 1659, 1659,
-     1035, 1035, 1035, 4107, 4107, 4107, 1035, 1667, 1667, 1667,
-     1667, 4107, 4107, 1667, 1667, 1041, 1041, 1041, 4107, 4107,
-
-     4107, 1041, 1678, 1678, 1678, 1678, 4107, 4107, 1678, 1678,
-     1311, 1311, 1311, 1311, 1311, 1311, 1311, 1311, 1311, 1920,
-     1920, 1920, 1920, 1920, 1920, 1920, 1920, 1920,  789,  789,
-      789, 4107, 4107, 4107,  789,  832,  832,  832,  832, 4107,
-      832, 4107,  832, 1382, 1382, 1382, 1382, 4107, 4107, 1382,
-     1382,  840,  840,  840, 4107, 4107, 4107,  840, 1392, 1392,
-     1392, 1392, 4107, 4107, 1392, 1392, 1398, 1398, 1398, 1398,
-     4107, 4107, 1398, 1398,  853,  853,  853, 4107, 4107, 4107,
-      853, 1407, 1407, 1407, 1407, 4107, 4107, 1407, 1407,  859,
-      859,  859,  859, 4107,  859, 4107,  859, 1417, 1417, 1417,
-
-     1417, 4107, 4107, 1417, 1417, 1425, 1425, 1425, 1425, 4107,
-     4107, 1425, 1425,  870,  870,  870,  870, 4107,  870, 4107,
-      870, 1435, 1435, 1435, 1435, 4107, 4107, 1435, 1435,  876,
-      876,  876,  876, 4107,  876, 4107,  876, 1451, 1451, 1451,
-     1451, 4107, 4107, 1451, 1451,  886,  886,  886,  886, 4107,
-      886, 4107,  886, 1476, 1476, 1476, 1476, 4107, 4107, 1476,
-     1476, 1483, 1483, 1483, 1483, 4107, 4107, 1483, 1483,  907,
-      907,  907, 4107, 4107, 4107,  907, 1496, 1496, 1496, 1496,
-     4107, 4107, 1496, 1496, 1508, 1508, 1508, 1508, 4107, 4107,
-     1508, 1508, 1513, 1513, 1513, 1513, 4107, 4107, 1513, 1513,
-
-      927,  927,  927, 4107, 4107, 4107,  927, 1524, 1524, 1524,
-     1524, 4107, 4107, 1524, 1524,  935,  935,  935, 4107, 4107,
-     4107,  935, 1532, 1532, 1532, 1532, 4107, 4107, 1532, 1532,
-     1540, 1540, 1540, 1540, 4107, 4107, 1540, 1540,  945,  945,
-      945, 4107, 4107, 4107,  945, 1546, 1546, 1546, 1546, 4107,
-     4107, 1546, 1546,  950,  950,  950, 4107, 4107, 4107,  950,
-     1561, 1561, 1561, 1561, 4107, 4107, 1561, 1561,  961,  961,
-      961, 4107, 4107, 4107,  961, 1567, 1567, 1567, 1567, 4107,
-     4107, 1567, 1567,  971,  971,  971, 4107, 4107, 4107,  971,
-     1580, 1580, 1580, 1580, 4107, 4107, 1580, 1580, 1588, 1588,
-
-     1588, 1588, 4107, 4107, 1588, 1588,  984,  984,  984, 4107,
-     4107, 4107,  984, 1604, 1604, 1604, 1604, 4107, 4107, 1604,
-     1604,  995,  995,  995, 4107, 4107, 4107,  995, 1613, 1613,
-     1613, 1613, 4107, 4107, 1613, 1613, 1001, 1001, 1001, 4107,
-     4107, 4107, 1001, 1621, 1621, 1621, 1621, 4107, 4107, 1621,
-     1621, 1006, 1006, 1006, 1006, 4107, 1006, 4107, 1006, 1631,
-     1631, 1631, 1631, 4107, 4107, 1631, 1631, 1013, 1013, 1013,
-     4107, 4107, 4107, 1013, 1641, 1641, 1641, 1641, 4107, 4107,
-     1641, 1641, 1021, 1021, 1021, 4107, 4107, 4107, 1021, 1652,
-     1652, 1652, 1652, 4107, 4107, 1652, 1652, 1029, 1029, 1029,
-
-     4107, 4107, 4107, 1029, 1659, 1659, 1659, 1659, 4107, 4107,
-     1659, 1659, 1035, 1035, 1035, 4107, 4107, 4107, 1035, 1667,
-     1667, 1667, 1667, 4107, 4107, 1667, 1667, 1041, 1041, 1041,
-     1041, 4107, 1041, 4107, 1041, 1678, 1678, 1678, 1678, 4107,
-     4107, 1678, 1678, 1311, 1311, 1311, 1311, 1311, 1311, 1311,
-     1311, 1311, 1920, 1920, 1920, 1920, 1920, 1920, 1920, 1920,
-     1920,  789,  789,  789,  789, 4107,  789, 4107,  789,  832,
-      832,  832, 4107, 4107, 4107,  832, 1382, 1382, 1382, 1382,
-     4107, 4107, 1382, 1382,  840,  840,  840, 4107, 4107, 4107,
-      840, 1392, 1392, 1392, 1392, 4107, 4107, 1392, 1392, 1398,
-
-     1398, 1398, 1398, 4107, 4107, 1398, 1398,  853,  853,  853,
-     4107, 4107, 4107,  853, 1407, 1407, 1407, 1407, 4107, 4107,
-     1407, 1407, 1417, 1417, 1417, 1417, 4107, 4107, 1417, 1417,
-     1425, 1425, 1425, 1425, 4107, 4107, 1425, 1425, 1435, 1435,
-     1435, 1435, 4107, 4107, 1435, 1435,  876,  876,  876,  876,
-     4107,  876, 4107,  876, 1451, 1451, 1451, 1451, 4107, 4107,
-     1451, 1451,  886,  886,  886, 4107, 4107, 4107,  886, 1476,
-     1476, 1476, 1476, 4107, 4107, 1476, 1476, 1483, 1483, 1483,
-     1483, 4107, 4107, 1483, 1483,  907,  907,  907, 4107, 4107,
-     4107,  907, 1508, 1508, 1508, 1508, 4107, 4107, 1508, 1508,
-
-     1513, 1513, 1513, 1513, 4107, 4107, 1513, 1513,  927,  927,
-      927, 4107, 4107, 4107,  927,  935,  935,  935, 4107, 4107,
-     4107,  935, 1532, 1532, 1532, 1532, 4107, 4107, 1532, 1532,
-     1540, 1540, 1540, 1540, 4107, 4107, 1540, 1540,  945,  945,
-      945, 4107, 4107, 4107,  945, 1546, 1546, 1546, 1546, 4107,
-     4107, 1546, 1546,  950,  950,  950, 4107, 4107, 4107,  950,
-      961,  961,  961,  961, 4107,  961, 4107,  961, 1567, 1567,
-     1567, 1567, 4107, 4107, 1567, 1567,  971,  971,  971, 4107,
-     4107, 4107,  971, 1580, 1580, 1580, 1580, 4107, 4107, 1580,
-     1580,  984,  984,  984, 4107, 4107, 4107,  984, 1604, 1604,
-
-     1604, 1604, 4107, 4107, 1604, 1604,  995,  995,  995, 4107,
-     4107, 4107,  995, 1613, 1613, 1613, 1613, 4107, 4107, 1613,
-     1613, 1001, 1001, 1001, 4107, 4107, 4107, 1001, 1621, 1621,
-     1621, 1621, 4107, 4107, 1621, 1621, 1006, 1006, 1006, 1006,
-     4107, 1006, 4107, 1006, 1631, 1631, 1631, 1631, 4107, 4107,
-     1631, 1631, 1013, 1013, 1013, 1013, 4107, 1013, 4107, 1013,
-     1641, 1641, 1641, 1641, 4107, 4107, 1641, 1641, 1021, 1021,
-     1021, 4107, 4107, 4107, 1021, 1652, 1652, 1652, 1652, 4107,
-     4107, 1652, 1652, 1029, 1029, 1029, 1029, 4107, 1029, 4107,
-     1029, 1659, 1659, 1659, 1659, 4107, 4107, 1659, 1659, 1035,
-
-     1035, 1035, 1035, 4107, 1035, 4107, 1035, 1041, 1041, 1041,
-     4107, 4107, 4107, 1041, 1678, 1678, 1678, 1678, 4107, 4107,
-     1678, 1678, 1311, 1311, 1311, 1311, 1311, 1311, 1311, 1311,
-     1311, 1920, 1920, 1920, 1920, 1920, 1920, 1920, 1920, 1920,
-      832,  832,  832, 4107, 4107, 4107,  832, 1382, 1382, 1382,
-     1382, 4107, 4107, 1382, 1382,  840,  840,  840,  840, 4107,
-      840, 4107,  840, 1398, 1398, 1398, 1398, 4107, 4107, 1398,
-     1398,  853,  853,  853, 4107, 4107, 4107,  853, 1407, 1407,
-     1407, 1407, 4107, 4107, 1407, 1407, 1417, 1417, 1417, 1417,
-     4107, 4107, 1417, 1417, 1425, 1425, 1425, 1425, 4107, 4107,
-
-     1425, 1425, 1435, 1435, 1435, 1435, 4107, 4107, 1435, 1435,
-     1451, 1451, 1451, 1451, 4107, 4107, 1451, 1451,  886,  886,
-      886, 4107, 4107, 4107,  886, 1476, 1476, 1476, 1476, 4107,
-     4107, 1476, 1476, 1483, 1483, 1483, 1483, 4107, 4107, 1483,
-     1483,  907,  907,  907, 4107, 4107, 4107,  907, 1508, 1508,
-     1508, 1508, 4107, 4107, 1508, 1508, 1513, 1513, 1513, 1513,
-     4107, 4107, 1513, 1513,  927,  927,  927, 4107, 4107, 4107,
-      927,  935,  935,  935, 4107, 4107, 4107,  935, 1532, 1532,
-     1532, 1532, 4107, 4107, 1532, 1532, 1540, 1540, 1540, 1540,
-     4107, 4107, 1540, 1540,  945,  945,  945, 4107, 4107, 4107,
-
-      945,  950,  950,  950, 4107, 4107, 4107,  950, 1567, 1567,
-     1567, 1567, 4107, 4107, 1567, 1567,  971,  971,  971,  971,
-     4107,  971, 4107,  971, 1580, 1580, 1580, 1580, 4107, 4107,
-     1580, 1580,  984,  984,  984, 4107, 4107, 4107,  984, 1604,
-     1604, 1604, 1604, 4107, 4107, 1604, 1604,  995,  995,  995,
-     4107, 4107, 4107,  995, 1001, 1001, 1001, 4107, 4107, 4107,
-     1001, 1621, 1621, 1621, 1621, 4107, 4107, 1621, 1621, 1631,
-     1631, 1631, 1631, 4107, 4107, 1631, 1631, 1641, 1641, 1641,
-     1641, 4107, 4107, 1641, 1641, 1021, 1021, 1021, 4107, 4107,
-     4107, 1021, 1659, 1659, 1659, 1659, 4107, 4107, 1659, 1659,
-
-     1041, 1041, 1041, 4107, 4107, 4107, 1041, 1678, 1678, 1678,
-     1678, 4107, 4107, 1678, 1678, 1311, 1311, 1311, 1311, 1311,
-     1311, 1311, 1311, 1311, 1920, 1920, 1920, 1920, 1920, 1920,
-     1920, 1920, 1920,  832,  832,  832, 4107, 4107, 4107,  832,
-     1382, 1382, 1382, 1382, 4107, 4107, 1382, 1382,  840,  840,
-      840,  840, 4107,  840, 4107,  840, 1398, 1398, 1398, 1398,
-     4107, 4107, 1398, 1398,  853,  853,  853,  853, 4107,  853,
-     4107,  853, 1407, 1407, 1407, 1407, 4107, 4107, 1407, 1407,
-     1417, 1417, 1417, 1417, 4107, 4107, 1417, 1417, 1425, 1425,
-     1425, 1425, 4107, 4107, 1425, 1425, 1435, 1435, 1435, 1435,
-
-     4107, 4107, 1435, 1435, 1451, 1451, 1451, 1451, 4107, 4107,
-     1451, 1451,  886,  886,  886, 4107, 4107, 4107,  886, 1476,
-     1476, 1476, 1476, 4107, 4107, 1476, 1476,  907,  907,  907,
-     4107, 4107, 4107,  907, 1508, 1508, 1508, 1508, 4107, 4107,
-     1508, 1508, 1513, 1513, 1513, 1513, 4107, 4107, 1513, 1513,
-      927,  927,  927,  927, 4107,  927, 4107,  927,  935,  935,
-      935,  935, 4107,  935, 4107,  935, 1532, 1532, 1532, 1532,
-     4107, 4107, 1532, 1532, 1540, 1540, 1540, 1540, 4107, 4107,
-     1540, 1540,  945,  945,  945,  945, 4107,  945, 4107,  945,
-      950,  950,  950, 4107, 4107, 4107,  950, 1567, 1567, 1567,
-
-     1567, 4107, 4107, 1567, 1567,  971,  971,  971,  971, 4107,
-      971, 4107,  971, 1580, 1580, 1580, 1580, 4107, 4107, 1580,
-     1580,  984,  984,  984,  984, 4107,  984, 4107,  984,  995,
-      995,  995, 4107, 4107, 4107,  995, 1001, 1001, 1001, 4107,
-     4107, 4107, 1001, 1631, 1631, 1631, 1631, 4107, 4107, 1631,
-     1631, 1641, 1641, 1641, 1641, 4107, 4107, 1641, 1641, 1021,
-     1021, 1021, 4107, 4107, 4107, 1021, 1659, 1659, 1659, 1659,
-     4107, 4107, 1659, 1659, 1041, 1041, 1041, 4107, 4107, 4107,
-     1041, 1678, 1678, 1678, 1678, 4107, 4107, 1678, 1678, 1311,
-     1311, 1311, 1311, 1311, 1311, 1311, 1311, 1311, 1920, 1920,
-
-     1920, 1920, 1920, 1920, 1920, 1920, 1920,  832,  832,  832,
-     4107, 4107, 4107,  832,  840,  840,  840,  840, 4107,  840,
-     4107,  840, 1398, 1398, 1398, 1398, 4107, 4107, 1398, 1398,
-     1407, 1407, 1407, 1407, 4107, 4107, 1407, 1407, 1417, 1417,
-     1417, 1417, 4107, 4107, 1417, 1417, 1425, 1425, 1425, 1425,
-     4107, 4107, 1425, 1425, 1435, 1435, 1435, 1435, 4107, 4107,
-     1435, 1435,  886,  886,  886, 4107, 4107, 4107,  886,  907,
-      907,  907, 4107, 4107, 4107,  907, 1508, 1508, 1508, 1508,
-     4107, 4107, 1508, 1508,  927,  927,  927, 4107, 4107, 4107,
-      927, 1532, 1532, 1532, 1532, 4107, 4107, 1532, 1532, 1540,
-
-     1540, 1540, 1540, 4107, 4107, 1540, 1540,  950,  950,  950,
-     4107, 4107, 4107,  950, 1567, 1567, 1567, 1567, 4107, 4107,
-     1567, 1567,  971,  971,  971,  971, 4107,  971, 4107,  971,
-      984,  984,  984, 4107, 4107, 4107,  984,  995,  995,  995,
-     4107, 4107, 4107,  995, 1001, 1001, 1001, 4107, 4107, 4107,
-     1001, 3434, 3434, 3434, 3434, 3434, 3434, 3434, 3434, 3434,
-     3435, 3435, 3435, 3435, 3435, 3435, 3435, 3435, 3435, 3526,
-     3526, 3526, 3526, 3526, 3526, 3526, 3526, 3526, 3529, 3529,
-     3529, 3529, 3529, 3529, 3529, 3529, 3529, 3602, 3602, 3602,
-     3602, 3602, 3602, 3602, 3602, 3602, 3604, 3604, 3604, 3604,
-
-     3604, 3604, 3604, 3604, 3604,  323, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107
+     4192,  336,  337,  336,  336,  337,  336,  336,  337,  336,
+      336,  337,  336,  341,  337,  341,  347,  338,  344,  347,
+      338,  344, 1079,  339, 4192,  345,  339,  870,  345,  342,
+      341,  337,  341,  797,  348,  350,  351,  348,  350,  351,
+      352,  353,  815,  352,  353,  797,  342,  357,  358,  798,
+      354,  350,  351,  354,  355,  800,  352,  350,  351, 1330,
+      355,  799,  352,  357,  358,  871,  354,  369,  337,  369,
+     1860,  799,  354,  369,  337,  369,  962,  369,  337,  369,
+      369,  337,  369,  370,  337,  337,  337,  815,  963,  370,
+      844,  800,  359,  371,  828,  844,  371,  796,  796,  796,
+
+      372,  796,  796,  796,  796,  796,  796,  799,  359,  360,
+      361,  337,  361,  360,  360,  360,  360,  360,  360,  360,
+      362,  360,  360,  360, 1861,  360,  364,  360,  365,  360,
+      337,  337,  337,  369,  337,  369,  369,  337,  369,  919,
+      844,  369,  337,  369,  828,  906,  372,  859,  800,  370,
+      907, 1863,  370,  920,  860,  360,  360,  373,  369,  337,
+      369,  796,  796,  796,  799,  861,  366,  796,  796,  796,
+      796,  796,  796, 1864,  373,  367,  360,  361,  337,  361,
+      360,  360,  360,  360,  360,  360,  360,  362,  360,  360,
+      360,  911,  360,  364,  360,  365,  360,  337,  337,  337,
+
+      337,  337,  337,  369,  337,  369,  350,  351,  369,  337,
+      369,  352,  912,  374,  862,  861,  374,  819,  844,  375,
+     1867,  750,  360,  360,  375,  369,  337,  369,  369,  337,
+      369,  945,  838,  366,  337,  337,  337,  337,  337,  337,
+      946,  376,  367, 1383,  376,  369,  337,  369,  862, 1868,
+      377,  751,  844,  377,  369,  337,  369,  337,  337,  337,
+     1384,  373,  337,  337,  337,  369,  337,  369,  844,  832,
+      373, 1869,  800,  378,  369,  337,  369, 1085,  378,  836,
+     1086,  376,  369,  337,  369,  369,  337,  369,  799,  815,
+      376,  337,  337,  337,  337,  337,  337, 1871,  379,  816,
+
+      831,  379,  369,  337,  369, 1872, 1049,  380, 1008,  800,
+      380,  369,  337,  369,  337,  337,  337, 1383,  381,  337,
+      337,  337,  369,  337,  369,  799, 1879,  381,  849,  850,
+      382,  369,  337,  369, 1549,  382,  870, 1112,  379,  369,
+      337,  369,  369,  337,  369,  851,  871,  379,  796,  796,
+      796, 1113,  829,  841, 1217,  383, 1050, 1218,  383,  384,
+      385,  337,  385,  384,  384,  384,  384,  384,  384,  384,
+      386,  384,  384,  384,  800,  384,  388,  384,  389,  384,
+      394,  337,  394,  394,  337,  394,  337,  337,  337,  844,
+      799,  337,  337,  337,  942, 1694,  395,  800,  943,  395,
+
+     1880, 1099,  396,  815,  875,  384,  384,  396,  394,  337,
+      394,  390, 1384,  799,  391,  796,  796,  796,  796,  796,
+      796,  796,  796,  796,  395, 1100,  392,  384,  385,  337,
+      385,  384,  384,  384,  384,  384,  384,  384,  386,  384,
+      384,  384,  854,  384,  388,  384,  389,  384,  394,  337,
+      394,  394,  337,  394,  394,  337,  394, 1101,  826,  410,
+      337,  410,  987, 1881,  395,  800,  988,  397, 1102, 1119,
+      397, 1103,  881,  384,  384,  411,  410,  337,  410,  390,
+      887,  799,  391,  796,  796,  796,  796,  796,  796,  796,
+      796,  796,  411, 1120,  392,  398,  399,  337,  399,  398,
+
+      398,  398,  398,  398,  398,  398,  400,  398,  398,  398,
+      800,  398,  402,  398,  403,  398,  337,  337,  337,  337,
+      337,  337,  410,  337,  410,  892,  799,  410,  337,  410,
+     1600,  800,  412,  844,  800,  412, 1601,  800,  411, 1882,
+      898,  398,  398,  411,  410,  337,  410,  799, 1756,  404,
+      799,  405,  887,  799,  406,  796,  796,  796,  407, 1884,
+      413, 1757,  408,  398,  399,  337,  399,  398,  398,  398,
+      398,  398,  398,  398,  400,  398,  398,  398,  844,  398,
+      402,  398,  403,  398,  410,  337,  410,  422,  337,  422,
+      422,  337,  422,  844,  915,  434,  337,  434, 1886,  800,
+
+      413,  862,  916,  423, 1892,  844,  423, 1121,  917,  398,
+      398,  435,  434,  337,  434,  799, 1756,  404, 1122,  405,
+      892, 1103,  406,  796,  796,  796,  407,  956,  435, 1763,
+      408,  414,  415,  337,  415,  414,  414,  414,  414,  414,
+      414,  414,  416,  414,  414,  414,  995,  414,  418,  414,
+      419,  414,  446,  337,  446,  446,  337,  446,  337,  337,
+      337, 1000,  921,  337,  337,  337,  832, 1893,  447,  862,
+      922,  447, 1894,  844,  396,  923,  836,  414,  414,  396,
+      446,  337,  446,  446,  337,  446,  796,  796,  796,  796,
+      796,  796,  796,  796,  796, 1895,  447, 1899, 1900,  447,
+
+     1902,  420,  414,  415,  337,  415,  414,  414,  414,  414,
+      414,  414,  414,  416,  414,  414,  414,  800,  414,  418,
+      414,  419,  414,  446,  337,  446,  446,  337,  446,  458,
+      337,  458, 1112,  799,  458,  337,  458, 1028, 1903,  448,
+     1905, 1906,  448, 1908, 1029,  459, 1127,  800,  414,  414,
+      459,  337,  337,  337,  337,  337,  337,  796,  796,  796,
+      796,  796,  796,  799, 1075,  898, 1909,  396,  805, 1912,
+      396, 1076,  420,  424,  425,  337,  425,  424,  424,  424,
+      424,  424,  424,  424,  426,  424,  424,  424,  800,  424,
+      428,  424,  429,  424,  458,  337,  458,  458,  337,  458,
+
+      458,  337,  458, 1913,  799,  458,  337,  458, 1119, 1914,
+      459,  806,  925,  459,  862,  800,  460,  807,  844,  424,
+      424,  460,  808,  430,  796,  796,  796,  809, 1916,  944,
+      431,  799, 1132,  432,  424,  425,  337,  425,  424,  424,
+      424,  424,  424,  424,  424,  426,  424,  424,  424, 1022,
+      424,  428,  424,  429,  424,  471,  337,  471,  471,  337,
+      471,  337,  337,  337, 1023,  844,  337,  337,  337,  800,
+      945,  472,  929,  935,  472, 1079,  908,  396,  944,  946,
+      424,  424,  396,  956,  430,  799,  796,  796,  796, 1351,
+     1080,  431, 1918, 1731,  432,  436,  437,  337,  437,  436,
+
+      436,  436,  436,  436,  436,  436,  438,  436,  436,  436,
+     1099,  436,  440,  436,  441,  436,  471,  337,  471,  471,
+      337,  471,  471,  337,  471,  844,  844,  471,  337,  471,
+     1927,  844,  472,  800, 1120,  472,  844, 1099,  473, 1930,
+      952,  436,  436,  473,  487,  337,  487,  442, 1938,  799,
+      443,  796,  796,  796,  796,  796,  796,  796,  796,  796,
+      488, 1132,  444,  436,  437,  337,  437,  436,  436,  436,
+      436,  436,  436,  436,  438,  436,  436,  436,  800,  436,
+      440,  436,  441,  436,  487,  337,  487,  504,  337,  504,
+      504,  337,  504,  964,  799,  337,  337,  337, 1940, 1942,
+
+      488,  800, 1943,  505, 1944, 1119,  505, 1946,  994,  436,
+      436,  372,  337,  337,  337,  442, 1008,  799,  443,  796,
+      796,  796,  796,  796,  796,  796,  796,  796,  372, 1136,
+      444,  449,  450,  337,  450,  449,  449,  449,  449,  449,
+      449,  449,  451,  449,  449,  449,  844,  449,  453,  449,
+      454,  449,  504,  337,  504,  504,  337,  504,  504,  337,
+      504,  844, 1018,  504,  337,  504, 1019, 1947,  505,  844,
+     1020,  505, 1951, 1099,  506, 1955, 1030,  449,  449,  506,
+      515,  337,  515,  455,  796,  796,  796,  796,  796,  796,
+      796,  796,  796,  796,  796,  796,  516, 1136,  456,  449,
+
+      450,  337,  450,  449,  449,  449,  449,  449,  449,  449,
+      451,  449,  449,  449,  800,  449,  453,  449,  454,  449,
+      515,  337,  515,  337,  337,  337,  337,  337,  337,  844,
+      799,  515,  337,  515, 1957, 1960,  516, 1962, 1967,  372,
+     1968, 1972,  372, 1979, 1042,  449,  449,  516,  515,  337,
+      515,  455,  796,  796,  796,  796,  796,  796,  796,  796,
+      796,  796,  796,  796,  516, 1980,  456,  461,  462,  337,
+      462,  461,  461,  461,  461,  461,  461,  461,  463,  461,
+      461,  461,  800,  461,  465,  461,  466,  461,  515,  337,
+      515,  515,  337,  515,  528,  337,  528,  844,  799,  528,
+
+      337,  528, 1981, 1982,  517,  800, 1112,  517, 1983, 1984,
+      529, 1985,  969,  461,  461,  529,  337,  337,  337,  467,
+     1137,  799,  468,  796,  796,  796,  796,  796,  796,  796,
+      796,  796,  372, 1986,  469,  461,  462,  337,  462,  461,
+      461,  461,  461,  461,  461,  461,  463,  461,  461,  461,
+      800,  461,  465,  461,  466,  461,  337,  337,  337,  528,
+      337,  528,  528,  337,  528, 1101,  799,  528,  337,  528,
+     1987, 1988,  372,  800, 1989,  529, 1122, 1993,  529, 1103,
+      974,  461,  461,  530,  528,  337,  528,  467, 1049,  799,
+      468,  796,  796,  796,  796,  796,  796,  796,  796,  796,
+
+      530, 1996,  469,  474,  475,  337,  475,  474,  474,  474,
+      474,  474,  474,  474,  476,  474,  474,  474,  800,  474,
+      478,  474,  479,  474,  543,  337,  543,  543,  337,  543,
+      337,  337,  337, 1112,  799,  337,  337,  337,  800, 1997,
+      544,  844,  800,  544, 1999,  979,  545, 1138,  994,  474,
+      474,  545,  800,  480,  799,  796,  796,  796,  799,  989,
+      481, 2000, 1069,  482,  796,  796,  796,  483,  799,  484,
+      485,  474,  475,  337,  475,  474,  474,  474,  474,  474,
+      474,  474,  476,  474,  474,  474,  995,  474,  478,  474,
+      479,  474,  543,  337,  543,  543,  337,  543,  543,  337,
+
+      543, 1000,  990,  543,  337,  543,  800, 2002,  544, 2003,
+      800,  544, 2004,  800,  546,  844, 1077,  474,  474,  546,
+      800,  480,  799,  796,  796,  796,  799, 1013,  481,  799,
+     2005,  482,  796,  796,  796,  483,  799,  484,  485,  489,
+      490,  337,  490,  489,  489,  489,  489,  489,  489,  489,
+      491,  489,  489,  489,  800,  489,  493,  489,  494,  489,
+      557,  337,  557,  557,  337,  557,  567,  337,  567,  844,
+      799,  567,  337,  567, 2009, 2010,  558, 1097,  999,  558,
+     1097,  800,  568, 1274, 1351,  489,  489,  568, 1024,  495,
+      496,  844, 1098,  998, 1030, 1153,  497,  799, 1098,  498,
+
+      796,  796,  796,  499, 1974,  500,  501,  502,  489,  490,
+      337,  490,  489,  489,  489,  489,  489,  489,  489,  491,
+      489,  489,  489,  800,  489,  493,  489,  494,  489,  337,
+      337,  337,  337,  337,  337,  567,  337,  567, 1101,  799,
+      567,  337,  567,  862, 2011,  569, 2012,  844,  569, 1102,
+      800,  568, 1275, 1277,  489,  489,  568,  800,  495,  496,
+      796,  796,  796, 2013, 1035,  497,  799, 1127,  498,  796,
+      796,  796,  499,  799,  500,  501,  502,  507,  508,  337,
+      508,  507,  507,  507,  507,  507,  507,  507,  509,  507,
+      507,  507,  800,  507,  511,  507,  512,  507,  567,  337,
+
+      567,  567,  337,  567,  582,  337,  582, 1121,  799,  582,
+      337,  582, 2016, 2019,  570, 2020,  800,  570, 1122, 2021,
+      583, 1275, 2024,  507,  507,  583,  796,  796,  796,  796,
+      796,  796,  799, 2025,  513,  507,  508,  337,  508,  507,
+      507,  507,  507,  507,  507,  507,  509,  507,  507,  507,
+      800,  507,  511,  507,  512,  507,  337,  337,  337,  337,
+      337,  337,  582,  337,  582, 1121,  799,  582,  337,  582,
+     2026, 2027,  372, 2028,  800,  372, 1102, 2029,  583, 1103,
+     2030,  507,  507,  583,  796,  796,  796,  796,  796,  796,
+      799, 2033,  513,  518,  519,  337,  519,  518,  518,  518,
+
+      518,  518,  518,  518,  520,  518,  518,  518,  800,  518,
+      522,  518,  523,  518,  582,  337,  582,  582,  337,  582,
+      594,  337,  594, 1856,  799,  594,  337,  594, 2037, 2038,
+      584, 2039,  800,  584, 2041, 1857,  595, 2045, 2046,  518,
+      518,  595,  605,  337,  605,  605,  337,  605,  799, 1907,
+      524,  796,  796,  796,  796,  796,  796, 1077,  606,  525,
+     2048,  606, 1763, 2049,  526,  518,  519,  337,  519,  518,
+      518,  518,  518,  518,  518,  518,  520,  518,  518,  518,
+     2052,  518,  522,  518,  523,  518,  616,  337,  616,  616,
+      337,  616,  631,  337,  631, 2053, 1109,  631,  337,  631,
+
+     2055, 2056,  617, 1110, 1351,  617,  862, 2059,  632, 1111,
+      844,  518,  518,  632,  337,  337,  337,  337,  337,  337,
+     1353, 2081,  524,  796,  796,  796,  796,  796,  796, 2082,
+      633,  525, 2084,  633, 2085, 2089,  526,  531,  532,  337,
+      532,  531,  531,  531,  531,  531,  531,  531,  533,  531,
+      531,  531, 2093,  531,  535,  531,  536,  531,  642,  337,
+      642,  642,  337,  642,  642,  337,  642, 2096, 1109,  642,
+      337,  642, 2105, 2106,  643, 1110, 2107,  643, 2108, 2110,
+      644, 1117, 2118,  531,  531,  644,  537, 1069,  538,  796,
+      796,  796, 2120, 2123,  539,  796,  796,  796,  796,  796,
+
+      796,  540, 2124, 2128,  541,  531,  532,  337,  532,  531,
+      531,  531,  531,  531,  531,  531,  533,  531,  531,  531,
+     2130,  531,  535,  531,  536,  531,  337,  337,  337,  337,
+      337,  337,  642,  337,  642, 2131, 2133,  642,  337,  642,
+      844, 2134,  645, 1056,  828,  645, 2135, 2136,  643, 2137,
+     1057,  531,  531,  643,  537, 2141,  538, 2142, 2143,  799,
+     2148, 2152,  539,  796,  796,  796,  796,  796,  796,  540,
+     2156, 2158,  541,  547,  548,  337,  548,  547,  547,  547,
+      547,  547,  547,  547,  549,  547,  547,  547, 2160,  547,
+      551,  547,  552,  547,  642,  337,  642,  642,  337,  642,
+
+      337,  337,  337, 2162, 2163,  337,  337,  337, 2164, 2166,
+      646,  800, 2173,  646, 2177, 2178,  569, 2180, 1064,  547,
+      547,  569,  642,  337,  642,  553, 2187,  799, 2189,  831,
+      554,  796,  796,  796,  796,  796,  796, 2190,  644,  796,
+      796,  796,  555,  547,  548,  337,  548,  547,  547,  547,
+      547,  547,  547,  547,  549,  547,  547,  547,  850,  547,
+      551,  547,  552,  547,  642,  337,  642,  337,  337,  337,
+      337,  337,  337, 2191,  851,  642,  337,  642, 1977, 2196,
+      644, 2197,  841,  647, 2198, 2200,  647, 2201, 2202,  547,
+      547,  646,  642,  337,  642,  553,  796,  796,  796, 2203,
+
+      554,  796,  796,  796, 1083, 1083, 1083, 2204,  646, 1370,
+     1370, 1370,  555,  559,  560,  337,  560,  559,  559,  559,
+      559,  559,  559,  559,  561,  559,  559,  559, 2205,  559,
+      563,  559,  564,  559,  642,  337,  642,  642,  337,  642,
+      661,  337,  661, 2206, 1126,  661,  337,  661, 1494, 2207,
+      648, 1110, 2208,  648, 2209, 2211,  662, 1111, 1495,  559,
+      559,  662, 2212, 2213, 1084, 1496, 2216,  565,  559,  560,
+      337,  560,  559,  559,  559,  559,  559,  559,  559,  561,
+      559,  559,  559, 2219,  559,  563,  559,  564,  559,  337,
+      337,  337,  337,  337,  337,  661,  337,  661, 2220, 1126,
+
+      661,  337,  661, 2221, 2222,  412, 1110, 2223,  412, 2224,
+     2225,  662, 1117, 1351,  559,  559,  662, 1083, 1083, 1083,
+     2226, 1355,  565,  571,  572,  337,  572,  571,  571,  571,
+      571,  571,  571,  571,  573,  571,  571,  571, 2193,  571,
+      575,  571,  576,  571,  661,  337,  661,  661,  337,  661,
+      673,  337,  673, 2229, 1109,  673,  337,  673, 2232, 2233,
+      663, 1110, 2234,  663, 2241, 1126,  674, 1276, 2242,  571,
+      571,  674, 1110,  577, 2243, 1362, 1362, 1362, 1276, 1363,
+      578, 2244, 1364,  579, 1370, 1370, 1370, 1394, 1394, 1394,
+      580,  571,  572,  337,  572,  571,  571,  571,  571,  571,
+
+      571,  571,  573,  571,  571,  571, 2245,  571,  575,  571,
+      576,  571,  687,  337,  687,  687,  337,  687,  698,  337,
+      698, 2247, 2252,  698,  337,  698, 2253, 2297,  688, 2298,
+     2301,  688, 2302, 2308,  699, 2309, 2315,  571,  571,  699,
+     2316,  577, 2317, 1394, 1394, 1394, 2318, 2321,  578, 1371,
+     2327,  579, 1395, 1394, 1394, 1394, 2329, 2335,  580,  585,
+      586,  337,  586,  585,  585,  585,  585,  585,  585,  585,
+      587,  585,  585,  585, 2339,  585,  589,  585,  590,  585,
+      337,  337,  337,  337,  337,  337,  698,  337,  698, 2340,
+     2343,  698,  337,  698, 2344, 2347,  396, 2348, 2349,  396,
+
+     2350, 2351,  699, 2352, 2353,  585,  585,  699, 1371, 2360,
+     2361,  591, 1990, 1990, 1990, 2362,  592,  585,  586,  337,
+      586,  585,  585,  585,  585,  585,  585,  585,  587,  585,
+      585,  585, 2364,  585,  589,  585,  590,  585,  698,  337,
+      698,  698,  337,  698,  710,  337,  710, 2366, 2374,  710,
+      337,  710, 2379, 2380,  700, 2381, 2383,  700, 2396, 2410,
+      711, 2411, 1977,  585,  585,  711, 1370, 1370, 1370,  591,
+     1991, 1991, 1991, 1351,  592,  596,  597,  337,  597,  596,
+      596,  596,  596,  596,  596,  596,  598,  596,  596,  596,
+     2405,  596,  600,  596,  601,  596,  723,  337,  723,  723,
+
+      337,  723,  337,  337,  337, 2406, 2412,  337,  337,  337,
+     1977, 2416,  724, 2417, 2419,  724, 2420, 1992,  372, 2421,
+     2422,  596,  596,  372,  723,  337,  723,  723,  337,  723,
+     2423, 1395,  602, 2424, 1442, 1442, 1442, 2427, 1443, 2428,
+      724, 1444, 2429,  724, 2407,  603,  596,  597,  337,  597,
+      596,  596,  596,  596,  596,  596,  596,  598,  596,  596,
+      596, 2413,  596,  600,  596,  601,  596,  723,  337,  723,
+      723,  337,  723,  737,  337,  737, 2430, 2414,  737,  337,
+      737, 2431, 2435,  725, 2436, 2415,  725, 2437, 2438,  738,
+     2440, 2441,  596,  596,  738,  337,  337,  337,  337,  337,
+
+      337, 2442, 2449,  602, 2451, 1478, 1478, 1478, 2452, 1479,
+     2453,  739, 1480, 2454,  739, 2455,  603,  607,  608,  337,
+      608,  607,  607,  607,  607,  607,  607,  607,  609,  607,
+      607,  607, 2432,  607,  611,  607,  612,  607,  737,  337,
+      737,  737,  337,  737,  737,  337,  737, 2458, 2433,  737,
+      337,  737, 2460, 2491,  738, 2492, 2434,  738, 2493, 2499,
+      740,  350,  351,  607,  607,  740,  352,  762,  337,  762,
+     1481, 1481, 1481, 2500, 1482, 2504,  750, 1483, 2505,  613,
+     1994, 1994, 1994,  763,  614,  607,  608,  337,  608,  607,
+      607,  607,  607,  607,  607,  607,  609,  607,  607,  607,
+
+     2511,  607,  611,  607,  612,  607,  751,  762,  337,  762,
+      773,  337,  773,  773,  337,  773, 2512,  773,  337,  773,
+      773,  337,  773,  763, 2384, 2516,  774, 1995, 2517,  774,
+     2385,  607,  607,  775, 2386, 2520,  775, 1497, 1497, 1497,
+     2387, 1498, 2524, 2525, 1499, 2526, 2529,  613, 1998, 1998,
+     1998, 2532,  614,  618,  619,  337,  619,  618,  618,  618,
+      618,  618,  618,  618,  620,  618,  618,  618, 2413,  618,
+      622,  618,  623,  618,  337,  337,  337,  337,  337,  337,
+      773,  337,  773, 2536, 2433,  773,  337,  773, 2537, 2538,
+      372, 2539, 2415,  372, 2544, 2546,  774, 2547, 2548,  618,
+
+      618,  774,  624,  625,  626, 1501, 1501, 1501, 2549, 1502,
+      627, 2551, 1503,  628, 2001, 2001, 2001, 2008, 2008, 2008,
+      629,  618,  619,  337,  619,  618,  618,  618,  618,  618,
+      618,  618,  620,  618,  618,  618, 2432,  618,  622,  618,
+      623,  618,  773,  337,  773,  773,  337,  773,  337,  337,
+      337, 2554, 2414,  337,  337,  337, 2556, 2559,  776, 2573,
+     2434,  776, 2574, 2575,  777, 2580, 2581,  618,  618,  777,
+      624,  625,  626, 1519, 1519, 1519, 2584, 1520,  627, 2582,
+     1521,  628, 2585, 2006, 2006, 2006, 2586, 2583,  629,  634,
+      635,  337,  635,  634,  634,  634,  634,  634,  634,  634,
+
+      636,  634,  634,  634, 2589,  634,  638,  634,  639,  634,
+      773,  337,  773,  773,  337,  773,  773,  337,  773, 2007,
+     2587,  773,  337,  773, 2599, 1351,  778, 2608, 2588,  778,
+     2609, 2601,  779, 2610, 2611,  634,  634,  779,  337,  337,
+      337,  337,  337,  337, 1526, 1526, 1526, 2612, 1527, 1977,
+     2615, 1528, 2617, 2618,  377, 2619, 2623,  377, 1977,  640,
+      634,  635,  337,  635,  634,  634,  634,  634,  634,  634,
+      634,  636,  634,  634,  634, 2624,  634,  638,  634,  639,
+      634,  773,  337,  773,  773,  337,  773,  337,  337,  337,
+     2602, 2626,  337,  337,  337, 2627, 2603,  776, 2628, 2629,
+
+      776, 2632, 2636,  378, 2637, 2638,  634,  634,  378,  773,
+      337,  773,  773,  337,  773, 1538, 1538, 1538, 2640, 1539,
+     2646, 2648, 1540, 2660, 2661,  779, 2662, 2666,  779, 2667,
+      640,  649,  650,  337,  650,  649,  649,  649,  649,  649,
+      649,  649,  651,  649,  649,  649, 2668,  649,  653,  649,
+      654,  649,  773,  337,  773,  773,  337,  773,  337,  337,
+      337, 2679, 2680,  337,  337,  337, 2681, 2682,  780, 2685,
+     2689,  780, 2690, 2691,  380, 2692, 2695,  649,  649,  380,
+      773,  337,  773, 2696, 2697,  655, 2698,  656, 2699, 2700,
+      657, 2014, 2014, 2014,  658, 2712,  781, 2716,  659,  649,
+
+      650,  337,  650,  649,  649,  649,  649,  649,  649,  649,
+      651,  649,  649,  649, 2719,  649,  653,  649,  654,  649,
+      773,  337,  773,  337,  337,  337,  337,  337,  337, 2720,
+     2731,  773,  337,  773, 2732, 2733,  781, 2737, 2015,  382,
+     2738, 2739,  382, 2740, 2741,  649,  649,  780,  773,  337,
+      773, 2742, 2743,  655, 2744,  656, 2745, 2746,  657, 2017,
+     2017, 2017,  658, 2751,  780, 1977,  659,  664,  665,  337,
+      665,  664,  664,  664,  664,  664,  664,  664,  666,  664,
+      664,  664, 2768,  664,  668,  664,  669,  664,  773,  337,
+      773,  773,  337,  773,  793,  337,  793, 2769, 2770,  793,
+
+      337,  793, 2771, 2773,  782, 2775, 1995,  782, 2776, 2754,
+      794, 2777, 2779,  664,  664,  794,  337,  337,  337,  337,
+      337,  337, 2780, 2781,  670, 1977, 1551, 1551, 1551, 2782,
+     1552, 2783,  396, 1553, 2784,  396, 2785,  671,  664,  665,
+      337,  665,  664,  664,  664,  664,  664,  664,  664,  666,
+      664,  664,  664,  846,  664,  668,  664,  669,  664,  793,
+      337,  793,  793,  337,  793,  793,  337,  793, 2786, 2807,
+      793,  337,  793, 2755, 2808,  794, 2756, 2757,  794, 2758,
+     2809,  795,  847,  819,  664,  664,  795, 2759, 2813,  822,
+     2810,  815,  823, 2814, 2760,  670,  830, 2018, 2018, 2018,
+
+      828,  842, 2823, 2824,  831, 2825,  848, 2826,  671,  675,
+      676,  337,  676,  675,  675,  675,  675,  675,  675,  675,
+      677,  675,  675,  675, 2842,  675,  679,  675,  680,  675,
+      843, 2095, 2095, 2095,  852, 1091, 1091, 1091, 2843,  821,
+     2844, 1158, 1158, 1158,  844, 2845, 2860,  844,  828,  853,
+      827, 2861, 1092, 2865,  845,  675,  675,  841, 1159, 2866,
+      994, 2867, 2868, 1069,  681, 2869,  682, 1554, 1554, 1554,
+      683, 1555, 2870,  816, 1556,  684,  685,  675,  676,  337,
+      676,  675,  675,  675,  675,  675,  675,  675,  677,  675,
+      675,  675, 2871,  675,  679,  675,  680,  675,  995,  832,
+
+      996, 2872,  818, 1177, 1177, 1177, 2873, 2874,  821,  836,
+     1366, 1366, 1366,  997, 2875,  998,  825, 2876,  826,  827,
+     1178, 1069, 2888,  675,  675, 2893,  829, 1069, 1368, 2894,
+     2895,  842,  681, 2897,  682, 1977, 2898,  816,  683, 2896,
+      831, 2899, 2900,  684,  685,  689,  690,  337,  690,  689,
+      689,  689,  689,  689,  689,  689,  691,  689,  689,  689,
+      843,  689,  693,  689,  694,  689,  849, 1070, 2891,  854,
+      852, 1179, 1179, 1179,  844, 2022, 2022, 2022,  828, 1189,
+     1189, 1189, 2903,  844,  845, 1192, 1192, 1192, 1180, 2901,
+      829,  689,  689,  841, 2904, 2905, 1190,  695, 2902, 1567,
+
+     1567, 1567, 1193, 1568, 2906, 2907, 1569, 2022, 2022, 2022,
+     2909, 2023,  696,  689,  690,  337,  690,  689,  689,  689,
+      689,  689,  689,  689,  691,  689,  689,  689, 2910,  689,
+      693,  689,  694,  689, 1206, 1206, 1206, 1210, 1210, 1210,
+     1219, 1219, 1219, 2007, 1229, 1229, 1229, 1231, 1231, 1231,
+     2911, 1207, 2913, 2914, 1211, 2915, 2917, 1220, 1977,  689,
+      689, 1230, 2918, 2920, 1232,  695, 1578, 1578, 1578, 2938,
+     1579, 2939, 2940, 1580, 2941, 2006, 2006, 2006, 2945, 2946,
+      696,  701,  702,  337,  702,  701,  701,  701,  701,  701,
+      701,  701,  703,  701,  701,  701, 2892,  701,  705,  701,
+
+      706,  701, 1239, 1239, 1239, 1247, 1247, 1247, 1251, 1251,
+     1251, 2023, 1263, 1263, 1263, 2953, 1285, 1285, 1285, 1240,
+     2954, 2963, 1248, 2964, 2965, 1252, 2977,  701,  701, 1264,
+     2978, 2995,  707, 1286, 2017, 2017, 2017, 2996,  708,  701,
+      702,  337,  702,  701,  701,  701,  701,  701,  701,  701,
+      703,  701,  701,  701, 2997,  701,  705,  701,  706,  701,
+     1291, 1291, 1291, 1307, 1307, 1307, 1313, 1313, 1313, 2999,
+     1319, 1319, 1319, 3000, 1327, 1327, 1327, 1292, 3001, 3002,
+     1308, 2032, 3003, 1314, 3004,  701,  701, 1320, 3005, 3006,
+      707, 1328, 2199, 2199, 2199, 3007,  708,  712,  713,  337,
+
+      713,  712,  712,  712,  712,  712,  712,  712,  714,  712,
+      712,  712, 3008,  712,  716,  712,  717,  712, 1339, 1339,
+     1339, 1091, 1091, 1091, 1366, 1366, 1366, 3009, 1414, 1414,
+     1414, 3010, 1418, 1418, 1418, 1340, 3012, 3013, 1092, 4192,
+     4192, 4192, 1368,  712,  712, 1415,  718, 3016,  719, 1419,
+     3014, 1585, 1585, 1585,  720, 1586, 4192, 3017, 1587, 3015,
+     3018, 1369, 1990, 1990, 1990,  721,  712,  713,  337,  713,
+      712,  712,  712,  712,  712,  712,  712,  714,  712,  712,
+      712, 3019,  712,  716,  712,  717,  712, 1158, 1158, 1158,
+     1416, 1421, 1421, 1421, 1450, 1450, 1450, 4192, 4192, 4192,
+
+     1431, 1431, 1431, 3022, 1159, 1417, 1431, 1431, 1431, 1423,
+     3023, 1451,  712,  712, 4192,  718, 3024,  719, 1433, 1991,
+     1991, 1991, 3020,  720, 1433, 1603, 1603, 1603, 3029, 1604,
+     1977, 3021, 1605, 3030,  721,  726,  727,  337,  727,  726,
+      726,  726,  726,  726,  726,  726,  728,  726,  726,  726,
+     1351,  726,  730,  726,  731,  726, 1434, 1420, 1421, 1421,
+     1421, 1437, 1437, 1437, 3031, 1437, 1437, 1437, 3027, 1446,
+     1446, 1446, 1454, 1454, 1454, 2947, 1423, 2948, 2388, 1439,
+     1977,  726,  726, 1439, 2389, 3032,  732, 1448, 2390, 1455,
+     2949, 3026,  733, 3033, 2391, 1424,  734, 1994, 1994, 1994,
+
+     3034, 3035,  735,  726,  727,  337,  727,  726,  726,  726,
+      726,  726,  726,  726,  728,  726,  726,  726, 3036,  726,
+      730,  726,  731,  726, 3028, 3037, 1456, 1456, 1456, 3038,
+     1440, 3039, 3040, 1456, 1456, 1456, 3041, 3042, 1446, 1446,
+     1446, 4192, 4192, 4192, 1458, 1460, 1460, 1460, 3043,  726,
+      726, 1458, 3045, 2950,  732, 2951, 1448, 3046, 4192, 3047,
+      733, 3048, 1461, 3049,  734, 2210, 2210, 2210, 2952, 3050,
+      735,  741,  742,  337,  742,  741,  741,  741,  741,  741,
+      741,  741,  743,  741,  741,  741, 1449,  741,  745,  741,
+      746,  741, 1452, 1462, 1462, 1462, 1464, 1464, 1464, 3051,
+
+     3063, 1464, 1464, 1464, 3064, 1459, 3067, 1453, 3068, 3069,
+     1463, 1474, 1474, 1474, 1466, 3070, 3073,  741,  741, 1466,
+     1633, 1633, 1633, 3071, 1634,  747, 3074, 1635,  748, 1476,
+     1998, 1998, 1998, 3077, 3072,  749,  741,  742,  337,  742,
+      741,  741,  741,  741,  741,  741,  741,  743,  741,  741,
+      741, 3078,  741,  745,  741,  746,  741, 1468, 1468, 1468,
+     3089, 1472, 1472, 1472, 3090, 3091, 1474, 1474, 1474, 1177,
+     1177, 1177, 3102, 1467, 1469, 4192, 4192, 4192, 1473, 1179,
+     1179, 1179,  741,  741, 1476, 3123, 1178, 1642, 1642, 1642,
+      747, 1643, 4192,  748, 1644, 3132, 1180, 2001, 2001, 2001,
+
+      749,  752,  753,  337,  753,  752,  752,  752,  752,  752,
+      752,  752,  754,  752,  752,  752, 3133,  752,  756,  752,
+      757,  752, 1484, 1484, 1484, 3134, 1470, 1490, 1490, 1490,
+     3135, 3136, 4192, 4192, 4192, 4192, 4192, 4192, 1477, 1485,
+     3075, 1471, 4192, 4192, 4192, 1492, 3137,  752,  752, 4192,
+     3138, 3076, 4192, 3139,  758, 2214, 2214, 2214, 3140, 4192,
+      759, 1667, 1667, 1667, 3141, 1668, 3143, 3144, 1669,  760,
+      752,  753,  337,  753,  752,  752,  752,  752,  752,  752,
+      752,  754,  752,  752,  752, 1486,  752,  756,  752,  757,
+      752, 1487, 3145, 3146, 1488, 2006, 2006, 2006, 1189, 1189,
+
+     1189, 4192, 4192, 4192, 1192, 1192, 1192, 1504, 1504, 1504,
+     3147, 3148, 1490, 1490, 1490, 1190,  752,  752, 4192, 3149,
+     2215, 1193, 3150,  758, 1505, 2008, 2008, 2008, 3151,  759,
+     1492, 2217, 2217, 2217, 2014, 2014, 2014, 3152,  760,  764,
+      765,  337,  765,  764,  764,  764,  764,  764,  764,  764,
+      766,  764,  764,  764, 1489,  764,  768,  764,  769,  764,
+     1493, 1515, 1515, 1515, 1206, 1206, 1206, 3153, 3154, 1515,
+     1515, 1515, 1522, 1522, 1522, 1522, 1522, 1522, 2218, 1517,
+     3162, 1207, 1210, 1210, 1210,  764,  764, 1517, 3095, 3163,
+     1524, 1351, 1977, 1524, 3164, 3165,  770, 3166, 3096, 1211,
+
+     2017, 2017, 2017, 3167, 3097,  771,  764,  765,  337,  765,
+      764,  764,  764,  764,  764,  764,  764,  766,  764,  764,
+      764, 3159,  764,  768,  764,  769,  764, 1977, 1518, 1531,
+     1531, 1531, 1531, 1531, 1531, 3160, 3168, 1525, 1219, 1219,
+     1219, 1544, 1544, 1544, 1544, 1544, 1544, 1533, 3169, 3170,
+     1533, 3098,  764,  764, 3171, 1220, 2018, 2018, 2018, 1546,
+     3172, 3099, 1546,  770, 1676, 1676, 1676, 3100, 1677, 3173,
+     3161, 1678,  771,  783,  784,  337,  784,  783,  783,  783,
+      783,  783,  783,  783,  785,  783,  783,  783, 1534,  783,
+      787,  783,  788,  783, 1229, 1229, 1229, 1231, 1231, 1231,
+
+     1557, 1557, 1557, 1557, 1557, 1557, 1547, 3174, 1562, 1562,
+     1562, 1230, 3176, 3177, 1232, 1562, 1562, 1562, 1559,  783,
+      783, 1559, 1239, 1239, 1239,  789, 1564, 3178,  790, 3179,
+     1685, 1685, 1685, 1564, 1686, 3181, 3182, 1687, 3183, 1240,
+      791,  783,  784,  337,  784,  783,  783,  783,  783,  783,
+      783,  783,  785,  783,  783,  783, 3194,  783,  787,  783,
+      788,  783, 1573, 1573, 1573, 1560, 1573, 1573, 1573, 1247,
+     1247, 1247, 1581, 1581, 1581, 3202, 1565, 1581, 1581, 1581,
+     1575, 1251, 1251, 1251, 1575, 3203, 1248,  783,  783, 3204,
+     1583, 3205, 3206,  789, 3207, 1583,  790, 3187, 1252, 1589,
+
+     1589, 1589, 1589, 1589, 1589, 1595, 1595, 1595,  791,  800,
+     3188, 3117, 1595, 1595, 1595, 3208,  815, 1591, 3189, 3209,
+     1591, 3118, 1576, 1597, 3119,  799,  816, 1263, 1263, 1263,
+     1597, 3190, 3210, 1584, 1606, 1606, 1606, 2227, 2227, 2227,
+     1610, 1610, 1610, 3211, 1264, 1616, 1616, 1616, 2230, 2230,
+     2230, 1607, 3212, 3216,  817,  818,  819,  820, 1612, 3219,
+     3220,  821,  822, 1618, 1592,  823,  824, 3221, 3222,  825,
+     3223,  826,  827,  828, 1598, 3224, 1616, 1616, 1616,  829,
+      800, 3225, 1610, 1610, 1610, 1629, 1629, 1629, 1629, 1629,
+     1629, 1285, 1285, 1285, 1618, 2231,  799,  831, 3228, 3236,
+
+     1612, 3237, 2228, 1631, 3240, 3241, 1631, 3244, 1286, 3255,
+     3232, 1637, 1637, 1637, 1291, 1291, 1291, 2022, 2022, 2022,
+     1637, 1637, 1637, 3233, 3256,  817,  832,  833,  820, 1639,
+     3257, 1292,  834,  835, 1613, 1619,  836,  824, 1639, 3120,
+      837, 3258,  838,  839,  840, 1645, 1645, 1645, 3234, 3121,
+      841, 3259, 3122, 1632, 1648, 1648, 1648, 1653, 1653, 1653,
+     3260, 3235, 1646, 1653, 1653, 1653, 1657, 1657, 1657, 3238,
+     3261, 1649, 1659, 1659, 1659, 1655, 4192, 4192, 4192, 3262,
+     3264, 1655, 3239, 1658, 3265, 1640, 1662, 1662, 1662, 1660,
+     1662, 1662, 1662, 4192, 3266, 1307, 1307, 1307, 1670, 1670,
+
+     1670, 1670, 1670, 1670, 1664, 1313, 1313, 1313, 1664, 3267,
+     3268, 1656, 1308, 1680, 1680, 1680, 1672, 3242, 3269, 1672,
+     3270, 3271, 1314, 1680, 1680, 1680, 1319, 1319, 1319, 3272,
+     3243, 1682, 1690, 1690, 1690, 3273, 1661, 1690, 1690, 1690,
+     3274, 1682, 3275, 1320, 1327, 1327, 1327, 1696, 1696, 1696,
+     1692, 1697, 1665, 1351, 1698, 1692, 1701, 1701, 1701, 3283,
+     3284, 1328, 3285, 1673, 1701, 1701, 1701, 1708, 1708, 1708,
+     1708, 1708, 1708, 3286, 1703, 1339, 1339, 1339, 3287, 1712,
+     1712, 1712, 1703, 1713, 1977, 1710, 1714, 3288, 1710, 3289,
+     1683, 3290, 1340, 1716, 1716, 1716, 1716, 1716, 1716, 1720,
+
+     1720, 1720, 3279, 3291, 1693, 4192, 4192, 4192, 1724, 1724,
+     1724, 1718, 3292, 3293, 1718, 3294, 1721, 4192, 4192, 4192,
+     3280, 3295, 4192, 3296, 3298, 1725, 1727, 1727, 1727, 1704,
+     1727, 1727, 1727, 3299, 4192, 1711, 1362, 1362, 1362, 3300,
+     1363, 3302, 3311, 1364, 1729, 1366, 1366, 1366, 1729, 1366,
+     1366, 1366, 1738, 1738, 1738, 3312, 1722, 3313, 1719, 1414,
+     1414, 1414, 3314, 1368, 1418, 1418, 1418, 1368, 3319, 3326,
+     1739, 1723, 3327, 1421, 1421, 1421, 1415, 1726, 1783, 1783,
+     1783, 1419, 1784, 3328, 3329, 1785, 1788, 1788, 1788, 3330,
+     1789, 1423, 1730, 1790, 1421, 1421, 1421, 1421, 1421, 1421,
+
+     1795, 1795, 1795, 1431, 1431, 1431, 1431, 1431, 1431, 1431,
+     1431, 1431, 1423, 3331, 3332, 1423, 3333, 1796, 1437, 1437,
+     1437, 1433, 3334, 3335, 1433, 3336, 3337, 1433, 1437, 1437,
+     1437, 1437, 1437, 1437, 3341, 3342, 1439, 1442, 1442, 1442,
+     3343, 1443, 3344, 3345, 1444, 3346, 1439, 3347, 3348, 1439,
+     1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 1446, 2214,
+     2214, 2214, 1792, 1450, 1450, 1450, 3349, 3350, 1448, 3351,
+     3352, 1448, 3353, 3354, 1448, 3355, 1800, 1807, 1807, 1807,
+     1451, 1808, 3356, 3357, 1809, 1803, 1454, 1454, 1454, 1812,
+     1812, 1812, 3358, 1813, 3359, 3360, 1814, 1456, 1456, 1456,
+
+     1456, 1456, 1456, 1455, 3372, 3373, 1806, 1456, 1456, 1456,
+     1460, 1460, 1460, 3374, 3375, 1458, 3376, 3377, 1458, 1816,
+     1816, 1816, 3378, 1817, 2228, 1458, 1818, 1461, 1462, 1462,
+     1462, 1819, 1819, 1819, 3379, 1820, 3381, 3382, 1821, 1464,
+     1464, 1464, 1464, 1464, 1464, 1463, 1464, 1464, 1464, 1468,
+     1468, 1468, 1823, 1823, 1823, 3383, 1824, 1466, 3384, 1825,
+     1466, 1472, 1472, 1472, 1466, 3385, 1469, 1828, 1828, 1828,
+     1815, 1829, 3386, 3387, 1830, 1474, 1474, 1474, 1473, 1474,
+     1474, 1474, 1474, 1474, 1474, 1478, 1478, 1478, 3388, 1479,
+     3389, 3390, 1480, 1476, 1481, 1481, 1481, 1476, 1482, 3391,
+
+     1476, 1483, 1484, 1484, 1484, 3392, 1832, 1832, 1832, 1822,
+     1833, 3407, 1351, 1834, 1490, 1490, 1490, 3408, 3409, 1485,
+     1490, 1490, 1490, 1490, 1490, 1490, 1497, 1497, 1497, 3410,
+     1498, 3411, 1492, 1499, 1843, 1843, 1843, 3412, 1492, 3413,
+     3414, 1492, 1501, 1501, 1501, 1831, 1502, 3401, 3416, 1503,
+     3419, 1844, 1504, 1504, 1504, 1845, 1845, 1845, 3421, 1846,
+     3422, 3423, 1847, 1515, 1515, 1515, 1515, 1515, 1515, 1505,
+     3424, 3425, 1839, 1515, 1515, 1515, 1519, 1519, 1519, 3426,
+     1520, 1517, 3427, 1521, 1517, 1522, 1522, 1522, 1522, 1522,
+     1522, 1517, 1522, 1522, 1522, 1526, 1526, 1526, 3428, 1527,
+
+     3429, 3430, 1528, 1524, 3431, 3432, 1524, 1531, 1531, 1531,
+     1524, 1531, 1531, 1531, 1531, 1531, 1531, 1865, 1865, 1865,
+     1538, 1538, 1538, 3435, 1539, 1533, 3438, 1540, 3439, 1533,
+     3303, 3440, 1533, 3441, 1866, 3442, 1544, 1544, 1544, 3443,
+     3304, 1858, 1544, 1544, 1544, 1544, 1544, 1544, 1873, 1873,
+     1873, 3444, 3445, 1859, 1546, 1551, 1551, 1551, 3305, 1552,
+     1546, 3446, 1553, 1546, 3447, 1874, 1554, 1554, 1554, 3306,
+     1555, 3452, 3453, 1556, 1557, 1557, 1557, 1557, 1557, 1557,
+     1862, 1557, 1557, 1557, 1876, 1876, 1876, 1562, 1562, 1562,
+     3454, 3455, 1559, 3456, 3457, 1559, 1562, 1562, 1562, 1559,
+
+     3458, 1877, 1562, 1562, 1562, 1564, 1567, 1567, 1567, 3459,
+     1568, 1870, 3460, 1569, 1564, 1573, 1573, 1573, 3461, 3462,
+     1564, 1573, 1573, 1573, 1573, 1573, 1573, 1578, 1578, 1578,
+     3463, 1579, 3464, 1575, 1580, 1581, 1581, 1581, 3465, 1575,
+     3466, 3467, 1575, 1581, 1581, 1581, 3468, 1875, 1581, 1581,
+     1581, 3472, 1878, 1583, 3473, 1585, 1585, 1585, 3474, 1586,
+     3475, 1583, 1587, 1589, 1589, 1589, 1583, 3476, 1589, 1589,
+     1589, 1589, 1589, 1589, 1888, 1888, 1888, 4192, 4192, 4192,
+     3477, 1591, 1595, 1595, 1595, 1883, 1591, 3478, 3479, 1591,
+     3482, 1889, 3483, 3484, 4192, 1595, 1595, 1595, 3485, 3486,
+
+     1597, 1595, 1595, 1595, 1603, 1603, 1603, 3487, 1604, 1885,
+     3489, 1605, 3490, 1597, 1606, 1606, 1606, 3491, 3492, 1597,
+     3493, 3494, 1887, 3495, 3496, 1890, 1896, 1896, 1896, 3497,
+     1897, 1607, 3498, 1898, 1610, 1610, 1610, 1610, 1610, 1610,
+     1610, 1610, 1610, 1616, 1616, 1616, 1616, 1616, 1616, 1616,
+     1616, 1616, 1612, 3499, 3500, 1612, 3501, 3502, 1612, 3503,
+     3504, 1618, 3511, 3512, 1618, 3513, 3514, 1618, 3515, 1891,
+     1910, 1910, 1910, 1629, 1629, 1629, 1629, 1629, 1629, 3516,
+     1629, 1629, 1629, 1351, 1637, 1637, 1637, 1911, 1645, 1645,
+     1645, 1631, 1901, 3517, 1631, 3518, 3519, 1904, 1631, 1633,
+
+     1633, 1633, 1639, 1634, 3520, 1646, 1635, 1637, 1637, 1637,
+     1637, 1637, 1637, 1642, 1642, 1642, 3521, 1643, 3522, 3523,
+     1644, 3524, 1919, 1919, 1919, 1639, 1920, 3505, 1639, 1921,
+     1922, 1922, 1922, 1648, 1648, 1648, 1924, 1924, 1924, 3525,
+     1925, 3526, 1915, 1926, 1928, 1928, 1928, 1923, 3527, 3528,
+     1649, 1653, 1653, 1653, 3529, 1653, 1653, 1653, 1653, 1653,
+     1653, 1929, 1657, 1657, 1657, 3530, 1659, 1659, 1659, 1655,
+     3534, 3540, 1917, 1655, 3541, 3542, 1655, 3543, 3544, 1658,
+     1932, 1932, 1932, 1660, 1933, 3545, 3546, 1934, 1935, 1935,
+     1935, 3553, 1936, 3554, 3555, 1937, 1662, 1662, 1662, 1662,
+
+     1662, 1662, 1662, 1662, 1662, 1667, 1667, 1667, 3556, 1668,
+     3557, 3558, 1669, 3559, 1664, 3560, 3561, 1664, 3562, 1931,
+     1664, 1670, 1670, 1670, 1670, 1670, 1670, 1670, 1670, 1670,
+     1676, 1676, 1676, 3563, 1677, 3564, 3565, 1678, 3566, 1672,
+     3567, 3568, 1672, 3569, 3570, 1672, 1680, 1680, 1680, 1680,
+     1680, 1680, 3571, 1680, 1680, 1680, 1685, 1685, 1685, 3307,
+     1686, 3572, 3573, 1687, 1682, 3574, 3575, 1682, 3576, 3308,
+     1939, 1682, 1948, 1948, 1948, 1690, 1690, 1690, 1690, 1690,
+     1690, 1690, 1690, 1690, 1952, 1952, 1952, 3309, 3577, 1949,
+     1696, 1696, 1696, 1692, 1697, 1941, 1692, 1698, 3310, 1692,
+
+     3578, 1953, 4192, 4192, 4192, 1701, 1701, 1701, 1701, 1701,
+     1701, 1701, 1701, 1701, 3579, 1945, 1958, 1958, 1958, 4192,
+     1708, 1708, 1708, 1703, 3580, 3581, 1703, 3582, 3583, 1703,
+     1708, 1708, 1708, 1959, 1708, 1708, 1708, 3586, 1710, 3587,
+     1712, 1712, 1712, 1950, 1713, 3588, 3589, 1714, 1710, 1716,
+     1716, 1716, 1710, 1716, 1716, 1716, 1716, 1716, 1716, 1956,
+     1720, 1720, 1720, 3590, 1954, 3591, 3592, 1718, 1964, 1964,
+     1964, 1718, 1965, 3593, 1718, 1966, 3594, 1721, 1724, 1724,
+     1724, 3595, 1961, 1969, 1969, 1969, 3596, 1970, 3597, 3598,
+     1971, 1727, 1727, 1727, 3599, 1725, 1727, 1727, 1727, 3611,
+
+     1727, 1727, 1727, 1976, 1976, 1976, 1738, 1738, 1738, 1729,
+     1421, 1421, 1421, 1351, 1729, 3612, 3602, 1963, 1729, 3617,
+     3602, 1977, 1978, 3618, 1739, 1783, 1783, 1783, 1423, 1784,
+     3603, 3605, 1785, 1788, 1788, 1788, 3621, 1789, 3622, 3623,
+     1790, 1795, 1795, 1795, 2034, 2034, 2034, 3624, 2035, 3363,
+     3625, 2036, 1431, 1431, 1431, 1437, 1437, 1437, 1796, 3364,
+     3600, 1973, 2042, 2042, 2042, 3626, 1446, 1446, 1446, 3628,
+     1433, 3629, 2031, 1439, 1807, 1807, 1807, 3365, 1808, 2043,
+     3636, 1809, 3637, 3630, 1448, 1812, 1812, 1812, 3366, 1813,
+     3631, 3638, 1814, 1456, 1456, 1456, 1816, 1816, 1816, 3639,
+
+     1817, 3640, 3632, 1818, 3647, 1819, 1819, 1819, 3648, 1820,
+     3649, 1458, 1821, 3650, 2040, 1464, 1464, 1464, 1823, 1823,
+     1823, 3651, 1824, 2044, 2047, 1825, 3652, 1828, 1828, 1828,
+     3653, 1829, 3654, 1466, 1830, 1474, 1474, 1474, 1832, 1832,
+     1832, 2050, 1833, 3655, 3656, 1834, 3657, 2057, 2057, 2057,
+     1490, 1490, 1490, 1476, 2061, 2061, 2061, 4192, 4192, 4192,
+     4192, 4192, 4192, 2051, 2058, 1843, 1843, 1843, 1492, 3658,
+     3659, 2062, 3660, 3661, 4192, 3666, 3667, 4192, 4192, 4192,
+     4192, 3672, 1844, 2054, 2065, 2065, 2065, 3673, 2066, 3674,
+     3675, 2067, 1845, 1845, 1845, 4192, 1846, 3607, 3676, 1847,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 2060, 3677, 2064, 4192,
+     4192, 4192, 4192, 4192, 4192, 3680, 3608, 4192, 3609, 3680,
+     4192, 4192, 4192, 4192, 2063, 3683, 4192, 1351, 3684, 4192,
+     2068, 3610, 2074, 2074, 2074, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 1515, 1515, 1515, 2069, 2075,
+     3602, 3685, 4192, 1865, 1865, 1865, 4192, 2071, 3688, 4192,
+     1522, 1522, 1522, 1517, 3603, 1531, 1531, 1531, 3689, 3678,
+     1866, 1544, 1544, 1544, 2070, 1977, 1978, 2072, 1524, 2090,
+     2090, 2090, 2073, 1533, 2086, 2086, 2086, 3602, 2087, 1546,
+     3690, 2088, 1873, 1873, 1873, 3691, 2091, 3367, 3605, 1557,
+
+     1557, 1557, 2077, 3693, 2078, 3694, 2076, 3368, 3641, 1874,
+     3692, 2079, 3707, 2080, 2097, 2097, 2097, 1559, 2098, 3708,
+     3642, 2099, 3709, 2083, 3643, 3369, 2092, 1876, 1876, 1876,
+     2101, 2101, 2101, 3710, 2102, 3717, 3370, 2103, 2094, 1562,
+     1562, 1562, 3722, 3686, 1877, 1573, 1573, 1573, 3701, 1581,
+     1581, 1581, 2112, 2112, 2112, 3725, 3702, 1564, 1589, 1589,
+     1589, 3687, 3726, 1575, 3727, 3728, 2100, 1583, 3729, 2113,
+     1888, 1888, 1888, 2115, 2115, 2115, 1591, 2116, 3613, 3730,
+     2117, 1595, 1595, 1595, 2121, 2121, 2121, 1889, 1896, 1896,
+     1896, 3731, 1897, 3732, 3614, 1898, 3615, 3733, 2104, 1597,
+
+     3705, 2122, 3736, 2109, 2125, 2125, 2125, 2111, 3706, 3616,
+     2114, 1610, 1610, 1610, 1616, 1616, 1616, 1910, 1910, 1910,
+     3715, 2126, 3737, 2138, 2138, 2138, 3738, 2139, 3716, 1612,
+     2140, 3393, 1618, 3699, 1911, 1629, 1629, 1629, 2145, 2145,
+     2145, 3394, 2119, 1637, 1637, 1637, 3720, 1922, 1922, 1922,
+     3734, 2127, 3700, 1631, 3721, 2146, 1919, 1919, 1919, 3395,
+     1920, 1639, 3680, 1921, 1923, 2149, 2149, 2149, 3735, 2150,
+     3396, 3742, 2151, 1924, 1924, 1924, 2129, 1925, 3703, 3713,
+     1926, 2132, 1928, 1928, 1928, 2144, 2153, 2153, 2153, 3718,
+     2154, 3680, 3743, 2155, 1653, 1653, 1653, 3704, 3714, 1929,
+
+     1932, 1932, 1932, 3744, 1933, 3745, 2147, 1934, 3719, 1935,
+     1935, 1935, 1655, 1936, 3746, 3747, 1937, 1662, 1662, 1662,
+     1670, 1670, 1670, 1680, 1680, 1680, 2167, 2167, 2167, 1948,
+     1948, 1948, 2169, 2169, 2169, 1664, 2170, 3748, 1672, 2171,
+     3749, 1682, 3750, 2168, 3739, 2157, 1949, 1690, 1690, 1690,
+     1952, 1952, 1952, 2174, 2174, 2174, 3751, 2175, 3752, 3740,
+     2176, 1701, 1701, 1701, 3756, 1692, 3757, 1953, 1958, 1958,
+     1958, 2181, 2181, 2181, 3758, 2182, 3759, 3760, 2183, 1703,
+     2184, 2184, 2184, 3761, 2159, 1959, 3762, 2161, 2165, 1708,
+     1708, 1708, 1716, 1716, 1716, 3763, 3764, 2185, 1964, 1964,
+
+     1964, 3765, 1965, 3766, 3767, 1966, 3771, 1710, 3772, 3773,
+     1718, 2179, 2172, 1969, 1969, 1969, 3774, 1970, 3775, 3776,
+     1971, 3777, 1727, 1727, 1727, 1976, 1976, 1976, 2227, 2227,
+     2227, 2235, 2235, 2235, 2237, 2237, 2237, 3778, 3779, 2186,
+     1729, 3780, 3784, 1977, 2188, 4192, 4192, 4192, 2236, 3785,
+     3786, 2238, 1421, 1421, 1421, 3787, 2034, 2034, 2034, 3788,
+     2035, 3789, 4192, 2036, 1431, 1431, 1431, 2042, 2042, 2042,
+     1423, 2248, 2248, 2248, 2192, 2249, 3790, 2194, 2250, 1437,
+     1437, 1437, 1433, 3791, 2043, 1446, 1446, 1446, 2255, 2255,
+     2255, 3792, 3793, 2215, 2195, 3794, 3795, 1439, 2257, 2257,
+
+     2257, 3796, 3797, 1448, 3799, 2256, 1456, 1456, 1456, 3800,
+     2239, 3801, 1464, 1464, 1464, 2258, 2261, 2261, 2261, 3802,
+     2240, 2263, 2263, 2263, 1458, 1474, 1474, 1474, 3803, 2246,
+     1466, 3804, 3805, 2262, 2254, 2266, 2266, 2266, 2264, 2251,
+     4192, 4192, 4192, 1476, 2057, 2057, 2057, 2269, 2269, 2269,
+     3806, 2270, 2267, 3807, 2271, 3808, 3809, 4192, 2272, 2272,
+     2272, 2058, 1490, 1490, 1490, 2061, 2061, 2061, 3814, 2275,
+     2275, 2275, 2259, 2276, 3815, 2273, 2277, 3644, 2260, 3816,
+     1492, 3817, 2062, 2278, 2278, 2278, 4192, 4192, 4192, 3645,
+     3818, 2265, 3397, 3646, 2065, 2065, 2065, 3819, 2066, 2268,
+
+     2279, 2067, 3398, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     2283, 2283, 2283, 4192, 4192, 4192, 4192, 4192, 4192, 3820,
+     3399, 4192, 3810, 2274, 4192, 3821, 3822, 2284, 3662, 3823,
+     4192, 3400, 3812, 4192, 3811, 4192, 4192, 4192, 2074, 2074,
+     2074, 2288, 2288, 2288, 3813, 2289, 3824, 3663, 2290, 3664,
+     3825, 2280, 4192, 3826, 3827, 2075, 3828, 2282, 2291, 2291,
+     2291, 3829, 3665, 2286, 4192, 4192, 4192, 3830, 3831, 2281,
+     3832, 3833, 2285, 3834, 3835, 2292, 4192, 4192, 4192, 3836,
+     3837, 4192, 1515, 1515, 1515, 1522, 1522, 1522, 3838, 2287,
+     2299, 2299, 2299, 4192, 2086, 2086, 2086, 3839, 2087, 3840,
+
+     1517, 2088, 3841, 1524, 2303, 2303, 2303, 3842, 2300, 2090,
+     2090, 2090, 2293, 2305, 2305, 2305, 3843, 2306, 3844, 3845,
+     2307, 2304, 2310, 2310, 2310, 3847, 2091, 2095, 2095, 2095,
+     2294, 2312, 2312, 2312, 3848, 2097, 2097, 2097, 3849, 2098,
+     2311, 2296, 2099, 1557, 1557, 1557, 2101, 2101, 2101, 2295,
+     2102, 3850, 3851, 2103, 1562, 1562, 1562, 2319, 2319, 2319,
+     3852, 1559, 1581, 1581, 1581, 2112, 2112, 2112, 3853, 2323,
+     2323, 2323, 1564, 2324, 3854, 2320, 2325, 1589, 1589, 1589,
+     1583, 3855, 2113, 1351, 2115, 2115, 2115, 3856, 2116, 3668,
+     2313, 2117, 1595, 1595, 1595, 1591, 2121, 2121, 2121, 2330,
+
+     2330, 2330, 3857, 2331, 3858, 3669, 2332, 3670, 3846, 2322,
+     1597, 3859, 3860, 2122, 2333, 2333, 2333, 2125, 2125, 2125,
+     3671, 3861, 2314, 2336, 2336, 2336, 3862, 2337, 3863, 3864,
+     2338, 2334, 3865, 3866, 2126, 3867, 2326, 2341, 2341, 2341,
+     1616, 1616, 1616, 2346, 2346, 2346, 2138, 2138, 2138, 3868,
+     2139, 3869, 3870, 2140, 3871, 2342, 3872, 3873, 1618, 2328,
+     1629, 1629, 1629, 2145, 2145, 2145, 2355, 2355, 2355, 3874,
+     2356, 3875, 3876, 2357, 2358, 2358, 2358, 3877, 1631, 3878,
+     2146, 2149, 2149, 2149, 3879, 2150, 3880, 3881, 2151, 1653,
+     1653, 1653, 2359, 2345, 2153, 2153, 2153, 3882, 2154, 3883,
+
+     3884, 2155, 1662, 1662, 1662, 3885, 3886, 1655, 1670, 1670,
+     1670, 3888, 2354, 2368, 2368, 2368, 4192, 4192, 4192, 3889,
+     1664, 2371, 2371, 2371, 3890, 1351, 1672, 1680, 1680, 1680,
+     2369, 3891, 3892, 4192, 3893, 2167, 2167, 2167, 2372, 2375,
+     2375, 2375, 3894, 2376, 3887, 1682, 2377, 1690, 1690, 1690,
+     3895, 2363, 2168, 3896, 2365, 2169, 2169, 2169, 3897, 2170,
+     2367, 3898, 2171, 3899, 3900, 1692, 2174, 2174, 2174, 3901,
+     2175, 3902, 3903, 2176, 3904, 2373, 1701, 1701, 1701, 3905,
+     2181, 2181, 2181, 2370, 2182, 3906, 3907, 2183, 2184, 2184,
+     2184, 1708, 1708, 1708, 1703, 2378, 2392, 2392, 2392, 3908,
+
+     2393, 3909, 3910, 2394, 3911, 2185, 2397, 2397, 2397, 1710,
+     2399, 2399, 2399, 2401, 2401, 2401, 4192, 4192, 4192, 1727,
+     1727, 1727, 3912, 3913, 2398, 3914, 3915, 2400, 2382, 3916,
+     2402, 3917, 3918, 4192, 2408, 2408, 2408, 1729, 2199, 2199,
+     2199, 3919, 3920, 2395, 2418, 2418, 2418, 2210, 2210, 2210,
+     3921, 2409, 2425, 2425, 2425, 2404, 2214, 2214, 2214, 2426,
+     2426, 2426, 2217, 2217, 2217, 2227, 2227, 2227, 2439, 2439,
+     2439, 2230, 2230, 2230, 2235, 2235, 2235, 3922, 2443, 2443,
+     2443, 2403, 2444, 3923, 3925, 2445, 2237, 2237, 2237, 3926,
+     1351, 2236, 2446, 2446, 2446, 3927, 2447, 3928, 3929, 2448,
+
+     1421, 1421, 1421, 2238, 2456, 2456, 2456, 2248, 2248, 2248,
+     3924, 2249, 3930, 3931, 2250, 2461, 2461, 2461, 1423, 1437,
+     1437, 1437, 2457, 1446, 1446, 1446, 2255, 2255, 2255, 2464,
+     2464, 2464, 2462, 2465, 3932, 3933, 2466, 1439, 2257, 2257,
+     2257, 1448, 3934, 2256, 2467, 2467, 2467, 3935, 2468, 3936,
+     3937, 2469, 1456, 1456, 1456, 2258, 1464, 1464, 1464, 2261,
+     2261, 2261, 2472, 2472, 2472, 3938, 2473, 2450, 3939, 2474,
+     1458, 2459, 3940, 3941, 1466, 3942, 2262, 2263, 2263, 2263,
+     2475, 2475, 2475, 3943, 2476, 2463, 3944, 2477, 1474, 1474,
+     1474, 2266, 2266, 2266, 2264, 2479, 2479, 2479, 3945, 2480,
+
+     3946, 3947, 2481, 2482, 2482, 2482, 1476, 3948, 2267, 2269,
+     2269, 2269, 3949, 2270, 3950, 3951, 2271, 3952, 2470, 3953,
+     2483, 3954, 2471, 2272, 2272, 2272, 2484, 2484, 2484, 3955,
+     2485, 3956, 3958, 2486, 1490, 1490, 1490, 2275, 2275, 2275,
+     2273, 2276, 1351, 3959, 2277, 2278, 2278, 2278, 3957, 2488,
+     2488, 2488, 1492, 2489, 2478, 3960, 2490, 2283, 2283, 2283,
+     3961, 3962, 2279, 2494, 2494, 2494, 3963, 2495, 3964, 3965,
+     2496, 2497, 2497, 2497, 2284, 2288, 2288, 2288, 3966, 2289,
+     3967, 3968, 2290, 2291, 2291, 2291, 2487, 3969, 2498, 2501,
+     2501, 2501, 3970, 2502, 3971, 3972, 2503, 1515, 1515, 1515,
+
+     2292, 1522, 1522, 1522, 2508, 2508, 2508, 4192, 4192, 4192,
+     2299, 2299, 2299, 3973, 3974, 1517, 2303, 2303, 2303, 1524,
+     3975, 2509, 3976, 3977, 4192, 2513, 2513, 2513, 2300, 2514,
+     3978, 3979, 2515, 2304, 2305, 2305, 2305, 3980, 2306, 3981,
+     1351, 2307, 2310, 2310, 2310, 2312, 2312, 2312, 3983, 2506,
+     1557, 1557, 1557, 3984, 3982, 2507, 1562, 1562, 1562, 3985,
+     2311, 2521, 2521, 2521, 2319, 2319, 2319, 3986, 1559, 1581,
+     1581, 1581, 3987, 3988, 1564, 3989, 3990, 2510, 2522, 2323,
+     2323, 2323, 2320, 2324, 3991, 3992, 2325, 1583, 1589, 1589,
+     1589, 3993, 2530, 2530, 2530, 2330, 2330, 2330, 3994, 2331,
+
+     3995, 3996, 2332, 2333, 2333, 2333, 1591, 2519, 2523, 2518,
+     2531, 2533, 2533, 2533, 3997, 2534, 3998, 4000, 2535, 2527,
+     2334, 2336, 2336, 2336, 4001, 2337, 4002, 4003, 2338, 2341,
+     2341, 2341, 2540, 2540, 2540, 2528, 1616, 1616, 1616, 2346,
+     2346, 2346, 2543, 2543, 2543, 4004, 4005, 2342, 4006, 2541,
+     2545, 2545, 2545, 4007, 1618, 1629, 1629, 1629, 2355, 2355,
+     2355, 4008, 2356, 4009, 4010, 2357, 2358, 2358, 2358, 2552,
+     2552, 2552, 4011, 1631, 1653, 1653, 1653, 2557, 2557, 2557,
+     4012, 1670, 1670, 1670, 2359, 4013, 2553, 2368, 2368, 2368,
+     4014, 4015, 1655, 4018, 4019, 2558, 4020, 4021, 2542, 1672,
+
+     4022, 2561, 2561, 2561, 2369, 2562, 4023, 4024, 2563, 2564,
+     2564, 2564, 2371, 2371, 2371, 2566, 2566, 2566, 4025, 2567,
+     4026, 2550, 2568, 1680, 1680, 1680, 2565, 4027, 4030, 2372,
+     2570, 2570, 2570, 4031, 2555, 2375, 2375, 2375, 1351, 2376,
+     4032, 1682, 2377, 1690, 1690, 1690, 2560, 2571, 2576, 2576,
+     2576, 2578, 2578, 2578, 4033, 2392, 2392, 2392, 1351, 2393,
+     1351, 1692, 2394, 1708, 1708, 1708, 2577, 1351, 2579, 2591,
+     2591, 2591, 2397, 2397, 2397, 4028, 1855, 2569, 2399, 2399,
+     2399, 1710, 2401, 2401, 2401, 1351, 2592, 2593, 2593, 2593,
+     2398, 2594, 4045, 1854, 2595, 2400, 1351, 2572, 4044, 2402,
+
+     2596, 2596, 2596, 4038, 2597, 4056, 1351, 2598, 1853, 4034,
+     2590, 1727, 1727, 1727, 2408, 2408, 2408, 2604, 2604, 2604,
+     4046, 2605, 4029, 1351, 2606, 2607, 2607, 2607, 1351, 1729,
+     1852, 2409, 2613, 2613, 2613, 2614, 2614, 2614, 2418, 2418,
+     2418, 2616, 2616, 2616, 2620, 2620, 2620, 2425, 2425, 2425,
+     2426, 2426, 2426, 2621, 2621, 2621, 2625, 2625, 2625, 2630,
+     2630, 2630, 2631, 2631, 2631, 2633, 2633, 2633, 2439, 2439,
+     2439, 1351, 4035, 2600, 2634, 2634, 2634, 2443, 2443, 2443,
+     4048, 2444, 1351, 1851, 2445, 2446, 2446, 2446, 1351, 2447,
+     1351, 1351, 2448, 1421, 1421, 1421, 2641, 2641, 2641, 1850,
+
+     2622, 4192, 4192, 4192, 4049, 4192, 4192, 4192, 4192, 4192,
+     4192, 1423, 1351, 2642, 2456, 2456, 2456, 1351, 4192, 4047,
+     4036, 2635, 4192, 1351, 4060, 4192, 1437, 1437, 1437, 2461,
+     2461, 2461, 2457, 2649, 2649, 2649, 4039, 2650, 1351, 4037,
+     2651, 1446, 1446, 1446, 1439, 2639, 2462, 2464, 2464, 2464,
+     1849, 2465, 1848, 2643, 2466, 4058, 2467, 2467, 2467, 1448,
+     2468, 4050, 1351, 2469, 1456, 1456, 1456, 1842, 2645, 1351,
+     2644, 1464, 1464, 1464, 2472, 2472, 2472, 1351, 2473, 4040,
+     4062, 2474, 1458, 1351, 2653, 2761, 2762, 2647, 2763, 1466,
+     2475, 2475, 2475, 4051, 2476, 1351, 2764, 2477, 1474, 1474,
+
+     1474, 1351, 2652, 2765, 2479, 2479, 2479, 2654, 2480, 1351,
+     4052, 2481, 2482, 2482, 2482, 4053, 1476, 2656, 2656, 2656,
+     1351, 2657, 1351, 1351, 2658, 4054, 2484, 2484, 2484, 2483,
+     2485, 4041, 4055, 2486, 1490, 1490, 1490, 2488, 2488, 2488,
+     1351, 2489, 2655, 4057, 2490, 4064, 2494, 2494, 2494, 1351,
+     2495, 1351, 1492, 2496, 2497, 2497, 2497, 2663, 2663, 2663,
+     4061, 2664, 1351, 1351, 2665, 2501, 2501, 2501, 4059, 2502,
+     1351, 2498, 2503, 2669, 2669, 2669, 1515, 1515, 1515, 2672,
+     2672, 2672, 2508, 2508, 2508, 2674, 2674, 2674, 1351, 2675,
+     2670, 4065, 2676, 4067, 1517, 1351, 1351, 2673, 1351, 2509,
+
+     4063, 2659, 2677, 2677, 2677, 2513, 2513, 2513, 4072, 2514,
+     4068, 1351, 2515, 1557, 1557, 1557, 1562, 1562, 1562, 2678,
+     2521, 2521, 2521, 2686, 2686, 2686, 1351, 2687, 1351, 4042,
+     2688, 1559, 4066, 1351, 1564, 4070, 4074, 2522, 1581, 1581,
+     1581, 2671, 4073, 1589, 1589, 1589, 2530, 2530, 2530, 4077,
+     2533, 2533, 2533, 1841, 2534, 1840, 1583, 2535, 2540, 2540,
+     2540, 1591, 4069, 4088, 2531, 1616, 1616, 1616, 2684, 2683,
+     2701, 2701, 2701, 1351, 2702, 2541, 1351, 2703, 2543, 2543,
+     2543, 4043, 1351, 1618, 2705, 2705, 2705, 2545, 2545, 2545,
+     2706, 2706, 2706, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4192, 1629, 1629, 1629, 2693, 2694, 2707, 1351, 4071,
+     4192, 1351, 1838, 4192, 4079, 4080, 4192, 2552, 2552, 2552,
+     1631, 2713, 2713, 2713, 1351, 2714, 1351, 1351, 2715, 4075,
+     2704, 2717, 2717, 2717, 2553, 2557, 2557, 2557, 2721, 2721,
+     2721, 2564, 2564, 2564, 4076, 2708, 2607, 2607, 2607, 2718,
+     2561, 2561, 2561, 2558, 2562, 4093, 2722, 2563, 2565, 2710,
+     4078, 2709, 2723, 2723, 2723, 1837, 2724, 4082, 2711, 2725,
+     2566, 2566, 2566, 4095, 2567, 1351, 1351, 2568, 1680, 1680,
+     1680, 2570, 2570, 2570, 2727, 2727, 2727, 4101, 2728, 1351,
+     1351, 2729, 1690, 1690, 1690, 1351, 1682, 1351, 2571, 2576,
+
+     2576, 2576, 2578, 2578, 2578, 2734, 2734, 2734, 4081, 2735,
+     1692, 1351, 2736, 1708, 1708, 1708, 1351, 2577, 1351, 2579,
+     2591, 2591, 2591, 4083, 4090, 2748, 2748, 2748, 1351, 2749,
+     2726, 1710, 2750, 4084, 2593, 2593, 2593, 2592, 2594, 4085,
+     1836, 2595, 4087, 1835, 2730, 2596, 2596, 2596, 1351, 2597,
+     4104, 1351, 2598, 1727, 1727, 1727, 2753, 2753, 2753, 4105,
+     2604, 2604, 2604, 2747, 2605, 4096, 1827, 2606, 2766, 2766,
+     2766, 1729, 4089, 1351, 1351, 2767, 2767, 2767, 2613, 2613,
+     2613, 2614, 2614, 2614, 2616, 2616, 2616, 2772, 2772, 2772,
+     2774, 2774, 2774, 2620, 2620, 2620, 2621, 2621, 2621, 2625,
+
+     2625, 2625, 2778, 2778, 2778, 2630, 2630, 2630, 2631, 2631,
+     2631, 2633, 2633, 2633, 2634, 2634, 2634, 2787, 2787, 2787,
+     4098, 2752, 2789, 2789, 2789, 2641, 2641, 2641, 1351, 2790,
+     2790, 2790, 4103, 2791, 1351, 2788, 2792, 2793, 2793, 2793,
+     1351, 1826, 2642, 4192, 4192, 4192, 4192, 4192, 4192, 2797,
+     2797, 2797, 1351, 1351, 2794, 1437, 1437, 1437, 1351, 1811,
+     4192, 1351, 1810, 4192, 2799, 2799, 2799, 2649, 2649, 2649,
+     4086, 2650, 4091, 1439, 2651, 1446, 1446, 1446, 1456, 1456,
+     1456, 2800, 1464, 1464, 1464, 1474, 1474, 1474, 4097, 1351,
+     2656, 2656, 2656, 1448, 2657, 2795, 1458, 2658, 2796, 4109,
+
+     1466, 4107, 4092, 1476, 1351, 2805, 2805, 2805, 1351, 2663,
+     2663, 2663, 1351, 2664, 1351, 2802, 2665, 2811, 2811, 2811,
+     1351, 1351, 2798, 2806, 2669, 2669, 2669, 2801, 2815, 2815,
+     2815, 1351, 2816, 4094, 2812, 2817, 2818, 2818, 2818, 1351,
+     4099, 2670, 4106, 1351, 2803, 4129, 1351, 2804, 2672, 2672,
+     2672, 2674, 2674, 2674, 2819, 2675, 4100, 4102, 2676, 2677,
+     2677, 2677, 4148, 2820, 2820, 2820, 2673, 2821, 1805, 4111,
+     2822, 1557, 1557, 1557, 4136, 1351, 2678, 2828, 2828, 2828,
+     2830, 2830, 2830, 2686, 2686, 2686, 4116, 2687, 4113, 1559,
+     2688, 4192, 4192, 4192, 1351, 2829, 1351, 2831, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 2836, 2836, 2836, 4108, 4192, 1351,
+     1581, 1581, 1581, 4112, 1351, 4192, 1351, 4110, 4192, 1804,
+     1351, 2837, 1589, 1589, 1589, 1351, 1351, 2832, 1583, 2840,
+     2840, 2840, 2827, 2846, 2846, 2846, 4115, 2701, 2701, 2701,
+     1591, 2702, 1351, 4120, 2703, 4117, 2841, 2833, 1616, 1616,
+     1616, 1351, 4114, 2835, 2705, 2705, 2705, 2706, 2706, 2706,
+     2834, 2848, 2848, 2848, 1351, 2849, 1618, 4121, 2850, 1351,
+     1351, 2838, 4122, 1802, 2707, 2851, 2851, 2851, 4192, 4192,
+     4192, 4192, 4192, 4192, 2855, 2855, 2855, 2839, 2857, 2857,
+     2857, 4141, 2852, 1351, 4118, 4192, 1351, 4131, 4192, 2713,
+
+     2713, 2713, 2856, 2714, 4144, 2858, 2715, 4124, 2847, 4192,
+     4192, 4192, 1351, 2717, 2717, 2717, 2721, 2721, 2721, 4143,
+     2723, 2723, 2723, 1351, 2724, 1351, 4192, 2725, 1351, 4119,
+     2853, 2718, 1351, 2854, 2722, 2862, 2862, 2862, 2727, 2727,
+     2727, 1351, 2728, 4123, 1351, 2729, 1690, 1690, 1690, 1351,
+     2734, 2734, 2734, 2863, 2735, 1801, 4137, 2736, 4128, 1708,
+     1708, 1708, 4130, 4125, 1692, 2748, 2748, 2748, 1799, 2749,
+     2878, 2879, 2750, 2880, 4139, 4149, 2859, 1710, 4146, 2883,
+     2884, 2881, 2885, 1727, 1727, 1727, 1351, 4126, 2882, 1351,
+     2886, 4140, 1351, 2864, 2753, 2753, 2753, 2887, 2766, 2766,
+
+     2766, 1729, 2767, 2767, 2767, 2908, 2908, 2908, 2772, 2772,
+     2772, 4132, 1351, 2774, 2774, 2774, 2912, 2912, 2912, 1351,
+     1351, 2877, 2778, 2778, 2778, 2916, 2916, 2916, 2919, 2919,
+     2919, 2787, 2787, 2787, 2789, 2789, 2789, 2790, 2790, 2790,
+     4150, 2791, 1351, 1351, 2792, 2793, 2793, 2793, 1351, 2788,
+     2889, 2921, 2921, 2921, 4138, 2922, 1798, 2890, 2923, 2924,
+     2924, 2924, 2794, 2926, 2926, 2926, 2797, 2797, 2797, 2928,
+     2928, 2928, 2799, 2799, 2799, 4145, 2925, 2930, 2930, 2930,
+     2927, 2931, 1351, 1351, 2932, 4155, 4127, 2929, 1351, 2800,
+     2933, 2933, 2933, 1456, 1456, 1456, 1464, 1464, 1464, 1474,
+
+     1474, 1474, 2805, 2805, 2805, 2811, 2811, 2811, 2934, 4133,
+     4134, 1458, 4135, 1797, 1466, 4149, 4147, 1476, 1351, 1351,
+     2806, 1351, 2812, 2942, 2942, 2942, 1351, 2943, 1351, 4142,
+     2944, 2815, 2815, 2815, 1794, 2816, 1351, 4185, 2817, 2818,
+     2818, 2818, 2820, 2820, 2820, 1351, 2821, 1793, 1351, 2822,
+     2955, 2955, 2955, 2957, 2957, 2957, 1351, 2819, 2935, 1791,
+     2937, 1557, 1557, 1557, 2936, 1351, 4151, 2956, 1351, 1787,
+     2958, 2828, 2828, 2828, 2830, 2830, 2830, 1351, 4156, 1559,
+     2960, 2960, 2960, 4154, 2961, 1351, 4161, 2962, 1351, 2829,
+     1786, 2831, 2966, 2966, 2966, 2836, 2836, 2836, 2968, 2968,
+
+     2968, 4157, 2969, 4159, 4158, 2970, 2971, 2971, 2971, 2967,
+     4163, 1351, 2837, 1589, 1589, 1589, 2840, 2840, 2840, 2959,
+     4181, 2974, 2974, 2974, 2972, 2975, 4162, 1782, 2976, 1351,
+     1351, 1591, 4160, 2841, 2979, 2979, 2979, 2981, 2981, 2981,
+     2846, 2846, 2846, 2983, 2983, 2983, 2848, 2848, 2848, 4169,
+     2849, 2980, 1781, 2850, 2982, 2851, 2851, 2851, 2985, 2985,
+     2985, 2984, 2986, 4164, 4182, 2987, 2988, 2988, 2988, 2990,
+     2990, 2990, 2852, 1351, 4165, 2973, 2855, 2855, 2855, 2857,
+     2857, 2857, 1351, 2989, 1351, 4166, 2991, 1780, 2992, 2992,
+     2992, 1779, 2993, 1351, 2856, 2994, 2858, 2862, 2862, 2862,
+
+     1690, 1690, 1690, 1708, 1708, 1708, 1727, 1727, 1727, 2908,
+     2908, 2908, 3044, 3044, 3044, 2863, 1351, 1351, 1692, 1351,
+     1351, 1710, 4170, 1351, 1729, 2912, 2912, 2912, 2916, 2916,
+     2916, 2919, 2919, 2919, 3052, 3052, 3052, 2921, 2921, 2921,
+     1351, 2922, 1778, 1351, 2923, 2924, 2924, 2924, 3054, 3054,
+     3054, 3053, 3055, 1351, 4177, 3056, 4173, 1777, 3025, 2926,
+     2926, 2926, 2925, 1351, 3011, 4167, 4175, 2998, 3057, 3057,
+     3057, 4168, 3058, 4179, 1351, 3059, 2927, 2928, 2928, 2928,
+     2930, 2930, 2930, 1351, 2931, 4171, 4180, 2932, 2933, 2933,
+     2933, 1456, 1456, 1456, 1351, 2929, 1464, 1464, 1464, 1474,
+
+     1474, 1474, 3065, 3065, 3065, 4172, 2934, 1776, 1351, 1458,
+     4174, 2942, 2942, 2942, 1466, 2943, 4183, 1476, 2944, 3066,
+     3079, 3079, 3079, 2955, 2955, 2955, 3081, 3081, 3081, 1351,
+     3082, 1775, 4178, 3083, 3129, 3129, 3129, 3080, 1351, 4189,
+     2956, 2957, 2957, 2957, 1774, 3084, 3084, 3084, 1351, 3085,
+     1351, 3062, 3086, 3060, 3087, 3087, 3087, 4186, 2958, 1773,
+     2960, 2960, 2960, 3061, 2961, 4189, 1351, 2962, 2966, 2966,
+     2966, 4184, 3088, 3092, 3092, 3092, 4176, 3093, 1772, 1351,
+     3094, 4187, 2968, 2968, 2968, 2967, 2969, 1771, 1770, 2970,
+     2971, 2971, 2971, 1589, 1589, 1589, 2974, 2974, 2974, 4188,
+
+     2975, 1769, 1768, 2976, 3103, 3103, 3103, 1767, 2972, 1766,
+     1765, 1591, 2979, 2979, 2979, 3105, 3105, 3105, 1764, 3106,
+     1762, 3104, 3107, 2981, 2981, 2981, 3108, 3108, 3108, 2980,
+     3109, 1761, 1760, 3110, 2983, 2983, 2983, 2985, 2985, 2985,
+     2982, 2986, 1759, 1758, 2987, 2988, 2988, 2988, 2990, 2990,
+     2990, 1755, 2984, 3111, 3111, 3111, 3101, 3112, 1754, 1753,
+     3113, 1752, 2989, 1751, 1750, 2991, 3114, 3114, 3114, 1749,
+     3115, 1748, 1747, 3116, 2992, 2992, 2992, 1746, 2993, 1745,
+     1744, 2994, 3124, 3124, 3124, 3126, 3126, 3126, 1690, 1690,
+     1690, 3130, 3130, 3130, 1708, 1708, 1708, 1743, 1742, 3125,
+
+     1741, 1740, 3127, 3155, 3155, 3155, 1692, 1737, 3131, 3157,
+     3157, 3157, 1710, 3175, 3175, 3175, 3044, 3044, 3044, 1736,
+     3156, 3180, 3180, 3180, 3052, 3052, 3052, 3158, 3184, 3184,
+     3184, 1735, 3185, 1734, 1733, 3186, 3054, 3054, 3054, 1732,
+     3055, 3053, 1351, 3056, 3057, 3057, 3057, 1715, 3058, 1707,
+     1706, 3059, 1456, 1456, 1456, 3142, 1464, 1464, 1464, 1705,
+     3128, 1474, 1474, 1474, 3195, 3195, 3195, 3065, 3065, 3065,
+     1458, 3197, 3197, 3197, 1466, 3198, 1700, 1699, 3199, 1476,
+     1695, 3196, 1689, 1688, 3066, 3200, 3200, 3200, 3079, 3079,
+     3079, 3213, 3213, 3213, 1684, 3214, 1679, 3193, 3215, 3081,
+
+     3081, 3081, 3201, 3082, 1675, 3080, 3083, 1674, 3192, 3084,
+     3084, 3084, 1666, 3085, 1652, 1651, 3086, 3087, 3087, 3087,
+     3191, 3217, 3217, 3217, 3092, 3092, 3092, 1650, 3093, 1647,
+     1641, 3094, 3226, 3226, 3226, 3088, 1636, 1628, 3218, 3103,
+     3103, 3103, 3229, 3229, 3229, 1627, 3230, 1626, 1625, 3231,
+     3227, 3105, 3105, 3105, 1624, 3106, 3104, 1623, 3107, 3108,
+     3108, 3108, 1622, 3109, 1621, 1620, 3110, 3111, 3111, 3111,
+     1615, 3112, 1614, 1609, 3113, 3114, 3114, 3114, 1608, 3115,
+     1602, 1599, 3116, 3124, 3124, 3124, 3245, 3245, 3245, 1594,
+     3246, 1593, 1588, 3247, 3126, 3126, 3126, 3248, 3248, 3248,
+
+     3125, 3249, 1577, 1572, 3250, 1690, 1690, 1690, 3129, 3129,
+     3129, 3127, 3130, 3130, 3130, 3252, 3252, 3252, 1571, 3253,
+     1570, 1566, 3254, 1692, 1708, 1708, 1708, 1561, 1550, 3131,
+     3155, 3155, 3155, 3276, 3276, 3276, 1548, 3277, 1543, 1542,
+     3278, 1541, 1710, 3157, 3157, 3157, 1537, 3156, 3281, 3281,
+     3281, 3175, 3175, 3175, 3297, 3297, 3297, 3180, 3180, 3180,
+     1536, 3158, 3301, 3301, 3301, 3282, 1977, 1535, 3251, 1530,
+     3184, 3184, 3184, 1529, 3185, 1514, 3263, 3186, 1456, 1456,
+     1456, 3316, 3316, 3316, 1474, 1474, 1474, 3195, 3195, 3195,
+     3320, 3320, 3320, 1513, 3321, 1512, 1458, 3322, 1511, 3317,
+
+     1510, 1509, 1476, 1508, 3196, 3197, 3197, 3197, 1507, 3198,
+     1506, 1500, 3199, 3200, 3200, 3200, 3323, 3323, 3323, 1445,
+     3324, 1441, 1436, 3325, 3213, 3213, 3213, 1435, 3214, 1430,
+     3201, 3215, 3217, 3217, 3217, 3338, 3338, 3338, 1429, 3339,
+     1428, 1427, 3340, 1426, 1425, 3315, 3318, 1413, 1412, 3218,
+     3226, 3226, 3226, 3229, 3229, 3229, 1411, 3230, 1410, 1409,
+     3231, 3361, 3361, 3361, 1408, 3245, 3245, 3245, 3227, 3246,
+     1407, 1406, 3247, 3248, 3248, 3248, 1405, 3249, 3362, 1404,
+     3250, 1690, 1690, 1690, 3252, 3252, 3252, 1403, 3253, 1402,
+     1401, 3254, 1708, 1708, 1708, 1400, 3276, 3276, 3276, 1692,
+
+     3277, 1399, 1398, 3278, 3402, 3402, 3402, 3281, 3281, 3281,
+     1710, 3404, 3404, 3404, 1397, 3405, 1396, 1393, 3406, 1392,
+     1391, 3403, 1977, 1390, 3282, 1977, 3415, 3415, 3415, 1977,
+     3297, 3297, 3297, 3371, 3417, 3417, 3417, 3418, 3418, 3418,
+     1389, 1388, 3380, 3301, 3301, 3301, 3420, 3420, 3420, 1456,
+     1456, 1456, 3316, 3316, 3316, 1474, 1474, 1474, 3320, 3320,
+     3320, 1387, 3321, 1386, 1385, 3322, 1382, 1458, 1381, 1380,
+     3317, 1379, 1378, 1476, 3323, 3323, 3323, 1377, 3324, 1376,
+     1375, 3325, 3436, 3436, 3436, 3448, 3448, 3448, 3338, 3338,
+     3338, 1374, 3339, 1373, 1372, 3340, 3450, 3450, 3450, 3437,
+
+     1365, 3433, 3449, 3361, 3361, 3361, 1361, 3469, 3469, 3469,
+     1360, 3470, 1359, 3451, 3471, 3480, 3480, 3480, 1358, 1357,
+     3362, 1354, 1352, 3434, 1708, 1708, 1708, 3402, 3402, 3402,
+     3506, 3506, 3506, 3481, 3507, 1351, 1349, 3508, 1347, 3404,
+     3404, 3404, 1710, 3405, 3403, 1977, 3406, 1346, 1977, 3415,
+     3415, 3415, 3417, 3417, 3417, 1345, 1344, 1977, 3418, 3418,
+     3418, 3420, 3420, 3420, 3531, 3531, 3531, 1474, 1474, 1474,
+     3436, 3436, 3436, 3535, 3535, 3535, 1343, 3536, 1341, 1338,
+     3537, 1336, 3532, 1335, 1334, 1476, 1333, 3437, 3538, 3538,
+     3538, 3488, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975,
+
+     1975, 1332, 1329, 1975, 1326, 3539, 1325, 1324, 1975, 1975,
+     1975, 1977, 1975, 3448, 3448, 3448, 3547, 3547, 3547, 1322,
+     3548, 1321, 1318, 3549, 3550, 3550, 3550, 1317, 3551, 1315,
+     3449, 3552, 1312, 1311, 3533, 3450, 3450, 3450, 1975, 1975,
+     1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1310,
+     1306, 1975, 3451, 3480, 3480, 3480, 1975, 1975, 1975, 1977,
+     1975, 3469, 3469, 3469, 1305, 3470, 1303, 1302, 3471, 1301,
+     1300, 3481, 3584, 3584, 3584, 3506, 3506, 3506, 1298, 3507,
+     1297, 1296, 3508, 3619, 3619, 3619, 1975, 1975, 1295, 1294,
+     3585, 1293, 1290, 1977, 1975, 1975, 1975, 1975, 1975, 3606,
+
+     1975, 1975, 1975, 1289, 1287, 1975, 3620, 3620, 3620, 1284,
+     1975, 1975, 1975, 1977, 1975, 3531, 3531, 3531, 1474, 1474,
+     1474, 3535, 3535, 3535, 1282, 3536, 1281, 1280, 3537, 3619,
+     3619, 3619, 1279, 3532, 1278, 1273, 1476, 3538, 3538, 3538,
+     1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975,
+     3606, 1271, 1270, 1975, 3539, 3620, 3620, 3620, 1975, 1975,
+     1975, 1977, 1975, 1269, 3633, 3633, 3633, 1267, 3634, 1266,
+     3627, 3635, 3547, 3547, 3547, 1265, 3548, 1262, 1261, 3549,
+     3550, 3550, 3550, 1260, 3551, 1259, 1257, 3552, 1975, 1975,
+     3584, 3584, 3584, 3682, 3682, 3682, 3695, 3695, 3695, 3697,
+
+     3697, 3697, 3633, 3633, 3633, 1256, 3634, 1255, 3585, 3635,
+     1253, 1977, 1978, 1250, 3696, 1246, 3698, 3711, 3711, 3711,
+     3723, 3723, 3723, 3741, 3741, 3741, 3682, 3682, 3682, 3695,
+     3695, 3695, 1245, 1243, 3712, 1242, 1241, 3724, 3697, 3697,
+     3697, 1351, 1238, 1237, 1977, 1235, 1234, 3696, 1228, 3753,
+     3753, 3753, 1227, 3754, 1226, 3698, 3755, 3711, 3711, 3711,
+     3768, 3768, 3768, 1225, 3769, 1223, 1222, 3770, 3723, 3723,
+     3723, 3741, 3741, 3741, 3712, 3781, 3781, 3781, 2194, 3782,
+     1221, 1216, 3783, 1215, 1213, 3724, 3753, 3753, 3753, 1351,
+     3754, 1212, 1209, 3755, 3768, 3768, 3768, 1205, 3769, 1203,
+
+     1202, 3770, 3781, 3781, 3781, 1201, 3782, 1200, 3798, 3783,
+     3999, 3999, 3999, 3999, 3999, 3999, 1199, 4016, 1198, 1197,
+     4017, 4152, 4152, 4152, 4152, 4152, 4152, 1196, 1351, 1195,
+     1194, 1351, 4190, 4190, 4190, 4190, 4190, 4190, 1191, 4153,
+     1188, 1187, 4153, 1185, 1184, 1183, 1182, 1181, 1176, 1174,
+     4191, 1173, 1172, 4191,  334,  334,  334,  334,  334,  334,
+      334,  334,  334,  335,  335,  335,  335,  335,  335,  335,
+      335,  335,  340,  340,  340,  340,  340,  340,  340,  340,
+      340,  343,  343,  343,  343,  343,  343,  343,  343,  343,
+      346,  346,  346,  346,  346,  346,  346,  346,  346,  349,
+
+      349,  349,  349,  349,  349,  349,  349,  349,  356,  356,
+      356,  356,  356,  356,  356,  356,  356,  363,  363,  363,
+      363,  363,  363,  363,  363,  363,  368,  368,  368,  368,
+      368,  368,  368,  368,  368,  387,  387,  387,  387,  387,
+      387,  387,  387,  387,  393,  393,  393,  393,  393,  393,
+      393,  393,  393,  401,  401,  401,  401,  401,  401,  401,
+      401,  401,  409,  409,  409,  409,  409,  409,  409,  409,
+      409,  417,  417,  417,  417,  417,  417,  417,  417,  417,
+      421,  421,  421,  421,  421,  421,  421,  421,  421,  427,
+      427,  427,  427,  427,  427,  427,  427,  427,  433,  433,
+
+      433,  433,  433,  433,  433,  433,  433,  439,  439,  439,
+      439,  439,  439,  439,  439,  439,  445,  445,  445,  445,
+      445,  445,  445,  445,  445,  452,  452,  452,  452,  452,
+      452,  452,  452,  452,  457,  457,  457,  457,  457,  457,
+      457,  457,  457,  464,  464,  464,  464,  464,  464,  464,
+      464,  464,  470,  470,  470,  470,  470,  470,  470,  470,
+      470,  477,  477,  477,  477,  477,  477,  477,  477,  477,
+      486,  486,  486,  486,  486,  486,  486,  486,  486,  492,
+      492,  492,  492,  492,  492,  492,  492,  492,  503,  503,
+      503,  503,  503,  503,  503,  503,  503,  510,  510,  510,
+
+      510,  510,  510,  510,  510,  510,  514,  514,  514,  514,
+      514,  514,  514,  514,  514,  521,  521,  521,  521,  521,
+      521,  521,  521,  521,  527,  527,  527,  527,  527,  527,
+      527,  527,  527,  534,  534,  534,  534,  534,  534,  534,
+      534,  534,  542,  542,  542,  542,  542,  542,  542,  542,
+      542,  550,  550,  550,  550,  550,  550,  550,  550,  550,
+      556,  556,  556,  556,  556,  556,  556,  556,  556,  562,
+      562,  562,  562,  562,  562,  562,  562,  562,  566,  566,
+      566,  566,  566,  566,  566,  566,  566,  574,  574,  574,
+      574,  574,  574,  574,  574,  574,  581,  581,  581,  581,
+
+      581,  581,  581,  581,  581,  588,  588,  588,  588,  588,
+      588,  588,  588,  588,  593,  593,  593,  593,  593,  593,
+      593,  593,  593,  599,  599,  599,  599,  599,  599,  599,
+      599,  599,  604,  604,  604,  604,  604,  604,  604,  604,
+      604,  610,  610,  610,  610,  610,  610,  610,  610,  610,
+      615,  615,  615,  615,  615,  615,  615,  615,  615,  621,
+      621,  621,  621,  621,  621,  621,  621,  621,  630,  630,
+      630,  630,  630,  630,  630,  630,  630,  637,  637,  637,
+      637,  637,  637,  637,  637,  637,  641,  641,  641,  641,
+      641,  641,  641,  641,  641,  652,  652,  652,  652,  652,
+
+      652,  652,  652,  652,  660,  660,  660,  660,  660,  660,
+      660,  660,  660,  667,  667,  667,  667,  667,  667,  667,
+      667,  667,  672,  672,  672,  672,  672,  672,  672,  672,
+      672,  678,  678,  678,  678,  678,  678,  678,  678,  678,
+      686,  686,  686,  686,  686,  686,  686,  686,  686,  692,
+      692,  692,  692,  692,  692,  692,  692,  692,  697,  697,
+      697,  697,  697,  697,  697,  697,  697,  704,  704,  704,
+      704,  704,  704,  704,  704,  704,  709,  709,  709,  709,
+      709,  709,  709,  709,  709,  715,  715,  715,  715,  715,
+      715,  715,  715,  715,  722,  722,  722,  722,  722,  722,
+
+      722,  722,  722,  729,  729,  729,  729,  729,  729,  729,
+      729,  729,  736,  736,  736,  736,  736,  736,  736,  736,
+      736,  744,  744,  744,  744,  744,  744,  744,  744,  744,
+      349,  349,  349,  349,  349,  349,  349,  349,  349,  755,
+      755,  755,  755,  755,  755,  755,  755,  755,  761,  761,
+      761,  761,  761,  761,  761,  761,  761,  767,  767,  767,
+      767,  767,  767,  767,  767,  767,  772,  772,  772,  772,
+      772,  772,  772,  772,  772,  786,  786,  786,  786,  786,
+      786,  786,  786,  786,  792,  792,  792,  792,  792,  792,
+      792,  792,  792,  812,  812,  812, 1171, 1169, 1168,  812,
+
+      856,  856,  856, 1167, 1165, 1164,  856,  864,  864,  864,
+     1163, 1162, 1160,  864,  873,  873,  873, 1157, 1156, 1154,
+      873,  877,  877,  877, 1152, 1150, 1149,  877,  883,  883,
+      883, 1148, 1147, 1146,  883,  889,  889,  889, 1145, 1144,
+     1142,  889,  894,  894,  894, 1141, 1140, 1139,  894,  900,
+      900,  900, 1135, 1134, 1133,  900,  910,  910,  910, 1131,
+     1130, 1129,  910,  927,  927,  927, 1128, 1125, 1124,  927,
+      931,  931,  931, 1123, 1118, 1116,  931,  937,  937,  937,
+     1115, 1114, 1108,  937,  948,  948,  948, 1107, 1106, 1105,
+      948,  954,  954,  954, 1104, 1096, 1095,  954,  958,  958,
+
+      958, 1093, 1090, 1089,  958,  966,  966,  966, 1088, 1087,
+     1082,  966,  971,  971,  971, 1079, 1081, 1074,  971,  976,
+      976,  976, 1073, 1071, 1070,  976,  981,  981,  981,  830,
+     1068, 1067,  981,  992,  992,  992, 1065, 1063, 1062,  992,
+     1002, 1002, 1002, 1061, 1059, 1058, 1002, 1010, 1010, 1010,
+     1055, 1054, 1053, 1010, 1015, 1015, 1015, 1051, 1050, 1048,
+     1015, 1026, 1026, 1026, 1047, 1046, 1045, 1026, 1032, 1032,
+     1032, 1043, 1042, 1041, 1032, 1037, 1037, 1037, 1040, 1039,
+     1038, 1037, 1044, 1044, 1044, 1036, 1034, 1033, 1044, 1052,
+     1052, 1052, 1031, 1027, 1025, 1052, 1060, 1060, 1060, 1021,
+
+     1017, 1016, 1060, 1066, 1066, 1066, 1014, 1012, 1011, 1066,
+     1072, 1072, 1072, 1009, 1007, 1006, 1072, 1078, 1078, 1078,
+     1078, 1078, 1078, 1078, 1005, 1078,  812,  812,  812, 1004,
+     1003, 1001,  812, 1094,  993,  991,  986, 1094,  856,  856,
+      856,  985,  984,  983,  856, 1143,  982,  980,  978, 1143,
+      864,  864,  864,  977,  975,  973,  864, 1151,  972,  970,
+      968, 1151,  873,  873,  873,  967,  965,  964,  873, 1155,
+      961,  960,  959, 1155,  877,  877,  877,  957,  955,  953,
+      877, 1161,  951,  950,  949, 1161,  883,  883,  883,  947,
+      941,  940,  883, 1166,  939,  938,  936, 1166,  889,  889,
+
+      889,  935,  934,  933,  889, 1170,  932,  930,  929, 1170,
+      894,  894,  894,  928,  926,  925,  894, 1175,  924,  918,
+      914, 1175,  900,  900,  900,  913,  909,  905,  900, 1186,
+      904,  903,  902, 1186,  910,  910,  910,  901,  899,  897,
+      910, 1204,  896,  895,  893, 1204,  927,  927,  927,  891,
+      890,  888,  927, 1208,  886,  885,  884, 1208,  931,  931,
+      931,  882,  880,  879,  931, 1214,  878,  876,  874, 1214,
+      937,  937,  937,  872,  871,  869,  937, 1224,  868,  867,
+      866, 1224,  948,  948,  948,  865,  863,  858,  948, 1233,
+      857,  855, 4192, 1233,  954,  954,  954, 4192,  830,  814,
+
+      954, 1236,  813,  811,  810, 1236,  958,  958,  958,  804,
+      803,  804,  958, 1244,  803,  802,  801, 1244,  966,  966,
+      966, 4192, 4192, 4192,  966, 1249, 4192, 4192, 4192, 1249,
+      971,  971,  971, 4192, 4192, 4192,  971, 1254, 4192, 4192,
+     4192, 1254,  976,  976,  976, 4192, 4192, 4192,  976, 1258,
+     4192, 4192, 4192, 1258,  981,  981,  981, 4192, 4192, 4192,
+      981, 1268, 4192, 4192, 4192, 1268,  992,  992,  992, 4192,
+     4192, 4192,  992, 1272, 4192, 4192, 4192, 1272, 1002, 1002,
+     1002, 4192, 4192, 4192, 1002, 1283, 4192, 4192, 4192, 1283,
+     1010, 1010, 1010, 4192, 4192, 4192, 1010, 1288, 4192, 4192,
+
+     4192, 1288, 1015, 1015, 1015, 4192, 4192, 4192, 1015, 1299,
+     4192, 4192, 4192, 1299, 1026, 1026, 1026, 4192, 4192, 4192,
+     1026, 1304, 4192, 4192, 4192, 1304, 1032, 1032, 1032, 4192,
+     4192, 4192, 1032, 1309, 4192, 4192, 4192, 1309, 1037, 1037,
+     1037, 4192, 4192, 4192, 1037, 1316, 4192, 4192, 4192, 1316,
+     1044, 1044, 1044, 4192, 4192, 4192, 1044, 1323, 4192, 4192,
+     4192, 1323, 1052, 1052, 1052, 4192, 4192, 4192, 1052, 1331,
+     4192, 4192, 4192, 1331, 1060, 1060, 1060, 4192, 4192, 4192,
+     1060, 1337, 4192, 4192, 4192, 1337, 1066, 1066, 1066, 4192,
+     4192, 4192, 1066, 1342, 4192, 4192, 4192, 1342, 1072, 1072,
+
+     1072, 4192, 4192, 4192, 1072, 1348, 4192, 4192, 4192, 1348,
+     1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1356,
+     4192, 4192, 4192, 4192, 1356,  812,  812,  812, 4192, 4192,
+     4192,  812, 1367, 1367, 1367, 1367, 4192, 4192, 1367, 1367,
+      856,  856,  856,  856, 4192,  856, 4192,  856, 1422, 1422,
+     1422, 1422, 4192, 4192, 1422, 1422,  864,  864,  864, 4192,
+     4192, 4192,  864, 1432, 1432, 1432, 1432, 4192, 4192, 1432,
+     1432,  873,  873,  873, 4192, 4192, 4192,  873, 1438, 1438,
+     1438, 1438, 4192, 4192, 1438, 1438,  877,  877,  877, 4192,
+     4192, 4192,  877, 1447, 1447, 1447, 1447, 4192, 4192, 1447,
+
+     1447,  883,  883,  883,  883, 4192,  883, 4192,  883, 1457,
+     1457, 1457, 1457, 4192, 4192, 1457, 1457,  889,  889,  889,
+      889, 4192,  889, 4192,  889, 1465, 1465, 1465, 1465, 4192,
+     4192, 1465, 1465,  894,  894,  894,  894, 4192,  894, 4192,
+      894, 1475, 1475, 1475, 1475, 4192, 4192, 1475, 1475,  900,
+      900,  900,  900, 4192,  900, 4192,  900, 1491, 1491, 1491,
+     1491, 4192, 4192, 1491, 1491,  910,  910,  910, 4192, 4192,
+     4192,  910, 1516, 1516, 1516, 1516, 4192, 4192, 1516, 1516,
+     1523, 1523, 1523, 1523, 4192, 4192, 1523, 1523,  931,  931,
+      931, 4192, 4192, 4192,  931, 1532, 1532, 1532, 1532, 4192,
+
+     4192, 1532, 1532,  937,  937,  937, 4192, 4192, 4192,  937,
+     1545, 1545, 1545, 1545, 4192, 4192, 1545, 1545,  948,  948,
+      948, 4192, 4192, 4192,  948, 1558, 1558, 1558, 1558, 4192,
+     4192, 1558, 1558,  954,  954,  954, 4192, 4192, 4192,  954,
+     1563, 1563, 1563, 1563, 4192, 4192, 1563, 1563,  958,  958,
+      958, 4192, 4192, 4192,  958, 1574, 1574, 1574, 1574, 4192,
+     4192, 1574, 1574,  966,  966,  966, 4192, 4192, 4192,  966,
+     1582, 1582, 1582, 1582, 4192, 4192, 1582, 1582,  971,  971,
+      971, 4192, 4192, 4192,  971, 1590, 1590, 1590, 1590, 4192,
+     4192, 1590, 1590,  976,  976,  976, 4192, 4192, 4192,  976,
+
+     1596, 1596, 1596, 1596, 4192, 4192, 1596, 1596,  981,  981,
+      981, 4192, 4192, 4192,  981, 1611, 1611, 1611, 1611, 4192,
+     4192, 1611, 1611,  992,  992,  992, 4192, 4192, 4192,  992,
+     1617, 1617, 1617, 1617, 4192, 4192, 1617, 1617, 1002, 1002,
+     1002, 4192, 4192, 4192, 1002, 1630, 1630, 1630, 1630, 4192,
+     4192, 1630, 1630, 1010, 1010, 1010, 4192, 4192, 4192, 1010,
+     1638, 1638, 1638, 1638, 4192, 4192, 1638, 1638, 1015, 1015,
+     1015, 4192, 4192, 4192, 1015, 1654, 1654, 1654, 1654, 4192,
+     4192, 1654, 1654, 1026, 1026, 1026, 1026, 4192, 1026, 4192,
+     1026, 1663, 1663, 1663, 1663, 4192, 4192, 1663, 1663, 1032,
+
+     1032, 1032, 4192, 4192, 4192, 1032, 1671, 1671, 1671, 1671,
+     4192, 4192, 1671, 1671, 1037, 1037, 1037, 4192, 4192, 4192,
+     1037, 1681, 1681, 1681, 1681, 4192, 4192, 1681, 1681, 1044,
+     1044, 1044, 4192, 4192, 4192, 1044, 1691, 1691, 1691, 1691,
+     4192, 4192, 1691, 1691, 1052, 1052, 1052, 4192, 4192, 4192,
+     1052, 1702, 1702, 1702, 1702, 4192, 4192, 1702, 1702, 1060,
+     1060, 1060, 4192, 4192, 4192, 1060, 1709, 1709, 1709, 1709,
+     4192, 4192, 1709, 1709, 1066, 1066, 1066, 4192, 4192, 4192,
+     1066, 1717, 1717, 1717, 1717, 4192, 4192, 1717, 1717, 1072,
+     1072, 1072, 1072, 4192, 1072, 4192, 1072, 1728, 1728, 1728,
+
+     1728, 4192, 4192, 1728, 1728, 1350, 1350, 1350, 1350, 1350,
+     1350, 1350, 1350, 1350, 1356, 4192, 1356, 4192, 4192, 1356,
+      812,  812,  812, 4192, 4192, 4192,  812, 1367, 1367, 1367,
+     1367, 4192, 4192, 1367, 1367,  856,  856,  856, 4192, 4192,
+     4192,  856, 1422, 1422, 1422, 1422, 4192, 4192, 1422, 1422,
+      864,  864,  864, 4192, 4192, 4192,  864, 1432, 1432, 1432,
+     1432, 4192, 4192, 1432, 1432,  873,  873,  873, 4192, 4192,
+     4192,  873, 1438, 1438, 1438, 1438, 4192, 4192, 1438, 1438,
+      877,  877,  877, 4192, 4192, 4192,  877, 1447, 1447, 1447,
+     1447, 4192, 4192, 1447, 1447,  883,  883,  883, 4192, 4192,
+
+     4192,  883, 1457, 1457, 1457, 1457, 4192, 4192, 1457, 1457,
+     1465, 1465, 1465, 1465, 4192, 4192, 1465, 1465,  894,  894,
+      894, 4192, 4192, 4192,  894, 1475, 1475, 1475, 1475, 4192,
+     4192, 1475, 1475,  900,  900,  900, 4192, 4192, 4192,  900,
+     1491, 1491, 1491, 1491, 4192, 4192, 1491, 1491,  910,  910,
+      910, 4192, 4192, 4192,  910, 1516, 1516, 1516, 1516, 4192,
+     4192, 1516, 1516, 1523, 1523, 1523, 1523, 4192, 4192, 1523,
+     1523,  931,  931,  931, 4192, 4192, 4192,  931, 1532, 1532,
+     1532, 1532, 4192, 4192, 1532, 1532,  937,  937,  937, 4192,
+     4192, 4192,  937, 1545, 1545, 1545, 1545, 4192, 4192, 1545,
+
+     1545,  948,  948,  948,  948, 4192,  948, 4192,  948, 1558,
+     1558, 1558, 1558, 4192, 4192, 1558, 1558,  954,  954,  954,
+      954, 4192,  954, 4192,  954, 1563, 1563, 1563, 1563, 4192,
+     4192, 1563, 1563,  958,  958,  958, 4192, 4192, 4192,  958,
+     1574, 1574, 1574, 1574, 4192, 4192, 1574, 1574,  966,  966,
+      966, 4192, 4192, 4192,  966, 1582, 1582, 1582, 1582, 4192,
+     4192, 1582, 1582,  971,  971,  971, 4192, 4192, 4192,  971,
+     1590, 1590, 1590, 1590, 4192, 4192, 1590, 1590,  976,  976,
+      976,  976, 4192,  976, 4192,  976, 1596, 1596, 1596, 1596,
+     4192, 4192, 1596, 1596,  981,  981,  981, 4192, 4192, 4192,
+
+      981, 1611, 1611, 1611, 1611, 4192, 4192, 1611, 1611,  992,
+      992,  992, 4192, 4192, 4192,  992, 1617, 1617, 1617, 1617,
+     4192, 4192, 1617, 1617, 1002, 1002, 1002, 4192, 4192, 4192,
+     1002, 1630, 1630, 1630, 1630, 4192, 4192, 1630, 1630, 1010,
+     1010, 1010, 4192, 4192, 4192, 1010, 1638, 1638, 1638, 1638,
+     4192, 4192, 1638, 1638, 1015, 1015, 1015, 4192, 4192, 4192,
+     1015, 1654, 1654, 1654, 1654, 4192, 4192, 1654, 1654, 1026,
+     1026, 1026, 4192, 4192, 4192, 1026, 1663, 1663, 1663, 1663,
+     4192, 4192, 1663, 1663, 1032, 1032, 1032, 4192, 4192, 4192,
+     1032, 1671, 1671, 1671, 1671, 4192, 4192, 1671, 1671, 1037,
+
+     1037, 1037, 4192, 4192, 4192, 1037, 1681, 1681, 1681, 1681,
+     4192, 4192, 1681, 1681, 1044, 1044, 1044, 4192, 4192, 4192,
+     1044, 1691, 1691, 1691, 1691, 4192, 4192, 1691, 1691, 1052,
+     1052, 1052, 1052, 4192, 1052, 4192, 1052, 1702, 1702, 1702,
+     1702, 4192, 4192, 1702, 1702, 1060, 1060, 1060, 4192, 4192,
+     4192, 1060, 1709, 1709, 1709, 1709, 4192, 4192, 1709, 1709,
+     1066, 1066, 1066, 4192, 4192, 4192, 1066, 1717, 1717, 1717,
+     1717, 4192, 4192, 1717, 1717, 1072, 1072, 1072, 4192, 4192,
+     4192, 1072, 1728, 1728, 1728, 1728, 4192, 4192, 1728, 1728,
+     1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1975,
+
+     1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975,  812,  812,
+      812, 4192, 4192, 4192,  812,  856,  856,  856, 4192, 4192,
+     4192,  856, 1422, 1422, 1422, 1422, 4192, 4192, 1422, 1422,
+      864,  864,  864, 4192, 4192, 4192,  864, 1432, 1432, 1432,
+     1432, 4192, 4192, 1432, 1432,  873,  873,  873,  873, 4192,
+      873, 4192,  873, 1438, 1438, 1438, 1438, 4192, 4192, 1438,
+     1438,  877,  877,  877, 4192, 4192, 4192,  877, 1447, 1447,
+     1447, 1447, 4192, 4192, 1447, 1447,  883,  883,  883, 4192,
+     4192, 4192,  883, 1457, 1457, 1457, 1457, 4192, 4192, 1457,
+     1457, 1465, 1465, 1465, 1465, 4192, 4192, 1465, 1465,  894,
+
+      894,  894, 4192, 4192, 4192,  894, 1475, 1475, 1475, 1475,
+     4192, 4192, 1475, 1475,  900,  900,  900, 4192, 4192, 4192,
+      900, 1491, 1491, 1491, 1491, 4192, 4192, 1491, 1491,  910,
+      910,  910,  910, 4192,  910, 4192,  910, 1516, 1516, 1516,
+     1516, 4192, 4192, 1516, 1516, 1523, 1523, 1523, 1523, 4192,
+     4192, 1523, 1523,  931,  931,  931, 4192, 4192, 4192,  931,
+     1532, 1532, 1532, 1532, 4192, 4192, 1532, 1532,  937,  937,
+      937, 4192, 4192, 4192,  937, 1545, 1545, 1545, 1545, 4192,
+     4192, 1545, 1545, 1558, 1558, 1558, 1558, 4192, 4192, 1558,
+     1558, 1563, 1563, 1563, 1563, 4192, 4192, 1563, 1563,  958,
+
+      958,  958, 4192, 4192, 4192,  958, 1574, 1574, 1574, 1574,
+     4192, 4192, 1574, 1574,  966,  966,  966, 4192, 4192, 4192,
+      966, 1582, 1582, 1582, 1582, 4192, 4192, 1582, 1582,  971,
+      971,  971,  971, 4192,  971, 4192,  971, 1590, 1590, 1590,
+     1590, 4192, 4192, 1590, 1590,  976,  976,  976, 4192, 4192,
+     4192,  976, 1596, 1596, 1596, 1596, 4192, 4192, 1596, 1596,
+      981,  981,  981, 4192, 4192, 4192,  981, 1611, 1611, 1611,
+     1611, 4192, 4192, 1611, 1611,  992,  992,  992, 4192, 4192,
+     4192,  992, 1617, 1617, 1617, 1617, 4192, 4192, 1617, 1617,
+     1002, 1002, 1002, 4192, 4192, 4192, 1002, 1630, 1630, 1630,
+
+     1630, 4192, 4192, 1630, 1630, 1010, 1010, 1010, 1010, 4192,
+     1010, 4192, 1010, 1638, 1638, 1638, 1638, 4192, 4192, 1638,
+     1638, 1015, 1015, 1015, 4192, 4192, 4192, 1015, 1654, 1654,
+     1654, 1654, 4192, 4192, 1654, 1654, 1026, 1026, 1026, 4192,
+     4192, 4192, 1026, 1663, 1663, 1663, 1663, 4192, 4192, 1663,
+     1663, 1032, 1032, 1032, 4192, 4192, 4192, 1032, 1671, 1671,
+     1671, 1671, 4192, 4192, 1671, 1671, 1037, 1037, 1037, 4192,
+     4192, 4192, 1037, 1681, 1681, 1681, 1681, 4192, 4192, 1681,
+     1681, 1044, 1044, 1044, 4192, 4192, 4192, 1044, 1691, 1691,
+     1691, 1691, 4192, 4192, 1691, 1691, 1052, 1052, 1052, 4192,
+
+     4192, 4192, 1052, 1702, 1702, 1702, 1702, 4192, 4192, 1702,
+     1702, 1060, 1060, 1060, 4192, 4192, 4192, 1060, 1709, 1709,
+     1709, 1709, 4192, 4192, 1709, 1709, 1066, 1066, 1066, 4192,
+     4192, 4192, 1066, 1717, 1717, 1717, 1717, 4192, 4192, 1717,
+     1717, 1072, 1072, 1072, 4192, 4192, 4192, 1072, 1728, 1728,
+     1728, 1728, 4192, 4192, 1728, 1728, 1350, 1350, 1350, 1350,
+     1350, 1350, 1350, 1350, 1350, 1975, 1975, 1975, 1975, 1975,
+     1975, 1975, 1975, 1975,  812,  812,  812, 4192, 4192, 4192,
+      812,  856,  856,  856,  856, 4192,  856, 4192,  856, 1422,
+     1422, 1422, 1422, 4192, 4192, 1422, 1422,  864,  864,  864,
+
+     4192, 4192, 4192,  864, 1432, 1432, 1432, 1432, 4192, 4192,
+     1432, 1432, 1438, 1438, 1438, 1438, 4192, 4192, 1438, 1438,
+      877,  877,  877, 4192, 4192, 4192,  877, 1447, 1447, 1447,
+     1447, 4192, 4192, 1447, 1447,  883,  883,  883,  883, 4192,
+      883, 4192,  883, 1457, 1457, 1457, 1457, 4192, 4192, 1457,
+     1457, 1465, 1465, 1465, 1465, 4192, 4192, 1465, 1465,  894,
+      894,  894,  894, 4192,  894, 4192,  894, 1475, 1475, 1475,
+     1475, 4192, 4192, 1475, 1475,  900,  900,  900,  900, 4192,
+      900, 4192,  900, 1491, 1491, 1491, 1491, 4192, 4192, 1491,
+     1491,  910,  910,  910,  910, 4192,  910, 4192,  910, 1516,
+
+     1516, 1516, 1516, 4192, 4192, 1516, 1516, 1523, 1523, 1523,
+     1523, 4192, 4192, 1523, 1523,  931,  931,  931, 4192, 4192,
+     4192,  931, 1532, 1532, 1532, 1532, 4192, 4192, 1532, 1532,
+      937,  937,  937, 4192, 4192, 4192,  937, 1545, 1545, 1545,
+     1545, 4192, 4192, 1545, 1545, 1558, 1558, 1558, 1558, 4192,
+     4192, 1558, 1558, 1563, 1563, 1563, 1563, 4192, 4192, 1563,
+     1563,  958,  958,  958, 4192, 4192, 4192,  958, 1574, 1574,
+     1574, 1574, 4192, 4192, 1574, 1574,  966,  966,  966, 4192,
+     4192, 4192,  966, 1582, 1582, 1582, 1582, 4192, 4192, 1582,
+     1582, 1590, 1590, 1590, 1590, 4192, 4192, 1590, 1590,  976,
+
+      976,  976, 4192, 4192, 4192,  976, 1596, 1596, 1596, 1596,
+     4192, 4192, 1596, 1596,  981,  981,  981, 4192, 4192, 4192,
+      981, 1611, 1611, 1611, 1611, 4192, 4192, 1611, 1611,  992,
+      992,  992, 4192, 4192, 4192,  992, 1617, 1617, 1617, 1617,
+     4192, 4192, 1617, 1617, 1002, 1002, 1002, 4192, 4192, 4192,
+     1002, 1630, 1630, 1630, 1630, 4192, 4192, 1630, 1630, 1638,
+     1638, 1638, 1638, 4192, 4192, 1638, 1638, 1015, 1015, 1015,
+     4192, 4192, 4192, 1015, 1654, 1654, 1654, 1654, 4192, 4192,
+     1654, 1654, 1026, 1026, 1026, 4192, 4192, 4192, 1026, 1663,
+     1663, 1663, 1663, 4192, 4192, 1663, 1663, 1032, 1032, 1032,
+
+     4192, 4192, 4192, 1032, 1671, 1671, 1671, 1671, 4192, 4192,
+     1671, 1671, 1037, 1037, 1037, 1037, 4192, 1037, 4192, 1037,
+     1681, 1681, 1681, 1681, 4192, 4192, 1681, 1681, 1044, 1044,
+     1044, 4192, 4192, 4192, 1044, 1691, 1691, 1691, 1691, 4192,
+     4192, 1691, 1691, 1052, 1052, 1052, 4192, 4192, 4192, 1052,
+     1702, 1702, 1702, 1702, 4192, 4192, 1702, 1702, 1060, 1060,
+     1060, 4192, 4192, 4192, 1060, 1709, 1709, 1709, 1709, 4192,
+     4192, 1709, 1709, 1066, 1066, 1066, 4192, 4192, 4192, 1066,
+     1717, 1717, 1717, 1717, 4192, 4192, 1717, 1717, 1072, 1072,
+     1072, 1072, 4192, 1072, 4192, 1072, 1728, 1728, 1728, 1728,
+
+     4192, 4192, 1728, 1728, 1350, 1350, 1350, 1350, 1350, 1350,
+     1350, 1350, 1350, 1975, 1975, 1975, 1975, 1975, 1975, 1975,
+     1975, 1975,  812,  812,  812,  812, 4192,  812, 4192,  812,
+      856,  856,  856, 4192, 4192, 4192,  856, 1422, 1422, 1422,
+     1422, 4192, 4192, 1422, 1422,  864,  864,  864, 4192, 4192,
+     4192,  864, 1432, 1432, 1432, 1432, 4192, 4192, 1432, 1432,
+     1438, 1438, 1438, 1438, 4192, 4192, 1438, 1438,  877,  877,
+      877, 4192, 4192, 4192,  877, 1447, 1447, 1447, 1447, 4192,
+     4192, 1447, 1447, 1457, 1457, 1457, 1457, 4192, 4192, 1457,
+     1457, 1465, 1465, 1465, 1465, 4192, 4192, 1465, 1465, 1475,
+
+     1475, 1475, 1475, 4192, 4192, 1475, 1475,  900,  900,  900,
+      900, 4192,  900, 4192,  900, 1491, 1491, 1491, 1491, 4192,
+     4192, 1491, 1491,  910,  910,  910, 4192, 4192, 4192,  910,
+     1516, 1516, 1516, 1516, 4192, 4192, 1516, 1516, 1523, 1523,
+     1523, 1523, 4192, 4192, 1523, 1523,  931,  931,  931,  931,
+     4192,  931, 4192,  931,  937,  937,  937, 4192, 4192, 4192,
+      937, 1558, 1558, 1558, 1558, 4192, 4192, 1558, 1558, 1563,
+     1563, 1563, 1563, 4192, 4192, 1563, 1563,  958,  958,  958,
+     4192, 4192, 4192,  958,  966,  966,  966, 4192, 4192, 4192,
+      966, 1582, 1582, 1582, 1582, 4192, 4192, 1582, 1582, 1590,
+
+     1590, 1590, 1590, 4192, 4192, 1590, 1590,  976,  976,  976,
+     4192, 4192, 4192,  976, 1596, 1596, 1596, 1596, 4192, 4192,
+     1596, 1596,  981,  981,  981, 4192, 4192, 4192,  981,  992,
+      992,  992,  992, 4192,  992, 4192,  992, 1617, 1617, 1617,
+     1617, 4192, 4192, 1617, 1617, 1002, 1002, 1002, 4192, 4192,
+     4192, 1002, 1630, 1630, 1630, 1630, 4192, 4192, 1630, 1630,
+     1015, 1015, 1015, 4192, 4192, 4192, 1015, 1654, 1654, 1654,
+     1654, 4192, 4192, 1654, 1654, 1026, 1026, 1026, 4192, 4192,
+     4192, 1026, 1663, 1663, 1663, 1663, 4192, 4192, 1663, 1663,
+     1032, 1032, 1032, 4192, 4192, 4192, 1032, 1671, 1671, 1671,
+
+     1671, 4192, 4192, 1671, 1671, 1037, 1037, 1037, 1037, 4192,
+     1037, 4192, 1037, 1681, 1681, 1681, 1681, 4192, 4192, 1681,
+     1681, 1044, 1044, 1044, 1044, 4192, 1044, 4192, 1044, 1691,
+     1691, 1691, 1691, 4192, 4192, 1691, 1691, 1052, 1052, 1052,
+     4192, 4192, 4192, 1052, 1702, 1702, 1702, 1702, 4192, 4192,
+     1702, 1702, 1060, 1060, 1060, 1060, 4192, 1060, 4192, 1060,
+     1709, 1709, 1709, 1709, 4192, 4192, 1709, 1709, 1066, 1066,
+     1066, 1066, 4192, 1066, 4192, 1066, 1072, 1072, 1072, 4192,
+     4192, 4192, 1072, 1728, 1728, 1728, 1728, 4192, 4192, 1728,
+     1728, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350,
+
+     1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975,  856,
+      856,  856, 4192, 4192, 4192,  856, 1422, 1422, 1422, 1422,
+     4192, 4192, 1422, 1422,  864,  864,  864,  864, 4192,  864,
+     4192,  864, 1438, 1438, 1438, 1438, 4192, 4192, 1438, 1438,
+      877,  877,  877, 4192, 4192, 4192,  877, 1447, 1447, 1447,
+     1447, 4192, 4192, 1447, 1447, 1457, 1457, 1457, 1457, 4192,
+     4192, 1457, 1457, 1465, 1465, 1465, 1465, 4192, 4192, 1465,
+     1465, 1475, 1475, 1475, 1475, 4192, 4192, 1475, 1475, 1491,
+     1491, 1491, 1491, 4192, 4192, 1491, 1491,  910,  910,  910,
+     4192, 4192, 4192,  910, 1516, 1516, 1516, 1516, 4192, 4192,
+
+     1516, 1516, 1523, 1523, 1523, 1523, 4192, 4192, 1523, 1523,
+      931,  931,  931,  931, 4192,  931, 4192,  931,  937,  937,
+      937, 4192, 4192, 4192,  937, 1558, 1558, 1558, 1558, 4192,
+     4192, 1558, 1558, 1563, 1563, 1563, 1563, 4192, 4192, 1563,
+     1563,  958,  958,  958, 4192, 4192, 4192,  958,  966,  966,
+      966, 4192, 4192, 4192,  966, 1582, 1582, 1582, 1582, 4192,
+     4192, 1582, 1582, 1590, 1590, 1590, 1590, 4192, 4192, 1590,
+     1590,  976,  976,  976, 4192, 4192, 4192,  976,  981,  981,
+      981, 4192, 4192, 4192,  981, 1617, 1617, 1617, 1617, 4192,
+     4192, 1617, 1617, 1002, 1002, 1002, 1002, 4192, 1002, 4192,
+
+     1002, 1630, 1630, 1630, 1630, 4192, 4192, 1630, 1630, 1015,
+     1015, 1015, 4192, 4192, 4192, 1015, 1654, 1654, 1654, 1654,
+     4192, 4192, 1654, 1654, 1026, 1026, 1026, 4192, 4192, 4192,
+     1026, 1032, 1032, 1032, 4192, 4192, 4192, 1032, 1671, 1671,
+     1671, 1671, 4192, 4192, 1671, 1671, 1681, 1681, 1681, 1681,
+     4192, 4192, 1681, 1681, 1691, 1691, 1691, 1691, 4192, 4192,
+     1691, 1691, 1052, 1052, 1052, 4192, 4192, 4192, 1052, 1709,
+     1709, 1709, 1709, 4192, 4192, 1709, 1709, 1072, 1072, 1072,
+     4192, 4192, 4192, 1072, 1728, 1728, 1728, 1728, 4192, 4192,
+     1728, 1728, 1350, 1350, 1350, 1350, 1350, 1350, 1350, 1350,
+
+     1350, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975, 1975,
+      856,  856,  856, 4192, 4192, 4192,  856, 1422, 1422, 1422,
+     1422, 4192, 4192, 1422, 1422,  864,  864,  864,  864, 4192,
+      864, 4192,  864, 1438, 1438, 1438, 1438, 4192, 4192, 1438,
+     1438,  877,  877,  877,  877, 4192,  877, 4192,  877, 1447,
+     1447, 1447, 1447, 4192, 4192, 1447, 1447, 1457, 1457, 1457,
+     1457, 4192, 4192, 1457, 1457, 1465, 1465, 1465, 1465, 4192,
+     4192, 1465, 1465, 1475, 1475, 1475, 1475, 4192, 4192, 1475,
+     1475, 1491, 1491, 1491, 1491, 4192, 4192, 1491, 1491,  910,
+      910,  910, 4192, 4192, 4192,  910, 1516, 1516, 1516, 1516,
+
+     4192, 4192, 1516, 1516,  937,  937,  937, 4192, 4192, 4192,
+      937, 1558, 1558, 1558, 1558, 4192, 4192, 1558, 1558, 1563,
+     1563, 1563, 1563, 4192, 4192, 1563, 1563,  958,  958,  958,
+      958, 4192,  958, 4192,  958,  966,  966,  966,  966, 4192,
+      966, 4192,  966, 1582, 1582, 1582, 1582, 4192, 4192, 1582,
+     1582, 1590, 1590, 1590, 1590, 4192, 4192, 1590, 1590,  976,
+      976,  976,  976, 4192,  976, 4192,  976,  981,  981,  981,
+     4192, 4192, 4192,  981, 1617, 1617, 1617, 1617, 4192, 4192,
+     1617, 1617, 1002, 1002, 1002, 1002, 4192, 1002, 4192, 1002,
+     1630, 1630, 1630, 1630, 4192, 4192, 1630, 1630, 1015, 1015,
+
+     1015, 1015, 4192, 1015, 4192, 1015, 1026, 1026, 1026, 4192,
+     4192, 4192, 1026, 1032, 1032, 1032, 4192, 4192, 4192, 1032,
+     1681, 1681, 1681, 1681, 4192, 4192, 1681, 1681, 1691, 1691,
+     1691, 1691, 4192, 4192, 1691, 1691, 1052, 1052, 1052, 4192,
+     4192, 4192, 1052, 1709, 1709, 1709, 1709, 4192, 4192, 1709,
+     1709, 1072, 1072, 1072, 4192, 4192, 4192, 1072, 1728, 1728,
+     1728, 1728, 4192, 4192, 1728, 1728, 1350, 1350, 1350, 1350,
+     1350, 1350, 1350, 1350, 1350, 1975, 1975, 1975, 1975, 1975,
+     1975, 1975, 1975, 1975,  856,  856,  856, 4192, 4192, 4192,
+      856,  864,  864,  864,  864, 4192,  864, 4192,  864, 1438,
+
+     1438, 1438, 1438, 4192, 4192, 1438, 1438, 1447, 1447, 1447,
+     1447, 4192, 4192, 1447, 1447, 1457, 1457, 1457, 1457, 4192,
+     4192, 1457, 1457, 1465, 1465, 1465, 1465, 4192, 4192, 1465,
+     1465, 1475, 1475, 1475, 1475, 4192, 4192, 1475, 1475,  910,
+      910,  910, 4192, 4192, 4192,  910,  937,  937,  937, 4192,
+     4192, 4192,  937, 1558, 1558, 1558, 1558, 4192, 4192, 1558,
+     1558,  958,  958,  958, 4192, 4192, 4192,  958, 1582, 1582,
+     1582, 1582, 4192, 4192, 1582, 1582, 1590, 1590, 1590, 1590,
+     4192, 4192, 1590, 1590,  981,  981,  981, 4192, 4192, 4192,
+      981, 1617, 1617, 1617, 1617, 4192, 4192, 1617, 1617, 1002,
+
+     1002, 1002, 1002, 4192, 1002, 4192, 1002, 1015, 1015, 1015,
+     4192, 4192, 4192, 1015, 1026, 1026, 1026, 4192, 4192, 4192,
+     1026, 1032, 1032, 1032, 4192, 4192, 4192, 1032, 3509, 3509,
+     3509, 3509, 3509, 3509, 3509, 3509, 3509, 3510, 3510, 3510,
+     3510, 3510, 3510, 3510, 3510, 3510, 3601, 3601, 3601, 3601,
+     3601, 3601, 3601, 3601, 3601, 3604, 3604, 3604, 3604, 3604,
+     3604, 3604, 3604, 3604, 3679, 3679, 3679, 3679, 3679, 3679,
+     3679, 3679, 3679, 3681, 3681, 3681, 3681, 3681, 3681, 3681,
+     3681, 3681,  333, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192
     } ;
 
-static const flex_int16_t yy_chk[14182] =
+static const flex_int16_t yy_chk[14559] =
     {   0,
         0,    3,    3,    3,    4,    4,    4,    5,    5,    5,
         6,    6,    6,    7,    7,    7,   11,    3,    9,   12,
-        4,   10, 1025,    5,    0,    9,    6,  401,   10,    7,
-        8,    8,    8,  328,   11,   13,   13,   12,   14,   14,
-       13,   13,  373,   14,   14,  329,    8,   17,   17,  328,
-       13,   15,   15,   14,   15,  332,   15,   16,   16, 1025,
-       16,  329,   16,   18,   18,  401,   15,   21,   21,   21,
-     1551,  332,   16,   22,   22,   22,  557,   23,   23,   23,
-       24,   24,   24,   21,   25,   25,   25,  366,  557,   22,
-      368,  354,   17,   23,  368,  373,   24,  326,  326,  326,
-
-       25,  327,  327,  327,  331,  331,  331,  354,   18,   19,
+        4,   10, 1056,    5,    0,    9,    6,  411,   10,    7,
+        8,    8,    8,  338,   11,   13,   13,   12,   14,   14,
+       13,   13,  383,   14,   14,  339,    8,   17,   17,  338,
+       13,   15,   15,   14,   15,  342,   15,   16,   16, 1056,
+       16,  339,   16,   18,   18,  411,   15,   21,   21,   21,
+     1529,  342,   16,   22,   22,   22,  580,   23,   23,   23,
+       24,   24,   24,   21,   25,   25,   25,  376,  580,   22,
+      378,  364,   17,   23,  378,  383,   24,  336,  336,  336,
+
+       25,  337,  337,  337,  341,  341,  341,  364,   18,   19,
        19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
-       19,   19,   19,   19, 1552,   19,   19,   19,   19,   19,
-       26,   26,   26,   27,   27,   27,   28,   28,   28,  490,
-      366,   29,   29,   29,  366,  475,   26,  382,  378,   27,
-      475, 1558,   28,  490,  382,   19,   19,   29,   30,   30,
-       30,  351,  351,  351,  378,  385,   19,  359,  359,  359,
-      375,  375,  375, 1559,   30,   19,   20,   20,   20,   20,
+       19,   19,   19,   19, 1530,   19,   19,   19,   19,   19,
+       26,   26,   26,   27,   27,   27,   28,   28,   28,  500,
+      376,   29,   29,   29,  376,  485,   26,  392,  388,   27,
+      485, 1535,   28,  500,  392,   19,   19,   29,   30,   30,
+       30,  361,  361,  361,  388,  395,   19,  369,  369,  369,
+      385,  385,  385, 1536,   30,   19,   20,   20,   20,   20,
        20,   20,   20,   20,   20,   20,   20,   20,   20,   20,
-       20,  485,   20,   20,   20,   20,   20,   31,   31,   31,
-
-       32,   32,   32,   33,   33,   33,  267,  267,   34,   34,
-       34,  267,  485,   31,  385,  387,   32,  621,  385,   33,
-     1564,  267,   20,   20,   34,   35,   35,   35,   36,   36,
-       36, 1565,  621,   20,   37,   37,   37,   38,   38,   38,
-      783,   35,   20,  783,   36,   39,   39,   39,  386, 1570,
-       37,  267,  386,   38,   40,   40,   40,   41,   41,   41,
-     1571,   39,   42,   42,   42,   43,   43,   43,  387,  546,
-       40, 1573,  392,   41,   44,   44,   44,  909,   42,  546,
-      909,   43,   45,   45,   45,   46,   46,   46,  392,  365,
-       44,   47,   47,   47,   48,   48,   48, 1574,   45,  365,
-
-      369,   46,   49,   49,   49, 1576,  521,   47,  639,  408,
-       48,   50,   50,   50,   51,   51,   51, 1076,   49,   52,
-       52,   52,   53,   53,   53,  408, 1577,   50,  365,  369,
-       51,   54,   54,   54, 1076,   52,  403, 1188,   53,   55,
-       55,   55,   56,   56,   56,  369,  639,   54,  384,  384,
-      384,  715,  365,  369, 1188,   55,  521, 1578,   56,   57,
+       20,  495,   20,   20,   20,   20,   20,   31,   31,   31,
+
+       32,   32,   32,   33,   33,   33,  277,  277,   34,   34,
+       34,  277,  495,   31,  395,  397,   32,  644,  395,   33,
+     1541,  277,   20,   20,   34,   35,   35,   35,   36,   36,
+       36,  545,  644,   20,   37,   37,   37,   38,   38,   38,
+      545,   35,   20, 1108,   36,   39,   39,   39,  396, 1542,
+       37,  277,  396,   38,   40,   40,   40,   41,   41,   41,
+     1108,   39,   42,   42,   42,   43,   43,   43,  397,  569,
+       40, 1543,  402,   41,   44,   44,   44,  806,   42,  569,
+      806,   43,   45,   45,   45,   46,   46,   46,  402,  375,
+       44,   47,   47,   47,   48,   48,   48, 1548,   45,  375,
+
+      379,   46,   49,   49,   49, 1549,  738,   47,  662,  418,
+       48,   50,   50,   50,   51,   51,   51, 1227,   49,   52,
+       52,   52,   53,   53,   53,  418, 1566,   50,  375,  379,
+       51,   54,   54,   54, 1227,   52,  413,  826,   53,   55,
+       55,   55,   56,   56,   56,  379,  662,   54,  394,  394,
+      394,  826,  375,  379,  939,   55,  738,  939,   56,   57,
        57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
-       57,   57,   57,   57,  418,   57,   57,   57,   57,   57,
-       59,   59,   59,   60,   60,   60,   61,   61,   61,  403,
-      418,   62,   62,   62,  518, 1286,   59,  413,  518,   60,
+       57,   57,   57,   57,  428,   57,   57,   57,   57,   57,
+       59,   59,   59,   60,   60,   60,   61,   61,   61,  413,
+      428,   62,   62,   62,  541, 1325,   59,  423,  541,   60,
 
-     1586,  715,   61,  371,  413,   57,   57,   62,   63,   63,
-       63,   57, 1286,  413,   57,  389,  389,  389,  400,  400,
-      400,  405,  405,  405,   63, 1591,   57,   58,   58,   58,
+     1570,  818,   61,  381,  423,   57,   57,   62,   63,   63,
+       63,   57, 1325,  423,   57,  399,  399,  399,  410,  410,
+      410,  415,  415,  415,   63,  818,   57,   58,   58,   58,
        58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
-       58,   58,  371,   58,   58,   58,   58,   58,   64,   64,
-       64,   65,   65,   65,   66,   66,   66,  796,  371,   69,
-       69,   69,  606, 1600,   64,  425,  606,   65,  796,  795,
-       66,  796,  425,   58,   58,   69,   70,   70,   70,   58,
-      438,  425,   58,  412,  412,  412,  415,  415,  415,  424,
-      424,  424,   70,  795,   58,   67,   67,   67,   67,   67,
+       58,   58,  381,   58,   58,   58,   58,   58,   64,   64,
+       64,   65,   65,   65,   66,   66,   66,  819,  381,   69,
+       69,   69,  629, 1571,   64,  435,  629,   65,  819,  832,
+       66,  819,  435,   58,   58,   69,   70,   70,   70,   58,
+      448,  435,   58,  422,  422,  422,  425,  425,  425,  434,
+      434,  434,   70,  832,   58,   67,   67,   67,   67,   67,
 
        67,   67,   67,   67,   67,   67,   67,   67,   67,   67,
-      430,   67,   67,   67,   67,   67,   71,   71,   71,   72,
-       72,   72,   73,   73,   73,  450,  430,   74,   74,   74,
-     1222,  443,   71,  438,  455,   72, 1222,  468,   73, 1602,
-      463,   67,   67,   74,   75,   75,   75,  443, 1347,   67,
-      455,   67,  437,  468,   67,  427,  427,  427,   67, 1611,
-       75, 1347,   67,   68,   68,   68,   68,   68,   68,   68,
-       68,   68,   68,   68,   68,   68,   68,   68,  450,   68,
+      440,   67,   67,   67,   67,   67,   71,   71,   71,   72,
+       72,   72,   73,   73,   73,  460,  440,   74,   74,   74,
+     1261,  453,   71,  448,  465,   72, 1261,  478,   73, 1572,
+      473,   67,   67,   74,   75,   75,   75,  453, 1387,   67,
+      465,   67,  447,  478,   67,  437,  437,  437,   67, 1577,
+       75, 1387,   67,   68,   68,   68,   68,   68,   68,   68,
+       68,   68,   68,   68,   68,   68,   68,   68,  460,   68,
        68,   68,   68,   68,   76,   76,   76,   79,   79,   79,
-       80,   80,   80,  463,  488,   83,   83,   83, 1616,  483,
+       80,   80,   80,  473,  498,   83,   83,   83, 1588,  493,
 
-       76,  437,  488,   79,  802,  437,   80,  814,  488,   68,
-       68,   83,   84,   84,   84,  483, 1353,   68,  802,   68,
-      449,  814,   68,  436,  436,  436,   68,  545,   84, 1353,
+       76,  447,  498,   79, 1599,  447,   80,  833,  498,   68,
+       68,   83,   84,   84,   84,  493, 1393,   68,  833,   68,
+      459,  833,   68,  446,  446,  446,   68,  568,   84, 1393,
        68,   77,   77,   77,   77,   77,   77,   77,   77,   77,
-       77,   77,   77,   77,   77,   77,  624,   77,   77,   77,
+       77,   77,   77,   77,   77,   77,  647,   77,   77,   77,
        77,   77,   87,   87,   87,   88,   88,   88,   89,   89,
-       89,  624,  491,   90,   90,   90,  545, 1624,   87,  449,
-      491,   88, 1625,  449,   89,  491,  545,   77,   77,   90,
-       91,   91,   91,   92,   92,   92,  440,  440,  440,  448,
-      448,  448,  452,  452,  452, 1629,   91, 1634, 1638,   92,
+       89,  647,  501,   90,   90,   90,  568, 1600,   87,  459,
+      501,   88, 1601,  459,   89,  501,  568,   77,   77,   90,
+       91,   91,   91,   92,   92,   92,  450,  450,  450,  458,
+      458,  458,  462,  462,  462, 1602,   91, 1608, 1609,   92,
 
-     1644,   77,   78,   78,   78,   78,   78,   78,   78,   78,
-       78,   78,   78,   78,   78,   78,   78,  501,   78,   78,
+     1614,   77,   78,   78,   78,   78,   78,   78,   78,   78,
+       78,   78,   78,   78,   78,   78,   78,  511,   78,   78,
        78,   78,   78,   93,   93,   93,   94,   94,   94,   97,
-       97,   97,  809,  501,   98,   98,   98,  673, 1650,   93,
-     1655, 1657,   94,  809,  673,   97,  809,  512,   78,   78,
-       98,   99,   99,   99,  100,  100,  100,  461,  461,  461,
-      465,  465,  465,  512,  768,  462, 1665,   99,  342, 1672,
-      100,  768,   78,   81,   81,   81,   81,   81,   81,   81,
-       81,   81,   81,   81,   81,   81,   81,   81,  528,   81,
+       97,   97,  838,  511,   98,   98,   98,  696, 1615,   93,
+     1620, 1621,   94, 1623,  696,   97,  838,  522,   78,   78,
+       98,   99,   99,   99,  100,  100,  100,  471,  471,  471,
+      475,  475,  475,  522,  791,  472, 1624,   99,  352, 1626,
+      100,  791,   78,   81,   81,   81,   81,   81,   81,   81,
+       81,   81,   81,   81,   81,   81,   81,   81,  535,   81,
        81,   81,   81,   81,  101,  101,  101,  102,  102,  102,
 
-      103,  103,  103, 1673,  528,  104,  104,  104,  808, 1676,
-      101,  342,  496,  102,  462,  540,  103,  342,  462,   81,
-       81,  104,  342,   81,  477,  477,  477,  342, 1685, 1686,
-       81,  540,  808,   81,   82,   82,   82,   82,   82,   82,
-       82,   82,   82,   82,   82,   82,   82,   82,   82,  662,
+      103,  103,  103, 1627,  535,  104,  104,  104,  843, 1628,
+      101,  352,  506,  102,  472,  551,  103,  352,  472,   81,
+       81,  104,  352,   81,  487,  487,  487,  352, 1636,  544,
+       81,  551,  843,   81,   82,   82,   82,   82,   82,   82,
+       82,   82,   82,   82,   82,   82,   82,   82,   82,  685,
        82,   82,   82,   82,   82,  107,  107,  107,  108,  108,
-      108,  109,  109,  109,  662,  496,  110,  110,  110,  478,
-     1687,  107,  507,  523,  108,  774,  478,  109,  547,  827,
-       82,   82,  110,  561,   82,  478,  480,  480,  480, 1690,
-      774,   82, 1691,  827,   82,   85,   85,   85,   85,   85,
+      108,  109,  109,  109,  685,  506,  110,  110,  110,  488,
+      544,  107,  517,  530,  108,  797,  488,  109,  546,  544,
+       82,   82,  110,  570,   82,  488,  490,  490,  490, 1353,
+      797,   82, 1641, 1353,   82,   85,   85,   85,   85,   85,
 
        85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
-      819,   85,   85,   85,   85,   85,  111,  111,  111,  112,
-      112,  112,  113,  113,  113,  507,  523,  114,  114,  114,
-     1692,  547,  111,  535,  819,  112,  561,  823,  113, 1693,
-      535,   85,   85,  114,  117,  117,  117,   85, 1694,  535,
-       85,  494,  494,  494,  498,  498,  498,  505,  505,  505,
-      117,  823,   85,   86,   86,   86,   86,   86,   86,   86,
-       86,   86,   86,   86,   86,   86,   86,   86,  552,   86,
+      847,   85,   85,   85,   85,   85,  111,  111,  111,  112,
+      112,  112,  113,  113,  113,  517,  530,  114,  114,  114,
+     1650,  546,  111,  558,  847,  112,  570,  849,  113, 1652,
+      558,   85,   85,  114,  117,  117,  117,   85, 1661,  558,
+       85,  504,  504,  504,  508,  508,  508,  515,  515,  515,
+      117,  849,   85,   86,   86,   86,   86,   86,   86,   86,
+       86,   86,   86,   86,   86,   86,   86,   86,  563,   86,
        86,   86,   86,   86,  118,  118,  118,  121,  121,  121,
-      122,  122,  122,  828,  552,  123,  123,  123, 1314, 1695,
+      122,  122,  122,  584,  563,  123,  123,  123, 1666, 1674,
 
-      118,  566, 1314,  121,  828,  825,  122,  828,  625,   86,
-       86,  123,  124,  124,  124,   86,  640,  566,   86,  509,
-      509,  509,  520,  520,  520,  525,  525,  525,  124,  825,
+      118,  575, 1675,  121, 1679,  850,  122, 1684,  648,   86,
+       86,  123,  124,  124,  124,   86,  663,  575,   86,  519,
+      519,  519,  528,  528,  528,  532,  532,  532,  124,  850,
        86,   95,   95,   95,   95,   95,   95,   95,   95,   95,
-       95,   95,   95,   95,   95,   95,  577,   95,   95,   95,
+       95,   95,   95,   95,   95,   95,  584,   95,   95,   95,
        95,   95,  125,  125,  125,  126,  126,  126,  127,  127,
-      127,  625,  577,  128,  128,  128, 1696, 1697,  125,  640,
-     1699,  126, 1701,  826,  127, 1702,  677,   95,   95,  128,
-      131,  131,  131,   95,  534,  534,  534,  537,  537,  537,
-      544,  544,  544,  549,  549,  549,  131,  826,   95,   96,
+      127,  648,  683,  128,  128,  128,  683, 1688,  125,  663,
+      683,  126, 1694,  854,  127, 1700,  700,   95,   95,  128,
+      131,  131,  131,   95,  543,  543,  543,  548,  548,  548,
+      557,  557,  557,  560,  560,  560,  131,  854,   95,   96,
 
        96,   96,   96,   96,   96,   96,   96,   96,   96,   96,
-       96,   96,   96,   96,  588,   96,   96,   96,   96,   96,
-      132,  132,  132,  133,  133,  133,  134,  134,  134,  677,
-      588,  135,  135,  135, 1704, 1705,  132, 1707, 1708,  133,
-     1709,  830,  134, 1710,  702,   96,   96,  135,  136,  136,
-      136,   96,  559,  559,  559,  563,  563,  563,  571,  571,
-      571,  574,  574,  574,  136,  830,   96,  105,  105,  105,
+       96,   96,   96,   96,  589,   96,   96,   96,   96,   96,
+      132,  132,  132,  133,  133,  133,  134,  134,  134,  700,
+      589,  135,  135,  135, 1705, 1707,  132, 1715, 1722,  133,
+     1723, 1726,  134, 1735,  725,   96,   96,  135,  136,  136,
+      136,   96,  567,  567,  567,  572,  572,  572,  582,  582,
+      582,  586,  586,  586,  136, 1736,   96,  105,  105,  105,
       105,  105,  105,  105,  105,  105,  105,  105,  105,  105,
-      105,  105,  599,  105,  105,  105,  105,  105,  137,  137,
-      137,  138,  138,  138,  141,  141,  141,  702,  599,  142,
+      105,  105,  600,  105,  105,  105,  105,  105,  137,  137,
+      137,  138,  138,  138,  141,  141,  141,  725,  600,  142,
 
-      142,  142, 1713, 1714,  137,  572,  829,  138, 1715, 1716,
-      141, 1717,  572,  105,  105,  142,  143,  143,  143,  105,
-      829,  572,  105,  582,  582,  582,  585,  585,  585,  593,
-      593,  593,  143, 1719,  105,  106,  106,  106,  106,  106,
+      142,  142, 1737, 1740,  137,  595,  851,  138, 1741, 1742,
+      141, 1743,  595,  105,  105,  142,  143,  143,  143,  105,
+      851,  595,  105,  594,  594,  594,  597,  597,  597,  605,
+      605,  605,  143, 1744,  105,  106,  106,  106,  106,  106,
       106,  106,  106,  106,  106,  106,  106,  106,  106,  106,
-      615,  106,  106,  106,  106,  106,  144,  144,  144,  145,
-      145,  145,  146,  146,  146,  965,  615,  147,  147,  147,
-     1722, 1723,  144,  583,  967,  145,  965, 1724,  146,  965,
-      583,  106,  106,  147,  148,  148,  148,  106,  967,  583,
-      106,  596,  596,  596,  608,  608,  608,  612,  612,  612,
-
-      148, 1726,  106,  115,  115,  115,  115,  115,  115,  115,
-      115,  115,  115,  115,  115,  115,  115,  115,  630,  115,
+      611,  106,  106,  106,  106,  106,  144,  144,  144,  145,
+      145,  145,  146,  146,  146,  852,  611,  147,  147,  147,
+     1745, 1746,  144,  606, 1747,  145,  852, 1750,  146,  852,
+      606,  106,  106,  147,  148,  148,  148,  106,  740,  606,
+      106,  608,  608,  608,  616,  616,  616,  619,  619,  619,
+
+      148, 1752,  106,  115,  115,  115,  115,  115,  115,  115,
+      115,  115,  115,  115,  115,  115,  115,  115,  622,  115,
       115,  115,  115,  115,  151,  151,  151,  152,  152,  152,
-      155,  155,  155,  717,  630,  156,  156,  156,  594,  645,
-      151,  609,  610,  152, 1729,  594,  155, 1730,  609,  115,
-      115,  156,  651,  115,  594,  645,  759,  609,  610,  651,
-      115, 1731,  772,  115,  619,  619,  619,  115,  651,  115,
+      153,  153,  153,  853,  622,  154,  154,  154,  617, 1753,
+      151,  740,  633,  152, 1755,  617,  153,  853,  646,  115,
+      115,  154,  632,  115,  617,  631,  631,  631,  633,  632,
+      115, 1756,  782,  115,  635,  635,  635,  115,  632,  115,
       115,  116,  116,  116,  116,  116,  116,  116,  116,  116,
-      116,  116,  116,  116,  116,  116,  717,  116,  116,  116,
-      116,  116,  157,  157,  157,  158,  158,  158,  159,  159,
+      116,  116,  116,  116,  116,  116,  646,  116,  116,  116,
+      116,  116,  155,  155,  155,  156,  156,  156,  157,  157,
 
-      159, 1735,  610,  160,  160,  160, 1736,  622,  157,  759,
-      656,  158, 1740,  670,  159,  772,  623,  116,  116,  160,
-      622,  116,  622,  627,  627,  627,  656,  756,  116,  670,
-     1743,  116,  638,  638,  638,  116, 1746,  116,  116,  119,
+      157,  646,  633,  158,  158,  158,  638, 1758,  155, 1759,
+      653,  156, 1760,  668,  157,  782,  795,  116,  116,  158,
+      674,  116,  638,  642,  642,  642,  653,  674,  116,  668,
+     1761,  116,  650,  650,  650,  116,  674,  116,  116,  119,
       119,  119,  119,  119,  119,  119,  119,  119,  119,  119,
-      119,  119,  119,  119,  623,  119,  119,  119,  119,  119,
-      161,  161,  161,  162,  162,  162,  165,  165,  165,  623,
-      660,  166,  166,  166,  660, 1681,  161, 1747,  660,  162,
-      756,  665,  165,  794,  756,  119,  119,  166,  665,  119,
-      119,  642,  642,  642,  676, 1681,  119,  665,  794,  119,
+      119,  119,  119,  119,  679,  119,  119,  119,  119,  119,
+      161,  161,  161,  162,  162,  162,  165,  165,  165,  795,
+      679,  166,  166,  166, 1764, 1765,  161,  817,  645,  162,
+      871,  688,  165,  995, 1731,  119,  119,  166,  688,  119,
+      119,  645,  817,  645,  699,  871,  119,  688,  995,  119,
 
-      650,  650,  650,  119, 1748,  119,  119,  119,  120,  120,
+      661,  661,  661,  119, 1731,  119,  119,  119,  120,  120,
       120,  120,  120,  120,  120,  120,  120,  120,  120,  120,
-      120,  120,  120,  682,  120,  120,  120,  120,  120,  167,
-      167,  167,  168,  168,  168,  169,  169,  169,  847,  682,
-      170,  170,  170,  676, 1750,  167, 1753,  676,  168,  964,
-      688,  169, 1754,  847,  120,  120,  170,  688,  120,  120,
-      653,  653,  653, 1759,  964,  120,  688, 1760,  120,  664,
-      664,  664,  120, 1775,  120,  120,  120,  129,  129,  129,
+      120,  120,  120,  693,  120,  120,  120,  120,  120,  167,
+      167,  167,  168,  168,  168,  169,  169,  169,  996,  693,
+      170,  170,  170,  699, 1766,  167, 1767,  699,  168,  996,
+      705,  169,  996,  998,  120,  120,  170,  711,  120,  120,
+      665,  665,  665, 1768,  711,  120,  705,  998,  120,  673,
+      673,  673,  120,  711,  120,  120,  120,  129,  129,  129,
       129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
-      129,  129,  693,  129,  129,  129,  129,  129,  171,  171,
+      129,  129,  716,  129,  129,  129,  129,  129,  171,  171,
 
-      171,  172,  172,  172,  175,  175,  175,  968,  693,  176,
-      176,  176, 1776, 1784,  171, 1785,  707,  172,  968, 1787,
-      175,  968, 1809,  129,  129,  176,  667,  667,  667,  675,
-      675,  675,  707, 1810,  129,  130,  130,  130,  130,  130,
+      171,  172,  172,  172,  175,  175,  175,  999,  716,  176,
+      176,  176, 1770, 1773,  171, 1774,  730,  172,  999, 1775,
+      175,  999, 1777,  129,  129,  176,  676,  676,  676,  687,
+      687,  687,  730, 1780,  129,  130,  130,  130,  130,  130,
       130,  130,  130,  130,  130,  130,  130,  130,  130,  130,
-      722,  130,  130,  130,  130,  130,  179,  179,  179,  180,
-      180,  180,  183,  183,  183, 1039,  722,  184,  184,  184,
-     1813, 1815,  179, 1817,  733,  180, 1039, 1824,  183, 1039,
-     1825,  130,  130,  184,  679,  679,  679,  687,  687,  687,
-      733, 1826,  130,  139,  139,  139,  139,  139,  139,  139,
-
-      139,  139,  139,  139,  139,  139,  139,  139,  745,  139,
-      139,  139,  139,  139,  187,  187,  187,  188,  188,  188,
-      189,  189,  189, 1474,  745,  190,  190,  190, 1827, 1829,
-      187, 1835,  764,  188, 1837, 1474,  189, 1839, 1840,  139,
-      139,  190,  139,  771,  139,  690,  690,  690,  764, 1845,
-      139,  700,  700,  700,  704,  704,  704,  139, 1847, 1848,
-      139,  140,  140,  140,  140,  140,  140,  140,  140,  140,
-      140,  140,  140,  140,  140,  140, 1850,  140,  140,  140,
-      140,  140,  193,  193,  193,  194,  194,  194,  195,  195,
-      195, 1851,  771,  196,  196,  196,  771, 1852,  193, 1853,
-
-     1049,  194, 1854, 1857,  195, 1858, 1859,  140,  140,  196,
-      140, 1863,  140,  714,  714,  714, 1049, 1872,  140,  719,
-      719,  719,  730,  730,  730,  140, 1875, 1883,  140,  149,
+      745,  130,  130,  130,  130,  130,  177,  177,  177,  178,
+      178,  178,  179,  179,  179, 1070,  745,  180,  180,  180,
+     1781, 1782,  177, 1786,  756,  178, 1070, 1787,  179, 1070,
+     1791,  130,  130,  180,  690,  690,  690,  698,  698,  698,
+      756, 1794,  130,  139,  139,  139,  139,  139,  139,  139,
+
+      139,  139,  139,  139,  139,  139,  139,  139,  768,  139,
+      139,  139,  139,  139,  181,  181,  181,  182,  182,  182,
+      185,  185,  185, 1514,  768,  186,  186,  186, 1797, 1798,
+      181, 1799,  787,  182, 1801, 1514,  185, 1804, 1805,  139,
+      139,  186,  189,  189,  189,  190,  190,  190,  787, 1622,
+      139,  702,  702,  702,  710,  710,  710,  794,  189,  139,
+     1810,  190, 1622, 1811,  139,  140,  140,  140,  140,  140,
+      140,  140,  140,  140,  140,  140,  140,  140,  140,  140,
+     1826,  140,  140,  140,  140,  140,  193,  193,  193,  194,
+      194,  194,  197,  197,  197, 1827,  825,  198,  198,  198,
+
+     1835, 1836,  193,  825, 1080,  194,  794, 1838,  197,  825,
+      794,  140,  140,  198,  199,  199,  199,  200,  200,  200,
+     1080, 1860,  140,  713,  713,  713,  723,  723,  723, 1861,
+      199,  140, 1863,  200, 1864, 1867,  140,  149,  149,  149,
       149,  149,  149,  149,  149,  149,  149,  149,  149,  149,
-      149,  149,  149,  149, 1885,  149,  149,  149,  149,  149,
-      197,  197,  197,  198,  198,  198,  199,  199,  199, 1887,
-     1572,  200,  200,  200, 1888, 1889,  197,  727, 1891,  198,
-     1896, 1899,  199, 1572,  727,  149,  149,  200,  201,  201,
-      201,  149, 1900,  727, 1902,  757,  149,  739,  739,  739,
-      742,  742,  742, 1907,  201,  750,  750,  750,  149,  150,
+      149,  149, 1869,  149,  149,  149,  149,  149,  203,  203,
+      203,  204,  204,  204,  205,  205,  205, 1872,  830,  206,
+      206,  206, 1879, 1880,  203,  830, 1881,  204, 1882, 1884,
+      205,  830, 1890,  149,  149,  206,  149,  779,  149,  727,
+      727,  727, 1892, 1894,  149,  737,  737,  737,  742,  742,
 
+      742,  149, 1895, 1900,  149,  150,  150,  150,  150,  150,
       150,  150,  150,  150,  150,  150,  150,  150,  150,  150,
-      150,  150,  150,  150,  757,  150,  150,  150,  150,  150,
-      202,  202,  202,  203,  203,  203,  204,  204,  204, 1912,
-      757,  205,  205,  205, 1913, 1917,  202,  740,  757,  203,
-     1920, 1923,  204, 1926,  740,  150,  150,  205,  206,  206,
-      206,  150, 1927,  740, 1929, 1930,  150,  761,  761,  761,
-      770,  770,  770, 1931,  206,  773,  773,  773,  150,  153,
-      153,  153,  153,  153,  153,  153,  153,  153,  153,  153,
-      153,  153,  153,  153, 1932,  153,  153,  153,  153,  153,
-      207,  207,  207,  208,  208,  208,  209,  209,  209, 1933,
-
-      801,  210,  210,  210, 1156, 1934,  207,  801, 1936,  208,
-     1937, 1939,  209,  801, 1156,  153,  153,  210, 1052, 1052,
-     1052, 1156, 1052,  153,  154,  154,  154,  154,  154,  154,
-      154,  154,  154,  154,  154,  154,  154,  154,  154, 1940,
-      154,  154,  154,  154,  154,  211,  211,  211,  212,  212,
-      212,  215,  215,  215, 1943,  806,  216,  216,  216, 1944,
-     1946,  211,  806, 1948,  212, 1951, 1953,  215,  806, 1919,
-      154,  154,  216,  782,  782,  782, 1954, 1955,  154,  163,
-      163,  163,  163,  163,  163,  163,  163,  163,  163,  163,
-      163,  163,  163,  163, 1919,  163,  163,  163,  163,  163,
-
-      217,  217,  217,  218,  218,  218,  219,  219,  219, 1956,
-      813,  220,  220,  220, 1957, 1959,  217,  813, 1960,  218,
-     1964,  820,  219,  813,  966,  163,  163,  220,  820,  163,
-     1967,  966, 1968,  782,  820, 1969,  163,  966, 1976,  163,
-     1977, 1065, 1065, 1065, 1981, 1982,  163,  164,  164,  164,
+     1902,  150,  150,  150,  150,  150,  207,  207,  207,  208,
+      208,  208,  209,  209,  209, 1903, 1905,  210,  210,  210,
+      779, 1906,  207,  750,  779,  208, 1907, 1908,  209, 1909,
+      750,  150,  150,  210,  150, 1912,  150, 1913, 1914,  750,
+     1918, 1927,  150,  753,  753,  753,  762,  762,  762,  150,
+     1930, 1938,  150,  159,  159,  159,  159,  159,  159,  159,
+      159,  159,  159,  159,  159,  159,  159,  159, 1940,  159,
+      159,  159,  159,  159,  211,  211,  211,  212,  212,  212,
+
+      213,  213,  213, 1942, 1943,  214,  214,  214, 1944, 1946,
+      211,  763, 1951,  212, 1954, 1955,  213, 1957,  763,  159,
+      159,  214,  215,  215,  215,  159, 1962,  763, 1967,  780,
+      159,  765,  765,  765,  773,  773,  773, 1968,  215,  784,
+      784,  784,  159,  160,  160,  160,  160,  160,  160,  160,
+      160,  160,  160,  160,  160,  160,  160,  160,  780,  160,
+      160,  160,  160,  160,  216,  216,  216,  217,  217,  217,
+      218,  218,  218, 1972,  780,  219,  219,  219, 1975, 1978,
+      216, 1981,  780,  217, 1982, 1984,  218, 1985, 1986,  160,
+      160,  219,  220,  220,  220,  160,  793,  793,  793, 1987,
+
+      160,  796,  796,  796,  805,  805,  805, 1988,  220, 1370,
+     1370, 1370,  160,  163,  163,  163,  163,  163,  163,  163,
+      163,  163,  163,  163,  163,  163,  163,  163, 1989,  163,
+      163,  163,  163,  163,  221,  221,  221,  222,  222,  222,
+      225,  225,  225, 1992,  837,  226,  226,  226, 1188, 1993,
+      221,  837, 1995,  222, 1996, 1999,  225,  837, 1188,  163,
+      163,  226, 2000, 2002,  805, 1188, 2004,  163,  164,  164,
       164,  164,  164,  164,  164,  164,  164,  164,  164,  164,
-      164,  164, 1983,  164,  164,  164,  164,  164,  221,  221,
-      221,  222,  222,  222,  225,  225,  225, 1985,  969,  226,
-      226,  226, 1989, 1990,  221,  969, 2025,  222, 2026, 2033,
-      225,  969, 2034,  164,  164,  226, 2045,  164, 1061, 1061,
-
-     1061, 2046, 1061, 2047,  164, 1061, 1065,  164, 1331, 1331,
-     1331, 1354, 1354, 1354,  164,  173,  173,  173,  173,  173,
-      173,  173,  173,  173,  173,  173,  173,  173,  173,  173,
-     2048,  173,  173,  173,  173,  173,  229,  229,  229,  230,
-      230,  230,  233,  233,  233, 2050, 2058,  234,  234,  234,
-     2060, 2064,  229, 2067, 2068,  230, 2070, 2071,  233, 2074,
-     2075,  173,  173,  234, 1086, 1086, 1086,  173, 1698, 1698,
-     1698, 2076,  173,  174,  174,  174,  174,  174,  174,  174,
-      174,  174,  174,  174,  174,  174,  174,  174, 2077,  174,
-      174,  174,  174,  174,  235,  235,  235,  236,  236,  236,
-
-      237,  237,  237, 2081, 2082,  238,  238,  238, 2083, 2088,
-      235, 2092, 2096,  236, 2098, 1698,  237, 2100, 2106,  174,
-      174,  238, 1099, 1099, 1099,  174, 1102, 1102, 1102, 1086,
-      174,  177,  177,  177,  177,  177,  177,  177,  177,  177,
-      177,  177,  177,  177,  177,  177, 2113,  177,  177,  177,
-      177,  177,  239,  239,  239,  240,  240,  240,  243,  243,
-      243, 2117, 2118,  244,  244,  244, 2120, 2127,  239, 2133,
-     2138,  240, 2140, 2141,  243, 2143, 2144,  177,  177,  244,
-      247,  247,  247,  248,  248,  248, 2133, 1099,  177, 2134,
-     2146, 1102, 2147, 1127, 1127, 1127,  247, 1127, 2148,  248,
-
-     1127,  177,  178,  178,  178,  178,  178,  178,  178,  178,
-      178,  178,  178,  178,  178,  178,  178, 2142,  178,  178,
-      178,  178,  178,  249,  249,  249,  250,  250,  250,  251,
-      251,  251, 2134, 2142,  252,  252,  252, 2135, 2149,  249,
-     2151, 2142,  250, 2152, 2156,  251, 2158, 2159,  178,  178,
-      252,  253,  253,  253,  254,  254,  254, 2160, 2161,  178,
-     2163, 1146, 1146, 1146, 2164, 1146, 2165,  253, 1146, 2166,
-      254, 2135,  178,  181,  181,  181,  181,  181,  181,  181,
-      181,  181,  181,  181,  181,  181,  181,  181, 2162,  181,
-      181,  181,  181,  181,  257,  257,  257,  258,  258,  258,
-
-      259,  259,  259, 2169, 2162,  260,  260,  260, 2171, 2172,
-      257, 2179, 2162,  258, 2181, 2173,  259, 2182, 2183,  181,
-      181,  260,  261,  261,  261, 1148, 1148, 1148, 2184, 1148,
-     2185, 2173, 1148, 2187, 2192,  181, 2220, 2221,  261, 2173,
-      181,  182,  182,  182,  182,  182,  182,  182,  182,  182,
-      182,  182,  182,  182,  182,  182, 2174,  182,  182,  182,
-      182,  182,  262,  262,  262,  263,  263,  263,  264,  264,
-      264, 2222, 2174,  271,  271,  271, 2226, 2227,  262, 2233,
-     2174,  263, 2234, 2237,  264,  268,  268,  182,  182,  271,
-      268,  272,  272,  272, 1158, 1158, 1158, 2238, 1158, 2244,
-
-      268, 1158, 2245,  182, 1700, 1700, 1700,  272,  182,  185,
-      185,  185,  185,  185,  185,  185,  185,  185,  185,  185,
-      185,  185,  185,  185, 2251,  185,  185,  185,  185,  185,
-      268,  275,  275,  275,  276,  276,  276,  277,  277,  277,
-     2253,  278,  278,  278,  790,  790,  790,  275, 2254, 2257,
-      276, 1700, 2263,  277, 2265,  185,  185,  278,  185,  185,
-      185,  790, 2271, 1161, 1161, 1161,  185, 1161, 2275,  185,
-     1161, 1703, 1703, 1703, 2276, 2279,  185,  186,  186,  186,
-      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
-      186,  186, 2284,  186,  186,  186,  186,  186,  279,  279,
-
-      279,  280,  280,  280,  281,  281,  281, 2286, 2287,  282,
-      282,  282, 2288, 2289,  279, 2296, 2298,  280, 2300, 2302,
-      281, 2315, 2316,  186,  186,  282,  186,  186,  186, 1175,
-     1175, 1175, 2317, 1175,  186, 2320, 1175,  186, 1706, 1706,
-     1706, 1712, 1712, 1712,  186,  191,  191,  191,  191,  191,
+      164,  164,  164, 2007,  164,  164,  164,  164,  164,  227,
+      227,  227,  228,  228,  228,  229,  229,  229, 2009,  844,
+
+      230,  230,  230, 2010, 2011,  227,  844, 2012,  228, 2013,
+     2015,  229,  844, 1974,  164,  164,  230, 1083, 1083, 1083,
+     2016, 1083,  164,  173,  173,  173,  173,  173,  173,  173,
+      173,  173,  173,  173,  173,  173,  173,  173, 1974,  173,
+      173,  173,  173,  173,  231,  231,  231,  232,  232,  232,
+      235,  235,  235, 2020,  997,  236,  236,  236, 2023, 2024,
+      231,  997, 2025,  232, 2032, 1000,  235,  997, 2033,  173,
+      173,  236, 1000,  173, 2037, 1092, 1092, 1092, 1000, 1092,
+      173, 2038, 1092,  173, 1096, 1096, 1096, 1118, 1118, 1118,
+      173,  174,  174,  174,  174,  174,  174,  174,  174,  174,
+
+      174,  174,  174,  174,  174,  174, 2039,  174,  174,  174,
+      174,  174,  239,  239,  239,  240,  240,  240,  243,  243,
+      243, 2041, 2045,  244,  244,  244, 2046, 2081,  239, 2082,
+     2084,  240, 2085, 2092,  243, 2093, 2105,  174,  174,  244,
+     2106,  174, 2107, 1131, 1131, 1131, 2108, 2110,  174, 1096,
+     2118,  174, 1118, 1394, 1394, 1394, 2120, 2124,  174,  183,
+      183,  183,  183,  183,  183,  183,  183,  183,  183,  183,
+      183,  183,  183,  183, 2127,  183,  183,  183,  183,  183,
+      245,  245,  245,  246,  246,  246,  247,  247,  247, 2128,
+     2130,  248,  248,  248, 2131, 2134,  245, 2135, 2136,  246,
+
+     2137, 2141,  247, 2142, 2143,  183,  183,  248, 1131, 2148,
+     2152,  183, 1748, 1748, 1748, 2156,  183,  184,  184,  184,
+      184,  184,  184,  184,  184,  184,  184,  184,  184,  184,
+      184,  184, 2158,  184,  184,  184,  184,  184,  249,  249,
+      249,  250,  250,  250,  253,  253,  253, 2160, 2166,  254,
+      254,  254, 2173, 2177,  249, 2178, 2180,  250, 2187, 2198,
+      253, 2200, 2194,  184,  184,  254, 1134, 1134, 1134,  184,
+     1749, 1749, 1749, 2193,  184,  187,  187,  187,  187,  187,
+      187,  187,  187,  187,  187,  187,  187,  187,  187,  187,
+     2193,  187,  187,  187,  187,  187,  257,  257,  257,  258,
+
+      258,  258,  259,  259,  259, 2194, 2201,  260,  260,  260,
+     2195, 2203,  257, 2204, 2206,  258, 2207, 1749,  259, 2208,
+     2209,  187,  187,  260,  261,  261,  261,  262,  262,  262,
+     2211, 1134,  187, 2212, 1159, 1159, 1159, 2216, 1159, 2218,
+      261, 1159, 2219,  262, 2195,  187,  188,  188,  188,  188,
+      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
+      188, 2202,  188,  188,  188,  188,  188,  263,  263,  263,
+      264,  264,  264,  267,  267,  267, 2220, 2202,  268,  268,
+      268, 2221, 2223,  263, 2224, 2202,  264, 2225, 2226,  267,
+     2229, 2231,  188,  188,  268,  269,  269,  269,  270,  270,
+
+      270, 2232, 2239,  188, 2241, 1178, 1178, 1178, 2242, 1178,
+     2243,  269, 1178, 2244,  270, 2245,  188,  191,  191,  191,
       191,  191,  191,  191,  191,  191,  191,  191,  191,  191,
-     2321,  191,  191,  191,  191,  191,  283,  283,  283,  284,
-      284,  284,  285,  285,  285, 2322, 2323,  286,  286,  286,
-     2324, 2325,  283, 2322, 2327,  284, 2339, 2347,  285, 2348,
-     2349,  191,  191,  286,  287,  287,  287,  288,  288,  288,
-
-     1182, 1182, 1182, 2326, 1182, 2343, 2341, 1182, 2350, 2351,
-      287, 2326, 2341,  288, 2342,  191,  192,  192,  192,  192,
+      191,  191, 2222,  191,  191,  191,  191,  191,  271,  271,
+      271,  272,  272,  272,  273,  273,  273, 2247, 2222,  274,
+      274,  274, 2252, 2280,  271, 2281, 2222,  272, 2282, 2286,
+      273,  278,  278,  191,  191,  274,  278,  281,  281,  281,
+     1180, 1180, 1180, 2287, 1180, 2293,  278, 1180, 2294,  191,
+     1751, 1751, 1751,  281,  191,  192,  192,  192,  192,  192,
       192,  192,  192,  192,  192,  192,  192,  192,  192,  192,
-      192, 2355,  192,  192,  192,  192,  192,  289,  289,  289,
-      290,  290,  290,  291,  291,  291, 2342, 2357,  292,  292,
-      292, 2358, 2343,  289, 2359, 2364,  290, 2365, 2367,  291,
-     2368, 2369,  192,  192,  292,  293,  293,  293,  294,  294,
-      294, 1191, 1191, 1191, 2370, 1191, 2373, 2377, 1191, 2378,
-     2385,  293, 2387, 2394,  294, 2396,  192,  213,  213,  213,
-      213,  213,  213,  213,  213,  213,  213,  213,  213,  213,
-
-      213,  213, 2427,  213,  213,  213,  213,  213,  295,  295,
-      295,  296,  296,  296,  297,  297,  297, 2428, 2429,  298,
-      298,  298, 2435, 2436,  295, 2440, 2444,  296, 2445, 2449,
-      297, 2450, 2453,  213,  213,  298,  299,  299,  299, 2456,
-     2457,  213, 2458,  213, 2459, 2462,  213, 1718, 1718, 1718,
-      213, 2465,  299, 2469,  213,  214,  214,  214,  214,  214,
-      214,  214,  214,  214,  214,  214,  214,  214,  214,  214,
-     2470,  214,  214,  214,  214,  214,  300,  300,  300,  301,
-      301,  301,  302,  302,  302, 2471, 2472,  303,  303,  303,
-     2484, 2487,  300, 2489, 1718,  301, 2492, 2506,  302, 2507,
-
-     2508,  214,  214,  303,  304,  304,  304, 2513, 2514,  214,
-     2515,  214, 2516, 2517,  214, 1720, 1720, 1720,  214, 2518,
-      304, 2519,  214,  223,  223,  223,  223,  223,  223,  223,
-      223,  223,  223,  223,  223,  223,  223,  223, 2520,  223,
-      223,  223,  223,  223,  305,  305,  305,  306,  306,  306,
-      307,  307,  307, 2521, 2522,  308,  308,  308, 2532, 2543,
-      305, 2544, 1720,  306, 2545, 2535,  307, 2548, 2551,  223,
-      223,  308,  309,  309,  309,  310,  310,  310, 2555, 2556,
-      223, 2536, 1193, 1193, 1193, 2557, 1193, 2560,  309, 1193,
-     2561,  310, 2562,  223,  224,  224,  224,  224,  224,  224,
-
-      224,  224,  224,  224,  224,  224,  224,  224,  224, 2535,
-      224,  224,  224,  224,  224,  313,  313,  313,  314,  314,
-      314,  315,  315,  315, 2565, 2568,  316,  316,  316, 2536,
-     2569,  313, 2570, 2571,  314, 2593, 2594,  315, 2600, 2595,
-      224,  224,  316,  317,  317,  317,  318,  318,  318, 2595,
-     2601,  224, 2607,  363, 1201, 1201, 1201, 2608, 1201,  317,
-      620, 1201,  318,  363,  224,  227,  227,  227,  227,  227,
-      227,  227,  227,  227,  227,  227,  227,  227,  227,  227,
-     2609,  227,  227,  227,  227,  227,  319,  319,  319,  320,
-      320,  320,  363, 2610, 1711, 1711, 1711, 2624,  620,  620,
-
-      620, 2625,  319, 2626, 2627,  320,  363, 2647, 2648,  620,
-      363,  227,  227,  620, 2659,  620,  363, 2660,  751,  753,
-      227, 2665,  227, 2666,  370, 2667,  227, 2668,  751,  753,
-     1711,  227,  227,  228,  228,  228,  228,  228,  228,  228,
-      228,  228,  228,  228,  228,  228,  228,  228, 2669,  228,
-      228,  228,  228,  228,  370, 2670, 2671,  751,  753,  370,
-     1063, 1063, 1063,  751, 1721, 1721, 1721,  370, 2672,  370,
-      370,  751,  753,  751,  751, 2673,  753,  370, 1063,  228,
-      228,  751,  753,  755, 2674, 1209, 1209, 1209,  228, 1209,
-      228, 2679, 1209,  755,  228, 2684,  758, 2685, 2687,  228,
-
-      228,  231,  231,  231,  231,  231,  231,  231,  231,  231,
-      231,  231,  231,  231,  231,  231, 2688,  231,  231,  231,
-      231,  231,  755,  755, 2689,  758,  758,  855,  855,  855,
-     1725, 1725, 1725,  877,  877,  877, 1111, 1111, 1111,  758,
-      878,  878,  878, 2686,  855, 2122,  755,  231,  231,  758,
-      877, 2122, 2686,  231, 1111, 2122, 2690,  878, 1213, 1213,
-     1213, 2122, 1213, 2692, 2693, 1213, 1725, 2696,  231,  232,
-      232,  232,  232,  232,  232,  232,  232,  232,  232,  232,
-      232,  232,  232,  232, 2697,  232,  232,  232,  232,  232,
-      888,  888,  888,  890,  890,  890,  904,  904,  904, 2691,
-
-      910,  910,  910,  919,  919,  919, 2698,  888, 2691, 2701,
-      890, 2703, 2704,  904, 2707,  232,  232,  910, 2708, 2682,
-      919,  232, 1225, 1225, 1225, 2709, 1225, 2711, 2712, 1225,
-     2714, 1727, 1727, 1727, 2735, 2736,  232,  241,  241,  241,
+
+     2301,  192,  192,  192,  192,  192,  278,  282,  282,  282,
+      285,  285,  285,  286,  286,  286, 2302,  287,  287,  287,
+      288,  288,  288,  282, 2182, 2308,  285, 1751, 2309,  286,
+     2182,  192,  192,  287, 2182, 2315,  288, 1190, 1190, 1190,
+     2182, 1190, 2317, 2318, 1190, 2321, 2327,  192, 1754, 1754,
+     1754, 2329,  192,  195,  195,  195,  195,  195,  195,  195,
+      195,  195,  195,  195,  195,  195,  195,  195, 2233,  195,
+      195,  195,  195,  195,  289,  289,  289,  290,  290,  290,
+      291,  291,  291, 2335, 2233,  292,  292,  292, 2339, 2340,
+      289, 2343, 2233,  290, 2348, 2350,  291, 2351, 2352,  195,
+
+      195,  292,  195,  195,  195, 1193, 1193, 1193, 2353, 1193,
+      195, 2360, 1193,  195, 1757, 1757, 1757, 1763, 1763, 1763,
+      195,  196,  196,  196,  196,  196,  196,  196,  196,  196,
+      196,  196,  196,  196,  196,  196, 2234,  196,  196,  196,
+      196,  196,  293,  293,  293,  294,  294,  294,  295,  295,
+      295, 2362, 2234,  296,  296,  296, 2364, 2366,  293, 2379,
+     2234,  294, 2380, 2381,  295, 2384, 2385,  196,  196,  296,
+      196,  196,  196, 1207, 1207, 1207, 2387, 1207,  196, 2386,
+     1207,  196, 2388, 1762, 1762, 1762, 2389, 2386,  196,  201,
+      201,  201,  201,  201,  201,  201,  201,  201,  201,  201,
+
+      201,  201,  201,  201, 2391,  201,  201,  201,  201,  201,
+      297,  297,  297,  298,  298,  298,  299,  299,  299, 1762,
+     2390,  300,  300,  300, 2403, 2405,  297, 2411, 2390,  298,
+     2412, 2405,  299, 2413, 2414,  201,  201,  300,  301,  301,
+      301,  302,  302,  302, 1211, 1211, 1211, 2415, 1211, 2407,
+     2419, 1211, 2421, 2422,  301, 2423, 2428,  302, 2406,  201,
+      202,  202,  202,  202,  202,  202,  202,  202,  202,  202,
+      202,  202,  202,  202,  202, 2429,  202,  202,  202,  202,
+      202,  303,  303,  303,  304,  304,  304,  305,  305,  305,
+     2406, 2431,  306,  306,  306, 2432, 2407,  303, 2433, 2434,
+
+      304, 2437, 2441,  305, 2442, 2449,  202,  202,  306,  307,
+      307,  307,  308,  308,  308, 1220, 1220, 1220, 2451, 1220,
+     2458, 2460, 1220, 2491, 2492,  307, 2493, 2499,  308, 2500,
+      202,  223,  223,  223,  223,  223,  223,  223,  223,  223,
+      223,  223,  223,  223,  223,  223, 2504,  223,  223,  223,
+      223,  223,  309,  309,  309,  310,  310,  310,  311,  311,
+      311, 2511, 2512,  312,  312,  312, 2516, 2517,  309, 2520,
+     2523,  310, 2524, 2525,  311, 2526, 2529,  223,  223,  312,
+      313,  313,  313, 2532, 2536,  223, 2537,  223, 2538, 2539,
+      223, 1769, 1769, 1769,  223, 2551,  313, 2554,  223,  224,
+
+      224,  224,  224,  224,  224,  224,  224,  224,  224,  224,
+      224,  224,  224,  224, 2556,  224,  224,  224,  224,  224,
+      314,  314,  314,  315,  315,  315,  316,  316,  316, 2559,
+     2573,  317,  317,  317, 2574, 2575,  314, 2580, 1769,  315,
+     2581, 2582,  316, 2583, 2584,  224,  224,  317,  318,  318,
+      318, 2585, 2586,  224, 2587,  224, 2588, 2589,  224, 1771,
+     1771, 1771,  224, 2599,  318, 2602,  224,  233,  233,  233,
+      233,  233,  233,  233,  233,  233,  233,  233,  233,  233,
+      233,  233, 2610,  233,  233,  233,  233,  233,  319,  319,
+      319,  320,  320,  320,  323,  323,  323, 2611, 2612,  324,
+
+      324,  324, 2615, 2618,  319, 2622, 1771,  320, 2623, 2602,
+      323, 2624, 2627,  233,  233,  324,  325,  325,  325,  326,
+      326,  326, 2628, 2629,  233, 2603, 1230, 1230, 1230, 2632,
+     1230, 2635,  325, 1230, 2636,  326, 2637,  233,  234,  234,
+      234,  234,  234,  234,  234,  234,  234,  234,  234,  234,
+      234,  234,  234,  374,  234,  234,  234,  234,  234,  327,
+      327,  327,  328,  328,  328,  329,  329,  329, 2638, 2660,
+      330,  330,  330, 2603, 2661,  327, 2605, 2605,  328, 2605,
+     2662,  329,  374,  374,  234,  234,  330, 2605, 2667,  374,
+     2662,  373,  374, 2668, 2605,  234,  374, 1772, 1772, 1772,
+
+      374,  373, 2679, 2680,  380, 2681,  374, 2682,  234,  237,
+      237,  237,  237,  237,  237,  237,  237,  237,  237,  237,
+      237,  237,  237,  237, 2696,  237,  237,  237,  237,  237,
+      373, 1871, 1871, 1871,  380,  813,  813,  813, 2697,  380,
+     2698,  879,  879,  879,  373, 2699, 2719,  380,  373,  380,
+      380, 2720,  813, 2731,  373,  237,  237,  380,  879, 2732,
+      643, 2737, 2738,  774,  237, 2739,  237, 1232, 1232, 1232,
+      237, 1232, 2740,  774, 1232,  237,  237,  238,  238,  238,
+      238,  238,  238,  238,  238,  238,  238,  238,  238,  238,
+      238,  238, 2741,  238,  238,  238,  238,  238,  643,  643,
+
+      643, 2742,  774,  901,  901,  901, 2743, 2744,  774,  643,
+     1094, 1094, 1094,  643, 2745,  643,  774, 2746,  774,  774,
+      901,  776, 2751,  238,  238, 2756,  774,  778, 1094, 2757,
+     2758,  776,  238, 2759,  238, 2754, 2760,  778,  238, 2758,
+      781, 2761, 2762,  238,  238,  241,  241,  241,  241,  241,
       241,  241,  241,  241,  241,  241,  241,  241,  241,  241,
-      241,  241, 2682,  241,  241,  241,  241,  241,  920,  920,
-      920,  929,  929,  929,  937,  937,  937, 1727,  941,  941,
-      941, 2737,  954,  954,  954,  920, 2738, 2741,  929, 2742,
-     2748,  937, 2749,  241,  241,  941, 2757, 2683,  241,  954,
-     1742, 1742, 1742, 2758,  241,  242,  242,  242,  242,  242,
-
-      242,  242,  242,  242,  242,  242,  242,  242,  242,  242,
-     2759,  242,  242,  242,  242,  242,  980,  980,  980,  986,
-      986,  986, 1003, 1003, 1003, 2683, 1009, 1009, 1009, 2767,
-     1015, 1015, 1015,  980, 2768, 2784,  986, 1742, 2785, 1003,
-     2786,  242,  242, 1009, 2790, 2791,  242, 1015, 1928, 1928,
-     1928, 2792,  242,  245,  245,  245,  245,  245,  245,  245,
-      245,  245,  245,  245,  245,  245,  245,  245, 2793,  245,
-      245,  245,  245,  245, 1023, 1023, 1023, 1036, 1036, 1036,
-     1060, 1060, 1060, 1064, 1064, 1064, 1107, 1107, 1107, 2794,
-     2795, 1023, 2796, 2744, 1036, 2744, 2745, 1060, 2745,  245,
-
-      245, 1064,  245, 1107,  245, 1247, 1247, 1247, 2744, 1247,
-      245, 2745, 1247, 2797, 2798, 1728, 1728, 1728, 2799, 2800,
-     1064,  245,  246,  246,  246,  246,  246,  246,  246,  246,
-      246,  246,  246,  246,  246,  246,  246, 2801,  246,  246,
-      246,  246,  246, 1109, 1109, 1109, 2803, 2804, 1112, 1112,
-     1112, 1728, 1119, 1119, 1119, 1108, 1108, 1108, 2805, 2806,
-     1109, 2807, 2808, 1110, 1110, 1110, 1112, 2805,  246,  246,
-     1119,  246, 1108,  246, 1253, 1253, 1253, 2809, 1253,  246,
-     1110, 1253, 1269, 1269, 1269, 1112, 1269, 2811, 2812, 1269,
-      246,  255,  255,  255,  255,  255,  255,  255,  255,  255,
-
-      255,  255,  255,  255,  255,  255, 1108,  255,  255,  255,
-      255,  255, 1123, 1123, 1123, 2813, 2815, 1124, 1124, 1124,
-     2818, 1108, 2819, 1110, 1126, 1126, 1126, 1129, 1129, 1129,
-     1123, 1120, 1120, 1120, 2123, 1124, 2816,  255,  255, 2820,
-     2123, 1126,  255, 2821, 2123, 1129, 2822, 2810,  255, 1120,
-     2123, 2823,  255, 1935, 1935, 1935, 2810, 2815,  255,  256,
+      776,  241,  241,  241,  241,  241,  778,  778, 2754,  781,
+      781,  902,  902,  902,  776, 1776, 1776, 1776,  776,  912,
+      912,  912, 2764,  781,  776,  914,  914,  914,  902, 2763,
+      778,  241,  241,  781, 2765, 2768,  912,  241, 2763, 1240,
+
+     1240, 1240,  914, 1240, 2769, 2770, 1240, 1778, 1778, 1778,
+     2773, 1776,  241,  242,  242,  242,  242,  242,  242,  242,
+      242,  242,  242,  242,  242,  242,  242,  242, 2775,  242,
+      242,  242,  242,  242,  928,  928,  928,  932,  932,  932,
+      940,  940,  940, 1778,  950,  950,  950,  951,  951,  951,
+     2776,  928, 2779, 2780,  932, 2781, 2783,  940, 2755,  242,
+      242,  950, 2784, 2786,  951,  242, 1248, 1248, 1248, 2807,
+     1248, 2808, 2809, 1248, 2810, 1779, 1779, 1779, 2813, 2814,
+      242,  251,  251,  251,  251,  251,  251,  251,  251,  251,
+      251,  251,  251,  251,  251,  251, 2755,  251,  251,  251,
+
+      251,  251,  960,  960,  960,  968,  968,  968,  972,  972,
+      972, 1779,  985,  985,  985, 2823, 1011, 1011, 1011,  960,
+     2824, 2832,  968, 2833, 2834,  972, 2842,  251,  251,  985,
+     2843, 2859,  251, 1011, 1793, 1793, 1793, 2860,  251,  252,
+      252,  252,  252,  252,  252,  252,  252,  252,  252,  252,
+      252,  252,  252,  252, 2861,  252,  252,  252,  252,  252,
+     1017, 1017, 1017, 1034, 1034, 1034, 1040, 1040, 1040, 2865,
+     1046, 1046, 1046, 2866, 1054, 1054, 1054, 1017, 2867, 2868,
+     1034, 1793, 2869, 1040, 2870,  252,  252, 1046, 2871, 2872,
+      252, 1054, 1983, 1983, 1983, 2873,  252,  255,  255,  255,
+
+      255,  255,  255,  255,  255,  255,  255,  255,  255,  255,
+      255,  255, 2874,  255,  255,  255,  255,  255, 1067, 1067,
+     1067, 1091, 1091, 1091, 1095, 1095, 1095, 2875, 1139, 1139,
+     1139, 2876, 1141, 1141, 1141, 1067, 2878, 2879, 1091, 1140,
+     1140, 1140, 1095,  255,  255, 1139,  255, 2881,  255, 1141,
+     2880, 1252, 1252, 1252,  255, 1252, 1140, 2882, 1252, 2880,
+     2883, 1095, 1990, 1990, 1990,  255,  256,  256,  256,  256,
       256,  256,  256,  256,  256,  256,  256,  256,  256,  256,
-      256,  256,  256,  256, 2816,  256,  256,  256,  256,  256,
-     2824, 1120, 1124, 1131, 1131, 1131, 1133, 1133, 1133, 1134,
-     1134, 1134, 2825, 2826, 1130, 1130, 1130, 1132, 1132, 1132,
+      256, 2884,  256,  256,  256,  256,  256, 1158, 1158, 1158,
+     1140, 1143, 1143, 1143, 1163, 1163, 1163, 1142, 1142, 1142,
 
-     1131, 2827, 2828, 1133, 2829,  256,  256, 1134, 2830, 2831,
-      256, 2832, 1130, 2835, 1132, 2836,  256, 1275, 1275, 1275,
-      256, 1275, 2838, 2839, 1275, 2840,  256,  265,  265,  265,
+     1151, 1151, 1151, 2886, 1158, 1140, 1152, 1152, 1152, 1143,
+     2887, 1163,  256,  256, 1142,  256, 2888,  256, 1151, 1991,
+     1991, 1991, 2885,  256, 1152, 1264, 1264, 1264, 2893, 1264,
+     2891, 2885, 1264, 2894,  256,  265,  265,  265,  265,  265,
       265,  265,  265,  265,  265,  265,  265,  265,  265,  265,
-      265,  265, 1130,  265,  265,  265,  265,  265, 1132, 1135,
-     1135, 1135, 1136, 1136, 1136, 1137, 1137, 1137, 1138, 1138,
-     1138, 2842, 2843, 1132, 1139, 1139, 1139, 1135, 2863, 1136,
-     2864, 2866, 1137,  265,  265, 2817, 1138, 1938, 1938, 1938,
-     2870,  265, 1139, 2871,  265, 1941, 1941, 1941, 1942, 1942,
-     1942,  265,  266,  266,  266,  266,  266,  266,  266,  266,
-
-      266,  266,  266,  266,  266,  266,  266, 2872,  266,  266,
-      266,  266,  266, 1140, 1140, 1140, 1142, 1142, 1142, 2817,
-     2873, 1135, 1143, 1143, 1143, 2874, 2875, 1141, 1141, 1141,
-     1140, 2873, 2877, 1142, 2878, 2888, 1139, 2889,  266,  266,
-     1143, 1281, 1281, 1281, 1141, 1281,  266, 2890, 1281,  266,
-     1945, 1945, 1945, 1947, 1947, 1947,  266,  269,  269,  269,
-      269,  269,  269,  269,  269,  269,  269,  269,  269,  269,
-      269,  269, 2902,  269,  269,  269,  269,  269, 1141, 1144,
-     1144, 1144, 1145, 1145, 1145, 1147, 1147, 1147, 1149, 1149,
-     1149, 2920, 2926, 1141, 1150, 1150, 1150, 1144, 2876, 1145,
-
-     2927, 2928, 1147,  269,  269, 1149, 1151, 1151, 1151, 2876,
-      269, 1150, 2929, 1289, 1289, 1289,  269, 1289, 1947, 2930,
-     1289, 2931, 2932, 1151, 2933,  269,  270,  270,  270,  270,
-      270,  270,  270,  270,  270,  270,  270,  270,  270,  270,
-      270, 2934,  270,  270,  270,  270,  270, 1150, 1154, 1154,
-     1154, 1144, 1950, 1950, 1950, 1952, 1952, 1952, 1152, 1152,
-     1152, 2935, 1151, 1153, 1153, 1153, 1154, 2937, 2938, 1155,
-     1155, 1155,  270,  270, 2939, 1152, 1157, 1157, 1157,  270,
-     1153, 2940, 1301, 1301, 1301,  270, 1301, 1155, 2941, 1301,
-     1949, 1949, 1949, 1157,  270,  273,  273,  273,  273,  273,
-
-      273,  273,  273,  273,  273,  273,  273,  273,  273,  273,
-     1152,  273,  273,  273,  273,  273, 1153, 1155, 1160, 1160,
-     1160, 1162, 1162, 1162, 2894, 1172, 1172, 1172, 1173, 1173,
-     1173, 1174, 1174, 1174, 2894, 1160, 2942, 1949, 1162, 2943,
-     2894,  273,  273, 1172, 2895, 2944, 1173, 2945, 1174, 1323,
-     1323, 1323,  273, 1323, 2895, 2946, 1323, 1958, 1958, 1958,
-     2895,  273,  274,  274,  274,  274,  274,  274,  274,  274,
-      274,  274,  274,  274,  274,  274,  274, 2947,  274,  274,
-      274,  274,  274, 1176, 1176, 1176, 2948, 1173, 1177, 1177,
-     1177, 2954, 2955, 1181, 1181, 1181, 1186, 1186, 1186, 2956,
-
-     2957, 1176, 1187, 1187, 1187, 2958, 1177, 2959,  274,  274,
-     1181, 1375, 1375, 1375, 1186, 1375, 2960, 2961, 1375,  274,
-     1187, 1961, 1961, 1961, 1962, 1962, 1962, 2951,  274,  311,
-      311,  311,  311,  311,  311,  311,  311,  311,  311,  311,
-      311,  311,  311,  311, 2962,  311,  311,  311,  311,  311,
-     1177, 1190, 1190, 1190, 1192, 1192, 1192, 2951, 2963, 1194,
-     1194, 1194, 2964, 2965, 1187, 1195, 1195, 1195, 1190, 2952,
-     2966, 1192, 1197, 1197, 1197,  311,  311, 1194, 1200, 1200,
-     1200,  311, 2968, 1195,  311, 1379, 1379, 1379, 2953, 1379,
-     1197, 2970, 1379, 2971, 2972, 1200,  311,  312,  312,  312,
-
-      312,  312,  312,  312,  312,  312,  312,  312,  312,  312,
-      312,  312, 2952,  312,  312,  312,  312,  312, 1198, 1198,
-     1198, 1205, 1205, 1205, 1206, 1206, 1206, 1195, 1208, 1208,
-     1208, 2953, 1210, 1210, 1210, 2974, 1198, 2975, 2976, 1205,
-     2988, 2993, 1206,  312,  312, 1208, 1212, 1212, 1212,  312,
-     1210, 2994,  312, 1211, 1211, 1211, 1215, 1215, 1215, 1219,
-     1219, 1219, 2980, 1212,  312,  360, 2995, 2996, 1216, 1216,
-     1216, 1211,  360, 2997, 1215, 2980, 2998, 1219, 2999, 1198,
-     1206,  360,  360, 1220, 1220, 1220, 1216, 1224, 1224, 1224,
-     1226, 1226, 1226, 2918, 3000, 1229, 1229, 1229, 1230, 1230,
-
-     1230, 1220, 2981, 2918, 1224, 3001, 2918, 1226, 3002, 1211,
-      360,  360,  360, 1229, 3003, 2981, 1230,  360,  360, 3014,
-     3016,  360,  360, 3020, 2919,  360, 3021,  360,  360,  360,
-     1216, 1233, 1233, 1233, 2919,  360,  362, 2919, 1234, 1234,
-     1234, 1244, 1244, 1244, 3022, 1220, 1245, 1245, 1245, 1233,
-     1230, 3023,  362,  362, 2538, 2538, 1234, 2538, 3024, 1244,
-     1246, 1246, 1246, 3025, 1245, 2538, 1249, 1249, 1249, 1250,
-     1250, 1250, 2538, 1252, 1252, 1252, 3027, 1246, 1254, 1254,
-     1254,  362,  362,  362, 1249, 3042, 3043, 1250,  362,  362,
-     1252, 3037,  362,  362, 3045, 1254,  362, 1234,  362,  362,
-
-      362, 1256, 1256, 1256, 3037, 3046,  362,  364, 1260, 1260,
-     1260, 1245, 3038, 1261, 1261, 1261, 3048, 3044, 1256, 1262,
-     1262, 1262, 3047,  364,  364, 3038, 1260, 1263, 1263, 1263,
-     3044, 1261, 3057, 3058, 1250, 3047, 1262, 3059, 1264, 1264,
-     1264, 1966, 1966, 1966, 1263, 3060, 3062, 1265, 1265, 1265,
-     3063, 3064,  364,  364,  364, 1264, 1266, 1266, 1266,  364,
-      364, 1261, 3065,  364,  364, 1265, 3068,  364, 3069,  364,
-      364,  364, 3070, 3071, 1266, 3072, 3073,  364, 1268, 1268,
-     1268, 1270, 1270, 1270, 1271, 1271, 1271, 1274, 1274, 1274,
-     1277, 1277, 1277, 3074, 3075, 1268, 3076, 3077, 1264, 1270,
-
-     3078, 3079, 1271, 3087, 1274, 1278, 1278, 1278, 1277, 1280,
-     1280, 1280, 1284, 1284, 1284, 1285, 1285, 1285, 1266, 1288,
-     1288, 1288, 3084, 1278, 3088, 3089, 1280, 1292, 1292, 1292,
-     1284, 3090, 3091, 1285, 3092, 3093, 1288, 1293, 1293, 1293,
-     1298, 1298, 1298, 3085, 3094, 1292, 1271, 1299, 1299, 1299,
-     1300, 1300, 1300, 3095, 3096, 1293, 3097, 3098, 1298, 1303,
-     1303, 1303, 1304, 1304, 1304, 1299, 3099, 1300, 1305, 1305,
-     1305, 3084, 1278, 3101, 1306, 1306, 1306, 1303, 3103, 3085,
-     1304, 3104, 1285, 3106, 3108, 1305, 1307, 1307, 1307, 3112,
-     3113, 1306, 1308, 1308, 1308, 1309, 1309, 1309, 1310, 1310,
-
-     1310, 3114, 1293, 1307, 1327, 1327, 1327, 3115, 3119, 1308,
-     3127, 3110, 1299, 1309, 3128, 3129, 1310, 1328, 1328, 1328,
-     3130, 3110, 1327, 3131, 1304, 1306, 1330, 1330, 1330, 1374,
-     1374, 1374, 1378, 1378, 1378, 1328, 1381, 1381, 1381, 3110,
-     1306, 1382, 1382, 1382, 1330, 3132, 1374, 3133, 3134, 1378,
-     3110, 3135, 1308, 3136, 1381, 1384, 1384, 1384, 3137, 1382,
-     1310, 1387, 1387, 1387, 1391, 1391, 1391, 1392, 1392, 1392,
-     1394, 1394, 1394, 1384, 1397, 1397, 1397, 3141, 1387, 1398,
-     1398, 1398, 1391, 3144, 3145, 1392, 3146, 3147, 1394, 1400,
-     1400, 1400, 1397, 3148, 1402, 1402, 1402, 1398, 1402, 3149,
-
-     3150, 1402, 3153, 1406, 1406, 1406, 3157, 1400, 1407, 1407,
-     1407, 1409, 1409, 1409, 1410, 1410, 1410, 1414, 1414, 1414,
-     1384, 1406, 3158, 1411, 1411, 1411, 1407, 1411, 3159, 1409,
-     1411, 1410, 3160, 3161, 1414, 3162, 3163, 1394, 1415, 1415,
-     1415, 3164, 1415, 1400, 3165, 1415, 1416, 1416, 1416, 1417,
-     1417, 1417, 1419, 1419, 1419, 1420, 1420, 1420, 1421, 1421,
-     1421, 1409, 1421, 3166, 1416, 1421, 3167, 1417, 3168, 3180,
-     1419, 3181, 1420, 1422, 1422, 1422, 1423, 1423, 1423, 3182,
-     1423, 3183, 3184, 1423, 1424, 1424, 1424, 1425, 1425, 1425,
-     1422, 1427, 1427, 1427, 1428, 1428, 1428, 1429, 1429, 1429,
-
-     3185, 1429, 1424, 3186, 1429, 1425, 1432, 1432, 1432, 1427,
-     3187, 1428, 1433, 1433, 1433, 1419, 1433, 3189, 3190, 1433,
-     1434, 1434, 1434, 1432, 1435, 1435, 1435, 1437, 1437, 1437,
-     1438, 1438, 1438, 3191, 1438, 3192, 3193, 1438, 1434, 1441,
-     1441, 1441, 1435, 1441, 3194, 1437, 1441, 1444, 1444, 1444,
-     3195, 1445, 1445, 1445, 1427, 1445, 3196, 3197, 1445, 1450,
-     1450, 1450, 3198, 3199, 1444, 1451, 1451, 1451, 1453, 1453,
-     1453, 1457, 1457, 1457, 3200, 1457, 3208, 1450, 1457, 1460,
-     1460, 1460, 3209, 1451, 3210, 3213, 1453, 1461, 1461, 1461,
-     1437, 1461, 3204, 3214, 1461, 3215, 1460, 1464, 1464, 1464,
-
-     1465, 1465, 1465, 3216, 1465, 3219, 3221, 1465, 1475, 1475,
-     1475, 1476, 1476, 1476, 1464, 3225, 3228, 1453, 1478, 1478,
-     1478, 1479, 1479, 1479, 3229, 1479, 1475, 3204, 1479, 1476,
-     1482, 1482, 1482, 1483, 1483, 1483, 1478, 1485, 1485, 1485,
-     1488, 1488, 1488, 1489, 1489, 1489, 3230, 1489, 1482, 3231,
-     1489, 1483, 1495, 1495, 1495, 1485, 3232, 1488, 1496, 1496,
-     1496, 1498, 1498, 1498, 1500, 1500, 1500, 1501, 1501, 1501,
-     1495, 1501, 3233, 3234, 1501, 3235, 1496, 3236, 3237, 1498,
-     3238, 1500, 3239, 1504, 1504, 1504, 1478, 1504, 3244, 3252,
-     1504, 1507, 1507, 1507, 1508, 1508, 1508, 3253, 1485, 1510,
-
-     1510, 1510, 1511, 1511, 1511, 1512, 1512, 1512, 3254, 1507,
-     3255, 3256, 1508, 1513, 1513, 1513, 3257, 1510, 3258, 1511,
-     1515, 1515, 1515, 1512, 1523, 1523, 1523, 1498, 1517, 1517,
-     1517, 1513, 1517, 3259, 3260, 1517, 3261, 3267, 1515, 1524,
-     1524, 1524, 1523, 1526, 1526, 1526, 1528, 1528, 1528, 3268,
-     1528, 3270, 3271, 1528, 1531, 1531, 1531, 1524, 1532, 1532,
-     1532, 1526, 1534, 1534, 1534, 1510, 3273, 1535, 1535, 1535,
-     1515, 1535, 1531, 3274, 1535, 3275, 1532, 1539, 1539, 1539,
-     1534, 1540, 1540, 1540, 1542, 1542, 1542, 3276, 1543, 1543,
-     1543, 1544, 1544, 1544, 3277, 1539, 1545, 1545, 1545, 1540,
-
-     3278, 3279, 1542, 3111, 1526, 1543, 3280, 3281, 1544, 1546,
-     1546, 1546, 3282, 3111, 1545, 1548, 1548, 1548, 1553, 1553,
-     1553, 3283, 1553, 1534, 3284, 1553, 3285, 1546, 1556, 1556,
-     1556, 3111, 3288, 1548, 3289, 1542, 1557, 1557, 1557, 1544,
-     1557, 3290, 3111, 1557, 3291, 1556, 1560, 1560, 1560, 1561,
-     1561, 1561, 1563, 1563, 1563, 1566, 1566, 1566, 1567, 1567,
-     1567, 1569, 1569, 1569, 1560, 3292, 3293, 1561, 3294, 3295,
-     1563, 3297, 3298, 1566, 3300, 3301, 1567, 3302, 3304, 1569,
-     1575, 1575, 1575, 1548, 1579, 1579, 1579, 1580, 1580, 1580,
-     1582, 1582, 1582, 3306, 1583, 1583, 1583, 1575, 1583, 3307,
-
-     3308, 1583, 1579, 3311, 1563, 1580, 3312, 3313, 1582, 1569,
-     1587, 1587, 1587, 1588, 1588, 1588, 1590, 1590, 1590, 1592,
-     1592, 1592, 3171, 1592, 2539, 2539, 1592, 2539, 1587, 3314,
-     3317, 1588, 3171, 3318, 1590, 2539, 1595, 1595, 1595, 1596,
-     1596, 1596, 2539, 1596, 3319, 3320, 1596, 1597, 1597, 1597,
-     3171, 3321, 1582, 1595, 1598, 1598, 1598, 3322, 1599, 1599,
-     1599, 3171, 1599, 3323, 1597, 1599, 1601, 1601, 1601, 3324,
-     3325, 1598, 1603, 1603, 1603, 1604, 1604, 1604, 1590, 1606,
-     1606, 1606, 3332, 1601, 1607, 1607, 1607, 1608, 1608, 1608,
-     1603, 1608, 3326, 1604, 1608, 3333, 3335, 1606, 1609, 1609,
-
-     1609, 1607, 1610, 1610, 1610, 3336, 1610, 3337, 3339, 1610,
-     1612, 1612, 1612, 3341, 3344, 1609, 1613, 1613, 1613, 1615,
-     1615, 1615, 1617, 1617, 1617, 3346, 1617, 3347, 1612, 1617,
-     1620, 1620, 1620, 3348, 1613, 3349, 3326, 1615, 3350, 3351,
-     1606, 1621, 1621, 1621, 1623, 1623, 1623, 3352, 1620, 1626,
-     1626, 1626, 3353, 1626, 3354, 3355, 1626, 3356, 3357, 1621,
-     3360, 3364, 1623, 1630, 1630, 1630, 1631, 1631, 1631, 3365,
-     1633, 1633, 1633, 1635, 1635, 1635, 3172, 1635, 3367, 3368,
-     1635, 1630, 3369, 3371, 1631, 3372, 3172, 1615, 1633, 1639,
-     1639, 1639, 1640, 1640, 1640, 1641, 1641, 1641, 1643, 1643,
-
-     1643, 1645, 1645, 1645, 3172, 3377, 1639, 1646, 1646, 1646,
-     1640, 1646, 1623, 1641, 1646, 3172, 1643, 3378, 1645, 1649,
-     1649, 1649, 1651, 1651, 1651, 1652, 1652, 1652, 1654, 1654,
-     1654, 3379, 1633, 1656, 1656, 1656, 1649, 1658, 1658, 1658,
-     1651, 3380, 3381, 1652, 3382, 3383, 1654, 1659, 1659, 1659,
-     1656, 1661, 1661, 1661, 3384, 1658, 3385, 1662, 1662, 1662,
-     1643, 1662, 3386, 3387, 1662, 1659, 1666, 1666, 1666, 1661,
-     1667, 1667, 1667, 1669, 1669, 1669, 1654, 1670, 1670, 1670,
-     3388, 1649, 3389, 3390, 1666, 1671, 1671, 1671, 1667, 1671,
-     3391, 1669, 1671, 3392, 1670, 1674, 1674, 1674, 3393, 1661,
-
-     1675, 1675, 1675, 3397, 1675, 3398, 3399, 1675, 1677, 1677,
-     1677, 3400, 1674, 1678, 1678, 1678, 3401, 1680, 1680, 1680,
-     1682, 1682, 1682, 1688, 1688, 1688, 1677, 1741, 1741, 1741,
-     3402, 1678, 3403, 3404, 1669, 1680, 3407, 3408, 1682, 1682,
-     3409, 1688, 1732, 1732, 1732, 1741, 1732, 3410, 3411, 1732,
-     1737, 1737, 1737, 3412, 1737, 3414, 3415, 1737, 1744, 1744,
-     1744, 1745, 1745, 1745, 3417, 1745, 3202, 3418, 1745, 1749,
-     1749, 1749, 1752, 1752, 1752, 1744, 3202, 3419, 1680, 1751,
-     1751, 1751, 3421, 1755, 1755, 1755, 3422, 1749, 3423, 1741,
-     1752, 1756, 1756, 1756, 3202, 1756, 1751, 3424, 1756, 3425,
-
-     3426, 1755, 1761, 1761, 1761, 3202, 1761, 3427, 3428, 1761,
-     1764, 1764, 1764, 1765, 1765, 1765, 3429, 1765, 3437, 3433,
-     1765, 3438, 1768, 1768, 1768, 3440, 1768, 3441, 1764, 1768,
-     3433, 1749, 1771, 1771, 1771, 1772, 1772, 1772, 3445, 1772,
-     1752, 1755, 1772, 3430, 1777, 1777, 1777, 3432, 1777, 3447,
-     1771, 1777, 1780, 1780, 1780, 1781, 1781, 1781, 1764, 1781,
-     3449, 3432, 1781, 3451, 1786, 1786, 1786, 1788, 1788, 1788,
-     1780, 1789, 1789, 1789, 1790, 1790, 1790, 1791, 1791, 1791,
-     1771, 1786, 1792, 1792, 1792, 1788, 3453, 3455, 1789, 3459,
-     3430, 1790, 3461, 3465, 1791, 1797, 1797, 1797, 3466, 1792,
-
-     1780, 1793, 1793, 1793, 3461, 1793, 3468, 3469, 1793, 1794,
-     1794, 1794, 1797, 1794, 3436, 3471, 1794, 1798, 1798, 1798,
-     1799, 1799, 1799, 1788, 3462, 1791, 1800, 1800, 1800, 1801,
-     1801, 1801, 3476, 3436, 1798, 3436, 3462, 1799, 1802, 1802,
-     1802, 1790, 3482, 1800, 3476, 3484, 1801, 1797, 3436, 1803,
-     1803, 1803, 1804, 1804, 1804, 1802, 1805, 1805, 1805, 1806,
-     1806, 1806, 1807, 1807, 1807, 1798, 1803, 3486, 3487, 1804,
-     1811, 1811, 1811, 1805, 1800, 3490, 1806, 1808, 1808, 1808,
-     1807, 1812, 1812, 1812, 3491, 1812, 3494, 1811, 1812, 3496,
-     3498, 1799, 3500, 3502, 1801, 1808, 1814, 1814, 1814, 1802,
-
-     1816, 1816, 1816, 1818, 1818, 1818, 3504, 1819, 1819, 1819,
-     3477, 1819, 3505, 1814, 1819, 1820, 1820, 1820, 1816, 1805,
-     1818, 1806, 3477, 1804, 1821, 1821, 1821, 3507, 1807, 3508,
-     1808, 3512, 3513, 1820, 3515, 1822, 1822, 1822, 3516, 1822,
-     3518, 1821, 1822, 1814, 1823, 1823, 1823, 1828, 1828, 1828,
-     1830, 1830, 1830, 1831, 1831, 1831, 3520, 1832, 1832, 1832,
-     3522, 3524, 1823, 2677, 2677, 1828, 2677, 1816, 1830, 3528,
-     1831, 1833, 1833, 1833, 2677, 1832, 1834, 1834, 1834, 3530,
-     1834, 2677, 1820, 1834, 1836, 1836, 1836, 3526, 1833, 1838,
-     1838, 1838, 1841, 1841, 1841, 3533, 1841, 3534, 3525, 1841,
-
-     3535, 3526, 1836, 1823, 3539, 1828, 1838, 3536, 1830, 1832,
-     1844, 1844, 1844, 1846, 1846, 1846, 1849, 1849, 1849, 1855,
-     1855, 1855, 1856, 1856, 1856, 3536, 1856, 1844, 3540, 1856,
-     3541, 1846, 3527, 3527, 1849, 3550, 1855, 1860, 1860, 1860,
-     3525, 1861, 1861, 1861, 3551, 1836, 1862, 1862, 1862, 1864,
-     1864, 1864, 3561, 1864, 3555, 1860, 1864, 1844, 1861, 1867,
-     1867, 1867, 3555, 3439, 1862, 1868, 1868, 1868, 3562, 1868,
-     3563, 3529, 1868, 1869, 1869, 1869, 1867, 1869, 1846, 3439,
-     1869, 3439, 3529, 1849, 1873, 1873, 1873, 1860, 1874, 1874,
-     1874, 3542, 1874, 3564, 3439, 1874, 1876, 1876, 1876, 3571,
-
-     3557, 1873, 3572, 1877, 1877, 1877, 3542, 1877, 3557, 1862,
-     1877, 1880, 1880, 1880, 1876, 1880, 3573, 3574, 1880, 1884,
-     1884, 1884, 1886, 1886, 1886, 1890, 1890, 1890, 1892, 1892,
-     1892, 1893, 1893, 1893, 1894, 1894, 1894, 1884, 1894, 3554,
-     1886, 1894, 3556, 1890, 3575, 1892, 3576, 1876, 1893, 1895,
-     1895, 1895, 1897, 1897, 1897, 1898, 1898, 1898, 3554, 1898,
-     3566, 3556, 1898, 1901, 1901, 1901, 3568, 1895, 3567, 1897,
-     1903, 1903, 1903, 1904, 1904, 1904, 3567, 1904, 3586, 3566,
-     1904, 1901, 1905, 1905, 1905, 3568, 1884, 1903, 3587, 1886,
-     1890, 1906, 1906, 1906, 1908, 1908, 1908, 3569, 3588, 1905,
-
-     1909, 1909, 1909, 3589, 1909, 3569, 3592, 1909, 3593, 1906,
-     3594, 3602, 1908, 1901, 1895, 1914, 1914, 1914, 3603, 1914,
-     3604, 3589, 1914, 3606, 1918, 1918, 1918, 1921, 1921, 1921,
-     1963, 1963, 1963, 1965, 1965, 1965, 1970, 1970, 1970, 3607,
-     3608, 1906, 1918, 3610, 3611, 1921, 1908, 1971, 1971, 1971,
-     1972, 1972, 1972, 1973, 1973, 1973, 1974, 1974, 1974, 1975,
-     1975, 1975, 1978, 1978, 1978, 3612, 1978, 1972, 3613, 1978,
-     1973, 3615, 3616, 1974, 3595, 3617, 1918, 1975, 3622, 1921,
-     1965, 1984, 1984, 1984, 3623, 1986, 1986, 1986, 3624, 3595,
-     1987, 1987, 1987, 3625, 1987, 1963, 1921, 1987, 3626, 1984,
-
-     3627, 1970, 1986, 3628, 1988, 1988, 1988, 1991, 1991, 1991,
-     3629, 3630, 1971, 1992, 1992, 1992, 1993, 1993, 1993, 3631,
-     3632, 1974, 1988, 3633, 3636, 1991, 3637, 1975, 3638, 3639,
-     1992, 3640, 3641, 1993, 1994, 1994, 1994, 1995, 1995, 1995,
-     1996, 1996, 1996, 1997, 1997, 1997, 1984, 1998, 1998, 1998,
-     3642, 3643, 1994, 3646, 3647, 1995, 1991, 1996, 3648, 3649,
-     1997, 1999, 1999, 1999, 1988, 1998, 2000, 2000, 2000, 2001,
-     2001, 2001, 2002, 2002, 2002, 3650, 2002, 3651, 1999, 2002,
-     2003, 2003, 2003, 2000, 3652, 3653, 2001, 2004, 2004, 2004,
-     2005, 2005, 2005, 3654, 2006, 2006, 2006, 2003, 2006, 3656,
-
-     1994, 2006, 3657, 1995, 3658, 2004, 3659, 2005, 3661, 2007,
-     2007, 2007, 3663, 1998, 2008, 2008, 2008, 2009, 2009, 2009,
-     3664, 2009, 3665, 3666, 2009, 2000, 2007, 2012, 2012, 2012,
-     3667, 2008, 2013, 2013, 2013, 2014, 2014, 2014, 2015, 2015,
-     2015, 2016, 2016, 2016, 2012, 2017, 2017, 2017, 2004, 2013,
-     3514, 3668, 2014, 3669, 3670, 2015, 3511, 3671, 2016, 2018,
-     2018, 2018, 2017, 2019, 2019, 2019, 3514, 2019, 3514, 3672,
-     2019, 3673, 2020, 2020, 2020, 3511, 2018, 3511, 3677, 2008,
-     3678, 3514, 2013, 2021, 2021, 2021, 3675, 3679, 2016, 2020,
-     3511, 3680, 2012, 2022, 2022, 2022, 3681, 2015, 3675, 2017,
-
-     2021, 2023, 2023, 2023, 2024, 2024, 2024, 2027, 2027, 2027,
-     2022, 2027, 3682, 3683, 2027, 2030, 2030, 2030, 3684, 2023,
-     3685, 3687, 2024, 2031, 2031, 2031, 2032, 2032, 2032, 3692,
-     2032, 2021, 2030, 2032, 2035, 2035, 2035, 2036, 2036, 2036,
-     2031, 2037, 2037, 2037, 3693, 2037, 3694, 2022, 2037, 2040,
-     2040, 2040, 2035, 3676, 2041, 2041, 2041, 3695, 2041, 3696,
-     2024, 2041, 2044, 2044, 2044, 3676, 3697, 2040, 2023, 2049,
-     2049, 2049, 2051, 2051, 2051, 2052, 2052, 2052, 3698, 3699,
-     2044, 2053, 2053, 2053, 3703, 2053, 3704, 2049, 2053, 3706,
-     2051, 3708, 2052, 2054, 2054, 2054, 2040, 2055, 2055, 2055,
-
-     3709, 2055, 3710, 3711, 2055, 2059, 2059, 2059, 2061, 2061,
-     2061, 2054, 3712, 2062, 2062, 2062, 3713, 2062, 3714, 2051,
-     2062, 3715, 3716, 2059, 3719, 2061, 2063, 2063, 2063, 3720,
-     2044, 2065, 2065, 2065, 2066, 2066, 2066, 3721, 2066, 3722,
-     3723, 2066, 3724, 2063, 2069, 2069, 2069, 3725, 2065, 2072,
-     2072, 2072, 2054, 2073, 2073, 2073, 2078, 2078, 2078, 3717,
-     2078, 3726, 2069, 2078, 2084, 2084, 2084, 2072, 2085, 2085,
-     2085, 3729, 2059, 2086, 2086, 2086, 3730, 2086, 3731, 3732,
-     2086, 3733, 2084, 3734, 3717, 2085, 2087, 2087, 2087, 2089,
-     2089, 2089, 3735, 2089, 3736, 3737, 2089, 3738, 3739, 2093,
-
-     2093, 2093, 2072, 2093, 2087, 3740, 2093, 2097, 2097, 2097,
-     2099, 2099, 2099, 2101, 2101, 2101, 2084, 2102, 2102, 2102,
-     2103, 2103, 2103, 3743, 3744, 2097, 3745, 3746, 2099, 3747,
-     3748, 2101, 3749, 3750, 2102, 3753, 3754, 2103, 2104, 2104,
-     2104, 2105, 2105, 2105, 2107, 2107, 2107, 2108, 2108, 2108,
-     3755, 2108, 3756, 3757, 2108, 2104, 2109, 2109, 2109, 2105,
-     2109, 2107, 2099, 2109, 3758, 2101, 2112, 2112, 2112, 2097,
-     2114, 2114, 2114, 3759, 2114, 3760, 3761, 2114, 2119, 2119,
-     2119, 2121, 2121, 2121, 2112, 2121, 3762, 2103, 2121, 2105,
-     2124, 2124, 2124, 2125, 2125, 2125, 2119, 2125, 3764, 3763,
-
-     2125, 2126, 2126, 2126, 2128, 2128, 2128, 2124, 2129, 2129,
-     2129, 2130, 2130, 2130, 2112, 2131, 2131, 2131, 3763, 2126,
-     3765, 3766, 2128, 3767, 3768, 2129, 3769, 3770, 2130, 3771,
-     2119, 3772, 2131, 2132, 2132, 2132, 3773, 2137, 2137, 2137,
-     2139, 2139, 2139, 2145, 2145, 2145, 2150, 2150, 2150, 3774,
-     3775, 2132, 3776, 2126, 2137, 2153, 2153, 2153, 2154, 2154,
-     2154, 2155, 2155, 2155, 2157, 2157, 2157, 3777, 3778, 2132,
-     2167, 2167, 2167, 2168, 2168, 2168, 2170, 2170, 2170, 3779,
-     2131, 2175, 2175, 2175, 2176, 2176, 2176, 3780, 2176, 3781,
-     3782, 2176, 2177, 2177, 2177, 2178, 2178, 2178, 2175, 2178,
-
-     3783, 3784, 2178, 2180, 2180, 2180, 2186, 2186, 2186, 2177,
-     2188, 2188, 2188, 3785, 2188, 3786, 3787, 2188, 2193, 2193,
-     2193, 2180, 3788, 3789, 2186, 2191, 2191, 2191, 2194, 2194,
-     2194, 2195, 2195, 2195, 3790, 2193, 3791, 2196, 2196, 2196,
-     3794, 2196, 3795, 2191, 2196, 3796, 2194, 3797, 2195, 2197,
-     2197, 2197, 2198, 2198, 2198, 3798, 2198, 3799, 3800, 2198,
-     2199, 2199, 2199, 2200, 2200, 2200, 2197, 2201, 2201, 2201,
-     2180, 3801, 2202, 2202, 2202, 3803, 2202, 2191, 2199, 2202,
-     3804, 2200, 3806, 3807, 2201, 2203, 2203, 2203, 3808, 3802,
-     2194, 2204, 2204, 2204, 3810, 2204, 3811, 3812, 2204, 2205,
-
-     2205, 2205, 2203, 2206, 2206, 2206, 2207, 2207, 2207, 3802,
-     2207, 3813, 3814, 2207, 2208, 2208, 2208, 2205, 3815, 3816,
-     2206, 2209, 2209, 2209, 3817, 2209, 2199, 3818, 2209, 2200,
-     3819, 2208, 2212, 2212, 2212, 2213, 2213, 2213, 3820, 2213,
-     3821, 3822, 2213, 2214, 2214, 2214, 2215, 2215, 2215, 2212,
-     2215, 3823, 3824, 2215, 2218, 2218, 2218, 2223, 2223, 2223,
-     3825, 2214, 2219, 2219, 2219, 2205, 2219, 3826, 3827, 2219,
-     3828, 2218, 3829, 3830, 2223, 2224, 2224, 2224, 3831, 2224,
-     3832, 3834, 2224, 2225, 2225, 2225, 2228, 2228, 2228, 3835,
-     2228, 3836, 3838, 2228, 3840, 2214, 2231, 2231, 2231, 3841,
-
-     2225, 2232, 2232, 2232, 3843, 2232, 3839, 3844, 2232, 2235,
-     2235, 2235, 3839, 2231, 2236, 2236, 2236, 2239, 2239, 2239,
-     3846, 2240, 2240, 2240, 3847, 2240, 3848, 2235, 2240, 2241,
-     2241, 2241, 2236, 2241, 2239, 3849, 2241, 2246, 2246, 2246,
-     2248, 2248, 2248, 3850, 2249, 2249, 2249, 2250, 2250, 2250,
-     2252, 2252, 2252, 3851, 3853, 2246, 2255, 2255, 2255, 3854,
-     3855, 2235, 2249, 3203, 3857, 2250, 3858, 2252, 2236, 2258,
-     2258, 2258, 3859, 3203, 2255, 2259, 2259, 2259, 3861, 2259,
-     3862, 3863, 2259, 2262, 2262, 2262, 3865, 2258, 2264, 2264,
-     2264, 3203, 2266, 2266, 2266, 3866, 2266, 2252, 2250, 2266,
-
-     3867, 2262, 3203, 2249, 3869, 3870, 2264, 2269, 2269, 2269,
-     2270, 2270, 2270, 3872, 2270, 3873, 3875, 2270, 3877, 2258,
-     3878, 2272, 2272, 2272, 2269, 2272, 3879, 3872, 2272, 3880,
-     2262, 2277, 2277, 2277, 2280, 2280, 2280, 2281, 2281, 2281,
-     2282, 2282, 2282, 2283, 2283, 2283, 2285, 2285, 2285, 2277,
-     3882, 2280, 2290, 2290, 2290, 2281, 2291, 2291, 2291, 3883,
-     2291, 3885, 3886, 2291, 2294, 2294, 2294, 2297, 2297, 2297,
-     2290, 2299, 2299, 2299, 2301, 2301, 2301, 2303, 2303, 2303,
-     3888, 3889, 2294, 3891, 2297, 2304, 2304, 2304, 3892, 2299,
-     3893, 3895, 2301, 3898, 3899, 2303, 2305, 2305, 2305, 2281,
-
-     2305, 3900, 2304, 2305, 2306, 2306, 2306, 2307, 2307, 2307,
-     2308, 2308, 2308, 3901, 2308, 3902, 3903, 2308, 2290, 3904,
-     3905, 2306, 3906, 3907, 2307, 2309, 2309, 2309, 2310, 2310,
-     2310, 2299, 2311, 2311, 2311, 3908, 2311, 3909, 3910, 2311,
-     3911, 3912, 2303, 2309, 3913, 2310, 2314, 2314, 2314, 2318,
-     2318, 2318, 2319, 2319, 2319, 2328, 2328, 2328, 3917, 2328,
-     3919, 3921, 2328, 3922, 2314, 3923, 3924, 2318, 3925, 2319,
-     2331, 2331, 2331, 2332, 2332, 2332, 2333, 2333, 2333, 2309,
-     2335, 2335, 2335, 3926, 3927, 2336, 2336, 2336, 2331, 2336,
-     2332, 3928, 2336, 3936, 2333, 3938, 3940, 2335, 3931, 3942,
-
-     2314, 2337, 2337, 2337, 2338, 2338, 2338, 3955, 2338, 1550,
-     1549, 2338, 2340, 2340, 2340, 3955, 3991, 2331, 2337, 2344,
-     2344, 2344, 2345, 2345, 2345, 3991, 2345, 1538, 1527, 2345,
-     2340, 2346, 2346, 2346, 1522, 3931, 2344, 2352, 2352, 2352,
-     2353, 2353, 2353, 2354, 2354, 2354, 2356, 2356, 2356, 2360,
-     2360, 2360, 2361, 2361, 2361, 2362, 2362, 2362, 2363, 2363,
-     2363, 2366, 2366, 2366, 2371, 2371, 2371, 2372, 2372, 2372,
-     2374, 2374, 2374, 3943, 2340, 2375, 2375, 2375, 2376, 2376,
-     2376, 2379, 2379, 2379, 3932, 2379, 3971, 1521, 2379, 2382,
-     2382, 2382, 3999, 2382, 3944, 3951, 2382, 2386, 2386, 2386,
-
-     2388, 2388, 2388, 1520, 1516, 2363, 2389, 2389, 2389, 2390,
-     2390, 2390, 2391, 2391, 2391, 2386, 3949, 2388, 2392, 2392,
-     2392, 3932, 3943, 2389, 3950, 2376, 2390, 3999, 3971, 2391,
-     2395, 2395, 2395, 2397, 2397, 2397, 2392, 2398, 2398, 2398,
-     3951, 2398, 3952, 3944, 2398, 2399, 2399, 2399, 2395, 2386,
-     2397, 3956, 2400, 2400, 2400, 3956, 2400, 3973, 2389, 2400,
-     2403, 2403, 2403, 2399, 2403, 3949, 3963, 2403, 2406, 2406,
-     2406, 3976, 2391, 3950, 2390, 2407, 2407, 2407, 2408, 2408,
-     2408, 3965, 2408, 1499, 3978, 2408, 2406, 3952, 2406, 2678,
-     2678, 2395, 2678, 2407, 2411, 2411, 2411, 3957, 2411, 3973,
-
-     2678, 2411, 2414, 2414, 2414, 3957, 2399, 2678, 2415, 2415,
-     2415, 2407, 2415, 3976, 3963, 2415, 2418, 2418, 2418, 3959,
-     2414, 2419, 2419, 2419, 4062, 2419, 3978, 3959, 2419, 3965,
-     2420, 2420, 2420, 2418, 2420, 4062, 3960, 2420, 2423, 2423,
-     2423, 2424, 2424, 2424, 3960, 2424, 2414, 3961, 2424, 3958,
-     2430, 2430, 2430, 3958, 2430, 3961, 2423, 2430, 2433, 2433,
-     2433, 2434, 2434, 2434, 3962, 2434, 3964, 3968, 2434, 2437,
-     2437, 2437, 3962, 2437, 3964, 2433, 2437, 2441, 2441, 2441,
-     2442, 2442, 2442, 2443, 2443, 2443, 2446, 2446, 2446, 3967,
-     2446, 3966, 3975, 2446, 2441, 2451, 2451, 2451, 2442, 3966,
-
-     3993, 2443, 2452, 2452, 2452, 2423, 2454, 2454, 2454, 3993,
-     2455, 2455, 2455, 2451, 2455, 3968, 3970, 2455, 1494, 4024,
-     2452, 4060, 1493, 2454, 2460, 2460, 2460, 3967, 3975, 2461,
-     2461, 2461, 2463, 2463, 2463, 4060, 2466, 2466, 2466, 1492,
-     2466, 1487, 2460, 2466, 3969, 2442, 1486, 2461, 3953, 3954,
-     2463, 2451, 3953, 3954, 2452, 2473, 2473, 2473, 2474, 2474,
-     2474, 4024, 2474, 3979, 3970, 2474, 2475, 2475, 2475, 2476,
-     2476, 2476, 2473, 2477, 2477, 2477, 2478, 2478, 2478, 2479,
-     2479, 2479, 3969, 3972, 2475, 2480, 2480, 2480, 2481, 2481,
-     2481, 2460, 2461, 2483, 2483, 2483, 2479, 2482, 2482, 2482,
-
-     3953, 3954, 2480, 3987, 4012, 2481, 2485, 2485, 2485, 3996,
-     3979, 2483, 4012, 3974, 2482, 2486, 2486, 2486, 3996, 2486,
-     4026, 3972, 2486, 2485, 2488, 2488, 2488, 2490, 2490, 2490,
-     3983, 2475, 2493, 2493, 2493, 3977, 3987, 2480, 3981, 2494,
-     2494, 2494, 2488, 2494, 4014, 2490, 2494, 2497, 2497, 2497,
-     2493, 3974, 4014, 2481, 2498, 2498, 2498, 2482, 2498, 2483,
-     4027, 2498, 4026, 4016, 2497, 2499, 2499, 2499, 3983, 2499,
-     3980, 3977, 2499, 2502, 2502, 2502, 2503, 2503, 2503, 2504,
-     2504, 2504, 3982, 2504, 4001, 3981, 2504, 2505, 2505, 2505,
-     3984, 2502, 3995, 2503, 2509, 2509, 2509, 2511, 2511, 2511,
-
-     2512, 2512, 2512, 4027, 2512, 2505, 3980, 2512, 2523, 2523,
-     2523, 4016, 2509, 3986, 2511, 2524, 2524, 2524, 3982, 4001,
-     2525, 2525, 2525, 3985, 2525, 2502, 2523, 2525, 3995, 2526,
-     2526, 2526, 2524, 2526, 3989, 3992, 2526, 3984, 4055, 2505,
-     2529, 2529, 2529, 1473, 2529, 3998, 4055, 2529, 2533, 2533,
-     2533, 2534, 2534, 2534, 3998, 2537, 2537, 2537, 2523, 2537,
-     3986, 3985, 2537, 2540, 2540, 2540, 2533, 3989, 3992, 2534,
-     2541, 2541, 2541, 2542, 2542, 2542, 2546, 2546, 2546, 2547,
-     2547, 2547, 2549, 2549, 2549, 2550, 2550, 2550, 2552, 2552,
-     2552, 2553, 2553, 2553, 2554, 2554, 2554, 2558, 2558, 2558,
-
-     2559, 2559, 2559, 2563, 2563, 2563, 2564, 2564, 2564, 2566,
-     2566, 2566, 2567, 2567, 2567, 4000, 2533, 2572, 2572, 2572,
-     2573, 2573, 2573, 2574, 2574, 2574, 2575, 2575, 2575, 3988,
-     2575, 1472, 3990, 2575, 1471, 2572, 2576, 2576, 2576, 3997,
-     2574, 2577, 2577, 2577, 2578, 2578, 2578, 2579, 2579, 2579,
-     2580, 2580, 2580, 2576, 2581, 2581, 2581, 4015, 2577, 4000,
-     4004, 2578, 2582, 2582, 2582, 3994, 2582, 3988, 2580, 2582,
-     3990, 2581, 2585, 2585, 2585, 3997, 2586, 2586, 2586, 2587,
-     2587, 2587, 2588, 2588, 2588, 2589, 2589, 2589, 4018, 2589,
-     2585, 4015, 2589, 2577, 2586, 4006, 2578, 2587, 3994, 4002,
-
-     2588, 2592, 2592, 2592, 2596, 2596, 2596, 4004, 2596, 1470,
-     1469, 2596, 1468, 2586, 2599, 2599, 2599, 2580, 4003, 2592,
-     2602, 2602, 2602, 4005, 2585, 2603, 2603, 2603, 1467, 2603,
-     4047, 2599, 2603, 2604, 2604, 2604, 4018, 2602, 2605, 2605,
-     2605, 2587, 4006, 4002, 2588, 2611, 2611, 2611, 2612, 2612,
-     2612, 2604, 2613, 2613, 2613, 4008, 2605, 2614, 2614, 2614,
-     4017, 2614, 4003, 2611, 2614, 4047, 2612, 4005, 4010, 2613,
-     2617, 2617, 2617, 2618, 2618, 2618, 2619, 2619, 2619, 2620,
-     2620, 2620, 2621, 2621, 2621, 4040, 4019, 2617, 4021, 4011,
-     2618, 4008, 4049, 2619, 4017, 4019, 2620, 4021, 4007, 2613,
-
-     2621, 2622, 2622, 2622, 4010, 4029, 2611, 2623, 2623, 2623,
-     2628, 2628, 2628, 2629, 2629, 2629, 1466, 2629, 4040, 2622,
-     2629, 2632, 2632, 2632, 2623, 4011, 2617, 4049, 2619, 2633,
-     2633, 2633, 2634, 2634, 2634, 2618, 2636, 2636, 2636, 2632,
-     2635, 2635, 2635, 2621, 2635, 4007, 4009, 2635, 4029, 2634,
-     2637, 2637, 2637, 2636, 2638, 2638, 2638, 2639, 2639, 2639,
-     2640, 2640, 2640, 2644, 2644, 2644, 2622, 2637, 2645, 2645,
-     2645, 2638, 2641, 2641, 2641, 2639, 2641, 2640, 4039, 2641,
-     2644, 2632, 2649, 2649, 2649, 4020, 2645, 2651, 2651, 2651,
-     4041, 2651, 4013, 4009, 2651, 2654, 2654, 2654, 4022, 4066,
-
-     2649, 4023, 2637, 2655, 2655, 2655, 2638, 2655, 4039, 4042,
-     2655, 1456, 4031, 2654, 2658, 2658, 2658, 2662, 2662, 2662,
-     4041, 2662, 4025, 4020, 2662, 2675, 2675, 2675, 4013, 4043,
-     2644, 4048, 2658, 2676, 2676, 2676, 4022, 2676, 4043, 4023,
-     2676, 4066, 4042, 2675, 2680, 2680, 2680, 2681, 2681, 2681,
-     2694, 2694, 2694, 2695, 2695, 2695, 2699, 2699, 2699, 4031,
-     4025, 2658, 2680, 4050, 4048, 2681, 2700, 2700, 2700, 2702,
-     2702, 2702, 2705, 2705, 2705, 2706, 2706, 2706, 2710, 2710,
-     2710, 2713, 2713, 2713, 2715, 2715, 2715, 2675, 2717, 2717,
-     2717, 2718, 2718, 2718, 4102, 2718, 4050, 1455, 2718, 2721,
-
-     2721, 2721, 2715, 4028, 4030, 2722, 2722, 2722, 4102, 2722,
-     2681, 2680, 2722, 2723, 2723, 2723, 2721, 2724, 2724, 2724,
-     2725, 2725, 2725, 2726, 2726, 2726, 2727, 2727, 2727, 4035,
-     2723, 2728, 2728, 2728, 2724, 2728, 4032, 4036, 2728, 4028,
-     4030, 2726, 4037, 2727, 2729, 2729, 2729, 2730, 2730, 2730,
-     2731, 2731, 2731, 2732, 2732, 2732, 2733, 2733, 2733, 2739,
-     2739, 2739, 2729, 1454, 4044, 2730, 1449, 4035, 2731, 1448,
-     4033, 2732, 4034, 4044, 2733, 4036, 2739, 2740, 2740, 2740,
-     4037, 2740, 4057, 4032, 2740, 2743, 2743, 2743, 1447, 2743,
-     4057, 4038, 2743, 2746, 2746, 2746, 2750, 2750, 2750, 2751,
-
-     2751, 2751, 2752, 2752, 2752, 2753, 2753, 2753, 2755, 2755,
-     2755, 2746, 2730, 2750, 2732, 4045, 2751, 4033, 2731, 4034,
-     2752, 4052, 4046, 2753, 4045, 2755, 2756, 2756, 2756, 4038,
-     2756, 4046, 4056, 2756, 2760, 2760, 2760, 2761, 2761, 2761,
-     2762, 2762, 2762, 1446, 2762, 1431, 1430, 2762, 2763, 2763,
-     2763, 2760, 4051, 4054, 2761, 2764, 2764, 2764, 4058, 1413,
-     2752, 2765, 2765, 2765, 4053, 4056, 2763, 2766, 2766, 2766,
-     4052, 2766, 1412, 2764, 2766, 2769, 2769, 2769, 2765, 2770,
-     2770, 2770, 2771, 2771, 2771, 2772, 2772, 2772, 2776, 2776,
-     2776, 4058, 2769, 2773, 2773, 2773, 2770, 2773, 4103, 4051,
-
-     2773, 4059, 4054, 2772, 4063, 2776, 2777, 2777, 2777, 4103,
-     2777, 4053, 1405, 2777, 2778, 2778, 2778, 2764, 2779, 2779,
-     2779, 2780, 2780, 2780, 2782, 2782, 2782, 2787, 2787, 2787,
-     4065, 2778, 2789, 2789, 2789, 2779, 2783, 2783, 2783, 2780,
-     2783, 2782, 4063, 2783, 4061, 2787, 2802, 2802, 2802, 4059,
-     2789, 2814, 2814, 2814, 2833, 2833, 2833, 2834, 2834, 2834,
-     2837, 2837, 2837, 1401, 2802, 2841, 2841, 2841, 4065, 2814,
-     2844, 2844, 2844, 2845, 2845, 2845, 2846, 2846, 2846, 4069,
-     2846, 4074, 1396, 2846, 2849, 2849, 2849, 2850, 2850, 2850,
-     2845, 2850, 4061, 4094, 2850, 2851, 2851, 2851, 1395, 2789,
-
-     4095, 2849, 4094, 2814, 2852, 2852, 2852, 2802, 2852, 4095,
-     4070, 2852, 2851, 2853, 2853, 2853, 2855, 2855, 2855, 4074,
-     2855, 4069, 1390, 2855, 2858, 2858, 2858, 2860, 2860, 2860,
-     4075, 2853, 2861, 2861, 2861, 2862, 2862, 2862, 2865, 2865,
-     2865, 4076, 2858, 1389, 4071, 2860, 4070, 2867, 2867, 2867,
-     2861, 2867, 1388, 2862, 2867, 2865, 2879, 2879, 2879, 2880,
-     2880, 2880, 2881, 2881, 2881, 4072, 2881, 4073, 4075, 2881,
-     2924, 2924, 2924, 2879, 4076, 4080, 2880, 2882, 2882, 2882,
-     4071, 2883, 2883, 2883, 4077, 2883, 4082, 2862, 2883, 2860,
-     2884, 2884, 2884, 4078, 2882, 4081, 2885, 2885, 2885, 2861,
-
-     2885, 4078, 4086, 2885, 2891, 2891, 2891, 4079, 2884, 2892,
-     2892, 2892, 4072, 2892, 4073, 4079, 2892, 4077, 2893, 2893,
-     2893, 2891, 2893, 4080, 4082, 2893, 2896, 2896, 2896, 2898,
-     2898, 2898, 2899, 2899, 2899, 1386, 2899, 4084, 4086, 2899,
-     2903, 2903, 2903, 4081, 2896, 4085, 4098, 2898, 2904, 2904,
-     2904, 2905, 2905, 2905, 1385, 2905, 4083, 2903, 2905, 2906,
-     2906, 2906, 2907, 2907, 2907, 2904, 2907, 4090, 4088, 2907,
-     2908, 2908, 2908, 2910, 2910, 2910, 2906, 2910, 4091, 4084,
-     2910, 2913, 2913, 2913, 2915, 2915, 2915, 4085, 2908, 2914,
-     2914, 2914, 2898, 2914, 4083, 4098, 2914, 4087, 2913, 1380,
-
-     1377, 2915, 2916, 2916, 2916, 4090, 2916, 1376, 4089, 2916,
-     2917, 2917, 2917, 1373, 2917, 4088, 4091, 2917, 2921, 2921,
-     2921, 2922, 2922, 2922, 2923, 2923, 2923, 2925, 2925, 2925,
-     2936, 2936, 2936, 4087, 4092, 2921, 4093, 4096, 2922, 2949,
-     2949, 2949, 2923, 1372, 2925, 2950, 2950, 2950, 2936, 2967,
-     2967, 2967, 2969, 2969, 2969, 4089, 2949, 2973, 2973, 2973,
-     2977, 2977, 2977, 2950, 2978, 2978, 2978, 4092, 2978, 4093,
-     4096, 2978, 2979, 2979, 2979, 1371, 2979, 2977, 1370, 2979,
-     2982, 2982, 2982, 4097, 2982, 4100, 4101, 2982, 2985, 2985,
-     2985, 2936, 2986, 2986, 2986, 1369, 2923, 2987, 2987, 2987,
-
-     2989, 2989, 2989, 2990, 2990, 2990, 2985, 2991, 2991, 2991,
-     2986, 2991, 1368, 1367, 2991, 2987, 4097, 2989, 4100, 4101,
-     2990, 2992, 2992, 2992, 3004, 3004, 3004, 3005, 3005, 3005,
-     1366, 3005, 4099, 2987, 3005, 3006, 3006, 3006, 2992, 3006,
-     1365, 3004, 3006, 1364, 2986, 3009, 3009, 3009, 1363, 3009,
-     1362, 1361, 3009, 3012, 3012, 3012, 2985, 3015, 3015, 3015,
-     3017, 3017, 3017, 1360, 3017, 1359, 1358, 3017, 3026, 3026,
-     3026, 3012, 1357, 1356, 3015, 3028, 3028, 3028, 3029, 3029,
-     3029, 4099, 3029, 1355, 1352, 3029, 3026, 3030, 3030, 3030,
-     1351, 3030, 3028, 1350, 3030, 3033, 3033, 3033, 1349, 3033,
-
-     1348, 1346, 3033, 3036, 3036, 3036, 1345, 3036, 1344, 1343,
-     3036, 3039, 3039, 3039, 1342, 3039, 1341, 1340, 3039, 3049,
-     3049, 3049, 3050, 3050, 3050, 1339, 3050, 1338, 1337, 3050,
-     3051, 3051, 3051, 3052, 3052, 3052, 3049, 3052, 1336, 1335,
-     3052, 3053, 3053, 3053, 3054, 3054, 3054, 3051, 3055, 3055,
-     3055, 3056, 3056, 3056, 1334, 3056, 1333, 1332, 3056, 3053,
-     3067, 3067, 3067, 1326, 1322, 3055, 3080, 3080, 3080, 3081,
-     3081, 3081, 1319, 3081, 1318, 1317, 3081, 1315, 3067, 3082,
-     3082, 3082, 1311, 3080, 3086, 3086, 3086, 3100, 3100, 3100,
-     3102, 3102, 3102, 3105, 3105, 3105, 1302, 3082, 3107, 3107,
-
-     3107, 3086, 3086, 1297, 3053, 1296, 3109, 3109, 3109, 1295,
-     3109, 1291, 3067, 3109, 3116, 3116, 3116, 3117, 3117, 3117,
-     3118, 3118, 3118, 3120, 3120, 3120, 3121, 3121, 3121, 1290,
-     3121, 1287, 3116, 3121, 1283, 3117, 1282, 1279, 3118, 1276,
-     3120, 3122, 3122, 3122, 1273, 3122, 1272, 1267, 3122, 3125,
-     3125, 3125, 3126, 3126, 3126, 1259, 3126, 1258, 1257, 3126,
-     3138, 3138, 3138, 1255, 3138, 1251, 3125, 3138, 3142, 3142,
-     3142, 3143, 3143, 3143, 1248, 3143, 1243, 1242, 3143, 1241,
-     1240, 3116, 3118, 1239, 1238, 3142, 3151, 3151, 3151, 3154,
-     3154, 3154, 1237, 3154, 1236, 1235, 3154, 3169, 3169, 3169,
-
-     1232, 3170, 3170, 3170, 3151, 3170, 1231, 1228, 3170, 3173,
-     3173, 3173, 1227, 3173, 3169, 1223, 3173, 3176, 3176, 3176,
-     3177, 3177, 3177, 1221, 3177, 1218, 1217, 3177, 3188, 3188,
-     3188, 1214, 3201, 3201, 3201, 3176, 3201, 1207, 1204, 3201,
-     3205, 3205, 3205, 3206, 3206, 3206, 3188, 3207, 3207, 3207,
-     1203, 3207, 1202, 1199, 3207, 1196, 1189, 3205, 3205, 1185,
-     3206, 3206, 3220, 3220, 3220, 3207, 3222, 3222, 3222, 3176,
-     3223, 3223, 3223, 3224, 3224, 3224, 1184, 1183, 3188, 3226,
-     3226, 3226, 3227, 3227, 3227, 3240, 3240, 3240, 3241, 3241,
-     3241, 3243, 3243, 3243, 3245, 3245, 3245, 1180, 3245, 1179,
-
-     1178, 3245, 1171, 3240, 1170, 1169, 3241, 1168, 1167, 3243,
-     3248, 3248, 3248, 1166, 3248, 1165, 1164, 3248, 3251, 3251,
-     3251, 3262, 3262, 3262, 3263, 3263, 3263, 1163, 3263, 1159,
-     1128, 3263, 3266, 3266, 3266, 3251, 1125, 3240, 3262, 3286,
-     3286, 3286, 1122, 3287, 3287, 3287, 1121, 3287, 1118, 3266,
-     3287, 3296, 3296, 3296, 1117, 1116, 3286, 1115, 1114, 3243,
-     3305, 3305, 3305, 3327, 3327, 3327, 3328, 3328, 3328, 3296,
-     3328, 1113, 1106, 3328, 1105, 3329, 3329, 3329, 3305, 3329,
-     3327, 3327, 3329, 1104, 3328, 3340, 3340, 3340, 3342, 3342,
-     3342, 1103, 1101, 3329, 3343, 3343, 3343, 3345, 3345, 3345,
-
-     3358, 3358, 3358, 3359, 3359, 3359, 3361, 3361, 3361, 3362,
-     3362, 3362, 1100, 3362, 1098, 1097, 3362, 1096, 3358, 1095,
-     1094, 3359, 1093, 3361, 3363, 3363, 3363, 3305, 3330, 3330,
-     3330, 3330, 3330, 3330, 3330, 3330, 3330, 1092, 1091, 3330,
-     1090, 3363, 1089, 1088, 3330, 3330, 3330, 3330, 3330, 3373,
-     3373, 3373, 3374, 3374, 3374, 1087, 3374, 1085, 1084, 3374,
-     3376, 3376, 3376, 1083, 3376, 1082, 3373, 3376, 1081, 1080,
-     3359, 3375, 3375, 3375, 3330, 3330, 3331, 3331, 3331, 3331,
-     3331, 3331, 3331, 3331, 3331, 1079, 1078, 3331, 3375, 3405,
-     3405, 3405, 3331, 3331, 3331, 3331, 3331, 3394, 3394, 3394,
-
-     1077, 3394, 1075, 1074, 3394, 1073, 1072, 3405, 3413, 3413,
-     3413, 3431, 3431, 3431, 1071, 3431, 1070, 1069, 3431, 3442,
-     3442, 3442, 3331, 3331, 1068, 1067, 3413, 1066, 1062, 3431,
-     3434, 3434, 3434, 3434, 3434, 3434, 3434, 3434, 3434, 1058,
-     1057, 3434, 3443, 3443, 3443, 1056, 3434, 3434, 3434, 3434,
-     3434, 3456, 3456, 3456, 3458, 3458, 3458, 3460, 3460, 3460,
-     1055, 3460, 1054, 1050, 3460, 3544, 3544, 3544, 1048, 3456,
-     1047, 1046, 3458, 3463, 3463, 3463, 3434, 3434, 3435, 3435,
-     3435, 3435, 3435, 3435, 3435, 3435, 3435, 1045, 1044, 3435,
-     3463, 3545, 3545, 3545, 3435, 3435, 3435, 3435, 3435, 1043,
-
-     3464, 3464, 3464, 1042, 3464, 1038, 3458, 3464, 3472, 3472,
-     3472, 1037, 3472, 1033, 1032, 3472, 3475, 3475, 3475, 1031,
-     3475, 1030, 1027, 3475, 3435, 3435, 3509, 3509, 3509, 3531,
-     3531, 3531, 3552, 3552, 3552, 3553, 3553, 3553, 3558, 3558,
-     3558, 1026, 3558, 1024, 3509, 3558, 1022, 3531, 3531, 1019,
-     3552, 1018, 3553, 3565, 3565, 3565, 3570, 3570, 3570, 3601,
-     3601, 3601, 3605, 3605, 3605, 3618, 3618, 3618, 1017, 1016,
-     3565, 1014, 1011, 3570, 3620, 3620, 3620, 3601, 1010, 1008,
-     3605, 1007, 1004, 3618, 1002, 3621, 3621, 3621,  999, 3621,
-      998, 3620, 3621, 3634, 3634, 3634, 3635, 3635, 3635,  997,
-
-     3635,  996,  993, 3635, 3644, 3644, 3644, 3662, 3662, 3662,
-     3634, 3645, 3645, 3645, 3605, 3645,  992,  991, 3645,  990,
-      989, 3644, 3674, 3674, 3674, 3662, 3674,  988,  987, 3674,
-     3689, 3689, 3689,  985, 3689,  982,  981, 3689, 3700, 3700,
-     3700,  977, 3700,  976, 3662, 3700, 3897, 3897, 3897, 3914,
-     3914, 3914,  975, 3914,  974,  973, 3914, 4064, 4064, 4064,
-     4067, 4067, 4067,  972, 3897,  963,  962, 3914, 4104, 4104,
-     4104, 4105, 4105, 4105,  959, 4064,  958,  957, 4067,  956,
-      955,  953,  952,  951,  948,  947, 4104,  946,  943, 4105,
-     4108, 4108, 4108, 4108, 4108, 4108, 4108, 4108, 4108, 4109,
-
-     4109, 4109, 4109, 4109, 4109, 4109, 4109, 4109, 4110, 4110,
-     4110, 4110, 4110, 4110, 4110, 4110, 4110, 4111, 4111, 4111,
-     4111, 4111, 4111, 4111, 4111, 4111, 4112, 4112, 4112, 4112,
-     4112, 4112, 4112, 4112, 4112, 4113, 4113, 4113, 4113, 4113,
-     4113, 4113, 4113, 4113, 4114, 4114, 4114, 4114, 4114, 4114,
-     4114, 4114, 4114, 4115, 4115, 4115, 4115, 4115, 4115, 4115,
-     4115, 4115, 4116, 4116, 4116, 4116, 4116, 4116, 4116, 4116,
-     4116, 4117, 4117, 4117, 4117, 4117, 4117, 4117, 4117, 4117,
-     4118, 4118, 4118, 4118, 4118, 4118, 4118, 4118, 4118, 4119,
-     4119, 4119, 4119, 4119, 4119, 4119, 4119, 4119, 4120, 4120,
-
-     4120, 4120, 4120, 4120, 4120, 4120, 4120, 4121, 4121, 4121,
-     4121, 4121, 4121, 4121, 4121, 4121, 4122, 4122, 4122, 4122,
-     4122, 4122, 4122, 4122, 4122, 4123, 4123, 4123, 4123, 4123,
-     4123, 4123, 4123, 4123, 4124, 4124, 4124, 4124, 4124, 4124,
-     4124, 4124, 4124, 4125, 4125, 4125, 4125, 4125, 4125, 4125,
-     4125, 4125, 4126, 4126, 4126, 4126, 4126, 4126, 4126, 4126,
-     4126, 4127, 4127, 4127, 4127, 4127, 4127, 4127, 4127, 4127,
-     4128, 4128, 4128, 4128, 4128, 4128, 4128, 4128, 4128, 4129,
-     4129, 4129, 4129, 4129, 4129, 4129, 4129, 4129, 4130, 4130,
-     4130, 4130, 4130, 4130, 4130, 4130, 4130, 4131, 4131, 4131,
-
-     4131, 4131, 4131, 4131, 4131, 4131, 4132, 4132, 4132, 4132,
-     4132, 4132, 4132, 4132, 4132, 4133, 4133, 4133, 4133, 4133,
-     4133, 4133, 4133, 4133, 4134, 4134, 4134, 4134, 4134, 4134,
-     4134, 4134, 4134, 4135, 4135, 4135, 4135, 4135, 4135, 4135,
-     4135, 4135, 4136, 4136, 4136, 4136, 4136, 4136, 4136, 4136,
-     4136, 4137, 4137, 4137, 4137, 4137, 4137, 4137, 4137, 4137,
-     4138, 4138, 4138, 4138, 4138, 4138, 4138, 4138, 4138, 4139,
-     4139, 4139, 4139, 4139, 4139, 4139, 4139, 4139, 4140, 4140,
-     4140, 4140, 4140, 4140, 4140, 4140, 4140, 4141, 4141, 4141,
-     4141, 4141, 4141, 4141, 4141, 4141, 4142, 4142, 4142, 4142,
-
-     4142, 4142, 4142, 4142, 4142, 4143, 4143, 4143, 4143, 4143,
-     4143, 4143, 4143, 4143, 4144, 4144, 4144, 4144, 4144, 4144,
-     4144, 4144, 4144, 4145, 4145, 4145, 4145, 4145, 4145, 4145,
-     4145, 4145, 4146, 4146, 4146, 4146, 4146, 4146, 4146, 4146,
-     4146, 4147, 4147, 4147, 4147, 4147, 4147, 4147, 4147, 4147,
-     4148, 4148, 4148, 4148, 4148, 4148, 4148, 4148, 4148, 4149,
-     4149, 4149, 4149, 4149, 4149, 4149, 4149, 4149, 4150, 4150,
-     4150, 4150, 4150, 4150, 4150, 4150, 4150, 4151, 4151, 4151,
-     4151, 4151, 4151, 4151, 4151, 4151, 4152, 4152, 4152, 4152,
-     4152, 4152, 4152, 4152, 4152, 4153, 4153, 4153, 4153, 4153,
-
-     4153, 4153, 4153, 4153, 4154, 4154, 4154, 4154, 4154, 4154,
-     4154, 4154, 4154, 4155, 4155, 4155, 4155, 4155, 4155, 4155,
-     4155, 4155, 4156, 4156, 4156, 4156, 4156, 4156, 4156, 4156,
-     4156, 4157, 4157, 4157, 4157, 4157, 4157, 4157, 4157, 4157,
-     4158, 4158, 4158, 4158, 4158, 4158, 4158, 4158, 4158, 4159,
-     4159, 4159, 4159, 4159, 4159, 4159, 4159, 4159, 4160, 4160,
-     4160, 4160, 4160, 4160, 4160, 4160, 4160, 4161, 4161, 4161,
-     4161, 4161, 4161, 4161, 4161, 4161, 4162, 4162, 4162, 4162,
-     4162, 4162, 4162, 4162, 4162, 4163, 4163, 4163, 4163, 4163,
-     4163, 4163, 4163, 4163, 4164, 4164, 4164, 4164, 4164, 4164,
-
-     4164, 4164, 4164, 4165, 4165, 4165, 4165, 4165, 4165, 4165,
-     4165, 4165, 4166, 4166, 4166, 4166, 4166, 4166, 4166, 4166,
-     4166, 4167, 4167, 4167, 4167, 4167, 4167, 4167, 4167, 4167,
-     4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4168, 4169,
-     4169, 4169, 4169, 4169, 4169, 4169, 4169, 4169, 4170, 4170,
-     4170, 4170, 4170, 4170, 4170, 4170, 4170, 4171, 4171, 4171,
-     4171, 4171, 4171, 4171, 4171, 4171, 4172, 4172, 4172, 4172,
-     4172, 4172, 4172, 4172, 4172, 4173, 4173, 4173, 4173, 4173,
-     4173, 4173, 4173, 4173, 4174, 4174, 4174, 4174, 4174, 4174,
-     4174, 4174, 4174, 4175, 4175, 4175, 4175, 4175, 4175, 4175,
-
-     4175, 4175, 4176, 4176, 4176, 4176, 4176, 4176, 4176, 4176,
-     4176, 4177, 4177, 4177,  942,  938,  936, 4177, 4178, 4178,
-     4178,  933,  932,  931, 4178, 4179, 4179, 4179,  930,  928,
-      925, 4179, 4180, 4180, 4180,  924,  921,  918, 4180, 4181,
-     4181, 4181,  915,  914,  913, 4181, 4182, 4182, 4182,  912,
-      911,  908, 4182, 4183, 4183, 4183,  905,  901,  900, 4183,
-     4184, 4184, 4184,  899,  898,  897, 4184, 4185, 4185, 4185,
-      896,  895,  894, 4185, 4186, 4186, 4186,  893,  892,  891,
-     4186, 4187, 4187, 4187,  889,  887,  884, 4187, 4188, 4188,
-     4188,  883,  882,  881, 4188, 4189, 4189, 4189,  880,  879,
-
-      874, 4189, 4190, 4190, 4190,  873,  872,  871, 4190, 4191,
-     4191, 4191,  868,  867,  866, 4191, 4192, 4192, 4192,  863,
-      862,  861, 4192, 4193, 4193, 4193,  860,  857,  856, 4193,
-     4194, 4194, 4194,  854,  851,  850, 4194, 4195, 4195, 4195,
-      846,  845,  844, 4195, 4196, 4196, 4196,  843,  842,  841,
-     4196, 4197, 4197, 4197,  838,  837,  836, 4197, 4198, 4198,
-     4198,  835,  834,  833, 4198, 4199, 4199, 4199,  824,  822,
-      821, 4199, 4200, 4200, 4200,  818,  817,  816, 4200, 4201,
-     4201, 4201,  815,  812,  811, 4201, 4202, 4202, 4202,  810,
-      807,  805, 4202, 4203, 4203, 4203,  804,  803,  800, 4203,
-
-     4204, 4204, 4204,  799,  798,  797, 4204, 4205, 4205, 4205,
-      793,  792,  791, 4205, 4206, 4206, 4206,  787,  786,  785,
-     4206, 4207, 4207, 4207,  784,  778,  777, 4207, 4208, 4208,
-     4208, 4208, 4208, 4208, 4208,  775, 4208, 4209, 4209, 4209,
-      767,  766,  762, 4209, 4210,  754,  752,  748, 4210, 4211,
-     4211, 4211,  747,  743,  737, 4211, 4212,  736,  735,  731,
-     4212, 4213, 4213, 4213,  728,  726,  725, 4213, 4214,  724,
-      720,  716, 4214, 4215, 4215, 4215,  712,  711,  710, 4215,
-     4216,  709,  705,  701, 4216, 4217, 4217, 4217,  698,  697,
-      696, 4217, 4218,  695,  691,  685, 4218, 4219, 4219, 4219,
-
-      684,  680,  672, 4219, 4220,  668,  661,  659, 4220, 4221,
-     4221, 4221,  658,  654,  648, 4221, 4222,  647,  643,  636,
-     4222, 4223, 4223, 4223,  635,  634,  633, 4223, 4224,  632,
-      628,  617, 4224, 4225, 4225, 4225,  613,  605,  604, 4225,
-     4226,  603,  602,  601, 4226, 4227, 4227, 4227,  597,  591,
-      590, 4227, 4228,  586,  580,  579, 4228, 4229, 4229, 4229,
-      575,  569,  568, 4229, 4230,  564,  560,  556, 4230, 4231,
-     4231, 4231,  555,  554,  550, 4231, 4232,  542,  538,  532,
-     4232, 4233, 4233, 4233,  531,  530,  526, 4233, 4234,  522,
-      517,  516, 4234, 4235, 4235, 4235,  515,  514,  510, 4235,
-
-     4236,  506,  503,  499, 4236, 4237, 4237, 4237,  495,  492,
-      489, 4237, 4238,  487,  486,  481, 4238, 4239, 4239, 4239,
-      474,  473,  472, 4239, 4240,  471,  470,  466, 4240, 4241,
-     4241, 4241,  459,  458,  457, 4241, 4242,  453,  446,  445,
-     4242, 4243, 4243, 4243,  441,  434,  433, 4243, 4244,  432,
-      428,  422, 4244, 4245, 4245, 4245,  421,  420,  416, 4245,
-     4246,  410,  406,  402, 4246, 4247, 4247, 4247,  398,  397,
-      396, 4247, 4248,  395,  394,  390, 4248, 4249, 4249, 4249,
-      381,  380,  376, 4249, 4250,  372,  367,  361, 4250, 4251,
-     4251, 4251,  357,  356,  352, 4251, 4252,  349,  348,  347,
-
-     4252, 4253, 4253, 4253,  341,  340,  338, 4253, 4254,  335,
-      323,    0, 4254, 4255, 4255, 4255,    0,    0,    0, 4255,
-     4256,    0,    0,    0, 4256, 4257, 4257, 4257,    0,    0,
-        0, 4257, 4258,    0,    0,    0, 4258, 4259, 4259, 4259,
-        0,    0,    0, 4259, 4260,    0,    0,    0, 4260, 4261,
-     4261, 4261,    0,    0,    0, 4261, 4262,    0,    0,    0,
-     4262, 4263, 4263, 4263,    0,    0,    0, 4263, 4264,    0,
-        0,    0, 4264, 4265, 4265, 4265,    0,    0,    0, 4265,
-     4266,    0,    0,    0, 4266, 4267, 4267, 4267,    0,    0,
-        0, 4267, 4268,    0,    0,    0, 4268, 4269, 4269, 4269,
-
-        0,    0,    0, 4269, 4270,    0,    0,    0, 4270, 4271,
-     4271, 4271, 4271, 4271, 4271, 4271, 4271, 4271, 4272,    0,
-        0,    0,    0, 4272, 4273, 4273, 4273,    0,    0,    0,
-     4273, 4274, 4274, 4274, 4274,    0,    0, 4274, 4274, 4275,
-     4275, 4275, 4275,    0, 4275,    0, 4275, 4276, 4276, 4276,
-     4276,    0,    0, 4276, 4276, 4277, 4277, 4277,    0,    0,
-        0, 4277, 4278, 4278, 4278, 4278,    0,    0, 4278, 4278,
-     4279, 4279, 4279,    0,    0,    0, 4279, 4280, 4280, 4280,
-     4280,    0,    0, 4280, 4280, 4281, 4281, 4281,    0,    0,
-        0, 4281, 4282, 4282, 4282, 4282,    0,    0, 4282, 4282,
-
-     4283, 4283, 4283, 4283,    0, 4283,    0, 4283, 4284, 4284,
-     4284, 4284,    0,    0, 4284, 4284, 4285, 4285, 4285, 4285,
-        0, 4285,    0, 4285, 4286, 4286, 4286, 4286,    0,    0,
-     4286, 4286, 4287, 4287, 4287, 4287,    0, 4287,    0, 4287,
-     4288, 4288, 4288, 4288,    0,    0, 4288, 4288, 4289, 4289,
-     4289, 4289,    0, 4289,    0, 4289, 4290, 4290, 4290, 4290,
-        0,    0, 4290, 4290, 4291, 4291, 4291,    0,    0,    0,
-     4291, 4292, 4292, 4292, 4292,    0,    0, 4292, 4292, 4293,
-     4293, 4293, 4293,    0,    0, 4293, 4293, 4294, 4294, 4294,
-        0,    0,    0, 4294, 4295, 4295, 4295, 4295,    0,    0,
-
-     4295, 4295, 4296, 4296, 4296,    0,    0,    0, 4296, 4297,
-     4297, 4297, 4297,    0,    0, 4297, 4297, 4298, 4298, 4298,
-        0,    0,    0, 4298, 4299, 4299, 4299, 4299,    0,    0,
-     4299, 4299, 4300, 4300, 4300,    0,    0,    0, 4300, 4301,
-     4301, 4301, 4301,    0,    0, 4301, 4301, 4302, 4302, 4302,
-        0,    0,    0, 4302, 4303, 4303, 4303, 4303,    0,    0,
-     4303, 4303, 4304, 4304, 4304,    0,    0,    0, 4304, 4305,
-     4305, 4305, 4305,    0,    0, 4305, 4305, 4306, 4306, 4306,
-        0,    0,    0, 4306, 4307, 4307, 4307, 4307,    0,    0,
-     4307, 4307, 4308, 4308, 4308,    0,    0,    0, 4308, 4309,
-
-     4309, 4309, 4309,    0,    0, 4309, 4309, 4310, 4310, 4310,
-        0,    0,    0, 4310, 4311, 4311, 4311, 4311,    0,    0,
-     4311, 4311, 4312, 4312, 4312,    0,    0,    0, 4312, 4313,
-     4313, 4313, 4313,    0,    0, 4313, 4313, 4314, 4314, 4314,
-        0,    0,    0, 4314, 4315, 4315, 4315, 4315,    0,    0,
-     4315, 4315, 4316, 4316, 4316,    0,    0,    0, 4316, 4317,
-     4317, 4317, 4317,    0,    0, 4317, 4317, 4318, 4318, 4318,
-     4318,    0, 4318,    0, 4318, 4319, 4319, 4319, 4319,    0,
-        0, 4319, 4319, 4320, 4320, 4320,    0,    0,    0, 4320,
-     4321, 4321, 4321, 4321,    0,    0, 4321, 4321, 4322, 4322,
-
-     4322,    0,    0,    0, 4322, 4323, 4323, 4323, 4323,    0,
-        0, 4323, 4323, 4324, 4324, 4324,    0,    0,    0, 4324,
-     4325, 4325, 4325, 4325,    0,    0, 4325, 4325, 4326, 4326,
-     4326,    0,    0,    0, 4326, 4327, 4327, 4327, 4327,    0,
-        0, 4327, 4327, 4328, 4328, 4328,    0,    0,    0, 4328,
-     4329, 4329, 4329, 4329,    0,    0, 4329, 4329, 4330, 4330,
-     4330,    0,    0,    0, 4330, 4331, 4331, 4331, 4331,    0,
-        0, 4331, 4331, 4332, 4332, 4332, 4332,    0, 4332,    0,
-     4332, 4333, 4333, 4333, 4333,    0,    0, 4333, 4333, 4334,
-     4334, 4334, 4334, 4334, 4334, 4334, 4334, 4334, 4335,    0,
-
-     4335,    0,    0, 4335, 4336, 4336, 4336,    0,    0,    0,
-     4336, 4337, 4337, 4337, 4337,    0,    0, 4337, 4337, 4338,
-     4338, 4338,    0,    0,    0, 4338, 4339, 4339, 4339, 4339,
-        0,    0, 4339, 4339, 4340, 4340, 4340,    0,    0,    0,
-     4340, 4341, 4341, 4341, 4341,    0,    0, 4341, 4341, 4342,
-     4342, 4342,    0,    0,    0, 4342, 4343, 4343, 4343, 4343,
-        0,    0, 4343, 4343, 4344, 4344, 4344,    0,    0,    0,
-     4344, 4345, 4345, 4345, 4345,    0,    0, 4345, 4345, 4346,
-     4346, 4346,    0,    0,    0, 4346, 4347, 4347, 4347, 4347,
-        0,    0, 4347, 4347, 4348, 4348, 4348, 4348,    0,    0,
-
-     4348, 4348, 4349, 4349, 4349,    0,    0,    0, 4349, 4350,
-     4350, 4350, 4350,    0,    0, 4350, 4350, 4351, 4351, 4351,
-        0,    0,    0, 4351, 4352, 4352, 4352, 4352,    0,    0,
-     4352, 4352, 4353, 4353, 4353,    0,    0,    0, 4353, 4354,
-     4354, 4354, 4354,    0,    0, 4354, 4354, 4355, 4355, 4355,
-     4355,    0,    0, 4355, 4355, 4356, 4356, 4356,    0,    0,
-        0, 4356, 4357, 4357, 4357, 4357,    0,    0, 4357, 4357,
-     4358, 4358, 4358, 4358,    0, 4358,    0, 4358, 4359, 4359,
-     4359, 4359,    0,    0, 4359, 4359, 4360, 4360, 4360, 4360,
-        0, 4360,    0, 4360, 4361, 4361, 4361, 4361,    0,    0,
-
-     4361, 4361, 4362, 4362, 4362,    0,    0,    0, 4362, 4363,
-     4363, 4363, 4363,    0,    0, 4363, 4363, 4364, 4364, 4364,
-        0,    0,    0, 4364, 4365, 4365, 4365, 4365,    0,    0,
-     4365, 4365, 4366, 4366, 4366,    0,    0,    0, 4366, 4367,
-     4367, 4367, 4367,    0,    0, 4367, 4367, 4368, 4368, 4368,
-     4368,    0, 4368,    0, 4368, 4369, 4369, 4369, 4369,    0,
-        0, 4369, 4369, 4370, 4370, 4370,    0,    0,    0, 4370,
-     4371, 4371, 4371, 4371,    0,    0, 4371, 4371, 4372, 4372,
-     4372,    0,    0,    0, 4372, 4373, 4373, 4373, 4373,    0,
-        0, 4373, 4373, 4374, 4374, 4374,    0,    0,    0, 4374,
-
-     4375, 4375, 4375, 4375,    0,    0, 4375, 4375, 4376, 4376,
-     4376,    0,    0,    0, 4376, 4377, 4377, 4377, 4377,    0,
-        0, 4377, 4377, 4378, 4378, 4378,    0,    0,    0, 4378,
-     4379, 4379, 4379, 4379,    0,    0, 4379, 4379, 4380, 4380,
-     4380,    0,    0,    0, 4380, 4381, 4381, 4381, 4381,    0,
-        0, 4381, 4381, 4382, 4382, 4382,    0,    0,    0, 4382,
+     2890,  265,  265,  265,  265,  265, 1152, 1142, 1144, 1144,
+     1144, 1155, 1155, 1155, 2895, 1156, 1156, 1156, 2891, 1161,
+     1161, 1161, 1165, 1165, 1165, 2816, 1144, 2816, 2183, 1155,
+     2892,  265,  265, 1156, 2183, 2896,  265, 1161, 2183, 1165,
+     2816, 2890,  265, 2897, 2183, 1144,  265, 1994, 1994, 1994,
+
+     2898, 2899,  265,  266,  266,  266,  266,  266,  266,  266,
+      266,  266,  266,  266,  266,  266,  266,  266, 2900,  266,
+      266,  266,  266,  266, 2892, 2901, 1166, 1166, 1166, 2902,
+     1156, 2903, 2904, 1167, 1167, 1167, 2905, 2906, 1162, 1162,
+     1162, 1164, 1164, 1164, 1166, 1168, 1168, 1168, 2907,  266,
+      266, 1167, 2910, 2817,  266, 2817, 1162, 2911, 1164, 2913,
+      266, 2914, 1168, 2915,  266, 1997, 1997, 1997, 2817, 2917,
+      266,  275,  275,  275,  275,  275,  275,  275,  275,  275,
+      275,  275,  275,  275,  275,  275, 1162,  275,  275,  275,
+      275,  275, 1164, 1169, 1169, 1169, 1170, 1170, 1170, 2918,
+
+     2938, 1171, 1171, 1171, 2939, 1167, 2941, 1164, 2945, 2946,
+     1169, 1175, 1175, 1175, 1170, 2947, 2949,  275,  275, 1171,
+     1286, 1286, 1286, 2948, 1286,  275, 2950, 1286,  275, 1175,
+     1998, 1998, 1998, 2952, 2948,  275,  276,  276,  276,  276,
+      276,  276,  276,  276,  276,  276,  276,  276,  276,  276,
+      276, 2953,  276,  276,  276,  276,  276, 1172, 1172, 1172,
+     2963, 1174, 1174, 1174, 2964, 2965, 1176, 1176, 1176, 1177,
+     1177, 1177, 2977, 1171, 1172, 1173, 1173, 1173, 1174, 1179,
+     1179, 1179,  276,  276, 1176, 2995, 1177, 1292, 1292, 1292,
+      276, 1292, 1173,  276, 1292, 3001, 1179, 2001, 2001, 2001,
+
+      276,  279,  279,  279,  279,  279,  279,  279,  279,  279,
+      279,  279,  279,  279,  279,  279, 3002,  279,  279,  279,
+      279,  279, 1181, 1181, 1181, 3003, 1173, 1186, 1186, 1186,
+     3004, 3005, 1182, 1182, 1182, 1183, 1183, 1183, 1176, 1181,
+     2951, 1173, 1184, 1184, 1184, 1186, 3006,  279,  279, 1182,
+     3007, 2951, 1183, 3008,  279, 2003, 2003, 2003, 3009, 1184,
+      279, 1308, 1308, 1308, 3010, 1308, 3012, 3013, 1308,  279,
+      280,  280,  280,  280,  280,  280,  280,  280,  280,  280,
+      280,  280,  280,  280,  280, 1182,  280,  280,  280,  280,
+      280, 1183, 3014, 3015, 1184, 2006, 2006, 2006, 1189, 1189,
+
+     1189, 1185, 1185, 1185, 1192, 1192, 1192, 1194, 1194, 1194,
+     3016, 3017, 1187, 1187, 1187, 1189,  280,  280, 1185, 3018,
+     2003, 1192, 3019,  280, 1194, 2008, 2008, 2008, 3020,  280,
+     1187, 2005, 2005, 2005, 2014, 2014, 2014, 3021,  280,  283,
+      283,  283,  283,  283,  283,  283,  283,  283,  283,  283,
+      283,  283,  283,  283, 1185,  283,  283,  283,  283,  283,
+     1187, 1204, 1204, 1204, 1206, 1206, 1206, 3022, 3023, 1205,
+     1205, 1205, 1208, 1208, 1208, 1209, 1209, 1209, 2005, 1204,
+     3029, 1206, 1210, 1210, 1210,  283,  283, 1205, 2969, 3030,
+     1208, 3026, 3027, 1209, 3031, 3032,  283, 3033, 2969, 1210,
+
+     2017, 2017, 2017, 3034, 2969,  283,  284,  284,  284,  284,
+      284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
+      284, 3026,  284,  284,  284,  284,  284, 3028, 1205, 1214,
+     1214, 1214, 1215, 1215, 1215, 3027, 3035, 1209, 1219, 1219,
+     1219, 1224, 1224, 1224, 1225, 1225, 1225, 1214, 3036, 3037,
+     1215, 2970,  284,  284, 3038, 1219, 2018, 2018, 2018, 1224,
+     3039, 2970, 1225,  284, 1314, 1314, 1314, 2970, 1314, 3040,
+     3028, 1314,  284,  321,  321,  321,  321,  321,  321,  321,
+      321,  321,  321,  321,  321,  321,  321,  321, 1215,  321,
+      321,  321,  321,  321, 1229, 1229, 1229, 1231, 1231, 1231,
+
+     1233, 1233, 1233, 1234, 1234, 1234, 1225, 3041, 1236, 1236,
+     1236, 1229, 3043, 3045, 1231, 1237, 1237, 1237, 1233,  321,
+      321, 1234, 1239, 1239, 1239,  321, 1236, 3046,  321, 3047,
+     1320, 1320, 1320, 1237, 1320, 3049, 3050, 1320, 3051, 1239,
+      321,  322,  322,  322,  322,  322,  322,  322,  322,  322,
+      322,  322,  322,  322,  322,  322, 3063,  322,  322,  322,
+      322,  322, 1244, 1244, 1244, 1234, 1245, 1245, 1245, 1247,
+     1247, 1247, 1249, 1249, 1249, 3068, 1237, 1250, 1250, 1250,
+     1244, 1251, 1251, 1251, 1245, 3069, 1247,  322,  322, 3070,
+     1249, 3071, 3072,  322, 3073, 1250,  322, 3055, 1251, 1254,
+
+     1254, 1254, 1255, 1255, 1255, 1258, 1258, 1258,  322,  370,
+     3055, 2993, 1259, 1259, 1259, 3074,  370, 1254, 3056, 3075,
+     1255, 2993, 1245, 1258, 2993,  370,  370, 1263, 1263, 1263,
+     1259, 3056, 3076, 1250, 1265, 1265, 1265, 2019, 2019, 2019,
+     1268, 1268, 1268, 3077, 1263, 1272, 1272, 1272, 2021, 2021,
+     2021, 1265, 3078, 3089,  370,  370,  370,  370, 1268, 3091,
+     3095,  370,  370, 1272, 1255,  370,  370, 3096, 3097,  370,
+     3098,  370,  370,  370, 1259, 3099, 1273, 1273, 1273,  370,
+      372, 3100, 1269, 1269, 1269, 1283, 1283, 1283, 1284, 1284,
+     1284, 1285, 1285, 1285, 1273, 2021,  372,  372, 3102, 3117,
+
+     1269, 3118, 2019, 1283, 3120, 3121, 1284, 3123, 1285, 3132,
+     3112, 1288, 1288, 1288, 1291, 1291, 1291, 2022, 2022, 2022,
+     1289, 1289, 1289, 3112, 3133,  372,  372,  372,  372, 1288,
+     3134, 1291,  372,  372, 1269, 1273,  372,  372, 1289, 2994,
+      372, 3135,  372,  372,  372, 1293, 1293, 1293, 3113, 2994,
+      372, 3137, 2994, 1284, 1295, 1295, 1295, 1299, 1299, 1299,
+     3138, 3113, 1293, 1300, 1300, 1300, 1301, 1301, 1301, 3119,
+     3139, 1295, 1302, 1302, 1302, 1299, 1303, 1303, 1303, 3140,
+     3143, 1300, 3119, 1301, 3144, 1289, 1304, 1304, 1304, 1302,
+     1305, 1305, 1305, 1303, 3145, 1307, 1307, 1307, 1309, 1309,
+
+     1309, 1310, 1310, 1310, 1304, 1313, 1313, 1313, 1305, 3146,
+     3147, 1300, 1307, 1316, 1316, 1316, 1309, 3122, 3148, 1310,
+     3149, 3150, 1313, 1317, 1317, 1317, 1319, 1319, 1319, 3151,
+     3122, 1316, 1323, 1323, 1323, 3152, 1303, 1324, 1324, 1324,
+     3153, 1317, 3154, 1319, 1327, 1327, 1327, 1328, 1328, 1328,
+     1323, 1328, 1305, 3159, 1328, 1324, 1331, 1331, 1331, 3162,
+     3163, 1327, 3164, 1310, 1332, 1332, 1332, 1337, 1337, 1337,
+     1338, 1338, 1338, 3165, 1331, 1339, 1339, 1339, 3166, 1340,
+     1340, 1340, 1332, 1340, 3160, 1337, 1340, 3167, 1338, 3168,
+     1317, 3169, 1339, 1342, 1342, 1342, 1343, 1343, 1343, 1344,
+
+     1344, 1344, 3159, 3170, 1324, 1345, 1345, 1345, 1346, 1346,
+     1346, 1342, 3171, 3172, 1343, 3173, 1344, 1347, 1347, 1347,
+     3160, 3174, 1345, 3176, 3178, 1346, 1348, 1348, 1348, 1332,
+     1349, 1349, 1349, 3179, 1347, 1338, 1362, 1362, 1362, 3181,
+     1362, 3183, 3187, 1362, 1348, 1366, 1366, 1366, 1349, 1367,
+     1367, 1367, 1369, 1369, 1369, 3188, 1345, 3189, 1343, 1414,
+     1414, 1414, 3190, 1366, 1418, 1418, 1418, 1367, 3194, 3202,
+     1369, 1345, 3203, 1421, 1421, 1421, 1414, 1347, 1415, 1415,
+     1415, 1418, 1415, 3204, 3205, 1415, 1419, 1419, 1419, 3206,
+     1419, 1421, 1349, 1419, 1422, 1422, 1422, 1424, 1424, 1424,
+
+     1427, 1427, 1427, 1431, 1431, 1431, 1432, 1432, 1432, 1434,
+     1434, 1434, 1422, 3207, 3208, 1424, 3209, 1427, 1437, 1437,
+     1437, 1431, 3210, 3211, 1432, 3212, 3216, 1434, 1438, 1438,
+     1438, 1440, 1440, 1440, 3219, 3220, 1437, 1442, 1442, 1442,
+     3221, 1442, 3222, 3223, 1442, 3224, 1438, 3225, 3228, 1440,
+     1446, 1446, 1446, 1447, 1447, 1447, 1449, 1449, 1449, 2026,
+     2026, 2026, 1424, 1450, 1450, 1450, 3232, 3233, 1446, 3234,
+     3235, 1447, 3236, 3237, 1449, 3238, 1434, 1451, 1451, 1451,
+     1450, 1451, 3239, 3240, 1451, 1440, 1454, 1454, 1454, 1455,
+     1455, 1455, 3241, 1455, 3242, 3243, 1455, 1456, 1456, 1456,
+
+     1457, 1457, 1457, 1454, 3255, 3256, 1449, 1459, 1459, 1459,
+     1460, 1460, 1460, 3257, 3258, 1456, 3259, 3260, 1457, 1461,
+     1461, 1461, 3261, 1461, 2026, 1459, 1461, 1460, 1462, 1462,
+     1462, 1463, 1463, 1463, 3262, 1463, 3264, 3265, 1463, 1464,
+     1464, 1464, 1465, 1465, 1465, 1462, 1467, 1467, 1467, 1468,
+     1468, 1468, 1469, 1469, 1469, 3266, 1469, 1464, 3267, 1469,
+     1465, 1472, 1472, 1472, 1467, 3268, 1468, 1473, 1473, 1473,
+     1459, 1473, 3269, 3270, 1473, 1474, 1474, 1474, 1472, 1475,
+     1475, 1475, 1477, 1477, 1477, 1478, 1478, 1478, 3271, 1478,
+     3272, 3273, 1478, 1474, 1481, 1481, 1481, 1475, 1481, 3274,
+
+     1477, 1481, 1484, 1484, 1484, 3275, 1485, 1485, 1485, 1467,
+     1485, 3283, 3279, 1485, 1490, 1490, 1490, 3284, 3285, 1484,
+     1491, 1491, 1491, 1493, 1493, 1493, 1497, 1497, 1497, 3288,
+     1497, 3289, 1490, 1497, 1500, 1500, 1500, 3290, 1491, 3291,
+     3294, 1493, 1501, 1501, 1501, 1477, 1501, 3279, 3296, 1501,
+     3300, 1500, 1504, 1504, 1504, 1505, 1505, 1505, 3303, 1505,
+     3304, 3305, 1505, 1515, 1515, 1515, 1516, 1516, 1516, 1504,
+     3306, 3307, 1493, 1518, 1518, 1518, 1519, 1519, 1519, 3308,
+     1519, 1515, 3309, 1519, 1516, 1522, 1522, 1522, 1523, 1523,
+     1523, 1518, 1525, 1525, 1525, 1526, 1526, 1526, 3310, 1526,
+
+     3311, 3312, 1526, 1522, 3313, 3314, 1523, 1531, 1531, 1531,
+     1525, 1532, 1532, 1532, 1534, 1534, 1534, 1537, 1537, 1537,
+     1538, 1538, 1538, 3319, 1538, 1531, 3327, 1538, 3328, 1532,
+     3185, 3329, 1534, 3330, 1537, 3331, 1544, 1544, 1544, 3332,
+     3185, 1518, 1545, 1545, 1545, 1547, 1547, 1547, 1550, 1550,
+     1550, 3333, 3334, 1525, 1544, 1551, 1551, 1551, 3185, 1551,
+     1545, 3335, 1551, 1547, 3336, 1550, 1554, 1554, 1554, 3185,
+     1554, 3342, 3343, 1554, 1557, 1557, 1557, 1558, 1558, 1558,
+     1534, 1560, 1560, 1560, 1561, 1561, 1561, 1562, 1562, 1562,
+     3345, 3346, 1557, 3348, 3349, 1558, 1563, 1563, 1563, 1560,
+
+     3350, 1561, 1565, 1565, 1565, 1562, 1567, 1567, 1567, 3351,
+     1567, 1547, 3352, 1567, 1563, 1573, 1573, 1573, 3353, 3354,
+     1565, 1574, 1574, 1574, 1576, 1576, 1576, 1578, 1578, 1578,
+     3355, 1578, 3356, 1573, 1578, 1581, 1581, 1581, 3357, 1574,
+     3358, 3359, 1576, 1582, 1582, 1582, 3360, 1560, 1584, 1584,
+     1584, 3363, 1565, 1581, 3364, 1585, 1585, 1585, 3365, 1585,
+     3366, 1582, 1585, 1589, 1589, 1589, 1584, 3367, 1590, 1590,
+     1590, 1592, 1592, 1592, 1593, 1593, 1593, 1594, 1594, 1594,
+     3368, 1589, 1595, 1595, 1595, 1576, 1590, 3369, 3370, 1592,
+     3372, 1593, 3373, 3375, 1594, 1596, 1596, 1596, 3376, 3377,
+
+     1595, 1598, 1598, 1598, 1603, 1603, 1603, 3379, 1603, 1584,
+     3381, 1603, 3382, 1596, 1606, 1606, 1606, 3383, 3386, 1598,
+     3387, 3388, 1592, 3389, 3392, 1594, 1607, 1607, 1607, 3393,
+     1607, 1606, 3394, 1607, 1610, 1610, 1610, 1611, 1611, 1611,
+     1613, 1613, 1613, 1616, 1616, 1616, 1617, 1617, 1617, 1619,
+     1619, 1619, 1610, 3395, 3396, 1611, 3397, 3398, 1613, 3399,
+     3400, 1616, 3407, 3408, 1617, 3410, 3411, 1619, 3412, 1598,
+     1625, 1625, 1625, 1629, 1629, 1629, 1630, 1630, 1630, 3414,
+     1632, 1632, 1632, 3401, 1637, 1637, 1637, 1625, 1645, 1645,
+     1645, 1629, 1613, 3416, 1630, 3419, 3421, 1619, 1632, 1633,
+
+     1633, 1633, 1637, 1633, 3422, 1645, 1633, 1638, 1638, 1638,
+     1640, 1640, 1640, 1642, 1642, 1642, 3423, 1642, 3424, 3425,
+     1642, 3426, 1646, 1646, 1646, 1638, 1646, 3401, 1640, 1646,
+     1647, 1647, 1647, 1648, 1648, 1648, 1649, 1649, 1649, 3427,
+     1649, 3428, 1632, 1649, 1651, 1651, 1651, 1647, 3429, 3430,
+     1648, 1653, 1653, 1653, 3431, 1654, 1654, 1654, 1656, 1656,
+     1656, 1651, 1657, 1657, 1657, 3432, 1659, 1659, 1659, 1653,
+     3435, 3439, 1640, 1654, 3440, 3442, 1656, 3443, 3444, 1657,
+     1658, 1658, 1658, 1659, 1658, 3446, 3447, 1658, 1660, 1660,
+     1660, 3452, 1660, 3453, 3454, 1660, 1662, 1662, 1662, 1663,
+
+     1663, 1663, 1665, 1665, 1665, 1667, 1667, 1667, 3455, 1667,
+     3456, 3457, 1667, 3458, 1662, 3459, 3460, 1663, 3461, 1656,
+     1665, 1670, 1670, 1670, 1671, 1671, 1671, 1673, 1673, 1673,
+     1676, 1676, 1676, 3462, 1676, 3463, 3464, 1676, 3465, 1670,
+     3466, 3467, 1671, 3468, 3472, 1673, 1680, 1680, 1680, 1681,
+     1681, 1681, 3473, 1683, 1683, 1683, 1685, 1685, 1685, 3186,
+     1685, 3474, 3475, 1685, 1680, 3476, 3477, 1681, 3478, 3186,
+     1665, 1683, 1689, 1689, 1689, 1690, 1690, 1690, 1691, 1691,
+     1691, 1693, 1693, 1693, 1695, 1695, 1695, 3186, 3479, 1689,
+     1696, 1696, 1696, 1690, 1696, 1673, 1691, 1696, 3186, 1693,
+
+     3482, 1695, 1699, 1699, 1699, 1701, 1701, 1701, 1702, 1702,
+     1702, 1704, 1704, 1704, 3483, 1683, 1706, 1706, 1706, 1699,
+     1708, 1708, 1708, 1701, 3484, 3485, 1702, 3486, 3487, 1704,
+     1709, 1709, 1709, 1706, 1711, 1711, 1711, 3489, 1708, 3490,
+     1712, 1712, 1712, 1693, 1712, 3492, 3493, 1712, 1709, 1716,
+     1716, 1716, 1711, 1717, 1717, 1717, 1719, 1719, 1719, 1704,
+     1720, 1720, 1720, 3494, 1699, 3496, 3497, 1716, 1721, 1721,
+     1721, 1717, 1721, 3498, 1719, 1721, 3499, 1720, 1724, 1724,
+     1724, 3500, 1711, 1725, 1725, 1725, 3501, 1725, 3502, 3503,
+     1725, 1727, 1727, 1727, 3504, 1724, 1728, 1728, 1728, 3512,
+
+     1730, 1730, 1730, 1732, 1732, 1732, 1738, 1738, 1738, 1727,
+     1792, 1792, 1792, 3505, 1728, 3513, 3507, 1719, 1730, 3515,
+     3508, 1732, 1732, 3516, 1738, 1783, 1783, 1783, 1792, 1783,
+     3507, 3508, 1783, 1788, 1788, 1788, 3520, 1788, 3522, 3524,
+     1788, 1795, 1795, 1795, 1796, 1796, 1796, 3526, 1796, 3246,
+     3528, 1796, 1800, 1800, 1800, 1803, 1803, 1803, 1795, 3246,
+     3505, 1730, 1802, 1802, 1802, 3530, 1806, 1806, 1806, 3534,
+     1800, 3536, 1792, 1803, 1807, 1807, 1807, 3246, 1807, 1802,
+     3540, 1807, 3541, 3536, 1806, 1812, 1812, 1812, 3246, 1812,
+     3537, 3543, 1812, 1815, 1815, 1815, 1816, 1816, 1816, 3544,
+
+     1816, 3546, 3537, 1816, 3557, 1819, 1819, 1819, 3559, 1819,
+     3561, 1815, 1819, 3562, 1800, 1822, 1822, 1822, 1823, 1823,
+     1823, 3565, 1823, 1803, 1806, 1823, 3566, 1828, 1828, 1828,
+     3569, 1828, 3571, 1822, 1828, 1831, 1831, 1831, 1832, 1832,
+     1832, 1815, 1832, 3573, 3575, 1832, 3577, 1837, 1837, 1837,
+     1839, 1839, 1839, 1831, 1840, 1840, 1840, 1841, 1841, 1841,
+     1842, 1842, 1842, 1822, 1837, 1843, 1843, 1843, 1839, 3579,
+     3580, 1840, 3582, 3583, 1841, 3587, 3588, 1842, 1848, 1848,
+     1848, 3590, 1843, 1831, 1844, 1844, 1844, 3591, 1844, 3593,
+     3595, 1844, 1845, 1845, 1845, 1848, 1845, 3511, 3597, 1845,
+
+     1849, 1849, 1849, 1850, 1850, 1850, 1839, 3599, 1842, 1851,
+     1851, 1851, 1852, 1852, 1852, 3603, 3511, 1849, 3511, 3605,
+     1850, 1853, 1853, 1853, 1841, 3608, 1851, 3600, 3609, 1852,
+     1848, 3511, 1854, 1854, 1854, 1855, 1855, 1855, 1853, 1856,
+     1856, 1856, 1857, 1857, 1857, 1858, 1858, 1858, 1849, 1854,
+     3601, 3610, 1855, 1865, 1865, 1865, 1856, 1851, 3614, 1857,
+     1859, 1859, 1859, 1858, 3601, 1862, 1862, 1862, 3615, 3600,
+     1865, 1870, 1870, 1870, 1850, 3602, 3602, 1852, 1859, 1868,
+     1868, 1868, 1853, 1862, 1866, 1866, 1866, 3604, 1866, 1870,
+     3616, 1866, 1873, 1873, 1873, 3617, 1868, 3247, 3604, 1875,
+
+     1875, 1875, 1856, 3625, 1857, 3626, 1855, 3247, 3551, 1873,
+     3617, 1858, 3636, 1859, 1874, 1874, 1874, 1875, 1874, 3637,
+     3551, 1874, 3638, 1862, 3551, 3247, 1868, 1876, 1876, 1876,
+     1877, 1877, 1877, 3639, 1877, 3643, 3247, 1877, 1870, 1878,
+     1878, 1878, 3646, 3611, 1876, 1883, 1883, 1883, 3630, 1885,
+     1885, 1885, 1886, 1886, 1886, 3648, 3630, 1878, 1887, 1887,
+     1887, 3611, 3649, 1883, 3650, 3651, 1875, 1885, 3652, 1886,
+     1888, 1888, 1888, 1889, 1889, 1889, 1887, 1889, 3514, 3653,
+     1889, 1891, 1891, 1891, 1893, 1893, 1893, 1888, 1896, 1896,
+     1896, 3663, 1896, 3664, 3514, 1896, 3514, 3665, 1878, 1891,
+
+     3632, 1893, 3669, 1883, 1899, 1899, 1899, 1885, 3632, 3514,
+     1887, 1901, 1901, 1901, 1904, 1904, 1904, 1910, 1910, 1910,
+     3642, 1899, 3670, 1911, 1911, 1911, 3671, 1911, 3642, 1901,
+     1911, 3277, 1904, 3629, 1910, 1915, 1915, 1915, 1916, 1916,
+     1916, 3277, 1891, 1917, 1917, 1917, 3645, 1922, 1922, 1922,
+     3666, 1899, 3629, 1915, 3645, 1916, 1919, 1919, 1919, 3277,
+     1919, 1917, 3679, 1919, 1922, 1923, 1923, 1923, 3666, 1923,
+     3277, 3680, 1923, 1924, 1924, 1924, 1901, 1924, 3631, 3641,
+     1924, 1904, 1928, 1928, 1928, 1915, 1929, 1929, 1929, 3644,
+     1929, 3681, 3683, 1929, 1931, 1931, 1931, 3631, 3641, 1928,
+
+     1932, 1932, 1932, 3684, 1932, 3685, 1917, 1932, 3644, 1935,
+     1935, 1935, 1931, 1935, 3687, 3688, 1935, 1939, 1939, 1939,
+     1941, 1941, 1941, 1945, 1945, 1945, 1947, 1947, 1947, 1948,
+     1948, 1948, 1949, 1949, 1949, 1939, 1949, 3689, 1941, 1949,
+     3690, 1945, 3692, 1947, 3672, 1931, 1948, 1950, 1950, 1950,
+     1952, 1952, 1952, 1953, 1953, 1953, 3693, 1953, 3694, 3672,
+     1953, 1956, 1956, 1956, 3699, 1950, 3700, 1952, 1958, 1958,
+     1958, 1959, 1959, 1959, 3701, 1959, 3702, 3703, 1959, 1956,
+     1960, 1960, 1960, 3704, 1939, 1958, 3705, 1941, 1945, 1961,
+     1961, 1961, 1963, 1963, 1963, 3706, 3707, 1960, 1964, 1964,
+
+     1964, 3708, 1964, 3709, 3710, 1964, 3713, 1961, 3714, 3715,
+     1963, 1956, 1950, 1969, 1969, 1969, 3716, 1969, 3717, 3718,
+     1969, 3719, 1973, 1973, 1973, 1976, 1976, 1976, 2027, 2027,
+     2027, 2028, 2028, 2028, 2029, 2029, 2029, 3720, 3721, 1961,
+     1973, 3722, 3725, 1976, 1963, 2030, 2030, 2030, 2028, 3726,
+     3727, 2029, 2031, 2031, 2031, 3728, 2034, 2034, 2034, 3729,
+     2034, 3730, 2030, 2034, 2040, 2040, 2040, 2042, 2042, 2042,
+     2031, 2043, 2043, 2043, 1973, 2043, 3731, 1976, 2043, 2044,
+     2044, 2044, 2040, 3732, 2042, 2047, 2047, 2047, 2048, 2048,
+     2048, 3733, 3735, 2027, 1976, 3736, 3737, 2044, 2049, 2049,
+
+     2049, 3738, 3740, 2047, 3742, 2048, 2050, 2050, 2050, 3743,
+     2030, 3744, 2051, 2051, 2051, 2049, 2052, 2052, 2052, 3745,
+     2031, 2053, 2053, 2053, 2050, 2054, 2054, 2054, 3746, 2040,
+     2051, 3747, 3748, 2052, 2047, 2055, 2055, 2055, 2053, 2044,
+     2056, 2056, 2056, 2054, 2057, 2057, 2057, 2058, 2058, 2058,
+     3749, 2058, 2055, 3750, 2058, 3751, 3752, 2056, 2059, 2059,
+     2059, 2057, 2060, 2060, 2060, 2061, 2061, 2061, 3756, 2062,
+     2062, 2062, 2050, 2062, 3757, 2059, 2062, 3552, 2051, 3758,
+     2060, 3759, 2061, 2063, 2063, 2063, 2064, 2064, 2064, 3552,
+     3760, 2054, 3278, 3552, 2065, 2065, 2065, 3761, 2065, 2056,
+
+     2063, 2065, 3278, 2064, 2068, 2068, 2068, 2069, 2069, 2069,
+     2070, 2070, 2070, 2071, 2071, 2071, 2072, 2072, 2072, 3762,
+     3278, 2068, 3754, 2060, 2069, 3763, 3764, 2070, 3586, 3766,
+     2071, 3278, 3755, 2072, 3754, 2073, 2073, 2073, 2074, 2074,
+     2074, 2075, 2075, 2075, 3755, 2075, 3771, 3586, 2075, 3586,
+     3772, 2064, 2073, 3773, 3774, 2074, 3775, 2069, 2076, 2076,
+     2076, 3776, 3586, 2072, 2077, 2077, 2077, 3777, 3778, 2068,
+     3779, 3780, 2071, 3784, 3785, 2076, 2078, 2078, 2078, 3787,
+     3789, 2077, 2079, 2079, 2079, 2080, 2080, 2080, 3790, 2073,
+     2083, 2083, 2083, 2078, 2086, 2086, 2086, 3791, 2086, 3792,
+
+     2079, 2086, 3793, 2080, 2089, 2089, 2089, 3794, 2083, 2090,
+     2090, 2090, 2077, 2091, 2091, 2091, 3795, 2091, 3796, 3797,
+     2091, 2089, 2094, 2094, 2094, 3800, 2090, 2095, 2095, 2095,
+     2078, 2096, 2096, 2096, 3801, 2097, 2097, 2097, 3802, 2097,
+     2094, 2080, 2097, 2100, 2100, 2100, 2101, 2101, 2101, 2079,
+     2101, 3803, 3804, 2101, 2104, 2104, 2104, 2109, 2109, 2109,
+     3805, 2100, 2111, 2111, 2111, 2112, 2112, 2112, 3806, 2113,
+     2113, 2113, 2104, 2113, 3807, 2109, 2113, 2114, 2114, 2114,
+     2111, 3810, 2112, 3798, 2115, 2115, 2115, 3811, 2115, 3589,
+     2100, 2115, 2119, 2119, 2119, 2114, 2121, 2121, 2121, 2122,
+
+     2122, 2122, 3812, 2122, 3813, 3589, 2122, 3589, 3798, 2111,
+     2119, 3814, 3815, 2121, 2123, 2123, 2123, 2125, 2125, 2125,
+     3589, 3816, 2104, 2126, 2126, 2126, 3817, 2126, 3818, 3819,
+     2126, 2123, 3820, 3821, 2125, 3824, 2114, 2129, 2129, 2129,
+     2132, 2132, 2132, 2133, 2133, 2133, 2138, 2138, 2138, 3825,
+     2138, 3826, 3827, 2138, 3828, 2129, 3829, 3830, 2132, 2119,
+     2144, 2144, 2144, 2145, 2145, 2145, 2146, 2146, 2146, 3831,
+     2146, 3832, 3833, 2146, 2147, 2147, 2147, 3836, 2144, 3837,
+     2145, 2149, 2149, 2149, 3838, 2149, 3839, 3840, 2149, 2157,
+     2157, 2157, 2147, 2132, 2153, 2153, 2153, 3841, 2153, 3842,
+
+     3843, 2153, 2159, 2159, 2159, 3844, 3845, 2157, 2161, 2161,
+     2161, 3847, 2144, 2162, 2162, 2162, 2163, 2163, 2163, 3848,
+     2159, 2164, 2164, 2164, 3849, 3846, 2161, 2165, 2165, 2165,
+     2162, 3850, 3851, 2163, 3852, 2167, 2167, 2167, 2164, 2168,
+     2168, 2168, 3853, 2168, 3846, 2165, 2168, 2172, 2172, 2172,
+     3854, 2157, 2167, 3855, 2159, 2169, 2169, 2169, 3856, 2169,
+     2161, 3857, 2169, 3858, 3859, 2172, 2174, 2174, 2174, 3860,
+     2174, 3861, 3862, 2174, 3863, 2165, 2179, 2179, 2179, 3864,
+     2181, 2181, 2181, 2163, 2181, 3865, 3866, 2181, 2184, 2184,
+     2184, 2186, 2186, 2186, 2179, 2172, 2185, 2185, 2185, 3867,
+
+     2185, 3868, 3869, 2185, 3870, 2184, 2188, 2188, 2188, 2186,
+     2189, 2189, 2189, 2190, 2190, 2190, 2191, 2191, 2191, 2192,
+     2192, 2192, 3872, 3873, 2188, 3874, 3875, 2189, 2179, 3879,
+     2190, 3880, 3881, 2191, 2197, 2197, 2197, 2192, 2199, 2199,
+     2199, 3882, 3883, 2186, 2205, 2205, 2205, 2210, 2210, 2210,
+     3884, 2197, 2213, 2213, 2213, 2192, 2214, 2214, 2214, 2215,
+     2215, 2215, 2217, 2217, 2217, 2227, 2227, 2227, 2228, 2228,
+     2228, 2230, 2230, 2230, 2235, 2235, 2235, 3885, 2236, 2236,
+     2236, 2191, 2236, 3886, 3888, 2236, 2237, 2237, 2237, 3889,
+     3887, 2235, 2238, 2238, 2238, 3891, 2238, 3892, 3893, 2238,
+
+     2240, 2240, 2240, 2237, 2246, 2246, 2246, 2248, 2248, 2248,
+     3887, 2248, 3895, 3896, 2248, 2253, 2253, 2253, 2240, 2251,
+     2251, 2251, 2246, 2254, 2254, 2254, 2255, 2255, 2255, 2256,
+     2256, 2256, 2253, 2256, 3897, 3898, 2256, 2251, 2257, 2257,
+     2257, 2254, 3899, 2255, 2258, 2258, 2258, 3900, 2258, 3901,
+     3902, 2258, 2259, 2259, 2259, 2257, 2260, 2260, 2260, 2261,
+     2261, 2261, 2262, 2262, 2262, 3903, 2262, 2240, 3904, 2262,
+     2259, 2251, 3905, 3906, 2260, 3907, 2261, 2263, 2263, 2263,
+     2264, 2264, 2264, 3908, 2264, 2254, 3909, 2264, 2265, 2265,
+     2265, 2266, 2266, 2266, 2263, 2267, 2267, 2267, 3910, 2267,
+
+     3911, 3912, 2267, 2268, 2268, 2268, 2265, 3913, 2266, 2269,
+     2269, 2269, 3914, 2269, 3915, 3916, 2269, 3917, 2259, 3919,
+     2268, 3920, 2260, 2272, 2272, 2272, 2273, 2273, 2273, 3921,
+     2273, 3923, 3925, 2273, 2274, 2274, 2274, 2275, 2275, 2275,
+     2272, 2275, 3924, 3926, 2275, 2278, 2278, 2278, 3924, 2279,
+     2279, 2279, 2274, 2279, 2265, 3928, 2279, 2283, 2283, 2283,
+     3929, 3931, 2278, 2284, 2284, 2284, 3932, 2284, 3933, 3934,
+     2284, 2285, 2285, 2285, 2283, 2288, 2288, 2288, 3935, 2288,
+     3936, 3938, 2288, 2291, 2291, 2291, 2274, 3939, 2285, 2292,
+     2292, 2292, 3940, 2292, 3942, 3943, 2292, 2295, 2295, 2295,
+
+     2291, 2296, 2296, 2296, 2297, 2297, 2297, 2298, 2298, 2298,
+     2299, 2299, 2299, 3944, 3946, 2295, 2303, 2303, 2303, 2296,
+     3947, 2297, 3948, 3950, 2298, 2304, 2304, 2304, 2299, 2304,
+     3951, 3952, 2304, 2303, 2305, 2305, 2305, 3954, 2305, 3955,
+     3957, 2305, 2310, 2310, 2310, 2312, 2312, 2312, 3958, 2295,
+     2313, 2313, 2313, 3960, 3957, 2296, 2314, 2314, 2314, 3962,
+     2310, 2316, 2316, 2316, 2319, 2319, 2319, 3963, 2313, 2322,
+     2322, 2322, 3964, 3965, 2314, 3967, 3968, 2298, 2316, 2323,
+     2323, 2323, 2319, 2323, 3970, 3971, 2323, 2322, 2326, 2326,
+     2326, 3973, 2328, 2328, 2328, 2330, 2330, 2330, 3974, 2330,
+
+     3976, 3977, 2330, 2333, 2333, 2333, 2326, 2314, 2316, 2313,
+     2328, 2334, 2334, 2334, 3978, 2334, 3980, 3983, 2334, 2322,
+     2333, 2336, 2336, 2336, 3984, 2336, 3985, 3986, 2336, 2341,
+     2341, 2341, 2344, 2344, 2344, 2326, 2345, 2345, 2345, 2346,
+     2346, 2346, 2347, 2347, 2347, 3987, 3988, 2341, 3989, 2344,
+     2349, 2349, 2349, 3990, 2345, 2354, 2354, 2354, 2355, 2355,
+     2355, 3991, 2355, 3992, 3993, 2355, 2358, 2358, 2358, 2361,
+     2361, 2361, 3994, 2354, 2363, 2363, 2363, 2365, 2365, 2365,
+     3995, 2367, 2367, 2367, 2358, 3996, 2361, 2368, 2368, 2368,
+     3997, 3998, 2363, 4002, 4004, 2365, 4006, 4007, 2345, 2367,
+
+     4008, 2369, 2369, 2369, 2368, 2369, 4009, 4010, 2369, 2370,
+     2370, 2370, 2371, 2371, 2371, 2372, 2372, 2372, 4011, 2372,
+     4012, 2354, 2372, 2373, 2373, 2373, 2370, 4013, 4021, 2371,
+     2374, 2374, 2374, 4023, 2363, 2375, 2375, 2375, 4016, 2375,
+     4025, 2373, 2375, 2378, 2378, 2378, 2367, 2374, 2382, 2382,
+     2382, 2383, 2383, 2383, 4027, 2392, 2392, 2392, 4036, 2392,
+     4028, 2378, 2392, 2395, 2395, 2395, 2382, 4052, 2383, 2396,
+     2396, 2396, 2397, 2397, 2397, 4016, 1513, 2373, 2399, 2399,
+     2399, 2395, 2401, 2401, 2401, 4017, 2396, 2400, 2400, 2400,
+     2397, 2400, 4041, 1512, 2400, 2399, 4041, 2378, 4040, 2401,
+
+     2402, 2402, 2402, 4036, 2402, 4052, 4040, 2402, 1511, 4028,
+     2395, 2404, 2404, 2404, 2408, 2408, 2408, 2409, 2409, 2409,
+     4042, 2409, 4017, 4029, 2409, 2410, 2410, 2410, 4042, 2404,
+     1510, 2408, 2416, 2416, 2416, 2417, 2417, 2417, 2418, 2418,
+     2418, 2420, 2420, 2420, 2424, 2424, 2424, 2425, 2425, 2425,
+     2426, 2426, 2426, 2427, 2427, 2427, 2430, 2430, 2430, 2435,
+     2435, 2435, 2436, 2436, 2436, 2438, 2438, 2438, 2439, 2439,
+     2439, 4034, 4029, 2404, 2440, 2440, 2440, 2443, 2443, 2443,
+     4044, 2443, 4056, 1509, 2443, 2446, 2446, 2446, 4044, 2446,
+     4035, 4037, 2446, 2450, 2450, 2450, 2452, 2452, 2452, 1508,
+
+     2427, 2453, 2453, 2453, 4045, 2454, 2454, 2454, 2455, 2455,
+     2455, 2450, 4045, 2452, 2456, 2456, 2456, 4054, 2453, 4043,
+     4034, 2440, 2454, 4043, 4056, 2455, 2459, 2459, 2459, 2461,
+     2461, 2461, 2456, 2462, 2462, 2462, 4037, 2462, 4058, 4035,
+     2462, 2463, 2463, 2463, 2459, 2450, 2461, 2464, 2464, 2464,
+     1507, 2464, 1506, 2453, 2464, 4054, 2467, 2467, 2467, 2463,
+     2467, 4046, 4048, 2467, 2470, 2470, 2470, 1496, 2455, 4046,
+     2454, 2471, 2471, 2471, 2472, 2472, 2472, 4050, 2472, 4038,
+     4058, 2472, 2470, 4038, 2470, 2606, 2606, 2459, 2606, 2471,
+     2475, 2475, 2475, 4047, 2475, 4053, 2606, 2475, 2478, 2478,
+
+     2478, 4047, 2463, 2606, 2479, 2479, 2479, 2471, 2479, 4060,
+     4048, 2479, 2482, 2482, 2482, 4049, 2478, 2483, 2483, 2483,
+     4055, 2483, 4057, 4049, 2483, 4050, 2484, 2484, 2484, 2482,
+     2484, 4038, 4051, 2484, 2487, 2487, 2487, 2488, 2488, 2488,
+     4051, 2488, 2478, 4053, 2488, 4060, 2494, 2494, 2494, 4061,
+     2494, 4063, 2487, 2494, 2497, 2497, 2497, 2498, 2498, 2498,
+     4057, 2498, 4059, 4064, 2498, 2501, 2501, 2501, 4055, 2501,
+     4068, 2497, 2501, 2505, 2505, 2505, 2506, 2506, 2506, 2507,
+     2507, 2507, 2508, 2508, 2508, 2509, 2509, 2509, 4066, 2509,
+     2505, 4061, 2509, 4063, 2506, 4069, 4062, 2507, 4070, 2508,
+
+     4059, 2487, 2510, 2510, 2510, 2513, 2513, 2513, 4068, 2513,
+     4064, 4073, 2513, 2518, 2518, 2518, 2519, 2519, 2519, 2510,
+     2521, 2521, 2521, 2522, 2522, 2522, 4065, 2522, 4084, 4039,
+     2522, 2518, 4062, 4039, 2519, 4066, 4070, 2521, 2527, 2527,
+     2527, 2506, 4069, 2528, 2528, 2528, 2530, 2530, 2530, 4073,
+     2533, 2533, 2533, 1495, 2533, 1494, 2527, 2533, 2540, 2540,
+     2540, 2528, 4065, 4084, 2530, 2542, 2542, 2542, 2519, 2518,
+     2541, 2541, 2541, 4067, 2541, 2540, 4075, 2541, 2543, 2543,
+     2543, 4039, 4071, 2542, 2544, 2544, 2544, 2545, 2545, 2545,
+     2546, 2546, 2546, 2547, 2547, 2547, 2548, 2548, 2548, 2549,
+
+     2549, 2549, 2550, 2550, 2550, 2527, 2528, 2546, 4089, 4067,
+     2547, 4072, 1489, 2548, 4075, 4076, 2549, 2552, 2552, 2552,
+     2550, 2553, 2553, 2553, 4076, 2553, 4091, 4074, 2553, 4071,
+     2542, 2555, 2555, 2555, 2552, 2557, 2557, 2557, 2560, 2560,
+     2560, 2564, 2564, 2564, 4072, 2547, 2607, 2607, 2607, 2555,
+     2561, 2561, 2561, 2557, 2561, 4089, 2560, 2561, 2564, 2549,
+     4074, 2548, 2565, 2565, 2565, 1488, 2565, 4078, 2550, 2565,
+     2566, 2566, 2566, 4091, 2566, 4077, 4078, 2566, 2569, 2569,
+     2569, 2570, 2570, 2570, 2571, 2571, 2571, 4097, 2571, 4086,
+     4079, 2571, 2572, 2572, 2572, 4097, 2569, 4080, 2570, 2576,
+
+     2576, 2576, 2578, 2578, 2578, 2579, 2579, 2579, 4077, 2579,
+     2572, 4101, 2579, 2590, 2590, 2590, 4100, 2576, 4092, 2578,
+     2591, 2591, 2591, 4079, 4086, 2592, 2592, 2592, 4085, 2592,
+     2569, 2590, 2592, 4080, 2593, 2593, 2593, 2591, 2593, 4081,
+     1487, 2593, 4083, 1486, 2572, 2596, 2596, 2596, 4081, 2596,
+     4100, 4083, 2596, 2600, 2600, 2600, 2601, 2601, 2601, 4101,
+     2604, 2604, 2604, 2590, 2604, 4092, 1471, 2604, 2608, 2608,
+     2608, 2600, 4085, 4094, 2601, 2609, 2609, 2609, 2613, 2613,
+     2613, 2614, 2614, 2614, 2616, 2616, 2616, 2617, 2617, 2617,
+     2619, 2619, 2619, 2620, 2620, 2620, 2621, 2621, 2621, 2625,
+
+     2625, 2625, 2626, 2626, 2626, 2630, 2630, 2630, 2631, 2631,
+     2631, 2633, 2633, 2633, 2634, 2634, 2634, 2639, 2639, 2639,
+     4094, 2600, 2640, 2640, 2640, 2641, 2641, 2641, 4087, 2642,
+     2642, 2642, 4099, 2642, 4082, 2639, 2642, 2643, 2643, 2643,
+     4099, 1470, 2641, 2644, 2644, 2644, 2645, 2645, 2645, 2646,
+     2646, 2646, 4093, 4103, 2643, 2647, 2647, 2647, 4088, 1453,
+     2644, 4105, 1452, 2645, 2648, 2648, 2648, 2649, 2649, 2649,
+     4082, 2649, 4087, 2647, 2649, 2652, 2652, 2652, 2653, 2653,
+     2653, 2648, 2654, 2654, 2654, 2655, 2655, 2655, 4093, 4090,
+     2656, 2656, 2656, 2652, 2656, 2644, 2653, 2656, 2645, 4105,
+
+     2654, 4103, 4088, 2655, 4095, 2659, 2659, 2659, 4102, 2663,
+     2663, 2663, 4125, 2663, 4144, 2653, 2663, 2666, 2666, 2666,
+     4096, 4098, 2647, 2659, 2669, 2669, 2669, 2652, 2670, 2670,
+     2670, 4107, 2670, 4090, 2666, 2670, 2671, 2671, 2671, 4132,
+     4095, 2669, 4102, 4112, 2654, 4125, 4109, 2655, 2672, 2672,
+     2672, 2674, 2674, 2674, 2671, 2674, 4096, 4098, 2674, 2677,
+     2677, 2677, 4144, 2678, 2678, 2678, 2672, 2678, 1445, 4107,
+     2678, 2683, 2683, 2683, 4132, 4108, 2677, 2684, 2684, 2684,
+     2685, 2685, 2685, 2686, 2686, 2686, 4112, 2686, 4109, 2683,
+     2686, 2689, 2689, 2689, 4111, 2684, 4116, 2685, 2690, 2690,
+
+     2690, 2691, 2691, 2691, 2692, 2692, 2692, 4104, 2689, 4113,
+     2693, 2693, 2693, 4108, 4110, 2690, 4104, 4106, 2691, 1441,
+     4117, 2692, 2694, 2694, 2694, 4118, 4106, 2685, 2693, 2695,
+     2695, 2695, 2683, 2700, 2700, 2700, 4111, 2701, 2701, 2701,
+     2694, 2701, 4137, 4116, 2701, 4113, 2695, 2689, 2704, 2704,
+     2704, 4114, 4110, 2691, 2705, 2705, 2705, 2706, 2706, 2706,
+     2690, 2707, 2707, 2707, 4127, 2707, 2704, 4117, 2707, 4120,
+     4139, 2693, 4118, 1436, 2706, 2708, 2708, 2708, 2709, 2709,
+     2709, 2710, 2710, 2710, 2711, 2711, 2711, 2694, 2712, 2712,
+     2712, 4137, 2708, 4115, 4114, 2709, 4119, 4127, 2710, 2713,
+
+     2713, 2713, 2711, 2713, 4140, 2712, 2713, 4120, 2704, 2716,
+     2716, 2716, 4140, 2717, 2717, 2717, 2721, 2721, 2721, 4139,
+     2723, 2723, 2723, 4133, 2723, 4121, 2716, 2723, 4124, 4115,
+     2709, 2717, 4126, 2710, 2721, 2726, 2726, 2726, 2727, 2727,
+     2727, 4135, 2727, 4119, 4136, 2727, 2730, 2730, 2730, 4122,
+     2734, 2734, 2734, 2726, 2734, 1435, 4133, 2734, 4124, 2747,
+     2747, 2747, 4126, 4121, 2730, 2748, 2748, 2748, 1430, 2748,
+     2749, 2749, 2748, 2749, 4135, 4145, 2716, 2747, 4142, 2750,
+     2750, 2749, 2750, 2752, 2752, 2752, 4142, 4122, 2749, 4145,
+     2750, 4136, 4146, 2730, 2753, 2753, 2753, 2750, 2766, 2766,
+
+     2766, 2752, 2767, 2767, 2767, 2771, 2771, 2771, 2772, 2772,
+     2772, 4128, 2753, 2774, 2774, 2774, 2777, 2777, 2777, 4134,
+     4128, 2747, 2778, 2778, 2778, 2782, 2782, 2782, 2785, 2785,
+     2785, 2787, 2787, 2787, 2789, 2789, 2789, 2790, 2790, 2790,
+     4146, 2790, 4141, 4151, 2790, 2793, 2793, 2793, 4123, 2787,
+     2752, 2794, 2794, 2794, 4134, 2794, 1429, 2753, 2794, 2795,
+     2795, 2795, 2793, 2796, 2796, 2796, 2797, 2797, 2797, 2798,
+     2798, 2798, 2799, 2799, 2799, 4141, 2795, 2800, 2800, 2800,
+     2796, 2800, 4138, 4143, 2800, 4151, 4123, 2798, 4183, 2799,
+     2801, 2801, 2801, 2802, 2802, 2802, 2803, 2803, 2803, 2804,
+
+     2804, 2804, 2805, 2805, 2805, 2811, 2811, 2811, 2801, 4129,
+     4130, 2802, 4131, 1428, 2803, 4147, 4143, 2804, 4129, 4130,
+     2805, 4131, 2811, 2812, 2812, 2812, 4147, 2812, 4148, 4138,
+     2812, 2815, 2815, 2815, 1426, 2815, 4154, 4183, 2815, 2818,
+     2818, 2818, 2820, 2820, 2820, 4150, 2820, 1425, 4159, 2820,
+     2825, 2825, 2825, 2826, 2826, 2826, 4157, 2818, 2802, 1420,
+     2804, 2827, 2827, 2827, 2803, 4155, 4148, 2825, 4156, 1417,
+     2826, 2828, 2828, 2828, 2830, 2830, 2830, 4161, 4154, 2827,
+     2831, 2831, 2831, 4150, 2831, 4158, 4159, 2831, 4160, 2828,
+     1416, 2830, 2835, 2835, 2835, 2836, 2836, 2836, 2837, 2837,
+
+     2837, 4155, 2837, 4157, 4156, 2837, 2838, 2838, 2838, 2835,
+     4161, 4167, 2836, 2839, 2839, 2839, 2840, 2840, 2840, 2827,
+     4179, 2841, 2841, 2841, 2838, 2841, 4160, 1413, 2841, 4179,
+     4162, 2839, 4158, 2840, 2844, 2844, 2844, 2845, 2845, 2845,
+     2846, 2846, 2846, 2847, 2847, 2847, 2848, 2848, 2848, 4167,
+     2848, 2844, 1412, 2848, 2845, 2851, 2851, 2851, 2852, 2852,
+     2852, 2847, 2852, 4162, 4180, 2852, 2853, 2853, 2853, 2854,
+     2854, 2854, 2851, 4180, 4163, 2839, 2855, 2855, 2855, 2857,
+     2857, 2857, 4163, 2853, 4168, 4164, 2854, 1411, 2858, 2858,
+     2858, 1410, 2858, 4164, 2855, 2858, 2857, 2862, 2862, 2862,
+
+     2864, 2864, 2864, 2877, 2877, 2877, 2889, 2889, 2889, 2908,
+     2908, 2908, 2909, 2909, 2909, 2862, 4175, 4165, 2864, 4173,
+     4171, 2877, 4168, 4166, 2889, 2912, 2912, 2912, 2916, 2916,
+     2916, 2919, 2919, 2919, 2920, 2920, 2920, 2921, 2921, 2921,
+     4177, 2921, 1409, 4169, 2921, 2924, 2924, 2924, 2925, 2925,
+     2925, 2920, 2925, 4178, 4175, 2925, 4171, 1408, 2889, 2926,
+     2926, 2926, 2924, 4170, 2877, 4165, 4173, 2864, 2927, 2927,
+     2927, 4166, 2927, 4177, 4172, 2927, 2926, 2928, 2928, 2928,
+     2930, 2930, 2930, 4181, 2930, 4169, 4178, 2930, 2933, 2933,
+     2933, 2935, 2935, 2935, 4176, 2928, 2936, 2936, 2936, 2937,
+
+     2937, 2937, 2940, 2940, 2940, 4170, 2933, 1407, 4184, 2935,
+     4172, 2942, 2942, 2942, 2936, 2942, 4181, 2937, 2942, 2940,
+     2954, 2954, 2954, 2955, 2955, 2955, 2956, 2956, 2956, 4174,
+     2956, 1406, 4176, 2956, 2999, 2999, 2999, 2954, 4182, 4188,
+     2955, 2957, 2957, 2957, 1405, 2958, 2958, 2958, 4185, 2958,
+     4188, 2937, 2958, 2935, 2959, 2959, 2959, 4184, 2957, 1404,
+     2960, 2960, 2960, 2936, 2960, 4187, 4186, 2960, 2966, 2966,
+     2966, 4182, 2959, 2967, 2967, 2967, 4174, 2967, 1403, 4187,
+     2967, 4185, 2968, 2968, 2968, 2966, 2968, 1402, 1401, 2968,
+     2971, 2971, 2971, 2973, 2973, 2973, 2974, 2974, 2974, 4186,
+
+     2974, 1400, 1399, 2974, 2978, 2978, 2978, 1398, 2971, 1397,
+     1396, 2973, 2979, 2979, 2979, 2980, 2980, 2980, 1395, 2980,
+     1392, 2978, 2980, 2981, 2981, 2981, 2982, 2982, 2982, 2979,
+     2982, 1391, 1390, 2982, 2983, 2983, 2983, 2985, 2985, 2985,
+     2981, 2985, 1389, 1388, 2985, 2988, 2988, 2988, 2990, 2990,
+     2990, 1386, 2983, 2989, 2989, 2989, 2973, 2989, 1385, 1384,
+     2989, 1383, 2988, 1382, 1381, 2990, 2991, 2991, 2991, 1380,
+     2991, 1379, 1378, 2991, 2992, 2992, 2992, 1377, 2992, 1376,
+     1375, 2992, 2996, 2996, 2996, 2997, 2997, 2997, 2998, 2998,
+     2998, 3000, 3000, 3000, 3011, 3011, 3011, 1374, 1373, 2996,
+
+     1372, 1371, 2997, 3024, 3024, 3024, 2998, 1365, 3000, 3025,
+     3025, 3025, 3011, 3042, 3042, 3042, 3044, 3044, 3044, 1361,
+     3024, 3048, 3048, 3048, 3052, 3052, 3052, 3025, 3053, 3053,
+     3053, 1358, 3053, 1357, 1356, 3053, 3054, 3054, 3054, 1354,
+     3054, 3052, 1350, 3054, 3057, 3057, 3057, 1341, 3057, 1336,
+     1335, 3057, 3060, 3060, 3060, 3011, 3061, 3061, 3061, 1334,
+     2998, 3062, 3062, 3062, 3064, 3064, 3064, 3065, 3065, 3065,
+     3060, 3066, 3066, 3066, 3061, 3066, 1330, 1329, 3066, 3062,
+     1326, 3064, 1322, 1321, 3065, 3067, 3067, 3067, 3079, 3079,
+     3079, 3080, 3080, 3080, 1318, 3080, 1315, 3062, 3080, 3081,
+
+     3081, 3081, 3067, 3081, 1312, 3079, 3081, 1311, 3061, 3084,
+     3084, 3084, 1306, 3084, 1298, 1297, 3084, 3087, 3087, 3087,
+     3060, 3090, 3090, 3090, 3092, 3092, 3092, 1296, 3092, 1294,
+     1290, 3092, 3101, 3101, 3101, 3087, 1287, 1282, 3090, 3103,
+     3103, 3103, 3104, 3104, 3104, 1281, 3104, 1280, 1279, 3104,
+     3101, 3105, 3105, 3105, 1278, 3105, 3103, 1277, 3105, 3108,
+     3108, 3108, 1276, 3108, 1275, 1274, 3108, 3111, 3111, 3111,
+     1271, 3111, 1270, 1267, 3111, 3114, 3114, 3114, 1266, 3114,
+     1262, 1260, 3114, 3124, 3124, 3124, 3125, 3125, 3125, 1257,
+     3125, 1256, 1253, 3125, 3126, 3126, 3126, 3127, 3127, 3127,
+
+     3124, 3127, 1246, 1243, 3127, 3128, 3128, 3128, 3129, 3129,
+     3129, 3126, 3130, 3130, 3130, 3131, 3131, 3131, 1242, 3131,
+     1241, 1238, 3131, 3128, 3142, 3142, 3142, 1235, 1228, 3130,
+     3155, 3155, 3155, 3156, 3156, 3156, 1226, 3156, 1223, 1222,
+     3156, 1221, 3142, 3157, 3157, 3157, 1218, 3155, 3161, 3161,
+     3161, 3175, 3175, 3175, 3177, 3177, 3177, 3180, 3180, 3180,
+     1217, 3157, 3182, 3182, 3182, 3161, 3161, 1216, 3128, 1213,
+     3184, 3184, 3184, 1212, 3184, 1203, 3142, 3184, 3191, 3191,
+     3191, 3192, 3192, 3192, 3193, 3193, 3193, 3195, 3195, 3195,
+     3196, 3196, 3196, 1202, 3196, 1201, 3191, 3196, 1200, 3192,
+
+     1199, 1198, 3193, 1197, 3195, 3197, 3197, 3197, 1196, 3197,
+     1195, 1191, 3197, 3200, 3200, 3200, 3201, 3201, 3201, 1160,
+     3201, 1157, 1154, 3201, 3213, 3213, 3213, 1153, 3213, 1150,
+     3200, 3213, 3217, 3217, 3217, 3218, 3218, 3218, 1149, 3218,
+     1148, 1147, 3218, 1146, 1145, 3191, 3193, 1138, 1137, 3217,
+     3226, 3226, 3226, 3229, 3229, 3229, 1136, 3229, 1135, 1133,
+     3229, 3244, 3244, 3244, 1132, 3245, 3245, 3245, 3226, 3245,
+     1130, 1129, 3245, 3248, 3248, 3248, 1128, 3248, 3244, 1127,
+     3248, 3251, 3251, 3251, 3252, 3252, 3252, 1126, 3252, 1125,
+     1124, 3252, 3263, 3263, 3263, 1123, 3276, 3276, 3276, 3251,
+
+     3276, 1122, 1121, 3276, 3280, 3280, 3280, 3281, 3281, 3281,
+     3263, 3282, 3282, 3282, 1120, 3282, 1119, 1117, 3282, 1116,
+     1115, 3280, 3280, 1114, 3281, 3281, 3295, 3295, 3295, 3282,
+     3297, 3297, 3297, 3251, 3298, 3298, 3298, 3299, 3299, 3299,
+     1113, 1112, 3263, 3301, 3301, 3301, 3302, 3302, 3302, 3315,
+     3315, 3315, 3316, 3316, 3316, 3318, 3318, 3318, 3320, 3320,
+     3320, 1111, 3320, 1110, 1109, 3320, 1107, 3315, 1106, 1105,
+     3316, 1104, 1103, 3318, 3323, 3323, 3323, 1102, 3323, 1101,
+     1100, 3323, 3326, 3326, 3326, 3337, 3337, 3337, 3338, 3338,
+     3338, 1099, 3338, 1098, 1097, 3338, 3341, 3341, 3341, 3326,
+
+     1093, 3315, 3337, 3361, 3361, 3361, 1089, 3362, 3362, 3362,
+     1088, 3362, 1087, 3341, 3362, 3371, 3371, 3371, 1086, 1085,
+     3361, 1081, 1079, 3318, 3380, 3380, 3380, 3402, 3402, 3402,
+     3403, 3403, 3403, 3371, 3403, 1078, 1077, 3403, 1076, 3404,
+     3404, 3404, 3380, 3404, 3402, 3402, 3404, 1075, 3403, 3415,
+     3415, 3415, 3417, 3417, 3417, 1074, 1073, 3404, 3418, 3418,
+     3418, 3420, 3420, 3420, 3433, 3433, 3433, 3434, 3434, 3434,
+     3436, 3436, 3436, 3437, 3437, 3437, 1069, 3437, 1068, 1064,
+     3437, 1063, 3433, 1062, 1061, 3434, 1058, 3436, 3438, 3438,
+     3438, 3380, 3405, 3405, 3405, 3405, 3405, 3405, 3405, 3405,
+
+     3405, 1057, 1055, 3405, 1053, 3438, 1050, 1049, 3405, 3405,
+     3405, 3405, 3405, 3448, 3448, 3448, 3449, 3449, 3449, 1048,
+     3449, 1047, 1045, 3449, 3451, 3451, 3451, 1042, 3451, 1041,
+     3448, 3451, 1039, 1038, 3434, 3450, 3450, 3450, 3405, 3405,
+     3406, 3406, 3406, 3406, 3406, 3406, 3406, 3406, 3406, 1035,
+     1033, 3406, 3450, 3480, 3480, 3480, 3406, 3406, 3406, 3406,
+     3406, 3469, 3469, 3469, 1030, 3469, 1029, 1028, 3469, 1027,
+     1024, 3480, 3488, 3488, 3488, 3506, 3506, 3506, 1023, 3506,
+     1022, 1021, 3506, 3517, 3517, 3517, 3406, 3406, 1020, 1019,
+     3488, 1018, 1016, 3506, 3509, 3509, 3509, 3509, 3509, 3509,
+
+     3509, 3509, 3509, 1013, 1012, 3509, 3518, 3518, 3518, 1008,
+     3509, 3509, 3509, 3509, 3509, 3531, 3531, 3531, 3533, 3533,
+     3533, 3535, 3535, 3535, 1007, 3535, 1006, 1005, 3535, 3619,
+     3619, 3619, 1004, 3531, 1003,  994, 3533, 3538, 3538, 3538,
+     3509, 3509, 3510, 3510, 3510, 3510, 3510, 3510, 3510, 3510,
+     3510,  993,  990, 3510, 3538, 3620, 3620, 3620, 3510, 3510,
+     3510, 3510, 3510,  989, 3539, 3539, 3539,  988, 3539,  987,
+     3533, 3539, 3547, 3547, 3547,  986, 3547,  984,  983, 3547,
+     3550, 3550, 3550,  982, 3550,  979,  978, 3550, 3510, 3510,
+     3584, 3584, 3584, 3606, 3606, 3606, 3627, 3627, 3627, 3628,
+
+     3628, 3628, 3633, 3633, 3633,  977, 3633,  974, 3584, 3633,
+      973, 3606, 3606,  969, 3627,  967, 3628, 3640, 3640, 3640,
+     3647, 3647, 3647, 3678, 3678, 3678, 3682, 3682, 3682, 3695,
+     3695, 3695,  964,  963, 3640,  962,  961, 3647, 3697, 3697,
+     3697, 3678,  959,  956, 3682,  955,  952, 3695,  949, 3698,
+     3698, 3698,  946, 3698,  945, 3697, 3698, 3711, 3711, 3711,
+     3712, 3712, 3712,  944, 3712,  943,  942, 3712, 3723, 3723,
+     3723, 3741, 3741, 3741, 3711, 3724, 3724, 3724, 3682, 3724,
+      941,  938, 3724,  935,  934, 3723, 3753, 3753, 3753, 3741,
+     3753,  933,  929, 3753, 3768, 3768, 3768,  925, 3768,  924,
+
+      923, 3768, 3781, 3781, 3781,  922, 3781,  921, 3741, 3781,
+     3982, 3982, 3982, 3999, 3999, 3999,  920, 3999,  919,  918,
+     3999, 4149, 4149, 4149, 4152, 4152, 4152,  917, 3982,  916,
+      915, 3999, 4189, 4189, 4189, 4190, 4190, 4190,  913, 4149,
+      911,  908, 4152,  907,  906,  905,  904,  903,  898,  897,
+     4189,  896,  895, 4190, 4193, 4193, 4193, 4193, 4193, 4193,
+     4193, 4193, 4193, 4194, 4194, 4194, 4194, 4194, 4194, 4194,
+     4194, 4194, 4195, 4195, 4195, 4195, 4195, 4195, 4195, 4195,
+     4195, 4196, 4196, 4196, 4196, 4196, 4196, 4196, 4196, 4196,
+     4197, 4197, 4197, 4197, 4197, 4197, 4197, 4197, 4197, 4198,
+
+     4198, 4198, 4198, 4198, 4198, 4198, 4198, 4198, 4199, 4199,
+     4199, 4199, 4199, 4199, 4199, 4199, 4199, 4200, 4200, 4200,
+     4200, 4200, 4200, 4200, 4200, 4200, 4201, 4201, 4201, 4201,
+     4201, 4201, 4201, 4201, 4201, 4202, 4202, 4202, 4202, 4202,
+     4202, 4202, 4202, 4202, 4203, 4203, 4203, 4203, 4203, 4203,
+     4203, 4203, 4203, 4204, 4204, 4204, 4204, 4204, 4204, 4204,
+     4204, 4204, 4205, 4205, 4205, 4205, 4205, 4205, 4205, 4205,
+     4205, 4206, 4206, 4206, 4206, 4206, 4206, 4206, 4206, 4206,
+     4207, 4207, 4207, 4207, 4207, 4207, 4207, 4207, 4207, 4208,
+     4208, 4208, 4208, 4208, 4208, 4208, 4208, 4208, 4209, 4209,
+
+     4209, 4209, 4209, 4209, 4209, 4209, 4209, 4210, 4210, 4210,
+     4210, 4210, 4210, 4210, 4210, 4210, 4211, 4211, 4211, 4211,
+     4211, 4211, 4211, 4211, 4211, 4212, 4212, 4212, 4212, 4212,
+     4212, 4212, 4212, 4212, 4213, 4213, 4213, 4213, 4213, 4213,
+     4213, 4213, 4213, 4214, 4214, 4214, 4214, 4214, 4214, 4214,
+     4214, 4214, 4215, 4215, 4215, 4215, 4215, 4215, 4215, 4215,
+     4215, 4216, 4216, 4216, 4216, 4216, 4216, 4216, 4216, 4216,
+     4217, 4217, 4217, 4217, 4217, 4217, 4217, 4217, 4217, 4218,
+     4218, 4218, 4218, 4218, 4218, 4218, 4218, 4218, 4219, 4219,
+     4219, 4219, 4219, 4219, 4219, 4219, 4219, 4220, 4220, 4220,
+
+     4220, 4220, 4220, 4220, 4220, 4220, 4221, 4221, 4221, 4221,
+     4221, 4221, 4221, 4221, 4221, 4222, 4222, 4222, 4222, 4222,
+     4222, 4222, 4222, 4222, 4223, 4223, 4223, 4223, 4223, 4223,
+     4223, 4223, 4223, 4224, 4224, 4224, 4224, 4224, 4224, 4224,
+     4224, 4224, 4225, 4225, 4225, 4225, 4225, 4225, 4225, 4225,
+     4225, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 4226,
+     4227, 4227, 4227, 4227, 4227, 4227, 4227, 4227, 4227, 4228,
+     4228, 4228, 4228, 4228, 4228, 4228, 4228, 4228, 4229, 4229,
+     4229, 4229, 4229, 4229, 4229, 4229, 4229, 4230, 4230, 4230,
+     4230, 4230, 4230, 4230, 4230, 4230, 4231, 4231, 4231, 4231,
+
+     4231, 4231, 4231, 4231, 4231, 4232, 4232, 4232, 4232, 4232,
+     4232, 4232, 4232, 4232, 4233, 4233, 4233, 4233, 4233, 4233,
+     4233, 4233, 4233, 4234, 4234, 4234, 4234, 4234, 4234, 4234,
+     4234, 4234, 4235, 4235, 4235, 4235, 4235, 4235, 4235, 4235,
+     4235, 4236, 4236, 4236, 4236, 4236, 4236, 4236, 4236, 4236,
+     4237, 4237, 4237, 4237, 4237, 4237, 4237, 4237, 4237, 4238,
+     4238, 4238, 4238, 4238, 4238, 4238, 4238, 4238, 4239, 4239,
+     4239, 4239, 4239, 4239, 4239, 4239, 4239, 4240, 4240, 4240,
+     4240, 4240, 4240, 4240, 4240, 4240, 4241, 4241, 4241, 4241,
+     4241, 4241, 4241, 4241, 4241, 4242, 4242, 4242, 4242, 4242,
+
+     4242, 4242, 4242, 4242, 4243, 4243, 4243, 4243, 4243, 4243,
+     4243, 4243, 4243, 4244, 4244, 4244, 4244, 4244, 4244, 4244,
+     4244, 4244, 4245, 4245, 4245, 4245, 4245, 4245, 4245, 4245,
+     4245, 4246, 4246, 4246, 4246, 4246, 4246, 4246, 4246, 4246,
+     4247, 4247, 4247, 4247, 4247, 4247, 4247, 4247, 4247, 4248,
+     4248, 4248, 4248, 4248, 4248, 4248, 4248, 4248, 4249, 4249,
+     4249, 4249, 4249, 4249, 4249, 4249, 4249, 4250, 4250, 4250,
+     4250, 4250, 4250, 4250, 4250, 4250, 4251, 4251, 4251, 4251,
+     4251, 4251, 4251, 4251, 4251, 4252, 4252, 4252, 4252, 4252,
+     4252, 4252, 4252, 4252, 4253, 4253, 4253, 4253, 4253, 4253,
+
+     4253, 4253, 4253, 4254, 4254, 4254, 4254, 4254, 4254, 4254,
+     4254, 4254, 4255, 4255, 4255, 4255, 4255, 4255, 4255, 4255,
+     4255, 4256, 4256, 4256, 4256, 4256, 4256, 4256, 4256, 4256,
+     4257, 4257, 4257, 4257, 4257, 4257, 4257, 4257, 4257, 4258,
+     4258, 4258, 4258, 4258, 4258, 4258, 4258, 4258, 4259, 4259,
+     4259, 4259, 4259, 4259, 4259, 4259, 4259, 4260, 4260, 4260,
+     4260, 4260, 4260, 4260, 4260, 4260, 4261, 4261, 4261, 4261,
+     4261, 4261, 4261, 4261, 4261, 4262, 4262, 4262, 4262, 4262,
+     4262, 4262, 4262, 4262, 4263, 4263, 4263, 4263, 4263, 4263,
+     4263, 4263, 4263, 4264, 4264, 4264,  892,  891,  890, 4264,
+
+     4265, 4265, 4265,  887,  886,  885, 4265, 4266, 4266, 4266,
+      884,  881,  880, 4266, 4267, 4267, 4267,  878,  875,  874,
+     4267, 4268, 4268, 4268,  870,  869,  868, 4268, 4269, 4269,
+     4269,  867,  866,  865, 4269, 4270, 4270, 4270,  862,  861,
+      860, 4270, 4271, 4271, 4271,  859,  858,  857, 4271, 4272,
+     4272, 4272,  848,  846,  845, 4272, 4273, 4273, 4273,  842,
+      841,  840, 4273, 4274, 4274, 4274,  839,  836,  835, 4274,
+     4275, 4275, 4275,  834,  831,  829, 4275, 4276, 4276, 4276,
+      828,  827,  824, 4276, 4277, 4277, 4277,  823,  822,  821,
+     4277, 4278, 4278, 4278,  820,  816,  815, 4278, 4279, 4279,
+
+     4279,  814,  810,  809, 4279, 4280, 4280, 4280,  808,  807,
+      801, 4280, 4281, 4281, 4281,  800,  798,  790, 4281, 4282,
+     4282, 4282,  789,  785,  777, 4282, 4283, 4283, 4283,  775,
+      771,  770, 4283, 4284, 4284, 4284,  766,  760,  759, 4284,
+     4285, 4285, 4285,  758,  754,  751, 4285, 4286, 4286, 4286,
+      749,  748,  747, 4286, 4287, 4287, 4287,  743,  739,  735,
+     4287, 4288, 4288, 4288,  734,  733,  732, 4288, 4289, 4289,
+     4289,  728,  724,  721, 4289, 4290, 4290, 4290,  720,  719,
+      718, 4290, 4291, 4291, 4291,  714,  708,  707, 4291, 4292,
+     4292, 4292,  703,  695,  691, 4292, 4293, 4293, 4293,  684,
+
+      682,  681, 4293, 4294, 4294, 4294,  677,  671,  670, 4294,
+     4295, 4295, 4295,  666,  659,  658, 4295, 4296, 4296, 4296,
+     4296, 4296, 4296, 4296,  657, 4296, 4297, 4297, 4297,  656,
+      655,  651, 4297, 4298,  640,  636,  628, 4298, 4299, 4299,
+     4299,  627,  626,  625, 4299, 4300,  624,  620,  614, 4300,
+     4301, 4301, 4301,  613,  609,  603, 4301, 4302,  602,  598,
+      592, 4302, 4303, 4303, 4303,  591,  587,  583, 4303, 4304,
+      579,  578,  577, 4304, 4305, 4305, 4305,  573,  565,  561,
+     4305, 4306,  555,  554,  553, 4306, 4307, 4307, 4307,  549,
+      540,  539, 4307, 4308,  538,  537,  533, 4308, 4309, 4309,
+
+     4309,  529,  526,  525, 4309, 4310,  524,  520,  516, 4310,
+     4311, 4311, 4311,  513,  509,  505, 4311, 4312,  502,  499,
+      497, 4312, 4313, 4313, 4313,  496,  491,  484, 4313, 4314,
+      483,  482,  481, 4314, 4315, 4315, 4315,  480,  476,  469,
+     4315, 4316,  468,  467,  463, 4316, 4317, 4317, 4317,  456,
+      455,  451, 4317, 4318,  444,  443,  442, 4318, 4319, 4319,
+     4319,  438,  432,  431, 4319, 4320,  430,  426,  420, 4320,
+     4321, 4321, 4321,  416,  412,  408, 4321, 4322,  407,  406,
+      405, 4322, 4323, 4323, 4323,  404,  400,  391, 4323, 4324,
+      390,  386,  382, 4324, 4325, 4325, 4325,  377,  371,  367,
+
+     4325, 4326,  366,  362,  359, 4326, 4327, 4327, 4327,  358,
+      357,  351, 4327, 4328,  350,  348,  345, 4328, 4329, 4329,
+     4329,  333,    0,    0, 4329, 4330,    0,    0,    0, 4330,
+     4331, 4331, 4331,    0,    0,    0, 4331, 4332,    0,    0,
+        0, 4332, 4333, 4333, 4333,    0,    0,    0, 4333, 4334,
+        0,    0,    0, 4334, 4335, 4335, 4335,    0,    0,    0,
+     4335, 4336,    0,    0,    0, 4336, 4337, 4337, 4337,    0,
+        0,    0, 4337, 4338,    0,    0,    0, 4338, 4339, 4339,
+     4339,    0,    0,    0, 4339, 4340,    0,    0,    0, 4340,
+     4341, 4341, 4341,    0,    0,    0, 4341, 4342,    0,    0,
+
+        0, 4342, 4343, 4343, 4343,    0,    0,    0, 4343, 4344,
+        0,    0,    0, 4344, 4345, 4345, 4345,    0,    0,    0,
+     4345, 4346,    0,    0,    0, 4346, 4347, 4347, 4347,    0,
+        0,    0, 4347, 4348,    0,    0,    0, 4348, 4349, 4349,
+     4349,    0,    0,    0, 4349, 4350,    0,    0,    0, 4350,
+     4351, 4351, 4351,    0,    0,    0, 4351, 4352,    0,    0,
+        0, 4352, 4353, 4353, 4353,    0,    0,    0, 4353, 4354,
+        0,    0,    0, 4354, 4355, 4355, 4355,    0,    0,    0,
+     4355, 4356,    0,    0,    0, 4356, 4357, 4357, 4357,    0,
+        0,    0, 4357, 4358,    0,    0,    0, 4358, 4359, 4359,
+
+     4359,    0,    0,    0, 4359, 4360,    0,    0,    0, 4360,
+     4361, 4361, 4361, 4361, 4361, 4361, 4361, 4361, 4361, 4362,
+        0,    0,    0,    0, 4362, 4363, 4363, 4363,    0,    0,
+        0, 4363, 4364, 4364, 4364, 4364,    0,    0, 4364, 4364,
+     4365, 4365, 4365, 4365,    0, 4365,    0, 4365, 4366, 4366,
+     4366, 4366,    0,    0, 4366, 4366, 4367, 4367, 4367,    0,
+        0,    0, 4367, 4368, 4368, 4368, 4368,    0,    0, 4368,
+     4368, 4369, 4369, 4369,    0,    0,    0, 4369, 4370, 4370,
+     4370, 4370,    0,    0, 4370, 4370, 4371, 4371, 4371,    0,
+        0,    0, 4371, 4372, 4372, 4372, 4372,    0,    0, 4372,
+
+     4372, 4373, 4373, 4373, 4373,    0, 4373,    0, 4373, 4374,
+     4374, 4374, 4374,    0,    0, 4374, 4374, 4375, 4375, 4375,
+     4375,    0, 4375,    0, 4375, 4376, 4376, 4376, 4376,    0,
+        0, 4376, 4376, 4377, 4377, 4377, 4377,    0, 4377,    0,
+     4377, 4378, 4378, 4378, 4378,    0,    0, 4378, 4378, 4379,
+     4379, 4379, 4379,    0, 4379,    0, 4379, 4380, 4380, 4380,
+     4380,    0,    0, 4380, 4380, 4381, 4381, 4381,    0,    0,
+        0, 4381, 4382, 4382, 4382, 4382,    0,    0, 4382, 4382,
      4383, 4383, 4383, 4383,    0,    0, 4383, 4383, 4384, 4384,
      4384,    0,    0,    0, 4384, 4385, 4385, 4385, 4385,    0,
+
         0, 4385, 4385, 4386, 4386, 4386,    0,    0,    0, 4386,
      4387, 4387, 4387, 4387,    0,    0, 4387, 4387, 4388, 4388,
-
-     4388, 4388,    0, 4388,    0, 4388, 4389, 4389, 4389, 4389,
-        0,    0, 4389, 4389, 4390, 4390, 4390,    0,    0,    0,
-     4390, 4391, 4391, 4391, 4391,    0,    0, 4391, 4391, 4392,
-     4392, 4392,    0,    0,    0, 4392, 4393, 4393, 4393, 4393,
-        0,    0, 4393, 4393, 4394, 4394, 4394,    0,    0,    0,
-     4394, 4395, 4395, 4395, 4395,    0,    0, 4395, 4395, 4396,
-     4396, 4396, 4396, 4396, 4396, 4396, 4396, 4396, 4397, 4397,
-     4397, 4397, 4397, 4397, 4397, 4397, 4397, 4398, 4398, 4398,
-        0,    0,    0, 4398, 4399, 4399, 4399,    0,    0,    0,
-     4399, 4400, 4400, 4400, 4400,    0,    0, 4400, 4400, 4401,
-
-     4401, 4401,    0,    0,    0, 4401, 4402, 4402, 4402, 4402,
-        0,    0, 4402, 4402, 4403, 4403, 4403, 4403,    0, 4403,
-        0, 4403, 4404, 4404, 4404, 4404,    0,    0, 4404, 4404,
-     4405, 4405, 4405,    0,    0,    0, 4405, 4406, 4406, 4406,
-     4406,    0,    0, 4406, 4406, 4407, 4407, 4407,    0,    0,
-        0, 4407, 4408, 4408, 4408, 4408,    0,    0, 4408, 4408,
-     4409, 4409, 4409, 4409,    0,    0, 4409, 4409, 4410, 4410,
-     4410,    0,    0,    0, 4410, 4411, 4411, 4411, 4411,    0,
-        0, 4411, 4411, 4412, 4412, 4412,    0,    0,    0, 4412,
-     4413, 4413, 4413, 4413,    0,    0, 4413, 4413, 4414, 4414,
-
-     4414, 4414,    0, 4414,    0, 4414, 4415, 4415, 4415, 4415,
-        0,    0, 4415, 4415, 4416, 4416, 4416, 4416,    0,    0,
-     4416, 4416, 4417, 4417, 4417,    0,    0,    0, 4417, 4418,
-     4418, 4418, 4418,    0,    0, 4418, 4418, 4419, 4419, 4419,
-     4419,    0,    0, 4419, 4419, 4420, 4420, 4420, 4420,    0,
-        0, 4420, 4420, 4421, 4421, 4421,    0,    0,    0, 4421,
-     4422, 4422, 4422, 4422,    0,    0, 4422, 4422, 4423, 4423,
-     4423,    0,    0,    0, 4423, 4424, 4424, 4424, 4424,    0,
-        0, 4424, 4424, 4425, 4425, 4425, 4425,    0, 4425,    0,
-     4425, 4426, 4426, 4426, 4426,    0,    0, 4426, 4426, 4427,
-
-     4427, 4427,    0,    0,    0, 4427, 4428, 4428, 4428, 4428,
-        0,    0, 4428, 4428, 4429, 4429, 4429,    0,    0,    0,
-     4429, 4430, 4430, 4430, 4430,    0,    0, 4430, 4430, 4431,
-     4431, 4431,    0,    0,    0, 4431, 4432, 4432, 4432, 4432,
-        0,    0, 4432, 4432, 4433, 4433, 4433,    0,    0,    0,
-     4433, 4434, 4434, 4434, 4434,    0,    0, 4434, 4434, 4435,
-     4435, 4435, 4435,    0, 4435,    0, 4435, 4436, 4436, 4436,
-     4436,    0,    0, 4436, 4436, 4437, 4437, 4437,    0,    0,
-        0, 4437, 4438, 4438, 4438, 4438,    0,    0, 4438, 4438,
-     4439, 4439, 4439,    0,    0,    0, 4439, 4440, 4440, 4440,
-
-     4440,    0,    0, 4440, 4440, 4441, 4441, 4441,    0,    0,
-        0, 4441, 4442, 4442, 4442, 4442,    0,    0, 4442, 4442,
-     4443, 4443, 4443,    0,    0,    0, 4443, 4444, 4444, 4444,
-     4444,    0,    0, 4444, 4444, 4445, 4445, 4445,    0,    0,
-        0, 4445, 4446, 4446, 4446, 4446,    0,    0, 4446, 4446,
-     4447, 4447, 4447,    0,    0,    0, 4447, 4448, 4448, 4448,
-     4448,    0,    0, 4448, 4448, 4449, 4449, 4449,    0,    0,
-        0, 4449, 4450, 4450, 4450, 4450,    0,    0, 4450, 4450,
-     4451, 4451, 4451,    0,    0,    0, 4451, 4452, 4452, 4452,
-     4452,    0,    0, 4452, 4452, 4453, 4453, 4453,    0,    0,
-
-        0, 4453, 4454, 4454, 4454, 4454,    0,    0, 4454, 4454,
-     4455, 4455, 4455, 4455, 4455, 4455, 4455, 4455, 4455, 4456,
-     4456, 4456, 4456, 4456, 4456, 4456, 4456, 4456, 4457, 4457,
-     4457,    0,    0,    0, 4457, 4458, 4458, 4458, 4458,    0,
-     4458,    0, 4458, 4459, 4459, 4459, 4459,    0,    0, 4459,
-     4459, 4460, 4460, 4460,    0,    0,    0, 4460, 4461, 4461,
-     4461, 4461,    0,    0, 4461, 4461, 4462, 4462, 4462, 4462,
-        0,    0, 4462, 4462, 4463, 4463, 4463,    0,    0,    0,
-     4463, 4464, 4464, 4464, 4464,    0,    0, 4464, 4464, 4465,
-     4465, 4465, 4465,    0, 4465,    0, 4465, 4466, 4466, 4466,
-
-     4466,    0,    0, 4466, 4466, 4467, 4467, 4467, 4467,    0,
-        0, 4467, 4467, 4468, 4468, 4468, 4468,    0, 4468,    0,
+     4388,    0,    0,    0, 4388, 4389, 4389, 4389, 4389,    0,
+        0, 4389, 4389, 4390, 4390, 4390,    0,    0,    0, 4390,
+     4391, 4391, 4391, 4391,    0,    0, 4391, 4391, 4392, 4392,
+     4392,    0,    0,    0, 4392, 4393, 4393, 4393, 4393,    0,
+        0, 4393, 4393, 4394, 4394, 4394,    0,    0,    0, 4394,
+     4395, 4395, 4395, 4395,    0,    0, 4395, 4395, 4396, 4396,
+     4396,    0,    0,    0, 4396, 4397, 4397, 4397, 4397,    0,
+        0, 4397, 4397, 4398, 4398, 4398,    0,    0,    0, 4398,
+
+     4399, 4399, 4399, 4399,    0,    0, 4399, 4399, 4400, 4400,
+     4400,    0,    0,    0, 4400, 4401, 4401, 4401, 4401,    0,
+        0, 4401, 4401, 4402, 4402, 4402,    0,    0,    0, 4402,
+     4403, 4403, 4403, 4403,    0,    0, 4403, 4403, 4404, 4404,
+     4404,    0,    0,    0, 4404, 4405, 4405, 4405, 4405,    0,
+        0, 4405, 4405, 4406, 4406, 4406,    0,    0,    0, 4406,
+     4407, 4407, 4407, 4407,    0,    0, 4407, 4407, 4408, 4408,
+     4408,    0,    0,    0, 4408, 4409, 4409, 4409, 4409,    0,
+        0, 4409, 4409, 4410, 4410, 4410, 4410,    0, 4410,    0,
+     4410, 4411, 4411, 4411, 4411,    0,    0, 4411, 4411, 4412,
+
+     4412, 4412,    0,    0,    0, 4412, 4413, 4413, 4413, 4413,
+        0,    0, 4413, 4413, 4414, 4414, 4414,    0,    0,    0,
+     4414, 4415, 4415, 4415, 4415,    0,    0, 4415, 4415, 4416,
+     4416, 4416,    0,    0,    0, 4416, 4417, 4417, 4417, 4417,
+        0,    0, 4417, 4417, 4418, 4418, 4418,    0,    0,    0,
+     4418, 4419, 4419, 4419, 4419,    0,    0, 4419, 4419, 4420,
+     4420, 4420,    0,    0,    0, 4420, 4421, 4421, 4421, 4421,
+        0,    0, 4421, 4421, 4422, 4422, 4422,    0,    0,    0,
+     4422, 4423, 4423, 4423, 4423,    0,    0, 4423, 4423, 4424,
+     4424, 4424, 4424,    0, 4424,    0, 4424, 4425, 4425, 4425,
+
+     4425,    0,    0, 4425, 4425, 4426, 4426, 4426, 4426, 4426,
+     4426, 4426, 4426, 4426, 4427,    0, 4427,    0,    0, 4427,
+     4428, 4428, 4428,    0,    0,    0, 4428, 4429, 4429, 4429,
+     4429,    0,    0, 4429, 4429, 4430, 4430, 4430,    0,    0,
+        0, 4430, 4431, 4431, 4431, 4431,    0,    0, 4431, 4431,
+     4432, 4432, 4432,    0,    0,    0, 4432, 4433, 4433, 4433,
+     4433,    0,    0, 4433, 4433, 4434, 4434, 4434,    0,    0,
+        0, 4434, 4435, 4435, 4435, 4435,    0,    0, 4435, 4435,
+     4436, 4436, 4436,    0,    0,    0, 4436, 4437, 4437, 4437,
+     4437,    0,    0, 4437, 4437, 4438, 4438, 4438,    0,    0,
+
+        0, 4438, 4439, 4439, 4439, 4439,    0,    0, 4439, 4439,
+     4440, 4440, 4440, 4440,    0,    0, 4440, 4440, 4441, 4441,
+     4441,    0,    0,    0, 4441, 4442, 4442, 4442, 4442,    0,
+        0, 4442, 4442, 4443, 4443, 4443,    0,    0,    0, 4443,
+     4444, 4444, 4444, 4444,    0,    0, 4444, 4444, 4445, 4445,
+     4445,    0,    0,    0, 4445, 4446, 4446, 4446, 4446,    0,
+        0, 4446, 4446, 4447, 4447, 4447, 4447,    0,    0, 4447,
+     4447, 4448, 4448, 4448,    0,    0,    0, 4448, 4449, 4449,
+     4449, 4449,    0,    0, 4449, 4449, 4450, 4450, 4450,    0,
+        0,    0, 4450, 4451, 4451, 4451, 4451,    0,    0, 4451,
+
+     4451, 4452, 4452, 4452, 4452,    0, 4452,    0, 4452, 4453,
+     4453, 4453, 4453,    0,    0, 4453, 4453, 4454, 4454, 4454,
+     4454,    0, 4454,    0, 4454, 4455, 4455, 4455, 4455,    0,
+        0, 4455, 4455, 4456, 4456, 4456,    0,    0,    0, 4456,
+     4457, 4457, 4457, 4457,    0,    0, 4457, 4457, 4458, 4458,
+     4458,    0,    0,    0, 4458, 4459, 4459, 4459, 4459,    0,
+        0, 4459, 4459, 4460, 4460, 4460,    0,    0,    0, 4460,
+     4461, 4461, 4461, 4461,    0,    0, 4461, 4461, 4462, 4462,
+     4462, 4462,    0, 4462,    0, 4462, 4463, 4463, 4463, 4463,
+        0,    0, 4463, 4463, 4464, 4464, 4464,    0,    0,    0,
+
+     4464, 4465, 4465, 4465, 4465,    0,    0, 4465, 4465, 4466,
+     4466, 4466,    0,    0,    0, 4466, 4467, 4467, 4467, 4467,
+        0,    0, 4467, 4467, 4468, 4468, 4468,    0,    0,    0,
      4468, 4469, 4469, 4469, 4469,    0,    0, 4469, 4469, 4470,
-     4470, 4470, 4470,    0, 4470,    0, 4470, 4471, 4471, 4471,
-     4471,    0,    0, 4471, 4471, 4472, 4472, 4472, 4472,    0,
-     4472,    0, 4472, 4473, 4473, 4473, 4473,    0,    0, 4473,
-     4473, 4474, 4474, 4474, 4474,    0,    0, 4474, 4474, 4475,
-     4475, 4475,    0,    0,    0, 4475, 4476, 4476, 4476, 4476,
-        0,    0, 4476, 4476, 4477, 4477, 4477, 4477,    0,    0,
-     4477, 4477, 4478, 4478, 4478, 4478,    0,    0, 4478, 4478,
-
-     4479, 4479, 4479,    0,    0,    0, 4479, 4480, 4480, 4480,
-     4480,    0,    0, 4480, 4480, 4481, 4481, 4481,    0,    0,
-        0, 4481, 4482, 4482, 4482, 4482,    0,    0, 4482, 4482,
-     4483, 4483, 4483, 4483,    0,    0, 4483, 4483, 4484, 4484,
-     4484,    0,    0,    0, 4484, 4485, 4485, 4485, 4485,    0,
-        0, 4485, 4485, 4486, 4486, 4486,    0,    0,    0, 4486,
-     4487, 4487, 4487, 4487,    0,    0, 4487, 4487, 4488, 4488,
-     4488,    0,    0,    0, 4488, 4489, 4489, 4489, 4489,    0,
-        0, 4489, 4489, 4490, 4490, 4490,    0,    0,    0, 4490,
-     4491, 4491, 4491, 4491,    0,    0, 4491, 4491, 4492, 4492,
-
-     4492, 4492,    0,    0, 4492, 4492, 4493, 4493, 4493,    0,
-        0,    0, 4493, 4494, 4494, 4494, 4494,    0,    0, 4494,
-     4494, 4495, 4495, 4495,    0,    0,    0, 4495, 4496, 4496,
-     4496, 4496,    0,    0, 4496, 4496, 4497, 4497, 4497,    0,
-        0,    0, 4497, 4498, 4498, 4498, 4498,    0,    0, 4498,
-     4498, 4499, 4499, 4499, 4499,    0, 4499,    0, 4499, 4500,
-     4500, 4500, 4500,    0,    0, 4500, 4500, 4501, 4501, 4501,
-        0,    0,    0, 4501, 4502, 4502, 4502, 4502,    0,    0,
-     4502, 4502, 4503, 4503, 4503,    0,    0,    0, 4503, 4504,
-     4504, 4504, 4504,    0,    0, 4504, 4504, 4505, 4505, 4505,
-
-        0,    0,    0, 4505, 4506, 4506, 4506, 4506,    0,    0,
-     4506, 4506, 4507, 4507, 4507,    0,    0,    0, 4507, 4508,
-     4508, 4508, 4508,    0,    0, 4508, 4508, 4509, 4509, 4509,
-     4509,    0, 4509,    0, 4509, 4510, 4510, 4510, 4510,    0,
-        0, 4510, 4510, 4511, 4511, 4511, 4511, 4511, 4511, 4511,
-     4511, 4511, 4512, 4512, 4512, 4512, 4512, 4512, 4512, 4512,
-     4512, 4513, 4513, 4513, 4513,    0, 4513,    0, 4513, 4514,
-     4514, 4514,    0,    0,    0, 4514, 4515, 4515, 4515, 4515,
-        0,    0, 4515, 4515, 4516, 4516, 4516,    0,    0,    0,
-     4516, 4517, 4517, 4517, 4517,    0,    0, 4517, 4517, 4518,
-
-     4518, 4518, 4518,    0,    0, 4518, 4518, 4519, 4519, 4519,
-        0,    0,    0, 4519, 4520, 4520, 4520, 4520,    0,    0,
-     4520, 4520, 4521, 4521, 4521, 4521,    0,    0, 4521, 4521,
-     4522, 4522, 4522, 4522,    0,    0, 4522, 4522, 4523, 4523,
-     4523, 4523,    0,    0, 4523, 4523, 4524, 4524, 4524, 4524,
-        0, 4524,    0, 4524, 4525, 4525, 4525, 4525,    0,    0,
-     4525, 4525, 4526, 4526, 4526,    0,    0,    0, 4526, 4527,
-     4527, 4527, 4527,    0,    0, 4527, 4527, 4528, 4528, 4528,
-     4528,    0,    0, 4528, 4528, 4529, 4529, 4529,    0,    0,
-        0, 4529, 4530, 4530, 4530, 4530,    0,    0, 4530, 4530,
-
-     4531, 4531, 4531, 4531,    0,    0, 4531, 4531, 4532, 4532,
-     4532,    0,    0,    0, 4532, 4533, 4533, 4533,    0,    0,
-        0, 4533, 4534, 4534, 4534, 4534,    0,    0, 4534, 4534,
-     4535, 4535, 4535, 4535,    0,    0, 4535, 4535, 4536, 4536,
-     4536,    0,    0,    0, 4536, 4537, 4537, 4537, 4537,    0,
-        0, 4537, 4537, 4538, 4538, 4538,    0,    0,    0, 4538,
-     4539, 4539, 4539, 4539,    0, 4539,    0, 4539, 4540, 4540,
-     4540, 4540,    0,    0, 4540, 4540, 4541, 4541, 4541,    0,
-        0,    0, 4541, 4542, 4542, 4542, 4542,    0,    0, 4542,
-     4542, 4543, 4543, 4543,    0,    0,    0, 4543, 4544, 4544,
-
-     4544, 4544,    0,    0, 4544, 4544, 4545, 4545, 4545,    0,
-        0,    0, 4545, 4546, 4546, 4546, 4546,    0,    0, 4546,
-     4546, 4547, 4547, 4547,    0,    0,    0, 4547, 4548, 4548,
-     4548, 4548,    0,    0, 4548, 4548, 4549, 4549, 4549, 4549,
-        0, 4549,    0, 4549, 4550, 4550, 4550, 4550,    0,    0,
-     4550, 4550, 4551, 4551, 4551, 4551,    0, 4551,    0, 4551,
-     4552, 4552, 4552, 4552,    0,    0, 4552, 4552, 4553, 4553,
-     4553,    0,    0,    0, 4553, 4554, 4554, 4554, 4554,    0,
-        0, 4554, 4554, 4555, 4555, 4555, 4555,    0, 4555,    0,
-     4555, 4556, 4556, 4556, 4556,    0,    0, 4556, 4556, 4557,
-
-     4557, 4557, 4557,    0, 4557,    0, 4557, 4558, 4558, 4558,
-        0,    0,    0, 4558, 4559, 4559, 4559, 4559,    0,    0,
-     4559, 4559, 4560, 4560, 4560, 4560, 4560, 4560, 4560, 4560,
-     4560, 4561, 4561, 4561, 4561, 4561, 4561, 4561, 4561, 4561,
-     4562, 4562, 4562,    0,    0,    0, 4562, 4563, 4563, 4563,
-     4563,    0,    0, 4563, 4563, 4564, 4564, 4564, 4564,    0,
-     4564,    0, 4564, 4565, 4565, 4565, 4565,    0,    0, 4565,
-     4565, 4566, 4566, 4566,    0,    0,    0, 4566, 4567, 4567,
-     4567, 4567,    0,    0, 4567, 4567, 4568, 4568, 4568, 4568,
-        0,    0, 4568, 4568, 4569, 4569, 4569, 4569,    0,    0,
-
-     4569, 4569, 4570, 4570, 4570, 4570,    0,    0, 4570, 4570,
-     4571, 4571, 4571, 4571,    0,    0, 4571, 4571, 4572, 4572,
-     4572,    0,    0,    0, 4572, 4573, 4573, 4573, 4573,    0,
-        0, 4573, 4573, 4574, 4574, 4574, 4574,    0,    0, 4574,
-     4574, 4575, 4575, 4575,    0,    0,    0, 4575, 4576, 4576,
-     4576, 4576,    0,    0, 4576, 4576, 4577, 4577, 4577, 4577,
-        0,    0, 4577, 4577, 4578, 4578, 4578,    0,    0,    0,
-     4578, 4579, 4579, 4579,    0,    0,    0, 4579, 4580, 4580,
-     4580, 4580,    0,    0, 4580, 4580, 4581, 4581, 4581, 4581,
-        0,    0, 4581, 4581, 4582, 4582, 4582,    0,    0,    0,
-
-     4582, 4583, 4583, 4583,    0,    0,    0, 4583, 4584, 4584,
-     4584, 4584,    0,    0, 4584, 4584, 4585, 4585, 4585, 4585,
-        0, 4585,    0, 4585, 4586, 4586, 4586, 4586,    0,    0,
-     4586, 4586, 4587, 4587, 4587,    0,    0,    0, 4587, 4588,
-     4588, 4588, 4588,    0,    0, 4588, 4588, 4589, 4589, 4589,
-        0,    0,    0, 4589, 4590, 4590, 4590,    0,    0,    0,
-     4590, 4591, 4591, 4591, 4591,    0,    0, 4591, 4591, 4592,
-     4592, 4592, 4592,    0,    0, 4592, 4592, 4593, 4593, 4593,
-     4593,    0,    0, 4593, 4593, 4594, 4594, 4594,    0,    0,
-        0, 4594, 4595, 4595, 4595, 4595,    0,    0, 4595, 4595,
-
-     4596, 4596, 4596,    0,    0,    0, 4596, 4597, 4597, 4597,
-     4597,    0,    0, 4597, 4597, 4598, 4598, 4598, 4598, 4598,
-     4598, 4598, 4598, 4598, 4599, 4599, 4599, 4599, 4599, 4599,
-     4599, 4599, 4599, 4600, 4600, 4600,    0,    0,    0, 4600,
-     4601, 4601, 4601, 4601,    0,    0, 4601, 4601, 4602, 4602,
-     4602, 4602,    0, 4602,    0, 4602, 4603, 4603, 4603, 4603,
-        0,    0, 4603, 4603, 4604, 4604, 4604, 4604,    0, 4604,
-        0, 4604, 4605, 4605, 4605, 4605,    0,    0, 4605, 4605,
+     4470, 4470,    0,    0,    0, 4470, 4471, 4471, 4471, 4471,
+        0,    0, 4471, 4471, 4472, 4472, 4472,    0,    0,    0,
+     4472, 4473, 4473, 4473, 4473,    0,    0, 4473, 4473, 4474,
+     4474, 4474,    0,    0,    0, 4474, 4475, 4475, 4475, 4475,
+        0,    0, 4475, 4475, 4476, 4476, 4476,    0,    0,    0,
+     4476, 4477, 4477, 4477, 4477,    0,    0, 4477, 4477, 4478,
+
+     4478, 4478,    0,    0,    0, 4478, 4479, 4479, 4479, 4479,
+        0,    0, 4479, 4479, 4480, 4480, 4480,    0,    0,    0,
+     4480, 4481, 4481, 4481, 4481,    0,    0, 4481, 4481, 4482,
+     4482, 4482, 4482,    0, 4482,    0, 4482, 4483, 4483, 4483,
+     4483,    0,    0, 4483, 4483, 4484, 4484, 4484,    0,    0,
+        0, 4484, 4485, 4485, 4485, 4485,    0,    0, 4485, 4485,
+     4486, 4486, 4486,    0,    0,    0, 4486, 4487, 4487, 4487,
+     4487,    0,    0, 4487, 4487, 4488, 4488, 4488,    0,    0,
+        0, 4488, 4489, 4489, 4489, 4489,    0,    0, 4489, 4489,
+     4490, 4490, 4490, 4490, 4490, 4490, 4490, 4490, 4490, 4491,
+
+     4491, 4491, 4491, 4491, 4491, 4491, 4491, 4491, 4492, 4492,
+     4492,    0,    0,    0, 4492, 4493, 4493, 4493,    0,    0,
+        0, 4493, 4494, 4494, 4494, 4494,    0,    0, 4494, 4494,
+     4495, 4495, 4495,    0,    0,    0, 4495, 4496, 4496, 4496,
+     4496,    0,    0, 4496, 4496, 4497, 4497, 4497, 4497,    0,
+     4497,    0, 4497, 4498, 4498, 4498, 4498,    0,    0, 4498,
+     4498, 4499, 4499, 4499,    0,    0,    0, 4499, 4500, 4500,
+     4500, 4500,    0,    0, 4500, 4500, 4501, 4501, 4501,    0,
+        0,    0, 4501, 4502, 4502, 4502, 4502,    0,    0, 4502,
+     4502, 4503, 4503, 4503, 4503,    0,    0, 4503, 4503, 4504,
+
+     4504, 4504,    0,    0,    0, 4504, 4505, 4505, 4505, 4505,
+        0,    0, 4505, 4505, 4506, 4506, 4506,    0,    0,    0,
+     4506, 4507, 4507, 4507, 4507,    0,    0, 4507, 4507, 4508,
+     4508, 4508, 4508,    0, 4508,    0, 4508, 4509, 4509, 4509,
+     4509,    0,    0, 4509, 4509, 4510, 4510, 4510, 4510,    0,
+        0, 4510, 4510, 4511, 4511, 4511,    0,    0,    0, 4511,
+     4512, 4512, 4512, 4512,    0,    0, 4512, 4512, 4513, 4513,
+     4513,    0,    0,    0, 4513, 4514, 4514, 4514, 4514,    0,
+        0, 4514, 4514, 4515, 4515, 4515, 4515,    0,    0, 4515,
+     4515, 4516, 4516, 4516, 4516,    0,    0, 4516, 4516, 4517,
+
+     4517, 4517,    0,    0,    0, 4517, 4518, 4518, 4518, 4518,
+        0,    0, 4518, 4518, 4519, 4519, 4519,    0,    0,    0,
+     4519, 4520, 4520, 4520, 4520,    0,    0, 4520, 4520, 4521,
+     4521, 4521, 4521,    0, 4521,    0, 4521, 4522, 4522, 4522,
+     4522,    0,    0, 4522, 4522, 4523, 4523, 4523,    0,    0,
+        0, 4523, 4524, 4524, 4524, 4524,    0,    0, 4524, 4524,
+     4525, 4525, 4525,    0,    0,    0, 4525, 4526, 4526, 4526,
+     4526,    0,    0, 4526, 4526, 4527, 4527, 4527,    0,    0,
+        0, 4527, 4528, 4528, 4528, 4528,    0,    0, 4528, 4528,
+     4529, 4529, 4529,    0,    0,    0, 4529, 4530, 4530, 4530,
+
+     4530,    0,    0, 4530, 4530, 4531, 4531, 4531, 4531,    0,
+     4531,    0, 4531, 4532, 4532, 4532, 4532,    0,    0, 4532,
+     4532, 4533, 4533, 4533,    0,    0,    0, 4533, 4534, 4534,
+     4534, 4534,    0,    0, 4534, 4534, 4535, 4535, 4535,    0,
+        0,    0, 4535, 4536, 4536, 4536, 4536,    0,    0, 4536,
+     4536, 4537, 4537, 4537,    0,    0,    0, 4537, 4538, 4538,
+     4538, 4538,    0,    0, 4538, 4538, 4539, 4539, 4539,    0,
+        0,    0, 4539, 4540, 4540, 4540, 4540,    0,    0, 4540,
+     4540, 4541, 4541, 4541,    0,    0,    0, 4541, 4542, 4542,
+     4542, 4542,    0,    0, 4542, 4542, 4543, 4543, 4543,    0,
+
+        0,    0, 4543, 4544, 4544, 4544, 4544,    0,    0, 4544,
+     4544, 4545, 4545, 4545,    0,    0,    0, 4545, 4546, 4546,
+     4546, 4546,    0,    0, 4546, 4546, 4547, 4547, 4547,    0,
+        0,    0, 4547, 4548, 4548, 4548, 4548,    0,    0, 4548,
+     4548, 4549, 4549, 4549,    0,    0,    0, 4549, 4550, 4550,
+     4550, 4550,    0,    0, 4550, 4550, 4551, 4551, 4551, 4551,
+     4551, 4551, 4551, 4551, 4551, 4552, 4552, 4552, 4552, 4552,
+     4552, 4552, 4552, 4552, 4553, 4553, 4553,    0,    0,    0,
+     4553, 4554, 4554, 4554, 4554,    0, 4554,    0, 4554, 4555,
+     4555, 4555, 4555,    0,    0, 4555, 4555, 4556, 4556, 4556,
+
+        0,    0,    0, 4556, 4557, 4557, 4557, 4557,    0,    0,
+     4557, 4557, 4558, 4558, 4558, 4558,    0,    0, 4558, 4558,
+     4559, 4559, 4559,    0,    0,    0, 4559, 4560, 4560, 4560,
+     4560,    0,    0, 4560, 4560, 4561, 4561, 4561, 4561,    0,
+     4561,    0, 4561, 4562, 4562, 4562, 4562,    0,    0, 4562,
+     4562, 4563, 4563, 4563, 4563,    0,    0, 4563, 4563, 4564,
+     4564, 4564, 4564,    0, 4564,    0, 4564, 4565, 4565, 4565,
+     4565,    0,    0, 4565, 4565, 4566, 4566, 4566, 4566,    0,
+     4566,    0, 4566, 4567, 4567, 4567, 4567,    0,    0, 4567,
+     4567, 4568, 4568, 4568, 4568,    0, 4568,    0, 4568, 4569,
+
+     4569, 4569, 4569,    0,    0, 4569, 4569, 4570, 4570, 4570,
+     4570,    0,    0, 4570, 4570, 4571, 4571, 4571,    0,    0,
+        0, 4571, 4572, 4572, 4572, 4572,    0,    0, 4572, 4572,
+     4573, 4573, 4573,    0,    0,    0, 4573, 4574, 4574, 4574,
+     4574,    0,    0, 4574, 4574, 4575, 4575, 4575, 4575,    0,
+        0, 4575, 4575, 4576, 4576, 4576, 4576,    0,    0, 4576,
+     4576, 4577, 4577, 4577,    0,    0,    0, 4577, 4578, 4578,
+     4578, 4578,    0,    0, 4578, 4578, 4579, 4579, 4579,    0,
+        0,    0, 4579, 4580, 4580, 4580, 4580,    0,    0, 4580,
+     4580, 4581, 4581, 4581, 4581,    0,    0, 4581, 4581, 4582,
+
+     4582, 4582,    0,    0,    0, 4582, 4583, 4583, 4583, 4583,
+        0,    0, 4583, 4583, 4584, 4584, 4584,    0,    0,    0,
+     4584, 4585, 4585, 4585, 4585,    0,    0, 4585, 4585, 4586,
+     4586, 4586,    0,    0,    0, 4586, 4587, 4587, 4587, 4587,
+        0,    0, 4587, 4587, 4588, 4588, 4588,    0,    0,    0,
+     4588, 4589, 4589, 4589, 4589,    0,    0, 4589, 4589, 4590,
+     4590, 4590, 4590,    0,    0, 4590, 4590, 4591, 4591, 4591,
+        0,    0,    0, 4591, 4592, 4592, 4592, 4592,    0,    0,
+     4592, 4592, 4593, 4593, 4593,    0,    0,    0, 4593, 4594,
+     4594, 4594, 4594,    0,    0, 4594, 4594, 4595, 4595, 4595,
+
+        0,    0,    0, 4595, 4596, 4596, 4596, 4596,    0,    0,
+     4596, 4596, 4597, 4597, 4597, 4597,    0, 4597,    0, 4597,
+     4598, 4598, 4598, 4598,    0,    0, 4598, 4598, 4599, 4599,
+     4599,    0,    0,    0, 4599, 4600, 4600, 4600, 4600,    0,
+        0, 4600, 4600, 4601, 4601, 4601,    0,    0,    0, 4601,
+     4602, 4602, 4602, 4602,    0,    0, 4602, 4602, 4603, 4603,
+     4603,    0,    0,    0, 4603, 4604, 4604, 4604, 4604,    0,
+        0, 4604, 4604, 4605, 4605, 4605,    0,    0,    0, 4605,
      4606, 4606, 4606, 4606,    0,    0, 4606, 4606, 4607, 4607,
-     4607, 4607,    0,    0, 4607, 4607, 4608, 4608, 4608, 4608,
-
-        0,    0, 4608, 4608, 4609, 4609, 4609, 4609,    0,    0,
-     4609, 4609, 4610, 4610, 4610,    0,    0,    0, 4610, 4611,
-     4611, 4611, 4611,    0,    0, 4611, 4611, 4612, 4612, 4612,
-        0,    0,    0, 4612, 4613, 4613, 4613, 4613,    0,    0,
-     4613, 4613, 4614, 4614, 4614, 4614,    0,    0, 4614, 4614,
-     4615, 4615, 4615, 4615,    0, 4615,    0, 4615, 4616, 4616,
-     4616, 4616,    0, 4616,    0, 4616, 4617, 4617, 4617, 4617,
-        0,    0, 4617, 4617, 4618, 4618, 4618, 4618,    0,    0,
-     4618, 4618, 4619, 4619, 4619, 4619,    0, 4619,    0, 4619,
-     4620, 4620, 4620,    0,    0,    0, 4620, 4621, 4621, 4621,
-
-     4621,    0,    0, 4621, 4621, 4622, 4622, 4622, 4622,    0,
-     4622,    0, 4622, 4623, 4623, 4623, 4623,    0,    0, 4623,
-     4623, 4624, 4624, 4624, 4624,    0, 4624,    0, 4624, 4625,
-     4625, 4625,    0,    0,    0, 4625, 4626, 4626, 4626,    0,
-        0,    0, 4626, 4627, 4627, 4627, 4627,    0,    0, 4627,
-     4627, 4628, 4628, 4628, 4628,    0,    0, 4628, 4628, 4629,
-     4629, 4629,    0,    0,    0, 4629, 4630, 4630, 4630, 4630,
-        0,    0, 4630, 4630, 4631, 4631, 4631,    0,    0,    0,
-     4631, 4632, 4632, 4632, 4632,    0,    0, 4632, 4632, 4633,
-     4633, 4633, 4633, 4633, 4633, 4633, 4633, 4633, 4634, 4634,
-
-     4634, 4634, 4634, 4634, 4634, 4634, 4634, 4635, 4635, 4635,
-        0,    0,    0, 4635, 4636, 4636, 4636, 4636,    0, 4636,
-        0, 4636, 4637, 4637, 4637, 4637,    0,    0, 4637, 4637,
-     4638, 4638, 4638, 4638,    0,    0, 4638, 4638, 4639, 4639,
-     4639, 4639,    0,    0, 4639, 4639, 4640, 4640, 4640, 4640,
-        0,    0, 4640, 4640, 4641, 4641, 4641, 4641,    0,    0,
-     4641, 4641, 4642, 4642, 4642,    0,    0,    0, 4642, 4643,
-     4643, 4643,    0,    0,    0, 4643, 4644, 4644, 4644, 4644,
-        0,    0, 4644, 4644, 4645, 4645, 4645,    0,    0,    0,
-     4645, 4646, 4646, 4646, 4646,    0,    0, 4646, 4646, 4647,
-
-     4647, 4647, 4647,    0,    0, 4647, 4647, 4648, 4648, 4648,
-        0,    0,    0, 4648, 4649, 4649, 4649, 4649,    0,    0,
-     4649, 4649, 4650, 4650, 4650, 4650,    0, 4650,    0, 4650,
-     4651, 4651, 4651,    0,    0,    0, 4651, 4652, 4652, 4652,
-        0,    0,    0, 4652, 4653, 4653, 4653,    0,    0,    0,
-     4653, 4654, 4654, 4654, 4654, 4654, 4654, 4654, 4654, 4654,
-     4655, 4655, 4655, 4655, 4655, 4655, 4655, 4655, 4655, 4656,
-     4656, 4656, 4656, 4656, 4656, 4656, 4656, 4656, 4657, 4657,
-     4657, 4657, 4657, 4657, 4657, 4657, 4657, 4658, 4658, 4658,
-     4658, 4658, 4658, 4658, 4658, 4658, 4659, 4659, 4659, 4659,
-
-     4659, 4659, 4659, 4659, 4659, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107, 4107,
-     4107
+     4607, 4607,    0, 4607,    0, 4607, 4608, 4608, 4608, 4608,
+
+        0,    0, 4608, 4608, 4609, 4609, 4609, 4609, 4609, 4609,
+     4609, 4609, 4609, 4610, 4610, 4610, 4610, 4610, 4610, 4610,
+     4610, 4610, 4611, 4611, 4611, 4611,    0, 4611,    0, 4611,
+     4612, 4612, 4612,    0,    0,    0, 4612, 4613, 4613, 4613,
+     4613,    0,    0, 4613, 4613, 4614, 4614, 4614,    0,    0,
+        0, 4614, 4615, 4615, 4615, 4615,    0,    0, 4615, 4615,
+     4616, 4616, 4616, 4616,    0,    0, 4616, 4616, 4617, 4617,
+     4617,    0,    0,    0, 4617, 4618, 4618, 4618, 4618,    0,
+        0, 4618, 4618, 4619, 4619, 4619, 4619,    0,    0, 4619,
+     4619, 4620, 4620, 4620, 4620,    0,    0, 4620, 4620, 4621,
+
+     4621, 4621, 4621,    0,    0, 4621, 4621, 4622, 4622, 4622,
+     4622,    0, 4622,    0, 4622, 4623, 4623, 4623, 4623,    0,
+        0, 4623, 4623, 4624, 4624, 4624,    0,    0,    0, 4624,
+     4625, 4625, 4625, 4625,    0,    0, 4625, 4625, 4626, 4626,
+     4626, 4626,    0,    0, 4626, 4626, 4627, 4627, 4627, 4627,
+        0, 4627,    0, 4627, 4628, 4628, 4628,    0,    0,    0,
+     4628, 4629, 4629, 4629, 4629,    0,    0, 4629, 4629, 4630,
+     4630, 4630, 4630,    0,    0, 4630, 4630, 4631, 4631, 4631,
+        0,    0,    0, 4631, 4632, 4632, 4632,    0,    0,    0,
+     4632, 4633, 4633, 4633, 4633,    0,    0, 4633, 4633, 4634,
+
+     4634, 4634, 4634,    0,    0, 4634, 4634, 4635, 4635, 4635,
+        0,    0,    0, 4635, 4636, 4636, 4636, 4636,    0,    0,
+     4636, 4636, 4637, 4637, 4637,    0,    0,    0, 4637, 4638,
+     4638, 4638, 4638,    0, 4638,    0, 4638, 4639, 4639, 4639,
+     4639,    0,    0, 4639, 4639, 4640, 4640, 4640,    0,    0,
+        0, 4640, 4641, 4641, 4641, 4641,    0,    0, 4641, 4641,
+     4642, 4642, 4642,    0,    0,    0, 4642, 4643, 4643, 4643,
+     4643,    0,    0, 4643, 4643, 4644, 4644, 4644,    0,    0,
+        0, 4644, 4645, 4645, 4645, 4645,    0,    0, 4645, 4645,
+     4646, 4646, 4646,    0,    0,    0, 4646, 4647, 4647, 4647,
+
+     4647,    0,    0, 4647, 4647, 4648, 4648, 4648, 4648,    0,
+     4648,    0, 4648, 4649, 4649, 4649, 4649,    0,    0, 4649,
+     4649, 4650, 4650, 4650, 4650,    0, 4650,    0, 4650, 4651,
+     4651, 4651, 4651,    0,    0, 4651, 4651, 4652, 4652, 4652,
+        0,    0,    0, 4652, 4653, 4653, 4653, 4653,    0,    0,
+     4653, 4653, 4654, 4654, 4654, 4654,    0, 4654,    0, 4654,
+     4655, 4655, 4655, 4655,    0,    0, 4655, 4655, 4656, 4656,
+     4656, 4656,    0, 4656,    0, 4656, 4657, 4657, 4657,    0,
+        0,    0, 4657, 4658, 4658, 4658, 4658,    0,    0, 4658,
+     4658, 4659, 4659, 4659, 4659, 4659, 4659, 4659, 4659, 4659,
+
+     4660, 4660, 4660, 4660, 4660, 4660, 4660, 4660, 4660, 4661,
+     4661, 4661,    0,    0,    0, 4661, 4662, 4662, 4662, 4662,
+        0,    0, 4662, 4662, 4663, 4663, 4663, 4663,    0, 4663,
+        0, 4663, 4664, 4664, 4664, 4664,    0,    0, 4664, 4664,
+     4665, 4665, 4665,    0,    0,    0, 4665, 4666, 4666, 4666,
+     4666,    0,    0, 4666, 4666, 4667, 4667, 4667, 4667,    0,
+        0, 4667, 4667, 4668, 4668, 4668, 4668,    0,    0, 4668,
+     4668, 4669, 4669, 4669, 4669,    0,    0, 4669, 4669, 4670,
+     4670, 4670, 4670,    0,    0, 4670, 4670, 4671, 4671, 4671,
+        0,    0,    0, 4671, 4672, 4672, 4672, 4672,    0,    0,
+
+     4672, 4672, 4673, 4673, 4673, 4673,    0,    0, 4673, 4673,
+     4674, 4674, 4674, 4674,    0, 4674,    0, 4674, 4675, 4675,
+     4675,    0,    0,    0, 4675, 4676, 4676, 4676, 4676,    0,
+        0, 4676, 4676, 4677, 4677, 4677, 4677,    0,    0, 4677,
+     4677, 4678, 4678, 4678,    0,    0,    0, 4678, 4679, 4679,
+     4679,    0,    0,    0, 4679, 4680, 4680, 4680, 4680,    0,
+        0, 4680, 4680, 4681, 4681, 4681, 4681,    0,    0, 4681,
+     4681, 4682, 4682, 4682,    0,    0,    0, 4682, 4683, 4683,
+     4683,    0,    0,    0, 4683, 4684, 4684, 4684, 4684,    0,
+        0, 4684, 4684, 4685, 4685, 4685, 4685,    0, 4685,    0,
+
+     4685, 4686, 4686, 4686, 4686,    0,    0, 4686, 4686, 4687,
+     4687, 4687,    0,    0,    0, 4687, 4688, 4688, 4688, 4688,
+        0,    0, 4688, 4688, 4689, 4689, 4689,    0,    0,    0,
+     4689, 4690, 4690, 4690,    0,    0,    0, 4690, 4691, 4691,
+     4691, 4691,    0,    0, 4691, 4691, 4692, 4692, 4692, 4692,
+        0,    0, 4692, 4692, 4693, 4693, 4693, 4693,    0,    0,
+     4693, 4693, 4694, 4694, 4694,    0,    0,    0, 4694, 4695,
+     4695, 4695, 4695,    0,    0, 4695, 4695, 4696, 4696, 4696,
+        0,    0,    0, 4696, 4697, 4697, 4697, 4697,    0,    0,
+     4697, 4697, 4698, 4698, 4698, 4698, 4698, 4698, 4698, 4698,
+
+     4698, 4699, 4699, 4699, 4699, 4699, 4699, 4699, 4699, 4699,
+     4700, 4700, 4700,    0,    0,    0, 4700, 4701, 4701, 4701,
+     4701,    0,    0, 4701, 4701, 4702, 4702, 4702, 4702,    0,
+     4702,    0, 4702, 4703, 4703, 4703, 4703,    0,    0, 4703,
+     4703, 4704, 4704, 4704, 4704,    0, 4704,    0, 4704, 4705,
+     4705, 4705, 4705,    0,    0, 4705, 4705, 4706, 4706, 4706,
+     4706,    0,    0, 4706, 4706, 4707, 4707, 4707, 4707,    0,
+        0, 4707, 4707, 4708, 4708, 4708, 4708,    0,    0, 4708,
+     4708, 4709, 4709, 4709, 4709,    0,    0, 4709, 4709, 4710,
+     4710, 4710,    0,    0,    0, 4710, 4711, 4711, 4711, 4711,
+
+        0,    0, 4711, 4711, 4712, 4712, 4712,    0,    0,    0,
+     4712, 4713, 4713, 4713, 4713,    0,    0, 4713, 4713, 4714,
+     4714, 4714, 4714,    0,    0, 4714, 4714, 4715, 4715, 4715,
+     4715,    0, 4715,    0, 4715, 4716, 4716, 4716, 4716,    0,
+     4716,    0, 4716, 4717, 4717, 4717, 4717,    0,    0, 4717,
+     4717, 4718, 4718, 4718, 4718,    0,    0, 4718, 4718, 4719,
+     4719, 4719, 4719,    0, 4719,    0, 4719, 4720, 4720, 4720,
+        0,    0,    0, 4720, 4721, 4721, 4721, 4721,    0,    0,
+     4721, 4721, 4722, 4722, 4722, 4722,    0, 4722,    0, 4722,
+     4723, 4723, 4723, 4723,    0,    0, 4723, 4723, 4724, 4724,
+
+     4724, 4724,    0, 4724,    0, 4724, 4725, 4725, 4725,    0,
+        0,    0, 4725, 4726, 4726, 4726,    0,    0,    0, 4726,
+     4727, 4727, 4727, 4727,    0,    0, 4727, 4727, 4728, 4728,
+     4728, 4728,    0,    0, 4728, 4728, 4729, 4729, 4729,    0,
+        0,    0, 4729, 4730, 4730, 4730, 4730,    0,    0, 4730,
+     4730, 4731, 4731, 4731,    0,    0,    0, 4731, 4732, 4732,
+     4732, 4732,    0,    0, 4732, 4732, 4733, 4733, 4733, 4733,
+     4733, 4733, 4733, 4733, 4733, 4734, 4734, 4734, 4734, 4734,
+     4734, 4734, 4734, 4734, 4735, 4735, 4735,    0,    0,    0,
+     4735, 4736, 4736, 4736, 4736,    0, 4736,    0, 4736, 4737,
+
+     4737, 4737, 4737,    0,    0, 4737, 4737, 4738, 4738, 4738,
+     4738,    0,    0, 4738, 4738, 4739, 4739, 4739, 4739,    0,
+        0, 4739, 4739, 4740, 4740, 4740, 4740,    0,    0, 4740,
+     4740, 4741, 4741, 4741, 4741,    0,    0, 4741, 4741, 4742,
+     4742, 4742,    0,    0,    0, 4742, 4743, 4743, 4743,    0,
+        0,    0, 4743, 4744, 4744, 4744, 4744,    0,    0, 4744,
+     4744, 4745, 4745, 4745,    0,    0,    0, 4745, 4746, 4746,
+     4746, 4746,    0,    0, 4746, 4746, 4747, 4747, 4747, 4747,
+        0,    0, 4747, 4747, 4748, 4748, 4748,    0,    0,    0,
+     4748, 4749, 4749, 4749, 4749,    0,    0, 4749, 4749, 4750,
+
+     4750, 4750, 4750,    0, 4750,    0, 4750, 4751, 4751, 4751,
+        0,    0,    0, 4751, 4752, 4752, 4752,    0,    0,    0,
+     4752, 4753, 4753, 4753,    0,    0,    0, 4753, 4754, 4754,
+     4754, 4754, 4754, 4754, 4754, 4754, 4754, 4755, 4755, 4755,
+     4755, 4755, 4755, 4755, 4755, 4755, 4756, 4756, 4756, 4756,
+     4756, 4756, 4756, 4756, 4756, 4757, 4757, 4757, 4757, 4757,
+     4757, 4757, 4757, 4757, 4758, 4758, 4758, 4758, 4758, 4758,
+     4758, 4758, 4758, 4759, 4759, 4759, 4759, 4759, 4759, 4759,
+     4759, 4759, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192,
+     4192, 4192, 4192, 4192, 4192, 4192, 4192, 4192
     } ;
 
 /* Table of booleans, true if rule could match eol. */
-static const flex_int32_t yy_rule_can_match_eol[669] =
+static const flex_int32_t yy_rule_can_match_eol[686] =
     {   0,
 0, 0, 0, 0, 0, 1, 0, 0, 1, 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, 
@@ -5315,27 +5429,28 @@ static const flex_int32_t yy_rule_can_match_eol[669] =
     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, 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, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 
     1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 
-    1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 
-    1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
-    1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 
-    0, 1, 1, 1, 1, 1, 1, 1, 1, 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, 
+    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, 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, 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, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
+    0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 
+    1, 1, 1, 1, 1, 1, 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, 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, 1, 1, 1, 1, 0, 0, 0, 
+    0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 
+    1, 0, 0, 0, 1, 0,     };
 
 static yy_state_type yy_last_accepting_state;
 static char *yy_last_accepting_cpos;
@@ -5589,6 +5704,15 @@ short int surfxml_cluster_topology_isset;
 AT_surfxml_config_id AX_surfxml_config_id;
 #define A_surfxml_config_id (surfxml_bufferstack + AX_surfxml_config_id)
 short int surfxml_config_id_isset;
+AT_surfxml_disk_id AX_surfxml_disk_id;
+#define A_surfxml_disk_id (surfxml_bufferstack + AX_surfxml_disk_id)
+short int surfxml_disk_id_isset;
+AT_surfxml_disk_read___bw AX_surfxml_disk_read___bw;
+#define A_surfxml_disk_read___bw (surfxml_bufferstack + AX_surfxml_disk_read___bw)
+short int surfxml_disk_read___bw_isset;
+AT_surfxml_disk_write___bw AX_surfxml_disk_write___bw;
+#define A_surfxml_disk_write___bw (surfxml_bufferstack + AX_surfxml_disk_write___bw)
+short int surfxml_disk_write___bw_isset;
 AT_surfxml_host_availability___file AX_surfxml_host_availability___file;
 #define A_surfxml_host_availability___file (surfxml_bufferstack + AX_surfxml_host_availability___file)
 short int surfxml_host_availability___file_isset;
@@ -6035,98 +6159,103 @@ const char* *surfxml_statenames=NULL;
 #define S_surfxml_config_1 66
 #define S_surfxml_config_2 67
 #define E_surfxml_config 68
-#define AL_surfxml_host 69
-#define S_surfxml_host 70
-#define S_surfxml_host_1 71
-#define S_surfxml_host_2 72
-#define E_surfxml_host 73
-#define AL_surfxml_host___link 74
-#define E_surfxml_host___link 75
-#define AL_surfxml_include 76
-#define S_surfxml_include 77
-#define S_surfxml_include_1 78
-#define S_surfxml_include_2 79
-#define E_surfxml_include 80
-#define AL_surfxml_link 81
-#define S_surfxml_link 82
-#define S_surfxml_link_1 83
-#define S_surfxml_link_2 84
-#define E_surfxml_link 85
-#define AL_surfxml_link___ctn 86
-#define E_surfxml_link___ctn 87
-#define AL_surfxml_model___prop 88
-#define E_surfxml_model___prop 89
-#define AL_surfxml_mount 90
-#define E_surfxml_mount 91
-#define AL_surfxml_peer 92
-#define E_surfxml_peer 93
-#define ROOT_surfxml_platform 94
-#define AL_surfxml_platform 95
-#define S_surfxml_platform 96
-#define S_surfxml_platform_1 97
-#define S_surfxml_platform_2 98
-#define S_surfxml_platform_3 99
-#define S_surfxml_platform_4 100
-#define S_surfxml_platform_5 101
-#define S_surfxml_platform_6 102
-#define S_surfxml_platform_7 103
-#define S_surfxml_platform_8 104
-#define E_surfxml_platform 105
-#define AL_surfxml_process 106
-#define S_surfxml_process 107
-#define S_surfxml_process_1 108
-#define S_surfxml_process_2 109
-#define E_surfxml_process 110
-#define AL_surfxml_prop 111
-#define E_surfxml_prop 112
-#define AL_surfxml_random 113
-#define E_surfxml_random 114
-#define AL_surfxml_route 115
-#define S_surfxml_route 116
-#define S_surfxml_route_1 117
-#define S_surfxml_route_2 118
-#define E_surfxml_route 119
-#define AL_surfxml_router 120
-#define E_surfxml_router 121
-#define AL_surfxml_storage 122
-#define S_surfxml_storage 123
-#define S_surfxml_storage_1 124
-#define S_surfxml_storage_2 125
-#define E_surfxml_storage 126
-#define AL_surfxml_storage___type 127
-#define S_surfxml_storage___type 128
-#define S_surfxml_storage___type_1 129
-#define S_surfxml_storage___type_2 130
-#define E_surfxml_storage___type 131
-#define AL_surfxml_trace 132
-#define IN_trace 133
-#define AL_surfxml_trace___connect 134
-#define E_surfxml_trace___connect 135
-#define AL_surfxml_zone 136
-#define S_surfxml_zone 137
-#define S_surfxml_zone_1 138
-#define S_surfxml_zone_2 139
-#define S_surfxml_zone_3 140
-#define S_surfxml_zone_4 141
-#define S_surfxml_zone_5 142
-#define S_surfxml_zone_6 143
-#define S_surfxml_zone_7 144
-#define S_surfxml_zone_8 145
-#define S_surfxml_zone_9 146
-#define S_surfxml_zone_10 147
-#define S_surfxml_zone_11 148
-#define S_surfxml_zone_12 149
-#define S_surfxml_zone_13 150
-#define S_surfxml_zone_14 151
-#define S_surfxml_zone_15 152
-#define S_surfxml_zone_16 153
-#define E_surfxml_zone 154
-#define AL_surfxml_zoneRoute 155
-#define S_surfxml_zoneRoute 156
-#define S_surfxml_zoneRoute_1 157
-#define S_surfxml_zoneRoute_2 158
-#define E_surfxml_zoneRoute 159
-#define IMPOSSIBLE 160
+#define AL_surfxml_disk 69
+#define S_surfxml_disk 70
+#define S_surfxml_disk_1 71
+#define S_surfxml_disk_2 72
+#define E_surfxml_disk 73
+#define AL_surfxml_host 74
+#define S_surfxml_host 75
+#define S_surfxml_host_1 76
+#define S_surfxml_host_2 77
+#define E_surfxml_host 78
+#define AL_surfxml_host___link 79
+#define E_surfxml_host___link 80
+#define AL_surfxml_include 81
+#define S_surfxml_include 82
+#define S_surfxml_include_1 83
+#define S_surfxml_include_2 84
+#define E_surfxml_include 85
+#define AL_surfxml_link 86
+#define S_surfxml_link 87
+#define S_surfxml_link_1 88
+#define S_surfxml_link_2 89
+#define E_surfxml_link 90
+#define AL_surfxml_link___ctn 91
+#define E_surfxml_link___ctn 92
+#define AL_surfxml_model___prop 93
+#define E_surfxml_model___prop 94
+#define AL_surfxml_mount 95
+#define E_surfxml_mount 96
+#define AL_surfxml_peer 97
+#define E_surfxml_peer 98
+#define ROOT_surfxml_platform 99
+#define AL_surfxml_platform 100
+#define S_surfxml_platform 101
+#define S_surfxml_platform_1 102
+#define S_surfxml_platform_2 103
+#define S_surfxml_platform_3 104
+#define S_surfxml_platform_4 105
+#define S_surfxml_platform_5 106
+#define S_surfxml_platform_6 107
+#define S_surfxml_platform_7 108
+#define S_surfxml_platform_8 109
+#define E_surfxml_platform 110
+#define AL_surfxml_process 111
+#define S_surfxml_process 112
+#define S_surfxml_process_1 113
+#define S_surfxml_process_2 114
+#define E_surfxml_process 115
+#define AL_surfxml_prop 116
+#define E_surfxml_prop 117
+#define AL_surfxml_random 118
+#define E_surfxml_random 119
+#define AL_surfxml_route 120
+#define S_surfxml_route 121
+#define S_surfxml_route_1 122
+#define S_surfxml_route_2 123
+#define E_surfxml_route 124
+#define AL_surfxml_router 125
+#define E_surfxml_router 126
+#define AL_surfxml_storage 127
+#define S_surfxml_storage 128
+#define S_surfxml_storage_1 129
+#define S_surfxml_storage_2 130
+#define E_surfxml_storage 131
+#define AL_surfxml_storage___type 132
+#define S_surfxml_storage___type 133
+#define S_surfxml_storage___type_1 134
+#define S_surfxml_storage___type_2 135
+#define E_surfxml_storage___type 136
+#define AL_surfxml_trace 137
+#define IN_trace 138
+#define AL_surfxml_trace___connect 139
+#define E_surfxml_trace___connect 140
+#define AL_surfxml_zone 141
+#define S_surfxml_zone 142
+#define S_surfxml_zone_1 143
+#define S_surfxml_zone_2 144
+#define S_surfxml_zone_3 145
+#define S_surfxml_zone_4 146
+#define S_surfxml_zone_5 147
+#define S_surfxml_zone_6 148
+#define S_surfxml_zone_7 149
+#define S_surfxml_zone_8 150
+#define S_surfxml_zone_9 151
+#define S_surfxml_zone_10 152
+#define S_surfxml_zone_11 153
+#define S_surfxml_zone_12 154
+#define S_surfxml_zone_13 155
+#define S_surfxml_zone_14 156
+#define S_surfxml_zone_15 157
+#define S_surfxml_zone_16 158
+#define E_surfxml_zone 159
+#define AL_surfxml_zoneRoute 160
+#define S_surfxml_zoneRoute 161
+#define S_surfxml_zoneRoute_1 162
+#define S_surfxml_zoneRoute_2 163
+#define E_surfxml_zoneRoute 164
+#define IMPOSSIBLE 165
 
 #ifndef YY_NO_UNISTD_H
 /* Special case for "unistd.h", since it is non-ANSI. We include it way
@@ -6380,6 +6509,7 @@ YY_DECL
   surfxml_bufferliteral('\0', &bnext, "N11");
   surfxml_bufferliteral('\0', &bnext, "1");
   surfxml_bufferliteral('\0', &bnext, "0.0");
+  surfxml_bufferliteral('\0', &bnext, "/");
   surfxml_bufferliteral('\0', &bnext, "1");
   surfxml_bufferliteral('\0', &bnext, "0s");
   surfxml_bufferliteral('\0', &bnext, "-1.0");
@@ -6455,6 +6585,11 @@ YY_DECL
   surfxml_statenames[S_surfxml_config_1] = "config";
   surfxml_statenames[S_surfxml_config_2] = "config";
   surfxml_statenames[E_surfxml_config] = "config";
+  surfxml_statenames[AL_surfxml_disk] = NULL;
+  surfxml_statenames[S_surfxml_disk] = "disk";
+  surfxml_statenames[S_surfxml_disk_1] = "disk";
+  surfxml_statenames[S_surfxml_disk_2] = "disk";
+  surfxml_statenames[E_surfxml_disk] = "disk";
   surfxml_statenames[AL_surfxml_host] = NULL;
   surfxml_statenames[S_surfxml_host] = "host";
   surfxml_statenames[S_surfxml_host_1] = "host";
@@ -6575,13 +6710,13 @@ yy_match:
                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                                {
                                yy_current_state = (int) yy_def[yy_current_state];
-                               if ( yy_current_state >= 4108 )
+                               if ( yy_current_state >= 4193 )
                                        yy_c = yy_meta[yy_c];
                                }
                        yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
                        ++yy_cp;
                        }
-               while ( yy_base[yy_current_state] != 14106 );
+               while ( yy_base[yy_current_state] != 14483 );
 
 yy_find_action:
                yy_act = yy_accept[yy_current_state];
@@ -7042,11 +7177,11 @@ YY_RULE_SETUP
   surfxml_actor_function_isset = 0;
   AX_surfxml_actor_host = 0;
   surfxml_actor_host_isset = 0;
-  AX_surfxml_actor_kill___time = 46;
+  AX_surfxml_actor_kill___time = 48;
   surfxml_actor_kill___time_isset = 0;
   AX_surfxml_actor_on___failure = A_surfxml_actor_on___failure_DIE;
   surfxml_actor_on___failure_isset = 0;
-  AX_surfxml_actor_start___time = 41;
+  AX_surfxml_actor_start___time = 43;
   surfxml_actor_start___time_isset = 0;
   ENTER(AL_surfxml_actor); pushbuffer(0);
   }
@@ -7311,10 +7446,10 @@ 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; ETag_surfxml_backbone(); popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS: case S_surfxml_AS_13: case S_surfxml_AS_14: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break;
-   case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
-   case S_surfxml_zone: case S_surfxml_zone_13: case S_surfxml_zone_14: case S_surfxml_zone_3: SET(S_surfxml_zone_14); break;
-   case S_surfxml_zone_1: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
+   case S_surfxml_AS: case S_surfxml_AS_13: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break;
+   case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_zone: case S_surfxml_zone_13: case S_surfxml_zone_14: SET(S_surfxml_zone_14); break;
+   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
@@ -7338,10 +7473,10 @@ YY_RULE_SETUP
   ETag_surfxml_backbone();
   popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS: case S_surfxml_AS_13: case S_surfxml_AS_14: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break;
-   case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
-   case S_surfxml_zone: case S_surfxml_zone_13: case S_surfxml_zone_14: case S_surfxml_zone_3: SET(S_surfxml_zone_14); break;
-   case S_surfxml_zone_1: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
+   case S_surfxml_AS: case S_surfxml_AS_13: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break;
+   case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_zone: case S_surfxml_zone_13: case S_surfxml_zone_14: SET(S_surfxml_zone_14); break;
+   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
@@ -7827,8 +7962,8 @@ 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; ETag_surfxml_cabinet(); popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS: case S_surfxml_AS_13: case S_surfxml_AS_14: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break;
-   case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_AS: case S_surfxml_AS_13: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break;
+   case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
    case S_surfxml_include: case S_surfxml_include_1: case S_surfxml_include_2: SET(S_surfxml_include_2); break;
    case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break;
    case S_surfxml_zone: case S_surfxml_zone_13: case S_surfxml_zone_14: case S_surfxml_zone_1: case S_surfxml_zone_3: SET(S_surfxml_zone_14); break;
@@ -7855,8 +7990,8 @@ YY_RULE_SETUP
   ETag_surfxml_cabinet();
   popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS: case S_surfxml_AS_13: case S_surfxml_AS_14: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break;
-   case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_AS: case S_surfxml_AS_13: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break;
+   case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
    case S_surfxml_include: case S_surfxml_include_1: case S_surfxml_include_2: SET(S_surfxml_include_2); break;
    case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break;
    case S_surfxml_zone: case S_surfxml_zone_13: case S_surfxml_zone_14: case S_surfxml_zone_1: case S_surfxml_zone_3: SET(S_surfxml_zone_14); break;
@@ -7887,13 +8022,13 @@ YY_RULE_SETUP
 {
   AX_surfxml_cluster_bb___bw = 0;
   surfxml_cluster_bb___bw_isset = 0;
-  AX_surfxml_cluster_bb___lat = 28;
+  AX_surfxml_cluster_bb___lat = 30;
   surfxml_cluster_bb___lat_isset = 0;
   AX_surfxml_cluster_bb___sharing___policy = A_surfxml_cluster_bb___sharing___policy_SHARED;
   surfxml_cluster_bb___sharing___policy_isset = 0;
   AX_surfxml_cluster_bw = 0;
   surfxml_cluster_bw_isset = 0;
-  AX_surfxml_cluster_core = 26;
+  AX_surfxml_cluster_core = 28;
   surfxml_cluster_core_isset = 0;
   AX_surfxml_cluster_id = 0;
   surfxml_cluster_id_isset = 0;
@@ -8298,16 +8433,123 @@ case YY_STATE_EOF(S_surfxml_config_2):
 FAIL("Premature EOF: `</config>' expected.");
        YY_BREAK
 
-/* <!-- deprecated -->
-  * <!-- deprecated -->  */
 case 260:
 /* rule 260 can match eol */
 YY_RULE_SETUP
-FAIL("Starting tag <host> is not allowed here.");
+FAIL("Starting tag <disk> is not allowed here.");
        YY_BREAK
 case 261:
 /* rule 261 can match eol */
 YY_RULE_SETUP
+{
+  AX_surfxml_disk_id = 26;
+  surfxml_disk_id_isset = 0;
+  AX_surfxml_disk_read___bw = 0;
+  surfxml_disk_read___bw_isset = 0;
+  AX_surfxml_disk_write___bw = 0;
+  surfxml_disk_write___bw_isset = 0;
+  ENTER(AL_surfxml_disk); pushbuffer(0);
+  }
+       YY_BREAK
+
+case 262:
+/* rule 262 can match eol */
+YY_RULE_SETUP
+if (surfxml_disk_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_disk>");} surfxml_disk_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_disk_id);
+       YY_BREAK
+case 263:
+/* rule 263 can match eol */
+YY_RULE_SETUP
+if (surfxml_disk_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_disk>");}  surfxml_disk_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_disk_id);
+       YY_BREAK
+case 264:
+/* rule 264 can match eol */
+YY_RULE_SETUP
+if (surfxml_disk_read___bw_isset != 0) {FAIL("Multiple definition of attribute read_bw in <surfxml_disk>");} surfxml_disk_read___bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_disk_read___bw);
+       YY_BREAK
+case 265:
+/* rule 265 can match eol */
+YY_RULE_SETUP
+if (surfxml_disk_read___bw_isset != 0) {FAIL("Multiple definition of attribute read_bw in <surfxml_disk>");}  surfxml_disk_read___bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_disk_read___bw);
+       YY_BREAK
+case 266:
+/* rule 266 can match eol */
+YY_RULE_SETUP
+if (surfxml_disk_write___bw_isset != 0) {FAIL("Multiple definition of attribute write_bw in <surfxml_disk>");} surfxml_disk_write___bw_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_disk_write___bw);
+       YY_BREAK
+case 267:
+/* rule 267 can match eol */
+YY_RULE_SETUP
+if (surfxml_disk_write___bw_isset != 0) {FAIL("Multiple definition of attribute write_bw in <surfxml_disk>");}  surfxml_disk_write___bw_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_disk_write___bw);
+       YY_BREAK
+case 268:
+YY_RULE_SETUP
+{
+  if (!AX_surfxml_disk_read___bw) FAIL("Required attribute `read_bw' not set for `disk' element.");
+  if (!AX_surfxml_disk_write___bw) FAIL("Required attribute `write_bw' not set for `disk' element.");
+  LEAVE; STag_surfxml_disk();surfxml_pcdata_ix = 0; ENTER(S_surfxml_disk);
+ }
+       YY_BREAK
+case 269:
+YY_RULE_SETUP
+{
+  if (!AX_surfxml_disk_read___bw) FAIL("Required attribute `read_bw' not set for `disk' element.");
+  if (!AX_surfxml_disk_write___bw) FAIL("Required attribute `write_bw' not set for `disk' element.");
+  LEAVE; STag_surfxml_disk(); surfxml_pcdata_ix = 0; ETag_surfxml_disk(); popbuffer(); /* attribute */
+  switch (YY_START) {
+   case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
+  }
+ }
+       YY_BREAK
+case 270:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c' in attribute list of disk element.", yytext[0]);
+       YY_BREAK
+case 271:
+YY_RULE_SETUP
+FAIL("Bad attribute `%s' in `disk' element start tag.",yytext);
+       YY_BREAK
+case YY_STATE_EOF(AL_surfxml_disk):
+FAIL("EOF in attribute list of `disk' element.");
+       YY_BREAK
+
+case 272:
+/* rule 272 can match eol */
+YY_RULE_SETUP
+{
+  LEAVE;
+  ETag_surfxml_disk();
+  popbuffer(); /* attribute */
+  switch (YY_START) {
+   case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
+  }
+ }
+       YY_BREAK
+case 273:
+/* rule 273 can match eol */
+YY_RULE_SETUP
+FAIL("Unexpected end-tag `%s': `</disk>' expected.",yytext);
+       YY_BREAK
+case 274:
+YY_RULE_SETUP
+FAIL("Unexpected character `%c': `</disk>' expected.",yytext[0]);
+       YY_BREAK
+case YY_STATE_EOF(E_surfxml_disk):
+case YY_STATE_EOF(S_surfxml_disk):
+case YY_STATE_EOF(S_surfxml_disk_2):
+FAIL("Premature EOF: `</disk>' expected.");
+       YY_BREAK
+
+/* <!-- deprecated -->
+  * <!-- deprecated -->  */
+case 275:
+/* rule 275 can match eol */
+YY_RULE_SETUP
+FAIL("Starting tag <host> is not allowed here.");
+       YY_BREAK
+case 276:
+/* rule 276 can match eol */
+YY_RULE_SETUP
 {
   AX_surfxml_host_availability___file = 0;
   surfxml_host_availability___file_isset = 0;
@@ -8329,87 +8571,87 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 262:
-/* rule 262 can match eol */
+case 277:
+/* rule 277 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_host>");} surfxml_host_availability___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_availability___file);
        YY_BREAK
-case 263:
-/* rule 263 can match eol */
+case 278:
+/* rule 278 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
-case 264:
-/* rule 264 can match eol */
+case 279:
+/* rule 279 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_host>");} surfxml_host_coordinates_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_coordinates);
        YY_BREAK
-case 265:
-/* rule 265 can match eol */
+case 280:
+/* rule 280 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_host>");}  surfxml_host_coordinates_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_coordinates);
        YY_BREAK
-case 266:
-/* rule 266 can match eol */
+case 281:
+/* rule 281 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
-case 267:
-/* rule 267 can match eol */
+case 282:
+/* rule 282 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
-case 268:
-/* rule 268 can match eol */
+case 283:
+/* rule 283 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_host>");} surfxml_host_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_id);
        YY_BREAK
-case 269:
-/* rule 269 can match eol */
+case 284:
+/* rule 284 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_host>");}  surfxml_host_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_id);
        YY_BREAK
-case 270:
-/* rule 270 can match eol */
+case 285:
+/* rule 285 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_pstate_isset != 0) {FAIL("Multiple definition of attribute pstate in <surfxml_host>");} surfxml_host_pstate_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_pstate);
        YY_BREAK
-case 271:
-/* rule 271 can match eol */
+case 286:
+/* rule 286 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_pstate_isset != 0) {FAIL("Multiple definition of attribute pstate in <surfxml_host>");}  surfxml_host_pstate_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_pstate);
        YY_BREAK
-case 272:
-/* rule 272 can match eol */
+case 287:
+/* rule 287 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
-case 273:
-/* rule 273 can match eol */
+case 288:
+/* rule 288 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
-case 274:
-/* rule 274 can match eol */
+case 289:
+/* rule 289 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_speed___file_isset != 0) {FAIL("Multiple definition of attribute speed_file in <surfxml_host>");} surfxml_host_speed___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_speed___file);
        YY_BREAK
-case 275:
-/* rule 275 can match eol */
+case 290:
+/* rule 290 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_speed___file_isset != 0) {FAIL("Multiple definition of attribute speed_file in <surfxml_host>");}  surfxml_host_speed___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_speed___file);
        YY_BREAK
-case 276:
-/* rule 276 can match eol */
+case 291:
+/* rule 291 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_host>");} surfxml_host_state___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host_state___file);
        YY_BREAK
-case 277:
-/* rule 277 can match eol */
+case 292:
+/* rule 292 can match eol */
 YY_RULE_SETUP
 if (surfxml_host_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_host>");}  surfxml_host_state___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host_state___file);
        YY_BREAK
-case 278:
+case 293:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_host_id) FAIL("Required attribute `id' not set for `host' element.");
@@ -8417,7 +8659,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_host();surfxml_pcdata_ix = 0; ENTER(S_surfxml_host);
  }
        YY_BREAK
-case 279:
+case 294:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_host_id) FAIL("Required attribute `id' not set for `host' element.");
@@ -8429,11 +8671,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 280:
+case 295:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of host element.", yytext[0]);
        YY_BREAK
-case 281:
+case 296:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `host' element start tag.",yytext);
        YY_BREAK
@@ -8441,8 +8683,8 @@ case YY_STATE_EOF(AL_surfxml_host):
 FAIL("EOF in attribute list of `host' element.");
        YY_BREAK
 
-case 282:
-/* rule 282 can match eol */
+case 297:
+/* rule 297 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -8454,12 +8696,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 283:
-/* rule 283 can match eol */
+case 298:
+/* rule 298 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</host>' expected.",yytext);
        YY_BREAK
-case 284:
+case 299:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</host>' expected.",yytext[0]);
        YY_BREAK
@@ -8469,13 +8711,13 @@ case YY_STATE_EOF(S_surfxml_host_2):
 FAIL("Premature EOF: `</host>' expected.");
        YY_BREAK
 
-case 285:
-/* rule 285 can match eol */
+case 300:
+/* rule 300 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <host_link> is not allowed here.");
        YY_BREAK
-case 286:
-/* rule 286 can match eol */
+case 301:
+/* rule 301 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_host___link_down = 0;
@@ -8488,37 +8730,37 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 287:
-/* rule 287 can match eol */
+case 302:
+/* rule 302 can match eol */
 YY_RULE_SETUP
 if (surfxml_host___link_down_isset != 0) {FAIL("Multiple definition of attribute down in <surfxml_host___link>");} surfxml_host___link_down_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host___link_down);
        YY_BREAK
-case 288:
-/* rule 288 can match eol */
+case 303:
+/* rule 303 can match eol */
 YY_RULE_SETUP
 if (surfxml_host___link_down_isset != 0) {FAIL("Multiple definition of attribute down in <surfxml_host___link>");}  surfxml_host___link_down_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host___link_down);
        YY_BREAK
-case 289:
-/* rule 289 can match eol */
+case 304:
+/* rule 304 can match eol */
 YY_RULE_SETUP
 if (surfxml_host___link_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_host___link>");} surfxml_host___link_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host___link_id);
        YY_BREAK
-case 290:
-/* rule 290 can match eol */
+case 305:
+/* rule 305 can match eol */
 YY_RULE_SETUP
 if (surfxml_host___link_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_host___link>");}  surfxml_host___link_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host___link_id);
        YY_BREAK
-case 291:
-/* rule 291 can match eol */
+case 306:
+/* rule 306 can match eol */
 YY_RULE_SETUP
 if (surfxml_host___link_up_isset != 0) {FAIL("Multiple definition of attribute up in <surfxml_host___link>");} surfxml_host___link_up_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_host___link_up);
        YY_BREAK
-case 292:
-/* rule 292 can match eol */
+case 307:
+/* rule 307 can match eol */
 YY_RULE_SETUP
 if (surfxml_host___link_up_isset != 0) {FAIL("Multiple definition of attribute up in <surfxml_host___link>");}  surfxml_host___link_up_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_host___link_up);
        YY_BREAK
-case 293:
+case 308:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_host___link_down) FAIL("Required attribute `down' not set for `host_link' element.");
@@ -8527,7 +8769,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_host___link();surfxml_pcdata_ix = 0; ENTER(E_surfxml_host___link);
  }
        YY_BREAK
-case 294:
+case 309:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_host___link_down) FAIL("Required attribute `down' not set for `host_link' element.");
@@ -8540,11 +8782,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 295:
+case 310:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of host_link element.", yytext[0]);
        YY_BREAK
-case 296:
+case 311:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `host_link' element start tag.",yytext);
        YY_BREAK
@@ -8552,8 +8794,8 @@ case YY_STATE_EOF(AL_surfxml_host___link):
 FAIL("EOF in attribute list of `host_link' element.");
        YY_BREAK
 
-case 297:
-/* rule 297 can match eol */
+case 312:
+/* rule 312 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -8565,12 +8807,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 298:
-/* rule 298 can match eol */
+case 313:
+/* rule 313 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</host_link>' expected.",yytext);
        YY_BREAK
-case 299:
+case 314:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</host_link>' expected.",yytext[0]);
        YY_BREAK
@@ -8579,13 +8821,13 @@ FAIL("Premature EOF: `</host_link>' expected.");
        YY_BREAK
 
 /* <!-- tag include is deprecated. Not documented, and removed in v3.22 -->  */
-case 300:
-/* rule 300 can match eol */
+case 315:
+/* rule 315 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <include> is not allowed here.");
        YY_BREAK
-case 301:
-/* rule 301 can match eol */
+case 316:
+/* rule 316 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_include_file = 0;
@@ -8594,43 +8836,43 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 302:
-/* rule 302 can match eol */
+case 317:
+/* rule 317 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
-case 303:
-/* rule 303 can match eol */
+case 318:
+/* rule 318 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
-case 304:
+case 319:
 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
-case 305:
+case 320:
 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; ETag_surfxml_include(); popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS: case S_surfxml_AS_13: case S_surfxml_AS_14: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break;
-   case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_AS: case S_surfxml_AS_13: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break;
+   case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
    case S_surfxml_include: case S_surfxml_include_1: case S_surfxml_include_2: SET(S_surfxml_include_2); break;
    case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break;
-   case S_surfxml_zone: case S_surfxml_zone_13: case S_surfxml_zone_14: case S_surfxml_zone_3: SET(S_surfxml_zone_14); break;
-   case S_surfxml_zone_1: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
+   case S_surfxml_zone: case S_surfxml_zone_13: case S_surfxml_zone_14: SET(S_surfxml_zone_14); break;
+   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
-case 306:
+case 321:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of include element.", yytext[0]);
        YY_BREAK
-case 307:
+case 322:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `include' element start tag.",yytext);
        YY_BREAK
@@ -8638,29 +8880,29 @@ case YY_STATE_EOF(AL_surfxml_include):
 FAIL("EOF in attribute list of `include' element.");
        YY_BREAK
 
-case 308:
-/* rule 308 can match eol */
+case 323:
+/* rule 323 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
   ETag_surfxml_include();
   popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS: case S_surfxml_AS_13: case S_surfxml_AS_14: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break;
-   case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_AS: case S_surfxml_AS_13: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break;
+   case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
    case S_surfxml_include: case S_surfxml_include_1: case S_surfxml_include_2: SET(S_surfxml_include_2); break;
    case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break;
-   case S_surfxml_zone: case S_surfxml_zone_13: case S_surfxml_zone_14: case S_surfxml_zone_3: SET(S_surfxml_zone_14); break;
-   case S_surfxml_zone_1: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
+   case S_surfxml_zone: case S_surfxml_zone_13: case S_surfxml_zone_14: SET(S_surfxml_zone_14); break;
+   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
-case 309:
-/* rule 309 can match eol */
+case 324:
+/* rule 324 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</include>' expected.",yytext);
        YY_BREAK
-case 310:
+case 325:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</include>' expected.",yytext[0]);
        YY_BREAK
@@ -8670,13 +8912,13 @@ case YY_STATE_EOF(S_surfxml_include_2):
 FAIL("Premature EOF: `</include>' expected.");
        YY_BREAK
 
-case 311:
-/* rule 311 can match eol */
+case 326:
+/* rule 326 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <link> is not allowed here.");
        YY_BREAK
-case 312:
-/* rule 312 can match eol */
+case 327:
+/* rule 327 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_link_bandwidth = 0;
@@ -8697,95 +8939,102 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 313:
-/* rule 313 can match eol */
+case 328:
+/* rule 328 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in <surfxml_link>");} surfxml_link_bandwidth_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth);
        YY_BREAK
-case 314:
-/* rule 314 can match eol */
+case 329:
+/* rule 329 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_bandwidth_isset != 0) {FAIL("Multiple definition of attribute bandwidth in <surfxml_link>");}  surfxml_link_bandwidth_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_bandwidth);
        YY_BREAK
-case 315:
-/* rule 315 can match eol */
+case 330:
+/* rule 330 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_bandwidth___file_isset != 0) {FAIL("Multiple definition of attribute bandwidth_file in <surfxml_link>");} surfxml_link_bandwidth___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_bandwidth___file);
        YY_BREAK
-case 316:
-/* rule 316 can match eol */
+case 331:
+/* rule 331 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
-case 317:
-/* rule 317 can match eol */
+case 332:
+/* rule 332 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_link>");} surfxml_link_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_id);
        YY_BREAK
-case 318:
-/* rule 318 can match eol */
+case 333:
+/* rule 333 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_link>");}  surfxml_link_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link_id);
        YY_BREAK
-case 319:
-/* rule 319 can match eol */
+case 334:
+/* rule 334 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_latency_isset != 0) {FAIL("Multiple definition of attribute latency in <surfxml_link>");} surfxml_link_latency_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_latency);
        YY_BREAK
-case 320:
-/* rule 320 can match eol */
+case 335:
+/* rule 335 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
-case 321:
-/* rule 321 can match eol */
+case 336:
+/* rule 336 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
-case 322:
-/* rule 322 can match eol */
+case 337:
+/* rule 337 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
-case 323:
-/* rule 323 can match eol */
-case 324:
-/* rule 324 can match eol */
+case 338:
+/* rule 338 can match eol */
+case 339:
+/* rule 339 can match eol */
 YY_RULE_SETUP
 A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_SHARED;
        YY_BREAK
-case 325:
-/* rule 325 can match eol */
-case 326:
-/* rule 326 can match eol */
+case 340:
+/* rule 340 can match eol */
+case 341:
+/* rule 341 can match eol */
 YY_RULE_SETUP
 A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_SPLITDUPLEX;
        YY_BREAK
-case 327:
-/* rule 327 can match eol */
-case 328:
-/* rule 328 can match eol */
+case 342:
+/* rule 342 can match eol */
+case 343:
+/* rule 343 can match eol */
 YY_RULE_SETUP
 A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_FULLDUPLEX;
        YY_BREAK
-case 329:
-/* rule 329 can match eol */
-case 330:
-/* rule 330 can match eol */
+case 344:
+/* rule 344 can match eol */
+case 345:
+/* rule 345 can match eol */
 YY_RULE_SETUP
 A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_FATPIPE;
        YY_BREAK
-case 331:
-/* rule 331 can match eol */
+case 346:
+/* rule 346 can match eol */
+case 347:
+/* rule 347 can match eol */
+YY_RULE_SETUP
+A_surfxml_link_sharing___policy = A_surfxml_link_sharing___policy_WIFI;
+       YY_BREAK
+case 348:
+/* rule 348 can match eol */
 YY_RULE_SETUP
 if (surfxml_link_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_link>");} surfxml_link_state___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link_state___file);
        YY_BREAK
-case 332:
-/* rule 332 can match eol */
+case 349:
+/* rule 349 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
-case 333:
+case 350:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `link' element.");
@@ -8793,25 +9042,25 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_link();surfxml_pcdata_ix = 0; ENTER(S_surfxml_link);
  }
        YY_BREAK
-case 334:
+case 351:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_link_bandwidth) FAIL("Required attribute `bandwidth' not set for `link' element.");
   if (!AX_surfxml_link_id) FAIL("Required attribute `id' not set for `link' element.");
   LEAVE; STag_surfxml_link(); surfxml_pcdata_ix = 0; ETag_surfxml_link(); popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS: case S_surfxml_AS_13: case S_surfxml_AS_14: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break;
-   case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
-   case S_surfxml_zone: case S_surfxml_zone_13: case S_surfxml_zone_14: case S_surfxml_zone_3: SET(S_surfxml_zone_14); break;
-   case S_surfxml_zone_1: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
+   case S_surfxml_AS: case S_surfxml_AS_13: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break;
+   case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_zone: case S_surfxml_zone_13: case S_surfxml_zone_14: SET(S_surfxml_zone_14); break;
+   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
-case 335:
+case 352:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of link element.", yytext[0]);
        YY_BREAK
-case 336:
+case 353:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `link' element start tag.",yytext);
        YY_BREAK
@@ -8819,27 +9068,27 @@ case YY_STATE_EOF(AL_surfxml_link):
 FAIL("EOF in attribute list of `link' element.");
        YY_BREAK
 
-case 337:
-/* rule 337 can match eol */
+case 354:
+/* rule 354 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
   ETag_surfxml_link();
   popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS: case S_surfxml_AS_13: case S_surfxml_AS_14: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break;
-   case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
-   case S_surfxml_zone: case S_surfxml_zone_13: case S_surfxml_zone_14: case S_surfxml_zone_3: SET(S_surfxml_zone_14); break;
-   case S_surfxml_zone_1: case S_surfxml_zone_5: case S_surfxml_zone_6: SET(S_surfxml_zone_6); break;
+   case S_surfxml_AS: case S_surfxml_AS_13: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break;
+   case S_surfxml_AS_1: case S_surfxml_AS_3: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_zone: case S_surfxml_zone_13: case S_surfxml_zone_14: SET(S_surfxml_zone_14); break;
+   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
-case 338:
-/* rule 338 can match eol */
+case 355:
+/* rule 355 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</link>' expected.",yytext);
        YY_BREAK
-case 339:
+case 356:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</link>' expected.",yytext[0]);
        YY_BREAK
@@ -8849,13 +9098,13 @@ case YY_STATE_EOF(S_surfxml_link_2):
 FAIL("Premature EOF: `</link>' expected.");
        YY_BREAK
 
-case 340:
-/* rule 340 can match eol */
+case 357:
+/* rule 357 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <link_ctn> is not allowed here.");
        YY_BREAK
-case 341:
-/* rule 341 can match eol */
+case 358:
+/* rule 358 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_link___ctn_direction = A_surfxml_link___ctn_direction_NONE;
@@ -8866,45 +9115,45 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 342:
-/* rule 342 can match eol */
-case 343:
-/* rule 343 can match eol */
+case 359:
+/* rule 359 can match eol */
+case 360:
+/* rule 360 can match eol */
 YY_RULE_SETUP
 A_surfxml_link___ctn_direction = A_surfxml_link___ctn_direction_UP;
        YY_BREAK
-case 344:
-/* rule 344 can match eol */
-case 345:
-/* rule 345 can match eol */
+case 361:
+/* rule 361 can match eol */
+case 362:
+/* rule 362 can match eol */
 YY_RULE_SETUP
 A_surfxml_link___ctn_direction = A_surfxml_link___ctn_direction_DOWN;
        YY_BREAK
-case 346:
-/* rule 346 can match eol */
-case 347:
-/* rule 347 can match eol */
+case 363:
+/* rule 363 can match eol */
+case 364:
+/* rule 364 can match eol */
 YY_RULE_SETUP
 A_surfxml_link___ctn_direction = A_surfxml_link___ctn_direction_NONE;
        YY_BREAK
-case 348:
-/* rule 348 can match eol */
+case 365:
+/* rule 365 can match eol */
 YY_RULE_SETUP
 if (surfxml_link___ctn_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_link___ctn>");} surfxml_link___ctn_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_link___ctn_id);
        YY_BREAK
-case 349:
-/* rule 349 can match eol */
+case 366:
+/* rule 366 can match eol */
 YY_RULE_SETUP
 if (surfxml_link___ctn_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_link___ctn>");}  surfxml_link___ctn_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_link___ctn_id);
        YY_BREAK
-case 350:
+case 367:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_link___ctn_id) FAIL("Required attribute `id' not set for `link_ctn' element.");
   LEAVE; STag_surfxml_link___ctn();surfxml_pcdata_ix = 0; ENTER(E_surfxml_link___ctn);
  }
        YY_BREAK
-case 351:
+case 368:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_link___ctn_id) FAIL("Required attribute `id' not set for `link_ctn' element.");
@@ -8919,11 +9168,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 352:
+case 369:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of link_ctn element.", yytext[0]);
        YY_BREAK
-case 353:
+case 370:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `link_ctn' element start tag.",yytext);
        YY_BREAK
@@ -8931,8 +9180,8 @@ case YY_STATE_EOF(AL_surfxml_link___ctn):
 FAIL("EOF in attribute list of `link_ctn' element.");
        YY_BREAK
 
-case 354:
-/* rule 354 can match eol */
+case 371:
+/* rule 371 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -8948,12 +9197,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 355:
-/* rule 355 can match eol */
+case 372:
+/* rule 372 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</link_ctn>' expected.",yytext);
        YY_BREAK
-case 356:
+case 373:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</link_ctn>' expected.",yytext[0]);
        YY_BREAK
@@ -8963,13 +9212,13 @@ FAIL("Premature EOF: `</link_ctn>' expected.");
 
 /* <!-- <!ATTLIST model_prop key CDATA #REQUIRED> -->
   * <!-- <!ATTLIST model_prop key CDATA #REQUIRED> -->  */
-case 357:
-/* rule 357 can match eol */
+case 374:
+/* rule 374 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <model_prop> is not allowed here.");
        YY_BREAK
-case 358:
-/* rule 358 can match eol */
+case 375:
+/* rule 375 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_model___prop_id = 0;
@@ -8980,27 +9229,27 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 359:
-/* rule 359 can match eol */
+case 376:
+/* rule 376 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
-case 360:
-/* rule 360 can match eol */
+case 377:
+/* rule 377 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
-case 361:
-/* rule 361 can match eol */
+case 378:
+/* rule 378 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
-case 362:
-/* rule 362 can match eol */
+case 379:
+/* rule 379 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
-case 363:
+case 380:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_model___prop_id) FAIL("Required attribute `id' not set for `model_prop' element.");
@@ -9008,7 +9257,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_model___prop();surfxml_pcdata_ix = 0; ENTER(E_surfxml_model___prop);
  }
        YY_BREAK
-case 364:
+case 381:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_model___prop_id) FAIL("Required attribute `id' not set for `model_prop' element.");
@@ -9019,11 +9268,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 365:
+case 382:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of model_prop element.", yytext[0]);
        YY_BREAK
-case 366:
+case 383:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `model_prop' element start tag.",yytext);
        YY_BREAK
@@ -9031,8 +9280,8 @@ case YY_STATE_EOF(AL_surfxml_model___prop):
 FAIL("EOF in attribute list of `model_prop' element.");
        YY_BREAK
 
-case 367:
-/* rule 367 can match eol */
+case 384:
+/* rule 384 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -9043,12 +9292,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 368:
-/* rule 368 can match eol */
+case 385:
+/* rule 385 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</model_prop>' expected.",yytext);
        YY_BREAK
-case 369:
+case 386:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</model_prop>' expected.",yytext[0]);
        YY_BREAK
@@ -9056,13 +9305,13 @@ case YY_STATE_EOF(E_surfxml_model___prop):
 FAIL("Premature EOF: `</model_prop>' expected.");
        YY_BREAK
 
-case 370:
-/* rule 370 can match eol */
+case 387:
+/* rule 387 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <mount> is not allowed here.");
        YY_BREAK
-case 371:
-/* rule 371 can match eol */
+case 388:
+/* rule 388 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_mount_name = 0;
@@ -9073,27 +9322,27 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 372:
-/* rule 372 can match eol */
+case 389:
+/* rule 389 can match eol */
 YY_RULE_SETUP
 if (surfxml_mount_name_isset != 0) {FAIL("Multiple definition of attribute name in <surfxml_mount>");} surfxml_mount_name_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_mount_name);
        YY_BREAK
-case 373:
-/* rule 373 can match eol */
+case 390:
+/* rule 390 can match eol */
 YY_RULE_SETUP
 if (surfxml_mount_name_isset != 0) {FAIL("Multiple definition of attribute name in <surfxml_mount>");}  surfxml_mount_name_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_mount_name);
        YY_BREAK
-case 374:
-/* rule 374 can match eol */
+case 391:
+/* rule 391 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
-case 375:
-/* rule 375 can match eol */
+case 392:
+/* rule 392 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
-case 376:
+case 393:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_mount_name) FAIL("Required attribute `name' not set for `mount' element.");
@@ -9101,7 +9350,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_mount();surfxml_pcdata_ix = 0; ENTER(E_surfxml_mount);
  }
        YY_BREAK
-case 377:
+case 394:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_mount_name) FAIL("Required attribute `name' not set for `mount' element.");
@@ -9112,11 +9361,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 378:
+case 395:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of mount element.", yytext[0]);
        YY_BREAK
-case 379:
+case 396:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `mount' element start tag.",yytext);
        YY_BREAK
@@ -9124,8 +9373,8 @@ case YY_STATE_EOF(AL_surfxml_mount):
 FAIL("EOF in attribute list of `mount' element.");
        YY_BREAK
 
-case 380:
-/* rule 380 can match eol */
+case 397:
+/* rule 397 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -9136,12 +9385,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 381:
-/* rule 381 can match eol */
+case 398:
+/* rule 398 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</mount>' expected.",yytext);
        YY_BREAK
-case 382:
+case 399:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</mount>' expected.",yytext[0]);
        YY_BREAK
@@ -9151,13 +9400,13 @@ FAIL("Premature EOF: `</mount>' expected.");
 
 /* <!-- deprecated -->
   * <!-- deprecated -->  */
-case 383:
-/* rule 383 can match eol */
+case 400:
+/* rule 400 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <peer> is not allowed here.");
        YY_BREAK
-case 384:
-/* rule 384 can match eol */
+case 401:
+/* rule 401 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_peer_availability___file = 0;
@@ -9182,97 +9431,97 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 385:
-/* rule 385 can match eol */
+case 402:
+/* rule 402 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_peer>");} surfxml_peer_availability___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_availability___file);
        YY_BREAK
-case 386:
-/* rule 386 can match eol */
+case 403:
+/* rule 403 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_availability___file_isset != 0) {FAIL("Multiple definition of attribute availability_file in <surfxml_peer>");}  surfxml_peer_availability___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_availability___file);
        YY_BREAK
-case 387:
-/* rule 387 can match eol */
+case 404:
+/* rule 404 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_bw___in_isset != 0) {FAIL("Multiple definition of attribute bw_in in <surfxml_peer>");} surfxml_peer_bw___in_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_bw___in);
        YY_BREAK
-case 388:
-/* rule 388 can match eol */
+case 405:
+/* rule 405 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_bw___in_isset != 0) {FAIL("Multiple definition of attribute bw_in in <surfxml_peer>");}  surfxml_peer_bw___in_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_bw___in);
        YY_BREAK
-case 389:
-/* rule 389 can match eol */
+case 406:
+/* rule 406 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_bw___out_isset != 0) {FAIL("Multiple definition of attribute bw_out in <surfxml_peer>");} surfxml_peer_bw___out_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_bw___out);
        YY_BREAK
-case 390:
-/* rule 390 can match eol */
+case 407:
+/* rule 407 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_bw___out_isset != 0) {FAIL("Multiple definition of attribute bw_out in <surfxml_peer>");}  surfxml_peer_bw___out_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_bw___out);
        YY_BREAK
-case 391:
-/* rule 391 can match eol */
+case 408:
+/* rule 408 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_peer>");} surfxml_peer_coordinates_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_coordinates);
        YY_BREAK
-case 392:
-/* rule 392 can match eol */
+case 409:
+/* rule 409 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_peer>");}  surfxml_peer_coordinates_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_coordinates);
        YY_BREAK
-case 393:
-/* rule 393 can match eol */
+case 410:
+/* rule 410 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_peer>");} surfxml_peer_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_id);
        YY_BREAK
-case 394:
-/* rule 394 can match eol */
+case 411:
+/* rule 411 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_peer>");}  surfxml_peer_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_id);
        YY_BREAK
-case 395:
-/* rule 395 can match eol */
+case 412:
+/* rule 412 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_peer>");} surfxml_peer_lat_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_lat);
        YY_BREAK
-case 396:
-/* rule 396 can match eol */
+case 413:
+/* rule 413 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_lat_isset != 0) {FAIL("Multiple definition of attribute lat in <surfxml_peer>");}  surfxml_peer_lat_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_lat);
        YY_BREAK
-case 397:
-/* rule 397 can match eol */
+case 414:
+/* rule 414 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
-case 398:
-/* rule 398 can match eol */
+case 415:
+/* rule 415 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
-case 399:
-/* rule 399 can match eol */
+case 416:
+/* rule 416 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_speed___file_isset != 0) {FAIL("Multiple definition of attribute speed_file in <surfxml_peer>");} surfxml_peer_speed___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_speed___file);
        YY_BREAK
-case 400:
-/* rule 400 can match eol */
+case 417:
+/* rule 417 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_speed___file_isset != 0) {FAIL("Multiple definition of attribute speed_file in <surfxml_peer>");}  surfxml_peer_speed___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_speed___file);
        YY_BREAK
-case 401:
-/* rule 401 can match eol */
+case 418:
+/* rule 418 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_peer>");} surfxml_peer_state___file_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_peer_state___file);
        YY_BREAK
-case 402:
-/* rule 402 can match eol */
+case 419:
+/* rule 419 can match eol */
 YY_RULE_SETUP
 if (surfxml_peer_state___file_isset != 0) {FAIL("Multiple definition of attribute state_file in <surfxml_peer>");}  surfxml_peer_state___file_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_peer_state___file);
        YY_BREAK
-case 403:
+case 420:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_peer_bw___in) FAIL("Required attribute `bw_in' not set for `peer' element.");
@@ -9282,7 +9531,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_peer();surfxml_pcdata_ix = 0; ENTER(E_surfxml_peer);
  }
        YY_BREAK
-case 404:
+case 421:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_peer_bw___in) FAIL("Required attribute `bw_in' not set for `peer' element.");
@@ -9298,11 +9547,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 405:
+case 422:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of peer element.", yytext[0]);
        YY_BREAK
-case 406:
+case 423:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `peer' element start tag.",yytext);
        YY_BREAK
@@ -9310,8 +9559,8 @@ case YY_STATE_EOF(AL_surfxml_peer):
 FAIL("EOF in attribute list of `peer' element.");
        YY_BREAK
 
-case 407:
-/* rule 407 can match eol */
+case 424:
+/* rule 424 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -9325,12 +9574,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 408:
-/* rule 408 can match eol */
+case 425:
+/* rule 425 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</peer>' expected.",yytext);
        YY_BREAK
-case 409:
+case 426:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</peer>' expected.",yytext[0]);
        YY_BREAK
@@ -9340,7 +9589,7 @@ FAIL("Premature EOF: `</peer>' expected.");
 
 /* <!--
   *              DTD of SimGrid platform and deployment files.
-  * More info: http://simgrid.gforge.inria.fr/simgrid/latest/doc/platform.html
+  * More info: https://simgrid.org/doc/latest/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:
@@ -9348,22 +9597,20 @@ FAIL("Premature EOF: `</peer>' expected.");
   *     - <random> does nothing since a very long time
   *     - <as>, <asroute>, <bypassZoneRoute> and <process>, deprecated in DTD4.1
   *   - FULLDUPLEX sharing will be removed, deprecated in DTD4.2 (v3.19)
-  * * New in DTD version 4.2b (in SimGrid 3.22): backward compatible change
-  *  (version is still announced to be 4.2 to not bother users)
-  *    - In <host> and <peer> availability_file is now speed_file
-  * * New in DTD version 4.2 (in SimGrid 3.19): backward compatible change (v4 files are valid v4.2 files)
-  *    - SPLITDUPLEX is the new spelling of the deprecated FULLDUPLEX
   * * 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>
+  *   Other backward-compatible changes for which we did not bump the DTD version.
+  *   - SPLITDUPLEX is the new spelling of the deprecated FULLDUPLEX (SimGrid v3.19)
+  *   - In <host> and <peer> availability_file is now speed_file (SimGrid v3.22)
   * * New in DTD version 4 (in SimGrid 3.13):
   *    - 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 redundant with state and availability traces, and with peak values.
+  *      It was redundant with state and availability profiles, and with peak values.
   *    - In <cluster>, cannot set the availability nor state profiles.
   *      This was too complex and unused.
   *    - The DOCTYPE points to the right URL (this file).
@@ -9400,13 +9647,13 @@ FAIL("Premature EOF: `</peer>' expected.");
   *      - Link bandwidth: from Mb/s to b/s
   *      - CPU speed: from MFlop/s to Flop/s
   * -->  */
-case 410:
-/* rule 410 can match eol */
+case 427:
+/* rule 427 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <platform> is not allowed here.");
        YY_BREAK
-case 411:
-/* rule 411 can match eol */
+case 428:
+/* rule 428 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_platform_version = 1;
@@ -9415,23 +9662,23 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 412:
-/* rule 412 can match eol */
+case 429:
+/* rule 429 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
-case 413:
-/* rule 413 can match eol */
+case 430:
+/* rule 430 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
-case 414:
+case 431:
 YY_RULE_SETUP
 {
   LEAVE; STag_surfxml_platform();surfxml_pcdata_ix = 0; ENTER(S_surfxml_platform);
  }
        YY_BREAK
-case 415:
+case 432:
 YY_RULE_SETUP
 {
   LEAVE; STag_surfxml_platform(); surfxml_pcdata_ix = 0; ETag_surfxml_platform(); popbuffer(); /* attribute */
@@ -9440,11 +9687,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 416:
+case 433:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of platform element.", yytext[0]);
        YY_BREAK
-case 417:
+case 434:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `platform' element start tag.",yytext);
        YY_BREAK
@@ -9452,8 +9699,8 @@ case YY_STATE_EOF(AL_surfxml_platform):
 FAIL("EOF in attribute list of `platform' element.");
        YY_BREAK
 
-case 418:
-/* rule 418 can match eol */
+case 435:
+/* rule 435 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -9464,12 +9711,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 419:
-/* rule 419 can match eol */
+case 436:
+/* rule 436 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</platform>' expected.",yytext);
        YY_BREAK
-case 420:
+case 437:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</platform>' expected.",yytext[0]);
        YY_BREAK
@@ -9483,84 +9730,84 @@ case YY_STATE_EOF(S_surfxml_platform_8):
 FAIL("Premature EOF: `</platform>' expected.");
        YY_BREAK
 
-case 421:
-/* rule 421 can match eol */
+case 438:
+/* rule 438 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <process> is not allowed here.");
        YY_BREAK
-case 422:
-/* rule 422 can match eol */
+case 439:
+/* rule 439 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_process_function = 0;
   surfxml_process_function_isset = 0;
   AX_surfxml_process_host = 0;
   surfxml_process_host_isset = 0;
-  AX_surfxml_process_kill___time = 36;
+  AX_surfxml_process_kill___time = 38;
   surfxml_process_kill___time_isset = 0;
   AX_surfxml_process_on___failure = A_surfxml_process_on___failure_DIE;
   surfxml_process_on___failure_isset = 0;
-  AX_surfxml_process_start___time = 31;
+  AX_surfxml_process_start___time = 33;
   surfxml_process_start___time_isset = 0;
   ENTER(AL_surfxml_process); pushbuffer(0);
   }
        YY_BREAK
 
-case 423:
-/* rule 423 can match eol */
+case 440:
+/* rule 440 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_function_isset != 0) {FAIL("Multiple definition of attribute function in <surfxml_process>");} surfxml_process_function_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_function);
        YY_BREAK
-case 424:
-/* rule 424 can match eol */
+case 441:
+/* rule 441 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_function_isset != 0) {FAIL("Multiple definition of attribute function in <surfxml_process>");}  surfxml_process_function_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_function);
        YY_BREAK
-case 425:
-/* rule 425 can match eol */
+case 442:
+/* rule 442 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_host_isset != 0) {FAIL("Multiple definition of attribute host in <surfxml_process>");} surfxml_process_host_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_host);
        YY_BREAK
-case 426:
-/* rule 426 can match eol */
+case 443:
+/* rule 443 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_host_isset != 0) {FAIL("Multiple definition of attribute host in <surfxml_process>");}  surfxml_process_host_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_host);
        YY_BREAK
-case 427:
-/* rule 427 can match eol */
+case 444:
+/* rule 444 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_kill___time_isset != 0) {FAIL("Multiple definition of attribute kill_time in <surfxml_process>");} surfxml_process_kill___time_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_kill___time);
        YY_BREAK
-case 428:
-/* rule 428 can match eol */
+case 445:
+/* rule 445 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_kill___time_isset != 0) {FAIL("Multiple definition of attribute kill_time in <surfxml_process>");}  surfxml_process_kill___time_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_kill___time);
        YY_BREAK
-case 429:
-/* rule 429 can match eol */
-case 430:
-/* rule 430 can match eol */
+case 446:
+/* rule 446 can match eol */
+case 447:
+/* rule 447 can match eol */
 YY_RULE_SETUP
 A_surfxml_process_on___failure = A_surfxml_process_on___failure_DIE;
        YY_BREAK
-case 431:
-/* rule 431 can match eol */
-case 432:
-/* rule 432 can match eol */
+case 448:
+/* rule 448 can match eol */
+case 449:
+/* rule 449 can match eol */
 YY_RULE_SETUP
 A_surfxml_process_on___failure = A_surfxml_process_on___failure_RESTART;
        YY_BREAK
-case 433:
-/* rule 433 can match eol */
+case 450:
+/* rule 450 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_start___time_isset != 0) {FAIL("Multiple definition of attribute start_time in <surfxml_process>");} surfxml_process_start___time_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_process_start___time);
        YY_BREAK
-case 434:
-/* rule 434 can match eol */
+case 451:
+/* rule 451 can match eol */
 YY_RULE_SETUP
 if (surfxml_process_start___time_isset != 0) {FAIL("Multiple definition of attribute start_time in <surfxml_process>");}  surfxml_process_start___time_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_process_start___time);
        YY_BREAK
-case 435:
+case 452:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element.");
@@ -9568,7 +9815,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_process();surfxml_pcdata_ix = 0; ENTER(S_surfxml_process);
  }
        YY_BREAK
-case 436:
+case 453:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_process_function) FAIL("Required attribute `function' not set for `process' element.");
@@ -9579,11 +9826,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 437:
+case 454:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of process element.", yytext[0]);
        YY_BREAK
-case 438:
+case 455:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `process' element start tag.",yytext);
        YY_BREAK
@@ -9591,8 +9838,8 @@ case YY_STATE_EOF(AL_surfxml_process):
 FAIL("EOF in attribute list of `process' element.");
        YY_BREAK
 
-case 439:
-/* rule 439 can match eol */
+case 456:
+/* rule 456 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -9603,12 +9850,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 440:
-/* rule 440 can match eol */
+case 457:
+/* rule 457 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</process>' expected.",yytext);
        YY_BREAK
-case 441:
+case 458:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</process>' expected.",yytext[0]);
        YY_BREAK
@@ -9620,13 +9867,13 @@ FAIL("Premature EOF: `</process>' expected.");
 
 /* <!-- <!ATTLIST prop key CDATA #REQUIRED> -->
   * <!-- <!ATTLIST prop key CDATA #REQUIRED> -->  */
-case 442:
-/* rule 442 can match eol */
+case 459:
+/* rule 459 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <prop> is not allowed here.");
        YY_BREAK
-case 443:
-/* rule 443 can match eol */
+case 460:
+/* rule 460 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_prop_id = 0;
@@ -9637,27 +9884,27 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 444:
-/* rule 444 can match eol */
+case 461:
+/* rule 461 can match eol */
 YY_RULE_SETUP
 if (surfxml_prop_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_prop>");} surfxml_prop_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_id);
        YY_BREAK
-case 445:
-/* rule 445 can match eol */
+case 462:
+/* rule 462 can match eol */
 YY_RULE_SETUP
 if (surfxml_prop_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_prop>");}  surfxml_prop_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_id);
        YY_BREAK
-case 446:
-/* rule 446 can match eol */
+case 463:
+/* rule 463 can match eol */
 YY_RULE_SETUP
 if (surfxml_prop_value_isset != 0) {FAIL("Multiple definition of attribute value in <surfxml_prop>");} surfxml_prop_value_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_prop_value);
        YY_BREAK
-case 447:
-/* rule 447 can match eol */
+case 464:
+/* rule 464 can match eol */
 YY_RULE_SETUP
 if (surfxml_prop_value_isset != 0) {FAIL("Multiple definition of attribute value in <surfxml_prop>");}  surfxml_prop_value_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_prop_value);
        YY_BREAK
-case 448:
+case 465:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_prop_id) FAIL("Required attribute `id' not set for `prop' element.");
@@ -9665,7 +9912,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_prop();surfxml_pcdata_ix = 0; ENTER(E_surfxml_prop);
  }
        YY_BREAK
-case 449:
+case 466:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_prop_id) FAIL("Required attribute `id' not set for `prop' element.");
@@ -9676,6 +9923,7 @@ YY_RULE_SETUP
    case S_surfxml_actor: case S_surfxml_actor_1: case S_surfxml_actor_2: SET(S_surfxml_actor_2); break;
    case S_surfxml_cluster: case S_surfxml_cluster_1: case S_surfxml_cluster_2: SET(S_surfxml_cluster_2); break;
    case S_surfxml_config: case S_surfxml_config_1: case S_surfxml_config_2: SET(S_surfxml_config_2); break;
+   case S_surfxml_disk: case S_surfxml_disk_1: case S_surfxml_disk_2: SET(S_surfxml_disk_2); break;
    case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
    case S_surfxml_link: case S_surfxml_link_1: case S_surfxml_link_2: SET(S_surfxml_link_2); break;
    case S_surfxml_process: case S_surfxml_process_1: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
@@ -9685,11 +9933,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 450:
+case 467:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of prop element.", yytext[0]);
        YY_BREAK
-case 451:
+case 468:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `prop' element start tag.",yytext);
        YY_BREAK
@@ -9697,8 +9945,8 @@ case YY_STATE_EOF(AL_surfxml_prop):
 FAIL("EOF in attribute list of `prop' element.");
        YY_BREAK
 
-case 452:
-/* rule 452 can match eol */
+case 469:
+/* rule 469 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -9709,6 +9957,7 @@ YY_RULE_SETUP
    case S_surfxml_actor: case S_surfxml_actor_1: case S_surfxml_actor_2: SET(S_surfxml_actor_2); break;
    case S_surfxml_cluster: case S_surfxml_cluster_1: case S_surfxml_cluster_2: SET(S_surfxml_cluster_2); break;
    case S_surfxml_config: case S_surfxml_config_1: case S_surfxml_config_2: SET(S_surfxml_config_2); break;
+   case S_surfxml_disk: case S_surfxml_disk_1: case S_surfxml_disk_2: SET(S_surfxml_disk_2); break;
    case S_surfxml_host: case S_surfxml_host_1: case S_surfxml_host_2: SET(S_surfxml_host_2); break;
    case S_surfxml_link: case S_surfxml_link_1: case S_surfxml_link_2: SET(S_surfxml_link_2); break;
    case S_surfxml_process: case S_surfxml_process_1: case S_surfxml_process_2: SET(S_surfxml_process_2); break;
@@ -9718,12 +9967,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 453:
-/* rule 453 can match eol */
+case 470:
+/* rule 470 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</prop>' expected.",yytext);
        YY_BREAK
-case 454:
+case 471:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</prop>' expected.",yytext[0]);
        YY_BREAK
@@ -9731,13 +9980,13 @@ case YY_STATE_EOF(E_surfxml_prop):
 FAIL("Premature EOF: `</prop>' expected.");
        YY_BREAK
 
-case 455:
-/* rule 455 can match eol */
+case 472:
+/* rule 472 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <random> is not allowed here.");
        YY_BREAK
-case 456:
-/* rule 456 can match eol */
+case 473:
+/* rule 473 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_random_generator = A_surfxml_random_generator_DRAND48;
@@ -9760,105 +10009,105 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 457:
-/* rule 457 can match eol */
-case 458:
-/* rule 458 can match eol */
+case 474:
+/* rule 474 can match eol */
+case 475:
+/* rule 475 can match eol */
 YY_RULE_SETUP
 A_surfxml_random_generator = A_surfxml_random_generator_DRAND48;
        YY_BREAK
-case 459:
-/* rule 459 can match eol */
-case 460:
-/* rule 460 can match eol */
+case 476:
+/* rule 476 can match eol */
+case 477:
+/* rule 477 can match eol */
 YY_RULE_SETUP
 A_surfxml_random_generator = A_surfxml_random_generator_RAND;
        YY_BREAK
-case 461:
-/* rule 461 can match eol */
-case 462:
-/* rule 462 can match eol */
+case 478:
+/* rule 478 can match eol */
+case 479:
+/* rule 479 can match eol */
 YY_RULE_SETUP
 A_surfxml_random_generator = A_surfxml_random_generator_RNGSTREAM;
        YY_BREAK
-case 463:
-/* rule 463 can match eol */
-case 464:
-/* rule 464 can match eol */
+case 480:
+/* rule 480 can match eol */
+case 481:
+/* rule 481 can match eol */
 YY_RULE_SETUP
 A_surfxml_random_generator = A_surfxml_random_generator_NONE;
        YY_BREAK
-case 465:
-/* rule 465 can match eol */
+case 482:
+/* rule 482 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
-case 466:
-/* rule 466 can match eol */
+case 483:
+/* rule 483 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
-case 467:
-/* rule 467 can match eol */
+case 484:
+/* rule 484 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
-case 468:
-/* rule 468 can match eol */
+case 485:
+/* rule 485 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
-case 469:
-/* rule 469 can match eol */
+case 486:
+/* rule 486 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
-case 470:
-/* rule 470 can match eol */
+case 487:
+/* rule 487 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
-case 471:
-/* rule 471 can match eol */
+case 488:
+/* rule 488 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
-case 472:
-/* rule 472 can match eol */
+case 489:
+/* rule 489 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
-case 473:
-/* rule 473 can match eol */
+case 490:
+/* rule 490 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
-case 474:
-/* rule 474 can match eol */
+case 491:
+/* rule 491 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
-case 475:
-/* rule 475 can match eol */
+case 492:
+/* rule 492 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
-case 476:
-/* rule 476 can match eol */
+case 493:
+/* rule 493 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
-case 477:
-/* rule 477 can match eol */
+case 494:
+/* rule 494 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
-case 478:
-/* rule 478 can match eol */
+case 495:
+/* rule 495 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
-case 479:
+case 496:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_random_id) FAIL("Required attribute `id' not set for `random' element.");
@@ -9869,7 +10118,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_random();surfxml_pcdata_ix = 0; ENTER(E_surfxml_random);
  }
        YY_BREAK
-case 480:
+case 497:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_random_id) FAIL("Required attribute `id' not set for `random' element.");
@@ -9883,11 +10132,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 481:
+case 498:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of random element.", yytext[0]);
        YY_BREAK
-case 482:
+case 499:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `random' element start tag.",yytext);
        YY_BREAK
@@ -9895,8 +10144,8 @@ case YY_STATE_EOF(AL_surfxml_random):
 FAIL("EOF in attribute list of `random' element.");
        YY_BREAK
 
-case 483:
-/* rule 483 can match eol */
+case 500:
+/* rule 500 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -9907,12 +10156,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 484:
-/* rule 484 can match eol */
+case 501:
+/* rule 501 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</random>' expected.",yytext);
        YY_BREAK
-case 485:
+case 502:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</random>' expected.",yytext[0]);
        YY_BREAK
@@ -9920,13 +10169,13 @@ case YY_STATE_EOF(E_surfxml_random):
 FAIL("Premature EOF: `</random>' expected.");
        YY_BREAK
 
-case 486:
-/* rule 486 can match eol */
+case 503:
+/* rule 503 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <route> is not allowed here.");
        YY_BREAK
-case 487:
-/* rule 487 can match eol */
+case 504:
+/* rule 504 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_route_dst = 0;
@@ -9939,55 +10188,55 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 488:
-/* rule 488 can match eol */
+case 505:
+/* rule 505 can match eol */
 YY_RULE_SETUP
 if (surfxml_route_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_route>");} surfxml_route_dst_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_route_dst);
        YY_BREAK
-case 489:
-/* rule 489 can match eol */
+case 506:
+/* rule 506 can match eol */
 YY_RULE_SETUP
 if (surfxml_route_dst_isset != 0) {FAIL("Multiple definition of attribute dst in <surfxml_route>");}  surfxml_route_dst_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_route_dst);
        YY_BREAK
-case 490:
-/* rule 490 can match eol */
+case 507:
+/* rule 507 can match eol */
 YY_RULE_SETUP
 if (surfxml_route_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_route>");} surfxml_route_src_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_route_src);
        YY_BREAK
-case 491:
-/* rule 491 can match eol */
+case 508:
+/* rule 508 can match eol */
 YY_RULE_SETUP
 if (surfxml_route_src_isset != 0) {FAIL("Multiple definition of attribute src in <surfxml_route>");}  surfxml_route_src_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_route_src);
        YY_BREAK
-case 492:
-/* rule 492 can match eol */
-case 493:
-/* rule 493 can match eol */
+case 509:
+/* rule 509 can match eol */
+case 510:
+/* rule 510 can match eol */
 YY_RULE_SETUP
 A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_YES;
        YY_BREAK
-case 494:
-/* rule 494 can match eol */
-case 495:
-/* rule 495 can match eol */
+case 511:
+/* rule 511 can match eol */
+case 512:
+/* rule 512 can match eol */
 YY_RULE_SETUP
 A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_NO;
        YY_BREAK
-case 496:
-/* rule 496 can match eol */
-case 497:
-/* rule 497 can match eol */
+case 513:
+/* rule 513 can match eol */
+case 514:
+/* rule 514 can match eol */
 YY_RULE_SETUP
 A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_yes;
        YY_BREAK
-case 498:
-/* rule 498 can match eol */
-case 499:
-/* rule 499 can match eol */
+case 515:
+/* rule 515 can match eol */
+case 516:
+/* rule 516 can match eol */
 YY_RULE_SETUP
 A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_no;
        YY_BREAK
-case 500:
+case 517:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
@@ -9995,7 +10244,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_route();surfxml_pcdata_ix = 0; ENTER(S_surfxml_route);
  }
        YY_BREAK
-case 501:
+case 518:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_route_dst) FAIL("Required attribute `dst' not set for `route' element.");
@@ -10007,11 +10256,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 502:
+case 519:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of route element.", yytext[0]);
        YY_BREAK
-case 503:
+case 520:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `route' element start tag.",yytext);
        YY_BREAK
@@ -10019,8 +10268,8 @@ case YY_STATE_EOF(AL_surfxml_route):
 FAIL("EOF in attribute list of `route' element.");
        YY_BREAK
 
-case 504:
-/* rule 504 can match eol */
+case 521:
+/* rule 521 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -10032,12 +10281,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 505:
-/* rule 505 can match eol */
+case 522:
+/* rule 522 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</route>' expected.",yytext);
        YY_BREAK
-case 506:
+case 523:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</route>' expected.",yytext[0]);
        YY_BREAK
@@ -10047,13 +10296,13 @@ case YY_STATE_EOF(S_surfxml_route_2):
 FAIL("Premature EOF: `</route>' expected.");
        YY_BREAK
 
-case 507:
-/* rule 507 can match eol */
+case 524:
+/* rule 524 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <router> is not allowed here.");
        YY_BREAK
-case 508:
-/* rule 508 can match eol */
+case 525:
+/* rule 525 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_router_coordinates = 0;
@@ -10064,34 +10313,34 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 509:
-/* rule 509 can match eol */
+case 526:
+/* rule 526 can match eol */
 YY_RULE_SETUP
 if (surfxml_router_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_router>");} surfxml_router_coordinates_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_router_coordinates);
        YY_BREAK
-case 510:
-/* rule 510 can match eol */
+case 527:
+/* rule 527 can match eol */
 YY_RULE_SETUP
 if (surfxml_router_coordinates_isset != 0) {FAIL("Multiple definition of attribute coordinates in <surfxml_router>");}  surfxml_router_coordinates_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_router_coordinates);
        YY_BREAK
-case 511:
-/* rule 511 can match eol */
+case 528:
+/* rule 528 can match eol */
 YY_RULE_SETUP
 if (surfxml_router_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_router>");} surfxml_router_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_router_id);
        YY_BREAK
-case 512:
-/* rule 512 can match eol */
+case 529:
+/* rule 529 can match eol */
 YY_RULE_SETUP
 if (surfxml_router_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_router>");}  surfxml_router_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_router_id);
        YY_BREAK
-case 513:
+case 530:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element.");
   LEAVE; STag_surfxml_router();surfxml_pcdata_ix = 0; ENTER(E_surfxml_router);
  }
        YY_BREAK
-case 514:
+case 531:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_router_id) FAIL("Required attribute `id' not set for `router' element.");
@@ -10102,11 +10351,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 515:
+case 532:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of router element.", yytext[0]);
        YY_BREAK
-case 516:
+case 533:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `router' element start tag.",yytext);
        YY_BREAK
@@ -10114,8 +10363,8 @@ case YY_STATE_EOF(AL_surfxml_router):
 FAIL("EOF in attribute list of `router' element.");
        YY_BREAK
 
-case 517:
-/* rule 517 can match eol */
+case 534:
+/* rule 534 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -10127,12 +10376,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 518:
-/* rule 518 can match eol */
+case 535:
+/* rule 535 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</router>' expected.",yytext);
        YY_BREAK
-case 519:
+case 536:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</router>' expected.",yytext[0]);
        YY_BREAK
@@ -10140,13 +10389,13 @@ case YY_STATE_EOF(E_surfxml_router):
 FAIL("Premature EOF: `</router>' expected.");
        YY_BREAK
 
-case 520:
-/* rule 520 can match eol */
+case 537:
+/* rule 537 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <storage> is not allowed here.");
        YY_BREAK
-case 521:
-/* rule 521 can match eol */
+case 538:
+/* rule 538 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_storage_attach = 0;
@@ -10161,47 +10410,47 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 522:
-/* rule 522 can match eol */
+case 539:
+/* rule 539 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
-case 523:
-/* rule 523 can match eol */
+case 540:
+/* rule 540 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
-case 524:
-/* rule 524 can match eol */
+case 541:
+/* rule 541 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_content_isset != 0) {FAIL("Multiple definition of attribute content in <surfxml_storage>");} surfxml_storage_content_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_content);
        YY_BREAK
-case 525:
-/* rule 525 can match eol */
+case 542:
+/* rule 542 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_content_isset != 0) {FAIL("Multiple definition of attribute content in <surfxml_storage>");}  surfxml_storage_content_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_content);
        YY_BREAK
-case 526:
-/* rule 526 can match eol */
+case 543:
+/* rule 543 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_storage>");} surfxml_storage_id_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_id);
        YY_BREAK
-case 527:
-/* rule 527 can match eol */
+case 544:
+/* rule 544 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_id_isset != 0) {FAIL("Multiple definition of attribute id in <surfxml_storage>");}  surfxml_storage_id_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_id);
        YY_BREAK
-case 528:
-/* rule 528 can match eol */
+case 545:
+/* rule 545 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_typeId_isset != 0) {FAIL("Multiple definition of attribute typeId in <surfxml_storage>");} surfxml_storage_typeId_isset = 1; ENTER(VALUE1); BUFFERSET(AX_surfxml_storage_typeId);
        YY_BREAK
-case 529:
-/* rule 529 can match eol */
+case 546:
+/* rule 546 can match eol */
 YY_RULE_SETUP
 if (surfxml_storage_typeId_isset != 0) {FAIL("Multiple definition of attribute typeId in <surfxml_storage>");}  surfxml_storage_typeId_isset = 1; ENTER(VALUE2); BUFFERSET(AX_surfxml_storage_typeId);
        YY_BREAK
-case 530:
+case 547:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_storage_attach) FAIL("Required attribute `attach' not set for `storage' element.");
@@ -10210,7 +10459,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_storage();surfxml_pcdata_ix = 0; ENTER(S_surfxml_storage);
  }
        YY_BREAK
-case 531:
+case 548:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_storage_attach) FAIL("Required attribute `attach' not set for `storage' element.");
@@ -10223,11 +10472,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 532:
+case 549:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of storage element.", yytext[0]);
        YY_BREAK
-case 533:
+case 550:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `storage' element start tag.",yytext);
        YY_BREAK
@@ -10235,8 +10484,8 @@ case YY_STATE_EOF(AL_surfxml_storage):
 FAIL("EOF in attribute list of `storage' element.");
        YY_BREAK
 
-case 534:
-/* rule 534 can match eol */
+case 551:
+/* rule 551 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -10248,12 +10497,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 535:
-/* rule 535 can match eol */
+case 552:
+/* rule 552 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</storage>' expected.",yytext);
        YY_BREAK
-case 536:
+case 553:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</storage>' expected.",yytext[0]);
        YY_BREAK
@@ -10263,13 +10512,13 @@ case YY_STATE_EOF(S_surfxml_storage_2):
 FAIL("Premature EOF: `</storage>' expected.");
        YY_BREAK
 
-case 537:
-/* rule 537 can match eol */
+case 554:
+/* rule 554 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <storage_type> is not allowed here.");
        YY_BREAK
-case 538:
-/* rule 538 can match eol */
+case 555:
+/* rule 555 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_storage___type_content = 0;
@@ -10284,47 +10533,47 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 539:
-/* rule 539 can match eol */
+case 556:
+/* rule 556 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
-case 540:
-/* rule 540 can match eol */
+case 557:
+/* rule 557 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
-case 541:
-/* rule 541 can match eol */
+case 558:
+/* rule 558 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
-case 542:
-/* rule 542 can match eol */
+case 559:
+/* rule 559 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
-case 543:
-/* rule 543 can match eol */
+case 560:
+/* rule 560 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
-case 544:
-/* rule 544 can match eol */
+case 561:
+/* rule 561 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
-case 545:
-/* rule 545 can match eol */
+case 562:
+/* rule 562 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
-case 546:
-/* rule 546 can match eol */
+case 563:
+/* rule 563 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
-case 547:
+case 564:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_storage___type_id) FAIL("Required attribute `id' not set for `storage_type' element.");
@@ -10332,7 +10581,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_storage___type();surfxml_pcdata_ix = 0; ENTER(S_surfxml_storage___type);
  }
        YY_BREAK
-case 548:
+case 565:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_storage___type_id) FAIL("Required attribute `id' not set for `storage_type' element.");
@@ -10344,11 +10593,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 549:
+case 566:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of storage_type element.", yytext[0]);
        YY_BREAK
-case 550:
+case 567:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `storage_type' element start tag.",yytext);
        YY_BREAK
@@ -10356,9 +10605,9 @@ case YY_STATE_EOF(AL_surfxml_storage___type):
 FAIL("EOF in attribute list of `storage_type' element.");
        YY_BREAK
 
-case 551:
-/* rule 551 can match eol */
-YY_RULE_SETUP
+case 568:
+/* rule 568 can match eol */
+YY_RULE_SETUP
 {
   LEAVE;
   ETag_surfxml_storage___type();
@@ -10369,12 +10618,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 552:
-/* rule 552 can match eol */
+case 569:
+/* rule 569 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</storage_type>' expected.",yytext);
        YY_BREAK
-case 553:
+case 570:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</storage_type>' expected.",yytext[0]);
        YY_BREAK
@@ -10384,13 +10633,13 @@ case YY_STATE_EOF(S_surfxml_storage___type_2):
 FAIL("Premature EOF: `</storage_type>' expected.");
        YY_BREAK
 
-case 554:
-/* rule 554 can match eol */
+case 571:
+/* rule 571 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <trace> is not allowed here.");
        YY_BREAK
-case 555:
-/* rule 555 can match eol */
+case 572:
+/* rule 572 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_trace_file = 0;
@@ -10403,37 +10652,37 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 556:
-/* rule 556 can match eol */
+case 573:
+/* rule 573 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
-case 557:
-/* rule 557 can match eol */
+case 574:
+/* rule 574 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
-case 558:
-/* rule 558 can match eol */
+case 575:
+/* rule 575 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
-case 559:
-/* rule 559 can match eol */
+case 576:
+/* rule 576 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
-case 560:
-/* rule 560 can match eol */
+case 577:
+/* rule 577 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
-case 561:
-/* rule 561 can match eol */
+case 578:
+/* rule 578 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
-case 562:
+case 579:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_trace_id) FAIL("Required attribute `id' not set for `trace' element.");
@@ -10441,33 +10690,33 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_trace();pushbuffer(surfxml_pcdata_ix); BUFFERSET(surfxml_pcdata_ix);; ENTER(IN_trace);
  }
        YY_BREAK
-case 563:
+case 580:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_trace_id) FAIL("Required attribute `id' not set for `trace' element.");
   if (!AX_surfxml_trace_periodicity) FAIL("Required attribute `periodicity' not set for `trace' element.");
   LEAVE; STag_surfxml_trace(); surfxml_pcdata_ix = 0; ETag_surfxml_trace(); popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS_10: case S_surfxml_AS_11: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_9: SET(S_surfxml_AS_11); break;
-   case S_surfxml_AS_13: case S_surfxml_AS_14: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break;
+   case S_surfxml_AS_10: case S_surfxml_AS_11: case S_surfxml_AS_7: case S_surfxml_AS_9: SET(S_surfxml_AS_11); break;
+   case S_surfxml_AS_13: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break;
    case S_surfxml_AS_12: case S_surfxml_AS_15: case S_surfxml_AS_16: SET(S_surfxml_AS_16); break;
-   case S_surfxml_AS_1: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break;
-   case S_surfxml_AS: case S_surfxml_AS_8: SET(S_surfxml_AS_9); break;
+   case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_8: SET(S_surfxml_AS_9); break;
    case S_surfxml_include: case S_surfxml_include_1: case S_surfxml_include_2: SET(S_surfxml_include_2); break;
    case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break;
-   case S_surfxml_zone: case S_surfxml_zone_10: case S_surfxml_zone_11: case S_surfxml_zone_1: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_9: SET(S_surfxml_zone_11); break;
+   case S_surfxml_zone: case S_surfxml_zone_10: case S_surfxml_zone_11: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_9: SET(S_surfxml_zone_11); break;
    case S_surfxml_zone_13: SET(S_surfxml_zone_14); break;
-   case S_surfxml_zone_12: case S_surfxml_zone_14: case S_surfxml_zone_15: case S_surfxml_zone_16: case S_surfxml_zone_3: SET(S_surfxml_zone_16); break;
-   case S_surfxml_zone_5: SET(S_surfxml_zone_6); break;
+   case S_surfxml_zone_12: case S_surfxml_zone_14: case S_surfxml_zone_15: case S_surfxml_zone_16: case S_surfxml_zone_1: SET(S_surfxml_zone_16); break;
+   case S_surfxml_zone_3: case S_surfxml_zone_5: SET(S_surfxml_zone_6); break;
    case S_surfxml_zone_8: SET(S_surfxml_zone_9); break;
   }
  }
        YY_BREAK
-case 564:
+case 581:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of trace element.", yytext[0]);
        YY_BREAK
-case 565:
+case 582:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `trace' element start tag.",yytext);
        YY_BREAK
@@ -10475,8 +10724,8 @@ case YY_STATE_EOF(AL_surfxml_trace):
 FAIL("EOF in attribute list of `trace' element.");
        YY_BREAK
 
-case 566:
-/* rule 566 can match eol */
+case 583:
+/* rule 583 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -10485,23 +10734,23 @@ YY_RULE_SETUP
   surfxml_pcdata_ix = popbuffer();
   popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS_10: case S_surfxml_AS_11: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_9: SET(S_surfxml_AS_11); break;
-   case S_surfxml_AS_13: case S_surfxml_AS_14: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break;
+   case S_surfxml_AS_10: case S_surfxml_AS_11: case S_surfxml_AS_7: case S_surfxml_AS_9: SET(S_surfxml_AS_11); break;
+   case S_surfxml_AS_13: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break;
    case S_surfxml_AS_12: case S_surfxml_AS_15: case S_surfxml_AS_16: SET(S_surfxml_AS_16); break;
-   case S_surfxml_AS_1: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break;
-   case S_surfxml_AS: case S_surfxml_AS_8: SET(S_surfxml_AS_9); break;
+   case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_8: SET(S_surfxml_AS_9); break;
    case S_surfxml_include: case S_surfxml_include_1: case S_surfxml_include_2: SET(S_surfxml_include_2); break;
    case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break;
-   case S_surfxml_zone: case S_surfxml_zone_10: case S_surfxml_zone_11: case S_surfxml_zone_1: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_9: SET(S_surfxml_zone_11); break;
+   case S_surfxml_zone: case S_surfxml_zone_10: case S_surfxml_zone_11: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_9: SET(S_surfxml_zone_11); break;
    case S_surfxml_zone_13: SET(S_surfxml_zone_14); break;
-   case S_surfxml_zone_12: case S_surfxml_zone_14: case S_surfxml_zone_15: case S_surfxml_zone_16: case S_surfxml_zone_3: SET(S_surfxml_zone_16); break;
-   case S_surfxml_zone_5: SET(S_surfxml_zone_6); break;
+   case S_surfxml_zone_12: case S_surfxml_zone_14: case S_surfxml_zone_15: case S_surfxml_zone_16: case S_surfxml_zone_1: SET(S_surfxml_zone_16); break;
+   case S_surfxml_zone_3: case S_surfxml_zone_5: SET(S_surfxml_zone_6); break;
    case S_surfxml_zone_8: SET(S_surfxml_zone_9); break;
   }
  }
        YY_BREAK
-case 567:
-/* rule 567 can match eol */
+case 584:
+/* rule 584 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</trace>' expected.",yytext);
        YY_BREAK
@@ -10509,13 +10758,13 @@ case YY_STATE_EOF(IN_trace):
 FAIL("Premature EOF: `</trace>' expected.");
        YY_BREAK
 
-case 568:
-/* rule 568 can match eol */
+case 585:
+/* rule 585 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <trace_connect> is not allowed here.");
        YY_BREAK
-case 569:
-/* rule 569 can match eol */
+case 586:
+/* rule 586 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_trace___connect_element = 0;
@@ -10528,62 +10777,62 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 570:
-/* rule 570 can match eol */
+case 587:
+/* rule 587 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
-case 571:
-/* rule 571 can match eol */
+case 588:
+/* rule 588 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
-case 572:
-/* rule 572 can match eol */
-case 573:
-/* rule 573 can match eol */
+case 589:
+/* rule 589 can match eol */
+case 590:
+/* rule 590 can match eol */
 YY_RULE_SETUP
 A_surfxml_trace___connect_kind = A_surfxml_trace___connect_kind_HOST___AVAIL;
        YY_BREAK
-case 574:
-/* rule 574 can match eol */
-case 575:
-/* rule 575 can match eol */
+case 591:
+/* rule 591 can match eol */
+case 592:
+/* rule 592 can match eol */
 YY_RULE_SETUP
 A_surfxml_trace___connect_kind = A_surfxml_trace___connect_kind_SPEED;
        YY_BREAK
-case 576:
-/* rule 576 can match eol */
-case 577:
-/* rule 577 can match eol */
+case 593:
+/* rule 593 can match eol */
+case 594:
+/* rule 594 can match eol */
 YY_RULE_SETUP
 A_surfxml_trace___connect_kind = A_surfxml_trace___connect_kind_LINK___AVAIL;
        YY_BREAK
-case 578:
-/* rule 578 can match eol */
-case 579:
-/* rule 579 can match eol */
+case 595:
+/* rule 595 can match eol */
+case 596:
+/* rule 596 can match eol */
 YY_RULE_SETUP
 A_surfxml_trace___connect_kind = A_surfxml_trace___connect_kind_BANDWIDTH;
        YY_BREAK
-case 580:
-/* rule 580 can match eol */
-case 581:
-/* rule 581 can match eol */
+case 597:
+/* rule 597 can match eol */
+case 598:
+/* rule 598 can match eol */
 YY_RULE_SETUP
 A_surfxml_trace___connect_kind = A_surfxml_trace___connect_kind_LATENCY;
        YY_BREAK
-case 582:
-/* rule 582 can match eol */
+case 599:
+/* rule 599 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
-case 583:
-/* rule 583 can match eol */
+case 600:
+/* rule 600 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
-case 584:
+case 601:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_trace___connect_element) FAIL("Required attribute `element' not set for `trace_connect' element.");
@@ -10591,33 +10840,33 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_trace___connect();surfxml_pcdata_ix = 0; ENTER(E_surfxml_trace___connect);
  }
        YY_BREAK
-case 585:
+case 602:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_trace___connect_element) FAIL("Required attribute `element' not set for `trace_connect' element.");
   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; ETag_surfxml_trace___connect(); popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS_10: case S_surfxml_AS_11: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_9: SET(S_surfxml_AS_11); break;
-   case S_surfxml_AS_13: case S_surfxml_AS_14: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break;
+   case S_surfxml_AS_10: case S_surfxml_AS_11: case S_surfxml_AS_7: case S_surfxml_AS_9: SET(S_surfxml_AS_11); break;
+   case S_surfxml_AS_13: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break;
    case S_surfxml_AS_12: case S_surfxml_AS_15: case S_surfxml_AS_16: SET(S_surfxml_AS_16); break;
-   case S_surfxml_AS_1: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break;
-   case S_surfxml_AS: case S_surfxml_AS_8: SET(S_surfxml_AS_9); break;
+   case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_8: SET(S_surfxml_AS_9); break;
    case S_surfxml_include: case S_surfxml_include_1: case S_surfxml_include_2: SET(S_surfxml_include_2); break;
    case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break;
-   case S_surfxml_zone: case S_surfxml_zone_10: case S_surfxml_zone_11: case S_surfxml_zone_1: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_9: SET(S_surfxml_zone_11); break;
+   case S_surfxml_zone: case S_surfxml_zone_10: case S_surfxml_zone_11: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_9: SET(S_surfxml_zone_11); break;
    case S_surfxml_zone_13: SET(S_surfxml_zone_14); break;
-   case S_surfxml_zone_12: case S_surfxml_zone_14: case S_surfxml_zone_15: case S_surfxml_zone_16: case S_surfxml_zone_3: SET(S_surfxml_zone_16); break;
-   case S_surfxml_zone_5: SET(S_surfxml_zone_6); break;
+   case S_surfxml_zone_12: case S_surfxml_zone_14: case S_surfxml_zone_15: case S_surfxml_zone_16: case S_surfxml_zone_1: SET(S_surfxml_zone_16); break;
+   case S_surfxml_zone_3: case S_surfxml_zone_5: SET(S_surfxml_zone_6); break;
    case S_surfxml_zone_8: SET(S_surfxml_zone_9); break;
   }
  }
        YY_BREAK
-case 586:
+case 603:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of trace_connect element.", yytext[0]);
        YY_BREAK
-case 587:
+case 604:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `trace_connect' element start tag.",yytext);
        YY_BREAK
@@ -10625,35 +10874,35 @@ case YY_STATE_EOF(AL_surfxml_trace___connect):
 FAIL("EOF in attribute list of `trace_connect' element.");
        YY_BREAK
 
-case 588:
-/* rule 588 can match eol */
+case 605:
+/* rule 605 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
   ETag_surfxml_trace___connect();
   popbuffer(); /* attribute */
   switch (YY_START) {
-   case S_surfxml_AS_10: case S_surfxml_AS_11: case S_surfxml_AS_4: case S_surfxml_AS_6: case S_surfxml_AS_7: case S_surfxml_AS_9: SET(S_surfxml_AS_11); break;
-   case S_surfxml_AS_13: case S_surfxml_AS_14: case S_surfxml_AS_3: SET(S_surfxml_AS_14); break;
+   case S_surfxml_AS_10: case S_surfxml_AS_11: case S_surfxml_AS_7: case S_surfxml_AS_9: SET(S_surfxml_AS_11); break;
+   case S_surfxml_AS_13: case S_surfxml_AS_14: SET(S_surfxml_AS_14); break;
    case S_surfxml_AS_12: case S_surfxml_AS_15: case S_surfxml_AS_16: SET(S_surfxml_AS_16); break;
-   case S_surfxml_AS_1: case S_surfxml_AS_5: SET(S_surfxml_AS_6); break;
-   case S_surfxml_AS: case S_surfxml_AS_8: SET(S_surfxml_AS_9); break;
+   case S_surfxml_AS_1: case S_surfxml_AS_5: case S_surfxml_AS_6: SET(S_surfxml_AS_6); break;
+   case S_surfxml_AS: case S_surfxml_AS_3: case S_surfxml_AS_4: case S_surfxml_AS_8: SET(S_surfxml_AS_9); break;
    case S_surfxml_include: case S_surfxml_include_1: case S_surfxml_include_2: SET(S_surfxml_include_2); break;
    case S_surfxml_platform: case S_surfxml_platform_1: case S_surfxml_platform_3: case S_surfxml_platform_5: case S_surfxml_platform_6: SET(S_surfxml_platform_6); break;
-   case S_surfxml_zone: case S_surfxml_zone_10: case S_surfxml_zone_11: case S_surfxml_zone_1: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_9: SET(S_surfxml_zone_11); break;
+   case S_surfxml_zone: case S_surfxml_zone_10: case S_surfxml_zone_11: case S_surfxml_zone_4: case S_surfxml_zone_6: case S_surfxml_zone_7: case S_surfxml_zone_9: SET(S_surfxml_zone_11); break;
    case S_surfxml_zone_13: SET(S_surfxml_zone_14); break;
-   case S_surfxml_zone_12: case S_surfxml_zone_14: case S_surfxml_zone_15: case S_surfxml_zone_16: case S_surfxml_zone_3: SET(S_surfxml_zone_16); break;
-   case S_surfxml_zone_5: SET(S_surfxml_zone_6); break;
+   case S_surfxml_zone_12: case S_surfxml_zone_14: case S_surfxml_zone_15: case S_surfxml_zone_16: case S_surfxml_zone_1: SET(S_surfxml_zone_16); break;
+   case S_surfxml_zone_3: case S_surfxml_zone_5: SET(S_surfxml_zone_6); break;
    case S_surfxml_zone_8: SET(S_surfxml_zone_9); break;
   }
  }
        YY_BREAK
-case 589:
-/* rule 589 can match eol */
+case 606:
+/* rule 606 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</trace_connect>' expected.",yytext);
        YY_BREAK
-case 590:
+case 607:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</trace_connect>' expected.",yytext[0]);
        YY_BREAK
@@ -10668,13 +10917,13 @@ FAIL("Premature EOF: `</trace_connect>' expected.");
   *        (trace|trace_connect)*)
   *       |((include|storage_type|storage|host|cabinet|router|link|backbone|trace|trace_connect|host_link)*,
   *         (route|trace|trace_connect|bypassRoute)*)))>  */
-case 591:
-/* rule 591 can match eol */
+case 608:
+/* rule 608 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <zone> is not allowed here.");
        YY_BREAK
-case 592:
-/* rule 592 can match eol */
+case 609:
+/* rule 609 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_zone_id = 0;
@@ -10685,87 +10934,87 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 593:
-/* rule 593 can match eol */
+case 610:
+/* rule 610 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
-case 594:
-/* rule 594 can match eol */
+case 611:
+/* rule 611 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
-case 595:
-/* rule 595 can match eol */
-case 596:
-/* rule 596 can match eol */
+case 612:
+/* rule 612 can match eol */
+case 613:
+/* rule 613 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_Full;
        YY_BREAK
-case 597:
-/* rule 597 can match eol */
-case 598:
-/* rule 598 can match eol */
+case 614:
+/* rule 614 can match eol */
+case 615:
+/* rule 615 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_Floyd;
        YY_BREAK
-case 599:
-/* rule 599 can match eol */
-case 600:
-/* rule 600 can match eol */
+case 616:
+/* rule 616 can match eol */
+case 617:
+/* rule 617 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_Dijkstra;
        YY_BREAK
-case 601:
-/* rule 601 can match eol */
-case 602:
-/* rule 602 can match eol */
+case 618:
+/* rule 618 can match eol */
+case 619:
+/* rule 619 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_DijkstraCache;
        YY_BREAK
-case 603:
-/* rule 603 can match eol */
-case 604:
-/* rule 604 can match eol */
+case 620:
+/* rule 620 can match eol */
+case 621:
+/* rule 621 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_None;
        YY_BREAK
-case 605:
-/* rule 605 can match eol */
-case 606:
-/* rule 606 can match eol */
+case 622:
+/* rule 622 can match eol */
+case 623:
+/* rule 623 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_Vivaldi;
        YY_BREAK
-case 607:
-/* rule 607 can match eol */
-case 608:
-/* rule 608 can match eol */
+case 624:
+/* rule 624 can match eol */
+case 625:
+/* rule 625 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_Cluster;
        YY_BREAK
-case 609:
-/* rule 609 can match eol */
-case 610:
-/* rule 610 can match eol */
+case 626:
+/* rule 626 can match eol */
+case 627:
+/* rule 627 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_ClusterTorus;
        YY_BREAK
-case 611:
-/* rule 611 can match eol */
-case 612:
-/* rule 612 can match eol */
+case 628:
+/* rule 628 can match eol */
+case 629:
+/* rule 629 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_ClusterFatTree;
        YY_BREAK
-case 613:
-/* rule 613 can match eol */
-case 614:
-/* rule 614 can match eol */
+case 630:
+/* rule 630 can match eol */
+case 631:
+/* rule 631 can match eol */
 YY_RULE_SETUP
 A_surfxml_zone_routing = A_surfxml_zone_routing_ClusterDragonfly;
        YY_BREAK
-case 615:
+case 632:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_zone_id) FAIL("Required attribute `id' not set for `zone' element.");
@@ -10773,7 +11022,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_zone();surfxml_pcdata_ix = 0; ENTER(S_surfxml_zone);
  }
        YY_BREAK
-case 616:
+case 633:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_zone_id) FAIL("Required attribute `id' not set for `zone' element.");
@@ -10787,11 +11036,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 617:
+case 634:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of zone element.", yytext[0]);
        YY_BREAK
-case 618:
+case 635:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `zone' element start tag.",yytext);
        YY_BREAK
@@ -10799,8 +11048,8 @@ case YY_STATE_EOF(AL_surfxml_zone):
 FAIL("EOF in attribute list of `zone' element.");
        YY_BREAK
 
-case 619:
-/* rule 619 can match eol */
+case 636:
+/* rule 636 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -10814,12 +11063,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 620:
-/* rule 620 can match eol */
+case 637:
+/* rule 637 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</zone>' expected.",yytext);
        YY_BREAK
-case 621:
+case 638:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</zone>' expected.",yytext[0]);
        YY_BREAK
@@ -10838,13 +11087,13 @@ case YY_STATE_EOF(S_surfxml_zone_9):
 FAIL("Premature EOF: `</zone>' expected.");
        YY_BREAK
 
-case 622:
-/* rule 622 can match eol */
+case 639:
+/* rule 639 can match eol */
 YY_RULE_SETUP
 FAIL("Starting tag <zoneRoute> is not allowed here.");
        YY_BREAK
-case 623:
-/* rule 623 can match eol */
+case 640:
+/* rule 640 can match eol */
 YY_RULE_SETUP
 {
   AX_surfxml_zoneRoute_dst = 0;
@@ -10861,75 +11110,75 @@ YY_RULE_SETUP
   }
        YY_BREAK
 
-case 624:
-/* rule 624 can match eol */
+case 641:
+/* rule 641 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
-case 625:
-/* rule 625 can match eol */
+case 642:
+/* rule 642 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
-case 626:
-/* rule 626 can match eol */
+case 643:
+/* rule 643 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
-case 627:
-/* rule 627 can match eol */
+case 644:
+/* rule 644 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
-case 628:
-/* rule 628 can match eol */
+case 645:
+/* rule 645 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
-case 629:
-/* rule 629 can match eol */
+case 646:
+/* rule 646 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
-case 630:
-/* rule 630 can match eol */
+case 647:
+/* rule 647 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
-case 631:
-/* rule 631 can match eol */
+case 648:
+/* rule 648 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
-case 632:
-/* rule 632 can match eol */
-case 633:
-/* rule 633 can match eol */
+case 649:
+/* rule 649 can match eol */
+case 650:
+/* rule 650 can match eol */
 YY_RULE_SETUP
 A_surfxml_zoneRoute_symmetrical = A_surfxml_zoneRoute_symmetrical_YES;
        YY_BREAK
-case 634:
-/* rule 634 can match eol */
-case 635:
-/* rule 635 can match eol */
+case 651:
+/* rule 651 can match eol */
+case 652:
+/* rule 652 can match eol */
 YY_RULE_SETUP
 A_surfxml_zoneRoute_symmetrical = A_surfxml_zoneRoute_symmetrical_NO;
        YY_BREAK
-case 636:
-/* rule 636 can match eol */
-case 637:
-/* rule 637 can match eol */
+case 653:
+/* rule 653 can match eol */
+case 654:
+/* rule 654 can match eol */
 YY_RULE_SETUP
 A_surfxml_zoneRoute_symmetrical = A_surfxml_zoneRoute_symmetrical_yes;
        YY_BREAK
-case 638:
-/* rule 638 can match eol */
-case 639:
-/* rule 639 can match eol */
+case 655:
+/* rule 655 can match eol */
+case 656:
+/* rule 656 can match eol */
 YY_RULE_SETUP
 A_surfxml_zoneRoute_symmetrical = A_surfxml_zoneRoute_symmetrical_no;
        YY_BREAK
-case 640:
+case 657:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_zoneRoute_dst) FAIL("Required attribute `dst' not set for `zoneRoute' element.");
@@ -10939,7 +11188,7 @@ YY_RULE_SETUP
   LEAVE; STag_surfxml_zoneRoute();surfxml_pcdata_ix = 0; ENTER(S_surfxml_zoneRoute);
  }
        YY_BREAK
-case 641:
+case 658:
 YY_RULE_SETUP
 {
   if (!AX_surfxml_zoneRoute_dst) FAIL("Required attribute `dst' not set for `zoneRoute' element.");
@@ -10953,11 +11202,11 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 642:
+case 659:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c' in attribute list of zoneRoute element.", yytext[0]);
        YY_BREAK
-case 643:
+case 660:
 YY_RULE_SETUP
 FAIL("Bad attribute `%s' in `zoneRoute' element start tag.",yytext);
        YY_BREAK
@@ -10965,8 +11214,8 @@ case YY_STATE_EOF(AL_surfxml_zoneRoute):
 FAIL("EOF in attribute list of `zoneRoute' element.");
        YY_BREAK
 
-case 644:
-/* rule 644 can match eol */
+case 661:
+/* rule 661 can match eol */
 YY_RULE_SETUP
 {
   LEAVE;
@@ -10978,12 +11227,12 @@ YY_RULE_SETUP
   }
  }
        YY_BREAK
-case 645:
-/* rule 645 can match eol */
+case 662:
+/* rule 662 can match eol */
 YY_RULE_SETUP
 FAIL("Unexpected end-tag `%s': `</zoneRoute>' expected.",yytext);
        YY_BREAK
-case 646:
+case 663:
 YY_RULE_SETUP
 FAIL("Unexpected character `%c': `</zoneRoute>' expected.",yytext[0]);
        YY_BREAK
@@ -10995,7 +11244,7 @@ FAIL("Premature EOF: `</zoneRoute>' expected.");
 
 /* EPILOG: after the root element. */
 
-case 647:
+case 664:
 YY_RULE_SETUP
 {SET(PROLOG); yyless(0); CLEANUP; return -1;}
        YY_BREAK
@@ -11006,58 +11255,58 @@ SUCCEED;
 /* CHARACTER DATA. */
 
 /* Non-defined standard entities... */
-case 648:
+case 665:
 YY_RULE_SETUP
 BUFFERPUTC('&');
        YY_BREAK
-case 649:
+case 666:
 YY_RULE_SETUP
 BUFFERPUTC('<');
        YY_BREAK
-case 650:
+case 667:
 YY_RULE_SETUP
 BUFFERPUTC('>');
        YY_BREAK
-case 651:
+case 668:
 YY_RULE_SETUP
 BUFFERPUTC('\'');
        YY_BREAK
-case 652:
+case 669:
 YY_RULE_SETUP
 BUFFERPUTC('"');
        YY_BREAK
 /* Character entities. */
-case 653:
+case 670:
 YY_RULE_SETUP
 BUFFERPUTC((unsigned char)atoi(yytext+2));
        YY_BREAK
-case 654:
+case 671:
 YY_RULE_SETUP
 BUFFERPUTC((unsigned char)strtol(yytext+3,NULL,16));
        YY_BREAK
 
-case 655:
-/* rule 655 can match eol */
-case 656:
-/* rule 656 can match eol */
-case 657:
-/* rule 657 can match eol */
-case 658:
-/* rule 658 can match eol */
+case 672:
+/* rule 672 can match eol */
+case 673:
+/* rule 673 can match eol */
+case 674:
+/* rule 674 can match eol */
+case 675:
+/* rule 675 can match eol */
 YY_RULE_SETUP
 BUFFERPUTC('\n');
        YY_BREAK
 
-case 659:
+case 676:
 YY_RULE_SETUP
 ENTER(CDATA);
        YY_BREAK
-case 660:
+case 677:
 YY_RULE_SETUP
 FAIL("Unexpected `]""]>' in character data.");
        YY_BREAK
 
-case 661:
+case 678:
 YY_RULE_SETUP
 BUFFERDONE; LEAVE;
        YY_BREAK
@@ -11065,7 +11314,7 @@ case YY_STATE_EOF(VALUE1):
 FAIL("EOF in literal (\"'\" expected).");
        YY_BREAK
 
-case 662:
+case 679:
 YY_RULE_SETUP
 BUFFERDONE; LEAVE;
        YY_BREAK
@@ -11073,22 +11322,22 @@ case YY_STATE_EOF(VALUE2):
 FAIL("EOF in literal (`\"' expected).");
        YY_BREAK
 
-case 663:
-/* rule 663 can match eol */
+case 680:
+/* rule 680 can match eol */
 YY_RULE_SETUP
 BUFFERPUTC(yytext[0]);
        YY_BREAK
-case 664:
+case 681:
 YY_RULE_SETUP
 FAIL("Spurious `%c' in character data.",yytext[0]);
        YY_BREAK
 
-case 665:
+case 682:
 YY_RULE_SETUP
 LEAVE;
        YY_BREAK
 /* "]""]"              BUFFERPUTC(yytext[0]); BUFFERPUTC(yytext[1]); */
-case 666:
+case 683:
 YY_RULE_SETUP
 BUFFERPUTC(yytext[0]);
        YY_BREAK
@@ -11100,13 +11349,13 @@ FAIL("EOF in CDATA section.");
 /* Ideally, this should be replaced by code in flexml.pl that
     generates just the states not covered by other rules. */
 
-case 667:
-/* rule 667 can match eol */
+case 684:
+/* rule 684 can match eol */
 YY_RULE_SETUP
 FAIL("Syntax error on character `%c'.", yytext[0]);
        YY_BREAK
 
-case 668:
+case 685:
 YY_RULE_SETUP
 ECHO;
        YY_BREAK
@@ -11124,6 +11373,7 @@ case YY_STATE_EOF(S_surfxml_bypassRoute_1):
 case YY_STATE_EOF(S_surfxml_bypassZoneRoute_1):
 case YY_STATE_EOF(S_surfxml_cluster_1):
 case YY_STATE_EOF(S_surfxml_config_1):
+case YY_STATE_EOF(S_surfxml_disk_1):
 case YY_STATE_EOF(S_surfxml_host_1):
 case YY_STATE_EOF(S_surfxml_include_1):
 case YY_STATE_EOF(S_surfxml_link_1):
@@ -11438,7 +11688,7 @@ static int yy_get_next_buffer (void)
                while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                        {
                        yy_current_state = (int) yy_def[yy_current_state];
-                       if ( yy_current_state >= 4108 )
+                       if ( yy_current_state >= 4193 )
                                yy_c = yy_meta[yy_c];
                        }
                yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
@@ -11466,11 +11716,11 @@ static int yy_get_next_buffer (void)
        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
                {
                yy_current_state = (int) yy_def[yy_current_state];
-               if ( yy_current_state >= 4108 )
+               if ( yy_current_state >= 4193 )
                        yy_c = yy_meta[yy_c];
                }
        yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
-       yy_is_jam = (yy_current_state == 4107);
+       yy_is_jam = (yy_current_state == 4192);
 
                return yy_is_jam ? 0 : yy_current_state;
 }
index 20f21d8..36b858b 100644 (file)
@@ -70,11 +70,13 @@ XBT_PUBLIC void STag_surfxml_cluster(void);
 XBT_PUBLIC void ETag_surfxml_cluster(void);
 XBT_PUBLIC void STag_surfxml_config(void);
 XBT_PUBLIC void ETag_surfxml_config(void);
+XBT_PUBLIC void STag_surfxml_disk(void);
+XBT_PUBLIC void ETag_surfxml_disk(void);
 XBT_PUBLIC void STag_surfxml_host(void);
 XBT_PUBLIC void ETag_surfxml_host(void);
 XBT_PUBLIC void STag_surfxml_host___link(void);
 XBT_PUBLIC void ETag_surfxml_host___link(void);
-XBT_PUBLIC void STag_surfxml_include(void);
+XBT_ATTRIB_NORETURN XBT_PUBLIC void STag_surfxml_include(void);
 XBT_PUBLIC void ETag_surfxml_include(void);
 XBT_PUBLIC void STag_surfxml_link(void);
 XBT_PUBLIC void ETag_surfxml_link(void);
@@ -210,6 +212,12 @@ typedef int AT_surfxml_cluster_topo___parameters;
 typedef enum { AU_surfxml_cluster_topology, A_surfxml_cluster_topology_FLAT,A_surfxml_cluster_topology_TORUS,A_surfxml_cluster_topology_FAT___TREE,A_surfxml_cluster_topology_DRAGONFLY } AT_surfxml_cluster_topology;
 typedef int AT_surfxml_config_id;
 #define AU_surfxml_config_id NULL
+typedef int AT_surfxml_disk_id;
+#define AU_surfxml_disk_id NULL
+typedef int AT_surfxml_disk_read___bw;
+#define AU_surfxml_disk_read___bw NULL
+typedef int AT_surfxml_disk_write___bw;
+#define AU_surfxml_disk_write___bw NULL
 typedef int AT_surfxml_host_availability___file;
 #define AU_surfxml_host_availability___file NULL
 typedef int AT_surfxml_host_coordinates;
@@ -244,7 +252,7 @@ typedef int AT_surfxml_link_latency;
 #define AU_surfxml_link_latency NULL
 typedef int AT_surfxml_link_latency___file;
 #define AU_surfxml_link_latency___file NULL
-typedef enum { AU_surfxml_link_sharing___policy, A_surfxml_link_sharing___policy_SHARED,A_surfxml_link_sharing___policy_SPLITDUPLEX,A_surfxml_link_sharing___policy_FULLDUPLEX,A_surfxml_link_sharing___policy_FATPIPE } AT_surfxml_link_sharing___policy;
+typedef enum { AU_surfxml_link_sharing___policy, A_surfxml_link_sharing___policy_SHARED,A_surfxml_link_sharing___policy_SPLITDUPLEX,A_surfxml_link_sharing___policy_FULLDUPLEX,A_surfxml_link_sharing___policy_FATPIPE,A_surfxml_link_sharing___policy_WIFI } AT_surfxml_link_sharing___policy;
 typedef int AT_surfxml_link_state___file;
 #define AU_surfxml_link_state___file NULL
 typedef enum { AU_surfxml_link___ctn_direction, A_surfxml_link___ctn_direction_UP,A_surfxml_link___ctn_direction_DOWN,A_surfxml_link___ctn_direction_NONE } AT_surfxml_link___ctn_direction;
@@ -515,6 +523,15 @@ XBT_PUBLIC_DATA short int surfxml_cluster_topology_isset;
 XBT_PUBLIC_DATA AT_surfxml_config_id AX_surfxml_config_id;
 #define A_surfxml_config_id (surfxml_bufferstack + AX_surfxml_config_id)
 XBT_PUBLIC_DATA short int surfxml_config_id_isset;
+XBT_PUBLIC_DATA AT_surfxml_disk_id AX_surfxml_disk_id;
+#define A_surfxml_disk_id (surfxml_bufferstack + AX_surfxml_disk_id)
+XBT_PUBLIC_DATA short int surfxml_disk_id_isset;
+XBT_PUBLIC_DATA AT_surfxml_disk_read___bw AX_surfxml_disk_read___bw;
+#define A_surfxml_disk_read___bw (surfxml_bufferstack + AX_surfxml_disk_read___bw)
+XBT_PUBLIC_DATA short int surfxml_disk_read___bw_isset;
+XBT_PUBLIC_DATA AT_surfxml_disk_write___bw AX_surfxml_disk_write___bw;
+#define A_surfxml_disk_write___bw (surfxml_bufferstack + AX_surfxml_disk_write___bw)
+XBT_PUBLIC_DATA short int surfxml_disk_write___bw_isset;
 XBT_PUBLIC_DATA AT_surfxml_host_availability___file AX_surfxml_host_availability___file;
 #define A_surfxml_host_availability___file (surfxml_bufferstack + AX_surfxml_host_availability___file)
 XBT_PUBLIC_DATA short int surfxml_host_availability___file_isset;
index 8fb038a..f95634f 100644 (file)
@@ -107,7 +107,7 @@ void parse_platform_file(const std::string& file)
 
     simgrid::s4u::Host* host = simgrid::s4u::Host::by_name_or_null(elm.second);
     xbt_assert(host, "Host %s undefined", elm.second.c_str());
-    simgrid::surf::Cpu* cpu = host->pimpl_cpu;
+    simgrid::kernel::resource::Cpu* cpu = host->pimpl_cpu;
 
     cpu->set_state_profile(profile);
   }
@@ -118,7 +118,7 @@ void parse_platform_file(const std::string& file)
 
     simgrid::s4u::Host* host = simgrid::s4u::Host::by_name_or_null(elm.second);
     xbt_assert(host, "Host %s undefined", elm.second.c_str());
-    simgrid::surf::Cpu* cpu = host->pimpl_cpu;
+    simgrid::kernel::resource::Cpu* cpu = host->pimpl_cpu;
 
     cpu->set_speed_profile(profile);
   }
index 26046c6..86ab5cb 100644 (file)
@@ -6,6 +6,8 @@
 #include "simgrid/kernel/routing/NetPoint.hpp"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/sg_config.hpp"
+#include "src/kernel/resource/profile/FutureEvtSet.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "src/surf/xml/platf_private.hpp"
@@ -26,8 +28,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_parse, surf, "Logging specific to the SURF
 
 static std::string surf_parsed_filename; // Currently parsed file (for the error messages)
 std::vector<simgrid::kernel::resource::LinkImpl*>
-    parsed_link_list; /* temporary store of current list link of a route */
-
+    parsed_link_list; /* temporary store of current link list of a route */
+std::vector<simgrid::kernel::resource::DiskImpl*> parsed_disk_list; /* temporary store of current disk list of a host */
 /*
  * Helping functions
  */
@@ -86,7 +88,7 @@ double surf_parse_get_double(const std::string& s)
 {
   try {
     return std::stod(s);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     surf_parse_error(s + " is not a double");
   }
 }
@@ -95,7 +97,7 @@ int surf_parse_get_int(const std::string& s)
 {
   try {
     return std::stoi(s);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     surf_parse_error(s + " is not a double");
   }
 }
@@ -171,23 +173,23 @@ unit_scale::unit_scale(std::initializer_list<std::tuple<const std::string, doubl
   }
 }
 
-/* Note: field `unit' for the last element of parameter `units' should be nullptr. */
+/* Note: no warning is issued for unit-less values when `name' is empty. */
 double surf_parse_get_value_with_unit(const char* string, const unit_scale& units, const char* entity_kind,
                                       const std::string& name, const char* error_msg, const char* default_unit)
 {
-  char* ptr;
+  char* endptr;
   errno = 0;
-  double res   = strtod(string, &ptr);
+  double res      = strtod(string, &endptr);
+  const char* ptr = endptr; // for const-correctness
   if (errno == ERANGE)
     surf_parse_error(std::string("value out of range: ") + string);
   if (ptr == 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.c_str(), error_msg);
-    ptr = (char*)default_unit;
+    // Ok, 0 can be unit-less
+    if (res != 0 && not name.empty())
+      XBT_WARN("Deprecated unit-less value '%s' for %s %s. %s", string, entity_kind, name.c_str(), error_msg);
+    ptr = default_unit;
   }
   auto u = units.find(ptr);
   if (u == units.end())
@@ -227,6 +229,23 @@ double surf_parse_get_bandwidth(const char* string, const char* entity_kind, con
       "Append 'Bps' to get bytes per second (or 'bps' for bits but 1Bps = 8bps)", "Bps");
 }
 
+std::vector<double> surf_parse_get_bandwidths(const char* string, const char* entity_kind, const std::string& name)
+{
+  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)};
+
+  std::vector<double> bandwidths;
+  std::vector<std::string> tokens;
+  boost::split(tokens, string, boost::is_any_of(";"));
+  for (auto token : tokens) {
+    bandwidths.push_back(surf_parse_get_value_with_unit(
+        token.c_str(), units, entity_kind, name,
+        "Append 'Bps' to get bytes per second (or 'bps' for bits but 1Bps = 8bps)", "Bps"));
+  }
+
+  return bandwidths;
+}
+
 double surf_parse_get_speed(const char* string, const char* entity_kind, const std::string& name)
 {
   static const unit_scale units{std::make_tuple("f", 1.0, 10, true), std::make_tuple("flops", 1.0, 10, false)};
@@ -390,7 +409,7 @@ void STag_surfxml_platform() {
              surf_parsed_filename.c_str(), version);
 }
 void ETag_surfxml_platform(){
-  simgrid::s4u::on_platform_created();
+  simgrid::s4u::Engine::on_platform_created();
 }
 
 void STag_surfxml_host(){
@@ -439,10 +458,29 @@ void ETag_surfxml_host()    {
                          : nullptr;
   host.pstate      = surf_parse_get_int(A_surfxml_host_pstate);
   host.coord       = A_surfxml_host_coordinates;
+  host.disks.swap(parsed_disk_list);
 
   sg_platf_new_host(&host);
 }
 
+void STag_surfxml_disk() {
+  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)");
+}
+
+void ETag_surfxml_disk() {
+  simgrid::kernel::routing::DiskCreationArgs disk;
+  disk.properties      = current_property_set;
+  current_property_set = nullptr;
+
+  disk.id       = A_surfxml_disk_id;
+  disk.read_bw  = surf_parse_get_bandwidth(A_surfxml_disk_read___bw, "read_bw of disk ", disk.id);
+  disk.write_bw = surf_parse_get_bandwidth(A_surfxml_disk_write___bw, "write_bw of disk ", disk.id);
+
+  parsed_disk_list.push_back(sg_platf_new_disk(&disk));
+}
+
 void STag_surfxml_host___link(){
   XBT_DEBUG("Create a Host_link for %s",A_surfxml_host___link_id);
   simgrid::kernel::routing::HostLinkCreationArgs host_link;
@@ -587,7 +625,7 @@ void ETag_surfxml_link(){
   current_property_set     = nullptr;
 
   link.id                  = std::string(A_surfxml_link_id);
-  link.bandwidth           = surf_parse_get_bandwidth(A_surfxml_link_bandwidth, "bandwidth of link", link.id.c_str());
+  link.bandwidths          = surf_parse_get_bandwidths(A_surfxml_link_bandwidth, "bandwidth of link", link.id.c_str());
   link.bandwidth_trace     = A_surfxml_link_bandwidth___file[0]
                              ? simgrid::kernel::profile::Profile::from_file(A_surfxml_link_bandwidth___file)
                              : nullptr;
@@ -613,6 +651,9 @@ void ETag_surfxml_link(){
   case A_surfxml_link_sharing___policy_SPLITDUPLEX:
     link.policy = simgrid::s4u::Link::SharingPolicy::SPLITDUPLEX;
     break;
+  case A_surfxml_link_sharing___policy_WIFI:
+    link.policy = simgrid::s4u::Link::SharingPolicy::WIFI;
+    break;
   default:
     surf_parse_error(std::string("Invalid sharing policy in link ") + link.id);
   }
@@ -658,7 +699,8 @@ void ETag_surfxml_backbone(){
 
   link.properties = nullptr;
   link.id = std::string(A_surfxml_backbone_id);
-  link.bandwidth = surf_parse_get_bandwidth(A_surfxml_backbone_bandwidth, "bandwidth of backbone", link.id.c_str());
+  link.bandwidths.push_back(
+      surf_parse_get_bandwidth(A_surfxml_backbone_bandwidth, "bandwidth of backbone", link.id.c_str()));
   link.latency = surf_parse_get_time(A_surfxml_backbone_latency, "latency of backbone", link.id.c_str());
   link.policy     = simgrid::s4u::Link::SharingPolicy::SHARED;
 
index f6e7083..e8bc29b 100644 (file)
@@ -3,6 +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 <xbt/base.h>
+
 #include <condition_variable>
 #include <mutex>
 
index e43df85..bf93af4 100644 (file)
@@ -15,6 +15,8 @@
 #include <xbt/log.h>
 #include <xbt/sysdep.h>
 
+#include "parserPromela.tab.cacc"
+
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_automaton);
 
 static xbt_automaton_t parsed_automaton;
@@ -56,13 +58,10 @@ static void new_transition(char* id, xbt_automaton_exp_label_t label)
   xbt_automaton_state_t state_dst = xbt_automaton_state_exists(parsed_automaton, id);
   xbt_automaton_state_t state_src = xbt_automaton_state_exists(parsed_automaton, state_id_src);
 
-  //xbt_transition_t trans = NULL;
   xbt_automaton_transition_new(parsed_automaton, state_src, state_dst, label);
 
 }
 
-#include "parserPromela.tab.cacc"
-
 void xbt_automaton_load(xbt_automaton_t a, const char *file)
 {
   parsed_automaton = a;
index 480e0c2..5585076 100644 (file)
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.2.2.  */
+/* A Bison parser, made by GNU Bison 3.4.1.  */
 
 /* Bison implementation for Yacc-like parsers in C
 
-   Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
+   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
+   Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -47,7 +48,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "3.2.2"
+#define YYBISON_VERSION "3.4.1"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -73,7 +74,7 @@
 #define yychar          xbt_automaton_parser_char
 
 /* First part of user prologue.  */
-#line 7 "parserPromela.yacc" /* yacc.c:338  */
+#line 7 "parserPromela.yacc"
 
 #include "simgrid/config.h"
 #if !HAVE_UNISTD_H
 
 void yyerror(const char *s);
 
+static void new_state(char* id, int src);
+static void new_transition(char* id, xbt_automaton_exp_label_t label);
+
+
+#line 94 "parserPromela.tab.cacc"
 
-#line 90 "parserPromela.tab.cacc" /* yacc.c:338  */
 # ifndef YY_NULLPTR
 #  if defined __cplusplus
 #   if 201103L <= __cplusplus
@@ -107,8 +112,8 @@ void yyerror(const char *s);
 # define YYERROR_VERBOSE 0
 #endif
 
-/* In a future release of Bison, this section will be replaced
-   by #include "parserPromela.tab.hacc".  */
+/* Use api.header.include to #include this header
+   instead of duplicating it here.  */
 #ifndef YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED
 # define YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED
 /* Debug traces.  */
@@ -149,19 +154,18 @@ extern int xbt_automaton_parser_debug;
 
 /* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-
 union YYSTYPE
 {
-#line 20 "parserPromela.yacc" /* yacc.c:353  */
+#line 23 "parserPromela.yacc"
 
   double real;
   int integer;
   char* string;
   xbt_automaton_exp_label_t label;
 
-#line 163 "parserPromela.tab.cacc" /* yacc.c:353  */
-};
+#line 167 "parserPromela.tab.cacc"
 
+};
 typedef union YYSTYPE YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define YYSTYPE_IS_DECLARED 1
@@ -276,6 +280,8 @@ typedef short yytype_int16;
 #endif
 
 
+#define YY_ASSERT(E) ((void) (0 && (E)))
+
 #if ! defined yyoverflow || YYERROR_VERBOSE
 
 /* The parser invokes alloca or malloc; define the necessary symbols.  */
@@ -418,16 +424,16 @@ union yyalloc
 /* YYNSTATES -- Number of states.  */
 #define YYNSTATES  32
 
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
-   by yylex, with out-of-bounds checking.  */
 #define YYUNDEFTOK  2
 #define YYMAXUTOK   277
 
+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
+   as returned by yylex, with out-of-bounds checking.  */
 #define YYTRANSLATE(YYX)                                                \
   ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
-   as returned by yylex, without out-of-bounds checking.  */
+   as returned by yylex.  */
 static const yytype_uint8 yytranslate[] =
 {
        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
@@ -464,8 +470,8 @@ static const yytype_uint8 yytranslate[] =
   /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
 static const yytype_uint8 yyrline[] =
 {
-       0,    57,    57,    60,    61,    61,    64,    65,    68,    69,
-      70,    71,    72,    73
+       0,    60,    60,    63,    64,    64,    67,    68,    71,    72,
+      73,    74,    75,    76
 };
 #endif
 
@@ -590,22 +596,22 @@ static const yytype_uint8 yyr2[] =
 
 #define YYRECOVERING()  (!!yyerrstatus)
 
-#define YYBACKUP(Token, Value)                                  \
-do                                                              \
-  if (yychar == YYEMPTY)                                        \
-    {                                                           \
-      yychar = (Token);                                         \
-      yylval = (Value);                                         \
-      YYPOPSTACK (yylen);                                       \
-      yystate = *yyssp;                                         \
-      goto yybackup;                                            \
-    }                                                           \
-  else                                                          \
-    {                                                           \
-      yyerror (YY_("syntax error: cannot back up")); \
-      YYERROR;                                                  \
-    }                                                           \
-while (0)
+#define YYBACKUP(Token, Value)                                    \
+  do                                                              \
+    if (yychar == YYEMPTY)                                        \
+      {                                                           \
+        yychar = (Token);                                         \
+        yylval = (Value);                                         \
+        YYPOPSTACK (yylen);                                       \
+        yystate = *yyssp;                                         \
+        goto yybackup;                                            \
+      }                                                           \
+    else                                                          \
+      {                                                           \
+        yyerror (YY_("syntax error: cannot back up")); \
+        YYERROR;                                                  \
+      }                                                           \
+  while (0)
 
 /* Error token number */
 #define YYTERROR        1
@@ -720,7 +726,7 @@ yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
       yy_symbol_print (stderr,
                        yystos[yyssp[yyi + 1 - yynrhs]],
-                       &(yyvsp[(yyi + 1) - (yynrhs)])
+                       &yyvsp[(yyi + 1) - (yynrhs)]
                                               );
       YYFPRINTF (stderr, "\n");
     }
@@ -824,7 +830,10 @@ yytnamerr (char *yyres, const char *yystr)
           case '\\':
             if (*++yyp != '\\')
               goto do_not_strip_quotes;
-            /* Fall through.  */
+            else
+              goto append;
+
+          append:
           default:
             if (yyres)
               yyres[yyn] = *yyp;
@@ -920,10 +929,10 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
                 yyarg[yycount++] = yytname[yyx];
                 {
                   YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
-                  if (! (yysize <= yysize1
-                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+                  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+                    yysize = yysize1;
+                  else
                     return 2;
-                  yysize = yysize1;
                 }
               }
         }
@@ -947,9 +956,10 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
 
   {
     YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
-    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+    if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+      yysize = yysize1;
+    else
       return 2;
-    yysize = yysize1;
   }
 
   if (*yymsg_alloc < yysize)
@@ -1075,23 +1085,33 @@ yyparse (void)
   yychar = YYEMPTY; /* Cause a token to be read.  */
   goto yysetstate;
 
+
 /*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate.  |
+| yynewstate -- push a new state, which is found in yystate.  |
 `------------------------------------------------------------*/
- yynewstate:
+yynewstate:
   /* In all cases, when you get here, the value and location stacks
      have just been pushed.  So pushing a state here evens the stacks.  */
   yyssp++;
 
- yysetstate:
+
+/*--------------------------------------------------------------------.
+| yynewstate -- set current state (the top of the stack) to yystate.  |
+`--------------------------------------------------------------------*/
+yysetstate:
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
   *yyssp = (yytype_int16) yystate;
 
   if (yyss + yystacksize - 1 <= yyssp)
+#if !defined yyoverflow && !defined YYSTACK_RELOCATE
+    goto yyexhaustedlab;
+#else
     {
       /* Get the current used size of the three stacks, in elements.  */
       YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
 
-#ifdef yyoverflow
+# if defined yyoverflow
       {
         /* Give user a chance to reallocate the stack.  Use copies of
            these so that the &'s don't force the real ones into
@@ -1110,10 +1130,7 @@ yyparse (void)
         yyss = yyss1;
         yyvs = yyvs1;
       }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
-      goto yyexhaustedlab;
-# else
+# else /* defined YYSTACK_RELOCATE */
       /* Extend the stack our own way.  */
       if (YYMAXDEPTH <= yystacksize)
         goto yyexhaustedlab;
@@ -1129,12 +1146,11 @@ yyparse (void)
           goto yyexhaustedlab;
         YYSTACK_RELOCATE (yyss_alloc, yyss);
         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
-#  undef YYSTACK_RELOCATE
+# undef YYSTACK_RELOCATE
         if (yyss1 != yyssa)
           YYSTACK_FREE (yyss1);
       }
 # endif
-#endif /* no yyoverflow */
 
       yyssp = yyss + yysize - 1;
       yyvsp = yyvs + yysize - 1;
@@ -1145,19 +1161,18 @@ yyparse (void)
       if (yyss + yystacksize - 1 <= yyssp)
         YYABORT;
     }
-
-  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
 
   if (yystate == YYFINAL)
     YYACCEPT;
 
   goto yybackup;
 
+
 /*-----------.
 | yybackup.  |
 `-----------*/
 yybackup:
-
   /* Do appropriate processing given the current state.  Read a
      lookahead token if we need one and don't already have one.  */
 
@@ -1215,7 +1230,6 @@ yybackup:
   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   *++yyvsp = yylval;
   YY_IGNORE_MAYBE_UNINITIALIZED_END
-
   goto yynewstate;
 
 
@@ -1230,7 +1244,7 @@ yydefault:
 
 
 /*-----------------------------.
-| yyreduce -- Do a reduction.  |
+| yyreduce -- do a reduction.  |
 `-----------------------------*/
 yyreduce:
   /* yyn is the number of a rule to reduce with.  */
@@ -1250,56 +1264,57 @@ yyreduce:
   YY_REDUCE_PRINT (yyn);
   switch (yyn)
     {
-        case 4:
-#line 61 "parserPromela.yacc" /* yacc.c:1645  */
+  case 4:
+#line 64 "parserPromela.yacc"
     { new_state((yyvsp[-1].string), 1);}
-#line 1257 "parserPromela.tab.cacc" /* yacc.c:1645  */
+#line 1271 "parserPromela.tab.cacc"
     break;
 
   case 7:
-#line 65 "parserPromela.yacc" /* yacc.c:1645  */
+#line 68 "parserPromela.yacc"
     { new_transition((yyvsp[-1].string), (yyvsp[-4].label));}
-#line 1263 "parserPromela.tab.cacc" /* yacc.c:1645  */
+#line 1277 "parserPromela.tab.cacc"
     break;
 
   case 8:
-#line 68 "parserPromela.yacc" /* yacc.c:1645  */
+#line 71 "parserPromela.yacc"
     { (yyval.label) = (yyvsp[-1].label); }
-#line 1269 "parserPromela.tab.cacc" /* yacc.c:1645  */
+#line 1283 "parserPromela.tab.cacc"
     break;
 
   case 9:
-#line 69 "parserPromela.yacc" /* yacc.c:1645  */
+#line 72 "parserPromela.yacc"
     { (yyval.label) = xbt_automaton_exp_label_new_or((yyvsp[-2].label), (yyvsp[0].label)); }
-#line 1275 "parserPromela.tab.cacc" /* yacc.c:1645  */
+#line 1289 "parserPromela.tab.cacc"
     break;
 
   case 10:
-#line 70 "parserPromela.yacc" /* yacc.c:1645  */
+#line 73 "parserPromela.yacc"
     { (yyval.label) = xbt_automaton_exp_label_new_and((yyvsp[-2].label), (yyvsp[0].label)); }
-#line 1281 "parserPromela.tab.cacc" /* yacc.c:1645  */
+#line 1295 "parserPromela.tab.cacc"
     break;
 
   case 11:
-#line 71 "parserPromela.yacc" /* yacc.c:1645  */
+#line 74 "parserPromela.yacc"
     { (yyval.label) = xbt_automaton_exp_label_new_not((yyvsp[0].label)); }
-#line 1287 "parserPromela.tab.cacc" /* yacc.c:1645  */
+#line 1301 "parserPromela.tab.cacc"
     break;
 
   case 12:
-#line 72 "parserPromela.yacc" /* yacc.c:1645  */
+#line 75 "parserPromela.yacc"
     { (yyval.label) = xbt_automaton_exp_label_new_one(); }
-#line 1293 "parserPromela.tab.cacc" /* yacc.c:1645  */
+#line 1307 "parserPromela.tab.cacc"
     break;
 
   case 13:
-#line 73 "parserPromela.yacc" /* yacc.c:1645  */
+#line 76 "parserPromela.yacc"
     { (yyval.label) = xbt_automaton_exp_label_new_predicat((yyvsp[0].string)); }
-#line 1299 "parserPromela.tab.cacc" /* yacc.c:1645  */
+#line 1313 "parserPromela.tab.cacc"
     break;
 
 
-#line 1303 "parserPromela.tab.cacc" /* yacc.c:1645  */
+#line 1317 "parserPromela.tab.cacc"
+
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
@@ -1413,12 +1428,10 @@ yyerrlab:
 | yyerrorlab -- error raised explicitly by YYERROR.  |
 `---------------------------------------------------*/
 yyerrorlab:
-
-  /* Pacify compilers like GCC when the user code never invokes
-     YYERROR and the label yyerrorlab therefore never appears in user
-     code.  */
-  if (/*CONSTCOND*/ 0)
-     goto yyerrorlab;
+  /* Pacify compilers when the user code never invokes YYERROR and the
+     label yyerrorlab therefore never appears in user code.  */
+  if (0)
+    YYERROR;
 
   /* Do not reclaim the symbols of the rule whose action triggered
      this YYERROR.  */
@@ -1480,6 +1493,7 @@ yyacceptlab:
   yyresult = 0;
   goto yyreturn;
 
+
 /*-----------------------------------.
 | yyabortlab -- YYABORT comes here.  |
 `-----------------------------------*/
@@ -1487,6 +1501,7 @@ yyabortlab:
   yyresult = 1;
   goto yyreturn;
 
+
 #if !defined yyoverflow || YYERROR_VERBOSE
 /*-------------------------------------------------.
 | yyexhaustedlab -- memory exhaustion comes here.  |
@@ -1497,6 +1512,10 @@ yyexhaustedlab:
   /* Fall through.  */
 #endif
 
+
+/*-----------------------------------------------------.
+| yyreturn -- parsing is finished, return the result.  |
+`-----------------------------------------------------*/
 yyreturn:
   if (yychar != YYEMPTY)
     {
@@ -1526,7 +1545,7 @@ yyreturn:
 #endif
   return yyresult;
 }
-#line 76 "parserPromela.yacc" /* yacc.c:1903  */
+#line 79 "parserPromela.yacc"
 
 
 
index d159c90..18c33f7 100644 (file)
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.2.2.  */
+/* A Bison parser, made by GNU Bison 3.4.1.  */
 
 /* Bison interface for Yacc-like parsers in C
 
-   Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
+   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
+   Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -73,19 +74,18 @@ extern int xbt_automaton_parser_debug;
 
 /* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-
 union YYSTYPE
 {
-#line 20 "parserPromela.yacc" /* yacc.c:1906  */
+#line 23 "parserPromela.yacc"
 
   double real;
   int integer;
   char* string;
   xbt_automaton_exp_label_t label;
 
-#line 87 "parserPromela.tab.hacc" /* yacc.c:1906  */
-};
+#line 87 "parserPromela.tab.hacc"
 
+};
 typedef union YYSTYPE YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define YYSTYPE_IS_DECLARED 1
index 699b732..e41de7e 100644 (file)
@@ -15,6 +15,9 @@
 
 void yyerror(const char *s);
 
+static void new_state(char* id, int src);
+static void new_transition(char* id, xbt_automaton_exp_label_t label);
+
 %}
 
 %union{
index 837062a..a7c8585 100644 (file)
 #include <cxxabi.h>
 #endif
 
-#if HAVE_BOOST_STACKTRACE
+#if HAVE_BOOST_STACKTRACE_BACKTRACE
 #define BOOST_STACKTRACE_USE_BACKTRACE
 #include <boost/stacktrace.hpp>
+#elif HAVE_BOOST_STACKTRACE_ADDR2LINE
+#define BOOST_STACKTRACE_USE_ADDR2LINE
+#include <boost/stacktrace.hpp>
 #endif
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_backtrace, xbt, "Backtrace");
@@ -71,14 +74,14 @@ public:
       return false;
     }
   }
-#if HAVE_BOOST_STACKTRACE
+#if HAVE_BOOST_STACKTRACE_BACKTRACE || HAVE_BOOST_STACKTRACE_ADDR2LINE
   boost::stacktrace::stacktrace st;
 #endif
 };
 
 Backtrace::Backtrace()
 {
-#if HAVE_BOOST_STACKTRACE
+#if HAVE_BOOST_STACKTRACE_BACKTRACE || HAVE_BOOST_STACKTRACE_ADDR2LINE
   impl_     = new BacktraceImpl();
   impl_->st = boost::stacktrace::stacktrace();
 #endif
@@ -129,7 +132,7 @@ std::string const Backtrace::resolve() const
 {
   std::string result("");
 
-#if HAVE_BOOST_STACKTRACE
+#if HAVE_BOOST_STACKTRACE_BACKTRACE || HAVE_BOOST_STACKTRACE_ADDR2LINE
   std::stringstream ss;
   ss << impl_->st;
   result.append(ss.str());
index 762a5ec..e51a1ba 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <functional>
 #include <map>
+#include <memory>
 #include <stdexcept>
 #include <string>
 #include <string>
@@ -252,14 +253,13 @@ template <class T> const char* TypedConfigurationElement<T>::get_type_name() //
 class Config {
 private:
   // name -> ConfigElement:
-  std::map<std::string, simgrid::config::ConfigurationElement*> options;
+  std::map<std::string, std::unique_ptr<ConfigurationElement>> options;
   // alias -> ConfigElement from options:
-  std::map<std::string, simgrid::config::ConfigurationElement*> aliases;
+  std::map<std::string, ConfigurationElement*> aliases;
   bool warn_for_aliases = true;
 
 public:
   Config();
-  ~Config();
 
   // No copy:
   Config(Config const&) = delete;
@@ -268,15 +268,14 @@ public:
   ConfigurationElement& operator[](const std::string& name);
   void alias(const std::string& realname, const std::string& aliasname);
 
-  template <class T, class... A>
-  simgrid::config::TypedConfigurationElement<T>* register_option(const std::string& name, A&&... a)
+  template <class T, class... A> TypedConfigurationElement<T>* register_option(const std::string& name, A&&... a)
   {
     xbt_assert(options.find(name) == options.end(), "Refusing to register the config element '%s' twice.",
                name.c_str());
     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.c_str(), variable->get_description().c_str(),
               variable->get_type_name(), variable, this);
-    options.insert({name, variable});
+    options[name].reset(variable);
     variable->update();
     return variable;
   }
@@ -294,18 +293,12 @@ Config::Config()
 {
   atexit(&sg_config_finalize);
 }
-Config::~Config()
-{
-  XBT_DEBUG("Frees cfg set %p", this);
-  for (auto const& elm : options)
-    delete elm.second;
-}
 
 inline ConfigurationElement* Config::get_dict_element(const std::string& name)
 {
   auto opt = options.find(name);
   if (opt != options.end()) {
-    return opt->second;
+    return opt->second.get();
   } else {
     auto als = aliases.find(name);
     if (als != aliases.end()) {
@@ -314,7 +307,10 @@ inline ConfigurationElement* Config::get_dict_element(const std::string& name)
         XBT_INFO("Option %s has been renamed to %s. Consider switching.", name.c_str(), res->get_key().c_str());
       return res;
     } else {
-      THROWF(not_found_error, 0, "Bad config key: %s", name.c_str());
+      std::string msg = "Bad config key: " + name + "\nExisting config keys:\n";
+      for (auto const& elm : options)
+        msg += "  " + elm.first + ": (" + elm.second->get_type_name() + ")" + elm.second->get_string_value() + "\n";
+      throw std::out_of_range(msg);
     }
   }
 }
@@ -339,33 +335,32 @@ void Config::alias(const std::string& realname, const std::string& aliasname)
  */
 void Config::dump(const char *name, const char *indent)
 {
+  XBT_LOG_DEFAULT_CATEGORY(xbt_help);
   if (name)
-    printf("%s>> Dumping of the config set '%s':\n", indent, name);
+    XBT_VERB("%s>> Dumping of the config set '%s':", indent, name);
 
   for (auto const& elm : options)
-    printf("%s  %s: ()%s) %s", indent, elm.first.c_str(), elm.second->get_type_name(),
-           elm.second->get_string_value().c_str());
+    XBT_VERB("%s  %s: ()%s) %s", indent, elm.first.c_str(), elm.second->get_type_name(),
+             elm.second->get_string_value().c_str());
 
   if (name)
-    printf("%s<< End of the config set '%s'\n", indent, name);
-  fflush(stdout);
+    XBT_VERB("%s<< End of the config set '%s'", indent, name);
 }
 
 /** @brief Displays the declared aliases and their replacement */
 void Config::show_aliases()
 {
   for (auto const& elm : aliases)
-    printf("   %-40s %s\n", elm.first.c_str(), elm.second->get_key().c_str());
+    XBT_HELP("   %-40s %s", elm.first.c_str(), elm.second->get_key().c_str());
 }
 
 /** @brief Displays the declared options and their description */
 void Config::help()
 {
   for (auto const& elm : options) {
-    simgrid::config::ConfigurationElement* variable = this->options.at(elm.first);
-    printf("   %s: %s\n", elm.first.c_str(), variable->get_description().c_str());
-    printf("       Type: %s; ", variable->get_type_name());
-    printf("Current value: %s\n", variable->get_string_value().c_str());
+    simgrid::config::ConfigurationElement* variable = elm.second.get();
+    XBT_HELP("   %s: %s", elm.first.c_str(), variable->get_description().c_str());
+    XBT_HELP("       Type: %s; Current value: %s", variable->get_type_name(), variable->get_string_value().c_str());
   }
 }
 
@@ -495,139 +490,19 @@ void help()
 }
 }
 
-// ***** C bindings *****
-
-xbt_cfg_t xbt_cfg_new()
-{
-  return new simgrid::config::Config();
-}
-void xbt_cfg_free(xbt_cfg_t * cfg) { delete *cfg; }
-
-void xbt_cfg_dump(const char *name, const char *indent, xbt_cfg_t cfg)
-{
-  cfg->dump(name, indent);
-}
-
-/*----[ Registering stuff ]-----------------------------------------------*/
-
-void xbt_cfg_register_double(const char *name, double default_value,
-  xbt_cfg_cb_t cb_set, const char *desc)
-{
-  if (simgrid_config == nullptr)
-    simgrid_config = new simgrid::config::Config();
-  simgrid_config->register_option<double>(name, desc, default_value, cb_set);
-}
-
-void xbt_cfg_register_int(const char *name, int default_value,xbt_cfg_cb_t cb_set, const char *desc)
-{
-  if (simgrid_config == nullptr)
-    simgrid_config = new simgrid::config::Config();
-  simgrid_config->register_option<int>(name, desc, default_value, cb_set);
-}
-
-void xbt_cfg_register_string(const char *name, const char *default_value, xbt_cfg_cb_t cb_set, const char *desc)
-{
-  if (simgrid_config == nullptr)
-    simgrid_config = new simgrid::config::Config();
-  simgrid_config->register_option<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)
-{
-  if (simgrid_config == nullptr)
-    simgrid_config = new simgrid::config::Config();
-  simgrid_config->register_option<bool>(name, desc, simgrid::config::parse_bool(default_value), cb_set);
-}
-
-void xbt_cfg_register_alias(const char *realname, const char *aliasname)
-{
-  if (simgrid_config == nullptr)
-    simgrid_config = new simgrid::config::Config();
-  simgrid_config->alias(realname, aliasname);
-}
-
-void xbt_cfg_aliases()
-{
-  simgrid_config->show_aliases();
-}
-void xbt_cfg_help()
-{
-  simgrid_config->help();
-}
-
 /*----[ Setting ]---------------------------------------------------------*/
 
-/** @brief Add values parsed from a string into a config set
- *
- * @param options a string containing the content to add to the config set. This is a '\\t',' ' or '\\n' or ','
- * separated list of variables. Each individual variable is like "[name]:[value]" where [name] is the name of an
- * already registered variable, and [value] conforms to the data type under which this variable was registered.
- *
- * @todo This is a crude manual parser, it should be a proper lexer.
- */
-void xbt_cfg_set_parse(const char *options)
-{
-  if (options && strlen(options) > 0)
-    simgrid::config::set_parse(std::string(options));
-}
-
-/** @brief Set the value of a variable, using the string representation of that value
- *
- * @param key name of the variable to modify
- * @param value string representation of the value to set
- */
-
-void xbt_cfg_set_as_string(const char *key, const char *value)
-{
-  (*simgrid_config)[key].set_string_value(value);
-}
-
-/** @brief Set an integer value to \a name within \a cfg if it wasn't changed yet
- *
- * This is useful to change the default value of a variable while allowing
- * users to override it with command line arguments
- */
-void xbt_cfg_setdefault_int(const char *key, int value)
-{
-  (*simgrid_config)[key].set_default_value<int>(value);
-}
-
-/** @brief Set an integer value to \a name within \a cfg if it wasn't changed yet
- *
- * This is useful to change the default value of a variable while allowing
- * users to override it with command line arguments
- */
-void xbt_cfg_setdefault_double(const char *key, double value)
-{
-  (*simgrid_config)[key].set_default_value<double>(value);
-}
-
-/** @brief Set a string value to \a name within \a cfg if it wasn't changed yet
- *
- * This is useful to change the default value of a variable while allowing
- * users to override it with command line arguments
- */
-void xbt_cfg_setdefault_string(const char *key, const char *value)
-{
-  (*simgrid_config)[key].set_default_value<std::string>(value ? value : "");
-}
-
-/** @brief Set an boolean value to \a name within \a cfg if it wasn't changed yet
- *
- * This is useful to change the default value of a variable while allowing
- * users to override it with command line arguments
- */
-void xbt_cfg_setdefault_boolean(const char *key, const char *value)
-{
-  (*simgrid_config)[key].set_default_value<bool>(simgrid::config::parse_bool(value));
-}
-
 /** @brief Set an integer value to \a name within \a cfg
  *
  * @param key the name of the variable
  * @param value the value of the variable
  */
 void xbt_cfg_set_int(const char *key, int value)
+{
+  sg_cfg_set_int(key, value);
+}
+
+void sg_cfg_set_int(const char* key, int value)
 {
   (*simgrid_config)[key].set_value<int>(value);
 }
@@ -638,6 +513,11 @@ void xbt_cfg_set_int(const char *key, int value)
  * @param value the double to set
  */
 void xbt_cfg_set_double(const char *key, double value)
+{
+  sg_cfg_set_double(key, value);
+}
+
+void sg_cfg_set_double(const char* key, double value)
 {
   (*simgrid_config)[key].set_value<double>(value);
 }
@@ -649,6 +529,11 @@ void xbt_cfg_set_double(const char *key, double value)
  *
  */
 void xbt_cfg_set_string(const char* key, const char* value)
+{
+  sg_cfg_set_string(key, value);
+}
+
+void sg_cfg_set_string(const char* key, const char* value)
 {
   (*simgrid_config)[key].set_value<std::string>(value);
 }
@@ -660,14 +545,12 @@ void xbt_cfg_set_string(const char* key, const char* value)
  */
 void xbt_cfg_set_boolean(const char *key, const char *value)
 {
-  (*simgrid_config)[key].set_value<bool>(simgrid::config::parse_bool(value));
+  sg_cfg_set_boolean(key, value);
 }
 
-
-/* Say if the value is the default value */
-int xbt_cfg_is_default_value(const char *key)
+void sg_cfg_set_boolean(const char* key, const char* value)
 {
-  return (*simgrid_config)[key].is_default() ? 1 : 0;
+  (*simgrid_config)[key].set_value<bool>(simgrid::config::parse_bool(value));
 }
 
 /*----[ Getting ]---------------------------------------------------------*/
@@ -678,6 +561,11 @@ int xbt_cfg_is_default_value(const char *key)
  * Returns the first value from the config set under the given name.
  */
 int xbt_cfg_get_int(const char *key)
+{
+  return sg_cfg_get_int(key);
+}
+
+int sg_cfg_get_int(const char* key)
 {
   return (*simgrid_config)[key].get_value<int>();
 }
@@ -690,22 +578,12 @@ int xbt_cfg_get_int(const char *key)
  */
 double xbt_cfg_get_double(const char *key)
 {
-  return (*simgrid_config)[key].get_value<double>();
+  return sg_cfg_get_double(key);
 }
 
-/** @brief Retrieve a string value of a variable (get a warning if not uniq)
- *
- * @param key the name of the variable
- *
- * Returns the first value from the config set under the given name.
- * If there is more than one value, it will issue a warning.
- * Returns nullptr if there is no value.
- *
- * \warning the returned value is the actual content of the config set
- */
-std::string xbt_cfg_get_string(const char* key)
+double sg_cfg_get_double(const char* key)
 {
-  return (*simgrid_config)[key].get_value<std::string>();
+  return (*simgrid_config)[key].get_value<double>();
 }
 
 /** @brief Retrieve a boolean value of a variable (get a warning if not uniq)
@@ -716,6 +594,11 @@ std::string xbt_cfg_get_string(const char* key)
  * If there is more than one value, it will issue a warning.
  */
 int xbt_cfg_get_boolean(const char *key)
+{
+  return sg_cfg_get_boolean(key);
+}
+
+int sg_cfg_get_boolean(const char* key)
 {
   return (*simgrid_config)[key].get_value<bool>() ? 1 : 0;
 }
index dd89d9e..8b41924 100644 (file)
@@ -49,10 +49,7 @@ TEST_CASE("xbt::config: Configuration support", "config")
 
     INFO("Access to a non-existant entry");
 
-    REQUIRE_THROWS_MATCHES(
-        simgrid::config::set_parse("color:blue"), xbt_ex,
-        Catch::Matchers::Predicate<xbt_ex>([](xbt_ex const& e) { return e.category == not_found_error; },
-                                           "category not_found_error"));
+    REQUIRE_THROWS_AS(simgrid::config::set_parse("color:blue"), std::out_of_range);
 
     simgrid::config::finalize();
     simgrid_config = temp;
index e15c41d..f6742fb 100644 (file)
@@ -13,6 +13,7 @@
 #include "xbt/log.h"
 #include "xbt/mallocator.h"
 #include "xbt/str.h"
+#include "xbt/string.hpp"
 
 #include <cstdio>
 #include <cstring>
@@ -194,7 +195,7 @@ void xbt_dict_set(xbt_dict_t dict, const char *key, void *data, void_f_pvoid_t f
  * @param key_len the size of the @a key
  * @return the data that we are looking for
  *
- * Search the given @a key. Throws not_found_error when not found.
+ * Search the given @a key. Throws std::out_of_range when not found.
  */
 void *xbt_dict_get_ext(xbt_dict_t dict, const char *key, int key_len)
 {
@@ -207,7 +208,7 @@ void *xbt_dict_get_ext(xbt_dict_t dict, const char *key, int key_len)
   }
 
   if (current == nullptr)
-    THROWF(not_found_error, 0, "key %.*s not found", key_len, key);
+    throw std::out_of_range(simgrid::xbt::string_printf("key %.*s not found", key_len, key));
 
   return current->content;
 }
@@ -254,7 +255,7 @@ char *xbt_dict_get_key(xbt_dict_t dict, const void *data)
  * @param key the key to find data
  * @return the data that we are looking for
  *
- * Search the given @a key. Throws not_found_error when not found.
+ * Search the given @a key. Throws std::out_of_range when not found.
  * Check xbt_dict_get_or_null() for a version returning nullptr without exception when not found.
  */
 void *xbt_dict_get(xbt_dict_t dict, const char *key)
@@ -269,7 +270,7 @@ void *xbt_dict_get(xbt_dict_t dict, const char *key)
  * @param key the key to find data
  * @return the s_xbt_dictelm_t that we are looking for
  *
- * Search the given @a key. Throws not_found_error when not found.
+ * Search the given @a key. Throws std::out_of_range when not found.
  * Check xbt_dict_get_or_null() for a version returning nullptr without exception when not found.
  */
 xbt_dictelm_t xbt_dict_get_elm(xbt_dict_t dict, const char *key)
@@ -277,7 +278,7 @@ xbt_dictelm_t xbt_dict_get_elm(xbt_dict_t dict, const char *key)
   xbt_dictelm_t current = xbt_dict_get_elm_or_null(dict, key);
 
   if (current == nullptr)
-    THROWF(not_found_error, 0, "key %s not found", key);
+    throw std::out_of_range(simgrid::xbt::string_printf("key %s not found", key));
 
   return current;
 }
@@ -315,7 +316,7 @@ xbt_dictelm_t xbt_dict_get_elm_or_null(xbt_dict_t dict, const char *key)
  * @param key the key of the data to be removed
  * @param key_len the size of the @a key
  *
- * Remove the entry associated with the given @a key (throws not_found)
+ * Remove the entry associated with the given @a key (throws std::out_of_range)
  */
 void xbt_dict_remove_ext(xbt_dict_t dict, const char *key, int key_len)
 {
@@ -330,7 +331,7 @@ void xbt_dict_remove_ext(xbt_dict_t dict, const char *key, int key_len)
   }
 
   if (current == nullptr)
-    THROWF(not_found_error, 0, "key %.*s not found", key_len, key);
+    throw std::out_of_range(simgrid::xbt::string_printf("key %.*s not found", key_len, key));
   else {
     if (previous != nullptr) {
       previous->next = current->next;
@@ -397,40 +398,6 @@ int xbt_dict_is_empty(xbt_dict_t dict)
   return not dict || (xbt_dict_length(dict) == 0);
 }
 
-/**
- * @brief Outputs the content of the structure (debugging purpose)
- *
- * @param dict the exibitionist
- * @param output a function to dump each data in the tree
- *
- * Outputs the content of the structure. (for debugging purpose).
- * @a output is a function to output the data. If nullptr, data won't be displayed.
- */
-void xbt_dict_dump(xbt_dict_t dict, void_f_pvoid_t output)
-{
-  xbt_dictelm_t element;
-  printf("Dict %p:\n", dict);
-  if (dict != nullptr) {
-    for (int i = 0; i < dict->table_size; i++) {
-      element = dict->table[i];
-      if (element) {
-        printf("[\n");
-        while (element != nullptr) {
-          printf(" %s -> '", element->key);
-          if (output != nullptr) {
-            output(element->content);
-          }
-          printf("'\n");
-          element = element->next;
-        }
-        printf("]\n");
-      } else {
-        printf("[]\n");
-      }
-    }
-  }
-}
-
 /**
  * Create the dict mallocators.
  * This is an internal XBT function called during the lib initialization.
index 5facbd8..bd54663 100644 (file)
 
 #define STR(str) ((str) ? (str) : "(null)")
 
-#define REQUIRE_THROWS_XBT_EX(...)                                                                                     \
-  REQUIRE_THROWS_MATCHES((__VA_ARGS__), xbt_ex, Catch::Matchers::Predicate<xbt_ex>(                                    \
-                                                    [](xbt_ex const& e) { return e.category == not_found_error; },     \
-                                                    "category not_found_error"))
-
 static constexpr int NB_ELM    = 20000;
 static constexpr int SIZEOFKEY = 1024;
 
@@ -95,7 +90,7 @@ static void traverse(xbt_dict_t head)
 static void search_not_found(xbt_dict_t head, const char* data)
 {
   INFO("Search " << STR(data) << " (expected not to be found)");
-  REQUIRE_THROWS_XBT_EX(data = (const char*)xbt_dict_get(head, data));
+  REQUIRE_THROWS_AS(xbt_dict_get(head, data), std::out_of_range);
 }
 
 static void count(xbt_dict_t dict, int length)
@@ -156,7 +151,7 @@ TEST_CASE("xbt::dict: dict data container", "dict")
     INFO("Traversal and search the empty dictionary");
     xbt_dict_t head = xbt_dict_new_homogeneous(&free);
     traverse(head);
-    REQUIRE_THROWS_XBT_EX(debugged_remove(head, "12346"));
+    REQUIRE_THROWS_AS(debugged_remove(head, "12346"), std::out_of_range);
     xbt_dict_free(&head);
 
     INFO("Traverse the full dictionary");
@@ -228,7 +223,7 @@ TEST_CASE("xbt::dict: dict data container", "dict")
     xbt_dict_t head = new_fixture();
     count(head, 7);
     INFO("Remove non existing data");
-    REQUIRE_THROWS_XBT_EX(debugged_remove(head, "Does not exist"));
+    REQUIRE_THROWS_AS(debugged_remove(head, "Does not exist"), std::out_of_range);
     traverse(head);
 
     xbt_dict_free(&head);
@@ -247,7 +242,7 @@ TEST_CASE("xbt::dict: dict data container", "dict")
     debugged_remove(head, "123456");
     traverse(head);
     count(head, 3);
-    REQUIRE_THROWS_XBT_EX(debugged_remove(head, "12346"));
+    REQUIRE_THROWS_AS(debugged_remove(head, "12346"), std::out_of_range);
     traverse(head);
     debugged_remove(head, "1234");
     traverse(head);
@@ -255,7 +250,7 @@ TEST_CASE("xbt::dict: dict data container", "dict")
     traverse(head);
     debugged_remove(head, "123");
     traverse(head);
-    REQUIRE_THROWS_XBT_EX(debugged_remove(head, "12346"));
+    REQUIRE_THROWS_AS(debugged_remove(head, "12346"), std::out_of_range);
     traverse(head);
 
     INFO("Free dict, create new fresh one, and then reset the dict");
index 6b9a739..8216c76 100644 (file)
@@ -11,6 +11,7 @@
 #include "xbt/ex.h"
 #include "xbt/log.h"
 #include "xbt/misc.h"
+#include "xbt/string.hpp"
 #include "xbt/sysdep.h"
 #include <sys/types.h>
 
@@ -29,15 +30,15 @@ static inline void _sanity_check_idx(int idx)
 static inline void _check_inbound_idx(xbt_dynar_t dynar, int idx)
 {
   if (idx < 0 || idx >= static_cast<int>(dynar->used)) {
-    THROWF(bound_error, idx, "dynar is not that long. You asked %d, but it's only %lu long",
-           idx, static_cast<unsigned long>(dynar->used));
+    throw std::out_of_range(simgrid::xbt::string_printf("dynar is not that long. You asked %d, but it's only %lu long",
+                                                        idx, static_cast<unsigned long>(dynar->used)));
   }
 }
 
 static inline void _check_populated_dynar(xbt_dynar_t dynar)
 {
   if (dynar->used == 0) {
-    THROWF(bound_error, 0, "dynar %p is empty", dynar);
+    throw std::out_of_range(simgrid::xbt::string_printf("dynar %p is empty", dynar));
   }
 }
 
@@ -431,8 +432,8 @@ void xbt_dynar_remove_n_at(xbt_dynar_t const dynar, const unsigned int n, const
  * }
  * @endcode
  *
- * Raises not_found_error if not found. If you have less than 2 millions elements, you probably want to use
- * #xbt_dynar_search_or_negative() instead, so that you don't have to TRY/CATCH on element not found.
+ * Raises std::out_of_range if not found. If you have less than 2 millions elements, you probably want to use
+ * #xbt_dynar_search_or_negative() instead, so that you don't have to try/catch on element not found.
  */
 unsigned int xbt_dynar_search(xbt_dynar_t const dynar, void* const elem)
 {
@@ -443,7 +444,7 @@ unsigned int xbt_dynar_search(xbt_dynar_t const dynar, void* const elem)
       return it;
     }
 
-  THROWF(not_found_error, 0, "Element %p not part of dynar %p", elem, dynar);
+  throw std::out_of_range(simgrid::xbt::string_printf("Element %p not part of dynar %p", elem, dynar));
 }
 
 /** @brief Returns the position of the element in the dynar (or -1 if not found)
@@ -602,17 +603,6 @@ void xbt_dynar_sort(xbt_dynar_t dynar, int_f_cpvoid_cpvoid_t compar_fn)
     qsort(dynar->data, dynar->used, dynar->elmsize, compar_fn);
 }
 
-static int strcmp_voidp(const void *pa, const void *pb) {
-  return strcmp(*(const char **)pa, *(const char **)pb);
-}
-
-/** @brief Sorts a dynar of strings (ie, char* data) */
-xbt_dynar_t xbt_dynar_sort_strings(xbt_dynar_t dynar)
-{
-  xbt_dynar_sort(dynar, strcmp_voidp);
-  return dynar; // to enable functional uses
-}
-
 /** @brief Transform a dynar into a nullptr terminated array.
  *
  *  @param dynar the dynar to transform
index 41db24d..c89f325 100644 (file)
 XBT_LOG_EXTERNAL_CATEGORY(xbt);
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_exception, xbt, "Exceptions");
 
-// DO NOT define ~xbt_ex() in exception.hpp.
-// Defining it here ensures that xbt_ex is defined only in libsimgrid, but not in libsimgrid-java.
-// Doing otherwise naturally breaks things (at least on freebsd with clang).
-
-xbt_ex::~xbt_ex() = default;
-
-void _xbt_throw(char* message, xbt_errcat_t errcat, int value, const char* file, int line, const char* func)
+void _xbt_throw(char* message, int value, const char* file, int line, const char* func)
 {
-  xbt_ex e(simgrid::xbt::ThrowPoint(file, line, func, simgrid::xbt::Backtrace(), xbt_procname(), xbt_getpid()),
-           message);
+  simgrid::Exception e(
+      simgrid::xbt::ThrowPoint(file, line, func, simgrid::xbt::Backtrace(), xbt_procname(), xbt_getpid()),
+      message ? message : "");
   xbt_free(message);
-  e.category = errcat;
   e.value    = value;
   throw e;
 }
 
-/** @brief returns a short name for the given exception category */
-const char* xbt_ex_catname(xbt_errcat_t cat)
-{
-  switch (cat) {
-    case unknown_error:
-      return "unknown error";
-    case arg_error:
-      return "invalid argument";
-    case bound_error:
-      return "out of bounds";
-    case mismatch_error:
-      return "mismatch";
-    case not_found_error:
-      return "not found";
-    case system_error:
-      return "system error";
-    case network_error:
-      return "network error";
-    case timeout_error:
-      return "timeout";
-    case cancel_error:
-      return "action canceled";
-    case thread_error:
-      return "thread error";
-    case host_error:
-      return "host failed";
-    case tracing_error:
-      return "tracing error";
-    case io_error:
-      return "io error";
-    case vm_error:
-      return "vm error";
-    default:
-      return "INVALID ERROR";
-  }
-}
-
 namespace simgrid {
 namespace xbt {
 
+ImpossibleError::~ImpossibleError()       = default;
+UnimplementedError::~UnimplementedError() = default;
+
 void log_exception(e_xbt_log_priority_t prio, const char* context, std::exception const& exception)
 {
   try {
@@ -105,18 +65,19 @@ void log_exception(e_xbt_log_priority_t prio, const char* context, std::exceptio
   }
   catch (...) {
     // Don't log exceptions we got when trying to log exception
+    XBT_LOG(prio, "Ignoring exception caught while while trying to log an exception!");
   }
 }
 
 static void show_backtrace(const simgrid::xbt::Backtrace& bt)
 {
   if (simgrid::config::get_value<bool>("exception/cutpath")) {
-    XBT_LOG(xbt_log_priority_critical, "Display of current backtrace disabled by --cfg=exception/cutpath.");
+    XBT_CRITICAL("Display of current backtrace disabled by --cfg=exception/cutpath.");
     return;
   }
   std::string res = bt.resolve();
-  XBT_LOG(xbt_log_priority_critical, "Current backtrace:");
-  XBT_LOG(xbt_log_priority_critical, "  -> %s", res.c_str());
+  XBT_CRITICAL("Current backtrace:");
+  XBT_CRITICAL("  -> %s", res.c_str());
 }
 
 static std::terminate_handler previous_terminate_handler = nullptr;
@@ -145,7 +106,7 @@ static void handler()
     std::abort();
   }
 
-  catch (simgrid::ForcefulKillException const& e) {
+  catch (const simgrid::ForcefulKillException&) {
     XBT_ERROR("Received a ForcefulKillException at the top-level exception handler. Maybe a Java->C++ call that is not "
               "protected "
               "in a try/catch?");
@@ -172,15 +133,6 @@ void install_exception_handler()
     previous_terminate_handler = std::set_terminate(handler);
   });
 }
-// deprecated
-void logException(e_xbt_log_priority_t priority, const char* context, std::exception const& exception)
-{
-  log_exception(priority, context, exception);
-}
-void installExceptionHandler()
-{
-  install_exception_handler();
-}
 
 } // namespace xbt
 } // namespace simgrid
@@ -188,12 +140,13 @@ void installExceptionHandler()
 void xbt_throw_impossible(const char* file, int line, const char* func)
 {
   std::stringstream ss;
-  ss << file << ":" << line << ":" << func << ": The Impossible Did Happen (yet again). Please report this bug.";
-  throw std::runtime_error(ss.str());
+  ss << file << ":" << line << ":" << func
+     << ": The Impossible Did Happen (yet again). Please report this bug (after reading https://xkcd.com/2200 :)";
+  throw simgrid::xbt::ImpossibleError(ss.str());
 }
 void xbt_throw_unimplemented(const char* file, int line, const char* func)
 {
   std::stringstream ss;
   ss << file << ":" << line << ":" << func << ": Feature unimplemented yet. Please report this bug.";
-  throw std::runtime_error(ss.str());
+  throw simgrid::xbt::UnimplementedError(ss.str());
 }
index 71ffabb..a72858e 100644 (file)
@@ -5,11 +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 "src/xbt_modinter.h"
 #include "src/xbt/log_private.hpp"
+#include "src/xbt_modinter.h"
 #include "xbt/asserts.h"
 #include "xbt/dynar.h"
 #include "xbt/str.h"
+#include "xbt/string.hpp"
 
 #include <algorithm>
 #include <mutex>
@@ -68,7 +69,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(log, xbt, "Loggings from the logging mechanism i
    which were already created (damnit. Too slow little beetle) */
 void xbt_log_preinit(void)
 {
-  xbt_log_default_appender             = xbt_log_appender_file_new(nullptr);
+  xbt_log_default_appender             = xbt_log_appender_stream(stderr);
   xbt_log_default_layout               = xbt_log_layout_simple_new(nullptr);
   _XBT_LOGV(XBT_LOG_ROOT_CAT).appender = xbt_log_default_appender;
   _XBT_LOGV(XBT_LOG_ROOT_CAT).layout = xbt_log_default_layout;
@@ -88,6 +89,8 @@ void xbt_log_init(int *argc, char **argv)
   int j                   = 1;
   int parse_args          = 1; // Stop parsing the parameters once we found '--'
 
+  xbt_log_control_set("xbt_help.app:stdout xbt_help.threshold:VERBOSE xbt_help.fmt:%m%n");
+
   /* Set logs and init log submodule */
   for (int i = 1; i < *argc; i++) {
     if (strcmp("--", argv[i]) == 0) {
@@ -403,15 +406,11 @@ static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string)
     }else if (i < xbt_log_priority_infinite) {
       set.thresh = (e_xbt_log_priority_t)i;
     } else {
-      THROWF(arg_error, 0,
-             "Unknown priority name: %s (must be one of: trace,debug,verbose,info,warning,error,critical)", value);
+      throw std::invalid_argument(simgrid::xbt::string_printf(
+          "Unknown priority name: %s (must be one of: trace,debug,verbose,info,warning,error,critical)", value));
     }
   } else if (strncmp(option, "additivity", option_len) == 0) {
-    if (strcasecmp(value, "ON") == 0 || strcasecmp(value, "YES") == 0 || strcmp(value, "1") == 0) {
-      set.additivity = 1;
-    } else {
-      set.additivity = 0;
-    }
+    set.additivity = (strcasecmp(value, "ON") == 0 || strcasecmp(value, "YES") == 0 || strcmp(value, "1") == 0);
   } else if (strncmp(option, "appender", option_len) == 0) {
     if (strncmp(value, "file:", 5) == 0) {
       set.appender = xbt_log_appender_file_new(value + 5);
@@ -419,8 +418,12 @@ static xbt_log_setting_t _xbt_log_parse_setting(const char *control_string)
       set.appender = xbt_log_appender2_file_new(value + 9, 1);
     } else if (strncmp(value, "splitfile:", 10) == 0) {
       set.appender = xbt_log_appender2_file_new(value + 10, 0);
+    } else if (strcmp(value, "stderr") == 0) {
+      set.appender = xbt_log_appender_stream(stderr);
+    } else if (strcmp(value, "stdout") == 0) {
+      set.appender = xbt_log_appender_stream(stdout);
     } else {
-      THROWF(arg_error, 0, "Unknown appender log type: '%s'", value);
+      throw std::invalid_argument(simgrid::xbt::string_printf("Unknown appender log type: '%s'", value));
     }
   } else if (strncmp(option, "fmt", option_len) == 0) {
     set.fmt = std::string(value);
@@ -549,56 +552,67 @@ void xbt_log_additivity_set(xbt_log_category_t cat, int additivity)
 
 static void xbt_log_help(void)
 {
-  printf("Description of the logging output:\n"
-         "\n"
-         "   Threshold configuration: --log=CATEGORY_NAME.thres:PRIORITY_LEVEL\n"
-         "      CATEGORY_NAME: defined in code with function 'XBT_LOG_NEW_CATEGORY'\n"
-         "      PRIORITY_LEVEL: the level to print (trace,debug,verbose,info,warning,error,critical)\n"
-         "         -> trace: enter and return of some functions\n"
-         "         -> debug: crufty output\n"
-         "         -> verbose: verbose output for the user wanting more\n"
-         "         -> info: output about the regular functioning\n"
-         "         -> 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: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"
-         "\n"
-         "         -> %%m: user-provided message\n"
-         "\n"
-         "         -> %%c: Category name (LOG4J compatible)\n"
-         "         -> %%p: Priority name (LOG4J compatible)\n"
-         "\n"
-         "         -> %%h: Hostname (SimGrid extension)\n"
-         "         -> %%P: Process name (SimGrid extension)\n"
-         "         -> %%t: Thread \"name\" (LOG4J compatible -- actually the address of the thread in memory)\n"
-         "         -> %%i: Process PID (SimGrid extension -- this is a 'i' as in 'i'dea)\n"
-         "\n"
-         "         -> %%F: file name where the log event was raised (LOG4J compatible)\n"
-         "         -> %%l: location where the log event was raised (LOG4J compatible, like '%%F:%%L' -- this is a l as "
-         "in 'l'etter)\n"
-         "         -> %%L: line number where the log event was raised (LOG4J compatible)\n"
-         "         -> %%M: function name (LOG4J compatible -- called method name here of course).\n"
-         "\n"
-         "         -> %%b: full backtrace (Called %%throwable in LOG4J). Defined only under windows or when using the "
-         "GNU libc because\n"
-         "                 backtrace() is not defined elsewhere, and we only have a fallback for windows boxes, not "
-         "mac ones for example.\n"
-         "         -> %%B: short backtrace (only the first line of the %%b). Called %%throwable{short} in LOG4J; "
-         "defined where %%b is.\n"
-         "\n"
-         "         -> %%d: date (UNIX-like epoch)\n"
-         "         -> %%r: application age (time elapsed since the beginning of the application)\n"
-         "\n"
-         "   Miscellaneous:\n"
-         "      --help-log-categories    Display the current hierarchy of log categories.\n"
-         "      --log=no_loc             Don't print file names in messages (for tesh tests).\n"
-         "\n");
+  XBT_HELP(
+      "Description of the logging output:\n"
+      "\n"
+      "   Threshold configuration: --log=CATEGORY_NAME.thres:PRIORITY_LEVEL\n"
+      "      CATEGORY_NAME: defined in code with function 'XBT_LOG_NEW_CATEGORY'\n"
+      "      PRIORITY_LEVEL: the level to print (trace,debug,verbose,info,warning,error,critical)\n"
+      "         -> trace: enter and return of some functions\n"
+      "         -> debug: crufty output\n"
+      "         -> verbose: verbose output for the user wanting more\n"
+      "         -> info: output about the regular functioning\n"
+      "         -> 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: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"
+      "\n"
+      "         -> %%m: user-provided message\n"
+      "\n"
+      "         -> %%c: Category name (LOG4J compatible)\n"
+      "         -> %%p: Priority name (LOG4J compatible)\n"
+      "\n"
+      "         -> %%h: Hostname (SimGrid extension)\n"
+      "         -> %%P: Process name (SimGrid extension)\n"
+      "         -> %%t: Thread \"name\" (LOG4J compatible -- actually the address of the thread in memory)\n"
+      "         -> %%i: Process PID (SimGrid extension -- this is a 'i' as in 'i'dea)\n"
+      "\n"
+      "         -> %%F: file name where the log event was raised (LOG4J compatible)\n"
+      "         -> %%l: location where the log event was raised (LOG4J compatible, like '%%F:%%L' -- this is a l as "
+      "in 'l'etter)\n"
+      "         -> %%L: line number where the log event was raised (LOG4J compatible)\n"
+      "         -> %%M: function name (LOG4J compatible -- called method name here of course).\n"
+      "\n"
+      "         -> %%b: full backtrace (Called %%throwable in LOG4J). Defined only under windows or when using the "
+      "GNU libc because\n"
+      "                 backtrace() is not defined elsewhere, and we only have a fallback for windows boxes, not "
+      "mac ones for example.\n"
+      "         -> %%B: short backtrace (only the first line of the %%b). Called %%throwable{short} in LOG4J; "
+      "defined where %%b is.\n"
+      "\n"
+      "         -> %%d: date (UNIX-like epoch)\n"
+      "         -> %%r: application age (time elapsed since the beginning of the application)\n"
+      "\n"
+      "   Category appender: --log=CATEGORY_NAME.app:APPENDER\n"
+      "      APPENDER may be:\n"
+      "         -> stdout or stderr: standard output streams\n"
+      "         -> file:NAME: append to file with given name\n"
+      "         -> splitfile:SIZE:NAME: append to files with maximum size SIZE per file.\n"
+      "                                 NAME may contain the %% wildcard as a placeholder for the file number.\n"
+      "         -> rollfile:SIZE:NAME: append to file with maximum size SIZE.\n"
+      "\n"
+      "   Category additivity: --log=CATEGORY_NAME.add:VALUE\n"
+      "      VALUE:  '0', '1', 'no', 'yes', 'on', or 'off'\n"
+      "\n"
+      "   Miscellaneous:\n"
+      "      --help-log-categories    Display the current hierarchy of log categories.\n"
+      "      --log=no_loc             Don't print file names in messages (for tesh tests).\n");
 }
 
 static void xbt_log_help_categories_rec(xbt_log_category_t category, const std::string& prefix)
@@ -621,7 +635,7 @@ static void xbt_log_help_categories_rec(xbt_log_category_t category, const std::
             [](xbt_log_category_t a, xbt_log_category_t b) { return strcmp(a->name, b->name) < 0; });
 
   for (auto const& cat : cats) {
-    printf("%s%s: %s\n", this_prefix.c_str(), cat->name, cat->description);
+    XBT_HELP("%s%s: %s", this_prefix.c_str(), cat->name, cat->description);
     if (cat == cats.back() && category->parent)
       child_prefix[child_prefix.rfind('|')] = ' ';
     xbt_log_help_categories_rec(cat->firstChild, child_prefix);
@@ -630,7 +644,7 @@ static void xbt_log_help_categories_rec(xbt_log_category_t category, const std::
 
 static void xbt_log_help_categories(void)
 {
-  printf("Current log category hierarchy:\n");
+  XBT_HELP("Current log category hierarchy:");
   xbt_log_help_categories_rec(&_XBT_LOGV(XBT_LOG_ROOT_CAT), "   ");
-  printf("\n");
+  XBT_HELP("%s", "");
 }
index 9dd422f..43ce328 100644 (file)
 #endif
 
 #include <cinttypes>
-#include <xbt/base.h>
-#include <xbt/log.h>
-#include <xbt/sysdep.h>
 
 #include "memory_map.hpp"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_memory_map, xbt, "Logging specific to algorithms for memory_map");
-
 namespace simgrid {
 namespace xbt {
 
 /**
  * \todo This function contains many cases that do not allow for a
- *       recovery. Currently, xbt_abort() is called but we should
+ *       recovery. Currently, abort() is called but we should
  *       much rather die with the specific reason so that it's easier
  *       to find out what's going on.
  */
-XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
+std::vector<VmMap> get_memory_map(pid_t pid)
 {
   std::vector<VmMap> ret;
 #if defined __APPLE__
@@ -73,7 +68,8 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
   /* Request authorization to read mappings */
   if (task_for_pid(mach_task_self(), pid, &map) != KERN_SUCCESS) {
     std::perror("task_for_pid failed");
-    xbt_die("Cannot request authorization for kernel information access");
+    std::fprintf(stderr, "Cannot request authorization for kernel information access\n");
+    abort();
   }
 
   /*
@@ -109,7 +105,8 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
     }
     else if (kr != KERN_SUCCESS) {
       std::perror("mach_vm_region failed");
-      xbt_die("Cannot request authorization for kernel information access");
+      std::fprintf(stderr, "Cannot request authorization for kernel information access\n");
+      abort();
     }
 
     VmMap memreg;
@@ -149,9 +146,11 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
     if (dladdr(reinterpret_cast<void*>(address), &dlinfo))
       memreg.pathname = dlinfo.dli_fname;
 
-    XBT_DEBUG("Region: %016" PRIx64 "-%016" PRIx64 " | %c%c%c | %s", memreg.start_addr, memreg.end_addr,
+#if 0 /* debug */
+    std::fprintf(stderr, "Region: %016" PRIx64 "-%016" PRIx64 " | %c%c%c | %s\n", memreg.start_addr, memreg.end_addr,
               (memreg.prot & PROT_READ) ? 'r' : '-', (memreg.prot & PROT_WRITE) ? 'w' : '-',
               (memreg.prot & PROT_EXEC) ? 'x' : '-', memreg.pathname.c_str());
+#endif
 
     ret.push_back(std::move(memreg));
     address += size;
@@ -167,7 +166,8 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
   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());
+    std::fprintf(stderr, "Cannot open %s to investigate the memory map of the process.\n", path.c_str());
+    abort();
   }
 
   /* Read one line at the time, parse it and add it to the memory map to be returned */
@@ -190,34 +190,39 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
     }
 
     /* Check to see if we got the expected amount of columns */
-    if (i < 6)
-      xbt_die("The memory map apparently only supplied less than 6 columns. Recovery impossible.");
+    if (i < 6) {
+      std::fprintf(stderr, "The memory map apparently only supplied less than 6 columns. Recovery impossible.\n");
+      abort();
+    }
 
     /* 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 = 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.");
+    if (tok == nullptr) {
+      std::fprintf(stderr,
+                   "Start and end address of the map are not concatenated by a hyphen (-). Recovery impossible.\n");
+      abort();
+    }
 
     VmMap memreg;
     char *endptr;
     memreg.start_addr = std::strtoull(tok, &endptr, 16);
     /* Make sure that the entire string was an hex number */
     if (*endptr != '\0')
-      xbt_abort();
+      abort();
 
     tok = strtok_r(nullptr, "-", &saveptr);
     if (tok == nullptr)
-      xbt_abort();
+      abort();
 
     memreg.end_addr = std::strtoull(tok, &endptr, 16);
     /* Make sure that the entire string was an hex number */
     if (*endptr != '\0')
-      xbt_abort();
+      abort();
 
     /* Get the permissions flags */
     if (std::strlen(lfields[1]) < 4)
-      xbt_abort();
+      abort();
 
     memreg.prot = 0;
     for (i = 0; i < 3; i++){
@@ -244,40 +249,41 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
     } else {
       memreg.flags |= MAP_SHARED;
       if (lfields[1][3] != 's')
-        XBT_WARN("The protection is neither 'p' (private) nor 's' (shared) but '%s'. Let's assume shared, as on b0rken "
-                 "win-ubuntu systems.\nFull line: %s\n",
-                 lfields[1], line);
+        fprintf(stderr,
+                "The protection is neither 'p' (private) nor 's' (shared) but '%s'. Let's assume shared, as on b0rken "
+                "win-ubuntu systems.\nFull line: %s\n",
+                lfields[1], line);
     }
 
     /* Get the offset value */
     memreg.offset = std::strtoull(lfields[2], &endptr, 16);
     /* Make sure that the entire string was an hex number */
     if (*endptr != '\0')
-      xbt_abort();
+      abort();
 
     /* Get the device major:minor bytes */
     tok = strtok_r(lfields[3], ":", &saveptr);
     if (tok == nullptr)
-      xbt_abort();
+      abort();
 
     memreg.dev_major = (char) strtoul(tok, &endptr, 16);
     /* Make sure that the entire string was an hex number */
     if (*endptr != '\0')
-      xbt_abort();
+      abort();
 
     tok = strtok_r(nullptr, ":", &saveptr);
     if (tok == nullptr)
-      xbt_abort();
+      abort();
 
     memreg.dev_minor = (char) std::strtoul(tok, &endptr, 16);
     /* Make sure that the entire string was an hex number */
     if (*endptr != '\0')
-      xbt_abort();
+      abort();
 
     /* Get the inode number and make sure that the entire string was a long int */
     memreg.inode = strtoul(lfields[4], &endptr, 10);
     if (*endptr != '\0')
-      xbt_abort();
+      abort();
 
     /* And finally get the pathname */
     if (lfields[5])
@@ -285,7 +291,7 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
 
     /* Create space for a new map region in the region's array and copy the */
     /* parsed stuff from the temporal memreg variable */
-    XBT_DEBUG("Found region for %s", not memreg.pathname.empty() ? memreg.pathname.c_str() : "(null)");
+    // std::fprintf(stderr, "Found region for %s\n", not memreg.pathname.empty() ? memreg.pathname.c_str() : "(null)");
 
     ret.push_back(std::move(memreg));
   }
@@ -299,15 +305,18 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
 
   if ((prstat = procstat_open_sysctl()) == NULL) {
     std::perror("procstat_open_sysctl failed");
-    xbt_die("Cannot access kernel state information");
+    std::fprintf(stderr, "Cannot access kernel state information\n");
+    abort();
   }
   if ((proc = procstat_getprocs(prstat, KERN_PROC_PID, pid, &cnt)) == NULL) {
     std::perror("procstat_open_sysctl failed");
-    xbt_die("Cannot access process information");
+    std::fprintf(stderr, "Cannot access process information\n");
+    abort();
   }
   if ((vmentries = procstat_getvmmap(prstat, proc, &cnt)) == NULL) {
     std::perror("procstat_getvmmap failed");
-    xbt_die("Cannot access process memory mappings");
+    std::fprintf(stderr, "Cannot access process memory mappings\n");
+    abort();
   }
   for (unsigned int i = 0; i < cnt; i++) {
     VmMap memreg;
@@ -371,7 +380,8 @@ XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid)
   procstat_freeprocs(prstat, proc);
   procstat_close(prstat);
 #else
-  xbt_die("Could not get memory map from process %lli", (long long int) pid);
+  std::fprintf(stderr, "Could not get memory map from process %lli\n", (long long int)pid);
+  abort();
 #endif
   return ret;
 }
index 974b88f..5938899 100644 (file)
@@ -11,9 +11,6 @@
 #include <string>
 #include <vector>
 
-#include <xbt/base.h>
-#include <sys/types.h>
-
 namespace simgrid {
 namespace xbt {
 
@@ -30,8 +27,7 @@ struct VmMap {
   std::string pathname;         /* Path name of the mapped file */
 };
 
-XBT_PRIVATE std::vector<VmMap> get_memory_map(pid_t pid);
-
+std::vector<VmMap> get_memory_map(pid_t pid);
 }
 }
 
index 6a95aa3..411ca29 100644 (file)
@@ -24,8 +24,6 @@ void mfree(struct mdesc *mdp, void *ptr)
   size_t i;
   int it;
 
-//  fprintf(stderr,"free(%p)\n",ptr);
-
   if (ptr == NULL)
     return;
 
@@ -41,12 +39,12 @@ void mfree(struct mdesc *mdp, void *ptr)
   switch (type) {
   case MMALLOC_TYPE_HEAPINFO:
     UNLOCK(mdp);
-    THROWF(system_error, 0, "Asked to free a fragment in a heapinfo block. I'm confused.\n");
+    THROWF(0, "Asked to free a fragment in a heapinfo block. I'm confused.\n");
     break;
 
   case MMALLOC_TYPE_FREE: /* Already free */
     UNLOCK(mdp);
-    THROWF(system_error, 0, "Asked to free a fragment in a block that is already free. I'm puzzled.\n");
+    THROWF(0, "Asked to free a fragment in a block that is already free. I'm puzzled.\n");
     break;
 
   case MMALLOC_TYPE_UNFRAGMENTED:
@@ -93,7 +91,6 @@ void mfree(struct mdesc *mdp, void *ptr)
 
       block = i;
     } else {
-      //fprintf(stderr,"Free block %d to %d (as a new chunck)\n",block,block+mdp->heapinfo[block].busy_block.size);
       /* Really link this block back into the free list.  */
       mdp->heapinfo[block].free_block.size = mdp->heapinfo[block].busy_block.size;
       mdp->heapinfo[block].free_block.next = mdp->heapinfo[i].free_block.next;
@@ -126,7 +123,8 @@ void mfree(struct mdesc *mdp, void *ptr)
     }
 
     /* Now see if we can return stuff to the system.  */
-    /*    blocks = mdp -> heapinfo[block].free.size;
+#if 0
+          blocks = mdp -> heapinfo[block].free.size;
           if (blocks >= FINAL_FREE_BLOCKS && block + blocks == mdp -> heaplimit
           && mdp -> morecore (mdp, 0) == ADDRESS (block + blocks))
           {
@@ -140,7 +138,8 @@ void mfree(struct mdesc *mdp, void *ptr)
           block = mdp -> heapinfo[block].free.prev;
           mdp -> heapstats.chunks_free--;
           mdp -> heapstats.bytes_free -= bytes;
-          } */
+          }
+#endif
 
     /* Set the next search to begin at this block.
        This is probably important to the trick where realloc returns the block to
@@ -164,7 +163,7 @@ void mfree(struct mdesc *mdp, void *ptr)
 
     if( mdp->heapinfo[block].busy_frag.frag_size[frag_nb] == -1){
       UNLOCK(mdp);
-      THROWF(system_error, 0, "Asked to free a fragment that is already free. I'm puzzled\n");
+      THROWF(0, "Asked to free a fragment that is already free. I'm puzzled\n");
     }
 
     if (MC_is_active() && mdp->heapinfo[block].busy_frag.ignore[frag_nb] > 0)
@@ -174,7 +173,6 @@ void mfree(struct mdesc *mdp, void *ptr)
     mdp->heapinfo[block].busy_frag.frag_size[frag_nb] = -1;
     mdp->heapinfo[block].busy_frag.ignore[frag_nb] = 0;
 
-//    fprintf(stderr,"nfree:%zu capa:%d\n", mdp->heapinfo[block].busy_frag.nfree,(BLOCKSIZE >> type));
     if (mdp->heapinfo[block].busy_frag.nfree ==
         (BLOCKSIZE >> type) - 1) {
       /* If all fragments of this block are free, remove this block from its swag and free the whole block.  */
index 32aadda..825d992 100644 (file)
@@ -332,7 +332,7 @@ void mmalloc_postexit(void)
 {
   /* Do not destroy the default mdp or ldl won't be able to free the memory it
    * allocated since we're in memory */
-  // xbt_mheap_destroy_no_free(__mmalloc_default_mdp);
+  // xbt_mheap_destroy_no_free(__mmalloc_default_mdp)
 }
 
 // This is the underlying implementation of mmalloc_get_bytes_used_remote.
index 46da29a..5294d69 100644 (file)
@@ -197,8 +197,6 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size)
   if (size < SMALLEST_POSSIBLE_MALLOC)
     size = SMALLEST_POSSIBLE_MALLOC;
 
-  //  printf("(%s) Mallocing %d bytes on %p (default: %p)...",xbt_thread_self_name(),size,mdp,__mmalloc_default_mdp);fflush(stdout);
-
   if (!(mdp->flags & MMALLOC_INITIALIZED))
     initialize(mdp);
 
@@ -345,7 +343,6 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size)
     mdp -> heapstats.bytes_free -= blocks * BLOCKSIZE;
 
   }
-  //printf("(%s) Done mallocing. Result is %p\n",xbt_thread_self_name(),result);fflush(stdout);
 
   return (result);
 }
index 853e611..e28edb7 100644 (file)
@@ -63,7 +63,6 @@
  */
 void *mmorecore(struct mdesc *mdp, ssize_t size)
 {
-  ssize_t test = 0;
   void* result;                 // please keep it uninitialized to track issues
   off_t foffset;                /* File offset at which new mapping will start */
   size_t mapbytes;              /* Number of bytes to map */
@@ -103,10 +102,11 @@ void *mmorecore(struct mdesc *mdp, ssize_t size)
       foffset  = (char*)mdp->top - (char*)mdp->base;
 
       if (mdp->fd > 0) {
-        /* FIXME:  Test results of lseek() */
-        lseek(mdp->fd, foffset + mapbytes - 1, SEEK_SET);
-        test = write(mdp->fd, &buf, 1);
-        if (test == -1) {
+        if (lseek(mdp->fd, foffset + mapbytes - 1, SEEK_SET) == -1) {
+          fprintf(stderr, "Internal error: lseek into mmap'ed fd failed! error: %s", strerror(errno));
+          abort();
+        }
+        if (write(mdp->fd, &buf, 1) == -1) {
           fprintf(stderr,"Internal error: write to mmap'ed fd failed! error: %s", strerror(errno));
           abort();
         }
index 9e1c9b0..46fe161 100644 (file)
@@ -286,8 +286,8 @@ XBT_PUBLIC void* mmorecore(struct mdesc* mdp, ssize_t size);
  * in a model-checking enabled tree. Without this protection, our malloc
  * implementation will not like multi-threading AT ALL.
  */
-#define LOCK(mdp) pthread_mutex_lock(&mdp->mutex)
-#define UNLOCK(mdp) pthread_mutex_unlock(&mdp->mutex)
+#define LOCK(mdp) pthread_mutex_lock(&(mdp)->mutex)
+#define UNLOCK(mdp) pthread_mutex_unlock(&(mdp)->mutex)
 
 XBT_PRIVATE int malloc_use_mmalloc(void);
 
index 89360df..2d3c1ce 100644 (file)
@@ -35,8 +35,6 @@ void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
     return mmalloc(mdp, size);
   }
 
-  //printf("(%s)realloc %p to %d...",xbt_thread_self_name(),ptr,(int)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");
@@ -83,7 +81,6 @@ void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
     if (blocks < mdp->heapinfo[block].busy_block.size) {
       int it;
       /* The new size is smaller; return excess memory to the free list. */
-      //printf("(%s) return excess memory...",xbt_thread_self_name());
       for (it= block+blocks; it< mdp->heapinfo[block].busy_block.size ; it++){
         mdp->heapinfo[it].type = MMALLOC_TYPE_UNFRAGMENTED; // FIXME that should be useless, type should already be 0 here
         mdp->heapinfo[it].busy_block.ignore = 0;
@@ -119,7 +116,6 @@ void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
       mdp->heaplimit = oldlimit;
 
       result = mmalloc_no_memset(mdp, requested_size);
-      //fprintf(stderr,"remalloc(%zu)~>%p\n",requested_size,result);
 
       if (ptr != result)
         memmove(result, ptr, blocks * BLOCKSIZE);
@@ -136,7 +132,6 @@ void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
 
     if (size > (size_t) (1 << (type - 1)) && size <= (size_t) (1 << type)) {
       /* The new size is the same kind of fragment.  */
-      //printf("(%s) new size is same kind of fragment...",xbt_thread_self_name());
 
       result = ptr;
       int frag_nb = RESIDUAL(result, BLOCKSIZE) >> type;
@@ -146,7 +141,6 @@ void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
     } else { /* fragment -> Either other fragment, or block */
       /* The new size is different; allocate a new space,
          and copy the lesser of the new size and the old. */
-      //printf("(%s) new size is different...",xbt_thread_self_name());
 
       result = mmalloc(mdp, requested_size);
 
@@ -155,6 +149,5 @@ void *mrealloc(xbt_mheap_t mdp, void *ptr, size_t size)
     }
     break;
   }
-  //printf("(%s) Done reallocing: %p\n",xbt_thread_self_name(),result);fflush(stdout);
   return (result);
 }
index 2bd4b7e..bf85795 100644 (file)
  *   If not, I'll be glad to provide one.
  *
  * FEATURES
- * - careful adherence to specs regarding flags, field width and precision;
+ * - careful adherence to specs regarding flags, field width and precision
  * - good performance for large string handling (large format, large
  *   argument or large paddings). Performance is similar to system's sprintf
  *   and in several cases significantly better (make sure you compile with
  *   optimizations turned on, tell the compiler the code is strict ANSI
- *   if necessary to give it more freedom for optimizations);
- * - return value semantics per ISO/IEC 9899:1999 ("ISO C99");
- * - written in standard ISO/ANSI C - requires an ANSI C compiler.
+ *   if necessary to give it more freedom for optimizations)
+ * - return value semantics per ISO/IEC 9899:1999 ("ISO C99")
+ * - written in standard ISO/ANSI C - requires an ANSI C compiler
  *
  * [...]
  *
index 7d9a216..fbb0a88 100644 (file)
@@ -17,23 +17,30 @@ static void 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(static_cast<FILE*>(this_->data));
+static void free_(xbt_log_appender_t this_)
+{
+  fclose(static_cast<FILE*>(this_->data));
+}
+
+xbt_log_appender_t xbt_log_appender_stream(FILE* f)
+{
+  xbt_log_appender_t res = xbt_new0(s_xbt_log_appender_t, 1);
+  res->do_append         = &append_file;
+  res->free_             = nullptr;
+  res->data              = static_cast<void*>(f);
+  return res;
 }
 
 xbt_log_appender_t xbt_log_appender_file_new(const char* arg)
 {
+  if (arg == nullptr)
+    return xbt_log_appender_stream(stderr);
   xbt_log_appender_t res = xbt_new0(s_xbt_log_appender_t, 1);
   res->do_append         = &append_file;
   res->free_             = &free_;
-  if (arg) {
-    res->data = (void *) fopen(arg, "w");
-    if (res->data == nullptr)
-      xbt_die("Cannot open file: %s: %s", arg, strerror(errno));
-  } else {
-    res->data = (void *) stderr;
-  }
+  res->data              = static_cast<void*>(fopen(arg, "w"));
+  if (res->data == nullptr)
+    xbt_die("Cannot open file: %s: %s", arg, strerror(errno));
   return res;
 }
 
index 06c9a73..6a675dd 100644 (file)
@@ -40,32 +40,33 @@ static constexpr const char* ERRMSG =
     }                                                                   \
   } else (void)0
 
-#define show_it(data, letter)                                           \
-  if (1) {                                                              \
-    int len;                                                            \
-    int wd;                                                             \
-    if (length == -1) {                                                 \
-      wd = 0;                                                           \
-    } else {                                                            \
-      wd = length;                                                      \
-      length = -1;                                                      \
-    }                                                                   \
-    if (precision == -1) {                                              \
-      len = snprintf(p, rem_size, "%*" letter, wd, data);               \
-    } else {                                                            \
-      len = snprintf(p, rem_size, "%*.*" letter, wd, precision, data);  \
-      precision = -1;                                                   \
-    }                                                                   \
-    check_overflow(len);                                                \
-  } else (void)0
+#define show_it(data, letter)                                                                                          \
+  if (1) {                                                                                                             \
+    int len;                                                                                                           \
+    int wd;                                                                                                            \
+    if (length == -1) {                                                                                                \
+      wd = 0;                                                                                                          \
+    } else {                                                                                                           \
+      wd     = length;                                                                                                 \
+      length = -1;                                                                                                     \
+    }                                                                                                                  \
+    if (precision == -1) {                                                                                             \
+      len = snprintf(p, rem_size, "%*" letter, wd, (data));                                                            \
+    } else {                                                                                                           \
+      len       = snprintf(p, rem_size, "%*.*" letter, wd, precision, (data));                                         \
+      precision = -1;                                                                                                  \
+    }                                                                                                                  \
+    check_overflow(len);                                                                                               \
+  } else                                                                                                               \
+  (void)0
 
 #define show_string(data)                                               \
   if (1) {                                                              \
     const char *show_string_data = (data);                              \
     show_it(show_string_data ? show_string_data : "(null)", "s");       \
   } else (void)0
-#define show_int(data)    show_it(data, "d")
-#define show_double(data) show_it(data, "f")
+#define show_int(data) show_it((data), "d")
+#define show_double(data) show_it((data), "f")
 
 static int xbt_log_layout_format_doit(xbt_log_layout_t l, xbt_log_event_t ev, const char* msg_fmt)
 {
@@ -184,7 +185,7 @@ xbt_log_layout_t xbt_log_layout_format_new(const char* arg)
   xbt_log_layout_t res = xbt_new0(s_xbt_log_layout_t, 1);
   res->do_layout       = &xbt_log_layout_format_doit;
   res->free_           = &xbt_log_layout_format_free;
-  res->data = xbt_strdup((char *) arg);
+  res->data            = xbt_strdup(arg);
 
   return res;
 }
index 5fe3845..bfdf869 100644 (file)
@@ -37,7 +37,11 @@ char *xbt_binary_name = NULL;   /* Name of the system process containing us (man
 xbt_dynar_t xbt_cmdline = NULL; /* all we got in argv */
 
 int xbt_initialized = 0;
-bool _sg_do_clean_atexit = true;
+simgrid::config::Flag<bool> cfg_dbg_clean_atexit{
+    "debug/clean-atexit",
+    {"clean-atexit"},
+    "Whether to cleanup SimGrid at exit. Disable it if your code segfaults after its end.",
+    true};
 
 int xbt_pagesize;
 int xbt_pagebits = 0;
@@ -93,17 +97,12 @@ static void xbt_preinit()
 #endif
   xbt_log_preinit();
   xbt_dict_preinit();
-
-#ifndef _WIN32
-  constexpr unsigned seed = 2147483647;
-  srand48(seed); // FIXME: still worthwhile?
-#endif
   atexit(xbt_postexit);
 }
 
 static void xbt_postexit()
 {
-  if (not _sg_do_clean_atexit)
+  if (not cfg_dbg_clean_atexit)
     return;
   xbt_initialized--;
   xbt_dict_postexit();
@@ -117,14 +116,14 @@ static void xbt_postexit()
 /** @brief Initialize the xbt mechanisms. */
 void xbt_init(int *argc, char **argv)
 {
-  simgrid::xbt::install_exception_handler();
-
   xbt_initialized++;
   if (xbt_initialized > 1) {
     XBT_DEBUG("XBT has been initialized %d times.", xbt_initialized);
     return;
   }
 
+  simgrid::xbt::install_exception_handler();
+
   xbt_binary_name = argv[0];
   xbt_cmdline     = xbt_dynar_new(sizeof(char*), NULL);
   for (int i = 0; i < *argc; i++)
index 087c662..d07e6ac 100644 (file)
@@ -16,6 +16,8 @@
 #ifdef _WIN32
 #include <sys/timeb.h>
 #include <windows.h>
+#else
+#include <unistd.h>
 #endif
 
 //Freebsd doesn't provide this clock_gettime flag yet, because it was added too recently (after 1993)
@@ -108,7 +110,7 @@ void xbt_os_sleep(double sec)
  * @brief This section describes many macros/functions that can serve as  an OS abstraction.
  */
 struct s_xbt_os_timer {
-#if HAVE_POSIX_GETTIME
+#if HAVE_POSIX_GETTIME && defined (_POSIX_THREAD_CPUTIME)
   struct timespec start;
   struct timespec stop;
   struct timespec elapse;
@@ -140,7 +142,7 @@ void xbt_os_timer_free(xbt_os_timer_t timer)
 
 double xbt_os_timer_elapsed(xbt_os_timer_t timer)
 {
-#if HAVE_POSIX_GETTIME
+#if HAVE_POSIX_GETTIME && defined (_POSIX_THREAD_CPUTIME)
   return ((double) timer->stop.tv_sec) - ((double) timer->start.tv_sec) + ((double) timer->elapse.tv_sec ) +
       ((((double) timer->stop.tv_nsec) - ((double) timer->start.tv_nsec) + ((double) timer->elapse.tv_nsec )) / 1e9);
 #elif HAVE_GETTIMEOFDAY || defined(_WIN32)
@@ -154,7 +156,7 @@ double xbt_os_timer_elapsed(xbt_os_timer_t timer)
 
 void xbt_os_walltimer_start(xbt_os_timer_t timer)
 {
-#if HAVE_POSIX_GETTIME
+#if HAVE_POSIX_GETTIME && defined (_POSIX_THREAD_CPUTIME)
   timer->elapse.tv_sec = 0;
   timer->elapse.tv_nsec = 0;
   clock_gettime(CLOCK_REALTIME, &(timer->start));
@@ -176,7 +178,7 @@ void xbt_os_walltimer_start(xbt_os_timer_t timer)
 
 void xbt_os_walltimer_resume(xbt_os_timer_t timer)
 {
-#if HAVE_POSIX_GETTIME
+#if HAVE_POSIX_GETTIME && defined (_POSIX_THREAD_CPUTIME)
   timer->elapse.tv_sec += timer->stop.tv_sec - timer->start.tv_sec;
 
    timer->elapse.tv_nsec += timer->stop.tv_nsec - timer->start.tv_nsec;
@@ -199,7 +201,7 @@ void xbt_os_walltimer_resume(xbt_os_timer_t timer)
 
 void xbt_os_walltimer_stop(xbt_os_timer_t timer)
 {
-#if HAVE_POSIX_GETTIME
+#if HAVE_POSIX_GETTIME && defined (_POSIX_THREAD_CPUTIME)
   clock_gettime(CLOCK_REALTIME, &(timer->stop));
 #elif HAVE_GETTIMEOFDAY
   gettimeofday(&(timer->stop), NULL);
@@ -214,7 +216,7 @@ void xbt_os_walltimer_stop(xbt_os_timer_t timer)
 
 void xbt_os_cputimer_start(xbt_os_timer_t timer)
 {
-#if HAVE_POSIX_GETTIME
+#if HAVE_POSIX_GETTIME && defined (_POSIX_THREAD_CPUTIME)
   timer->elapse.tv_sec = 0;
   timer->elapse.tv_nsec = 0;
   clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &(timer->start));
@@ -229,12 +231,14 @@ void xbt_os_cputimer_start(xbt_os_timer_t timer)
   FILETIME creationTime, exitTime, kernelTime, userTime;
   GetProcessTimes(h, &creationTime, &exitTime, &kernelTime, &userTime);
   w32_times_to_timeval(&timer->start, &kernelTime, &userTime);
+#else
+# error The cpu timers of SimGrid do not seem to work on your platform.
 #endif
 }
 
 void xbt_os_cputimer_resume(xbt_os_timer_t timer)
 {
-#if HAVE_POSIX_GETTIME
+#if HAVE_POSIX_GETTIME && defined (_POSIX_THREAD_CPUTIME)
   timer->elapse.tv_sec += timer->stop.tv_sec - timer->start.tv_sec;
   timer->elapse.tv_nsec += timer->stop.tv_nsec - timer->start.tv_nsec;
   clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &(timer->start));
@@ -249,12 +253,14 @@ void xbt_os_cputimer_resume(xbt_os_timer_t timer)
   FILETIME creationTime, exitTime, kernelTime, userTime;
   GetProcessTimes(h, &creationTime, &exitTime, &kernelTime, &userTime);
   w32_times_to_timeval(&timer->start, &kernelTime, &userTime);
+#else
+# error The cpu timers of SimGrid do not seem to work on your platform.
 #endif
 }
 
 void xbt_os_cputimer_stop(xbt_os_timer_t timer)
 {
-#if HAVE_POSIX_GETTIME
+#if HAVE_POSIX_GETTIME && defined (_POSIX_THREAD_CPUTIME)
   clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &(timer->stop));
 #elif HAVE_GETTIMEOFDAY
   gettimeofday(&(timer->stop), NULL);
@@ -263,12 +269,14 @@ void xbt_os_cputimer_stop(xbt_os_timer_t timer)
   FILETIME creationTime, exitTime, kernelTime, userTime;
   GetProcessTimes(h, &creationTime, &exitTime, &kernelTime, &userTime);
   w32_times_to_timeval(&timer->stop, &kernelTime, &userTime);
+#else
+# error The cpu timers of SimGrid do not seem to work on your platform.
 #endif
 }
 
 void xbt_os_threadtimer_start(xbt_os_timer_t timer)
 {
-#if HAVE_POSIX_GETTIME
+#if HAVE_POSIX_GETTIME && defined (_POSIX_THREAD_CPUTIME)
   timer->elapse.tv_sec = 0;
   timer->elapse.tv_nsec = 0;
   clock_gettime(CLOCK_THREAD_CPUTIME_ID, &(timer->start));
@@ -290,12 +298,14 @@ void xbt_os_threadtimer_start(xbt_os_timer_t timer)
   FILETIME creationTime, exitTime, kernelTime, userTime;
   GetThreadTimes(h, &creationTime, &exitTime, &kernelTime, &userTime);
   w32_times_to_timeval(&timer->start, &kernelTime, &userTime);
+#else
+# error The thread timers of SimGrid do not seem to work on your platform.
 #endif
 }
 
 void xbt_os_threadtimer_resume(xbt_os_timer_t timer)
 {
-#if HAVE_POSIX_GETTIME
+#if HAVE_POSIX_GETTIME && defined (_POSIX_THREAD_CPUTIME)
   timer->elapse.tv_sec += timer->stop.tv_sec - timer->start.tv_sec;
   timer->elapse.tv_nsec += timer->stop.tv_nsec - timer->start.tv_nsec;
   clock_gettime(CLOCK_THREAD_CPUTIME_ID, &(timer->start));
@@ -319,12 +329,14 @@ void xbt_os_threadtimer_resume(xbt_os_timer_t timer)
   FILETIME creationTime, exitTime, kernelTime, userTime;
   GetThreadTimes(h, &creationTime, &exitTime, &kernelTime, &userTime);
   w32_times_to_timeval(&timer->start, &kernelTime, &userTime);
+#else
+# error The thread timers of SimGrid do not seem to work on your platform.
 #endif
 }
 
 void xbt_os_threadtimer_stop(xbt_os_timer_t timer)
 {
-#if HAVE_POSIX_GETTIME
+#if HAVE_POSIX_GETTIME && defined (_POSIX_THREAD_CPUTIME)
   clock_gettime(CLOCK_THREAD_CPUTIME_ID, &(timer->stop));
 #elif HAVE_GETTIMEOFDAY && defined(__MACH__) && defined(__APPLE__)
   mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT;
@@ -340,5 +352,7 @@ void xbt_os_threadtimer_stop(xbt_os_timer_t timer)
   FILETIME creationTime, exitTime, kernelTime, userTime;
   GetThreadTimes(h, &creationTime, &exitTime, &kernelTime, &userTime);
   w32_times_to_timeval(&timer->stop, &kernelTime, &userTime);
+#else
+# error The thread timers of SimGrid do not seem to work on your platform.
 #endif
 }
index 25d6d2c..2c51d9d 100644 (file)
@@ -18,32 +18,27 @@ std::ifstream* action_fs = nullptr;
 std::unordered_map<std::string, action_fun> action_funs;
 static std::unordered_map<std::string, std::queue<ReplayAction*>*> action_queues;
 
-static void read_and_trim_line(std::ifstream* fs, std::string* line)
+static void read_and_trim_line(std::ifstream& fs, std::string* line)
 {
   do {
-    std::getline(*fs, *line);
+    std::getline(fs, *line);
     boost::trim(*line);
-  } while (not fs->eof() && (line->length() == 0 || line->front() == '#'));
+  } while (not fs.eof() && (line->length() == 0 || line->front() == '#'));
   XBT_DEBUG("got from trace: %s", line->c_str());
 }
 
 class ReplayReader {
-  std::ifstream* fs;
+  std::ifstream fs;
   std::string line;
 
 public:
-  explicit ReplayReader(const char* filename)
+  explicit ReplayReader(const char* filename) : fs(filename, std::ifstream::in)
   {
     XBT_VERB("Prepare to replay file '%s'", filename);
-    fs = new std::ifstream(filename, std::ifstream::in);
-    xbt_assert(fs->is_open(), "Cannot read replay file '%s'", filename);
+    xbt_assert(fs.is_open(), "Cannot read replay file '%s'", filename);
   }
   ReplayReader(const ReplayReader&) = delete;
   ReplayReader& operator=(const ReplayReader&) = delete;
-  ~ReplayReader()
-  {
-    delete fs;
-  }
   bool get(ReplayAction* action);
 };
 
@@ -52,7 +47,7 @@ bool ReplayReader::get(ReplayAction* action)
   read_and_trim_line(fs, &line);
 
   boost::split(*action, line, boost::is_any_of(" \t"), boost::token_compress_on);
-  return not fs->eof();
+  return not fs.eof();
 }
 
 static ReplayAction* get_action(const char* name)
@@ -66,7 +61,7 @@ static ReplayAction* get_action(const char* name)
     // Read lines until I reach something for me (which breaks in loop body) or end of file reached
     while (true) {
       std::string action_line;
-      read_and_trim_line(action_fs, &action_line);
+      read_and_trim_line(*action_fs, &action_line);
       if (action_fs->eof())
         break;
       /* we cannot split in place here because we parse&store several lines for the colleagues... */
@@ -107,7 +102,7 @@ static void handle_action(ReplayAction& action)
   action_fun function = action_funs.at(action.at(1));
   try {
     function(action);
-  } catch (xbt_ex& e) {
+  } catch (const Exception& e) {
     action.clear();
     xbt_die("Replay error:\n %s", e.what());
   }
index bfaeff9..b38ad7d 100644 (file)
@@ -8,6 +8,7 @@
 #include "simgrid/Exception.hpp"
 #include "xbt/misc.h"
 #include "xbt/str.h" /* headers of these functions */
+#include "xbt/string.hpp"
 
 /** @brief Splits a string into a dynar of strings
  *
@@ -101,7 +102,7 @@ xbt_dynar_t xbt_str_split_quoted_in_place(char *s) {
       /* Protected char; move it closer */
       memmove(end, end + 1, strlen(end));
       if (*end == '\0')
-        THROWF(arg_error, 0, "String ends with \\");
+        throw std::invalid_argument("String ends with \\");
       end++;                    /* Pass the protected char */
       break;
     case '\'':
@@ -129,7 +130,8 @@ xbt_dynar_t xbt_str_split_quoted_in_place(char *s) {
     case '\n':
     case '\0':
       if (*end == '\0' && (in_simple_quote || in_double_quote)) {
-        THROWF(arg_error, 0, "End of string found while searching for %c in %s", (in_simple_quote ? '\'' : '"'), s);
+        throw std::invalid_argument(simgrid::xbt::string_printf("End of string found while searching for %c in %s",
+                                                                (in_simple_quote ? '\'' : '"'), s));
       }
       if (in_simple_quote || in_double_quote) {
         end++;
@@ -195,17 +197,17 @@ xbt_dynar_t xbt_str_split_quoted(const char *s)
 /** @brief Parse an integer out of a string, or raise an error
  *
  * The @a str is passed as argument to your @a error_msg, as follows:
- * @verbatim THROWF(arg_error, 0, error_msg, str); @endverbatim
+ * @verbatim throw std::invalid_argument(simgrid::xbt::string_printf(error_msg, str)); @endverbatim
  */
 long int xbt_str_parse_int(const char* str, const char* error_msg)
 {
   char* endptr;
   if (str == nullptr || str[0] == '\0')
-    THROWF(arg_error, 0, error_msg, str);
+    throw std::invalid_argument(simgrid::xbt::string_printf(error_msg, str));
 
   long int res = strtol(str, &endptr, 10);
   if (endptr[0] != '\0')
-    THROWF(arg_error, 0, error_msg, str);
+    throw std::invalid_argument(simgrid::xbt::string_printf(error_msg, str));
 
   return res;
 }
@@ -213,17 +215,17 @@ long int xbt_str_parse_int(const char* str, const char* error_msg)
 /** @brief Parse a double out of a string, or raise an error
  *
  * The @a str is passed as argument to your @a error_msg, as follows:
- * @verbatim THROWF(arg_error, 0, error_msg, str); @endverbatim
+ * @verbatim throw std::invalid_argument(simgrid::xbt::string_printf(error_msg, str)); @endverbatim
  */
 double xbt_str_parse_double(const char* str, const char* error_msg)
 {
   char *endptr;
   if (str == nullptr || str[0] == '\0')
-    THROWF(arg_error, 0, error_msg, str);
+    throw std::invalid_argument(simgrid::xbt::string_printf(error_msg, str));
 
   double res = strtod(str, &endptr);
   if (endptr[0] != '\0')
-    THROWF(arg_error, 0, error_msg, str);
+    throw std::invalid_argument(simgrid::xbt::string_printf(error_msg, str));
 
   return res;
 }
index 48fe51b..e1e7600 100644 (file)
@@ -29,9 +29,7 @@ void test_split_quoted(const std::string& name, const char* input, const std::ve
 template <typename F> void test_parse_error(F function, const std::string& name, const char* str)
 {
   INFO(name);
-  REQUIRE_THROWS_MATCHES(function(str, "Parse error"), xbt_ex,
-                         Catch::Matchers::Predicate<xbt_ex>([](xbt_ex const& e) { return e.category == arg_error; },
-                                                            "category arg_error"));
+  REQUIRE_THROWS_AS(function(str, "Parse error"), std::invalid_argument);
 }
 
 template <typename F, typename T> void test_parse_ok(F function, const std::string& name, const char* str, T value)
index 628911f..9032b78 100644 (file)
@@ -5,15 +5,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. */
 
-#include "simgrid/msg.h"
+#include "simgrid/actor.h"
+#include "simgrid/simix.h"
 #include "xbt/virtu.h"
 
 int xbt_getpid()
 {
-  return MSG_process_self_PID();
+  smx_actor_t self = SIMIX_process_self();
+  return self == NULL ? 0 : sg_actor_self_get_pid();
 }
 
 const char *xbt_procname(void)
 {
-  return MSG_process_self_name();
+  return SIMIX_process_self_get_name();
 }
index 76c248e..67fcbea 100644 (file)
@@ -24,10 +24,10 @@ foreach(example semaphoregc sleephostoff)
   set(examples_src ${examples_src} ${sources})
 endforeach()
 
-set(examples_src ${examples_src} ${sources}                                                    PARENT_SCOPE)
+set(examples_src ${examples_src}                                                               PARENT_SCOPE)
 set(tesh_files   ${tesh_files}                                                                 PARENT_SCOPE)
 
 if(enable_java)
-  ADD_TESH(tesh-java-semaphoregc  --setenv javacmd=${Java_JAVA_EXECUTABLE} --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 javacmd=${Java_JAVA_EXECUTABLE} --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 javacmd=${Java_JAVA_EXECUTABLE} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv LD_LIBRARY_PATH=${TESH_LIBRARY_PATH} --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 javacmd=${Java_JAVA_EXECUTABLE} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv LD_LIBRARY_PATH=${TESH_LIBRARY_PATH} --setenv classpath=${TESH_CLASSPATH} --cd ${CMAKE_BINARY_DIR}/teshsuite/java/sleephostoff ${CMAKE_HOME_DIRECTORY}/teshsuite/java/sleephostoff/sleephostoff.tesh)
 endif()
index b47ee6c..baefd9e 100644 (file)
@@ -21,7 +21,7 @@ class Sleeper extends Process {
         stillAlive = true;
       } catch (HostFailureException e) {
         stillAlive = false;
-        Msg.info("catch HostException: "+e.getLocalizedMessage());
+        Msg.info("catch HostFailureException: "+e.getLocalizedMessage());
       }
     }
   }
index cdb73b7..b67522a 100644 (file)
@@ -7,6 +7,6 @@ $ ${javacmd:=java} -classpath ${classpath:=.} sleephostoff.SleepHostOff ${srcdir
 > [  0.020000] (1:TestRunner@Fafard) Stop Tremblay
 > [  0.020000] (2:Sleeper@Tremblay) I'm not dead
 > [  0.020000] (1:TestRunner@Fafard) Tremblay has been stopped
-> [  0.020000] (2:Sleeper@Tremblay) catch HostException: Host Failure 
+> [  0.020000] (2:Sleeper@Tremblay) catch HostFailureException: Host Failure 
 > [  0.320000] (1:TestRunner@Fafard) Test sleep seems ok, cool! (number of Process : 1, it should be 1 (i.e. the Test one))
 > [  0.320000] (0:maestro@) MSG_main finished; Terminating the simulation...
index c39217e..79a98cb 100644 (file)
@@ -28,7 +28,7 @@ $ ${bindir:=.}/examples/deprecated/msg/app-masterworker/app-masterworker ${srcdi
 > [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:=.}/teshsuite/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"
+$ ${bindir:=.}/teshsuite/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 85fc94b..f7fdd36 100644 (file)
@@ -1,3 +1,4 @@
+# MC-only C++ binaries
 foreach(x dwarf dwarf-expression)
   if (SIMGRID_HAVE_MC)
     add_executable       (${x}  EXCLUDE_FROM_ALL ${x}/${x}.cpp)
@@ -11,13 +12,25 @@ foreach(x dwarf dwarf-expression)
   set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.cpp)
 endforeach()
 
+# MC-independent C++ binaries
+foreach(x random-bug)
+  add_executable       (${x}  EXCLUDE_FROM_ALL ${x}/${x}.cpp)
+  target_link_libraries(${x}  simgrid)
+  set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
+  set_property(TARGET ${x} APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")
+  add_dependencies(tests ${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()
+
 add_executable       (without-mutex-handling EXCLUDE_FROM_ALL mutex-handling/mutex-handling.c)
 target_link_libraries(without-mutex-handling simgrid)
 set_target_properties(without-mutex-handling PROPERTIES COMPILE_FLAGS -DDISABLE_THE_MUTEX=1)
 set_target_properties(without-mutex-handling PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mutex-handling)
 add_dependencies(tests without-mutex-handling)
 
-foreach(x mutex-handling random-bug)
+foreach(x mutex-handling)
   add_executable       (${x} EXCLUDE_FROM_ALL ${x}/${x}.c)
   target_link_libraries(${x}  simgrid)
   set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
@@ -28,7 +41,8 @@ foreach(x mutex-handling random-bug)
 endforeach()
 
 set(teshsuite_src  ${teshsuite_src}                                                                        PARENT_SCOPE)
-set(tesh_files     ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/random-bug/random-bug-report.tesh
+set(tesh_files     ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/random-bug/random-bug-nocrash.tesh
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/random-bug/random-bug-replay.tesh
                                     ${CMAKE_CURRENT_SOURCE_DIR}/mutex-handling/without-mutex-handling.tesh PARENT_SCOPE)
 set(xml_files      ${xml_files}     ${CMAKE_CURRENT_SOURCE_DIR}/mutex-handling/mutex-handling_d.xml        PARENT_SCOPE)
 
@@ -39,7 +53,11 @@ IF(SIMGRID_HAVE_MC)
 # ADD_TESH(tesh-mc-mutex-handling-dpor         --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/mutex-handling --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/mutex-handling mutex-handling.tesh --cfg=model-check/reduction:dpor)
   ADD_TESH(tesh-mc-without-mutex-handling      --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/mutex-handling --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/mutex-handling without-mutex-handling.tesh --cfg=model-check/reduction:none)
   ADD_TESH(tesh-mc-without-mutex-handling-dpor --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/mutex-handling --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/mutex-handling without-mutex-handling.tesh --cfg=model-check/reduction:dpor)
-  ADD_TESH(mc-random-bug-record                --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/random-bug --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/random-bug random-bug-report.tesh)
+  IF("${CMAKE_SYSTEM}" MATCHES "Linux")
+    ADD_TESH(mc-random-bug                       --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/random-bug --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/random-bug random-bug.tesh)
+  ELSE()
+    ADD_TESH(mc-random-bug-nocrash               --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/random-bug --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/random-bug random-bug-nocrash.tesh)
+  ENDIF()
 ENDIF()
 
-ADD_TESH(mc-random-bug                         --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/random-bug --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/random-bug random-bug.tesh)
+ADD_TESH(mc-random-bug-replay                  --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/random-bug --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/random-bug random-bug-replay.tesh)
index a3c143f..48d21ac 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2014-2019. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program 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,18 +7,18 @@
 #undef NDEBUG
 #endif
 
+#include "src/mc/mc_private.hpp"
+
+#include "src/mc/inspect/ObjectInformation.hpp"
+#include "src/mc/inspect/Type.hpp"
+#include "src/mc/inspect/Variable.hpp"
+#include "src/mc/remote/RemoteClient.hpp"
+
 #include <cassert>
 #include <cstdlib>
 #include <cstring>
 #include <random>
 
-#include "src/mc/mc_private.hpp"
-
-#include "src/mc/ObjectInformation.hpp"
-#include "src/mc/Type.hpp"
-#include "src/mc/Variable.hpp"
-#include "src/mc/remote/RemoteClient.hpp"
-
 static std::default_random_engine rnd_engine;
 
 static simgrid::mc::RemoteClient* process;
@@ -36,11 +35,9 @@ uintptr_t eval_binary_operation(
   ops[2].atom = op;
 
   simgrid::dwarf::ExpressionStack stack;
-
   try {
     simgrid::dwarf::execute(ops, 3, state, stack);
-  }
-  catch(std::runtime_error& e) {
+  } catch (const simgrid::dwarf::evaluation_error&) {
     fprintf(stderr,"Expression evaluation error");
   }
 
@@ -63,7 +60,7 @@ void basic_test(simgrid::dwarf::ExpressionContext const& state) {
   try {
     ops[0].atom = DW_OP_drop;
     simgrid::dwarf::execute(ops, 1, state, stack);
-  } catch (simgrid::dwarf::evaluation_error& e) {
+  } catch (const simgrid::dwarf::evaluation_error&) {
     caught_ex = true;
   }
   if (not caught_ex)
@@ -125,8 +122,7 @@ void basic_test(simgrid::dwarf::ExpressionContext const& state) {
   assert(stack.top()  == a);
   assert(stack.top(1) == b);
 
-  }
-  catch(std::runtime_error& e) {
+  } catch (const simgrid::dwarf::evaluation_error&) {
     fprintf(stderr,"Expression evaluation error");
   }
 }
@@ -148,13 +144,13 @@ void test_deref(simgrid::dwarf::ExpressionContext const& state) {
   assert(stack.size() == 1);
   assert(stack.top()  == foo);
 
-  }
-  catch(std::runtime_error& e) {
+  } catch (const simgrid::dwarf::evaluation_error&) {
     fprintf(stderr,"Expression evaluation error");
   }
 }
 
-int main(int argc, char** argv) {
+int main()
+{
   process = new simgrid::mc::RemoteClient(getpid(), -1);
   process->init();
 
index 471fa94..787f2bc 100644 (file)
@@ -1,3 +1,3 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/dwarf-expression
+$ ${bindir:=.}/dwarf-expression
index 0e08c60..c3f876e 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2014-2019. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -8,19 +7,19 @@
 #undef NDEBUG
 #endif
 
-#include <cassert>
-#include <cstring>
-
 #include <mc/mc.h>
 
 #include "mc/datatypes.h"
 #include "src/mc/mc_private.hpp"
 
-#include "src/mc/ObjectInformation.hpp"
-#include "src/mc/Type.hpp"
-#include "src/mc/Variable.hpp"
+#include "src/mc/inspect/ObjectInformation.hpp"
+#include "src/mc/inspect/Type.hpp"
+#include "src/mc/inspect/Variable.hpp"
 #include "src/mc/remote/RemoteClient.hpp"
 
+#include <cassert>
+#include <cstring>
+
 // Test broken with multi-dimensional arrays. See https://sourceware.org/bugzilla/show_bug.cgi?id=22546
 // int test_some_array[4][5][6];
 int test_some_array[4 * 5 * 6];
@@ -30,14 +29,6 @@ struct some_struct {
 };
 some_struct test_some_struct;
 
-static simgrid::mc::Type* find_type_by_name(simgrid::mc::ObjectInformation* info, const char* name)
-{
-  for (auto& entry : info->types)
-    if(entry.second.name == name)
-      return &entry.second;
-  return nullptr;
-}
-
 static simgrid::mc::Frame* find_function_by_name(
     simgrid::mc::ObjectInformation* info, const char* name)
 {
@@ -73,18 +64,17 @@ static void test_local_variable(simgrid::mc::ObjectInformation* info, const char
   assert(var);
 
   void* frame_base = subprogram->frame_base(*cursor);
-  simgrid::dwarf::Location location = simgrid::dwarf::resolve(
-    var->location_list, info, cursor, frame_base, nullptr, -1);
+  simgrid::dwarf::Location location = simgrid::dwarf::resolve(var->location_list, info, cursor, frame_base, nullptr);
 
   xbt_assert(location.in_memory(), "Expected the variable %s of function %s to be in memory", variable, function);
   xbt_assert(location.address() == address, "Bad resolution of local variable %s of %s", variable, function);
 }
 
-static simgrid::mc::Variable* test_global_variable(simgrid::mc::RemoteClient& process,
-                                                   simgrid::mc::ObjectInformation* info, const char* name,
-                                                   void* address, long byte_size)
+static const simgrid::mc::Variable* test_global_variable(simgrid::mc::RemoteClient& process,
+                                                         simgrid::mc::ObjectInformation* info, const char* name,
+                                                         void* address, long byte_size)
 {
-  simgrid::mc::Variable* variable = info->find_variable(name);
+  const simgrid::mc::Variable* variable = info->find_variable(name);
   xbt_assert(variable, "Global variable %s was not found", name);
   xbt_assert(variable->name == name, "Name mismatch for %s", name);
   xbt_assert(variable->global, "Variable %s is not global", name);
@@ -121,7 +111,7 @@ int main(int argc, char** argv)
 {
   SIMIX_global_init(&argc, argv);
 
-  simgrid::mc::Variable* var;
+  const simgrid::mc::Variable* var;
   simgrid::mc::Type* type;
 
   simgrid::mc::RemoteClient process(getpid(), -1);
@@ -161,5 +151,5 @@ int main(int argc, char** argv)
   s_foo my_foo = {0};
   test_type_by_name(process, my_foo);
 
-  _exit(0);
+  return 0;
 }
index 6c3b12c..f6c817b 100644 (file)
@@ -1,3 +1,3 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/dwarf
+$ ${bindir:=.}/dwarf
index 2c4ce3f..c367cdf 100644 (file)
@@ -27,10 +27,10 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example")
 #define BOX_NAME "box"
 
 #ifndef DISABLE_THE_MUTEX
-static xbt_mutex_t mutex = NULL;
+static sg_mutex_t mutex = NULL;
 #endif
 
-static int receiver(int argc, char *argv[])
+static int receiver(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task = NULL;
 
@@ -47,13 +47,14 @@ static int receiver(int argc, char *argv[])
 
 static int sender(int argc, char *argv[])
 {
+  xbt_assert(argc == 2);
   char* message_name = argv[1];
 #ifndef DISABLE_THE_MUTEX
-  xbt_mutex_acquire(mutex);
+  sg_mutex_lock(mutex);
 #endif
   MSG_task_send(MSG_task_create(message_name, 0.0, 0.0, NULL), BOX_NAME);
 #ifndef DISABLE_THE_MUTEX
-  xbt_mutex_release(mutex);
+  sg_mutex_unlock(mutex);
 #endif
   return 0;
 }
@@ -70,11 +71,12 @@ int main(int argc, char *argv[])
 
   MSG_launch_application(argv[2]);
 #ifndef DISABLE_THE_MUTEX
-  mutex = xbt_mutex_init();
+  mutex = sg_mutex_init();
 #endif
   msg_error_t res = MSG_main();
 #ifndef DISABLE_THE_MUTEX
-  xbt_mutex_destroy(mutex); mutex = NULL;
+  sg_mutex_destroy(mutex);
+  mutex = NULL;
 #endif
   XBT_INFO("Simulation time %g", MSG_get_clock());
 
diff --git a/teshsuite/mc/random-bug/random-bug-nocrash.tesh b/teshsuite/mc/random-bug/random-bug-nocrash.tesh
new file mode 100644 (file)
index 0000000..00fdd65
--- /dev/null
@@ -0,0 +1,24 @@
+#!/usr/bin/env tesh
+! expect return 1
+$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug assert ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=xbt_cfg.thresh:warning
+> [  0.000000] (0:maestro@) Check a safety property. Reduction is: dpor.
+> [  0.000000] (0:maestro@) Behavior: assert
+> [  0.000000] (0:maestro@) **************************
+> [  0.000000] (0:maestro@) *** PROPERTY NOT VALID ***
+> [  0.000000] (0:maestro@) **************************
+> [  0.000000] (0:maestro@) Counter-example execution trace:
+> [  0.000000] (0:maestro@)   [(1)Fafard (app)] MC_RANDOM(3)
+> [  0.000000] (0:maestro@)   [(1)Fafard (app)] MC_RANDOM(4)
+> [  0.000000] (0:maestro@) Path = 1/3;1/4
+> [  0.000000] (0:maestro@) Expanded states = 27
+> [  0.000000] (0:maestro@) Visited states = 68
+> [  0.000000] (0:maestro@) Executed transitions = 46
+
+$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug printf ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=xbt_cfg.thresh:warning
+> [  0.000000] (0:maestro@) Check a safety property. Reduction is: dpor.
+> [  0.000000] (0:maestro@) Behavior: printf
+> [  0.000000] (1:app@Fafard) Error reached
+> [  0.000000] (0:maestro@) No property violation found.
+> [  0.000000] (0:maestro@) Expanded states = 43
+> [  0.000000] (0:maestro@) Visited states = 108
+> [  0.000000] (0:maestro@) Executed transitions = 72
diff --git a/teshsuite/mc/random-bug/random-bug-replay.tesh b/teshsuite/mc/random-bug/random-bug-replay.tesh
new file mode 100644 (file)
index 0000000..ed83684
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/env tesh
+$ ${bindir:=.}/random-bug printf ${platfdir}/small_platform.xml  --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" "--cfg=model-check/replay:1/3;1/4"
+> [  0.000000] (0:maestro@) Behavior: printf
+> [  0.000000] (0:maestro@) path=1/3;1/4
+> [  0.000000] (1:app@Fafard) Error reached
+
+# Behavior: assert does not have the same output within and without MC, so don't test it here. That's already covered with the other ones
+
+! expect signal SIGIOT
+$ $VALGRIND_NO_LEAK_CHECK ${bindir:=.}/random-bug abort ${platfdir}/small_platform.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" "--cfg=model-check/replay:1/3;1/4"
+> [  0.000000] (0:maestro@) Behavior: abort
+> [  0.000000] (0:maestro@) path=1/3;1/4
diff --git a/teshsuite/mc/random-bug/random-bug-report.tesh b/teshsuite/mc/random-bug/random-bug-report.tesh
deleted file mode 100644 (file)
index 1fec35e..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env tesh
-! expect return 1
-$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug ${srcdir:=.}/examples/platforms/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=xbt_cfg.thresh:warning --cfg=model-check/record:1
-> [  0.000000] (0:maestro@) Check a safety property. Reduction is: dpor.
-> [  0.000000] (0:maestro@) **************************
-> [  0.000000] (0:maestro@) *** PROPERTY NOT VALID ***
-> [  0.000000] (0:maestro@) **************************
-> [  0.000000] (0:maestro@) Counter-example execution trace:
-> [  0.000000] (0:maestro@) Path = 1/3;1/4
-> [  0.000000] (0:maestro@) [(1)Tremblay (app)] MC_RANDOM(3)
-> [  0.000000] (0:maestro@) [(1)Tremblay (app)] MC_RANDOM(4)
-> [  0.000000] (0:maestro@) Expanded states = 27
-> [  0.000000] (0:maestro@) Visited states = 68
-> [  0.000000] (0:maestro@) Executed transitions = 46
diff --git a/teshsuite/mc/random-bug/random-bug.c b/teshsuite/mc/random-bug/random-bug.c
deleted file mode 100644 (file)
index 9de062f..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved.          */
-
-/* This program is 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 <simgrid/modelchecker.h>
-
-#include <stdio.h> /* snprintf */
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(random_bug, "Application");
-
-/** An (fake) application with a bug occuring for some random values */
-static int app(int argc, char *argv[])
-{
-  int x = MC_random(0, 5);
-  int y = MC_random(0, 5);
-
-  if (MC_is_active()) {
-    MC_assert(x !=3 || y !=4);
-  }
-  if (x ==3 && y ==4) {
-    fprintf(stderr, "Error reached\n");
-  }
-
-  return 0;
-}
-
-/** Main function */
-int main(int argc, char *argv[])
-{
-  MSG_init(&argc, argv);
-  MSG_function_register("app", &app);
-  MSG_create_environment(argv[1]);
-  MSG_process_create("app", app, NULL, MSG_get_host_by_name("Tremblay"));
-  return MSG_main();
-}
diff --git a/teshsuite/mc/random-bug/random-bug.cpp b/teshsuite/mc/random-bug/random-bug.cpp
new file mode 100644 (file)
index 0000000..03bc2ae
--- /dev/null
@@ -0,0 +1,54 @@
+/* Copyright (c) 2014-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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>
+#include <simgrid/modelchecker.h>
+#include <simgrid/s4u.hpp>
+#include <xbt/log.h>
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(random_bug, "For this example");
+
+enum { ABORT, ASSERT, PRINTF } behavior;
+
+/** A fake application with a bug occuring for some random values */
+static void app()
+{
+  int x = MC_random(0, 5);
+  int y = MC_random(0, 5);
+
+  if (behavior == ASSERT) {
+    MC_assert(x != 3 || y != 4);
+  } else if (behavior == PRINTF) {
+    if (x == 3 && y == 4)
+      XBT_ERROR("Error reached");
+  } else { // behavior == ABORT
+    abort();
+  }
+}
+
+/** Main function */
+int main(int argc, char* argv[])
+{
+  simgrid::s4u::Engine e(&argc, argv);
+  xbt_assert(argc == 3, "Usage: random-bug raise|assert <platformfile>");
+  if (strcmp(argv[1], "abort") == 0) {
+    XBT_INFO("Behavior: abort");
+    behavior = ABORT;
+  } else if (strcmp(argv[1], "assert") == 0) {
+    XBT_INFO("Behavior: assert");
+    behavior = ASSERT;
+  } else if (strcmp(argv[1], "printf") == 0) {
+    XBT_INFO("Behavior: printf");
+    behavior = PRINTF;
+  } else {
+    xbt_die("Please use either 'abort', 'assert' or 'printf' as first parameter, to specify what to do when the error "
+            "is found.");
+  }
+
+  e.load_platform(argv[2]);
+
+  simgrid::s4u::Actor::create("app", simgrid::s4u::Host::by_name("Fafard"), &app);
+  e.run();
+}
index c3f29d9..c41c45b 100644 (file)
@@ -1,4 +1,42 @@
 #!/usr/bin/env tesh
-$ ${bindir:=.}/random-bug  ${srcdir:=.}/examples/platforms/small_platform.xml  --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" "--cfg=model-check/replay:1/3;1/4"
-> [  0.000000] (0:maestro@) path=1/3;1/4
-> Error reached
+! expect return 1
+$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug assert ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=xbt_cfg.thresh:warning
+> [  0.000000] (0:maestro@) Check a safety property. Reduction is: dpor.
+> [  0.000000] (0:maestro@) Behavior: assert
+> [  0.000000] (0:maestro@) **************************
+> [  0.000000] (0:maestro@) *** PROPERTY NOT VALID ***
+> [  0.000000] (0:maestro@) **************************
+> [  0.000000] (0:maestro@) Counter-example execution trace:
+> [  0.000000] (0:maestro@)   [(1)Fafard (app)] MC_RANDOM(3)
+> [  0.000000] (0:maestro@)   [(1)Fafard (app)] MC_RANDOM(4)
+> [  0.000000] (0:maestro@) Path = 1/3;1/4
+> [  0.000000] (0:maestro@) Expanded states = 27
+> [  0.000000] (0:maestro@) Visited states = 68
+> [  0.000000] (0:maestro@) Executed transitions = 46
+
+! expect return 6
+# because SIMGRID_MC_EXIT_PROGRAM_CRASH = 6
+$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug abort ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=xbt_cfg.thresh:warning --log=no_loc
+> [  0.000000] (0:maestro@) Check a safety property. Reduction is: dpor.
+> [  0.000000] (0:maestro@) Behavior: abort
+> [  0.000000] (0:maestro@) **************************
+> [  0.000000] (0:maestro@) ** CRASH IN THE PROGRAM **
+> [  0.000000] (0:maestro@) **************************
+> [  0.000000] (0:maestro@) From signal: Aborted
+> [  0.000000] (0:maestro@) Counter-example execution trace:
+> [  0.000000] (0:maestro@)   [(1)Fafard (app)] MC_RANDOM(0)
+> [  0.000000] (0:maestro@)   [(1)Fafard (app)] MC_RANDOM(0)
+> [  0.000000] (0:maestro@) Path = 1;1
+> [  0.000000] (0:maestro@) Expanded states = 2
+> [  0.000000] (0:maestro@) Visited states = 2
+> [  0.000000] (0:maestro@) Executed transitions = 2
+> [  0.000000] (0:maestro@) Stack trace not displayed because you passed --log=no_loc
+
+$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug printf ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=xbt_cfg.thresh:warning
+> [  0.000000] (0:maestro@) Check a safety property. Reduction is: dpor.
+> [  0.000000] (0:maestro@) Behavior: printf
+> [  0.000000] (1:app@Fafard) Error reached
+> [  0.000000] (0:maestro@) No property violation found.
+> [  0.000000] (0:maestro@) Expanded states = 43
+> [  0.000000] (0:maestro@) Visited states = 108
+> [  0.000000] (0:maestro@) Executed transitions = 72
index afb6936..308a7b8 100644 (file)
@@ -626,9 +626,8 @@ void update_choked_peers(peer_t peer)
           i++;
         }
         xbt_dict_cursor_free(&cursor);
-        if (peer_choosed == NULL)
-          THROWF(unknown_error, 0, "A peer should have be selected at this point");
-        else if ((peer_choosed->interested == 0) || (peer_choosed->choked_upload == 0))
+        xbt_assert(peer_choosed != NULL, "A peer should have been selected at this point");
+        if ((peer_choosed->interested == 0) || (peer_choosed->choked_upload == 0))
           peer_choosed = NULL;
         else
           XBT_DEBUG("Nothing to do, keep going");
index f26c366..ddeb69f 100644 (file)
@@ -4,7 +4,7 @@ p Testing the chainsend MSG implementation
 
 ! timeout 60
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/chainsend ${platfdir}/cluster_backbone.xml app-chainsend_d.xml "--log=root.fmt:[%12.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/chainsend ${platfdir}/cluster_backbone.xml app-chainsend_d.xml "--log=root.fmt:[%12.6r]%e(%i:%P@%h)%e%m%n"
 > [    2.214423] (2:peer@node-1.simgrid.org) ### 2.214423 16777216 bytes (Avg 7.225359 MB/s); copy finished (simulated).
 > [    2.222796] (3:peer@node-2.simgrid.org) ### 2.222796 16777216 bytes (Avg 7.198141 MB/s); copy finished (simulated).
 > [    2.231170] (4:peer@node-3.simgrid.org) ### 2.231170 16777216 bytes (Avg 7.171126 MB/s); copy finished (simulated).
index aa9f5c6..29a193f 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing with default compound
 
-$ $SG_TEST_EXENV ${bindir:=.}/app-pingpong$EXEEXT ${platfdir}/small_platform.xml app-pingpong_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/app-pingpong ${platfdir}/small_platform.xml app-pingpong_d.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)
@@ -14,7 +14,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/app-pingpong$EXEEXT ${platfdir}/small_platform.xml
 
 p Testing with default compound and Full network optimization
 
-$ $SG_TEST_EXENV ${bindir:=.}/app-pingpong$EXEEXT ${platfdir}/small_platform.xml app-pingpong_d.xml "--cfg=network/optim:Full" "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/app-pingpong ${platfdir}/small_platform.xml 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
@@ -27,7 +27,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/app-pingpong$EXEEXT ${platfdir}/small_platform.xml
 
 p Testing the deprecated CM02 network model
 
-$ $SG_TEST_EXENV ${bindir:=.}/app-pingpong$EXEEXT ${platfdir}/small_platform.xml app-pingpong_d.xml --cfg=cpu/model:Cas01 --cfg=network/model:CM02 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/app-pingpong ${platfdir}/small_platform.xml app-pingpong_d.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
@@ -39,54 +39,9 @@ $ $SG_TEST_EXENV ${bindir:=.}/app-pingpong$EXEEXT ${platfdir}/small_platform.xml
 > [145.639041] (1:pinger@Tremblay) Pong time (bandwidth bound): 145.638
 > [145.639041] (0:maestro@) Total simulation time: 145.639
 
-p Testing the surf network Reno fairness model using lagrangian approach
-
-$ $SG_TEST_EXENV ${bindir:=.}/app-pingpong$EXEEXT ${platfdir}/small_platform.xml app-pingpong_d.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'
-> [  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 Reno2 fairness model using lagrangian approach
-
-$ $SG_TEST_EXENV ${bindir:=.}/app-pingpong$EXEEXT ${platfdir}/small_platform.xml 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 ${platfdir}/small_platform.xml 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"
-> [  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'
-> [  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 constant model
 
-$ $SG_TEST_EXENV ${bindir:=.}/app-pingpong$EXEEXT ${platfdir}/small_platform_constant.xml 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"
+$ ${bindir:=.}/app-pingpong ${platfdir}/small_platform_constant.xml 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'
index 3c585b2..dc780b9 100644 (file)
@@ -10,7 +10,7 @@
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_app_token_ring, "Messages specific for this msg example");
 
 /* Main function of all processes used in this example */
-static int relay_runner(int argc, char* argv[])
+static int relay_runner(int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   xbt_assert(argc == 0, "The relay_runner function does not accept any parameter from the XML deployment file");
   int rank = xbt_str_parse_int(MSG_process_get_name(MSG_process_self()),
index 00c488e..47f5abf 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/app-token-ring ${platfdir}/routing_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/app-token-ring ${platfdir}/routing_cluster.xml "--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"
@@ -16,7 +16,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/app-token-ring ${platfdir}/routing_cluster.xml "--
 > [  0.131796] (1:0@host1) Host "0" received "Token"
 > [  0.131796] (0:maestro@) Simulation time 0.131796
 
-$ $SG_TEST_EXENV ${bindir:=.}/app-token-ring ${platfdir}/two_peers.xml "--log=root.fmt:[%12.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/app-token-ring ${platfdir}/two_peers.xml "--log=root.fmt:[%12.6r]%e(%i:%P@%h)%e%m%n"
 > [    0.000000] (0:maestro@) Number of hosts '2'
 > [    0.000000] (1:0@100030591) Host "0" send 'Token' to Host "1"
 > [    0.624423] (2:1@100036570) Host "1" received "Token"
@@ -24,7 +24,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/app-token-ring ${platfdir}/two_peers.xml "--log=ro
 > [    1.248846] (1:0@100030591) Host "0" received "Token"
 > [    1.248846] (0:maestro@) Simulation time 1.24885
 
-$ $SG_TEST_EXENV ${bindir:=.}/app-token-ring ${platfdir}/meta_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/app-token-ring ${platfdir}/meta_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Number of hosts '60'
 > [  0.000000] (1:0@host-1.cluster1) Host "0" send 'Token' to Host "1"
 > [  0.030364] (2:1@host-1.cluster2) Host "1" received "Token"
index 322ad38..daab871 100644 (file)
@@ -2,7 +2,7 @@
 
 p Test1 MSG_comm_test() with Sleep_sender > Sleep_receiver
 
-$ $SG_TEST_EXENV ${bindir:=.}/async-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/async-wait_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/async-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/async-wait_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) sleep_start_time : 5.000000 , sleep_test_time : 0.100000
 > [  0.000000] (2:receiver@Ruby) sleep_start_time : 1.000000 , sleep_test_time : 0.100000
 > [  1.000000] (2:receiver@Ruby) Wait to receive a task
@@ -29,7 +29,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/async-wait ${platfdir:=.}/small_platform_fatpipe.x
 
 p Test2 MSG_comm_test() with Sleep_sender < Sleep_receiver
 
-$ $SG_TEST_EXENV ${bindir:=.}/async-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/async-wait2_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/async-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/async-wait2_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) sleep_start_time : 1.000000 , sleep_test_time : 0.100000
 > [  0.000000] (2:receiver@Ruby) sleep_start_time : 5.000000 , sleep_test_time : 0.100000
 > [  1.000000] (1:sender@Tremblay) Send to receiver-0 Task_0
@@ -56,7 +56,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/async-wait ${platfdir:=.}/small_platform_fatpipe.x
 
 p Test1 MSG_comm_wait() with Sleep_sender > Sleep_receiver
 
-$ $SG_TEST_EXENV ${bindir:=.}/async-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/async-wait3_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/async-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/async-wait3_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) sleep_start_time : 5.000000 , sleep_test_time : 0.000000
 > [  0.000000] (2:receiver@Ruby) sleep_start_time : 1.000000 , sleep_test_time : 0.000000
 > [  1.000000] (2:receiver@Ruby) Wait to receive a task
@@ -84,7 +84,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/async-wait ${platfdir:=.}/small_platform_fatpipe.x
 
 p Test2 MSG_comm_wait() with Sleep_sender < Sleep_receiver
 
-$ $SG_TEST_EXENV ${bindir:=.}/async-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/async-wait4_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/async-wait ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/async-wait4_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) sleep_start_time : 1.000000 , sleep_test_time : 0.000000
 > [  0.000000] (2:receiver@Ruby) sleep_start_time : 5.000000 , sleep_test_time : 0.000000
 > [  1.000000] (1:sender@Tremblay) Send to receiver-0 Task_0
index 717ac31..b815ef3 100644 (file)
@@ -2,7 +2,7 @@
 p Test1 MSG_comm_waitall() for sender
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/async-waitall ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/async-waitall_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/async-waitall ${platfdir:=.}/small_platform_fatpipe.xml ${srcdir:=.}/async-waitall_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) Send to receiver-0 Task_0
 > [  0.000000] (1:sender@Tremblay) Send to receiver-0 Task_1
 > [  0.000000] (1:sender@Tremblay) Send to receiver-0 Task_2
index 821c1d7..4027e42 100644 (file)
@@ -3,7 +3,7 @@
 p Testing the MSG_comm_waitany function
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/async-waitany ${platfdir:=.}/small_platform.xml ${srcdir:=.}/async-waitany_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/async-waitany ${platfdir:=.}/small_platform.xml ${srcdir:=.}/async-waitany_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sender@Tremblay) Send to receiver-0 Task_0 comm_size 1000000.000000
 > [  0.000000] (1:sender@Tremblay) Send to receiver-1 Task_1 comm_size 1000000.000000
 > [  0.000000] (1:sender@Tremblay) Send to receiver-0 Task_2 comm_size 1000000.000000
index 3a4f493..b364e4f 100644 (file)
@@ -15,6 +15,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example")
 
 static int worker_main(int argc, char* argv[])
 {
+  xbt_assert(argc == 4);
   double computation_amount = xbt_str_parse_double(argv[1], "Invalid computation amount: %s");
   int use_bound             = xbt_str_parse_int(argv[2], "Second parameter (use_bound) should be 0 or 1 but is: %s");
   double bound              = xbt_str_parse_double(argv[3], "Invalid bound: %s");
@@ -51,7 +52,7 @@ static void launch_worker(msg_host_t host, const char* pr_name, double computati
   MSG_process_create_with_arguments(pr_name, worker_main, NULL, host, 4, argv);
 }
 
-static int worker_busy_loop_main(int argc, char* argv[])
+static int worker_busy_loop_main(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t* task = MSG_process_get_data(MSG_process_self());
   MSG_task_execute(*task);
@@ -189,7 +190,7 @@ static void test_two_tasks(msg_host_t hostA, msg_host_t hostB)
   MSG_process_sleep(1000);
 }
 
-static int master_main(int argc, char* argv[])
+static int master_main(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_host_t pm0 = MSG_host_by_name("Fafard");
   msg_host_t pm1 = MSG_host_by_name("Fafard");
index 0bd4127..b30353d 100644 (file)
@@ -1,4 +1,4 @@
-$ $SG_TEST_EXENV ${bindir:=.}/cloud-capping ${platfdir}/small_platform.xml --log=no_loc "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/cloud-capping ${platfdir}/small_platform.xml --log=no_loc "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:master_@Fafard) # 1. Put a single task on a PM. 
 > [  0.000000] (1:master_@Fafard) ### Test: with/without MSG_task_set_bound
 > [  0.000000] (1:master_@Fafard) ### Test: no bound for Task1@Fafard
index dc9f1f2..d3603d7 100644 (file)
@@ -50,7 +50,7 @@ static void vm_migrate_async(msg_vm_t vm, msg_host_t dst_pm)
   MSG_process_create_with_arguments(pr_name, migration_worker_main, NULL, host, 3, argv);
 }
 
-static int master_main(int argc, char* argv[])
+static int master_main(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_host_t pm0 = MSG_host_by_name("Fafard");
   msg_host_t pm1 = MSG_host_by_name("Tremblay");
index 124b61a..fce982f 100644 (file)
@@ -1,4 +1,4 @@
-$ $SG_TEST_EXENV ${bindir:=.}/cloud-migration ${platfdir}/small_platform.xml --log=no_loc "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/cloud-migration ${platfdir}/small_platform.xml --log=no_loc "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:master_@Fafard) Test: Migrate a VM with 1000 Mbytes RAM
 > [132.765801] (1:master_@Fafard) VM0 migrated: Fafard->Tremblay in 132.766 s
 > [132.765801] (1:master_@Fafard) Test: Migrate a VM with 100 Mbytes RAM
index 186ffa4..0985122 100644 (file)
@@ -8,7 +8,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
-static int computation_fun(int argc, char* argv[])
+static int computation_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   const char* pr_name   = MSG_process_get_name(MSG_process_self());
   const char* host_name = MSG_host_get_name(MSG_host_self());
@@ -106,7 +106,7 @@ static void launch_communication_worker(msg_host_t tx_host, msg_host_t rx_host)
   xbt_free(mbox);
 }
 
-static int master_main(int argc, char* argv[])
+static int master_main(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_host_t pm0 = MSG_host_by_name("Fafard");
   msg_host_t pm1 = MSG_host_by_name("Tremblay");
index 795fb86..b542166 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing a vm with two successive tasks
 
-$ $SG_TEST_EXENV ${bindir:=.}/cloud-simple$EXEEXT --log=no_loc ${platfdir}/small_platform.xml
+$ ${bindir:=.}/cloud-simple --log=no_loc ${platfdir}/small_platform.xml
 > [Fafard:master_:(1) 0.000000] [msg_test/INFO] ## Test 1 (started): check computation on normal PMs
 > [Fafard:master_:(1) 0.000000] [msg_test/INFO] ### Put a task on a PM
 > [Fafard:compute:(2) 0.013107] [msg_test/INFO] Fafard:compute task executed 0.0131068
index c99a8a6..160b321 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing a vm with two successive tasks
 
-$ $SG_TEST_EXENV ${bindir:=.}/cloud-two-tasks$EXEEXT ${platfdir}/small_platform.xml
+$ ${bindir:=.}/cloud-two-tasks ${platfdir}/small_platform.xml
 > [VM0:compute:(2) 0.000000] [msg_test/INFO] VM0:compute task 1 created 0
 > [Fafard:master_:(1) 0.000000] [msg_test/INFO] aTask remaining duration: 1e+09
 > [Fafard:master_:(1) 1.000000] [msg_test/INFO] aTask remaining duration: 9.23704e+08
index 82d9f95..358775a 100644 (file)
@@ -9,11 +9,11 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
-static int dvfs(int argc, char* argv[])
+static int dvfs(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_host_t host = MSG_host_by_name("MyHost1");
 
-  XBT_INFO("Energetic profile: %s", MSG_host_get_property_value(host, "watt_per_state"));
+  XBT_INFO("Energetic profile: %s", MSG_host_get_property_value(host, "wattage_per_state"));
   XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J", MSG_host_get_speed(host),
            sg_host_get_consumed_energy(host));
 
index bcb9f7f..b7752c9 100644 (file)
@@ -2,13 +2,13 @@
 
 p Testing the mechanism for computing host energy consumption
 
-$ ${bindir:=.}/energy-consumption$EXEEXT ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
-> [  0.000000] (1:dvfs_test@MyHost1) Energetic profile: 100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0
+$ ${bindir:=.}/energy-consumption ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (1:dvfs_test@MyHost1) Energetic profile: 100.0:93.33333333333333:200.0, 93.0:90.0:170.0, 90.0:90.0:150.0
 > [  0.000000] (1:dvfs_test@MyHost1) Initial peak speed=1E+08 flop/s; Energy dissipated =0E+00 J
 > [  0.000000] (1:dvfs_test@MyHost1) Sleep for 10 seconds
 > [ 10.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=1E+08; Energy dissipated=1000.00 J
 > [ 10.000000] (1:dvfs_test@MyHost1) Run a task of 1E+08 flops
-> [ 11.000000] (1:dvfs_test@MyHost1) Task done (duration: 1.00 s). Current peak speed=1E+08 flop/s; Current consumption: from 120W to 200W depending on load; Energy dissipated=1120 J
+> [ 11.000000] (1:dvfs_test@MyHost1) Task done (duration: 1.00 s). Current peak speed=1E+08 flop/s; Current consumption: from 93W to 200W depending on load; Energy dissipated=1120 J
 > [ 11.000000] (1:dvfs_test@MyHost1) ========= Requesting pstate 2 (speed should be of 2E+07 flop/s and is of 2E+07 flop/s)
 > [ 11.000000] (1:dvfs_test@MyHost1) Run a task of 1E+08 flops
 > [ 16.000000] (1:dvfs_test@MyHost1) Task done (duration: 5.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=1645 J
@@ -22,15 +22,15 @@ $ ${bindir:=.}/energy-consumption$EXEEXT ${platfdir}/energy_platform.xml "--log=
 > [ 30.000000] (0:maestro@) Energy consumption of host MyHost2: 2100.000000 Joules
 > [ 30.000000] (0:maestro@) Energy consumption of host MyHost3: 3000.000000 Joules
 
-$ ${bindir:=.}/energy-consumption$EXEEXT ${platfdir}/energy_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=host/model:ptask_L07
+$ ${bindir:=.}/energy-consumption ${platfdir}/energy_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=host/model:ptask_L07
 > [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'ptask_L07'
 > [  0.000000] (0:maestro@) Switching to the L07 model to handle parallel tasks.
-> [  0.000000] (1:dvfs_test@MyHost1) Energetic profile: 100.0:120.0:200.0, 93.0:110.0:170.0, 90.0:105.0:150.0
+> [  0.000000] (1:dvfs_test@MyHost1) Energetic profile: 100.0:93.33333333333333:200.0, 93.0:90.0:170.0, 90.0:90.0:150.0
 > [  0.000000] (1:dvfs_test@MyHost1) Initial peak speed=1E+08 flop/s; Energy dissipated =0E+00 J
 > [  0.000000] (1:dvfs_test@MyHost1) Sleep for 10 seconds
 > [ 10.000000] (1:dvfs_test@MyHost1) Done sleeping (duration: 10.00 s). Current peak speed=1E+08; Energy dissipated=1000.00 J
 > [ 10.000000] (1:dvfs_test@MyHost1) Run a task of 1E+08 flops
-> [ 11.000000] (1:dvfs_test@MyHost1) Task done (duration: 1.00 s). Current peak speed=1E+08 flop/s; Current consumption: from 120W to 200W depending on load; Energy dissipated=1120 J
+> [ 11.000000] (1:dvfs_test@MyHost1) Task done (duration: 1.00 s). Current peak speed=1E+08 flop/s; Current consumption: from 93W to 200W depending on load; Energy dissipated=1120 J
 > [ 11.000000] (1:dvfs_test@MyHost1) ========= Requesting pstate 2 (speed should be of 2E+07 flop/s and is of 2E+07 flop/s)
 > [ 11.000000] (1:dvfs_test@MyHost1) Run a task of 1E+08 flops
 > [ 16.000000] (1:dvfs_test@MyHost1) Task done (duration: 5.00 s). Current peak speed=2E+07 flop/s; Energy dissipated=1645 J
index 2ffc29a..e0afcf4 100644 (file)
@@ -16,7 +16,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Pstate properties test");
 
-static int dvfs(int argc, char* argv[])
+static int dvfs(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   double workload = 100E6;
   msg_host_t host = MSG_host_self();
index 7d47505..464869f 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing the DVFS-related functions
 
-$ ${bindir:=.}/energy-pstate$EXEEXT ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/energy-pstate ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:dvfs_test@MyHost1) Count of Processor states=3
 > [  0.000000] (1:dvfs_test@MyHost1) Current power peak=100000000.000000
 > [  0.000000] (2:dvfs_test@MyHost2) Count of Processor states=3
@@ -21,7 +21,7 @@ $ ${bindir:=.}/energy-pstate$EXEEXT ${platfdir}/energy_platform.xml "--log=root.
 > [  6.000000] (2:dvfs_test@MyHost2) Current power peak=20000000.000000
 > [  6.000000] (0:maestro@) Total simulation time: 6.000000e+00
 
-$ ${bindir:=.}/energy-pstate$EXEEXT ${platfdir}/energy_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=host/model:ptask_L07
+$ ${bindir:=.}/energy-pstate ${platfdir}/energy_cluster.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=host/model:ptask_L07
 > [  0.000000] (0:maestro@) Configuration change: Set 'host/model' to 'ptask_L07'
 > [  0.000000] (0:maestro@) Switching to the L07 model to handle parallel tasks.
 > [  0.000000] (1:dvfs_test@MyHost1) Count of Processor states=3
index 94f3a9b..c1b73bb 100644 (file)
@@ -12,7 +12,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example")
  *
  * - <b>energy-ptask/energy-ptask.c</b>: Demonstrates the use of @ref MSG_parallel_task_create, to create special
  *   tasks that run on several hosts at the same time. The resulting simulations are very close to what can be
- *   achieved in @ref SD_API, but still allows to use the other features of MSG (it'd be cool to be able to mix
+ *   achieved in @ref SD_API, but still allows one to use the other features of MSG (it'd be cool to be able to mix
  *   interfaces, but it's not possible ATM).
  */
 
index 6848fdb..2ab7b15 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ ${bindir:=.}/energy-ptask$EXEEXT ${platfdir:=.}/energy_platform.xml --energy "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/energy-ptask ${platfdir:=.}/energy_platform.xml --energy "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Switching to the L07 model to handle parallel tasks.
 > [  0.000000] (1:test@MyHost1) First, build a classical parallel task, with 1 Gflop to execute on each node, and 10MB to exchange between each pair
 > [300.000000] (1:test@MyHost1) We can do the same with a timeout of one second enabled.
index c4bf34c..eb97efd 100644 (file)
@@ -8,22 +8,24 @@
 #include <float.h>
 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Messages specific to this example");
 
-static int sender_fun(int argc, char *argv[])
+static int sender_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("Sending");
   MSG_task_send(MSG_task_create("Blah", 0.0, 0.0, NULL), MSG_host_get_name(MSG_host_self()));
-  MSG_process_sleep(1.);     /* FIXME: if the sender exits before the receiver calls get_sender(), bad thing happens */
+  MSG_process_sleep(1.0);
   XBT_INFO("Exiting");
   return 0;
 }
 
-static int receiver_fun(int argc, char *argv[])
+static int receiver_fun(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("Receiving");
   msg_task_t task = NULL;
   MSG_task_receive_with_timeout(&task, MSG_host_get_name(MSG_host_self()), DBL_MAX);
   xbt_assert(MSG_task_get_sender(task), "No sender received");
   XBT_INFO("Got a message sent by '%s'", MSG_process_get_name(MSG_task_get_sender(task)));
+  MSG_process_sleep(2.0);
+  XBT_INFO("Did I tell you that I got a message sent by '%s'?", MSG_process_get_name(MSG_task_get_sender(task)));
   MSG_task_destroy(task);
   return 0;
 }
index ca9ced0..7ec1a59 100644 (file)
@@ -4,3 +4,4 @@ $ ${bindir}/get_sender  ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%
 > [  0.000000] (2:receive@Tremblay) Receiving
 > [  0.000195] (2:receive@Tremblay) Got a message sent by 'send'
 > [  1.000195] (1:send@Tremblay) Exiting
+> [  2.000195] (2:receive@Tremblay) Did I tell you that I got a message sent by 'send'?
index db526a4..9b1152b 100644 (file)
@@ -8,7 +8,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
-static int slave(int argc, char *argv[])
+static int slave(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_task_t task = NULL;
   XBT_ATTRIB_UNUSED int res;
@@ -38,7 +38,7 @@ static int slave(int argc, char *argv[])
   return 0;
 }
 
-static int master(int argc, char *argv[])
+static int master(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   double task_comp_size = 5E7;
   double task_comm_size = 1E6;
index 87cb748..8f278b2 100644 (file)
@@ -156,7 +156,6 @@ static int test_launcher(int /*argc*/, char** /*argv*/)
   test = 6;
   if (xbt_dynar_search_or_negative(tests, &test) != -1) {
     XBT_INFO("Test 6: Turn on Jupiter, assign a VM on Jupiter, launch a process inside the VM, and turn off the node");
-    MSG_process_set_data_cleanup(nullptr); // If set for test 6, cleanup handler gives double-free errors.
 
     // Create VM0
     msg_vm_t vm0 = MSG_vm_create_core(jupiter, "vm0");
index 309dbd4..ebb928c 100644 (file)
@@ -13,7 +13,7 @@ $ ${bindir}/host_on_off_processes ${platfdir}/small_platform.xml 1 --log=no_loc
 > [13.000000] [msg_test/INFO] Simulation time 13
 
 ! expect signal SIGIOT
-$ ${bindir}/host_on_off_processes ${platfdir}/small_platform.xml 2 --log=no_loc
+$ $VALGRIND_NO_LEAK_CHECK ${bindir}/host_on_off_processes ${platfdir}/small_platform.xml 2 --log=no_loc
 > [Tremblay:test_launcher:(1) 0.000000] [msg_test/INFO] Test 2:
 > [Tremblay:test_launcher:(1) 0.000000] [msg_test/INFO]   Turn off Jupiter
 > [0.000000] [simix_process/WARNING] Cannot launch actor 'process_daemon' on failed host 'Jupiter'
index 3c7b6d8..5c4f339 100644 (file)
@@ -10,7 +10,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example")
 
 static const char* mailbox = "comm";
 
-static int master(int argc, char *argv[])
+static int master(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_host_t jupiter = MSG_host_by_name("Jupiter");
 
@@ -35,7 +35,7 @@ static int master(int argc, char *argv[])
   return 0;
 }
 
-static int slave(int argc, char *argv[])
+static int slave(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("Slave receiving");
   msg_task_t task = NULL;
index 7f3119d..a3127a0 100644 (file)
@@ -1,17 +1,17 @@
 #!/usr/bin/env tesh
 
-$ ${bindir:=.}/io-file-remote$EXEEXT ${platfdir:=.}/storage/remote_io.xml ${srcdir:=.}/io-file-remote_d.xml "--log=root.fmt:[%10.6r]%e(%i@%5h)%e%m%n"
+$ ${bindir:=.}/io-file-remote ${platfdir:=.}/storage/remote_io.xml ${srcdir:=.}/io-file-remote_d.xml "--log=root.fmt:[%10.6r]%e(%i@%5h)%e%m%n"
 > [  0.000000] (0@     ) Init: 12/476824 MiB used/free on 'Disk1'
-> [  0.000000] (0@     ) Init: 2280/474556 MiB used/free on 'Disk2'
-> [  0.000000] (1@alice) Opened file 'c:\Windows\setupact.log'
+> [  0.000000] (0@     ) Init: 35/476801 MiB used/free on 'Disk2'
+> [  0.000000] (1@alice) Opened file '/tmp/doc/simgrid/examples/msg/chord/chord10k.xml'
 > [  0.000000] (1@alice) File Descriptor information:
->              Full path: 'c:\Windows\setupact.log'
->              Size: 101663
->              Mount point: 'c:'
+>              Full path: '/tmp/doc/simgrid/examples/msg/chord/chord10k.xml'
+>              Size: 1624671
+>              Mount point: '/tmp'
 >              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] (1@alice) Try to read 1624671 from '/tmp/doc/simgrid/examples/msg/chord/chord10k.xml'
 > [  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'
@@ -30,23 +30,23 @@ $ ${bindir:=.}/io-file-remote$EXEEXT ${platfdir:=.}/storage/remote_io.xml ${srcd
 >              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) Opened file '/tmp/doc/simgrid/examples/simdag/dax/Montage_50.xml'
 > [  0.000000] (4@ dave) File Descriptor information:
->              Full path: 'c:\Windows\bootstat.dat'
->              Size: 67584
->              Mount point: 'c:'
+>              Full path: '/tmp/doc/simgrid/examples/simdag/dax/Montage_50.xml'
+>              Size: 48868
+>              Mount point: '/tmp'
 >              Storage Id: 'Disk2'
 >              Storage Type: 'SATA-II_HDD'
 >              File Descriptor Id: 0
-> [  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...
-> [  0.001469] (4@ dave) Offset is now at: 0
-> [  0.001469] (4@ dave) Opened file 'c:\Windows\Professional.xml'
-> [  0.001469] (4@ dave) Try to write 31 MiB to 'c:\Windows\Professional.xml'
-> [  0.003741] (1@alice) Have read 101663 from 'c:\Windows\setupact.log'. Offset is now at: 101663
-> [  0.003741] (1@alice) Seek back to the begining of the stream...
-> [  0.003741] (1@alice) Offset is now at: 0
+> [  0.000000] (4@ dave) Try to read 48868 from '/tmp/doc/simgrid/examples/simdag/dax/Montage_50.xml'
+> [  0.001062] (4@ dave) Have read 48868 from '/tmp/doc/simgrid/examples/simdag/dax/Montage_50.xml'. Offset is now at: 48868
+> [  0.001062] (4@ dave) Seek back to the begining of the stream...
+> [  0.001062] (4@ dave) Offset is now at: 0
+> [  0.001062] (4@ dave) Opened file '/tmp/doc/simgrid/examples/simdag/scheduling/Montage_25.xml'
+> [  0.001062] (4@ dave) Try to write 22 MiB to '/tmp/doc/simgrid/examples/simdag/scheduling/Montage_25.xml'
+> [  0.050039] (1@alice) Have read 1624671 from '/tmp/doc/simgrid/examples/msg/chord/chord10k.xml'. Offset is now at: 1624671
+> [  0.050039] (1@alice) Seek back to the begining of the stream...
+> [  0.050039] (1@alice) Offset is now at: 0
 > [  0.276315] (3@ carl) Have read 12710497 from '/scratch/lib/libsimgrid.so.3.6.2'. Offset is now at: 12710497
 > [  0.276315] (3@ carl) Seek back to the begining of the stream...
 > [  0.276315] (3@ carl) Offset is now at: 0
@@ -55,10 +55,10 @@ $ ${bindir:=.}/io-file-remote$EXEEXT ${platfdir:=.}/storage/remote_io.xml ${srcd
 > [  0.387036] (2@  bob) Offset is now at: 0
 > [  0.387036] (2@  bob) Opened file '/scratch/doc/simgrid/examples/platforms/g5k.xml'
 > [  0.387036] (2@  bob) Try to write 16 MiB to '/scratch/doc/simgrid/examples/platforms/g5k.xml'
-> [  0.528211] (4@ dave) Have written 32646144 bytes to 'c:\Windows\Professional.xml'.
-> [  0.528211] (4@ dave) Move 'c:\Windows\Professional.xml' (of size 32646144) from 'dave' to 'carl'
+> [  0.391211] (4@ dave) Have written 23641088 bytes to '/tmp/doc/simgrid/examples/simdag/scheduling/Montage_25.xml'.
+> [  0.391211] (4@ dave) Move '/tmp/doc/simgrid/examples/simdag/scheduling/Montage_25.xml' (of size 23641088) from 'dave' to 'carl'
 > [  0.819921] (2@  bob) Have written 17436672 bytes to '/scratch/doc/simgrid/examples/platforms/g5k.xml'.
 > [  0.819921] (2@  bob) Copy '/scratch/doc/simgrid/examples/platforms/g5k.xml' (of size 17436672) from 'bob' to 'alice'
-> [  1.843969] (0@     ) End: 60/476776 MiB used/free on 'Disk1'
-> [  1.843969] (0@     ) End: 2297/474539 MiB used/free on 'Disk2'
-> [  1.843969] (0@     ) Simulation time 1.84397
+> [  1.598229] (0@     ) End: 51/476785 MiB used/free on 'Disk1'
+> [  1.598229] (0@     ) End: 51/476785 MiB used/free on 'Disk2'
+> [  1.598229] (0@     ) Simulation time 1.59823
index 3b3f1ab..1200d95 100644 (file)
@@ -2,23 +2,23 @@
 <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
 <platform version="4.1">
   <actor host="alice" function="host">
-    <argument value = "c:\Windows\setupact.log"/>
+    <argument value = "/tmp/doc/simgrid/examples/msg/chord/chord10k.xml"/>
   </actor>
   <actor host="bob" function="host">
     <argument value = "/scratch/lib/libsimgrid.so.3.6.2"/>
     <argument value = "/scratch/doc/simgrid/examples/platforms/g5k.xml"/>
     <argument value = "alice"/>
-    <argument value = "c:\Windows\Platforms\g5k.xml"/>
+    <argument value = "/tmp/doc/simgrid/examples/g5k_2.xml"/>
     <argument value = "0"/>
   </actor>
   <actor host="carl" function="host">
     <argument value = "/scratch/lib/libsimgrid.so.3.6.2"/>
   </actor>
   <actor host="dave" function="host">
-    <argument value = "c:\Windows\bootstat.dat"/>
-    <argument value = "c:\Windows\Professional.xml"/>
+    <argument value = "/tmp/doc/simgrid/examples/simdag/dax/Montage_50.xml"/>
+    <argument value = "/tmp/doc/simgrid/examples/simdag/scheduling/Montage_25.xml"/>
     <argument value = "carl"/>
-    <argument value = "/scratch/mailbox/Professional.xml"/>
+    <argument value = "/scratch/doc/simgrid/examples/simdag/dax/Montage_25.xml"/>
     <argument value = "1"/>
   </actor>
 </platform>
index fd77c08..a2feefc 100644 (file)
@@ -10,7 +10,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(io_file, "Messages specific for this io example");
 
-static int host(int argc, char* argv[])
+static int host(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_file_t file = NULL;
   sg_size_t read;
@@ -20,7 +20,7 @@ static int host(int argc, char* argv[])
 
   switch (MSG_process_self_PID()) {
     case 1:
-      file    = MSG_file_open("c:\\Windows\\setupact.log", NULL);
+      file    = MSG_file_open("/tmp/include/surf/simgrid_dtd.h", NULL);
       st_name = "Disk2";
       break;
     case 2:
index 636d10e..87589ec 100644 (file)
@@ -2,8 +2,8 @@
 
 $ ${bindir:=.}/io-file ${platfdir}/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] (1:host@alice)  Capacity of the storage element 'c:\Windows\setupact.log' is stored on: 2391537133 / 536870912000
+> [  0.000000] (1:host@alice)  Open file '/tmp/include/surf/simgrid_dtd.h'
+> [  0.000000] (1:host@alice)  Capacity of the storage element '/tmp/include/surf/simgrid_dtd.h' is stored on: 13221994 / 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'
@@ -19,18 +19,18 @@ $ ${bindir:=.}/io-file ${platfdir}/storage/storage.xml "--log=root.fmt:[%10.6r]%
 > [  0.000000] (4:host@denise)         Capacity of the storage element '/home/doc/simgrid/examples/platforms/g5k.xml' is stored on: 13221994 / 536870912000
 > [  0.000040] (2:host@bob)    Have read 4028 from '/home/doc/simgrid/examples/platforms/nancy.xml'
 > [  0.000085] (4:host@denise)         Have read 17028 from '/home/doc/simgrid/examples/platforms/g5k.xml'
+> [  0.000118] (1:host@alice)  Have read 23583 from '/tmp/include/surf/simgrid_dtd.h'
 > [  0.000226] (3:host@carl)   Have read 22645 from '/home/doc/simgrid/examples/platforms/g5k_cabinets.xml'
-> [  0.000508] (1:host@alice)  Have read 101663 from 'c:\Windows\setupact.log'
 > [  0.001752] (4:host@denise)         Have written 100000 in '/home/doc/simgrid/examples/platforms/g5k.xml'. Size now is: 117028
 > [  0.001752] (4:host@denise)         Capacity of the storage element '/home/doc/simgrid/examples/platforms/g5k.xml' is stored on: 13321994 / 536870912000
 > [  0.001752] (4:host@denise)         Coming back to the beginning of the stream for file '/home/doc/simgrid/examples/platforms/g5k.xml'
-> [  0.002175] (1:host@alice)  Have written 100000 in 'c:\Windows\setupact.log'. Size now is: 201663
-> [  0.002175] (1:host@alice)  Capacity of the storage element 'c:\Windows\setupact.log' is stored on: 2391637133 / 536870912000
-> [  0.002175] (1:host@alice)  Coming back to the beginning of the stream for file 'c:\Windows\setupact.log'
+> [  0.001785] (1:host@alice)  Have written 100000 in '/tmp/include/surf/simgrid_dtd.h'. Size now is: 123583
+> [  0.001785] (1:host@alice)  Capacity of the storage element '/tmp/include/surf/simgrid_dtd.h' is stored on: 13321994 / 536870912000
+> [  0.001785] (1:host@alice)  Coming back to the beginning of the stream for file '/tmp/include/surf/simgrid_dtd.h'
 > [  0.002302] (4:host@denise)         Have read 110000 from '/home/doc/simgrid/examples/platforms/g5k.xml' (of size 117028)
 > [  0.002302] (4:host@denise)         Coming back to the beginning of the stream for file '/home/doc/simgrid/examples/platforms/g5k.xml'
-> [  0.002725] (1:host@alice)  Have read 110000 from 'c:\Windows\setupact.log' (of size 201663)
-> [  0.002725] (1:host@alice)  Coming back to the beginning of the stream for file 'c:\Windows\setupact.log'
+> [  0.002335] (1:host@alice)  Have read 110000 from '/tmp/include/surf/simgrid_dtd.h' (of size 123583)
+> [  0.002335] (1:host@alice)  Coming back to the beginning of the stream for file '/tmp/include/surf/simgrid_dtd.h'
 > [  0.003374] (2:host@bob)    Have written 100000 in '/home/doc/simgrid/examples/platforms/nancy.xml'. Size now is: 104028
 > [  0.003374] (2:host@bob)    Capacity of the storage element '/home/doc/simgrid/examples/platforms/nancy.xml' is stored on: 37033331 / 536870912000
 > [  0.003374] (2:host@bob)    Coming back to the beginning of the stream for file '/home/doc/simgrid/examples/platforms/nancy.xml'
@@ -40,11 +40,11 @@ $ ${bindir:=.}/io-file ${platfdir}/storage/storage.xml "--log=root.fmt:[%10.6r]%
 > [  0.004135] (4:host@denise)         Have written 110000 in '/home/doc/simgrid/examples/platforms/g5k.xml'. Size now is: 110000
 > [  0.004135] (4:host@denise)         Capacity of the storage element '/home/doc/simgrid/examples/platforms/g5k.xml' is stored on: 13314966 / 536870912000
 > [  0.004135] (4:host@denise)         Close file '/home/doc/simgrid/examples/platforms/g5k.xml'
+> [  0.004168] (1:host@alice)  Have written 110000 in '/tmp/include/surf/simgrid_dtd.h'. Size now is: 110000
+> [  0.004168] (1:host@alice)  Capacity of the storage element '/tmp/include/surf/simgrid_dtd.h' is stored on: 13308411 / 536870912000
+> [  0.004168] (1:host@alice)  Unlink file '/tmp/include/surf/simgrid_dtd.h'
 > [  0.004414] (2:host@bob)    Have read 104028 from '/home/doc/simgrid/examples/platforms/nancy.xml' (of size 104028)
 > [  0.004414] (2:host@bob)    Coming back to the beginning of the stream for file '/home/doc/simgrid/examples/platforms/nancy.xml'
-> [  0.004558] (1:host@alice)  Have written 110000 in 'c:\Windows\setupact.log'. Size now is: 110000
-> [  0.004558] (1:host@alice)  Capacity of the storage element 'c:\Windows\setupact.log' is stored on: 2391545470 / 536870912000
-> [  0.004558] (1:host@alice)  Unlink file 'c:\Windows\setupact.log'
 > [  0.004660] (3:host@carl)   Have read 110000 from '/home/doc/simgrid/examples/platforms/g5k_cabinets.xml' (of size 122645)
 > [  0.004660] (3:host@carl)   Coming back to the beginning of the stream for file '/home/doc/simgrid/examples/platforms/g5k_cabinets.xml'
 > [  0.008081] (2:host@bob)    Have written 110000 in '/home/doc/simgrid/examples/platforms/nancy.xml'. Size now is: 110000
index aa11c7b..d94788e 100644 (file)
@@ -1,8 +1,8 @@
 #!/usr/bin/env tesh
 
-$ ${bindir}/io-raw-storage$EXEEXT ${platfdir}/storage/storage.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir}/io-raw-storage ${platfdir}/storage/storage.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:@denise) *** Storage info on denise ***
-> [  0.000000] (1:@denise) Storage name: Disk2, mount name: c:
+> [  0.000000] (1:@denise) Storage name: Disk2, mount name: /tmp
 > [  0.000000] (1:@denise) Storage name: Disk4, mount name: /home
 > [  0.003333] (1:@denise) Wrote 200000 bytes on 'Disk4'
 > [  0.004333] (1:@denise) Read 200000 bytes on 'Disk4'
index 6864d33..c5668a4 100644 (file)
@@ -3,7 +3,7 @@
 p Testing a MSG application with properties in the XML for Hosts, Links and Processes
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/platform-properties$EXEEXT ${platfdir}/prop.xml ${srcdir:=.}/platform-properties_d.xml  "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/platform-properties ${platfdir}/prop.xml ${srcdir:=.}/platform-properties_d.xml  "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (0:maestro@) There are 7 hosts in the environment
 > [  0.000000] (0:maestro@) Host 'host1' runs at 1000000000 flops/s
 > [  0.000000] (0:maestro@) Host 'host2' runs at 1000000000 flops/s
index 9d8f417..0e727f1 100644 (file)
@@ -9,7 +9,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
-static int execute_load_test(int argc, char* argv[])
+static int execute_load_test(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_host_t host = MSG_host_by_name("MyHost1");
 
index 0cb5cfa..1f8df83 100644 (file)
@@ -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:=.}/plugin-hostload$EXEEXT ${platfdir}/energy_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/plugin-hostload ${platfdir}/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 4bbc66e..d6560d5 100644 (file)
@@ -8,7 +8,7 @@
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_process_daemon, "Messages specific for this msg example");
 
 /* The worker process, working for a while before leaving */
-static int worker_process(int argc, char* argv[])
+static int worker_process(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("Let's do some work (for 10 sec on Boivin).");
   msg_task_t task = MSG_task_create("easy work", 980.95e6, 0, NULL);
@@ -20,7 +20,7 @@ static int worker_process(int argc, char* argv[])
 }
 
 /* The daemon, displaying a message every 3 seconds until all other processes stop */
-static int daemon_process(int argc, char* argv[])
+static int daemon_process(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   MSG_process_daemonize(MSG_process_self());
 
index 226fbdf..1808baa 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing the process daemonization feature of MSG
 
-$ $SG_TEST_EXENV ${bindir:=.}/process-daemon ${platfdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/process-daemon ${platfdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:worker@Boivin) Let's do some work (for 10 sec on Boivin).
 > [  0.000000] (2:daemon@Tremblay) Hello from the infinite loop
 > [  3.000000] (2:daemon@Tremblay) Hello from the infinite loop
index 771bb6e..9e7a4ad 100644 (file)
@@ -8,7 +8,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
-static int slave(int argc, char* argv[])
+static int slave(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("Slave started");
   MSG_process_sleep(3);
@@ -16,7 +16,7 @@ static int slave(int argc, char* argv[])
   return 0;
 }
 
-static int master(int argc, char* argv[])
+static int master(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   msg_process_t process;
 
index 3a33646..19e04ea 100644 (file)
@@ -1,5 +1,5 @@
 
-$ $SG_TEST_EXENV ${bindir:=.}/process-join$EXEEXT ${platfdir}/small_platform.xml
+$ ${bindir:=.}/process-join ${platfdir}/small_platform.xml
 > [Tremblay:master:(1) 0.000000] [msg_test/INFO] Start slave
 > [Tremblay:slave from master:(2) 0.000000] [msg_test/INFO] Slave started
 > [Tremblay:master:(1) 0.000000] [msg_test/INFO] Join the slave (timeout 2)
index f20a32d..fa1dc2d 100644 (file)
@@ -2,7 +2,7 @@
 
 p Testing a MSG_process_kill function
 
-$ $SG_TEST_EXENV ${bindir:=.}/process-kill ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/process-kill ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:killer@Tremblay) Hello!
 > [  0.000000] (2:victim@Fafard) Hello!
 > [  0.000000] (2:victim@Fafard) Suspending myself
index 602e1af..afa3c7f 100644 (file)
@@ -19,6 +19,7 @@ static int my_onexit(XBT_ATTRIB_UNUSED int ignored1, XBT_ATTRIB_UNUSED void* ign
 /* Just sleep until termination */
 static int sleeper(int argc, char* argv[])
 {
+  xbt_assert(argc == 2);
   XBT_INFO("Hello! I go to sleep.");
   MSG_process_on_exit(my_onexit, NULL);
 
index 4d3c96b..8f10283 100644 (file)
@@ -2,7 +2,7 @@
 
 p Test0 Process without time
 
-$ $SG_TEST_EXENV ${bindir:=.}/process-lifetime ${platfdir}/cluster_backbone.xml ${srcdir:=.}/baseline_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/process-lifetime ${platfdir}/cluster_backbone.xml ${srcdir:=.}/baseline_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sleeper@node-0.simgrid.org) Hello! I go to sleep.
 > [ 10.000000] (1:sleeper@node-0.simgrid.org) Done sleeping.
 > [ 10.000000] (1:sleeper@node-0.simgrid.org) Exiting now (done sleeping or got killed).
@@ -10,7 +10,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/process-lifetime ${platfdir}/cluster_backbone.xml
 
 p Test1 Process with start time
 
-$ $SG_TEST_EXENV ${bindir:=.}/process-lifetime ${platfdir}/cluster_backbone.xml ${srcdir:=.}/start_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/process-lifetime ${platfdir}/cluster_backbone.xml ${srcdir:=.}/start_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sleeper@node-0.simgrid.org) Hello! I go to sleep.
 > [  1.000000] (2:sleeper@node-1.simgrid.org) Hello! I go to sleep.
 > [  2.000000] (3:sleeper@node-2.simgrid.org) Hello! I go to sleep.
@@ -34,7 +34,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/process-lifetime ${platfdir}/cluster_backbone.xml
 p Test1 Process with kill time
 
 ! output sort
-$ $SG_TEST_EXENV ${bindir:=.}/process-lifetime ${platfdir}/cluster_backbone.xml ${srcdir:=.}/kill_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/process-lifetime ${platfdir}/cluster_backbone.xml ${srcdir:=.}/kill_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sleeper@node-1.simgrid.org) Hello! I go to sleep.
 > [  0.000000] (2:sleeper@node-2.simgrid.org) Hello! I go to sleep.
 > [  0.000000] (3:sleeper@node-3.simgrid.org) Hello! I go to sleep.
@@ -47,7 +47,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/process-lifetime ${platfdir}/cluster_backbone.xml
 p Test2 Process with start and kill times
 
 ! output sort
-$ $SG_TEST_EXENV ${bindir:=.}/process-lifetime ${platfdir}/cluster_backbone.xml ${srcdir:=.}/start_kill_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/process-lifetime ${platfdir}/cluster_backbone.xml ${srcdir:=.}/start_kill_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:sleeper@node-0.simgrid.org) Hello! I go to sleep.
 > [  1.000000] (2:sleeper@node-1.simgrid.org) Hello! I go to sleep.
 > [  2.000000] (3:sleeper@node-2.simgrid.org) Hello! I go to sleep.
index a53583f..66322d2 100644 (file)
@@ -11,7 +11,7 @@ msg_bar_t barrier;
 static msg_process_t controlled_process = NULL;
 
 /* The Emigrant process will be moved from host to host. */
-static int emigrant(int argc, char* argv[])
+static int emigrant(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("I'll look for a new job on another machine ('Boivin') where the grass is greener.");
   MSG_process_migrate(MSG_process_self(), MSG_host_by_name("Boivin")); /* - First, move to another host by myself */
@@ -35,7 +35,7 @@ static int emigrant(int argc, char* argv[])
 }
 
 /* The policeman check for emigrants and move them back to 'Jacquelin' */
-static int policeman(int argc, char* argv[])
+static int policeman(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("Wait at the checkpoint."); /* - block on the mutex+condition */
   MSG_barrier_wait(barrier);
index 05e95a2..8b1530e 100644 (file)
@@ -3,7 +3,7 @@
 p Testing the migration feature of MSG
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/process-migration ${platfdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/process-migration ${platfdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:emigrant@Jacquelin) I'll look for a new job on another machine ('Boivin') where the grass is greener.
 > [  0.000000] (1:emigrant@Boivin) Yeah, found something to do
 > [  0.000000] (2:policeman@Boivin) Wait at the checkpoint.
index 19c020f..f28573d 100644 (file)
@@ -9,7 +9,7 @@
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_process_suspend, "Messages specific for this msg example");
 
 /* The Lazy guy only wants to sleep, but can be awaken by the dream_master process. */
-static int lazy_guy(int argc, char* argv[])
+static int lazy_guy(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("Nobody's watching me ? Let's go to sleep.");
   MSG_process_suspend(MSG_process_self()); /* - Start by suspending itself */
@@ -33,7 +33,7 @@ static int lazy_guy(int argc, char* argv[])
 }
 
 /* The Dream master: */
-static int dream_master(int argc, char* argv[])
+static int dream_master(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   XBT_INFO("Let's create a lazy guy."); /* - Create a lazy_guy process */
   msg_process_t lazy = MSG_process_create("Lazy", lazy_guy, NULL, MSG_host_self());
index a7f41fc..172df6c 100644 (file)
@@ -3,7 +3,7 @@
 p Testing the suspend/resume feature of MSG
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/process-suspend ${platfdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/process-suspend ${platfdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:dream_master@Boivin) Let's create a lazy guy.
 > [  0.000000] (2:Lazy@Boivin) Nobody's watching me ? Let's go to sleep.
 > [  0.000000] (1:dream_master@Boivin) Let's wait a little bit...
index 458bfed..897e61a 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/process-yield ${platfdir}/small_platform_fatpipe.xml ${srcdir:=.}/process-yield_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/process-yield ${platfdir}/small_platform_fatpipe.xml ${srcdir:=.}/process-yield_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:yielder@Tremblay) I yielded 10 times. Goodbye now!
 > [  0.000000] (2:yielder@Ruby) I yielded 15 times. Goodbye now!
index fcecaa2..bc52e13 100644 (file)
@@ -8,6 +8,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example")
 
 static int test(int argc, char* argv[])
 {
+  xbt_assert(argc == 3);
   double computation_amount = xbt_str_parse_double(argv[1], "Invalid argument: %s");
   double priority           = xbt_str_parse_double(argv[2], "Invalid argument: %s");
 
index 19886bd..8af98f9 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env tesh
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/task-priority$EXEEXT ${platfdir}/small_platform.xml  ${srcdir:=.}/task-priority_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/task-priority ${platfdir}/small_platform.xml  ${srcdir:=.}/task-priority_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:test@Fafard) Hello! Running a task of size 7.6296e+07 with priority 1
 > [  0.000000] (2:test@Fafard) Hello! Running a task of size 7.6296e+07 with priority 2
 > [  1.500000] (2:test@Fafard) Goodbye now!
index e34396b..653845b 100644 (file)
@@ -9,7 +9,7 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
-static int tester(int argc, char* argv[])
+static int tester(int, char**)
 {
   msg_task_t task = MSG_task_create("name", 0, 10, NULL);
   msg_comm_t comm = MSG_task_isend(task, "mailbox");
index a93c8f9..2109376 100644 (file)
@@ -1,6 +1,6 @@
 foreach(x actor actor-autorestart actor-migration
         activity-lifecycle
-        comm-pt2pt
+        comm-pt2pt wait-any-for
         cloud-interrupt-migration cloud-sharing
         concurrent_rw storage_client_server listen_async pid )
   add_executable       (${x}  EXCLUDE_FROM_ALL ${x}/${x}.cpp)
@@ -14,16 +14,12 @@ endforeach()
 ## Add the tests.
 ## Some need to be run with all factories, some need not tesh to run
 foreach(x actor actor-autorestart actor-migration 
-        activity-lifecycle
+        activity-lifecycle wait-any-for
        cloud-interrupt-migration concurrent_rw) # TODO: actor-autorestart is disabled for now
   set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
   ADD_TESH_FACTORIES(tesh-s4u-${x} "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/s4u/${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/teshsuite/s4u/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x}/${x}.tesh)
 endforeach()
 
-# Manually add this file, but the test is broken and must be disabled for now (TODO)
-set(tesh_files    ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/actor-autorestart/actor-autorestart.tesh)
-
-
 foreach(x listen_async pid storage_client_server cloud-sharing)
   set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
   ADD_TESH(tesh-s4u-${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/teshsuite/s4u/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x}/${x}.tesh)
@@ -32,7 +28,21 @@ 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_backbone.xml)
 
-
+# NS-3 specific tests
+if(SIMGRID_HAVE_NS3)
+  foreach(x ns3-simultaneous-send-rcv)
+    add_executable       (${x}  EXCLUDE_FROM_ALL ${x}/${x}.cpp)
+    target_link_libraries(${x}  simgrid)
+    set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
+    add_dependencies(tests ${x})
+    ADD_TESH(tesh-s4u-${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/teshsuite/s4u/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x}/${x}.tesh)
+  endforeach()
+endif()
+
+foreach(x ns3-simultaneous-send-rcv)
+  set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.cpp)
+  set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
+endforeach()
 
 set(teshsuite_src ${teshsuite_src}  PARENT_SCOPE)
 set(tesh_files    ${tesh_files}     PARENT_SCOPE)
index be1e495..97bc3fd 100644 (file)
@@ -59,7 +59,7 @@ static void test_sleep()
     simgrid::s4u::this_actor::sleep_for(5);
     global = true;
   });
-  simgrid::s4u::this_actor::sleep_for(10);
+  simgrid::s4u::this_actor::sleep_for(9);
   xbt_assert(global, "The forked actor did not modify the global after sleeping. Was it killed before?");
 }
 
@@ -133,9 +133,9 @@ static void test_sleep_restart_end()
     all_hosts[1]->turn_off(); // kill the host right at the end of this sleep and of this actor
     sleeper_done = true;
   });
-  simgrid::s4u::this_actor::sleep_for(10);
-  all_hosts[1]->turn_on();
+  simgrid::s4u::this_actor::sleep_for(9);
   xbt_assert(sleeper_done, "Not sure of how the actor survived the shutdown of its host.");
+  all_hosts[1]->turn_on();
 }
 static void test_exec()
 {
@@ -147,7 +147,7 @@ static void test_exec()
     simgrid::s4u::this_actor::execute(500000000);
     global = true;
   });
-  simgrid::s4u::this_actor::sleep_for(10);
+  simgrid::s4u::this_actor::sleep_for(9);
   xbt_assert(global, "The forked actor did not modify the global after executing. Was it killed before?");
 }
 
@@ -226,7 +226,7 @@ static void test_exec_restart_end()
     all_hosts[1]->turn_off();
     all_hosts[1]->turn_on();
   });
-  simgrid::s4u::this_actor::sleep_for(10);
+  simgrid::s4u::this_actor::sleep_for(9);
   xbt_assert(execution_done,
              "Restarted actor was already dead in the scheduling round during which the host_off simcall was issued");
 }
@@ -250,7 +250,7 @@ static void test_comm()
     recv_done = true;
   });
 
-  simgrid::s4u::this_actor::sleep_for(10);
+  simgrid::s4u::this_actor::sleep_for(9);
   xbt_assert(send_done, "Sender killed somehow. It shouldn't");
   xbt_assert(recv_done, "Receiver killed somehow. It shouldn't");
 }
@@ -266,7 +266,6 @@ static void test_comm_dsend_and_quit_put_before_get()
     char* payload = xbt_strdup("toto");
     simgrid::s4u::Mailbox::by_name("mb")->put_init(payload, 1000)->detach();
     dsend_done = true;
-    return;
   });
 
   simgrid::s4u::Actor::create("receiver", all_hosts[2], [&recv_done]() {
@@ -275,7 +274,6 @@ static void test_comm_dsend_and_quit_put_before_get()
     void* payload = simgrid::s4u::Mailbox::by_name("mb")->get();
     xbt_free(payload);
     recv_done = true;
-    return;
   });
 
   // Sleep long enough to let the test ends by itself. 3 + surf_precision should be enough.
@@ -296,7 +294,6 @@ static void test_comm_dsend_and_quit_get_before_put()
     simgrid::s4u::this_actor::sleep_for(2);
     simgrid::s4u::Mailbox::by_name("mb")->put_init(payload, 1000)->detach();
     dsend_done = true;
-    return;
   });
 
   simgrid::s4u::Actor::create("receiver", all_hosts[2], [&recv_done]() {
@@ -304,7 +301,6 @@ static void test_comm_dsend_and_quit_get_before_put()
     void* payload = simgrid::s4u::Mailbox::by_name("mb")->get();
     xbt_free(payload);
     recv_done = true;
-    return;
   });
 
   // Sleep long enough to let the test ends by itself. 3 + surf_precision should be enough.
@@ -358,6 +354,7 @@ static void test_host_off_while_receive()
   bool returned_from_main = false;
   bool in_catch_before_on_exit = false;
   bool in_catch_after_on_exit = false;
+  bool send_done               = false;
 
   simgrid::s4u::ActorPtr receiver = simgrid::s4u::Actor::create(
     "receiver", all_hosts[1], 
@@ -365,10 +362,8 @@ static void test_host_off_while_receive()
        assert_exit(true, 1);
        try {
          simgrid::s4u::Mailbox::by_name("mb")->get();
-       } catch (simgrid::HostFailureException const&) {
-         in_catch_before_on_exit = not in_on_exit;
-         in_catch_after_on_exit = in_on_exit;
        } catch (simgrid::NetworkFailureException const&) {
+         // Shouldn't get in here
          in_catch_before_on_exit = not in_on_exit;
          in_catch_after_on_exit = in_on_exit;
        }
@@ -377,12 +372,18 @@ static void test_host_off_while_receive()
 
   receiver->on_exit([&in_on_exit](bool) { in_on_exit = true; });
 
-  simgrid::s4u::ActorPtr sender = simgrid::s4u::Actor::create(
-    "sender", all_hosts[2], 
-    []() {
-      int data;
+  simgrid::s4u::ActorPtr sender = simgrid::s4u::Actor::create("sender", all_hosts[2], [&send_done]() {
+    assert_exit(false, 1);
+    bool got_exception = false;
+    try {
+      int data = 42;
       simgrid::s4u::Mailbox::by_name("mb")->put(&data, 100000);
-    });
+    } catch (simgrid::NetworkFailureException const&) {
+      got_exception = true;
+    }
+    xbt_assert(got_exception);
+    send_done = true;
+  });
 
   simgrid::s4u::this_actor::sleep_for(1);
   receiver->get_host()->turn_off();
@@ -398,12 +399,138 @@ static void test_host_off_while_receive()
     "Receiver mistakenly went to catch clause (after the on_exit function was called)");
   xbt_assert(not returned_from_main, 
     "Receiver returned from main normally even though its host was killed");
+  xbt_assert(send_done, "Sender killed somehow. It shouldn't");
+  receiver->get_host()->turn_on();
 }
 
+static void test_link_off_helper(double delay)
+{
+  const double start = simgrid::s4u::Engine::get_clock();
+
+  simgrid::s4u::ActorPtr receiver = simgrid::s4u::Actor::create("receiver", all_hosts[1], [&start]() {
+    assert_exit(false, 9);
+    double milestone[5] = {0.5, 3.5, 4.5, 7.5, 9.0};
+    for (int i = 0; i < 5; i++)
+      milestone[i] += start;
+    for (int i = 0; i < 4; i++) {
+      simgrid::s4u::this_actor::sleep_until(milestone[i]);
+      try {
+        XBT_VERB("get(%c)", 'A' + i);
+        simgrid::s4u::Mailbox::by_name("mb")->get();
+        return;
+      } catch (simgrid::NetworkFailureException const&) {
+        XBT_VERB("got expected NetworkFailureException");
+      }
+    }
+    simgrid::s4u::this_actor::sleep_until(milestone[4]);
+  });
+
+  simgrid::s4u::ActorPtr sender = simgrid::s4u::Actor::create("sender", all_hosts[2], [&start]() {
+    assert_exit(false, 9);
+    int data            = 42;
+    double milestone[5] = {1.5, 2.5, 5.5, 6.5, 9.0};
+    for (int i = 0; i < 5; i++)
+      milestone[i] += start;
+    for (int i = 0; i < 2; i++) {
+      simgrid::s4u::this_actor::sleep_until(milestone[i]);
+      XBT_VERB("dsend(%c)", 'A' + i);
+      simgrid::s4u::Mailbox::by_name("mb")->put_init(&data, 100000)->detach();
+    }
+    for (int i = 2; i < 4; i++) {
+      simgrid::s4u::this_actor::sleep_until(milestone[i]);
+      try {
+        XBT_VERB("put(%c)", 'A' + i);
+        simgrid::s4u::Mailbox::by_name("mb")->put(&data, 100000);
+        return;
+      } catch (simgrid::NetworkFailureException const&) {
+        XBT_VERB("got expected NetworkFailureException");
+      }
+    }
+    simgrid::s4u::this_actor::sleep_until(milestone[4]);
+  });
+
+  for (int i = 0; i < 4; i++) {
+    XBT_VERB("##### %d / 4 #####", i + 1);
+    simgrid::s4u::this_actor::sleep_for(delay);
+    XBT_VERB("link off");
+    simgrid::s4u::Link::by_name("link1")->turn_off();
+    simgrid::s4u::this_actor::sleep_for(2.0 - delay);
+    XBT_VERB("link on");
+    simgrid::s4u::Link::by_name("link1")->turn_on();
+  }
+  simgrid::s4u::this_actor::sleep_for(1.5);
+}
+
+static void test_link_off_before_send_recv()
+{
+  XBT_INFO("%s: try to communicate with communicating link turned off before start", __func__);
+  test_link_off_helper(0.0);
+}
+static void test_link_off_between_send_recv()
+{
+  XBT_INFO("%s: try to communicate with communicating link turned off between send and receive", __func__);
+  test_link_off_helper(1.0);
+}
+static void test_link_off_during_transfer()
+{
+  XBT_INFO("%s: try to communicate with communicating link turned off during transfer", __func__);
+  test_link_off_helper(2.0);
+}
+
+static void test_link_off_during_wait_any()
+{
+  simgrid::s4u::ActorPtr receiver = simgrid::s4u::Actor::create("receiver", all_hosts[1], []() {
+    assert_exit(false, 2);
+    bool receiver_got_network_failure_execution = false;
+    bool receiver_got_base_execution = false;
+    int *data;
+    std::vector<simgrid::s4u::CommPtr> pending_comms;
+    simgrid::s4u::CommPtr comm = simgrid::s4u::Mailbox::by_name("mb")->get_async((void**)&data);
+    pending_comms.push_back(comm);
+    try {
+      simgrid::s4u::Comm::wait_any(&pending_comms);
+    } catch (simgrid::NetworkFailureException const&) {
+      XBT_VERB("got expected NetworkFailureException");
+      receiver_got_network_failure_execution = true;
+    } catch (simgrid::Exception const&) {
+      XBT_VERB("got unexpected base Exception");
+      receiver_got_base_execution = true;
+    }
+    xbt_assert(receiver_got_network_failure_execution, "The receiver should have gotten a NetworkFailureException");
+    xbt_assert(not receiver_got_base_execution, "The receiver should not have gotten a base Exception");
+  });
+
+  simgrid::s4u::ActorPtr sender = simgrid::s4u::Actor::create("sender", all_hosts[2], []() {
+    assert_exit(false, 2);
+    int data = 42;
+    bool sender_got_network_failure_execution = false;
+    bool sender_got_base_execution = false;
+    try {
+      simgrid::s4u::Mailbox::by_name("mb")->put(&data, 100000);
+    } catch (simgrid::NetworkFailureException const&) {
+      XBT_VERB("got expected NetworkFailureException");
+      sender_got_network_failure_execution = true;
+    } catch (simgrid::Exception const&) {
+      XBT_VERB("got unexpected base Exception");
+      sender_got_base_execution = true;
+    }
+    xbt_assert(sender_got_network_failure_execution, "The sender should have gotten a NetworkFailureException");
+    xbt_assert(not sender_got_base_execution, "The sender should not have gotten a base Exception");
+  });
+
+  simgrid::s4u::this_actor::sleep_for(2.0);
+  XBT_VERB("link off");
+  simgrid::s4u::Link::by_name("link1")->turn_off();
+  simgrid::s4u::this_actor::sleep_for(2.0);
+  XBT_VERB("link on");
+  simgrid::s4u::Link::by_name("link1")->turn_on();
+}
+
+
 /* We need an extra actor here, so that it can sleep until the end of each test */
 static void main_dispatcher()
 {
-  run_test("sleep", static_cast<std::function<void()>>(test_sleep));
+  run_test("sleep", test_sleep);
   run_test("sleep killed at start", test_sleep_kill_begin);
   run_test("sleep killed in middle", test_sleep_kill_middle);
   /* We cannot kill right at the end of the action because killer actors are always rescheduled to the end of the round
@@ -412,7 +539,7 @@ static void main_dispatcher()
   run_test("sleep restarted in middle", test_sleep_restart_middle);
   // run_test("sleep restarted at end", test_sleep_restart_end);
 
-  run_test("exec", static_cast<std::function<void()>>(test_exec));
+  run_test("exec", test_exec);
   run_test("exec killed at start", test_exec_kill_begin);
   run_test("exec killed in middle", test_exec_kill_middle);
   run_test("exec restarted at start", test_exec_restart_begin);
@@ -424,7 +551,11 @@ static void main_dispatcher()
   run_test("comm dsend and quit (get before put)", test_comm_dsend_and_quit_get_before_put);
   run_test("comm kill sender", test_comm_killsend);
 
-  //run_test("comm recv and kill", test_host_off_while_receive);
+  run_test("comm recv and kill", test_host_off_while_receive);
+  run_test("comm turn link off before send/recv", test_link_off_before_send_recv);
+  run_test("comm turn link off between send/recv", test_link_off_between_send_recv);
+  run_test("comm turn link off during transfer", test_link_off_during_transfer);
+  run_test("comm turn link off during wait_any", test_link_off_during_wait_any);
 }
 
 int main(int argc, char* argv[])
index d26fd37..89189a9 100644 (file)
@@ -10,21 +10,34 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example")
 static void dummy()
 {
   XBT_INFO("I start");
-  try {
     simgrid::s4u::this_actor::sleep_for(200);
     XBT_INFO("I stop");
-  } catch (simgrid::HostFailureException& e) {
-    XBT_DEBUG("The host has died ... as expected. This actor silently stops");
+}
+
+static void dummy_daemon()
+{
+  simgrid::s4u::Actor::self()->daemonize();
+  while (simgrid::s4u::this_actor::get_host()->is_on()) {
+    XBT_INFO("Hello from the infinite loop");
+    simgrid::s4u::this_actor::sleep_for(80.0);
   }
 }
 
 static void autostart()
 {
   simgrid::s4u::Host* host = simgrid::s4u::Host::by_name("Fafard");
-  XBT_INFO("starting a dummy process on %s ", host->get_cname());
 
+  XBT_INFO("starting a dummy process on %s", host->get_cname());
   simgrid::s4u::ActorPtr dummy_actor = simgrid::s4u::Actor::create("Dummy", host, dummy);
+  dummy_actor->on_exit([](bool) { XBT_INFO("On_exit callback set before autorestart"); });
   dummy_actor->set_auto_restart(true);
+  dummy_actor->on_exit([](bool) { XBT_INFO("On_exit callback set after autorestart"); });
+
+  XBT_INFO("starting a daemon process on %s", host->get_cname());
+  simgrid::s4u::ActorPtr daemon_actor = simgrid::s4u::Actor::create("Daemon", host, dummy_daemon);
+  daemon_actor->on_exit([](bool) { XBT_INFO("On_exit callback set before autorestart"); });
+  daemon_actor->set_auto_restart(true);
+  daemon_actor->on_exit([](bool) { XBT_INFO("On_exit callback set after autorestart"); });
 
   simgrid::s4u::this_actor::sleep_for(50);
 
index a835b8c..05e8162 100644 (file)
@@ -1,8 +1,21 @@
 $ ./actor-autorestart ${platfdir}/small_platform.xml
-> [Tremblay:Autostart:(1) 0.000000] [s4u_test/INFO] starting a dummy process on Fafard 
+> [Tremblay:Autostart:(1) 0.000000] [s4u_test/INFO] starting a dummy process on Fafard
 > [Fafard:Dummy:(2) 0.000000] [s4u_test/INFO] I start
+> [Tremblay:Autostart:(1) 0.000000] [s4u_test/INFO] starting a daemon process on Fafard
+> [Fafard:Daemon:(3) 0.000000] [s4u_test/INFO] Hello from the infinite loop
 > [Tremblay:Autostart:(1) 50.000000] [s4u_test/INFO] powering off Fafard
+> [Fafard:Dummy:(2) 50.000000] [s4u_test/INFO] On_exit callback set after autorestart
+> [Fafard:Dummy:(2) 50.000000] [s4u_test/INFO] On_exit callback set before autorestart
+> [Fafard:Daemon:(3) 50.000000] [s4u_test/INFO] On_exit callback set after autorestart
+> [Fafard:Daemon:(3) 50.000000] [s4u_test/INFO] On_exit callback set before autorestart
 > [Tremblay:Autostart:(1) 60.000000] [s4u_test/INFO] powering on Fafard
-> [Fafard:Dummy:(3) 60.000000] [s4u_test/INFO] I start
-> [Fafard:Dummy:(3) 260.000000] [s4u_test/INFO] I stop
+> [Fafard:Dummy:(4) 60.000000] [s4u_test/INFO] I start
+> [Fafard:Daemon:(5) 60.000000] [s4u_test/INFO] Hello from the infinite loop
+> [Fafard:Daemon:(5) 140.000000] [s4u_test/INFO] Hello from the infinite loop
+> [Fafard:Daemon:(5) 220.000000] [s4u_test/INFO] Hello from the infinite loop
+> [Fafard:Dummy:(4) 260.000000] [s4u_test/INFO] I stop
+> [Fafard:Dummy:(4) 260.000000] [s4u_test/INFO] On_exit callback set after autorestart
+> [Fafard:Dummy:(4) 260.000000] [s4u_test/INFO] On_exit callback set before autorestart
+> [Fafard:Daemon:(5) 260.000000] [s4u_test/INFO] On_exit callback set after autorestart
+> [Fafard:Daemon:(5) 260.000000] [s4u_test/INFO] On_exit callback set before autorestart
 > [260.000000] [s4u_test/INFO] Simulation time 260
index c3c3790..2dcf6e5 100644 (file)
@@ -3,7 +3,7 @@
 p Testing the migration feature of S4U
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/actor-migration ${platfdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/actor-migration ${platfdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:emigrant@Jacquelin) I'll look for a new job on another machine ('Boivin') where the grass is greener.
 > [  0.000000] (1:emigrant@Boivin) Yeah, found something to do
 > [  0.000000] (2:policeman@Boivin) Wait at the checkpoint.
index 6c70080..01558b2 100644 (file)
@@ -12,7 +12,7 @@ static void worker()
   simgrid::s4u::this_actor::sleep_for(.5);
   XBT_INFO("Worker started (PID:%ld, PPID:%ld)", simgrid::s4u::this_actor::get_pid(),
            simgrid::s4u::this_actor::get_ppid());
-  while (1) {
+  while (simgrid::s4u::this_actor::get_host()->is_on()) {
     simgrid::s4u::this_actor::yield();
     XBT_INFO("Plop i am not suspended");
     simgrid::s4u::this_actor::sleep_for(1);
index fe95a5b..235dfcf 100644 (file)
@@ -1,4 +1,4 @@
-$ $SG_TEST_EXENV ${bindir:=.}/cloud-interrupt-migration ${platfdir}/small_platform.xml --log=no_loc "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/cloud-interrupt-migration ${platfdir}/small_platform.xml --log=no_loc "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:master_@Fafard) Start the migration of VM0 from Fafard to Tremblay
 > [  2.000000] (1:master_@Fafard) Wait! change my mind, shutdown VM0. This ends the migration
 > [ 10.000000] (1:master_@Fafard) Start again the migration of VM0 from Fafard to Tremblay
index 03294d0..b9c1d9f 100644 (file)
@@ -12,7 +12,7 @@
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this msg example");
 
 const int FAIL_ON_ERROR = 0;
-const int flop_amount = 100000000;
+const int flop_amount   = 100000000; // 100Mf, so that computing this on a 1Gf core takes exactly 0.1s
 int failed_test = 0;
 
 double energy = 0;
index 756efd7..07838b5 100644 (file)
@@ -40,7 +40,6 @@ static void usage(const char* binaryName, const char* defaultSend, const char* d
                        "Example 1: %s examples/platforms/cluster_backbone.xml rRiIdD rrrrrr # testing all send functions\n"
                        "Default specs: %s %s (all possible pairs)\n",
                binaryName, binaryName, defaultSend, defaultRecv);
-  exit(1);
 }
 
 static void sender(std::vector<std::string> args)
@@ -165,8 +164,10 @@ int main(int argc, char* argv[])
   std::vector<std::string> argRecv{specRecv.c_str()};
 
   simgrid::s4u::Engine e(&argc, argv);
-  if (argc < 2)
+  if (argc < 2) {
     usage(argv[0], specSend.c_str(), specRecv.c_str());
+    return 1;
+  }
 
   e.load_platform(argv[1]);
 
index 9cb7c06..1261137 100644 (file)
@@ -9,22 +9,22 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u test");
 
 static void host()
 {
-  simgrid::s4u::Storage* storage = simgrid::s4u::Storage::by_name("Disk1");
-  int id                         = simgrid::s4u::this_actor::get_pid();
+  simgrid::s4u::Disk* disk = simgrid::s4u::this_actor::get_host()->get_disks().front(); // Disk1
+  int id                   = simgrid::s4u::this_actor::get_pid();
   XBT_INFO("process %d is writing!", id);
-  storage->write(3000000);
+  disk->write(4000000);
   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);
-  storage->write(3000000);
+  disk->write(4000000);
   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);
-  storage->read(3000000);
+  disk->read(4000000);
   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);
-  storage->read(3000000);
+  disk->read(4000000);
 }
 
 int main(int argc, char** argv)
index f12ea29..89e43ce 100644 (file)
@@ -1,4 +1,4 @@
-$ ./concurrent_rw$EXEEXT ${platfdir}/storage/storage.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+$ ./concurrent_rw ${platfdir}/hosts_with_disks.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
 > [  0.000000] (host@bob) process 1 is writing!
 > [  0.000000] (host@bob) process 2 is writing!
 > [  0.000000] (host@bob) process 3 is writing!
@@ -24,14 +24,14 @@ $ ./concurrent_rw$EXEEXT ${platfdir}/storage/storage.xml "--log=root.fmt:[%10.6r
 > [  6.600000] (host@bob) process 3 is reading!
 > [  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!
-> [  8.750000] (host@bob) process 2 is reading again!
-> [  9.750000] (host@bob) process 3 is reading again!
-> [ 10.750000] (host@bob) process 4 is reading again!
-> [ 11.750000] (host@bob) process 5 is reading again!
-> [ 11.780000] (maestro@) Simulation time 11.78
+> [  6.800000] (host@bob) process 1 goes to sleep for 1 seconds
+> [  6.800000] (host@bob) process 2 goes to sleep for 2 seconds
+> [  6.800000] (host@bob) process 3 goes to sleep for 3 seconds
+> [  6.800000] (host@bob) process 4 goes to sleep for 4 seconds
+> [  6.800000] (host@bob) process 5 goes to sleep for 5 seconds
+> [  7.800000] (host@bob) process 1 is reading again!
+> [  8.800000] (host@bob) process 2 is reading again!
+> [  9.800000] (host@bob) process 3 is reading again!
+> [ 10.800000] (host@bob) process 4 is reading again!
+> [ 11.800000] (host@bob) process 5 is reading again!
+> [ 11.840000] (maestro@) Simulation time 11.84
diff --git a/teshsuite/s4u/ns3-simultaneous-send-rcv/ns3-simultaneous-send-rcv.cpp b/teshsuite/s4u/ns3-simultaneous-send-rcv/ns3-simultaneous-send-rcv.cpp
new file mode 100644 (file)
index 0000000..b7a4de5
--- /dev/null
@@ -0,0 +1,60 @@
+/* Copyright (c) 2019. The SimGrid Team. All rights reserved.          */
+
+/* This program 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 test checks that ns-3 behave correctly when multiple flows finish   */
+/* at the exact same time. Given the amount of simultaneous senders, it     */
+/* also serves as a (small) crash test for ns-3.                            */
+
+#include "simgrid/s4u.hpp"
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u tests");
+
+const int payload            = 1000;
+const int nb_message_to_send = 5;
+const double sleep_time      = 5;
+const int nb_sender          = 100;
+
+int nb_messages_sent = 0;
+
+simgrid::s4u::Mailbox* box;
+
+static void test_send(){
+  for (int nb_message = 0; nb_message < nb_message_to_send; nb_message++) {
+    nb_messages_sent++;
+    XBT_VERB("start sending test #%i", nb_messages_sent);
+    box->put(new int(nb_messages_sent), payload);
+    XBT_VERB("done sending test #%i", nb_messages_sent);
+    simgrid::s4u::this_actor::sleep_until(sleep_time * (nb_message + 1));
+  }
+}
+
+static void test_receive(){
+  for (int nb_message = 0; nb_message < nb_message_to_send * nb_sender; nb_message++) {
+    XBT_VERB("waiting for messages");
+    int id = *(int*)(box->get());
+    XBT_VERB("received messages #%i", id);
+  }
+  XBT_INFO("Done receiving from %d senders, each of them sending %d messages", nb_sender, nb_message_to_send);
+}
+
+
+int main(int argc, char *argv[])
+{
+  simgrid::s4u::Engine e(&argc, argv);
+  e.load_platform(argv[1]);
+
+  simgrid::s4u::ActorPtr receiver = simgrid::s4u::Actor::create("receiver", e.get_all_hosts()[0], test_receive);
+  for (int i = 0; i < nb_sender; i++)
+    simgrid::s4u::Actor::create("sender_" + std::to_string(i), e.get_all_hosts()[i % (e.get_host_count() - 1) + 1],
+                                test_send);
+
+  box = simgrid::s4u::Mailbox::by_name("test");
+  box->set_receiver(receiver);
+
+  e.run();
+
+  return 0;
+}
diff --git a/teshsuite/s4u/ns3-simultaneous-send-rcv/ns3-simultaneous-send-rcv.tesh b/teshsuite/s4u/ns3-simultaneous-send-rcv/ns3-simultaneous-send-rcv.tesh
new file mode 100644 (file)
index 0000000..61b0e9c
--- /dev/null
@@ -0,0 +1,6 @@
+p In the ns-3 tests, the timings are not shown because the exact values may vary with your ns-3 version.
+p We just want to check that the ns-3 bindings of SimGrid are working correctly, we don't want to thoroughly test ns-3.
+
+$ ./ns3-simultaneous-send-rcv ${platfdir}/ns3-big-cluster.xml --cfg=network/model:ns-3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
+> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'ns-3'
+> [c-01.rennes:receiver(1)] [s4u_test/INFO] Done receiving from 100 senders, each of them sending 5 messages
index 7e2e985..4803505 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(storage, "Messages specific for this simulation");
 
-static void display_storage_properties(simgrid::s4u::Storage* storage)
+static void display_disk_properties(simgrid::s4u::Disk* disk)
 {
-  std::unordered_map<std::string, std::string>* props = storage->get_properties();
+  const std::unordered_map<std::string, std::string>* props = disk->get_properties();
   if (not props->empty()) {
-    XBT_INFO("\tProperties of mounted storage: %s", storage->get_cname());
+    XBT_INFO("  Properties of disk: %s", disk->get_cname());
 
     for (auto const& elm : *props) {
       XBT_INFO("    %s->%s", elm.first.c_str(), elm.second.c_str());
     }
   } else {
-    XBT_INFO("\tNo property attached.");
+    XBT_INFO("  No property attached.");
   }
 }
 
@@ -53,84 +53,77 @@ static void hsm_put(const std::string& remote_host, const std::string& src, cons
   XBT_INFO("%s sends %llu to %s", simgrid::s4u::this_actor::get_cname(), 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::Mailbox* mailbox   = simgrid::s4u::Mailbox::by_name(remote_host);
-  mailbox->put(payload, static_cast<double>(read_size));
+  mailbox->put(payload, read_size);
   simgrid::s4u::this_actor::sleep_for(.4);
 }
 
-static void display_storage_content(simgrid::s4u::Storage* storage)
+static void display_disk_content(simgrid::s4u::Disk* disk)
 {
-  XBT_INFO("Print the content of the storage element: %s", storage->get_cname());
-  std::map<std::string, sg_size_t>* content = storage->extension<simgrid::s4u::FileSystemStorageExt>()->get_content();
+  XBT_INFO("*** Dump a disk ***");
+  XBT_INFO("Print the content of the disk: %s", disk->get_cname());
+  std::map<std::string, sg_size_t>* content = disk->extension<simgrid::s4u::FileSystemDiskExt>()->get_content();
   if (not content->empty()) {
     for (auto const& entry : *content)
-      XBT_INFO("\t%s size: %llu bytes", entry.first.c_str(), entry.second);
+      XBT_INFO("  %s size: %llu bytes", entry.first.c_str(), entry.second);
   } else {
-    XBT_INFO("\tNo content.");
+    XBT_INFO("  No content.");
   }
 }
 
-static void dump_storage_by_name(const std::string& name)
+static void get_set_disk_data(simgrid::s4u::Disk* disk)
 {
-  XBT_INFO("*** Dump a storage element ***");
-  simgrid::s4u::Storage* storage = simgrid::s4u::Storage::by_name(name);
-  display_storage_content(storage);
-}
-
-static void get_set_storage_data(const std::string& storage_name)
-{
-  XBT_INFO("*** GET/SET DATA for storage element: %s ***", storage_name.c_str());
-  simgrid::s4u::Storage* storage = simgrid::s4u::Storage::by_name(storage_name);
+  XBT_INFO("*** GET/SET DATA for disk: %s ***", disk->get_cname());
 
-  std::string* data = static_cast<std::string*>(storage->get_data());
+  std::string* data = static_cast<std::string*>(disk->get_data());
   XBT_INFO("Get data: '%s'", data ? data->c_str() : "No User Data");
-  storage->set_data(new std::string("Some data"));
-  data = static_cast<std::string*>(storage->get_data());
-  XBT_INFO("\tSet and get data: '%s'", data->c_str());
+  disk->set_data(new std::string("Some data"));
+  data = static_cast<std::string*>(disk->get_data());
+  XBT_INFO("  Set and get data: '%s'", data->c_str());
   delete data;
 }
 
-static void dump_platform_storages()
+static void dump_platform_disks()
 {
-  std::vector<simgrid::s4u::Storage*> storages = simgrid::s4u::Engine::get_instance()->get_all_storages();
 
-  for (auto const& s : storages) {
-    XBT_INFO("Storage %s is attached to %s", s->get_cname(), s->get_host()->get_cname());
-    s->set_property("other usage", "gpfs");
-  }
+  for (auto const& h : simgrid::s4u::Engine::get_instance()->get_all_hosts())
+    for (auto const& d : h->get_disks()) {
+      if (h == d->get_host())
+        XBT_INFO("%s is attached to %s", d->get_cname(), d->get_host()->get_cname());
+      d->set_property("other usage", "gpfs");
+    }
 }
 
-static void storage_info(simgrid::s4u::Host* host)
+static void disk_info(simgrid::s4u::Host* host)
 {
-  XBT_INFO("*** Storage info on %s ***", host->get_cname());
+  XBT_INFO("*** Disk info on %s ***", host->get_cname());
 
-  for (auto const& elm : host->get_mounted_storages()) {
-    const std::string& mount_name  = elm.first;
-    simgrid::s4u::Storage* storage = elm.second;
-    XBT_INFO("\tStorage name: %s, mount name: %s", storage->get_cname(), mount_name.c_str());
+  for (auto const& disk : host->get_disks()) {
+    const char* mount_name = sg_disk_get_mount_point(disk);
+    XBT_INFO("  Disk name: %s, mount name: %s", disk->get_cname(), mount_name);
 
-    XBT_INFO("\t\tFree size: %llu bytes", sg_storage_get_size_free(storage));
-    XBT_INFO("\t\tUsed size: %llu bytes", sg_storage_get_size_used(storage));
+    XBT_INFO("    Free size: %llu bytes", sg_disk_get_size_free(disk));
+    XBT_INFO("    Used size: %llu bytes", sg_disk_get_size_used(disk));
 
-    display_storage_properties(storage);
-    dump_storage_by_name(storage->get_cname());
+    display_disk_properties(disk);
+    display_disk_content(disk);
   }
 }
 
 static void client()
 {
-  hsm_put("alice", "/home/doc/simgrid/examples/msg/icomms/small_platform.xml", "c:\\Windows\\toto.cxx");
-  hsm_put("alice", "/home/doc/simgrid/examples/msg/parallel_task/test_ptask_deployment.xml", "c:\\Windows\\titi.xml");
-  hsm_put("alice", "/home/doc/simgrid/examples/msg/alias/masterslave_forwarder_with_alias.c", "c:\\Windows\\tata.c");
+  hsm_put("alice", "/scratch/doc/simgrid/examples/msg/icomms/small_platform.xml", "/tmp/toto.xml");
+  hsm_put("alice", "/scratch/doc/simgrid/examples/msg/parallel_task/test_ptask_deployment.xml", "/tmp/titi.xml");
+  hsm_put("alice", "/scratch/doc/simgrid/examples/msg/alias/masterslave_forwarder_with_alias.c", "/tmp/tata.c");
 
   simgrid::s4u::Mailbox* mailbox = simgrid::s4u::Mailbox::by_name("alice");
   mailbox->put(new std::string("finalize"), 0);
 
-  get_set_storage_data("Disk1");
+  get_set_disk_data(simgrid::s4u::Host::current()->get_disks().front()); // Disk1
 }
 
 static void server()
 {
-  storage_info(simgrid::s4u::this_actor::get_host());
+  disk_info(simgrid::s4u::this_actor::get_host());
   simgrid::s4u::Mailbox* mailbox = simgrid::s4u::Mailbox::by_name(simgrid::s4u::this_actor::get_host()->get_cname());
 
   XBT_INFO("Server waiting for transfers ...");
@@ -148,8 +141,8 @@ static void server()
     }
   }
 
-  storage_info(simgrid::s4u::this_actor::get_host());
-  dump_platform_storages();
+  disk_info(simgrid::s4u::this_actor::get_host());
+  dump_platform_disks();
 }
 
 int main(int argc, char* argv[])
index 8cc8816..b4d2841 100644 (file)
-$ ./storage_client_server$EXEEXT ${platfdir}/storage/storage.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
-> [  0.000000] (server@alice) *** Storage info on alice ***
-> [  0.000000] (server@alice)  Storage name: Disk2, mount name: c:
-> [  0.000000] (server@alice)          Free size: 534479374867 bytes
-> [  0.000000] (server@alice)          Used size: 2391537133 bytes
-> [  0.000000] (server@alice)  No property attached.
-> [  0.000000] (server@alice) *** Dump a storage element ***
-> [  0.000000] (server@alice) Print the content of the storage element: Disk2
-> [  0.000000] (server@alice)  \Windows\CoreSingleLanguage.xml size: 31497 bytes
-> [  0.000000] (server@alice)  \Windows\DPINST.LOG size: 18944 bytes
-> [  0.000000] (server@alice)  \Windows\DirectX.log size: 10486 bytes
-> [  0.000000] (server@alice)  \Windows\DtcInstall.log size: 1955 bytes
-> [  0.000000] (server@alice)  \Windows\HelpPane.exe size: 883712 bytes
-> [  0.000000] (server@alice)  \Windows\MEMORY.DMP size: 2384027342 bytes
-> [  0.000000] (server@alice)  \Windows\PFRO.log size: 6770 bytes
-> [  0.000000] (server@alice)  \Windows\Professional.xml size: 31881 bytes
-> [  0.000000] (server@alice)  \Windows\Starter.xml size: 31537 bytes
-> [  0.000000] (server@alice)  \Windows\WLXPGSS.SCR size: 322048 bytes
-> [  0.000000] (server@alice)  \Windows\WMSysPr9.prx size: 316640 bytes
-> [  0.000000] (server@alice)  \Windows\WindowsUpdate.log size: 1518934 bytes
-> [  0.000000] (server@alice)  \Windows\_isusr32.dll size: 180320 bytes
-> [  0.000000] (server@alice)  \Windows\avastSS.scr size: 41664 bytes
-> [  0.000000] (server@alice)  \Windows\bfsvc.exe size: 75264 bytes
-> [  0.000000] (server@alice)  \Windows\bootstat.dat size: 67584 bytes
-> [  0.000000] (server@alice)  \Windows\csup.txt size: 12 bytes
-> [  0.000000] (server@alice)  \Windows\dchcfg64.exe size: 335464 bytes
-> [  0.000000] (server@alice)  \Windows\dcmdev64.exe size: 93288 bytes
-> [  0.000000] (server@alice)  \Windows\explorer.exe size: 2380944 bytes
-> [  0.000000] (server@alice)  \Windows\font1.sii size: 4907 bytes
-> [  0.000000] (server@alice)  \Windows\font2.sii size: 8698 bytes
-> [  0.000000] (server@alice)  \Windows\hapint.exe size: 382056 bytes
-> [  0.000000] (server@alice)  \Windows\hh.exe size: 17408 bytes
-> [  0.000000] (server@alice)  \Windows\mib.bin size: 43131 bytes
-> [  0.000000] (server@alice)  \Windows\notepad.exe size: 243712 bytes
-> [  0.000000] (server@alice)  \Windows\regedit.exe size: 159232 bytes
-> [  0.000000] (server@alice)  \Windows\setupact.log size: 101663 bytes
-> [  0.000000] (server@alice)  \Windows\setuperr.log size: 0 bytes
-> [  0.000000] (server@alice)  \Windows\splwow64.exe size: 126464 bytes
-> [  0.000000] (server@alice)  \Windows\system.ini size: 219 bytes
-> [  0.000000] (server@alice)  \Windows\twain_32.dll size: 50176 bytes
-> [  0.000000] (server@alice)  \Windows\vmgcoinstall.log size: 1585 bytes
-> [  0.000000] (server@alice)  \Windows\win.ini size: 92 bytes
-> [  0.000000] (server@alice)  \Windows\winhlp32.exe size: 10752 bytes
-> [  0.000000] (server@alice)  \Windows\write.exe size: 10752 bytes
+$ ./storage_client_server ${platfdir}/hosts_with_disks.xml "--log=root.fmt:[%10.6r]%e(%P@%h)%e%m%n"
+> [  0.000000] (server@alice) *** Disk info on alice ***
+> [  0.000000] (server@alice)   Disk name: Disk1, mount name: /
+> [  0.000000] (server@alice)     Free size: 536857690006 bytes
+> [  0.000000] (server@alice)     Used size: 13221994 bytes
+> [  0.000000] (server@alice)   Properties of disk: Disk1
+> [  0.000000] (server@alice)     content->storage/content/small_content.txt
+> [  0.000000] (server@alice) *** Dump a disk ***
+> [  0.000000] (server@alice) Print the content of the disk: Disk1
+> [  0.000000] (server@alice)   /bin/smpicc size: 918 bytes
+> [  0.000000] (server@alice)   /bin/tesh size: 356434 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/examples/msg/README size: 4805 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/examples/msg/alias/masterslave_forwarder_with_alias.c size: 6217 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/examples/msg/icomms/small_platform.xml size: 972 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/examples/msg/parallel_task/test_ptask_deployment.xml size: 654 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/examples/msg/trace/test9.xml size: 598 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/examples/platforms/g5k.xml size: 17028 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/examples/smpi/NAS/DT/README size: 999 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/examples/smpi/NAS/EP/README size: 347 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/examples/smpi/NAS/EP/randlc.c size: 3300 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/examples/smpi/NAS/FT/README size: 276 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/examples/smpi/NAS/MG/README size: 5465 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/examples/smpi/NAS/MPI_dummy/README size: 2406 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/examples/smpi/NAS/README size: 1857 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/examples/smpi/NAS/SP/README size: 926 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/examples/smpi/NAS/common/randdp.c size: 1441 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/examples/smpi/NAS/sys/README size: 1461 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/examples/smpi/mc_bugged2.c size: 1387 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/examples/xbt/sem_basic.c size: 1970 bytes
+> [  0.000000] (server@alice)   /doc/simgrid/html/group__XBT__str.html size: 36192 bytes
+> [  0.000000] (server@alice)   /include/instr/instr.h size: 5750 bytes
+> [  0.000000] (server@alice)   /include/mc/modelchecker.h size: 96 bytes
+> [  0.000000] (server@alice)   /include/msg/datatypes.h size: 4635 bytes
+> [  0.000000] (server@alice)   /include/simdag/simdag.h size: 10325 bytes
+> [  0.000000] (server@alice)   /include/simix/simix.h size: 13003 bytes
+> [  0.000000] (server@alice)   /include/smpi/mpif.h size: 4826 bytes
+> [  0.000000] (server@alice)   /include/surf/simgrid_dtd.h size: 23583 bytes
+> [  0.000000] (server@alice)   /include/xbt/fifo.h size: 3626 bytes
+> [  0.000000] (server@alice)   /lib/libsimgrid.so.3.6.2 size: 12710497 bytes
 > [  0.000000] (server@alice) Server waiting for transfers ...
-> [  0.000010] (client@bob) client has read 972 on /home/doc/simgrid/examples/msg/icomms/small_platform.xml
+> [  0.000010] (client@bob) client has read 972 on /scratch/doc/simgrid/examples/msg/icomms/small_platform.xml
 > [  0.000010] (client@bob) client sends 972 to alice
-> [  0.001986] (server@alice) 972 bytes on 972 bytes have been written by server on /sd1
-> [  0.401976] (client@bob) client has read 654 on /home/doc/simgrid/examples/msg/parallel_task/test_ptask_deployment.xml
+> [  0.001982] (server@alice) 972 bytes on 972 bytes have been written by server on /sd1
+> [  0.401976] (client@bob) client has read 654 on /scratch/doc/simgrid/examples/msg/parallel_task/test_ptask_deployment.xml
 > [  0.401976] (client@bob) client sends 654 to alice
-> [  0.403944] (server@alice) 654 bytes on 654 bytes have been written by server on /sd1
-> [  0.803996] (client@bob) client has read 6217 on /home/doc/simgrid/examples/msg/alias/masterslave_forwarder_with_alias.c
+> [  0.403942] (server@alice) 654 bytes on 654 bytes have been written by server on /sd1
+> [  0.803996] (client@bob) client has read 6217 on /scratch/doc/simgrid/examples/msg/alias/masterslave_forwarder_with_alias.c
 > [  0.803996] (client@bob) client sends 6217 to alice
-> [  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 ***
+> [  0.806079] (server@alice) 6217 bytes on 6217 bytes have been written by server on /sd1
+> [  1.207952] (server@alice) *** Disk info on alice ***
+> [  1.207952] (server@alice)   Disk name: Disk1, mount name: /
+> [  1.207952] (server@alice)     Free size: 536857682163 bytes
+> [  1.207952] (server@alice)     Used size: 13229837 bytes
+> [  1.207952] (server@alice)   Properties of disk: Disk1
+> [  1.207952] (server@alice)     content->storage/content/small_content.txt
+> [  1.207952] (server@alice) *** Dump a disk ***
+> [  1.207952] (server@alice) Print the content of the disk: Disk1
+> [  1.207952] (server@alice)   /bin/smpicc size: 918 bytes
+> [  1.207952] (server@alice)   /bin/tesh size: 356434 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/examples/msg/README size: 4805 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/examples/msg/alias/masterslave_forwarder_with_alias.c size: 6217 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/examples/msg/icomms/small_platform.xml size: 972 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/examples/msg/parallel_task/test_ptask_deployment.xml size: 654 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/examples/msg/trace/test9.xml size: 598 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/examples/platforms/g5k.xml size: 17028 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/examples/smpi/NAS/DT/README size: 999 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/examples/smpi/NAS/EP/README size: 347 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/examples/smpi/NAS/EP/randlc.c size: 3300 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/examples/smpi/NAS/FT/README size: 276 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/examples/smpi/NAS/MG/README size: 5465 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/examples/smpi/NAS/MPI_dummy/README size: 2406 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/examples/smpi/NAS/README size: 1857 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/examples/smpi/NAS/SP/README size: 926 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/examples/smpi/NAS/common/randdp.c size: 1441 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/examples/smpi/NAS/sys/README size: 1461 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/examples/smpi/mc_bugged2.c size: 1387 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/examples/xbt/sem_basic.c size: 1970 bytes
+> [  1.207952] (server@alice)   /doc/simgrid/html/group__XBT__str.html size: 36192 bytes
+> [  1.207952] (server@alice)   /include/instr/instr.h size: 5750 bytes
+> [  1.207952] (server@alice)   /include/mc/modelchecker.h size: 96 bytes
+> [  1.207952] (server@alice)   /include/msg/datatypes.h size: 4635 bytes
+> [  1.207952] (server@alice)   /include/simdag/simdag.h size: 10325 bytes
+> [  1.207952] (server@alice)   /include/simix/simix.h size: 13003 bytes
+> [  1.207952] (server@alice)   /include/smpi/mpif.h size: 4826 bytes
+> [  1.207952] (server@alice)   /include/surf/simgrid_dtd.h size: 23583 bytes
+> [  1.207952] (server@alice)   /include/xbt/fifo.h size: 3626 bytes
+> [  1.207952] (server@alice)   /lib/libsimgrid.so.3.6.2 size: 12710497 bytes
+> [  1.207952] (server@alice)   /tmp/tata.c size: 6217 bytes
+> [  1.207952] (server@alice)   /tmp/titi.xml size: 654 bytes
+> [  1.207952] (server@alice)   /tmp/toto.xml size: 972 bytes
+> [  1.207952] (client@bob) *** GET/SET DATA for disk: Disk1 ***
 > [  1.207952] (client@bob) Get data: 'No User Data'
-> [  1.207952] (client@bob)    Set and get data: 'Some data'
-> [  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
-> [  1.207952] (server@alice)  \Windows\CoreSingleLanguage.xml size: 31497 bytes
-> [  1.207952] (server@alice)  \Windows\DPINST.LOG size: 18944 bytes
-> [  1.207952] (server@alice)  \Windows\DirectX.log size: 10486 bytes
-> [  1.207952] (server@alice)  \Windows\DtcInstall.log size: 1955 bytes
-> [  1.207952] (server@alice)  \Windows\HelpPane.exe size: 883712 bytes
-> [  1.207952] (server@alice)  \Windows\MEMORY.DMP size: 2384027342 bytes
-> [  1.207952] (server@alice)  \Windows\PFRO.log size: 6770 bytes
-> [  1.207952] (server@alice)  \Windows\Professional.xml size: 31881 bytes
-> [  1.207952] (server@alice)  \Windows\Starter.xml size: 31537 bytes
-> [  1.207952] (server@alice)  \Windows\WLXPGSS.SCR size: 322048 bytes
-> [  1.207952] (server@alice)  \Windows\WMSysPr9.prx size: 316640 bytes
-> [  1.207952] (server@alice)  \Windows\WindowsUpdate.log size: 1518934 bytes
-> [  1.207952] (server@alice)  \Windows\_isusr32.dll size: 180320 bytes
-> [  1.207952] (server@alice)  \Windows\avastSS.scr size: 41664 bytes
-> [  1.207952] (server@alice)  \Windows\bfsvc.exe size: 75264 bytes
-> [  1.207952] (server@alice)  \Windows\bootstat.dat size: 67584 bytes
-> [  1.207952] (server@alice)  \Windows\csup.txt size: 12 bytes
-> [  1.207952] (server@alice)  \Windows\dchcfg64.exe size: 335464 bytes
-> [  1.207952] (server@alice)  \Windows\dcmdev64.exe size: 93288 bytes
-> [  1.207952] (server@alice)  \Windows\explorer.exe size: 2380944 bytes
-> [  1.207952] (server@alice)  \Windows\font1.sii size: 4907 bytes
-> [  1.207952] (server@alice)  \Windows\font2.sii size: 8698 bytes
-> [  1.207952] (server@alice)  \Windows\hapint.exe size: 382056 bytes
-> [  1.207952] (server@alice)  \Windows\hh.exe size: 17408 bytes
-> [  1.207952] (server@alice)  \Windows\mib.bin size: 43131 bytes
-> [  1.207952] (server@alice)  \Windows\notepad.exe size: 243712 bytes
-> [  1.207952] (server@alice)  \Windows\regedit.exe size: 159232 bytes
-> [  1.207952] (server@alice)  \Windows\setupact.log size: 101663 bytes
-> [  1.207952] (server@alice)  \Windows\setuperr.log size: 0 bytes
-> [  1.207952] (server@alice)  \Windows\splwow64.exe size: 126464 bytes
-> [  1.207952] (server@alice)  \Windows\system.ini size: 219 bytes
-> [  1.207952] (server@alice)  \Windows\tata.c size: 6217 bytes
-> [  1.207952] (server@alice)  \Windows\titi.xml size: 654 bytes
-> [  1.207952] (server@alice)  \Windows\toto.cxx size: 972 bytes
-> [  1.207952] (server@alice)  \Windows\twain_32.dll size: 50176 bytes
-> [  1.207952] (server@alice)  \Windows\vmgcoinstall.log size: 1585 bytes
-> [  1.207952] (server@alice)  \Windows\win.ini size: 92 bytes
-> [  1.207952] (server@alice)  \Windows\winhlp32.exe size: 10752 bytes
-> [  1.207952] (server@alice)  \Windows\write.exe size: 10752 bytes
-> [  1.207952] (server@alice) Storage Disk1 is attached to bob
-> [  1.207952] (server@alice) Storage Disk2 is attached to alice
-> [  1.207952] (server@alice) Storage Disk3 is attached to carl
-> [  1.207952] (server@alice) Storage Disk4 is attached to denise
+> [  1.207952] (client@bob)   Set and get data: 'Some data'
+> [  1.207952] (server@alice) Disk1 is attached to alice
+> [  1.207952] (server@alice) Disk1 is attached to bob
+> [  1.207952] (server@alice) Disk2 is attached to bob
 > [  1.207952] (maestro@) Simulated time: 1.20795
diff --git a/teshsuite/s4u/wait-any-for/wait-any-for.cpp b/teshsuite/s4u/wait-any-for/wait-any-for.cpp
new file mode 100644 (file)
index 0000000..6558a47
--- /dev/null
@@ -0,0 +1,49 @@
+#include <cstdlib>
+#include <iostream>
+#include <string>
+#include <simgrid/s4u.hpp>
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(meh, "meh");
+
+static void worker()
+{
+  auto mbox = simgrid::s4u::Mailbox::by_name("meh");
+  int input_data[2] = {42, 51};
+
+  XBT_INFO("Sending and receiving %d and %d asynchronously", input_data[0], input_data[1]);
+
+  auto put1 = mbox->put_async(input_data, 1000*1000*500);
+  auto put2 = mbox->put_async(input_data + 1, 1000*1000*1000);
+
+  int * out1;
+  auto get1 = mbox->get_async((void**)&out1);
+
+  int * out2;
+  auto get2 = mbox->get_async((void**)&out2);
+
+  XBT_INFO("All comms have started");
+  std::vector<simgrid::s4u::CommPtr> comms = {put1, put2, get1, get2};
+
+  while (!comms.empty()) {
+    int index = simgrid::s4u::Comm::wait_any_for(&comms, 0.5);
+    if (index < 0)
+      XBT_INFO("wait_any_for: Timeout reached");
+    else {
+      XBT_INFO("wait_any_for: A comm finished (index=%d, #comms=%zu)", index, comms.size());
+      comms.erase(comms.begin() + index);
+    }
+  }
+
+  XBT_INFO("All comms have finished");
+  XBT_INFO("Got %d and %d", *out1, *out2);
+}
+
+int main(int argc, char* argv[])
+
+{
+  simgrid::s4u::Engine e(&argc, argv);
+  e.load_platform(argv[1]);
+  simgrid::s4u::Actor::create("worker", simgrid::s4u::Host::by_name("Tremblay"), worker);
+  e.run();
+  return 0;
+}
diff --git a/teshsuite/s4u/wait-any-for/wait-any-for.tesh b/teshsuite/s4u/wait-any-for/wait-any-for.tesh
new file mode 100644 (file)
index 0000000..a28b790
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/env tesh
+
+p Testing the wait_any_for feature of S4U
+
+! output sort 19
+$ ${bindir:=.}/wait-any-for ${platfdir:=.}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+> [  0.000000] (1:worker@Tremblay) Sending and receiving 42 and 51 asynchronously
+> [  0.000000] (1:worker@Tremblay) All comms have started
+> [  0.500000] (1:worker@Tremblay) wait_any_for: Timeout reached
+> [  1.000000] (1:worker@Tremblay) wait_any_for: Timeout reached
+> [  1.035263] (1:worker@Tremblay) wait_any_for: A comm finished (index=0, #comms=4)
+> [  1.035263] (1:worker@Tremblay) wait_any_for: A comm finished (index=1, #comms=3)
+> [  1.535263] (1:worker@Tremblay) wait_any_for: Timeout reached
+> [  2.035263] (1:worker@Tremblay) wait_any_for: Timeout reached
+> [  2.070331] (1:worker@Tremblay) wait_any_for: A comm finished (index=0, #comms=2)
+> [  2.070331] (1:worker@Tremblay) wait_any_for: A comm finished (index=0, #comms=1)
+> [  2.070331] (1:worker@Tremblay) All comms have finished
+> [  2.070331] (1:worker@Tremblay) Got 42 and 51
index e13e3e2..54cc945 100644 (file)
@@ -78,9 +78,10 @@ foreach(x availability basic0 basic1 basic3 basic4 basic5 basic6 basic-link-test
 endforeach()
 
 # test for code coverage
-foreach(x version help help-logs help-log-categories help-aliases help-models help-tracing)
-  ADD_TEST(test-${x} ${CMAKE_BINARY_DIR}/teshsuite/simdag/basic-parsing-test/basic-parsing-test --${x})
-endforeach()
+ADD_TEST(test-help-version ${TESH_WRAPPER_UNBOXED} ${CMAKE_BINARY_DIR}/teshsuite/simdag/basic-parsing-test/basic-parsing-test
+  --version --help --help-aliases --help-models --help-tracing)
+ADD_TEST(test-help-logs    ${TESH_WRAPPER_UNBOXED} ${CMAKE_BINARY_DIR}/teshsuite/simdag/basic-parsing-test/basic-parsing-test
+  --help-logs --help-log-categories)
 
 ADD_TESH(tesh-simdag-parser-bypass   --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/basic-parsing-test --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic-parsing-test --setenv srcdir=${CMAKE_HOME_DIRECTORY} basic-parsing-test-bypass.tesh)
 ADD_TESH(tesh-simdag-parser-sym-full --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/basic-parsing-test --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic-parsing-test basic-parsing-test-sym-full.tesh)
@@ -89,8 +90,8 @@ ADD_TEST(tesh-simdag-full-links01    ${CMAKE_BINARY_DIR}/teshsuite/simdag/basic-
 ADD_TEST(tesh-simdag-full-links02    ${CMAKE_BINARY_DIR}/teshsuite/simdag/basic-parsing-test/basic-parsing-test ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms/two_clusters_one_name.xml FULL_LINK)
 ADD_TEST(tesh-simdag-one-link-g5k    ${CMAKE_BINARY_DIR}/teshsuite/simdag/basic-parsing-test/basic-parsing-test ${CMAKE_HOME_DIRECTORY}/examples/platforms/g5k.xml ONE_LINK)
 
-if(enable_debug AND NOT enable_memcheck)
-  # these tests need assertions. Exclude them from memcheck, as they normally die, leaving lots of unfree'd objects
+if(enable_debug)
+  # these tests need assertions
   ADD_TESH(tesh-parser-bogus-symmetric         --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/flatifier --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/flatifier ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/flatifier/bogus_two_hosts_asymetric.tesh)
   ADD_TESH(tesh-parser-bogus-missing-gw        --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/flatifier --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/flatifier ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/flatifier/bogus_missing_gateway.tesh)
   ADD_TESH(tesh-parser-bogus-disk-attachment   --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/flatifier --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/flatifier ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/flatifier/bogus_disk_attachment.tesh)
index 099c46b..4519613 100644 (file)
@@ -43,7 +43,6 @@ $ ${bindir:=.}/basic-parsing-test ../platforms/properties.xml
 > [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
@@ -51,6 +50,5 @@ $ ${bindir:=.}/basic-parsing-test ../platforms/properties.xml --cfg=cpu/optim:TI
 > [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 f51b30f..ae49cdc 100644 (file)
@@ -1,5 +1,5 @@
 ! expect signal SIGABRT
-$ ${bindir:=.}/flatifier ../platforms/bogus_disk_attachment.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
+$ $VALGRIND_NO_LEAK_CHECK ${bindir:=.}/flatifier ../platforms/bogus_disk_attachment.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
 > [  0.000000] [0:maestro@] Switching to the L07 model to handle parallel tasks.
 > [  0.000000] [0:maestro@] Parse error at ../platforms/bogus_disk_attachment.xml:19: Unable to attach storage cdisk: host plouf does not exist.
 > [  0.000000] [0:maestro@] Exiting now
index 832004a..20f2519 100644 (file)
@@ -1,12 +1,12 @@
 ! expect signal SIGABRT
-$ ${bindir:=.}/flatifier ../platforms/bogus_missing_src_gateway.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
+$ $VALGRIND_NO_LEAK_CHECK ${bindir:=.}/flatifier ../platforms/bogus_missing_src_gateway.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
 > [  0.000000] [0:maestro@] Switching to the L07 model to handle parallel tasks.
 > [  0.000000] [0:maestro@] Parse error at ../platforms/bogus_missing_src_gateway.xml:14: zoneRoute gw_src='nod-cluster_router.cluster.us' does name a node. Existing netpoints: 
 > 'node-1.cluster.us','node-2.cluster.us','node-3.cluster.us','node-4.cluster.us','node-cluster_router.cluster.us','noeud-1.grappe.fr','noeud-2.grappe.fr','noeud-3.grappe.fr','noeud-4.grappe.fr','noeud-grappe_router.grappe.fr'
 > [  0.000000] [0:maestro@] Exiting now
 
 ! expect signal SIGABRT
-$ ${bindir:=.}/flatifier ../platforms/bogus_missing_dst_gateway.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
+$ $VALGRIND_NO_LEAK_CHECK ${bindir:=.}/flatifier ../platforms/bogus_missing_dst_gateway.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
 > [  0.000000] [0:maestro@] Switching to the L07 model to handle parallel tasks.
 > [  0.000000] [0:maestro@] Parse error at ../platforms/bogus_missing_dst_gateway.xml:14: zoneRoute gw_dst='neud-grappe_router.grappe.fr' does name a node. Existing netpoints: 
 > 'node-1.cluster.us','node-2.cluster.us','node-3.cluster.us','node-4.cluster.us','node-cluster_router.cluster.us','noeud-1.grappe.fr','noeud-2.grappe.fr','noeud-3.grappe.fr','noeud-4.grappe.fr','noeud-grappe_router.grappe.fr'
index 8a77381..27535d7 100644 (file)
@@ -1,4 +1,4 @@
 ! expect signal SIGABRT
-$ ${bindir:=.}/flatifier ../platforms/bogus_two_hosts_asymetric.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n" --log=no_loc
+$ $VALGRIND_NO_LEAK_CHECK ${bindir:=.}/flatifier ../platforms/bogus_two_hosts_asymetric.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n" --log=no_loc
 > [  0.000000] [0:maestro@] Switching to the L07 model to handle parallel tasks.
 > [  0.000000] [0:maestro@] The route between alice and bob already exists (Rq: routes are symmetrical by default).
index 844e307..ce9155b 100644 (file)
@@ -42,7 +42,6 @@ static void create_environment(xbt_os_timer_t parse_time, const char *platformFi
 
 static void dump_hosts()
 {
-  std::unordered_map<std::string, std::string>* props = nullptr;
   unsigned int totalHosts = sg_host_count();
   sg_host_t* hosts        = sg_host_list();
   std::sort(hosts, hosts + totalHosts,
@@ -50,7 +49,7 @@ static void dump_hosts()
 
   for (unsigned int i = 0; i < totalHosts; i++) {
     std::printf("  <host id=\"%s\" speed=\"%.0f\"", hosts[i]->get_cname(), sg_host_speed(hosts[i]));
-    props = hosts[i]->get_properties();
+    const std::unordered_map<std::string, std::string>* props = hosts[i]->get_properties();
     if (hosts[i]->get_core_count() > 1) {
       std::printf(" core=\"%d\"", hosts[i]->get_core_count());
     }
index 5bfeacd..90d20da 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/bin/env tesh
-$ ${bindir:=.}/flatifier$EXEEXT ../platforms/one_cluster.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
+$ ${bindir:=.}/flatifier ../platforms/one_cluster.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
 > [  0.000000] [0:maestro@] Switching to the L07 model to handle parallel tasks.
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
@@ -134,7 +134,7 @@ $ ${bindir:=.}/flatifier$EXEEXT ../platforms/one_cluster.xml "--log=root.fmt:[%1
 > </AS>
 > </platform>
 
-$ ${bindir:=.}/flatifier$EXEEXT ../platforms/one_cluster_multicore.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
+$ ${bindir:=.}/flatifier ../platforms/one_cluster_multicore.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
 > [  0.000000] [0:maestro@] Switching to the L07 model to handle parallel tasks.
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
@@ -268,7 +268,7 @@ $ ${bindir:=.}/flatifier$EXEEXT ../platforms/one_cluster_multicore.xml "--log=ro
 > </AS>
 > </platform>
 
-$ ${bindir:=.}/flatifier$EXEEXT ../platforms/host_attributes.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
+$ ${bindir:=.}/flatifier ../platforms/host_attributes.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
 > [  0.000000] [0:maestro@] Switching to the L07 model to handle parallel tasks.
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
@@ -302,7 +302,7 @@ $ ${bindir:=.}/flatifier$EXEEXT ../platforms/host_attributes.xml "--log=root.fmt
 > </AS>
 > </platform>
 
-$ ${bindir:=.}/flatifier$EXEEXT ../platforms/link_attributes.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
+$ ${bindir:=.}/flatifier ../platforms/link_attributes.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
 > [  0.000000] [0:maestro@] Switching to the L07 model to handle parallel tasks.
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
@@ -320,7 +320,7 @@ $ ${bindir:=.}/flatifier$EXEEXT ../platforms/link_attributes.xml "--log=root.fmt
 > </AS>
 > </platform>
 
-$ ${bindir:=.}/flatifier$EXEEXT ../platforms/three_hosts_non_symmetric_route.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
+$ ${bindir:=.}/flatifier ../platforms/three_hosts_non_symmetric_route.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
 > [  0.000000] [0:maestro@] Switching to the L07 model to handle parallel tasks.
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
@@ -363,7 +363,7 @@ $ ${bindir:=.}/flatifier$EXEEXT ../platforms/three_hosts_non_symmetric_route.xml
 > </AS>
 > </platform>
 
-$ ${bindir:=.}/flatifier$EXEEXT ../platforms/two_clusters.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
+$ ${bindir:=.}/flatifier ../platforms/two_clusters.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
 > [  0.000000] [0:maestro@] Switching to the L07 model to handle parallel tasks.
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
@@ -498,7 +498,7 @@ $ ${bindir:=.}/flatifier$EXEEXT ../platforms/two_clusters.xml "--log=root.fmt:[%
 > </AS>
 > </platform>
 
-$ ${bindir:=.}/flatifier$EXEEXT ../platforms/two_hosts_multi_hop.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
+$ ${bindir:=.}/flatifier ../platforms/two_hosts_multi_hop.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
 > [  0.000000] [0:maestro@] Switching to the L07 model to handle parallel tasks.
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
@@ -525,7 +525,7 @@ $ ${bindir:=.}/flatifier$EXEEXT ../platforms/two_hosts_multi_hop.xml "--log=root
 > </AS>
 > </platform>
 
-$ ${bindir:=.}/flatifier$EXEEXT ../platforms/two_hosts_one_link.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
+$ ${bindir:=.}/flatifier ../platforms/two_hosts_one_link.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
 > [  0.000000] [0:maestro@] Switching to the L07 model to handle parallel tasks.
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
@@ -550,7 +550,7 @@ $ ${bindir:=.}/flatifier$EXEEXT ../platforms/two_hosts_one_link.xml "--log=root.
 > </AS>
 > </platform>
 
-$ ${bindir:=.}/flatifier$EXEEXT ${srcdir:=.}/examples/platforms/bypassASroute.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
+$ ${bindir:=.}/flatifier ${srcdir:=.}/examples/platforms/bypassASroute.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
 > [  0.000000] [0:maestro@] Switching to the L07 model to handle parallel tasks.
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
@@ -684,7 +684,7 @@ $ ${bindir:=.}/flatifier$EXEEXT ${srcdir:=.}/examples/platforms/bypassASroute.xm
 > </AS>
 > </platform>
 
-$ ${bindir:=.}/flatifier$EXEEXT ${srcdir:=.}/examples/platforms/cluster_torus.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
+$ ${bindir:=.}/flatifier ${srcdir:=.}/examples/platforms/cluster_torus.xml "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
 > [  0.000000] [0:maestro@] Switching to the L07 model to handle parallel tasks.
 > <?xml version='1.0'?>
 > <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
index ef1a90c..35441df 100644 (file)
@@ -42,9 +42,17 @@ int main(int argc, char **argv)
   xbt_dynar_free(&hosts);
 
   std::printf("NetCards count: %zu\n", netpoints.size());
-  for (auto const& nc : netpoints)
-    std::printf("   - Seen: \"%s\". Type: %s\n", nc->get_cname(),
-                nc->is_router() ? "router" : (nc->is_netzone() ? "netzone" : (nc->is_host() ? "host" : "buggy")));
-
+  for (auto const& nc : netpoints) {
+    const char* type;
+    if (nc->is_router())
+      type = "router";
+    else if (nc->is_netzone())
+      type = "netzone";
+    else if (nc->is_host())
+      type = "host";
+    else
+      type = "buggy";
+    std::printf("   - Seen: \"%s\". Type: %s\n", nc->get_cname(), type);
+  }
   return 0;
 }
index d52a0ed..50de5a4 100644 (file)
@@ -5,7 +5,6 @@
     <prop id="maxmin/precision" value="0.000010"/>
     <prop id="cpu/optim" value="TI"/>
     <prop id="host/model" value="compound"/>
-    <prop id="network/model" value="Vegas"/>
     <prop id="path" value="~/"/>
   </config>
   <zone  id="AS0"  routing="Full">
index 26919a1..7d3ba78 100644 (file)
@@ -26,15 +26,13 @@ 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)
+if (NOT enable_memcheck AND NOT enable_address_sanitizer AND NOT enable_thread_sanitizer)
   ADD_TESH_FACTORIES(stack-overflow   "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)
   if (release AND (WIN32 OR CMAKE_SYSTEM_NAME MATCHES "Darwin"))
     SET_TESH_PROPERTIES(stack-overflow "ucontext;raw;boost" WILL_FAIL true)
   endif()
 endif()
-if (NOT enable_memcheck)
-  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()
+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)
 
 foreach (factory raw thread boost ucontext)
   string (TOUPPER have_${factory}_contexts VARNAME)
index 5e8ddf5..758b519 100644 (file)
@@ -35,13 +35,13 @@ static void master()
 {
   // Test the simple immediate execution:
   XBT_INFO("Start");
-  simgrid::simix::simcall([] { XBT_INFO("kernel"); });
+  simgrid::kernel::actor::simcall([] { XBT_INFO("kernel"); });
   XBT_INFO("kernel, returned");
 
   // Synchronize on a successful Future<void>:
   simgrid::simix::kernel_sync([] {
-    return kernel_wait_until(10).then([](simgrid::kernel::Future<void> future) {
-      future.get();
+    return kernel_wait_until(10).then([](simgrid::kernel::Future<void> f) {
+      f.get();
       XBT_INFO("kernel_sync with void");
     });
   });
@@ -50,8 +50,8 @@ static void master()
   // Synchronize on a failing Future<void>:
   try {
     simgrid::simix::kernel_sync([] {
-      return kernel_wait_until(20).then([](simgrid::kernel::Future<void> future) {
-        future.get();
+      return kernel_wait_until(20).then([](simgrid::kernel::Future<void> f) {
+        f.get();
         throw example::exception("Exception throwed from kernel_defer");
       });
     });
@@ -62,8 +62,8 @@ static void master()
 
   // Synchronize on a successul Future<int> and get the value:
   int res = simgrid::simix::kernel_sync([] {
-    return kernel_wait_until(30).then([](simgrid::kernel::Future<void> future) {
-      future.get();
+    return kernel_wait_until(30).then([](simgrid::kernel::Future<void> f) {
+      f.get();
       XBT_INFO("kernel_sync with value");
       return 42;
     });
@@ -72,8 +72,8 @@ static void master()
 
   // Synchronize on a successul Future<int> and get the value:
   simgrid::simix::Future<int> future = simgrid::simix::kernel_async([] {
-    return kernel_wait_until(50).then([](simgrid::kernel::Future<void> future) {
-      future.get();
+    return kernel_wait_until(50).then([](simgrid::kernel::Future<void> f) {
+      f.get();
       XBT_INFO("kernel_async with value");
       return 43;
     });
@@ -83,8 +83,8 @@ static void master()
 
   // Synchronize on a successul Future<int> and get the value:
   future = simgrid::simix::kernel_async([] {
-    return kernel_wait_until(60).then([](simgrid::kernel::Future<void> future) {
-      future.get();
+    return kernel_wait_until(60).then([](simgrid::kernel::Future<void> f) {
+      f.get();
       XBT_INFO("kernel_async with value");
       return 43;
     });
index c7180fa..11c9899 100644 (file)
@@ -1,7 +1,7 @@
 ! expect signal SIGSEGV
 $ ${bindir:=.}/stack-overflow --cfg=contexts/stack-size:96 ${srcdir:=.}/examples/platforms/small_platform.xml
 > [Tremblay:master:(1) 0.000000] [test/INFO] Launching our nice bugged recursive function...
-> Access violation detected.
+> Access violation or Bus error detected.
 > This probably comes from a programming error in your code, or from a stack
 > overflow. If you are certain of your code, try increasing the stack size
 >    --cfg=contexts/stack-size=XXX (current size is 96 KiB).
index 800ae86..33d629b 100644 (file)
@@ -8,7 +8,8 @@ if(enable_smpi)
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
   foreach(x coll-allgather coll-allgatherv coll-allreduce coll-alltoall coll-alltoallv coll-barrier coll-bcast
             coll-gather coll-reduce coll-reduce-scatter coll-scatter macro-sample pt2pt-dsend pt2pt-pingpong
-            type-hvector type-indexed type-struct type-vector bug-17132 timers privatization )
+            type-hvector type-indexed type-struct type-vector bug-17132 timers privatization 
+            io-simple io-simple-at io-all io-all-at io-shared io-ordered)
     add_executable       (${x}  EXCLUDE_FROM_ALL ${x}/${x}.c)
     target_link_libraries(${x}  simgrid)
     set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
@@ -28,6 +29,7 @@ if(enable_smpi)
     set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpif90")
     add_executable       (fort_args EXCLUDE_FROM_ALL fort_args/fort_args.f90)
     target_link_libraries(fort_args simgrid)
+    target_link_libraries(fort_args mpi)
     set_target_properties(fort_args PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/fort_args)
     add_dependencies(tests fort_args)
   endif()
@@ -36,7 +38,8 @@ endif()
 foreach(x coll-allgather coll-allgatherv coll-allreduce coll-alltoall coll-alltoallv coll-barrier coll-bcast
     coll-gather coll-reduce coll-reduce-scatter coll-scatter macro-sample pt2pt-dsend pt2pt-pingpong
     type-hvector type-indexed type-struct type-vector bug-17132 timers privatization
-    macro-shared macro-partial-shared macro-partial-shared-communication)
+    macro-shared macro-partial-shared macro-partial-shared-communication
+    io-simple io-simple-at io-all io-all-at io-shared io-ordered)
   set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
   set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c)
 endforeach()
@@ -51,6 +54,8 @@ set(tesh_files    ${tesh_files}     ${CMAKE_CURRENT_SOURCE_DIR}/coll-allreduce/c
 set(bin_files       ${bin_files}    ${CMAKE_CURRENT_SOURCE_DIR}/hostfile
                                     ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_cluster
                                     ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_coll
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_mpich
+                                    ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_io
                                     ${CMAKE_CURRENT_SOURCE_DIR}/hostfile_empty  PARENT_SCOPE)
 
 
@@ -63,7 +68,7 @@ if(enable_smpi)
 
   foreach(x coll-allgather coll-allgatherv coll-allreduce coll-alltoall coll-alltoallv coll-barrier coll-bcast
             coll-gather coll-reduce coll-reduce-scatter coll-scatter macro-sample pt2pt-dsend pt2pt-pingpong
-           type-hvector type-indexed type-struct type-vector bug-17132 timers)
+           type-hvector type-indexed type-struct type-vector bug-17132 timers io-simple io-simple-at io-all io-all-at io-shared io-ordered)
     ADD_TESH_FACTORIES(tesh-smpi-${x} "thread;ucontext;raw;boost" --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/smpi/${x} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/${x} ${x}.tesh)
   endforeach()
 
index 55d3c4a..72327a3 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2009-2019. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2009-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program 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,6 +18,7 @@ int main(int argc, char *argv[])
   MPI_Init(&argc, &argv);
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
   MPI_Comm_size(MPI_COMM_WORLD, &size);
+  MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
 
   int count = 2;
   int* sb = (int *) xbt_malloc(count * sizeof(int));
@@ -29,6 +29,28 @@ int main(int argc, char *argv[])
   for (int i = 0; i < count * size; ++i)
     rb[i] = 0;
 
+  status = MPI_Allgather(NULL, count, MPI_INT, rb, count, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_BUFFER)
+    printf("MPI_Allgather did not return MPI_ERR_BUFFER for empty sendbuf\n");
+  status = MPI_Allgather(sb, -1, MPI_INT, rb, count, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_COUNT)
+    printf("MPI_Allgather did not return MPI_ERR_COUNT for -1 sendcount\n");
+  status = MPI_Allgather(sb, count, MPI_DATATYPE_NULL, rb, count, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_TYPE)
+    printf("MPI_Allgather did not return MPI_ERR_TYPE for MPI_DATATYPE_NULL sendtype\n");
+  status = MPI_Allgather(sb, count, MPI_INT, NULL, count, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_BUFFER)
+    printf("MPI_Allgather did not return MPI_ERR_BUFFER for empty recvbuf\n");
+  status = MPI_Allgather(sb, count, MPI_INT, rb, -1, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_COUNT)
+    printf("MPI_Allgather did not return MPI_ERR_COUNT for -1 recvcount\n");
+  status = MPI_Allgather(sb, count, MPI_INT, rb, count, MPI_DATATYPE_NULL, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_TYPE)
+    printf("MPI_Allgather did not return MPI_ERR_TYPE for MPI_DATATYPE_NULL recvtype\n");
+  status = MPI_Allgather(sb, count, MPI_INT, rb, count, MPI_INT, MPI_COMM_NULL);
+  if(status!=MPI_ERR_COMM)
+    printf("MPI_Allgather did not return MPI_ERR_COMM for MPI_COMM_NULL comm\n");
+
   printf("[%d] sndbuf=[", rank);
   for (int i = 0; i < count; i++)
     printf("%d ", sb[i]);
index 7f6d031..b3db84e 100644 (file)
@@ -2,7 +2,7 @@
 ! output sort
 
 p Test allgather
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allgather --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allgather --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --log=smpi_pmpi.thres:error --log=smpi_mpi.thres:error
 > [rank 0] -> Tremblay
 > [rank 1] -> Tremblay
 > [rank 2] -> Tremblay
index 852dba3..a780669 100644 (file)
@@ -20,6 +20,7 @@ int main(int argc, char *argv[])
   MPI_Init(&argc, &argv);
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
   MPI_Comm_size(MPI_COMM_WORLD, &size);
+  MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
 
   int* recv_counts = (int *) xbt_malloc(size * sizeof(int));
   int* recv_disps = (int *) xbt_malloc(size * sizeof(int));
@@ -34,6 +35,31 @@ 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));
 
+  status = MPI_Allgatherv(NULL, recv_counts[rank], MPI_INT, rb, recv_counts, recv_disps, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_BUFFER)
+    printf("MPI_Allgatherv did not return MPI_ERR_BUFFER for empty sendbuf\n");
+  status = MPI_Allgatherv(sb, -1, MPI_INT, rb, recv_counts, recv_disps, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_COUNT)
+    printf("MPI_Allgatherv did not return MPI_ERR_COUNT for -1 sendcount\n");
+  status = MPI_Allgatherv(sb, recv_counts[rank], MPI_DATATYPE_NULL, rb, recv_counts, recv_disps, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_TYPE)
+    printf("MPI_Allgatherv did not return MPI_ERR_TYPE for MPI_DATATYPE_NULL sendtype\n");
+  status = MPI_Allgatherv(sb, recv_counts[rank], MPI_INT, NULL, recv_counts, recv_disps, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_BUFFER)
+    printf("MPI_Allgatherv did not return MPI_ERR_BUFFER for empty recvbuf\n");
+  status = MPI_Allgatherv(sb, recv_counts[rank], MPI_INT, rb, NULL, recv_disps, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_ARG)
+    printf("MPI_Allgatherv did not return MPI_ERR_ARG for NULL recvcounts\n");
+  status = MPI_Allgatherv(sb, recv_counts[rank], MPI_INT, rb, recv_counts, NULL, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_ARG)
+    printf("MPI_Allgatherv did not return MPI_ERR_ARG for NULL recvdisps\n");
+  status = MPI_Allgatherv(sb, recv_counts[rank], MPI_INT, rb, recv_counts, recv_disps, MPI_DATATYPE_NULL, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_TYPE)
+    printf("MPI_Allgatherv did not return MPI_ERR_TYPE for MPI_DATATYPE_NULL recvtype\n");
+  status = MPI_Allgatherv(sb, recv_counts[rank], MPI_INT, rb, recv_counts, recv_disps, MPI_INT, MPI_COMM_NULL);
+  if(status!=MPI_ERR_COMM)
+    printf("MPI_Allgatherv did not return MPI_ERR_COMM for MPI_COMM_NULL comm\n");
+
   printf("[%d] sndbuf=[", rank);
   for (i = 0; i < recv_counts[rank]; i++){
     sb[i] = recv_disps[rank] + i;
index 835f628..3716966 100644 (file)
@@ -2,7 +2,7 @@
 ! output sort
 
 p Test allgatherv
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allgatherv --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allgatherv --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error
 > [rank 0] -> Tremblay
 > [rank 1] -> Tremblay
 > [rank 2] -> Tremblay
index 939de48..8471bda 100644 (file)
@@ -2,7 +2,7 @@
 
 p Test allreduce
 ! 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-allreduce --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --cfg=smpi/allreduce:automatic --cfg=smpi/async-small-thresh:65536 --cfg=smpi/send-is-detached-thresh:128000 --cfg=smpi/simulate-computation:no "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allreduce --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --cfg=smpi/allreduce:automatic --cfg=smpi/async-small-thresh:65536 --cfg=smpi/send-is-detached-thresh:128000 --cfg=smpi/simulate-computation:no "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --log=smpi_mpi.thres:error
 > [rank 0] -> Tremblay
 > [rank 1] -> Tremblay
 > [rank 2] -> Tremblay
index 1aa4a72..a8f6ac3 100644 (file)
@@ -3,7 +3,7 @@
 
 ! timeout 20
 p Test allreduce
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allreduce 300000 --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allreduce 300000 --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error
 > [rank 0] -> Tremblay
 > [rank 1] -> Jupiter
 > [rank 2] -> Fafard
index b5b71a8..a176003 100644 (file)
@@ -23,6 +23,8 @@ int main(int argc, char *argv[])
 
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
   MPI_Comm_size(MPI_COMM_WORLD, &size);
+  MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+
   if (maxlen > 1)
     mult = maxlen > size ? size : maxlen;
   int* sb = xbt_new0(int, size * maxlen);
@@ -33,6 +35,25 @@ int main(int argc, char *argv[])
     rb[i] = 0;
   }
 
+  status = MPI_Allreduce(NULL, rb, size, MPI_UNSIGNED_LONG_LONG, MPI_SUM, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_BUFFER)
+    printf("MPI_Allreduce did not return MPI_ERR_BUFFER for empty sendbuf\n");
+  status = MPI_Allreduce(sb, NULL, size, MPI_UNSIGNED_LONG_LONG, MPI_SUM, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_BUFFER)
+    printf("MPI_Allreduce did not return MPI_ERR_BUFFER for empty recvbuf\n");
+  status = MPI_Allreduce(sb, rb, -1, MPI_UNSIGNED_LONG_LONG, MPI_SUM, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_COUNT)
+    printf("MPI_Allreduce did not return MPI_ERR_COUNT for -1 count\n");
+  status = MPI_Allreduce(sb, rb, size, MPI_DATATYPE_NULL, MPI_SUM, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_TYPE)
+    printf("MPI_Allreduce did not return MPI_ERR_TYPE for MPI_DATATYPE_NULL type\n");
+  status = MPI_Allreduce(sb, rb, size, MPI_UNSIGNED_LONG_LONG, MPI_OP_NULL, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_OP)
+    printf("MPI_Allreduce did not return MPI_ERR_COMM for MPI_OP_NULL op\n");
+  status = MPI_Allreduce(sb, rb, size, MPI_UNSIGNED_LONG_LONG, MPI_SUM, MPI_COMM_NULL);
+  if(status!=MPI_ERR_COMM)
+    printf("MPI_Allreduce did not return MPI_ERR_COMM for MPI_COMM_NULL comm\n");
+
   printf("[%d] sndbuf=[", rank);
   for (i = 0; i < size *mult; i++)
     printf("%d ", sb[i]);
index f1b9a3c..83b9fa2 100644 (file)
@@ -2,7 +2,7 @@
 ! output sort
 
 p Test allreduce
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allreduce --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allreduce --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error
 > [rank 0] -> Tremblay
 > [rank 1] -> Tremblay
 > [rank 2] -> Tremblay
index 33faf0c..64fa937 100644 (file)
@@ -2,7 +2,7 @@
 ! output sort
 
 p Test classic - backbone
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ${bindir}/../hostfile_cluster -platform ${platfdir:=.}/cluster_backbone.xml -np 12 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ${bindir}/../hostfile_cluster -platform ${platfdir:=.}/cluster_backbone.xml -np 12 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error
 > [rank 0] -> node-0.simgrid.org
 > [rank 1] -> node-1.simgrid.org
 > [rank 2] -> node-2.simgrid.org
@@ -42,7 +42,7 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ${bindir}/../host
 
 ! output sort
 p Test separate clusters
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -platform ../../../examples/platforms/cluster_multi.xml -np 12 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -platform ../../../examples/platforms/cluster_multi.xml -np 12 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error
 > [rank 0] -> node-0.1core.org
 > [rank 1] -> node-1.1core.org
 > [rank 2] -> node-2.1core.org
@@ -50,11 +50,11 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -platform ../../../examples
 > [rank 4] -> node-4.1core.org
 > [rank 5] -> node-5.1core.org
 > [rank 6] -> node-6.1core.org
-> [rank 7] -> node-7.1core.org
-> [rank 8] -> node-0.2cores.org
-> [rank 9] -> node-1.2cores.org
-> [rank 10] -> node-2.2cores.org
-> [rank 11] -> node-3.2cores.org
+> [rank 7] -> node-0.2cores.org
+> [rank 8] -> node-1.2cores.org
+> [rank 9] -> node-2.2cores.org
+> [rank 10] -> node-3.2cores.org
+> [rank 11] -> node-4.2cores.org
 > [0] sndbuf=[0 1 2 3 4 5 6 7 8 9 10 11 ]
 > [1] sndbuf=[12 13 14 15 16 17 18 19 20 21 22 23 ]
 > [2] sndbuf=[24 25 26 27 28 29 30 31 32 33 34 35 ]
@@ -82,7 +82,7 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -platform ../../../examples
 
 ! output sort
 p Test torus
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_cluster -platform ../../../examples/platforms/cluster_torus.xml -np 12 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_cluster -platform ../../../examples/platforms/cluster_torus.xml -np 12 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error
 > [rank 0] -> node-0.simgrid.org
 > [rank 1] -> node-1.simgrid.org
 > [rank 2] -> node-2.simgrid.org
@@ -122,7 +122,7 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_clust
 
 ! output sort
 p Test fat tree
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_cluster -platform ../../../examples/platforms/cluster_fat_tree.xml -np 12 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_cluster -platform ../../../examples/platforms/cluster_fat_tree.xml -np 12 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error
 > [rank 0] -> node-0.simgrid.org
 > [rank 1] -> node-1.simgrid.org
 > [rank 2] -> node-2.simgrid.org
@@ -162,7 +162,7 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_clust
 
 ! output sort
 p Test fat tree IB
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_cluster -platform ../../../examples/platforms/cluster_fat_tree.xml -np 12 --cfg=network/model:IB --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_cluster -platform ../../../examples/platforms/cluster_fat_tree.xml -np 12 --cfg=network/model:IB --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error
 > [rank 0] -> node-0.simgrid.org
 > [rank 1] -> node-1.simgrid.org
 > [rank 2] -> node-2.simgrid.org
@@ -202,7 +202,7 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_clust
 
 ! output sort
 p Test Dragonfly
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_cluster -platform ../../../examples/platforms/cluster_dragonfly.xml -np 12 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_cluster -platform ../../../examples/platforms/cluster_dragonfly.xml -np 12 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error
 > [rank 0] -> node-0.simgrid.org
 > [rank 1] -> node-1.simgrid.org
 > [rank 2] -> node-2.simgrid.org
index 97596c2..9e7eea7 100644 (file)
@@ -20,6 +20,8 @@ int main(int argc, char *argv[])
   MPI_Init(&argc, &argv);
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
   MPI_Comm_size(MPI_COMM_WORLD, &size);
+  MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+
 
   int* sb = (int *) xbt_malloc(size * sizeof(int) * 2);
   int* rb = (int *) xbt_malloc(size * sizeof(int) * 2);
@@ -33,8 +35,31 @@ int main(int argc, char *argv[])
   for (i = 0; i < size; i++)
     printf("%d ", sb[i]);
   printf("]\n");
+  int count=1;
+
+  status = MPI_Alltoall(NULL, count, MPI_INT, rb, count, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_BUFFER)
+    printf("MPI_Alltoall did not return MPI_ERR_BUFFER for empty sendbuf\n");
+  status = MPI_Alltoall(sb, -1, MPI_INT, rb, count, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_COUNT)
+    printf("MPI_Alltoall did not return MPI_ERR_COUNT for -1 sendcount\n");
+  status = MPI_Alltoall(sb, count, MPI_DATATYPE_NULL, rb, count, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_TYPE)
+    printf("MPI_Alltoall did not return MPI_ERR_TYPE for MPI_DATATYPE_NULL sendtype\n");
+  status = MPI_Alltoall(sb, count, MPI_INT, NULL, count, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_BUFFER)
+    printf("MPI_Alltoall did not return MPI_ERR_BUFFER for empty recvbuf\n");
+  status = MPI_Alltoall(sb, count, MPI_INT, rb, -1, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_COUNT)
+    printf("MPI_Alltoall did not return MPI_ERR_COUNT for -1 recvcount\n");
+  status = MPI_Alltoall(sb, count, MPI_INT, rb, count, MPI_DATATYPE_NULL, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_TYPE)
+    printf("MPI_Alltoall did not return MPI_ERR_TYPE for MPI_DATATYPE_NULL recvtype\n");
+  status = MPI_Alltoall(sb, count, MPI_INT, rb, count, MPI_INT, MPI_COMM_NULL);
+  if(status!=MPI_ERR_COMM)
+    printf("MPI_Alltoall did not return MPI_ERR_COMM for MPI_COMM_NULL comm\n");
 
-  status = MPI_Alltoall(sb, 1, MPI_INT, rb, 1, MPI_INT, MPI_COMM_WORLD);
+  status = MPI_Alltoall(sb, count, MPI_INT, rb, count, MPI_INT, MPI_COMM_WORLD);
 
   printf("[%d] rcvbuf=[", rank);
   for (i = 0; i < size; i++)
index f1dc1e5..b1e8e8c 100644 (file)
@@ -2,7 +2,7 @@
 ! output sort
 
 p Test all to all
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ${bindir:=.}/../hostfile_coll -platform ${platfdir}/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ${bindir:=.}/../hostfile_coll -platform ${platfdir}/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error
 > [rank 0] -> Tremblay
 > [rank 1] -> Tremblay
 > [rank 2] -> Tremblay
index ed1c5bb..7d88c60 100644 (file)
@@ -38,7 +38,7 @@
    <2> sdisp: (#3):  [0][1][3]
    <2> rdisp: (#3):  [0][2][4]
 
-   after MPI_Alltoallv :
+   after MPI_Alltoallvv :
    <0> rbuf: (#9):   [-1][-1][-1][-1][-1][-1][-1][-1][-1]
    <1> rbuf: (#9):   [1][101][201][-1][-1][-1][-1][-1][-1]
    <2> rbuf: (#9):   [3][4][103][104][203][204][-1][-1][-1]
@@ -66,6 +66,8 @@ int main(int argc, char **argv)
 
   /* Create the buffer */
   MPI_Comm_size(comm, &size);
+  MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+
   if(size<=0){
     printf("error : comm size <= 0, run with mpirun\n");
     return -1;
@@ -93,6 +95,35 @@ int main(int argc, char **argv)
     rdispls[i] = i * rank;
     sdispls[i] = (i * (i + 1)) / 2;
   }
+  int status;
+
+  status = MPI_Alltoallv(NULL, sendcounts, sdispls, MPI_INT, rbuf, recvcounts, rdispls, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_BUFFER)
+    printf("MPI_Alltoallv did not return MPI_ERR_BUFFER for empty sendbuf\n");
+  status = MPI_Alltoallv(sbuf, NULL, sdispls, MPI_INT, rbuf, recvcounts, rdispls, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_ARG)
+    printf("MPI_Alltoallv did not return MPI_ERR_ARG for NULL sendcounts\n");
+  status = MPI_Alltoallv(sbuf, sendcounts, NULL, MPI_INT, rbuf, recvcounts, rdispls, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_ARG)
+    printf("MPI_Alltoallv did not return MPI_ERR_ARG for NULL senddispl\n");
+  status = MPI_Alltoallv(sbuf, sendcounts, sdispls, MPI_DATATYPE_NULL, rbuf, recvcounts, rdispls, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_TYPE)
+    printf("MPI_Alltoallv did not return MPI_ERR_TYPE for MPI_DATATYPE_NULL sendtype\n");
+  status = MPI_Alltoallv(sbuf, sendcounts, sdispls, MPI_INT, NULL, recvcounts, rdispls, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_BUFFER)
+    printf("MPI_Alltoallv did not return MPI_ERR_BUFFER for empty recvbuf\n");
+  status = MPI_Alltoallv(sbuf, sendcounts, sdispls, MPI_INT, rbuf, NULL, rdispls, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_ARG)
+    printf("MPI_Alltoallv did not return MPI_ERR_ARG for NULL recvcounts\n");
+  status = MPI_Alltoallv(sbuf, sendcounts, sdispls, MPI_INT, rbuf, recvcounts, NULL, MPI_INT, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_ARG)
+    printf("MPI_Alltoallv did not return MPI_ERR_ARG for NULL recvdispl\n");
+  status = MPI_Alltoallv(sbuf, sendcounts, sdispls, MPI_INT, rbuf, recvcounts, rdispls, MPI_DATATYPE_NULL, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_TYPE)
+    printf("MPI_Alltoallv did not return MPI_ERR_TYPE for MPI_DATATYPE_NULL recvtype\n");
+  status = MPI_Alltoallv(sbuf, sendcounts, sdispls, MPI_INT, rbuf, recvcounts, rdispls, MPI_INT, MPI_COMM_NULL);
+  if(status!=MPI_ERR_COMM)
+    printf("MPI_Alltoallv did not return MPI_ERR_COMM for MPI_COMM_NULL comm\n");
 
   print_buffer_int(sbuf, size2, "sbuf:", rank);
   print_buffer_int(sendcounts, size, "scount:", rank);
index 02acc66..aabb597 100644 (file)
@@ -2,7 +2,7 @@
 ! output sort
 
 p Test all to all
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoallv --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoallv --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error
 > [rank 0] -> Tremblay
 > [rank 1] -> Tremblay
 > [rank 2] -> Tremblay
index d0a6bc9..99a3632 100644 (file)
@@ -15,6 +15,11 @@ int main(int argc, char **argv)
   MPI_Init(&argc, &argv);
   MPI_Comm_size(MPI_COMM_WORLD, &size);
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+  MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+
+  int status = MPI_Barrier(MPI_COMM_NULL);
+  if(status!=MPI_ERR_COMM)
+    printf("MPI_Barrier did not return MPI_ERR_COMM for MPI_COMM_NULL comm\n");
 
   MPI_Barrier(MPI_COMM_WORLD);
 
index 6f92664..b8faa4d 100644 (file)
@@ -2,7 +2,7 @@
 ! output sort
 
 p Test barrier
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-barrier --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-barrier --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error
 > ... Barrier ....
 > [rank 0] -> Tremblay
 > [rank 1] -> Tremblay
index 4a145d5..fc2bc73 100644 (file)
@@ -13,16 +13,37 @@ int main(int argc, char **argv)
   int size;
   int rank;
   int count = 2048;
+  int status;
 
   MPI_Init(&argc, &argv);
   MPI_Comm_size(MPI_COMM_WORLD, &size);
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+  MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
 
   int *values = (int *) xbt_malloc(count * sizeof(int));
 
   for (i = 0; i < count; i++)
     values[i] = (0 == rank) ? 17 : 3;
 
+  status = MPI_Bcast(NULL, count, MPI_INT, 0, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_BUFFER)
+    printf("MPI_Bcast did not return MPI_ERR_BUFFER for empty sendbuf\n");
+  status = MPI_Bcast(values, -1, MPI_INT, 0, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_COUNT)
+    printf("MPI_Bcast did not return MPI_ERR_COUNT for -1 sendcount\n");
+  status = MPI_Bcast(values, count, MPI_DATATYPE_NULL, 0, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_TYPE)
+    printf("MPI_Bcast did not return MPI_ERR_TYPE for MPI_DATATYPE_NULL sendtype\n");
+  status = MPI_Bcast(values, count, MPI_INT, -1, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_ROOT)
+    printf("MPI_Bcast did not return MPI_ERR_ROOT for -1 root\n");
+  status = MPI_Bcast(values, count, MPI_INT, size, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_ROOT)
+    printf("MPI_Bcast did not return MPI_ERR_ROOT for root > size\n");
+  status = MPI_Bcast(values, count, MPI_INT, 0, MPI_COMM_NULL);
+  if(status!=MPI_ERR_COMM)
+    printf("MPI_Bcast did not return MPI_ERR_COMM for MPI_COMM_NULL comm\n");
+
   MPI_Bcast(values, count, MPI_INT, 0, MPI_COMM_WORLD);
 
   int good = 0;
@@ -39,7 +60,7 @@ int main(int argc, char **argv)
   for (i = 0; i < count; i++)
     values[i] = (size -1 == rank) ? 17 : 3;
 
-  int status = MPI_Bcast(values, count, MPI_INT, size-1, MPI_COMM_WORLD);
+  status = MPI_Bcast(values, count, MPI_INT, size-1, MPI_COMM_WORLD);
 
   good = 0;
   for (i = 0; i < count; i++)
index 32d741e..43dcf10 100644 (file)
@@ -1,7 +1,7 @@
 p Test Broadcast with more processes than hosts
 ! 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
+$ ${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 --log=smpi_mpi.thres:error
 > [rank 0] -> Tremblay
 > [rank 1] -> Tremblay
 > [rank 2] -> Tremblay
index 0097c35..be0ae6a 100644 (file)
@@ -21,6 +21,7 @@ int main(int argc, char *argv[])
   MPI_Init(&argc, &argv);
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
   MPI_Comm_size(MPI_COMM_WORLD, &size);
+  MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
 
   int count = 2;
   int* sb = (int *) xbt_malloc(count * sizeof(int));
@@ -36,6 +37,25 @@ int main(int argc, char *argv[])
     printf("%d ", sb[i]);
   printf("]\n");
 
+  status = MPI_Gather(NULL, count, MPI_INT, rb, count, MPI_INT, root, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_BUFFER)
+    printf("MPI_Gather did not return MPI_ERR_BUFFER for empty sendbuf\n");
+  status = MPI_Gather(sb, -1, MPI_INT, rb, count, MPI_INT, root, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_COUNT)
+    printf("MPI_Gather did not return MPI_ERR_COUNT for -1 sendcount\n");
+  status = MPI_Gather(sb, count, MPI_DATATYPE_NULL, rb, count, MPI_INT, root, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_TYPE)
+    printf("MPI_Gather did not return MPI_ERR_TYPE for MPI_DATATYPE_NULL sendtype\n");
+  status = MPI_Gather(sb, count, MPI_INT, rb, count, MPI_INT, -1, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_ROOT)
+    printf("MPI_Gather did not return MPI_ERR_ROOT for root -1\n");
+  status = MPI_Gather(sb, count, MPI_INT, rb, count, MPI_INT, size+1, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_ROOT)
+    printf("MPI_Gather did not return MPI_ERR_ROOT for root > size\n");
+  status = MPI_Gather(sb, count, MPI_INT, rb, count, MPI_INT, root, MPI_COMM_NULL);
+  if(status!=MPI_ERR_COMM)
+    printf("MPI_Gather did not return MPI_ERR_COMM for MPI_COMM_NULL comm\n");
+
   status = MPI_Gather(sb, count, MPI_INT, rb, count, MPI_INT, root, MPI_COMM_WORLD);
 
   if (rank == root) {
@@ -45,7 +65,7 @@ int main(int argc, char *argv[])
     printf("]\n");
 
     if (status != MPI_SUCCESS) {
-      printf("allgather returned %d\n", status);
+      printf("gather returned %d\n", status);
       fflush(stdout);
     }
   }
index 99efd2b..84fcf65 100644 (file)
@@ -3,7 +3,7 @@
 ! timeout 30
 
 p Test all to all
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-gather --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-gather --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error
 > [rank 0] -> Tremblay
 > [rank 1] -> Tremblay
 > [rank 2] -> Tremblay
index a6cfcdf..58e1239 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright (c) 2013-2019. The SimGrid Team.
- * All rights reserved.                                                     */
+ * All rights reserved.                           */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 int main( int argc, char **argv )
 {
-    int err = 0;
-    int toterr;
-    int size;
-    int rank;
-    int i;
-    MPI_Comm comm;
-
-    MPI_Init( &argc, &argv );
-    comm = MPI_COMM_WORLD;
-
-    MPI_Comm_size( comm, &size );
-    MPI_Comm_rank( comm, &rank );
-    int* sendbuf = (int *) malloc( size * sizeof(int) );
-    for (i=0; i<size; i++)
-      sendbuf[i] = rank + i;
-    int* recvcounts = (int*) malloc (size * sizeof(int));
-    int* recvbuf    = (int*) malloc (size * sizeof(int));
-    for (i=0; i<size; i++)
-      recvcounts[i] = 1;
-    MPI_Reduce_scatter( sendbuf, recvbuf, recvcounts, MPI_INT, MPI_SUM, comm );
-    int sumval = size * rank + ((size - 1) * size)/2;
-    /* recvbuf should be size * (rank + i) */
-    if (recvbuf[0] != sumval) {
-      err++;
-      fprintf( stdout, "Did not get expected value for reduce scatter\n" );
-      fprintf( stdout, "[%d] Got %d expected %d\n", rank, recvbuf[0], sumval );
-    }
-
-    MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
-    if (rank == 0 && toterr == 0) {
-      printf( " No Errors\n" );
-    }
-    free(sendbuf);
-    free(recvcounts);
-    free(recvbuf);
-
-    MPI_Finalize();
-
-    return toterr;
+  int err = 0;
+  int toterr;
+  int size;
+  int rank;
+  int i;
+  MPI_Comm comm;
+
+  MPI_Init( &argc, &argv );
+  comm = MPI_COMM_WORLD;
+
+  MPI_Comm_size( comm, &size );
+  MPI_Comm_rank( comm, &rank );
+  MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+
+  int* sendbuf = (int *) malloc( size * sizeof(int) );
+  for (i=0; i<size; i++)
+    sendbuf[i] = rank + i;
+  int* recvcounts = (int*) malloc (size * sizeof(int));
+  int* recvbuf  = (int*) malloc (size * sizeof(int));
+  for (i=0; i<size; i++)
+    recvcounts[i] = 1;
+  int retval;
+
+  retval = MPI_Reduce_scatter(NULL, recvbuf, recvcounts, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
+  if(retval!=MPI_ERR_BUFFER)
+    printf("MPI_Reduce_scatter did not return MPI_ERR_BUFFER for empty sendbuf\n");
+  retval = MPI_Reduce_scatter(sendbuf, NULL, recvcounts, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
+  if(retval!=MPI_ERR_BUFFER)
+    printf("MPI_Reduce_scatter did not return MPI_ERR_BUFFER for empty recvbuf\n");
+  retval = MPI_Reduce_scatter(sendbuf, recvbuf, NULL, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
+  if(retval!=MPI_ERR_ARG)
+    printf("MPI_Reduce_scatter did not return MPI_ERR_ARG for NULL recvcounts\n");
+  retval = MPI_Reduce_scatter(sendbuf, recvbuf, recvcounts, MPI_DATATYPE_NULL, MPI_SUM, MPI_COMM_WORLD);
+  if(retval!=MPI_ERR_TYPE)
+    printf("MPI_Reduce_scatter did not return MPI_ERR_TYPE for MPI_DATATYPE_NULL type\n");
+  retval = MPI_Reduce_scatter(sendbuf, recvbuf, recvcounts, MPI_DOUBLE, MPI_OP_NULL, MPI_COMM_WORLD);
+  if(retval!=MPI_ERR_OP)
+    printf("MPI_Reduce_scatter did not return MPI_ERR_OP for MPI_OP_NULL op\n");
+  retval = MPI_Reduce_scatter(sendbuf, recvbuf, recvcounts, MPI_DOUBLE, MPI_SUM, MPI_COMM_NULL);
+  if(retval!=MPI_ERR_COMM)
+    printf("MPI_Reduce_scatter did not return MPI_ERR_COMM for MPI_COMM_NULL comm\n");
+
+  MPI_Reduce_scatter( sendbuf, recvbuf, recvcounts, MPI_INT, MPI_SUM, comm );
+  int sumval = size * rank + ((size - 1) * size)/2;
+  /* recvbuf should be size * (rank + i) */
+  if (recvbuf[0] != sumval) {
+    err++;
+    fprintf( stdout, "Did not get expected value for reduce scatter\n" );
+    fprintf( stdout, "[%d] Got %d expected %d\n", rank, recvbuf[0], sumval );
+  }
+
+  MPI_Allreduce( &err, &toterr, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
+  if (rank == 0 && toterr == 0) {
+    printf( " No Errors\n" );
+  }
+  free(sendbuf);
+  free(recvcounts);
+  free(recvbuf);
+
+  MPI_Finalize();
+
+  return toterr;
 }
index 5c04f3e..afeeb85 100644 (file)
@@ -2,7 +2,7 @@
 ! output sort
 
 p Test reduce_scatter
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-reduce-scatter --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-reduce-scatter --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error
 >  No Errors
 > [rank 0] -> Tremblay
 > [rank 10] -> Fafard
index cf69db4..bd6ff17 100644 (file)
@@ -20,6 +20,7 @@ int main(int argc, char *argv[])
   MPI_Init(&argc, &argv);
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
   MPI_Comm_size(MPI_COMM_WORLD, &size);
+  MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
 
   unsigned long long* sb = (unsigned long long *) xbt_malloc(size * sizeof(unsigned long long));
   unsigned long long* rb = (unsigned long long *) xbt_malloc(size * sizeof(unsigned long long));
@@ -32,8 +33,30 @@ int main(int argc, char *argv[])
   for (i = 0; i < size; i++)
     printf("%llu ", sb[i]);
   printf("]\n");
-
   int root=0;
+
+  status = MPI_Reduce(NULL, rb, size, MPI_UNSIGNED_LONG_LONG, MPI_SUM, root, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_BUFFER)
+    printf("MPI_Reduce did not return MPI_ERR_BUFFER for empty sendbuf\n");
+  status = MPI_Reduce(sb, rb, -1, MPI_UNSIGNED_LONG_LONG, MPI_SUM, root, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_COUNT)
+    printf("MPI_Reduce did not return MPI_ERR_COUNT for -1 count\n");
+  status = MPI_Reduce(sb, rb, size, MPI_DATATYPE_NULL, MPI_SUM, root, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_TYPE)
+    printf("MPI_Reduce did not return MPI_ERR_TYPE for MPI_DATATYPE_NULL type\n");
+  status = MPI_Reduce(sb, rb, size, MPI_UNSIGNED_LONG_LONG, MPI_OP_NULL, root, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_OP)
+    printf("MPI_Reduce did not return MPI_ERR_COMM for MPI_OP_NULL op\n");
+  status = MPI_Reduce(sb, rb, size, MPI_UNSIGNED_LONG_LONG, MPI_SUM, -1, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_ROOT)
+    printf("MPI_Reduce did not return MPI_ERR_ROOT for root -1\n");
+  status = MPI_Reduce(sb, rb, size, MPI_UNSIGNED_LONG_LONG, MPI_SUM, size+1, MPI_COMM_WORLD);
+  if(status!=MPI_ERR_ROOT)
+    printf("MPI_Reduce did not return MPI_ERR_ROOT for root > size\n");
+  status = MPI_Reduce(sb, rb, size, MPI_UNSIGNED_LONG_LONG, MPI_SUM, root, MPI_COMM_NULL);
+  if(status!=MPI_ERR_COMM)
+    printf("MPI_Reduce did not return MPI_ERR_COMM for MPI_COMM_NULL comm\n");
+
   status = MPI_Reduce(sb, rb, size, MPI_UNSIGNED_LONG_LONG, MPI_SUM, root, MPI_COMM_WORLD);
   MPI_Barrier(MPI_COMM_WORLD);
 
index bbab866..69433de 100644 (file)
@@ -2,7 +2,7 @@
 ! output sort
 
 p Test allreduce
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-reduce --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-reduce --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error
 > [0] rcvbuf=[1920 1936 1952 1968 1984 2000 2016 2032 2048 2064 2080 2096 2112 2128 2144 2160 ]
 > [0] second sndbuf=[0 ]
 > [0] sndbuf=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ]
index 1232977..7f45d9a 100644 (file)
@@ -9,42 +9,61 @@
 
 int main(int argc, char **argv)
 {
-   int size;
-   int rank;
-   int success = 1;
-   int retval;
-   int sendcount = 1;            // one double to each process
-   int recvcount = 1;
-   double *sndbuf = NULL;
-   double rcvd;
-   int root = 0;                 // arbitrary choice
-
-   MPI_Init(&argc, &argv);
-   MPI_Comm_size(MPI_COMM_WORLD, &size);
-   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-
-   // on root, initialize sendbuf
-   if (root == rank) {
-     sndbuf = malloc(size * sizeof(double));
-     for (int i = 0; i < size; i++) {
-       sndbuf[i] = (double) i;
-     }
-   }
-
-   retval = MPI_Scatter(sndbuf, sendcount, MPI_DOUBLE, &rcvd, recvcount, MPI_DOUBLE, root, MPI_COMM_WORLD);
-   if (root == rank) {
-     free(sndbuf);
-   }
-   if (retval != MPI_SUCCESS) {
-     fprintf(stderr, "(%s:%d) MPI_Scatter() returned retval=%d\n", __FILE__, __LINE__, retval);
-     return 0;
-   }
-   // verification
-   if ((double) rank != rcvd) {
-     fprintf(stderr, "[%d] has %f instead of %d\n", rank, rcvd, rank);
-     success = 0;
-   }
+  int size;
+  int rank;
+  int success = 1;
+  int retval;
+  int sendcount = 1;            // one double to each process
+  int recvcount = 1;
+  double *sndbuf = NULL;
+  double rcvd;
+  int root = 0;                 // arbitrary choice
 
+  MPI_Init(&argc, &argv);
+  MPI_Comm_size(MPI_COMM_WORLD, &size);
+  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+  MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+
+  // on root, initialize sendbuf
+  if (root == rank) {
+    sndbuf = malloc(size * sizeof(double));
+    for (int i = 0; i < size; i++) {
+      sndbuf[i] = (double) i;
+    }
+  }
+
+  retval = MPI_Scatter(sndbuf, sendcount, MPI_DOUBLE, NULL, recvcount, MPI_DOUBLE, root, MPI_COMM_WORLD);
+  if(retval!=MPI_ERR_BUFFER)
+    printf("MPI_Scatter did not return MPI_ERR_BUFFER for empty recvbuf\n");
+  retval = MPI_Scatter(sndbuf, sendcount, MPI_DOUBLE, &rcvd, -1, MPI_DOUBLE, root, MPI_COMM_WORLD);
+  if(retval!=MPI_ERR_COUNT)
+    printf("MPI_Scatter did not return MPI_ERR_COUNT for -1 recvcount\n");
+  retval = MPI_Scatter(sndbuf, sendcount, MPI_DOUBLE, &rcvd, recvcount, MPI_DATATYPE_NULL, root, MPI_COMM_WORLD);
+  if(retval!=MPI_ERR_TYPE)
+    printf("MPI_Scatter did not return MPI_ERR_TYPE for MPI_DATATYPE_NULL sendtype\n");
+  retval = MPI_Scatter(sndbuf, sendcount, MPI_DOUBLE, &rcvd, recvcount, MPI_DOUBLE, -1, MPI_COMM_WORLD);
+  if(retval!=MPI_ERR_ROOT)
+    printf("MPI_Scatter did not return MPI_ERR_ROOT for root -1\n");
+  retval = MPI_Scatter(sndbuf, sendcount, MPI_DOUBLE, &rcvd, recvcount, MPI_DOUBLE, size+1, MPI_COMM_WORLD);
+  if(retval!=MPI_ERR_ROOT)
+    printf("MPI_Scatter did not return MPI_ERR_ROOT for root > size\n");
+  retval = MPI_Scatter(sndbuf, sendcount, MPI_DOUBLE, &rcvd, recvcount, MPI_DOUBLE, root, MPI_COMM_NULL);
+  if(retval!=MPI_ERR_COMM)
+    printf("MPI_Scatter did not return MPI_ERR_COMM for MPI_COMM_NULL comm\n");
+
+  retval = MPI_Scatter(sndbuf, sendcount, MPI_DOUBLE, &rcvd, recvcount, MPI_DOUBLE, root, MPI_COMM_WORLD);
+  if (root == rank) {
+    free(sndbuf);
+  }
+  if (retval != MPI_SUCCESS) {
+    fprintf(stderr, "(%s:%d) MPI_Scatter() returned retval=%d\n", __FILE__, __LINE__, retval);
+    return 0;
+  }
+  // verification
+  if ((double) rank != rcvd) {
+    fprintf(stderr, "[%d] has %f instead of %d\n", rank, rcvd, rank);
+    success = 0;
+  }
   /* test 1 */
   if (0 == rank)
     printf("** Small Test Result: ...\n");
index a7bd5a6..a7f0556 100644 (file)
@@ -2,7 +2,7 @@
 ! output sort
 
 p Test scatter
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-scatter --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-scatter --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error
 >      [0] ok.
 >      [10] ok.
 >      [11] ok.
index d1f4aea..0e634ed 100644 (file)
@@ -1,9 +1,12 @@
 ! Check that getarg does somethig sensible.
 program getarg_1
+  use mpi
   CHARACTER*10 ARGS, ARGS2
   INTEGER*4 I
   INTEGER*2 I2
+  INTEGER ierr
   I = 0
+  call MPI_Init(ierr)
   CALL GETARG(I,ARGS)
   ! This should return the invoking command.  The actual value depends 
   ! on the OS, but a blank string is wrong no matter what.
@@ -22,4 +25,5 @@ program getarg_1
   I = 1000
   CALL GETARG(I,ARGS)
   if (args.ne.'') STOP 6
+  call MPI_Finalize(ierr)
 end
diff --git a/teshsuite/smpi/hostfile_io b/teshsuite/smpi/hostfile_io
new file mode 100644 (file)
index 0000000..6b4158a
--- /dev/null
@@ -0,0 +1,2 @@
+bob
+carl
diff --git a/teshsuite/smpi/hostfile_mpich b/teshsuite/smpi/hostfile_mpich
new file mode 100644 (file)
index 0000000..99eec54
--- /dev/null
@@ -0,0 +1,5 @@
+Tremblay:2
+Jupiter:2
+Fafard:3
+Ginette:6
+Bourassa:7
diff --git a/teshsuite/smpi/io-all-at/io-all-at.c b/teshsuite/smpi/io-all-at/io-all-at.c
new file mode 100644 (file)
index 0000000..3c2963b
--- /dev/null
@@ -0,0 +1,76 @@
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <memory.h>
+
+/* Test reading and writing zero bytes (set status correctly) */
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int size;
+    int rank;
+    int i;
+    int* buf;
+    int count;
+    MPI_File fh;
+    MPI_Comm comm;
+    MPI_Status status;
+    MPI_Init( &argc, &argv );
+    comm = MPI_COMM_WORLD;
+    MPI_File_open( comm, (char*)"/scratch/testfile", MPI_MODE_RDWR | MPI_MODE_CREATE | MPI_MODE_DELETE_ON_CLOSE, MPI_INFO_NULL, &fh );
+    MPI_Comm_size( comm, &size );
+    MPI_Comm_rank( comm, &rank );
+    buf = (int *)malloc( 10 * sizeof(int) );
+    buf[0] = rank;
+    /* Write to file */
+    MPI_File_seek( fh, sizeof(int)*rank, MPI_SEEK_SET ); 
+    MPI_File_write_all( fh, buf, 1, MPI_INT, &status );
+    MPI_Get_count( &status, MPI_INT, &count );
+    if (count != 1) {
+        errs++;
+        fprintf( stderr, "Wrong count (%d) on write\n", count );fflush(stderr);
+    }
+    /* Write to file, overlapping */
+    MPI_File_write_at_all( fh, sizeof(int)*rank, buf, 10, MPI_INT, &status );
+    MPI_Get_count( &status, MPI_INT, &count );
+    if (count != 10) {
+        errs++;
+        fprintf( stderr, "Wrong count (%d) on write\n", count );fflush(stderr);
+    }
+    /* Read nothing (check status) */
+    memset( &status, 0xff, sizeof(MPI_Status) );
+    MPI_File_read_at_all( fh, 0, buf, 0, MPI_INT, &status );
+    MPI_Get_count( &status, MPI_INT, &count );
+    if (count != 0) {
+        errs++;
+        fprintf( stderr, "Count not zero (%d) on read\n", count );fflush(stderr);
+    }
+
+    /* Write nothing (check status) */
+    memset( &status, 0xff, sizeof(MPI_Status) );
+    MPI_File_write_at_all( fh, 0, buf, 0, MPI_INT, &status );
+    if (count != 0) {
+        errs++;
+        fprintf( stderr, "Count not zero (%d) on write\n", count );fflush(stderr);
+    }
+
+    MPI_Barrier( comm );
+
+    for (i=0; i<size; i++) buf[i] = -1;
+    MPI_File_read_at_all( fh, sizeof(int)*rank, buf, 10, MPI_INT, &status );
+    // if (buf[0] != rank) {
+        // errs++;
+        // fprintf( stderr, "%d: buf = %d\n", rank, buf[0] );fflush(stderr);
+    // }
+    free( buf );
+    MPI_File_close( &fh );
+    MPI_Finalize();
+    return errs;
+}
diff --git a/teshsuite/smpi/io-all-at/io-all-at.tesh b/teshsuite/smpi/io-all-at/io-all-at.tesh
new file mode 100644 (file)
index 0000000..57f3e23
--- /dev/null
@@ -0,0 +1,60 @@
+# Test for MPI_File_read and MPI_File_write
+! output sort
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_io -platform ../../../examples/platforms/hosts_with_disks.xml -np 4 --log=xbt_cfg.thres:critical --log=smpi_kernel.thres:warning --log=smpi_mpi.thres:error --log=smpi_io.thres:verbose "--log=root.fmt:(%P@%h)%e%m%n" --cfg=smpi/simulate-computation:0 ${bindir:=.}/io-all-at
+> You requested to use 4 ranks, but there is only 2 processes in your hostfile...
+> [rank 0] -> bob
+> [rank 1] -> carl
+> [rank 2] -> bob
+> [rank 3] -> carl
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 8
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 12
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 4
+> (3@carl) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (3@carl) Position after write in MPI_File /scratch/testfile : 16
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 12
+> (1@carl) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (1@carl) Position after write in MPI_File /scratch/testfile : 8
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 4
+> (2@bob) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (2@bob) Position after write in MPI_File /scratch/testfile : 12
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 8
+> (0@bob) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (0@bob) Position after write in MPI_File /scratch/testfile : 4
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 39
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 26
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 13
+> (3@carl) Write in MPI_File /scratch/testfile, 12 bytes written, readsize 12 bytes, movesize 12
+> (3@carl) Position after write in MPI_File /scratch/testfile : 51
+> (1@carl) Write in MPI_File /scratch/testfile, 12 bytes written, readsize 12 bytes, movesize 12
+> (1@carl) Position after write in MPI_File /scratch/testfile : 25
+> (0@bob) Write in MPI_File /scratch/testfile, 12 bytes written, readsize 12 bytes, movesize 12
+> (0@bob) Position after write in MPI_File /scratch/testfile : 12
+> (2@bob) Write in MPI_File /scratch/testfile, 12 bytes written, readsize 12 bytes, movesize 12
+> (2@bob) Position after write in MPI_File /scratch/testfile : 38
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 8
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 12
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 4
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 26
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 39
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 13
+> (3@carl) Read in MPI_File /scratch/testfile, 12 bytes read, readsize 12 bytes, movesize 12
+> (3@carl) Position after read in MPI_File /scratch/testfile : 51
+> (1@carl) Read in MPI_File /scratch/testfile, 12 bytes read, readsize 12 bytes, movesize 12
+> (1@carl) Position after read in MPI_File /scratch/testfile : 25
+> (2@bob) Read in MPI_File /scratch/testfile, 12 bytes read, readsize 12 bytes, movesize 12
+> (2@bob) Position after read in MPI_File /scratch/testfile : 38
+> (0@bob) Read in MPI_File /scratch/testfile, 12 bytes read, readsize 12 bytes, movesize 12
+> (0@bob) Position after read in MPI_File /scratch/testfile : 12
diff --git a/teshsuite/smpi/io-all/io-all.c b/teshsuite/smpi/io-all/io-all.c
new file mode 100644 (file)
index 0000000..72468b1
--- /dev/null
@@ -0,0 +1,78 @@
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <memory.h>
+
+/* Test reading and writing zero bytes (set status correctly) */
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int size;
+    int rank;
+    int i;
+    int* buf;
+    int count;
+    MPI_File fh;
+    MPI_Comm comm;
+    MPI_Status status;
+    MPI_Init( &argc, &argv );
+    comm = MPI_COMM_WORLD;
+    MPI_File_open( comm, (char*)"/scratch/testfile", MPI_MODE_RDWR | MPI_MODE_CREATE | MPI_MODE_DELETE_ON_CLOSE, MPI_INFO_NULL, &fh );
+    MPI_Comm_size( comm, &size );
+    MPI_Comm_rank( comm, &rank );
+    buf = (int *)malloc( 10 * sizeof(int) );
+    buf[0] = rank;
+    /* Write to file */
+    MPI_File_seek( fh, sizeof(int)*rank, MPI_SEEK_SET ); 
+    MPI_File_write_all( fh, buf, 1, MPI_INT, &status );
+    MPI_Get_count( &status, MPI_INT, &count );
+    if (count != 1) {
+        errs++;
+        fprintf( stderr, "Wrong count (%d) on write\n", count );fflush(stderr);
+    }
+    /* Write to file, overlapping */
+    MPI_File_seek( fh, sizeof(int)*rank, MPI_SEEK_SET ); 
+    MPI_File_write_all( fh, buf, 10, MPI_INT, &status );
+    MPI_Get_count( &status, MPI_INT, &count );
+    if (count != 10) {
+        errs++;
+        fprintf( stderr, "Wrong count (%d) on write\n", count );fflush(stderr);
+    }
+    /* Read nothing (check status) */
+    memset( &status, 0xff, sizeof(MPI_Status) );
+    MPI_File_read_all( fh, buf, 0, MPI_INT, &status );
+    MPI_Get_count( &status, MPI_INT, &count );
+    if (count != 0) {
+        errs++;
+        fprintf( stderr, "Count not zero (%d) on read\n", count );fflush(stderr);
+    }
+
+    /* Write nothing (check status) */
+    memset( &status, 0xff, sizeof(MPI_Status) );
+    MPI_File_write_all( fh, buf, 0, MPI_INT, &status );
+    if (count != 0) {
+        errs++;
+        fprintf( stderr, "Count not zero (%d) on write\n", count );fflush(stderr);
+    }
+
+    MPI_Barrier( comm );
+
+    MPI_File_seek( fh, sizeof(int)*rank, MPI_SEEK_SET );
+    for (i=0; i<size; i++) buf[i] = -1;
+    MPI_File_read_all( fh, buf, 10, MPI_INT, &status );
+    // if (buf[0] != rank) {
+        // errs++;
+        // fprintf( stderr, "%d: buf = %d\n", rank, buf[0] );fflush(stderr);
+    // }
+    free( buf );
+    MPI_File_close( &fh );
+    MPI_Finalize();
+    return errs;
+}
diff --git a/teshsuite/smpi/io-all/io-all.tesh b/teshsuite/smpi/io-all/io-all.tesh
new file mode 100644 (file)
index 0000000..d60d27e
--- /dev/null
@@ -0,0 +1,52 @@
+# Test for MPI_File_read and MPI_File_write
+! output sort
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_io -platform ../../../examples/platforms/hosts_with_disks.xml -np 4 --log=xbt_cfg.thres:critical --log=smpi_kernel.thres:warning --log=smpi_mpi.thres:error --log=smpi_io.thres:verbose "--log=root.fmt:(%P@%h)%e%m%n" --cfg=smpi/simulate-computation:0 ${bindir:=.}/io-all
+> You requested to use 4 ranks, but there is only 2 processes in your hostfile...
+> [rank 0] -> bob
+> [rank 1] -> carl
+> [rank 2] -> bob
+> [rank 3] -> carl
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 8
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 12
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 4
+> (3@carl) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (3@carl) Position after write in MPI_File /scratch/testfile : 16
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 12
+> (1@carl) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (1@carl) Position after write in MPI_File /scratch/testfile : 8
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 4
+> (2@bob) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (2@bob) Position after write in MPI_File /scratch/testfile : 12
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 8
+> (0@bob) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (0@bob) Position after write in MPI_File /scratch/testfile : 4
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 39
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 26
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 13
+> (3@carl) Write in MPI_File /scratch/testfile, 12 bytes written, readsize 12 bytes, movesize 12
+> (3@carl) Position after write in MPI_File /scratch/testfile : 51
+> (1@carl) Write in MPI_File /scratch/testfile, 12 bytes written, readsize 12 bytes, movesize 12
+> (1@carl) Position after write in MPI_File /scratch/testfile : 25
+> (0@bob) Write in MPI_File /scratch/testfile, 12 bytes written, readsize 12 bytes, movesize 12
+> (0@bob) Position after write in MPI_File /scratch/testfile : 12
+> (2@bob) Write in MPI_File /scratch/testfile, 12 bytes written, readsize 12 bytes, movesize 12
+> (2@bob) Position after write in MPI_File /scratch/testfile : 38
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 8
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 12
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 4
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 26
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 39
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 13
+> (3@carl) Read in MPI_File /scratch/testfile, 12 bytes read, readsize 12 bytes, movesize 12
+> (3@carl) Position after read in MPI_File /scratch/testfile : 51
+> (1@carl) Read in MPI_File /scratch/testfile, 12 bytes read, readsize 12 bytes, movesize 12
+> (1@carl) Position after read in MPI_File /scratch/testfile : 25
+> (2@bob) Read in MPI_File /scratch/testfile, 12 bytes read, readsize 12 bytes, movesize 12
+> (2@bob) Position after read in MPI_File /scratch/testfile : 38
+> (0@bob) Read in MPI_File /scratch/testfile, 12 bytes read, readsize 12 bytes, movesize 12
+> (0@bob) Position after read in MPI_File /scratch/testfile : 12
diff --git a/teshsuite/smpi/io-ordered/io-ordered.c b/teshsuite/smpi/io-ordered/io-ordered.c
new file mode 100644 (file)
index 0000000..c34409a
--- /dev/null
@@ -0,0 +1,50 @@
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <memory.h>
+
+/* Test reading and writing zero bytes (set status correctly) */
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int size;
+    int rank;
+    int i;
+    int* buf;
+    int count;
+    MPI_File fh;
+    MPI_Comm comm;
+    MPI_Status status;
+    MPI_Init( &argc, &argv );
+    comm = MPI_COMM_WORLD;
+    MPI_File_open( comm, (char*)"/scratch/testfile", MPI_MODE_RDWR | MPI_MODE_CREATE | MPI_MODE_DELETE_ON_CLOSE, MPI_INFO_NULL, &fh );
+    MPI_Comm_size( comm, &size );
+    MPI_Comm_rank( comm, &rank );
+    buf = (int *)malloc( 10* sizeof(int) );
+    buf[0] = rank;
+    /* Write to file */
+    MPI_File_write_ordered( fh, buf, 10, MPI_INT, &status );
+    MPI_Get_count( &status, MPI_INT, &count );
+    if (count != 10) {
+        errs++;
+        fprintf( stderr, "Wrong count (%d) on write-ordered\n", count );fflush(stderr);
+    }
+    MPI_Barrier( comm );
+    MPI_File_seek_shared( fh, 0, MPI_SEEK_SET );
+    for (i=0; i<size; i++) buf[i] = -1;
+    MPI_File_read_ordered( fh, buf, 10, MPI_INT, &status );
+
+    MPI_Barrier(comm);
+    MPI_File_seek_shared( fh, 0, MPI_SEEK_SET );
+
+    free( buf );
+    MPI_File_close( &fh );
+    MPI_Finalize();
+    return errs;
+}
diff --git a/teshsuite/smpi/io-ordered/io-ordered.tesh b/teshsuite/smpi/io-ordered/io-ordered.tesh
new file mode 100644 (file)
index 0000000..dedb550
--- /dev/null
@@ -0,0 +1,40 @@
+# Test for MPI_File_read and MPI_File_write
+! output sort
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_io -platform ../../../examples/platforms/hosts_with_disks.xml -np 4 --log=xbt_cfg.thres:critical --log=smpi_kernel.thres:warning --log=smpi_mpi.thres:error --log=smpi_io.thres:verbose "--log=root.fmt:(%P@%h)%e%m%n" --cfg=smpi/simulate-computation:0 ${bindir:=.}/io-ordered
+> You requested to use 4 ranks, but there is only 2 processes in your hostfile...
+> [rank 0] -> bob
+> [rank 1] -> carl
+> [rank 2] -> bob
+> [rank 3] -> carl
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 80
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 40
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 120
+> (3@carl) Write in MPI_File /scratch/testfile, 40 bytes written, readsize 40 bytes, movesize 40
+> (3@carl) Position after write in MPI_File /scratch/testfile : 160
+> (1@carl) Write in MPI_File /scratch/testfile, 40 bytes written, readsize 40 bytes, movesize 40
+> (1@carl) Position after write in MPI_File /scratch/testfile : 80
+> (2@bob) Write in MPI_File /scratch/testfile, 40 bytes written, readsize 40 bytes, movesize 40
+> (2@bob) Position after write in MPI_File /scratch/testfile : 120
+> (0@bob) Write in MPI_File /scratch/testfile, 40 bytes written, readsize 40 bytes, movesize 40
+> (0@bob) Position after write in MPI_File /scratch/testfile : 40
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 80
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 40
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 120
+> (3@carl) Read in MPI_File /scratch/testfile, 40 bytes read, readsize 40 bytes, movesize 40
+> (3@carl) Position after read in MPI_File /scratch/testfile : 160
+> (1@carl) Read in MPI_File /scratch/testfile, 40 bytes read, readsize 40 bytes, movesize 40
+> (1@carl) Position after read in MPI_File /scratch/testfile : 80
+> (2@bob) Read in MPI_File /scratch/testfile, 40 bytes read, readsize 40 bytes, movesize 40
+> (2@bob) Position after read in MPI_File /scratch/testfile : 120
+> (0@bob) Read in MPI_File /scratch/testfile, 40 bytes read, readsize 40 bytes, movesize 40
+> (0@bob) Position after read in MPI_File /scratch/testfile : 40
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 0
diff --git a/teshsuite/smpi/io-shared/io-shared.c b/teshsuite/smpi/io-shared/io-shared.c
new file mode 100644 (file)
index 0000000..e4b90d2
--- /dev/null
@@ -0,0 +1,65 @@
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <memory.h>
+
+/* Test reading and writing zero bytes (set status correctly) */
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int size;
+    int rank;
+    int* buf;
+    int count;
+    MPI_File fh;
+    MPI_Comm comm;
+    MPI_Status status;
+    MPI_Init( &argc, &argv );
+    comm = MPI_COMM_WORLD;
+    MPI_File_open( comm, (char*)"/scratch/testfile", MPI_MODE_RDWR | MPI_MODE_CREATE | MPI_MODE_DELETE_ON_CLOSE, MPI_INFO_NULL, &fh );
+    MPI_Comm_size( comm, &size );
+    MPI_Comm_rank( comm, &rank );
+    buf = (int *)malloc( sizeof(int) );
+    buf[0] = rank;
+
+    MPI_File_seek_shared( fh, 0, MPI_SEEK_SET );
+    MPI_Barrier(comm);
+    
+    memset( &status, 0xff, sizeof(MPI_Status) );
+    MPI_File_write_shared( fh, buf, 1, MPI_INT, &status );
+    MPI_Get_count( &status, MPI_INT, &count );
+    if (count != 1) {
+        errs++;
+        fprintf( stderr, "Count not one (%d) on write\n", count );fflush(stderr);
+    }
+
+    /* Write nothing (check status) */
+    memset( &status, 0xff, sizeof(MPI_Status) );
+    MPI_File_write_shared( fh, buf, 0, MPI_INT, &status );
+    MPI_Get_count( &status, MPI_INT, &count );
+    if (count != 0) {
+        errs++;
+        fprintf( stderr, "Count not zero (%d) on write\n", count );fflush(stderr);
+    }
+
+    MPI_File_seek_shared( fh, 0, MPI_SEEK_SET );
+    MPI_Barrier(comm);
+    
+    memset( &status, 0xff, sizeof(MPI_Status) );
+    MPI_File_read_shared( fh, buf, 1, MPI_INT, &status );
+    MPI_Get_count( &status, MPI_INT, &count );
+    if (count != 1) {
+        errs++;
+        fprintf( stderr, "Count not zero (%d) on read shared\n", count );fflush(stderr);
+    }
+
+    free( buf );
+    MPI_File_close( &fh );
+    MPI_Finalize();
+    return errs;
+}
diff --git a/teshsuite/smpi/io-shared/io-shared.tesh b/teshsuite/smpi/io-shared/io-shared.tesh
new file mode 100644 (file)
index 0000000..8dba085
--- /dev/null
@@ -0,0 +1,40 @@
+# Test for MPI_File_read and MPI_File_write
+! output sort
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_io -platform ../../../examples/platforms/hosts_with_disks.xml -np 4 --log=xbt_cfg.thres:critical --log=smpi_kernel.thres:warning --log=smpi_mpi.thres:error --log=smpi_io.thres:verbose "--log=root.fmt:(%P@%h)%e%m%n" --cfg=smpi/simulate-computation:0 ${bindir:=.}/io-shared
+> You requested to use 4 ranks, but there is only 2 processes in your hostfile...
+> [rank 0] -> bob
+> [rank 1] -> carl
+> [rank 2] -> bob
+> [rank 3] -> carl
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (0@bob) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (0@bob) Position after write in MPI_File /scratch/testfile : 4
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (2@bob) Position after write in MPI_File /scratch/testfile : 4
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (3@carl) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (3@carl) Position after write in MPI_File /scratch/testfile : 4
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 4
+> (1@carl) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (1@carl) Position after write in MPI_File /scratch/testfile : 8
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (0@bob) Read in MPI_File /scratch/testfile, 4 bytes read, readsize 4 bytes, movesize 4
+> (0@bob) Position after read in MPI_File /scratch/testfile : 4
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 4
+> (2@bob) Read in MPI_File /scratch/testfile, 0 bytes read, readsize 4 bytes, movesize 4
+> (2@bob) Position after read in MPI_File /scratch/testfile : 4
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 4
+> (3@carl) Read in MPI_File /scratch/testfile, 0 bytes read, readsize 4 bytes, movesize 4
+> (3@carl) Position after read in MPI_File /scratch/testfile : 4
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 4
+> (1@carl) Read in MPI_File /scratch/testfile, 4 bytes read, readsize 4 bytes, movesize 4
+> (1@carl) Position after read in MPI_File /scratch/testfile : 8
diff --git a/teshsuite/smpi/io-simple-at/io-simple-at.c b/teshsuite/smpi/io-simple-at/io-simple-at.c
new file mode 100644 (file)
index 0000000..9ad28f1
--- /dev/null
@@ -0,0 +1,69 @@
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <memory.h>
+
+/* Test reading and writing zero bytes (set status correctly) */
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int size;
+    int rank;
+    int i;
+    int* buf;
+    int count;
+    MPI_File fh;
+    MPI_Comm comm;
+    MPI_Status status;
+    MPI_Init( &argc, &argv );
+    comm = MPI_COMM_WORLD;
+    MPI_File_open( comm, (char*)"/scratch/testfile", MPI_MODE_RDWR | MPI_MODE_CREATE | MPI_MODE_DELETE_ON_CLOSE, MPI_INFO_NULL, &fh );
+    MPI_Comm_size( comm, &size );
+    MPI_Comm_rank( comm, &rank );
+    buf = (int *)malloc( size * sizeof(int) );
+    buf[0] = rank;
+    /* Write to file */
+    MPI_File_write_at( fh, sizeof(int)*rank, buf, 1, MPI_INT, &status );
+    MPI_Get_count( &status, MPI_INT, &count );
+    if (count != 1) {
+        errs++;
+        fprintf( stderr, "Wrong count (%d) on write_at\n", count );fflush(stderr);
+    }
+
+    /* Read nothing (check status) */
+    memset( &status, 0xff, sizeof(MPI_Status) );
+    MPI_File_read_at( fh, sizeof(int)*rank, buf, 0, MPI_INT, &status );
+    MPI_Get_count( &status, MPI_INT, &count );
+    if (count != 0) {
+        errs++;
+        fprintf( stderr, "Count not zero (%d) on read\n", count );fflush(stderr);
+    }
+
+    /* Write nothing (check status) */
+    memset( &status, 0xff, sizeof(MPI_Status) );
+    MPI_File_write_at( fh, sizeof(int)*rank, buf, 0, MPI_INT, &status );
+    if (count != 0) {
+        errs++;
+        fprintf( stderr, "Count not zero (%d) on write\n", count );fflush(stderr);
+    }
+
+    MPI_Barrier( comm );
+
+    for (i=0; i<size; i++) buf[i] = -1;
+    MPI_File_read_at( fh, sizeof(int)*rank, buf, 1, MPI_INT, &status );
+    // if (buf[0] != rank) {
+        // errs++;
+        // fprintf( stderr, "%d: buf = %d\n", rank, buf[0] );fflush(stderr);
+    // }
+    free( buf );
+    MPI_File_close( &fh );
+    MPI_Finalize();
+    return errs;
+}
diff --git a/teshsuite/smpi/io-simple-at/io-simple-at.tesh b/teshsuite/smpi/io-simple-at/io-simple-at.tesh
new file mode 100644 (file)
index 0000000..f8ff027
--- /dev/null
@@ -0,0 +1,32 @@
+# Test for MPI_File_read and MPI_File_write
+! output sort
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_io -platform ../../../examples/platforms/hosts_with_disks.xml -np 4 --log=xbt_cfg.thres:critical --log=smpi_kernel.thres:warning --log=smpi_mpi.thres:error --log=smpi_io.thres:verbose "--log=root.fmt:(%P@%h)%e%m%n" --cfg=smpi/simulate-computation:0 ${bindir:=.}/io-simple-at
+> You requested to use 4 ranks, but there is only 2 processes in your hostfile...
+> [rank 0] -> bob
+> [rank 1] -> carl
+> [rank 2] -> bob
+> [rank 3] -> carl
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 8
+> (0@bob) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (0@bob) Position after write in MPI_File /scratch/testfile : 4
+> (2@bob) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (2@bob) Position after write in MPI_File /scratch/testfile : 12
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 12
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 4
+> (3@carl) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (3@carl) Position after write in MPI_File /scratch/testfile : 16
+> (1@carl) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (1@carl) Position after write in MPI_File /scratch/testfile : 8
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 8
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 12
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 4
+> (3@carl) Read in MPI_File /scratch/testfile, 4 bytes read, readsize 4 bytes, movesize 4
+> (3@carl) Position after read in MPI_File /scratch/testfile : 16
+> (1@carl) Read in MPI_File /scratch/testfile, 4 bytes read, readsize 4 bytes, movesize 4
+> (1@carl) Position after read in MPI_File /scratch/testfile : 8
+> (0@bob) Read in MPI_File /scratch/testfile, 4 bytes read, readsize 4 bytes, movesize 4
+> (0@bob) Position after read in MPI_File /scratch/testfile : 4
+> (2@bob) Read in MPI_File /scratch/testfile, 4 bytes read, readsize 4 bytes, movesize 4
+> (2@bob) Position after read in MPI_File /scratch/testfile : 12
diff --git a/teshsuite/smpi/io-simple/io-simple.c b/teshsuite/smpi/io-simple/io-simple.c
new file mode 100644 (file)
index 0000000..f4563c3
--- /dev/null
@@ -0,0 +1,71 @@
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <memory.h>
+
+/* Test reading and writing zero bytes (set status correctly) */
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int size;
+    int rank;
+    int i;
+    int* buf;
+    int count;
+    MPI_File fh;
+    MPI_Comm comm;
+    MPI_Status status;
+    MPI_Init( &argc, &argv );
+    comm = MPI_COMM_WORLD;
+    MPI_File_open( comm, (char*)"/scratch/testfile", MPI_MODE_RDWR | MPI_MODE_CREATE | MPI_MODE_DELETE_ON_CLOSE, MPI_INFO_NULL, &fh );
+    MPI_Comm_size( comm, &size );
+    MPI_Comm_rank( comm, &rank );
+    buf = (int *)malloc( size * sizeof(int) );
+    buf[0] = rank;
+    /* Write to file */
+    MPI_File_seek( fh, sizeof(int)*rank, MPI_SEEK_SET ); 
+    MPI_File_write( fh, buf, 1, MPI_INT, &status );
+    MPI_Get_count( &status, MPI_INT, &count );
+    if (count != 1) {
+        errs++;
+        fprintf( stderr, "Wrong count (%d) on write\n", count );fflush(stderr);
+    }
+
+    /* Read nothing (check status) */
+    memset( &status, 0xff, sizeof(MPI_Status) );
+    MPI_File_read( fh, buf, 0, MPI_INT, &status );
+    MPI_Get_count( &status, MPI_INT, &count );
+    if (count != 0) {
+        errs++;
+        fprintf( stderr, "Count not zero (%d) on read\n", count );fflush(stderr);
+    }
+
+    /* Write nothing (check status) */
+    memset( &status, 0xff, sizeof(MPI_Status) );
+    MPI_File_write( fh, buf, 0, MPI_INT, &status );
+    if (count != 0) {
+        errs++;
+        fprintf( stderr, "Count not zero (%d) on write\n", count );fflush(stderr);
+    }
+
+    MPI_Barrier( comm );
+
+    MPI_File_seek( fh, sizeof(int)*rank, MPI_SEEK_SET );
+    for (i=0; i<size; i++) buf[i] = -1;
+    MPI_File_read( fh, buf, 1, MPI_INT, &status );
+    // if (buf[0] != rank) {
+        // errs++;
+        // fprintf( stderr, "%d: buf = %d\n", rank, buf[0] );fflush(stderr);
+    // }
+    free( buf );
+    MPI_File_close( &fh );
+    MPI_Finalize();
+    return errs;
+}
diff --git a/teshsuite/smpi/io-simple/io-simple.tesh b/teshsuite/smpi/io-simple/io-simple.tesh
new file mode 100644 (file)
index 0000000..bd56168
--- /dev/null
@@ -0,0 +1,32 @@
+# Test for MPI_File_read and MPI_File_write
+! output sort
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_io -platform ../../../examples/platforms/hosts_with_disks.xml -np 4 --log=xbt_cfg.thres:critical --log=smpi_kernel.thres:warning --log=smpi_mpi.thres:error --log=smpi_io.thres:verbose "--log=root.fmt:(%P@%h)%e%m%n" --cfg=smpi/simulate-computation:0 ${bindir:=.}/io-simple
+> You requested to use 4 ranks, but there is only 2 processes in your hostfile...
+> [rank 0] -> bob
+> [rank 1] -> carl
+> [rank 2] -> bob
+> [rank 3] -> carl
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 8
+> (0@bob) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (0@bob) Position after write in MPI_File /scratch/testfile : 4
+> (2@bob) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (2@bob) Position after write in MPI_File /scratch/testfile : 12
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 12
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 4
+> (3@carl) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (3@carl) Position after write in MPI_File /scratch/testfile : 16
+> (1@carl) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (1@carl) Position after write in MPI_File /scratch/testfile : 8
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 8
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 12
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 4
+> (3@carl) Read in MPI_File /scratch/testfile, 4 bytes read, readsize 4 bytes, movesize 4
+> (3@carl) Position after read in MPI_File /scratch/testfile : 16
+> (1@carl) Read in MPI_File /scratch/testfile, 4 bytes read, readsize 4 bytes, movesize 4
+> (1@carl) Position after read in MPI_File /scratch/testfile : 8
+> (0@bob) Read in MPI_File /scratch/testfile, 4 bytes read, readsize 4 bytes, movesize 4
+> (0@bob) Position after read in MPI_File /scratch/testfile : 4
+> (2@bob) Read in MPI_File /scratch/testfile, 4 bytes read, readsize 4 bytes, movesize 4
+> (2@bob) Position after read in MPI_File /scratch/testfile : 12
index 5dc3cd1..2619992 100644 (file)
@@ -110,8 +110,6 @@ set(umpire_src_other
   change-send-buffer-type-exhaustive.c
   collective-exhaustive-byte-int-mismatch.c
   collective-exhaustive-no-error.c
-  collective-misorder.c
-  collective-misorder2.c
 
   deadlock-config_blocking.c
   errhandler-no-error.c
@@ -226,7 +224,7 @@ if(enable_smpi AND enable_model-checking AND enable_smpi_ISP_testsuite)
     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:ompi \${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/buffering:zero --cfg=smpi/coll-selector:ompi \${bindir:=.}/${test} --log=smpi_coll.thresh:error" APPEND)
   endforeach()
 endif()
 
index af9fd48..6eb375a 100644 (file)
@@ -12,4 +12,17 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ../hostfile -platform
 > [3] The value in the shared buffer is: 4
 > hashing !
 
+! 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 --cfg=smpi/shared-malloc:local
+> [0] After change, the value in the shared buffer is: 16053117601147974045
+> [0] The value in the shared buffer is: 4
+> [1] After change, the value in the shared buffer is: 16053117601147974045
+> [1] The value in the shared buffer is: 4
+> [2] After change, the value in the shared buffer is: 16053117601147974045
+> [2] The value in the shared buffer is: 4
+> [3] After change, the value in the shared buffer is: 16053117601147974045
+> [3] The value in the shared buffer is: 4
+> hashing !
+
 
index 140fedb..b8c8967 100644 (file)
@@ -21,9 +21,6 @@ set(txt_files  ${txt_files}  ${CMAKE_CURRENT_SOURCE_DIR}/README
                              ${CMAKE_CURRENT_SOURCE_DIR}/util/mtestcheck.c
                              ${CMAKE_CURRENT_SOURCE_DIR}/util/mtest_datatype.c
                              ${CMAKE_CURRENT_SOURCE_DIR}/util/mtest_datatype_gen.c
-                             ${CMAKE_CURRENT_SOURCE_DIR}/util/mtest_manual.c
-                             ${CMAKE_CURRENT_SOURCE_DIR}/util/mtest_datatype_gen_manual.c
-                             ${CMAKE_CURRENT_SOURCE_DIR}/util/dtypes_manual.c
                              ${CMAKE_CURRENT_SOURCE_DIR}/f77/testlist
                              ${CMAKE_CURRENT_SOURCE_DIR}/f90/testlist
                              ${CMAKE_CURRENT_SOURCE_DIR}/include/dtypes.h
@@ -47,11 +44,10 @@ include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include/")
 
 if(enable_smpi AND enable_smpi_MPICH3_testsuite)
-#C version - use automatic privatization if mmap is supported, manual through SMPI macros if not
   if(HAVE_PRIVATIZATION)
     add_library(mtest_c STATIC util/dtypes.c util/mtest.c  util/mtestcheck.c  util/mtest_datatype.c util/mtest_datatype_gen.c)
   else()
-    add_library(mtest_c STATIC util/mtest_manual.c util/dtypes_manual.c util/mtestcheck.c util/mtest_datatype.c util/mtest_datatype_gen_manual.c)
+    message(FATAL_ERROR "MPICH testsuite needs privatization. Use a modern OS.")
   endif()
 endif()
 
index 2b6a852..d85adf5 100644 (file)
@@ -14,33 +14,24 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite)
           alltoallv0 alltoallv alltoallw1 alltoallw2 alltoallw_zeros
           bcasttest bcastzerotype coll2 coll3 coll4 coll5 coll6 coll7 coll8
           coll9 coll10 coll11 coll12 coll13 exscan exscan2 gather gather2 
-          gather_big ibarrier longuser nonblocking nonblocking2
-        # iallred icallgather icallgatherv icallreduce
+          gather_big ibarrier longuser nonblocking nonblocking2 iallred
+        # icallgather icallgatherv icallreduce
         # icalltoall icalltoallv icalltoallw icbarrier icbcast
         # icgather icgatherv icreduce icscatter icscatterv
-        # nonblocking3 
-        # opband opbor opbxor opland oplor oplxor opmax opmaxloc
-        # opmin opminloc opprod opsum
+         opband opbor opbxor opland oplor oplxor opmax opmaxloc
+         opmin opminloc opprod opsum 
+         #nonblocking3
           op_commutative red3 red4 redscat2 redscat3 redscatbkinter redscatblk3
-          redscat red_scat_block red_scat_block2
+          redscat red_scat_block red_scat_block2 allgatherv4 allred
         # redscatinter
           reduce_local scantst scatter2 scatter3 scattern scatterv
-        # uoplong
+         uoplong
          )
     add_executable(${test} EXCLUDE_FROM_ALL ${test}.c)
     add_dependencies(tests ${test})
     target_link_libraries(${test} simgrid mtest_c)
   endforeach()
 
-  foreach(test allgatherv4 allred)
-    if(HAVE_PRIVATIZATION)
-      add_executable(${test} EXCLUDE_FROM_ALL ${test}.c)
-    else()
-      add_executable(${test} EXCLUDE_FROM_ALL ${test}_manual.c)
-    endif()
-    add_dependencies(tests ${test})
-    target_link_libraries(${test} simgrid mtest_c)
-  endforeach()
   set_target_properties(allred PROPERTIES COMPILE_FLAGS "-O0" LINK_FLAGS "-O0")
 
   foreach(test bcast_full bcast_min_datatypes bcast_comm_world)
@@ -99,14 +90,12 @@ set(examples_src  ${examples_src}
  ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv2.c 
  ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv3.c 
  ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv4.c 
- ${CMAKE_CURRENT_SOURCE_DIR}/allgatherv4_manual.c 
  ${CMAKE_CURRENT_SOURCE_DIR}/allred2.c 
  ${CMAKE_CURRENT_SOURCE_DIR}/allred3.c 
  ${CMAKE_CURRENT_SOURCE_DIR}/allred4.c 
  ${CMAKE_CURRENT_SOURCE_DIR}/allred5.c 
  ${CMAKE_CURRENT_SOURCE_DIR}/allred6.c 
  ${CMAKE_CURRENT_SOURCE_DIR}/allred.c 
- ${CMAKE_CURRENT_SOURCE_DIR}/allred_manual.c 
  ${CMAKE_CURRENT_SOURCE_DIR}/allredmany.c 
  ${CMAKE_CURRENT_SOURCE_DIR}/alltoall1.c 
  ${CMAKE_CURRENT_SOURCE_DIR}/alltoallv0.c 
diff --git a/teshsuite/smpi/mpich3-test/coll/allgatherv4_manual.c b/teshsuite/smpi/mpich3-test/coll/allgatherv4_manual.c
deleted file mode 100644 (file)
index ff76581..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- *  (C) 2003 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-#include "mpi.h"
-#include "mpitest.h"
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include <time.h>
-#include <math.h>
-#include <assert.h>
-
-/* FIXME: What is this test supposed to accomplish? */
-
-#define START_BUF (1)
-#define LARGE_BUF (256 * 1024)
-
-/* FIXME: MAX_BUF is too large */
-#define MAX_BUF   (32 * 1024 * 1024)
-#define LOOPS 10
-
-SMPI_VARINIT_GLOBAL(sbuf, char*);
-SMPI_VARINIT_GLOBAL(rbuf, char*);
-SMPI_VARINIT_GLOBAL(recvcounts, int*);
-SMPI_VARINIT_GLOBAL(displs, int*);
-SMPI_VARINIT_GLOBAL_AND_SET(errs, int, 0);
-
-/* #define dprintf printf */
-#define dprintf(...)
-
-typedef enum {
-    REGULAR,
-    BCAST,
-    SPIKE,
-    HALF_FULL,
-    LINEAR_DECREASE,
-    BELL_CURVE
-} test_t;
-
-void comm_tests(MPI_Comm comm);
-double run_test(long long msg_size, MPI_Comm comm, test_t test_type, double * max_time);
-
-int main(int argc, char ** argv)
-{
-    int comm_size, comm_rank;
-    MPI_Comm comm;
-
-    MTest_Init(&argc, &argv);
-    MPI_Comm_size(MPI_COMM_WORLD, &comm_size);
-    MPI_Comm_rank(MPI_COMM_WORLD, &comm_rank);
-
-    if (LARGE_BUF * comm_size > MAX_BUF)
-        goto fn_exit;
-
-    SMPI_VARGET_GLOBAL(sbuf) = (void *) calloc(MAX_BUF, 1);
-    SMPI_VARGET_GLOBAL(rbuf) = (void *) calloc(MAX_BUF, 1);
-
-    srand(time(NULL));
-
-    SMPI_VARGET_GLOBAL(recvcounts) = (void *) malloc(comm_size * sizeof(int));
-    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 %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);
-    }
-
-    if (!comm_rank) {
-        dprintf("Message Range: (%d, %d); System size: %d\n", START_BUF, LARGE_BUF, comm_size);
-        fflush(stdout);
-    }
-
-
-    /* COMM_WORLD tests */
-    if (!comm_rank) {
-        dprintf("\n\n==========================================================\n");
-        dprintf("                         MPI_COMM_WORLD\n");
-        dprintf("==========================================================\n");
-    }
-    comm_tests(MPI_COMM_WORLD);
-
-    /* non-COMM_WORLD tests */
-    if (!comm_rank) {
-        dprintf("\n\n==========================================================\n");
-        dprintf("                         non-COMM_WORLD\n");
-        dprintf("==========================================================\n");
-    }
-    MPI_Comm_split(MPI_COMM_WORLD, (comm_rank == comm_size - 1) ? 0 : 1, 0, &comm);
-    if (comm_rank < comm_size - 1)
-        comm_tests(comm);
-    MPI_Comm_free(&comm);
-
-    /* Randomized communicator tests */
-    if (!comm_rank) {
-        dprintf("\n\n==========================================================\n");
-        dprintf("                         Randomized Communicator\n");
-        dprintf("==========================================================\n");
-    }
-    MPI_Comm_split(MPI_COMM_WORLD, 0, rand(), &comm);
-    comm_tests(comm);
-    MPI_Comm_free(&comm);
-
-    //free(SMPI_VARGET_GLOBAL(sbuf));
-    //free(SMPI_VARGET_GLOBAL(rbuf));
-    free(SMPI_VARGET_GLOBAL(recvcounts));
-    free(SMPI_VARGET_GLOBAL(displs));
-
-fn_exit:
-    MTest_Finalize(SMPI_VARGET_GLOBAL(errs));
-    MPI_Finalize();
-
-    return 0;
-}
-
-void comm_tests(MPI_Comm comm)
-{
-    int comm_size, comm_rank;
-    double rtime = rtime;       /* stop warning about unused variable */
-    double max_time;
-    long long msg_size;
-
-    MPI_Comm_size(comm, &comm_size);
-    MPI_Comm_rank(comm, &comm_rank);
-
-    for (msg_size = START_BUF; msg_size <= LARGE_BUF; msg_size *= 2) {
-        if (!comm_rank) {
-            dprintf("\n====> MSG_SIZE: %d\n", (int) msg_size);
-            fflush(stdout);
-        }
-
-        rtime = run_test(msg_size, comm, REGULAR, &max_time);
-        if (!comm_rank) {
-            dprintf("REGULAR:\tAVG: %.3f\tMAX: %.3f\n", rtime, max_time);
-            fflush(stdout);
-        }
-
-        rtime = run_test(msg_size, comm, BCAST, &max_time);
-        if (!comm_rank) {
-            dprintf("BCAST:\tAVG: %.3f\tMAX: %.3f\n", rtime, max_time);
-            fflush(stdout);
-        }
-
-        rtime = run_test(msg_size, comm, SPIKE, &max_time);
-        if (!comm_rank) {
-            dprintf("SPIKE:\tAVG: %.3f\tMAX: %.3f\n", rtime, max_time);
-            fflush(stdout);
-        }
-
-        rtime = run_test(msg_size, comm, HALF_FULL, &max_time);
-        if (!comm_rank) {
-            dprintf("HALF_FULL:\tAVG: %.3f\tMAX: %.3f\n", rtime, max_time);
-            fflush(stdout);
-        }
-
-        rtime = run_test(msg_size, comm, LINEAR_DECREASE, &max_time);
-        if (!comm_rank) {
-            dprintf("LINEAR_DECREASE:\tAVG: %.3f\tMAX: %.3f\n", rtime, max_time);
-            fflush(stdout);
-        }
-
-        rtime = run_test(msg_size, comm, BELL_CURVE, &max_time);
-        if (!comm_rank) {
-            dprintf("BELL_CURVE:\tAVG: %.3f\tMAX: %.3f\n", rtime, max_time);
-            fflush(stdout);
-        }
-    }
-}
-
-double run_test(long long msg_size, MPI_Comm comm, test_t test_type,
-               double * max_time)
-{
-    int i, j;
-    int comm_size, comm_rank;
-    double start, end;
-    double total_time, avg_time;
-    MPI_Aint tmp;
-
-    MPI_Comm_size(comm, &comm_size);
-    MPI_Comm_rank(comm, &comm_rank);
-
-    SMPI_VARGET_GLOBAL(displs)[0] = 0;
-    for (i = 0; i < comm_size; i++) {
-        if (test_type == REGULAR)
-            SMPI_VARGET_GLOBAL(recvcounts)[i] = msg_size;
-        else if (test_type == BCAST)
-            SMPI_VARGET_GLOBAL(recvcounts)[i] = (!i) ? msg_size : 0;
-        else if (test_type == SPIKE)
-            SMPI_VARGET_GLOBAL(recvcounts)[i] = (!i) ? (msg_size / 2) : (msg_size / (2 * (comm_size - 1)));
-        else if (test_type == HALF_FULL)
-            SMPI_VARGET_GLOBAL(recvcounts)[i] = (i < (comm_size / 2)) ? (2 * msg_size) : 0;
-        else if (test_type == LINEAR_DECREASE) {
-            tmp = 2 * msg_size * (comm_size - 1 - i) / (comm_size - 1);
-           if (tmp != (int)tmp) {
-               fprintf( stderr, "Integer overflow in variable tmp\n" );
-               MPI_Abort( MPI_COMM_WORLD, 1 );
-                exit(1);
-           }
-            SMPI_VARGET_GLOBAL(recvcounts)[i] = (int) tmp;
-
-            /* If the maximum message size is too large, don't run */
-            if (tmp > MAX_BUF) return 0;
-        }
-        else if (test_type == BELL_CURVE) {
-            for (j = 0; j < i; j++) {
-                if (i - 1 + j >= comm_size) continue;
-                tmp = msg_size * comm_size / (log(comm_size) * i);
-                SMPI_VARGET_GLOBAL(recvcounts)[i - 1 + j] = (int) tmp;
-                SMPI_VARGET_GLOBAL(displs)[i - 1 + j] = 0;
-
-                /* If the maximum message size is too large, don't run */
-                if (tmp > MAX_BUF) return 0;
-            }
-        }
-
-        if (i < comm_size - 1)
-            SMPI_VARGET_GLOBAL(displs)[i+1] = SMPI_VARGET_GLOBAL(displs)[i] + SMPI_VARGET_GLOBAL(recvcounts)[i];
-    }
-
-    /* Test that:
-       1: sbuf is large enough
-       2: rbuf is large enough
-       3: There were no failures (e.g., tmp nowhere > rbuf size
-    */
-    MPI_Barrier(comm);
-    start = MPI_Wtime();
-    for (i = 0; i < LOOPS; i++) {
-        MPI_Allgatherv(SMPI_VARGET_GLOBAL(sbuf), SMPI_VARGET_GLOBAL(recvcounts)[comm_rank], MPI_CHAR,
-                       SMPI_VARGET_GLOBAL(rbuf), SMPI_VARGET_GLOBAL(recvcounts), SMPI_VARGET_GLOBAL(displs), MPI_CHAR, comm);
-    }
-    end = MPI_Wtime();
-    MPI_Barrier(comm);
-
-    /* Convert to microseconds (why?) */
-    total_time = 1.0e6 * (end - start);
-    MPI_Reduce(&total_time, &avg_time, 1, MPI_DOUBLE, MPI_SUM, 0, comm);
-    MPI_Reduce(&total_time, max_time, 1, MPI_DOUBLE, MPI_MAX, 0, comm);
-
-    return (avg_time / (LOOPS * comm_size));
-}
index ea6fff5..431fcdb 100644 (file)
@@ -279,54 +279,56 @@ struct double_test {
     }
 
 #if MTEST_HAVE_MIN_MPI_VERSION(2,2)
-#define test_types_set_mpi_2_2_integer(op,post) do {                \
-        op##_test##post(int8_t, MPI_INT8_T);                        \
-        op##_test##post(int16_t, MPI_INT16_T);                      \
-        op##_test##post(int32_t, MPI_INT32_T);                      \
-        op##_test##post(int64_t, MPI_INT64_T);                      \
-        op##_test##post(uint8_t, MPI_UINT8_T);                      \
-        op##_test##post(uint16_t, MPI_UINT16_T);                    \
-        op##_test##post(uint32_t, MPI_UINT32_T);                    \
-        op##_test##post(uint64_t, MPI_UINT64_T);                    \
-        op##_test##post(MPI_Aint, MPI_AINT);                        \
-        op##_test##post(MPI_Offset, MPI_OFFSET);                    \
-    } while (0)
+#define test_types_set_mpi_2_2_integer(op, post)                                                                       \
+  do {                                                                                                                 \
+    _XBT_CONCAT3(op, _test, post)(int8_t, MPI_INT8_T);                                                                 \
+    _XBT_CONCAT3(op, _test, post)(int16_t, MPI_INT16_T);                                                               \
+    _XBT_CONCAT3(op, _test, post)(int32_t, MPI_INT32_T);                                                               \
+    _XBT_CONCAT3(op, _test, post)(int64_t, MPI_INT64_T);                                                               \
+    _XBT_CONCAT3(op, _test, post)(uint8_t, MPI_UINT8_T);                                                               \
+    _XBT_CONCAT3(op, _test, post)(uint16_t, MPI_UINT16_T);                                                             \
+    _XBT_CONCAT3(op, _test, post)(uint32_t, MPI_UINT32_T);                                                             \
+    _XBT_CONCAT3(op, _test, post)(uint64_t, MPI_UINT64_T);                                                             \
+    _XBT_CONCAT3(op, _test, post)(MPI_Aint, MPI_AINT);                                                                 \
+    _XBT_CONCAT3(op, _test, post)(MPI_Offset, MPI_OFFSET);                                                             \
+  } while (0)
 #else
 #define test_types_set_mpi_2_2_integer(op,post) do { } while (0)
 #endif
 
 #if MTEST_HAVE_MIN_MPI_VERSION(3,0)
-#define test_types_set_mpi_3_0_integer(op,post) do {                \
-        op##_test##post(MPI_Count, MPI_COUNT);                      \
-    } while (0)
+#define test_types_set_mpi_3_0_integer(op, post)                                                                       \
+  do {                                                                                                                 \
+    _XBT_CONCAT3(op, _test, post)(MPI_Count, MPI_COUNT);                                                               \
+  } while (0)
 #else
 #define test_types_set_mpi_3_0_integer(op,post) do { } while (0)
 #endif
 
-#define test_types_set1(op, post)                                   \
-    {                                                               \
-        op##_test##post(int, MPI_INT);                              \
-        op##_test##post(long, MPI_LONG);                            \
-        op##_test##post(short, MPI_SHORT);                          \
-        op##_test##post(unsigned short, MPI_UNSIGNED_SHORT);        \
-        op##_test##post(unsigned, MPI_UNSIGNED);                    \
-        op##_test##post(unsigned long, MPI_UNSIGNED_LONG);          \
-        op##_test##post(unsigned char, MPI_UNSIGNED_CHAR);          \
-        test_types_set_mpi_2_2_integer(op,post);                    \
-        test_types_set_mpi_3_0_integer(op,post);                    \
-    }
-
-#define test_types_set2(op, post)               \
-    {                                           \
-        test_types_set1(op, post);              \
-        op##_test##post(float, MPI_FLOAT);      \
-        op##_test##post(double, MPI_DOUBLE);    \
-    }
-
-#define test_types_set3(op, post)                                   \
-    {                                                               \
-        op##_test##post(unsigned char, MPI_BYTE);                   \
-    }
+#define test_types_set1(op, post)                                                                                      \
+  {                                                                                                                    \
+    _XBT_CONCAT3(op, _test, post)(int, MPI_INT);                                                                       \
+    _XBT_CONCAT3(op, _test, post)(long, MPI_LONG);                                                                     \
+    _XBT_CONCAT3(op, _test, post)(short, MPI_SHORT);                                                                   \
+    _XBT_CONCAT3(op, _test, post)(unsigned short, MPI_UNSIGNED_SHORT);                                                 \
+    _XBT_CONCAT3(op, _test, post)(unsigned, MPI_UNSIGNED);                                                             \
+    _XBT_CONCAT3(op, _test, post)(unsigned long, MPI_UNSIGNED_LONG);                                                   \
+    _XBT_CONCAT3(op, _test, post)(unsigned char, MPI_UNSIGNED_CHAR);                                                   \
+    test_types_set_mpi_2_2_integer(op, post);                                                                          \
+    test_types_set_mpi_3_0_integer(op, post);                                                                          \
+  }
+
+#define test_types_set2(op, post)                                                                                      \
+  {                                                                                                                    \
+    test_types_set1(op, post);                                                                                         \
+    _XBT_CONCAT3(op, _test, post)(float, MPI_FLOAT);                                                                   \
+    _XBT_CONCAT3(op, _test, post)(double, MPI_DOUBLE);                                                                 \
+  }
+
+#define test_types_set3(op, post)                                                                                      \
+  {                                                                                                                    \
+    _XBT_CONCAT3(op, _test, post)(unsigned char, MPI_BYTE);                                                            \
+  }
 
 /* Make sure that we test complex and double complex, even if long
    double complex is not available */
@@ -335,14 +337,14 @@ struct double_test {
 #if MTEST_HAVE_MIN_MPI_VERSION(2,2) && defined(HAVE_FLOAT__COMPLEX) \
     && defined(HAVE_DOUBLE__COMPLEX) \
     && defined(HAVE_LONG_DOUBLE__COMPLEX)
-#define test_types_set4(op, post)                                             \
-    do {                                                                      \
-        op##_test##post(float _Complex, MPI_C_FLOAT_COMPLEX);                 \
-        op##_test##post(double _Complex, MPI_C_DOUBLE_COMPLEX);               \
-        if (MPI_C_LONG_DOUBLE_COMPLEX != MPI_DATATYPE_NULL) {                 \
-            op##_test##post(long double _Complex, MPI_C_LONG_DOUBLE_COMPLEX); \
-        }                                                                     \
-    } while (0)
+#define test_types_set4(op, post)                                                                                      \
+  do {                                                                                                                 \
+    _XBT_CONCAT3(op, _test, post)(float _Complex, MPI_C_FLOAT_COMPLEX);                                                \
+    _XBT_CONCAT3(op, _test, post)(double _Complex, MPI_C_DOUBLE_COMPLEX);                                              \
+    if (MPI_C_LONG_DOUBLE_COMPLEX != MPI_DATATYPE_NULL) {                                                              \
+      _XBT_CONCAT3(op, _test, post)(long double _Complex, MPI_C_LONG_DOUBLE_COMPLEX);                                  \
+    }                                                                                                                  \
+  } while (0)
 
 #else
 #define test_types_set4(op, post) do { } while (0)
@@ -351,11 +353,11 @@ struct double_test {
 
 #if MTEST_HAVE_MIN_MPI_VERSION(2,2) && defined(HAVE_FLOAT__COMPLEX) \
     && defined(HAVE_DOUBLE__COMPLEX)
-#define test_types_set4(op, post)                                         \
-    do {                                                                  \
-        op##_test##post(float _Complex, MPI_C_FLOAT_COMPLEX);             \
-        op##_test##post(double _Complex, MPI_C_DOUBLE_COMPLEX);           \
-    } while (0)
+#define test_types_set4(op, post)                                                                                      \
+  do {                                                                                                                 \
+    _XBT_CONCAT3(op, _test, post)(float _Complex, MPI_C_FLOAT_COMPLEX);                                                \
+    _XBT_CONCAT3(op, _test, post)(double _Complex, MPI_C_DOUBLE_COMPLEX);                                              \
+  } while (0)
 
 #else
 #define test_types_set4(op, post) do { } while (0)
@@ -364,10 +366,10 @@ struct double_test {
 #endif /* defined(USE_LONG_DOUBLE_COMPLEX) */
 
 #if MTEST_HAVE_MIN_MPI_VERSION(2,2) && defined(HAVE__BOOL)
-#define test_types_set5(op, post)           \
-    do {                                    \
-        op##_test##post(_Bool, MPI_C_BOOL); \
-    } while (0)
+#define test_types_set5(op, post)                                                                                      \
+  do {                                                                                                                 \
+    _XBT_CONCAT3(op, _test, post)(_Bool, MPI_C_BOOL);                                                                  \
+  } while (0)
 
 #else
 #define test_types_set5(op, post) do { } while (0)
diff --git a/teshsuite/smpi/mpich3-test/coll/allred_manual.c b/teshsuite/smpi/mpich3-test/coll/allred_manual.c
deleted file mode 100644 (file)
index ee57daa..0000000
+++ /dev/null
@@ -1,466 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-/*      Warning - this test will fail for MPI_PROD & maybe MPI_SUM
- *        if more than 10 MPI processes are used.  Loss of precision
- *        will occur as the number of processors is increased.
- */
-
-#include "mpi.h"
-#include "mpitest.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
-
-SMPI_VARINIT_GLOBAL(count, int);
-SMPI_VARINIT_GLOBAL(size, int);
-SMPI_VARINIT_GLOBAL(rank, int);
-SMPI_VARINIT_GLOBAL(cerrcnt, int);
-
-
-struct int_test {
-    int a;
-    int b;
-};
-struct long_test {
-    long a;
-    int b;
-};
-struct short_test {
-    short a;
-    int b;
-};
-struct float_test {
-    float a;
-    int b;
-};
-struct double_test {
-    double a;
-    int b;
-};
-
-#define mpi_op2str(op)                   \
-    ((op == MPI_SUM) ? "MPI_SUM" :       \
-     (op == MPI_PROD) ? "MPI_PROD" :     \
-     (op == MPI_MAX) ? "MPI_MAX" :       \
-     (op == MPI_MIN) ? "MPI_MIN" :       \
-     (op == MPI_LOR) ? "MPI_LOR" :       \
-     (op == MPI_LXOR) ? "MPI_LXOR" :     \
-     (op == MPI_LAND) ? "MPI_LAND" :     \
-     (op == MPI_BOR) ? "MPI_BOR" :       \
-     (op == MPI_BAND) ? "MPI_BAND" :     \
-     (op == MPI_BXOR) ? "MPI_BXOR" :     \
-     (op == MPI_MAXLOC) ? "MPI_MAXLOC" : \
-     (op == MPI_MINLOC) ? "MPI_MINLOC" : \
-     "MPI_NO_OP")
-
-/* calloc to avoid spurious valgrind warnings when "type" has padding bytes */
-#define DECL_MALLOC_IN_OUT_SOL(type)                 \
-    type *in, *out, *sol;                            \
-    in  = (type *) calloc(SMPI_VARGET_GLOBAL(count), sizeof(type));      \
-    out = (type *) calloc(SMPI_VARGET_GLOBAL(count), sizeof(type));      \
-    sol = (type *) calloc(SMPI_VARGET_GLOBAL(count), sizeof(type));
-
-#define SET_INDEX_CONST(arr, val)               \
-    {                                           \
-        int i;                                  \
-        for (i = 0; i < SMPI_VARGET_GLOBAL(count); i++)             \
-            arr[i] = val;                       \
-    }
-
-#define SET_INDEX_SUM(arr, val)                 \
-    {                                           \
-        int i;                                  \
-        for (i = 0; i < SMPI_VARGET_GLOBAL(count); i++)             \
-            arr[i] = i + val;                   \
-    }
-
-#define SET_INDEX_FACTOR(arr, val)              \
-    {                                           \
-        int i;                                  \
-        for (i = 0; i < SMPI_VARGET_GLOBAL(count); i++)             \
-            arr[i] = i * (val);                 \
-    }
-
-#define SET_INDEX_POWER(arr, val)               \
-    {                                           \
-        int i, j;                               \
-        for (i = 0; i < SMPI_VARGET_GLOBAL(count); i++) {           \
-            (arr)[i] = 1;                       \
-            for (j = 0; j < (val); j++)         \
-                arr[i] *= i;                    \
-        }                                       \
-    }
-
-#define ERROR_CHECK_AND_FREE(lerrcnt, mpi_type, mpi_op)                 \
-    do {                                                                \
-        char name[MPI_MAX_OBJECT_NAME] = {0};                           \
-        int len = 0;                                                    \
-        if (lerrcnt) {                                                  \
-            MPI_Type_get_name(mpi_type, name, &len);                    \
-            fprintf(stderr, "(%d) Error for type %s and op %s\n",       \
-                    SMPI_VARGET_GLOBAL(rank), name, mpi_op2str(mpi_op));                    \
-        }                                                               \
-        free(in); free(out); free(sol);                                 \
-    } while (0)
-
-/* The logic on the error check on MPI_Allreduce assumes that all
-   MPI_Allreduce routines return a failure if any do - this is sufficient
-   for MPI implementations that reject some of the valid op/datatype pairs
-   (and motivated this addition, as some versions of the IBM MPI
-   failed in just this way).
-*/
-#define ALLREDUCE_AND_FREE(mpi_type, mpi_op, in, out, sol)              \
-    {                                                                   \
-        int i, rc, lerrcnt = 0;                                                \
-        rc = MPI_Allreduce(in, out, SMPI_VARGET_GLOBAL(count), mpi_type, mpi_op, MPI_COMM_WORLD); \
-       if (rc) { lerrcnt++; SMPI_VARGET_GLOBAL(cerrcnt)++; MTestPrintError(rc); }        \
-       else {                                                          \
-          for (i = 0; i < SMPI_VARGET_GLOBAL(count); i++) {                                   \
-              if (out[i] != sol[i]) {                                     \
-                  SMPI_VARGET_GLOBAL(cerrcnt)++;                                              \
-                  lerrcnt++;                                              \
-              }                                                           \
-          }                                                              \
-        }                                                               \
-        ERROR_CHECK_AND_FREE(lerrcnt, mpi_type, mpi_op);                \
-    }
-
-#define STRUCT_ALLREDUCE_AND_FREE(mpi_type, mpi_op, in, out, sol)       \
-    {                                                                   \
-        int i, rc, lerrcnt = 0;                                                \
-        rc = MPI_Allreduce(in, out, SMPI_VARGET_GLOBAL(count), mpi_type, mpi_op, MPI_COMM_WORLD); \
-       if (rc) { lerrcnt++; SMPI_VARGET_GLOBAL(cerrcnt)++; MTestPrintError(rc); }        \
-        else {                                                            \
-          for (i = 0; i < SMPI_VARGET_GLOBAL(count); i++) {                                   \
-              if ((out[i].a != sol[i].a) || (out[i].b != sol[i].b)) {     \
-                  SMPI_VARGET_GLOBAL(cerrcnt)++;                                              \
-                  lerrcnt++;                                              \
-              }                                                           \
-            }                                                             \
-        }                                                               \
-        ERROR_CHECK_AND_FREE(lerrcnt, mpi_type, mpi_op);                \
-    }
-
-#define SET_INDEX_STRUCT_CONST(arr, val, el)                    \
-    {                                                           \
-        int i;                                                  \
-        for (i = 0; i < SMPI_VARGET_GLOBAL(count); i++)                             \
-            arr[i].el = val;                                    \
-    }
-
-#define SET_INDEX_STRUCT_SUM(arr, val, el)                      \
-    {                                                           \
-        int i;                                                  \
-        for (i = 0; i < SMPI_VARGET_GLOBAL(count); i++)                             \
-            arr[i].el = i + (val);                              \
-    }
-
-#define sum_test1(type, mpi_type)                                       \
-    {                                                                   \
-        DECL_MALLOC_IN_OUT_SOL(type);                                   \
-        SET_INDEX_SUM(in, 0);                                           \
-        SET_INDEX_FACTOR(sol, SMPI_VARGET_GLOBAL(size));                                    \
-        SET_INDEX_CONST(out, 0);                                        \
-        ALLREDUCE_AND_FREE(mpi_type, MPI_SUM, in, out, sol);            \
-    }
-
-#define prod_test1(type, mpi_type)                                      \
-    {                                                                   \
-        DECL_MALLOC_IN_OUT_SOL(type);                                   \
-        SET_INDEX_SUM(in, 0);                                           \
-        SET_INDEX_POWER(sol, SMPI_VARGET_GLOBAL(size));                                     \
-        SET_INDEX_CONST(out, 0);                                        \
-        ALLREDUCE_AND_FREE(mpi_type, MPI_PROD, in, out, sol);           \
-    }
-
-#define max_test1(type, mpi_type)                                       \
-    {                                                                   \
-        DECL_MALLOC_IN_OUT_SOL(type);                                   \
-        SET_INDEX_SUM(in, SMPI_VARGET_GLOBAL(rank));                                        \
-        SET_INDEX_SUM(sol, SMPI_VARGET_GLOBAL(size) - 1);                                   \
-        SET_INDEX_CONST(out, 0);                                        \
-        ALLREDUCE_AND_FREE(mpi_type, MPI_MAX, in, out, sol);            \
-    }
-
-#define min_test1(type, mpi_type)                                       \
-    {                                                                   \
-        DECL_MALLOC_IN_OUT_SOL(type);                                   \
-        SET_INDEX_SUM(in, SMPI_VARGET_GLOBAL(rank));                                        \
-        SET_INDEX_SUM(sol, 0);                                          \
-        SET_INDEX_CONST(out, 0);                                        \
-        ALLREDUCE_AND_FREE(mpi_type, MPI_MIN, in, out, sol);            \
-    }
-
-#define const_test(type, mpi_type, mpi_op, val1, val2, val3)            \
-    {                                                                   \
-        DECL_MALLOC_IN_OUT_SOL(type);                                   \
-        SET_INDEX_CONST(in, (val1));                                    \
-        SET_INDEX_CONST(sol, (val2));                                   \
-        SET_INDEX_CONST(out, (val3));                                   \
-        ALLREDUCE_AND_FREE(mpi_type, mpi_op, in, out, sol);             \
-    }
-
-#define lor_test1(type, mpi_type)                                       \
-    const_test(type, mpi_type, MPI_LOR, (SMPI_VARGET_GLOBAL(rank) & 0x1), (SMPI_VARGET_GLOBAL(size) > 1), 0)
-#define lor_test2(type, mpi_type)                       \
-    const_test(type, mpi_type, MPI_LOR, 0, 0, 0)
-#define lxor_test1(type, mpi_type)                                      \
-    const_test(type, mpi_type, MPI_LXOR, (SMPI_VARGET_GLOBAL(rank) == 1), (SMPI_VARGET_GLOBAL(size) > 1), 0)
-#define lxor_test2(type, mpi_type)                      \
-    const_test(type, mpi_type, MPI_LXOR, 0, 0, 0)
-#define lxor_test3(type, mpi_type)                      \
-    const_test(type, mpi_type, MPI_LXOR, 1, (SMPI_VARGET_GLOBAL(size) & 0x1), 0)
-#define land_test1(type, mpi_type)                              \
-    const_test(type, mpi_type, MPI_LAND, (SMPI_VARGET_GLOBAL(rank) & 0x1), 0, 0)
-#define land_test2(type, mpi_type)                      \
-    const_test(type, mpi_type, MPI_LAND, 1, 1, 0)
-#define bor_test1(type, mpi_type)                                       \
-    const_test(type, mpi_type, MPI_BOR, (SMPI_VARGET_GLOBAL(rank) & 0x3), ((SMPI_VARGET_GLOBAL(size) < 3) ? SMPI_VARGET_GLOBAL(size) - 1 : 0x3), 0)
-#define bxor_test1(type, mpi_type)                                      \
-    const_test(type, mpi_type, MPI_BXOR, (SMPI_VARGET_GLOBAL(rank) == 1) * 0xf0, (SMPI_VARGET_GLOBAL(size) > 1) * 0xf0, 0)
-#define bxor_test2(type, mpi_type)                      \
-    const_test(type, mpi_type, MPI_BXOR, 0, 0, 0)
-#define bxor_test3(type, mpi_type)                      \
-    const_test(type, mpi_type, MPI_BXOR, ~0, (SMPI_VARGET_GLOBAL(size) &0x1) ? ~0 : 0, 0)
-
-#define band_test1(type, mpi_type)                                      \
-    {                                                                   \
-        DECL_MALLOC_IN_OUT_SOL(type);                                   \
-        if (SMPI_VARGET_GLOBAL(rank) == SMPI_VARGET_GLOBAL(size)-1) {                                           \
-            SET_INDEX_SUM(in, 0);                                       \
-        }                                                               \
-        else {                                                          \
-            SET_INDEX_CONST(in, ~0);                                    \
-        }                                                               \
-        SET_INDEX_SUM(sol, 0);                                          \
-        SET_INDEX_CONST(out, 0);                                        \
-        ALLREDUCE_AND_FREE(mpi_type, MPI_BAND, in, out, sol);           \
-    }
-
-#define band_test2(type, mpi_type)                                      \
-    {                                                                   \
-        DECL_MALLOC_IN_OUT_SOL(type);                                   \
-        if (SMPI_VARGET_GLOBAL(rank) == SMPI_VARGET_GLOBAL(size)-1) {                                           \
-            SET_INDEX_SUM(in, 0);                                       \
-        }                                                               \
-        else {                                                          \
-            SET_INDEX_CONST(in, 0);                                     \
-        }                                                               \
-        SET_INDEX_CONST(sol, 0);                                        \
-        SET_INDEX_CONST(out, 0);                                        \
-        ALLREDUCE_AND_FREE(mpi_type, MPI_BAND, in, out, sol);           \
-    }
-
-#define maxloc_test(type, mpi_type)                                     \
-    {                                                                   \
-        DECL_MALLOC_IN_OUT_SOL(type);                                   \
-        SET_INDEX_STRUCT_SUM(in, SMPI_VARGET_GLOBAL(rank), a);                              \
-        SET_INDEX_STRUCT_CONST(in, SMPI_VARGET_GLOBAL(rank), b);                            \
-        SET_INDEX_STRUCT_SUM(sol, SMPI_VARGET_GLOBAL(size) - 1, a);                         \
-        SET_INDEX_STRUCT_CONST(sol, SMPI_VARGET_GLOBAL(size) - 1, b);                       \
-        SET_INDEX_STRUCT_CONST(out, 0, a);                              \
-        SET_INDEX_STRUCT_CONST(out, -1, b);                             \
-        STRUCT_ALLREDUCE_AND_FREE(mpi_type, MPI_MAXLOC, in, out, sol);   \
-    }
-
-#define minloc_test(type, mpi_type)                                     \
-    {                                                                   \
-        DECL_MALLOC_IN_OUT_SOL(type);                                   \
-        SET_INDEX_STRUCT_SUM(in, SMPI_VARGET_GLOBAL(rank), a);                              \
-        SET_INDEX_STRUCT_CONST(in, SMPI_VARGET_GLOBAL(rank), b);                            \
-        SET_INDEX_STRUCT_SUM(sol, 0, a);                                \
-        SET_INDEX_STRUCT_CONST(sol, 0, b);                              \
-        SET_INDEX_STRUCT_CONST(out, 0, a);                              \
-        SET_INDEX_STRUCT_CONST(out, -1, b);                             \
-        STRUCT_ALLREDUCE_AND_FREE(mpi_type, MPI_MINLOC, in, out, sol);  \
-    }
-
-#if MTEST_HAVE_MIN_MPI_VERSION(2,2)
-#define test_types_set_mpi_2_2_integer(op,post) do {                \
-        op##_test##post(int8_t, MPI_INT8_T);                        \
-        op##_test##post(int16_t, MPI_INT16_T);                      \
-        op##_test##post(int32_t, MPI_INT32_T);                      \
-        op##_test##post(int64_t, MPI_INT64_T);                      \
-        op##_test##post(uint8_t, MPI_UINT8_T);                      \
-        op##_test##post(uint16_t, MPI_UINT16_T);                    \
-        op##_test##post(uint32_t, MPI_UINT32_T);                    \
-        op##_test##post(uint64_t, MPI_UINT64_T);                    \
-        op##_test##post(MPI_Aint, MPI_AINT);                        \
-        op##_test##post(MPI_Offset, MPI_OFFSET);                    \
-    } while (0)
-#else
-#define test_types_set_mpi_2_2_integer(op,post) do { } while (0)
-#endif
-
-#if MTEST_HAVE_MIN_MPI_VERSION(3,0)
-#define test_types_set_mpi_3_0_integer(op,post) do {                \
-        op##_test##post(MPI_Count, MPI_COUNT);                      \
-    } while (0)
-#else
-#define test_types_set_mpi_3_0_integer(op,post) do { } while (0)
-#endif
-
-#define test_types_set1(op, post)                                   \
-    {                                                               \
-        op##_test##post(int, MPI_INT);                              \
-        op##_test##post(long, MPI_LONG);                            \
-        op##_test##post(short, MPI_SHORT);                          \
-        op##_test##post(unsigned short, MPI_UNSIGNED_SHORT);        \
-        op##_test##post(unsigned, MPI_UNSIGNED);                    \
-        op##_test##post(unsigned long, MPI_UNSIGNED_LONG);          \
-        op##_test##post(unsigned char, MPI_UNSIGNED_CHAR);          \
-        test_types_set_mpi_2_2_integer(op,post);                    \
-        test_types_set_mpi_3_0_integer(op,post);                    \
-    }
-
-#define test_types_set2(op, post)               \
-    {                                           \
-        test_types_set1(op, post);              \
-        op##_test##post(float, MPI_FLOAT);      \
-        op##_test##post(double, MPI_DOUBLE);    \
-    }
-
-#define test_types_set3(op, post)                                   \
-    {                                                               \
-        op##_test##post(unsigned char, MPI_BYTE);                   \
-    }
-
-/* Make sure that we test complex and double complex, even if long
-   double complex is not available */
-#if defined(USE_LONG_DOUBLE_COMPLEX)
-
-#if MTEST_HAVE_MIN_MPI_VERSION(2,2) && defined(HAVE_FLOAT__COMPLEX) \
-    && defined(HAVE_DOUBLE__COMPLEX) \
-    && defined(HAVE_LONG_DOUBLE__COMPLEX)
-#define test_types_set4(op, post)                                             \
-    do {                                                                      \
-        op##_test##post(float _Complex, MPI_C_FLOAT_COMPLEX);                 \
-        op##_test##post(double _Complex, MPI_C_DOUBLE_COMPLEX);               \
-        if (MPI_C_LONG_DOUBLE_COMPLEX != MPI_DATATYPE_NULL) {                 \
-            op##_test##post(long double _Complex, MPI_C_LONG_DOUBLE_COMPLEX); \
-        }                                                                     \
-    } while (0)
-
-#else
-#define test_types_set4(op, post) do { } while (0)
-#endif
-#else
-
-#if MTEST_HAVE_MIN_MPI_VERSION(2,2) && defined(HAVE_FLOAT__COMPLEX) \
-    && defined(HAVE_DOUBLE__COMPLEX)
-#define test_types_set4(op, post)                                         \
-    do {                                                                  \
-        op##_test##post(float _Complex, MPI_C_FLOAT_COMPLEX);             \
-        op##_test##post(double _Complex, MPI_C_DOUBLE_COMPLEX);           \
-    } while (0)
-
-#else
-#define test_types_set4(op, post) do { } while (0)
-#endif
-
-#endif /* defined(USE_LONG_DOUBLE_COMPLEX) */
-
-#if MTEST_HAVE_MIN_MPI_VERSION(2,2) && defined(HAVE__BOOL)
-#define test_types_set5(op, post)           \
-    do {                                    \
-        op##_test##post(_Bool, MPI_C_BOOL); \
-    } while (0)
-
-#else
-#define test_types_set5(op, post) do { } while (0)
-#endif
-
-int main(int argc, char **argv)
-{
-    MTest_Init(&argc, &argv);
-
-    MPI_Comm_size(MPI_COMM_WORLD, &SMPI_VARGET_GLOBAL(size));
-    MPI_Comm_rank(MPI_COMM_WORLD, &SMPI_VARGET_GLOBAL(rank));
-
-    if (SMPI_VARGET_GLOBAL(size) < 2) {
-        fprintf(stderr, "At least 2 processes required\n");
-        MPI_Abort(MPI_COMM_WORLD, 1);
-    }
-
-    /* Set errors return so that we can provide better information
-     * should a routine reject one of the operand/datatype pairs */
-    MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
-
-    SMPI_VARGET_GLOBAL(count) = 10;
-    /* Allow an argument to override the count.
-     * Note that the product tests may fail if the count is very large.
-     */
-    if (argc >= 2) {
-        SMPI_VARGET_GLOBAL(count) = atoi(argv[1]);
-        if (SMPI_VARGET_GLOBAL(count) <= 0) {
-            fprintf(stderr, "Invalid count argument %s\n", argv[1]);
-            MPI_Abort(MPI_COMM_WORLD, 1);
-        }
-    }
-
-    test_types_set2(sum, 1);
-    test_types_set2(prod, 1);
-    test_types_set2(max, 1);
-    test_types_set2(min, 1);
-
-    test_types_set1(lor, 1);
-    test_types_set1(lor, 2);
-
-    test_types_set1(lxor, 1);
-    test_types_set1(lxor, 2);
-    test_types_set1(lxor, 3);
-
-    test_types_set1(land, 1);
-    test_types_set1(land, 2);
-
-    test_types_set1(bor, 1);
-    test_types_set1(band, 1);
-    test_types_set1(band, 2);
-
-    test_types_set1(bxor, 1);
-    test_types_set1(bxor, 2);
-    test_types_set1(bxor, 3);
-
-    test_types_set3(bor, 1);
-    test_types_set3(band, 1);
-    test_types_set3(band, 2);
-
-    test_types_set3(bxor, 1);
-    test_types_set3(bxor, 2);
-    test_types_set3(bxor, 3);
-
-    test_types_set4(sum, 1);
-    test_types_set4(prod, 1);
-
-    test_types_set5(lor, 1);
-    test_types_set5(lor, 2);
-    test_types_set5(lxor, 1);
-    test_types_set5(lxor, 2);
-    test_types_set5(lxor, 3);
-    test_types_set5(land, 1);
-    test_types_set5(land, 2);
-
-    maxloc_test(struct int_test, MPI_2INT);
-    maxloc_test(struct long_test, MPI_LONG_INT);
-    maxloc_test(struct short_test, MPI_SHORT_INT);
-    maxloc_test(struct float_test, MPI_FLOAT_INT);
-    maxloc_test(struct double_test, MPI_DOUBLE_INT);
-
-    minloc_test(struct int_test, MPI_2INT);
-    minloc_test(struct long_test, MPI_LONG_INT);
-    minloc_test(struct short_test, MPI_SHORT_INT);
-    minloc_test(struct float_test, MPI_FLOAT_INT);
-    minloc_test(struct double_test, MPI_DOUBLE_INT);
-
-    MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL);
-    MTest_Finalize(SMPI_VARGET_GLOBAL(cerrcnt));
-    MPI_Finalize();
-    return 0;
-}
index 9b3df59..76828b6 100644 (file)
@@ -27,7 +27,7 @@ static int errs = 0;
 
 /* Constants that control the high level test harness behavior. */
 /* MAIN_ITERATIONS is how many NBC ops the test will attempt to issue. */
-#define MAIN_ITERATIONS (100000)
+#define MAIN_ITERATIONS (1000)
 /* WINDOW is the maximum number of outstanding NBC requests at any given time */
 #define WINDOW (20)
 /* we sleep with probability 1/CHANCE_OF_SLEEP */
@@ -95,8 +95,8 @@ struct laundry {
     int *recvcounts;
     int *sdispls;
     int *rdispls;
-    int *sendtypes;
-    int *recvtypes;
+    MPI_Datatype *sendtypes;
+    MPI_Datatype *recvtypes;
 };
 
 static void cleanup_laundry(struct laundry *l)
@@ -136,8 +136,8 @@ static void start_random_nonblocking(MPI_Comm comm, unsigned int rndnum, MPI_Req
     int *recvcounts = NULL;
     int *sdispls = NULL;
     int *rdispls = NULL;
-    int *sendtypes = NULL;
-    int *recvtypes = NULL;
+    MPI_Datatype *sendtypes = NULL;
+    MPI_Datatype *recvtypes = NULL;
     signed char *buf_alias = NULL;
 
     MPI_Comm_rank(comm, &rank);
@@ -415,12 +415,6 @@ static void check_after_completion(struct laundry *l)
     MPI_Comm comm = l->comm;
     int *buf = l->buf;
     int *recvbuf = l->recvbuf;
-    int *sendcounts = l->sendcounts;
-    int *recvcounts = l->recvcounts;
-    int *sdispls = l->sdispls;
-    int *rdispls = l->rdispls;
-    int *sendtypes = l->sendtypes;
-    int *recvtypes = l->recvtypes;
     char *buf_alias = (char *) buf;
 
     MPI_Comm_rank(comm, &rank);
@@ -802,7 +796,7 @@ int main(int argc, char **argv)
         complete_seq = gen_prn(complete_seq);
         for (i = 0; i < outcount; ++i) {
             int idx = indices[i];
-            assert(reqs[idx] == MPI_REQUEST_NULL);
+          //  assert(reqs[idx] == MPI_REQUEST_NULL);
             if (larr[idx].case_num != -1) {
                 check_after_completion(&larr[idx]);
                 cleanup_laundry(&larr[idx]);
index 5cf9414..6a84bf2 100644 (file)
@@ -112,24 +112,24 @@ scatterv 4
 #icalltoallw 7
 # the opxxx tests look at optional types, and are included for MPICH testing.
 # MPI implementations may instead signal errors for these types
-#opland 4
-#oplor 4
-#oplxor 4
-#oplxor 5
-#opband 4
-#opbor 4
-#opbxor 4
-#opbxor 5
-#opprod 5
-#opprod 6
-#opsum 4
-#opmin 4
-#opminloc 4
-#opmax 5
-#opmaxloc 5
-#uoplong 4
-#uoplong 11
-#uoplong 16
+opland 4
+oplor 4
+oplxor 4
+oplxor 5
+opband 4
+opbor 4
+opbxor 4
+opbxor 5
+opprod 5
+opprod 6
+opsum 4
+opmin 4
+opminloc 4
+opmax 5
+opmaxloc 5
+uoplong 4
+uoplong 11
+uoplong 16
 nonblocking 4
 nonblocking 5
 nonblocking 10
@@ -137,19 +137,19 @@ nonblocking2 1
 nonblocking2 4
 nonblocking2 5
 nonblocking2 10
-nonblocking3 1 mpiversion=3.0
-nonblocking3 4 mpiversion=3.0
-nonblocking3 5 mpiversion=3.0
-nonblocking3 10 timeLimit=600 mpiversion=3.0
-iallred 2 mpiversion=3.0
+#nonblocking3 1 mpiversion=3.0
+#nonblocking3 4 mpiversion=3.0
+#nonblocking3 5 mpiversion=3.0
+#nonblocking3 10 timeLimit=600 mpiversion=3.0
+iallred 2
 # ibarrier will hang forever if it fails, but will complete quickly if it
 # succeeds
 ibarrier 2 timeLimit=30
 
 # run some of the tests, relinked with the nbc_pmpi_adaptor.o file
-nballtoall1 8 mpiversion=3.0
-nbcoll2 5     mpiversion=3.0
-nbredscat 4   mpiversion=3.0
-nbredscat 8   mpiversion=3.0
-nbredscat3 8  mpiversion=3.0
-nbredscatinter 8 mpiversion=3.0
+#nballtoall1 8 mpiversion=3.0
+#nbcoll2 5     mpiversion=3.0
+#nbredscat 4   mpiversion=3.0
+#nbredscat 8   mpiversion=3.0
+#nbredscat3 8  mpiversion=3.0
+#nbredscatinter 8 mpiversion=3.0
index ab8a43f..8344461 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #define MAX_ERRS 10
-#define MAX_COUNT 1200000
+#define MAX_COUNT 120000
 
 void myop(void *cinPtr, void *coutPtr, int *count, MPI_Datatype * dtype);
 
index 712e5d5..e075b3f 100644 (file)
@@ -10,9 +10,9 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite)
   include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
   foreach(file cmfree cmsplit2 cmsplit cmsplit_type commcreate1 comm_create_group comm_group_half comm_group_rand 
-          comm_info ctxalloc ctxsplit dup dup_with_info) 
+          comm_info ctxalloc ctxsplit dup dup_with_info commname
     # not compiled files
-    # comm_idup comm_idup_mul comm_idup_overlap commname dupic ic1 ic2 iccreate icgroup icm icsplit probe-intercomm 
+    # comm_idup comm_idup_mul comm_idup_overlap  dupic ic1 ic2 iccreate icgroup icm icsplit probe-intercomm 
     add_executable(${file} EXCLUDE_FROM_ALL ${file}.c)
     add_dependencies(tests ${file})
     target_link_libraries(${file} simgrid mtest_c)
@@ -25,7 +25,7 @@ if (enable_smpi_MPICH3_testsuite AND HAVE_RAW_CONTEXTS)
 endif()
 
 foreach(file cmfree cmsplit2 cmsplit cmsplit_type commcreate1 comm_create_group comm_group_half comm_group_rand 
-        comm_idup comm_idup_overlap comm_idup_mul comm_info commname ctxalloc ctxsplit dup dupic dup_with_info ic1 ic2 
+        comm_info commname ctxalloc ctxsplit dup dupic dup_with_info ic1 ic2 
         iccreate icgroup icm icsplit probe-intercomm comm_create_group_idup comm_idup_comm comm_idup_mul comm_idup comm_idup_iallreduce comm_idup_nb comm_idup_comm2 comm_idup_isend comm_idup_overlap
 )
   set(examples_src ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/${file}.c)
index 29e3b1b..e047c25 100644 (file)
@@ -35,7 +35,7 @@ int main(int argc, char **argv)
     MPI_Comm_get_info(comm, &info_out);
 
     MPI_Info_get(info_out, invalid_key, MPI_MAX_INFO_VAL, buf, &flag);
-#ifndef USE_STRICT_MPI
+#ifdef USE_STRICT_MPI
     /* Check if our invalid key was ignored.  Note, this check's MPICH's
      * behavior, but this behavior may not be required for a standard
      * conforming MPI implementation. */
index 97c8466..39c8094 100644 (file)
@@ -25,7 +25,7 @@ int main(int argc, char **argv)
 
     MPI_Errhandler_set(newcomm1, MPI_ERRORS_RETURN);
     /* Allocate many communicators in batches, then free them */
-    for (i = 0; i < 1000; i++) {
+    for (i = 0; i < 100; i++) {
         for (j = 0; j < 200; j++) {
             err = MPI_Comm_dup(newcomm1, &newcomm2[j]);
             if (err) {
index c150ff5..fe46d37 100644 (file)
@@ -27,7 +27,7 @@ int main(int argc, char **argv)
     int errs = 0;
     MPI_Comm newcomm;
     double startTime;
-    int nLoop = 10000;
+    int nLoop = 1000;
 
     MTest_Init(&argc, &argv);
 
index f8b8296..8580d3f 100644 (file)
@@ -4,8 +4,7 @@ dup 2
 #works, but needs MPI_Comm_set_name
 commcreate1 8
 commcreate1 1
-#needs MPI_Comm_set_name and MPI_Intercomm_create
-#commname 4
+commname 4
 #ic1 4
 # ic2 needs an unusually large number of processes (>= 33)
 #ic2 33
@@ -28,11 +27,11 @@ comm_group_half 8 mpiversion=3.0
 comm_group_rand 2 mpiversion=3.0
 comm_group_rand 4 mpiversion=3.0
 comm_group_rand 8 mpiversion=3.0
-comm_idup 2 mpiversion=3.0
-comm_idup 4 mpiversion=3.0
-comm_idup 9 mpiversion=3.0
-comm_idup_mul 2 mpiversion=3.0
-comm_idup_overlap 2 mpiversion=3.0
+#comm_idup 2 mpiversion=3.0
+#comm_idup 4 mpiversion=3.0
+#comm_idup 9 mpiversion=3.0
+#comm_idup_mul 2 mpiversion=3.0
+#comm_idup_overlap 2 mpiversion=3.0
 dup_with_info 2 mpiversion=3.0
 dup_with_info 4 mpiversion=3.0
 dup_with_info 9 mpiversion=3.0
index 98fb32c..d85299f 100644 (file)
@@ -61,7 +61,8 @@ struct-derived-zeros 1
 struct-verydeep 1
 #get-elements 1
 hindexed_block 1 mpiversion=3.0
-hindexed_block_contents 1 mpiversion=3.0
+#needs MPI_Type_get_envelope
+#hindexed_block_contents 1 mpiversion=3.0
 vecblklen 1
 hvecblklen 1
 longdouble 1
diff --git a/teshsuite/smpi/mpich3-test/errhan/CMakeLists.txt b/teshsuite/smpi/mpich3-test/errhan/CMakeLists.txt
new file mode 100644 (file)
index 0000000..5d4ec3a
--- /dev/null
@@ -0,0 +1,28 @@
+if(enable_smpi AND enable_smpi_MPICH3_testsuite)
+  if(WIN32)
+    set(CMAKE_C_FLAGS "-include ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_main.h")
+  else()
+    set(CMAKE_C_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpicc")
+    set(CMAKE_Fortran_COMPILER "${CMAKE_BINARY_DIR}/smpi_script/bin/smpiff")
+  endif()
+
+  include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
+  include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
+
+  foreach(file adderr commcall errfatal predef_eh errstring2 dynamic_errcode_predefined_errclass)
+    add_executable(${file} EXCLUDE_FROM_ALL ${file}.c)
+    add_dependencies(tests ${file})
+    target_link_libraries(${file} simgrid mtest_c)
+  endforeach()
+endif()
+
+if (enable_smpi_MPICH3_testsuite AND HAVE_RAW_CONTEXTS)
+  ADD_TEST(test-smpi-mpich3-errhan-raw       ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/errhan ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests "-wrapper=${TESH_WRAPPER}" -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/errhan -tests=testlist -execarg=--cfg=contexts/factory:raw)
+  SET_TESTS_PROPERTIES(test-smpi-mpich3-errhan-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
+endif()
+
+foreach(file adderr commcall errfatal predef_eh errstring2 dynamic_errcode_predefined_errclass)
+  set(examples_src  ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${file}.c)
+endforeach()
+set(examples_src  ${examples_src}                                        PARENT_SCOPE)
+set(txt_files     ${txt_files}     ${CMAKE_CURRENT_SOURCE_DIR}/testlist  PARENT_SCOPE)
diff --git a/teshsuite/smpi/mpich3-test/errhan/adderr.c b/teshsuite/smpi/mpich3-test/errhan/adderr.c
new file mode 100644 (file)
index 0000000..8c3dcfc
--- /dev/null
@@ -0,0 +1,63 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "mpitest.h"
+#include "mpitestconf.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+/* Create NCLASSES new classes, each with 5 codes (160 total) */
+#define NCLASSES 32
+#define NCODES   5
+
+int main(int argc, char *argv[])
+{
+    int errs = 0;
+    char string[MPI_MAX_ERROR_STRING], outstring[MPI_MAX_ERROR_STRING];
+    int newclass[NCLASSES], newcode[NCLASSES][NCODES];
+    int i, j, slen, outclass;
+
+    MTest_Init(&argc, &argv);
+
+    /* Initialize the new codes */
+    for (i = 0; i < NCLASSES; i++) {
+        MPI_Add_error_class(&newclass[i]);
+        for (j = 0; j < NCODES; j++) {
+            MPI_Add_error_code(newclass[i], &newcode[i][j]);
+            sprintf(string, "code for class %d code %d\n", i, j);
+            MPI_Add_error_string(newcode[i][j], string);
+        }
+    }
+
+    /* check the values */
+    for (i = 0; i < NCLASSES; i++) {
+        MPI_Error_class(newclass[i], &outclass);
+        if (outclass != newclass[i]) {
+            errs++;
+            printf("Error class %d is not a valid error code %d %d\n", i, outclass, newclass[i]);
+        }
+        for (j = 0; j < NCODES; j++) {
+            MPI_Error_class(newcode[i][j], &outclass);
+            if (outclass != newclass[i]) {
+                errs++;
+                printf("Class of code for %d is not correct %d %d\n", j, outclass, newclass[i]);
+            }
+            MPI_Error_string(newcode[i][j], outstring, &slen);
+            sprintf(string, "code for class %d code %d\n", i, j);
+            if (strcmp(outstring, string)) {
+                errs++;
+                printf("Error string is :%s: but should be :%s:\n", outstring, string);
+            }
+        }
+    }
+
+    MTest_Finalize(errs);
+    return MTestReturnValue(errs);
+}
diff --git a/teshsuite/smpi/mpich3-test/errhan/commcall.c b/teshsuite/smpi/mpich3-test/errhan/commcall.c
new file mode 100644 (file)
index 0000000..28e88ed
--- /dev/null
@@ -0,0 +1,93 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+/*
+static char MTEST_Descrip[] = "Test comm_call_errhandler";
+*/
+
+static int calls = 0;
+static int errs = 0;
+static MPI_Comm mycomm;
+void eh(MPI_Comm * comm, int *err, ...);
+void eh(MPI_Comm * comm, int *err, ...)
+{
+    if (*err != MPI_ERR_OTHER) {
+        errs++;
+        printf("Unexpected error code\n");
+    }
+    if (*comm != mycomm) {
+        errs++;
+        printf("Unexpected communicator\n");
+    }
+    calls++;
+    return;
+}
+
+int main(int argc, char *argv[])
+{
+    MPI_Comm comm;
+    MPI_Errhandler newerr;
+    int i;
+    int reset_handler;
+
+    MTest_Init(&argc, &argv);
+
+    comm = MPI_COMM_WORLD;
+    mycomm = comm;
+
+    MPI_Comm_create_errhandler(eh, &newerr);
+
+    MPI_Comm_set_errhandler(comm, newerr);
+    MPI_Comm_call_errhandler(comm, MPI_ERR_OTHER);
+    MPI_Errhandler_free(&newerr);
+    if (calls != 1) {
+        errs++;
+        printf("Error handler not called\n");
+    }
+
+    /* Here we apply the test to many copies of a communicator */
+    for (reset_handler = 0; reset_handler <= 1; ++reset_handler) {
+        for (i = 0; i < 1000; i++) {
+            MPI_Comm comm2;
+            calls = 0;
+            MPI_Comm_dup(MPI_COMM_WORLD, &comm);
+            mycomm = comm;
+            MPI_Comm_create_errhandler(eh, &newerr);
+
+            MPI_Comm_set_errhandler(comm, newerr);
+            MPI_Comm_call_errhandler(comm, MPI_ERR_OTHER);
+            if (calls != 1) {
+                errs++;
+                printf("Error handler not called\n");
+            }
+            MPI_Comm_dup(comm, &comm2);
+            calls = 0;
+            mycomm = comm2;
+            /* comm2 must inherit the error handler from comm */
+            MPI_Comm_call_errhandler(comm2, MPI_ERR_OTHER);
+            if (calls != 1) {
+                errs++;
+                printf("Error handler not called\n");
+            }
+
+            if (reset_handler) {
+                /* extra checking of the reference count handling */
+                MPI_Comm_set_errhandler(comm, MPI_ERRORS_ARE_FATAL);
+            }
+            MPI_Errhandler_free(&newerr);
+
+            MPI_Comm_free(&comm);
+            MPI_Comm_free(&comm2);
+        }
+    }
+
+    MTest_Finalize(errs);
+    return MTestReturnValue(errs);
+}
diff --git a/teshsuite/smpi/mpich3-test/errhan/dynamic_errcode_predefined_errclass.c b/teshsuite/smpi/mpich3-test/errhan/dynamic_errcode_predefined_errclass.c
new file mode 100644 (file)
index 0000000..d697e6f
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ *  (C) 2006 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ *
+ *  Portions of this code were written by Intel Corporation.
+ *  Copyright (C) 2011-2012 Intel Corporation.  Intel provides this material
+ *  to Argonne National Laboratory subject to Software Grant and Corporate
+ *  Contributor License Agreement dated February 8, 2012.
+ */
+
+#include <stdio.h>
+#include <mpi.h>
+#include "mpitest.h"
+
+int main(int argc, char **argv)
+{
+    int errcode, errclass, errs = 0;
+
+    MTest_Init(&argc, &argv);
+
+    MPI_Add_error_code(MPI_ERR_ARG, &errcode);
+    MPI_Error_class(errcode, &errclass);
+
+    if (errclass != MPI_ERR_ARG) {
+        printf("ERROR: Got 0x%d, expected 0x%d\n", errclass, MPI_ERR_ARG);
+        errs++;
+    }
+
+    MTest_Finalize(errs);
+    return MTestReturnValue(errs);
+}
diff --git a/teshsuite/smpi/mpich3-test/errhan/errfatal.c b/teshsuite/smpi/mpich3-test/errhan/errfatal.c
new file mode 100644 (file)
index 0000000..0e9f55a
--- /dev/null
@@ -0,0 +1,46 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2004 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include <mpi.h>
+#include <stdio.h>
+
+/* FIXME: This behavior of this test is implementation specific. */
+
+static int verbose = 0;
+
+int main(int argc, char **argv)
+{
+    int MY_ERROR_CLASS;
+    int MY_ERROR_CODE;
+    char MY_ERROR_STRING[10];
+
+    sprintf(MY_ERROR_STRING, "MY ERROR");
+
+    MPI_Init(&argc, &argv);
+
+    if (verbose)
+        printf("Adding My Error Class\n");
+    MPI_Add_error_class(&MY_ERROR_CLASS);
+    if (verbose)
+        printf("Adding My Error Code\n");
+    MPI_Add_error_code(MY_ERROR_CLASS, &MY_ERROR_CODE);
+    if (verbose)
+        printf("Adding My Error String\n");
+    MPI_Add_error_string(MY_ERROR_CODE, MY_ERROR_STRING);
+
+    if (verbose)
+        printf("Calling Error Handler\n");
+    MPI_Comm_call_errhandler(MPI_COMM_WORLD, MY_ERROR_CODE);
+
+    /* We should not get here, because the default error handler
+     * is ERRORS_ARE_FATAL.  This makes sure that the correct error
+     * handler is called and that no failure occured (such as
+     * a SEGV) in Comm_call_errhandler on the default
+     * error handler. */
+    printf("After the Error Handler Has Been Called\n");
+
+    MPI_Finalize();
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/errhan/errstring2.c b/teshsuite/smpi/mpich3-test/errhan/errstring2.c
new file mode 100644 (file)
index 0000000..e12aafe
--- /dev/null
@@ -0,0 +1,28 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2014 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include <stdio.h>
+#include <mpi.h>
+#include <string.h>
+#include "mpitest.h"
+
+int main(int argc, char *argv[])
+{
+    int errorclass;
+    char errorstring[MPI_MAX_ERROR_STRING] = { 64, 0 };
+    int slen;
+    int errs = 0;
+
+    MTest_Init(&argc, &argv);
+    MPI_Add_error_class(&errorclass);
+    MPI_Error_string(errorclass, errorstring, &slen);
+    if (strncmp(errorstring, "", 1)) {
+        fprintf(stderr, "errorclass:%d errorstring:'%s' len:%d\n", errorclass, errorstring, slen);
+        errs++;
+    }
+    MTest_Finalize(errs);
+    return MTestReturnValue(errs);
+}
diff --git a/teshsuite/smpi/mpich3-test/errhan/predef_eh.c b/teshsuite/smpi/mpich3-test/errhan/predef_eh.c
new file mode 100644 (file)
index 0000000..b7e6ccc
--- /dev/null
@@ -0,0 +1,35 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2012 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include <stdio.h>
+#include <assert.h>
+#include <stdlib.h>
+#include "mpi.h"
+#include "mpitest.h"
+
+/* Ensure that setting a user-defined error handler on predefined
+ * communicators does not cause a problem at finalize time.  Regression
+ * test for ticket #1591 */
+void errf(MPI_Comm * comm, int *ec);
+void errf(MPI_Comm * comm, int *ec)
+{
+    /* do nothing */
+}
+
+int main(int argc, char **argv)
+{
+    MPI_Errhandler errh;
+    int wrank;
+    MTest_Init(&argc, &argv);
+    MPI_Comm_rank(MPI_COMM_WORLD, &wrank);
+    MPI_Comm_create_errhandler((MPI_Comm_errhandler_function *) errf, &errh);
+    MPI_Comm_set_errhandler(MPI_COMM_WORLD, errh);
+    MPI_Comm_set_errhandler(MPI_COMM_SELF, errh);
+    MPI_Errhandler_free(&errh);
+    MTest_Finalize(0);
+    return 0;
+}
diff --git a/teshsuite/smpi/mpich3-test/errhan/testlist b/teshsuite/smpi/mpich3-test/errhan/testlist
new file mode 100644 (file)
index 0000000..9cf33b8
--- /dev/null
@@ -0,0 +1,9 @@
+#needs MPI_Error_class
+#adderr 1
+commcall 2
+errfatal 1 resultTest=TestErrFatal
+predef_eh 1
+predef_eh 2
+#needs MPI_Error_class and such
+#errstring2 1
+#dynamic_errcode_predefined_errclass 1
index 9ea90c1..8deb66a 100644 (file)
@@ -9,11 +9,11 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
 
   foreach(test alltoallvf
-             # allredint8f allredopttf alltoallwf
-              exscanf inplacef
-            # nonblockingf nonblocking_inpf
-              redscatf red_scat_blockf reducelocalf
-              split_typef uallreducef vw_inplacef)
+           allredint8f allredopttf alltoallwf
+           exscanf inplacef
+           nonblockingf nonblocking_inpf
+           redscatf red_scat_blockf reducelocalf
+           split_typef uallreducef vw_inplacef)
     add_executable(${test} EXCLUDE_FROM_ALL ${test}.f)
     add_dependencies(tests ${test})
     target_link_libraries(${test} simgrid mtest_f77)
index b912acd..b2785bb 100644 (file)
@@ -19,7 +19,7 @@ C
       integer ii, ans
 
       errs = 0
-
+      rbuf=0
       call mtest_init(ierr)
 
       comm = MPI_COMM_WORLD
@@ -93,6 +93,24 @@ C
      .                  MPI_SUM, comm, req, ierr)
       call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
 
+      call MPI_Iscatter(sbuf, NUM_INTS, MPI_INTEGER, rbuf, 
+     .                  NUM_INTS, MPI_INTEGER, 0, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Iscatterv(sbuf, scounts, sdispls, MPI_INTEGER,
+     .                   rbuf, NUM_INTS, MPI_INTEGER,
+     .                   0, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Iallgather(sbuf, NUM_INTS, MPI_INTEGER,
+     .                  rbuf, NUM_INTS, MPI_INTEGER, comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
+      call MPI_Iallgatherv(sbuf, NUM_INTS, MPI_INTEGER, 
+     .                  rbuf, rcounts, rdispls, MPI_INTEGER, 
+     .                  comm, req, ierr)
+      call MPI_Wait(req, MPI_STATUS_IGNORE, ierr)
+
       call mtest_finalize( errs )
       call MPI_Finalize( ierr )
       end
index 835bb62..79b6c2e 100644 (file)
@@ -1,12 +1,15 @@
-#uallreducef 4
+uallreducef 4
 exscanf 5
-#alltoallwf 7
+alltoallwf 7
 alltoallvf 7
 inplacef 4
 reducelocalf 2 mpiversion=2.2
 redscatf 4
-split_typef 4 mpiversion=3.0
-nonblockingf 4 mpiversion=3.0
-#vw_inplacef 4 mpiversion=2.2
+split_typef 4
+nonblockingf 4
+vw_inplacef 4 mpiversion=2.2
 red_scat_blockf 4 mpiversion=2.2
-nonblocking_inpf 4 mpiversion=3.0
+nonblocking_inpf 4
+allredint8f 4
+allredopttf 4
+uallreducef 4 
index 8867e04..44b8e3e 100644 (file)
@@ -9,12 +9,12 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
 
  # add_executable(commerrf EXCLUDE_FROM_ALL commerrf.f)
- # add_executable(commnamef EXCLUDE_FROM_ALL commnamef.f)
-
- # add_dependencies(tests commerrf commnamef)
+  add_executable(commnamef EXCLUDE_FROM_ALL commnamef.f)
 
+  add_dependencies(tests commnamef)
+ # add_dependencies(tests commerrf)
  # target_link_libraries(commerrf simgrid mtest_f77)
# target_link_libraries(commnamef simgrid mtest_f77)
+  target_link_libraries(commnamef simgrid mtest_f77)
 endif()
 
 set(examples_src
index ea62837..5132564 100644 (file)
@@ -12,8 +12,8 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/typeaints.h.in typeaints.h @ONLY)
 
   foreach(test gaddressf
-             allctypesf hindex1f hindexed_blockf packef typecntsf
-             typem2f typename3f typenamef typesnamef
+             allctypesf hindex1f hindexed_blockf packef typecntsf
+             typem2f typename3f typenamef typesnamef
               typesubf)
     add_executable(${test} EXCLUDE_FROM_ALL ${test}.f)
     add_dependencies(tests ${test})
index a9e8dcd..66040dc 100644 (file)
@@ -1,11 +1,17 @@
+#C types are not all available in fortran, and some returned names are C ones.
 #typenamef 1
 #typename3f 1 mpiversion=3.0
-#typesnamef 1
+typesnamef 1
+#needs PMPI_Type_get_envelope
 #typecntsf 1
+#needs correct MPI_Type_get_true_extent
 #typem2f 1
 typesubf 1
+#needs MPI_Pack_external_size
 #packef 1
 gaddressf 1
+#C types are not all available in fortran
 #allctypesf 1
-#hindex1f 1
+hindex1f 1
+#needs correct MPI_Type_get_true_extent
 #hindexed_blockf 1 mpiversion=3.0
index 84ac36f..ad9c158 100644 (file)
@@ -7,15 +7,19 @@ 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 EXCLUDE_FROM_ALL allocmemf.f)
-#  add_executable(c2f2cf    EXCLUDE_FROM_ALL c2f2cf.f c2f2c.c)
-#  add_executable(ctypesinf EXCLUDE_FROM_ALL ctypesinf.f ctypesfromc.c)
-# add_dependencies(tests allocmemf c2f2cf ctypesinf)
-
-#  target_link_libraries(allocmemf simgrid mtest_f77)
-#  target_link_libraries(c2f2cf simgrid mtest_f77)
-#  target_link_libraries(ctypesinf simgrid mtest_f77)
+  #  add_executable(allocmemf EXCLUDE_FROM_ALL allocmemf.f)
+  add_executable(c2fmult    EXCLUDE_FROM_ALL c2fmult.c)
+  add_executable(c2f2cf    EXCLUDE_FROM_ALL c2f2cf.f c2f2c.c)
+  #add_executable(ctypesinf EXCLUDE_FROM_ALL ctypesinf.f ctypesfromc.c)
+  add_dependencies(tests c2f2cf c2fmult
+                   #ctypesinf allocmemf
+  )
+  # target_link_libraries(allocmemf simgrid mtest_f77)
+  target_link_libraries(c2fmult simgrid mtest_c)
+  target_link_libraries(c2f2cf simgrid mtest_f77)
+  #target_link_libraries(ctypesinf simgrid mtest_f77)
 endif()
 
 set(examples_src
index 4454e70..b704f72 100644 (file)
@@ -199,7 +199,8 @@ MPI_Fint c2fop_ ( MPI_Fint *op )
 
 MPI_Fint c2ferrhandler_ ( MPI_Fint *errh )
 {
-    MPI_Errhandler errhand = MPI_Errhandler_f2c( *errh );
+    MPI_Errhandler errhand = MPI_ERRORS_RETURN;
+    //MPI_Errhandler errhand = MPI_Errhandler_f2c( *errh );
 
     if (errhand != MPI_ERRORS_RETURN) {
        fprintf( stderr, "Errhandler: did not get errors return\n" );
index 1755925..89850c1 100644 (file)
@@ -41,7 +41,7 @@ C Test passing a Fortran MPI object to C
       errs = errs + c2frequest( req )
       call mpi_wait( req, MPI_STATUS_IGNORE, ierr )
 
-      errs = errs + c2ferrhandler( MPI_ERRORS_RETURN )
+      !errs = errs + c2ferrhandler( MPI_ERRORS_RETURN )
 
       errs = errs + c2fop( MPI_SUM )
 
index 3e1bb3e..07fc599 100644 (file)
@@ -10,13 +10,13 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
 
   add_executable(allpairf  EXCLUDE_FROM_ALL allpairf.f)
-#  add_executable(greqf    EXCLUDE_FROM_ALL greqf.f dummyf.f)
+  add_executable(greqf    EXCLUDE_FROM_ALL greqf.f dummyf.f)
 #  add_executable(mprobef  EXCLUDE_FROM_ALL mprobef.f)
   add_executable(statusesf EXCLUDE_FROM_ALL statusesf.f)
   add_dependencies(tests allpairf statusesf) # greqf mprobef
 
   target_link_libraries(allpairf simgrid mtest_f77)
-#  target_link_libraries(greqf simgrid mtest_f77)
+  target_link_libraries(greqf simgrid mtest_f77)
   #target_link_libraries(mprobef simgrid mtest_f77)
   target_link_libraries(statusesf simgrid mtest_f77)
 endif()
index e6d46aa..49b047f 100644 (file)
@@ -23,13 +23,13 @@ C      verbose = .true.
       do while ( mtestGetIntraComm( comm, 2, .false. ) )
          call test_pair_send( comm, errs )
          call test_pair_ssend( comm, errs )
-         !call test_pair_rsend( comm, errs )
+         call test_pair_rsend( comm, errs )
          call test_pair_isend( comm, errs )
-         !call test_pair_irsend( comm, errs )
+         call test_pair_irsend( comm, errs )
          call test_pair_issend( comm, errs )
-         !call test_pair_psend( comm, errs )
-         !call test_pair_prsend( comm, errs )
-         !call test_pair_pssend( comm, errs )
+         call test_pair_psend( comm, errs )
+         call test_pair_prsend( comm, errs )
+         call test_pair_pssend( comm, errs )
          call test_pair_sendrecv( comm, errs )
          call test_pair_sendrecvrepl( comm, errs )
          call mtestFreeComm( comm )
index b71a61f..4b263fd 100644 (file)
@@ -1,4 +1,4 @@
 statusesf 1
 #greqf 1
 allpairf 2 needs_privatization=1
-mprobef 2 mpiversion=3.0
+#mprobef 2 mpiversion=3.0
index e34c19d..1cadf23 100644 (file)
@@ -9,12 +9,11 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
 
   foreach(test winaccf
-             # winerrf
-              winfencef wingroupf
-            # baseattrwinf winattr2f winattrf
-               wingetf winnamef winscale1f
-            # winscale2f
-              )
+           winfencef wingroupf
+           baseattrwinf winattr2f winattrf
+           wingetf winnamef winscale1f
+         # winscale2f winerrf
+           )
     add_executable(${test} EXCLUDE_FROM_ALL ${test}.f)
     add_dependencies(tests ${test})
     target_link_libraries(${test} simgrid mtest_f77)
index fb0747f..5deb79d 100644 (file)
@@ -3,4 +3,4 @@ C
 C  (C) 2003 by Argonne National Laboratory.
 C      See COPYRIGHT in top-level directory.
 C
-       integer extrastate, valin, valout, val
+       integer(kind=MPI_ADDRESS_KIND) extrastate, valin, valout, val
index 9141374..db7670b 100644 (file)
@@ -9,6 +9,6 @@ winnamef 1
 wingroupf 4 needs_privatization=1
 winaccf 4 needs_privatization=1
 c2f2cwinf 1
-#baseattrwinf 1
-#winattrf 1
-#winattr2f 1
+baseattrwinf 1
+winattrf 1
+winattr2f 1
index 07e0a69..9651b8e 100644 (file)
@@ -9,12 +9,11 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
 
   foreach(test alltoallvf90
-             # allredint8f90 allredopttf90 alltoallwf90 
-              exscanf90 inplacef90 
-            # nonblockingf90 nonblocking_inpf90
-              redscatf90 red_scat_blockf90 reducelocalf90
-               split_typef90 uallreducef90 vw_inplacef90)
-              
+           allredint8f90 allredopttf90 alltoallwf90 
+           exscanf90 inplacef90 
+           nonblockingf90 nonblocking_inpf90
+           redscatf90 red_scat_blockf90 reducelocalf90
+           split_typef90 uallreducef90 vw_inplacef90)
     add_executable(${test} EXCLUDE_FROM_ALL ${test}.f90)
     add_dependencies(tests ${test})
     target_link_libraries(${test} simgrid mtest_f90)
index 2877db2..a9805c9 100644 (file)
@@ -1,13 +1,16 @@
 # This file generated by f77tof90
 uallreducef90 4
 exscanf90 5
-#alltoallwf90 7
+alltoallwf90 7
 alltoallvf90 7
 inplacef90 4
-reducelocalf90 2 mpiversion=2.2
+reducelocalf90 2
 redscatf90 4
 split_typef90 4 mpiversion=3.0
-#nonblockingf90 4 mpiversion=3.0
-#vw_inplacef90 4 mpiversion=2.2
-red_scat_blockf90 4 mpiversion=2.2
-nonblocking_inpf90 4 mpiversion=3.0
+nonblockingf90 4
+vw_inplacef90 4
+red_scat_blockf90 4
+nonblocking_inpf90 4
+allredint8f90 4
+allredopttf90 4
+uallreducef90 4
index 5b2f44a..3218a78 100644 (file)
@@ -8,12 +8,12 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
 
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
 
-  foreach(test gaddressf90
+  foreach(test gaddressf90 typesnamef90 structf 
              # allctypesf90 createf90 get_elem_d get_elem_u
-            # hindex1f90 hindexed_blockf90 
+              hindex1f90
               indtype kinds
-            # packef90 sizeof structf trf90 typecntsf90 typem2f90 typename3f90
-            # typenamef90 typesnamef90
+            # packef90 sizeof  trf90 typecntsf90 typem2f90 typename3f90
+            # typenamef90 hindexed_blockf90
               typesubf90)
     add_executable(${test} EXCLUDE_FROM_ALL ${test}.f90)
     add_dependencies(tests ${test})
index 8227ef0..dbdc861 100644 (file)
@@ -14,8 +14,9 @@
 ! for MPICH, and to fit in the MPICH test harness - WDG
 !
       program bustit
-      implicit none
       use mpi
+      implicit none
+
       
       integer comm
       integer newtype
index 5b158a0..b7afc9e 100644 (file)
@@ -1,20 +1,30 @@
 # This file generated by f77tof90
+#C types are not all available in fortran, and some returned names are C ones.
 #typenamef90 1
 #typename3f90 1 mpiversion=3.0
-#typesnamef90 1
+typesnamef90 1
+#needs PMPI_Type_get_envelope
 #typecntsf90 1
+#needs correct MPI_Type_get_true_extent
 #typem2f90 1
 typesubf90 1
+#needs MPI_Pack_external_size
 #packef90 1
 gaddressf90 1
+#C types are not all available in fortran
 #allctypesf90 1
-#hindex1f90 1
+hindex1f90 1
+#needs correct MPI_Type_get_true_extent
 #hindexed_blockf90 1 mpiversion=1.0
-#structf 2
+structf 2
 indtype 2
+#needs mpi_type_create_f90_integer
 #createf90 1
+#needs MPI_Sizeof
 #sizeof 1
 kinds 2 mpiversion=1.0
+#needs mpi_type_create_f90_real
 #trf90 1
+#needs mpi_get_elements
 #get_elem_d 2
 #get_elem_u 2
index 3b47871..5aa5cf9 100644 (file)
@@ -9,7 +9,7 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
   
   foreach(test allpairf90
-               # greqf90 mprobef90
+               # mprobef90 greqf90
                 statusesf90)
     add_executable(${test} EXCLUDE_FROM_ALL ${test}.f90)
     add_dependencies(tests ${test})
index a0cfd21..c20238b 100644 (file)
 
          call test_pair_send( comm, errs )
          call test_pair_ssend( comm, errs )
-         !call test_pair_rsend( comm, errs )
+         call test_pair_rsend( comm, errs )
          call test_pair_isend( comm, errs )
-         !call test_pair_irsend( comm, errs )
+         call test_pair_irsend( comm, errs )
          call test_pair_issend( comm, errs )
          call test_pair_psend( comm, errs )
-         !call test_pair_prsend( comm, errs )
-         !call test_pair_pssend( comm, errs )
+         call test_pair_prsend( comm, errs )
+         call test_pair_pssend( comm, errs )
          call test_pair_sendrecv( comm, errs )
          call test_pair_sendrecvrepl( comm, errs )
          call mtestFreeComm( comm )
index d7a4b64..3ee90a4 100644 (file)
@@ -2,4 +2,4 @@
 statusesf90 1
 #greqf90 1
 allpairf90 2 needs_privatization=1
-mprobef90 2 mpiversion=3.0
+#mprobef90 2 mpiversion=3.0
index 2dbd955..44b91b1 100644 (file)
@@ -10,11 +10,11 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN)
  
   foreach(test winaccf90
              # winerrf90
-              winfencef90 wingroupf90
-            # baseattrwinf90 winattr2f90 winattrf90
-              wingetf90 winnamef90 winscale1f90
-            # winscale2f90
-              )
+           winfencef90 wingroupf90
+           baseattrwinf90 winattr2f90 winattrf90
+           wingetf90 winnamef90 winscale1f90
+         # winscale2f90
+           )
     add_executable(${test} EXCLUDE_FROM_ALL ${test}.f90)
     add_dependencies(tests ${test})
     target_link_libraries(${test} simgrid mtest_f90)   
index 0686c73..80be344 100644 (file)
@@ -9,6 +9,6 @@ winnamef90 1
 wingroupf90 4 needs_privatization=1
 winaccf90 4 needs_privatization=1
 c2f2cwinf90 1
-#baseattrwinf90 1
-#winattrf90 1
-#winattr2f90 1
+baseattrwinf90 1
+winattrf90 1
+winattr2f90 1
index 454076e..9975f7d 100644 (file)
@@ -62,7 +62,7 @@ typedef struct _MTestDatatype {
  *  reach the long message algorithms. (The maximal count or block length
  *  can be generated by 256K count is 4K or 32Kbytes respectively) */
 #define MTEST_DATATYPE_FOR_EACH_COUNT(count) \
-        for (count = 1; count <= 262144; count *= 128)
+        for (count = 1; count <= 8192; count *= 8192)
 
 /* Setup the full version of datatype tests.
  * It generate tests for all basic datatypes and all derived datatypes except darray. */
index 92f123a..6918822 100644 (file)
@@ -9,7 +9,7 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite)
   include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
   include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
-  foreach(file infodel infodup infomany2 infomany infoorder infotest infoget infovallen) #infoenv
+  foreach(file infodel infodup infomany2 infomany infoorder infotest infoget infovallen infoenv)
     add_executable(${file} EXCLUDE_FROM_ALL ${file}.c)
     add_dependencies(tests ${file})
     target_link_libraries(${file} simgrid mtest_c)
index 5b0fa1c..08da1d1 100644 (file)
@@ -12,7 +12,7 @@ static int verbose = 0;
 int main(int argc, char *argv[])
 {
     char value[MPI_MAX_INFO_VAL];
-    char *keys[] = { "command", "argv", "maxprocs", "soft", "host", "arch", "wdir", "file",
+    const char *keys[] = { "command", "argv", "maxprocs", "soft", "host", "arch", "wdir", "file",
         "thread_level", 0
     };
     int flag, i;
@@ -20,7 +20,7 @@ int main(int argc, char *argv[])
     MPI_Init(NULL, NULL);
 
     for (i = 0; keys[i]; i++) {
-        MPI_Info_get(MPI_INFO_ENV, keys[i], MPI_MAX_INFO_VAL, value, &flag);
+        MPI_Info_get(MPI_INFO_ENV, (char*)keys[i], MPI_MAX_INFO_VAL, value, &flag);
         if (flag && verbose)
             printf("command: %s\n", value);
     }
index b2e20fb..4e14874 100644 (file)
@@ -6,4 +6,4 @@ version 1
 finalized 1
 #needs PMPI_Comm_free_keyval
 #attrself 1
-library_version 1 mpiversion=3.0
+library_version 1
index 50ad8f5..90931a6 100644 (file)
@@ -10,9 +10,9 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite)
   include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
   foreach(file anyall bottom eagerdt huge_anysrc huge_underflow inactivereq isendself isendirecv isendselfprobe issendselfcancel cancelanysrc pingping probenull
-          dtype_send greq1 probe-unexp rqstatus sendall sendflood sendrecv1 sendrecv2 sendrecv3 waitany-null waittestnull many_isend manylmt recv_any scancel scancel2 rcancel)
-    # not compiled files: big_count_status bsend1 bsend2 bsend3 bsend4 bsend5 bsendalign bsendfrag bsendpending mprobe
-    # cancelrecv  icsend large_message pscancel  rqfreeb   sendself scancel_unmatch
+          dtype_send greq1 probe-unexp rqstatus sendall sendflood sendrecv1 sendrecv2 sendrecv3 waitany-null waittestnull many_isend manylmt recv_any sendself scancel scancel2 rcancel bsend1 bsend2 bsend3 bsend4 bsend5 bsendalign bsendfrag bsendpending rqfreeb)
+    # not compiled files: big_count_status mprobe
+    # cancelrecv  icsend large_message pscancel     scancel_unmatch
     add_executable(${file} EXCLUDE_FROM_ALL ${file}.c)
     add_dependencies(tests ${file})
     target_link_libraries(${file} simgrid mtest_c)
index 77d7c16..bf89ff1 100644 (file)
@@ -86,7 +86,7 @@ int main(int argc, char *argv[])
             free(buf);
         }
         else if (rank == dest) {
-            double tstart;
+/*            double tstart;*/
 
             /* Clear the message buffers */
             for (i = 0; i < msgsize; i++) {
@@ -100,9 +100,9 @@ int main(int argc, char *argv[])
                          NULL, 0, MPI_UNSIGNED_CHAR, source, 10, comm, MPI_STATUS_IGNORE);
 
             /* Wait 2 seconds */
-            tstart = MPI_Wtime();
-            while (MPI_Wtime() - tstart < 2.0);
-
+/*            tstart = MPI_Wtime();*/
+/*            while (MPI_Wtime() - tstart < 2.0);*/
+            sleep(2);
             /* Now receive the messages */
             MPI_Recv(msg1, msgsize, MPI_UNSIGNED_CHAR, source, 0, comm, &status1);
             MPI_Recv(msg2, msgsize, MPI_UNSIGNED_CHAR, source, 0, comm, &status2);
index c6abf8a..0af8ea4 100644 (file)
@@ -7,7 +7,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "mpitest.h"
-
+#define USE_STRICT_MPI 1 
 /* Test Ibsend and Request_free */
 int main(int argc, char *argv[])
 {
index 7f151b5..626d088 100644 (file)
@@ -2,31 +2,28 @@ sendrecv1 4
 sendrecv2 2
 sendrecv3 2
 sendflood 8 timeLimit=600
-#needs rsend
-#sendself 1
+sendself 1
 sendall 4
 anyall 2
 eagerdt 2
 pingping 2
 bottom 2
-#needs MPI_Bsend
-#bsend1 1
-#bsend2 1
-#bsend3 1
-#bsend4 1
+bsend1 1
+bsend2 1
+bsend3 1
+bsend4 1
+#needs MPI_Intercomm_create
 #bsend5 4
-#bsendalign 2
-#bsendpending 2
+bsendalign 2
+bsendpending 2
 isendself 1
 #issendselfcancel 1
 isendirecv 10   
-#needs MPI_Buffer_attach, MPI_Bsend, MPI_Buffer_detach
-#bsendfrag 2
+bsendfrag 2
 #needs MPI_Intercomm_create
 #icsend 4
 rqstatus 2
-#needs MPI_Pack, MPI_Buffer_attach, MPI_Buffer_detach, MPI_Irsend, MPI_Ibsend
-#rqfreeb 4
+rqfreeb 4
 #needs MPI_Grequest_start MPI_Grequest_complete
 greq1 1
 probe-unexp 4
@@ -46,12 +43,11 @@ waitany-null 1
 # this should be run only on machines with large amount of memory (>=8GB)
 # perhaps disable in the release tarball
 #large_message 3
-mprobe 2 mpiversion=3.0
-big_count_status 1 mpiversion=3.0
+#mprobe 2 mpiversion=3.0
+#big_count_status 1 mpiversion=3.0
 many_isend 3
 manylmt 2
 huge_anysrc 2
 huge_underflow 2
-#Needs MPI_Irsend
-#dtype_send 2
+dtype_send 2
 recv_any 2
index d1be6d3..d4b2710 100644 (file)
@@ -11,22 +11,22 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite)
   include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include/")
 
   foreach(file accfence1 accfence2_am accfence2 accpscw1 allocmem epochtest getfence1 getgroup manyrma3 nullpscw lockcontention lockopts contig_displ
-          putfence1 putfidx putpscw1 test1_am test1 test1_dt test2_am test2 test3 test3_am test4 test4_am test5_am test5 transpose1 transpose2 lockcontention2
+          putfence1 putfidx putpscw1 test1_am test1 test1_dt test2_am test2 test3 test3_am test4 test4_am test5_am test5 transpose1 transpose2 lockcontention2 wincall
           transpose3 transpose4 transpose5 transpose6 transpose7 window_creation selfrma locknull win_info
           at_complete  acc-pairtype manyget large-small-acc lock_dt win_dynamic_acc fetch_and_op flush req_example rmanull rmazero badrma
           lock_nested winname attrorderwin baseattrwin fkeyvalwin strided_acc_indexed strided_getacc_indexed compare_and_swap
           lockall_dt lockall_dt_flushall lock_dt_flush lockall_dt_flush lockall_dt_flushlocalall lockall_dt_flushlocal  lock_dt_flushlocal 
-     strided_acc_onelock strided_get_indexed strided_putget_indexed contention_put contention_putget
+     strided_acc_onelock strided_get_indexed strided_putget_indexed contention_put contention_putget lockcontention3
      adlb_mimic1 lock_contention_dt acc-loc get_acc_local get_accumulate put_base put_bottom
      linked_list_bench_lock_all linked_list_bench_lock_excl manyrma2 pscw_ordering rma-contig get-struct
-     rput_local_comp racc_local_comp rget-testall win_shared)
+     rput_local_comp racc_local_comp rget-testall win_shared win_shared_put_flush_get)
     # fence_shm fetchandadd_am fetchandadd fetchandadd_tree_am fetchandadd_tree 
     #  linked_list_bench_lock_shr linked_list linked_list_fop linked_list_lockall 
-    #   mcs-mutex mixedsync mutex_bench lockcontention3 reqops
+    #   mcs-mutex mixedsync mutex_bench  reqops
     # strided_getacc_indexed_shared rget-unlock 
-    # win_flavors  win_shared_noncontig win_shared_noncontig_put 
+    # win_flavors win_shared_zerobyte win_shared_noncontig win_shared_noncontig_put 
     # win_large_shm win_zero wintest  atomic_rmw_fop atomic_rmw_gacc  atomic_get atomic_rmw_cas
-    # win_shared_zerobyte aint derived-acc-flush_local large-acc-flush_local
+    # aint derived-acc-flush_local large-acc-flush_local
     #  win_shared_create win_shared_put_flush_get win_shared_rma_flush_load
     # wrma_flush_get
     add_executable(${file} EXCLUDE_FROM_ALL ${file}.c)
index 09fd3d7..8c642c6 100644 (file)
@@ -96,7 +96,7 @@ int main(int argc, char *argv[])
     types[3] = MPI_DOUBLE;
 
     MPI_Win_create(win_buf, SIZE * sizeof(int), sizeof(int), MPI_INFO_NULL, MPI_COMM_WORLD, &win);
-
+    MPI_Win_set_errhandler(win, MPI_ERRORS_RETURN);
     MPI_Win_fence(0, win);
 
     if (rank == 0) {
index 134f412..d1ae7f6 100644 (file)
@@ -313,24 +313,20 @@ int RMACheck(int i, int *buf, MPI_Aint bufsize)
         break;
     case 3:    /* Datatype single put (strided put) */
     case 6:    /* a few small puts (like strided put, but 1 word at a time) */
-        /* FIXME: The conditional and increment are reversed below.  This looks
-         * like a bug, and currently prevents the following test from running. */
         for (j = 0; j < veccount; j++) {
-            if (buf[j * stride] != PUT_VAL + j) {
+            if (buf[j * stride+OFFSET_1] != PUT_VAL + j) {
                 errs++;
-                printf("case %d: value is %d should be %d\n", i, buf[j * stride], PUT_VAL + j);
+                printf("case %d: value is %d should be %d\n", i, buf[j * stride+OFFSET_1], PUT_VAL + j);
             }
         }
         break;
     case 4:    /* Datatype single accumulate (strided acc) */
     case 7:    /* a few small accumulates (like strided acc, but 1 word at a time) */
-        /* FIXME: The conditional and increment are reversed below.  This looks
-         * like a bug, and currently prevents the following test from running. */
         for (j = 0; j < veccount;j++) {
-            if (buf[j * stride] != ACC_VAL + j + OFFSET_2 + j * stride) {
+            if (buf[j * stride+OFFSET_2] != ACC_VAL + j + OFFSET_2 + j * stride) {
                 errs++;
                 printf("case %d: value is %d should be %d\n", i,
-                       buf[j * stride], ACC_VAL + j + OFFSET_2 + j * stride);
+                       buf[j * stride+OFFSET_2], ACC_VAL + j + OFFSET_2 + j * stride);
             }
         }
         break;
index f86619e..7105ba6 100644 (file)
@@ -15,7 +15,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#define MAX_COUNT 512
+#define MAX_COUNT 256
 #define MAX_RMA_SIZE 1  /* 16 in manyrma performance test */
 #define MAX_RUNS 8
 #define MAX_ITER_TIME  5.0      /* seconds */
index acf93a9..d148893 100644 (file)
@@ -7,7 +7,7 @@
 #include "mpi.h"
 #include <stdio.h>
 
-#define MAX_COUNT 4096
+#define MAX_COUNT 2048
 
 int main(int argc, char *argv[])
 {
index ea9e57c..35c228a 100644 (file)
@@ -33,9 +33,9 @@ int main(int argc, char *argv[])
     MPI_Alloc_mem(MAX_SIZE * sizeof(int), MPI_INFO_NULL, &winbuf);
     MPI_Win_create(winbuf, MAX_SIZE * sizeof(int), sizeof(int), MPI_INFO_NULL,
                    MPI_COMM_WORLD, &window);
-
+    buf[0] = 0;
+    winbuf[0]=0;
     MPI_Win_lock_all(0, window);
-
     /* Test Raccumulate local completion with small data.
      * Small data is always copied to header packet as immediate data. */
     if (rank == 1) {
index e2562a8..6f920ef 100644 (file)
@@ -26,8 +26,7 @@ test5 2
 lockcontention 3
 lockcontention2 4
 lockcontention2 8
-#Buggy one.
-#lockcontention3 8
+lockcontention3 8
 lockopts 2
 lock_dt 2
 lock_dt_flush 2
@@ -56,8 +55,7 @@ test1_dt 2 timeLimit=30
 #Needs post/start
 nullpscw 7
 attrorderwin 1
-#Needs MPI_Win_call_errhandler
-#wincall 2
+wincall 2
 baseattrwin 1
 fkeyvalwin 1
 selfrma 1
@@ -132,7 +130,7 @@ acc-loc 4
 #fence_shm 2 mpiversion=3.0
 #mutex_bench 4 mpiversion=3.0
 #mutex_bench_shared 4 mpiversion=3.0
-win_shared_zerobyte 4 mpiversion=3.0
+#win_shared_zerobyte 4 mpiversion=3.0
 win_shared_put_flush_get 4 mpiversion=3.0
 get-struct 2
 at_complete 2
index 5c4cfcf..bec2ba6 100644 (file)
@@ -94,7 +94,7 @@ int main(int argc, char *argv[])
         int disp_unit;
         for (i = 0; i < shm_nproc; i++) {
             MPI_Win_shared_query(shm_win, i, &size, &disp_unit, &shm_bases[i]);
-            printf("%d --    shared query: base[%d]=%p, size %ld, "
+            printf("%d --    shared query: base[%d]=%p, size %zd, "
                    "unit %d\n", rank, i, shm_bases[i], size, disp_unit);
         }
     }
@@ -103,7 +103,7 @@ int main(int argc, char *argv[])
     get_target_base_offsets = (shm_nproc - 1) * win_size / win_unit;
 
     if (origin == rank && verbose)
-        printf("%d --    base_offset of put_target %d on get_target %d: %ld\n",
+        printf("%d --    base_offset of put_target %d on get_target %d: %zd\n",
                rank, put_target, get_target, get_target_base_offsets);
 
     /* Create using MPI_Win_create(). Note that new window size of get_target(0)
index e0a3712..92cba94 100755 (executable)
@@ -40,8 +40,8 @@
 use File::Path;
 
 # Global variables
-$MPIMajorVersion = "2";
-$MPIMinorVersion = "2";
+$MPIMajorVersion = "3";
+$MPIMinorVersion = "1";
 $mpiexec = "smpirun";    # Name of mpiexec program (including path, if necessary)
 $testIsStrict = "true";
 $MPIhasMPIX   = "no";
@@ -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/host-speed:1e9  --cfg=smpi/async-small-thresh:65536"; }
+       $mpiexec="$mpiexec  -platform ${srcdir}/../../../../examples/platforms/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile_mpich --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; }
diff --git a/teshsuite/smpi/mpich3-test/util/dtypes_manual.c b/teshsuite/smpi/mpich3-test/util/dtypes_manual.c
deleted file mode 100644 (file)
index 48bc309..0000000
+++ /dev/null
@@ -1,387 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- *  (C) 2014 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-#include "mpi.h"
-#include "mpitestconf.h"
-#include "mpitest.h"
-#include "dtypes.h"
-#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS)
-#include <stdio.h>
-#endif
-#if defined(HAVE_STDLIB_H) || defined(STDC_HEADERS)
-#include <stdlib.h>
-#endif
-#if defined(HAVE_STRING_H) || defined(STDC_HEADERS)
-#include <string.h>
-#endif
-#ifdef HAVE_STDARG_H
-#include <stdarg.h>
-#endif
-
-/* This file contains code to generate a variety of MPI datatypes for testing
-   the various MPI routines.
-
-   To simplify the test code, this generates an array of datatypes, buffers with
-   data and buffers with no data (0 bits) for use in send and receive
-   routines of various types.
-
-   In addition, this doesn't even test all of the possibilities.  For example,
-   there is currently no test of sending more than one item defined with
-   MPI_Type_contiguous .
-
-   Note also that this test assumes that the sending and receive types are
-   the same.  MPI requires only that the type signatures match, which is
-   a weaker requirement.
-
-   This code was drawn from the MPICH-1 test suite and modified to fit the
-   new MPICH test suite.  It provides an alternative set of datatype tests
-   to the ones in mtest.c.
-
- */
-
-/* Change this to test only the basic, predefined types */
-SMPI_VARINIT_GLOBAL_AND_SET(basic_only, int, 0);
-
-/*
-   Arrays types, inbufs, outbufs, and counts are allocated by the
-   CALLER.  n on input is the maximum number; on output, it is the
-   number defined.
-
-   See MTestDatatype2Allocate below for a routine to allocate these arrays.
-
-   We may want to add a routine to call to check that the proper data
-   has been received.
- */
-
-/*
-   Add a predefined MPI type to the tests.  _count instances of the
-   type will be sent.
-*/
-#define SETUPBASICTYPE(_mpitype,_ctype,_count) { \
-  int i; _ctype *a;    \
-  if (cnt > *n) {*n = cnt; return; }                   \
-  types[cnt] = _mpitype; \
-  inbufs[cnt] = (void *)calloc(_count,sizeof(_ctype)); \
-  outbufs[cnt] = (void *)malloc(sizeof(_ctype) * (_count));    \
-  a = (_ctype *)inbufs[cnt]; for (i=0; i<(_count); i++) a[i] = i;      \
-  a = (_ctype *)outbufs[cnt]; for (i=0; i<(_count); i++) a[i] = 0;     \
-  counts[cnt]  = _count; bytesize[cnt] = sizeof(_ctype) * (_count); cnt++; }
-
-/*
-   Add a contiguous version of a predefined type.  Send one instance of
-   the type which contains _count copies of the predefined type.
- */
-#define SETUPCONTIGTYPE(_mpitype,_ctype,_count) { \
-  int i; _ctype *a; char*myname; \
-  char _basename[MPI_MAX_OBJECT_NAME]; int _basenamelen;\
-  if (cnt > *n) {*n = cnt; return; }\
-  MPI_Type_contiguous(_count, _mpitype, types + cnt);\
-  MPI_Type_commit(types + cnt);\
-  inbufs[cnt] = (void *)calloc(_count, sizeof(_ctype)); \
-  outbufs[cnt] = (void *)malloc(sizeof(_ctype) * (_count));    \
-  a = (_ctype *)inbufs[cnt]; for (i=0; i<(_count); i++) a[i] = i;      \
-  a = (_ctype *)outbufs[cnt]; for (i=0; i<(_count); i++) a[i] = 0;     \
-  myname = (char *)malloc(100);\
-  MPI_Type_get_name(_mpitype, _basename, &_basenamelen); \
-  snprintf(myname, 100, "Contig type %s", _basename);  \
-  MPI_Type_set_name(types[cnt], myname); \
-  free(myname); \
-  counts[cnt]  = 1;  bytesize[cnt] = sizeof(_ctype) * (_count); cnt++; }
-
-/*
-  Create a vector with _count elements, separated by stride _stride,
-  of _mpitype.  Each block has a single element.
- */
-#define SETUPVECTORTYPE(_mpitype,_ctype,_count,_stride,_name) { \
-  int i; _ctype *a; char *myname;                              \
-  char _basename[MPI_MAX_OBJECT_NAME]; int _basenamelen;\
-  if (cnt > *n) {*n = cnt; return; }\
-  MPI_Type_vector(_count, 1, _stride, _mpitype, types + cnt);  \
-  MPI_Type_commit(types + cnt);\
-  inbufs[cnt] = (void *)calloc(sizeof(_ctype) * (_count) * (_stride),1); \
-  outbufs[cnt] = (void *)calloc(sizeof(_ctype) * (_count) * (_stride),1); \
-  a = (_ctype *)inbufs[cnt]; for (i=0; i<(_count); i++) a[i*(_stride)] = i; \
-  a = (_ctype *)outbufs[cnt]; for (i=0; i<(_count); i++) a[i*(_stride)] = 0; \
-  myname = (char *)malloc(100);\
-  MPI_Type_get_name(_mpitype, _basename, &_basenamelen); \
-  snprintf(myname, 100, "Vector type %s", _basename);          \
-  MPI_Type_set_name(types[cnt], myname); \
-  free(myname); \
-  counts[cnt]  = 1; bytesize[cnt] = sizeof(_ctype) * (_count) * (_stride) ;\
-  cnt++; }
-
-/* This indexed type is setup like a contiguous type .
-   Note that systems may try to convert this to contiguous, so we'll
-   eventually need a test that has holes in it */
-#define SETUPINDEXTYPE(_mpitype,_ctype,_count,_name) { \
-  int i; int *lens, *disp; _ctype *a; char *myname;    \
-  char _basename[MPI_MAX_OBJECT_NAME]; int _basenamelen;\
-  if (cnt > *n) {*n = cnt; return; }\
-  lens = (int *)malloc((_count) * sizeof(int)); \
-  disp = (int *)malloc((_count) * sizeof(int)); \
-  for (i=0; i<(_count); i++) { lens[i] = 1; disp[i] = i; } \
-  MPI_Type_indexed((_count), lens, disp, _mpitype, types + cnt);\
-  free(lens); free(disp); \
-  MPI_Type_commit(types + cnt);\
-  inbufs[cnt] = (void *)calloc((_count), sizeof(_ctype)); \
-  outbufs[cnt] = (void *)malloc(sizeof(_ctype) * (_count)); \
-  a = (_ctype *)inbufs[cnt]; for (i=0; i<(_count); i++) a[i] = i; \
-  a = (_ctype *)outbufs[cnt]; for (i=0; i<(_count); i++) a[i] = 0; \
-  myname = (char *)malloc(100);\
-  MPI_Type_get_name(_mpitype, _basename, &_basenamelen); \
-  snprintf(myname, 100, "Index type %s", _basename);           \
-  MPI_Type_set_name(types[cnt], myname); \
-  free(myname); \
-  counts[cnt]  = 1;  bytesize[cnt] = sizeof(_ctype) * (_count); cnt++; }
-
-/* This defines a structure of two basic members; by chosing things like
-   (char, double), various packing and alignment tests can be made */
-#define SETUPSTRUCT2TYPE(_mpitype1,_ctype1,_mpitype2,_ctype2,_count,_tname) { \
-  int i; char *myname;                                         \
-  MPI_Datatype b[3]; int cnts[3]; \
-  struct name { _ctype1 a1; _ctype2 a2; } *a, samp;    \
-  MPI_Aint disp[3];                            \
-  if (cnt > *n) {*n = cnt; return; }                                   \
-  b[0] = _mpitype1; b[1] = _mpitype2; b[2] = MPI_UB;   \
-  cnts[0] = 1; cnts[1] = 1; cnts[2] = 1;       \
-  MPI_Get_address(&(samp.a2), &disp[1]);               \
-  MPI_Get_address(&(samp.a1), &disp[0]);               \
-  MPI_Get_address(&(samp) + 1, &disp[2]);              \
-  disp[1] = disp[1] - disp[0]; disp[2] = disp[2] - disp[0]; disp[0] = 0; \
-  MPI_Type_create_struct(3, cnts, disp, b, types + cnt);               \
-  MPI_Type_commit(types + cnt);                                        \
-  inbufs[cnt] = (void *)calloc(sizeof(struct name) * (_count),1);      \
-  outbufs[cnt] = (void *)calloc(sizeof(struct name) * (_count),1);     \
-  a = (struct name *)inbufs[cnt]; for (i=0; i<(_count); i++) { a[i].a1 = i; \
-      a[i].a2 = i; }                                                   \
-  a = (struct name *)outbufs[cnt]; for (i=0; i<(_count); i++) { a[i].a1 = 0; \
-      a[i].a2 = 0; }                                                   \
-  myname = (char *)malloc(100);                                        \
-  snprintf(myname, 100, "Struct type %s", _tname);             \
-  MPI_Type_set_name(types[cnt], myname); \
-  free(myname); \
-  counts[cnt]  = (_count);  bytesize[cnt] = sizeof(struct name) * (_count);cnt++; }
-
-/* This accomplished the same effect as VECTOR, but allow a count of > 1 */
-#define SETUPSTRUCTTYPEUB(_mpitype,_ctype,_count,_stride) {    \
-  int i; _ctype *a; char *myname;                                      \
-  int blens[2];  MPI_Aint disps[2]; MPI_Datatype mtypes[2];    \
-  char _basename[MPI_MAX_OBJECT_NAME]; int _basenamelen;\
-  if (cnt > *n) {*n = cnt; return; }                                   \
-  blens[0] = 1; blens[1] = 1; disps[0] = 0; \
-  disps[1] = (_stride) * sizeof(_ctype); \
-  mtypes[0] = _mpitype; mtypes[1] = MPI_UB;                            \
-  MPI_Type_create_struct(2, blens, disps, mtypes, types + cnt);        \
-  MPI_Type_commit(types + cnt);                                        \
-  inbufs[cnt] = (void *)calloc(sizeof(_ctype) * (_count) * (_stride),1);\
-  outbufs[cnt] = (void *)calloc(sizeof(_ctype) * (_count) * (_stride),1);\
-  a = (_ctype *)inbufs[cnt]; for (i=0; i<(_count); i++) a[i*(_stride)] = i;  \
-  a = (_ctype *)outbufs[cnt]; for (i=0; i<(_count); i++) a[i*(_stride)] = 0; \
-  myname = (char *)malloc(100);                                        \
-  MPI_Type_get_name(_mpitype, _basename, &_basenamelen); \
-  snprintf(myname, 100, "Struct (MPI_UB) type %s", _basename); \
-  MPI_Type_set_name(types[cnt], myname); \
-  free(myname); \
-  counts[cnt]  = (_count);  \
-  bytesize[cnt] = sizeof(_ctype) * (_count) * (_stride);\
-  cnt++; }
-
-/*
- * Set whether only the basic types should be generated
- */
-void MTestDatatype2BasicOnly(void)
-{
-    SMPI_VARGET_GLOBAL(basic_only) = 1;
-}
-
-SMPI_VARINIT_GLOBAL_AND_SET(nbasic_types, int, 0);  /* World rank */
-/* On input, n is the size of the various buffers.  On output,
-   it is the number available types
- */
-void MTestDatatype2Generate(MPI_Datatype * types, void **inbufs, void **outbufs,
-                            int *counts, int *bytesize, int *n)
-{
-    int cnt = 0;                /* Number of defined types */
-    int typecnt = 10;           /* Number of instances to send in most cases */
-    int stride = 9;             /* Number of elements in vector to stride */
-
-    /* First, generate an element of each basic type */
-    SETUPBASICTYPE(MPI_CHAR, char, typecnt);
-    SETUPBASICTYPE(MPI_SHORT, short, typecnt);
-    SETUPBASICTYPE(MPI_INT, int, typecnt);
-    SETUPBASICTYPE(MPI_LONG, long, typecnt);
-    SETUPBASICTYPE(MPI_UNSIGNED_CHAR, unsigned char, typecnt);
-    SETUPBASICTYPE(MPI_UNSIGNED_SHORT, unsigned short, typecnt);
-    SETUPBASICTYPE(MPI_UNSIGNED, unsigned, typecnt);
-    SETUPBASICTYPE(MPI_UNSIGNED_LONG, unsigned long, typecnt);
-    SETUPBASICTYPE(MPI_FLOAT, float, typecnt);
-    SETUPBASICTYPE(MPI_DOUBLE, double, typecnt);
-    SETUPBASICTYPE(MPI_BYTE, char, typecnt);
-#ifdef HAVE_LONG_LONG_INT
-    SETUPBASICTYPE(MPI_LONG_LONG_INT, long long, typecnt);
-#endif
-#ifdef HAVE_LONG_DOUBLE
-    SETUPBASICTYPE(MPI_LONG_DOUBLE, long double, typecnt);
-#endif
-    SMPI_VARGET_GLOBAL(nbasic_types) = cnt;
-
-    if (SMPI_VARGET_GLOBAL(basic_only)) {
-        *n = cnt;
-        return;
-    }
-    /* Generate contiguous data items */
-    SETUPCONTIGTYPE(MPI_CHAR, char, typecnt);
-    SETUPCONTIGTYPE(MPI_SHORT, short, typecnt);
-    SETUPCONTIGTYPE(MPI_INT, int, typecnt);
-    SETUPCONTIGTYPE(MPI_LONG, long, typecnt);
-    SETUPCONTIGTYPE(MPI_UNSIGNED_CHAR, unsigned char, typecnt);
-    SETUPCONTIGTYPE(MPI_UNSIGNED_SHORT, unsigned short, typecnt);
-    SETUPCONTIGTYPE(MPI_UNSIGNED, unsigned, typecnt);
-    SETUPCONTIGTYPE(MPI_UNSIGNED_LONG, unsigned long, typecnt);
-    SETUPCONTIGTYPE(MPI_FLOAT, float, typecnt);
-    SETUPCONTIGTYPE(MPI_DOUBLE, double, typecnt);
-    SETUPCONTIGTYPE(MPI_BYTE, char, typecnt);
-#ifdef HAVE_LONG_LONG_INT
-    SETUPCONTIGTYPE(MPI_LONG_LONG_INT, long long, typecnt);
-#endif
-#ifdef HAVE_LONG_DOUBLE
-    SETUPCONTIGTYPE(MPI_LONG_DOUBLE, long double, typecnt);
-#endif
-
-    /* Generate vector items */
-    SETUPVECTORTYPE(MPI_CHAR, char, typecnt, stride, "MPI_CHAR");
-    SETUPVECTORTYPE(MPI_SHORT, short, typecnt, stride, "MPI_SHORT");
-    SETUPVECTORTYPE(MPI_INT, int, typecnt, stride, "MPI_INT");
-    SETUPVECTORTYPE(MPI_LONG, long, typecnt, stride, "MPI_LONG");
-    SETUPVECTORTYPE(MPI_UNSIGNED_CHAR, unsigned char, typecnt, stride, "MPI_UNSIGNED_CHAR");
-    SETUPVECTORTYPE(MPI_UNSIGNED_SHORT, unsigned short, typecnt, stride, "MPI_UNSIGNED_SHORT");
-    SETUPVECTORTYPE(MPI_UNSIGNED, unsigned, typecnt, stride, "MPI_UNSIGNED");
-    SETUPVECTORTYPE(MPI_UNSIGNED_LONG, unsigned long, typecnt, stride, "MPI_UNSIGNED_LONG");
-    SETUPVECTORTYPE(MPI_FLOAT, float, typecnt, stride, "MPI_FLOAT");
-    SETUPVECTORTYPE(MPI_DOUBLE, double, typecnt, stride, "MPI_DOUBLE");
-    SETUPVECTORTYPE(MPI_BYTE, char, typecnt, stride, "MPI_BYTE");
-#ifdef HAVE_LONG_LONG_INT
-    SETUPVECTORTYPE(MPI_LONG_LONG_INT, long long, typecnt, stride, "MPI_LONG_LONG_INT");
-#endif
-#ifdef HAVE_LONG_DOUBLE
-    SETUPVECTORTYPE(MPI_LONG_DOUBLE, long double, typecnt, stride, "MPI_LONG_DOUBLE");
-#endif
-
-    /* Generate indexed items */
-    SETUPINDEXTYPE(MPI_CHAR, char, typecnt, "MPI_CHAR");
-    SETUPINDEXTYPE(MPI_SHORT, short, typecnt, "MPI_SHORT");
-    SETUPINDEXTYPE(MPI_INT, int, typecnt, "MPI_INT");
-    SETUPINDEXTYPE(MPI_LONG, long, typecnt, "MPI_LONG");
-    SETUPINDEXTYPE(MPI_UNSIGNED_CHAR, unsigned char, typecnt, "MPI_UNSIGNED_CHAR");
-    SETUPINDEXTYPE(MPI_UNSIGNED_SHORT, unsigned short, typecnt, "MPI_UNSIGNED_SHORT");
-    SETUPINDEXTYPE(MPI_UNSIGNED, unsigned, typecnt, "MPI_UNSIGNED");
-    SETUPINDEXTYPE(MPI_UNSIGNED_LONG, unsigned long, typecnt, "MPI_UNSIGNED_LONG");
-    SETUPINDEXTYPE(MPI_FLOAT, float, typecnt, "MPI_FLOAT");
-    SETUPINDEXTYPE(MPI_DOUBLE, double, typecnt, "MPI_DOUBLE");
-    SETUPINDEXTYPE(MPI_BYTE, char, typecnt, "MPI_BYTE");
-#ifdef HAVE_LONG_LONG_INT
-    SETUPINDEXTYPE(MPI_LONG_LONG_INT, long long, typecnt, "MPI_LONG_LONG_INT");
-#endif
-#ifdef HAVE_LONG_DOUBLE
-    SETUPINDEXTYPE(MPI_LONG_DOUBLE, long double, typecnt, "MPI_LONG_DOUBLE");
-#endif
-
-    /* Generate struct items */
-    SETUPSTRUCT2TYPE(MPI_CHAR, char, MPI_DOUBLE, double, typecnt, "char-double");
-    SETUPSTRUCT2TYPE(MPI_DOUBLE, double, MPI_CHAR, char, typecnt, "double-char");
-    SETUPSTRUCT2TYPE(MPI_UNSIGNED, unsigned, MPI_DOUBLE, double, typecnt, "unsigned-double");
-    SETUPSTRUCT2TYPE(MPI_FLOAT, float, MPI_LONG, long, typecnt, "float-long");
-    SETUPSTRUCT2TYPE(MPI_UNSIGNED_CHAR, unsigned char, MPI_CHAR, char, typecnt,
-                     "unsigned char-char");
-    SETUPSTRUCT2TYPE(MPI_UNSIGNED_SHORT, unsigned short, MPI_DOUBLE, double,
-                     typecnt, "unsigned short-double");
-
-    /* Generate struct using MPI_UB */
-    SETUPSTRUCTTYPEUB(MPI_CHAR, char, typecnt, stride);
-    SETUPSTRUCTTYPEUB(MPI_SHORT, short, typecnt, stride);
-    SETUPSTRUCTTYPEUB(MPI_INT, int, typecnt, stride);
-    SETUPSTRUCTTYPEUB(MPI_LONG, long, typecnt, stride);
-    SETUPSTRUCTTYPEUB(MPI_UNSIGNED_CHAR, unsigned char, typecnt, stride);
-    SETUPSTRUCTTYPEUB(MPI_UNSIGNED_SHORT, unsigned short, typecnt, stride);
-    SETUPSTRUCTTYPEUB(MPI_UNSIGNED, unsigned, typecnt, stride);
-    SETUPSTRUCTTYPEUB(MPI_UNSIGNED_LONG, unsigned long, typecnt, stride);
-    SETUPSTRUCTTYPEUB(MPI_FLOAT, float, typecnt, stride);
-    SETUPSTRUCTTYPEUB(MPI_DOUBLE, double, typecnt, stride);
-    SETUPSTRUCTTYPEUB(MPI_BYTE, char, typecnt, stride);
-
-    /* 60 different entries to this point + 4 for long long and
-     * 4 for long double */
-    *n = cnt;
-}
-
-/*
-   MAX_TEST should be 1 + actual max (allows us to check that it was,
-   indeed, large enough)
- */
-#define MAX_TEST 70
-void MTestDatatype2Allocate(MPI_Datatype ** types, void ***inbufs,
-                            void ***outbufs, int **counts, int **bytesize, int *n)
-{
-    *types = (MPI_Datatype *) malloc(MAX_TEST * sizeof(MPI_Datatype));
-    *inbufs = (void **) malloc(MAX_TEST * sizeof(void *));
-    *outbufs = (void **) malloc(MAX_TEST * sizeof(void *));
-    *counts = (int *) malloc(MAX_TEST * sizeof(int));
-    *bytesize = (int *) malloc(MAX_TEST * sizeof(int));
-    *n = MAX_TEST;
-}
-
-int MTestDatatype2Check(void *inbuf, void *outbuf, int size_bytes)
-{
-    char *in = (char *) inbuf, *out = (char *) outbuf;
-    int i;
-    for (i = 0; i < size_bytes; i++) {
-        if (in[i] != out[i]) {
-            return i + 1;
-        }
-    }
-    return 0;
-}
-
-/*
- * This is a version of CheckData that prints error messages
- */
-static int MtestDatatype2CheckAndPrint(void *inbuf, void *outbuf, int size_bytes,
-                                char *typename, int typenum)
-{
-    int errloc, world_rank;
-
-    if ((errloc = MTestDatatype2Check(inbuf, outbuf, size_bytes))) {
-        char *p1, *p2;
-        MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);
-        fprintf(stderr,
-                "Error in data with type %s (type %d on %d) at byte %d of %d\n",
-                typename, typenum, world_rank, errloc - 1, size_bytes);
-        p1 = (char *) inbuf;
-        p2 = (char *) outbuf;
-        fprintf(stderr, "Got %hhx expected %hhx\n", p2[errloc - 1], p1[errloc - 1]);
-    }
-    return errloc;
-}
-
-void MTestDatatype2Free(MPI_Datatype * types, void **inbufs, void **outbufs,
-                        int *counts, int *bytesize, int n)
-{
-    int i;
-    for (i = 0; i < n; i++) {
-        if (inbufs[i])
-            free(inbufs[i]);
-        if (outbufs[i])
-            free(outbufs[i]);
-        /* Only if not basic ... */
-        if (i >= SMPI_VARGET_GLOBAL(nbasic_types))
-            MPI_Type_free(types + i);
-    }
-    free(types);
-    free(inbufs);
-    free(outbufs);
-    free(counts);
-    free(bytesize);
-}
index 98ed601..cb24b32 100644 (file)
@@ -340,7 +340,7 @@ int MTestGetIntracommGeneral(MPI_Comm * comm, int min_size, int allowSmaller)
             break;
         case 5:
             {
-#if MTEST_HAVE_MIN_MPI_VERSION(3,0)
+#if MTEST_HAVE_MIN_MPI_VERSION(4,0)
                 /* Dup of the world using MPI_Intercomm_merge */
                 int rleader, isLeft;
                 MPI_Comm local_comm, inter_comm;
@@ -1033,9 +1033,9 @@ int MTestGetComm(MPI_Comm * comm, int min_size)
 
     if (!getinter) {
         idx = MTestGetIntracomm(comm, min_size);
-        if (idx == 0) {
-            getinter = 1;
-        }
+/*        if (idx == 0) {*/
+/*            getinter = 1;*/
+/*        }*/
     }
     if (getinter) {
         int isLeft;
@@ -1111,7 +1111,7 @@ void MTestError(const char *msg)
 /* ------------------------------------------------------------------------ */
 static void MTestResourceSummary(FILE * fp)
 {
-#ifdef HAVE_GETRUSAGE
+#if defined(HAVE_GETRUSAGE) && !defined(__HAIKU__)
     struct rusage ru;
     static int pfThreshold = -2;
     int doOutput = 1;
index 76dd032..17d3d6a 100644 (file)
@@ -162,7 +162,7 @@ static void MTestResetDatatypeGen()
 
 void MTestInitFullDatatypes(void)
 {
-    /* Do not allow to change datatype test level during loop.
+    /* Do not allow the datatype test level to change during loop.
      * Otherwise indexes will be wrong.
      * Test must explicitly call reset or wait for current datatype loop being
      * done before changing to another test level. */
@@ -178,7 +178,7 @@ void MTestInitFullDatatypes(void)
 
 void MTestInitMinDatatypes(void)
 {
-    /* Do not allow to change datatype test level during loop.
+    /* Do not allow the datatype test level to change during loop.
      * Otherwise indexes will be wrong.
      * Test must explicitly call reset or wait for current datatype loop being
      * done before changing to another test level. */
@@ -194,7 +194,7 @@ void MTestInitMinDatatypes(void)
 
 void MTestInitBasicDatatypes(void)
 {
-    /* Do not allow to change datatype test level during loop.
+    /* Do not allow the datatype test level to change during loop.
      * Otherwise indexes will be wrong.
      * Test must explicitly call reset or wait for current datatype loop being
      * done before changing to another test level. */
diff --git a/teshsuite/smpi/mpich3-test/util/mtest_datatype_gen_manual.c b/teshsuite/smpi/mpich3-test/util/mtest_datatype_gen_manual.c
deleted file mode 100644 (file)
index 7e271d1..0000000
+++ /dev/null
@@ -1,634 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- *  (C) 2014 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-#include "mtest_datatype.h"
-#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS)
-#include <stdio.h>
-#endif
-#if defined(HAVE_STDLIB_H) || defined(STDC_HEADERS)
-#include <stdlib.h>
-#endif
-#if defined(HAVE_STRING_H) || defined(STDC_HEADERS)
-#include <string.h>
-#endif
-#ifdef HAVE_STDARG_H
-#include <stdarg.h>
-#endif
-/* The following two includes permit the collection of resource usage
-   data in the tests
- */
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_RESOURCE_H
-#include <sys/resource.h>
-#endif
-#include <errno.h>
-
-SMPI_VARINIT_GLOBAL_AND_SET(dbgflag2, int, 0);         /* Flag used for debugging */
-SMPI_VARINIT_GLOBAL_AND_SET(wrank2, int, -1);  /* World rank */
-SMPI_VARINIT_GLOBAL_AND_SET(verbose2,int, 0);         /* Message level (0 is none) */
-
-/*
- * Utility routines for writing MPI datatype communication tests.
- *
- * Both basic and derived datatype are included.
- * For basic datatypes, every type has a test case that both the send and
- * receive buffer use the same datatype and count.
- *
- *  For derived datatypes:
- *    All the test cases are defined in this file, and the datatype definitions
- *    are in file mtest_datatype.c. Each test case will be automatically called
- *    by every datatype.
- *
- *  Test case generation:
- *    Every datatype tests derived datatype send buffer and
- *    derived datatype receive buffer separately. Each test contains various sub
- *    tests for different structures (i.e., different value of count or block
- *    length). The following four structures are defined:
- *      L count & S block length & S stride
- *      S count & L block length & S stride
- *      L count & S block length & L stride
- *      S count & L block length & L stride
- *      S count & L block length & S stride & S lower-bound
- *      contiguous (stride = block length)
- *      contiguous (stride = block length) & S lower-bound
- *
- *  How to add a new structure for each datatype:
- *    1. Add structure definition in function MTestDdtStructDefine.
- *    2. Increase MTEST_DDT_NUM_SUBTESTS
- *
- *  Datatype definition:
- *    Every type is initialized by the creation function stored in
- *    mtestDdtCreators variable, all of their create/init/check functions are
- *    defined in file mtest_datatype.c.
- *
- *  How to add a new derived datatype:
- *    1. Add the new datatype in enum MTEST_DERIVED_DT.
- *    2. Add its create/init/check functions in file mtest_datatype.c
- *    3. Add its creator function to mtestDdtCreators variable
- *
- *  Following three test levels of datatype are defined.
- *    1. Basic
- *      All basic datatypes
- *    2. Minimum
- *      All basic datatypes | Vector | Indexed
- *    3. Full
- *      All basic datatypes | Vector | Hvector | Indexed | Hindexed |
- *      Indexed-block | Hindexed-block | Subarray with order-C | Subarray with order-Fortran
- *
- *  There are two ways to specify the test level of datatype. The second way has
- *  higher priority (means the value specified by the first way will be overwritten
- *  by that in the second way).
- *  1. Specify global test level by setting the MPITEST_DATATYPE_TEST_LEVEL
- *     environment variable before execution (basic,min,full|full by default).
- *  2. Initialize a special level for a datatype loop by calling the corresponding
- *     initialization function before that loop, otherwise the default value specified
- *     in the first way is used.
- *    Basic     : MTestInitBasicDatatypes
- *    Minimum   : MTestInitMinDatatypes
- *    Full      : MTestInitFullDatatypes
- */
-
-SMPI_VARINIT_GLOBAL_AND_SET(datatype_index,int,0);
-
-/* ------------------------------------------------------------------------ */
-/* Routine and internal parameters to define the range of datatype tests */
-/* ------------------------------------------------------------------------ */
-
-#define MTEST_DDT_NUM_SUBTESTS 7        /* 7 kinds of derived datatype structure */
-SMPI_VARINIT_GLOBAL_AND_SET( mtestDdtCreators, MTestDdtCreator*,NULL);
-
-SMPI_VARINIT_GLOBAL_AND_SET(MTEST_BDT_START_IDX, int, -1);
-SMPI_VARINIT_GLOBAL_AND_SET(MTEST_BDT_NUM_TESTS, int, 0);
-SMPI_VARINIT_GLOBAL_AND_SET(MTEST_BDT_RANGE, int, 0);
-
-SMPI_VARINIT_GLOBAL_AND_SET(MTEST_DDT_NUM_TYPES, int, 0);
-SMPI_VARINIT_GLOBAL_AND_SET(MTEST_SEND_DDT_START_IDX, int, 0);
-SMPI_VARINIT_GLOBAL_AND_SET(MTEST_SEND_DDT_NUM_TESTS, int, 0);
-SMPI_VARINIT_GLOBAL_AND_SET(MTEST_SEND_DDT_RANGE, int, 0);
-
-SMPI_VARINIT_GLOBAL_AND_SET(MTEST_RECV_DDT_START_IDX, int, 0);
-SMPI_VARINIT_GLOBAL_AND_SET(MTEST_RECV_DDT_NUM_TESTS, int, 0);
-SMPI_VARINIT_GLOBAL_AND_SET(MTEST_RECV_DDT_RANGE, int, 0);
-
-enum {
-    MTEST_DATATYPE_TEST_LEVEL_FULL,
-    MTEST_DATATYPE_TEST_LEVEL_MIN,
-    MTEST_DATATYPE_TEST_LEVEL_BASIC
-};
-
-/* current datatype test level */
-SMPI_VARINIT_GLOBAL_AND_SET(MTEST_DATATYPE_TEST_LEVEL,int, MTEST_DATATYPE_TEST_LEVEL_FULL);
-/* default datatype test level specified by environment variable */
-SMPI_VARINIT_GLOBAL_AND_SET(MTEST_DATATYPE_TEST_LEVEL_ENV, int, -1);
-/* default datatype initialization function */
-static void (*MTestInitDefaultTestFunc) (void) = NULL;
-
-static void MTestInitDatatypeGen(int basic_dt_num, int derived_dt_num)
-{
-    SMPI_VARGET_GLOBAL(MTEST_BDT_START_IDX) = 0;
-    SMPI_VARGET_GLOBAL(MTEST_BDT_NUM_TESTS) = basic_dt_num;
-    SMPI_VARGET_GLOBAL(MTEST_BDT_RANGE) = SMPI_VARGET_GLOBAL(MTEST_BDT_START_IDX) + SMPI_VARGET_GLOBAL(MTEST_BDT_NUM_TESTS);
-    SMPI_VARGET_GLOBAL(MTEST_DDT_NUM_TYPES) = derived_dt_num;
-    SMPI_VARGET_GLOBAL(MTEST_SEND_DDT_START_IDX) = SMPI_VARGET_GLOBAL(MTEST_BDT_NUM_TESTS);
-    SMPI_VARGET_GLOBAL(MTEST_SEND_DDT_NUM_TESTS) = SMPI_VARGET_GLOBAL(MTEST_DDT_NUM_TYPES) * MTEST_DDT_NUM_SUBTESTS;
-    SMPI_VARGET_GLOBAL(MTEST_SEND_DDT_RANGE) = SMPI_VARGET_GLOBAL(MTEST_SEND_DDT_START_IDX) + SMPI_VARGET_GLOBAL(MTEST_SEND_DDT_NUM_TESTS);
-    SMPI_VARGET_GLOBAL(MTEST_RECV_DDT_START_IDX) = SMPI_VARGET_GLOBAL(MTEST_SEND_DDT_START_IDX) + SMPI_VARGET_GLOBAL(MTEST_SEND_DDT_NUM_TESTS);
-    SMPI_VARGET_GLOBAL(MTEST_RECV_DDT_NUM_TESTS) = SMPI_VARGET_GLOBAL(MTEST_DDT_NUM_TYPES) * MTEST_DDT_NUM_SUBTESTS;
-    SMPI_VARGET_GLOBAL(MTEST_RECV_DDT_RANGE) = SMPI_VARGET_GLOBAL(MTEST_RECV_DDT_START_IDX) + SMPI_VARGET_GLOBAL(MTEST_RECV_DDT_NUM_TESTS);
-}
-
-static int MTestIsDatatypeGenInited()
-{
-    return (SMPI_VARGET_GLOBAL(MTEST_BDT_START_IDX) < 0) ? 0 : 1;
-}
-
-static void MTestPrintDatatypeGen()
-{
-    MTestPrintfMsg(1, "MTest datatype test level : %s. %d basic datatype tests, "
-                   "%d derived datatype tests will be generated\n",
-                   (SMPI_VARGET_GLOBAL(MTEST_DATATYPE_TEST_LEVEL) == MTEST_DATATYPE_TEST_LEVEL_FULL) ? "FULL" : "MIN",
-                   SMPI_VARGET_GLOBAL(MTEST_BDT_NUM_TESTS), SMPI_VARGET_GLOBAL(MTEST_SEND_DDT_NUM_TESTS) + SMPI_VARGET_GLOBAL(MTEST_RECV_DDT_NUM_TESTS));
-}
-
-static void MTestResetDatatypeGen()
-{
-    SMPI_VARGET_GLOBAL(MTEST_BDT_START_IDX) = -1;
-}
-
-void MTestInitFullDatatypes(void)
-{
-    if(SMPI_VARGET_GLOBAL(mtestDdtCreators)==NULL)
-      SMPI_VARGET_GLOBAL(mtestDdtCreators)= (MTestDdtCreator*)malloc(sizeof(MTestDdtCreator)*MTEST_DDT_MAX);
-    /* Do not allow to change datatype test level during loop.
-     * Otherwise indexes will be wrong.
-     * Test must explicitly call reset or wait for current datatype loop being
-     * done before changing to another test level. */
-    if (!MTestIsDatatypeGenInited()) {
-        SMPI_VARGET_GLOBAL(MTEST_DATATYPE_TEST_LEVEL) = MTEST_DATATYPE_TEST_LEVEL_FULL;
-        MTestTypeCreatorInit((MTestDdtCreator *) SMPI_VARGET_GLOBAL(mtestDdtCreators));
-        MTestInitDatatypeGen(MTEST_BDT_MAX, MTEST_DDT_MAX);
-    }
-    else {
-        printf("Warning: trying to reinitialize mtest datatype during " "datatype iteration!");
-    }
-}
-
-void MTestInitMinDatatypes(void)
-{
-    if(SMPI_VARGET_GLOBAL(mtestDdtCreators)==NULL)
-      SMPI_VARGET_GLOBAL(mtestDdtCreators)= (MTestDdtCreator*)malloc(sizeof(MTestDdtCreator)*MTEST_DDT_MAX);
-    /* Do not allow to change datatype test level during loop.
-     * Otherwise indexes will be wrong.
-     * Test must explicitly call reset or wait for current datatype loop being
-     * done before changing to another test level. */
-    if (!MTestIsDatatypeGenInited()) {
-        SMPI_VARGET_GLOBAL(MTEST_DATATYPE_TEST_LEVEL) = MTEST_DATATYPE_TEST_LEVEL_MIN;
-        MTestTypeMinCreatorInit((MTestDdtCreator *) SMPI_VARGET_GLOBAL(mtestDdtCreators));
-        MTestInitDatatypeGen(MTEST_BDT_MAX, MTEST_MIN_DDT_MAX);
-    }
-    else {
-        printf("Warning: trying to reinitialize mtest datatype during " "datatype iteration!");
-    }
-}
-
-void MTestInitBasicDatatypes(void)
-{
-    if(SMPI_VARGET_GLOBAL(mtestDdtCreators)==NULL)
-      SMPI_VARGET_GLOBAL(mtestDdtCreators)= (MTestDdtCreator*)malloc(sizeof(MTestDdtCreator)*MTEST_DDT_MAX);
-    /* Do not allow to change datatype test level during loop.
-     * Otherwise indexes will be wrong.
-     * Test must explicitly call reset or wait for current datatype loop being
-     * done before changing to another test level. */
-    if (!MTestIsDatatypeGenInited()) {
-        SMPI_VARGET_GLOBAL(MTEST_DATATYPE_TEST_LEVEL) = MTEST_DATATYPE_TEST_LEVEL_BASIC;
-        MTestInitDatatypeGen(MTEST_BDT_MAX, 0);
-    }
-    else {
-        printf("Warning: trying to reinitialize mtest datatype during " "datatype iteration!");
-    }
-}
-
-static inline void MTestInitDatatypeEnv()
-{
-    char *envval = 0;
-
-    /* Read global test level specified by user environment variable.
-     * Only initialize once at the first time that test calls datatype routine. */
-    if (SMPI_VARGET_GLOBAL(MTEST_DATATYPE_TEST_LEVEL_ENV) > -1)
-        return;
-
-    /* default full */
-    SMPI_VARGET_GLOBAL(MTEST_DATATYPE_TEST_LEVEL_ENV) = MTEST_DATATYPE_TEST_LEVEL_FULL;
-    MTestInitDefaultTestFunc = MTestInitFullDatatypes;
-
-    envval = getenv("MPITEST_DATATYPE_TEST_LEVEL");
-    if (envval && strlen(envval)) {
-        if (!strncmp(envval, "min", strlen("min"))) {
-            SMPI_VARGET_GLOBAL(MTEST_DATATYPE_TEST_LEVEL_ENV) = MTEST_DATATYPE_TEST_LEVEL_MIN;
-            MTestInitDefaultTestFunc = MTestInitMinDatatypes;
-        }
-        else if (!strncmp(envval, "basic", strlen("basic"))) {
-            SMPI_VARGET_GLOBAL(MTEST_DATATYPE_TEST_LEVEL_ENV) = MTEST_DATATYPE_TEST_LEVEL_BASIC;
-            MTestInitDefaultTestFunc = MTestInitBasicDatatypes;
-        }
-        else if (strncmp(envval, "full", strlen("full"))) {
-            fprintf(stderr, "Unknown MPITEST_DATATYPE_TEST_LEVEL %s\n", envval);
-        }
-    }
-}
-
-/* -------------------------------------------------------------------------------*/
-/* Routine to define various sets of blocklen/count/stride for derived datatypes. */
-/* ------------------------------------------------------------------------------ */
-
-static inline int MTestDdtStructDefine(int ddt_index, MPI_Aint tot_count, MPI_Aint * count,
-                                       MPI_Aint * blen, MPI_Aint * stride,
-                                       MPI_Aint * align_tot_count, MPI_Aint * lb)
-{
-    int merr = 0;
-    int ddt_c_st;
-    MPI_Aint _short = 0, _align_tot_count = 0, _count = 0, _blen = 0, _stride = 0;
-    MPI_Aint _lb = 0;
-
-    ddt_c_st = ddt_index % MTEST_DDT_NUM_SUBTESTS;
-
-    /* Get short value according to user specified tot_count.
-     * It is used as count for large-block-length structure, or block length
-     * for large-count structure. */
-    if (tot_count < 2) {
-        _short = 1;
-    }
-    else if (tot_count < 64) {
-        _short = 2;
-    }
-    else {
-        _short = 64;
-    }
-    _align_tot_count = (tot_count + _short - 1) & ~(_short - 1);
-
-    switch (ddt_c_st) {
-    case 0:
-        /* Large block length. */
-        _count = _short;
-        _blen = _align_tot_count / _short;
-        _stride = _blen * 2;
-        break;
-    case 1:
-        /* Large count */
-        _count = _align_tot_count / _short;
-        _blen = _short;
-        _stride = _blen * 2;
-        break;
-    case 2:
-        /* Large block length and large stride */
-        _count = _short;
-        _blen = _align_tot_count / _short;
-        _stride = _blen * 10;
-        break;
-    case 3:
-        /* Large count and large stride */
-        _count = _align_tot_count / _short;
-        _blen = _short;
-        _stride = _blen * 10;
-        break;
-    case 4:
-        /* Large block length with lb */
-        _count = _short;
-        _blen = _align_tot_count / _short;
-        _stride = _blen * 2;
-        _lb = _short / 2;       /* make sure lb < blen */
-        break;
-    case 5:
-        /* Contig ddt (stride = block length) without lb */
-        _count = _align_tot_count / _short;
-        _blen = _short;
-        _stride = _blen;
-        break;
-    case 6:
-        /* Contig ddt (stride = block length) with lb */
-        _count = _short;
-        _blen = _align_tot_count / _short;
-        _stride = _blen;
-        _lb = _short / 2;       /* make sure lb < blen */
-        break;
-    default:
-        /* Undefined index */
-        merr = 1;
-        break;
-    }
-
-    *align_tot_count = _align_tot_count;
-    *count = _count;
-    *blen = _blen;
-    *stride = _stride;
-    *lb = _lb;
-
-    return merr;
-}
-
-/* ------------------------------------------------------------------------ */
-/* Routine to generate basic datatypes                                       */
-/* ------------------------------------------------------------------------ */
-
-static inline int MTestGetBasicDatatypes(MTestDatatype * sendtype,
-                                         MTestDatatype * recvtype, MPI_Aint tot_count)
-{
-    int merr = 0;
-    int bdt_index = SMPI_VARGET_GLOBAL(datatype_index) - SMPI_VARGET_GLOBAL(MTEST_BDT_START_IDX);
-    if (bdt_index >= MTEST_BDT_MAX) {
-      printf("Wrong index:  global %d, bst %d in %s\n", SMPI_VARGET_GLOBAL(datatype_index), bdt_index, __func__);
-      merr++;
-      return merr;
-    }
-
-    switch (bdt_index) {
-    case MTEST_BDT_INT:
-        merr = MTestTypeBasicCreate(MPI_INT, sendtype);
-        merr = MTestTypeBasicCreate(MPI_INT, recvtype);
-        break;
-    case MTEST_BDT_DOUBLE:
-        merr = MTestTypeBasicCreate(MPI_DOUBLE, sendtype);
-        merr = MTestTypeBasicCreate(MPI_DOUBLE, recvtype);
-        break;
-    case MTEST_BDT_FLOAT_INT:
-        merr = MTestTypeBasicCreate(MPI_FLOAT_INT, sendtype);
-        merr = MTestTypeBasicCreate(MPI_FLOAT_INT, recvtype);
-        break;
-    case MTEST_BDT_SHORT:
-        merr = MTestTypeBasicCreate(MPI_SHORT, sendtype);
-        merr = MTestTypeBasicCreate(MPI_SHORT, recvtype);
-        break;
-    case MTEST_BDT_LONG:
-        merr = MTestTypeBasicCreate(MPI_LONG, sendtype);
-        merr = MTestTypeBasicCreate(MPI_LONG, recvtype);
-        break;
-    case MTEST_BDT_CHAR:
-        merr = MTestTypeBasicCreate(MPI_CHAR, sendtype);
-        merr = MTestTypeBasicCreate(MPI_CHAR, recvtype);
-        break;
-    case MTEST_BDT_UINT64_T:
-        merr = MTestTypeBasicCreate(MPI_UINT64_T, sendtype);
-        merr = MTestTypeBasicCreate(MPI_UINT64_T, recvtype);
-        break;
-    case MTEST_BDT_FLOAT:
-        merr = MTestTypeBasicCreate(MPI_FLOAT, sendtype);
-        merr = MTestTypeBasicCreate(MPI_FLOAT, recvtype);
-        break;
-    case MTEST_BDT_BYTE:
-        merr = MTestTypeBasicCreate(MPI_BYTE, sendtype);
-        merr = MTestTypeBasicCreate(MPI_BYTE, recvtype);
-        break;
-    }
-    sendtype->count = tot_count;
-    recvtype->count = tot_count;
-
-    return merr;
-}
-
-/* ------------------------------------------------------------------------ */
-/* Routine to generate send/receive derived datatypes                     */
-/* ------------------------------------------------------------------------ */
-
-static inline int MTestGetSendDerivedDatatypes(MTestDatatype * sendtype,
-                                               MTestDatatype * recvtype, MPI_Aint tot_count)
-{
-    int merr = 0;
-    int ddt_datatype_index, ddt_c_dt;
-    MPI_Aint blen, stride, count, align_tot_count, lb;
-    MPI_Datatype old_type = MPI_DOUBLE;
-
-    /* Check index */
-    ddt_datatype_index = SMPI_VARGET_GLOBAL(datatype_index) - SMPI_VARGET_GLOBAL(MTEST_SEND_DDT_START_IDX);
-    ddt_c_dt = ddt_datatype_index / MTEST_DDT_NUM_SUBTESTS;
-    if (ddt_c_dt >= MTEST_DDT_MAX || !SMPI_VARGET_GLOBAL(mtestDdtCreators)[ddt_c_dt]) {
-      printf("Wrong index:  global %d, send %d send-ddt %d, or undefined creator in %s\n",
-             SMPI_VARGET_GLOBAL(datatype_index), ddt_datatype_index, ddt_c_dt, __func__);
-      merr++;
-      return merr;
-    }
-
-    /* Set datatype structure */
-    merr = MTestDdtStructDefine(ddt_datatype_index, tot_count, &count, &blen,
-                                &stride, &align_tot_count, &lb);
-    if (merr) {
-      printf("Wrong index:  global %d, send %d send-ddt %d, or undefined ddt structure in %s\n",
-             SMPI_VARGET_GLOBAL(datatype_index), ddt_datatype_index, ddt_c_dt, __func__);
-      merr++;
-      return merr;
-    }
-
-    /* Create send datatype */
-    merr = SMPI_VARGET_GLOBAL(mtestDdtCreators)[ddt_c_dt] (count, blen, stride, lb, old_type, "send", sendtype);
-    if (merr)
-        return merr;
-
-    sendtype->count = 1;
-
-    /* Create receive datatype */
-    merr = MTestTypeBasicCreate(old_type, recvtype);
-    if (merr)
-        return merr;
-
-    recvtype->count = sendtype->count * align_tot_count;
-
-    return merr;
-}
-
-static inline int MTestGetRecvDerivedDatatypes(MTestDatatype * sendtype,
-                                               MTestDatatype * recvtype, MPI_Aint tot_count)
-{
-    int merr = 0;
-    int ddt_datatype_index, ddt_c_dt;
-    MPI_Aint blen, stride, count, align_tot_count, lb;
-    MPI_Datatype old_type = MPI_DOUBLE;
-
-    /* Check index */
-    ddt_datatype_index = SMPI_VARGET_GLOBAL(datatype_index) - SMPI_VARGET_GLOBAL(MTEST_RECV_DDT_START_IDX);
-    ddt_c_dt = ddt_datatype_index / MTEST_DDT_NUM_SUBTESTS;
-    if (ddt_c_dt >= MTEST_DDT_MAX || !SMPI_VARGET_GLOBAL(mtestDdtCreators)[ddt_c_dt]) {
-      printf("Wrong index:  global %d, recv %d recv-ddt %d, or undefined creator in %s\n",
-             SMPI_VARGET_GLOBAL(datatype_index), ddt_datatype_index, ddt_c_dt, __func__);
-      merr++;
-      return merr;
-    }
-
-    /* Set datatype structure */
-    merr = MTestDdtStructDefine(ddt_datatype_index, tot_count, &count, &blen,
-                                &stride, &align_tot_count, &lb);
-    if (merr) {
-      printf("Wrong index:  global %d, recv %d recv-ddt %d, or undefined ddt structure in %s\n",
-             SMPI_VARGET_GLOBAL(datatype_index), ddt_datatype_index, ddt_c_dt, __func__);
-      return merr;
-    }
-
-    /* Create receive datatype */
-    merr = SMPI_VARGET_GLOBAL(mtestDdtCreators)[ddt_c_dt] (count, blen, stride, lb, old_type, "recv", recvtype);
-    if (merr)
-        return merr;
-
-    recvtype->count = 1;
-
-    /* Create send datatype */
-    merr = MTestTypeBasicCreate(old_type, sendtype);
-    if (merr)
-        return merr;
-
-    sendtype->count = recvtype->count * align_tot_count;
-
-    return merr;
-}
-
-/* ------------------------------------------------------------------------ */
-/* Exposed routine to external tests                                         */
-/* ------------------------------------------------------------------------ */
-int MTestGetDatatypes(MTestDatatype * sendtype, MTestDatatype * recvtype, MPI_Aint tot_count)
-{
-    int merr = 0;
-
-    MTestGetDbgInfo(&SMPI_VARGET_GLOBAL(dbgflag2), &SMPI_VARGET_GLOBAL(verbose2));
-    MTestInitDatatypeEnv();
-    MPI_Comm_rank(MPI_COMM_WORLD, &SMPI_VARGET_GLOBAL(wrank2));
-
-    /* Initialize the default test level if test does not specify. */
-    if (!MTestIsDatatypeGenInited()) {
-        MTestInitDefaultTestFunc();
-    }
-
-    if (SMPI_VARGET_GLOBAL(datatype_index) == 0) {
-        MTestPrintDatatypeGen();
-    }
-
-    /* Start generating tests */
-    if (SMPI_VARGET_GLOBAL(datatype_index) < SMPI_VARGET_GLOBAL(MTEST_BDT_RANGE)) {
-        merr = MTestGetBasicDatatypes(sendtype, recvtype, tot_count);
-
-    }
-    else if (SMPI_VARGET_GLOBAL(datatype_index) < SMPI_VARGET_GLOBAL(MTEST_SEND_DDT_RANGE)) {
-        merr = MTestGetSendDerivedDatatypes(sendtype, recvtype, tot_count);
-
-    }
-    else if (SMPI_VARGET_GLOBAL(datatype_index) < SMPI_VARGET_GLOBAL(MTEST_RECV_DDT_RANGE)) {
-        merr = MTestGetRecvDerivedDatatypes(sendtype, recvtype, tot_count);
-
-    }
-    else {
-        /* out of range */
-        SMPI_VARGET_GLOBAL(datatype_index) = -1;
-        MTestResetDatatypeGen();
-    }
-
-    /* stop if error reported */
-    if (merr) {
-        SMPI_VARGET_GLOBAL(datatype_index) = -1;
-    }
-
-    if (SMPI_VARGET_GLOBAL(datatype_index) > 0) {
-        /* general initialization for receive buffer. */
-        recvtype->InitBuf = MTestTypeInitRecv;
-    }
-
-    SMPI_VARGET_GLOBAL(datatype_index)++;
-
-    if (SMPI_VARGET_GLOBAL(verbose2) >= 2 && SMPI_VARGET_GLOBAL(datatype_index) > 0) {
-        MPI_Count ssize, rsize;
-        MPI_Aint slb, rlb, sextent, rextent;
-        const char *sendtype_nm = MTestGetDatatypeName(sendtype);
-        const char *recvtype_nm = MTestGetDatatypeName(recvtype);
-        MPI_Type_size_x(sendtype->datatype, &ssize);
-        MPI_Type_size_x(recvtype->datatype, &rsize);
-
-        MPI_Type_get_extent(sendtype->datatype, &slb, &sextent);
-        MPI_Type_get_extent(recvtype->datatype, &rlb, &rextent);
-
-        MTestPrintfMsg(2, "Get datatypes: send = %s(size %d ext %ld lb %ld count %d basesize %d), "
-                       "recv = %s(size %d ext %ld lb %ld count %d basesize %d), tot_count=%d\n",
-                       sendtype_nm, ssize, sextent, slb, sendtype->count, sendtype->basesize,
-                       recvtype_nm, rsize, rextent, rlb, recvtype->count, recvtype->basesize,
-                       tot_count);
-        fflush(stdout);
-    }
-
-    return SMPI_VARGET_GLOBAL(datatype_index);
-}
-
-/* Reset the datatype index (start from the initial data type.
-   Note: This routine is rarely needed; MTestGetDatatypes automatically
-   starts over after the last available datatype is used.
-*/
-void MTestResetDatatypes(void)
-{
-    SMPI_VARGET_GLOBAL(datatype_index) = 0;
-    MTestResetDatatypeGen();
-}
-
-/* Return the index of the current datatype.  This is rarely needed and
-   is provided mostly to enable debugging of the MTest package itself */
-int MTestGetDatatypeIndex(void)
-{
-    return SMPI_VARGET_GLOBAL(datatype_index);
-}
-
-/* Free the storage associated with a datatype */
-void MTestFreeDatatype(MTestDatatype * mtype)
-{
-    int merr;
-    /* Invoke a datatype-specific free function to handle
-     * both the datatype and the send/receive buffers */
-    if (mtype->FreeBuf) {
-        (mtype->FreeBuf) (mtype);
-    }
-    /* Free the datatype itself if it was created */
-    if (!mtype->isBasic) {
-        merr = MPI_Type_free(&mtype->datatype);
-        if (merr)
-            MTestPrintError(merr);
-    }
-}
-
-/* Check that a message was received correctly.  Returns the number of
-   errors detected.  Status may be NULL or MPI_STATUS_IGNORE */
-int MTestCheckRecv(MPI_Status * status, MTestDatatype * recvtype)
-{
-    int count;
-    int errs = 0, merr;
-
-    if (status && status != MPI_STATUS_IGNORE) {
-        merr = MPI_Get_count(status, recvtype->datatype, &count);
-        if (merr)
-            MTestPrintError(merr);
-
-        /* Check count against expected count */
-        if (count != recvtype->count) {
-            errs++;
-        }
-    }
-
-    /* Check received data */
-    if (!errs && recvtype->CheckBuf(recvtype)) {
-        errs++;
-    }
-    return errs;
-}
-
-    SMPI_VARINIT_GLOBAL_AND_SET(name , char*,NULL);
-    SMPI_VARINIT_GLOBAL_AND_SET(sp,int,0);
-
-/* This next routine uses a circular buffer of static name arrays just to
-   simplify the use of the routine */
-const char *MTestGetDatatypeName(MTestDatatype * dtype)
-{
-    if(SMPI_VARGET_GLOBAL(name)==NULL) SMPI_VARGET_GLOBAL(name)=(char*)malloc(4*MPI_MAX_OBJECT_NAME*sizeof(char));
-    int rlen, merr;
-
-    if (SMPI_VARGET_GLOBAL(sp) >= 4)
-        SMPI_VARGET_GLOBAL(sp) = 0;
-    merr = MPI_Type_get_name(dtype->datatype, &SMPI_VARGET_GLOBAL(name)[SMPI_VARGET_GLOBAL(sp)*MPI_MAX_OBJECT_NAME], &rlen);
-    if (merr)
-        MTestPrintError(merr);
-    return (const char *) &SMPI_VARGET_GLOBAL(name)[(SMPI_VARGET_GLOBAL(sp)++) *MPI_MAX_OBJECT_NAME];
-}
diff --git a/teshsuite/smpi/mpich3-test/util/mtest_manual.c b/teshsuite/smpi/mpich3-test/util/mtest_manual.c
deleted file mode 100644 (file)
index 9461da4..0000000
+++ /dev/null
@@ -1,1361 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *
- *  (C) 2001 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-#include "mpi.h"
-#include "mpitestconf.h"
-#include "mpitest.h"
-#if defined(HAVE_STDIO_H) || defined(STDC_HEADERS)
-#include <stdio.h>
-#endif
-#if defined(HAVE_STDLIB_H) || defined(STDC_HEADERS)
-#include <stdlib.h>
-#endif
-#if defined(HAVE_STRING_H) || defined(STDC_HEADERS)
-#include <string.h>
-#endif
-#ifdef HAVE_STDARG_H
-#include <stdarg.h>
-#endif
-/* The following two includes permit the collection of resource usage
-   data in the tests
- */
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_RESOURCE_H
-#include <sys/resource.h>
-#endif
-#include <errno.h>
-
-
-/*
- * Utility routines for writing MPI tests.
- *
- * We check the return codes on all MPI routines (other than INIT)
- * to allow the program that uses these routines to select MPI_ERRORS_RETURN
- * as the error handler.  We do *not* set MPI_ERRORS_RETURN because
- * the code that makes use of these routines may not check return
- * codes.
- *
- */
-
-static void MTestRMACleanup(void);
-static void MTestResourceSummary(FILE *);
-
-/* Here is where we could put the includes and definitions to enable
-   memory testing */
-
-SMPI_VARINIT_GLOBAL_AND_SET(dbgflag, int, 0); /* Flag used for debugging */
-SMPI_VARINIT_GLOBAL_AND_SET(wrank, int, -1);  /* World rank */
-SMPI_VARINIT_GLOBAL_AND_SET(verbose, int, 0); /* Message level (0 is none) */
-SMPI_VARINIT_GLOBAL_AND_SET(returnWithVal, int, 0); /* Allow programs to return
-                                  with a non-zero if there was an error (may
-                                  cause problems with some runtime systems) */
-SMPI_VARINIT_GLOBAL_AND_SET(usageOutput, int, 0); /* */
-
-/* Provide backward portability to MPI 1 */
-#ifndef MPI_VERSION
-#define MPI_VERSION 1
-#endif
-#if MPI_VERSION < 2
-#define MPI_THREAD_SINGLE 0
-#endif
-
-/*
- * Initialize and Finalize MTest
- */
-
-/*
-   Initialize MTest, initializing MPI if necessary.
-
- Environment Variables:
-+ MPITEST_DEBUG - If set (to any value), turns on debugging output
-. MPITEST_THREADLEVEL_DEFAULT - If set, use as the default "provided"
-                                level of thread support.  Applies to
-                                MTest_Init but not MTest_Init_thread.
-- MPITEST_VERBOSE - If set to a numeric value, turns on that level of
-  verbose output.  This is used by the routine 'MTestPrintfMsg'
-
-*/
-void MTest_Init_thread(int *argc, char ***argv, int required, int *provided)
-{
-    int flag;
-    char *envval = 0;
-
-    MPI_Initialized(&flag);
-    if (!flag) {
-        /* Permit an MPI that claims only MPI 1 but includes the
-         * MPI_Init_thread routine (e.g., IBM MPI) */
-#if MPI_VERSION >= 2 || defined(HAVE_MPI_INIT_THREAD)
-        MPI_Init_thread(argc, argv, required, provided);
-#else
-        MPI_Init(argc, argv);
-        *provided = -1;
-#endif
-    }
-    /* Check for debugging control */
-    if (getenv("MPITEST_DEBUG")) {
-        SMPI_VARGET_GLOBAL(dbgflag) = 1;
-        MPI_Comm_rank(MPI_COMM_WORLD, &SMPI_VARGET_GLOBAL(wrank));
-    }
-
-    /* Check for verbose control */
-    envval = getenv("MPITEST_VERBOSE");
-    if (envval) {
-        char *s;
-        long val = strtol(envval, &s, 0);
-        if (s == envval) {
-            /* This is the error case for strtol */
-            fprintf(stderr, "Warning: %s not valid for MPITEST_VERBOSE\n", envval);
-            fflush(stderr);
-        }
-        else {
-            if (val >= 0) {
-                SMPI_VARGET_GLOBAL(verbose) = val;
-            }
-            else {
-                fprintf(stderr, "Warning: %s not valid for MPITEST_VERBOSE\n", envval);
-                fflush(stderr);
-            }
-        }
-    }
-    /* Check for option to return success/failure in the return value of main */
-    envval = getenv("MPITEST_RETURN_WITH_CODE");
-    if (envval) {
-        if (strcmp(envval, "yes") == 0 ||
-            strcmp(envval, "YES") == 0 ||
-            strcmp(envval, "true") == 0 || strcmp(envval, "TRUE") == 0) {
-            SMPI_VARGET_GLOBAL(returnWithVal) = 1;
-        }
-        else if (strcmp(envval, "no") == 0 ||
-                 strcmp(envval, "NO") == 0 ||
-                 strcmp(envval, "false") == 0 || strcmp(envval, "FALSE") == 0) {
-            SMPI_VARGET_GLOBAL(returnWithVal) = 0;
-        }
-        else {
-            fprintf(stderr, "Warning: %s not valid for MPITEST_RETURN_WITH_CODE\n", envval);
-            fflush(stderr);
-        }
-    }
-
-    /* Print rusage data if set */
-    if (getenv("MPITEST_RUSAGE")) {
-        SMPI_VARGET_GLOBAL(usageOutput) = 1;
-    }
-}
-
-/*
- * Initialize the tests, using an MPI-1 style init.  Supports
- * MTEST_THREADLEVEL_DEFAULT to test with user-specified thread level
- */
-void MTest_Init(int *argc, char ***argv)
-{
-    int provided;
-#if MPI_VERSION >= 2 || defined(HAVE_MPI_INIT_THREAD)
-    const char *str = 0;
-    int threadLevel;
-
-    threadLevel = MPI_THREAD_SINGLE;
-    str = getenv("MTEST_THREADLEVEL_DEFAULT");
-    if (!str)
-        str = getenv("MPITEST_THREADLEVEL_DEFAULT");
-    if (str && *str) {
-        if (strcmp(str, "MULTIPLE") == 0 || strcmp(str, "multiple") == 0) {
-            threadLevel = MPI_THREAD_MULTIPLE;
-        }
-        else if (strcmp(str, "SERIALIZED") == 0 || strcmp(str, "serialized") == 0) {
-            threadLevel = MPI_THREAD_SERIALIZED;
-        }
-        else if (strcmp(str, "FUNNELED") == 0 || strcmp(str, "funneled") == 0) {
-            threadLevel = MPI_THREAD_FUNNELED;
-        }
-        else if (strcmp(str, "SINGLE") == 0 || strcmp(str, "single") == 0) {
-            threadLevel = MPI_THREAD_SINGLE;
-        }
-        else {
-            fprintf(stderr, "Unrecognized thread level %s\n", str);
-            /* Use exit since MPI_Init/Init_thread has not been called. */
-            exit(1);
-        }
-    }
-    MTest_Init_thread(argc, argv, threadLevel, &provided);
-#else
-    /* If the MPI_VERSION is 1, there is no MPI_THREAD_xxx defined */
-    MTest_Init_thread(argc, argv, 0, &provided);
-#endif
-}
-
-/*
-  Finalize MTest.  errs is the number of errors on the calling process;
-  this routine will write the total number of errors over all of MPI_COMM_WORLD
-  to the process with rank zero, or " No Errors".
-  It does *not* finalize MPI.
- */
-void MTest_Finalize(int errs)
-{
-    int rank, toterrs, merr;
-
-    merr = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-    if (merr)
-        MTestPrintError(merr);
-
-    merr = MPI_Reduce(&errs, &toterrs, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
-    if (merr)
-        MTestPrintError(merr);
-    if (rank == 0) {
-        if (toterrs) {
-            printf(" Found %d errors\n", toterrs);
-        }
-        else {
-            printf(" No Errors\n");
-        }
-        fflush(stdout);
-    }
-
-    if (SMPI_VARGET_GLOBAL(usageOutput))
-        MTestResourceSummary(stdout);
-
-
-    /* Clean up any persistent objects that we allocated */
-    MTestRMACleanup();
-}
-
-/* ------------------------------------------------------------------------ */
-/* This routine may be used instead of "return 0;" at the end of main;
-   it allows the program to use the return value to signal success or failure.
- */
-int MTestReturnValue(int errors)
-{
-    if (SMPI_VARGET_GLOBAL(returnWithVal))
-        return errors ? 1 : 0;
-    return 0;
-}
-
-/* ------------------------------------------------------------------------ */
-
-/*
- * Miscellaneous utilities, particularly to eliminate OS dependencies
- * from the tests.
- * MTestSleep(seconds)
- */
-#ifdef HAVE_WINDOWS_H
-#include <windows.h>
-void MTestSleep(int sec)
-{
-    Sleep(1000 * sec);
-}
-#else
-#include <unistd.h>
-void MTestSleep(int sec)
-{
-    sleep(sec);
-}
-#endif
-
-/* Other mtest subfiles read debug setting using this function. */
-void MTestGetDbgInfo(int *_dbgflag, int *_verbose)
-{
-    *_dbgflag = SMPI_VARGET_GLOBAL(dbgflag);
-    *_verbose = SMPI_VARGET_GLOBAL(verbose);
-}
-
-/* ----------------------------------------------------------------------- */
-
-/*
- * Create communicators.  Use separate routines for inter and intra
- * communicators (there is a routine to give both)
- * Note that the routines may return MPI_COMM_NULL, so code should test for
- * that return value as well.
- *
- */
-SMPI_VARINIT_GLOBAL_AND_SET(interCommIdx, int, 0);
-SMPI_VARINIT_GLOBAL_AND_SET(intraCommIdx, int, 0);
-SMPI_VARINIT_GLOBAL_AND_SET(intraCommName, const char *, 0);
-SMPI_VARINIT_GLOBAL_AND_SET(interCommName, const char *, 0);
-
-/*
- * Get an intracommunicator with at least min_size members.  If "allowSmaller"
- * is true, allow the communicator to be smaller than MPI_COMM_WORLD and
- * for this routine to return MPI_COMM_NULL for some values.  Returns 0 if
- * no more communicators are available.
- */
-int MTestGetIntracommGeneral(MPI_Comm * comm, int min_size, int allowSmaller)
-{
-    int size, rank, merr;
-    int done = 0;
-    int isBasic = 0;
-
-    /* The while loop allows us to skip communicators that are too small.
-     * MPI_COMM_NULL is always considered large enough */
-    while (!done) {
-        isBasic = 0;
-        SMPI_VARGET_GLOBAL(intraCommName) = "";
-        switch (SMPI_VARGET_GLOBAL(intraCommIdx)) {
-        case 0:
-            *comm = MPI_COMM_WORLD;
-            isBasic = 1;
-            SMPI_VARGET_GLOBAL(intraCommName) = "MPI_COMM_WORLD";
-            break;
-        case 1:
-            /* dup of world */
-            merr = MPI_Comm_dup(MPI_COMM_WORLD, comm);
-            if (merr)
-                MTestPrintError(merr);
-            SMPI_VARGET_GLOBAL(intraCommName) = "Dup of MPI_COMM_WORLD";
-            break;
-        case 2:
-            /* reverse ranks */
-            merr = MPI_Comm_size(MPI_COMM_WORLD, &size);
-            if (merr)
-                MTestPrintError(merr);
-            merr = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-            if (merr)
-                MTestPrintError(merr);
-            merr = MPI_Comm_split(MPI_COMM_WORLD, 0, size - rank, comm);
-            if (merr)
-                MTestPrintError(merr);
-            SMPI_VARGET_GLOBAL(intraCommName) = "Rank reverse of MPI_COMM_WORLD";
-            break;
-        case 3:
-            /* subset of world, with reversed ranks */
-            merr = MPI_Comm_size(MPI_COMM_WORLD, &size);
-            if (merr)
-                MTestPrintError(merr);
-            merr = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-            if (merr)
-                MTestPrintError(merr);
-            merr = MPI_Comm_split(MPI_COMM_WORLD, ((rank < size / 2) ? 1 : MPI_UNDEFINED),
-                                  size - rank, comm);
-            if (merr)
-                MTestPrintError(merr);
-            SMPI_VARGET_GLOBAL(intraCommName) = "Rank reverse of half of MPI_COMM_WORLD";
-            break;
-        case 4:
-            *comm = MPI_COMM_SELF;
-            isBasic = 1;
-            SMPI_VARGET_GLOBAL(intraCommName) = "MPI_COMM_SELF";
-            break;
-        case 5:
-            {
-#if MTEST_HAVE_MIN_MPI_VERSION(3,0)
-                /* Dup of the world using MPI_Intercomm_merge */
-                int rleader, isLeft;
-                MPI_Comm local_comm, inter_comm;
-                MPI_Comm_size(MPI_COMM_WORLD, &size);
-                MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-                if (size > 1) {
-                    merr = MPI_Comm_split(MPI_COMM_WORLD, (rank < size / 2), rank, &local_comm);
-                    if (merr)
-                        MTestPrintError(merr);
-                    if (rank == 0) {
-                        rleader = size / 2;
-                    }
-                    else if (rank == size / 2) {
-                        rleader = 0;
-                    }
-                    else {
-                        rleader = -1;
-                    }
-                    isLeft = rank < size / 2;
-                    merr =
-                        MPI_Intercomm_create(local_comm, 0, MPI_COMM_WORLD, rleader, 99,
-                                             &inter_comm);
-                    if (merr)
-                        MTestPrintError(merr);
-                    merr = MPI_Intercomm_merge(inter_comm, isLeft, comm);
-                    if (merr)
-                        MTestPrintError(merr);
-                    MPI_Comm_free(&inter_comm);
-                    MPI_Comm_free(&local_comm);
-                    SMPI_VARGET_GLOBAL(intraCommName) = "Dup of WORLD created by MPI_Intercomm_merge";
-                }
-                else {
-                    *comm = MPI_COMM_NULL;
-                }
-            }
-            break;
-        case 6:
-            {
-                /* Even of the world using MPI_Comm_create_group */
-                int i;
-                MPI_Group world_group, even_group;
-                int *excl = NULL;
-
-                MPI_Comm_size(MPI_COMM_WORLD, &size);
-                MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-                if (allowSmaller && (size + 1) / 2 >= min_size) {
-                    /* exclude the odd ranks */
-                    excl = malloc((size / 2) * sizeof(int));
-                    for (i = 0; i < size / 2; i++)
-                        excl[i] = (2 * i) + 1;
-
-                    MPI_Comm_group(MPI_COMM_WORLD, &world_group);
-                    MPI_Group_excl(world_group, size / 2, excl, &even_group);
-                    MPI_Group_free(&world_group);
-                    free(excl);
-
-                    if (rank % 2 == 0) {
-                        /* Even processes create a comm. for themselves */
-                        MPI_Comm_create_group(MPI_COMM_WORLD, even_group, 0, comm);
-                        SMPI_VARGET_GLOBAL(intraCommName) = "Even of WORLD created by MPI_Comm_create_group";
-                    }
-                    else {
-                        *comm = MPI_COMM_NULL;
-                    }
-
-                    MPI_Group_free(&even_group);
-                }
-                else {
-                    *comm = MPI_COMM_NULL;
-                }
-#else
-                *comm = MPI_COMM_NULL;
-#endif
-            }
-            break;
-        case 7:
-            {
-                /* High half of the world using MPI_Comm_create */
-                int ranges[1][3];
-                MPI_Group world_group, high_group;
-                MPI_Comm_size(MPI_COMM_WORLD, &size);
-                MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-                ranges[0][0] = size / 2;
-                ranges[0][1] = size - 1;
-                ranges[0][2] = 1;
-
-                if (allowSmaller && (size + 1) / 2 >= min_size) {
-                    MPI_Comm_group(MPI_COMM_WORLD, &world_group);
-                    merr = MPI_Group_range_incl(world_group, 1, ranges, &high_group);
-                    if (merr)
-                        MTestPrintError(merr);
-                    merr = MPI_Comm_create(MPI_COMM_WORLD, high_group, comm);
-                    if (merr)
-                        MTestPrintError(merr);
-                    MPI_Group_free(&world_group);
-                    MPI_Group_free(&high_group);
-                    SMPI_VARGET_GLOBAL(intraCommName) = "High half of WORLD created by MPI_Comm_create";
-                }
-                else {
-                    *comm = MPI_COMM_NULL;
-                }
-            }
-            break;
-            /* These next cases are communicators that include some
-             * but not all of the processes */
-        case 8:
-        case 9:
-        case 10:
-        case 11:
-            {
-                int newsize;
-                merr = MPI_Comm_size(MPI_COMM_WORLD, &size);
-                if (merr)
-                    MTestPrintError(merr);
-                newsize = size - (SMPI_VARGET_GLOBAL(intraCommIdx) - 7);
-
-                if (allowSmaller && newsize >= min_size) {
-                    merr = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-                    if (merr)
-                        MTestPrintError(merr);
-                    merr = MPI_Comm_split(MPI_COMM_WORLD, rank < newsize, rank, comm);
-                    if (merr)
-                        MTestPrintError(merr);
-                    if (rank >= newsize) {
-                        merr = MPI_Comm_free(comm);
-                        if (merr)
-                            MTestPrintError(merr);
-                        *comm = MPI_COMM_NULL;
-                    }
-                    else {
-                        SMPI_VARGET_GLOBAL(intraCommName) = "Split of WORLD";
-                    }
-                }
-                else {
-                    /* Act like default */
-                    *comm = MPI_COMM_NULL;
-                    SMPI_VARGET_GLOBAL(intraCommIdx) = -1;
-                }
-            }
-            break;
-
-            /* Other ideas: dup of self, cart comm, graph comm */
-        default:
-            *comm = MPI_COMM_NULL;
-            SMPI_VARGET_GLOBAL(intraCommIdx) = -1;
-            break;
-        }
-
-        if (*comm != MPI_COMM_NULL) {
-            merr = MPI_Comm_size(*comm, &size);
-            if (merr)
-                MTestPrintError(merr);
-            if (size >= min_size)
-                done = 1;
-        }
-        else {
-            SMPI_VARGET_GLOBAL(intraCommName) = "MPI_COMM_NULL";
-            isBasic = 1;
-            done = 1;
-        }
-
-        /* we are only done if all processes are done */
-        MPI_Allreduce(MPI_IN_PLACE, &done, 1, MPI_INT, MPI_LAND, MPI_COMM_WORLD);
-
-        /* Advance the comm index whether we are done or not, otherwise we could
-         * spin forever trying to allocate a too-small communicator over and
-         * over again. */
-        SMPI_VARGET_GLOBAL(intraCommIdx)++;
-
-        if (!done && !isBasic && *comm != MPI_COMM_NULL) {
-            /* avoid leaking communicators */
-            merr = MPI_Comm_free(comm);
-            if (merr)
-                MTestPrintError(merr);
-        }
-    }
-
-    return SMPI_VARGET_GLOBAL(intraCommIdx);
-}
-
-/*
- * Get an intracommunicator with at least min_size members.
- */
-int MTestGetIntracomm(MPI_Comm * comm, int min_size)
-{
-    return MTestGetIntracommGeneral(comm, min_size, 0);
-}
-
-/* Return the name of an intra communicator */
-const char *MTestGetIntracommName(void)
-{
-    return SMPI_VARGET_GLOBAL(intraCommName);
-}
-
-/*
- * Return an intercomm; set isLeftGroup to 1 if the calling process is
- * a member of the "left" group.
- */
-int MTestGetIntercomm(MPI_Comm * comm, int *isLeftGroup, int min_size)
-{
-    int size, rank, remsize, merr;
-    int done = 0;
-    MPI_Comm mcomm = MPI_COMM_NULL;
-    MPI_Comm mcomm2 = MPI_COMM_NULL;
-    int rleader;
-
-    /* The while loop allows us to skip communicators that are too small.
-     * MPI_COMM_NULL is always considered large enough.  The size is
-     * the sum of the sizes of the local and remote groups */
-    while (!done) {
-        *comm = MPI_COMM_NULL;
-        *isLeftGroup = 0;
-        SMPI_VARGET_GLOBAL(interCommName) = "MPI_COMM_NULL";
-
-        switch (SMPI_VARGET_GLOBAL(interCommIdx)) {
-        case 0:
-            /* Split comm world in half */
-            merr = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-            if (merr)
-                MTestPrintError(merr);
-            merr = MPI_Comm_size(MPI_COMM_WORLD, &size);
-            if (merr)
-                MTestPrintError(merr);
-            if (size > 1) {
-                merr = MPI_Comm_split(MPI_COMM_WORLD, (rank < size / 2), rank, &mcomm);
-                if (merr)
-                    MTestPrintError(merr);
-                if (rank == 0) {
-                    rleader = size / 2;
-                }
-                else if (rank == size / 2) {
-                    rleader = 0;
-                }
-                else {
-                    /* Remote leader is signficant only for the processes
-                     * designated local leaders */
-                    rleader = -1;
-                }
-                *isLeftGroup = rank < size / 2;
-                merr = MPI_Intercomm_create(mcomm, 0, MPI_COMM_WORLD, rleader, 12345, comm);
-                if (merr)
-                    MTestPrintError(merr);
-                SMPI_VARGET_GLOBAL(interCommName) = "Intercomm by splitting MPI_COMM_WORLD";
-            }
-            else
-                *comm = MPI_COMM_NULL;
-            break;
-        case 1:
-            /* Split comm world in to 1 and the rest */
-            merr = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-            if (merr)
-                MTestPrintError(merr);
-            merr = MPI_Comm_size(MPI_COMM_WORLD, &size);
-            if (merr)
-                MTestPrintError(merr);
-            if (size > 1) {
-                merr = MPI_Comm_split(MPI_COMM_WORLD, rank == 0, rank, &mcomm);
-                if (merr)
-                    MTestPrintError(merr);
-                if (rank == 0) {
-                    rleader = 1;
-                }
-                else if (rank == 1) {
-                    rleader = 0;
-                }
-                else {
-                    /* Remote leader is signficant only for the processes
-                     * designated local leaders */
-                    rleader = -1;
-                }
-                *isLeftGroup = rank == 0;
-                merr = MPI_Intercomm_create(mcomm, 0, MPI_COMM_WORLD, rleader, 12346, comm);
-                if (merr)
-                    MTestPrintError(merr);
-                SMPI_VARGET_GLOBAL(interCommName) = "Intercomm by splitting MPI_COMM_WORLD into 1, rest";
-            }
-            else
-                *comm = MPI_COMM_NULL;
-            break;
-
-        case 2:
-            /* Split comm world in to 2 and the rest */
-            merr = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-            if (merr)
-                MTestPrintError(merr);
-            merr = MPI_Comm_size(MPI_COMM_WORLD, &size);
-            if (merr)
-                MTestPrintError(merr);
-            if (size > 3) {
-                merr = MPI_Comm_split(MPI_COMM_WORLD, rank < 2, rank, &mcomm);
-                if (merr)
-                    MTestPrintError(merr);
-                if (rank == 0) {
-                    rleader = 2;
-                }
-                else if (rank == 2) {
-                    rleader = 0;
-                }
-                else {
-                    /* Remote leader is signficant only for the processes
-                     * designated local leaders */
-                    rleader = -1;
-                }
-                *isLeftGroup = rank < 2;
-                merr = MPI_Intercomm_create(mcomm, 0, MPI_COMM_WORLD, rleader, 12347, comm);
-                if (merr)
-                    MTestPrintError(merr);
-                SMPI_VARGET_GLOBAL(interCommName) = "Intercomm by splitting MPI_COMM_WORLD into 2, rest";
-            }
-            else
-                *comm = MPI_COMM_NULL;
-            break;
-
-        case 3:
-            /* Split comm world in half, then dup */
-            merr = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-            if (merr)
-                MTestPrintError(merr);
-            merr = MPI_Comm_size(MPI_COMM_WORLD, &size);
-            if (merr)
-                MTestPrintError(merr);
-            if (size > 1) {
-                merr = MPI_Comm_split(MPI_COMM_WORLD, (rank < size / 2), rank, &mcomm);
-                if (merr)
-                    MTestPrintError(merr);
-                if (rank == 0) {
-                    rleader = size / 2;
-                }
-                else if (rank == size / 2) {
-                    rleader = 0;
-                }
-                else {
-                    /* Remote leader is signficant only for the processes
-                     * designated local leaders */
-                    rleader = -1;
-                }
-                *isLeftGroup = rank < size / 2;
-                merr = MPI_Intercomm_create(mcomm, 0, MPI_COMM_WORLD, rleader, 12345, comm);
-                if (merr)
-                    MTestPrintError(merr);
-                /* avoid leaking after assignment below */
-                merr = MPI_Comm_free(&mcomm);
-                if (merr)
-                    MTestPrintError(merr);
-
-                /* now dup, some bugs only occur for dup's of intercomms */
-                mcomm = *comm;
-                merr = MPI_Comm_dup(mcomm, comm);
-                if (merr)
-                    MTestPrintError(merr);
-                SMPI_VARGET_GLOBAL(interCommName) = "Intercomm by splitting MPI_COMM_WORLD then dup'ing";
-            }
-            else
-                *comm = MPI_COMM_NULL;
-            break;
-
-        case 4:
-            /* Split comm world in half, form intercomm, then split that intercomm */
-            merr = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-            if (merr)
-                MTestPrintError(merr);
-            merr = MPI_Comm_size(MPI_COMM_WORLD, &size);
-            if (merr)
-                MTestPrintError(merr);
-            if (size > 1) {
-                merr = MPI_Comm_split(MPI_COMM_WORLD, (rank < size / 2), rank, &mcomm);
-                if (merr)
-                    MTestPrintError(merr);
-                if (rank == 0) {
-                    rleader = size / 2;
-                }
-                else if (rank == size / 2) {
-                    rleader = 0;
-                }
-                else {
-                    /* Remote leader is signficant only for the processes
-                     * designated local leaders */
-                    rleader = -1;
-                }
-                *isLeftGroup = rank < size / 2;
-                merr = MPI_Intercomm_create(mcomm, 0, MPI_COMM_WORLD, rleader, 12345, comm);
-                if (merr)
-                    MTestPrintError(merr);
-                /* avoid leaking after assignment below */
-                merr = MPI_Comm_free(&mcomm);
-                if (merr)
-                    MTestPrintError(merr);
-
-                /* now split, some bugs only occur for splits of intercomms */
-                mcomm = *comm;
-                merr = MPI_Comm_rank(mcomm, &rank);
-                if (merr)
-                    MTestPrintError(merr);
-                /* this split is effectively a dup but tests the split code paths */
-                merr = MPI_Comm_split(mcomm, 0, rank, comm);
-                if (merr)
-                    MTestPrintError(merr);
-                SMPI_VARGET_GLOBAL(interCommName) = "Intercomm by splitting MPI_COMM_WORLD then then splitting again";
-            }
-            else
-                *comm = MPI_COMM_NULL;
-            break;
-
-        case 5:
-            /* split comm world in half discarding rank 0 on the "left"
-             * communicator, then form them into an intercommunicator */
-            merr = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-            if (merr)
-                MTestPrintError(merr);
-            merr = MPI_Comm_size(MPI_COMM_WORLD, &size);
-            if (merr)
-                MTestPrintError(merr);
-            if (size >= 4) {
-                int color = (rank < size / 2 ? 0 : 1);
-                if (rank == 0)
-                    color = MPI_UNDEFINED;
-
-                merr = MPI_Comm_split(MPI_COMM_WORLD, color, rank, &mcomm);
-                if (merr)
-                    MTestPrintError(merr);
-
-                if (rank == 1) {
-                    rleader = size / 2;
-                }
-                else if (rank == (size / 2)) {
-                    rleader = 1;
-                }
-                else {
-                    /* Remote leader is signficant only for the processes
-                     * designated local leaders */
-                    rleader = -1;
-                }
-                *isLeftGroup = rank < size / 2;
-                if (rank != 0) {        /* 0's mcomm is MPI_COMM_NULL */
-                    merr = MPI_Intercomm_create(mcomm, 0, MPI_COMM_WORLD, rleader, 12345, comm);
-                    if (merr)
-                        MTestPrintError(merr);
-                }
-                SMPI_VARGET_GLOBAL(interCommName) =
-                    "Intercomm by splitting MPI_COMM_WORLD (discarding rank 0 in the left group) then MPI_Intercomm_create'ing";
-            }
-            else {
-                *comm = MPI_COMM_NULL;
-            }
-            break;
-
-        case 6:
-            /* Split comm world in half then form them into an
-             * intercommunicator.  Then discard rank 0 from each group of the
-             * intercomm via MPI_Comm_create. */
-            merr = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-            if (merr)
-                MTestPrintError(merr);
-            merr = MPI_Comm_size(MPI_COMM_WORLD, &size);
-            if (merr)
-                MTestPrintError(merr);
-            if (size >= 4) {
-                MPI_Group oldgroup, newgroup;
-                int ranks[1];
-                int color = (rank < size / 2 ? 0 : 1);
-
-                merr = MPI_Comm_split(MPI_COMM_WORLD, color, rank, &mcomm);
-                if (merr)
-                    MTestPrintError(merr);
-
-                if (rank == 0) {
-                    rleader = size / 2;
-                }
-                else if (rank == (size / 2)) {
-                    rleader = 0;
-                }
-                else {
-                    /* Remote leader is signficant only for the processes
-                     * designated local leaders */
-                    rleader = -1;
-                }
-                *isLeftGroup = rank < size / 2;
-                merr = MPI_Intercomm_create(mcomm, 0, MPI_COMM_WORLD, rleader, 12345, &mcomm2);
-                if (merr)
-                    MTestPrintError(merr);
-
-                /* We have an intercomm between the two halves of comm world. Now create
-                 * a new intercomm that removes rank 0 on each side. */
-                merr = MPI_Comm_group(mcomm2, &oldgroup);
-                if (merr)
-                    MTestPrintError(merr);
-                ranks[0] = 0;
-                merr = MPI_Group_excl(oldgroup, 1, ranks, &newgroup);
-                if (merr)
-                    MTestPrintError(merr);
-                merr = MPI_Comm_create(mcomm2, newgroup, comm);
-                if (merr)
-                    MTestPrintError(merr);
-
-                merr = MPI_Group_free(&oldgroup);
-                if (merr)
-                    MTestPrintError(merr);
-                merr = MPI_Group_free(&newgroup);
-                if (merr)
-                    MTestPrintError(merr);
-
-                SMPI_VARGET_GLOBAL(interCommName) =
-                    "Intercomm by splitting MPI_COMM_WORLD then discarding 0 ranks with MPI_Comm_create";
-            }
-            else {
-                *comm = MPI_COMM_NULL;
-            }
-            break;
-
-        default:
-            *comm = MPI_COMM_NULL;
-            SMPI_VARGET_GLOBAL(interCommIdx) = -1;
-            break;
-        }
-
-        if (*comm != MPI_COMM_NULL) {
-            merr = MPI_Comm_size(*comm, &size);
-            if (merr)
-                MTestPrintError(merr);
-            merr = MPI_Comm_remote_size(*comm, &remsize);
-            if (merr)
-                MTestPrintError(merr);
-            if (size + remsize >= min_size)
-                done = 1;
-        }
-        else {
-            SMPI_VARGET_GLOBAL(interCommName) = "MPI_COMM_NULL";
-            done = 1;
-        }
-
-        /* we are only done if all processes are done */
-        MPI_Allreduce(MPI_IN_PLACE, &done, 1, MPI_INT, MPI_LAND, MPI_COMM_WORLD);
-
-        /* Advance the comm index whether we are done or not, otherwise we could
-         * spin forever trying to allocate a too-small communicator over and
-         * over again. */
-        SMPI_VARGET_GLOBAL(interCommIdx)++;
-
-        if (!done && *comm != MPI_COMM_NULL) {
-            /* avoid leaking communicators */
-            merr = MPI_Comm_free(comm);
-            if (merr)
-                MTestPrintError(merr);
-        }
-
-        /* cleanup for common temp objects */
-        if (mcomm != MPI_COMM_NULL) {
-            merr = MPI_Comm_free(&mcomm);
-            if (merr)
-                MTestPrintError(merr);
-        }
-        if (mcomm2 != MPI_COMM_NULL) {
-            merr = MPI_Comm_free(&mcomm2);
-            if (merr)
-                MTestPrintError(merr);
-        }
-    }
-
-    return SMPI_VARGET_GLOBAL(interCommIdx);
-}
-
-int MTestTestIntercomm(MPI_Comm comm)
-{
-    int local_size, remote_size, rank, **bufs, *bufmem, rbuf[2], j;
-    int errs = 0, wrank_loc, nsize;
-    char commname[MPI_MAX_OBJECT_NAME + 1];
-    MPI_Request *reqs;
-
-    MPI_Comm_rank(MPI_COMM_WORLD, &wrank_loc);
-    MPI_Comm_size(comm, &local_size);
-    MPI_Comm_remote_size(comm, &remote_size);
-    MPI_Comm_rank(comm, &rank);
-    MPI_Comm_get_name(comm, commname, &nsize);
-
-    MTestPrintfMsg(1, "Testing communication on intercomm '%s', remote_size=%d\n",
-                   commname, remote_size);
-
-    reqs = (MPI_Request *) malloc(remote_size * sizeof(MPI_Request));
-    if (!reqs) {
-        printf("[%d] Unable to allocated %d requests for testing intercomm %s\n",
-               wrank_loc, remote_size, commname);
-        errs++;
-        return errs;
-    }
-    bufs = (int **) malloc(remote_size * sizeof(int *));
-    if (!bufs) {
-        printf("[%d] Unable to allocated %d int pointers for testing intercomm %s\n",
-               wrank_loc, remote_size, commname);
-        errs++;
-        return errs;
-    }
-    bufmem = (int *) malloc(remote_size * 2 * sizeof(int));
-    if (!bufmem) {
-        printf("[%d] Unable to allocated %d int data for testing intercomm %s\n",
-               wrank_loc, 2 * remote_size, commname);
-        errs++;
-        return errs;
-    }
-
-    /* Each process sends a message containing its own rank and the
-     * rank of the destination with a nonblocking send.  Because we're using
-     * nonblocking sends, we need to use different buffers for each isend */
-    /* NOTE: the send buffer access restriction was relaxed in MPI-2.2, although
-     * it doesn't really hurt to keep separate buffers for our purposes */
-    for (j = 0; j < remote_size; j++) {
-        bufs[j] = &bufmem[2 * j];
-        bufs[j][0] = rank;
-        bufs[j][1] = j;
-        MPI_Isend(bufs[j], 2, MPI_INT, j, 0, comm, &reqs[j]);
-    }
-    MTestPrintfMsg(2, "isends posted, about to recv\n");
-
-    for (j = 0; j < remote_size; j++) {
-        MPI_Recv(rbuf, 2, MPI_INT, j, 0, comm, MPI_STATUS_IGNORE);
-        if (rbuf[0] != j) {
-            printf("[%d] Expected rank %d but saw %d in %s\n", wrank_loc, j, rbuf[0], commname);
-            errs++;
-        }
-        if (rbuf[1] != rank) {
-            printf("[%d] Expected target rank %d but saw %d from %d in %s\n",
-                   wrank_loc, rank, rbuf[1], j, commname);
-            errs++;
-        }
-    }
-    if (errs)
-        fflush(stdout);
-
-    MTestPrintfMsg(2, "my recvs completed, about to waitall\n");
-    MPI_Waitall(remote_size, reqs, MPI_STATUSES_IGNORE);
-
-    free(reqs);
-    free(bufs);
-    free(bufmem);
-
-    return errs;
-}
-
-int MTestTestIntracomm(MPI_Comm comm)
-{
-    int i, errs = 0;
-    int size;
-    int in[16], out[16], sol[16];
-
-    MPI_Comm_size(comm, &size);
-
-    /* Set input, output and sol-values */
-    for (i = 0; i < 16; i++) {
-        in[i] = i;
-        out[i] = 0;
-        sol[i] = i * size;
-    }
-    MPI_Allreduce(in, out, 16, MPI_INT, MPI_SUM, comm);
-
-    /* Test results */
-    for (i = 0; i < 16; i++) {
-        if (sol[i] != out[i])
-            errs++;
-    }
-
-    return errs;
-}
-
-int MTestTestComm(MPI_Comm comm)
-{
-    int is_inter;
-
-    if (comm == MPI_COMM_NULL)
-        return 0;
-
-    MPI_Comm_test_inter(comm, &is_inter);
-
-    if (is_inter)
-        return MTestTestIntercomm(comm);
-    else
-        return MTestTestIntracomm(comm);
-}
-
-/* Return the name of an intercommunicator */
-const char *MTestGetIntercommName(void)
-{
-    return SMPI_VARGET_GLOBAL(interCommName);
-}
-
-/* Get a communicator of a given minimum size.  Both intra and inter
-   communicators are provided */
-int MTestGetComm(MPI_Comm * comm, int min_size)
-{
-    int idx = 0;
-    static int getinter = 0;
-
-    if (!getinter) {
-        idx = MTestGetIntracomm(comm, min_size);
-        if (idx == 0) {
-            getinter = 1;
-        }
-    }
-    if (getinter) {
-        int isLeft;
-        idx = MTestGetIntercomm(comm, &isLeft, min_size);
-        if (idx == 0) {
-            getinter = 0;
-        }
-    }
-
-    return idx;
-}
-
-/* Free a communicator.  It may be called with a predefined communicator
- or MPI_COMM_NULL */
-void MTestFreeComm(MPI_Comm * comm)
-{
-    int merr;
-    if (*comm != MPI_COMM_WORLD && *comm != MPI_COMM_SELF && *comm != MPI_COMM_NULL) {
-        merr = MPI_Comm_free(comm);
-        if (merr)
-            MTestPrintError(merr);
-    }
-}
-
-/* ------------------------------------------------------------------------ */
-void MTestPrintError(int errcode)
-{
-    int errclass, slen;
-    char string[MPI_MAX_ERROR_STRING];
-
-    MPI_Error_class(errcode, &errclass);
-    MPI_Error_string(errcode, string, &slen);
-    printf("Error class %d (%s)\n", errclass, string);
-    fflush(stdout);
-}
-
-void MTestPrintErrorMsg(const char msg[], int errcode)
-{
-    int errclass, slen;
-    char string[MPI_MAX_ERROR_STRING];
-
-    MPI_Error_class(errcode, &errclass);
-    MPI_Error_string(errcode, string, &slen);
-    printf("%s: Error class %d (%s)\n", msg, errclass, string);
-    fflush(stdout);
-}
-
-/* ------------------------------------------------------------------------ */
-/*
- If verbose output is selected and the level is at least that of the
- value of the verbose flag, then perform printf(format, ...);
- */
-void MTestPrintfMsg(int level, const char format[], ...)
-{
-    va_list list;
-
-    if (SMPI_VARGET_GLOBAL(verbose) && level <= SMPI_VARGET_GLOBAL(verbose)) {
-        va_start(list, format);
-        vprintf(format, list);
-        va_end(list);
-        fflush(stdout);
-    }
-}
-
-/* Fatal error.  Report and exit */
-void MTestError(const char *msg)
-{
-    fprintf(stderr, "%s\n", msg);
-    fflush(stderr);
-    MPI_Abort(MPI_COMM_WORLD, 1);
-}
-
-/* ------------------------------------------------------------------------ */
-static void MTestResourceSummary(FILE * fp)
-{
-#ifdef HAVE_GETRUSAGE
-    struct rusage ru;
-    static int pfThreshold = -2;
-    int doOutput = 1;
-    if (getrusage(RUSAGE_SELF, &ru) == 0) {
-        /* There is an option to generate output only when a resource
-         * exceeds a threshold.  To date, only page faults supported. */
-        if (pfThreshold == -2) {
-            char *p = getenv("MPITEST_RUSAGE_PF");
-            pfThreshold = -1;
-            if (p) {
-                pfThreshold = strtol(p, 0, 0);
-            }
-        }
-        if (pfThreshold > 0) {
-            doOutput = ru.ru_minflt > pfThreshold;
-        }
-        if (doOutput) {
-            /* Cast values to long in case some system has defined them
-             * as another integer type */
-            fprintf(fp, "RUSAGE: max resident set = %ldKB\n", (long) ru.ru_maxrss);
-            fprintf(fp, "RUSAGE: page faults = %ld : %ld\n",
-                    (long) ru.ru_minflt, (long) ru.ru_majflt);
-            /* Not every Unix provides useful information for the xxrss fields */
-            fprintf(fp, "RUSAGE: memory in text/data/stack = %ld : %ld : %ld\n",
-                    (long) ru.ru_ixrss, (long) ru.ru_idrss, (long) ru.ru_isrss);
-            fprintf(fp, "RUSAGE: I/O in and out = %ld : %ld\n",
-                    (long) ru.ru_inblock, (long) ru.ru_oublock);
-            fprintf(fp, "RUSAGE: context switch = %ld : %ld\n",
-                    (long) ru.ru_nvcsw, (long) ru.ru_nivcsw);
-        }
-    }
-    else {
-        fprintf(fp, "RUSAGE: return error %d\n", errno);
-    }
-#endif
-}
-
-/* ------------------------------------------------------------------------ */
-#ifdef HAVE_MPI_WIN_CREATE
-/*
- * Create MPI Windows
- */
-SMPI_VARINIT_GLOBAL_AND_SET(win_index, int, 0);
-SMPI_VARINIT_GLOBAL(winName, const char *);
-/* Use an attribute to remember the type of memory allocation (static,
-   malloc, or MPI_Alloc_mem) */
-SMPI_VARINIT_GLOBAL_AND_SET(mem_keyval, int, MPI_KEYVAL_INVALID);
-int MTestGetWin(MPI_Win * win, int mustBePassive)
-{
-    static char actbuf[1024];
-    static char *pasbuf;
-    char *buf;
-    int n, rank, merr;
-    MPI_Info info;
-
-    if (SMPI_VARGET_GLOBAL(mem_keyval) == MPI_KEYVAL_INVALID) {
-        /* Create the keyval */
-        merr = MPI_Win_create_keyval(MPI_WIN_NULL_COPY_FN, MPI_WIN_NULL_DELETE_FN, &SMPI_VARGET_GLOBAL(mem_keyval), 0);
-        if (merr)
-            MTestPrintError(merr);
-
-    }
-
-    switch (SMPI_VARGET_GLOBAL(win_index)) {
-    case 0:
-        /* Active target window */
-        merr = MPI_Win_create(actbuf, 1024, 1, MPI_INFO_NULL, MPI_COMM_WORLD, win);
-        if (merr)
-            MTestPrintError(merr);
-        SMPI_VARGET_GLOBAL(winName) = "active-window";
-        merr = MPI_Win_set_attr(*win, SMPI_VARGET_GLOBAL(mem_keyval), (void *) 0);
-        if (merr)
-            MTestPrintError(merr);
-        break;
-    case 1:
-        /* Passive target window */
-        merr = MPI_Alloc_mem(1024, MPI_INFO_NULL, &pasbuf);
-        if (merr)
-            MTestPrintError(merr);
-        merr = MPI_Win_create(pasbuf, 1024, 1, MPI_INFO_NULL, MPI_COMM_WORLD, win);
-        if (merr)
-            MTestPrintError(merr);
-        SMPI_VARGET_GLOBAL(winName) = "passive-window";
-        merr = MPI_Win_set_attr(*win, SMPI_VARGET_GLOBAL(mem_keyval), (void *) 2);
-        if (merr)
-            MTestPrintError(merr);
-        break;
-    case 2:
-        /* Active target; all windows different sizes */
-        merr = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-        if (merr)
-            MTestPrintError(merr);
-        n = rank * 64;
-        if (n)
-            buf = (char *) malloc(n);
-        else
-            buf = 0;
-        merr = MPI_Win_create(buf, n, 1, MPI_INFO_NULL, MPI_COMM_WORLD, win);
-        if (merr)
-            MTestPrintError(merr);
-        SMPI_VARGET_GLOBAL(winName) = "active-all-different-win";
-        merr = MPI_Win_set_attr(*win, SMPI_VARGET_GLOBAL(mem_keyval), (void *) 1);
-        if (merr)
-            MTestPrintError(merr);
-        break;
-    case 3:
-        /* Active target, no locks set */
-        merr = MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-        if (merr)
-            MTestPrintError(merr);
-        n = rank * 64;
-        if (n)
-            buf = (char *) malloc(n);
-        else
-            buf = 0;
-        merr = MPI_Info_create(&info);
-        if (merr)
-            MTestPrintError(merr);
-        merr = MPI_Info_set(info, (char *) "nolocks", (char *) "true");
-        if (merr)
-            MTestPrintError(merr);
-        merr = MPI_Win_create(buf, n, 1, info, MPI_COMM_WORLD, win);
-        if (merr)
-            MTestPrintError(merr);
-        merr = MPI_Info_free(&info);
-        if (merr)
-            MTestPrintError(merr);
-        SMPI_VARGET_GLOBAL(winName) = "active-nolocks-all-different-win";
-        merr = MPI_Win_set_attr(*win, SMPI_VARGET_GLOBAL(mem_keyval), (void *) 1);
-        if (merr)
-            MTestPrintError(merr);
-        break;
-    default:
-        SMPI_VARGET_GLOBAL(win_index) = -1;
-    }
-    SMPI_VARGET_GLOBAL(win_index)++;
-    return SMPI_VARGET_GLOBAL(win_index);
-}
-
-/* Return a pointer to the name associated with a window object */
-const char *MTestGetWinName(void)
-{
-    return SMPI_VARGET_GLOBAL(winName);
-}
-
-/* Free the storage associated with a window object */
-void MTestFreeWin(MPI_Win * win)
-{
-    void *addr;
-    int flag, merr;
-
-    merr = MPI_Win_get_attr(*win, MPI_WIN_BASE, &addr, &flag);
-    if (merr)
-        MTestPrintError(merr);
-    if (!flag) {
-        MTestError("Could not get WIN_BASE from window");
-    }
-    if (addr) {
-        void *val;
-        merr = MPI_Win_get_attr(*win, SMPI_VARGET_GLOBAL(mem_keyval), &val, &flag);
-        if (merr)
-            MTestPrintError(merr);
-        if (flag) {
-            if (val == (void *) 1) {
-                free(addr);
-            }
-            else if (val == (void *) 2) {
-                merr = MPI_Free_mem(addr);
-                if (merr)
-                    MTestPrintError(merr);
-            }
-            /* if val == (void *)0, then static data that must not be freed */
-        }
-    }
-    merr = MPI_Win_free(win);
-    if (merr)
-        MTestPrintError(merr);
-}
-
-static void MTestRMACleanup(void)
-{
-    if (SMPI_VARGET_GLOBAL(mem_keyval) != MPI_KEYVAL_INVALID) {
-        MPI_Win_free_keyval(&SMPI_VARGET_GLOBAL(mem_keyval));
-    }
-}
-#else
-static void MTestRMACleanup(void)
-{
-}
-#endif
-
-/* ------------------------------------------------------------------------ */
-/* This function determines if it is possible to spawn addition MPI
- * processes using MPI_COMM_SPAWN and MPI_COMM_SPAWN_MULTIPLE.
- *
- * It sets the can_spawn value to one of the following:
- * 1  = yes, additional processes can be spawned
- * 0  = no, MPI_UNIVERSE_SIZE <= the size of MPI_COMM_WORLD
- * -1 = it is unknown whether or not processes can be spawned
- *      due to errors in the necessary query functions
- *
- */
-int MTestSpawnPossible(int *can_spawn)
-{
-    int errs = 0;
-
-    void *v = NULL;
-    int flag = -1;
-    int vval = -1;
-    int rc;
-
-    rc = MPI_Comm_get_attr(MPI_COMM_WORLD, MPI_UNIVERSE_SIZE, &v, &flag);
-    if (rc != MPI_SUCCESS) {
-        /* MPI_UNIVERSE_SIZE keyval missing from MPI_COMM_WORLD attributes */
-        *can_spawn = -1;
-        errs++;
-    }
-    else {
-        /* MPI_UNIVERSE_SIZE need not be set */
-        if (flag) {
-
-            int size = -1;
-            rc = MPI_Comm_size(MPI_COMM_WORLD, &size);
-            if (rc != MPI_SUCCESS) {
-                /* MPI_Comm_size failed for MPI_COMM_WORLD */
-                *can_spawn = -1;
-                errs++;
-            }
-
-            vval = *(int *) v;
-            if (vval <= size) {
-                /* no additional processes can be spawned */
-                *can_spawn = 0;
-            }
-            else {
-                *can_spawn = 1;
-            }
-        }
-        else {
-            /* No attribute associated with key MPI_UNIVERSE_SIZE of MPI_COMM_WORLD */
-            *can_spawn = -1;
-        }
-    }
-    return errs;
-}
-
-/* ------------------------------------------------------------------------ */
index 07c2b8f..143b479 100644 (file)
@@ -5,12 +5,40 @@
 
 
 static int myvalue = 0;
-
+static void test_opts(int* argc, char **argv[]){
+  int found = 0;
+  static struct option long_options[] = {
+  {(char*)"long",     no_argument, 0,  0 },
+  {0,         0,                 0,  0 }
+  };
+  while (1) {
+    int ret = getopt_long_only(*argc, *argv, "s", long_options, NULL);
+    if(ret==-1)
+      break;
+
+    switch (ret) {
+      case 0:
+        found++;
+      break;
+      case 's':
+        found ++;
+      break;
+      default:
+        printf("option %s", long_options[0].name);
+      break;
+    }
+  }
+  if (found!=2){
+    printf("(smpi_)getopt_long_only failed ! \n");
+  }
+}
 int main(int argc, char **argv)
 {
     int me;
 
     MPI_Init(&argc, &argv);
+    /* test getopt_long function */
+    test_opts(&argc, &argv);
 
     MPI_Comm_rank(MPI_COMM_WORLD, &me);
 
index fa4352a..5f5f479 100644 (file)
@@ -1,4 +1,4 @@
 p Test privatization
 ! 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:${privatization:=1} --log=simix_context.thres:error --log=xbt_memory_map.thres:critical
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 32 ${bindir:=.}/privatization -s -long --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/privatization:${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 dbbcf91..0a76bed 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(dsend,"the dsend test");
 
-int main()
+static void test_opts(int* argc, char **argv[]){
+  int found = 0;
+  int option_index = 0;
+  static struct option long_options[] = {
+  {(char*)"long",     no_argument, 0,  0 },
+  {0,         0,                 0,  0 }
+  };
+  while (1) {
+    int ret = getopt_long(*argc, *argv, "s", long_options, &option_index);
+    if(ret==-1)
+      break;
+
+    switch (ret) {
+      case 0:
+        found++;
+      break;
+      case 's':
+        found ++;
+      break;
+      default:
+        printf("option %s", long_options[option_index].name);
+      break;
+    }
+  }
+  if (found!=2){
+    printf("(smpi_)getopt_long failed ! \n");
+  }
+}
+
+int main(int argc, char *argv[])
 {
   int rank;
   int32_t data=11;
 
   MPI_Init(NULL, NULL);
+
+  /* test getopt_long function */
+  test_opts(&argc, &argv);
+
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
   MPI_Request r;
   if (rank==1) {
index edd9479..09a5b98 100644 (file)
@@ -1,6 +1,6 @@
 p Test dsend
 ! output sort
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ${bindir:=.}/../hostfile -platform ${platfdir}/small_platform.xml -np 2 ${bindir:=.}/pt2pt-dsend -q --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/simulate-computation:no
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ${bindir:=.}/../hostfile -platform ${platfdir}/small_platform.xml -np 2 ${bindir:=.}/pt2pt-dsend -s --long --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning --cfg=smpi/simulate-computation:no
 > [Jupiter:1:(2) 0.000000] [dsend/INFO] rank 1: data exchanged
 > [Tremblay:0:(1) 0.005890] [dsend/INFO] rank 0: data exchanged
 > [rank 0] -> Tremblay
@@ -11,7 +11,7 @@ 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
 ! output sort
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ${bindir:=.}/../hostfile -platform ${platfdir}/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 --cfg=smpi/simulate-computation:no --log=xbt_cfg.thres:warning
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ${bindir:=.}/../hostfile -platform ${platfdir}/small_platform.xml -np 2 ${bindir:=.}/pt2pt-dsend -s --long --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 --cfg=smpi/simulate-computation:no --log=xbt_cfg.thres:warning
 > [Jupiter:1:(2) 9.900000] [dsend/INFO] rank 1: data exchanged
 > [Tremblay:0:(1) 14.505890] [dsend/INFO] rank 0: data exchanged
 > [rank 0] -> Tremblay
index 91d3dec..160ddc0 100644 (file)
@@ -4,7 +4,7 @@ $ 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)
 ! output sort
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt --cfg=smpi/simulate-computation:no -map -hostfile ${srcdir:=.}/../hostfile -platform ${srcdir:=.}/../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -q --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt --cfg=smpi/simulate-computation:no -map -hostfile ${srcdir:=.}/../hostfile -platform ${srcdir:=.}/../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -s --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 >
 >
 >
@@ -95,7 +95,7 @@ $ rm out_in_ti.txt
 p Same test, but only using one output file for all processes
 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)
 ! output sort
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt --cfg=tracing/smpi/format/ti-one-file:yes -map -hostfile ${srcdir:=.}/../hostfile -platform ${srcdir:=.}/../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -q --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt --cfg=tracing/smpi/format/ti-one-file:yes --cfg=smpi/simulate-computation:no -map -hostfile ${srcdir:=.}/../hostfile -platform ${srcdir:=.}/../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -s --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 >
 >
 >
@@ -125,7 +125,7 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -trace-ti --cfg=tracing/filename
 > [rank 2] -> Fafard
 > [rank 3] -> Ginette
 
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -no-privatize -replay ./out_in_ti.txt --log=replay.:critical -trace-ti --cfg=tracing/filename:out_ti.txt --cfg=tracing/smpi/format/ti-one-file:yes -map -hostfile ${srcdir:=.}/../hostfile -platform ${srcdir:=.}/../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/../../../examples/smpi/replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -no-privatize -replay ./out_in_ti.txt --log=replay.:critical -trace-ti --cfg=tracing/filename:out_ti.txt --cfg=tracing/smpi/format/ti-one-file:yes --cfg=smpi/simulate-computation:no -map -hostfile ${srcdir:=.}/../hostfile -platform ${srcdir:=.}/../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/../../../examples/smpi/replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 > [rank 0] -> Tremblay
 > [rank 1] -> Jupiter
 > [rank 2] -> Fafard
index 3629028..f6f0f23 100644 (file)
@@ -1,7 +1,7 @@
 ! 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
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile ../hostfile_empty  -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -s --log=smpi_kernel.thres:warning
 > [smpirun] ** error: the hostfile '../hostfile_empty' is empty. Aborting.
 
 ! expect return 1
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile hostfile-does-not-exist.txt -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -q --log=smpi_kernel.thres:warning
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -hostfile hostfile-does-not-exist.txt -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -s --log=smpi_kernel.thres:warning
 > [smpirun] ** error: the file 'hostfile-does-not-exist.txt' does not exist. Aborting.
index e42b1b8..c46ea33 100644 (file)
@@ -9,6 +9,19 @@
 #include <stdio.h>
 #include <mpi.h>
 
+static void test_opts(int* argc, char **argv[]){
+  int found = 0;
+  int ret;
+  while ((ret = getopt(*argc, *argv, "s")) >= 0)
+  {
+    if (ret == 's')
+      found = 1;
+  }
+  if (found!=1){
+    printf("(smpi_)getopt failed ! \n");
+  }
+}
+
 int main(int argc, char *argv[])
 {
   const int tag1 = 42;
@@ -19,6 +32,10 @@ int main(int argc, char *argv[])
   MPI_Status status;
 
   int err = MPI_Init(&argc, &argv); /* Initialize MPI */
+
+  /* test getopt function */
+  test_opts(&argc, &argv);
+
   if (err != MPI_SUCCESS) {
     printf("MPI initialization failed!\n");
     exit(1);
index 6120d55..fb42fb4 100644 (file)
@@ -1,6 +1,6 @@
 p Test pingpong
 ! 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
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -s --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning
 >     *** Ping-pong test (MPI_Send/MPI_Recv) ***
 >
 >
index ab86688..fcedf0d 100644 (file)
@@ -1,4 +1,4 @@
-foreach(x lmm_usage surf_usage surf_usage2)
+foreach(x lmm_usage surf_usage surf_usage2 wifi_usage)
   add_executable       (${x}  EXCLUDE_FROM_ALL ${x}/${x}.cpp)
   target_link_libraries(${x}  simgrid)
   set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
@@ -7,6 +7,8 @@ foreach(x lmm_usage surf_usage surf_usage2)
 
   set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
   set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.cpp)
+
+  ADD_TESH(tesh-surf-${x} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/surf/${x} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/surf/${x} ${x}.tesh)
 endforeach()
 
 add_executable       (maxmin_bench EXCLUDE_FROM_ALL maxmin_bench/maxmin_bench.cpp)
@@ -22,10 +24,6 @@ endforeach()
 set(tesh_files     ${tesh_files}                                                               PARENT_SCOPE)
 set(teshsuite_src  ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/maxmin_bench/maxmin_bench.cpp  PARENT_SCOPE)
 
-foreach(x lmm_usage surf_usage surf_usage2)
-  ADD_TESH(tesh-surf-${x} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/surf/${x} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/surf/${x} ${x}.tesh)
-endforeach()
-
 foreach(x small medium large)
   ADD_TESH(tesh-surf-maxmin-${x} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/surf/maxmin_bench --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/surf/maxmin_bench maxmin_bench_${x}.tesh)
 endforeach()
index 7c7c8c6..62b886b 100644 (file)
@@ -18,98 +18,19 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(surf_test, "Messages specific for surf example");
 
 namespace lmm = simgrid::kernel::lmm;
 
-#define PRINT_VAR(var) XBT_DEBUG(#var " = %g", (var)->get_value())
-#define SHOW_EXPR(expr) XBT_DEBUG(#expr " = %g",expr)
+#define PRINT_VAR(var) XBT_DEBUG(_XBT_STRINGIFY(var) " = %g", (var)->get_value())
+#define SHOW_EXPR(expr) XBT_DEBUG(_XBT_STRINGIFY(expr) " = %g", (expr))
 
 /*        ______                 */
 /*  ==l1==  L2  ==L3==           */
 /*        ------                 */
 
-enum method_t { MAXMIN, LAGRANGE_RENO, LAGRANGE_VEGAS };
-
-static lmm::System* new_system(method_t method)
-{
-  /* selective update would need real actions instead of NULL as a first parameter to the variable constructor */
-  switch (method) {
-    case MAXMIN:
-      return lmm::make_new_maxmin_system(false);
-    case LAGRANGE_VEGAS:
-    case LAGRANGE_RENO:
-      return lmm::make_new_lagrange_system(false);
-    default:
-      xbt_die("Invalid method");
-  }
-}
-
-double a_test_1 = 0;
-double b_test_1 = 0;
-static double diff_lagrange_test_1(double x)
-{
-  return -(3 / (1 + 3 * x * x / 2) - 3 / (2 * (3 * (a_test_1 - x) * (a_test_1 - x) / 2 + 1)) +
-           3 / (2 * (3 * (b_test_1 - a_test_1 + x) * (b_test_1 - a_test_1 + x) / 2 + 1)));
-}
-
-static double dichotomy(double min, double max, double min_error)
-{
-  double overall_error = 2 * min_error;
-
-  double min_func = diff_lagrange_test_1(min);
-  double max_func = diff_lagrange_test_1(max);
-
-  if (min_func > 0 && max_func > 0)
-    return min - 1.0;
-  if (min_func < 0 && max_func < 0)
-    return max + 1.0;
-  if (min_func > 0 && max_func < 0)
-    abort();
-
-  SHOW_EXPR(min_error);
-
-  while (overall_error > min_error) {
-    SHOW_EXPR(overall_error);
-    xbt_assert(min_func <= 0 || max_func <= 0);
-    xbt_assert(min_func >= 0 || max_func >= 0);
-    xbt_assert(min_func <= 0 || max_func >= 0);
-
-    SHOW_EXPR(min);
-    SHOW_EXPR(min_func);
-    SHOW_EXPR(max);
-    SHOW_EXPR(max_func);
-
-    double middle = (max + min) / 2.0;
-    if (fabs(min - middle) < 1e-12 || fabs(max - middle) < 1e-12) {
-      break;
-    }
-    double middle_func = diff_lagrange_test_1(middle);
-    SHOW_EXPR(middle);
-    SHOW_EXPR(middle_func);
-
-    if (middle_func < 0) {
-      min = middle;
-      min_func = middle_func;
-      overall_error = max_func - middle_func;
-    } else if (middle_func > 0) {
-      max = middle;
-      max_func = middle_func;
-      overall_error = middle_func - min_func;
-    } else {
-      overall_error = 0;
-    }
-  }
-  return ((min + max) / 2.0);
-}
-
-static void test1(method_t method)
+static void test1()
 {
   double a = 1.0;
   double b = 10.0;
 
-  if (method == LAGRANGE_VEGAS)
-    lmm::Lagrange::set_default_protocol_function(lmm::func_vegas_f, lmm::func_vegas_fp, lmm::func_vegas_fpi);
-  else if (method == LAGRANGE_RENO)
-    lmm::Lagrange::set_default_protocol_function(lmm::func_reno_f, lmm::func_reno_fp, lmm::func_reno_fpi);
-
-  lmm::System* Sys    = new_system(method);
+  lmm::System* Sys    = lmm::make_new_maxmin_system(false);
   lmm::Constraint* L1 = Sys->constraint_new(nullptr, a);
   lmm::Constraint* L2 = Sys->constraint_new(nullptr, b);
   lmm::Constraint* L3 = Sys->constraint_new(nullptr, a);
@@ -119,10 +40,10 @@ static void test1(method_t method)
   lmm::Variable* R_2     = Sys->variable_new(nullptr, 1.0, -1.0, 1);
   lmm::Variable* R_3     = Sys->variable_new(nullptr, 1.0, -1.0, 1);
 
-  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);
+  Sys->update_variable_penalty(R_1_2_3, 1.0);
+  Sys->update_variable_penalty(R_1, 1.0);
+  Sys->update_variable_penalty(R_2, 1.0);
+  Sys->update_variable_penalty(R_3, 1.0);
 
   Sys->expand(L1, R_1_2_3, 1.0);
   Sys->expand(L2, R_1_2_3, 1.0);
@@ -132,49 +53,7 @@ static void test1(method_t method)
   Sys->expand(L2, R_2, 1.0);
   Sys->expand(L3, R_3, 1.0);
 
-  if (method == MAXMIN) {
-    Sys->solve();
-  } else {
-    double x;
-    if (method == LAGRANGE_VEGAS) {
-      x = 3 * a / 4 - 3 * b / 8 + sqrt(9 * b * b + 4 * a * a - 4 * a * b) / 8;
-      /* Computed with mupad and D_f=1.0 */
-      if (x > a) {
-        x = a;
-      }
-      if (x < 0) {
-        x = 0;
-      }
-    } else if (method == LAGRANGE_RENO) {
-      a_test_1 = a;
-      b_test_1 = b;
-      x        = dichotomy(0, a, 1e-13);
-
-      if (x < 0)
-        x = 0;
-      if (x > a)
-        x = a;
-    } else {
-      xbt_die( "Invalid method");
-    }
-
-    Sys->solve();
-
-    double max_deviation = 0.0;
-    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, 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));
-    }
-  }
+  Sys->solve();
 
   PRINT_VAR(R_1_2_3);
   PRINT_VAR(R_1);
@@ -188,14 +67,9 @@ static void test1(method_t method)
   delete Sys;
 }
 
-static void test2(method_t method)
+static void test2()
 {
-  if (method == LAGRANGE_VEGAS)
-    lmm::Lagrange::set_default_protocol_function(lmm::func_vegas_f, lmm::func_vegas_fp, lmm::func_vegas_fpi);
-  if (method == LAGRANGE_RENO)
-    lmm::Lagrange::set_default_protocol_function(lmm::func_reno_f, lmm::func_reno_fp, lmm::func_reno_fpi);
-
-  lmm::System* Sys = new_system(method);
+  lmm::System* Sys = lmm::make_new_maxmin_system(false);
 
   lmm::Constraint* CPU1 = Sys->constraint_new(nullptr, 200.0);
   lmm::Constraint* CPU2 = Sys->constraint_new(nullptr, 100.0);
@@ -203,8 +77,8 @@ static void test2(method_t method)
   lmm::Variable* T1 = Sys->variable_new(nullptr, 1.0, -1.0, 1);
   lmm::Variable* T2 = Sys->variable_new(nullptr, 1.0, -1.0, 1);
 
-  Sys->update_variable_weight(T1, 1.0);
-  Sys->update_variable_weight(T2, 1.0);
+  Sys->update_variable_penalty(T1, 1.0);
+  Sys->update_variable_penalty(T2, 1.0);
 
   Sys->expand(CPU1, T1, 1.0);
   Sys->expand(CPU2, T2, 1.0);
@@ -219,7 +93,7 @@ static void test2(method_t method)
   delete Sys;
 }
 
-static void test3(method_t method)
+static void test3()
 {
   int flows = 11;
   int links = 10;
@@ -256,12 +130,7 @@ static void test3(method_t method)
   A[13][14] =                                        1.0;
   A[14][15] =                                        1.0;
 
-  if (method == LAGRANGE_VEGAS)
-    lmm::Lagrange::set_default_protocol_function(lmm::func_vegas_f, lmm::func_vegas_fp, lmm::func_vegas_fpi);
-  if (method == LAGRANGE_RENO)
-    lmm::Lagrange::set_default_protocol_function(lmm::func_reno_f, lmm::func_reno_fp, lmm::func_reno_fpi);
-
-  lmm::System* Sys = new_system(method);
+  lmm::System* Sys = lmm::make_new_maxmin_system(false);
 
   /* Creates the constraints */
   lmm::Constraint** tmp_cnst = new lmm::Constraint*[15];
@@ -272,7 +141,7 @@ static void test3(method_t method)
   lmm::Variable** tmp_var = new lmm::Variable*[16];
   for (int j = 0; j < 16; j++) {
     tmp_var[j] = Sys->variable_new(nullptr, 1.0, -1.0, 15);
-    Sys->update_variable_weight(tmp_var[j], 1.0);
+    Sys->update_variable_penalty(tmp_var[j], 1.0);
   }
 
   /* Link constraints and variables */
@@ -299,26 +168,14 @@ static void test3(method_t method)
 int main(int argc, char** argv)
 {
   MSG_init(&argc, argv);
-  XBT_INFO("***** Test 1 (Max-Min)");
-  test1(MAXMIN);
-  XBT_INFO("***** Test 1 (Lagrange - Vegas)");
-  test1(LAGRANGE_VEGAS);
-  XBT_INFO("***** Test 1 (Lagrange - Reno)");
-  test1(LAGRANGE_RENO);
-
-  XBT_INFO("***** Test 2 (Max-Min)");
-  test2(MAXMIN);
-  XBT_INFO("***** Test 2 (Lagrange - Vegas)");
-  test2(LAGRANGE_VEGAS);
-  XBT_INFO("***** Test 2 (Lagrange - Reno)");
-  test2(LAGRANGE_RENO);
-
-  XBT_INFO("***** Test 3 (Max-Min)");
-  test3(MAXMIN);
-  XBT_INFO("***** Test 3 (Lagrange - Vegas)");
-  test3(LAGRANGE_VEGAS);
-  XBT_INFO("***** Test 3 (Lagrange - Reno)");
-  test3(LAGRANGE_RENO);
+  XBT_INFO("***** Test 1");
+  test1();
+
+  XBT_INFO("***** Test 2");
+  test2();
+
+  XBT_INFO("***** Test 3");
+  test3();
 
   return 0;
 }
index 2a98cd4..1ab150d 100644 (file)
@@ -1,12 +1,6 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/lmm_usage
-> [0.000000] [surf_test/INFO] ***** Test 1 (Max-Min)
-> [0.000000] [surf_test/INFO] ***** Test 1 (Lagrange - Vegas)
-> [0.000000] [surf_test/INFO] ***** Test 1 (Lagrange - Reno)
-> [0.000000] [surf_test/INFO] ***** Test 2 (Max-Min)
-> [0.000000] [surf_test/INFO] ***** Test 2 (Lagrange - Vegas)
-> [0.000000] [surf_test/INFO] ***** Test 2 (Lagrange - Reno)
-> [0.000000] [surf_test/INFO] ***** Test 3 (Max-Min)
-> [0.000000] [surf_test/INFO] ***** Test 3 (Lagrange - Vegas)
-> [0.000000] [surf_test/INFO] ***** Test 3 (Lagrange - Reno)
+$ ${bindir:=.}/lmm_usage
+> [0.000000] [surf_test/INFO] ***** Test 1
+> [0.000000] [surf_test/INFO] ***** Test 2
+> [0.000000] [surf_test/INFO] ***** Test 3
index dbc5167..0cd7580 100644 (file)
@@ -3,7 +3,7 @@
 ! timeout 300
 ! expect return 0
 ! output sort
-$ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench big 1
+$ ${bindir:=.}/maxmin_bench big 1
 > Starting 0: (807)
 > Starting to solve(812)
 > 1x One shot execution time for a total of 2000 constraints, 2000 variables with 96 active constraint each, concurrency in [32,288] and max concurrency share 2
index 25c131e..ff97eee 100644 (file)
@@ -3,7 +3,7 @@
 ! timeout 50
 ! expect return 0
 ! output sort
-$ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
+$ ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] Setting selective_update_active flag to 0
 > [0.000000]: [surf_maxmin/DEBUG] Active constraints : 100
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '98' usage: 13.060939 remaining: 3.166833 concurrency: 7<=8<=10
@@ -106,176 +106,176 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '21' usage: 8.493506 remaining: 6.673327 concurrency: 4<=4<=9
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '3' usage: 10.696304 remaining: 5.434565 concurrency: 5<=5<=40
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '34' usage: 7.922577 remaining: 1.878122 concurrency: 3<=3<=-1
-> [0.000000]: [surf_maxmin/DEBUG] var=10, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004363, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=12, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004363, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=14, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004363, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=17, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004363, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=18, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004363, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=20, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004363, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=21, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004363, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=33, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004363, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=59, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004363, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=61, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004363, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=86, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004363, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=100, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004363, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=10, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004363, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=12, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004363, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=14, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004363, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=17, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004363, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=18, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004363, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=20, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004363, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=21, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004363, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=33, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004363, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=59, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004363, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=61, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004363, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=86, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004363, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=100, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004363, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (10) value to 0.004363
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(10).weight: 1.000000, Var(10).value: 0.004363 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(10).penalty: 1.000000, Var(10).value: 0.004363 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (12) value to 0.004363
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(12).weight: 1.000000, Var(12).value: 0.004363 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(12).penalty: 1.000000, Var(12).value: 0.004363 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (14) value to 0.004363
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(14).weight: 1.000000, Var(14).value: 0.004363 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(14).penalty: 1.000000, Var(14).value: 0.004363 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (17) value to 0.004363
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(17).weight: 1.000000, Var(17).value: 0.004363 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(17).penalty: 1.000000, Var(17).value: 0.004363 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (18) value to 0.004363
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(18).weight: 1.000000, Var(18).value: 0.004363 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(18).penalty: 1.000000, Var(18).value: 0.004363 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (20) value to 0.004363
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(20).weight: 1.000000, Var(20).value: 0.004363 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(20).penalty: 1.000000, Var(20).value: 0.004363 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (21) value to 0.004363
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(21).weight: 1.000000, Var(21).value: 0.004363 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(21).penalty: 1.000000, Var(21).value: 0.004363 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (33) value to 0.004363
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(33).weight: 1.000000, Var(33).value: 0.004363 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(33).penalty: 1.000000, Var(33).value: 0.004363 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (59) value to 0.004363
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(59).weight: 1.000000, Var(59).value: 0.004363 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(59).penalty: 1.000000, Var(59).value: 0.004363 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (61) value to 0.004363
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(61).weight: 1.000000, Var(61).value: 0.004363 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(61).penalty: 1.000000, Var(61).value: 0.004363 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (86) value to 0.004363
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(86).weight: 1.000000, Var(86).value: 0.004363 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(86).penalty: 1.000000, Var(86).value: 0.004363 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (100) value to 0.004363
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(100).weight: 1.000000, Var(100).value: 0.004363 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004363, Var(100).penalty: 1.000000, Var(100).value: 0.004363 
 > [0.000000]: [surf_maxmin/DEBUG] index: 86     cnst_light_num: 100     || usage: 0.000000 remaining: 0.000000 bound: 0.089910  
-> [0.000000]: [surf_maxmin/DEBUG] var=2, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008030, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=3, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008030, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=19, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008030, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=24, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008030, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=29, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008030, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=31, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008030, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=35, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008030, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=65, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008030, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=66, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008030, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=2, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008030, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=3, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008030, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=19, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008030, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=24, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008030, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=29, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008030, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=31, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008030, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=35, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008030, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=65, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008030, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=66, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008030, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (2) value to 0.008030
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008030, Var(2).weight: 1.000000, Var(2).value: 0.008030 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008030, Var(2).penalty: 1.000000, Var(2).value: 0.008030 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (3) value to 0.008030
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008030, Var(3).weight: 1.000000, Var(3).value: 0.008030 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008030, Var(3).penalty: 1.000000, Var(3).value: 0.008030 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (19) value to 0.008030
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008030, Var(19).weight: 1.000000, Var(19).value: 0.008030 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008030, Var(19).penalty: 1.000000, Var(19).value: 0.008030 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (24) value to 0.008030
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008030, Var(24).weight: 1.000000, Var(24).value: 0.008030 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008030, Var(24).penalty: 1.000000, Var(24).value: 0.008030 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (29) value to 0.008030
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008030, Var(29).weight: 1.000000, Var(29).value: 0.008030 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008030, Var(29).penalty: 1.000000, Var(29).value: 0.008030 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (31) value to 0.008030
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008030, Var(31).weight: 1.000000, Var(31).value: 0.008030 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008030, Var(31).penalty: 1.000000, Var(31).value: 0.008030 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (35) value to 0.008030
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008030, Var(35).weight: 1.000000, Var(35).value: 0.008030 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008030, Var(35).penalty: 1.000000, Var(35).value: 0.008030 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (65) value to 0.008030
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008030, Var(65).weight: 1.000000, Var(65).value: 0.008030 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008030, Var(65).penalty: 1.000000, Var(65).value: 0.008030 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (66) value to 0.008030
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008030, Var(66).weight: 1.000000, Var(66).value: 0.008030 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008030, Var(66).penalty: 1.000000, Var(66).value: 0.008030 
 > [0.000000]: [surf_maxmin/DEBUG] index: 33     cnst_light_num: 99      || usage: 0.000000 remaining: 0.000000 bound: 0.139860  
-> [0.000000]: [surf_maxmin/DEBUG] var=5, var.bound=-1.000000, var.weight=1.000000, min_usage=0.021367, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=13, var.bound=-1.000000, var.weight=1.000000, min_usage=0.021367, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=36, var.bound=-1.000000, var.weight=1.000000, min_usage=0.021367, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=39, var.bound=-1.000000, var.weight=1.000000, min_usage=0.021367, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=42, var.bound=-1.000000, var.weight=1.000000, min_usage=0.021367, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=57, var.bound=-1.000000, var.weight=1.000000, min_usage=0.021367, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=5, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.021367, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=13, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.021367, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=36, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.021367, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=39, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.021367, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=42, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.021367, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=57, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.021367, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (5) value to 0.021367
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.021367, Var(5).weight: 1.000000, Var(5).value: 0.021367 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.021367, Var(5).penalty: 1.000000, Var(5).value: 0.021367 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (13) value to 0.021367
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.021367, Var(13).weight: 1.000000, Var(13).value: 0.021367 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.021367, Var(13).penalty: 1.000000, Var(13).value: 0.021367 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (36) value to 0.021367
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.021367, Var(36).weight: 1.000000, Var(36).value: 0.021367 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.021367, Var(36).penalty: 1.000000, Var(36).value: 0.021367 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (39) value to 0.021367
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.021367, Var(39).weight: 1.000000, Var(39).value: 0.021367 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.021367, Var(39).penalty: 1.000000, Var(39).value: 0.021367 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (42) value to 0.021367
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.021367, Var(42).weight: 1.000000, Var(42).value: 0.021367 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.021367, Var(42).penalty: 1.000000, Var(42).value: 0.021367 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (57) value to 0.021367
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.021367, Var(57).weight: 1.000000, Var(57).value: 0.021367 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.021367, Var(57).penalty: 1.000000, Var(57).value: 0.021367 
 > [0.000000]: [surf_maxmin/DEBUG] index: 30     cnst_light_num: 98      || usage: 0.000000 remaining: 0.000000 bound: 0.239760  
-> [0.000000]: [surf_maxmin/DEBUG] var=7, var.bound=-1.000000, var.weight=1.000000, min_usage=0.111522, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=9, var.bound=-1.000000, var.weight=1.000000, min_usage=0.111522, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=25, var.bound=-1.000000, var.weight=1.000000, min_usage=0.111522, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=7, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.111522, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=9, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.111522, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=25, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.111522, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (7) value to 0.111522
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.111522, Var(7).weight: 1.000000, Var(7).value: 0.111522 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.111522, Var(7).penalty: 1.000000, Var(7).value: 0.111522 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (9) value to 0.111522
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.111522, Var(9).weight: 1.000000, Var(9).value: 0.111522 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.111522, Var(9).penalty: 1.000000, Var(9).value: 0.111522 
 > [0.000000]: [surf_maxmin/DEBUG] index: 43     cnst_light_num: 97      || usage: 0.000000 remaining: 6.351599 bound: 6.573427  
 > [0.000000]: [surf_maxmin/DEBUG] index: 35     cnst_light_num: 96      || usage: 0.000000 remaining: 6.501325 bound: 6.783217  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (25) value to 0.111522
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.111522, Var(25).weight: 1.000000, Var(25).value: 0.111522 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.111522, Var(25).penalty: 1.000000, Var(25).value: 0.111522 
 > [0.000000]: [surf_maxmin/DEBUG] index: 64     cnst_light_num: 95      || usage: 0.000000 remaining: 0.000000 bound: 0.419580  
 > [0.000000]: [surf_maxmin/DEBUG] index: 37     cnst_light_num: 94      || usage: 0.000000 remaining: 5.229520 bound: 5.464535  
-> [0.000000]: [surf_maxmin/DEBUG] var=11, var.bound=-1.000000, var.weight=1.000000, min_usage=0.114197, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=60, var.bound=-1.000000, var.weight=1.000000, min_usage=0.114197, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=94, var.bound=-1.000000, var.weight=1.000000, min_usage=0.114197, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=11, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.114197, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=60, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.114197, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=94, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.114197, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (11) value to 0.114197
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.114197, Var(11).weight: 1.000000, Var(11).value: 0.114197 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.114197, Var(11).penalty: 1.000000, Var(11).value: 0.114197 
 > [0.000000]: [surf_maxmin/DEBUG] index: 78     cnst_light_num: 93      || usage: 0.000000 remaining: 3.639923 bound: 3.946054  
 > [0.000000]: [surf_maxmin/DEBUG] index: 89     cnst_light_num: 92      || usage: 0.000000 remaining: 1.712163 bound: 1.928072  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (60) value to 0.114197
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.114197, Var(60).weight: 1.000000, Var(60).value: 0.114197 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.114197, Var(60).penalty: 1.000000, Var(60).value: 0.114197 
 > [0.000000]: [surf_maxmin/DEBUG] index: 77     cnst_light_num: 91      || usage: 0.000000 remaining: 1.857045 bound: 2.437562  
 > [0.000000]: [surf_maxmin/DEBUG] index: 30     cnst_light_num: 90      || usage: 0.000000 remaining: 6.367133 bound: 6.673327  
 > [0.000000]: [surf_maxmin/DEBUG] index: 39     cnst_light_num: 89      || usage: 0.000000 remaining: 6.894919 bound: 7.282717  
 > [0.000000]: [surf_maxmin/DEBUG] index: 45     cnst_light_num: 88      || usage: 0.000000 remaining: 4.984682 bound: 5.784216  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (94) value to 0.114197
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.114197, Var(94).weight: 1.000000, Var(94).value: 0.114197 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.114197, Var(94).penalty: 1.000000, Var(94).value: 0.114197 
 > [0.000000]: [surf_maxmin/DEBUG] index: 30     cnst_light_num: 87      || usage: 0.000000 remaining: 0.000000 bound: 0.909091  
 > [0.000000]: [surf_maxmin/DEBUG] index: 35     cnst_light_num: 86      || usage: 0.000000 remaining: 2.100813 bound: 2.467532  
 > [0.000000]: [surf_maxmin/DEBUG] index: 39     cnst_light_num: 85      || usage: 0.000000 remaining: 8.371246 bound: 8.641359  
 > [0.000000]: [surf_maxmin/DEBUG] index: 30     cnst_light_num: 84      || usage: 0.000000 remaining: 1.719694 bound: 1.878122  
 > [0.000000]: [surf_maxmin/DEBUG] index: 78     cnst_light_num: 83      || usage: 0.000000 remaining: 2.160269 bound: 2.597403  
 > [0.000000]: [surf_maxmin/DEBUG] index: 67     cnst_light_num: 82      || usage: 0.000000 remaining: 2.175342 bound: 2.557443  
-> [0.000000]: [surf_maxmin/DEBUG] var=6, var.bound=-1.000000, var.weight=1.000000, min_usage=0.220110, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=22, var.bound=-1.000000, var.weight=1.000000, min_usage=0.220110, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=6, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.220110, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=22, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.220110, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (6) value to 0.220110
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.220110, Var(6).weight: 1.000000, Var(6).value: 0.220110 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.220110, Var(6).penalty: 1.000000, Var(6).value: 0.220110 
 > [0.000000]: [surf_maxmin/DEBUG] index: 69     cnst_light_num: 81      || usage: 0.000000 remaining: 5.566744 bound: 6.223776  
 > [0.000000]: [surf_maxmin/DEBUG] index: 71     cnst_light_num: 80      || usage: 0.000000 remaining: 8.565684 bound: 9.140859  
 > [0.000000]: [surf_maxmin/DEBUG] index: 73     cnst_light_num: 79      || usage: 0.000000 remaining: 0.742072 bound: 1.418581  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (22) value to 0.220110
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.220110, Var(22).weight: 1.000000, Var(22).value: 0.220110 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.220110, Var(22).penalty: 1.000000, Var(22).value: 0.220110 
 > [0.000000]: [surf_maxmin/DEBUG] index: 64     cnst_light_num: 78      || usage: 0.000000 remaining: 0.265229 bound: 0.819181  
 > [0.000000]: [surf_maxmin/DEBUG] index: 29     cnst_light_num: 77      || usage: 0.000000 remaining: 0.000000 bound: 1.078921  
 > [0.000000]: [surf_maxmin/DEBUG] index: 64     cnst_light_num: 76      || usage: 0.000000 remaining: 7.994916 bound: 8.301698  
 > [0.000000]: [surf_maxmin/DEBUG] index: 36     cnst_light_num: 75      || usage: 0.000000 remaining: 0.153476 bound: 1.148851  
-> [0.000000]: [surf_maxmin/DEBUG] var=28, var.bound=-1.000000, var.weight=1.000000, min_usage=0.263657, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=28, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.263657, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (28) value to 0.263657
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.263657, Var(28).weight: 1.000000, Var(28).value: 0.263657 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.263657, Var(28).penalty: 1.000000, Var(28).value: 0.263657 
 > [0.000000]: [surf_maxmin/DEBUG] index: 29     cnst_light_num: 74      || usage: 0.000000 remaining: 8.806164 bound: 9.620380  
 > [0.000000]: [surf_maxmin/DEBUG] index: 38     cnst_light_num: 73      || usage: 0.000000 remaining: 8.089858 bound: 9.280719  
 > [0.000000]: [surf_maxmin/DEBUG] index: 33     cnst_light_num: 72      || usage: 0.000000 remaining: 4.844821 bound: 5.434565  
@@ -283,11 +283,11 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 38     cnst_light_num: 70      || usage: 0.000000 remaining: 4.360482 bound: 5.334665  
 > [0.000000]: [surf_maxmin/DEBUG] index: 25     cnst_light_num: 69      || usage: 0.000000 remaining: 0.000000 bound: 0.949051  
 > [0.000000]: [surf_maxmin/DEBUG] index: 37     cnst_light_num: 68      || usage: 0.000000 remaining: 5.851198 bound: 6.473526  
-> [0.000000]: [surf_maxmin/DEBUG] var=1, var.bound=-1.000000, var.weight=1.000000, min_usage=0.281538, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=15, var.bound=-1.000000, var.weight=1.000000, min_usage=0.281538, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=1, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.281538, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=15, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.281538, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (1) value to 0.281538
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.281538, Var(1).weight: 1.000000, Var(1).value: 0.281538 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.281538, Var(1).penalty: 1.000000, Var(1).value: 0.281538 
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 67      || usage: 0.000000 remaining: 2.572545 bound: 3.166833  
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 66      || usage: 0.000000 remaining: 2.546729 bound: 3.766234  
 > [0.000000]: [surf_maxmin/DEBUG] index: 4      cnst_light_num: 65      || usage: 0.000000 remaining: 8.853024 bound: 9.710290  
@@ -298,7 +298,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 21     cnst_light_num: 60      || usage: 0.000000 remaining: 1.765549 bound: 2.777223  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (15) value to 0.281538
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.281538, Var(15).weight: 1.000000, Var(15).value: 0.281538 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.281538, Var(15).penalty: 1.000000, Var(15).value: 0.281538 
 > [0.000000]: [surf_maxmin/DEBUG] index: 24     cnst_light_num: 59      || usage: 0.000000 remaining: 6.743340 bound: 9.040959  
 > [0.000000]: [surf_maxmin/DEBUG] index: 28     cnst_light_num: 58      || usage: 0.000000 remaining: 3.193824 bound: 3.966034  
 > [0.000000]: [surf_maxmin/DEBUG] index: 18     cnst_light_num: 57      || usage: 0.000000 remaining: 0.152448 bound: 1.528472  
@@ -306,11 +306,11 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 41     cnst_light_num: 55      || usage: 0.000000 remaining: 1.804698 bound: 3.346653  
 > [0.000000]: [surf_maxmin/DEBUG] index: 14     cnst_light_num: 54      || usage: 0.000000 remaining: 7.352391 bound: 9.780220  
 > [0.000000]: [surf_maxmin/DEBUG] index: 6      cnst_light_num: 53      || usage: 0.000000 remaining: 4.865037 bound: 6.283716  
-> [0.000000]: [surf_maxmin/DEBUG] var=8, var.bound=-1.000000, var.weight=1.000000, min_usage=0.293237, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=16, var.bound=-1.000000, var.weight=1.000000, min_usage=0.293237, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=8, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.293237, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=16, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.293237, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (8) value to 0.293237
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.293237, Var(8).weight: 1.000000, Var(8).value: 0.293237 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.293237, Var(8).penalty: 1.000000, Var(8).value: 0.293237 
 > [0.000000]: [surf_maxmin/DEBUG] index: 37     cnst_light_num: 52      || usage: 0.000000 remaining: 8.183363 bound: 9.610390  
 > [0.000000]: [surf_maxmin/DEBUG] index: 29     cnst_light_num: 51      || usage: 0.000000 remaining: 5.407458 bound: 6.343656  
 > [0.000000]: [surf_maxmin/DEBUG] index: 7      cnst_light_num: 50      || usage: 0.000000 remaining: 8.934859 bound: 9.760240  
@@ -330,7 +330,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 5      cnst_light_num: 36      || usage: 0.000000 remaining: 5.604287 bound: 7.692308  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (16) value to 0.293237
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.293237, Var(16).weight: 1.000000, Var(16).value: 0.293237 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.293237, Var(16).penalty: 1.000000, Var(16).value: 0.293237 
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 35      || usage: 0.000000 remaining: 0.000000 bound: 1.948052  
 > [0.000000]: [surf_maxmin/DEBUG] index: 26     cnst_light_num: 34      || usage: 0.000000 remaining: 5.197662 bound: 5.894106  
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 33      || usage: 0.000000 remaining: 1.441086 bound: 3.006993  
@@ -345,10 +345,10 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 7      cnst_light_num: 24      || usage: 0.000000 remaining: 2.217343 bound: 4.375624  
 > [0.000000]: [surf_maxmin/DEBUG] index: 7      cnst_light_num: 23      || usage: 0.000000 remaining: 5.049686 bound: 5.934066  
 > [0.000000]: [surf_maxmin/DEBUG] index: 16     cnst_light_num: 22      || usage: 0.000000 remaining: 5.574190 bound: 7.082917  
-> [0.000000]: [surf_maxmin/DEBUG] var=4, var.bound=-1.000000, var.weight=1.000000, min_usage=0.319893, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=4, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.319893, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (4) value to 0.319893
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.319893, Var(4).weight: 1.000000, Var(4).value: 0.319893 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.319893, Var(4).penalty: 1.000000, Var(4).value: 0.319893 
 > [0.000000]: [surf_maxmin/DEBUG] index: 20     cnst_light_num: 21      || usage: 0.000000 remaining: 4.569620 bound: 6.783217  
 > [0.000000]: [surf_maxmin/DEBUG] index: 6      cnst_light_num: 20      || usage: 0.000000 remaining: 3.597397 bound: 4.915085  
 > [0.000000]: [surf_maxmin/DEBUG] index: 10     cnst_light_num: 19      || usage: 0.000000 remaining: 4.238922 bound: 6.713287  
@@ -675,166 +675,166 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '131' usage: 10.369630 remaining: 1.608392 concurrency: 6<=7<=40
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '156' usage: 10.795205 remaining: 5.774226 concurrency: 6<=7<=9
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '103' usage: 11.283716 remaining: 1.088911 concurrency: 7<=8<=-1
-> [0.000000]: [surf_maxmin/DEBUG] var=101, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007926, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=110, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007926, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=125, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007926, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=130, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007926, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=131, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007926, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=132, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007926, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=136, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007926, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=138, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007926, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=139, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007926, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=153, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007926, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=101, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007926, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=110, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007926, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=125, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007926, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=130, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007926, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=131, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007926, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=132, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007926, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=136, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007926, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=138, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007926, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=139, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007926, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=153, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007926, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (101) value to 0.007926
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(101).weight: 1.000000, Var(101).value: 0.007926 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(101).penalty: 1.000000, Var(101).value: 0.007926 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (110) value to 0.007926
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(110).weight: 1.000000, Var(110).value: 0.007926 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(110).penalty: 1.000000, Var(110).value: 0.007926 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (125) value to 0.007926
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(125).weight: 1.000000, Var(125).value: 0.007926 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(125).penalty: 1.000000, Var(125).value: 0.007926 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (130) value to 0.007926
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(130).weight: 1.000000, Var(130).value: 0.007926 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(130).penalty: 1.000000, Var(130).value: 0.007926 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (131) value to 0.007926
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(131).weight: 1.000000, Var(131).value: 0.007926 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(131).penalty: 1.000000, Var(131).value: 0.007926 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (132) value to 0.007926
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(132).weight: 1.000000, Var(132).value: 0.007926 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(132).penalty: 1.000000, Var(132).value: 0.007926 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (136) value to 0.007926
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(136).weight: 1.000000, Var(136).value: 0.007926 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(136).penalty: 1.000000, Var(136).value: 0.007926 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (138) value to 0.007926
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(138).weight: 1.000000, Var(138).value: 0.007926 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(138).penalty: 1.000000, Var(138).value: 0.007926 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (139) value to 0.007926
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(139).weight: 1.000000, Var(139).value: 0.007926 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(139).penalty: 1.000000, Var(139).value: 0.007926 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (153) value to 0.007926
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(153).weight: 1.000000, Var(153).value: 0.007926 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007926, Var(153).penalty: 1.000000, Var(153).value: 0.007926 
 > [0.000000]: [surf_maxmin/DEBUG] index: 5      cnst_light_num: 100     || usage: 0.000000 remaining: 0.000000 bound: 0.119880  
-> [0.000000]: [surf_maxmin/DEBUG] var=102, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008159, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=103, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008159, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=104, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008159, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=105, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008159, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=106, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008159, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=112, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008159, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=127, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008159, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=129, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008159, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=102, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008159, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=103, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008159, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=104, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008159, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=105, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008159, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=106, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008159, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=112, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008159, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=127, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008159, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=129, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008159, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (102) value to 0.008159
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008159, Var(102).weight: 1.000000, Var(102).value: 0.008159 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008159, Var(102).penalty: 1.000000, Var(102).value: 0.008159 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (103) value to 0.008159
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008159, Var(103).weight: 1.000000, Var(103).value: 0.008159 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008159, Var(103).penalty: 1.000000, Var(103).value: 0.008159 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (104) value to 0.008159
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008159, Var(104).weight: 1.000000, Var(104).value: 0.008159 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008159, Var(104).penalty: 1.000000, Var(104).value: 0.008159 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (105) value to 0.008159
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008159, Var(105).weight: 1.000000, Var(105).value: 0.008159 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008159, Var(105).penalty: 1.000000, Var(105).value: 0.008159 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (106) value to 0.008159
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008159, Var(106).weight: 1.000000, Var(106).value: 0.008159 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008159, Var(106).penalty: 1.000000, Var(106).value: 0.008159 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (112) value to 0.008159
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008159, Var(112).weight: 1.000000, Var(112).value: 0.008159 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008159, Var(112).penalty: 1.000000, Var(112).value: 0.008159 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (127) value to 0.008159
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008159, Var(127).weight: 1.000000, Var(127).value: 0.008159 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008159, Var(127).penalty: 1.000000, Var(127).value: 0.008159 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (129) value to 0.008159
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008159, Var(129).weight: 1.000000, Var(129).value: 0.008159 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008159, Var(129).penalty: 1.000000, Var(129).value: 0.008159 
 > [0.000000]: [surf_maxmin/DEBUG] index: 65     cnst_light_num: 99      || usage: 0.000000 remaining: 2.401264 bound: 2.457542  
 > [0.000000]: [surf_maxmin/DEBUG] index: 13     cnst_light_num: 98      || usage: 0.000000 remaining: 0.000000 bound: 0.159840  
-> [0.000000]: [surf_maxmin/DEBUG] var=108, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008523, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=114, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008523, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=116, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008523, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=121, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008523, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=141, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008523, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=144, var.bound=-1.000000, var.weight=1.000000, min_usage=0.008523, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=108, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008523, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=114, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008523, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=116, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008523, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=121, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008523, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=141, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008523, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=144, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.008523, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (108) value to 0.008523
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008523, Var(108).weight: 1.000000, Var(108).value: 0.008523 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008523, Var(108).penalty: 1.000000, Var(108).value: 0.008523 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (114) value to 0.008523
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008523, Var(114).weight: 1.000000, Var(114).value: 0.008523 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008523, Var(114).penalty: 1.000000, Var(114).value: 0.008523 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (116) value to 0.008523
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008523, Var(116).weight: 1.000000, Var(116).value: 0.008523 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008523, Var(116).penalty: 1.000000, Var(116).value: 0.008523 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (121) value to 0.008523
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008523, Var(121).weight: 1.000000, Var(121).value: 0.008523 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008523, Var(121).penalty: 1.000000, Var(121).value: 0.008523 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (141) value to 0.008523
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008523, Var(141).weight: 1.000000, Var(141).value: 0.008523 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008523, Var(141).penalty: 1.000000, Var(141).value: 0.008523 
 > [0.000000]: [surf_maxmin/DEBUG] index: 71     cnst_light_num: 97      || usage: 0.000000 remaining: 8.670797 bound: 8.741259  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (144) value to 0.008523
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008523, Var(144).weight: 1.000000, Var(144).value: 0.008523 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.008523, Var(144).penalty: 1.000000, Var(144).value: 0.008523 
 > [0.000000]: [surf_maxmin/DEBUG] index: 3      cnst_light_num: 96      || usage: 0.000000 remaining: 0.000000 bound: 0.149850  
 > [0.000000]: [surf_maxmin/DEBUG] index: 53     cnst_light_num: 95      || usage: 0.000000 remaining: 6.333684 bound: 6.373626  
-> [0.000000]: [surf_maxmin/DEBUG] var=117, var.bound=-1.000000, var.weight=1.000000, min_usage=0.016848, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=119, var.bound=-1.000000, var.weight=1.000000, min_usage=0.016848, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=181, var.bound=-1.000000, var.weight=1.000000, min_usage=0.016848, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=117, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.016848, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=119, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.016848, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=181, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.016848, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (117) value to 0.016848
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.016848, Var(117).weight: 1.000000, Var(117).value: 0.016848 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.016848, Var(117).penalty: 1.000000, Var(117).value: 0.016848 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (119) value to 0.016848
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.016848, Var(119).weight: 1.000000, Var(119).value: 0.016848 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.016848, Var(119).penalty: 1.000000, Var(119).value: 0.016848 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (181) value to 0.016848
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.016848, Var(181).weight: 1.000000, Var(181).value: 0.016848 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.016848, Var(181).penalty: 1.000000, Var(181).value: 0.016848 
 > [0.000000]: [surf_maxmin/DEBUG] index: 69     cnst_light_num: 94      || usage: 0.000000 remaining: 5.020334 bound: 5.094905  
 > [0.000000]: [surf_maxmin/DEBUG] index: 22     cnst_light_num: 93      || usage: 0.000000 remaining: 0.000000 bound: 0.149850  
-> [0.000000]: [surf_maxmin/DEBUG] var=115, var.bound=-1.000000, var.weight=1.000000, min_usage=0.017542, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=120, var.bound=-1.000000, var.weight=1.000000, min_usage=0.017542, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=122, var.bound=-1.000000, var.weight=1.000000, min_usage=0.017542, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=115, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.017542, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=120, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.017542, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=122, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.017542, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (115) value to 0.017542
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.017542, Var(115).weight: 1.000000, Var(115).value: 0.017542 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.017542, Var(115).penalty: 1.000000, Var(115).value: 0.017542 
 > [0.000000]: [surf_maxmin/DEBUG] index: 44     cnst_light_num: 92      || usage: 0.000000 remaining: 1.917360 bound: 2.027972  
 > [0.000000]: [surf_maxmin/DEBUG] index: 54     cnst_light_num: 91      || usage: 0.000000 remaining: 4.207907 bound: 4.305694  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (120) value to 0.017542
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.017542, Var(120).weight: 1.000000, Var(120).value: 0.017542 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.017542, Var(120).penalty: 1.000000, Var(120).value: 0.017542 
 > [0.000000]: [surf_maxmin/DEBUG] index: 74     cnst_light_num: 90      || usage: 0.000000 remaining: 2.741877 bound: 2.887113  
 > [0.000000]: [surf_maxmin/DEBUG] index: 28     cnst_light_num: 89      || usage: 0.000000 remaining: 7.135906 bound: 7.252747  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (122) value to 0.017542
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.017542, Var(122).weight: 1.000000, Var(122).value: 0.017542 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.017542, Var(122).penalty: 1.000000, Var(122).value: 0.017542 
 > [0.000000]: [surf_maxmin/DEBUG] index: 59     cnst_light_num: 88      || usage: 0.000000 remaining: 4.167871 bound: 4.315684  
 > [0.000000]: [surf_maxmin/DEBUG] index: 68     cnst_light_num: 87      || usage: 0.000000 remaining: 0.000000 bound: 0.249750  
-> [0.000000]: [surf_maxmin/DEBUG] var=109, var.bound=-1.000000, var.weight=1.000000, min_usage=0.023470, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=111, var.bound=-1.000000, var.weight=1.000000, min_usage=0.023470, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=118, var.bound=-1.000000, var.weight=1.000000, min_usage=0.023470, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=109, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.023470, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=111, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.023470, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=118, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.023470, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (109) value to 0.023470
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023470, Var(109).weight: 1.000000, Var(109).value: 0.023470 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023470, Var(109).penalty: 1.000000, Var(109).value: 0.023470 
 > [0.000000]: [surf_maxmin/DEBUG] index: 38     cnst_light_num: 86      || usage: 0.000000 remaining: 3.751087 bound: 3.896104  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (111) value to 0.023470
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023470, Var(111).weight: 1.000000, Var(111).value: 0.023470 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023470, Var(111).penalty: 1.000000, Var(111).value: 0.023470 
 > [0.000000]: [surf_maxmin/DEBUG] index: 54     cnst_light_num: 85      || usage: 0.000000 remaining: 1.804308 bound: 1.878122  
 > [0.000000]: [surf_maxmin/DEBUG] index: 69     cnst_light_num: 84      || usage: 0.000000 remaining: 8.730985 bound: 8.861139  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (118) value to 0.023470
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023470, Var(118).weight: 1.000000, Var(118).value: 0.023470 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023470, Var(118).penalty: 1.000000, Var(118).value: 0.023470 
 > [0.000000]: [surf_maxmin/DEBUG] index: 28     cnst_light_num: 83      || usage: 0.000000 remaining: 2.564810 bound: 2.737263  
 > [0.000000]: [surf_maxmin/DEBUG] index: 26     cnst_light_num: 82      || usage: 0.000000 remaining: 7.605992 bound: 7.722278  
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 81      || usage: 0.000000 remaining: 0.000000 bound: 0.229770  
 > [0.000000]: [surf_maxmin/DEBUG] index: 66     cnst_light_num: 80      || usage: 0.000000 remaining: 6.046675 bound: 6.253746  
 > [0.000000]: [surf_maxmin/DEBUG] index: 62     cnst_light_num: 79      || usage: 0.000000 remaining: 7.487702 bound: 7.702298  
 > [0.000000]: [surf_maxmin/DEBUG] index: 3      cnst_light_num: 78      || usage: 0.000000 remaining: 1.079910 bound: 1.168831  
-> [0.000000]: [surf_maxmin/DEBUG] var=113, var.bound=-1.000000, var.weight=1.000000, min_usage=0.052532, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=156, var.bound=-1.000000, var.weight=1.000000, min_usage=0.052532, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=113, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.052532, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=156, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.052532, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (113) value to 0.052532
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.052532, Var(113).weight: 1.000000, Var(113).value: 0.052532 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.052532, Var(113).penalty: 1.000000, Var(113).value: 0.052532 
 > [0.000000]: [surf_maxmin/DEBUG] index: 42     cnst_light_num: 77      || usage: 0.000000 remaining: 6.792157 bound: 7.062937  
 > [0.000000]: [surf_maxmin/DEBUG] index: 31     cnst_light_num: 76      || usage: 0.000000 remaining: 9.368723 bound: 9.540460  
 > [0.000000]: [surf_maxmin/DEBUG] index: 50     cnst_light_num: 75      || usage: 0.000000 remaining: 8.560864 bound: 8.751249  
@@ -843,7 +843,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 45     cnst_light_num: 72      || usage: 0.000000 remaining: 4.138470 bound: 4.365634  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (156) value to 0.052532
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.052532, Var(156).weight: 1.000000, Var(156).value: 0.052532 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.052532, Var(156).penalty: 1.000000, Var(156).value: 0.052532 
 > [0.000000]: [surf_maxmin/DEBUG] index: 20     cnst_light_num: 71      || usage: 0.000000 remaining: 5.229336 bound: 5.404595  
 > [0.000000]: [surf_maxmin/DEBUG] index: 52     cnst_light_num: 70      || usage: 0.000000 remaining: 9.576867 bound: 9.730270  
 > [0.000000]: [surf_maxmin/DEBUG] index: 40     cnst_light_num: 69      || usage: 0.000000 remaining: 0.000000 bound: 0.299700  
@@ -852,10 +852,10 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 65     cnst_light_num: 66      || usage: 0.000000 remaining: 5.550824 bound: 5.774226  
 > [0.000000]: [surf_maxmin/DEBUG] index: 38     cnst_light_num: 65      || usage: 0.000000 remaining: 6.938266 bound: 7.102897  
 > [0.000000]: [surf_maxmin/DEBUG] index: 23     cnst_light_num: 64      || usage: 0.000000 remaining: 3.985576 bound: 4.125874  
-> [0.000000]: [surf_maxmin/DEBUG] var=147, var.bound=-1.000000, var.weight=1.000000, min_usage=0.060227, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=147, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.060227, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (147) value to 0.060227
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.060227, Var(147).weight: 1.000000, Var(147).value: 0.060227 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.060227, Var(147).penalty: 1.000000, Var(147).value: 0.060227 
 > [0.000000]: [surf_maxmin/DEBUG] index: 60     cnst_light_num: 63      || usage: 0.000000 remaining: 0.790150 bound: 1.138861  
 > [0.000000]: [surf_maxmin/DEBUG] index: 57     cnst_light_num: 62      || usage: 0.000000 remaining: 1.626935 bound: 1.938062  
 > [0.000000]: [surf_maxmin/DEBUG] index: 59     cnst_light_num: 61      || usage: 0.000000 remaining: 1.881502 bound: 2.127872  
@@ -865,11 +865,11 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 7      cnst_light_num: 57      || usage: 0.000000 remaining: 7.011837 bound: 7.362637  
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 56      || usage: 0.000000 remaining: 0.000000 bound: 0.239760  
 > [0.000000]: [surf_maxmin/DEBUG] index: 36     cnst_light_num: 55      || usage: 0.000000 remaining: 1.363107 bound: 1.548452  
-> [0.000000]: [surf_maxmin/DEBUG] var=107, var.bound=-1.000000, var.weight=1.000000, min_usage=0.151955, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=124, var.bound=-1.000000, var.weight=1.000000, min_usage=0.151955, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=107, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.151955, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=124, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.151955, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (107) value to 0.151955
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.151955, Var(107).weight: 1.000000, Var(107).value: 0.151955 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.151955, Var(107).penalty: 1.000000, Var(107).value: 0.151955 
 > [0.000000]: [surf_maxmin/DEBUG] index: 47     cnst_light_num: 54      || usage: 0.000000 remaining: 5.898751 bound: 6.563437  
 > [0.000000]: [surf_maxmin/DEBUG] index: 34     cnst_light_num: 53      || usage: 0.000000 remaining: 8.764203 bound: 9.020979  
 > [0.000000]: [surf_maxmin/DEBUG] index: 3      cnst_light_num: 52      || usage: 0.000000 remaining: 0.367055 bound: 0.569431  
@@ -881,7 +881,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 26     cnst_light_num: 46      || usage: 0.000000 remaining: 1.453623 bound: 1.828172  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (124) value to 0.151955
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.151955, Var(124).weight: 1.000000, Var(124).value: 0.151955 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.151955, Var(124).penalty: 1.000000, Var(124).value: 0.151955 
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 45      || usage: 0.000000 remaining: 7.302255 bound: 7.932068  
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 44      || usage: 0.000000 remaining: 7.271628 bound: 8.151848  
 > [0.000000]: [surf_maxmin/DEBUG] index: 17     cnst_light_num: 43      || usage: 0.000000 remaining: 8.011786 bound: 8.281718  
@@ -903,10 +903,10 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 27      || usage: 0.000000 remaining: 9.218764 bound: 9.880120  
 > [0.000000]: [surf_maxmin/DEBUG] index: 13     cnst_light_num: 26      || usage: 0.000000 remaining: 1.190898 bound: 1.608392  
 > [0.000000]: [surf_maxmin/DEBUG] index: 14     cnst_light_num: 25      || usage: 0.000000 remaining: 3.822706 bound: 4.185814  
-> [0.000000]: [surf_maxmin/DEBUG] var=143, var.bound=-1.000000, var.weight=1.000000, min_usage=0.162422, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=143, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.162422, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (143) value to 0.162422
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.162422, Var(143).weight: 1.000000, Var(143).value: 0.162422 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.162422, Var(143).penalty: 1.000000, Var(143).value: 0.162422 
 > [0.000000]: [surf_maxmin/DEBUG] index: 14     cnst_light_num: 24      || usage: 0.000000 remaining: 9.155216 bound: 9.790210  
 > [0.000000]: [surf_maxmin/DEBUG] index: 13     cnst_light_num: 23      || usage: 0.000000 remaining: 8.797972 bound: 9.480519  
 > [0.000000]: [surf_maxmin/DEBUG] index: 8      cnst_light_num: 22      || usage: 0.000000 remaining: 6.211834 bound: 6.843157  
@@ -1236,188 +1236,188 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '234' usage: 12.654845 remaining: 4.035964 concurrency: 6<=6<=24
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '272' usage: 19.035465 remaining: 1.598402 concurrency: 8<=9<=24
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '224' usage: 16.651349 remaining: 9.110889 concurrency: 10<=10<=10
-> [0.000000]: [surf_maxmin/DEBUG] var=204, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004588, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=205, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004588, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=208, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004588, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=209, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004588, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=217, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004588, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=220, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004588, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=221, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004588, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=222, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004588, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=223, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004588, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=240, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004588, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=259, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004588, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=272, var.bound=-1.000000, var.weight=1.000000, min_usage=0.004588, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=204, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004588, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=205, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004588, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=208, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004588, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=209, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004588, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=217, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004588, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=220, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004588, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=221, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004588, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=222, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004588, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=223, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004588, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=240, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004588, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=259, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004588, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=272, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.004588, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (204) value to 0.004588
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(204).weight: 1.000000, Var(204).value: 0.004588 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(204).penalty: 1.000000, Var(204).value: 0.004588 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (205) value to 0.004588
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(205).weight: 1.000000, Var(205).value: 0.004588 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(205).penalty: 1.000000, Var(205).value: 0.004588 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (208) value to 0.004588
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(208).weight: 1.000000, Var(208).value: 0.004588 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(208).penalty: 1.000000, Var(208).value: 0.004588 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (209) value to 0.004588
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(209).weight: 1.000000, Var(209).value: 0.004588 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(209).penalty: 1.000000, Var(209).value: 0.004588 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (217) value to 0.004588
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(217).weight: 1.000000, Var(217).value: 0.004588 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(217).penalty: 1.000000, Var(217).value: 0.004588 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (220) value to 0.004588
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(220).weight: 1.000000, Var(220).value: 0.004588 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(220).penalty: 1.000000, Var(220).value: 0.004588 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (221) value to 0.004588
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(221).weight: 1.000000, Var(221).value: 0.004588 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(221).penalty: 1.000000, Var(221).value: 0.004588 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (222) value to 0.004588
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(222).weight: 1.000000, Var(222).value: 0.004588 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(222).penalty: 1.000000, Var(222).value: 0.004588 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (223) value to 0.004588
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(223).weight: 1.000000, Var(223).value: 0.004588 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(223).penalty: 1.000000, Var(223).value: 0.004588 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (240) value to 0.004588
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(240).weight: 1.000000, Var(240).value: 0.004588 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(240).penalty: 1.000000, Var(240).value: 0.004588 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (259) value to 0.004588
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(259).weight: 1.000000, Var(259).value: 0.004588 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(259).penalty: 1.000000, Var(259).value: 0.004588 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (272) value to 0.004588
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(272).weight: 1.000000, Var(272).value: 0.004588 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.004588, Var(272).penalty: 1.000000, Var(272).value: 0.004588 
 > [0.000000]: [surf_maxmin/DEBUG] index: 57     cnst_light_num: 100     || usage: 0.000000 remaining: 0.000000 bound: 0.069930  
-> [0.000000]: [surf_maxmin/DEBUG] var=203, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011179, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=215, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011179, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=216, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011179, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=226, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011179, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=230, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011179, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=244, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011179, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=253, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011179, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=254, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011179, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=203, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011179, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=215, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011179, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=216, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011179, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=226, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011179, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=230, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011179, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=244, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011179, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=253, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011179, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=254, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011179, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (203) value to 0.011179
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011179, Var(203).weight: 1.000000, Var(203).value: 0.011179 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011179, Var(203).penalty: 1.000000, Var(203).value: 0.011179 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (215) value to 0.011179
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011179, Var(215).weight: 1.000000, Var(215).value: 0.011179 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011179, Var(215).penalty: 1.000000, Var(215).value: 0.011179 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (216) value to 0.011179
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011179, Var(216).weight: 1.000000, Var(216).value: 0.011179 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011179, Var(216).penalty: 1.000000, Var(216).value: 0.011179 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (226) value to 0.011179
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011179, Var(226).weight: 1.000000, Var(226).value: 0.011179 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011179, Var(226).penalty: 1.000000, Var(226).value: 0.011179 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (230) value to 0.011179
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011179, Var(230).weight: 1.000000, Var(230).value: 0.011179 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011179, Var(230).penalty: 1.000000, Var(230).value: 0.011179 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (244) value to 0.011179
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011179, Var(244).weight: 1.000000, Var(244).value: 0.011179 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011179, Var(244).penalty: 1.000000, Var(244).value: 0.011179 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (253) value to 0.011179
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011179, Var(253).weight: 1.000000, Var(253).value: 0.011179 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011179, Var(253).penalty: 1.000000, Var(253).value: 0.011179 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (254) value to 0.011179
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011179, Var(254).weight: 1.000000, Var(254).value: 0.011179 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011179, Var(254).penalty: 1.000000, Var(254).value: 0.011179 
 > [0.000000]: [surf_maxmin/DEBUG] index: 41     cnst_light_num: 99      || usage: 0.000000 remaining: 0.000000 bound: 0.129870  
-> [0.000000]: [surf_maxmin/DEBUG] var=206, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011967, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=214, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011967, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=224, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011967, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=228, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011967, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=235, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011967, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=255, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011967, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=261, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011967, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=206, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011967, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=214, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011967, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=224, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011967, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=228, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011967, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=235, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011967, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=255, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011967, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=261, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011967, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (206) value to 0.011967
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011967, Var(206).weight: 1.000000, Var(206).value: 0.011967 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011967, Var(206).penalty: 1.000000, Var(206).value: 0.011967 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (214) value to 0.011967
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011967, Var(214).weight: 1.000000, Var(214).value: 0.011967 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011967, Var(214).penalty: 1.000000, Var(214).value: 0.011967 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (224) value to 0.011967
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011967, Var(224).weight: 1.000000, Var(224).value: 0.011967 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011967, Var(224).penalty: 1.000000, Var(224).value: 0.011967 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (228) value to 0.011967
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011967, Var(228).weight: 1.000000, Var(228).value: 0.011967 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011967, Var(228).penalty: 1.000000, Var(228).value: 0.011967 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (235) value to 0.011967
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011967, Var(235).weight: 1.000000, Var(235).value: 0.011967 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011967, Var(235).penalty: 1.000000, Var(235).value: 0.011967 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (255) value to 0.011967
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011967, Var(255).weight: 1.000000, Var(255).value: 0.011967 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011967, Var(255).penalty: 1.000000, Var(255).value: 0.011967 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (261) value to 0.011967
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011967, Var(261).weight: 1.000000, Var(261).value: 0.011967 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011967, Var(261).penalty: 1.000000, Var(261).value: 0.011967 
 > [0.000000]: [surf_maxmin/DEBUG] index: 44     cnst_light_num: 98      || usage: 0.000000 remaining: 0.000000 bound: 0.209790  
-> [0.000000]: [surf_maxmin/DEBUG] var=210, var.bound=-1.000000, var.weight=1.000000, min_usage=0.018751, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=218, var.bound=-1.000000, var.weight=1.000000, min_usage=0.018751, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=219, var.bound=-1.000000, var.weight=1.000000, min_usage=0.018751, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=245, var.bound=-1.000000, var.weight=1.000000, min_usage=0.018751, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=210, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.018751, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=218, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.018751, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=219, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.018751, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=245, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.018751, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (210) value to 0.018751
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018751, Var(210).weight: 1.000000, Var(210).value: 0.018751 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018751, Var(210).penalty: 1.000000, Var(210).value: 0.018751 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (218) value to 0.018751
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018751, Var(218).weight: 1.000000, Var(218).value: 0.018751 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018751, Var(218).penalty: 1.000000, Var(218).value: 0.018751 
 > [0.000000]: [surf_maxmin/DEBUG] index: 63     cnst_light_num: 97      || usage: 0.000000 remaining: 0.578879 bound: 0.679321  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (219) value to 0.018751
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018751, Var(219).weight: 1.000000, Var(219).value: 0.018751 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018751, Var(219).penalty: 1.000000, Var(219).value: 0.018751 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (245) value to 0.018751
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018751, Var(245).weight: 1.000000, Var(245).value: 0.018751 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018751, Var(245).penalty: 1.000000, Var(245).value: 0.018751 
 > [0.000000]: [surf_maxmin/DEBUG] index: 93     cnst_light_num: 96      || usage: 0.000000 remaining: 3.076350 bound: 3.146853  
 > [0.000000]: [surf_maxmin/DEBUG] index: 45     cnst_light_num: 95      || usage: 0.000000 remaining: 3.769672 bound: 3.896104  
 > [0.000000]: [surf_maxmin/DEBUG] index: 84     cnst_light_num: 94      || usage: 0.000000 remaining: 0.000000 bound: 0.219780  
-> [0.000000]: [surf_maxmin/DEBUG] var=212, var.bound=-1.000000, var.weight=1.000000, min_usage=0.024496, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=213, var.bound=-1.000000, var.weight=1.000000, min_usage=0.024496, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=247, var.bound=-1.000000, var.weight=1.000000, min_usage=0.024496, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=251, var.bound=-1.000000, var.weight=1.000000, min_usage=0.024496, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=270, var.bound=-1.000000, var.weight=1.000000, min_usage=0.024496, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=212, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.024496, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=213, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.024496, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=247, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.024496, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=251, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.024496, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=270, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.024496, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (212) value to 0.024496
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.024496, Var(212).weight: 1.000000, Var(212).value: 0.024496 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.024496, Var(212).penalty: 1.000000, Var(212).value: 0.024496 
 > [0.000000]: [surf_maxmin/DEBUG] index: 61     cnst_light_num: 93      || usage: 0.000000 remaining: 2.039851 bound: 2.127872  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (213) value to 0.024496
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.024496, Var(213).weight: 1.000000, Var(213).value: 0.024496 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.024496, Var(213).penalty: 1.000000, Var(213).value: 0.024496 
 > [0.000000]: [surf_maxmin/DEBUG] index: 44     cnst_light_num: 92      || usage: 0.000000 remaining: 3.878060 bound: 4.035964  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (247) value to 0.024496
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.024496, Var(247).weight: 1.000000, Var(247).value: 0.024496 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.024496, Var(247).penalty: 1.000000, Var(247).value: 0.024496 
 > [0.000000]: [surf_maxmin/DEBUG] index: 60     cnst_light_num: 91      || usage: 0.000000 remaining: 7.260437 bound: 7.472527  
 > [0.000000]: [surf_maxmin/DEBUG] index: 78     cnst_light_num: 90      || usage: 0.000000 remaining: 6.425400 bound: 6.613387  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (251) value to 0.024496
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.024496, Var(251).weight: 1.000000, Var(251).value: 0.024496 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.024496, Var(251).penalty: 1.000000, Var(251).value: 0.024496 
 > [0.000000]: [surf_maxmin/DEBUG] index: 70     cnst_light_num: 89      || usage: 0.000000 remaining: 5.064446 bound: 5.214785  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (270) value to 0.024496
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.024496, Var(270).weight: 1.000000, Var(270).value: 0.024496 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.024496, Var(270).penalty: 1.000000, Var(270).value: 0.024496 
 > [0.000000]: [surf_maxmin/DEBUG] index: 45     cnst_light_num: 88      || usage: 0.000000 remaining: 4.866697 bound: 5.074925  
 > [0.000000]: [surf_maxmin/DEBUG] index: 54     cnst_light_num: 87      || usage: 0.000000 remaining: 2.783177 bound: 2.847153  
 > [0.000000]: [surf_maxmin/DEBUG] index: 73     cnst_light_num: 86      || usage: 0.000000 remaining: 0.000000 bound: 0.269730  
-> [0.000000]: [surf_maxmin/DEBUG] var=231, var.bound=-1.000000, var.weight=1.000000, min_usage=0.028740, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=258, var.bound=-1.000000, var.weight=1.000000, min_usage=0.028740, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=231, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.028740, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=258, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.028740, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (231) value to 0.028740
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.028740, Var(231).weight: 1.000000, Var(231).value: 0.028740 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.028740, Var(231).penalty: 1.000000, Var(231).value: 0.028740 
 > [0.000000]: [surf_maxmin/DEBUG] index: 63     cnst_light_num: 85      || usage: 0.000000 remaining: 7.996007 bound: 8.151848  
 > [0.000000]: [surf_maxmin/DEBUG] index: 56     cnst_light_num: 84      || usage: 0.000000 remaining: 1.988515 bound: 2.207792  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (258) value to 0.028740
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.028740, Var(258).weight: 1.000000, Var(258).value: 0.028740 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.028740, Var(258).penalty: 1.000000, Var(258).value: 0.028740 
 > [0.000000]: [surf_maxmin/DEBUG] index: 58     cnst_light_num: 83      || usage: 0.000000 remaining: 0.000000 bound: 0.219780  
 > [0.000000]: [surf_maxmin/DEBUG] index: 52     cnst_light_num: 82      || usage: 0.000000 remaining: 3.636900 bound: 3.856144  
 > [0.000000]: [surf_maxmin/DEBUG] index: 48     cnst_light_num: 81      || usage: 0.000000 remaining: 5.787038 bound: 6.073926  
 > [0.000000]: [surf_maxmin/DEBUG] index: 76     cnst_light_num: 80      || usage: 0.000000 remaining: 6.904787 bound: 7.102897  
 > [0.000000]: [surf_maxmin/DEBUG] index: 76     cnst_light_num: 79      || usage: 0.000000 remaining: 2.965961 bound: 3.096903  
 > [0.000000]: [surf_maxmin/DEBUG] index: 63     cnst_light_num: 78      || usage: 0.000000 remaining: 4.074735 bound: 4.255744  
-> [0.000000]: [surf_maxmin/DEBUG] var=207, var.bound=-1.000000, var.weight=1.000000, min_usage=0.081677, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=211, var.bound=-1.000000, var.weight=1.000000, min_usage=0.081677, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=225, var.bound=-1.000000, var.weight=1.000000, min_usage=0.081677, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=241, var.bound=-1.000000, var.weight=1.000000, min_usage=0.081677, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=207, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.081677, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=211, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.081677, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=225, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.081677, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=241, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.081677, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (207) value to 0.081677
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.081677, Var(207).weight: 1.000000, Var(207).value: 0.081677 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.081677, Var(207).penalty: 1.000000, Var(207).value: 0.081677 
 > [0.000000]: [surf_maxmin/DEBUG] index: 58     cnst_light_num: 77      || usage: 0.000000 remaining: 8.327882 bound: 8.671329  
 > [0.000000]: [surf_maxmin/DEBUG] index: 40     cnst_light_num: 76      || usage: 0.000000 remaining: 6.555929 bound: 6.863137  
 > [0.000000]: [surf_maxmin/DEBUG] index: 50     cnst_light_num: 75      || usage: 0.000000 remaining: 1.475985 bound: 1.838162  
@@ -1425,7 +1425,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 70     cnst_light_num: 73      || usage: 0.000000 remaining: 9.192322 bound: 9.540460  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (211) value to 0.081677
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.081677, Var(211).weight: 1.000000, Var(211).value: 0.081677 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.081677, Var(211).penalty: 1.000000, Var(211).value: 0.081677 
 > [0.000000]: [surf_maxmin/DEBUG] index: 50     cnst_light_num: 72      || usage: 0.000000 remaining: 3.995254 bound: 4.445554  
 > [0.000000]: [surf_maxmin/DEBUG] index: 60     cnst_light_num: 71      || usage: 0.000000 remaining: 8.857261 bound: 9.130869  
 > [0.000000]: [surf_maxmin/DEBUG] index: 42     cnst_light_num: 70      || usage: 0.000000 remaining: 6.483225 bound: 6.703297  
@@ -1433,7 +1433,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 54     cnst_light_num: 68      || usage: 0.000000 remaining: 3.798887 bound: 4.235764  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (225) value to 0.081677
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.081677, Var(225).weight: 1.000000, Var(225).value: 0.081677 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.081677, Var(225).penalty: 1.000000, Var(225).value: 0.081677 
 > [0.000000]: [surf_maxmin/DEBUG] index: 65     cnst_light_num: 67      || usage: 0.000000 remaining: 7.072223 bound: 7.462537  
 > [0.000000]: [surf_maxmin/DEBUG] index: 50     cnst_light_num: 66      || usage: 0.000000 remaining: 2.691950 bound: 2.967033  
 > [0.000000]: [surf_maxmin/DEBUG] index: 64     cnst_light_num: 65      || usage: 0.000000 remaining: 0.118066 bound: 0.439560  
@@ -1449,7 +1449,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 44     cnst_light_num: 55      || usage: 0.000000 remaining: 2.679793 bound: 2.957043  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (241) value to 0.081677
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.081677, Var(241).weight: 1.000000, Var(241).value: 0.081677 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.081677, Var(241).penalty: 1.000000, Var(241).value: 0.081677 
 > [0.000000]: [surf_maxmin/DEBUG] index: 41     cnst_light_num: 54      || usage: 0.000000 remaining: 1.184105 bound: 1.598402  
 > [0.000000]: [surf_maxmin/DEBUG] index: 39     cnst_light_num: 53      || usage: 0.000000 remaining: 3.653829 bound: 3.896104  
 > [0.000000]: [surf_maxmin/DEBUG] index: 39     cnst_light_num: 52      || usage: 0.000000 remaining: 0.077489 bound: 0.369630  
@@ -1466,10 +1466,10 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 39     cnst_light_num: 41      || usage: 0.000000 remaining: 6.589209 bound: 6.963037  
 > [0.000000]: [surf_maxmin/DEBUG] index: 38     cnst_light_num: 40      || usage: 0.000000 remaining: 8.777468 bound: 9.170829  
 > [0.000000]: [surf_maxmin/DEBUG] index: 38     cnst_light_num: 39      || usage: 0.000000 remaining: 6.325405 bound: 6.563437  
-> [0.000000]: [surf_maxmin/DEBUG] var=202, var.bound=-1.000000, var.weight=1.000000, min_usage=0.128912, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=202, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.128912, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (202) value to 0.128912
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.128912, Var(202).weight: 1.000000, Var(202).value: 0.128912 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.128912, Var(202).penalty: 1.000000, Var(202).value: 0.128912 
 > [0.000000]: [surf_maxmin/DEBUG] index: 20     cnst_light_num: 38      || usage: 0.000000 remaining: 2.032430 bound: 2.307692  
 > [0.000000]: [surf_maxmin/DEBUG] index: 21     cnst_light_num: 37      || usage: 0.000000 remaining: 6.334159 bound: 6.913087  
 > [0.000000]: [surf_maxmin/DEBUG] index: 22     cnst_light_num: 36      || usage: 0.000000 remaining: 0.404144 bound: 0.889111  
@@ -1488,10 +1488,10 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 22     cnst_light_num: 23      || usage: 0.000000 remaining: 5.378706 bound: 5.894106  
 > [0.000000]: [surf_maxmin/DEBUG] index: 21     cnst_light_num: 22      || usage: 0.000000 remaining: 7.128378 bound: 7.842158  
 > [0.000000]: [surf_maxmin/DEBUG] index: 20     cnst_light_num: 21      || usage: 0.000000 remaining: 3.080921 bound: 3.706294  
-> [0.000000]: [surf_maxmin/DEBUG] var=201, var.bound=-1.000000, var.weight=1.000000, min_usage=1.559233, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=201, var.bound=-1.000000, var.penalty=1.000000, min_usage=1.559233, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (201) value to 1.559233
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.559233, Var(201).weight: 1.000000, Var(201).value: 1.559233 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.559233, Var(201).penalty: 1.000000, Var(201).value: 1.559233 
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 20      || usage: 0.000000 remaining: 2.120434 bound: 3.656344  
 > [0.000000]: [surf_maxmin/DEBUG] index: 2      cnst_light_num: 19      || usage: 0.000000 remaining: 3.188475 bound: 5.324675  
 > [0.000000]: [surf_maxmin/DEBUG] index: 3      cnst_light_num: 18      || usage: 0.000000 remaining: 0.342262 bound: 3.136863  
@@ -1817,190 +1817,190 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '344' usage: 12.720779 remaining: 3.846154 concurrency: 6<=7<=16
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '390' usage: 8.037962 remaining: 2.907093 concurrency: 5<=6<=40
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '313' usage: 11.415584 remaining: 0.679321 concurrency: 5<=6<=40
-> [0.000000]: [surf_maxmin/DEBUG] var=302, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007198, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=307, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007198, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=308, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007198, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=309, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007198, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=311, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007198, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=312, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007198, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=327, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007198, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=328, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007198, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=335, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007198, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=338, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007198, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=352, var.bound=-1.000000, var.weight=1.000000, min_usage=0.007198, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=302, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007198, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=307, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007198, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=308, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007198, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=309, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007198, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=311, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007198, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=312, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007198, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=327, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007198, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=328, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007198, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=335, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007198, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=338, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007198, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=352, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.007198, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (302) value to 0.007198
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(302).weight: 1.000000, Var(302).value: 0.007198 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(302).penalty: 1.000000, Var(302).value: 0.007198 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (307) value to 0.007198
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(307).weight: 1.000000, Var(307).value: 0.007198 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(307).penalty: 1.000000, Var(307).value: 0.007198 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (308) value to 0.007198
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(308).weight: 1.000000, Var(308).value: 0.007198 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(308).penalty: 1.000000, Var(308).value: 0.007198 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (309) value to 0.007198
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(309).weight: 1.000000, Var(309).value: 0.007198 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(309).penalty: 1.000000, Var(309).value: 0.007198 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (311) value to 0.007198
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(311).weight: 1.000000, Var(311).value: 0.007198 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(311).penalty: 1.000000, Var(311).value: 0.007198 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (312) value to 0.007198
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(312).weight: 1.000000, Var(312).value: 0.007198 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(312).penalty: 1.000000, Var(312).value: 0.007198 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (327) value to 0.007198
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(327).weight: 1.000000, Var(327).value: 0.007198 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(327).penalty: 1.000000, Var(327).value: 0.007198 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (328) value to 0.007198
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(328).weight: 1.000000, Var(328).value: 0.007198 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(328).penalty: 1.000000, Var(328).value: 0.007198 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (335) value to 0.007198
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(335).weight: 1.000000, Var(335).value: 0.007198 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(335).penalty: 1.000000, Var(335).value: 0.007198 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (338) value to 0.007198
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(338).weight: 1.000000, Var(338).value: 0.007198 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(338).penalty: 1.000000, Var(338).value: 0.007198 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (352) value to 0.007198
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(352).weight: 1.000000, Var(352).value: 0.007198 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.007198, Var(352).penalty: 1.000000, Var(352).value: 0.007198 
 > [0.000000]: [surf_maxmin/DEBUG] index: 39     cnst_light_num: 100     || usage: 0.000000 remaining: 0.000000 bound: 0.139860  
-> [0.000000]: [surf_maxmin/DEBUG] var=301, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011252, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=304, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011252, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=315, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011252, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=318, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011252, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=319, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011252, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=322, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011252, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=332, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011252, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=333, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011252, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=334, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011252, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=339, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011252, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=343, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011252, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=344, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011252, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=345, var.bound=-1.000000, var.weight=1.000000, min_usage=0.011252, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=301, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011252, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=304, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011252, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=315, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011252, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=318, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011252, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=319, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011252, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=322, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011252, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=332, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011252, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=333, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011252, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=334, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011252, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=339, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011252, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=343, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011252, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=344, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011252, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=345, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.011252, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (301) value to 0.011252
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(301).weight: 1.000000, Var(301).value: 0.011252 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(301).penalty: 1.000000, Var(301).value: 0.011252 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (304) value to 0.011252
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(304).weight: 1.000000, Var(304).value: 0.011252 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(304).penalty: 1.000000, Var(304).value: 0.011252 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (315) value to 0.011252
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(315).weight: 1.000000, Var(315).value: 0.011252 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(315).penalty: 1.000000, Var(315).value: 0.011252 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (318) value to 0.011252
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(318).weight: 1.000000, Var(318).value: 0.011252 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(318).penalty: 1.000000, Var(318).value: 0.011252 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (319) value to 0.011252
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(319).weight: 1.000000, Var(319).value: 0.011252 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(319).penalty: 1.000000, Var(319).value: 0.011252 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (322) value to 0.011252
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(322).weight: 1.000000, Var(322).value: 0.011252 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(322).penalty: 1.000000, Var(322).value: 0.011252 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (332) value to 0.011252
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(332).weight: 1.000000, Var(332).value: 0.011252 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(332).penalty: 1.000000, Var(332).value: 0.011252 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (333) value to 0.011252
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(333).weight: 1.000000, Var(333).value: 0.011252 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(333).penalty: 1.000000, Var(333).value: 0.011252 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (334) value to 0.011252
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(334).weight: 1.000000, Var(334).value: 0.011252 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(334).penalty: 1.000000, Var(334).value: 0.011252 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (339) value to 0.011252
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(339).weight: 1.000000, Var(339).value: 0.011252 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(339).penalty: 1.000000, Var(339).value: 0.011252 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (343) value to 0.011252
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(343).weight: 1.000000, Var(343).value: 0.011252 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(343).penalty: 1.000000, Var(343).value: 0.011252 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (344) value to 0.011252
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(344).weight: 1.000000, Var(344).value: 0.011252 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(344).penalty: 1.000000, Var(344).value: 0.011252 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (345) value to 0.011252
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(345).weight: 1.000000, Var(345).value: 0.011252 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.011252, Var(345).penalty: 1.000000, Var(345).value: 0.011252 
 > [0.000000]: [surf_maxmin/DEBUG] index: 14     cnst_light_num: 99      || usage: 0.000000 remaining: 0.000000 bound: 0.299700  
-> [0.000000]: [surf_maxmin/DEBUG] var=306, var.bound=-1.000000, var.weight=1.000000, min_usage=0.018582, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=310, var.bound=-1.000000, var.weight=1.000000, min_usage=0.018582, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=313, var.bound=-1.000000, var.weight=1.000000, min_usage=0.018582, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=314, var.bound=-1.000000, var.weight=1.000000, min_usage=0.018582, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=342, var.bound=-1.000000, var.weight=1.000000, min_usage=0.018582, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=350, var.bound=-1.000000, var.weight=1.000000, min_usage=0.018582, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=368, var.bound=-1.000000, var.weight=1.000000, min_usage=0.018582, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=306, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.018582, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=310, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.018582, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=313, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.018582, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=314, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.018582, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=342, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.018582, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=350, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.018582, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=368, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.018582, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (306) value to 0.018582
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018582, Var(306).weight: 1.000000, Var(306).value: 0.018582 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018582, Var(306).penalty: 1.000000, Var(306).value: 0.018582 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (310) value to 0.018582
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018582, Var(310).weight: 1.000000, Var(310).value: 0.018582 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018582, Var(310).penalty: 1.000000, Var(310).value: 0.018582 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (313) value to 0.018582
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018582, Var(313).weight: 1.000000, Var(313).value: 0.018582 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018582, Var(313).penalty: 1.000000, Var(313).value: 0.018582 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (314) value to 0.018582
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018582, Var(314).weight: 1.000000, Var(314).value: 0.018582 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018582, Var(314).penalty: 1.000000, Var(314).value: 0.018582 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (342) value to 0.018582
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018582, Var(342).weight: 1.000000, Var(342).value: 0.018582 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018582, Var(342).penalty: 1.000000, Var(342).value: 0.018582 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (350) value to 0.018582
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018582, Var(350).weight: 1.000000, Var(350).value: 0.018582 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018582, Var(350).penalty: 1.000000, Var(350).value: 0.018582 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (368) value to 0.018582
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018582, Var(368).weight: 1.000000, Var(368).value: 0.018582 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.018582, Var(368).penalty: 1.000000, Var(368).value: 0.018582 
 > [0.000000]: [surf_maxmin/DEBUG] index: 14     cnst_light_num: 98      || usage: 0.000000 remaining: 2.790101 bound: 2.907093  
 > [0.000000]: [surf_maxmin/DEBUG] index: 35     cnst_light_num: 97      || usage: 0.000000 remaining: 0.000000 bound: 0.249750  
 > [0.000000]: [surf_maxmin/DEBUG] index: 80     cnst_light_num: 96      || usage: 0.000000 remaining: 5.032823 bound: 5.104895  
-> [0.000000]: [surf_maxmin/DEBUG] var=326, var.bound=-1.000000, var.weight=1.000000, min_usage=0.028518, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=365, var.bound=-1.000000, var.weight=1.000000, min_usage=0.028518, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=326, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.028518, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=365, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.028518, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (326) value to 0.028518
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.028518, Var(326).weight: 1.000000, Var(326).value: 0.028518 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.028518, Var(326).penalty: 1.000000, Var(326).value: 0.028518 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (365) value to 0.028518
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.028518, Var(365).weight: 1.000000, Var(365).value: 0.028518 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.028518, Var(365).penalty: 1.000000, Var(365).value: 0.028518 
 > [0.000000]: [surf_maxmin/DEBUG] index: 92     cnst_light_num: 95      || usage: 0.000000 remaining: 0.000000 bound: 0.239760  
-> [0.000000]: [surf_maxmin/DEBUG] var=321, var.bound=-1.000000, var.weight=1.000000, min_usage=0.047771, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=346, var.bound=-1.000000, var.weight=1.000000, min_usage=0.047771, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=370, var.bound=-1.000000, var.weight=1.000000, min_usage=0.047771, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=321, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.047771, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=346, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.047771, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=370, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.047771, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (321) value to 0.047771
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.047771, Var(321).weight: 1.000000, Var(321).value: 0.047771 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.047771, Var(321).penalty: 1.000000, Var(321).value: 0.047771 
 > [0.000000]: [surf_maxmin/DEBUG] index: 23     cnst_light_num: 94      || usage: 0.000000 remaining: 4.018641 bound: 4.205794  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (346) value to 0.047771
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.047771, Var(346).weight: 1.000000, Var(346).value: 0.047771 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.047771, Var(346).penalty: 1.000000, Var(346).value: 0.047771 
 > [0.000000]: [surf_maxmin/DEBUG] index: 58     cnst_light_num: 93      || usage: 0.000000 remaining: 6.974816 bound: 7.122877  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (370) value to 0.047771
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.047771, Var(370).weight: 1.000000, Var(370).value: 0.047771 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.047771, Var(370).penalty: 1.000000, Var(370).value: 0.047771 
 > [0.000000]: [surf_maxmin/DEBUG] index: 85     cnst_light_num: 92      || usage: 0.000000 remaining: 4.120057 bound: 4.375624  
 > [0.000000]: [surf_maxmin/DEBUG] index: 63     cnst_light_num: 91      || usage: 0.000000 remaining: 9.066800 bound: 9.350649  
 > [0.000000]: [surf_maxmin/DEBUG] index: 89     cnst_light_num: 90      || usage: 0.000000 remaining: 0.000000 bound: 0.359640  
-> [0.000000]: [surf_maxmin/DEBUG] var=317, var.bound=-1.000000, var.weight=1.000000, min_usage=0.094009, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=324, var.bound=-1.000000, var.weight=1.000000, min_usage=0.094009, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=317, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.094009, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=324, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.094009, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (317) value to 0.094009
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.094009, Var(317).weight: 1.000000, Var(317).value: 0.094009 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.094009, Var(317).penalty: 1.000000, Var(317).value: 0.094009 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (324) value to 0.094009
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.094009, Var(324).weight: 1.000000, Var(324).value: 0.094009 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.094009, Var(324).penalty: 1.000000, Var(324).value: 0.094009 
 > [0.000000]: [surf_maxmin/DEBUG] index: 7      cnst_light_num: 89      || usage: 0.000000 remaining: 4.485784 bound: 4.885115  
 > [0.000000]: [surf_maxmin/DEBUG] index: 4      cnst_light_num: 88      || usage: 0.000000 remaining: 0.000000 bound: 0.399600  
 > [0.000000]: [surf_maxmin/DEBUG] index: 63     cnst_light_num: 87      || usage: 0.000000 remaining: 7.782300 bound: 8.471528  
-> [0.000000]: [surf_maxmin/DEBUG] var=303, var.bound=-1.000000, var.weight=1.000000, min_usage=0.142202, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=305, var.bound=-1.000000, var.weight=1.000000, min_usage=0.142202, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=329, var.bound=-1.000000, var.weight=1.000000, min_usage=0.142202, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=355, var.bound=-1.000000, var.weight=1.000000, min_usage=0.142202, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=303, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.142202, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=305, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.142202, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=329, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.142202, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=355, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.142202, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (303) value to 0.142202
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.142202, Var(303).weight: 1.000000, Var(303).value: 0.142202 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.142202, Var(303).penalty: 1.000000, Var(303).value: 0.142202 
 > [0.000000]: [surf_maxmin/DEBUG] index: 45     cnst_light_num: 86      || usage: 0.000000 remaining: 8.926300 bound: 9.280719  
 > [0.000000]: [surf_maxmin/DEBUG] index: 43     cnst_light_num: 85      || usage: 0.000000 remaining: 2.225982 bound: 2.907093  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (305) value to 0.142202
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.142202, Var(305).weight: 1.000000, Var(305).value: 0.142202 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.142202, Var(305).penalty: 1.000000, Var(305).value: 0.142202 
 > [0.000000]: [surf_maxmin/DEBUG] index: 34     cnst_light_num: 84      || usage: 0.000000 remaining: 7.001496 bound: 7.732268  
 > [0.000000]: [surf_maxmin/DEBUG] index: 62     cnst_light_num: 83      || usage: 0.000000 remaining: 4.311663 bound: 4.855145  
 > [0.000000]: [surf_maxmin/DEBUG] index: 74     cnst_light_num: 82      || usage: 0.000000 remaining: 1.415789 bound: 1.658342  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (329) value to 0.142202
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.142202, Var(329).weight: 1.000000, Var(329).value: 0.142202 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.142202, Var(329).penalty: 1.000000, Var(329).value: 0.142202 
 > [0.000000]: [surf_maxmin/DEBUG] index: 58     cnst_light_num: 81      || usage: 0.000000 remaining: 5.694817 bound: 5.954046  
 > [0.000000]: [surf_maxmin/DEBUG] index: 30     cnst_light_num: 80      || usage: 0.000000 remaining: 8.782447 bound: 9.170829  
 > [0.000000]: [surf_maxmin/DEBUG] index: 18     cnst_light_num: 79      || usage: 0.000000 remaining: 4.018510 bound: 4.255744  
@@ -2008,7 +2008,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 18     cnst_light_num: 77      || usage: 0.000000 remaining: 3.346839 bound: 3.656344  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (355) value to 0.142202
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.142202, Var(355).weight: 1.000000, Var(355).value: 0.142202 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.142202, Var(355).penalty: 1.000000, Var(355).value: 0.142202 
 > [0.000000]: [surf_maxmin/DEBUG] index: 52     cnst_light_num: 76      || usage: 0.000000 remaining: 4.150664 bound: 4.915085  
 > [0.000000]: [surf_maxmin/DEBUG] index: 33     cnst_light_num: 75      || usage: 0.000000 remaining: 4.834649 bound: 5.974026  
 > [0.000000]: [surf_maxmin/DEBUG] index: 31     cnst_light_num: 74      || usage: 0.000000 remaining: 1.696954 bound: 2.277722  
@@ -2020,10 +2020,10 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 19     cnst_light_num: 68      || usage: 0.000000 remaining: 4.722579 bound: 5.504496  
 > [0.000000]: [surf_maxmin/DEBUG] index: 8      cnst_light_num: 67      || usage: 0.000000 remaining: 0.055535 bound: 0.659341  
 > [0.000000]: [surf_maxmin/DEBUG] index: 64     cnst_light_num: 66      || usage: 0.000000 remaining: 3.635989 bound: 4.465534  
-> [0.000000]: [surf_maxmin/DEBUG] var=320, var.bound=-1.000000, var.weight=1.000000, min_usage=0.201077, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=320, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.201077, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (320) value to 0.201077
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.201077, Var(320).weight: 1.000000, Var(320).value: 0.201077 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.201077, Var(320).penalty: 1.000000, Var(320).value: 0.201077 
 > [0.000000]: [surf_maxmin/DEBUG] index: 18     cnst_light_num: 65      || usage: 0.000000 remaining: 0.438337 bound: 0.799201  
 > [0.000000]: [surf_maxmin/DEBUG] index: 30     cnst_light_num: 64      || usage: 0.000000 remaining: 5.921236 bound: 6.273726  
 > [0.000000]: [surf_maxmin/DEBUG] index: 21     cnst_light_num: 63      || usage: 0.000000 remaining: 4.308459 bound: 4.995005  
@@ -2037,11 +2037,11 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 14     cnst_light_num: 55      || usage: 0.000000 remaining: 1.926234 bound: 2.987013  
 > [0.000000]: [surf_maxmin/DEBUG] index: 9      cnst_light_num: 54      || usage: 0.000000 remaining: 6.057243 bound: 6.453546  
 > [0.000000]: [surf_maxmin/DEBUG] index: 45     cnst_light_num: 53      || usage: 0.000000 remaining: 5.985763 bound: 6.363636  
-> [0.000000]: [surf_maxmin/DEBUG] var=316, var.bound=-1.000000, var.weight=1.000000, min_usage=0.288945, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=336, var.bound=-1.000000, var.weight=1.000000, min_usage=0.288945, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=316, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.288945, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=336, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.288945, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (316) value to 0.288945
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.288945, Var(316).weight: 1.000000, Var(316).value: 0.288945 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.288945, Var(316).penalty: 1.000000, Var(316).value: 0.288945 
 > [0.000000]: [surf_maxmin/DEBUG] index: 28     cnst_light_num: 52      || usage: 0.000000 remaining: 1.281667 bound: 2.327672  
 > [0.000000]: [surf_maxmin/DEBUG] index: 18     cnst_light_num: 51      || usage: 0.000000 remaining: 6.258337 bound: 7.092907  
 > [0.000000]: [surf_maxmin/DEBUG] index: 10     cnst_light_num: 50      || usage: 0.000000 remaining: 8.679785 bound: 9.950050  
@@ -2058,7 +2058,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 5      cnst_light_num: 39      || usage: 0.000000 remaining: 3.396353 bound: 4.475524  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (336) value to 0.288945
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.288945, Var(336).weight: 1.000000, Var(336).value: 0.288945 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.288945, Var(336).penalty: 1.000000, Var(336).value: 0.288945 
 > [0.000000]: [surf_maxmin/DEBUG] index: 22     cnst_light_num: 38      || usage: 0.000000 remaining: 8.886978 bound: 9.790210  
 > [0.000000]: [surf_maxmin/DEBUG] index: 12     cnst_light_num: 37      || usage: 0.000000 remaining: 2.289452 bound: 3.766234  
 > [0.000000]: [surf_maxmin/DEBUG] index: 7      cnst_light_num: 36      || usage: 0.000000 remaining: 6.936049 bound: 7.642358  
@@ -2076,10 +2076,10 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 16     cnst_light_num: 24      || usage: 0.000000 remaining: 7.844363 bound: 9.010989  
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 23      || usage: 0.000000 remaining: 5.328389 bound: 6.893107  
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 22      || usage: 0.000000 remaining: 6.171176 bound: 7.512488  
-> [0.000000]: [surf_maxmin/DEBUG] var=323, var.bound=-1.000000, var.weight=1.000000, min_usage=0.301983, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=323, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.301983, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (323) value to 0.301983
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.301983, Var(323).weight: 1.000000, Var(323).value: 0.301983 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.301983, Var(323).penalty: 1.000000, Var(323).value: 0.301983 
 > [0.000000]: [surf_maxmin/DEBUG] index: 5      cnst_light_num: 21      || usage: 0.000000 remaining: 3.866850 bound: 4.515485  
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 20      || usage: 0.000000 remaining: 8.277577 bound: 9.640360  
 > [0.000000]: [surf_maxmin/DEBUG] index: 12     cnst_light_num: 19      || usage: 0.000000 remaining: 6.671593 bound: 8.811189  
@@ -2406,185 +2406,185 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '434' usage: 13.643856 remaining: 9.670330 concurrency: 7<=8<=9
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '474' usage: 12.365634 remaining: 3.756244 concurrency: 6<=7<=9
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '414' usage: 8.673327 remaining: 3.066933 concurrency: 4<=6<=10
-> [0.000000]: [surf_maxmin/DEBUG] var=405, var.bound=-1.000000, var.weight=1.000000, min_usage=0.013951, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=410, var.bound=-1.000000, var.weight=1.000000, min_usage=0.013951, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=412, var.bound=-1.000000, var.weight=1.000000, min_usage=0.013951, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=413, var.bound=-1.000000, var.weight=1.000000, min_usage=0.013951, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=419, var.bound=-1.000000, var.weight=1.000000, min_usage=0.013951, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=421, var.bound=-1.000000, var.weight=1.000000, min_usage=0.013951, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=423, var.bound=-1.000000, var.weight=1.000000, min_usage=0.013951, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=431, var.bound=-1.000000, var.weight=1.000000, min_usage=0.013951, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=433, var.bound=-1.000000, var.weight=1.000000, min_usage=0.013951, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=462, var.bound=-1.000000, var.weight=1.000000, min_usage=0.013951, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=482, var.bound=-1.000000, var.weight=1.000000, min_usage=0.013951, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=405, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.013951, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=410, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.013951, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=412, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.013951, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=413, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.013951, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=419, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.013951, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=421, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.013951, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=423, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.013951, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=431, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.013951, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=433, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.013951, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=462, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.013951, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=482, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.013951, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (405) value to 0.013951
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(405).weight: 1.000000, Var(405).value: 0.013951 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(405).penalty: 1.000000, Var(405).value: 0.013951 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (410) value to 0.013951
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(410).weight: 1.000000, Var(410).value: 0.013951 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(410).penalty: 1.000000, Var(410).value: 0.013951 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (412) value to 0.013951
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(412).weight: 1.000000, Var(412).value: 0.013951 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(412).penalty: 1.000000, Var(412).value: 0.013951 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (413) value to 0.013951
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(413).weight: 1.000000, Var(413).value: 0.013951 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(413).penalty: 1.000000, Var(413).value: 0.013951 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (419) value to 0.013951
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(419).weight: 1.000000, Var(419).value: 0.013951 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(419).penalty: 1.000000, Var(419).value: 0.013951 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (421) value to 0.013951
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(421).weight: 1.000000, Var(421).value: 0.013951 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(421).penalty: 1.000000, Var(421).value: 0.013951 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (423) value to 0.013951
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(423).weight: 1.000000, Var(423).value: 0.013951 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(423).penalty: 1.000000, Var(423).value: 0.013951 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (431) value to 0.013951
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(431).weight: 1.000000, Var(431).value: 0.013951 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(431).penalty: 1.000000, Var(431).value: 0.013951 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (433) value to 0.013951
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(433).weight: 1.000000, Var(433).value: 0.013951 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(433).penalty: 1.000000, Var(433).value: 0.013951 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (462) value to 0.013951
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(462).weight: 1.000000, Var(462).value: 0.013951 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(462).penalty: 1.000000, Var(462).value: 0.013951 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (482) value to 0.013951
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(482).weight: 1.000000, Var(482).value: 0.013951 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.013951, Var(482).penalty: 1.000000, Var(482).value: 0.013951 
 > [0.000000]: [surf_maxmin/DEBUG] index: 67     cnst_light_num: 100     || usage: 0.000000 remaining: 0.000000 bound: 0.299700  
-> [0.000000]: [surf_maxmin/DEBUG] var=402, var.bound=-1.000000, var.weight=1.000000, min_usage=0.023700, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=406, var.bound=-1.000000, var.weight=1.000000, min_usage=0.023700, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=408, var.bound=-1.000000, var.weight=1.000000, min_usage=0.023700, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=415, var.bound=-1.000000, var.weight=1.000000, min_usage=0.023700, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=418, var.bound=-1.000000, var.weight=1.000000, min_usage=0.023700, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=420, var.bound=-1.000000, var.weight=1.000000, min_usage=0.023700, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=424, var.bound=-1.000000, var.weight=1.000000, min_usage=0.023700, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=402, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.023700, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=406, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.023700, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=408, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.023700, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=415, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.023700, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=418, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.023700, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=420, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.023700, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=424, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.023700, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (402) value to 0.023700
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023700, Var(402).weight: 1.000000, Var(402).value: 0.023700 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023700, Var(402).penalty: 1.000000, Var(402).value: 0.023700 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (406) value to 0.023700
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023700, Var(406).weight: 1.000000, Var(406).value: 0.023700 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023700, Var(406).penalty: 1.000000, Var(406).value: 0.023700 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (408) value to 0.023700
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023700, Var(408).weight: 1.000000, Var(408).value: 0.023700 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023700, Var(408).penalty: 1.000000, Var(408).value: 0.023700 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (415) value to 0.023700
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023700, Var(415).weight: 1.000000, Var(415).value: 0.023700 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023700, Var(415).penalty: 1.000000, Var(415).value: 0.023700 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (418) value to 0.023700
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023700, Var(418).weight: 1.000000, Var(418).value: 0.023700 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023700, Var(418).penalty: 1.000000, Var(418).value: 0.023700 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (420) value to 0.023700
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023700, Var(420).weight: 1.000000, Var(420).value: 0.023700 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023700, Var(420).penalty: 1.000000, Var(420).value: 0.023700 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (424) value to 0.023700
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023700, Var(424).weight: 1.000000, Var(424).value: 0.023700 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.023700, Var(424).penalty: 1.000000, Var(424).value: 0.023700 
 > [0.000000]: [surf_maxmin/DEBUG] index: 29     cnst_light_num: 99      || usage: 0.000000 remaining: 0.000000 bound: 0.359640  
-> [0.000000]: [surf_maxmin/DEBUG] var=414, var.bound=-1.000000, var.weight=1.000000, min_usage=0.036913, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=425, var.bound=-1.000000, var.weight=1.000000, min_usage=0.036913, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=427, var.bound=-1.000000, var.weight=1.000000, min_usage=0.036913, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=429, var.bound=-1.000000, var.weight=1.000000, min_usage=0.036913, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=435, var.bound=-1.000000, var.weight=1.000000, min_usage=0.036913, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=452, var.bound=-1.000000, var.weight=1.000000, min_usage=0.036913, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=414, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.036913, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=425, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.036913, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=427, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.036913, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=429, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.036913, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=435, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.036913, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=452, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.036913, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (414) value to 0.036913
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.036913, Var(414).weight: 1.000000, Var(414).value: 0.036913 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.036913, Var(414).penalty: 1.000000, Var(414).value: 0.036913 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (425) value to 0.036913
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.036913, Var(425).weight: 1.000000, Var(425).value: 0.036913 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.036913, Var(425).penalty: 1.000000, Var(425).value: 0.036913 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (427) value to 0.036913
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.036913, Var(427).weight: 1.000000, Var(427).value: 0.036913 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.036913, Var(427).penalty: 1.000000, Var(427).value: 0.036913 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (429) value to 0.036913
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.036913, Var(429).weight: 1.000000, Var(429).value: 0.036913 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.036913, Var(429).penalty: 1.000000, Var(429).value: 0.036913 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (435) value to 0.036913
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.036913, Var(435).weight: 1.000000, Var(435).value: 0.036913 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.036913, Var(435).penalty: 1.000000, Var(435).value: 0.036913 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (452) value to 0.036913
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.036913, Var(452).weight: 1.000000, Var(452).value: 0.036913 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.036913, Var(452).penalty: 1.000000, Var(452).value: 0.036913 
 > [0.000000]: [surf_maxmin/DEBUG] index: 84     cnst_light_num: 98      || usage: 0.000000 remaining: 0.000000 bound: 0.459540  
-> [0.000000]: [surf_maxmin/DEBUG] var=403, var.bound=-1.000000, var.weight=1.000000, min_usage=0.046599, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=404, var.bound=-1.000000, var.weight=1.000000, min_usage=0.046599, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=407, var.bound=-1.000000, var.weight=1.000000, min_usage=0.046599, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=416, var.bound=-1.000000, var.weight=1.000000, min_usage=0.046599, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=426, var.bound=-1.000000, var.weight=1.000000, min_usage=0.046599, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=403, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.046599, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=404, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.046599, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=407, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.046599, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=416, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.046599, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=426, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.046599, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (403) value to 0.046599
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.046599, Var(403).weight: 1.000000, Var(403).value: 0.046599 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.046599, Var(403).penalty: 1.000000, Var(403).value: 0.046599 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (404) value to 0.046599
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.046599, Var(404).weight: 1.000000, Var(404).value: 0.046599 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.046599, Var(404).penalty: 1.000000, Var(404).value: 0.046599 
 > [0.000000]: [surf_maxmin/DEBUG] index: 36     cnst_light_num: 97      || usage: 0.000000 remaining: 9.763793 bound: 9.860140  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (407) value to 0.046599
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.046599, Var(407).weight: 1.000000, Var(407).value: 0.046599 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.046599, Var(407).penalty: 1.000000, Var(407).value: 0.046599 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (416) value to 0.046599
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.046599, Var(416).weight: 1.000000, Var(416).value: 0.046599 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.046599, Var(416).penalty: 1.000000, Var(416).value: 0.046599 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (426) value to 0.046599
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.046599, Var(426).weight: 1.000000, Var(426).value: 0.046599 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.046599, Var(426).penalty: 1.000000, Var(426).value: 0.046599 
 > [0.000000]: [surf_maxmin/DEBUG] index: 49     cnst_light_num: 96      || usage: 0.000000 remaining: 1.560732 bound: 2.027972  
 > [0.000000]: [surf_maxmin/DEBUG] index: 57     cnst_light_num: 95      || usage: 0.000000 remaining: 0.000000 bound: 0.399600  
-> [0.000000]: [surf_maxmin/DEBUG] var=409, var.bound=-1.000000, var.weight=1.000000, min_usage=0.068172, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=417, var.bound=-1.000000, var.weight=1.000000, min_usage=0.068172, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=444, var.bound=-1.000000, var.weight=1.000000, min_usage=0.068172, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=455, var.bound=-1.000000, var.weight=1.000000, min_usage=0.068172, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=409, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.068172, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=417, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.068172, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=444, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.068172, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=455, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.068172, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (409) value to 0.068172
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.068172, Var(409).weight: 1.000000, Var(409).value: 0.068172 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.068172, Var(409).penalty: 1.000000, Var(409).value: 0.068172 
 > [0.000000]: [surf_maxmin/DEBUG] index: 90     cnst_light_num: 94      || usage: 0.000000 remaining: 9.436551 bound: 9.690310  
 > [0.000000]: [surf_maxmin/DEBUG] index: 31     cnst_light_num: 93      || usage: 0.000000 remaining: 6.950082 bound: 7.382617  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (417) value to 0.068172
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.068172, Var(417).weight: 1.000000, Var(417).value: 0.068172 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.068172, Var(417).penalty: 1.000000, Var(417).value: 0.068172 
 > [0.000000]: [surf_maxmin/DEBUG] index: 32     cnst_light_num: 92      || usage: 0.000000 remaining: 0.895015 bound: 1.248751  
 > [0.000000]: [surf_maxmin/DEBUG] index: 41     cnst_light_num: 91      || usage: 0.000000 remaining: 6.666825 bound: 7.132867  
 > [0.000000]: [surf_maxmin/DEBUG] index: 82     cnst_light_num: 90      || usage: 0.000000 remaining: 3.514705 bound: 3.956044  
 > [0.000000]: [surf_maxmin/DEBUG] index: 67     cnst_light_num: 89      || usage: 0.000000 remaining: 2.726842 bound: 3.066933  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (444) value to 0.068172
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.068172, Var(444).weight: 1.000000, Var(444).value: 0.068172 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.068172, Var(444).penalty: 1.000000, Var(444).value: 0.068172 
 > [0.000000]: [surf_maxmin/DEBUG] index: 71     cnst_light_num: 88      || usage: 0.000000 remaining: 8.404470 bound: 8.981019  
 > [0.000000]: [surf_maxmin/DEBUG] index: 25     cnst_light_num: 87      || usage: 0.000000 remaining: 8.866678 bound: 9.160839  
 > [0.000000]: [surf_maxmin/DEBUG] index: 46     cnst_light_num: 86      || usage: 0.000000 remaining: 7.947211 bound: 8.301698  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (455) value to 0.068172
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.068172, Var(455).weight: 1.000000, Var(455).value: 0.068172 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.068172, Var(455).penalty: 1.000000, Var(455).value: 0.068172 
 > [0.000000]: [surf_maxmin/DEBUG] index: 47     cnst_light_num: 85      || usage: 0.000000 remaining: 0.000000 bound: 0.599401  
 > [0.000000]: [surf_maxmin/DEBUG] index: 83     cnst_light_num: 84      || usage: 0.000000 remaining: 5.185774 bound: 5.594406  
 > [0.000000]: [surf_maxmin/DEBUG] index: 55     cnst_light_num: 83      || usage: 0.000000 remaining: 1.636352 bound: 1.838162  
-> [0.000000]: [surf_maxmin/DEBUG] var=401, var.bound=-1.000000, var.weight=1.000000, min_usage=0.075245, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=464, var.bound=-1.000000, var.weight=1.000000, min_usage=0.075245, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=401, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.075245, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=464, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.075245, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (401) value to 0.075245
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.075245, Var(401).weight: 1.000000, Var(401).value: 0.075245 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.075245, Var(401).penalty: 1.000000, Var(401).value: 0.075245 
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 82      || usage: 0.000000 remaining: 1.943854 bound: 2.417582  
 > [0.000000]: [surf_maxmin/DEBUG] index: 10     cnst_light_num: 81      || usage: 0.000000 remaining: 6.465660 bound: 6.663337  
 > [0.000000]: [surf_maxmin/DEBUG] index: 15     cnst_light_num: 80      || usage: 0.000000 remaining: 6.454602 bound: 6.843157  
 > [0.000000]: [surf_maxmin/DEBUG] index: 21     cnst_light_num: 79      || usage: 0.000000 remaining: 0.613333 bound: 0.969031  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (464) value to 0.075245
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.075245, Var(464).weight: 1.000000, Var(464).value: 0.075245 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.075245, Var(464).penalty: 1.000000, Var(464).value: 0.075245 
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 78      || usage: 0.000000 remaining: 5.604611 bound: 6.223776  
 > [0.000000]: [surf_maxmin/DEBUG] index: 6      cnst_light_num: 77      || usage: 0.000000 remaining: 0.000000 bound: 0.439560  
 > [0.000000]: [surf_maxmin/DEBUG] index: 3      cnst_light_num: 76      || usage: 0.000000 remaining: 8.337354 bound: 8.961039  
-> [0.000000]: [surf_maxmin/DEBUG] var=422, var.bound=-1.000000, var.weight=1.000000, min_usage=0.209953, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=422, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.209953, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (422) value to 0.209953
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.209953, Var(422).weight: 1.000000, Var(422).value: 0.209953 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.209953, Var(422).penalty: 1.000000, Var(422).value: 0.209953 
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 75      || usage: 0.000000 remaining: 0.000000 bound: 0.739261  
 > [0.000000]: [surf_maxmin/DEBUG] index: 43     cnst_light_num: 74      || usage: 0.000000 remaining: 3.910501 bound: 4.485514  
 > [0.000000]: [surf_maxmin/DEBUG] index: 13     cnst_light_num: 73      || usage: 0.000000 remaining: 0.637351 bound: 1.218781  
 > [0.000000]: [surf_maxmin/DEBUG] index: 67     cnst_light_num: 72      || usage: 0.000000 remaining: 8.292394 bound: 8.981019  
-> [0.000000]: [surf_maxmin/DEBUG] var=443, var.bound=-1.000000, var.weight=1.000000, min_usage=0.248078, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=460, var.bound=-1.000000, var.weight=1.000000, min_usage=0.248078, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=470, var.bound=-1.000000, var.weight=1.000000, min_usage=0.248078, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=443, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.248078, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=460, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.248078, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=470, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.248078, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (443) value to 0.248078
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.248078, Var(443).weight: 1.000000, Var(443).value: 0.248078 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.248078, Var(443).penalty: 1.000000, Var(443).value: 0.248078 
 > [0.000000]: [surf_maxmin/DEBUG] index: 46     cnst_light_num: 71      || usage: 0.000000 remaining: 4.903913 bound: 6.603397  
 > [0.000000]: [surf_maxmin/DEBUG] index: 56     cnst_light_num: 70      || usage: 0.000000 remaining: 5.661916 bound: 6.923077  
 > [0.000000]: [surf_maxmin/DEBUG] index: 10     cnst_light_num: 69      || usage: 0.000000 remaining: 6.671691 bound: 7.712288  
@@ -2594,7 +2594,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 59     cnst_light_num: 65      || usage: 0.000000 remaining: 6.079014 bound: 7.212787  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (460) value to 0.248078
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.248078, Var(460).weight: 1.000000, Var(460).value: 0.248078 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.248078, Var(460).penalty: 1.000000, Var(460).value: 0.248078 
 > [0.000000]: [surf_maxmin/DEBUG] index: 19     cnst_light_num: 64      || usage: 0.000000 remaining: 1.852859 bound: 2.937063  
 > [0.000000]: [surf_maxmin/DEBUG] index: 6      cnst_light_num: 63      || usage: 0.000000 remaining: 1.517831 bound: 2.447552  
 > [0.000000]: [surf_maxmin/DEBUG] index: 51     cnst_light_num: 62      || usage: 0.000000 remaining: 2.711337 bound: 4.165834  
@@ -2607,7 +2607,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 21     cnst_light_num: 55      || usage: 0.000000 remaining: 3.908501 bound: 5.144855  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (470) value to 0.248078
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.248078, Var(470).weight: 1.000000, Var(470).value: 0.248078 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.248078, Var(470).penalty: 1.000000, Var(470).value: 0.248078 
 > [0.000000]: [surf_maxmin/DEBUG] index: 10     cnst_light_num: 54      || usage: 0.000000 remaining: 9.086266 bound: 9.800200  
 > [0.000000]: [surf_maxmin/DEBUG] index: 25     cnst_light_num: 53      || usage: 0.000000 remaining: 4.317833 bound: 5.174825  
 > [0.000000]: [surf_maxmin/DEBUG] index: 47     cnst_light_num: 52      || usage: 0.000000 remaining: 0.574793 bound: 2.097902  
@@ -2619,10 +2619,10 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 31     cnst_light_num: 46      || usage: 0.000000 remaining: 6.113568 bound: 6.903097  
 > [0.000000]: [surf_maxmin/DEBUG] index: 40     cnst_light_num: 45      || usage: 0.000000 remaining: 0.000000 bound: 1.958042  
 > [0.000000]: [surf_maxmin/DEBUG] index: 29     cnst_light_num: 44      || usage: 0.000000 remaining: 2.366551 bound: 3.756244  
-> [0.000000]: [surf_maxmin/DEBUG] var=499, var.bound=-1.000000, var.weight=1.000000, min_usage=0.371099, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=499, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.371099, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (499) value to 0.371099
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.371099, Var(499).weight: 1.000000, Var(499).value: 0.371099 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.371099, Var(499).penalty: 1.000000, Var(499).value: 0.371099 
 > [0.000000]: [surf_maxmin/DEBUG] index: 38     cnst_light_num: 43      || usage: 0.000000 remaining: 4.195116 bound: 5.504496  
 > [0.000000]: [surf_maxmin/DEBUG] index: 2      cnst_light_num: 42      || usage: 0.000000 remaining: 3.396551 bound: 4.695305  
 > [0.000000]: [surf_maxmin/DEBUG] index: 18     cnst_light_num: 41      || usage: 0.000000 remaining: 4.348232 bound: 5.834166  
@@ -2644,10 +2644,10 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench medium 5 test
 > [0.000000]: [surf_maxmin/DEBUG] index: 18     cnst_light_num: 25      || usage: 0.000000 remaining: 0.897299 bound: 1.988012  
 > [0.000000]: [surf_maxmin/DEBUG] index: 9      cnst_light_num: 24      || usage: 0.000000 remaining: 0.066581 bound: 1.008991  
 > [0.000000]: [surf_maxmin/DEBUG] index: 9      cnst_light_num: 23      || usage: 0.000000 remaining: 3.392560 bound: 4.405594  
-> [0.000000]: [surf_maxmin/DEBUG] var=411, var.bound=-1.000000, var.weight=1.000000, min_usage=1.157925, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=411, var.bound=-1.000000, var.penalty=1.000000, min_usage=1.157925, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (411) value to 1.157925
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.157925, Var(411).weight: 1.000000, Var(411).value: 1.157925 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.157925, Var(411).penalty: 1.000000, Var(411).value: 1.157925 
 > [0.000000]: [surf_maxmin/DEBUG] index: 9      cnst_light_num: 22      || usage: 0.000000 remaining: 4.884981 bound: 7.072927  
 > [0.000000]: [surf_maxmin/DEBUG] index: 19     cnst_light_num: 21      || usage: 0.000000 remaining: 2.075096 bound: 4.745255  
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 20      || usage: 0.000000 remaining: 3.819295 bound: 5.634366  
index 40449aa..ceb76df 100644 (file)
@@ -3,7 +3,7 @@
 ! timeout 10
 ! expect return 0
 ! output sort
-$ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench small  10 test
+$ ${bindir:=.}/maxmin_bench small  10 test
 > [0.000000]: [surf_maxmin/DEBUG] Setting selective_update_active flag to 0
 > [0.000000]: [surf_maxmin/DEBUG] Active constraints : 10
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '9' usage: 4.703796 remaining: 7.082917 concurrency: 2<=2<=-1
@@ -16,36 +16,36 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench small  10 test
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '4' usage: 1.014486 remaining: 7.082917 concurrency: 1<=1<=3
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '8' usage: 2.985015 remaining: 3.026973 concurrency: 1<=1<=-1
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '3' usage: 2.495005 remaining: 5.434565 concurrency: 1<=1<=4
-> [0.000000]: [surf_maxmin/DEBUG] var=9, var.bound=-1.000000, var.weight=1.000000, min_usage=1.014056, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=9, var.bound=-1.000000, var.penalty=1.000000, min_usage=1.014056, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (9) value to 1.014056
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.014056, Var(9).weight: 1.000000, Var(9).value: 1.014056 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.014056, Var(9).penalty: 1.000000, Var(9).value: 1.014056 
 > [0.000000]: [surf_maxmin/DEBUG] index: 8      cnst_light_num: 10      || usage: 0.000000 remaining: 0.000000 bound: 3.026973  
-> [0.000000]: [surf_maxmin/DEBUG] var=2, var.bound=-1.000000, var.weight=1.000000, min_usage=1.024059, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=10, var.bound=-1.000000, var.weight=1.000000, min_usage=1.024059, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=2, var.bound=-1.000000, var.penalty=1.000000, min_usage=1.024059, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=10, var.bound=-1.000000, var.penalty=1.000000, min_usage=1.024059, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (2) value to 1.024059
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.024059, Var(2).weight: 1.000000, Var(2).value: 1.024059 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.024059, Var(2).penalty: 1.000000, Var(2).value: 1.024059 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (10) value to 1.024059
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.024059, Var(10).weight: 1.000000, Var(10).value: 1.024059 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.024059, Var(10).penalty: 1.000000, Var(10).value: 1.024059 
 > [0.000000]: [surf_maxmin/DEBUG] index: 5      cnst_light_num: 9       || usage: 0.000000 remaining: 0.000000 bound: 2.487512  
 > [0.000000]: [surf_maxmin/DEBUG] index: 7      cnst_light_num: 8       || usage: 0.000000 remaining: 6.044024 bound: 7.082917  
 > [0.000000]: [surf_maxmin/DEBUG] index: 5      cnst_light_num: 7       || usage: 0.000000 remaining: 2.879533 bound: 5.434565  
-> [0.000000]: [surf_maxmin/DEBUG] var=1, var.bound=-1.000000, var.weight=1.000000, min_usage=1.338213, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=4, var.bound=-1.000000, var.weight=1.000000, min_usage=1.338213, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=1, var.bound=-1.000000, var.penalty=1.000000, min_usage=1.338213, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=4, var.bound=-1.000000, var.penalty=1.000000, min_usage=1.338213, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (1) value to 1.338213
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.338213, Var(1).weight: 1.000000, Var(1).value: 1.338213 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.338213, Var(1).penalty: 1.000000, Var(1).value: 1.338213 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (4) value to 1.338213
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.338213, Var(4).weight: 1.000000, Var(4).value: 1.338213 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.338213, Var(4).penalty: 1.000000, Var(4).value: 1.338213 
 > [0.000000]: [surf_maxmin/DEBUG] index: 3      cnst_light_num: 6       || usage: 0.000000 remaining: 0.000000 bound: 5.594406  
 > [0.000000]: [surf_maxmin/DEBUG] index: 3      cnst_light_num: 5       || usage: 0.000000 remaining: 1.623266 bound: 6.573427  
-> [0.000000]: [surf_maxmin/DEBUG] var=3, var.bound=-1.000000, var.weight=1.000000, min_usage=1.625653, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=3, var.bound=-1.000000, var.penalty=1.000000, min_usage=1.625653, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (3) value to 1.625653
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.625653, Var(3).weight: 1.000000, Var(3).value: 1.625653 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.625653, Var(3).penalty: 1.000000, Var(3).value: 1.625653 
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 4       || usage: 0.000000 remaining: 1.548031 bound: 9.860140  
 > [0.000000]: [surf_maxmin/DEBUG] index: 2      cnst_light_num: 3       || usage: 0.000000 remaining: 0.581095 bound: 7.282717  
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 2       || usage: 0.000000 remaining: 0.000000 bound: 7.082917  
@@ -85,44 +85,44 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench small  10 test
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '11' usage: 4.858142 remaining: 4.975025 concurrency: 3<=3<=3
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '13' usage: 5.908591 remaining: 1.088911 concurrency: 3<=3<=-1
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '14' usage: 1.957043 remaining: 7.702298 concurrency: 1<=1<=4
-> [0.000000]: [surf_maxmin/DEBUG] var=14, var.bound=-1.000000, var.weight=1.000000, min_usage=0.184293, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=15, var.bound=-1.000000, var.weight=1.000000, min_usage=0.184293, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=17, var.bound=-1.000000, var.weight=1.000000, min_usage=0.184293, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=14, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.184293, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=15, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.184293, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=17, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.184293, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (14) value to 0.184293
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.184293, Var(14).weight: 1.000000, Var(14).value: 0.184293 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.184293, Var(14).penalty: 1.000000, Var(14).value: 0.184293 
 > [0.000000]: [surf_maxmin/DEBUG] index: 9      cnst_light_num: 10      || usage: 0.000000 remaining: 7.341629 bound: 7.702298  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (15) value to 0.184293
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.184293, Var(15).weight: 1.000000, Var(15).value: 0.184293 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.184293, Var(15).penalty: 1.000000, Var(15).value: 0.184293 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (17) value to 0.184293
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.184293, Var(17).weight: 1.000000, Var(17).value: 0.184293 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.184293, Var(17).penalty: 1.000000, Var(17).value: 0.184293 
 > [0.000000]: [surf_maxmin/DEBUG] index: 8      cnst_light_num: 9       || usage: 0.000000 remaining: 0.000000 bound: 1.088911  
-> [0.000000]: [surf_maxmin/DEBUG] var=11, var.bound=-1.000000, var.weight=1.000000, min_usage=0.316463, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=12, var.bound=-1.000000, var.weight=1.000000, min_usage=0.316463, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=13, var.bound=-1.000000, var.weight=1.000000, min_usage=0.316463, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=19, var.bound=-1.000000, var.weight=1.000000, min_usage=0.316463, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=11, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.316463, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=12, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.316463, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=13, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.316463, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=19, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.316463, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (11) value to 0.316463
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.316463, Var(11).weight: 1.000000, Var(11).value: 0.316463 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.316463, Var(11).penalty: 1.000000, Var(11).value: 0.316463 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (12) value to 0.316463
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.316463, Var(12).weight: 1.000000, Var(12).value: 0.316463 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.316463, Var(12).penalty: 1.000000, Var(12).value: 0.316463 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (13) value to 0.316463
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.316463, Var(13).weight: 1.000000, Var(13).value: 0.316463 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.316463, Var(13).penalty: 1.000000, Var(13).value: 0.316463 
 > [0.000000]: [surf_maxmin/DEBUG] index: 4      cnst_light_num: 8       || usage: 0.000000 remaining: 5.345264 bound: 6.663337  
 > [0.000000]: [surf_maxmin/DEBUG] index: 6      cnst_light_num: 7       || usage: 0.000000 remaining: 2.183786 bound: 3.366633  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (19) value to 0.316463
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.316463, Var(19).weight: 1.000000, Var(19).value: 0.316463 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.316463, Var(19).penalty: 1.000000, Var(19).value: 0.316463 
 > [0.000000]: [surf_maxmin/DEBUG] index: 5      cnst_light_num: 6       || usage: 0.000000 remaining: 4.337989 bound: 6.053946  
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 5       || usage: 0.000000 remaining: 0.000000 bound: 1.978022  
-> [0.000000]: [surf_maxmin/DEBUG] var=18, var.bound=-1.000000, var.weight=1.000000, min_usage=1.961597, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=18, var.bound=-1.000000, var.penalty=1.000000, min_usage=1.961597, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (18) value to 1.961597
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.961597, Var(18).weight: 1.000000, Var(18).value: 1.961597 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.961597, Var(18).penalty: 1.000000, Var(18).value: 1.961597 
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 4       || usage: 0.000000 remaining: 0.987622 bound: 4.975025  
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 3       || usage: 0.000000 remaining: 0.000000 bound: 2.127872  
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 2       || usage: 0.000000 remaining: 0.826438 bound: 4.575425  
@@ -162,36 +162,36 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench small  10 test
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '30' usage: 3.939560 remaining: 2.967033 concurrency: 2<=2<=-1
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '27' usage: 3.490010 remaining: 8.721279 concurrency: 1<=1<=3
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '21' usage: 3.869131 remaining: 7.462537 concurrency: 2<=2<=3
-> [0.000000]: [surf_maxmin/DEBUG] var=21, var.bound=-1.000000, var.weight=1.000000, min_usage=0.258940, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=23, var.bound=-1.000000, var.weight=1.000000, min_usage=0.258940, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=28, var.bound=-1.000000, var.weight=1.000000, min_usage=0.258940, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=21, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.258940, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=23, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.258940, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=28, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.258940, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (21) value to 0.258940
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.258940, Var(21).weight: 1.000000, Var(21).value: 0.258940 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.258940, Var(21).penalty: 1.000000, Var(21).value: 0.258940 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (23) value to 0.258940
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.258940, Var(23).weight: 1.000000, Var(23).value: 0.258940 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.258940, Var(23).penalty: 1.000000, Var(23).value: 0.258940 
 > [0.000000]: [surf_maxmin/DEBUG] index: 6      cnst_light_num: 10      || usage: 0.000000 remaining: 0.713448 bound: 1.428571  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (28) value to 0.258940
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.258940, Var(28).weight: 1.000000, Var(28).value: 0.258940 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.258940, Var(28).penalty: 1.000000, Var(28).value: 0.258940 
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 9       || usage: 0.000000 remaining: 1.451551 bound: 2.127872  
 > [0.000000]: [surf_maxmin/DEBUG] index: 3      cnst_light_num: 8       || usage: 0.000000 remaining: 0.000000 bound: 1.258741  
-> [0.000000]: [surf_maxmin/DEBUG] var=22, var.bound=-1.000000, var.weight=1.000000, min_usage=0.493696, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=24, var.bound=-1.000000, var.weight=1.000000, min_usage=0.493696, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=25, var.bound=-1.000000, var.weight=1.000000, min_usage=0.493696, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=22, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.493696, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=24, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.493696, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=25, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.493696, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (22) value to 0.493696
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.493696, Var(22).weight: 1.000000, Var(22).value: 0.493696 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.493696, Var(22).penalty: 1.000000, Var(22).value: 0.493696 
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 7       || usage: 0.000000 remaining: 5.661363 bound: 6.863137  
 > [0.000000]: [surf_maxmin/DEBUG] index: 2      cnst_light_num: 6       || usage: 0.000000 remaining: 1.851017 bound: 3.856144  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (24) value to 0.493696
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.493696, Var(24).weight: 1.000000, Var(24).value: 0.493696 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.493696, Var(24).penalty: 1.000000, Var(24).value: 0.493696 
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 5       || usage: 0.000000 remaining: 7.221658 bound: 8.721279  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (25) value to 0.493696
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.493696, Var(25).weight: 1.000000, Var(25).value: 0.493696 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.493696, Var(25).penalty: 1.000000, Var(25).value: 0.493696 
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 4       || usage: 0.000000 remaining: 0.000000 bound: 3.396603  
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 3       || usage: 0.000000 remaining: 1.022089 bound: 2.967033  
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 2       || usage: 0.000000 remaining: 6.051192 bound: 7.462537  
@@ -231,44 +231,44 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench small  10 test
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '38' usage: 3.966533 remaining: 4.475524 concurrency: 2<=2<=3
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '36' usage: 4.104396 remaining: 1.678322 concurrency: 3<=3<=4
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '37' usage: 0.000000 remaining: 0.139860 concurrency: 0<=1<=4
-> [0.000000]: [surf_maxmin/DEBUG] var=36, var.bound=-1.000000, var.weight=1.000000, min_usage=0.408908, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=38, var.bound=-1.000000, var.weight=1.000000, min_usage=0.408908, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=39, var.bound=-1.000000, var.weight=1.000000, min_usage=0.408908, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=36, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.408908, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=38, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.408908, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=39, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.408908, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (36) value to 0.408908
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.408908, Var(36).weight: 1.000000, Var(36).value: 0.408908 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.408908, Var(36).penalty: 1.000000, Var(36).value: 0.408908 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (38) value to 0.408908
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.408908, Var(38).weight: 1.000000, Var(38).value: 0.408908 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.408908, Var(38).penalty: 1.000000, Var(38).value: 0.408908 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (39) value to 0.408908
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.408908, Var(39).weight: 1.000000, Var(39).value: 0.408908 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.408908, Var(39).penalty: 1.000000, Var(39).value: 0.408908 
 > [0.000000]: [surf_maxmin/DEBUG] index: 8      cnst_light_num: 9       || usage: 0.000000 remaining: 0.000000 bound: 1.678322  
-> [0.000000]: [surf_maxmin/DEBUG] var=32, var.bound=-1.000000, var.weight=1.000000, min_usage=0.565462, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=33, var.bound=-1.000000, var.weight=1.000000, min_usage=0.565462, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=32, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.565462, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=33, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.565462, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (32) value to 0.565462
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.565462, Var(32).weight: 1.000000, Var(32).value: 0.565462 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.565462, Var(32).penalty: 1.000000, Var(32).value: 0.565462 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (33) value to 0.565462
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.565462, Var(33).weight: 1.000000, Var(33).value: 0.565462 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.565462, Var(33).penalty: 1.000000, Var(33).value: 0.565462 
 > [0.000000]: [surf_maxmin/DEBUG] index: 5      cnst_light_num: 8       || usage: 0.000000 remaining: 0.541481 bound: 4.375624  
 > [0.000000]: [surf_maxmin/DEBUG] index: 4      cnst_light_num: 7       || usage: 0.000000 remaining: 0.000000 bound: 1.758242  
-> [0.000000]: [surf_maxmin/DEBUG] var=31, var.bound=-1.000000, var.weight=1.000000, min_usage=0.757364, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=40, var.bound=-1.000000, var.weight=1.000000, min_usage=0.757364, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=31, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.757364, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=40, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.757364, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (31) value to 0.757364
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.757364, Var(31).weight: 1.000000, Var(31).value: 0.757364 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.757364, Var(31).penalty: 1.000000, Var(31).value: 0.757364 
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 6       || usage: 0.000000 remaining: 9.030772 bound: 9.950050  
 > [0.000000]: [surf_maxmin/DEBUG] index: 2      cnst_light_num: 5       || usage: 0.000000 remaining: 3.662606 bound: 5.414585  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (40) value to 0.757364
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.757364, Var(40).weight: 1.000000, Var(40).value: 0.757364 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.757364, Var(40).penalty: 1.000000, Var(40).value: 0.757364 
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 4       || usage: 0.000000 remaining: 0.000000 bound: 3.656344  
-> [0.000000]: [surf_maxmin/DEBUG] var=35, var.bound=-1.000000, var.weight=1.000000, min_usage=1.232357, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=35, var.bound=-1.000000, var.penalty=1.000000, min_usage=1.232357, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (35) value to 1.232357
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.232357, Var(35).weight: 1.000000, Var(35).value: 1.232357 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.232357, Var(35).penalty: 1.000000, Var(35).value: 1.232357 
 > [0.000000]: [surf_maxmin/DEBUG] index: 2      cnst_light_num: 3       || usage: 0.000000 remaining: 0.095809 bound: 4.255744  
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 2       || usage: 0.000000 remaining: 0.000000 bound: 8.941059  
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 1       || usage: 0.000000 remaining: 0.886438 bound: 4.475524  
@@ -307,40 +307,40 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench small  10 test
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '50' usage: 5.187812 remaining: 4.485514 concurrency: 2<=2<=4
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '46' usage: 3.005994 remaining: 6.933067 concurrency: 1<=2<=4
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '43' usage: 1.075924 remaining: 4.485514 concurrency: 1<=1<=4
-> [0.000000]: [surf_maxmin/DEBUG] var=42, var.bound=-1.000000, var.weight=1.000000, min_usage=0.182815, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=46, var.bound=-1.000000, var.weight=1.000000, min_usage=0.182815, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=50, var.bound=-1.000000, var.weight=1.000000, min_usage=0.182815, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=42, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.182815, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=46, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.182815, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=50, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.182815, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (42) value to 0.182815
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.182815, Var(42).weight: 1.000000, Var(42).value: 0.182815 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.182815, Var(42).penalty: 1.000000, Var(42).value: 0.182815 
 > [0.000000]: [surf_maxmin/DEBUG] index: 3      cnst_light_num: 10      || usage: 0.000000 remaining: 5.372434 bound: 5.524476  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (46) value to 0.182815
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.182815, Var(46).weight: 1.000000, Var(46).value: 0.182815 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.182815, Var(46).penalty: 1.000000, Var(46).value: 0.182815 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (50) value to 0.182815
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.182815, Var(50).weight: 1.000000, Var(50).value: 0.182815 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.182815, Var(50).penalty: 1.000000, Var(50).value: 0.182815 
 > [0.000000]: [surf_maxmin/DEBUG] index: 5      cnst_light_num: 9       || usage: 0.000000 remaining: 0.000000 bound: 0.599401  
-> [0.000000]: [surf_maxmin/DEBUG] var=41, var.bound=-1.000000, var.weight=1.000000, min_usage=0.380694, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=44, var.bound=-1.000000, var.weight=1.000000, min_usage=0.380694, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=47, var.bound=-1.000000, var.weight=1.000000, min_usage=0.380694, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=41, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.380694, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=44, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.380694, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=47, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.380694, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (41) value to 0.380694
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.380694, Var(41).weight: 1.000000, Var(41).value: 0.380694 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.380694, Var(41).penalty: 1.000000, Var(41).value: 0.380694 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (44) value to 0.380694
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.380694, Var(44).weight: 1.000000, Var(44).value: 0.380694 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.380694, Var(44).penalty: 1.000000, Var(44).value: 0.380694 
 > [0.000000]: [surf_maxmin/DEBUG] index: 2      cnst_light_num: 8       || usage: 0.000000 remaining: 0.977541 bound: 2.507493  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (47) value to 0.380694
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.380694, Var(47).weight: 1.000000, Var(47).value: 0.380694 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.380694, Var(47).penalty: 1.000000, Var(47).value: 0.380694 
 > [0.000000]: [surf_maxmin/DEBUG] index: 3      cnst_light_num: 7       || usage: 0.000000 remaining: 4.075916 bound: 4.485514  
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 6       || usage: 0.000000 remaining: 1.304610 bound: 2.117882  
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 5       || usage: 0.000000 remaining: 0.000000 bound: 3.556444  
-> [0.000000]: [surf_maxmin/DEBUG] var=43, var.bound=-1.000000, var.weight=1.000000, min_usage=1.071335, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=43, var.bound=-1.000000, var.penalty=1.000000, min_usage=1.071335, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (43) value to 1.071335
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.071335, Var(43).weight: 1.000000, Var(43).value: 1.071335 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.071335, Var(43).penalty: 1.000000, Var(43).value: 1.071335 
 > [0.000000]: [surf_maxmin/DEBUG] index: 3      cnst_light_num: 4       || usage: 0.000000 remaining: 1.585454 bound: 2.447552  
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 3       || usage: 0.000000 remaining: 0.000000 bound: 2.097902  
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 2       || usage: 0.000000 remaining: 2.853240 bound: 4.485514  
@@ -380,44 +380,44 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench small  10 test
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '52' usage: 5.824675 remaining: 6.383616 concurrency: 3<=3<=3
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '56' usage: 2.324176 remaining: 0.769231 concurrency: 2<=2<=3
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '51' usage: 1.348651 remaining: 4.935065 concurrency: 1<=1<=4
-> [0.000000]: [surf_maxmin/DEBUG] var=52, var.bound=-1.000000, var.weight=1.000000, min_usage=0.194386, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=53, var.bound=-1.000000, var.weight=1.000000, min_usage=0.194386, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=56, var.bound=-1.000000, var.weight=1.000000, min_usage=0.194386, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=57, var.bound=-1.000000, var.weight=1.000000, min_usage=0.194386, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=59, var.bound=-1.000000, var.weight=1.000000, min_usage=0.194386, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=52, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.194386, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=53, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.194386, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=56, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.194386, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=57, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.194386, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=59, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.194386, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (52) value to 0.194386
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.194386, Var(52).weight: 1.000000, Var(52).value: 0.194386 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.194386, Var(52).penalty: 1.000000, Var(52).value: 0.194386 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (53) value to 0.194386
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.194386, Var(53).weight: 1.000000, Var(53).value: 0.194386 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.194386, Var(53).penalty: 1.000000, Var(53).value: 0.194386 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (56) value to 0.194386
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.194386, Var(56).weight: 1.000000, Var(56).value: 0.194386 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.194386, Var(56).penalty: 1.000000, Var(56).value: 0.194386 
 > [0.000000]: [surf_maxmin/DEBUG] index: 9      cnst_light_num: 10      || usage: 0.000000 remaining: 4.672906 bound: 4.935065  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (57) value to 0.194386
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.194386, Var(57).weight: 1.000000, Var(57).value: 0.194386 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.194386, Var(57).penalty: 1.000000, Var(57).value: 0.194386 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (59) value to 0.194386
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.194386, Var(59).weight: 1.000000, Var(59).value: 0.194386 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.194386, Var(59).penalty: 1.000000, Var(59).value: 0.194386 
 > [0.000000]: [surf_maxmin/DEBUG] index: 5      cnst_light_num: 9       || usage: 0.000000 remaining: 0.000000 bound: 1.248751  
-> [0.000000]: [surf_maxmin/DEBUG] var=54, var.bound=-1.000000, var.weight=1.000000, min_usage=0.330969, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=54, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.330969, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (54) value to 0.330969
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.330969, Var(54).weight: 1.000000, Var(54).value: 0.330969 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.330969, Var(54).penalty: 1.000000, Var(54).value: 0.330969 
 > [0.000000]: [surf_maxmin/DEBUG] index: 7      cnst_light_num: 8       || usage: 0.000000 remaining: 5.027881 bound: 6.383616  
 > [0.000000]: [surf_maxmin/DEBUG] index: 6      cnst_light_num: 7       || usage: 0.000000 remaining: 6.410722 bound: 7.262737  
 > [0.000000]: [surf_maxmin/DEBUG] index: 5      cnst_light_num: 6       || usage: 0.000000 remaining: 0.000000 bound: 0.769231  
-> [0.000000]: [surf_maxmin/DEBUG] var=51, var.bound=-1.000000, var.weight=1.000000, min_usage=1.219766, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=58, var.bound=-1.000000, var.weight=1.000000, min_usage=1.219766, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=51, var.bound=-1.000000, var.penalty=1.000000, min_usage=1.219766, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=58, var.bound=-1.000000, var.penalty=1.000000, min_usage=1.219766, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (51) value to 1.219766
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.219766, Var(51).weight: 1.000000, Var(51).value: 1.219766 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.219766, Var(51).penalty: 1.000000, Var(51).value: 1.219766 
 > [0.000000]: [surf_maxmin/DEBUG] index: 3      cnst_light_num: 5       || usage: 0.000000 remaining: 1.051250 bound: 4.255744  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (58) value to 1.219766
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.219766, Var(58).weight: 1.000000, Var(58).value: 1.219766 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.219766, Var(58).penalty: 1.000000, Var(58).value: 1.219766 
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 4       || usage: 0.000000 remaining: 2.727287 bound: 6.793207  
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 3       || usage: 0.000000 remaining: 0.000000 bound: 3.456543  
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 2       || usage: 0.000000 remaining: 1.596251 bound: 3.636364  
@@ -457,35 +457,35 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench small  10 test
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '63' usage: 3.103397 remaining: 5.574426 concurrency: 2<=2<=3
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '70' usage: 1.173327 remaining: 3.576424 concurrency: 1<=2<=4
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '67' usage: 0.000000 remaining: 5.854146 concurrency: 0<=0<=4
-> [0.000000]: [surf_maxmin/DEBUG] var=61, var.bound=-1.000000, var.weight=1.000000, min_usage=0.596470, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=64, var.bound=-1.000000, var.weight=1.000000, min_usage=0.596470, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=61, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.596470, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=64, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.596470, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (61) value to 0.596470
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.596470, Var(61).weight: 1.000000, Var(61).value: 0.596470 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.596470, Var(61).penalty: 1.000000, Var(61).value: 0.596470 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (64) value to 0.596470
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.596470, Var(64).weight: 1.000000, Var(64).value: 0.596470 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.596470, Var(64).penalty: 1.000000, Var(64).value: 0.596470 
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 9       || usage: 0.000000 remaining: 0.000000 bound: 2.937063  
-> [0.000000]: [surf_maxmin/DEBUG] var=62, var.bound=-1.000000, var.weight=1.000000, min_usage=0.840184, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=66, var.bound=-1.000000, var.weight=1.000000, min_usage=0.840184, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=67, var.bound=-1.000000, var.weight=1.000000, min_usage=0.840184, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=62, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.840184, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=66, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.840184, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=67, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.840184, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (62) value to 0.840184
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.840184, Var(62).weight: 1.000000, Var(62).value: 0.840184 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.840184, Var(62).penalty: 1.000000, Var(62).value: 0.840184 
 > [0.000000]: [surf_maxmin/DEBUG] index: 5      cnst_light_num: 8       || usage: 0.000000 remaining: 5.699228 bound: 7.852148  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (66) value to 0.840184
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.840184, Var(66).weight: 1.000000, Var(66).value: 0.840184 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.840184, Var(66).penalty: 1.000000, Var(66).value: 0.840184 
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 7       || usage: 0.000000 remaining: 2.590613 bound: 3.576424  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (67) value to 0.840184
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.840184, Var(67).weight: 1.000000, Var(67).value: 0.840184 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.840184, Var(67).penalty: 1.000000, Var(67).value: 0.840184 
 > [0.000000]: [surf_maxmin/DEBUG] index: 5      cnst_light_num: 6       || usage: 0.000000 remaining: 3.285095 bound: 5.574426  
 > [0.000000]: [surf_maxmin/DEBUG] index: 3      cnst_light_num: 5       || usage: 0.000000 remaining: 0.000000 bound: 5.684316  
-> [0.000000]: [surf_maxmin/DEBUG] var=63, var.bound=-1.000000, var.weight=1.000000, min_usage=1.205488, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=63, var.bound=-1.000000, var.penalty=1.000000, min_usage=1.205488, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (63) value to 1.205488
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.205488, Var(63).weight: 1.000000, Var(63).value: 1.205488 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.205488, Var(63).penalty: 1.000000, Var(63).value: 1.205488 
 > [0.000000]: [surf_maxmin/DEBUG] index: 2      cnst_light_num: 4       || usage: 0.000000 remaining: 3.912988 bound: 6.843157  
 > [0.000000]: [surf_maxmin/DEBUG] index: 2      cnst_light_num: 3       || usage: 0.000000 remaining: 0.000000 bound: 5.944056  
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 2       || usage: 0.000000 remaining: 5.529444 bound: 7.422577  
@@ -525,44 +525,44 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench small  10 test
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '80' usage: 3.623377 remaining: 7.912088 concurrency: 3<=3<=4
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '75' usage: 4.765235 remaining: 0.539461 concurrency: 3<=3<=4
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '74' usage: 1.476024 remaining: 1.428571 concurrency: 1<=1<=4
-> [0.000000]: [surf_maxmin/DEBUG] var=74, var.bound=-1.000000, var.weight=1.000000, min_usage=0.113208, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=75, var.bound=-1.000000, var.weight=1.000000, min_usage=0.113208, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=76, var.bound=-1.000000, var.weight=1.000000, min_usage=0.113208, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=77, var.bound=-1.000000, var.weight=1.000000, min_usage=0.113208, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=74, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.113208, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=75, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.113208, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=76, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.113208, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=77, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.113208, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (74) value to 0.113208
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.113208, Var(74).weight: 1.000000, Var(74).value: 0.113208 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.113208, Var(74).penalty: 1.000000, Var(74).value: 0.113208 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (75) value to 0.113208
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.113208, Var(75).weight: 1.000000, Var(75).value: 0.113208 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.113208, Var(75).penalty: 1.000000, Var(75).value: 0.113208 
 > [0.000000]: [surf_maxmin/DEBUG] index: 6      cnst_light_num: 10      || usage: 0.000000 remaining: 0.783405 bound: 1.168831  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (76) value to 0.113208
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.113208, Var(76).weight: 1.000000, Var(76).value: 0.113208 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.113208, Var(76).penalty: 1.000000, Var(76).value: 0.113208 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (77) value to 0.113208
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.113208, Var(77).weight: 1.000000, Var(77).value: 0.113208 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.113208, Var(77).penalty: 1.000000, Var(77).value: 0.113208 
 > [0.000000]: [surf_maxmin/DEBUG] index: 6      cnst_light_num: 9       || usage: 0.000000 remaining: 1.261474 bound: 1.428571  
 > [0.000000]: [surf_maxmin/DEBUG] index: 6      cnst_light_num: 8       || usage: 0.000000 remaining: 0.000000 bound: 0.539461  
-> [0.000000]: [surf_maxmin/DEBUG] var=71, var.bound=-1.000000, var.weight=1.000000, min_usage=0.854701, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=73, var.bound=-1.000000, var.weight=1.000000, min_usage=0.854701, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=71, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.854701, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=73, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.854701, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (71) value to 0.854701
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.854701, Var(71).weight: 1.000000, Var(71).value: 0.854701 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.854701, Var(71).penalty: 1.000000, Var(71).value: 0.854701 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (73) value to 0.854701
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.854701, Var(73).weight: 1.000000, Var(73).value: 0.854701 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.854701, Var(73).penalty: 1.000000, Var(73).value: 0.854701 
 > [0.000000]: [surf_maxmin/DEBUG] index: 3      cnst_light_num: 7       || usage: 0.000000 remaining: 0.000000 bound: 3.446553  
 > [0.000000]: [surf_maxmin/DEBUG] index: 2      cnst_light_num: 6       || usage: 0.000000 remaining: 2.798086 bound: 4.355644  
-> [0.000000]: [surf_maxmin/DEBUG] var=72, var.bound=-1.000000, var.weight=1.000000, min_usage=1.655984, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=80, var.bound=-1.000000, var.weight=1.000000, min_usage=1.655984, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=72, var.bound=-1.000000, var.penalty=1.000000, min_usage=1.655984, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=80, var.bound=-1.000000, var.penalty=1.000000, min_usage=1.655984, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (72) value to 1.655984
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.655984, Var(72).weight: 1.000000, Var(72).value: 1.655984 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.655984, Var(72).penalty: 1.000000, Var(72).value: 1.655984 
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 5       || usage: 0.000000 remaining: 3.146068 bound: 7.882118  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (80) value to 1.655984
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.655984, Var(80).weight: 1.000000, Var(80).value: 1.655984 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.655984, Var(80).penalty: 1.000000, Var(80).value: 1.655984 
 > [0.000000]: [surf_maxmin/DEBUG] index: 2      cnst_light_num: 4       || usage: 0.000000 remaining: 3.590351 bound: 7.262737  
 > [0.000000]: [surf_maxmin/DEBUG] index: 2      cnst_light_num: 3       || usage: 0.000000 remaining: 5.451282 bound: 7.912088  
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 2       || usage: 0.000000 remaining: 0.000000 bound: 7.782218  
@@ -602,40 +602,40 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench small  10 test
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '82' usage: 3.173826 remaining: 7.812188 concurrency: 2<=2<=4
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '87' usage: 2.877123 remaining: 5.074925 concurrency: 1<=2<=4
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '83' usage: 1.522478 remaining: 0.199800 concurrency: 1<=1<=3
-> [0.000000]: [surf_maxmin/DEBUG] var=83, var.bound=-1.000000, var.weight=1.000000, min_usage=0.036726, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=85, var.bound=-1.000000, var.weight=1.000000, min_usage=0.036726, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=89, var.bound=-1.000000, var.weight=1.000000, min_usage=0.036726, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=83, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.036726, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=85, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.036726, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=89, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.036726, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (83) value to 0.036726
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.036726, Var(83).weight: 1.000000, Var(83).value: 0.036726 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.036726, Var(83).penalty: 1.000000, Var(83).value: 0.036726 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (85) value to 0.036726
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.036726, Var(85).weight: 1.000000, Var(85).value: 0.036726 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.036726, Var(85).penalty: 1.000000, Var(85).value: 0.036726 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (89) value to 0.036726
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.036726, Var(89).weight: 1.000000, Var(89).value: 0.036726 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.036726, Var(89).penalty: 1.000000, Var(89).value: 0.036726 
 > [0.000000]: [surf_maxmin/DEBUG] index: 5      cnst_light_num: 10      || usage: 0.000000 remaining: 0.000000 bound: 0.189810  
 > [0.000000]: [surf_maxmin/DEBUG] index: 5      cnst_light_num: 9       || usage: 0.000000 remaining: 0.143886 bound: 0.199800  
-> [0.000000]: [surf_maxmin/DEBUG] var=81, var.bound=-1.000000, var.weight=1.000000, min_usage=0.133180, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=82, var.bound=-1.000000, var.weight=1.000000, min_usage=0.133180, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=84, var.bound=-1.000000, var.weight=1.000000, min_usage=0.133180, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=81, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.133180, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=82, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.133180, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=84, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.133180, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (81) value to 0.133180
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.133180, Var(81).weight: 1.000000, Var(81).value: 0.133180 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.133180, Var(81).penalty: 1.000000, Var(81).value: 0.133180 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (82) value to 0.133180
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.133180, Var(82).weight: 1.000000, Var(82).value: 0.133180 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.133180, Var(82).penalty: 1.000000, Var(82).value: 0.133180 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (84) value to 0.133180
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.133180, Var(84).weight: 1.000000, Var(84).value: 0.133180 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.133180, Var(84).penalty: 1.000000, Var(84).value: 0.133180 
 > [0.000000]: [surf_maxmin/DEBUG] index: 7      cnst_light_num: 8       || usage: 0.000000 remaining: 7.532445 bound: 7.812188  
 > [0.000000]: [surf_maxmin/DEBUG] index: 2      cnst_light_num: 7       || usage: 0.000000 remaining: 7.706925 bound: 8.081918  
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 6       || usage: 0.000000 remaining: 0.000000 bound: 0.609391  
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 5       || usage: 0.000000 remaining: 4.876179 bound: 5.074925  
-> [0.000000]: [surf_maxmin/DEBUG] var=88, var.bound=-1.000000, var.weight=1.000000, min_usage=0.552648, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=88, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.552648, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (88) value to 0.552648
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.552648, Var(88).weight: 1.000000, Var(88).value: 0.552648 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.552648, Var(88).penalty: 1.000000, Var(88).value: 0.552648 
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 4       || usage: 0.000000 remaining: 2.232278 bound: 3.776224  
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 3       || usage: 0.000000 remaining: 5.081262 bound: 5.934066  
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 2       || usage: 0.000000 remaining: 3.095879 bound: 4.025974  
@@ -675,36 +675,36 @@ $ $SG_TEST_EXENV ${bindir:=.}/maxmin_bench small  10 test
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '91' usage: 1.179321 remaining: 8.421578 concurrency: 1<=1<=4
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '96' usage: 2.234266 remaining: 3.876124 concurrency: 1<=1<=3
 > [0.000000]: [surf_maxmin/DEBUG] Constraint '93' usage: 4.747253 remaining: 8.971029 concurrency: 3<=3<=3
-> [0.000000]: [surf_maxmin/DEBUG] var=91, var.bound=-1.000000, var.weight=1.000000, min_usage=0.147116, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=94, var.bound=-1.000000, var.weight=1.000000, min_usage=0.147116, var.bound*var.weight=-1.000000
-> [0.000000]: [surf_maxmin/DEBUG] var=97, var.bound=-1.000000, var.weight=1.000000, min_usage=0.147116, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=91, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.147116, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=94, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.147116, var.bound*var.penalty=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=97, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.147116, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (91) value to 0.147116
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.147116, Var(91).weight: 1.000000, Var(91).value: 0.147116 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.147116, Var(91).penalty: 1.000000, Var(91).value: 0.147116 
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (94) value to 0.147116
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.147116, Var(94).weight: 1.000000, Var(94).value: 0.147116 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.147116, Var(94).penalty: 1.000000, Var(94).value: 0.147116 
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 10      || usage: 0.000000 remaining: 3.978948 bound: 4.585415  
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (97) value to 0.147116
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.147116, Var(97).weight: 1.000000, Var(97).value: 0.147116 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.147116, Var(97).penalty: 1.000000, Var(97).value: 0.147116 
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 9       || usage: 0.000000 remaining: 0.000000 bound: 0.949051  
-> [0.000000]: [surf_maxmin/DEBUG] var=93, var.bound=-1.000000, var.weight=1.000000, min_usage=0.194272, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=93, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.194272, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (93) value to 0.194272
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.194272, Var(93).weight: 1.000000, Var(93).value: 0.194272 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.194272, Var(93).penalty: 1.000000, Var(93).value: 0.194272 
 > [0.000000]: [surf_maxmin/DEBUG] index: 6      cnst_light_num: 8       || usage: 0.000000 remaining: 0.000000 bound: 0.649351  
 > [0.000000]: [surf_maxmin/DEBUG] index: 6      cnst_light_num: 7       || usage: 0.000000 remaining: 8.192469 bound: 8.421578  
-> [0.000000]: [surf_maxmin/DEBUG] var=92, var.bound=-1.000000, var.weight=1.000000, min_usage=0.546822, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=92, var.bound=-1.000000, var.penalty=1.000000, min_usage=0.546822, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (92) value to 0.546822
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.546822, Var(92).weight: 1.000000, Var(92).value: 0.546822 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 0.546822, Var(92).penalty: 1.000000, Var(92).value: 0.546822 
 > [0.000000]: [surf_maxmin/DEBUG] index: 4      cnst_light_num: 6       || usage: 0.000000 remaining: 0.000000 bound: 1.198801  
 > [0.000000]: [surf_maxmin/DEBUG] index: 4      cnst_light_num: 5       || usage: 0.000000 remaining: 7.799890 bound: 8.541459  
-> [0.000000]: [surf_maxmin/DEBUG] var=95, var.bound=-1.000000, var.weight=1.000000, min_usage=1.734854, var.bound*var.weight=-1.000000
+> [0.000000]: [surf_maxmin/DEBUG] var=95, var.bound=-1.000000, var.penalty=1.000000, min_usage=1.734854, var.bound*var.penalty=-1.000000
 > [0.000000]: [surf_maxmin/DEBUG] Setting var (95) value to 1.734854
 > 
-> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.734854, Var(95).weight: 1.000000, Var(95).value: 1.734854 
+> [0.000000]: [surf_maxmin/DEBUG] Min usage: 1.734854, Var(95).penalty: 1.000000, Var(95).value: 1.734854 
 > [0.000000]: [surf_maxmin/DEBUG] index: 2      cnst_light_num: 4       || usage: 0.000000 remaining: 3.148664 bound: 5.714286  
 > [0.000000]: [surf_maxmin/DEBUG] index: 0      cnst_light_num: 3       || usage: 0.000000 remaining: 0.000000 bound: 3.876124  
 > [0.000000]: [surf_maxmin/DEBUG] index: 1      cnst_light_num: 2       || usage: 0.000000 remaining: 6.621449 bound: 8.971029  
index 1dbf13b..29fbac9 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/surf_usage ${platfdir}/two_hosts_profiles.xml
+$ ${bindir:=.}/surf_usage ${platfdir}/two_hosts_profiles.xml
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'Cas01'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02'
 > [0.000000] [surf_test/INFO] actionA state: SURF_ACTION_RUNNING
index eb98a91..935bb53 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/surf_usage2 ${platfdir}/two_hosts_profiles.xml
+$ ${bindir:=.}/surf_usage2 ${platfdir}/two_hosts_profiles.xml
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'CM02'
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'cpu/model' to 'Cas01'
 > [0.200000] [surf_test/INFO] Next Event : 0.2
diff --git a/teshsuite/surf/wifi_usage/wifi_usage.cpp b/teshsuite/surf/wifi_usage/wifi_usage.cpp
new file mode 100644 (file)
index 0000000..a081c0b
--- /dev/null
@@ -0,0 +1,83 @@
+/* Copyright (c) 2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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 "xbt/log.h"
+
+#include "simgrid/msg.h"
+#include "src/surf/network_cm02.hpp"
+#include <exception>
+#include <iostream>
+#include <random>
+#include <string>
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(simulator, "[usage] wifi_usage <platform-file>");
+
+void run_ping_test(const char* src, const char* dest, int data_size);
+
+/* We need a separate actor so that it can sleep after each test */
+static void main_dispatcher()
+{
+  bool crosstraffic = simgrid::kernel::resource::NetworkModel::cfg_crosstraffic;
+
+  XBT_INFO("TEST: Send from a station to a node on the wired network after the AP.");
+  XBT_INFO("----------------------------------------------------------------------");
+  XBT_INFO("Since AP1 is the limiting link, we have the following constraint for AP1:");
+  if (crosstraffic) {
+    XBT_INFO("1.05/r_STA1 * rho_STA1 <= 1   (1.05 instead of 1 because of cross-traffic)");
+    XBT_INFO("We should thus have:");
+    XBT_INFO("  mu = 1 / [ 1/1 * 1.05/54Mbps ] = 51428571");
+    XBT_INFO("  simulation_time = 1000*8 / mu = 0.0001555556s (rounded to 0.000156s in SimGrid)");
+  } else {
+    XBT_INFO("1/r_STA1 * rho_STA1 <= 1  (there is no cross-traffic)");
+    XBT_INFO("We should thus have:");
+    XBT_INFO("  mu = 1 / [ 1/1 * 1/54Mbps ] = 5.4e+07");
+    XBT_INFO("  simulation_time = 1000*8 / mu = 0.0001481481s");
+  }
+  run_ping_test("Station 1", "NODE1", 1000);
+
+  XBT_INFO("TEST: Send from a station to another station on the same AP.");
+  XBT_INFO("------------------------------------------------------------");
+  XBT_INFO("We have the following constraint for AP1:");
+  if (crosstraffic) {
+    XBT_INFO("1.05/r_STA1 * rho_STA1 + 1.05/r_STA2 * rho_2 <= 1     (1.05 instead of 1 because of cross-traffic)");
+    XBT_INFO("We should thus have:");
+    XBT_INFO("  mu = 1 / [ 1/2 * 1.05/54Mbps + 1.05/54Mbps ] =  51428571");
+    XBT_INFO("  simulation_time = 1000*8 / [ mu / 2 ] = 0.0003111111s");
+  } else {
+    XBT_INFO("1/r_STA1 * rho_STA1 +    1/r_STA2 * rho_2 <= 1   (there is no cross-traffic)");
+    XBT_INFO("  mu = 1 / [ 1/2 * 1/54Mbps + 1/54Mbps ] = 5.4e+07");
+    XBT_INFO("  simulation_time = 1000*8 / [ mu / 2 ] = 0.0002962963s");
+  }
+  run_ping_test("Station 1", "Station 2", 1000);
+}
+int main(int argc, char** argv)
+{
+  simgrid::s4u::Engine engine(&argc, argv);
+  engine.load_platform(argv[1]);
+  simgrid::s4u::Actor::create("dispatcher", simgrid::s4u::Host::by_name("NODE1"), main_dispatcher);
+  engine.run();
+
+  return 0;
+}
+
+void run_ping_test(const char* src, const char* dest, int data_size)
+{
+  auto* mailbox = simgrid::s4u::Mailbox::by_name("Test");
+
+  simgrid::s4u::Actor::create("sender", simgrid::s4u::Host::by_name(src), [mailbox, dest, data_size]() {
+    double start_time = simgrid::s4u::Engine::get_clock();
+    static char message[] = "message";
+    mailbox->put(message, data_size);
+    double end_time = simgrid::s4u::Engine::get_clock();
+    XBT_INFO("Actual result: Sending %d bytes from '%s' to '%s' takes %f seconds.", data_size,
+             simgrid::s4u::this_actor::get_host()->get_cname(), dest, end_time - start_time);
+  });
+  simgrid::s4u::Actor::create("receiver", simgrid::s4u::Host::by_name(dest), [mailbox]() { mailbox->get(); });
+  auto* l = (simgrid::kernel::resource::NetworkWifiLink*)simgrid::s4u::Link::by_name("AP1")->get_impl();
+  l->set_host_rate(simgrid::s4u::Host::by_name(src), 0);
+  simgrid::s4u::this_actor::sleep_for(10);
+  XBT_INFO("\n");
+}
diff --git a/teshsuite/surf/wifi_usage/wifi_usage.tesh b/teshsuite/surf/wifi_usage/wifi_usage.tesh
new file mode 100644 (file)
index 0000000..007fa0c
--- /dev/null
@@ -0,0 +1,43 @@
+#!/usr/bin/env tesh
+
+p Test WITH crosstraffic
+$ ${bindir:=.}/wifi_usage ${platfdir}/wifi.xml --log=root.fmt=%m%n
+> TEST: Send from a station to a node on the wired network after the AP.
+> ----------------------------------------------------------------------
+> Since AP1 is the limiting link, we have the following constraint for AP1:
+> 1.05/r_STA1 * rho_STA1 <= 1   (1.05 instead of 1 because of cross-traffic)
+> We should thus have:
+>   mu = 1 / [ 1/1 * 1.05/54Mbps ] = 51428571
+>   simulation_time = 1000*8 / mu = 0.0001555556s (rounded to 0.000156s in SimGrid)
+> Actual result: Sending 1000 bytes from 'Station 1' to 'NODE1' takes 0.000156 seconds.
+>
+>
+> TEST: Send from a station to another station on the same AP.
+> ------------------------------------------------------------
+> We have the following constraint for AP1:
+> 1.05/r_STA1 * rho_STA1 + 1.05/r_STA2 * rho_2 <= 1     (1.05 instead of 1 because of cross-traffic)
+> We should thus have:
+>   mu = 1 / [ 1/2 * 1.05/54Mbps + 1.05/54Mbps ] =  51428571
+>   simulation_time = 1000*8 / [ mu / 2 ] = 0.0003111111s
+> Actual result: Sending 1000 bytes from 'Station 1' to 'Station 2' takes 0.000311 seconds.
+
+p Test WITHOUT crosstraffic
+$ ${bindir:=.}/wifi_usage ${platfdir}/wifi.xml --log=root.fmt=%m%n --cfg=network/crosstraffic:0
+> Configuration change: Set 'network/crosstraffic' to '0'
+> TEST: Send from a station to a node on the wired network after the AP.
+> ----------------------------------------------------------------------
+> Since AP1 is the limiting link, we have the following constraint for AP1:
+> 1/r_STA1 * rho_STA1 <= 1  (there is no cross-traffic)
+> We should thus have:
+>   mu = 1 / [ 1/1 * 1/54Mbps ] = 5.4e+07
+>   simulation_time = 1000*8 / mu = 0.0001481481s
+> Actual result: Sending 1000 bytes from 'Station 1' to 'NODE1' takes 0.000148 seconds.
+>
+>
+> TEST: Send from a station to another station on the same AP.
+> ------------------------------------------------------------
+> We have the following constraint for AP1:
+> 1/r_STA1 * rho_STA1 +    1/r_STA2 * rho_2 <= 1   (there is no cross-traffic)
+>   mu = 1 / [ 1/2 * 1/54Mbps + 1/54Mbps ] = 5.4e+07
+>   simulation_time = 1000*8 / [ mu / 2 ] = 0.0002962963s
+> Actual result: Sending 1000 bytes from 'Station 1' to 'Station 2' takes 0.000296 seconds.
index c966d54..1d9a841 100644 (file)
@@ -8,7 +8,7 @@ foreach(x cmdline log_large log_usage)
   set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c)
 endforeach()
 
-foreach(x parallel_log_crashtest parmap_bench parmap_test)
+foreach(x parallel_log_crashtest parmap_bench parmap_test signals)
   add_executable       (${x}  EXCLUDE_FROM_ALL ${x}/${x}.cpp)
   target_link_libraries(${x}  simgrid)
   set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
@@ -39,6 +39,8 @@ if(enable_coverage)
   ADD_TESH(tesh-xbt-parmap_bench --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/xbt/parmap_bench --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/parmap_bench parmap_bench.tesh)
 endif()
 
+ADD_TESH(tesh-xbt-signals --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/xbt/signals --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/xbt/signals signals.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()
index 2a23033..4db584b 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env tesh
 
 p Check different log thresholds
-$ $SG_TEST_EXENV ${bindir:=.}/log_usage "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
+$ ${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
 > [  0.000000] [0:maestro@] false alarm!
@@ -22,7 +22,7 @@ $ $SG_TEST_EXENV ${bindir:=.}/log_usage "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m
 > [  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
+$ ${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
@@ -44,7 +44,7 @@ $ cat ${bindir:=.}/log_usage.log
 > [  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
+$ ${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!
@@ -63,7 +63,7 @@ $ cat ${bindir:=.}/log_usage.log
 >                    
 
 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
+$ ${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
@@ -87,7 +87,3 @@ $ cat ${bindir:=.}/log_usage_1.log
 > [  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-logs --help-log-categories
index c9f7f1e..113c106 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/log_usage "--log=root.fmt:[%10.6r]%e[%i:%P@%h]%e%m%n"
+$ ${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
 > [  0.000000] [0:maestro@] false alarm!
index e40a03f..06bc543 100644 (file)
@@ -104,7 +104,7 @@ $ ${bindir:=.}/mmalloc_test --log=root.fmt:%m%n
 > All blocks were correctly allocated. Free every second block
 > Memset every second block to zero (yeah, they are not currently allocated :)
 > Re-allocate every second block
-> 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)
+> free all blocks (each one twice, to check that double free are correctly caught)
+> free again all blocks (to really check that double free are correctly caught)
 > Let's try different codepaths for mrealloc
 > Damnit, I cannot break mmalloc this time. That's SO disappointing.
index 90e01ff..17356ee 100644 (file)
@@ -104,7 +104,7 @@ $ ${bindir:=.}/mmalloc_test --log=root.fmt:%m%n
 > All blocks were correctly allocated. Free every second block
 > Memset every second block to zero (yeah, they are not currently allocated :)
 > Re-allocate every second block
-> 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)
+> free all blocks (each one twice, to check that double free are correctly caught)
+> free again all blocks (to really check that double free are correctly caught)
 > Let's try different codepaths for mrealloc
 > Damnit, I cannot break mmalloc this time. That's SO disappointing.
index 847ff6c..9217257 100644 (file)
@@ -20,12 +20,10 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(test,"this test");
 constexpr int BUFFSIZE = 204800;
 constexpr int TESTSIZE = 100;
 
-#define size_of_block(i) (((i % 50)+1)* 100)
+#define size_of_block(i) ((((i) % 50) + 1) * 100)
 
-static void check_block(const void* s, int c, int n)
+static void check_block(const unsigned char* p, unsigned char b, 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);
@@ -71,25 +69,25 @@ int main(int argc, char**argv)
     pointers[i] = mmalloc(heapA, size);
   }
 
-  XBT_INFO("free all blocks (each one twice, to check that double free are correctly catched)");
+  XBT_INFO("free all blocks (each one twice, to check that double free are correctly caught)");
   for (i = 0; i < TESTSIZE; i++) {
     bool gotit = false;
     mfree(heapA, pointers[i]);
     try {
       mfree(heapA, pointers[i]);
-    } catch(xbt_ex& e) {
+    } catch (const simgrid::Exception&) {
       gotit = true;
     }
     if (not gotit)
       xbt_die("FAIL: A double-free went undetected (for size:%d)",size_of_block(i));
   }
 
-  XBT_INFO("free again all blocks (to really check that double free are correctly catched)");
+  XBT_INFO("free again all blocks (to really check that double free are correctly caught)");
   for (i = 0; i < TESTSIZE; i++) {
     bool gotit = false;
     try {
       mfree(heapA, pointers[i]);
-    } catch(xbt_ex& e) {
+    } catch (const simgrid::Exception&) {
       gotit = true;
     }
     if (not gotit)
@@ -98,14 +96,15 @@ int main(int argc, char**argv)
 
   XBT_INFO("Let's try different codepaths for mrealloc");
   for (i = 0; i < TESTSIZE; i++) {
-    const std::vector<std::pair<int, int>> requests = {
+    const std::vector<std::pair<int, unsigned char>> 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));
+        check_block(static_cast<unsigned char*>(pointers[i]), requests[k - 1].second,
+                    std::min(size, requests[k - 1].first));
       if (size > 0)
         memset(pointers[i], requests[k].second, size);
     }
index bc95e83..58b392b 100644 (file)
@@ -1,3 +1,3 @@
 #!/usr/bin/env tesh
 
-$ $SG_TEST_EXENV ${bindir:=.}/parmap_bench 4 0.25 --log=parmap_bench.thres:warning
+$ ${bindir:=.}/parmap_bench 4 0.25 --log=parmap_bench.thres:warning
diff --git a/teshsuite/xbt/signals/signals.cpp b/teshsuite/xbt/signals/signals.cpp
new file mode 100644 (file)
index 0000000..4668527
--- /dev/null
@@ -0,0 +1,51 @@
+/* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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(s4u_test, "Messages specific for this s4u example");
+
+static void worker()
+{
+  simgrid::s4u::Host* other_host = simgrid::s4u::Host::by_name("Fafard");
+  unsigned int first =
+      simgrid::s4u::Host::on_state_change.connect([](simgrid::s4u::Host const&) { XBT_INFO("First callback"); });
+  unsigned int second =
+      simgrid::s4u::Host::on_state_change.connect([](simgrid::s4u::Host const&) { XBT_INFO("Second callback"); });
+  unsigned int third =
+      simgrid::s4u::Host::on_state_change.connect([](simgrid::s4u::Host const&) { XBT_INFO("Third callback"); });
+
+  XBT_INFO("Turning off: Three callbacks should be triggered");
+  other_host->turn_off();
+
+  XBT_INFO("Disconnect the second callback");
+  simgrid::s4u::Host::on_state_change.disconnect(second);
+
+  XBT_INFO("Turning on: Two callbacks should be triggered");
+  other_host->turn_on();
+
+  XBT_INFO("Disconnect the first callback");
+  simgrid::s4u::Host::on_state_change.disconnect(first);
+
+  XBT_INFO("Turning off: One callback should be triggered");
+  other_host->turn_off();
+
+  XBT_INFO("Disconnect the third callback");
+  simgrid::s4u::Host::on_state_change.disconnect(third);
+  XBT_INFO("Turning on: No more callbacks");
+  other_host->turn_on();
+}
+
+int main(int argc, char* argv[])
+{
+  simgrid::s4u::Engine e(&argc, argv);
+  e.load_platform(argv[1]);
+
+  simgrid::s4u::Actor::create("worker", simgrid::s4u::Host::by_name("Tremblay"), worker);
+
+  e.run();
+
+  return 0;
+}
diff --git a/teshsuite/xbt/signals/signals.tesh b/teshsuite/xbt/signals/signals.tesh
new file mode 100644 (file)
index 0000000..b8d4c27
--- /dev/null
@@ -0,0 +1,14 @@
+$ $SG_EXENV_TEST ${bindir:=.}/signals ${platfdir}/small_platform.xml
+> [Tremblay:worker:(1) 0.000000] [s4u_test/INFO] Turning off: Three callbacks should be triggered
+> [0.000000] [s4u_test/INFO] First callback
+> [0.000000] [s4u_test/INFO] Second callback
+> [0.000000] [s4u_test/INFO] Third callback
+> [Tremblay:worker:(1) 0.000000] [s4u_test/INFO] Disconnect the second callback
+> [Tremblay:worker:(1) 0.000000] [s4u_test/INFO] Turning on: Two callbacks should be triggered
+> [0.000000] [s4u_test/INFO] First callback
+> [0.000000] [s4u_test/INFO] Third callback
+> [Tremblay:worker:(1) 0.000000] [s4u_test/INFO] Disconnect the first callback
+> [Tremblay:worker:(1) 0.000000] [s4u_test/INFO] Turning off: One callback should be triggered
+> [0.000000] [s4u_test/INFO] Third callback
+> [Tremblay:worker:(1) 0.000000] [s4u_test/INFO] Disconnect the third callback
+> [Tremblay:worker:(1) 0.000000] [s4u_test/INFO] Turning on: No more callbacks
index 821c0f2..7ad8d05 100644 (file)
@@ -2,6 +2,7 @@ set(bin_files ${bin_files}    ${CMAKE_CURRENT_SOURCE_DIR}/fix-paje-trace.sh
                               ${CMAKE_CURRENT_SOURCE_DIR}/generate-dwarf-functions
                               ${CMAKE_CURRENT_SOURCE_DIR}/normalize-pointers.py
                               ${CMAKE_CURRENT_SOURCE_DIR}/sg_xml_unit_converter.py
+                              ${CMAKE_CURRENT_SOURCE_DIR}/sg_xml_energy_ponecore_to_pepsilon.py
                               ${CMAKE_CURRENT_SOURCE_DIR}/simgrid_update_xml.pl
                               ${CMAKE_CURRENT_SOURCE_DIR}/simgrid_convert_TI_traces.py
                               ${CMAKE_CURRENT_SOURCE_DIR}/doxygen/fig2dev_postprocessor.pl
index 3b87fa9..0debf7c 100644 (file)
@@ -46,13 +46,8 @@ if(enable_coverage)
       "/include/"
       "/teshsuite/"
       "/src/bindings/"
+      "/examples/"
     )
-    if(NOT release)
-       set(PATTERN_CTEST_IGNORED
-        ${PATTERN_CTEST_IGNORED}
-        "/examples/"
-        )
-    endif()
 endif()
 
 CONFIGURE_FILE(${CMAKE_HOME_DIRECTORY}/tools/cmake/CTestCustom.cmake ${CMAKE_BINARY_DIR}/CTestCustom.cmake @ONLY)
index 9fb63c2..642e972 100644 (file)
@@ -11,6 +11,7 @@ set(EXTRA_DIST
   src/include/xbt/parmap.hpp
   src/include/xbt/mmalloc.h
   src/include/catch.hpp
+  src/include/xxhash.hpp
   src/mc/mc_mmu.hpp
   src/mc/mc_record.hpp
   src/msg/msg_private.hpp
@@ -48,6 +49,7 @@ set(EXTRA_DIST
   src/surf/xml/simgrid_dtd.c
   src/surf/xml/surfxml_sax_cb.cpp
 
+  src/surf/disk_s19.hpp
   src/surf/StorageImpl.hpp
   src/surf/storage_n11.hpp
   src/surf/surf_interface.hpp
@@ -66,7 +68,6 @@ set(EXTRA_DIST
   src/xbt/mallocator_private.h
 
   src/xbt/mmalloc/mfree.c
-  src/xbt/mmalloc/mm.c
   src/xbt/mmalloc/mm_legacy.c
   src/xbt/mmalloc/mm_module.c
   src/xbt/mmalloc/mmalloc.c
@@ -88,10 +89,61 @@ set(EXTRA_DIST
   )
 
 set(SMPI_SRC
+  src/smpi/internals/instr_smpi.cpp
+  src/smpi/internals/smpi_bench.cpp
+  src/smpi/internals/smpi_memory.cpp
+  src/smpi/internals/smpi_shared.cpp
+  src/smpi/internals/smpi_deployment.cpp
+  src/smpi/internals/smpi_global.cpp
+  src/smpi/internals/smpi_host.cpp
+  src/smpi/internals/smpi_replay.cpp
+  src/smpi/internals/smpi_actor.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_errhandler.cpp
+  src/smpi/mpi/smpi_f2c.cpp
+  src/smpi/mpi/smpi_file.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/include/smpi_actor.hpp
+  src/smpi/include/smpi_coll.hpp
+  src/smpi/include/smpi_comm.hpp
+  src/smpi/include/smpi_datatype_derived.hpp
+  src/smpi/include/smpi_datatype.hpp
+  src/smpi/include/smpi_errhandler.hpp
+  src/smpi/include/smpi_f2c.hpp
+  src/smpi/include/smpi_file.hpp
+  src/smpi/include/smpi_group.hpp
+  src/smpi/include/smpi_host.hpp
+  src/smpi/include/smpi_info.hpp
+  src/smpi/include/smpi_keyvals.hpp
+  src/smpi/include/smpi_op.hpp
+  src/smpi/include/smpi_request.hpp
+  src/smpi/include/smpi_status.hpp
+  src/smpi/include/smpi_topo.hpp
+  src/smpi/include/smpi_win.hpp
+  src/smpi/plugins/sampi_loadbalancer.cpp
+  src/smpi/plugins/ampi/ampi.cpp
+  src/smpi/plugins/ampi/ampi.hpp
+  src/smpi/plugins/ampi/instr_ampi.cpp
+  src/smpi/plugins/ampi/instr_ampi.hpp
+  src/smpi/plugins/load_balancer/LoadBalancer.cpp
+  src/smpi/plugins/load_balancer/load_balancer.hpp
+  src/surf/network_smpi.cpp
+  src/surf/network_ib.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_file.cpp
   src/smpi/bindings/smpi_pmpi_group.cpp
   src/smpi/bindings/smpi_pmpi_info.cpp
   src/smpi/bindings/smpi_pmpi_op.cpp
@@ -211,54 +263,6 @@ set(SMPI_SRC
   src/smpi/colls/smpi_openmpi_selector.cpp
   src/smpi/colls/smpi_mvapich2_selector.cpp
   src/smpi/colls/smpi_coll.cpp
-  src/smpi/internals/instr_smpi.cpp
-  src/smpi/internals/smpi_bench.cpp
-  src/smpi/internals/smpi_memory.cpp
-  src/smpi/internals/smpi_shared.cpp
-  src/smpi/internals/smpi_static_variables.cpp
-  src/smpi/internals/smpi_deployment.cpp
-  src/smpi/internals/smpi_dvfs.cpp
-  src/smpi/internals/smpi_global.cpp
-  src/smpi/internals/smpi_host.cpp
-  src/smpi/internals/smpi_replay.cpp
-  src/smpi/internals/smpi_actor.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/include/smpi_actor.hpp
-  src/smpi/include/smpi_coll.hpp
-  src/smpi/include/smpi_comm.hpp
-  src/smpi/include/smpi_datatype_derived.hpp
-  src/smpi/include/smpi_datatype.hpp
-  src/smpi/include/smpi_f2c.hpp
-  src/smpi/include/smpi_group.hpp
-  src/smpi/include/smpi_host.hpp
-  src/smpi/include/smpi_info.hpp
-  src/smpi/include/smpi_keyvals.hpp
-  src/smpi/include/smpi_op.hpp
-  src/smpi/include/smpi_request.hpp
-  src/smpi/include/smpi_status.hpp
-  src/smpi/include/smpi_topo.hpp
-  src/smpi/include/smpi_win.hpp
-  src/smpi/plugins/sampi_loadbalancer.cpp
-  src/smpi/plugins/ampi/ampi.cpp
-  src/smpi/plugins/ampi/ampi.hpp
-  src/smpi/plugins/ampi/instr_ampi.cpp
-  src/smpi/plugins/ampi/instr_ampi.hpp
-  src/smpi/plugins/load_balancer/LoadBalancer.cpp
-  src/smpi/plugins/load_balancer/load_balancer.hpp
-  src/surf/network_smpi.cpp
-  src/surf/network_ib.cpp
   )
 
 set(XBT_SRC
@@ -296,6 +300,8 @@ set(XBT_SRC
 
 if(HAVE_MMALLOC)
   set(XBT_SRC ${XBT_SRC}  src/xbt/mmalloc/mm.c )
+else()
+  set(EXTRA_DIST ${EXTRA_DIST} src/xbt/mmalloc/mm.c)
 endif()
 
 set(NS3_SRC  src/surf/network_ns3.cpp
@@ -303,15 +309,22 @@ set(NS3_SRC  src/surf/network_ns3.cpp
 
 set(SURF_SRC
   src/kernel/lmm/fair_bottleneck.cpp
-  src/kernel/lmm/lagrange.cpp
   src/kernel/lmm/maxmin.hpp
   src/kernel/lmm/maxmin.cpp
 
   src/kernel/resource/Action.cpp
   src/kernel/resource/Model.cpp
   src/kernel/resource/Resource.cpp
-  src/kernel/resource/profile/trace_mgr.hpp
-  src/kernel/resource/profile/trace_mgr.cpp
+  src/kernel/resource/DiskImpl.cpp
+  src/kernel/resource/DiskImpl.hpp
+
+  src/kernel/resource/profile/DatedValue.cpp
+  src/kernel/resource/profile/DatedValue.hpp
+  src/kernel/resource/profile/Event.hpp
+  src/kernel/resource/profile/FutureEvtSet.cpp
+  src/kernel/resource/profile/FutureEvtSet.hpp
+  src/kernel/resource/profile/Profile.cpp
+  src/kernel/resource/profile/Profile.hpp
 
   src/kernel/routing/ClusterZone.cpp
   src/kernel/routing/DijkstraZone.cpp
@@ -332,6 +345,7 @@ set(SURF_SRC
   src/surf/cpu_cas01.cpp
   src/surf/cpu_interface.cpp
   src/surf/cpu_ti.cpp
+  src/surf/disk_s19.cpp
   src/surf/network_cm02.cpp
   src/surf/network_constant.cpp
   src/surf/network_interface.cpp
@@ -382,7 +396,6 @@ set(SIMIX_SRC
   src/kernel/context/ContextThread.cpp
   src/kernel/context/ContextThread.hpp
   src/simix/smx_deployment.cpp
-  src/simix/smx_environment.cpp
   src/simix/smx_global.cpp
   src/simix/popping.cpp
   src/kernel/activity/ActivityImpl.cpp
@@ -430,6 +443,7 @@ set(S4U_SRC
   src/s4u/s4u_Barrier.cpp
   src/s4u/s4u_ConditionVariable.cpp
   src/s4u/s4u_Comm.cpp
+  src/s4u/s4u_Disk.cpp
   src/s4u/s4u_Engine.cpp
   src/s4u/s4u_Exec.cpp
   src/s4u/s4u_Host.cpp
@@ -589,8 +603,29 @@ set(MC_SRC
   src/mc/checker/CommunicationDeterminismChecker.hpp
   src/mc/checker/SafetyChecker.cpp
   src/mc/checker/SafetyChecker.hpp
+  src/mc/checker/SimcallInspector.hpp
   src/mc/checker/LivenessChecker.cpp
   src/mc/checker/LivenessChecker.hpp
+  
+  src/mc/inspect/DwarfExpression.hpp
+  src/mc/inspect/DwarfExpression.cpp
+  src/mc/inspect/Frame.hpp
+  src/mc/inspect/Frame.cpp
+  src/mc/inspect/LocationList.hpp
+  src/mc/inspect/LocationList.cpp
+  src/mc/inspect/ObjectInformation.hpp
+  src/mc/inspect/ObjectInformation.cpp
+  src/mc/inspect/Type.hpp
+  src/mc/inspect/Variable.hpp
+  src/mc/inspect/mc_dwarf.hpp
+  src/mc/inspect/mc_dwarf.cpp
+  src/mc/inspect/mc_dwarf_attrnames.cpp
+  src/mc/inspect/mc_dwarf_tagnames.cpp
+  src/mc/inspect/mc_member.cpp
+  src/mc/inspect/mc_unw.hpp
+  src/mc/inspect/mc_unw.cpp
+  src/mc/inspect/mc_unw_vmread.cpp
+
   src/mc/remote/Channel.cpp
   src/mc/remote/Channel.hpp
   src/mc/remote/Client.cpp
@@ -605,44 +640,24 @@ set(MC_SRC
   src/mc/sosp/PageStore.cpp
   src/mc/sosp/ChunkedData.hpp
   src/mc/sosp/ChunkedData.cpp
-  src/mc/sosp/RegionSnapshot.cpp
-  src/mc/sosp/RegionSnapshot.hpp
-  src/mc/sosp/mc_checkpoint.cpp
-  src/mc/sosp/mc_snapshot.hpp
-  src/mc/sosp/mc_snapshot.cpp
-  src/mc/sosp/mc_page_snapshot.cpp
+  src/mc/sosp/Region.cpp
+  src/mc/sosp/Region.hpp
+  src/mc/sosp/Snapshot.hpp
+  src/mc/sosp/Snapshot.cpp
   
   src/mc/AddressSpace.hpp
-  src/mc/Frame.hpp
-  src/mc/Frame.cpp
   src/mc/ModelChecker.hpp
   src/mc/ModelChecker.cpp
-  src/mc/ObjectInformation.hpp
-  src/mc/ObjectInformation.cpp
-  src/mc/Type.hpp
-  src/mc/Variable.hpp
   src/mc/mc_forward.hpp
   src/mc/Session.cpp
   src/mc/Session.hpp
-  src/mc/mc_unw.hpp
-  src/mc/mc_unw.cpp
-  src/mc/mc_unw_vmread.cpp
   src/mc/mc_comm_pattern.cpp
   src/mc/mc_comm_pattern.hpp
   src/mc/compare.cpp
-  src/mc/mc_dwarf.hpp
-  src/mc/mc_dwarf.cpp
-  src/mc/mc_dwarf_attrnames.cpp
-  src/mc/DwarfExpression.hpp
-  src/mc/DwarfExpression.cpp
-  src/mc/mc_dwarf_tagnames.cpp
   src/mc/mc_hash.hpp
   src/mc/mc_hash.cpp
   src/mc/mc_ignore.hpp
-  src/mc/LocationList.hpp
-  src/mc/LocationList.cpp
   src/mc/mc_record.cpp
-  src/mc/mc_member.cpp
   src/mc/mc_memory.cpp
   src/mc/mc_private.hpp
   src/mc/mc_request.hpp
@@ -687,6 +702,8 @@ set(headers_to_install
   include/simgrid/kernel/future.hpp
   include/simgrid/host.h
   include/simgrid/link.h
+  include/simgrid/cond.h
+  include/simgrid/mutex.h
   include/simgrid/semaphore.h
   include/simgrid/storage.h
   include/simgrid/vm.h
@@ -696,6 +713,7 @@ set(headers_to_install
   include/simgrid/s4u/Barrier.hpp
   include/simgrid/s4u/Comm.hpp
   include/simgrid/s4u/ConditionVariable.hpp
+  include/simgrid/s4u/Disk.hpp
   include/simgrid/s4u/Engine.hpp
   include/simgrid/s4u/Exec.hpp
   include/simgrid/s4u/Host.hpp
@@ -830,7 +848,6 @@ set(DOC_SOURCES
   doc/Layout.xml
 
   doc/doxygen/FAQ.doc
-  doc/doxygen/deployment.doc
   doc/doxygen/inside.doc
   doc/doxygen/inside_tests.doc
   doc/doxygen/inside_cmake.doc
@@ -841,8 +858,6 @@ set(DOC_SOURCES
   doc/doxygen/module-trace.doc
   doc/doxygen/module-xbt.doc
   doc/doxygen/module-index.doc
-  doc/doxygen/ns3.doc
-  doc/doxygen/outcomes.doc
   doc/doxygen/outcomes_logs.doc
   doc/doxygen/outcomes_vizu.doc
   doc/doxygen/platform.doc
@@ -863,6 +878,7 @@ set(DOC_SOURCES
   docs/source/conf.py
   docs/source/Doxyfile
   docs/source/_ext/hidden_code_block.py
+  docs/source/_templates/breadcrumbs.html
 
   docs/source/img/eclipseScreenShot.png
   docs/source/img/extlink.png
@@ -876,22 +892,24 @@ set(DOC_SOURCES
 
   docs/ignored_symbols
   docs/source/application.rst
-  docs/source/app_java.rst
   docs/source/app_msg.rst
   docs/source/app_s4u.rst
   docs/source/app_smpi.rst
   docs/source/community.rst
+  docs/source/Configuring_SimGrid.rst
+  docs/source/Deploying_your_Application.rst
+  docs/source/Experimental_Setup.rst
   docs/source/index.rst
-  docs/source/intro_concepts.rst
-  docs/source/introduction.rst
+  docs/source/Introduction.rst
   docs/source/Installing_SimGrid.rst
   docs/source/Start_Your_Own_Project.rst
   docs/source/models.rst
+  docs/source/ns3.rst
+  docs/source/outcomes.rst
   docs/source/platform.rst
   docs/source/platform_howtos.rst
-  docs/source/platform_reference.rst
-  docs/source/Configuring_SimGrid.rst
-  docs/source/scenario.rst
+  docs/source/Platform_Examples.rst
+  docs/source/XML_Reference.rst
 
   docs/source/Tutorial_Algorithms.rst
   docs/source/tuto_s4u/deployment1.xml
@@ -977,8 +995,6 @@ set(CMAKEFILES_TXT
   examples/smpi/smpi_msg_masterslave/CMakeLists.txt
   examples/smpi/replay_multiple/CMakeLists.txt
   examples/smpi/replay_multiple_manual_deploy/CMakeLists.txt
-  examples/smpi/energy/f77/CMakeLists.txt
-  examples/smpi/energy/f90/CMakeLists.txt
   examples/python/CMakeLists.txt
   examples/deprecated/java/CMakeLists.txt
   examples/deprecated/msg/CMakeLists.txt
@@ -1002,6 +1018,7 @@ set(CMAKEFILES_TXT
   teshsuite/smpi/mpich3-test/coll/CMakeLists.txt
   teshsuite/smpi/mpich3-test/comm/CMakeLists.txt
   teshsuite/smpi/mpich3-test/datatype/CMakeLists.txt
+  teshsuite/smpi/mpich3-test/errhan/CMakeLists.txt
   teshsuite/smpi/mpich3-test/f77/attr/CMakeLists.txt
   teshsuite/smpi/mpich3-test/f77/coll/CMakeLists.txt
   teshsuite/smpi/mpich3-test/f77/info/CMakeLists.txt
@@ -1055,6 +1072,7 @@ set(CMAKE_SOURCE_FILES
   tools/cmake/Modules/FindLuaSimgrid.cmake
   tools/cmake/Modules/FindNS3.cmake
   tools/cmake/Modules/FindPAPI.cmake
+  tools/cmake/Modules/pybind11Config.cmake
   tools/cmake/Modules/FindValgrind.cmake
   tools/cmake/Option.cmake
   tools/cmake/scripts/fixup_simgrid_dtd_l.pl
@@ -1073,6 +1091,10 @@ set(CMAKE_SOURCE_FILES
   tools/stack-cleaner/clean-stack-filter
   tools/stack-cleaner/compiler-wrapper
   tools/stack-cleaner/README
+  
+  setup.py 
+  MANIFEST.in
+  MANIFEST.in.in
   )
 
 set(PLATFORMS_EXAMPLES
@@ -1116,8 +1138,10 @@ set(PLATFORMS_EXAMPLES
   examples/platforms/faulty_host.xml
   examples/platforms/g5k.xml
   examples/platforms/griffon.xml
+  examples/platforms/hosts_with_disks.xml
   examples/platforms/meta_cluster.xml
   examples/platforms/multicore_machine.xml
+  examples/platforms/ns3-big-cluster.xml
   examples/platforms/onelink.xml
   examples/platforms/prop.xml
   examples/platforms/routing_cluster.xml
@@ -1126,7 +1150,6 @@ set(PLATFORMS_EXAMPLES
   examples/platforms/simulacrum_7_hosts.xml
   examples/platforms/storage/content/small_content.txt
   examples/platforms/storage/content/storage_content.txt
-  examples/platforms/storage/content/win_storage_content.txt
   examples/platforms/storage/remote_io.xml
   examples/platforms/storage/storage.xml
   examples/platforms/small_platform.xml
@@ -1148,6 +1171,7 @@ set(PLATFORMS_EXAMPLES
   examples/platforms/two_hosts_platform_with_availability_included.xml
   examples/platforms/two_peers.xml
   examples/platforms/vivaldi.xml
+  examples/platforms/wifi.xml
   )
 
 set(generated_src_files
index 91b516c..4948b39 100644 (file)
@@ -3,9 +3,7 @@
 #########################################
 
 # doc
-file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/doc/html/)
-install(DIRECTORY "${CMAKE_BINARY_DIR}/doc/html/"
-  DESTINATION doc/simgrid/html/)
+install(DIRECTORY "${CMAKE_BINARY_DIR}/doc/html/" DESTINATION doc/simgrid/html/ OPTIONAL)
 
 # binaries
 if(enable_smpi)
@@ -27,8 +25,6 @@ endif()
 
 install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/tesh  DESTINATION bin/)
 
-install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/graphicator  DESTINATION bin/)
-
 install(PROGRAMS ${CMAKE_HOME_DIRECTORY}/tools/MSG_visualization/colorize.pl
   DESTINATION bin/
   RENAME simgrid-colorizer)
@@ -181,11 +177,12 @@ set(source_to_pack
   ${examples_src}
   ${tesh_files}
   ${teshsuite_src}
-  ${testsuite_src}
   ${tools_src}
   ${txt_files}
   ${xml_files}
   )
+list(SORT source_to_pack)
+list(REMOVE_DUPLICATES source_to_pack)
 
 ##########################################
 ### Fill in the "make dist-dir" target ###
@@ -197,17 +194,18 @@ add_custom_target(dist-dir
   COMMAND ${CMAKE_COMMAND} -E remove ${PROJECT_NAME}-${release_version}.tar.gz
   COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_NAME}-${release_version}
   COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_NAME}-${release_version}/doc/html/
-  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/doc/html/ ${PROJECT_NAME}-${release_version}/doc/html/
-  COMMAND rm -f `grep -rl " Reference" ${PROJECT_NAME}-${release_version}/doc/html/` # Doxygen, go away
-  COMMAND rm -f `grep -rl "Member List" ${PROJECT_NAME}-${release_version}/doc/html/` # Doxygen, you're getting annoying
   )
 add_dependencies(dist-dir maintainer_files)
 
 set(dirs_in_tarball "")
+set(PYTHON_SOURCES "include MANIFEST.in")
 foreach(file ${source_to_pack})
   #message(${file})
   # This damn prefix is still set somewhere (seems to be in subdirs)
   string(REPLACE "${CMAKE_HOME_DIRECTORY}/" "" file "${file}")
+  
+  # Prepare the list of files to include in the python sdist, one per line
+  set(PYTHON_SOURCES "${PYTHON_SOURCES}\ninclude ${file}")
 
   # Create the directory on need
   get_filename_component(file_location ${file} PATH)
@@ -224,6 +222,9 @@ foreach(file ${source_to_pack})
     TARGET dist-dir
     COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_HOME_DIRECTORY}/${file} ${PROJECT_NAME}-${release_version}/${file_location})
 endforeach(file ${source_to_pack})
+configure_file("${CMAKE_HOME_DIRECTORY}/MANIFEST.in.in" "${CMAKE_BINARY_DIR}/MANIFEST.in" @ONLY IMMEDIATE)
+unset(PYTHON_SOURCES)
+
 
 add_custom_command(
   TARGET dist-dir
@@ -294,23 +295,26 @@ set(CMAKE_BINARY_TEST_DIR ${CMAKE_BINARY_DIR})
 
 # Allow to test the "make dist"
 add_custom_target(distcheck
-  COMMAND ${CMAKE_COMMAND} -E echo "XXX compare archive with git repository"
+  COMMAND ${CMAKE_COMMAND} -E echo "XXX Compare archive with git repository"
   COMMAND ${CMAKE_HOME_DIRECTORY}/tools/internal/check_dist_archive -batch ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}.tar.gz
 
-  COMMAND ${CMAKE_COMMAND} -E echo "XXX remove old copy"
+  COMMAND ${CMAKE_COMMAND} -E echo "XXX Remove old copy"
   COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}
 
   COMMAND ${CMAKE_COMMAND} -E echo "XXX Untar distrib"
   COMMAND ${CMAKE_COMMAND} -E tar xf ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}.tar.gz ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}
 
-  COMMAND ${CMAKE_COMMAND} -E echo "XXX create build and install subtrees"
+  COMMAND ${CMAKE_COMMAND} -E echo "XXX Create build and install subtrees"
   COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build
   COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_inst
 
   COMMAND ${CMAKE_COMMAND} -E echo "XXX Configure"
   COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build
           ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_inst -Denable_lto=OFF ..
-       
+
+  COMMAND ${CMAKE_COMMAND} -E echo "XXX Check generated files -- please copy new version if they are different"
+  COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_HOME_DIRECTORY}/MANIFEST.in ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build/MANIFEST.in
+
   COMMAND ${CMAKE_COMMAND} -E echo "XXX Build"
   COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_TEST_DIR}/${PROJECT_NAME}-${release_version}/_build ${CMAKE_MAKE_PROGRAM} -j 4
 
index 1d3262b..cb7a0c2 100644 (file)
@@ -23,11 +23,12 @@ if(enable_compile_warnings)
   endif()
   if (CMAKE_CXX_COMPILER_ID MATCHES "Intel")
     # ignore remark  #1418: external function definition with no prior declaration
+    # 2196: routine is both "inline" and "noinline"
     # 3179: deprecated conversion of string literal to char* (should be const char*)
     # 191: type qualifier is meaningless on cast type
     # 597: entity-kind "entity" will not be called for implicit or explicit conversions
     # 2330: argument of type "type" is incompatible with parameter of type "type" (dropping qualifiers)
-    set(warnCFLAGS "${warnCFLAGS} -wd1418 -wd191 -wd3179 -ww597 -ww2330")
+    set(warnCFLAGS "${warnCFLAGS} -wd1418 -wd191 -wd2196 -wd3179 -ww597 -ww2330")
   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")
@@ -59,6 +60,9 @@ endif()
 if(enable_compile_warnings AND enable_debug)
   set(warnCFLAGS "${warnCFLAGS} -Werror")
   set(warnCXXFLAGS "${warnCXXFLAGS} -Werror")
+  if(CMAKE_Fortran_COMPILER_ID MATCHES "GCC")
+    set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Werror -Werror=format-security")
+  endif()
 endif()
 
 # Activate the warnings on #if FOOBAR when FOOBAR has no value
index f9cee49..bb6ecba 100644 (file)
@@ -103,12 +103,14 @@ if(enable_lib_in_jar)
   endif()
 
   set(JAVA_NATIVE_PATH NATIVE/${SG_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR})
-  if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^i[3-6]86$")
-    set(JAVA_NATIVE_PATH NATIVE/${SG_SYSTEM_NAME}/x86)
-  endif()
-  if(  (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64") OR
-       (${CMAKE_SYSTEM_PROCESSOR} MATCHES "AMD64")     )
-    set(JAVA_NATIVE_PATH NATIVE/${SG_SYSTEM_NAME}/amd64)
+  if( (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^i[3-6]86$") OR
+      (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64") OR
+      (${CMAKE_SYSTEM_PROCESSOR} MATCHES "AMD64") )
+    if(CMAKE_SIZEOF_VOID_P EQUAL 4) # 32 bits
+      set(JAVA_NATIVE_PATH NATIVE/${SG_SYSTEM_NAME}/x86)
+    else()
+      set(JAVA_NATIVE_PATH NATIVE/${SG_SYSTEM_NAME}/amd64)
+    endif()
   endif()
   if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l")
     set(JAVA_NATIVE_PATH NATIVE/${SG_SYSTEM_NAME}/arm) # Default arm (soft-float ABI)
@@ -135,7 +137,8 @@ if(WIN32)
     # So let's be brutal and copy it in any case (even on non-windows builds) from the location where appveyor provides it.
     # The copy is only expected to work on the appveyor builder, but that's all we need right now
     # since our users are directed to download that file as nightly build.
-    COMMAND ${CMAKE_COMMAND} -E copy_if_different C:/mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1/mingw64/bin/libwinpthread-1.dll  ${JAVA_NATIVE_PATH}/libwinpthread-1.dll || true
+    COMMAND ${CMAKE_COMMAND} -E copy_if_different C:/mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1/mingw64/bin/libwinpthread-1.dll ${JAVA_NATIVE_PATH}/libwinpthread-1.dll || true
+    COMMAND ${CMAKE_COMMAND} -E copy_if_different C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/libwinpthread-1.dll  ${JAVA_NATIVE_PATH}/libwinpthread-1.dll || true
   )
 endif()
 
index 4765bd4..000cc6f 100644 (file)
@@ -162,6 +162,7 @@ if(enable_maintainer_mode AND NOT WIN32)
 
     set(string1  "'s/extern /XBT_PUBLIC_DATA /'")
     set(string2  "'s/XBT_PUBLIC_DATA \\([^(]*\\)(/XBT_PUBLIC \\1(/'")
+    set(string3  "'s/XBT_PUBLIC void STag_surfxml_include/XBT_ATTRIB_NORETURN &/'") # remove with v5 of the dtd
     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'")
@@ -193,6 +194,7 @@ if(enable_maintainer_mode AND NOT WIN32)
       COMMAND ${FLEXML_EXE} --root-tags platform -P surfxml --sysid=https://simgrid.org/simgrid.dtd -H src/surf/xml/simgrid_dtd.h -L src/surf/xml/simgrid.dtd
       COMMAND ${SED_EXE} -i ${string1} src/surf/xml/simgrid_dtd.h
       COMMAND ${SED_EXE} -i ${string2} src/surf/xml/simgrid_dtd.h
+      COMMAND ${SED_EXE} -i ${string3} src/surf/xml/simgrid_dtd.h
       COMMAND ${SED_EXE} -i ${string14} src/surf/xml/simgrid_dtd.h
       COMMAND ${CMAKE_COMMAND} -E echo "       Generated src/surf/xml/simgrid_dtd.h"
 
index 3d7d59f..480b934 100644 (file)
@@ -42,13 +42,21 @@ endif()
 # Compute the dependencies of SimGrid
 #####################################
 # search for dlopen
-if("${CMAKE_SYSTEM_NAME}" MATCHES "kFreeBSD|Linux")
+if("${CMAKE_SYSTEM_NAME}" MATCHES "kFreeBSD|Linux|SunOS")
   find_library(DL_LIBRARY dl)
 endif()
 mark_as_advanced(DL_LIBRARY)
 
 if (HAVE_BOOST_CONTEXTS)
-  set(SIMGRID_DEP "${SIMGRID_DEP} ${Boost_CONTEXT_LIBRARY}")
+  target_link_libraries(simgrid ${Boost_CONTEXT_LIBRARY})
+endif()
+
+if (HAVE_BOOST_STACKTRACE_BACKTRACE)
+  target_link_libraries(simgrid ${Boost_STACKTRACE_BACKTRACE_LIBRARY})
+endif()
+
+if (HAVE_BOOST_ADDR2LINE_BACKTRACE)
+  target_link_libraries(simgrid ${Boost_STACKTRACE_ADDR2LINE_LIBRARY})
 endif()
 
 if(CMAKE_USE_PTHREADS_INIT)
@@ -106,7 +114,7 @@ if(enable_smpi)
 
   add_executable(smpireplaymain src/smpi/smpi_replay_main.cpp)
   target_compile_options(smpireplaymain PRIVATE -fpic)
-  target_link_libraries(smpireplaymain simgrid -shared)
+  target_link_libraries(smpireplaymain simgrid -fpic -shared)
   set_target_properties(smpireplaymain
     PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/simgrid)
   install(TARGETS smpireplaymain # install that binary without breaking the rpath on Mac
index e7c5783..d76e274 100644 (file)
@@ -17,7 +17,15 @@ else()
   set(SIMGRID_DEP "-lm")
 
   if (HAVE_BOOST_CONTEXTS)
-    set(SIMGRID_DEP "${SIMGRID_DEP} ${Boost_CONTEXT_LIBRARY}")
+    target_link_libraries(simgrid ${Boost_CONTEXT_LIBRARY})
+  endif()
+
+  if (HAVE_BOOST_STACKTRACE_BACKTRACE)
+    target_link_libraries(simgrid ${Boost_STACKTRACE_BACKTRACE_LIBRARY})
+  endif()
+
+  if (HAVE_BOOST_ADDR2LINE_BACKTRACE)
+    target_link_libraries(simgrid ${Boost_STACKTRACE_ADDR2LINE_LIBRARY})
   endif()
 endif()
 
index 1d5adfa..5a3a120 100644 (file)
@@ -1,18 +1,18 @@
-# Try to find the NS3 library.
+# Try to find the ns-3 library.
 #
 # The user can hint a path using the NS3_HINT option.
 #
 # Once done, the following will be defined:
 #
-#  NS3_INCLUDE_DIRS - the NS3 include directories
+#  NS3_INCLUDE_DIRS - the ns-3 include directories
 #  NS3_LIBRARY_PATH - path to the libs
-#  NS3_LIBRARIES - link these to use NS3 (full path to libs)
+#  NS3_LIBRARIES - link these to use ns-3 (full path to libs)
 #
 # This could be improved in many ways (patches welcome):
-#  - No way to specify a minimal version (v3.10 is hardcoded).
+#  - No way to specify a minimal version (v3.26 is hardcoded).
 #  - No proper find_package() integration
 
-## ADDING A NS3 VERSION.
+## ADDING A ns-3 VERSION.
 #   - Add "ns3.${version}-core ns3.${version}-core-debug ns3.${version}-core-optimized" to the NAME line of the find_library below
 #   - Add "include/ns3{version}" to the PATH_SUFFIXES line of the find_path below
 
@@ -20,7 +20,20 @@ set(SIMGRID_HAVE_NS3 0)
 set(NS3_HINT ${ns3_path} CACHE PATH "Path to search for NS3 lib and include")
 
 find_library(NS3_LIBRARIES
-  NAME ns3-core ns3.14-core ns3.15-core ns3.16-core ns3.17-core ns3.18-core ns3.19-core ns3.20-core ns3.21-core ns3.22-core ns3.25-core ns3.26-core ns3.26-core-optimized ns3.26-core-debug ns3.27-core ns3.27-core-optimized ns3.27-core-debug ns3.28-core ns3.28-core-optimized ns3.28-core-debug ns3.29-core ns3.29-core-optimized ns3.29-core-debug
+  NAME ns3-core
+       ns3.22-core ns3.22-core-optimized ns3.22-core-debug
+       ns3.23-core ns3.23-core-optimized ns3.23-core-debug
+       ns3.24-core ns3.24-core-optimized ns3.24-core-debug
+       ns3.25-core ns3.25-core-optimized ns3.25-core-debug
+       ns3.26-core ns3.26-core-optimized ns3.26-core-debug
+       ns3.27-core ns3.27-core-optimized ns3.27-core-debug
+       ns3.28-core ns3.28-core-optimized ns3.28-core-debug
+       ns3.29-core ns3.29-core-optimized ns3.29-core-debug
+       ns3.30-core ns3.30-core-optimized ns3.30-core-debug
+       ns3.31-core ns3.31-core-optimized ns3.31-core-debug
+       ns3.32-core ns3.32-core-optimized ns3.32-core-debug
+       ns3.33-core ns3.33-core-optimized ns3.33-core-debug
+       ns3.34-core ns3.34-core-optimized ns3.34-core-debug
   PATH_SUFFIXES lib64 lib ns3/lib
   PATHS
   ${NS3_HINT}
@@ -28,7 +41,9 @@ find_library(NS3_LIBRARIES
 
 find_path(NS3_INCLUDE_DIR
   NAME ns3/core-module.h
-  PATH_SUFFIXES include ns3/include include/ns3.14 include/ns3.15 include/ns3.16 include/ns3.17 include/ns3.18 include/ns3.19 include/ns3.20 include/ns3.21 include/ns3.22 include/ns3.25 include/ns3.26 include/ns3.27 include/ns3.28 include/ns3.29
+  PATH_SUFFIXES include ns3/include 
+                include/ns3.22 include/ns3.23 include/ns3.24 include/ns3.25 include/ns3.26 include/ns3.27 include/ns3.28 include/ns3.29 include/ns3.30
+                include/ns3.31 include/ns3.32 include/ns3.33 include/ns3.34
   PATHS
   ${NS3_HINT}
   )
@@ -65,7 +80,7 @@ if(NS3_INCLUDE_DIR)
     # Compute NS3_PATH
     string(REGEX REPLACE "(.*)/lib" "\\1" NS3_PATH "${NS3_LIBRARY_PATH}")
 
-    message(STATUS "NS-3 found (v${NS3_VERSION}; incl:${NS3_INCLUDE_DIR}; lib: ${NS3_LIBRARY_PATH}).")
+    message(STATUS "ns-3 found (v${NS3_VERSION}; incl:${NS3_INCLUDE_DIR}; lib: ${NS3_LIBRARY_PATH}).")
 
     if (NOT NS3_LIBRARY_PATH STREQUAL "/usr/lib")
       string(REGEX MATCH "${NS3_LIBRARY_PATH}" MatchResult "$ENV{LD_LIBRARY_PATH}")
@@ -82,5 +97,5 @@ if(SIMGRID_HAVE_NS3)
   link_directories(${NS3_LIBRARY_PATH})
   include_directories(${NS3_INCLUDE_DIR})
 else()
-  message(STATUS "Warning: To use NS-3 Please install ns3 at least version 3.10 (http://www.nsnam.org/releases/)")
+  message(STATUS "Warning: Please install ns-3 (version 3.22 or higher -- http://www.nsnam.org/releases/) or disable this feature.")
 endif()
diff --git a/tools/cmake/Modules/pybind11Config.cmake b/tools/cmake/Modules/pybind11Config.cmake
new file mode 100644 (file)
index 0000000..e70847b
--- /dev/null
@@ -0,0 +1,129 @@
+# pybind11Config.cmake
+# --------------------
+#
+# Edited for simgrid so that we survive when pybind11Tools is not found, 
+# concluding that pybind11 is not installed. Original version was 2.2.4-2.
+#
+# PYBIND11 cmake module.
+# This module sets the following variables in your project::
+#
+#   pybind11_FOUND - true if pybind11 and all required components found on the system
+#   pybind11_VERSION - pybind11 version in format Major.Minor.Release
+#   pybind11_INCLUDE_DIRS - Directories where pybind11 and python headers are located.
+#   pybind11_INCLUDE_DIR - Directory where pybind11 headers are located.
+#   pybind11_DEFINITIONS - Definitions necessary to use pybind11, namely USING_pybind11.
+#   pybind11_LIBRARIES - compile flags and python libraries (as needed) to link against.
+#   pybind11_LIBRARY - empty.
+#   CMAKE_MODULE_PATH - appends location of accompanying FindPythonLibsNew.cmake and
+#                       pybind11Tools.cmake modules.
+#
+#
+# Available components: None
+#
+#
+# Exported targets::
+#
+# If pybind11 is found, this module defines the following :prop_tgt:`IMPORTED`
+# interface library targets::
+#
+#   pybind11::module - for extension modules
+#   pybind11::embed - for embedding the Python interpreter
+#
+# Python headers, libraries (as needed by platform), and the C++ standard
+# are attached to the target. Set PythonLibsNew variables to influence
+# python detection and PYBIND11_CPP_STANDARD (-std=c++11 or -std=c++14) to
+# influence standard setting. ::
+#
+#   find_package(pybind11 CONFIG REQUIRED)
+#   message(STATUS "Found pybind11 v${pybind11_VERSION}: ${pybind11_INCLUDE_DIRS}")
+#
+#   # Create an extension module
+#   add_library(mylib MODULE main.cpp)
+#   target_link_libraries(mylib pybind11::module)
+#
+#   # Or embed the Python interpreter into an executable
+#   add_executable(myexe main.cpp)
+#   target_link_libraries(myexe pybind11::embed)
+#
+# Suggested usage::
+#
+# find_package with version info is not recommended except for release versions. ::
+#
+#   find_package(pybind11 CONFIG)
+#   find_package(pybind11 2.0 EXACT CONFIG REQUIRED)
+#
+#
+# The following variables can be set to guide the search for this package::
+#
+#   pybind11_DIR - CMake variable, set to directory containing this Config file
+#   CMAKE_PREFIX_PATH - CMake variable, set to root directory of this package
+#   PATH - environment variable, set to bin directory of this package
+#   CMAKE_DISABLE_FIND_PACKAGE_pybind11 - CMake variable, disables
+#     find_package(pybind11) when not REQUIRED, perhaps to force internal build
+
+
+####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
+####### Any changes to this file will be overwritten by the next CMake run ####
+####### The input file was pybind11Config.cmake.in                            ########
+
+get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
+
+macro(set_and_check _var _file)
+  set(${_var} "${_file}")
+  if(NOT EXISTS "${_file}")
+    message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
+  endif()
+endmacro()
+
+macro(check_required_components _NAME)
+  foreach(comp ${${_NAME}_FIND_COMPONENTS})
+    if(NOT ${_NAME}_${comp}_FOUND)
+      if(${_NAME}_FIND_REQUIRED_${comp})
+        set(${_NAME}_FOUND FALSE)
+      endif()
+    endif()
+  endforeach()
+endmacro()
+
+####################################################################################
+
+set(PN pybind11)
+
+# location of pybind11/pybind11.h
+set(${PN}_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include")
+
+set(${PN}_LIBRARY "")
+set(${PN}_DEFINITIONS USING_${PN})
+
+check_required_components(${PN})
+
+# make detectable the FindPythonLibsNew.cmake module
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
+
+# SimGrid edit: survive to the fact that pybind11Tools is not found, but stop searching when it happens
+include(pybind11Tools OPTIONAL RESULT_VARIABLE found_pybind11_tools)
+
+if((NOT (found_pybind11_tools STREQUAL "NOT_FOUND")) AND (NOT (CMAKE_VERSION VERSION_LESS 3.0)))
+#-----------------------------------------------------------------------------
+# Don't include targets if this file is being picked up by another
+# project which has already built this as a subproject
+#-----------------------------------------------------------------------------
+if(NOT TARGET ${PN}::pybind11)
+    include("${CMAKE_CURRENT_LIST_DIR}/${PN}Targets.cmake")
+
+    find_package(PythonLibsNew ${PYBIND11_PYTHON_VERSION} MODULE REQUIRED)
+    set_property(TARGET ${PN}::pybind11 APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PYTHON_INCLUDE_DIRS})
+    set_property(TARGET ${PN}::embed APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${PYTHON_LIBRARIES})
+    if(WIN32 OR CYGWIN)
+      set_property(TARGET ${PN}::module APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${PYTHON_LIBRARIES})
+    endif()
+
+    set_property(TARGET ${PN}::pybind11 APPEND PROPERTY INTERFACE_COMPILE_OPTIONS "${PYBIND11_CPP_STANDARD}")
+
+    get_property(_iid TARGET ${PN}::pybind11 PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
+    get_property(_ill TARGET ${PN}::module PROPERTY INTERFACE_LINK_LIBRARIES)
+    set(${PN}_INCLUDE_DIRS ${_iid})
+    set(${PN}_LIBRARIES ${_ico} ${_ill})
+endif()
+endif()
+unset(found_pybind11tools)
index 32a5b24..36ac349 100644 (file)
@@ -9,8 +9,6 @@ else()
   set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Path where this project should be installed")
 endif()
 
-option(release "Whether Release Mode is activated (disable tests on experimental parts)" on)
-
 # How to build
 ###
 option(enable_compile_optimizations "Whether to produce efficient code for the SimGrid library" on)
@@ -22,27 +20,37 @@ option(enable_debug                 "Turn this off to remove all debug messages
 
 # Optional modules
 ###
-option(enable_documentation "Whether to produce documentation" on)
+option(enable_documentation "Whether to produce documentation" off)
 
-option(enable_ns3            "Whether ns3 model is activated." off)
+option(enable_ns3            "Whether ns-3 model is activated." off)
 option(enable_java           "Whether the Java bindings are activated." off)
 option(enable_lib_in_jar     "Whether the native libraries are bundled in a Java jar file" on)
+option(minimal-bindings      "Whether to compile the bindings libraries (Java/Python) with the minimal dependency set" off)
+mark_as_advanced(minimal-bindings)
+if(minimal-bindings)
+  set(enable_lib_in_jar on)
+endif()
 
 option(enable_lua            "Whether the Lua bindings are activated." off)
 
 option(enable_model-checking "Turn this on to experiment with our prototype of model-checker (hinders the simulation's performance even if turned off at runtime)" off)
+option(enable-model-checking "Please set 'enable_model-checking' instead" off)
+mark_as_advanced(enable-model-checking)
+if(enable-model-checking)
+  SET(enable_model-checking ON CACHE BOOL "Whether to compile the model-checker" FORCE)
+endif()
+
 option(enable_jedule         "Jedule output of SimDAG." off)
 
 if(WIN32)
   option(enable_smpi "Whether SMPI is included in the library." off)
-  option(enable_smpi_MPICH3_testsuite "Whether the test suite form MPICH 3 should be built" off)
 else()
   option(enable_smpi "Whether SMPI is included in the library." on)
   # PAPI does not support windows (they did in 3.7, but not anymore in 5.x)
   # See http://icl.cs.utk.edu/papi/custom/index.html?lid=62&slid=96
   option(enable_smpi_papi    "Whether SMPI supports PAPI bindings." off)
-  option(enable_smpi_MPICH3_testsuite "Whether the test suite form MPICH 3 should be built" off)
 endif()
+option(enable_smpi_MPICH3_testsuite "Whether the test suite form MPICH 3 should be built" off)
 option(enable_smpi_ISP_testsuite "Whether the test suite from ISP should be built." off)
 
 # Internal targets used by jenkins
index c175f19..e407752 100644 (file)
@@ -9,6 +9,11 @@ ENDIF()
 SET(TESH_OPTION "--ignore-jenkins")
 SET(TESH_COMMAND "${PYTHON_EXECUTABLE}" ${CMAKE_BINARY_DIR}/bin/tesh)
 
+SET(TESH_LIBRARY_PATH "${CMAKE_BINARY_DIR}/lib")
+if(NOT $ENV{LD_LIBRARY_PATH} STREQUAL "")
+  SET(TESH_LIBRARY_PATH "${TESH_LIBRARY_PATH}:$ENV{LD_LIBRARY_PATH}")
+endif()
+
 IF(enable_memcheck)
   INCLUDE(FindValgrind)
 
@@ -21,6 +26,7 @@ IF(enable_memcheck)
     if(enable_memcheck_xml)
       SET(TESH_WRAPPER ${TESH_WRAPPER}\ --xml=yes\ --xml-file=memcheck_test_%p.memcheck\ --child-silent-after-fork=yes\ )
     endif()
+    set(TESH_OPTION ${TESH_OPTION} --setenv VALGRIND_NO_LEAK_CHECK=--leak-check=no\ --show-leak-kinds=none)
 
 #    message(STATUS "tesh wrapper: ${TESH_WRAPPER}")
 
@@ -30,6 +36,8 @@ IF(enable_memcheck)
     message(STATUS "Error: Command valgrind not found --> enable_memcheck autoset to false.")
   endif()
 ENDIF()
+SET(TESH_WRAPPER_UNBOXED "${TESH_WRAPPER}")
+SEPARATE_ARGUMENTS(TESH_WRAPPER_UNBOXED)
 
 #some tests may take forever on non futexes systems, using busy_wait with n cores < n workers
 # default to posix for these tests if futexes are not supported
@@ -93,18 +101,20 @@ ENDIF()
 
 # New tests should use the Catch Framework
 set(UNIT_TESTS  src/xbt/unit-tests_main.cpp
-                src/kernel/resource/profile/trace_mgr_test.cpp
+                src/kernel/resource/profile/Profile_test.cpp
                 src/xbt/config_test.cpp
                 src/xbt/dict_test.cpp
                 src/xbt/dynar_test.cpp
-                src/xbt/xbt_str_test.cpp)
+                src/xbt/xbt_str_test.cpp
+               src/kernel/lmm/maxmin_test.cpp)
 if (SIMGRID_HAVE_MC)
-  set(UNIT_TESTS ${UNIT_TESTS} src/mc/sosp/mc_snapshot_test.cpp src/mc/sosp/PageStore_test.cpp)
+  set(UNIT_TESTS ${UNIT_TESTS} src/mc/sosp/Snapshot_test.cpp src/mc/sosp/PageStore_test.cpp)
 else()
-  set(EXTRA_DIST ${EXTRA_DIST} src/mc/sosp/mc_snapshot_test.cpp src/mc/sosp/PageStore_test.cpp)
+  set(EXTRA_DIST ${EXTRA_DIST} src/mc/sosp/Snapshot_test.cpp src/mc/sosp/PageStore_test.cpp)
 endif()  
 
-add_executable       (unit-tests ${UNIT_TESTS})
+add_executable       (unit-tests EXCLUDE_FROM_ALL ${UNIT_TESTS})
+add_dependencies     (tests unit-tests)
 target_link_libraries(unit-tests simgrid)
 ADD_TEST(unit-tests ${CMAKE_BINARY_DIR}/unit-tests)
 set_property(TARGET unit-tests APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")
index 4f16abd..eb33cb0 100755 (executable)
@@ -30,4 +30,4 @@ while (defined(my $arg = shift)) {
 # map { print "$_ " } @argv;
 # print "\n";
 
-system @argv;
+exec @argv;
index b99c787..8a8d26b 100755 (executable)
@@ -33,8 +33,6 @@ while(defined($line=<SH_LIGNE>))
                $line =~ s/\$\{srcdir\:\=\.\}/./g;
                $line =~ s/\(/\\(/g;
                $line =~ s/\)/\\)/g;
-               $line =~ s/\$SG_TEST_EXENV//g;
-               $line =~ s/\$EXEEXT//g;
                $line =~ s/^\$\ */.\//g;
                $line =~ s/^.\/lua/lua/g;
                $line =~ s/^.\/ruby/ruby/g;
index 4e76b83..f4dfef2 100644 (file)
@@ -1,8 +1,12 @@
 # Base image 
 FROM debian:testing
 
-# - Install SimGrid's dependencies
-RUN apt update && \
+# Install the dependencies:
+#  - of the website
+#  - of SimGrid itself
+RUN apt-get --allow-releaseinfo-change update && \
+    apt install -y \
+       bibclean emacs-nox org-mode elpa-ess elpa-htmlize wget unzip r-cran-ggplot2 r-cran-tidyr r-cran-dplyr libtext-bibtex-perl && \
     apt install -y \
        g++ gcc gfortran default-jdk pybind11-dev \
        git \
@@ -13,6 +17,7 @@ RUN apt update && \
        doxygen fig2dev \
        chrpath \
        libdw-dev libevent-dev libunwind8-dev \
+       linkchecker \
        && \
-    pip3 install breathe javasphinx sphinx>=1.8.0b1 sphinx_rtd_theme
+    pip3 install breathe 'sphinx>=1.8.0b1' sphinx_rtd_theme
                   
\ No newline at end of file
index 1b8cd23..d8f332b 100644 (file)
@@ -6,7 +6,7 @@ ARG DLURL
 # - Install SimGrid's dependencies
 # - Compile and install SimGrid itself
 RUN echo "DOWNLOAD_URL: ${DLURL}" && \
-    apt update && apt upgrade -y && apt install -y wget && \
+    apt-get --allow-releaseinfo-change update && apt upgrade -y && apt install -y wget && \
     mkdir /source && cd /source && \
     wget https://framagit.org/${DLURL} && \
     tar xf SimGrid-* && rm SimGrid-*tar.gz && \
@@ -19,5 +19,3 @@ RUN echo "DOWNLOAD_URL: ${DLURL}" && \
     apt remove -y  g++ gcc git valgrind default-jdk gfortran libboost-dev libboost-all-dev cmake dpkg-dev wget && \
     apt install `sed -e 's/shlibs:Depends=//' -e 's/([^)]*)//g' -e 's/,//g' /tmp/deps` && \
     apt autoremove -y && apt autoclean && apt clean
-
-    
\ No newline at end of file
diff --git a/tools/docker/Dockerfile.tuto-mc b/tools/docker/Dockerfile.tuto-mc
new file mode 100644 (file)
index 0000000..6784a21
--- /dev/null
@@ -0,0 +1,33 @@
+# Base image 
+FROM debian:testing
+
+RUN apt update && apt -y upgrade 
+
+RUN apt install -y sudo && \
+    groupadd -g 999 user && \
+    useradd -u 999 -g user user && \
+    echo "user ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/user && \
+    chmod 0440 /etc/sudoers.d/user && \
+    mkdir -p /home/user && \
+    chown -R user:user /home/user
+
+# - Install SimGrid's dependencies 
+# - Compile and install SimGrid itself.
+# - Remove everything that was installed, and re-install what's needed by the SimGrid libraries before the Gran Final Cleanup
+# - Keep g++ gcc gfortran as any MC user will use (some of) them
+RUN apt install -y g++ gcc git valgrind gfortran libboost-dev libboost-all-dev cmake dpkg-dev libunwind-dev libdw-dev libelf-dev libevent-dev && \
+    mkdir /source/ && cd /source && git clone --depth=1 https://framagit.org/simgrid/simgrid.git simgrid.git && \
+    cd simgrid.git && \
+    cmake -DCMAKE_INSTALL_PREFIX=/usr/ -Denable_model-checking=ON -Denable_documentation=OFF -Denable_java=OFF -Denable_smpi=ON -Denable_compile_optimizations=ON . && \
+    make -j4 install && \
+    chown -R user:user /source && \
+    mkdir debian/ && touch debian/control && dpkg-shlibdeps --ignore-missing-info lib/*.so -llib/ -O/tmp/deps && \
+    apt remove -y git valgrind libboost-dev libboost-all-dev cmake dpkg-dev libunwind-dev libdw-dev libelf-dev libevent-dev && \
+    apt install -y `sed -e 's/shlibs:Depends=//' -e 's/([^)]*)//g' -e 's/,//g' /tmp/deps` && rm /tmp/deps && \
+    apt autoremove -y && apt autoclean && apt clean
+
+USER user
+
+# The build and dependencies are not cleaned in this image since it's it's highly experimental so far    
+#    git reset --hard master && git clean -dfx && \
+
index ff7ddcc..e5dfaa8 100644 (file)
@@ -1,12 +1,26 @@
 # Base image 
 FROM simgrid/stable
 
+RUN apt update && apt -y upgrade 
+
+RUN apt install -y sudo && \
+    groupadd -g 999 user && \
+    useradd -r -u 999 -g user user && \
+    echo "user ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/user && \
+    chmod 0440 /etc/sudoers.d/user && \
+    mkdir -p /home/user && \
+    chown -R user:user /home/user
+
 # - Clone simgrid-template-s4u, as it is needed by the tutorial
 # - Add an empty makefile advising to run cmake before make, just in case
-RUN apt update && apt install -y pajeng r-base r-cran-ggplot2 r-cran-dplyr r-cran-devtools cmake g++ git libboost-all-dev flex bison&& \
+RUN apt install -y pajeng r-base r-cran-ggplot2 r-cran-dplyr r-cran-devtools cmake g++ git libboost-all-dev flex bison&& \
     cd /source && \
     git clone --depth=1 https://framagit.org/simgrid/simgrid-template-s4u.git simgrid-template-s4u.git && \
     printf "master-workers ping-pong:\n\t@echo \"Please run the following command before make:\";echo \"    cmake .\"; exit 1" > Makefile &&\
-    apt autoremove -y && apt clean && apt autoclean
+    chown -R user:user /source && \
+    apt autoremove -y && apt clean && apt autoclean && \
+    chown -R user:user /source
 
 RUN Rscript -e "library(devtools); install_github('schnorr/pajengr');"
+
+CMD ["su", "-", "user", "-c", "/bin/bash"]
index 77df661..640620e 100644 (file)
@@ -1,10 +1,23 @@
 # Base image 
-FROM simgrid/unstable
+FROM simgrid/stable
+
+RUN apt update && apt -y upgrade 
+
+RUN apt install -y sudo && \
+    groupadd -g 999 user && \
+    useradd -r -u 999 -g user user && \
+    echo "user ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/user && \
+    chmod 0440 /etc/sudoers.d/user && \
+    mkdir -p /home/user && \
+    chown -R user:user /home/user
 
 # - Clone simgrid-template-smpi, as it is needed by the tutorial
-RUN apt update && apt install -y pajeng libssl-dev r-base r-cran-ggplot2 r-cran-dplyr r-cran-devtools build-essential g++ gfortran git libboost-all-dev cmake flex bison && \
+RUN apt install -y pajeng libssl-dev r-base r-cran-ggplot2 r-cran-dplyr r-cran-devtools build-essential g++ gfortran git libboost-all-dev cmake flex bison && \
     cd /source && \
-    git clone --depth=1 https://framagit.org/simgrid/simgrid-template-smpi.git simgrid-template-smpi.git && \    
+    git clone --depth=1 https://framagit.org/simgrid/simgrid-template-smpi.git simgrid-template-smpi.git && \
+    chown -R user:user /source && \
     apt autoremove -y && apt clean && apt autoclean
     
 RUN Rscript -e "library(devtools); install_github('schnorr/pajengr');"
+
+CMD ["su", "-", "user", "-c", "/bin/bash"]
index 6d32dfc..4d3f75f 100644 (file)
@@ -4,7 +4,7 @@ FROM debian:testing
 # - Install SimGrid's dependencies 
 # - Compile and install SimGrid itself. Clean the tree.
 # - Remove everything that was installed, and re-install what's needed by the SimGrid libraries before the Gran Final Cleanup
-RUN apt update && apt -y upgrade && \
+RUN apt-get --allow-releaseinfo-change update && apt -y upgrade && \
     apt install -y g++ gcc git valgrind default-jdk gfortran libboost-dev libboost-all-dev cmake dpkg-dev && \
     mkdir /source/ && cd /source && git clone --depth=1 https://framagit.org/simgrid/simgrid.git simgrid.git && \
     cd simgrid.git && \
index 06cc7a7..ee4e44c 100644 (file)
@@ -5,6 +5,7 @@ default:
        @echo "   make unstable   -> build the git version of SimGrid (with SMPI, w/o MC)"
        @echo "   make tuto-s4u   -> build all what you need to take the S4U tutorial"
        @echo "   make tuto-smpi  -> build all what you need to take the SMPI tutorial"
+       @echo "   make tuto-mc    -> build the git version of SimGrid (with SMPI and MC)"
        @echo "   make all        -> build all but stable (ie, build-deps unstable tuto-s4u tuto-smpi)"
        @echo "   make push       -> push all images to the cloud"
        @echo "All our images are based on debian:testing"
@@ -13,12 +14,11 @@ default:
 all: build-deps unstable tuto-s4u tuto-smpi
 
 stable:
-       export last_tag=`wget https://framagit.org/simgrid/simgrid/tags 2>/dev/null -O - | grep /simgrid/simgrid/tags/v | head -n1  | sed 's/[^>]*>//' | sed 's/<.*//'`; \
-       export url=`wget https://framagit.org/simgrid/simgrid/tags/$${last_tag} 2>/dev/null -O - | grep SimGrid- | perl -pe 's/.*?<li><a href="//' | sed 's/tar.gz.*/tar.gz/'` ;\
-       echo URL:$${url} ; \
+       export last_tag=$$(wget https://framagit.org/simgrid/simgrid/tags 2>/dev/null -O - | grep /simgrid/simgrid/-/tags/v | head -n1  | sed 's/[^>]*>//' | sed 's/<.*//'); \
+       export DLURL=$$(wget https://framagit.org/simgrid/simgrid/tags/$${last_tag} 2>/dev/null -O - | grep SimGrid- | perl -pe 's/.*?<a href="//' | sed 's/tar.gz.*/tar.gz/'); \
        docker build -f Dockerfile.stable \
-                --build-arg DLURL=$${url} \
-                -t simgrid/stable:latest \
+                --build-arg DLURL=$${DLURL} \
+                -t simgrid/stable:latest \
                  -t simgrid/stable:$${last_tag} \
                 $(DOCKER_EXTRA) \
                  . | tee > stable.log
@@ -37,6 +37,13 @@ build-deps:
                 $(DOCKER_EXTRA) \
                  . | tee > build-deps.log
 
+tuto-mc:
+       docker build -f Dockerfile.tuto-mc \
+                -t simgrid/tuto-mc:latest \
+                 -t simgrid/tuto-mc:$$(date --iso-8601) \
+                $(DOCKER_EXTRA) \
+                 . | tee > tuto-mc.log
+
 build-deps-stable:
        docker build -f Dockerfile.build-deps-stable \
                 -t simgrid/build-deps-stable:latest \
@@ -64,3 +71,4 @@ push:
        docker push simgrid/unstable
        docker push simgrid/tuto-s4u
        docker push simgrid/tuto-smpi
+       docker push simgrid/tuto-mc
index 724853c..66b8af3 100644 (file)
@@ -4,6 +4,8 @@ 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_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/graphicator.tesh)
 
+install(TARGETS graphicator DESTINATION bin/)
+
 ## Clean generated files
 get_directory_property(extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
 set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${extra_clean_files};${CMAKE_CURRENT_BINARY_DIR}/simgrid.trace;")
index c9bb23b..d2f54c1 100755 (executable)
@@ -102,18 +102,4 @@ if [ -f Testing/TAG ] ; then
    #generate sloccount report
    sloccount --duplicates --wide --details $WORKSPACE | grep -v -e '.git' -e 'mpich3-test' -e 'sloccount.sc' -e 'isp/umpire' -e 'build/' -e 'xml_coverage.xml' -e 'CTestResults_memcheck.xml' -e 'DynamicAnalysis.xml' > $WORKSPACE/sloccount.sc
 
-   #upload files to codacy. CODACY_PROJECT_TOKEN must be setup !
-   if ! [ -z $CODACY_PROJECT_TOKEN ]
-   then 
-     for report in $BUILDFOLDER/java_cov*
-     do
-       if [ ! -e "$report" ]; then continue; fi
-       java -jar /home/ci/codacy-coverage-reporter-*-assembly.jar report -l Java -r $report --partial
-     done
-     java -jar /home/ci/codacy-coverage-reporter-*-assembly.jar final
-
-     java -jar /home/ci/codacy-coverage-reporter-*-assembly.jar report -l Python -r $BUILDFOLDER/python_coverage.xml
-     java -jar /home/ci/codacy-coverage-reporter-*-assembly.jar report -l C -f -r $BUILDFOLDER/xml_coverage.xml
-     java -jar /home/ci/codacy-coverage-reporter-*-assembly.jar report -l CPP -f -r $BUILDFOLDER/xml_coverage.xml
-   fi
-fi
+fi || exit 42
index e05907f..65d8628 100755 (executable)
@@ -12,6 +12,7 @@ export LC_ALL=C
 
 echo "XXXX Cleanup previous attempts. Remaining content of /tmp:"
 rm -rf /tmp/simgrid-java*
+rm -rf /var/tmp/simgrid-java*
 rm -rf /tmp/jvm-*
 find /builds/workspace/SimGrid/ -name "hs_err_pid*.log" | xargs rm -f
 ls /tmp
@@ -26,7 +27,7 @@ fi
 
 # usage: die status message...
 die () {
-  local status=${1:-1}
+  status=${1:-1}
   shift
   [ $# -gt 0 ] || set -- "Error - Halting"
   echo "$@" >&2
@@ -72,8 +73,7 @@ elif [ -f /etc/debian_version ]; then
     os=Debian
     ver=$(cat /etc/debian_version)
 elif [ -f /etc/redhat-release ]; then
-    os=""
-    ver=$(cat /etc/redhat-release)
+    read -r os ver < /etc/redhat-release
 elif [ -f /usr/bin/sw_vers ]; then
     os=$(sw_vers -productName)
     ver=$(sw_vers -productVersion)
@@ -163,7 +163,7 @@ echo "XX   pwd: "$(pwd)
 echo "XX"
 
 cmake -G"$GENERATOR" -Denable_documentation=OFF $WORKSPACE
-make dist -j$NUMBER_OF_PROCESSORS
+make dist -j $NUMBER_OF_PROCESSORS
 SIMGRID_VERSION=$(cat VERSION)
 
 echo "XX"
@@ -211,7 +211,7 @@ cmake -G"$GENERATOR" ${INSTALL:+-DCMAKE_INSTALL_PREFIX=$INSTALL} \
 #  -Denable_lua=$(onoff test "$build_mode" != "DynamicAnalysis") \
 set +x
 
-make -j$NUMBER_OF_PROCESSORS VERBOSE=1 tests
+make -j $NUMBER_OF_PROCESSORS VERBOSE=1 tests
 
 echo "XX"
 echo "XX Run the tests"
index 306b191..3570212 100755 (executable)
@@ -1,7 +1,12 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 get_boost(){
-    grep -m 1 "Boost version:" ./consoleText | sed  "s/.*-- Boost version: \([a-zA-Z0-9\.]*\)/\1/g"
+    BOOST=$(grep -m 1 "Boost version:" ./consoleText | sed  "s/.*-- Boost version: \([a-zA-Z0-9\.]*\)/\1/g")
+    if [ -z "$BOOST" ]
+    then
+      BOOST=$(grep -m 1 "Found Boost:" ./consoleText | sed  "s/.*-- Found Boost:.*found suitable version \"\([a-zA-Z0-9\.]*\)\",.*/\1/g")
+    fi
+  echo $BOOST
 }
 
 get_compiler(){
@@ -17,7 +22,7 @@ get_cmake(){
 }
 
 get_ns3(){
-  found=$(grep -c "NS-3 found" ./consoleText)
+  found=$(grep -c "ns-3 found" ./consoleText)
   if [ $found != 0 ]; then
     echo "✔"
   else
@@ -45,13 +50,85 @@ fi
 
 #get the list of nodes on jenkins
 wget --quiet ${BUILD_URL}/consoleText >/dev/null 2>&1
-nodes=($(grep -rR "Triggering SimGrid ? Debug," ./consoleText | sed "s/Triggering SimGrid ? Debug,\(.*\)/\1/g"| sort))
+nodes=($(sed -n 's/^Triggering SimGrid [^ ]* Debug,//p' ./consoleText| sort))
 rm consoleText
 
 
 echo "<br>Description of the nodes - Automatically updated by project_description.sh script - Don't edit here<br><br>
-<table id="configuration-matrix"> 
-<tr class="matrix-row">  <td class="matrix-header" style="min-width:75px">Name of the Builder</td><td class="matrix-header" style="min-width:75px">OS</td><td class="matrix-header" style="min-width:75px">Compiler</td><td class="matrix-header" style="min-width:75px">Boost</td><td class="matrix-header" style="min-width:75px">Java</td><td class="matrix-header" style="min-width:75px">Cmake</td><td class="matrix-header" style="min-width:50px">NS3</td><td class="matrix-header" style="min-width:50px">Python</td></tr>"
+<script>
+function compareVersion(v1, v2) {
+    if (typeof v1 !== 'string') return false;
+    if (typeof v2 !== 'string') return false;
+    v1 = v1.split('.');
+    v2 = v2.split('.');
+    const k = Math.min(v1.length, v2.length);
+    for (let i = 0; i < k; ++ i) {
+        v1[i] = parseInt(v1[i], 10);
+        v2[i] = parseInt(v2[i], 10);
+        if (v1[i] > v2[i]) return 1;
+        if (v1[i] < v2[i]) return -1;        
+    }
+    return v1.length == v2.length ? 0: (v1.length < v2.length ? -1 : 1);
+}</script>
+<script>
+function sortTable(n, type) {
+  var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0;
+  table = document.getElementById('configuration-matrix');
+  switching = true;
+  //Set the sorting direction to ascending:
+  dir = 'asc'; 
+  /*Make a loop that will continue until
+  no switching has been done:*/
+  while (switching) {
+    //start by saying: no switching is done:
+    switching = false;
+    rows = table.rows;
+    /*Loop through all table rows (except the
+    first, which contains table headers):*/
+    for (i = 1; i < (rows.length - 1); i++) {
+      //start by saying there should be no switching:
+      shouldSwitch = false;
+      /*Get the two elements you want to compare,
+      one from current row and one from the next:*/
+      x = rows[i].getElementsByTagName('TD')[n];
+      y = rows[i + 1].getElementsByTagName('TD')[n];
+      /*check if the two rows should switch place,
+      based on the direction, asc or desc:*/
+      if (dir == 'asc') {
+        if(type == 'version'){
+          shouldSwitch = (compareVersion(x.innerHTML.toLowerCase(), y.innerHTML.toLowerCase()) > 0);
+        }else{
+          shouldSwitch = (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase());
+        }
+      } else if (dir == 'desc') {
+        if(type == 'version'){
+          shouldSwitch = (compareVersion(x.innerHTML.toLowerCase(), y.innerHTML.toLowerCase()) < 0);
+        }else{
+          shouldSwitch = (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase());
+        }
+      }
+      if (shouldSwitch)
+        break;
+    }
+    if (shouldSwitch) {
+      /*If a switch has been marked, make the switch
+      and mark that a switch has been done:*/
+      rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);
+      switching = true;
+      //Each time a switch is done, increase this count by 1:
+      switchcount ++;      
+    } else {
+      /*If no switching has been done AND the direction is 'asc',
+      set the direction to 'desc' and run the while loop again.*/
+      if (switchcount == 0 && dir == 'asc') {
+        dir = 'desc';
+        switching = true;
+      }
+    }
+  }
+}</script>
+<table id=configuration-matrix> 
+<tr class=matrix-row>  <td class=matrix-header style=min-width:75px onclick='sortTable(0);'>Name of the Builder</td><td class=matrix-header style=min-width:75px onclick='sortTable(1);'>OS</td><td class=matrix-header style=min-width:75px onclick='sortTable(2);'>Compiler</td><td class=matrix-header style=min-width:75px onclick=\"sortTable(3, 'version');\">Boost</td><td class=matrix-header style=min-width:75px onclick=\"sortTable(4,'version');\">Java</td><td class=matrix-header style=min-width:75px onclick=\"sortTable(5,'version');\">Cmake</td><td class=matrix-header style=min-width:50px onclick='sortTable(6);'>ns-3</td><td class=matrix-header style=min-width:50px onclick='sortTable(7);'>Python</td><td class=matrix-header style=min-width:50px onclick='sortTable(1);'>Debug</td><td class=matrix-header style=min-width:50px onclick='sortTable(1);'>MC</td></tr>"
 
 for node in "${nodes[@]}"
 do
@@ -67,25 +144,50 @@ do
     ns3=$(get_ns3)
     py=$(get_python)
     os=$(grep -m 1 "OS Version" ./consoleText| sed "s/OS Version : \(.*\)/\1/g")
-    echo "<tr> <td class=\"matrix-leftcolumn\">$node</td><td class=\"matrix-cell\" style=\"text-align:left\">$os</td><td class=\"matrix-cell\" style=\"text-align:left\">$compiler</td><td class=\"matrix-cell\" style=\"text-align:left\">$boost</td><td class=\"matrix-cell\" style=\"text-align:left\">$java</td><td class=\"matrix-cell\" style=\"text-align:left\">$cmake</td><td class=\"matrix-cell\" style=\"text-align:center\">$ns3</td><td class=\"matrix-cell\" style=\"text-align:center\">$py</td></tr>"
+    
+    color1=""
+    color2=""
+    #in case of success, replace blue by green in status balls
+    wget --quiet https://ci.inria.fr/simgrid/buildStatus/text?job=SimGrid%2Fbuild_mode%3DDebug%2Cnode%3D${node} -O status  >/dev/null 2>&1
+    status=$(cat status)
+    if [ $status == "Success" ]; then
+      color1="&color=green"
+    fi
+    rm status
+    statusmc="<img src=https://ci.inria.fr/simgrid/images/24x24/grey.png>"
+    wget --quiet https://ci.inria.fr/simgrid/buildStatus/text?job=SimGrid%2Fbuild_mode%3DModelChecker%2Cnode%3D${node} -O status >/dev/null 2>&1
+    status=$(cat status)
+    if [ $status ]; then 
+      if [ $status == "Success" ]; then
+        color2="&color=green"
+      fi
+      statusmc="<a href=\"build_mode=ModelChecker,node=${node}/\"><img src=\"https://ci.inria.fr/simgrid/job/SimGrid/build_mode=ModelChecker,node=${node}/badge/icon?style=ball-24x24${color2}\"/>"
+    fi
+    rm status
+    echo "<tr> <td class=\"matrix-leftcolumn\">$node</td><td class=\"matrix-cell\" style=\"text-align:left\">$os</td><td class=\"matrix-cell\" style=\"text-align:left\">$compiler</td><td class=\"matrix-cell\" style=\"text-align:left\">$boost</td><td class=\"matrix-cell\" style=\"text-align:left\">$java</td><td class=\"matrix-cell\" style=\"text-align:left\">$cmake</td><td class=\"matrix-cell\" style=\"text-align:center\">$ns3</td><td class=\"matrix-cell\" style=\"text-align:center\">$py</td><td class="matrix-cell" style="text-align:center"><a href="build_mode=Debug,node=${node}/"><img src="https://ci.inria.fr/simgrid/job/SimGrid/build_mode=Debug,node=${node}/badge/icon?style=ball-24x24${color1}"/></td><td class="matrix-cell" style="text-align:center">${statusmc}</td></tr>"
     rm consoleText
 done
 
 
 #Travis - get ID of the last jobs with the API
 BUILD_NUM=$(curl -s 'https://api.travis-ci.org/repos/simgrid/simgrid/builds?limit=1' | grep -o '^\[{"id":[0-9]*,' | grep -o '[0-9]' | tr -d '\n')
-BUILDS=($(curl -s https://api.travis-ci.org/repos/simgrid/simgrid/builds/${BUILD_NUM} | grep -o '{"id":[0-9]*,' | grep -o '[0-9]*'| tail -n 2))
+BUILDS=($(curl -s https://api.travis-ci.org/repos/simgrid/simgrid/builds/${BUILD_NUM} | grep -o '{"id":[0-9]*,' | grep -o '[0-9]*'| tail -n 3))
+OS=($(curl -s https://api.travis-ci.org/repos/simgrid/simgrid/builds/${BUILD_NUM} | grep -o '"os":"[a-z]*",' | sed  's/"os":"\([a-z]*\)",/\1/g'| tail -n 3))
 
 for id in "${!BUILDS[@]}"
 do
     wget --quiet https://api.travis-ci.org/v3/job/${BUILDS[$id]}/log.txt -O ./consoleText >/dev/null 2>&1
     sed -i -e "s/\r//g" ./consoleText
-    if [ $id == 0 ]; then
-      node="<a href=\"https://travis-ci.org/simgrid/simgrid\">travis-linux</a>"
-      os="Ubuntu 16.04 (<a href=\"https://docs.travis-ci.com/user/reference/xenial/\">Xenial</a>) 64 bits"
-    else
-      node="<a href=\"https://travis-ci.org/simgrid/simgrid\">travis-mac</a>"
-      os="Mac OSX High Sierra (kernel: 17.4.0)"
+
+    if [ ${OS[$id]} == "linux" ]; then
+      node="travis-linux (<a href=\"https://travis-ci.org/simgrid/simgrid/jobs/${BUILDS[$id]}\">log</a>)"
+      os="Ubuntu  <a href=\"https://docs.travis-ci.com/user/reference/bionic/\">18.04 bionic</a>"
+    elif [ ${OS[$id]} == "osx" ]; then
+      node="travis-mac (<a href=\"https://travis-ci.org/simgrid/simgrid/jobs/${BUILDS[$id]}\">log</a>)"
+      os="Mac OS X <a href=\"https://docs.travis-ci.com/user/reference/osx/\">Mojave (10.14)</a> "
+    elif [ ${OS[$id]} == "windows" ]; then
+      node="travis-windows (<a href=\"https://travis-ci.org/simgrid/simgrid/jobs/${BUILDS[$id]}\">log</a>)"
+      os="Windows <a href=\"https://docs.travis-ci.com/user/reference/windows/\">10 v17134</a>"
     fi
     boost=$(get_boost)
     compiler=$(get_compiler)
@@ -93,7 +195,12 @@ do
     cmake=$(get_cmake)
     ns3=$(get_ns3)
     py=$(get_python)
-    echo "<tr> <td class=\"matrix-leftcolumn\">$node</td><td class=\"matrix-cell\" style=\"text-align:left\">$os</td><td class=\"matrix-cell\" style=\"text-align:left\">$compiler</td><td class=\"matrix-cell\" style=\"text-align:left\">$boost</td><td class=\"matrix-cell\" style=\"text-align:left\">$java</td><td class=\"matrix-cell\" style=\"text-align:left\">$cmake</td><td class=\"matrix-cell\" style=\"text-align:center\">$ns3</td><td class=\"matrix-cell\" style=\"text-align:center\">$py</td></tr>"
+    success=$(grep -m 1 "Your build exited with 0" ./consoleText)
+    ball="red.png"
+    if [ -n "$success" ]; then
+      ball="blue.png"
+    fi
+    echo "<tr> <td class=\"matrix-leftcolumn\">$node</td><td class=\"matrix-cell\" style=\"text-align:left\">$os</td><td class=\"matrix-cell\" style=\"text-align:left\">$compiler</td><td class=\"matrix-cell\" style=\"text-align:left\">$boost</td><td class=\"matrix-cell\" style=\"text-align:left\">$java</td><td class=\"matrix-cell\" style=\"text-align:left\">$cmake</td><td class=\"matrix-cell\" style=\"text-align:center\">$ns3</td><td class=\"matrix-cell\" style=\"text-align:center\">$py</td><td class=\"matrix-cell\" style=\"text-align:center\"><img src=https://ci.inria.fr/simgrid/images/24x24/${ball}></td><td class=\"matrix-cell\" style=\"text-align:center\"><img src=https://ci.inria.fr/simgrid/images/24x24/grey.png></td></tr>"
     rm consoleText
 done
 
@@ -109,7 +216,12 @@ java=$(get_java)
 cmake=$(get_cmake)
 ns3=$(get_ns3)
 py=$(get_python)
-echo "<tr> <td class=\"matrix-leftcolumn\">$node</td><td class=\"matrix-cell\" style=\"text-align:left\">$os</td><td class=\"matrix-cell\" style=\"text-align:left\">$compiler</td><td class=\"matrix-cell\" style=\"text-align:left\">$boost</td><td class=\"matrix-cell\" style=\"text-align:left\">$java</td><td class=\"matrix-cell\" style=\"text-align:left\">$cmake</td><td class=\"matrix-cell\" style=\"text-align:center\">$ns3</td><td class=\"matrix-cell\" style=\"text-align:center\">$py</td></tr>"
+success=$(grep -m 1 "Build success" ./consoleText)
+ball="red.png"
+if [ -n "$success" ]; then
+  ball="blue.png"
+fi
+echo "<tr> <td class=\"matrix-leftcolumn\">$node</td><td class=\"matrix-cell\" style=\"text-align:left\">$os</td><td class=\"matrix-cell\" style=\"text-align:left\">$compiler</td><td class=\"matrix-cell\" style=\"text-align:left\">$boost</td><td class=\"matrix-cell\" style=\"text-align:left\">$java</td><td class=\"matrix-cell\" style=\"text-align:left\">$cmake</td><td class=\"matrix-cell\" style=\"text-align:center\">$ns3</td><td class=\"matrix-cell\" style=\"text-align:center\">$py</td><td class=\"matrix-cell\" style=\"text-align:center\"><img src=https://ci.inria.fr/simgrid/images/24x24/${ball}></td><td class=\"matrix-cell\" style=\"text-align:center\"><img src=https://ci.inria.fr/simgrid/images/24x24/grey.png></td></tr>"
 rm consoleText
 
 echo "</table>"
diff --git a/tools/sg_xml_energy_ponecore_to_pepsilon.py b/tools/sg_xml_energy_ponecore_to_pepsilon.py
new file mode 100755 (executable)
index 0000000..b78523e
--- /dev/null
@@ -0,0 +1,94 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright (c) 2019. The SimGrid Team.
+# All rights reserved.
+
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the license (GNU LGPL) which comes with this package.
+
+'''Update 3-part energy consumption syntax in SimGrid XML platform files.
+
+- watt_per_state: "pIdle:pOneCore:pFull" -> "pIdle:pEpsilon:pFull"
+  This is done by computing pEpsilon from pOneCore, pFull and #core.'''
+import fnmatch
+import os
+import sys
+import xml.etree.ElementTree as ET
+
+class TreeBuilderWithComments(ET.TreeBuilder):
+    def comment(self, data):
+        self.start(ET.Comment, {})
+        self.data(data)
+        self.end(ET.Comment)
+
+def update_platform_file(filename):
+    comment_tb = TreeBuilderWithComments()
+    tree = ET.parse(filename, parser=ET.XMLParser(target=comment_tb))
+    root = tree.getroot()
+
+    parent_dict = {c:p for p in root.iter() for c in p}
+
+    for prop in root.iter('prop'):
+        if 'id' in prop.attrib and prop.attrib['id'] == 'watt_per_state':
+            # Parse energy consumption and core count
+            values_str = "".join(prop.attrib['value'].split()) # remove whitespaces
+            values = values_str.split(',')
+            nb_core = 1
+            if 'core' in parent_dict[prop].attrib:
+                nb_core = int(parent_dict[prop].attrib['core'])
+            if nb_core < 1: raise Exception(f'Invalid core count: {nb_core}')
+
+            # If a middle value is given, pIdle:pOneCore:pFull is assumed
+            # and converted to pIdle:pEpsilon:pFull
+            consumption_per_pstate = []
+            update_required = False
+            for value in values:
+                powers = value.split(':')
+                if len(powers) == 3:
+                    update_required = True
+                    (pIdle, p1, pFull) = [float(x) for x in powers]
+                    if nb_core == 1:
+                        if p1 != pFull:
+                            raise Exception('Invalid energy consumption: ' +
+                                "A 1-core host has pOneCore != pFull " +
+                                f'({p1} != {pFull}).\n' +
+                                'Original watt_per_state value: "{}"'.format(prop.attrib['value']))
+                        pEpsilon = pFull
+                    else:
+                        pEpsilon = p1 - ((pFull - p1) / (nb_core - 1))
+                    consumption_per_pstate.append(f"{pIdle}:{pEpsilon}:{pFull}")
+                    if pIdle > pEpsilon:
+                        print(f"WARNING: pIdle > pEpsilon ({pIdle} > {pEpsilon})")
+                else: # len(powers) == 2
+                    if nb_core == 1:
+                        update_required = True
+                        (pIdle, pFull) = [float(x) for x in powers]
+                        pEpsilon = pFull
+                        consumption_per_pstate.append(f"{pIdle}:{pEpsilon}:{pFull}")
+                        print(f"WARNING: putting {pFull} as pEpsilon by default for a single core")
+                    else:
+                        consumption_per_pstate.append(value)
+
+            if update_required:
+                updated_value = ', '.join(consumption_per_pstate)
+                print(f'"{values_str}" -> "{updated_value}" (core={nb_core})')
+                prop.attrib['value'] = updated_value
+
+    with open(filename, 'w', encoding='utf-8') as output_file:
+        # xml.etree.ElementTree does not handle doctypes =/
+        # https://stackoverflow.com/questions/15304229/convert-python-elementtree-to-string
+        content = '''<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
+{}
+'''.format(ET.tostring(root, encoding="unicode"))
+        output_file.write(content)
+
+if __name__ == '__main__':
+    usage = "usage: {cmd} FILE\n\n{doc}".format(cmd=sys.argv[0], doc=__doc__)
+
+    if len(sys.argv) != 2:
+        print(usage)
+        sys.exit(1)
+
+    update_platform_file(sys.argv[1])
index 31dd44d..f42b336 100755 (executable)
@@ -148,7 +148,7 @@ Rename the FULLDUPLEX sharing into SPLITDUPLEX.
 
 =item
 
-In <host> and <peer>, rename the 'availability_file' atribute into 'speed_file'.
+In <host> and <peer>, rename the 'availability_file' attribute into 'speed_file'.
 
 =back
 
index 0bd941b..fc0255b 100755 (executable)
@@ -42,12 +42,7 @@ sub output_macro {
     print "#define ". uc($id) ." smpi_trace_set_call_location(__FILE__,__LINE__); call ". ucfirst $id ."\n";
   }
   else {
-    if ($id eq "MPI_Init") {
-      print "#define MPI_Init(...) ({ smpi_process_init(__VA_ARGS__); smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Init(NULL, NULL); })\n";
-    }
-    else {
-      print "#define $id(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); $id(__VA_ARGS__); })\n";
-    }
+    print "#define $id(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); $id(__VA_ARGS__); })\n";
   }
 }
 
index ed44f89..77e6bf9 100644 (file)
@@ -3,7 +3,8 @@ configure_file("${CMAKE_HOME_DIRECTORY}/tools/tesh/tesh.py"
 
 
 foreach(x setenv set-output-ignore set-output-sort set-return set-timeout background basic bg-basic bg-set-signal
-          catch-return catch-signal catch-timeout catch-wrong-output cd color ignore-regexp IO-bigsize IO-broken-pipe IO-orders)
+          catch-all-bg-output catch-return catch-signal catch-timeout catch-timeout-output catch-wrong-output cd color
+          ignore-regexp IO-bigsize IO-broken-pipe IO-orders)
   set(tesh_files  ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}.tesh)
   if(NOT enable_memcheck AND NOT WIN32)
     ADD_TESH(tesh-self-${x} --setenv bindir=${CMAKE_BINARY_DIR}/bin ${CMAKE_HOME_DIRECTORY}/tools/tesh/${x}.tesh)
diff --git a/tools/tesh/catch-all-bg-output.tesh b/tools/tesh/catch-all-bg-output.tesh
new file mode 100644 (file)
index 0000000..e0ba89a
--- /dev/null
@@ -0,0 +1,37 @@
+#!/usr/bin/env tesh
+
+# Checks that background processes' output is not lost when a foreground
+# process (or another background process) does not match its expectation.
+
+! expect return 2
+< ! timeout 3
+< & sh -c 'echo "I crash in background" && sleep 2'
+< 
+< ! timeout 2
+< & sh -c 'echo "I also crash in background" && sleep 1'
+< 
+< ! timeout 1
+< $ sh -c 'echo "I crash in foreground"'
+$ ${bindir:=.}/tesh
+> Test suite from stdin
+> [(stdin):8] sh -c 'echo "I crash in foreground"'
+> Output of <(stdin):8> mismatch:
+> --- expected
+> +++ obtained
+> @@ -0,0 +1 @@
+> +I crash in foreground
+> Test suite `(stdin)': NOK (<(stdin):8> output mismatch)
+> [(stdin):5] sh -c 'echo "I also crash in background" && sleep 1'
+> Output of <(stdin):5> mismatch:
+> --- expected
+> +++ obtained
+> @@ -0,0 +1 @@
+> +I also crash in background
+> Test suite `(stdin)': NOK (<(stdin):5> output mismatch)
+> [(stdin):2] sh -c 'echo "I crash in background" && sleep 2'
+> Output of <(stdin):2> mismatch:
+> --- expected
+> +++ obtained
+> @@ -0,0 +1 @@
+> +I crash in background
+> Test suite `(stdin)': NOK (<(stdin):2> output mismatch)
diff --git a/tools/tesh/catch-timeout-output.tesh b/tools/tesh/catch-timeout-output.tesh
new file mode 100644 (file)
index 0000000..227d93c
--- /dev/null
@@ -0,0 +1,19 @@
+#!/usr/bin/env tesh
+
+# Checks that the output of a timeout process can be printed.
+
+! expect return 2
+< ! timeout 1
+< $ sh -c 'echo "I crashed" && sleep 6'
+> Test suite from stdin
+> [(stdin):2] sh -c 'echo "I crashed" && sleep 6'
+> Test suite `(stdin)': NOK (<(stdin):2> timeout after 1 sec)
+> Output of <(stdin):2> mismatch:
+> --- expected
+> +++ obtained
+> @@ -0,0 +1 @@
+> +I crashed
+> Test suite `(stdin)': NOK (<(stdin):2> output mismatch)
+$ ${bindir:=.}/tesh
+
+
index 0bee596..a246c16 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env tesh
 
-# This suite must be functional because we changed the timeout value to 10
+# This suite must be functional because we changed the timeout value to 1
 # before sleeping 6 secs.
 
 ! expect return 3
index dc7b629..f9ef1d4 100755 (executable)
@@ -33,6 +33,7 @@ import re
 import difflib
 import signal
 import argparse
+import time
 
 if sys.version_info[0] == 3:
     import subprocess
@@ -71,6 +72,7 @@ class Singleton(_Singleton('SingletonMeta', (object,), {})):
 SIGNALS_TO_NAMES_DICT = dict((getattr(signal, n), n)
                              for n in dir(signal) if n.startswith('SIG') and '_' not in n)
 
+return_code = 0
 
 # exit correctly
 def tesh_exit(errcode):
@@ -114,25 +116,47 @@ except NameError:
 #
 
 # Global variable. Stores which process group should be killed (or None otherwise)
-pgtokill = None
+running_pids = list()
 
+# Tests whether the process is dead already
+def process_is_dead(pid):
+    try:
+        os.kill(pid, 0)
+    except ProcessLookupError:
+        return True
+    except OSError as err:
+        if err.errno == errno.ESRCH: # ESRCH == No such process. The process is now dead
+            return True
+    return False
 
-def kill_process_group(pgid):
-    if pgid is None:  # Nobody to kill. We don't know who to kill on windows, or we don't have anyone to kill on signal handler
+# This function send TERM signal + KILL signal after 0.2s to the group of the specified process
+def kill_process_group(pid):
+    if pid is None:  # Nobody to kill. We don't know who to kill on windows, or we don't have anyone to kill on signal handler
         return
 
-    # print("Kill process group {}".format(pgid))
+    try:
+        pgid = os.getpgid(pid)
+    except:
+        # os.getpgid failed. Ok, don't cleanup.
+        return
+    
     try:
         os.killpg(pgid, signal.SIGTERM)
+        if process_is_dead(pid):
+            return
+        time.sleep(0.2)
+        os.killpg(pgid, signal.SIGKILL)
     except OSError:
         # os.killpg failed. OK. Some subprocesses may still be running.
         pass
 
-
 def signal_handler(signal, frame):
     print("Caught signal {}".format(SIGNALS_TO_NAMES_DICT[signal]))
-    if pgtokill is not None:
-        kill_process_group(pgtokill)
+    global running_pids
+    running_pids_copy = running_pids # Just in case of interthread conflicts.
+    for pid in running_pids_copy:
+        kill_process_group(pid)
+    running_pids.clear()
     tesh_exit(5)
 
 
@@ -319,14 +343,20 @@ class Cmd(object):
 
         self.args += TeshState().args_suffix
 
-        print("[" + FileReader().filename + ":" + str(self.linenumber) + "] " + self.args)
+        logs = list()
+        logs.append("[{file}:{number}] {args}".format(file=FileReader().filename,
+            number=self.linenumber, args=self.args))
 
         args = shlex.split(self.args)
-        #print (args)
 
-        global pgtokill
+        global running_pids
+        local_pid = None
+        global return_code
 
         try:
+            preexec_function = None
+            if not isWindows():
+                preexec_function = lambda: os.setpgid(0, 0)
             proc = subprocess.Popen(
                 args,
                 bufsize=1,
@@ -334,27 +364,32 @@ class Cmd(object):
                 stdout=subprocess.PIPE,
                 stderr=subprocess.STDOUT,
                 universal_newlines=True,
-                start_new_session=True)
-            try:
-                if not isWindows():
-                    pgtokill = os.getpgid(proc.pid)
-            except OSError:
-                # os.getpgid failed. OK. No cleanup.
-                pass
+                preexec_fn=preexec_function)
+            if not isWindows():
+                local_pid = proc.pid
+                running_pids.append(local_pid)
         except PermissionError:
-            print("[" + FileReader().filename + ":" + str(self.linenumber) +
-                  "] Cannot start '" + args[0] + "': The binary is not executable.")
-            print("[" + FileReader().filename + ":" + str(self.linenumber) + "] Current dir: " + os.getcwd())
-            tesh_exit(3)
+            logs.append("[{file}:{number}] Cannot start '{cmd}': The binary is not executable.".format(
+                file=FileReader().filename, number=self.linenumber, cmd=args[0]))
+            logs.append("[{file}:{number}] Current dir: {dir}".format(file=FileReader().filename,
+                number=self.linenumber, dir=os.getcwd()))
+            return_code = max(3, return_code)
+            print('\n'.join(logs))
+            return
         except NotADirectoryError:
-            print("[" + FileReader().filename + ":" + str(self.linenumber) + "] Cannot start '" +
-                  args[0] + "': The path to binary does not exist.")
-            print("[" + FileReader().filename + ":" + str(self.linenumber) + "] Current dir: " + os.getcwd())
-            tesh_exit(3)
+            logs.append("[{file}:{number}] Cannot start '{cmd}': The path to binary does not exist.".format(
+                file=FileReader().filename, number=self.linenumber, cmd=args[0]))
+            logs.append("[{file}:{number}] Current dir: {dir}".format(file=FileReader().filename,
+                number=self.linenumber, dir=os.getcwd()))
+            return_code = max(3, return_code)
+            print('\n'.join(logs))
+            return
         except FileNotFoundError:
-            print("[" + FileReader().filename + ":" + str(self.linenumber) +
-                  "] Cannot start '" + args[0] + "': File not found")
-            tesh_exit(3)
+            logs.append("[{file}:{number}] Cannot start '{cmd}': File not found.".format(
+                file=FileReader().filename, number=self.linenumber, cmd=args[0]))
+            return_code = max(3, return_code)
+            print('\n'.join(logs))
+            return
         except OSError as osE:
             if osE.errno == 8:
                 osE.strerror += "\nOSError: [Errno 8] Executed scripts should start with shebang line (like #!/usr/bin/env sh)"
@@ -363,24 +398,33 @@ class Cmd(object):
         cmdName = FileReader().filename + ":" + str(self.linenumber)
         try:
             (stdout_data, stderr_data) = proc.communicate("\n".join(self.input_pipe), self.timeout)
-            pgtokill = None
+            local_pid = None
+            timeout_reached = False
         except subprocess.TimeoutExpired:
-            print("Test suite `" + FileReader().filename + "': NOK (<" +
-                  cmdName + "> timeout after " + str(self.timeout) + " sec)")
-            kill_process_group(pgtokill)
-            tesh_exit(3)
+            timeout_reached = True
+            logs.append("Test suite `{file}': NOK (<{cmd}> timeout after {timeout} sec)".format(
+                file=FileReader().filename, cmd=cmdName, timeout=self.timeout))
+            running_pids.remove(local_pid)
+            kill_process_group(local_pid)
+            # Try to get the output of the timeout process, to help in debugging.
+            try:
+                (stdout_data, stderr_data) = proc.communicate(timeout=1)
+            except subprocess.TimeoutExpired:
+                logs.append("[{file}:{number}] Could not retrieve output. Killing the process group failed?".format(
+                    file=FileReader().filename, number=self.linenumber))
+                return_code = max(3, return_code)
+                print('\n'.join(logs))
+                return
 
         if self.output_display:
-            print(stdout_data)
+            logs.append(str(stdout_data))
 
         # remove text colors
         ansi_escape = re.compile(r'\x1b[^m]*m')
         stdout_data = ansi_escape.sub('', stdout_data)
 
-        #print ((stdout_data, stderr_data))
-
         if self.ignore_output:
-            print("(ignoring the output of <" + cmdName + "> as requested)")
+            logs.append("(ignoring the output of <{cmd}> as requested)".format(cmd=cmdName))
         else:
             stdouta = stdout_data.split("\n")
             while len(stdouta) > 0 and stdouta[-1] == "":
@@ -404,7 +448,7 @@ class Cmd(object):
                     fromfile='expected',
                     tofile='obtained'))
             if len(diff) > 0:
-                print("Output of <" + cmdName + "> mismatch:")
+                logs.append("Output of <{cmd}> mismatch:".format(cmd=cmdName))
                 if self.sort >= 0:  # If sorted, truncate the diff output and show the unsorted version
                     difflen = 0
                     for line in diff:
@@ -412,15 +456,16 @@ class Cmd(object):
                             print(line)
                         difflen += 1
                     if difflen > 50:
-                        print("(diff truncated after 50 lines)")
-                    print("Unsorted observed output:\n")
+                        logs.append("(diff truncated after 50 lines)")
+                    logs.append("Unsorted observed output:\n")
                     for line in stdcpy:
-                        print(line)
+                        logs.append(line)
                 else:  # If not sorted, just display the diff
                     for line in diff:
-                        print(line)
+                        logs.append(line)
 
-                print("Test suite `" + FileReader().filename + "': NOK (<" + cmdName + "> output mismatch)")
+                logs.append("Test suite `{file}': NOK (<{cmd}> output mismatch)".format(
+                    file=FileReader().filename, cmd=cmdName))
                 if lock is not None:
                     lock.release()
                 if TeshState().keep:
@@ -432,28 +477,40 @@ class Cmd(object):
                     for line in obtained:
                         f.write("> " + line + "\n")
                     f.close()
-                    print("Obtained output kept as requested: " + os.path.abspath("obtained"))
-                tesh_exit(2)
-
-        #print ((proc.returncode, self.expect_return))
+                    logs.append("Obtained output kept as requested: {path}".format(path=os.path.abspath("obtained")))
+                return_code = max(2, return_code)
+                print('\n'.join(logs))
+                return
+
+        if timeout_reached:
+            return_code = max(3, return_code)
+            print('\n'.join(logs))
+            return
 
         if proc.returncode != self.expect_return:
             if proc.returncode >= 0:
-                print("Test suite `" + FileReader().filename + "': NOK (<" +
-                      cmdName + "> returned code " + str(proc.returncode) + ")")
+                logs.append("Test suite `{file}': NOK (<{cmd}> returned code {code})".format(
+                    file=FileReader().filename, cmd=cmdName, code=proc.returncode))
                 if lock is not None:
                     lock.release()
-                tesh_exit(2)
+                return_code = max(2, return_code)
+                print('\n'.join(logs))
+                return
             else:
-                print("Test suite `" + FileReader().filename + "': NOK (<" + cmdName +
-                      "> got signal " + SIGNALS_TO_NAMES_DICT[-proc.returncode] + ")")
+                logs.append("Test suite `{file}': NOK (<{cmd}> got signal {sig})".format(
+                    file=FileReader().filename, cmd=cmdName,
+                    sig=SIGNALS_TO_NAMES_DICT[-proc.returncode]))
                 if lock is not None:
                     lock.release()
-                tesh_exit(-proc.returncode)
+                return_code = max(max(-proc.returncode, 1), return_code)
+                print('\n'.join(logs))
+                return
 
         if lock is not None:
             lock.release()
 
+        print('\n'.join(logs))
+
     def can_run(self):
         return self.args is not None
 
@@ -469,7 +526,7 @@ if __name__ == '__main__':
     signal.signal(signal.SIGINT, signal_handler)
     signal.signal(signal.SIGTERM, signal_handler)
 
-    parser = argparse.ArgumentParser(description='tesh -- testing shell', add_help=True)
+    parser = argparse.ArgumentParser(description='tesh -- testing shell')
     group1 = parser.add_argument_group('Options')
     group1.add_argument('teshfile', nargs='?', help='Name of teshfile, stdin if omitted')
     group1.add_argument(
@@ -489,10 +546,7 @@ if __name__ == '__main__':
         action='store_true',
         help='Keep the obtained output when it does not match the expected one')
 
-    try:
-        options = parser.parse_args()
-    except SystemExit:
-        tesh_exit(1)
+    options = parser.parse_args()
 
     if options.cd is not None:
         print("[Tesh/INFO] change directory to " + options.cd)
@@ -631,7 +685,10 @@ if __name__ == '__main__':
 
     TeshState().join_all_threads()
 
-    if f.filename == "(stdin)":
-        print("Test suite from stdin OK")
+    if return_code == 0:
+        if f.filename == "(stdin)":
+            print("Test suite from stdin OK")
+        else:
+            print("Test suite `" + f.filename + "' OK")
     else:
-        print("Test suite `" + f.filename + "' OK")
+        tesh_exit(return_code)