Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'wifi_clean' into 'master'
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 6 Oct 2022 19:07:17 +0000 (19:07 +0000)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 6 Oct 2022 19:07:17 +0000 (19:07 +0000)
Wi-Fi callback mechanism

See merge request simgrid/simgrid!118

209 files changed:
.github/workflows/docker-stable.yml
.mailmap
CMakeLists.txt
ChangeLog
MANIFEST.in
NEWS
doc/doxygen/inside_release.doc
docs/source/Configuring_SimGrid.rst
docs/source/Doxyfile
docs/source/Installing_SimGrid.rst
docs/source/Platform_cpp.rst
docs/source/Release_Notes.rst
docs/source/Start_your_own_project.rst
docs/source/Tutorial_Model-checking.rst
docs/source/conf.py
docs/source/tuto_network_calibration/dahu_platform_ckmeans.cpp
examples/c/cloud-migration/cloud-migration.c
examples/cpp/CMakeLists.txt
examples/cpp/mc-failing-assert/s4u-mc-failing-assert-nodpor.tesh [new file with mode: 0644]
examples/cpp/mc-failing-assert/s4u-mc-failing-assert-statequality.tesh [new file with mode: 0644]
examples/cpp/synchro-mutex/s4u-mc-synchro-mutex.tesh
examples/python/CMakeLists.txt
examples/python/exec-ptask/exec-ptask.py [new file with mode: 0644]
examples/python/exec-ptask/exec-ptask.tesh [new file with mode: 0644]
examples/sthread/CMakeLists.txt [new file with mode: 0644]
examples/sthread/pthread-mutex-simple.c [new file with mode: 0644]
examples/sthread/pthread-mutex-simple.tesh [new file with mode: 0644]
examples/sthread/sthread-mutex-simple.c [new file with mode: 0644]
include/simgrid/Exception.hpp
include/simgrid/forward.h
include/simgrid/host.h
include/simgrid/kernel/routing/NetZoneImpl.hpp
include/simgrid/modelchecker.h
include/simgrid/plugins/file_system.h
include/simgrid/s4u/Activity.hpp
include/simgrid/s4u/Comm.hpp
include/simgrid/s4u/Exec.hpp
include/simgrid/s4u/Host.hpp
include/simgrid/simix.h
include/smpi/smpi_helpers.h
include/smpi/smpi_helpers_internal.h
include/xbt/asserts.hpp [new file with mode: 0644]
include/xbt/base.h
include/xbt/range.hpp
setup.py
sonar-project.properties
src/bindings/java/org/simgrid/NativeLib.java
src/bindings/python/simgrid_python.cpp
src/include/xbt/mmalloc.h
src/include/xbt/xbt_modinter.h
src/instr/instr_config.cpp
src/instr/instr_paje_header.cpp
src/kernel/EngineImpl.cpp
src/kernel/EngineImpl.hpp
src/kernel/activity/ActivityImpl.cpp
src/kernel/activity/CommImpl.cpp
src/kernel/activity/ExecImpl.hpp
src/kernel/activity/MailboxImpl.cpp
src/kernel/actor/ActorImpl.cpp
src/kernel/actor/CommObserver.cpp
src/kernel/actor/CommObserver.hpp
src/kernel/actor/SimcallObserver.cpp
src/kernel/actor/SimcallObserver.hpp
src/kernel/context/Context.cpp
src/kernel/context/ContextSwapped.cpp
src/kernel/context/ContextUnix.cpp
src/kernel/lmm/System.cpp
src/kernel/lmm/System.hpp
src/kernel/lmm/bmf.cpp
src/kernel/lmm/bmf.hpp
src/kernel/resource/CpuImpl.cpp
src/kernel/resource/DiskImpl.cpp
src/kernel/resource/VirtualMachineImpl.cpp
src/kernel/resource/profile/ProfileBuilder.cpp
src/kernel/routing/FatTreeZone.cpp
src/kernel/routing/NetZoneImpl.cpp
src/kernel/routing/RoutedZone.cpp
src/mc/ModelChecker.cpp
src/mc/ModelChecker.hpp
src/mc/VisitedState.cpp
src/mc/VisitedState.hpp
src/mc/api.cpp [deleted file]
src/mc/api.hpp [deleted file]
src/mc/api/ActorState.hpp [moved from src/mc/mc_pattern.hpp with 66% similarity]
src/mc/api/RemoteApp.cpp [moved from src/mc/Session.cpp with 53% similarity]
src/mc/api/RemoteApp.hpp [moved from src/mc/Session.hpp with 64% similarity]
src/mc/api/State.cpp
src/mc/api/State.hpp
src/mc/compare.cpp
src/mc/explo/CommunicationDeterminismChecker.cpp
src/mc/explo/DFSExplorer.cpp
src/mc/explo/DFSExplorer.hpp
src/mc/explo/Exploration.cpp [new file with mode: 0644]
src/mc/explo/Exploration.hpp
src/mc/explo/LivenessChecker.cpp
src/mc/explo/LivenessChecker.hpp
src/mc/explo/UdporChecker.cpp
src/mc/explo/UdporChecker.hpp
src/mc/explo/simgrid_mc.cpp
src/mc/inspect/LocationList.hpp
src/mc/inspect/mc_dwarf.cpp
src/mc/inspect/mc_unw_vmread.cpp
src/mc/mc_base.cpp
src/mc/mc_client_api.cpp
src/mc/mc_config.cpp
src/mc/mc_config.hpp
src/mc/mc_global.cpp
src/mc/mc_hash.cpp [deleted file]
src/mc/mc_hash.hpp [deleted file]
src/mc/mc_ignore.hpp [deleted file]
src/mc/mc_private.hpp
src/mc/mc_safety.hpp [deleted file]
src/mc/mc_smx.cpp [deleted file]
src/mc/remote/AppSide.cpp
src/mc/remote/AppSide.hpp
src/mc/remote/RemoteProcess.cpp
src/mc/remote/RemoteProcess.hpp
src/mc/remote/mc_protocol.h
src/mc/sosp/Snapshot.cpp
src/mc/sosp/Snapshot.hpp
src/mc/sosp/Snapshot_test.cpp
src/mc/transition/TransitionAny.cpp
src/mc/transition/TransitionComm.cpp
src/mc/transition/TransitionComm.hpp
src/mc/transition/TransitionSynchro.hpp
src/plugins/chaos_monkey.cpp
src/plugins/file_system/s4u_FileSystem.cpp
src/plugins/link_load.cpp
src/s4u/s4u_Comm.cpp
src/s4u/s4u_Engine.cpp
src/s4u/s4u_Exec.cpp
src/s4u/s4u_Host.cpp
src/s4u/s4u_Io.cpp
src/simgrid/Exception.cpp
src/simgrid/sg_config.cpp
src/simix/smx_context.cpp [deleted file]
src/smpi/bindings/smpi_f77.cpp
src/smpi/bindings/smpi_mpi.cpp
src/smpi/bindings/smpi_pmpi_file.cpp
src/smpi/bindings/smpi_pmpi_request.cpp
src/smpi/bindings/smpi_pmpi_win.cpp
src/smpi/include/private.hpp
src/smpi/include/smpi_file.hpp
src/smpi/include/smpi_replay.hpp
src/smpi/internals/smpi_bench.cpp
src/smpi/internals/smpi_config.cpp
src/smpi/internals/smpi_global.cpp
src/smpi/internals/smpi_replay.cpp
src/smpi/mpi/smpi_file.cpp
src/smpi/mpi/smpi_request.cpp
src/smpi/mpi/smpi_win.cpp
src/smpi/smpicc.in
src/smpi/smpicxx.in
src/smpi/smpiff.in
src/sthread/sthread.c [new file with mode: 0644]
src/sthread/sthread.h [new file with mode: 0644]
src/sthread/sthread_impl.cpp [new file with mode: 0644]
src/surf/HostImpl.cpp
src/surf/cpu_cas01.cpp
src/surf/network_cm02.cpp
src/surf/ptask_L07.cpp
src/surf/xml/surfxml_sax_cb.cpp
src/xbt/dict.cpp
src/xbt/dict_test.cpp
src/xbt/mmalloc/mfree.c
src/xbt/mmalloc/mm_interface.c [new file with mode: 0644]
src/xbt/mmalloc/mm_legacy.c
src/xbt/mmalloc/mm_module.c
src/xbt/mmalloc/mmalloc.c
src/xbt/mmalloc/mmorecore.c
src/xbt/mmalloc/mmprivate.h
src/xbt/mmalloc/swag.c
src/xbt/mmalloc/swag.h
src/xbt/xbt_main.cpp
teshsuite/mc/dwarf-expression/dwarf-expression.cpp
teshsuite/mc/dwarf/dwarf.cpp
teshsuite/mc/random-bug/random-bug-nocrash.tesh
teshsuite/mc/random-bug/random-bug.tesh
teshsuite/platforms/flatifier.cpp
teshsuite/platforms/flatifier.tesh
teshsuite/s4u/issue71/issue71.cpp
teshsuite/s4u/issue71/issue71.tesh
teshsuite/smpi/CMakeLists.txt
teshsuite/smpi/coll-allreduce-with-leaks/mc-coll-allreduce-with-leaks.tesh
teshsuite/smpi/coll-allreduce/coll-allreduce-automatic.tesh
teshsuite/smpi/coll-alltoall/griffon.tesh [deleted file]
teshsuite/smpi/coll-alltoallv/coll-alltoallv.c
teshsuite/smpi/io-all-at/io-all-at.tesh
teshsuite/smpi/io-all/io-all.tesh
teshsuite/smpi/io-ordered/io-ordered.tesh
teshsuite/smpi/io-shared/io-shared.tesh
teshsuite/smpi/io-simple-at/io-simple-at.tesh
teshsuite/smpi/io-simple/io-simple.tesh
teshsuite/smpi/mpich3-test/rma/CMakeLists.txt
teshsuite/xbt/CMakeLists.txt
teshsuite/xbt/mmalloc/mmalloc_32.tesh
teshsuite/xbt/mmalloc/mmalloc_64.tesh
teshsuite/xbt/mmalloc/mmalloc_test.cpp
tools/address_sanitizer.supp
tools/cmake/DefinePackages.cmake
tools/cmake/Distrib.cmake
tools/cmake/Flags.cmake
tools/cmake/MakeLib.cmake
tools/cmake/Modules/FindNS3.cmake
tools/jenkins/Coverage.sh
tools/jenkins/Flags.sh
tools/jenkins/Sanitizers.sh
tools/jenkins/build.sh
tools/jenkins/project_description.sh

index 43de9e3..68a4ec3 100644 (file)
@@ -39,15 +39,15 @@ jobs:
           grep SIMGRID_VERSION_PATCH CMakeLists.txt| grep -q 'SIMGRID_VERSION_PATCH "0"' || (echo "Only run this action on stable source";exit 1)
           cd tools/docker
           make stable
-          docker push simgrid/stable
+          docker push --all-tags simgrid/stable
       - name: Create the failure Message
         if: ${{ failure() }}
         run: |
-          ver=$(git describe --tags --abbrev=0) echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building STABLE docker image $ver! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
+          ver=$(grep set.SIMGRID_VERSION_MINOR CMakeLists.txt|sed 's/[^"]*"//'|sed 's/".*$//') echo "{\"attachments\": [{\"color\": \"#FF0000\", \"text\":\"Failure when building STABLE docker image v3.$ver! See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
       - name: Create the success Message
         if: ${{ success() }}
         run: |
-          ver=$(git describe --tags --abbrev=0) echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"Docker STABLE image $ver built and pushed successfully! ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
+          ver=$(grep set.SIMGRID_VERSION_MINOR CMakeLists.txt|sed 's/[^"]*"//'|sed 's/".*$//') echo "{\"attachments\": [{\"color\": \"#00FF00\", \"text\":\"Docker STABLE image v3.$ver built and pushed successfully! ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}]}" > mattermost.json
       - uses: mattermost/action-mattermost-notify@master
         env:
           MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
index c279754..f7f551c 100644 (file)
--- a/.mailmap
+++ b/.mailmap
@@ -39,7 +39,9 @@ Clément Courageux-Sudan <clement.courageux-sudan@inria.fr> <clement.courageux-s
 Clément Courageux-Sudan <clement.courageux-sudan@inria.fr> <clementcourageuxsudan@gmail.com>
 Augustin Degomme <adegomme@gmail.com>
 Augustin Degomme <adegomme@gmail.com> <13270544+adegomme@users.noreply.github.com>
+Augustin Degomme <adegomme@gmail.com> <26892-adegomme@users.noreply.framagit.org>
 Augustin Degomme <adegomme@gmail.com> <ad254919@cardamome.intra.cea.fr>
+Augustin Degomme <adegomme@gmail.com> <adegomme@ampere03>
 Augustin Degomme <adegomme@gmail.com> <adegomme@users.noreply.github.com>
 Augustin Degomme <adegomme@gmail.com> <augustin.degomme@imag.fr>
 Augustin Degomme <adegomme@gmail.com> <augustin.degomme@unibas.ch>
@@ -108,6 +110,7 @@ Pierre Navarro <pierre.navarro@imag.fr> <pierre@.(none)>
 Pierre Navarro <pierre.navarro@imag.fr> <pierre@chontal.imag.fr>
 Pierre Navarro <pierre.navarro@imag.fr> <pierre@erie.imag.fr>
 Pierre Navarro <pierre.navarro@imag.fr> <pierre@workhorse-2.local>
+Lucas Nesi <lucas.nesi@inf.ufrgs.br> <lucas31nesi@hotmail.com>
 Lucas Nussbaum <lucas.nussbaum@loria.fr> <lucas@lucas-nussbaum.net>
 Tien-Dat Phan <tien-dat.phan@irisa.fr>
 Martin Quinson <martin.quinson@ens-rennes.fr> <(no author)@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
index ca5ab2d..c0e208c 100644 (file)
@@ -1,7 +1,7 @@
 # Build the version number
 
 set(SIMGRID_VERSION_MAJOR "3")
-set(SIMGRID_VERSION_MINOR "31")
+set(SIMGRID_VERSION_MINOR "32")
 set(SIMGRID_VERSION_PATCH "1") # odd => git branch; even => stable release or released snapshot
 
 if(${SIMGRID_VERSION_PATCH} EQUAL "0")
@@ -23,6 +23,7 @@ cmake_minimum_required(VERSION 3.5)
 if(NOT CMAKE_VERSION VERSION_LESS "3.9")
   cmake_policy(SET CMP0069 NEW)
 endif()
+# once we move >= 3.13, we should use target_link_option in examples/sthread
 message(STATUS "Cmake version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}")
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_HOME_DIRECTORY}/tools/cmake/Modules)
 
@@ -52,7 +53,7 @@ if (CMAKE_COMPILER_IS_GNUCC)
   endif()
 endif()
 
-## We need a decent support of the C++14 and C11 standards
+## We need a decent support of the C++17 and C11 standards
 set(CMAKE_CXX_STANDARD 17)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
@@ -228,12 +229,10 @@ if(enable_ns3)
   include(FindNS3)
   if (SIMGRID_HAVE_NS3)
     if (NOT NS3_VERSION EQUAL "3-dev" AND NS3_VERSION VERSION_LESS "3.28")
-      message(FATAL_ERROR "SimGrid needs at least ns-3.28. Please upgrade or disable that cmake option.")
+      message(FATAL_ERROR "SimGrid needs ns-3 in version 3.28 or higher. Please upgrade or disable that cmake option.")
     endif()
     set(SIMGRID_HAVE_NS3 1)
-    foreach(lib core csma point-to-point internet network applications wifi)
-      set(SIMGRID_DEP "${SIMGRID_DEP} -lns${NS3_VERSION}-${lib}${NS3_SUFFIX}")
-    endforeach()
+    set(SIMGRID_DEP "${SIMGRID_DEP} ${NS3_LIBRARIES}")
   else()
     message(FATAL_ERROR "Cannot find ns-3. Please install it (apt-get install ns3 libns3-dev) or disable that cmake option")
   endif()
@@ -413,6 +412,8 @@ if(enable_model-checking)
     message(WARNING "FreeBSD + Model-Checking + Java = too much for now. Disabling the Java bindings.")
     set(enable_java FALSE)
   endif()
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gdwarf-4")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gdwarf-4")
 else()
   SET(SIMGRID_HAVE_MC 0)
   set(HAVE_MMALLOC 0)
@@ -455,27 +456,27 @@ else()
     OUTPUT_VARIABLE compile_makecontext_output)
 
   #If can have both context
-  if(compile_makecontext)
-    set(HAVE_UCONTEXT_CONTEXTS 1)
-    message(STATUS "Support for ucontext factory ok.")
-  else()
+  if(NOT compile_makecontext)
     message(STATUS "Error: <ucontext.h> exists, but makecontext is not compilable. Compilation output:\n ${compile_makecontext_output}")
     message(STATUS "No ucontext factory: makecontext() is not compilable.")
-  endif()
-
-  # Stack setup (size and address)
-  try_run(RUN_makecontext_VAR COMPILE_makecontext_VAR
-    ${CMAKE_BINARY_DIR} ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_stacksetup.c
-    RUN_OUTPUT_VARIABLE stack_setup)
-
-  LIST(LENGTH stack_setup stack_setup_len)
-  if("${stack_setup_len}" STREQUAL "2")
-    LIST(GET stack_setup 0 makecontext_addr)
-    LIST(GET stack_setup 1 makecontext_size)
-    set(sg_makecontext_stack_addr "#define sg_makecontext_stack_addr(skaddr) (${makecontext_addr})")
-    set(sg_makecontext_stack_size "#define sg_makecontext_stack_size(sksize) (${makecontext_size})")
   else()
-    message(FATAL_ERROR "Could not figure out the stack setup. Compil: ${RUN_makecontext_VAR}. Exec: ${COMPILE_makecontext_VAR}. Output: ${stack_setup}")
+    message(STATUS "Support for ucontext factory ok.")
+    set(HAVE_UCONTEXT_CONTEXTS 1)
+
+    # Stack setup (size and address)
+    try_run(RUN_makecontext_VAR COMPILE_makecontext_VAR
+      ${CMAKE_BINARY_DIR} ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_stacksetup.c
+      RUN_OUTPUT_VARIABLE stack_setup)
+
+    LIST(LENGTH stack_setup stack_setup_len)
+    if("${stack_setup_len}" STREQUAL "2")
+      LIST(GET stack_setup 0 makecontext_addr)
+      LIST(GET stack_setup 1 makecontext_size)
+      set(sg_makecontext_stack_addr "#define sg_makecontext_stack_addr(skaddr) (${makecontext_addr})")
+      set(sg_makecontext_stack_size "#define sg_makecontext_stack_size(sksize) (${makecontext_size})")
+    else()
+      message(FATAL_ERROR "Could not figure out the stack setup. Compil: ${RUN_makecontext_VAR}. Exec: ${COMPILE_makecontext_VAR}. Output: ${stack_setup}")
+    endif()
   endif()
 endif()
 
index 2ef1975..bebb7f5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
-SimGrid (3.31.1) NOT RELEASED YET (v3.32 expected June 21. 2022, 09:13 UTC)
+SimGrid (3.32.1) not released yet (target december 22)
+
+S4U:
+ - Activity::set_remaining() is not public anymore. Use for example
+   Comm::set_payload_size() to change the size of the simulated data.
+
+----------------------------------------------------------------------------
+
+SimGrid (3.32) October 3. 2022.
+
+The Wiedervereinigung release. Germany was reunited 32 years ago.
+
+General:
+ - SimGrid now requires a compiler with C++17 support to compile the lib.
+   Our public headers still allow the user code to be compiled in C++14.
+ - Support graphviz v3 and ns-3 v3.36 (older versions are still supported).
+ - Tested with clang (v11, v13, v14 and v16), gcc (v7 to v13) and IntelCC v2022.2
+
+S4U:
+ - API evolutions:
+   - kill signal Comm::on_completion that was not working anyway.
+   - Expose signals Activity::on_suspend and Activity::on_resume
+   - New macro xbt_enforce(): similar to xbt_assert(), but throws an AssertionError
+     instead of calling abort().
+   - New: s4u::Exec::get_thread_count()
+ - Various cleanups around virtual machines:
+   - host_by_name() and friends now only return hosts. VMs are now excluded.
+   - It is now impossible to search a VM by name globally.
+     You can only search VM by name on a given PM, so either you know
+     the PM on which your VM runs and you can search by name, or you need
+     to manually iterate over all PMs to search this VM.
+   - The s4u::VirtualMachine constructor is now deprecated.
+     Please use s4u::Host::create_vm() instead.
+   - Rename s4u::VirtualMachine::on_creation() to on_vm_creation() to
+     avoid confusion with s4u:Host::on_creation() that is inherited.
+     Also s4u::VirtualMachine::on_destruction -> on_vm_destruction().
+ - Bug fixes:
+   - One-sided communications (Comm::sendto) can now be detached,
+     and should now be more resilient to network and host faults.
 
 Python:
-  - Added the following bindings / examples:
-    - Comm (now 100% covers the C++ interface):
-      - Comm.dst_data_size, Comm.mailbox, Comm.sender, Comm.start_time, Comm.finish_time
-      - Comm.state_str [examples: examples/python/comm-failure/, examples/python/comm-host2host/]
-      - Comm.remaining [examples: examples/python/comm-host2host/, examples/python/comm-suspend/]
-      - Comm.set_payload_size [example: examples/python/comm-host2host/]
-      - Comm.set_rate [example: examples/python/comm-throttling/]
-      - Comm.sendto, Comm.sendto_init, Comm.sendto_async [example: examples/python/comm-host2host/]
-      - Comm.start, Comm.suspend, Comm.resume [example: examples/python/comm-host2host/]
-      - Comm.test_any [example: examples/python/comm-testany/]
-      - Comm.wait_until [example: examples/python/comm-waituntil/]
-    - Engine:
-      - Engine.host_by_name [example: examples/python/comm-host2host/]
-      - Engine.mailbox_by_name_or_create [example: examples/python/comm-pingpong/]
-    - Mailbox: Mailbox.ready [example: examples/python/comm-ready/]
+ - Added the following bindings / examples:
+   - Comm (now 100% covers the C++ interface):
+     - Comm.dst_data_size, Comm.mailbox, Comm.sender, Comm.start_time, Comm.finish_time
+     - Comm.state_str [examples: examples/python/comm-failure/, examples/python/comm-host2host/]
+     - Comm.remaining [examples: examples/python/comm-host2host/, examples/python/comm-suspend/]
+     - Comm.set_payload_size [example: examples/python/comm-host2host/]
+     - Comm.set_rate [example: examples/python/comm-throttling/]
+     - Comm.sendto, Comm.sendto_init, Comm.sendto_async [example: examples/python/comm-host2host/]
+     - Comm.start, Comm.suspend, Comm.resume [example: examples/python/comm-host2host/]
+     - Comm.test_any [example: examples/python/comm-testany/]
+     - Comm.wait_until [example: examples/python/comm-waituntil/]
+   - Engine:
+     - Engine.host_by_name [example: examples/python/comm-host2host/]
+     - Engine.mailbox_by_name_or_create [example: examples/python/comm-pingpong/]
+     - Engine.set_config
+   - Mailbox: Mailbox.ready [example: examples/python/comm-ready/]
+   - Ptask [example: examples/python/exec-ptask/]:
+     - this_actor.exec_init
+     - this_actor.parallel_execute
+     - Exec.suspend
+     - Exec.wait_for
+ - Added an AssertionError exception that may be thrown in case of error.
+   For instance, creating two hosts with the same name will now throw this exception
+   instead of killing the interpreter.
+
+SMPI:
+ - Implement MPI_File_get_type_extent(), MPI_File_s/get_atomicity() and
+   MPI_File_get_byte_offset()
+ - Intercept getpid() calls to return the simulated ones.
+ - Fix various bugs in MPI IO.
 
 Platform description & visualization:
-  - More robust sanity checks for platforms, to reject unallowed topologies with
-    a proper error message.
-  - One new C++ platform example, supernode.cpp. A Python script (supernode.py)
-    demonstrates how we can generate a nice graphical representation of the
-       platform.
-
-Tools:
-  - Enhancements to the graphicator tool:
-       - Allow to dump the platform topology as a CSV file representing the edges
-         of the graph (in addition to the DOT format).
-       - Fix graphicator for "cluster" topologies (e.g. fat-tree, dragonfly).
+ - More robust sanity checks for platforms, to reject forbidden topologies with
+   a proper error message.
+ - New platform example: supernode.cpp and supernode.py.
+   The Python version generates a nice graphical representation of the platform.
+ - Bug fixes around fat-tree topologies.
+ - Allow to dump the platform topology as a CSV file representing the graph edges
+   with platform_graph_export_csv() (similar to the DOT export).
+ - Fix graphicator for "cluster" topologies (e.g. fat-tree, dragonfly).
+
+Models:
+ - Fix a bug when using ptasks with multicores (FG!111).
+
+Model-Checker:
+ - First bits of sthread, that intercepts pthread operations at runtime.
+   The intend is to use it together with simgrid-mc, but it is TBD.
+ - Sync MBI generators with upstream changes.
+ - Various cosmetics, small bug fixes and inner refactorings
 
 Fixed bugs (FG#.. -> FramaGit bugs; FG!.. -> FG merge requests)
  (FG: issues on Framagit; GH: issues on GitHub)
  - FG#105: "Variable penalty should not be negative!" with in-flight messages and bandwidth profiles
  - FG#109: Application time reported by --cfg=smpi/display-timing:yes is wrong
+ - FG#110: Wait_any does not trigger new model solve when host events occur
+ - FG#111: Wrong execution time in rare cases when using multicore
+ - FG!98: Re-enable the tests for legacy stochastic profiles
+ - FG!109: Trigger new engine solve upon host events such as host on/off
+ - FG!116: SMPI/replay: Fix issue with recv of size =0
 
 ----------------------------------------------------------------------------
 
-S4U:
- - kill signal Comm::on_completion that was not working anyway.
- - Expose signals Activity::on_suspend and Activity::on_resume
-
 SimGrid (3.31) March 22. 2022.
 
 The ненасильство release. We stand against war.
index 3dd0753..65352d5 100644 (file)
@@ -316,6 +316,8 @@ include examples/cpp/mc-centralized-mutex/s4u-mc-centralized-mutex.cpp
 include examples/cpp/mc-centralized-mutex/s4u-mc-centralized-mutex.tesh
 include examples/cpp/mc-electric-fence/s4u-mc-electric-fence.cpp
 include examples/cpp/mc-electric-fence/s4u-mc-electric-fence.tesh
+include examples/cpp/mc-failing-assert/s4u-mc-failing-assert-nodpor.tesh
+include examples/cpp/mc-failing-assert/s4u-mc-failing-assert-statequality.tesh
 include examples/cpp/mc-failing-assert/s4u-mc-failing-assert.cpp
 include examples/cpp/mc-failing-assert/s4u-mc-failing-assert.tesh
 include examples/cpp/network-factors/s4u-network-factors.cpp
@@ -557,6 +559,8 @@ include examples/python/exec-cpu-nonlinear/exec-cpu-nonlinear.py
 include examples/python/exec-cpu-nonlinear/exec-cpu-nonlinear.tesh
 include examples/python/exec-dvfs/exec-dvfs.py
 include examples/python/exec-dvfs/exec-dvfs.tesh
+include examples/python/exec-ptask/exec-ptask.py
+include examples/python/exec-ptask/exec-ptask.tesh
 include examples/python/exec-remote/exec-remote.py
 include examples/python/exec-remote/exec-remote.tesh
 include examples/python/io-degradation/io-degradation.py
@@ -710,6 +714,9 @@ 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 examples/sthread/pthread-mutex-simple.c
+include examples/sthread/pthread-mutex-simple.tesh
+include examples/sthread/sthread-mutex-simple.c
 include src/include/catch_simgrid.hpp
 include teshsuite/java/semaphoregc/SemaphoreGC.java
 include teshsuite/java/semaphoregc/semaphoregc.tesh
@@ -933,7 +940,6 @@ 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-alltoall/griffon.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
@@ -1974,6 +1980,7 @@ include examples/smpi/comm_dynamic_costs/CMakeLists.txt
 include examples/smpi/replay_multiple/CMakeLists.txt
 include examples/smpi/replay_multiple_manual_deploy/CMakeLists.txt
 include examples/smpi/smpi_s4u_masterworker/CMakeLists.txt
+include examples/sthread/CMakeLists.txt
 include include/simgrid/Exception.hpp
 include include/simgrid/actor.h
 include include/simgrid/barrier.h
@@ -2055,6 +2062,7 @@ include include/xbt.h
 include include/xbt/Extendable.hpp
 include include/xbt/PropertyHolder.hpp
 include include/xbt/asserts.h
+include include/xbt/asserts.hpp
 include include/xbt/automaton.h
 include include/xbt/automaton.hpp
 include include/xbt/backtrace.hpp
@@ -2272,18 +2280,18 @@ include src/kernel/timer/Timer.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/VisitedState.cpp
 include src/mc/VisitedState.hpp
-include src/mc/api.cpp
-include src/mc/api.hpp
+include src/mc/api/ActorState.hpp
+include src/mc/api/RemoteApp.cpp
+include src/mc/api/RemoteApp.hpp
 include src/mc/api/State.cpp
 include src/mc/api/State.hpp
 include src/mc/compare.cpp
 include src/mc/explo/CommunicationDeterminismChecker.cpp
 include src/mc/explo/DFSExplorer.cpp
 include src/mc/explo/DFSExplorer.hpp
+include src/mc/explo/Exploration.cpp
 include src/mc/explo/Exploration.hpp
 include src/mc/explo/LivenessChecker.cpp
 include src/mc/explo/LivenessChecker.hpp
@@ -2316,17 +2324,11 @@ 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_mmu.hpp
-include src/mc/mc_pattern.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_safety.hpp
-include src/mc/mc_smx.cpp
 include src/mc/remote/AppSide.cpp
 include src/mc/remote/AppSide.hpp
 include src/mc/remote/Channel.cpp
@@ -2398,7 +2400,6 @@ include src/simgrid/sg_config.cpp
 include src/simgrid/sg_version.cpp
 include src/simgrid/util.hpp
 include src/simix/libsmx.cpp
-include src/simix/smx_context.cpp
 include src/smpi/bindings/smpi_f77.cpp
 include src/smpi/bindings/smpi_f77_coll.cpp
 include src/smpi/bindings/smpi_f77_comm.cpp
@@ -2585,6 +2586,9 @@ include src/smpi/smpif90.in
 include src/smpi/smpiff.in
 include src/smpi/smpirun.in
 include src/smpi/smpitools.sh
+include src/sthread/sthread.c
+include src/sthread/sthread.h
+include src/sthread/sthread_impl.cpp
 include src/surf/HostImpl.cpp
 include src/surf/HostImpl.hpp
 include src/surf/cpu_cas01.cpp
@@ -2648,6 +2652,7 @@ 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_interface.c
 include src/xbt/mmalloc/mm_legacy.c
 include src/xbt/mmalloc/mm_module.c
 include src/xbt/mmalloc/mmalloc.c
diff --git a/NEWS b/NEWS
index f610e53..7752c9f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,22 @@
+                    _               _____  __________
+__   _____ _ __ ___(_) ___  _ __   |___ / |___ /___ /
+\ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   |_ \ |_ \
+ \ V /  __/ |  \__ \ | (_) | | | |  ___) | ___) |__) |
+  \_/ \___|_|  |___/_|\___/|_| |_| |____(_)____/____/
+               (not released yet)
                     _               _____  _________
 __   _____ _ __ ___(_) ___  _ __   |___ / |___ /___ \
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   |_ \ __) |
  \ V /  __/ |  \__ \ | (_) | | | |  ___) | ___) / __/
   \_/ \___|_|  |___/_|\___/|_| |_| |____(_)____/_____|
-               (unreleased)
+               October 3. 2022
+
+The Wiedervereinigung release. Germany was reunited 32 years ago.
+
+  * Various cleanups around the virtual machines API
+  * Improved Python platform generation (more robust, easier to use)
+  * Further complete Python bindings (Comm, Engine, ptasks)
+  * (+ internal refactoring, MANY bug fixes and documentation improvement)
 
                     _               _____  _____ _
 __   _____ _ __ ___(_) ___  _ __   |___ / |___ // |
@@ -17,7 +30,8 @@ The ненасильство release. We stand against war.
   * Refactoring the model-checker, enabling synchronization objects and future improvements
   * Introducing BMF sharing, enabling ptasks in regular models (experimental)
   * Further complete Python bindings (Mutex, Semaphore and Barrier)
- * (+ internal refactoring, many bug fixes and documentation improvement)
+  * (+ internal refactoring, many bug fixes and documentation improvement)
+
                     _               _____  _____  ___
 __   _____ _ __ ___(_) ___  _ __   |___ / |___ / / _ \
 \ \ / / _ \ '__/ __| |/ _ \| '_ \    |_ \   |_ \| | | |
index 1620515..4e64209 100644 (file)
@@ -90,6 +90,9 @@ Please apply the following checklist before releasing.
 - Update the simgrid/package.py for spack: https://gitlab.inria.fr/solverstack/spack-repo
 - Push the stable branch to github to rebuild and push the stable Docker images
   - It downloads the latest tag on framagit
+  - If it was done automatically at some point, make sure that it's really the latest stable, 
+    as things get sometimes out of synch to the point that the github action re-build the previous release. 
+    If this happens, just rerun the docker-stable action. Nothing should have been broken.
   - Doing the same manually: cd tools/docker && make stable && make tuto-s4u tuto-smpi
     (tuto-mc is not based on simgrid/stable but rebuilds from the git)
   - Once the new images are built, trigger a rebuild of the simgrid-template-{s4u,smpi} repositories on framagit
index f907c9d..4ea9206 100644 (file)
@@ -119,6 +119,7 @@ Existing Configuration Items
 - **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/setenv:** :ref:`cfg=model-check/setenv`
 - **model-check/termination:** :ref:`cfg=model-check/termination`
 - **model-check/timeout:** :ref:`cfg=model-check/timeout`
 - **model-check/visited:** :ref:`cfg=model-check/visited`
@@ -769,6 +770,15 @@ The ``model-check/communications-determinism`` and
 communication determinism mode of the model checker, which checks
 determinism properties of the communications of an application.
 
+.. _cfg=model-check/setenv:
+
+Passing environment variables
+.............................
+
+You can specify extra environment variables to be set in the verified application
+with ``model-check/setenv``. For example, you can preload a library as follows:
+``-cfg=model-check/setenv:LD_PRELOAD=toto;LD_LIBRARY_PATH=/tmp``.
+
 .. _options_mc_perf:
 
 Verification Performance Considerations
index c9ea8a3..72b2f58 100644 (file)
@@ -69,7 +69,7 @@ PREDEFINED             += \
     XBT_ATTRIB_NORETURN= \
     XBT_ATTRIB_UNUSED= \
     XBT_LOG_NEW_DEFAULT_SUBCATEGORY(cname,parent,desc)= \
-    XBT_ATTRIB_DEPRECATED_v333(mesg)= \
     XBT_ATTRIB_DEPRECATED_v334(mesg)= \
     XBT_ATTRIB_DEPRECATED_v335(mesg)= \
-    XBT_ATTRIB_DEPRECATED_v336(mesg)=
+    XBT_ATTRIB_DEPRECATED_v336(mesg)= \
+    XBT_ATTRIB_DEPRECATED_v337(mesg)=
index 2626419..e1234ab 100644 (file)
@@ -111,8 +111,8 @@ Getting the Dependencies
 ^^^^^^^^^^^^^^^^^^^^^^^^
 
 C++ compiler (either g++, clang, or icc).
-  We use the C++14 standard, and older compilers tend to fail on
-  us. It seems that g++ 5.0 or higher is required nowadays (because of
+  We use the C++17 standard, and older compilers tend to fail on
+  us. It seems that g++ 7.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 regression test suite.
@@ -122,11 +122,11 @@ cmake (v3.5).
   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 CentOS / Fedora: ``yum install boost-devel``
+  - On CentOS / Fedora: ``dnf install boost-devel``
   - On macOS with homebrew: ``brew install boost``
 Eigen3 (optional)
   - On Debian / Ubuntu: ``apt install libeigen3-dev``
-  - On CentOS / Fedora: ``yum install eigen3-devel``
+  - On CentOS / Fedora: ``dnf install eigen3-devel``
   - On macOS with homebrew: ``brew install eigen``
   - Use EIGEN3_HINT to specify where it's installed if cmake doesn't find it automatically.
 Java (optional):
@@ -146,7 +146,7 @@ Grab the last **stable release** from `FramaGit
 
    $ tar xf simgrid-3-XX.tar.gz
    $ cd simgrid-*
-   $ cmake -DCMAKE_INSTALL_PREFIX=/opt/simgrid .
+   $ cmake -DCMAKE_INSTALL_PREFIX=/opt/simgrid -GNinja.
    $ make
    $ make install
 
index 75abec5..e0aad12 100644 (file)
@@ -155,7 +155,7 @@ Note that the leaves and loopback links are defined through callbacks, as follow
 
     /* create each leaf in the Fat-Tree, return a pair composed of: <object (host, zone), gateway> */
     static std::pair<simgrid::kernel::routing::NetPoint*, simgrid::kernel::routing::NetPoint*>
-    create_hostzone(const sg4::NetZone* zone, const std::vector<unsigned int>& /*coord*/, int id)
+    create_hostzone(const sg4::NetZone* zone, const std::vector<unsigned long>& /*coord*/, unsigned long id)
     {
       /* creating zone */
       std::string hostname = "host" + std::to_string(id);
index 6dfa36e..b4353ab 100644 (file)
@@ -484,8 +484,8 @@ with another one <https://en.wikipedia.org/wiki/Partial_order_reduction>`_), the
 This was efficient and nice in C, but it prevented us from using C++ features such as opaque ``std::function`` data types. As such, it hindered the
 ongoing SimDAG++ code reorganization toward SimGrid4, where all activity classes should be homogeneously written in modern C++.
 
-This release introduces a new design, where the simcalls are given object-oriented ``Observers`` that can serialize the relevant information over the wire. 
-This information is used on the checker side to build ``Transition`` objects that the application simcalls. The checker code is now much simpler, as the 
+This release introduces a new design, where the simcalls are given object-oriented ``Observers`` that can serialize the relevant information over the wire.
+This information is used on the checker side to build ``Transition`` objects that the application simcalls. The checker code is now much simpler, as the
 formal logic is not spoiled with system-level tricks to retrieve the needed information.
 
 This cleaned design allowed us to finally implement the support for mutexes, semaphores and barriers in the model-checker (condition variables are still
@@ -494,9 +494,9 @@ Simix, a central element of the SimGrid 3 design, was also finally removed: the
 old, non-free ISP test suite by the one from the `MPI Bug Initiative <https://hal.archives-ouvertes.fr/hal-03474762>`_ (not all tests are activated yet).
 This will eventually help improving the robustness of Mc SimGrid.
 
-These changes unlock the future of Mc SimGrid. For the next releases, we plan to implement another exploration algorithm based on event unfoldings (using 
-`The Anh Pham's thesis <https://tel.archives-ouvertes.fr/tel-02462074/document>`_), the exploration of scenarios where the actors get killed and/or where
-communications timeout, and the addition of a `wrapper to pthreads <https://hal.inria.fr/hal-02449080>`, opening the path to the verification classical
+These changes unlock the future of Mc SimGrid. For the next releases, we plan to implement another exploration algorithm based on event unfoldings (using
+`The Anh Pham's thesis <https://tel.archives-ouvertes.fr/tel-02462074>`_), the exploration of scenarios where the actors get killed and/or where
+communications timeout, and the addition of a `wrapper to pthreads <https://hal.inria.fr/hal-02449080>`_, opening the path to the verification classical
 multithreaded applications.
 
 
@@ -528,6 +528,49 @@ since it does not mix bytes and flops and has a homogeneous consumption over a s
 
 This release also introduces steadily progress **on the bindings front**, introducing in particular the Mutex, Barrier and Semaphore to your python scripts.
 
+Version 3.32 (October 3. 2022)
+------------------------------
+
+The Wiedervereinigung release. Germany was reunited 32 years ago.
+
+This release introduces tons of bugs fixes overall, and many small usability improvements contributed by the community.
+
+**On the bindings front**, we further completed the Python bindings: the whole C++ API of Comms is now accessible (and exemplified) in Python, while a
+few missing functions have been added to Engine and Mailboxes. It is also possible to manipulate ptasks from Python.
+
+The Python platform generation has also been improved. In particular, user's errors should now raise an exception instead of killing the interpreter.
+Various small improvements have been done to the graphicator tool so that you can now use jupyter to generate your platforms semi-interactively.
+
+**On the model checking front**, we did many refactoring operations behind the scene (the deprecated ``mc::api`` namespace was for example emptied and removed),
+but there are almost no user-level changes. The internal work is twofold.
+
+First, we'd like to make optional all the complexity that liveness properties require to explore the application state (dwarf, libunwind, mmalloc,
+etc) and instead only rely on fork to explore all the executions when liveness is not used. This would allow us to run the verified application under valgrind to
+ease its debugging. Some progress was made towards that goal, but we are still rather far from this goal.
+
+Second, we'd like to simplify the protocol between the model-checker and the application, to make it more robust and hopefully simplify the
+model-checker code. After release v3.31, the model-checker can properly observe the simcall of a given actor through the protocol instead of reading
+the application memory directly, but retrieving the list of actors still requires to read the remote memory, which in turn requires the aforementioned tricks on state
+introspection that we are trying to remove. This goal is much harder to achieve than it may sound in the current code base, but we
+note steady improvements in that direction.
+
+In addition to these refactoring, this version introduces ``sthread``, a tool to intercept pthread operations at run time. The goal is to use it
+together with the model-checker, but it's not working yet: we get a segfault during the initialization phase, and we failed to debug it so far. If
+only we could use valgrind on the verified application, this would probably be much easier.
+
+But we feel that it's probably better to not delay this release any further, as this tangled web will probably take time to get solved. So ``sthread``
+is included in the source even if it's not usable in MC mode yet.
+
+**On the interface front**, small API fixes and improvements have been done in S4U (in particular about virtual machines), while the support for MPI
+IO has been improved in SMPI. We also hope that ``sthread`` will help simulating OpenMP applications at some point, but it's not usable for that either.
+Hopefully in the next release.
+
+Finally, this release mostly entails maintenance work **on the model front**: a bug was fixed when using ptasks on multicore hosts, and the legacy
+stochastic generator of external load has been reintroduced.
+
+Version 3.33 (not released yet)
+-------------------------------
+
 .. |br| raw:: html
 
    <br />
index cb70ef0..4fa7172 100644 (file)
@@ -24,8 +24,9 @@ to the template itself.
 Building your project with CMake
 --------------------------------
 
-Here is a `CMakeLists.txt` that you can use as a starting point for
-your project. It builds two simulators from a given set of source files.
+Here is a `CMakeLists.txt` that you can use as a starting point for your S4U
+project (see below for MPI projects). It builds two simulators from a given set
+of source files.
 
 .. code-block:: cmake
 
@@ -59,11 +60,13 @@ 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:
+point to the full path of smpicc, smpicxx, and smpiff respectively.
+It is however not advised to set these variables from the CMakeLists.txt file directly.
+In addition, you may need to set ``SMPI_PRETEND_CC=1`` to please cmake when it tests the compiler.
 
 .. code-block:: console
 
-   $ cmake -DMPI_C_COMPILER=/opt/simgrid/bin/smpicc -DMPI_CXX_COMPILER=/opt/simgrid/bin/smpicxx -DMPI_Fortran_COMPILER=/opt/simgrid/bin/smpiff .
+   $ SMPI_PRETEND_CC=1 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 0a5f1ca..b74ef33 100644 (file)
@@ -290,6 +290,8 @@ If you want to run such analysis on your own code, out of the provided docker, t
 - You should pass some specific flags to the linker when compiling your application: ``-Wl,-znorelro -Wl,-znoseparate-code`` In the
   docker, the provided CMakeLists.txt provides them for you when compiling the provided code. ``smpicc`` and friends also add this
   parameter automatically.
+- If you get error messages complaining about the Dwarf version used, try adding ``-gdwarf-4`` to you CFLAGS and CXXFLAGS.
+  If you find a situation where this flag is needed in ``smpicc``, please report this issue.
 - Also install ``libboost-stacktrace-dev`` to display nice backtraces from the application side (the one from the model-checking side is
   available in any case, but it contains less details).
 - Mc SimGrid uses the ``ptrace`` system call to spy on the verified application. Some versions of Docker forbid the use of this call by
index 03d7271..cda228d 100644 (file)
@@ -36,7 +36,7 @@ copyright = u'2002-2022, The SimGrid Team'
 author = u'The SimGrid Team'
 
 # The short X.Y version
-version = u'3.31.1'
+version = u'3.32.1'
 
 # -- General configuration ---------------------------------------------------
 
index d47c521..dc7f1f1 100644 (file)
@@ -88,7 +88,7 @@ static SegmentedRegression read_json_file(const std::string& jsonFile, std::mt19
     double max    = it.second.get_child("max_x").get_value<double>();
     coefs[max]    = it.second.get_child("coefficient").get_value<double>();
     auto& mixture = mixtures[max];
-    if (!mixture)
+    if (not mixture)
       mixture = std::make_shared<NormalMixture>(gen);
     mixture->append(it.second.get_child("mean").get_value<double>(), it.second.get_child("sd").get_value<double>(),
                     it.second.get_child("prob").get_value<double>());
@@ -138,4 +138,4 @@ void load_platform(const sg4::Engine& e)
   seg = read_json_file("recv_ckmeans.json", gen);
   smpi_register_op_cost_callback(SmpiOperation::RECV, std::bind(&smpi_cost_cb, seg, std::placeholders::_1,
                                                                 std::placeholders::_2, std::placeholders::_3));
-}
\ No newline at end of file
+}
index 3ffb504..b1c5dc2 100644 (file)
@@ -33,7 +33,8 @@ static void migration_worker_main(int argc, char* argv[])
   const char* vm_name     = argv[1];
   const char* dst_pm_name = argv[2];
 
-  sg_vm_t vm       = (sg_vm_t)sg_host_by_name(vm_name);
+  sg_host_t src_pm = sg_host_self();
+  sg_vm_t vm       = sg_vm_by_name(src_pm, vm_name);
   sg_host_t dst_pm = sg_host_by_name(dst_pm_name);
 
   vm_migrate(vm, dst_pm);
index cacac73..1e41321 100644 (file)
@@ -90,9 +90,18 @@ foreach (example synchro-barrier synchro-mutex synchro-semaphore)
              --setenv srcdir=${CMAKE_CURRENT_SOURCE_DIR}/${example}
              --cd ${CMAKE_CURRENT_SOURCE_DIR}/${example}
              ${CMAKE_HOME_DIRECTORY}/examples/cpp/${example}/s4u-mc-${example}.tesh)
+
+    add_dependencies(tests-mc s4u-${example})
   endif()
 endforeach()
 
+if (SIMGRID_HAVE_MC)
+  # Dependency on the regular tests
+  foreach(example mc-centralized-mutex)
+    add_dependencies(tests-mc s4u-${example})
+  endforeach()
+endif()
+
 
 if(NOT HAVE_GRAPHVIZ)
   set(_dag-from-dot_disable 1)
@@ -204,6 +213,31 @@ foreach(example app-bittorrent app-masterworkers
                                              ${CMAKE_HOME_DIRECTORY}/examples/cpp/${example}/s4u-${example}.tesh)
 endforeach()
 
+# Test non-DPOR reductions on a given MC test
+foreach(example mc-failing-assert)
+  if(SIMGRID_HAVE_MC)
+# State equality is not tested because it would take about 15 hours to run that test on my machine.
+# We should first optimize mmalloc_heap_differ() which takes ~4sec for each pair to compare (maybe {175 x 174/ 2} pairs here)
+# See the comment on mmalloc_heap_differ() in compare.cpp for more info on why it's hard to optimize.
+#
+#    ADD_TESH(s4u-${example}-statequality  --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/${example}
+#                                      --setenv libdir=${CMAKE_BINARY_DIR}/lib
+#                                      --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
+#                                      --setenv srcdir=${CMAKE_CURRENT_SOURCE_DIR}/${example}
+#                                      --cd ${CMAKE_CURRENT_SOURCE_DIR}/${example}
+#                                      ${CMAKE_HOME_DIRECTORY}/examples/cpp/${example}/s4u-${example}-statequality.tesh)
+
+    ADD_TESH(s4u-${example}-nodpor    --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/${example}
+                                      --setenv libdir=${CMAKE_BINARY_DIR}/lib
+                                      --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
+                                      --setenv srcdir=${CMAKE_CURRENT_SOURCE_DIR}/${example}
+                                      --cd ${CMAKE_CURRENT_SOURCE_DIR}/${example}
+                                      ${CMAKE_HOME_DIRECTORY}/examples/cpp/${example}/s4u-${example}-nodpor.tesh)
+  endif()
+  set(tesh_files    ${tesh_files}   ${CMAKE_HOME_DIRECTORY}/examples/cpp/${example}/s4u-${example}-statequality.tesh)
+  set(tesh_files    ${tesh_files}   ${CMAKE_HOME_DIRECTORY}/examples/cpp/${example}/s4u-${example}-nodpor.tesh)
+endforeach()
+
 # Examples not accepting factories
 ##################################
 
diff --git a/examples/cpp/mc-failing-assert/s4u-mc-failing-assert-nodpor.tesh b/examples/cpp/mc-failing-assert/s4u-mc-failing-assert-nodpor.tesh
new file mode 100644 (file)
index 0000000..912b9a1
--- /dev/null
@@ -0,0 +1,20 @@
+#!/usr/bin/env tesh
+
+! expect return 1
+! timeout 300
+$ ${bindir:=.}/../../../bin/simgrid-mc --cfg=model-check/reduction:none -- ${bindir:=.}/s4u-mc-failing-assert ${platfdir}/small_platform.xml --log=root.thresh:critical
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'model-check/reduction' to 'none'
+> [0.000000] [mc_dfs/INFO] Start a DFS exploration. Reduction is: none.
+> [0.000000] [mc_ModelChecker/INFO] **************************
+> [0.000000] [mc_ModelChecker/INFO] *** PROPERTY NOT VALID ***
+> [0.000000] [mc_ModelChecker/INFO] **************************
+> [0.000000] [mc_ModelChecker/INFO] Counter-example execution trace:
+> [0.000000] [mc_ModelChecker/INFO]   1: iRecv(mbox=0)
+> [0.000000] [mc_ModelChecker/INFO]   3: iSend(mbox=0)
+> [0.000000] [mc_ModelChecker/INFO]   1: WaitComm(from 3 to 1, mbox=0, no timeout)
+> [0.000000] [mc_ModelChecker/INFO]   1: iRecv(mbox=0)
+> [0.000000] [mc_ModelChecker/INFO]   2: iSend(mbox=0)
+> [0.000000] [mc_ModelChecker/INFO]   1: WaitComm(from 2 to 1, mbox=0, no timeout)
+> [0.000000] [mc_ModelChecker/INFO] Path = 1;3;1;1;2;1
+> [0.000000] [mc_dfs/INFO] DFS exploration ended. 119 unique states visited; 36 backtracks (330 transition replays, 175 states visited overall)
+
diff --git a/examples/cpp/mc-failing-assert/s4u-mc-failing-assert-statequality.tesh b/examples/cpp/mc-failing-assert/s4u-mc-failing-assert-statequality.tesh
new file mode 100644 (file)
index 0000000..97c8085
--- /dev/null
@@ -0,0 +1,19 @@
+#!/usr/bin/env tesh
+
+! expect return 1
+! timeout 300
+$ ${bindir:=.}/../../../bin/simgrid-mc --cfg=model-check/visited:10000 -- ${bindir:=.}/s4u-mc-failing-assert ${platfdir}/small_platform.xml --log=root.thresh:critical
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'model-check/visited' to '20'
+> [0.000000] [mc_dfs/INFO] Start a DFS exploration. Reduction is: dpor.
+> [0.000000] [mc_ModelChecker/INFO] **************************
+> [0.000000] [mc_ModelChecker/INFO] *** PROPERTY NOT VALID ***
+> [0.000000] [mc_ModelChecker/INFO] **************************
+> [0.000000] [mc_ModelChecker/INFO] Counter-example execution trace:
+> [0.000000] [mc_ModelChecker/INFO]   1: iRecv(mbox=0)
+> [0.000000] [mc_ModelChecker/INFO]   3: iSend(mbox=0)
+> [0.000000] [mc_ModelChecker/INFO]   1: WaitComm(from 3 to 1, mbox=0, no timeout)
+> [0.000000] [mc_ModelChecker/INFO]   1: iRecv(mbox=0)
+> [0.000000] [mc_ModelChecker/INFO]   2: iSend(mbox=0)
+> [0.000000] [mc_ModelChecker/INFO]   1: WaitComm(from 2 to 1, mbox=0, no timeout)
+> [0.000000] [mc_ModelChecker/INFO] Path = 1;3;1;1;2;1
+> [0.000000] [mc_dfs/INFO] DFS exploration ended. 18 unique states visited; 4 backtracks (22 transition replays, 0 states visited overall)
index e7dedc4..5bec63f 100644 (file)
@@ -3,8 +3,8 @@
 p This file tests the dependencies between MUTEX transitions
 
 $ ${bindir:=.}/../../../bin/simgrid-mc --log=mc_dfs.thres:verbose --log=root.fmt="[Checker]%e%m%n" -- ${bindir:=.}/s4u-synchro-mutex --cfg=actors:1 --log=s4u_test.thres:critical --log=root.fmt="[App%e%e%e%e]%e%m%n"
-> [Checker] Start a DFS exploration. Reduction is: dpor.
 > [App    ] Configuration change: Set 'actors' to '1'
+> [Checker] Start a DFS exploration. Reduction is: dpor.
 > [Checker] Execute 1: MUTEX_LOCK(mutex: 0, owner:1) (stack depth: 1, state: 1, 0 interleaves)
 > [Checker] Execute 1: MUTEX_WAIT(mutex: 0, owner:1) (stack depth: 2, state: 2, 0 interleaves)
 > [Checker] Execute 1: MUTEX_UNLOCK(mutex: 0, owner:-1) (stack depth: 3, state: 3, 0 interleaves)
@@ -43,8 +43,8 @@ $ ${bindir:=.}/../../../bin/simgrid-mc --log=mc_dfs.thres:verbose --log=root.fmt
 > [Checker] DFS exploration ended. 13 unique states visited; 3 backtracks (18 transition replays, 3 states visited overall)
 
 $ ${bindir:=.}/../../../bin/simgrid-mc --log=mc_dfs.thres:verbose --log=root.fmt="[Checker]%e%m%n" -- ${bindir:=.}/s4u-synchro-mutex --cfg=actors:2 --log=s4u_test.thres:critical --log=root.fmt="[App%e%e%e%e]%e%m%n"
-> [Checker] Start a DFS exploration. Reduction is: dpor.
 > [App    ] Configuration change: Set 'actors' to '2'
+> [Checker] Start a DFS exploration. Reduction is: dpor.
 > [Checker] Execute 1: MUTEX_LOCK(mutex: 0, owner:1) (stack depth: 1, state: 1, 0 interleaves)
 > [Checker] Execute 1: MUTEX_WAIT(mutex: 0, owner:1) (stack depth: 2, state: 2, 0 interleaves)
 > [Checker] Execute 1: MUTEX_UNLOCK(mutex: 0, owner:-1) (stack depth: 3, state: 3, 0 interleaves)
@@ -221,6 +221,6 @@ $ ${bindir:=.}/../../../bin/simgrid-mc --log=mc_dfs.thres:verbose --log=root.fmt
 > [Checker] DFS exploration ended. 37 unique states visited; 7 backtracks (76 transition replays, 33 states visited overall)
 
 $ ${bindir:=.}/../../../bin/simgrid-mc -- ${bindir:=.}/s4u-synchro-mutex --cfg=actors:3 --log=s4u_test.thres:critical
-> [0.000000] [mc_dfs/INFO] Start a DFS exploration. Reduction is: dpor.
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'actors' to '3'
+> [0.000000] [mc_dfs/INFO] Start a DFS exploration. Reduction is: dpor.
 > [0.000000] [mc_dfs/INFO] DFS exploration ended. 85 unique states visited; 15 backtracks (240 transition replays, 141 states visited overall)
index 48f69d4..1efe8e2 100644 (file)
@@ -2,7 +2,7 @@ foreach(example actor-create actor-daemon actor-join actor-kill actor-migrate ac
         app-masterworkers
         comm-wait comm-waitall comm-waitallfor comm-waitany comm-waitfor comm-failure comm-host2host comm-pingpong
         comm-ready comm-serialize comm-suspend comm-testany comm-throttling comm-waitallfor comm-waituntil
-        exec-async exec-basic exec-dvfs exec-remote
+        exec-async exec-basic exec-dvfs exec-remote exec-ptask
         platform-profile platform-failures
         network-nonlinear clusters-multicpu io-degradation exec-cpu-nonlinear
         synchro-barrier synchro-mutex synchro-semaphore)
diff --git a/examples/python/exec-ptask/exec-ptask.py b/examples/python/exec-ptask/exec-ptask.py
new file mode 100644 (file)
index 0000000..4b2da92
--- /dev/null
@@ -0,0 +1,103 @@
+# Copyright (c) 2018-2022. The SimGrid Team. All rights reserved.
+#
+# This program 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 script does exactly the same thing as file s4u-exec-ptask.cpp
+
+import sys
+from simgrid import Actor, Engine, Host, this_actor, TimeoutException
+
+def runner():
+    hosts = Engine.instance.all_hosts
+    hosts_count = len(hosts)
+
+    # Test 1
+    this_actor.info("First, build a classical parallel activity, with 1 Gflop to execute on each node, "
+               "and 10MB to exchange between each pair")
+    computation_amounts = [1e9]*hosts_count
+    communication_amounts = [0]*hosts_count*hosts_count
+    for i in range(hosts_count):
+        for j in range(i+1, hosts_count):
+            communication_amounts[i * hosts_count + j] = 1e7
+    this_actor.parallel_execute(hosts, computation_amounts, communication_amounts)
+
+    # Test 2
+    this_actor.info("We can do the same with a timeout of 10 seconds enabled.")
+    activity = this_actor.exec_init(hosts, computation_amounts, communication_amounts)
+    try:
+        activity.wait_for(10.0)
+        sys.exit("Woops, this did not timeout as expected... Please report that bug.")
+    except TimeoutException:
+        this_actor.info("Caught the expected timeout exception.")
+        activity.cancel()
+
+    # Test 3
+    this_actor.info("Then, build a parallel activity involving only computations (of different amounts) and no communication")
+    computation_amounts = [3e8, 6e8, 1e9]
+    communication_amounts = []
+    this_actor.parallel_execute(hosts, computation_amounts, communication_amounts)
+
+    # Test 4
+    this_actor.info("Then, build a parallel activity with no computation nor communication (synchro only)")
+    computation_amounts = []
+    this_actor.parallel_execute(hosts, computation_amounts, communication_amounts)
+
+    # Test 5
+    this_actor.info("Then, Monitor the execution of a parallel activity")
+    computation_amounts = [1e6]*hosts_count
+    communication_amounts = [0, 1e6, 0, 0, 0, 1e6, 1e6, 0, 0]
+    activity = this_actor.exec_init(hosts, computation_amounts, communication_amounts)
+    activity.start()
+    while not activity.test():
+        ratio = activity.remaining_ratio * 100
+        this_actor.info(f"Remaining flop ratio: {ratio:.0f}%")
+        this_actor.sleep_for(5)
+    activity.wait()
+
+    # Test 6
+    this_actor.info("Finally, simulate a malleable task (a parallel execution that gets reconfigured after its start).")
+    this_actor.info("  - Start a regular parallel execution, with both comm and computation")
+    computation_amounts = [1e6]*hosts_count
+    communication_amounts = [0, 1e6, 0, 0, 1e6, 0, 1e6, 0, 0]
+    activity = this_actor.exec_init(hosts, computation_amounts, communication_amounts)
+    activity.start()
+    this_actor.sleep_for(10)
+    remaining_ratio = activity.remaining_ratio
+    this_actor.info(f"  - After 10 seconds, {remaining_ratio*100:.2f}% remains to be done. Change it from 3 hosts to 2 hosts only.")
+    this_actor.info("    Let's first suspend the task.")
+    activity.suspend()
+    this_actor.info("  - Now, simulate the reconfiguration (modeled as a comm from the removed host to the remaining ones).")
+    rescheduling_comp = [0, 0, 0]
+    rescheduling_comm = [0, 0, 0, 0, 0, 0, 25000, 25000, 0]
+    this_actor.parallel_execute(hosts, rescheduling_comp, rescheduling_comm)
+    this_actor.info("  - Now, let's cancel the old task and create a new task with modified comm and computation vectors:")
+    this_actor.info("    What was already done is removed, and the load of the removed host is shared between remaining ones.")
+    for i in range(2):
+        # remove what we've done so far, for both comm and compute load
+        computation_amounts[i] *= remaining_ratio
+        communication_amounts[i] *= remaining_ratio
+        # The work from 1 must be shared between 2 remaining ones. 1/2=50% of extra work for each
+        computation_amounts[i] *= 1.5
+        communication_amounts[i] *= 1.5
+    hosts = hosts[:2]
+    computation_amounts = computation_amounts[:2]
+    remaining_comm = communication_amounts[1]
+    communication_amounts = [0, remaining_comm, remaining_comm, 0]
+    activity.cancel()
+    activity = this_actor.exec_init(hosts, computation_amounts, communication_amounts)
+    this_actor.info("  - Done, let's wait for the task completion")
+    activity.wait()
+    this_actor.info("Goodbye now!")
+
+
+if __name__ == "__main__":
+    if len(sys.argv) != 2:
+        sys.exit(f"Syntax: {sys.argv[0]} <platform_file>")
+    platform = sys.argv[1]
+    engine = Engine.instance
+    Engine.set_config("host/model:ptask_L07")  # /!\ this is required for running ptasks
+    engine.load_platform(platform)
+    Actor.create("foo", engine.host_by_name("MyHost1"), runner)
+    engine.run()
diff --git a/examples/python/exec-ptask/exec-ptask.tesh b/examples/python/exec-ptask/exec-ptask.tesh
new file mode 100644 (file)
index 0000000..90ff802
--- /dev/null
@@ -0,0 +1,26 @@
+#!/usr/bin/env tesh
+
+$ ${pythoncmd:=python3} ${PYTHON_TOOL_OPTIONS:=} ${srcdir}/exec-ptask.py ${platfdir}/energy_platform.xml
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'host/model' to 'ptask_L07'
+> [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks.
+> [MyHost1:foo:(1) 0.000000] [python/INFO] First, build a classical parallel activity, with 1 Gflop to execute on each node, and 10MB to exchange between each pair
+> [MyHost1:foo:(1) 300.000000] [python/INFO] We can do the same with a timeout of 10 seconds enabled.
+> [MyHost1:foo:(1) 310.000000] [python/INFO] Caught the expected timeout exception.
+> [MyHost1:foo:(1) 310.000000] [python/INFO] Then, build a parallel activity involving only computations (of different amounts) and no communication
+> [MyHost1:foo:(1) 320.000000] [python/INFO] Then, build a parallel activity with no computation nor communication (synchro only)
+> [MyHost1:foo:(1) 320.000000] [python/INFO] Then, Monitor the execution of a parallel activity
+> [MyHost1:foo:(1) 320.000000] [python/INFO] Remaining flop ratio: 100%
+> [MyHost1:foo:(1) 325.000000] [python/INFO] Remaining flop ratio: 83%
+> [MyHost1:foo:(1) 330.000000] [python/INFO] Remaining flop ratio: 67%
+> [MyHost1:foo:(1) 335.000000] [python/INFO] Remaining flop ratio: 50%
+> [MyHost1:foo:(1) 340.000000] [python/INFO] Remaining flop ratio: 33%
+> [MyHost1:foo:(1) 345.000000] [python/INFO] Remaining flop ratio: 17%
+> [MyHost1:foo:(1) 350.000000] [python/INFO] Finally, simulate a malleable task (a parallel execution that gets reconfigured after its start).
+> [MyHost1:foo:(1) 350.000000] [python/INFO]   - Start a regular parallel execution, with both comm and computation
+> [MyHost1:foo:(1) 360.000000] [python/INFO]   - After 10 seconds, 50.00% remains to be done. Change it from 3 hosts to 2 hosts only.
+> [MyHost1:foo:(1) 360.000000] [python/INFO]     Let's first suspend the task.
+> [MyHost1:foo:(1) 360.000000] [python/INFO]   - Now, simulate the reconfiguration (modeled as a comm from the removed host to the remaining ones).
+> [MyHost1:foo:(1) 360.500000] [python/INFO]   - Now, let's cancel the old task and create a new task with modified comm and computation vectors:
+> [MyHost1:foo:(1) 360.500000] [python/INFO]     What was already done is removed, and the load of the removed host is shared between remaining ones.
+> [MyHost1:foo:(1) 360.500000] [python/INFO]   - Done, let's wait for the task completion
+> [MyHost1:foo:(1) 375.500000] [python/INFO] Goodbye now!
diff --git a/examples/sthread/CMakeLists.txt b/examples/sthread/CMakeLists.txt
new file mode 100644 (file)
index 0000000..81d4ef1
--- /dev/null
@@ -0,0 +1,51 @@
+set(THREADS_PREFER_PTHREAD_FLAG ON)
+find_package(Threads REQUIRED)
+
+# Regular pthread examples: test the interceptor of the pthread interface
+#########################################################################
+
+foreach(x
+        mutex-simple)
+
+  if("${CMAKE_SYSTEM}" MATCHES "Linux")
+    add_executable       (pthread-${x} EXCLUDE_FROM_ALL pthread-${x}.c)
+    set_target_properties(pthread-${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+    target_link_libraries(pthread-${x} PRIVATE Threads::Threads)
+    target_link_libraries(pthread-${x} PUBLIC "-Wl,-znorelro -Wl,-znoseparate-code") # TODO: convert to target_link_option once cmake is >3.13
+
+    add_dependencies(tests pthread-${x})
+    ADD_TESH_FACTORIES(pthread-${x} "^thread" --setenv libdir=${CMAKE_BINARY_DIR}/lib --cd ${CMAKE_BINARY_DIR}/examples/sthread ${CMAKE_CURRENT_SOURCE_DIR}/pthread-${x}.tesh)
+  endif()
+
+  set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/pthread-${x}.tesh)
+  set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/pthread-${x}.c)
+
+endforeach()
+
+# Regular sthread examples: test the internal interface for debugging purpose
+#############################################################################
+
+foreach(x
+        mutex-simple)
+  if("${CMAKE_SYSTEM}" MATCHES "Linux")
+    add_executable       (sthread-${x} EXCLUDE_FROM_ALL sthread-${x}.c)
+    set_target_properties(sthread-${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+    target_link_libraries(sthread-${x} sthread)
+    set_property(TARGET sthread-${x} APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")
+    add_dependencies(tests sthread-${x})
+  endif()
+
+#  set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/sthread-${x}.tesh)
+  set(examples_src  ${examples_src}  ${CMAKE_CURRENT_SOURCE_DIR}/sthread-${x}.c)
+endforeach()
+
+
+# Add all extra files to the archive
+####################################
+
+set(tesh_files    ${tesh_files}     PARENT_SCOPE)
+set(bin_files     ${bin_files}      PARENT_SCOPE)
+set(examples_src  ${examples_src}   PARENT_SCOPE)
+set(xml_files     ${xml_files}      PARENT_SCOPE)
+
+
diff --git a/examples/sthread/pthread-mutex-simple.c b/examples/sthread/pthread-mutex-simple.c
new file mode 100644 (file)
index 0000000..d97bfe8
--- /dev/null
@@ -0,0 +1,34 @@
+/* Simple test code with no bug  */
+
+#include <pthread.h>
+#include <stdio.h>
+
+pthread_mutex_t mutex;
+
+static void* thread_fun(void* val)
+{
+  pthread_mutex_lock(&mutex);
+  pthread_mutex_unlock(&mutex);
+
+  fprintf(stderr, "The thread %d is terminating.\n", *(int*)val);
+  return NULL;
+}
+
+int main(int argc, char* argv[])
+{
+  pthread_mutex_init(&mutex, NULL);
+
+  int id[2] = {0, 1};
+  pthread_t thread1;
+  pthread_t thread2;
+  pthread_create(&thread1, NULL, thread_fun, (void*)&id[0]);
+  pthread_create(&thread2, NULL, thread_fun, (void*)&id[1]);
+  fprintf(stderr, "All threads are started.\n");
+  pthread_join(thread1, NULL);
+  pthread_join(thread2, NULL);
+
+  pthread_mutex_destroy(&mutex);
+
+  fprintf(stderr, "User's main is terminating.\n");
+  return 0;
+}
diff --git a/examples/sthread/pthread-mutex-simple.tesh b/examples/sthread/pthread-mutex-simple.tesh
new file mode 100644 (file)
index 0000000..1dd09bd
--- /dev/null
@@ -0,0 +1,7 @@
+$ env ASAN_OPTIONS=verify_asan_link_order=0:$ASAN_OPTIONS LD_PRELOAD=${libdir:=.}/libsthread.so ./pthread-mutex-simple
+> [0.000000] [sthread/INFO] Starting the simulation.
+> The thread 0 is terminating.
+> All threads are started.
+> The thread 1 is terminating.
+> User's main is terminating.
+> [0.000000] [sthread/INFO] All threads exited. Terminating the simulation.
diff --git a/examples/sthread/sthread-mutex-simple.c b/examples/sthread/sthread-mutex-simple.c
new file mode 100644 (file)
index 0000000..c0f48f6
--- /dev/null
@@ -0,0 +1,31 @@
+/* Simple test code with no bug  */
+
+#include "src/sthread/sthread.h"
+#include <stdio.h>
+
+sthread_mutex_t mutex;
+
+static void* thread_fun(void* ignore)
+{
+  sthread_mutex_lock(&mutex);
+  sthread_mutex_unlock(&mutex);
+
+  return NULL;
+}
+
+int main(int argc, char* argv[])
+{
+  sthread_mutex_init(&mutex, NULL);
+
+  sthread_t thread1;
+  sthread_t thread2;
+  sthread_create(&thread1, NULL, thread_fun, NULL);
+  sthread_create(&thread2, NULL, thread_fun, NULL);
+  sthread_join(thread1, NULL);
+  sthread_join(thread2, NULL);
+
+  sthread_mutex_destroy(&mutex);
+
+  fprintf(stderr, "done\n");
+  return 0;
+}
index 304295a..342bd4b 100644 (file)
@@ -153,6 +153,9 @@ DECLARE_SIMGRID_EXCEPTION(TracingError);
 DECLARE_SIMGRID_EXCEPTION(ParseError, PARSE_ERROR_CONSTRUCTOR);
 #undef PARSE_ERROR_CONSTRUCTOR
 
+/** Exception raised by xbt_enforce, when an assertion is not satisfied */
+DECLARE_SIMGRID_EXCEPTION(AssertionError);
+
 #undef DECLARE_SIMGRID_EXCEPTION
 
 class XBT_PUBLIC ForcefulKillException {
index e8356af..9b81d2a 100644 (file)
@@ -324,4 +324,6 @@ typedef enum {
   SG_ERROR_VM
 } sg_error_t;
 
+XBT_PUBLIC int SMPI_is_inited();
+
 #endif /* SIMGRID_TYPES_H */
index 8d70956..37efe41 100644 (file)
@@ -27,6 +27,7 @@ XBT_PUBLIC void* sg_host_extension_get(const_sg_host_t host, size_t rank);
 
 /** Finds a host from its name */
 XBT_PUBLIC sg_host_t sg_host_by_name(const char* name);
+XBT_PUBLIC sg_vm_t sg_vm_by_name(sg_host_t host, const char* name);
 
 /** @brief Return the name of the sg_host_t. */
 XBT_PUBLIC const char* sg_host_get_name(const_sg_host_t host);
index 55a1748..30ef1ff 100644 (file)
@@ -269,7 +269,7 @@ public:
   /*** Called on each newly created regular route (not on bypass routes) */
   static xbt::signal<void(bool symmetrical, NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
                           std::vector<resource::StandardLinkImpl*> const& link_list)>
-      on_route_creation; // XBT_ATTRIB_DEPRECATED_v332 : should be an internal signal used by NS3.. if necessary,
+      on_route_creation; // FIXME: XBT_ATTRIB_DEPRECATED_v332: should be an internal signal used by NS3.. if necessary,
                          // callback shouldn't use LinkImpl*
 
 private:
index 661fc12..69217b7 100644 (file)
@@ -5,12 +5,6 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-/** \file modelchecker.h
- *
- *  This is the API used by the user simulated program to communicate
- *  with the MC.
- */
-
 #ifndef SIMGRID_MODELCHECKER_H
 #define SIMGRID_MODELCHECKER_H
 
@@ -26,9 +20,7 @@ XBT_PUBLIC int MC_random(int min, int max);
 
 #if SIMGRID_HAVE_MC
 
-/* Internal variable used to check if we're running under the MC
- *
- * Please don't use directly: you should use MC_is_active. */
+/* Internal variable used to check if we're running under the MC. Please use MC_is_active instead. */
 extern XBT_PUBLIC int _sg_do_model_check;
 extern XBT_PUBLIC int _sg_mc_max_visited_states;
 
@@ -44,12 +36,9 @@ XBT_PUBLIC void MC_assert(int);
 XBT_PUBLIC void MC_automaton_new_propositional_symbol(const char* id, int (*fct)(void));
 XBT_PUBLIC void MC_automaton_new_propositional_symbol_pointer(const char* id, int* value);
 
-XBT_PUBLIC void MC_cut(void);
 XBT_PUBLIC void MC_ignore(void* addr, size_t size);
-
 XBT_PUBLIC void MC_ignore_heap(void* address, size_t size);
 XBT_PUBLIC void MC_unignore_heap(void* address, size_t size);
-XBT_PUBLIC void MC_ignore_global_variable(const char* var_name);
 
 #else
 
@@ -57,14 +46,13 @@ XBT_PUBLIC void MC_ignore_global_variable(const char* var_name);
 #define MC_visited_reduction()          0
 
 #define MC_assert(a)                    xbt_assert(a)
+
 #define MC_automaton_new_propositional_symbol(a, b) ((void)0)
 #define MC_automaton_new_propositional_symbol_pointer(a, b) ((void)0)
-#define MC_cut()                        ((void)0)
-#define MC_ignore(a, b)                 ((void)0)
 
-#define MC_ignore_heap(a,s)             ((void)0)
-#define MC_remove_ignore_heap(a,s)      ((void)0)
-#define MC_ignore_global_variable(v)    ((void)0)
+#define MC_ignore(a, b) ((void)0)
+#define MC_ignore_heap(a, s) ((void)0)
+#define MC_unignore_heap(a, s) ((void)0)
 
 #endif
 
index 28c31ea..8994889 100644 (file)
@@ -126,6 +126,7 @@ public:
   void seek(sg_offset_t pos);             /** Sets the file head to the given position. */
   void seek(sg_offset_t pos, int origin); /** Sets the file head to the given position from a given origin. */
   sg_size_t tell() const;                 /** Retrieves the current file position */
+  void update_position(sg_offset_t);      /** set new position in file, grow it if necessary, and increased usage */
 
   /** Rename a file. WARNING: It is forbidden to move the file to another mount point */
   void move(const std::string& fullpath) const;
index 353fcdb..d5d555a 100644 (file)
@@ -96,6 +96,11 @@ protected:
 
   static std::set<Activity*>* vetoed_activities_;
 
+  /** Set the [remaining] amount of work that this Activity will entail
+   *
+   * It is forbidden to change the amount of work once the Activity is started */
+  Activity* set_remaining(double remains);
+
 private:
   static xbt::signal<void(Activity&)> on_veto;
   static xbt::signal<void(Activity const&)> on_completion;
@@ -186,10 +191,6 @@ public:
 
   /** Get the remaining amount of work that this Activity entails. When it's 0, it's done. */
   virtual double get_remaining() const;
-  /** Set the [remaining] amount of work that this Activity will entail
-   *
-   * It is forbidden to change the amount of work once the Activity is started */
-  Activity* set_remaining(double remains);
 
   double get_start_time() const;
   double get_finish_time() const;
index 84b0cbb..e9f8acc 100644 (file)
@@ -128,7 +128,7 @@ public:
   CommPtr set_dst_data(void** buff, size_t size);
   /** Retrieve where the data will be copied on the receiver side */
   void* get_dst_data() const { return dst_buff_; }
-  /** Retrieve the size of the received data. Not to be mixed with @ref Activity::set_remaining()  */
+  /** Retrieve the size of the received data. Not to be mixed with @ref Activity::get_remaining()  */
   size_t get_dst_data_size() const { return dst_buff_size_; }
 
   /* Common functions */
index b0cdbf2..aa97e9f 100644 (file)
@@ -82,6 +82,7 @@ public:
 
   Host* get_host() const;
   unsigned int get_host_number() const;
+  int get_thread_count() const;
   double get_cost() const;
   bool is_parallel() const { return parallel_; }
   bool is_assigned() const override;
index 6208ff0..8fbe494 100644 (file)
@@ -227,6 +227,8 @@ public:
 
   VirtualMachine* create_vm(const std::string& name, int core_amount);
   VirtualMachine* create_vm(const std::string& name, int core_amount, size_t ramsize);
+  /** Retrieve a VM running on this host from its name, or return nullptr */
+  VirtualMachine* vm_by_name_or_null(const std::string& name);
 
   void route_to(const Host* dest, std::vector<Link*>& links, double* latency) const;
   void route_to(const Host* dest, std::vector<kernel::resource::StandardLinkImpl*>& links, double* latency) const;
index a7b6705..f7639e6 100644 (file)
@@ -7,57 +7,13 @@
 #define SIMGRID_SIMIX_H
 
 #include <simgrid/forward.h>
-#include <xbt/parmap.h>
 
+// avoid deprecation warning on include (remove entire file with XBT_ATTRIB_DEPRECATED_v335)
 #ifndef SIMIX_H_NO_DEPRECATED_WARNING
 #warning simgrid/simix.h is deprecated and will be removed in v3.35.
 #endif
 
-/******************************* Networking ***********************************/
-SG_BEGIN_DECL
-
-/* parallelism */
-XBT_ATTRIB_DEPRECATED_v333("Please use kernel::context::is_parallel()") XBT_PUBLIC int SIMIX_context_is_parallel();
-XBT_ATTRIB_DEPRECATED_v333("Please use kernel::context::get_nthreads()") XBT_PUBLIC int SIMIX_context_get_nthreads();
-XBT_ATTRIB_DEPRECATED_v333("Please use kernel::context::set_nthreads()") XBT_PUBLIC
-    void SIMIX_context_set_nthreads(int nb_threads);
-XBT_ATTRIB_DEPRECATED_v333("Please use kernel::context::get_parallel_mode()") XBT_PUBLIC e_xbt_parmap_mode_t
-    SIMIX_context_get_parallel_mode();
-XBT_ATTRIB_DEPRECATED_v333("Please use kernel::context::set_parallel_mode()") XBT_PUBLIC
-    void SIMIX_context_set_parallel_mode(e_xbt_parmap_mode_t mode);
-XBT_ATTRIB_DEPRECATED_v333("Please use Actor::is_maestro()") XBT_PUBLIC int SIMIX_is_maestro();
-
-/********************************** Global ************************************/
-/* Set some code to execute in the maestro (must be used before the engine creation)
- *
- * If no maestro code is registered (the default), the main thread
- * is assumed to be the maestro. */
-XBT_ATTRIB_DEPRECATED_v333("Please use simgrid_set_maestro()") XBT_PUBLIC
-    void SIMIX_set_maestro(void (*code)(void*), void* data);
-
-SG_END_DECL
-
-/********************************* Process ************************************/
-SG_BEGIN_DECL
-XBT_ATTRIB_DEPRECATED_v333("Please use kernel::actor::ActorImpl::self()") XBT_PUBLIC
 #ifdef __cplusplus
-    simgrid::kernel::actor::ActorImpl*
-#else
-    smx_actor_t
-#endif
-    SIMIX_process_self();
-XBT_ATTRIB_DEPRECATED_v333("Please use xbt_procname()") XBT_PUBLIC const char* SIMIX_process_self_get_name();
-SG_END_DECL
-
-/****************************** Communication *********************************/
-#ifdef __cplusplus
-XBT_ATTRIB_DEPRECATED_v333("Please use Engine::set_default_comm_data_copy_callback()") XBT_PUBLIC
-    void SIMIX_comm_set_copy_data_callback(void (*callback)(simgrid::kernel::activity::CommImpl*, void*, size_t));
-
-XBT_ATTRIB_DEPRECATED_v333("Please use Comm::copy_buffer_callback()") XBT_PUBLIC
-    void SIMIX_comm_copy_pointer_callback(simgrid::kernel::activity::CommImpl* comm, void* buff, size_t buff_size);
-XBT_ATTRIB_DEPRECATED_v333("Please use Comm::copy_pointer_callback()") XBT_PUBLIC
-    void SIMIX_comm_copy_buffer_callback(simgrid::kernel::activity::CommImpl* comm, void* buff, size_t buff_size);
 
 /******************************************************************************/
 /*                            SIMIX simcalls                                  */
index 5317dee..d5a0100 100644 (file)
@@ -41,4 +41,5 @@
 
 #define exit(x) smpi_exit(x)
 
+#define getpid smpi_getpid
 #endif
index 53ca8a7..26f2148 100644 (file)
 #include <unistd.h>
 
 #include <sys/time.h>
+#include <sys/types.h>
 #if _POSIX_TIMERS
 #include <time.h>
 #endif
 
+#if !defined(SMPI_NO_OVERRIDE_MALLOC) && !defined(__GLIBC__)
+/* For musl libc, <sched.h> must be included before #defining calloc(). Testing if !defined(__GLIBC__) is a bit crude
+ * but I don't know a better way. */
+#include <sched.h>
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -38,6 +45,8 @@ void* smpi_shared_malloc_intercept(size_t size, const char* file, int line);
 void* smpi_shared_calloc_intercept(size_t num_elm, size_t elem_size, const char* file, int line);
 void* smpi_shared_realloc_intercept(void* data, size_t size, const char* file, int line);
 void smpi_shared_free(void* data);
+
+pid_t smpi_getpid();
 #ifdef __cplusplus
 [[noreturn]] // c++11
 #else
diff --git a/include/xbt/asserts.hpp b/include/xbt/asserts.hpp
new file mode 100644 (file)
index 0000000..9b50fd2
--- /dev/null
@@ -0,0 +1,35 @@
+/* Copyright (c) 2016-2022. The SimGrid Team. All rights reserved.          */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef SIMGRID_XBT_ASSERTS_HPP
+#define SIMGRID_XBT_ASSERTS_HPP
+
+#include <simgrid/Exception.hpp>
+
+/**
+ * @brief Those are the SimGrid version of the good ol' assert macro.
+ *
+ * You can pass them a format message and arguments, just as if it where a printf.
+ *
+ * If the statement evaluates to false, then a simgrid::AsertionError is thrown.
+ * This is identical to the xbt_assert macro, except that an exception is thrown instead of calling abort().
+ *
+ * Unlike the standard assert, xbt_enforce is never disabled, even if the macro NDEBUG is defined at compile time.
+ * Note however that this macro should *not* be used with a condition that has side effects, since the exception can be
+ * caught and ignored.
+ */
+/** @brief The condition which failed will be displayed.
+    @hideinitializer  */
+#define xbt_enforce(...) \
+  _XBT_IF_ONE_ARG(_xbt_enforce_ARG1, _xbt_enforce_ARGN, __VA_ARGS__)(__VA_ARGS__)
+#define _xbt_enforce_ARG1(cond) _xbt_enforce_ARGN((cond), "Assertion %s failed", #cond)
+#define _xbt_enforce_ARGN(cond, ...)                                                                                   \
+  do {                                                                                                                 \
+    if (not(cond)) {                                                                                                   \
+      throw simgrid::AssertionError(XBT_THROW_POINT, xbt::string_printf(__VA_ARGS__));                                 \
+    }                                                                                                                  \
+  } while (0)
+
+#endif
index c6b9787..08a13d1 100644 (file)
 #define XBT_ATTRIB_DEPRECATED(mesg) __attribute__((deprecated(mesg)))
 #endif
 
-#define XBT_ATTRIB_DEPRECATED_v333(mesg)                                                                               \
-  XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped after v3.32)")
 #define XBT_ATTRIB_DEPRECATED_v334(mesg)                                                                               \
   XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped after v3.33)")
 #define XBT_ATTRIB_DEPRECATED_v335(mesg)                                                                               \
   XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped after v3.34)")
 #define XBT_ATTRIB_DEPRECATED_v336(mesg)                                                                               \
   XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped after v3.35)")
+#define XBT_ATTRIB_DEPRECATED_v337(mesg)                                                                               \
+  XBT_ATTRIB_DEPRECATED(mesg " (this compatibility wrapper will be dropped after v3.36)")
 
 /* Work around https://github.com/microsoft/vscode-cpptools/issues/4503 */
 #ifdef __INTELLISENSE__
index e5fd1ef..86de02c 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2016-2022. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2016-2022. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
index 21877a1..0b6eb55 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -88,7 +88,7 @@ class CMakeBuild(build_ext):
 
 setup(
     name='simgrid',
-    version='3.31.1',
+    version='3.32.1',
     author='Da SimGrid Team',
     author_email='simgrid-community@inria.fr',
     description='Toolkit for scalable simulation of distributed applications',
index 14f2557..09db112 100644 (file)
@@ -4,7 +4,7 @@
 sonar.organization=simgrid
 sonar.projectKey=simgrid_simgrid
 sonar.projectName=SimGrid
-sonar.projectVersion=3.31.1
+sonar.projectVersion=3.32.1
 
 sonar.links.homepage=https://simgrid.org
 sonar.links.issue=https://framagit.org/simgrid/simgrid/issues
index 5d2b646..507a2cb 100644 (file)
@@ -48,6 +48,12 @@ public final class NativeLib {
                NativeLib.nativeInit("simgrid");
                NativeLib.nativeInit("simgrid-java");
                isNativeInited = true;
+
+                /* Don't leak the files on disk */
+                if (tempDir != null) {
+                  FileCleaner fclean = new FileCleaner(tempDir.toFile());
+                  fclean.run();
+                }
        }
 
        /** Helper function trying to load one requested library */
@@ -108,8 +114,6 @@ public final class NativeLib {
                        }
 
                        tempDir = Files.createTempDirectory(tempPrefix);
-                       // don't leak the files on disk, but remove it on JVM shutdown
-                       Runtime.getRuntime().addShutdownHook(new Thread(new FileCleaner(tempDir.toFile())));
                }
 
                /* For each possible filename of the given library on all possible OSes, try it */
index 9d86a99..e1c42ed 100644 (file)
@@ -103,6 +103,7 @@ PYBIND11_MODULE(simgrid, m)
   py::register_exception<simgrid::StorageFailureException>(m, "StorageFailureException");
   py::register_exception<simgrid::VmFailureException>(m, "VmFailureException");
   py::register_exception<simgrid::CancelException>(m, "CancelException");
+  py::register_exception<simgrid::AssertionError>(m, "AssertionError");
 
   /* this_actor namespace */
   m.def_submodule("this_actor", "Bindings of the s4u::this_actor namespace. See the C++ documentation for details.")
@@ -122,6 +123,14 @@ PYBIND11_MODULE(simgrid, m)
            py::call_guard<py::gil_scoped_release>())
       .def("exec_async", py::overload_cast<double>(&simgrid::s4u::this_actor::exec_async),
            py::call_guard<py::gil_scoped_release>())
+      .def("parallel_execute", &simgrid::s4u::this_actor::parallel_execute,
+           py::call_guard<py::gil_scoped_release>(),
+           "Run a parallel task (requires the 'ptask_L07' model)")
+      .def("exec_init",
+           py::overload_cast<const std::vector<simgrid::s4u::Host*>&, const std::vector<double>&,
+           const std::vector<double>&>  (&simgrid::s4u::this_actor::exec_init),
+           py::call_guard<py::gil_scoped_release>(),
+           "Initiate a parallel task (requires the 'ptask_L07' model)")
       .def("get_host", &simgrid::s4u::this_actor::get_host, "Retrieves host on which the current actor is located")
       .def("set_host", &simgrid::s4u::this_actor::set_host, py::call_guard<py::gil_scoped_release>(),
            "Moves the current actor to another host.", py::arg("dest"))
@@ -218,6 +227,8 @@ PYBIND11_MODULE(simgrid, m)
                              "Retrieve the root netzone, containing all others.")
       .def("netpoint_by_name", &Engine::netpoint_by_name_or_null)
       .def("netzone_by_name", &Engine::netzone_by_name_or_null)
+      .def("set_config", py::overload_cast<const std::string&>(&Engine::set_config),
+           "Change one of SimGrid's configurations")
       .def("load_platform", &Engine::load_platform, "Load a platform file describing the environment")
       .def("load_deployment", &Engine::load_deployment, "Load a deployment file and launch the actors that it contains")
       .def("mailbox_by_name_or_create", &Engine::mailbox_by_name_or_create,
@@ -839,8 +850,12 @@ PYBIND11_MODULE(simgrid, m)
            "Test whether the execution is terminated.")
       .def("cancel", &simgrid::s4u::Exec::cancel, py::call_guard<py::gil_scoped_release>(), "Cancel that execution.")
       .def("start", &simgrid::s4u::Exec::start, py::call_guard<py::gil_scoped_release>(), "Start that execution.")
+      .def("suspend", &simgrid::s4u::Exec::suspend, py::call_guard<py::gil_scoped_release>(), "Suspend that execution.")
       .def("wait", &simgrid::s4u::Exec::wait, py::call_guard<py::gil_scoped_release>(),
-           "Block until the completion of that execution.");
+           "Block until the completion of that execution.")
+      .def("wait_for", &simgrid::s4u::Exec::wait_for, py::call_guard<py::gil_scoped_release>(),
+           py::arg("timeout"),
+           "Block until the completion of that activity, or raises TimeoutException after the specified timeout.");
 
   /* Class Semaphore */
   py::class_<Semaphore, SemaphorePtr>(m, "Semaphore",
index f2b85ac..bdff2c1 100644 (file)
 
 #include "src/internal_config.h"
 
+/** Environment variable name used to pass the communication socket.
+ *
+ * It is set by `simgrid-mc` to enable MC support in the children processes.
+ *
+ * It is placed in this file so that it's visible from mmalloc and MC without sharing anythin of xbt in mmalloc
+ */
+#define MC_ENV_SOCKET_FD "SIMGRID_MC_SOCKET_FD"
+
 #include <stdio.h>     /* for NULL */
 #include <sys/types.h> /* for size_t */
 
-#include "xbt/dict.h"
-#include "xbt/dynar.h"
-
 SG_BEGIN_DECL
 
 /* Datatype representing a separate heap. The whole point of the mmalloc module is to allow several such heaps in the
@@ -45,13 +50,14 @@ XBT_PUBLIC void mfree(xbt_mheap_t md, void* ptr);
 
 XBT_PUBLIC xbt_mheap_t xbt_mheap_new(void* baseaddr, int options);
 
-XBT_PUBLIC void xbt_mheap_destroy_no_free(xbt_mheap_t md);
-
 XBT_PUBLIC void* xbt_mheap_destroy(xbt_mheap_t md);
 
 /* To get the heap used when using the legacy version malloc/free/realloc and such */
 xbt_mheap_t mmalloc_get_current_heap(void);
 
+/* Returns true if we are using the internal mmalloc, and false if we are using the libc's malloc */
+XBT_PUBLIC int malloc_use_mmalloc(void);
+
 #endif
 SG_END_DECL
 
index 254f554..5913b17 100644 (file)
@@ -20,9 +20,6 @@ void xbt_log_postexit(void);
 void xbt_dict_preinit(void);
 void xbt_dict_postexit(void);
 
-xbt_mheap_t mmalloc_preinit(void);
-void mmalloc_postexit(void);
-
 extern int xbt_initialized;
 
 SG_END_DECL
index e989fd4..cec90b8 100644 (file)
@@ -279,7 +279,7 @@ static void on_container_creation_ti(const Container& c)
 #ifdef WIN32
     _mkdir(folder_name.c_str());
 #else
-    mkdir(folder_name.c_str(), S_IRWXU | S_IRWXG | S_IRWXO);
+    mkdir(folder_name.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
 #endif
     ti_unique_file = new std::ofstream(filename.c_str(), std::ofstream::out);
     xbt_assert(not ti_unique_file->fail(), "Tracefile %s could not be opened for writing", filename.c_str());
index 44092c2..a5a68af 100644 (file)
@@ -34,11 +34,9 @@ void dump_comment_file(const std::string& filename)
     throw TracingError(XBT_THROW_POINT,
                        xbt::string_printf("Comment file %s could not be opened for reading.", filename.c_str()));
 
-  while (not fs.eof()) {
-    std::string line;
-    std::getline(fs, line);
+  std::string line;
+  while (std::getline(fs, line))
     tracing_file << "# " << line;
-  }
   fs.close();
 }
 
index 7706219..717e771 100644 (file)
@@ -106,7 +106,7 @@ static void segvhandler(int signum, siginfo_t* siginfo, void* /*context*/)
   } else if (siginfo->si_signo == SIGSEGV) {
     fprintf(stderr, "Segmentation fault.\n");
 #if HAVE_SMPI
-    if (smpi_enabled() && smpi_cfg_privatization() == SmpiPrivStrategies::NONE) {
+    if (SMPI_is_inited() && smpi_cfg_privatization() == SmpiPrivStrategies::NONE) {
 #if HAVE_PRIVATIZATION
       fprintf(stderr, "Try to enable SMPI variable privatization with --cfg=smpi/privatization:yes.\n");
 #else
@@ -178,10 +178,6 @@ EngineImpl::~EngineImpl()
   delete maestro_;
   delete context_factory_;
 
-  /* Free the remaining data structures */
-#if SIMGRID_HAVE_MC
-  xbt_dynar_free(&actors_vector_);
-#endif
   /* clear models before freeing handle, network models can use external callback defined in the handle */
   models_prio_.clear();
 }
@@ -195,7 +191,7 @@ void EngineImpl::initialize(int* argc, char** argv)
   // The communication initialization is done ASAP, as we need to get some init parameters from the MC for different
   // layers. But instance_ needs to be created, as we send the address of some of its fields to the MC that wants to
   // read them directly.
-  simgrid::mc::AppSide::initialize(actors_vector_);
+  simgrid::mc::AppSide::initialize();
 #endif
 
   if (xbt_initialized == 0) {
index 6ea9106..d2d4108 100644 (file)
@@ -48,16 +48,6 @@ class EngineImpl {
                          boost::intrusive::member_hook<actor::ActorImpl, boost::intrusive::list_member_hook<>,
                                                        &actor::ActorImpl::kernel_destroy_list_hook>>
       actors_to_destroy_;
-#if SIMGRID_HAVE_MC
-  /* MCer cannot read members actor_list_ above in the remote process, so we copy the info it needs in a dynar.
-   * FIXME: This is supposed to be a temporary hack.
-   * A better solution would be to change the split between MCer and MCed, where the responsibility
-   *   to compute the list of the enabled transitions goes to the MCed.
-   * That way, the MCer would not need to have the list of actors on its side.
-   * These info could be published by the MCed to the MCer in a way inspired of vd.so
-   */
-  xbt_dynar_t actors_vector_      = xbt_dynar_new(sizeof(actor::ActorImpl*), nullptr);
-#endif
 
   static double now_;
   static EngineImpl* instance_;
@@ -136,11 +126,6 @@ public:
   void add_actor(aid_t pid, actor::ActorImpl* actor) { actor_list_[pid] = actor; }
   void remove_actor(aid_t pid) { actor_list_.erase(pid); }
 
-#if SIMGRID_HAVE_MC
-  void reset_actor_dynar() { xbt_dynar_reset(actors_vector_); }
-  void add_actor_to_dynar(actor::ActorImpl* actor) { xbt_dynar_push_as(actors_vector_, actor::ActorImpl*, actor); }
-#endif
-
   const std::map<aid_t, actor::ActorImpl*>& get_actor_list() const { return actor_list_; }
   const std::vector<actor::ActorImpl*>& get_actors_to_run() const { return actors_to_run_; }
   const std::vector<actor::ActorImpl*>& get_actors_that_ran() const { return actors_that_ran_; }
index c75799a..1f373dd 100644 (file)
@@ -140,12 +140,13 @@ void ActivityImpl::wait_any_for(actor::ActorImpl* issuer, const std::vector<Acti
     auto* observer = dynamic_cast<kernel::actor::ActivityWaitanySimcall*>(issuer->simcall_.observer_);
     xbt_assert(observer != nullptr);
     xbt_assert(timeout <= 0.0, "Timeout not implemented for waitany in the model-checker");
-    int idx   = observer->get_value();
-    auto* act = activities[idx];
-    act->simcalls_.push_back(&issuer->simcall_);
-    observer->set_result(idx);
-    act->set_state(State::DONE);
-    act->finish();
+    if (int idx = observer->get_value(); idx != -1) {
+      auto* act = activities.at(idx);
+      act->simcalls_.push_back(&issuer->simcall_);
+      observer->set_result(idx);
+      act->set_state(State::DONE);
+      act->finish();
+    }
     return;
   }
 
index e027255..0d21716 100644 (file)
@@ -8,9 +8,6 @@
 #include <simgrid/modelchecker.h>
 #include <simgrid/s4u/Host.hpp>
 
-#define SIMIX_H_NO_DEPRECATED_WARNING // avoid deprecation warning on include (remove with XBT_ATTRIB_DEPRECATED_v333)
-#include <simgrid/simix.h>
-
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/activity/CommImpl.hpp"
 #include "src/kernel/activity/MailboxImpl.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_network, kernel, "Kernel network-related synchronization");
 
-/******************************************************************************/
-/*                    SIMIX_comm_copy_data callbacks                       */
-/******************************************************************************/
-// XBT_ATTRIB_DEPRECATED_v333
-void SIMIX_comm_set_copy_data_callback(void (*callback)(simgrid::kernel::activity::CommImpl*, void*, size_t))
-{
-  simgrid::kernel::activity::CommImpl::set_copy_data_callback(callback);
-}
-
-// XBT_ATTRIB_DEPRECATED_v333
-void SIMIX_comm_copy_buffer_callback(simgrid::kernel::activity::CommImpl* comm, void* buff, size_t buff_size)
-{
-  simgrid::s4u::Comm::copy_buffer_callback(comm, buff, buff_size);
-}
-
-// XBT_ATTRIB_DEPRECATED_v333
-void SIMIX_comm_copy_pointer_callback(simgrid::kernel::activity::CommImpl* comm, void* buff, size_t buff_size)
-{
-  simgrid::s4u::Comm::copy_pointer_callback(comm, buff, buff_size);
-}
-
 namespace simgrid::kernel::activity {
 xbt::signal<void(CommImpl const&)> CommImpl::on_start;
 xbt::signal<void(CommImpl const&)> CommImpl::on_completion;
@@ -542,6 +518,9 @@ void CommImpl::finish()
   if (get_state() == State::DONE)
     copy_data();
 
+  if (detached_)
+    EngineImpl::get_instance()->get_maestro()->activities_.remove(this);
+
   while (not simcalls_.empty()) {
     actor::Simcall* simcall = simcalls_.front();
     simcalls_.pop_front();
index 22dfb5c..ed936f2 100644 (file)
@@ -42,6 +42,7 @@ public:
   ExecImpl& set_hosts(const std::vector<s4u::Host*>& hosts);
 
   unsigned int get_host_number() const { return static_cast<unsigned>(get_hosts().size()); }
+  int get_thread_count() const { return thread_count_; }
   double get_seq_remaining_ratio();
   double get_par_remaining_ratio();
   double get_remaining() const override;
index 7ee160c..b738381 100644 (file)
@@ -21,7 +21,11 @@ unsigned MailboxImpl::next_id_ = 0;
 
 MailboxImpl::~MailboxImpl()
 {
-  clear(false);
+  try {
+    clear(false);
+  } catch (const std::bad_alloc& ba) {
+    XBT_ERROR("MailboxImpl::clear() failure: %s", ba.what());
+  }
   set_receiver(nullptr);
 }
 
index bb40b4d..8f3b373 100644 (file)
@@ -7,9 +7,6 @@
 #include <simgrid/s4u/Actor.hpp>
 #include <simgrid/s4u/Host.hpp>
 
-#define SIMIX_H_NO_DEPRECATED_WARNING // avoid deprecation warning on include (remove with XBT_ATTRIB_DEPRECATED_v333)
-#include <simgrid/simix.h>
-
 #include "src/kernel/EngineImpl.hpp"
 #if HAVE_SMPI
 #include "src/smpi/include/private.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_actor, kernel, "Logging specific to Actor's kernel side");
 
-/**
- * @brief Returns the current agent.
- *
- * This functions returns the currently running SIMIX process.
- *
- * @return The SIMIX process
- */
-simgrid::kernel::actor::ActorImpl* SIMIX_process_self() // XBT_ATTRIB_DEPRECATED_v333
-{
-  return simgrid::kernel::actor::ActorImpl::self();
-}
-
 namespace simgrid::kernel::actor {
 
 /*------------------------- [ ActorIDTrait ] -------------------------*/
@@ -521,15 +506,3 @@ void create_maestro(const std::function<void()>& code)
 }
 
 } // namespace simgrid::kernel::actor
-
-/* needs to be public and without simcall because it is called by exceptions and logging events */
-const char* SIMIX_process_self_get_name() // XBT_ATTRIB_DEPRECATED_v333
-{
-  return simgrid::s4u::Actor::is_maestro() ? "maestro" : simgrid::kernel::actor::ActorImpl::self()->get_cname();
-}
-
-int SIMIX_is_maestro() // XBT_ATTRIB_DEPRECATED_v333
-{
-  const auto* self = simgrid::kernel::actor::ActorImpl::self();
-  return self != nullptr && self->is_maestro();
-}
index f44571e..e15d6aa 100644 (file)
@@ -18,16 +18,16 @@ namespace simgrid::kernel::actor {
 
 ActivityTestanySimcall::ActivityTestanySimcall(ActorImpl* actor, const std::vector<activity::ActivityImpl*>& activities)
     : ResultingSimcall(actor, -1), activities_(activities)
-{
-}
-
-int ActivityTestanySimcall::get_max_consider()
 {
   indexes_.clear();
   // list all the activities that are ready
   for (unsigned i = 0; i < activities_.size(); i++)
     if (activities_[i]->test(get_issuer()))
       indexes_.push_back(i);
+}
+
+int ActivityTestanySimcall::get_max_consider() const
+{
   return indexes_.size() + 1;
 }
 
@@ -94,6 +94,11 @@ ActivityWaitanySimcall::ActivityWaitanySimcall(ActorImpl* actor, const std::vect
                                                double timeout)
     : ResultingSimcall(actor, -1), activities_(activities), timeout_(timeout)
 {
+  // list all the activities that are ready
+  indexes_.clear();
+  for (unsigned i = 0; i < activities_.size(); i++)
+    if (activities_[i]->test(get_issuer()))
+      indexes_.push_back(i);
 }
 
 bool ActivityWaitSimcall::is_enabled()
@@ -119,14 +124,8 @@ bool ActivityWaitanySimcall::is_enabled()
   return not indexes_.empty();
 }
 
-int ActivityWaitanySimcall::get_max_consider()
+int ActivityWaitanySimcall::get_max_consider() const
 {
-  // list all the activities that are ready
-  indexes_.clear();
-  for (unsigned i = 0; i < activities_.size(); i++)
-    if (activities_[i]->test(get_issuer()))
-      indexes_.push_back(i);
-
   int res = indexes_.size();
   //  if (_sg_mc_timeout && timeout_)
   //    res++;
index 9cba17d..41607aa 100644 (file)
@@ -38,7 +38,7 @@ public:
   bool is_visible() const override { return true; }
   bool is_enabled() override { return true; /* can return -1 if no activity is ready */ }
   void serialize(std::stringstream& stream) const override;
-  int get_max_consider() override;
+  int get_max_consider() const override;
   void prepare(int times_considered) override;
   const std::vector<activity::ActivityImpl*>& get_activities() const { return activities_; }
   int get_value() const { return next_value_; }
@@ -73,7 +73,7 @@ public:
   void serialize(std::stringstream& stream) const override;
   bool is_visible() const override { return true; }
   void prepare(int times_considered) override;
-  int get_max_consider() override;
+  int get_max_consider() const override;
   const std::vector<activity::ActivityImpl*>& get_activities() const { return activities_; }
   double get_timeout() const { return timeout_; }
   int get_value() const { return next_value_; }
index e4ffca2..87991cc 100644 (file)
@@ -32,7 +32,7 @@ void RandomSimcall::prepare(int times_considered)
   XBT_DEBUG("MC_RANDOM(%d, %d) will return %d after %d times", min_, max_, next_value_, times_considered);
 }
 
-int RandomSimcall::get_max_consider()
+int RandomSimcall::get_max_consider() const
 {
   return max_ - min_ + 1;
 }
index 6eabf88..a4095e4 100644 (file)
@@ -37,7 +37,7 @@ public:
    * If it's more than one (as with mc_random or waitany), we need to consider this transition several times to start
    * differing branches
    */
-  virtual int get_max_consider() { return 1; }
+  virtual int get_max_consider() const { return 1; }
 
   /** Prepares the simcall to be used.
    *
@@ -83,7 +83,7 @@ public:
     xbt_assert(min < max);
   }
   void serialize(std::stringstream& stream) const override;
-  int get_max_consider() override;
+  int get_max_consider() const override;
   void prepare(int times_considered) override;
   int get_value() const { return next_value_; }
 };
index 66a895b..6827ff9 100644 (file)
@@ -9,6 +9,7 @@
 #include "simgrid/s4u/Host.hpp"
 #include "src/kernel/activity/CommImpl.hpp"
 #include "src/kernel/context/Context.hpp"
+#include "src/sthread/sthread.h"
 #include "src/surf/surf_interface.hpp"
 
 #include <vector>
@@ -139,6 +140,7 @@ Context::~Context()
 void Context::stop()
 {
   this->actor_->cleanup_from_self();
+  sthread_disable();
   throw ForcefulKillException(); // clean RAII variables with the dedicated exception
 }
 AttachContext::~AttachContext() = default;
index c6812f4..599d52a 100644 (file)
@@ -8,6 +8,7 @@
 #include "src/internal_config.h"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/actor/ActorImpl.hpp"
+#include "src/sthread/sthread.h"
 #include "xbt/parmap.hpp"
 
 #include "src/kernel/context/ContextSwapped.hpp"
@@ -48,11 +49,15 @@ void smx_ctx_wrapper(simgrid::kernel::context::SwappedContext* context)
   __sanitizer_finish_switch_fiber(nullptr, &context->asan_ctx_->asan_stack_, &context->asan_ctx_->asan_stack_size_);
 #endif
   try {
+    sthread_enable();
     (*context)();
+    sthread_disable();
     context->stop();
   } catch (simgrid::ForcefulKillException const&) {
+    sthread_disable();
     XBT_DEBUG("Caught a ForcefulKillException");
   } catch (simgrid::Exception const& e) {
+    sthread_disable();
     XBT_INFO("Actor killed by an uncaught exception %s", boost::core::demangle(typeid(e).name()).c_str());
     throw;
   }
@@ -244,6 +249,7 @@ void SwappedContext::resume()
     // Save my current soul (either maestro, or one of the minions) in a thread-specific area
     worker_context_ = old;
   }
+  sthread_enable();
   // Switch my soul and the actor's one
   Context::set_current(this);
   old->swap_into(this);
@@ -285,10 +291,12 @@ void SwappedContext::suspend()
     if (i < engine->get_actor_to_run_count()) {
       /* Actually swap into the next actor directly without transiting to maestro */
       XBT_DEBUG("Run next actor");
+      sthread_enable();
       next_context = static_cast<SwappedContext*>(engine->get_actor_to_run_at(i)->context_.get());
     } else {
       /* all processes were run, actually return to maestro */
       XBT_DEBUG("No more actors to run");
+      sthread_disable();
       next_context = factory_.maestro_context_;
     }
   }
index 24b2b1f..98f7832 100644 (file)
@@ -8,7 +8,7 @@
 #include "mc/mc.h"
 #include "simgrid/Exception.hpp"
 #include "src/kernel/actor/ActorImpl.hpp"
-#include "src/mc/mc_ignore.hpp"
+#include "src/mc/remote/AppSide.hpp"
 
 #include "ContextUnix.hpp"
 
@@ -62,9 +62,8 @@ UContext::UContext(std::function<void()>&& code, actor::ActorImpl* actor, Swappe
     makecontext(&this->uc_, (void (*)())sysv_ctx_wrapper, 2, ctx_addr[0], ctx_addr[1]);
 
 #if SIMGRID_HAVE_MC
-    if (MC_is_active()) {
-      MC_register_stack_area(get_stack(), &(this->uc_), stack_size);
-    }
+    if (MC_is_active())
+      simgrid::mc::AppSide::get()->declare_stack(get_stack(), stack_size, &uc_);
 #endif
   }
 }
index 100917b..d155ce5 100644 (file)
@@ -62,7 +62,7 @@ void Element::increase_concurrency(bool check_limit)
              "Concurrency limit overflow!");
 }
 
-System* System::build(const std::string& solver_name, bool selective_update)
+System* System::build(std::string_view solver_name, bool selective_update)
 {
   System* system = nullptr;
   if (solver_name == "bmf") {
@@ -275,18 +275,20 @@ Element& System::expand_add_to_elem(Element& elem, const Constraint* cnst, doubl
   return elem;
 }
 
-void System::expand(Constraint* cnst, Variable* var, double consumption_weight)
+void System::expand(Constraint* cnst, Variable* var, double consumption_weight, bool force_creation)
 {
   modified_ = true;
 
   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_) && var->sharing_penalty_ != 0.0) {
+
+  bool reuse_elem = elem_it != end(var->cnsts_) && not force_creation;
+  if (reuse_elem && var->sharing_penalty_ != 0.0) {
     /* before changing it, decreases concurrency on constraint, it'll be added back later */
     elem_it->decrease_concurrency();
   }
-  Element& elem = elem_it != end(var->cnsts_) ? expand_add_to_elem(*elem_it, cnst, consumption_weight)
-                                              : expand_create_elem(cnst, var, consumption_weight);
+  Element& elem = reuse_elem ? expand_add_to_elem(*elem_it, cnst, consumption_weight)
+                             : expand_create_elem(cnst, var, consumption_weight);
 
   // Check if we need to disable the variable
   if (var->sharing_penalty_ != 0) {
index b2e5c4f..b3f1113 100644 (file)
@@ -18,6 +18,7 @@
 #include <cmath>
 #include <limits>
 #include <memory>
+#include <string_view>
 #include <vector>
 
 namespace simgrid::kernel::lmm {
@@ -418,7 +419,7 @@ public:
    * @param selective_update Enables lazy updates
    * @return pointer to System instance
    */
-  static System* build(const std::string& solver_name, bool selective_update);
+  static System* build(std::string_view solver_name, bool selective_update);
   /** @brief Validates solver configuration */
   static void validate_solver(const std::string& solver_name);
 
@@ -464,8 +465,11 @@ public:
    * @param cnst A constraint
    * @param var A variable
    * @param value The coefficient associated to the variable in the constraint
+   * @param force_creation Force the creation of new element linking the variable to the constraint. Should be used only
+   * by the model ptask_L07 to cope with ptasks composed of flows running on the same resource (see
+   * https://framagit.org/simgrid/simgrid/-/issues/111)
    */
-  void expand(Constraint * cnst, Variable * var, double value);
+  void expand(Constraint* cnst, Variable* var, double value, bool force_creation = false);
 
   /** @brief Update the bound of a variable */
   void update_variable_bound(Variable * var, double bound);
index b6647a6..24d6638 100644 (file)
@@ -4,7 +4,6 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/kernel/lmm/bmf.hpp"
-#include "xbt/config.hpp"
 
 #include <Eigen/LU>
 #include <iostream>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_bmf, kernel, "Kernel BMF solver");
 
-simgrid::config::Flag<int>
-    cfg_bmf_max_iteration("bmf/max-iterations",
-                          "Maximum number of steps to be performed while searching for a BMF allocation", 1000);
-
-simgrid::config::Flag<double> cfg_bmf_precision{"bmf/precision",
-                                                "Numerical precision used when computing resource sharing", 1E-12};
-
 namespace simgrid::kernel::lmm {
 
 AllocationGenerator::AllocationGenerator(Eigen::MatrixXd A) : A_(std::move(A)), alloc_(A_.cols(), 0)
@@ -71,7 +63,6 @@ BmfSolver::BmfSolver(Eigen::MatrixXd A, Eigen::MatrixXd maxA, Eigen::VectorXd C,
     , C_shared_(std::move(shared))
     , phi_(std::move(phi))
     , gen_(A_)
-    , max_iteration_(cfg_bmf_max_iteration)
 
 {
   xbt_assert(max_iteration_ > 0,
index dfc7ff9..fa6b8bb 100644 (file)
@@ -7,6 +7,7 @@
 #define SIMGRID_KERNEL_LMM_BMF_HPP
 
 #include "src/kernel/lmm/System.hpp"
+#include "xbt/config.hpp"
 
 #ifdef __clang__
 // Ignore deprecation warnings with Eigen < 4.0 (see https://gitlab.com/libeigen/eigen/-/issues/1850)
@@ -73,6 +74,12 @@ private:
  * @endrst
  */
 class XBT_PUBLIC BmfSolver {
+  inline static simgrid::config::Flag<int> cfg_bmf_max_iteration{
+      "bmf/max-iterations", "Maximum number of steps to be performed while searching for a BMF allocation", 1000};
+
+  inline static simgrid::config::Flag<double> cfg_bmf_precision{
+      "bmf/precision", "Numerical precision used when computing resource sharing", 1E-12};
+
 public:
   /**
    * @brief Instantiate the BMF solver
@@ -195,7 +202,7 @@ private:
   std::set<std::vector<int>> allocations_; //!< set of already tested allocations, since last identified loop
   AllocationGenerator gen_;
   static constexpr int NO_RESOURCE = -1;                    //!< flag to indicate player has selected no resource
-  int max_iteration_;                                       //!< number maximum of iterations of BMF algorithm
+  int max_iteration_               = cfg_bmf_max_iteration; //!< number maximum of iterations of BMF algorithm
 };
 
 /**
index 6a6deb4..38f6869 100644 (file)
@@ -112,7 +112,7 @@ CpuImpl* CpuImpl::set_core_count(int core_count)
 
 void CpuImpl::apply_sharing_policy_cfg() const
 {
-  if (!get_constraint())
+  if (not get_constraint())
     return;
 
   kernel::lmm::Constraint::SharingPolicy lmm_policy = kernel::lmm::Constraint::SharingPolicy::SHARED;
index 29198e1..07709ce 100644 (file)
@@ -29,7 +29,7 @@ xbt::signal<void(DiskAction const&, Action::State, Action::State)> DiskAction::o
 
 DiskModel::DiskModel(const std::string& name) : Model(name)
 {
-  set_maxmin_system(lmm::System::build(cfg_disk_solver, true /* selective update */));
+  set_maxmin_system(lmm::System::build(cfg_disk_solver.get(), true /* selective update */));
 }
 
 /************
index 854aafc..cda3fdb 100644 (file)
@@ -71,7 +71,8 @@ static void add_active_exec(s4u::Exec const& task)
   const s4u::VirtualMachine* vm = dynamic_cast<s4u::VirtualMachine*>(task.get_host());
   if (vm != nullptr) {
     VirtualMachineImpl* vm_impl = vm->get_vm_impl();
-    vm_impl->add_active_exec();
+    for (int i = 1; i <= task.get_thread_count(); i++)
+      vm_impl->add_active_exec();
     vm_impl->update_action_weight();
   }
 }
@@ -86,7 +87,8 @@ static void remove_active_exec(s4u::Activity const& task)
   const s4u::VirtualMachine* vm = dynamic_cast<s4u::VirtualMachine*>(exec->get_host());
   if (vm != nullptr) {
     VirtualMachineImpl* vm_impl = vm->get_vm_impl();
-    vm_impl->remove_active_exec();
+    for (int i = 1; i <= exec->get_thread_count(); i++)
+      vm_impl->remove_active_exec();
     vm_impl->update_action_weight();
   }
 }
index 038a0ea..d31d31a 100644 (file)
@@ -237,8 +237,8 @@ Profile* ProfileBuilder::from_file(const std::string& path)
 
 
 Profile* ProfileBuilder::from_void() {
-  static Profile void_profile("__void__", nullptr, -1.0);
-  return &void_profile;
+  static auto* void_profile = new Profile("__void__", nullptr, -1.0);
+  return void_profile;
 }
 
 Profile* ProfileBuilder::from_callback(const std::string& name, const std::function<UpdateCb>& cb, double repeat_delay) {
index 851b140..3c6bfc6 100644 (file)
@@ -77,8 +77,8 @@ void FatTreeZone::get_local_route(const NetPoint* src, const NetPoint* dst, Rout
     for (unsigned int i = 0; i < currentNode->level; i++)
       d /= this->num_parents_per_node_[i];
 
-    int k = this->num_parents_per_node_[currentNode->level];
-    d     = d % k;
+    int k = this->num_parents_per_node_[currentNode->level] * this->num_port_lower_level_[currentNode->level];
+    d = d % k;
 
     if (currentNode->limiter_link_)
       into->link_list_.push_back(currentNode->limiter_link_);
@@ -93,7 +93,9 @@ void FatTreeZone::get_local_route(const NetPoint* src, const NetPoint* dst, Rout
 
   // Down part
   while (currentNode != destination) {
-    for (unsigned int i = 0; i < currentNode->children.size(); i++) {
+    //pick cable when multiple parallels
+    int d = source->position % this->num_port_lower_level_[currentNode->level - 1];
+    for (unsigned int i = d * this->num_children_per_node_[currentNode->level - 1]; i < currentNode->children.size(); i++) {
       if (i % this->num_children_per_node_[currentNode->level - 1] == destination->label[currentNode->level - 1]) {
         add_link_latency(into->link_list_, currentNode->children[i]->down_link_, latency);
 
index 17afb8b..18d00d9 100644 (file)
@@ -9,6 +9,7 @@
 #include <simgrid/s4u/Host.hpp>
 #include <simgrid/s4u/VirtualMachine.hpp>
 
+#include "xbt/asserts.hpp"
 #include "src/include/simgrid/sg_config.hpp"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/resource/CpuImpl.hpp"
@@ -40,8 +41,8 @@ static void surf_config_models_setup()
 
   XBT_DEBUG("host model: %s", host_model_name.c_str());
   if (host_model_name == "compound") {
-    xbt_assert(not cpu_model_name.empty(), "Set a cpu model to use with the 'compound' host model");
-    xbt_assert(not network_model_name.empty(), "Set a network model to use with the 'compound' host model");
+    xbt_enforce(not cpu_model_name.empty(), "Set a cpu model to use with the 'compound' host model");
+    xbt_enforce(not network_model_name.empty(), "Set a network model to use with the 'compound' host model");
 
     const auto* cpu_model = find_model_description(surf_cpu_model_description, cpu_model_name);
     cpu_model->model_init_preparse();
@@ -93,7 +94,7 @@ NetZoneImpl::NetZoneImpl(const std::string& name) : piface_(this), name_(name)
     surf_config_models_setup();
   }
 
-  xbt_assert(nullptr == engine->netpoint_by_name_or_null(get_name()),
+  xbt_enforce(nullptr == engine->netpoint_by_name_or_null(get_name()),
              "Refusing to create a second NetZone called '%s'.", get_cname());
   netpoint_ = new NetPoint(name_, NetPoint::Type::NetZone);
   XBT_DEBUG("NetZone '%s' created with the id '%lu'", get_cname(), netpoint_->id());
@@ -153,7 +154,7 @@ xbt_edge_t NetZoneImpl::new_xbt_graph_edge(const s_xbt_graph_t* graph, xbt_node_
 
 void NetZoneImpl::add_child(NetZoneImpl* new_zone)
 {
-  xbt_assert(not sealed_, "Cannot add a new child to the sealed zone %s", get_cname());
+  xbt_enforce(not sealed_, "Cannot add a new child to the sealed zone %s", get_cname());
   /* set the parent behavior */
   hierarchy_ = RoutingMode::recursive;
   children_.push_back(new_zone);
@@ -207,10 +208,10 @@ size_t NetZoneImpl::get_link_count() const
 
 s4u::Host* NetZoneImpl::create_host(const std::string& name, const std::vector<double>& speed_per_pstate)
 {
-  xbt_assert(cpu_model_pm_,
+  xbt_enforce(cpu_model_pm_,
              "Impossible to create host: %s. Invalid CPU model: nullptr. Have you set the parent of this NetZone: %s?",
              name.c_str(), get_cname());
-  xbt_assert(not sealed_, "Impossible to create host: %s. NetZone %s already sealed", name.c_str(), get_cname());
+  xbt_enforce(not sealed_, "Impossible to create host: %s. NetZone %s already sealed", name.c_str(), get_cname());
   auto* host   = (new resource::HostImpl(name))->set_englobing_zone(this);
   hosts_[name] = host;
   host->get_iface()->set_netpoint((new NetPoint(name, NetPoint::Type::Host))->set_englobing_zone(this));
@@ -227,11 +228,11 @@ resource::StandardLinkImpl* NetZoneImpl::do_create_link(const std::string& name,
 
 s4u::Link* NetZoneImpl::create_link(const std::string& name, const std::vector<double>& bandwidths)
 {
-  xbt_assert(
+  xbt_enforce(
       network_model_,
       "Impossible to create link: %s. Invalid network model: nullptr. Have you set the parent of this NetZone: %s?",
       name.c_str(), get_cname());
-  xbt_assert(not sealed_, "Impossible to create link: %s. NetZone %s already sealed", name.c_str(), get_cname());
+  xbt_enforce(not sealed_, "Impossible to create link: %s. NetZone %s already sealed", name.c_str(), get_cname());
   links_[name] = do_create_link(name, bandwidths)->set_englobing_zone(this);
   return links_[name]->get_iface();
 }
@@ -239,11 +240,11 @@ s4u::Link* NetZoneImpl::create_link(const std::string& name, const std::vector<d
 s4u::SplitDuplexLink* NetZoneImpl::create_split_duplex_link(const std::string& name,
                                                             const std::vector<double>& bandwidths)
 {
-  xbt_assert(
+  xbt_enforce(
       network_model_,
       "Impossible to create link: %s. Invalid network model: nullptr. Have you set the parent of this NetZone: %s?",
       name.c_str(), get_cname());
-  xbt_assert(not sealed_, "Impossible to create link: %s. NetZone %s already sealed", name.c_str(), get_cname());
+  xbt_enforce(not sealed_, "Impossible to create link: %s. NetZone %s already sealed", name.c_str(), get_cname());
 
   auto* link_up             = create_link(name + "_UP", bandwidths)->get_impl()->set_englobing_zone(this);
   auto* link_down           = create_link(name + "_DOWN", bandwidths)->get_impl()->set_englobing_zone(this);
@@ -253,10 +254,10 @@ s4u::SplitDuplexLink* NetZoneImpl::create_split_duplex_link(const std::string& n
 
 s4u::Disk* NetZoneImpl::create_disk(const std::string& name, double read_bandwidth, double write_bandwidth)
 {
-  xbt_assert(disk_model_,
+  xbt_enforce(disk_model_,
              "Impossible to create disk: %s. Invalid disk model: nullptr. Have you set the parent of this NetZone: %s?",
              name.c_str(), get_cname());
-  xbt_assert(not sealed_, "Impossible to create disk: %s. NetZone %s already sealed", name.c_str(), get_cname());
+  xbt_enforce(not sealed_, "Impossible to create disk: %s. NetZone %s already sealed", name.c_str(), get_cname());
   auto* l = disk_model_->create_disk(name, read_bandwidth, write_bandwidth);
 
   return l->get_iface();
@@ -264,9 +265,9 @@ s4u::Disk* NetZoneImpl::create_disk(const std::string& name, double read_bandwid
 
 NetPoint* NetZoneImpl::create_router(const std::string& name)
 {
-  xbt_assert(nullptr == s4u::Engine::get_instance()->netpoint_by_name_or_null(name),
+  xbt_enforce(nullptr == s4u::Engine::get_instance()->netpoint_by_name_or_null(name),
              "Refusing to create a router named '%s': this name already describes a node.", name.c_str());
-  xbt_assert(not sealed_, "Impossible to create router: %s. NetZone %s already sealed", name.c_str(), get_cname());
+  xbt_enforce(not sealed_, "Impossible to create router: %s. NetZone %s already sealed", name.c_str(), get_cname());
 
   return (new NetPoint(name, NetPoint::Type::Router))->set_englobing_zone(this);
 }
@@ -289,7 +290,7 @@ std::vector<resource::StandardLinkImpl*> NetZoneImpl::get_link_list_impl(const s
     }
     // split-duplex links
     const auto* sd_link = dynamic_cast<const s4u::SplitDuplexLink*>(link.get_link());
-    xbt_assert(sd_link,
+    xbt_enforce(sd_link,
                "Add_route: cast to SpliDuplexLink impossible. This should not happen, please contact SimGrid team");
     resource::StandardLinkImpl* link_impl;
     switch (link.get_direction()) {
@@ -342,19 +343,11 @@ resource::SplitDuplexLinkImpl* NetZoneImpl::get_split_duplex_link_by_name_or_nul
 
 resource::HostImpl* NetZoneImpl::get_host_by_name_or_null(const std::string& name) const
 {
-  for (auto const& [_, host] : hosts_) {
-    if (host->get_name() == name)
-      return host;
-    /* keep old behavior where host and VMs were saved together on EngineImpl::hosts_
-     * get hosts returns VMs too */
-    auto* vm = host->get_vm_by_name_or_null(name);
-    if (vm)
-      return vm;
-  }
+  if (auto host_it = hosts_.find(name); host_it != hosts_.end())
+    return host_it->second;
 
   for (const auto* child : children_) {
-    auto* host = child->get_host_by_name_or_null(name);
-    if (host)
+    if (auto* host = child->get_host_by_name_or_null(name))
       return host;
   }
 
@@ -396,16 +389,16 @@ void NetZoneImpl::add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_sr
   if (gw_dst) {
     XBT_DEBUG("Load bypassNetzoneRoute from %s@%s to %s@%s", src->get_cname(), gw_src->get_cname(), dst->get_cname(),
               gw_dst->get_cname());
-    xbt_assert(not link_list.empty(), "Bypass route between %s@%s and %s@%s cannot be empty.", src->get_cname(),
+    xbt_enforce(not link_list.empty(), "Bypass route between %s@%s and %s@%s cannot be empty.", src->get_cname(),
                gw_src->get_cname(), dst->get_cname(), gw_dst->get_cname());
-    xbt_assert(bypass_routes_.find({src, dst}) == bypass_routes_.end(),
+    xbt_enforce(bypass_routes_.find({src, dst}) == bypass_routes_.end(),
                "The bypass route between %s@%s and %s@%s already exists.", src->get_cname(), gw_src->get_cname(),
                dst->get_cname(), gw_dst->get_cname());
   } else {
     XBT_DEBUG("Load bypassRoute from %s to %s", src->get_cname(), dst->get_cname());
-    xbt_assert(not link_list.empty(), "Bypass route between %s and %s cannot be empty.", src->get_cname(),
+    xbt_enforce(not link_list.empty(), "Bypass route between %s and %s cannot be empty.", src->get_cname(),
                dst->get_cname());
-    xbt_assert(bypass_routes_.find({src, dst}) == bypass_routes_.end(),
+    xbt_enforce(bypass_routes_.find({src, dst}) == bypass_routes_.end(),
                "The bypass route between %s and %s already exists.", src->get_cname(), dst->get_cname());
   }
 
@@ -486,8 +479,8 @@ static void find_common_ancestors(const NetPoint* src, const NetPoint* dst,
   const NetZoneImpl* src_as = src->get_englobing_zone();
   const NetZoneImpl* dst_as = dst->get_englobing_zone();
 
-  xbt_assert(src_as, "Host %s must be in a netzone", src->get_cname());
-  xbt_assert(dst_as, "Host %s must be in a netzone", dst->get_cname());
+  xbt_enforce(src_as, "Host %s must be in a netzone", src->get_cname());
+  xbt_enforce(dst_as, "Host %s must be in a netzone", dst->get_cname());
 
   /* (2) find the path to the root routing component */
   std::vector<NetZoneImpl*> path_src;
@@ -522,7 +515,7 @@ static void find_common_ancestors(const NetPoint* src, const NetPoint* dst,
   if (*src_ancestor == *dst_ancestor) {             // src is the ancestor of dst, or the contrary
     *common_ancestor = *src_ancestor;
   } else {
-    xbt_assert(parent != nullptr);
+    xbt_enforce(parent != nullptr);
     *common_ancestor = parent;
   }
 }
@@ -652,7 +645,7 @@ void NetZoneImpl::get_global_route_with_netzones(const NetPoint* src, const NetP
 
   /* Not in the same netzone, no bypass. We'll have to find our path between the netzones recursively */
   common_ancestor->get_local_route(src_ancestor->netpoint_, dst_ancestor->netpoint_, &route, latency);
-  xbt_assert((route.gw_src_ != nullptr) && (route.gw_dst_ != nullptr), "Bad gateways for route from '%s' to '%s'.",
+  xbt_enforce((route.gw_src_ != nullptr) && (route.gw_dst_ != nullptr), "Bad gateways for route from '%s' to '%s'.",
              src->get_cname(), dst->get_cname());
 
   /* If source gateway is not our source, we have to recursively find our way up to this point */
@@ -742,7 +735,7 @@ void NetZoneImpl::seal()
 
 void NetZoneImpl::set_parent(NetZoneImpl* parent)
 {
-  xbt_assert(not sealed_, "Impossible to set parent to an already sealed NetZone(%s)", this->get_cname());
+  xbt_enforce(not sealed_, "Impossible to set parent to an already sealed NetZone(%s)", this->get_cname());
   parent_ = parent;
   netpoint_->set_englobing_zone(parent_);
   if (parent) {
@@ -759,37 +752,37 @@ void NetZoneImpl::set_parent(NetZoneImpl* parent)
 
 void NetZoneImpl::set_network_model(std::shared_ptr<resource::NetworkModel> netmodel)
 {
-  xbt_assert(not sealed_, "Impossible to set network model to an already sealed NetZone(%s)", this->get_cname());
+  xbt_enforce(not sealed_, "Impossible to set network model to an already sealed NetZone(%s)", this->get_cname());
   network_model_ = std::move(netmodel);
 }
 
 void NetZoneImpl::set_cpu_vm_model(std::shared_ptr<resource::CpuModel> cpu_model)
 {
-  xbt_assert(not sealed_, "Impossible to set CPU model to an already sealed NetZone(%s)", this->get_cname());
+  xbt_enforce(not sealed_, "Impossible to set CPU model to an already sealed NetZone(%s)", this->get_cname());
   cpu_model_vm_ = std::move(cpu_model);
 }
 
 void NetZoneImpl::set_cpu_pm_model(std::shared_ptr<resource::CpuModel> cpu_model)
 {
-  xbt_assert(not sealed_, "Impossible to set CPU model to an already sealed NetZone(%s)", this->get_cname());
+  xbt_enforce(not sealed_, "Impossible to set CPU model to an already sealed NetZone(%s)", this->get_cname());
   cpu_model_pm_ = std::move(cpu_model);
 }
 
 void NetZoneImpl::set_disk_model(std::shared_ptr<resource::DiskModel> disk_model)
 {
-  xbt_assert(not sealed_, "Impossible to set disk model to an already sealed NetZone(%s)", this->get_cname());
+  xbt_enforce(not sealed_, "Impossible to set disk model to an already sealed NetZone(%s)", this->get_cname());
   disk_model_ = std::move(disk_model);
 }
 
 void NetZoneImpl::set_host_model(std::shared_ptr<resource::HostModel> host_model)
 {
-  xbt_assert(not sealed_, "Impossible to set host model to an already sealed NetZone(%s)", this->get_cname());
+  xbt_enforce(not sealed_, "Impossible to set host model to an already sealed NetZone(%s)", this->get_cname());
   host_model_ = std::move(host_model);
 }
 
 const NetZoneImpl* NetZoneImpl::get_netzone_recursive(const NetPoint* netpoint) const
 {
-  xbt_assert(netpoint && netpoint->is_netzone(), "Netpoint %s must be of the type NetZone",
+  xbt_enforce(netpoint && netpoint->is_netzone(), "Netpoint %s must be of the type NetZone",
              netpoint ? netpoint->get_cname() : "nullptr");
 
   if (netpoint == netpoint_)
index 4534368..e7c2c79 100644 (file)
@@ -10,6 +10,7 @@
 #include "xbt/graph.h"
 #include "xbt/log.h"
 #include "xbt/sysdep.h"
+#include "xbt/asserts.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_routing_generic, ker_routing, "Kernel Generic Routing");
 
@@ -26,11 +27,10 @@ RoutedZone::RoutedZone(const std::string& name) : NetZoneImpl(name) {}
 Route* RoutedZone::new_extended_route(RoutingMode hierarchy, NetPoint* gw_src, NetPoint* gw_dst,
                                       const std::vector<resource::StandardLinkImpl*>& link_list, bool preserve_order)
 {
-  auto* result = new Route();
+  xbt_enforce(hierarchy != RoutingMode::recursive || (gw_src && gw_dst), "nullptr is obviously a deficient gateway");
 
+  auto* result = new Route();
   if (hierarchy == RoutingMode::recursive) {
-    xbt_assert(gw_src && gw_dst, "nullptr is obviously a deficient gateway");
-
     result->gw_src_ = gw_src;
     result->gw_dst_ = gw_dst;
   }
@@ -46,17 +46,17 @@ Route* RoutedZone::new_extended_route(RoutingMode hierarchy, NetPoint* gw_src, N
 
 void RoutedZone::get_route_check_params(const NetPoint* src, const NetPoint* dst) const
 {
-  xbt_assert(src, "Cannot have a route with (nullptr) source");
-  xbt_assert(dst, "Cannot have a route with (nullptr) destination");
+  xbt_enforce(src, "Cannot have a route with (nullptr) source");
+  xbt_enforce(dst, "Cannot have a route with (nullptr) destination");
 
   const NetZoneImpl* src_as = src->get_englobing_zone();
   const NetZoneImpl* dst_as = dst->get_englobing_zone();
 
-  xbt_assert(src_as == dst_as,
+  xbt_enforce(src_as == dst_as,
              "Internal error: %s@%s and %s@%s are not in the same netzone as expected. Please report that bug.",
              src->get_cname(), src_as->get_cname(), dst->get_cname(), dst_as->get_cname());
 
-  xbt_assert(this == dst_as,
+  xbt_enforce(this == dst_as,
              "Internal error: route destination %s@%s is not in netzone %s as expected (route source: "
              "%s@%s). Please report that bug.",
              src->get_cname(), dst->get_cname(), src_as->get_cname(), dst_as->get_cname(), get_cname());
@@ -71,40 +71,40 @@ void RoutedZone::add_route_check_params(NetPoint* src, NetPoint* dst, NetPoint*
 
   if (not gw_dst || not gw_src) {
     XBT_DEBUG("Load Route from \"%s\" to \"%s\"", srcName, dstName);
-    xbt_assert(not link_list.empty(), "Empty route (between %s and %s) forbidden.", srcName, dstName);
-    xbt_assert(not src->is_netzone(),
+    xbt_enforce(not link_list.empty(), "Empty route (between %s and %s) forbidden.", srcName, dstName);
+    xbt_enforce(not src->is_netzone(),
                "When defining a route, src cannot be a netzone such as '%s'. Did you meant to have a NetzoneRoute?",
                srcName);
-    xbt_assert(not dst->is_netzone(),
+    xbt_enforce(not dst->is_netzone(),
                "When defining a route, dst cannot be a netzone such as '%s'. Did you meant to have a NetzoneRoute?",
                dstName);
     NetZoneImpl::on_route_creation(symmetrical, src, dst, gw_src, gw_dst, get_link_list_impl(link_list, false));
   } else {
     XBT_DEBUG("Load NetzoneRoute from %s@%s to %s@%s", srcName, gw_src->get_cname(), dstName, gw_dst->get_cname());
-    xbt_assert(src->is_netzone(), "When defining a NetzoneRoute, src must be a netzone but '%s' is not", srcName);
-    xbt_assert(dst->is_netzone(), "When defining a NetzoneRoute, dst must be a netzone but '%s' is not", dstName);
+    xbt_enforce(src->is_netzone(), "When defining a NetzoneRoute, src must be a netzone but '%s' is not", srcName);
+    xbt_enforce(dst->is_netzone(), "When defining a NetzoneRoute, dst must be a netzone but '%s' is not", dstName);
 
-    xbt_assert(gw_src->is_host() || gw_src->is_router(),
+    xbt_enforce(gw_src->is_host() || gw_src->is_router(),
                "When defining a NetzoneRoute, gw_src must be a host or a router but '%s' is not.", srcName);
-    xbt_assert(gw_dst->is_host() || gw_dst->is_router(),
+    xbt_enforce(gw_dst->is_host() || gw_dst->is_router(),
                "When defining a NetzoneRoute, gw_dst must be a host or a router but '%s' is not.", dstName);
 
-    xbt_assert(gw_src != gw_dst, "Cannot define a NetzoneRoute from '%s' to itself", gw_src->get_cname());
+    xbt_enforce(gw_src != gw_dst, "Cannot define a NetzoneRoute from '%s' to itself", gw_src->get_cname());
 
-    xbt_assert(src, "Cannot add a route from %s@%s to %s@%s: %s does not exist.", srcName, gw_src->get_cname(), dstName,
+    xbt_enforce(src, "Cannot add a route from %s@%s to %s@%s: %s does not exist.", srcName, gw_src->get_cname(), dstName,
                gw_dst->get_cname(), srcName);
-    xbt_assert(dst, "Cannot add a route from %s@%s to %s@%s: %s does not exist.", srcName, gw_src->get_cname(), dstName,
+    xbt_enforce(dst, "Cannot add a route from %s@%s to %s@%s: %s does not exist.", srcName, gw_src->get_cname(), dstName,
                gw_dst->get_cname(), dstName);
-    xbt_assert(not link_list.empty(), "Empty route (between %s@%s and %s@%s) forbidden.", srcName, gw_src->get_cname(),
+    xbt_enforce(not link_list.empty(), "Empty route (between %s@%s and %s@%s) forbidden.", srcName, gw_src->get_cname(),
                dstName, gw_dst->get_cname());
     const auto* netzone_src = get_netzone_recursive(src);
-    xbt_assert(netzone_src->is_component_recursive(gw_src),
+    xbt_enforce(netzone_src->is_component_recursive(gw_src),
                "Invalid NetzoneRoute from %s@%s to %s@%s: gw_src %s belongs to %s, not to %s.", srcName,
                gw_src->get_cname(), dstName, gw_dst->get_cname(), gw_src->get_cname(),
                gw_src->get_englobing_zone()->get_cname(), srcName);
 
     const auto* netzone_dst = get_netzone_recursive(dst);
-    xbt_assert(netzone_dst->is_component_recursive(gw_dst),
+    xbt_enforce(netzone_dst->is_component_recursive(gw_dst),
                "Invalid NetzoneRoute from %s@%s to %s@%s: gw_dst %s belongs to %s, not to %s.", srcName,
                gw_src->get_cname(), dstName, gw_dst->get_cname(), gw_dst->get_cname(),
                gw_dst->get_englobing_zone()->get_cname(), dst->get_cname());
index 1e3c2be..17e2bce 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "src/mc/ModelChecker.hpp"
 #include "src/mc/explo/Exploration.hpp"
+#include "src/mc/explo/LivenessChecker.hpp"
 #include "src/mc/mc_config.hpp"
 #include "src/mc/mc_exit.hpp"
 #include "src/mc/mc_private.hpp"
@@ -66,8 +67,13 @@ void ModelChecker::start()
   xbt_assert(waitpid(pid, &status, WAITPID_CHECKED_FLAGS) == pid && WIFSTOPPED(status) && WSTOPSIG(status) == SIGSTOP,
              "Could not wait model-checked process");
 
-  if (not _sg_mc_dot_output_file.get().empty())
-    MC_init_dot_output();
+  if (not _sg_mc_dot_output_file.get().empty()) {
+    dot_output_ = fopen(_sg_mc_dot_output_file.get().c_str(), "w");
+    xbt_assert(dot_output_ != nullptr, "Error open dot output file: %s", strerror(errno));
+
+    fprintf(dot_output_, "digraph graphname{\n fixedsize=true; rankdir=TB; ranksep=.25; edge [fontsize=12]; node "
+                         "[fontsize=10, shape=circle,width=.5 ]; graph [resolution=20, fontsize=10];\n");
+  }
 
   setup_ignore();
 
@@ -87,6 +93,16 @@ void ModelChecker::start()
              errno);
 }
 
+void ModelChecker::dot_output(const char* fmt, ...)
+{
+  if (dot_output_ != nullptr) {
+    va_list ap;
+    va_start(ap, fmt);
+    vfprintf(dot_output_, fmt, ap);
+    va_end(ap);
+  }
+}
+
 static constexpr auto ignored_local_variables = {
     std::make_pair("e", "*"),
     std::make_pair("_log_ev", "*"),
@@ -125,7 +141,7 @@ void ModelChecker::resume()
   remote_process_->clear_cache();
 }
 
-static void MC_report_crash(int status)
+static void MC_report_crash(Exploration* explorer, int status)
 {
   XBT_INFO("**************************");
   XBT_INFO("** CRASH IN THE PROGRAM **");
@@ -136,12 +152,12 @@ static void MC_report_crash(int status)
     XBT_INFO("From exit: %i", WEXITSTATUS(status));
   if (not xbt_log_no_loc)
     XBT_INFO("%s core dump was generated by the system.", WCOREDUMP(status) ? "A" : "No");
-  if (mc_model_checker->get_exploration()) {
+  if (explorer) {
     XBT_INFO("Counter-example execution trace:");
-    for (auto const& s : mc_model_checker->get_exploration()->get_textual_trace())
+    for (auto const& s : explorer->get_textual_trace())
       XBT_INFO("  %s", s.c_str());
-    XBT_INFO("Path = %s", mc_model_checker->get_exploration()->get_record_trace().to_string().c_str());
-    Api::get().get_session().log_state();
+    XBT_INFO("Path = %s", explorer->get_record_trace().to_string().c_str());
+    explorer->log_state();
     if (xbt_log_no_loc) {
       XBT_INFO("Stack trace not displayed because you passed --log=no_loc");
     } else {
@@ -163,7 +179,7 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
       xbt_assert(size == sizeof(message), "Broken message. Got %d bytes instead of %d.", (int)size, (int)sizeof(message));
       memcpy(&message, buffer, sizeof(message));
 
-      get_remote_process().init(message.mmalloc_default_mdp, message.maxpid, message.actors);
+      get_remote_process().init(message.mmalloc_default_mdp, message.maxpid);
       break;
     }
 
@@ -211,14 +227,7 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
       xbt_assert(not message.callback, "Support for client-side function proposition is not implemented.");
       XBT_DEBUG("Received symbol: %s", message.name.data());
 
-      if (property_automaton == nullptr)
-        property_automaton = xbt_automaton_new();
-
-      const RemoteProcess* process    = &this->get_remote_process();
-      RemotePtr<int> address          = remote((int*)message.data);
-      xbt::add_proposition(property_automaton, message.name.data(),
-                           [process, address]() { return process->read(address); });
-
+      LivenessChecker::automaton_register_symbol(get_remote_process(), message.name.data(), remote((int*)message.data));
       break;
     }
 
@@ -233,7 +242,7 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
       for (auto const& s : get_exploration()->get_textual_trace())
         XBT_INFO("  %s", s.c_str());
       XBT_INFO("Path = %s", get_exploration()->get_record_trace().to_string().c_str());
-      Api::get().get_session().log_state();
+      exploration_->log_state();
 
       this->exit(SIMGRID_MC_EXIT_SAFETY);
 
@@ -273,7 +282,7 @@ void ModelChecker::handle_waitpid()
       if (status>>8 == (SIGTRAP | (PTRACE_EVENT_EXIT<<8))) {
         xbt_assert(ptrace(PTRACE_GETEVENTMSG, remote_process_->pid(), 0, &status) != -1, "Could not get exit status");
         if (WIFSIGNALED(status)) {
-          MC_report_crash(status);
+          MC_report_crash(exploration_, status);
           this->get_remote_process().terminate();
           this->exit(SIMGRID_MC_EXIT_PROGRAM_CRASH);
         }
@@ -293,7 +302,7 @@ void ModelChecker::handle_waitpid()
       }
 
       else if (WIFSIGNALED(status)) {
-        MC_report_crash(status);
+        MC_report_crash(exploration_, status);
         this->get_remote_process().terminate();
         this->exit(SIMGRID_MC_EXIT_PROGRAM_CRASH);
       } else if (WIFEXITED(status)) {
@@ -349,7 +358,11 @@ void ModelChecker::finalize_app(bool terminate_asap)
   xbt_assert(checker_side_.get_channel().send(m) == 0, "Could not ask the app to finalize on need");
 
   s_mc_message_t answer;
-  xbt_assert(checker_side_.get_channel().receive(answer) != -1, "Could not receive answer to FINALIZE");
+  ssize_t s = checker_side_.get_channel().receive(answer);
+  xbt_assert(s != -1, "Could not receive answer to FINALIZE");
+  xbt_assert(s == sizeof(answer) && answer.type == MessageType::FINALIZE_REPLY,
+             "Received unexpected message %s (%i, size=%i) expected MessageType::FINALIZE_REPLY (%i, size=%i)",
+             to_c_str(answer.type), (int)answer.type, (int)s, (int)MessageType::FINALIZE_REPLY, (int)sizeof(answer));
 }
 
 } // namespace simgrid::mc
index c4b1894..09fbfcb 100644 (file)
@@ -28,10 +28,9 @@ class ModelChecker {
   std::unique_ptr<RemoteProcess> remote_process_;
   Exploration* exploration_ = nullptr;
 
-  unsigned long visited_states_ = 0;
+  FILE* dot_output_ = nullptr;
 
-  // Expect MessageType::SIMCALL_TO_STRING or MessageType::SIMCALL_DOT_LABEL
-  std::string simcall_to_string(MessageType type, aid_t aid, int times_considered);
+  unsigned long visited_states_ = 0;
 
 public:
   ModelChecker(ModelChecker const&) = delete;
@@ -66,6 +65,18 @@ public:
   unsigned long get_visited_states() const { return visited_states_; }
   void inc_visited_states() { visited_states_++; }
 
+  void dot_output(const char* fmt, ...) XBT_ATTRIB_PRINTF(2, 3);
+  void dot_output_flush()
+  {
+    if (dot_output_ != nullptr)
+      fflush(dot_output_);
+  }
+  void dot_output_close()
+  {
+    if (dot_output_ != nullptr)
+      fclose(dot_output_);
+  }
+
 private:
   void setup_ignore();
   bool handle_message(const char* buffer, ssize_t size);
index 6e46c3c..8264c2a 100644 (file)
@@ -4,23 +4,23 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/mc/VisitedState.hpp"
+#include "src/mc/explo/Exploration.hpp"
 #include "src/mc/mc_private.hpp"
 
 #include <unistd.h>
 #include <sys/wait.h>
 #include <memory>
 #include <boost/range/algorithm.hpp>
-#include "src/mc/api.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_VisitedState, mc, "Logging specific to state equality detection mechanisms");
 
 namespace simgrid::mc {
 
 /** @brief Save the current state */
-VisitedState::VisitedState(unsigned long state_number) : num(state_number)
+VisitedState::VisitedState(unsigned long state_number, unsigned int actor_count)
+    : actor_count_(actor_count), num(state_number)
 {
-  this->heap_bytes_used = Api::get().get_remote_heap_bytes();
-  this->actors_count    = Api::get().get_actors().size();
+  this->heap_bytes_used = mc_model_checker->get_remote_process().get_remote_heap_bytes();
   this->system_state = std::make_shared<simgrid::mc::Snapshot>(state_number);
 }
 
@@ -39,45 +39,42 @@ 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_snapshots)
+std::unique_ptr<simgrid::mc::VisitedState> VisitedStates::addVisitedState(unsigned long state_number,
+                                                                          simgrid::mc::State* graph_state)
 {
-  auto new_state             = std::make_unique<simgrid::mc::VisitedState>(state_number);
+  auto new_state = std::make_unique<simgrid::mc::VisitedState>(state_number, graph_state->get_actor_count());
   graph_state->set_system_state(new_state->system_state);
   XBT_DEBUG("Snapshot %p of visited state %ld (exploration stack state %ld)", new_state->system_state.get(),
             new_state->num, graph_state->get_num());
 
-  auto [range_begin, range_end] = boost::range::equal_range(states_, new_state.get(), Api::get().compare_pair());
+  auto [range_begin, range_end] = boost::range::equal_range(states_, new_state.get(), [](auto const& a, auto const& b) {
+    return std::make_pair(a->actor_count_, a->heap_bytes_used) < std::make_pair(b->actor_count_, b->heap_bytes_used);
+  });
 
-  if (compare_snapshots)
-    for (auto i = range_begin; i != range_end; ++i) {
-      auto& visited_state = *i;
-      if (Api::get().snapshot_equal(visited_state->system_state.get(), new_state->system_state.get())) {
-        // The state has been visited:
+  for (auto i = range_begin; i != range_end; ++i) {
+    auto& visited_state = *i;
+    if (*visited_state->system_state.get() == *new_state->system_state.get()) {
+      // The state has been visited:
 
-        std::unique_ptr<simgrid::mc::VisitedState> old_state =
-          std::move(visited_state);
+      std::unique_ptr<simgrid::mc::VisitedState> old_state = std::move(visited_state);
 
-        if (old_state->original_num == -1) // I'm the copy of an original process
-          new_state->original_num = old_state->num;
-        else // I'm the copy of a copy
-          new_state->original_num = old_state->original_num;
+      if (old_state->original_num == -1) // I'm the copy of an original process
+        new_state->original_num = old_state->num;
+      else // I'm the copy of a copy
+        new_state->original_num = old_state->original_num;
 
-        if (dot_output == nullptr)
-          XBT_DEBUG("State %ld already visited ! (equal to state %ld)", new_state->num, old_state->num);
-        else
-          XBT_DEBUG("State %ld already visited ! (equal to state %ld (state %ld in dot_output))", new_state->num,
-                    old_state->num, new_state->original_num);
+      XBT_DEBUG("State %ld already visited ! (equal to state %ld (state %ld in dot_output))", new_state->num,
+                old_state->num, new_state->original_num);
 
-        /* Replace the old state with the new one (with a bigger num)
-           (when the max number of visited states is reached,  the oldest
-           one is removed according to its number (= with the min number) */
-        XBT_DEBUG("Replace visited state %ld with the new visited state %ld", old_state->num, new_state->num);
+      /* Replace the old state with the new one (with a bigger num)
+          (when the max number of visited states is reached,  the oldest
+          one is removed according to its number (= with the min number) */
+      XBT_DEBUG("Replace visited state %ld with the new visited state %ld", old_state->num, new_state->num);
 
-        visited_state = std::move(new_state);
-        return old_state;
-      }
+      visited_state = std::move(new_state);
+      return old_state;
     }
+  }
 
   XBT_DEBUG("Insert new visited state %ld (total : %lu)", new_state->num, (unsigned long)states_.size());
   states_.insert(range_begin, std::move(new_state));
index 33f3d1a..9cec57a 100644 (file)
@@ -18,11 +18,11 @@ class XBT_PRIVATE VisitedState {
 public:
   std::shared_ptr<simgrid::mc::Snapshot> system_state = nullptr;
   std::size_t heap_bytes_used = 0;
-  int actors_count            = 0;
-  long num                                            = 0; // unique id of that state in the storage of all stored IDs
+  int actor_count_;
+  long num;               // unique id of that state in the storage of all stored IDs
   long original_num = -1; // num field of the VisitedState to which I was declared equal to (used for dot_output)
 
-  explicit VisitedState(unsigned long state_number);
+  explicit VisitedState(unsigned long state_number, unsigned int actor_count);
 };
 
 class XBT_PRIVATE VisitedStates {
@@ -30,7 +30,7 @@ class XBT_PRIVATE VisitedStates {
 public:
   void clear() { states_.clear(); }
   std::unique_ptr<simgrid::mc::VisitedState> addVisitedState(unsigned long state_number,
-                                                             simgrid::mc::State* graph_state, bool compare_snapshots);
+                                                             simgrid::mc::State* graph_state);
 
 private:
   void prune();
diff --git a/src/mc/api.cpp b/src/mc/api.cpp
deleted file mode 100644 (file)
index 840ffef..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-/* Copyright (c) 2020-2022. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "api.hpp"
-
-#include "src/kernel/activity/MailboxImpl.hpp"
-#include "src/kernel/activity/MutexImpl.hpp"
-#include "src/kernel/actor/SimcallObserver.hpp"
-#include "src/mc/Session.hpp"
-#include "src/mc/explo/Exploration.hpp"
-#include "src/mc/mc_base.hpp"
-#include "src/mc/mc_exit.hpp"
-#include "src/mc/mc_pattern.hpp"
-#include "src/mc/mc_private.hpp"
-#include "src/mc/remote/RemoteProcess.hpp"
-#include "src/surf/HostImpl.hpp"
-
-#include <xbt/asserts.h>
-#include <xbt/log.h>
-#include "simgrid/s4u/Host.hpp"
-#include "xbt/string.hpp"
-#if HAVE_SMPI
-#include "src/smpi/include/smpi_request.hpp"
-#endif
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(Api, mc, "Logging specific to MC Facade APIs ");
-XBT_LOG_EXTERNAL_CATEGORY(mc_global);
-
-namespace simgrid::mc {
-
-simgrid::mc::Exploration* Api::initialize(char** argv, simgrid::mc::ExplorationAlgorithm algo)
-{
-  session_ = std::make_unique<simgrid::mc::Session>([argv] {
-    int i = 1;
-    while (argv[i] != nullptr && argv[i][0] == '-')
-      i++;
-    xbt_assert(argv[i] != nullptr,
-               "Unable to find a binary to exec on the command line. Did you only pass config flags?");
-    execvp(argv[i], argv + i);
-    xbt_die("The model-checked process failed to exec(%s): %s", argv[i], strerror(errno));
-  });
-
-  simgrid::mc::Exploration* explo;
-  switch (algo) {
-    case ExplorationAlgorithm::CommDeterminism:
-      explo = simgrid::mc::create_communication_determinism_checker(session_.get());
-      break;
-
-    case ExplorationAlgorithm::UDPOR:
-      explo = simgrid::mc::create_udpor_checker(session_.get());
-      break;
-
-    case ExplorationAlgorithm::Safety:
-      explo = simgrid::mc::create_dfs_exploration(session_.get());
-      break;
-
-    case ExplorationAlgorithm::Liveness:
-      explo = simgrid::mc::create_liveness_checker(session_.get());
-      break;
-
-    default:
-      THROW_IMPOSSIBLE;
-  }
-
-  mc_model_checker->set_exploration(explo);
-  return explo;
-}
-
-std::vector<simgrid::mc::ActorInformation>& Api::get_actors() const
-{
-  return mc_model_checker->get_remote_process().actors();
-}
-
-unsigned long Api::get_maxpid() const
-{
-  return mc_model_checker->get_remote_process().get_maxpid();
-}
-
-std::size_t Api::get_remote_heap_bytes() const
-{
-  RemoteProcess& process    = mc_model_checker->get_remote_process();
-  auto heap_bytes_used      = mmalloc_get_bytes_used_remote(process.get_heap()->heaplimit, process.get_malloc_info());
-  return heap_bytes_used;
-}
-
-void Api::mc_inc_visited_states() const
-{
-  mc_model_checker->inc_visited_states();
-}
-
-unsigned long Api::mc_get_visited_states() const
-{
-  return mc_model_checker->get_visited_states();
-}
-
-void Api::mc_exit(int status) const
-{
-  mc_model_checker->exit(status);
-}
-
-void Api::restore_state(const simgrid::mc::Snapshot* system_state) const
-{
-  system_state->restore(&mc_model_checker->get_remote_process());
-}
-
-bool Api::snapshot_equal(const Snapshot* s1, const Snapshot* s2) const
-{
-  return simgrid::mc::snapshot_equal(s1, s2);
-}
-
-simgrid::mc::Snapshot* Api::take_snapshot(long num_state) const
-{
-  auto snapshot = new simgrid::mc::Snapshot(num_state);
-  return snapshot;
-}
-
-void Api::s_close()
-{
-  session_.reset();
-  if (simgrid::mc::property_automaton != nullptr) {
-    xbt_automaton_free(simgrid::mc::property_automaton);
-    simgrid::mc::property_automaton = nullptr;
-  }
-}
-
-void Api::automaton_load(const char* file) const
-{
-  if (simgrid::mc::property_automaton == nullptr)
-    simgrid::mc::property_automaton = xbt_automaton_new();
-
-  xbt_automaton_load(simgrid::mc::property_automaton, file);
-}
-
-std::vector<int> Api::automaton_propositional_symbol_evaluate() const
-{
-  unsigned int cursor = 0;
-  std::vector<int> values;
-  xbt_automaton_propositional_symbol_t ps = nullptr;
-  xbt_dynar_foreach (mc::property_automaton->propositional_symbols, cursor, ps)
-    values.push_back(xbt_automaton_propositional_symbol_evaluate(ps));
-  return values;
-}
-
-std::vector<xbt_automaton_state_t> Api::get_automaton_state() const
-{
-  std::vector<xbt_automaton_state_t> automaton_stack;
-  unsigned int cursor = 0;
-  xbt_automaton_state_t automaton_state;
-  xbt_dynar_foreach (mc::property_automaton->states, cursor, automaton_state)
-    if (automaton_state->type == -1)
-      automaton_stack.push_back(automaton_state);
-  return automaton_stack;
-}
-
-int Api::compare_automaton_exp_label(const xbt_automaton_exp_label* l) const
-{
-  unsigned int cursor                    = 0;
-  xbt_automaton_propositional_symbol_t p = nullptr;
-  xbt_dynar_foreach (simgrid::mc::property_automaton->propositional_symbols, cursor, p) {
-    if (std::strcmp(xbt_automaton_propositional_symbol_get_name(p), l->u.predicat) == 0)
-      return cursor;
-  }
-  return -1;
-}
-
-void Api::set_property_automaton(xbt_automaton_state_t const& automaton_state) const
-{
-  mc::property_automaton->current_state = automaton_state;
-}
-
-xbt_automaton_exp_label_t Api::get_automaton_transition_label(xbt_dynar_t const& dynar, int index) const
-{
-  const xbt_automaton_transition* transition = xbt_dynar_get_as(dynar, index, xbt_automaton_transition_t);
-  return transition->label;
-}
-
-xbt_automaton_state_t Api::get_automaton_transition_dst(xbt_dynar_t const& dynar, int index) const
-{
-  const xbt_automaton_transition* transition = xbt_dynar_get_as(dynar, index, xbt_automaton_transition_t);
-  return transition->dst;
-}
-
-} // namespace simgrid::mc
diff --git a/src/mc/api.hpp b/src/mc/api.hpp
deleted file mode 100644 (file)
index 88b2e0c..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Copyright (c) 2020-2022. The SimGrid Team. All rights reserved.          */
-
-/* This program 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_API_HPP
-#define SIMGRID_MC_API_HPP
-
-#include <memory>
-#include <vector>
-
-#include "simgrid/forward.h"
-#include "src/mc/Session.hpp"
-#include "src/mc/api/State.hpp"
-#include "src/mc/mc_forward.hpp"
-#include "src/mc/mc_record.hpp"
-#include "xbt/automaton.hpp"
-#include "xbt/base.h"
-
-namespace simgrid::mc {
-
-XBT_DECLARE_ENUM_CLASS(ExplorationAlgorithm, Safety, UDPOR, Liveness, CommDeterminism);
-
-/*
-** This class aimes to implement FACADE APIs for simgrid. The FACADE layer sits between the CheckerSide
-** (Unfolding_Checker, DPOR, ...) layer and the
-** AppSide layer. The goal is to drill down into the entagled details in the CheckerSide layer and break down the
-** detailes in a way that the CheckerSide eventually
-** be capable to acquire the required information through the FACADE layer rather than the direct access to the AppSide.
-*/
-
-class Api {
-private:
-  Api() = default;
-
-  struct DerefAndCompareByActorsCountAndUsedHeap {
-    template <class X, class Y> bool operator()(X const& a, Y const& b) const
-    {
-      return std::make_pair(a->actors_count, a->heap_bytes_used) < std::make_pair(b->actors_count, b->heap_bytes_used);
-    }
-  };
-
-  std::unique_ptr<simgrid::mc::Session> session_;
-
-public:
-  // No copy:
-  Api(Api const&) = delete;
-  void operator=(Api const&) = delete;
-
-  static Api& get()
-  {
-    static Api api;
-    return api;
-  }
-
-  simgrid::mc::Exploration* initialize(char** argv, simgrid::mc::ExplorationAlgorithm algo);
-
-  // ACTOR APIs
-  std::vector<simgrid::mc::ActorInformation>& get_actors() const;
-  unsigned long get_maxpid() const;
-
-  // REMOTE APIs
-  std::size_t get_remote_heap_bytes() const;
-
-  // MODEL CHECKER APIs
-  void mc_inc_visited_states() const;
-  unsigned long mc_get_visited_states() const;
-  XBT_ATTRIB_NORETURN void mc_exit(int status) const;
-
-  // STATE APIs
-  void restore_state(const Snapshot* system_state) const;
-
-  // SNAPSHOT APIs
-  bool snapshot_equal(const Snapshot* s1, const Snapshot* s2) const;
-  simgrid::mc::Snapshot* take_snapshot(long num_state) const;
-
-  // SESSION APIs
-  simgrid::mc::Session const& get_session() const { return *session_; }
-  void s_close();
-
-  // AUTOMATION APIs
-  void automaton_load(const char* file) const;
-  std::vector<int> automaton_propositional_symbol_evaluate() const;
-  std::vector<xbt_automaton_state_t> get_automaton_state() const;
-  int compare_automaton_exp_label(const xbt_automaton_exp_label* l) const;
-  void set_property_automaton(xbt_automaton_state_t const& automaton_state) const;
-  inline DerefAndCompareByActorsCountAndUsedHeap compare_pair() const
-  {
-    return DerefAndCompareByActorsCountAndUsedHeap();
-  }
-  xbt_automaton_exp_label_t get_automaton_transition_label(xbt_dynar_t const& dynar, int index) const;
-  xbt_automaton_state_t get_automaton_transition_dst(xbt_dynar_t const& dynar, int index) const;
-};
-
-} // namespace simgrid::mc
-
-#endif
similarity index 66%
rename from src/mc/mc_pattern.hpp
rename to src/mc/api/ActorState.hpp
index 8702a24..6538eff 100644 (file)
@@ -31,13 +31,36 @@ class ActorState {
   /** Exploration control information */
   InterleavingType state_ = InterleavingType::disabled;
 
-  /** Number of times that the process was considered to be executed */
+  /** The ID of that actor */
+  const aid_t aid_;
+
+  /** Number of times that the actor was considered to be executed in previous explorations of the state space */
   unsigned int times_considered_ = 0;
+  /** Maximal amount of times that the actor can be considered for execution in this state.
+   * If times_considered==max_consider, we fully explored that part of the state space */
+  unsigned int max_consider_ = 0;
+
+  /** Whether that actor is initially enabled in this state */
+  bool enabled_;
 
 public:
+  ActorState(aid_t aid, bool enabled, unsigned int max_consider)
+      : aid_(aid), max_consider_(max_consider), enabled_(enabled)
+  {
+  }
+
+  unsigned int do_consider()
+  {
+    if (max_consider_ <= times_considered_ + 1)
+      set_done();
+    return times_considered_++;
+  }
   unsigned int get_times_considered() const { return times_considered_; }
-  unsigned int get_times_considered_and_inc() { return times_considered_++; }
+  aid_t get_aid() const { return aid_; }
 
+  /* returns whether the actor is marked as enabled in the application side */
+  bool is_enabled() const { return enabled_; }
+  /* returns whether the actor is marked as disabled by the exploration algorithm */
   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; }
similarity index 53%
rename from src/mc/Session.cpp
rename to src/mc/api/RemoteApp.cpp
index 7b4e357..27518c4 100644 (file)
@@ -3,22 +3,25 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "src/mc/Session.hpp"
+#include "src/mc/api/RemoteApp.hpp"
 #include "src/internal_config.h" // HAVE_SMPI
 #include "src/mc/explo/Exploration.hpp"
 #include "src/mc/mc_config.hpp"
+#include "xbt/asserts.h"
 #if HAVE_SMPI
 #include "smpi/smpi.h"
 #include "src/smpi/include/private.hpp"
 #endif
+#include "signal.h"
 #include "src/mc/api/State.hpp"
+#include "src/mc/mc_config.hpp"
 #include "src/mc/mc_exit.hpp"
 #include "src/mc/mc_private.hpp"
 #include "xbt/log.h"
 #include "xbt/system_error.hpp"
 
-#include "signal.h"
 #include <array>
+#include <boost/tokenizer.hpp>
 #include <memory>
 #include <string>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_Session, mc, "Model-checker session");
 XBT_LOG_EXTERNAL_CATEGORY(mc_global);
 
+static simgrid::config::Flag<std::string> _sg_mc_setenv{
+    "model-check/setenv", "Extra environment variables to pass to the child process (ex: 'AZE=aze;QWE=qwe').", "",
+    [](std::string_view value) {
+      xbt_assert(value.empty() || value.find('=', 0) != std::string_view::npos,
+                 "The 'model-check/setenv' parameter must be like 'AZE=aze', but it does not contain an equal sign.");
+    }};
+
 namespace simgrid::mc {
 
-template <class Code> void run_child_process(int socket, Code code)
+static void run_child_process(int socket, const std::vector<char*>& args)
 {
   /* On startup, simix_global_init() calls simgrid::mc::Client::initialize(), which checks whether the MC_ENV_SOCKET_FD
    * env variable is set. If so, MC mode is assumed, and the client is setup from its side
@@ -41,7 +51,7 @@ template <class Code> void run_child_process(int socket, Code code)
 #ifdef __linux__
   // Make sure we do not outlive our parent
   sigset_t mask;
-  sigemptyset (&mask);
+  sigemptyset(&mask);
   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
@@ -51,19 +61,47 @@ template <class Code> void run_child_process(int socket, Code code)
   xbt_assert(fdflags != -1 && fcntl(socket, F_SETFD, fdflags & ~FD_CLOEXEC) != -1,
              "Could not remove CLOEXEC for socket");
 
-  // 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);
-
   setenv(MC_ENV_SOCKET_FD, std::to_string(socket).c_str(), 1);
 
-  code();
+  /* Setup the tokenizer that parses the cfg:model-check/setenv parameter */
+  using Tokenizer = boost::tokenizer<boost::char_separator<char>>;
+  boost::char_separator<char> semicol_sep(";");
+  boost::char_separator<char> equal_sep("=");
+  Tokenizer token_vars(_sg_mc_setenv.get(), semicol_sep); /* Iterate over all FOO=foo parts */
+  for (const auto& token : token_vars) {
+    std::vector<std::string> kv;
+    Tokenizer token_kv(token, equal_sep);
+    for (const auto& t : token_kv) /* Iterate over 'FOO' and then 'foo' in that 'FOO=foo' */
+      kv.push_back(t);
+    xbt_assert(kv.size() == 2, "Parse error on 'model-check/setenv' value %s. Does it contain an equal sign?",
+               token.c_str());
+    XBT_INFO("setenv '%s'='%s'", kv[0].c_str(), kv[1].c_str());
+    setenv(kv[0].c_str(), kv[1].c_str(), 1);
+  }
+
+  /* And now, exec the child process */
+  int i = 1;
+  while (args[i] != nullptr && args[i][0] == '-')
+    i++;
+
+  xbt_assert(args[i] != nullptr,
+             "Unable to find a binary to exec on the command line. Did you only pass config flags?");
+
+  execvp(args[i], args.data() + i);
+  XBT_CRITICAL("The model-checked process failed to exec(%s): %s.\n"
+               "        Make sure that your binary exists on disk and is executable.",
+               args[i], strerror(errno));
+  if (strchr(args[i], '=') != nullptr)
+    XBT_CRITICAL("If you want to pass environment variables to the application, please use --cfg=model-check/setenv:%s",
+                 args[i]);
+
+  xbt_die("Aborting now.");
 }
 
-Session::Session(const std::function<void()>& code)
+RemoteApp::RemoteApp(const std::vector<char*>& args)
 {
 #if HAVE_SMPI
-  smpi_init_options();//only performed once
+  smpi_init_options(); // only performed once
   xbt_assert(smpi_cfg_privatization() != SmpiPrivStrategies::MMAP,
              "Please use the dlopen privatization schema when model-checking SMPI code");
 #endif
@@ -79,7 +117,7 @@ Session::Session(const std::function<void()>& code)
 
   if (pid == 0) { // Child
     ::close(sockets[1]);
-    run_child_process(sockets[0], code);
+    run_child_process(sockets[0], args);
     DIE_IMPOSSIBLE;
   }
 
@@ -93,42 +131,13 @@ Session::Session(const std::function<void()>& code)
 
   mc_model_checker = model_checker_.get();
   model_checker_->start();
-}
-
-Session::~Session()
-{
-  this->close();
-}
 
-/** The application must be stopped. */
-void Session::take_initial_snapshot()
-{
-  xbt_assert(initial_snapshot_ == nullptr);
+  /* Take the initial snapshot */
   model_checker_->wait_for_requests();
   initial_snapshot_ = std::make_shared<simgrid::mc::Snapshot>(0);
 }
 
-void Session::restore_initial_state() const
-{
-  this->initial_snapshot_->restore(&model_checker_->get_remote_process());
-}
-
-void Session::log_state() const
-{
-  model_checker_->get_exploration()->log_state();
-
-  if (not _sg_mc_dot_output_file.get().empty()) {
-    fprintf(dot_output, "}\n");
-    fclose(dot_output);
-  }
-  if (getenv("SIMGRID_MC_SYSTEM_STATISTICS")){
-    int ret=system("free");
-    if (ret != 0)
-      XBT_WARN("Call to system(free) did not return 0, but %d", ret);
-  }
-}
-
-void Session::close()
+RemoteApp::~RemoteApp()
 {
   initial_snapshot_ = nullptr;
   if (model_checker_) {
@@ -138,20 +147,45 @@ void Session::close()
   }
 }
 
-bool Session::actor_is_enabled(aid_t pid) const
+void RemoteApp::restore_initial_state() const
+{
+  this->initial_snapshot_->restore(&model_checker_->get_remote_process());
+}
+
+unsigned long RemoteApp::get_maxpid() const
+{
+  return model_checker_->get_remote_process().get_maxpid();
+}
+
+void RemoteApp::get_actors_status(std::map<aid_t, ActorState>& whereto) const
 {
-  s_mc_message_actor_enabled_t msg;
+  s_mc_message_t msg;
   memset(&msg, 0, sizeof msg);
-  msg.type = simgrid::mc::MessageType::ACTOR_ENABLED;
-  msg.aid  = pid;
+  msg.type = simgrid::mc::MessageType::ACTORS_STATUS;
   model_checker_->channel().send(msg);
-  std::array<char, MC_MESSAGE_LENGTH> buff;
-  ssize_t received = model_checker_->channel().receive(buff.data(), buff.size(), true);
-  xbt_assert(received == sizeof(s_mc_message_int_t), "Unexpected size in answer to ACTOR_ENABLED");
-  return ((s_mc_message_int_t*)buff.data())->value;
+
+  s_mc_message_actors_status_answer_t answer;
+  ssize_t received = model_checker_->channel().receive(answer);
+  xbt_assert(received != -1, "Could not receive message");
+  xbt_assert(received == sizeof(answer) && answer.type == MessageType::ACTORS_STATUS_REPLY,
+             "Received unexpected message %s (%i, size=%i) "
+             "expected MessageType::ACTORS_STATUS_REPLY (%i, size=%i)",
+             to_c_str(answer.type), (int)answer.type, (int)received, (int)MessageType::ACTORS_STATUS_REPLY,
+             (int)sizeof(answer));
+
+  std::vector<s_mc_message_actors_status_one_t> status(answer.count);
+  if (answer.count > 0) {
+    size_t size = status.size() * sizeof(s_mc_message_actors_status_one_t);
+    received    = model_checker_->channel().receive(status.data(), size);
+    xbt_assert(static_cast<size_t>(received) == size);
+  }
+
+  whereto.clear();
+  for (auto const& actor : status)
+    whereto.try_emplace(actor.aid, actor.aid, actor.enabled, actor.max_considered);
 }
 
-void Session::check_deadlock() const
+void RemoteApp::check_deadlock() const
 {
   xbt_assert(model_checker_->channel().send(MessageType::DEADLOCK_CHECK) == 0, "Could not check deadlock state");
   s_mc_message_int_t message;
@@ -171,7 +205,7 @@ void Session::check_deadlock() const
     for (auto const& frame : model_checker_->get_exploration()->get_textual_trace())
       XBT_CINFO(mc_global, "  %s", frame.c_str());
     XBT_CINFO(mc_global, "Path = %s", model_checker_->get_exploration()->get_record_trace().to_string().c_str());
-    log_state();
+    model_checker_->get_exploration()->log_state();
     throw DeadlockError();
   }
 }
similarity index 64%
rename from src/mc/Session.hpp
rename to src/mc/api/RemoteApp.hpp
index b84e6fe..7ad580c 100644 (file)
@@ -3,18 +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. */
 
-#ifndef SIMGRID_MC_SESSION_HPP
-#define SIMGRID_MC_SESSION_HPP
+#ifndef SIMGRID_MC_REMOTE_APP_HPP
+#define SIMGRID_MC_REMOTE_APP_HPP
 
 #include "simgrid/forward.h"
 #include "src/mc/ModelChecker.hpp"
+#include "src/mc/api/ActorState.hpp"
 #include "src/mc/remote/RemotePtr.hpp"
 
 #include <functional>
 
 namespace simgrid::mc {
 
-/** A model-checking session
+/** High-level view of the verified application, from the model-checker POV
  *
  *  This is expected to become the interface used by model-checking
  *  algorithms to control the execution of the model-checked process
@@ -22,14 +23,14 @@ namespace simgrid::mc {
  *  algorithms should be able to be written in high-level languages
  *  (e.g. Python) using bindings on this interface.
  */
-class XBT_PUBLIC Session {
+class XBT_PUBLIC RemoteApp {
 private:
   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;
+  RemoteApp(RemoteApp const&) = delete;
+  RemoteApp& operator=(RemoteApp const&) = delete;
 
 public:
   /** Create a new session by executing the provided code in a fork()
@@ -39,20 +40,23 @@ public:
    *
    *  The code is expected to `exec` the model-checked application.
    */
-  explicit Session(const std::function<void()>& code);
+  explicit RemoteApp(const std::vector<char*>& args);
 
-  ~Session();
-  void close();
+  ~RemoteApp();
 
-  void take_initial_snapshot();
   void restore_initial_state() const;
 
   /** Ask to the application to check for a deadlock. If so, do an error message and throw a DeadlockError. */
   void check_deadlock() const;
 
-  void log_state() const;
+  /** Retrieve the max PID of the running actors */
+  unsigned long get_maxpid() const;
 
-  bool actor_is_enabled(aid_t pid) const;
+  /* Get the list of actors that are ready to run at that step. Usually shorter than maxpid */
+  void get_actors_status(std::map<aid_t, simgrid::mc::ActorState>& whereto) const;
+
+  /* Get the remote process */
+  RemoteProcess& get_remote_process() { return model_checker_->get_remote_process(); }
 };
 } // namespace simgrid::mc
 
index e3048b1..777ca4d 100644 (file)
@@ -4,7 +4,6 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/mc/api/State.hpp"
-#include "src/mc/api.hpp"
 #include "src/mc/mc_config.hpp"
 
 #include <boost/range/algorithm.hpp>
@@ -15,21 +14,20 @@ namespace simgrid::mc {
 
 long State::expended_states_ = 0;
 
-State::State() : num_(++expended_states_)
+State::State(const RemoteApp& remote_app) : num_(++expended_states_)
 {
-  const unsigned long maxpid = Api::get().get_maxpid();
-  actor_states_.resize(maxpid);
+  remote_app.get_actors_status(actors_to_run_);
+
   transition_.reset(new Transition());
   /* Stateful model checking */
   if ((_sg_mc_checkpoint > 0 && (num_ % _sg_mc_checkpoint == 0)) || _sg_mc_termination) {
-    auto snapshot_ptr = Api::get().take_snapshot(num_);
-    system_state_     = std::shared_ptr<simgrid::mc::Snapshot>(snapshot_ptr);
+    system_state_ = std::make_shared<simgrid::mc::Snapshot>(num_);
   }
 }
 
 std::size_t State::count_todo() const
 {
-  return boost::range::count_if(this->actor_states_, [](simgrid::mc::ActorState const& a) { return a.is_todo(); });
+  return boost::range::count_if(this->actors_to_run_, [](auto& pair) { return pair.second.is_todo(); });
 }
 
 Transition* State::get_transition() const
@@ -37,39 +35,28 @@ Transition* State::get_transition() const
   return transition_.get();
 }
 
-int State::next_transition() const
+aid_t State::next_transition() const
 {
-  std::vector<ActorInformation>& actors = mc_model_checker->get_remote_process().actors();
-  XBT_DEBUG("Search for an actor to run. %zu actors to consider", actors.size());
-  for (unsigned int i = 0; i < actors.size(); i++) {
-    /* Only consider actors (1) marked as interleaving by the checker and (2) currently enabled in the application*/
-    if (aid_t aid = actors[i].copy.get_buffer()->get_pid();
-        not actor_states_[aid].is_todo() || not Api::get().get_session().actor_is_enabled(aid))
+  XBT_DEBUG("Search for an actor to run. %zu actors to consider", actors_to_run_.size());
+  for (auto const& [aid, actor] : actors_to_run_) {
+    /* Only consider actors (1) marked as interleaving by the checker and (2) currently enabled in the application */
+    if (not actor.is_todo() || not actor.is_enabled())
       continue;
 
-    return i;
+    return aid;
   }
   return -1;
 }
-void State::execute_next(int next)
+void State::execute_next(aid_t next)
 {
-  std::vector<ActorInformation>& actors = mc_model_checker->get_remote_process().actors();
-
-  const kernel::actor::ActorImpl* actor = actors[next].copy.get_buffer();
-  aid_t aid                       = actor->get_pid();
-  int times_considered;
-
-  simgrid::mc::ActorState* actor_state = &actor_states_[aid];
   /* This actor is ready to be executed. Prepare its execution when simcall_handle will be called on it */
-  times_considered = actor_state->get_times_considered_and_inc();
-  if (actor->simcall_.mc_max_consider_ <= actor_state->get_times_considered())
-    actor_state->set_done();
+  const unsigned times_considered = actors_to_run_.at(next).do_consider();
 
-  XBT_DEBUG("Let's run actor %ld (times_considered = %d)", aid, times_considered);
+  XBT_DEBUG("Let's run actor %ld (times_considered = %u)", next, times_considered);
 
   Transition::executed_transitions_++;
 
-  transition_.reset(mc_model_checker->handle_simcall(aid, times_considered, true));
+  transition_.reset(mc_model_checker->handle_simcall(next, times_considered, true));
   mc_model_checker->wait_for_requests();
 }
 } // namespace simgrid::mc
index 8432206..92164cf 100644 (file)
@@ -6,7 +6,8 @@
 #ifndef SIMGRID_MC_STATE_HPP
 #define SIMGRID_MC_STATE_HPP
 
-#include "src/mc/mc_pattern.hpp"
+#include "src/mc/api/ActorState.hpp"
+#include "src/mc/api/RemoteApp.hpp"
 #include "src/mc/sosp/Snapshot.hpp"
 #include "src/mc/transition/Transition.hpp"
 
@@ -19,30 +20,34 @@ class XBT_PRIVATE State : public xbt::Extendable<State> {
   /* Outgoing transition: what was the last transition that we took to leave this state? */
   std::unique_ptr<Transition> transition_;
 
-  /** Sequential state number (used for debugging) */
+  /** Sequential state ID (used for debugging) */
   long num_ = 0;
 
-  /** State's exploration status by process */
-  std::vector<ActorState> actor_states_;
+  /** State's exploration status by actor. Not all the actors are there, only the ones that are ready-to-run in this state */
+  std::map<aid_t, ActorState> actors_to_run_;
 
   /** Snapshot of system state (if needed) */
   std::shared_ptr<Snapshot> system_state_;
 
 public:
-  explicit State();
+  explicit State(const RemoteApp& remote_app);
 
   /* Returns a positive number if there is another transition to pick, or -1 if not */
-  int next_transition() const;
+  aid_t next_transition() const;
 
   /* Explore a new path; the parameter must be the result of a previous call to next_transition() */
-  void execute_next(int next);
+  void execute_next(aid_t next);
 
   long get_num() const { return num_; }
   std::size_t count_todo() const;
-  void mark_todo(aid_t actor) { this->actor_states_[actor].mark_todo(); }
-  bool is_done(aid_t actor) const { return this->actor_states_[actor].is_done(); }
+  void mark_todo(aid_t actor) { actors_to_run_.at(actor).mark_todo(); }
+  bool is_done(aid_t actor) const { return actors_to_run_.at(actor).is_done(); }
   Transition* get_transition() const;
   void set_transition(Transition* t) { transition_.reset(t); }
+  std::map<aid_t, ActorState> const& get_actors_list() const { return actors_to_run_; }
+
+  unsigned long get_actor_count() const { return actors_to_run_.size(); }
+  bool is_actor_enabled(aid_t actor) { return actors_to_run_.at(actor).is_enabled(); }
 
   Snapshot* get_system_state() const { return system_state_.get(); }
   void set_system_state(std::shared_ptr<Snapshot> state) { system_state_ = std::move(state); }
index 6b7ffe1..fdeba59 100644 (file)
@@ -201,6 +201,37 @@ static bool heap_area_differ(const RemoteProcess& process, StateComparator& stat
                              const Snapshot& snapshot1, const Snapshot& snapshot2, HeapLocationPairs* previous,
                              Type* type, int pointer_level);
 
+/* Compares the content of each heap fragment between the two states, at the bit level.
+ *
+ * This operation is costly (about 5 seconds per snapshots' pair to compare on a small program),
+ * but hard to optimize because our algorithm is too hackish.
+ *
+ * Going at bit level can trigger syntaxtic differences on states that are semantically equivalent.
+ *
+ * Padding bytes constitute the first source of such syntaxtic difference: Any malloced memory contains spaces that
+ * are not used to enforce the memory alignment constraints of the CPU. So, cruft of irrelevant changes could get
+ * added on these bits. But this case is handled properly, as any memory block is zeroed by mmalloc before being handled
+ * back, not only for calloc but also for malloc. So the memory interstices due to padding bytes are properly zeroed.
+ *
+ * Another source of such change comes from the order of mallocs, that may well change from one execution path to
+ * another. This will change the malloc fragment in which the data is stored and the pointer values (syntaxtic
+ * difference) while the semantic of the state remains the same.
+ *
+ * To fix this, this code relies on a hugly hack. When we see a difference during the bit-level comparison,
+ * we first check if it could be explained by a pointer-to-block difference. Ie, if when interpreting the memory
+ * area containing that difference as a pointer, I get the pointer to a valid fragment in the heap (in both snapshots).
+ *
+ * This is why we cannot pre-compute a bit-level hash of the heap content: we discover the pointers to other memory
+ * fragment when a difference is found during the bit-level exploration. Fixing this would require to save typing
+ * information about the memory fragments, which is something that could be done with https://github.com/tudasc/TypeART
+ * This would give us all pointers in the mallocated memory, allowing the graph traversal needed to precompute the hash.
+ *
+ * Using a hash without paying attention to malloc fragment reordering would lead to false negatives:
+ * semantically equivalent states would be detected as [syntaxically] different. It's of no importance for the
+ * state-equality reduction (we would re-explore semantically equivalent states), but it would endanger the soundness
+ * of the liveness model-checker, as state-equality is used to detect the loops that constitute the accepting states of
+ * the verified property. So we could miss counter-examples to the verified property. Not good. Not good at all.
+ */
 static bool mmalloc_heap_differ(const RemoteProcess& process, StateComparator& state, const Snapshot& snapshot1,
                                 const Snapshot& snapshot2)
 {
@@ -814,9 +845,7 @@ static bool heap_area_differ(const RemoteProcess& process, StateComparator& stat
     }
 
     if (type_size != -1 && type_size != (ssize_t)heapinfo1->busy_block.busy_size &&
-        type_size != (ssize_t)heapinfo2->busy_block.busy_size &&
-        (type->name.empty() ||
-         type->name == "struct s_smx_context")) { // FIXME: there is no struct s_smx_context anymore
+        type_size != (ssize_t)heapinfo2->busy_block.busy_size && type->name.empty()) {
       if (match_pairs)
         state.match_equals(previous);
       return false;
@@ -1174,65 +1203,62 @@ static bool local_variables_differ(const simgrid::mc::RemoteProcess& process, si
 
 namespace simgrid::mc {
 
-bool snapshot_equal(const Snapshot* s1, const Snapshot* s2)
+bool Snapshot::operator==(const Snapshot& other)
 {
   // TODO, make this a field of ModelChecker or something similar
   static StateComparator state_comparator;
 
   const RemoteProcess& process = mc_model_checker->get_remote_process();
 
-  if (s1->hash_ != s2->hash_) {
-    XBT_VERB("(%ld - %ld) Different hash: 0x%" PRIx64 "--0x%" PRIx64, s1->num_state_, s2->num_state_, s1->hash_,
-             s2->hash_);
+  if (hash_ != other.hash_) {
+    XBT_VERB("(%ld - %ld) Different hash: 0x%" PRIx64 "--0x%" PRIx64, this->num_state_, other.num_state_, this->hash_,
+             other.hash_);
     return false;
   }
-  XBT_VERB("(%ld - %ld) Same hash: 0x%" PRIx64, s1->num_state_, s2->num_state_, s1->hash_);
+  XBT_VERB("(%ld - %ld) Same hash: 0x%" PRIx64, this->num_state_, other.num_state_, this->hash_);
 
-  /* Compare enabled processes */
-  if (s1->enabled_processes_ != s2->enabled_processes_) {
-    XBT_VERB("(%ld - %ld) Different amount of enabled processes", s1->num_state_, s2->num_state_);
-    return false;
-  }
+  /* TODO: re-enable the quick filter of counting enabled processes in each snapshots */
 
   /* Compare size of stacks */
-  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 < this->stacks_.size(); i++) {
+    size_t size_used1 = this->stack_sizes_[i];
+    size_t size_used2 = other.stack_sizes_[i];
     if (size_used1 != size_used2) {
-      XBT_VERB("(%ld - %ld) Different size used in stacks: %zu - %zu", s1->num_state_, s2->num_state_, size_used1,
+      XBT_VERB("(%ld - %ld) Different size used in stacks: %zu - %zu", num_state_, other.num_state_, size_used1,
                size_used2);
       return false;
     }
   }
 
   /* Init heap information used in heap comparison algorithm */
-  const s_xbt_mheap_t* heap1 = static_cast<xbt_mheap_t>(
-      s1->read_bytes(alloca(sizeof(s_xbt_mheap_t)), sizeof(s_xbt_mheap_t), process.heap_address, ReadOptions::lazy()));
-  const s_xbt_mheap_t* heap2 = static_cast<xbt_mheap_t>(
-      s2->read_bytes(alloca(sizeof(s_xbt_mheap_t)), sizeof(s_xbt_mheap_t), process.heap_address, ReadOptions::lazy()));
-  if (state_comparator.initHeapInformation(heap1, heap2, s1->to_ignore_, s2->to_ignore_) == -1) {
-    XBT_VERB("(%ld - %ld) Different heap information", s1->num_state_, s2->num_state_);
+  const s_xbt_mheap_t* heap1 = static_cast<xbt_mheap_t>(this->read_bytes(
+      alloca(sizeof(s_xbt_mheap_t)), sizeof(s_xbt_mheap_t), process.heap_address, ReadOptions::lazy()));
+  const s_xbt_mheap_t* heap2 = static_cast<xbt_mheap_t>(other.read_bytes(
+      alloca(sizeof(s_xbt_mheap_t)), sizeof(s_xbt_mheap_t), process.heap_address, ReadOptions::lazy()));
+  if (state_comparator.initHeapInformation(heap1, heap2, this->to_ignore_, other.to_ignore_) == -1) {
+    XBT_VERB("(%ld - %ld) Different heap information", this->num_state_, other.num_state_);
     return false;
   }
 
   /* Stacks comparison */
-  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];
+  for (unsigned int cursor = 0; cursor < this->stacks_.size(); cursor++) {
+    const_mc_snapshot_stack_t stack1 = &this->stacks_[cursor];
+    const_mc_snapshot_stack_t stack2 = &other.stacks_[cursor];
 
-    if (local_variables_differ(process, state_comparator, *s1, *s2, stack1, stack2)) {
-      XBT_VERB("(%ld - %ld) Different local variables between stacks %u", s1->num_state_, s2->num_state_, cursor + 1);
+    if (local_variables_differ(process, state_comparator, *this, other, stack1, stack2)) {
+      XBT_VERB("(%ld - %ld) Different local variables between stacks %u", this->num_state_, other.num_state_,
+               cursor + 1);
       return false;
     }
   }
 
-  size_t regions_count = s1->snapshot_regions_.size();
-  if (regions_count != s2->snapshot_regions_.size())
+  size_t regions_count = this->snapshot_regions_.size();
+  if (regions_count != other.snapshot_regions_.size())
     return false;
 
   for (size_t k = 0; k != regions_count; ++k) {
-    Region* region1 = s1->snapshot_regions_[k].get();
-    Region* region2 = s2->snapshot_regions_[k].get();
+    Region* region1 = this->snapshot_regions_[k].get();
+    Region* region2 = other.snapshot_regions_[k].get();
 
     // Preconditions:
     if (region1->region_type() != RegionType::Data)
@@ -1243,20 +1269,21 @@ bool snapshot_equal(const Snapshot* s1, const Snapshot* s2)
     xbt_assert(region1->object_info());
 
     /* Compare global variables */
-    if (global_variables_differ(process, state_comparator, region1->object_info(), region1, region2, *s1, *s2)) {
+    if (global_variables_differ(process, state_comparator, region1->object_info(), region1, region2, *this, other)) {
       std::string const& name = region1->object_info()->file_name;
-      XBT_VERB("(%ld - %ld) Different global variables in %s", s1->num_state_, s2->num_state_, name.c_str());
+      XBT_VERB("(%ld - %ld) Different global variables in %s", this->num_state_, other.num_state_, name.c_str());
       return false;
     }
   }
 
+  XBT_VERB("   Compare heap...");
   /* Compare heap */
-  if (mmalloc_heap_differ(process, state_comparator, *s1, *s2)) {
-    XBT_VERB("(%ld - %ld) Different heap (mmalloc_compare)", s1->num_state_, s2->num_state_);
+  if (mmalloc_heap_differ(process, state_comparator, *this, other)) {
+    XBT_VERB("(%ld - %ld) Different heap (mmalloc_heap_differ)", this->num_state_, other.num_state_);
     return false;
   }
 
-  XBT_VERB("(%ld - %ld) No difference found", s1->num_state_, s2->num_state_);
+  XBT_VERB("(%ld - %ld) No difference found", this->num_state_, other.num_state_);
 
   return true;
 }
index 4464631..bb9a5b2 100644 (file)
@@ -60,9 +60,14 @@ struct PatternCommunicationList {
 
 /********** Checker extension **********/
 
-struct CommDetExtension {
+class CommDetExtension {
+  Exploration& exploration_;
+
+public:
   static simgrid::xbt::Extension<simgrid::mc::Exploration, CommDetExtension> EXTENSION_ID;
 
+  explicit CommDetExtension(Exploration& explo) : exploration_(explo) {}
+
   std::vector<simgrid::mc::PatternCommunicationList> initial_communications_pattern;
   std::vector<std::vector<simgrid::mc::PatternCommunication*>> incomplete_communications_pattern;
 
@@ -74,12 +79,12 @@ struct CommDetExtension {
 
   void exploration_start()
   {
-    const unsigned long maxpid = Api::get().get_maxpid();
+    const unsigned long maxpid = exploration_.get_remote_app().get_maxpid();
 
     initial_communications_pattern.resize(maxpid);
     incomplete_communications_pattern.resize(maxpid);
   }
-  void restore_communications_pattern(const simgrid::mc::State* state);
+  void restore_communications_pattern(const simgrid::mc::State* state, RemoteApp const& remote_app);
   void enforce_deterministic_pattern(aid_t process, const PatternCommunication* comm);
   void get_comm_pattern(const Transition* transition);
   void complete_comm_pattern(const CommWaitTransition* transition);
@@ -94,17 +99,17 @@ public:
   std::vector<unsigned> communication_indices_;
 
   static simgrid::xbt::Extension<simgrid::mc::State, StateCommDet> EXTENSION_ID;
-  explicit StateCommDet(CommDetExtension* checker)
+  explicit StateCommDet(CommDetExtension& checker, RemoteApp const& remote_app)
   {
-    const unsigned long maxpid = Api::get().get_maxpid();
+    const unsigned long maxpid = remote_app.get_maxpid();
     for (unsigned long i = 0; i < maxpid; i++) {
       std::vector<simgrid::mc::PatternCommunication> res;
-      for (auto const& comm : checker->incomplete_communications_pattern[i])
+      for (auto const& comm : checker.incomplete_communications_pattern[i])
         res.push_back(comm->dup());
       incomplete_comm_pattern_.push_back(std::move(res));
     }
 
-    for (auto const& list_process_comm : checker->initial_communications_pattern)
+    for (auto const& list_process_comm : checker.initial_communications_pattern)
       this->communication_indices_.push_back(list_process_comm.index_comm);
   }
 };
@@ -129,13 +134,13 @@ static simgrid::mc::CommPatternDifference compare_comm_pattern(const simgrid::mc
   return CommPatternDifference::NONE;
 }
 
-void CommDetExtension::restore_communications_pattern(const simgrid::mc::State* state)
+void CommDetExtension::restore_communications_pattern(const simgrid::mc::State* state, RemoteApp const& remote_app)
 {
   for (size_t i = 0; i < initial_communications_pattern.size(); i++)
     initial_communications_pattern[i].index_comm =
         state->extension<simgrid::mc::StateCommDet>()->communication_indices_[i];
 
-  const unsigned long maxpid = Api::get().get_maxpid();
+  const unsigned long maxpid = remote_app.get_maxpid();
   for (unsigned long i = 0; i < maxpid; i++) {
     incomplete_communications_pattern[i].clear();
     for (simgrid::mc::PatternCommunication const& comm :
@@ -202,8 +207,8 @@ void CommDetExtension::enforce_deterministic_pattern(aid_t actor, const PatternC
       XBT_INFO("***** Non-send-deterministic communications pattern *****");
       XBT_INFO("*********************************************************");
       XBT_INFO("%s", send_diff.c_str());
-      Api::get().get_session().log_state();
-      Api::get().mc_exit(SIMGRID_MC_EXIT_NON_DETERMINISM);
+      exploration_.log_state();
+      mc_model_checker->exit(SIMGRID_MC_EXIT_NON_DETERMINISM);
     } else if (_sg_mc_comms_determinism && (not send_deterministic && not recv_deterministic)) {
       XBT_INFO("****************************************************");
       XBT_INFO("***** Non-deterministic communications pattern *****");
@@ -212,8 +217,8 @@ void CommDetExtension::enforce_deterministic_pattern(aid_t actor, const PatternC
         XBT_INFO("%s", send_diff.c_str());
       if (not recv_diff.empty())
         XBT_INFO("%s", recv_diff.c_str());
-      Api::get().get_session().log_state();
-      Api::get().mc_exit(SIMGRID_MC_EXIT_NON_DETERMINISM);
+      exploration_.log_state();
+      mc_model_checker->exit(SIMGRID_MC_EXIT_NON_DETERMINISM);
     }
   }
 }
@@ -314,26 +319,32 @@ void CommDetExtension::handle_comm_pattern(const Transition* transition)
       }
  */
 
-Exploration* create_communication_determinism_checker(Session* session)
+Exploration* create_communication_determinism_checker(const std::vector<char*>& args, bool with_dpor)
 {
   CommDetExtension::EXTENSION_ID = simgrid::mc::Exploration::extension_create<CommDetExtension>();
   StateCommDet::EXTENSION_ID     = simgrid::mc::State::extension_create<StateCommDet>();
 
   XBT_DEBUG("********* Start communication determinism verification *********");
 
-  auto extension = new CommDetExtension();
+  auto base      = new DFSExplorer(args, with_dpor);
+  auto extension = new CommDetExtension(*base);
 
-  DFSExplorer::on_exploration_start([extension]() {
+  DFSExplorer::on_exploration_start([extension](RemoteApp const&) {
     XBT_INFO("Check communication determinism");
     extension->exploration_start();
   });
-  DFSExplorer::on_backtracking([extension]() { extension->initial_communications_pattern_done = true; });
-  DFSExplorer::on_state_creation([extension](State* state) { state->extension_set(new StateCommDet(extension)); });
+  DFSExplorer::on_backtracking(
+      [extension](RemoteApp const&) { extension->initial_communications_pattern_done = true; });
+  DFSExplorer::on_state_creation([extension](State* state, RemoteApp const& remote_app) {
+    state->extension_set(new StateCommDet(*extension, remote_app));
+  });
 
-  DFSExplorer::on_restore_system_state([extension](State* state) { extension->restore_communications_pattern(state); });
+  DFSExplorer::on_restore_system_state([extension](State const* state, RemoteApp const& remote_app) {
+    extension->restore_communications_pattern(state, remote_app);
+  });
 
-  DFSExplorer::on_restore_initial_state([extension]() {
-    const unsigned long maxpid = Api::get().get_maxpid();
+  DFSExplorer::on_restore_initial_state([extension](RemoteApp const& remote_app) {
+    const unsigned long maxpid = remote_app.get_maxpid();
     assert(maxpid == extension->incomplete_communications_pattern.size());
     assert(maxpid == extension->initial_communications_pattern.size());
     for (unsigned long j = 0; j < maxpid; j++) {
@@ -342,10 +353,12 @@ Exploration* create_communication_determinism_checker(Session* session)
     }
   });
 
-  DFSExplorer::on_transition_replay([extension](Transition* t) { extension->handle_comm_pattern(t); });
-  DFSExplorer::on_transition_execute([extension](Transition* t) { extension->handle_comm_pattern(t); });
+  DFSExplorer::on_transition_replay(
+      [extension](Transition const* t, RemoteApp const&) { extension->handle_comm_pattern(t); });
+  DFSExplorer::on_transition_execute(
+      [extension](Transition const* t, RemoteApp const&) { extension->handle_comm_pattern(t); });
 
-  DFSExplorer::on_log_state([extension]() {
+  DFSExplorer::on_log_state([extension](RemoteApp const&) {
     if (_sg_mc_comms_determinism) {
       if (extension->send_deterministic && not extension->recv_deterministic) {
         XBT_INFO("*******************************************************");
@@ -366,7 +379,7 @@ Exploration* create_communication_determinism_checker(Session* session)
     delete extension;
   });
 
-  return new DFSExplorer(session);
+  return base;
 }
 
 } // namespace simgrid::mc
index b39b7fb..03122f3 100644 (file)
@@ -26,22 +26,22 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_dfs, mc, "DFS exploration algorithm of the mo
 
 namespace simgrid::mc {
 
-xbt::signal<void()> DFSExplorer::on_exploration_start_signal;
-xbt::signal<void()> DFSExplorer::on_backtracking_signal;
+xbt::signal<void(RemoteApp&)> DFSExplorer::on_exploration_start_signal;
+xbt::signal<void(RemoteApp&)> DFSExplorer::on_backtracking_signal;
 
-xbt::signal<void(State*)> DFSExplorer::on_state_creation_signal;
+xbt::signal<void(State*, RemoteApp&)> DFSExplorer::on_state_creation_signal;
 
-xbt::signal<void(State*)> DFSExplorer::on_restore_system_state_signal;
-xbt::signal<void()> DFSExplorer::on_restore_initial_state_signal;
-xbt::signal<void(Transition*)> DFSExplorer::on_transition_replay_signal;
-xbt::signal<void(Transition*)> DFSExplorer::on_transition_execute_signal;
+xbt::signal<void(State*, RemoteApp&)> DFSExplorer::on_restore_system_state_signal;
+xbt::signal<void(RemoteApp&)> DFSExplorer::on_restore_initial_state_signal;
+xbt::signal<void(Transition*, RemoteApp&)> DFSExplorer::on_transition_replay_signal;
+xbt::signal<void(Transition*, RemoteApp&)> DFSExplorer::on_transition_execute_signal;
 
-xbt::signal<void()> DFSExplorer::on_log_state_signal;
+xbt::signal<void(RemoteApp&)> DFSExplorer::on_log_state_signal;
 
 void DFSExplorer::check_non_termination(const State* current_state)
 {
   for (auto state = stack_.rbegin(); state != stack_.rend(); ++state)
-    if (Api::get().snapshot_equal((*state)->get_system_state(), current_state->get_system_state())) {
+    if (*(*state)->get_system_state() == *current_state->get_system_state()) {
       XBT_INFO("Non-progressive cycle: state %ld -> state %ld", (*state)->get_num(), current_state->get_num());
       XBT_INFO("******************************************");
       XBT_INFO("*** NON-PROGRESSIVE CYCLE DETECTED ***");
@@ -76,16 +76,16 @@ std::vector<std::string> DFSExplorer::get_textual_trace() // override
 
 void DFSExplorer::log_state() // override
 {
-  on_log_state_signal();
+  on_log_state_signal(get_remote_app());
   XBT_INFO("DFS exploration ended. %ld unique states visited; %ld backtracks (%lu transition replays, %lu states "
            "visited overall)",
-           State::get_expanded_states(), backtrack_count_, Api::get().mc_get_visited_states(),
+           State::get_expanded_states(), backtrack_count_, mc_model_checker->get_visited_states(),
            Transition::get_replayed_transitions());
 }
 
 void DFSExplorer::run()
 {
-  on_exploration_start_signal();
+  on_exploration_start_signal(get_remote_app());
   /* This function runs the DFS algorithm the state space.
    * We do so iteratively instead of recursively, dealing with the call stack manually.
    * This allows one to explore the call stack at will. */
@@ -98,11 +98,11 @@ void DFSExplorer::run()
     XBT_DEBUG("Exploration depth=%zu (state:%ld; %zu interleaves)", stack_.size(), state->get_num(),
               state->count_todo());
 
-    Api::get().mc_inc_visited_states();
+    mc_model_checker->inc_visited_states();
 
     // Backtrack if we reached the maximum depth
     if (stack_.size() > (std::size_t)_sg_mc_max_depth) {
-      if (reductionMode_ == ReductionMode::dpor) {
+      if (reduction_mode_ == ReductionMode::dpor) {
         XBT_ERROR("/!\\ Max depth of %d reached! THIS WILL PROBABLY BREAK the dpor reduction /!\\",
                   _sg_mc_max_depth.get());
         XBT_ERROR("/!\\ If bad things happen, disable dpor with --cfg=model-check/reduction:none /!\\");
@@ -123,13 +123,13 @@ void DFSExplorer::run()
     }
 
     // Search for the next transition
-    int next = state->next_transition();
+    aid_t next = state->next_transition();
 
     if (next < 0) { // If there is no more transition in the current state, backtrack.
-      XBT_DEBUG("There remains %zu actors, but none to interleave (depth %zu).",
-                mc_model_checker->get_remote_process().actors().size(), stack_.size() + 1);
+      XBT_DEBUG("There remains %lu actors, but none to interleave (depth %zu).", state->get_actor_count(),
+                stack_.size() + 1);
 
-      if (mc_model_checker->get_remote_process().actors().empty()) {
+      if (state->get_actor_count() == 0) {
         mc_model_checker->finalize_app();
         XBT_VERB("Execution came to an end at %s (state: %ld, depth: %zu)", get_record_trace().to_string().c_str(),
                  state->get_num(), stack_.size());
@@ -140,49 +140,42 @@ void DFSExplorer::run()
 
     /* Actually answer the request: let's execute the selected request (MCed does one step) */
     state->execute_next(next);
-    on_transition_execute_signal(state->get_transition());
+    on_transition_execute_signal(state->get_transition(), get_remote_app());
 
     // If there are processes to interleave and the maximum depth has not been
     // reached then perform one step of the exploration algorithm.
     XBT_VERB("Execute %ld: %.60s (stack depth: %zu, state: %ld, %zu interleaves)", state->get_transition()->aid_,
              state->get_transition()->to_string().c_str(), stack_.size(), state->get_num(), state->count_todo());
 
-    std::string req_str;
-    if (dot_output != nullptr)
-      req_str = state->get_transition()->dot_string();
-
     /* Create the new expanded state (copy the state of MCed into our MCer data) */
-    auto next_state = std::make_unique<State>();
-    on_state_creation_signal(next_state.get());
+    auto next_state = std::make_unique<State>(get_remote_app());
+    on_state_creation_signal(next_state.get(), get_remote_app());
 
     if (_sg_mc_termination)
       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)
-      visited_state_ = visited_states_.addVisitedState(next_state->get_num(), next_state.get(), true);
+      visited_state_ = visited_states_.addVisitedState(next_state->get_num(), next_state.get());
 
     /* If this is a new state (or if we don't care about state-equality reduction) */
     if (visited_state_ == nullptr) {
       /* Get an enabled process and insert it in the interleave set of the next state */
-      auto actors = Api::get().get_actors();
-      for (auto& remoteActor : actors) {
-        auto actor = remoteActor.copy.get_buffer();
-        if (get_session().actor_is_enabled(actor->get_pid())) {
-          next_state->mark_todo(actor->get_pid());
-          if (reductionMode_ == ReductionMode::dpor)
+      for (auto const& [aid, _] : next_state->get_actors_list()) {
+        if (next_state->is_actor_enabled(aid)) {
+          next_state->mark_todo(aid);
+          if (reduction_mode_ == ReductionMode::dpor)
             break; // With DPOR, we take the first enabled transition
         }
       }
 
-      if (dot_output != nullptr)
-        std::fprintf(dot_output, "\"%ld\" -> \"%ld\" [%s];\n", state->get_num(), next_state->get_num(),
-                     req_str.c_str());
-
-    } else if (dot_output != nullptr)
-      std::fprintf(dot_output, "\"%ld\" -> \"%ld\" [%s];\n", state->get_num(),
-                   visited_state_->original_num == -1 ? visited_state_->num : visited_state_->original_num,
-                   req_str.c_str());
+      mc_model_checker->dot_output("\"%ld\" -> \"%ld\" [%s];\n", state->get_num(), next_state->get_num(),
+                                   state->get_transition()->dot_string().c_str());
+    } else
+      mc_model_checker->dot_output("\"%ld\" -> \"%ld\" [%s];\n", state->get_num(),
+                                   visited_state_->original_num == -1 ? visited_state_->num
+                                                                      : visited_state_->original_num,
+                                   state->get_transition()->dot_string().c_str());
 
     stack_.push_back(std::move(next_state));
   }
@@ -194,20 +187,20 @@ void DFSExplorer::backtrack()
 {
   backtrack_count_++;
   XBT_VERB("Backtracking from %s", get_record_trace().to_string().c_str());
-  on_backtracking_signal();
+  on_backtracking_signal(get_remote_app());
   stack_.pop_back();
 
-  get_session().check_deadlock();
+  get_remote_app().check_deadlock();
 
   /* Traverse the stack backwards until a state with a non empty interleave set is found, deleting all the states that
    *  have it empty in the way. For each deleted state, check if the request that has generated it (from its
    *  predecessor state), depends on any other previous request executed before it. If it does then add it to the
    *  interleave set of the state that executed that previous request. */
-
-  while (not stack_.empty()) {
+  bool found_backtracking_point = false;
+  while (not stack_.empty() && not found_backtracking_point) {
     std::unique_ptr<State> state = std::move(stack_.back());
     stack_.pop_back();
-    if (reductionMode_ == ReductionMode::dpor) {
+    if (reduction_mode_ == ReductionMode::dpor) {
       aid_t issuer_id = state->get_transition()->aid_;
       for (auto i = stack_.rbegin(); i != stack_.rend(); ++i) {
         State* prev_state = i->get();
@@ -233,76 +226,68 @@ void DFSExplorer::backtrack()
       }
     }
 
-    if (state->count_todo() && stack_.size() < (std::size_t)_sg_mc_max_depth) {
-      /* We found a back-tracking point, let's loop */
-      XBT_DEBUG("Back-tracking to state %ld at depth %zu", state->get_num(), stack_.size() + 1);
-      stack_.push_back(
-          std::move(state)); // Put it back on the stack from which it was removed earlier in this while loop
-      this->restore_state();
-      XBT_DEBUG("Back-tracking to state %ld at depth %zu done", stack_.back()->get_num(), stack_.size());
-      break;
-    } else {
+    if (state->count_todo() == 0) { // Empty interleaving set
       XBT_DEBUG("Delete state %ld at depth %zu", state->get_num(), stack_.size() + 1);
+
+    } else {
+      XBT_DEBUG("Back-tracking to state %ld at depth %zu", state->get_num(), stack_.size() + 1);
+      stack_.push_back(std::move(state)); // Put it back on the stack
+      found_backtracking_point = true;
     }
   }
-}
 
-void DFSExplorer::restore_state()
-{
-  /* If asked to rollback on a state that has a snapshot, restore it */
-  State* last_state = stack_.back().get();
-  if (const auto* system_state = last_state->get_system_state()) {
-    Api::get().restore_state(system_state);
-    on_restore_system_state_signal(last_state);
-    return;
-  }
+  if (found_backtracking_point) {
+    /* If asked to rollback on a state that has a snapshot, restore it */
+    State* last_state = stack_.back().get();
+    if (const auto* system_state = last_state->get_system_state()) {
+      system_state->restore(&get_remote_app().get_remote_process());
+      on_restore_system_state_signal(last_state, get_remote_app());
+      return;
+    }
 
-  /* if no snapshot, we need to restore the initial state and replay the transitions */
-  get_session().restore_initial_state();
-  on_restore_initial_state_signal();
-
-  /* Traverse the stack from the state at position start and re-execute the transitions */
-  for (std::unique_ptr<State> const& state : stack_) {
-    if (state == stack_.back()) /* If we are arrived on the target state, don't replay the outgoing transition */
-      break;
-    state->get_transition()->replay();
-    on_transition_replay_signal(state->get_transition());
-    /* Update statistics */
-    Api::get().mc_inc_visited_states();
-  }
+    /* if no snapshot, we need to restore the initial state and replay the transitions */
+    get_remote_app().restore_initial_state();
+    on_restore_initial_state_signal(get_remote_app());
+
+    /* Traverse the stack from the state at position start and re-execute the transitions */
+    for (std::unique_ptr<State> const& state : stack_) {
+      if (state == stack_.back()) /* If we are arrived on the target state, don't replay the outgoing transition */
+        break;
+      state->get_transition()->replay();
+      on_transition_replay_signal(state->get_transition(), get_remote_app());
+      /* Update statistics */
+      mc_model_checker->inc_visited_states();
+    }
+  } // If no backtracing point, then the stack is empty and the exploration is over
 }
 
-DFSExplorer::DFSExplorer(Session* session) : Exploration(session)
+DFSExplorer::DFSExplorer(const std::vector<char*>& args, bool with_dpor) : Exploration(args)
 {
-  reductionMode_ = reduction_mode;
-  if (_sg_mc_termination)
-    reductionMode_ = ReductionMode::none;
-  else if (reductionMode_ == ReductionMode::unset)
-    reductionMode_ = ReductionMode::dpor;
-
-  if (_sg_mc_termination)
-    XBT_INFO("Check non progressive cycles");
+  if (with_dpor)
+    reduction_mode_ = ReductionMode::dpor;
   else
-    XBT_INFO("Start a DFS exploration. Reduction is: %s.",
-             (reductionMode_ == ReductionMode::none ? "none"
-                                                    : (reductionMode_ == ReductionMode::dpor ? "dpor" : "unknown")));
-
-  get_session().take_initial_snapshot();
+    reduction_mode_ = ReductionMode::none;
 
-  XBT_DEBUG("Starting the DFS exploration");
+  if (_sg_mc_termination) {
+    if (with_dpor) {
+      XBT_INFO("Check non progressive cycles (turning DPOR off)");
+      reduction_mode_ = ReductionMode::none;
+    } else {
+      XBT_INFO("Check non progressive cycles");
+    }
+  } else
+    XBT_INFO("Start a DFS exploration. Reduction is: %s.", to_c_str(reduction_mode_));
 
-  auto initial_state = std::make_unique<State>();
+  auto initial_state = std::make_unique<State>(get_remote_app());
 
   XBT_DEBUG("**************************************************");
 
   /* Get an enabled actor and insert it in the interleave set of the initial state */
-  auto actors = Api::get().get_actors();
-  XBT_DEBUG("Initial state. %zu actors to consider", actors.size());
-  for (auto& actor : actors) {
-    aid_t aid = actor.copy.get_buffer()->get_pid();
-    if (get_session().actor_is_enabled(aid)) {
+  XBT_DEBUG("Initial state. %lu actors to consider", initial_state->get_actor_count());
+  for (auto const& [aid, _] : initial_state->get_actors_list()) {
+    if (initial_state->is_actor_enabled(aid)) {
       initial_state->mark_todo(aid);
-      if (reductionMode_ == ReductionMode::dpor) {
+      if (reduction_mode_ == ReductionMode::dpor) {
         XBT_DEBUG("Actor %ld is TODO, DPOR is ON so let's go for this one.", aid);
         break;
       }
@@ -313,9 +298,9 @@ DFSExplorer::DFSExplorer(Session* session) : Exploration(session)
   stack_.push_back(std::move(initial_state));
 }
 
-Exploration* create_dfs_exploration(Session* session)
+Exploration* create_dfs_exploration(const std::vector<char*>& args, bool with_dpor)
 {
-  return new DFSExplorer(session);
+  return new DFSExplorer(args, with_dpor);
 }
 
 } // namespace simgrid::mc
index 8c59356..d30de61 100644 (file)
@@ -8,7 +8,6 @@
 
 #include "src/mc/VisitedState.hpp"
 #include "src/mc/explo/Exploration.hpp"
-#include "src/mc/mc_safety.hpp"
 
 #include <list>
 #include <memory>
 namespace simgrid::mc {
 
 class XBT_PRIVATE DFSExplorer : public Exploration {
-  ReductionMode reductionMode_ = ReductionMode::unset;
+  XBT_DECLARE_ENUM_CLASS(ReductionMode, none, dpor);
+
+  ReductionMode reduction_mode_;
   long backtrack_count_        = 0;
 
-  static xbt::signal<void()> on_exploration_start_signal;
-  static xbt::signal<void()> on_backtracking_signal;
+  static xbt::signal<void(RemoteApp&)> on_exploration_start_signal;
+  static xbt::signal<void(RemoteApp&)> on_backtracking_signal;
 
-  static xbt::signal<void(State*)> on_state_creation_signal;
+  static xbt::signal<void(State*, RemoteApp&)> on_state_creation_signal;
 
-  static xbt::signal<void(State*)> on_restore_system_state_signal;
-  static xbt::signal<void()> on_restore_initial_state_signal;
-  static xbt::signal<void(Transition*)> on_transition_replay_signal;
-  static xbt::signal<void(Transition*)> on_transition_execute_signal;
+  static xbt::signal<void(State*, RemoteApp&)> on_restore_system_state_signal;
+  static xbt::signal<void(RemoteApp&)> on_restore_initial_state_signal;
+  static xbt::signal<void(Transition*, RemoteApp&)> on_transition_replay_signal;
+  static xbt::signal<void(Transition*, RemoteApp&)> on_transition_execute_signal;
 
-  static xbt::signal<void()> on_log_state_signal;
+  static xbt::signal<void(RemoteApp&)> on_log_state_signal;
 
 public:
-  explicit DFSExplorer(Session* session);
+  explicit DFSExplorer(const std::vector<char*>& args, bool with_dpor);
   void run() override;
   RecordTrace get_record_trace() override;
   std::vector<std::string> get_textual_trace() override;
   void log_state() override;
 
   /** Called once when the exploration starts */
-  static void on_exploration_start(std::function<void()> const& f) { on_exploration_start_signal.connect(f); }
+  static void on_exploration_start(std::function<void(RemoteApp& remote_app)> const& f)
+  {
+    on_exploration_start_signal.connect(f);
+  }
   /** Called each time that the exploration backtracks from a exploration end */
-  static void on_backtracking(std::function<void()> const& f) { on_backtracking_signal.connect(f); }
+  static void on_backtracking(std::function<void(RemoteApp& remote_app)> const& f)
+  {
+    on_backtracking_signal.connect(f);
+  }
   /** Called each time that a new state is create */
-  static void on_state_creation(std::function<void(State*)> const& f) { on_state_creation_signal.connect(f); }
+  static void on_state_creation(std::function<void(State*, RemoteApp& remote_app)> const& f)
+  {
+    on_state_creation_signal.connect(f);
+  }
   /** Called when rollbacking directly onto a previously checkpointed state */
-  static void on_restore_system_state(std::function<void(State*)> const& f)
+  static void on_restore_system_state(std::function<void(State*, RemoteApp& remote_app)> const& f)
   {
     on_restore_system_state_signal.connect(f);
   }
   /** Called when the state to which we backtrack was not checkpointed state, forcing us to restore the initial state
    * before replaying some transitions */
-  static void on_restore_initial_state(std::function<void()> const& f) { on_restore_initial_state_signal.connect(f); }
+  static void on_restore_initial_state(std::function<void(RemoteApp& remote_app)> const& f)
+  {
+    on_restore_initial_state_signal.connect(f);
+  }
   /** Called when replaying a transition that was previously executed, to reach a backtracked state */
-  static void on_transition_replay(std::function<void(Transition*)> const& f)
+  static void on_transition_replay(std::function<void(Transition*, RemoteApp& remote_app)> const& f)
   {
     on_transition_replay_signal.connect(f);
   }
   /** Called when executing a new transition */
-  static void on_transition_execute(std::function<void(Transition*)> const& f)
+  static void on_transition_execute(std::function<void(Transition*, RemoteApp& remote_app)> const& f)
   {
     on_transition_execute_signal.connect(f);
   }
   /** Called when displaying the statistics at the end of the exploration */
-  static void on_log_state(std::function<void()> const& f) { on_log_state_signal.connect(f); }
+  static void on_log_state(std::function<void(RemoteApp&)> const& f) { on_log_state_signal.connect(f); }
 
 private:
   void check_non_termination(const State* current_state);
   void backtrack();
-  void restore_state();
 
   /** Stack representing the position in the exploration graph */
   std::list<std::unique_ptr<State>> stack_;
diff --git a/src/mc/explo/Exploration.cpp b/src/mc/explo/Exploration.cpp
new file mode 100644 (file)
index 0000000..e23d38c
--- /dev/null
@@ -0,0 +1,32 @@
+/* Copyright (c) 2016-2022. The SimGrid Team. All rights reserved.          */
+
+/* This program is 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/explo/Exploration.hpp"
+#include "src/mc/mc_config.hpp"
+#include "src/mc/mc_private.hpp"
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_explo, mc, "Generic exploration algorithm of the model-checker");
+
+namespace simgrid::mc {
+
+Exploration::Exploration(const std::vector<char*>& args) : remote_app_(std::make_unique<RemoteApp>(args))
+{
+  mc_model_checker->set_exploration(this);
+}
+
+void Exploration::log_state()
+{
+  if (not _sg_mc_dot_output_file.get().empty()) {
+    mc_model_checker->dot_output("}\n");
+    mc_model_checker->dot_output_close();
+  }
+  if (getenv("SIMGRID_MC_SYSTEM_STATISTICS")) {
+    int ret = system("free");
+    if (ret != 0)
+      XBT_WARN("Call to system(free) did not return 0, but %d", ret);
+  }
+}
+
+}; // namespace simgrid::mc
index 5b995f7..9dfebd2 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2016-2022. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2016-2022. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -7,7 +6,12 @@
 #ifndef SIMGRID_MC_CHECKER_HPP
 #define SIMGRID_MC_CHECKER_HPP
 
-#include "src/mc/api.hpp"
+#include "simgrid/forward.h"
+#include "src/mc/api/RemoteApp.hpp"
+#include "src/mc/mc_record.hpp"
+#include <xbt/Extendable.hpp>
+
+#include <memory>
 
 namespace simgrid::mc {
 
@@ -20,15 +24,14 @@ namespace simgrid::mc {
  *  you might be able to write your model-checking algorithm as plain
  *  imperative code instead.
  *
- *  It is expected to interact with the model-checking core through the
- * `Session` interface (but currently the `Session` interface does not
- *  have all the necessary features). */
+ *  It is expected to interact with the model-checked application through the
+ * `RemoteApp` interface (that is currently not perfectly sufficient to that extend). */
 // abstract
 class Exploration : public xbt::Extendable<Exploration> {
-  Session* session_;
+  std::unique_ptr<RemoteApp> remote_app_;
 
 public:
-  explicit Exploration(Session* session) : session_(session) {}
+  explicit Exploration(const std::vector<char*>& args);
 
   // No copy:
   Exploration(Exploration const&) = delete;
@@ -52,16 +55,16 @@ public:
   virtual std::vector<std::string> get_textual_trace() = 0;
 
   /** Log additional information about the state of the model-checker */
-  virtual void log_state() = 0;
+  virtual void log_state();
 
-  Session& get_session() { return *session_; }
+  RemoteApp& get_remote_app() { return *remote_app_.get(); }
 };
 
 // External constructors so that the types (and the types of their content) remain hidden
-XBT_PUBLIC Exploration* create_liveness_checker(Session* session);
-XBT_PUBLIC Exploration* create_dfs_exploration(Session* session);
-XBT_PUBLIC Exploration* create_communication_determinism_checker(Session* session);
-XBT_PUBLIC Exploration* create_udpor_checker(Session* session);
+XBT_PUBLIC Exploration* create_liveness_checker(const std::vector<char*>& args);
+XBT_PUBLIC Exploration* create_dfs_exploration(const std::vector<char*>& args, bool with_dpor);
+XBT_PUBLIC Exploration* create_communication_determinism_checker(const std::vector<char*>& args, bool with_dpor);
+XBT_PUBLIC Exploration* create_udpor_checker(const std::vector<char*>& args);
 
 } // namespace simgrid::mc
 
index c467eee..8f1ecb2 100644 (file)
@@ -4,7 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/mc/explo/LivenessChecker.hpp"
-#include "src/mc/Session.hpp"
+#include "src/mc/api/RemoteApp.hpp"
 #include "src/mc/mc_config.hpp"
 #include "src/mc/mc_exit.hpp"
 #include "src/mc/mc_private.hpp"
@@ -18,21 +18,20 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_liveness, mc, "Logging specific to algorithms
 
 namespace simgrid::mc {
 
-VisitedPair::VisitedPair(int pair_num, xbt_automaton_state_t automaton_state,
-                         std::shared_ptr<const std::vector<int>> atomic_propositions,
-                         std::shared_ptr<State> graph_state)
-    : num(pair_num), automaton_state(automaton_state)
+VisitedPair::VisitedPair(int pair_num, xbt_automaton_state_t prop_state,
+                         std::shared_ptr<const std::vector<int>> atomic_propositions, std::shared_ptr<State> app_state)
+    : num(pair_num), prop_state_(prop_state)
 {
-  this->graph_state = std::move(graph_state);
-  if (not this->graph_state->get_system_state())
-    this->graph_state->set_system_state(std::make_shared<Snapshot>(pair_num));
-  this->heap_bytes_used     = Api::get().get_remote_heap_bytes();
-  this->actors_count        = Api::get().get_actors().size();
+  this->app_state_ = std::move(app_state);
+  if (not this->app_state_->get_system_state())
+    this->app_state_->set_system_state(std::make_shared<Snapshot>(pair_num));
+  this->heap_bytes_used     = mc_model_checker->get_remote_process().get_remote_heap_bytes();
+  this->actor_count_        = app_state_->get_actor_count();
   this->other_num           = -1;
   this->atomic_propositions = std::move(atomic_propositions);
 }
 
-static bool evaluate_label(const xbt_automaton_exp_label* l, std::vector<int> const& values)
+bool LivenessChecker::evaluate_label(const xbt_automaton_exp_label* l, std::vector<int> const& values)
 {
   switch (l->type) {
     case xbt_automaton_exp_label::AUT_OR:
@@ -42,7 +41,7 @@ static bool evaluate_label(const xbt_automaton_exp_label* l, std::vector<int> co
     case xbt_automaton_exp_label::AUT_NOT:
       return not evaluate_label(l->u.exp_not, values);
     case xbt_automaton_exp_label::AUT_PREDICAT:
-      return values.at(Api::get().compare_automaton_exp_label(l)) != 0;
+      return values.at(compare_automaton_exp_label(l)) != 0;
     case xbt_automaton_exp_label::AUT_ONE:
       return true;
     default:
@@ -54,30 +53,31 @@ Pair::Pair(unsigned long expanded_pairs) : num(expanded_pairs) {}
 
 std::shared_ptr<const std::vector<int>> LivenessChecker::get_proposition_values() const
 {
-  auto values = Api::get().automaton_propositional_symbol_evaluate();
+  auto values = automaton_propositional_symbol_evaluate();
   return std::make_shared<const std::vector<int>>(std::move(values));
 }
 
 std::shared_ptr<VisitedPair> LivenessChecker::insert_acceptance_pair(simgrid::mc::Pair* pair)
 {
   auto new_pair =
-      std::make_shared<VisitedPair>(pair->num, pair->automaton_state, pair->atomic_propositions, pair->graph_state);
+      std::make_shared<VisitedPair>(pair->num, pair->prop_state_, pair->atomic_propositions, pair->app_state_);
 
-  auto [res_begin, res_end] = boost::range::equal_range(acceptance_pairs_, new_pair.get(), Api::get().compare_pair());
+  auto [res_begin,
+        res_end] = boost::range::equal_range(acceptance_pairs_, new_pair.get(), [](auto const& a, auto const& b) {
+    return std::make_pair(a->actor_count_, a->heap_bytes_used) < std::make_pair(b->actor_count_, b->heap_bytes_used);
+  });
 
   if (pair->search_cycle)
     for (auto i = res_begin; i != res_end; ++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 ||
+      if (xbt_automaton_state_compare(pair_test->prop_state_, new_pair->prop_state_) != 0 ||
           *(pair_test->atomic_propositions) != *(new_pair->atomic_propositions) ||
-          not Api::get().snapshot_equal(pair_test->graph_state->get_system_state(),
-                                        new_pair->graph_state->get_system_state()))
+          (*pair_test->app_state_->get_system_state() != *new_pair->app_state_->get_system_state()))
         continue;
       XBT_INFO("Pair %d already reached (equal to pair %d) !", new_pair->num, pair_test->num);
       exploration_stack_.pop_back();
-      if (dot_output != nullptr)
-        fprintf(dot_output, "\"%d\" -> \"%d\" [%s];\n", this->previous_pair_, pair_test->num,
-                this->previous_request_.c_str());
+      mc_model_checker->dot_output("\"%d\" -> \"%d\" [%s];\n", this->previous_pair_, pair_test->num,
+                                   this->previous_request_.c_str());
       return nullptr;
     }
 
@@ -101,13 +101,13 @@ void LivenessChecker::replay()
   /* Intermediate backtracking */
   if (_sg_mc_checkpoint > 0) {
     const Pair* pair = exploration_stack_.back().get();
-    if (const auto* system_state = pair->graph_state->get_system_state()) {
-      Api::get().restore_state(system_state);
+    if (const auto* system_state = pair->app_state_->get_system_state()) {
+      system_state->restore(&get_remote_app().get_remote_process());
       return;
     }
   }
 
-  get_session().restore_initial_state();
+  get_remote_app().restore_initial_state();
 
   /* Traverse the stack from the initial state and re-execute the transitions */
   int depth = 1;
@@ -115,7 +115,7 @@ void LivenessChecker::replay()
     if (pair == exploration_stack_.back())
       break;
 
-    std::shared_ptr<State> state = pair->graph_state;
+    std::shared_ptr<State> state = pair->app_state_;
 
     if (pair->exploration_started) {
       state->get_transition()->replay();
@@ -139,27 +139,25 @@ int LivenessChecker::insert_visited_pair(std::shared_ptr<VisitedPair> visited_pa
 
   if (visited_pair == nullptr)
     visited_pair =
-        std::make_shared<VisitedPair>(pair->num, pair->automaton_state, pair->atomic_propositions, pair->graph_state);
+        std::make_shared<VisitedPair>(pair->num, pair->prop_state_, pair->atomic_propositions, pair->app_state_);
 
-  auto [range_begin, range_end] =
-      boost::range::equal_range(visited_pairs_, visited_pair.get(), Api::get().compare_pair());
+  auto [range_begin,
+        range_end] = boost::range::equal_range(visited_pairs_, visited_pair.get(), [](auto const& a, auto const& b) {
+    return std::make_pair(a->actor_count_, a->heap_bytes_used) < std::make_pair(b->actor_count_, b->heap_bytes_used);
+  });
 
   for (auto i = range_begin; i != range_end; ++i) {
     const VisitedPair* pair_test = i->get();
-    if (xbt_automaton_state_compare(pair_test->automaton_state, visited_pair->automaton_state) != 0 ||
+    if (xbt_automaton_state_compare(pair_test->prop_state_, visited_pair->prop_state_) != 0 ||
         *(pair_test->atomic_propositions) != *(visited_pair->atomic_propositions) ||
-        not Api::get().snapshot_equal(pair_test->graph_state->get_system_state(),
-                                      visited_pair->graph_state->get_system_state()))
+        (*pair_test->app_state_->get_system_state() != *visited_pair->app_state_->get_system_state()))
       continue;
     if (pair_test->other_num == -1)
       visited_pair->other_num = pair_test->num;
     else
       visited_pair->other_num = pair_test->other_num;
-    if (dot_output == nullptr)
-      XBT_DEBUG("Pair %d already visited ! (equal to pair %d)", visited_pair->num, pair_test->num);
-    else
-      XBT_DEBUG("Pair %d already visited ! (equal to pair %d (pair %d in dot_output))", visited_pair->num,
-                pair_test->num, visited_pair->other_num);
+    XBT_DEBUG("Pair %d already visited ! (equal to pair %d (pair %d in dot_output))", visited_pair->num, pair_test->num,
+              visited_pair->other_num);
     (*i) = std::move(visited_pair);
     return (*i)->other_num;
   }
@@ -179,13 +177,85 @@ void LivenessChecker::purge_visited_pairs()
   }
 }
 
-LivenessChecker::LivenessChecker(Session* session) : Exploration(session) {}
+LivenessChecker::LivenessChecker(const std::vector<char*>& args) : Exploration(args) {}
+LivenessChecker::~LivenessChecker()
+{
+  xbt_automaton_free(property_automaton_);
+}
+
+xbt_automaton_t LivenessChecker::property_automaton_ = nullptr;
+
+void LivenessChecker::automaton_load(const char* file) const
+{
+  if (property_automaton_ == nullptr)
+    property_automaton_ = xbt_automaton_new();
+
+  xbt_automaton_load(property_automaton_, file);
+}
+
+std::vector<int> LivenessChecker::automaton_propositional_symbol_evaluate() const
+{
+  unsigned int cursor = 0;
+  std::vector<int> values;
+  xbt_automaton_propositional_symbol_t ps = nullptr;
+  xbt_dynar_foreach (property_automaton_->propositional_symbols, cursor, ps)
+    values.push_back(xbt_automaton_propositional_symbol_evaluate(ps));
+  return values;
+}
+
+std::vector<xbt_automaton_state_t> LivenessChecker::get_automaton_state() const
+{
+  std::vector<xbt_automaton_state_t> automaton_stack;
+  unsigned int cursor = 0;
+  xbt_automaton_state_t automaton_state;
+  xbt_dynar_foreach (property_automaton_->states, cursor, automaton_state)
+    if (automaton_state->type == -1)
+      automaton_stack.push_back(automaton_state);
+  return automaton_stack;
+}
+
+int LivenessChecker::compare_automaton_exp_label(const xbt_automaton_exp_label* l) const
+{
+  unsigned int cursor                    = 0;
+  xbt_automaton_propositional_symbol_t p = nullptr;
+  xbt_dynar_foreach (property_automaton_->propositional_symbols, cursor, p) {
+    if (std::strcmp(xbt_automaton_propositional_symbol_get_name(p), l->u.predicat) == 0)
+      return cursor;
+  }
+  return -1;
+}
+
+void LivenessChecker::set_property_automaton(xbt_automaton_state_t const& automaton_state) const
+{
+  property_automaton_->current_state = automaton_state;
+}
+
+xbt_automaton_exp_label_t LivenessChecker::get_automaton_transition_label(xbt_dynar_t const& dynar, int index) const
+{
+  const xbt_automaton_transition* transition = xbt_dynar_get_as(dynar, index, xbt_automaton_transition_t);
+  return transition->label;
+}
+
+xbt_automaton_state_t LivenessChecker::get_automaton_transition_dst(xbt_dynar_t const& dynar, int index) const
+{
+  const xbt_automaton_transition* transition = xbt_dynar_get_as(dynar, index, xbt_automaton_transition_t);
+  return transition->dst;
+}
+void LivenessChecker::automaton_register_symbol(RemoteProcess const& remote_process, const char* name,
+                                                RemotePtr<int> address)
+{
+  if (property_automaton_ == nullptr)
+    property_automaton_ = xbt_automaton_new();
+
+  xbt::add_proposition(property_automaton_, name,
+                       [&remote_process, address]() { return remote_process.read(address); });
+}
 
 RecordTrace LivenessChecker::get_record_trace() // override
 {
   RecordTrace res;
   for (std::shared_ptr<Pair> const& pair : exploration_stack_)
-    res.push_back(pair->graph_state->get_transition());
+    res.push_back(pair->app_state_->get_transition());
   return res;
 }
 
@@ -194,6 +264,7 @@ void LivenessChecker::log_state() // override
   XBT_INFO("Expanded pairs = %lu", expanded_pairs_count_);
   XBT_INFO("Visited pairs = %lu", visited_pairs_count_);
   XBT_INFO("Executed transitions = %lu", Transition::get_executed_transitions());
+  Exploration::log_state();
 }
 
 void LivenessChecker::show_acceptance_cycle(std::size_t depth)
@@ -213,7 +284,7 @@ std::vector<std::string> LivenessChecker::get_textual_trace() // override
 {
   std::vector<std::string> trace;
   for (std::shared_ptr<Pair> const& pair : exploration_stack_)
-    trace.push_back(pair->graph_state->get_transition()->to_string());
+    trace.push_back(pair->app_state_->get_transition()->to_string());
 
   return trace;
 }
@@ -223,23 +294,21 @@ std::shared_ptr<Pair> LivenessChecker::create_pair(const Pair* current_pair, xbt
 {
   ++expanded_pairs_count_;
   auto next_pair                 = std::make_shared<Pair>(expanded_pairs_count_);
-  next_pair->automaton_state     = state;
-  next_pair->graph_state         = std::make_shared<State>();
+  next_pair->prop_state_         = state;
+  next_pair->app_state_          = std::make_shared<State>(get_remote_app());
   next_pair->atomic_propositions = std::move(propositions);
   if (current_pair)
     next_pair->depth = current_pair->depth + 1;
   else
     next_pair->depth = 1;
   /* Add all enabled actors to the interleave set of the initial state */
-  for (auto& act : Api::get().get_actors()) {
-    auto actor = act.copy.get_buffer();
-    if (get_session().actor_is_enabled(actor->get_pid()))
-      next_pair->graph_state->mark_todo(actor->get_pid());
-  }
+  for (auto const& [aid, _] : next_pair->app_state_->get_actors_list())
+    if (next_pair->app_state_->is_actor_enabled(aid))
+      next_pair->app_state_->mark_todo(aid);
 
-  next_pair->requests = next_pair->graph_state->count_todo();
+  next_pair->requests = next_pair->app_state_->count_todo();
   /* FIXME : get search_cycle value for each accepting state */
-  if (next_pair->automaton_state->type == 1 || (current_pair && current_pair->search_cycle))
+  if (next_pair->prop_state_->type == 1 || (current_pair && current_pair->search_cycle))
     next_pair->search_cycle = true;
   else
     next_pair->search_cycle = false;
@@ -262,7 +331,7 @@ void LivenessChecker::backtrack()
       break;
     } else {
       XBT_DEBUG("Delete pair %d at depth %d", current_pair->num, current_pair->depth);
-      if (current_pair->automaton_state->type == 1)
+      if (current_pair->prop_state_->type == 1)
         this->remove_acceptance_pair(current_pair->num);
     }
   }
@@ -271,10 +340,9 @@ void LivenessChecker::backtrack()
 void LivenessChecker::run()
 {
   XBT_INFO("Check the liveness property %s", _sg_mc_property_file.get().c_str());
-  Api::get().automaton_load(_sg_mc_property_file.get().c_str());
+  automaton_load(_sg_mc_property_file.get().c_str());
 
   XBT_DEBUG("Starting the liveness algorithm");
-  get_session().take_initial_snapshot();
 
   /* Initialize */
   this->previous_pair_ = 0;
@@ -283,7 +351,7 @@ void LivenessChecker::run()
 
   // For each initial state of the property automaton, push a
   // (application_state, automaton_state) pair to the exploration stack:
-  auto automaton_stack = Api::get().get_automaton_state();
+  auto automaton_stack = get_automaton_state();
   for (auto* automaton_state : automaton_stack) {
     if (automaton_state->type == -1)
       exploration_stack_.push_back(this->create_pair(nullptr, automaton_state, propos));
@@ -294,11 +362,11 @@ void LivenessChecker::run()
     std::shared_ptr<Pair> current_pair = exploration_stack_.back();
 
     /* Update current state in buchi automaton */
-    Api::get().set_property_automaton(current_pair->automaton_state);
+    set_property_automaton(current_pair->prop_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->count_todo(), current_pair->num,
+        current_pair->depth, current_pair->search_cycle, current_pair->app_state_->count_todo(), current_pair->num,
         current_pair->requests);
 
     if (current_pair->requests == 0) {
@@ -307,7 +375,7 @@ void LivenessChecker::run()
     }
 
     std::shared_ptr<VisitedPair> reached_pair;
-    if (current_pair->automaton_state->type == 1 && not current_pair->exploration_started) {
+    if (current_pair->prop_state_->type == 1 && not current_pair->exploration_started) {
       reached_pair = this->insert_acceptance_pair(current_pair.get());
       if (reached_pair == nullptr) {
         this->show_acceptance_cycle(current_pair->depth);
@@ -319,11 +387,10 @@ void LivenessChecker::run()
     if (not current_pair->exploration_started) {
       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->previous_pair_, visited_num,
-                  this->previous_request_.c_str());
-          fflush(dot_output);
-        }
+        mc_model_checker->dot_output("\"%d\" -> \"%d\" [%s];\n", this->previous_pair_, visited_num,
+                                     this->previous_request_.c_str());
+        mc_model_checker->dot_output_flush();
+
         XBT_DEBUG("Pair already visited (equal to pair %d), exploration on the current path stopped.", visited_num);
         current_pair->requests = 0;
         this->backtrack();
@@ -331,21 +398,20 @@ void LivenessChecker::run()
       }
     }
 
-    current_pair->graph_state->execute_next(current_pair->graph_state->next_transition());
-    XBT_DEBUG("Execute: %s", current_pair->graph_state->get_transition()->to_string().c_str());
+    current_pair->app_state_->execute_next(current_pair->app_state_->next_transition());
+    XBT_DEBUG("Execute: %s", current_pair->app_state_->get_transition()->to_string().c_str());
 
-    if (dot_output != nullptr) {
-      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->previous_pair_    = current_pair->num;
-      this->previous_request_ = current_pair->graph_state->get_transition()->dot_string();
-      if (current_pair->search_cycle)
-        fprintf(dot_output, "%d [shape=doublecircle];\n", current_pair->num);
-      fflush(dot_output);
+    /* Update the dot output */
+    if (this->previous_pair_ != 0 && this->previous_pair_ != current_pair->num) {
+      mc_model_checker->dot_output("\"%d\" -> \"%d\" [%s];\n", this->previous_pair_, current_pair->num,
+                                   this->previous_request_.c_str());
+      this->previous_request_.clear();
     }
+    this->previous_pair_    = current_pair->num;
+    this->previous_request_ = current_pair->app_state_->get_transition()->dot_string();
+    if (current_pair->search_cycle)
+      mc_model_checker->dot_output("%d [shape=doublecircle];\n", current_pair->num);
+    mc_model_checker->dot_output_flush();
 
     if (not current_pair->exploration_started)
       visited_pairs_count_++;
@@ -358,10 +424,9 @@ void LivenessChecker::run()
 
     // For each enabled transition in the property automaton, push a
     // (application_state, automaton_state) pair to the exploration stack:
-    for (int i = xbt_dynar_length(current_pair->automaton_state->out) - 1; i >= 0; i--) {
-      const auto* transition_succ_label =
-          Api::get().get_automaton_transition_label(current_pair->automaton_state->out, i);
-      auto* transition_succ_dst = Api::get().get_automaton_transition_dst(current_pair->automaton_state->out, i);
+    for (int i = xbt_dynar_length(current_pair->prop_state_->out) - 1; i >= 0; i--) {
+      const auto* transition_succ_label = get_automaton_transition_label(current_pair->prop_state_->out, i);
+      auto* transition_succ_dst         = get_automaton_transition_dst(current_pair->prop_state_->out, i);
       if (evaluate_label(transition_succ_label, *prop_values))
         exploration_stack_.push_back(this->create_pair(current_pair.get(), transition_succ_dst, prop_values));
     }
@@ -371,9 +436,9 @@ void LivenessChecker::run()
   log_state();
 }
 
-Exploration* create_liveness_checker(Session* session)
+Exploration* create_liveness_checker(const std::vector<char*>& args)
 {
-  return new LivenessChecker(session);
+  return new LivenessChecker(args);
 }
 
 } // namespace simgrid::mc
index 31aa65c..a9008f9 100644 (file)
@@ -19,10 +19,10 @@ namespace simgrid::mc {
 
 class XBT_PRIVATE Pair {
 public:
-  int num                               = 0;
-  bool search_cycle                     = false;
-  std::shared_ptr<State> graph_state    = nullptr; /* System state included */
-  xbt_automaton_state_t automaton_state = nullptr;
+  int num                           = 0;
+  bool search_cycle                 = false;
+  std::shared_ptr<State> app_state_ = nullptr; /* State of the application (including system state) */
+  xbt_automaton_state_t prop_state_ = nullptr; /* State of the property automaton */
   std::shared_ptr<const std::vector<int>> atomic_propositions;
   int requests             = 0;
   int depth                = 0;
@@ -38,19 +38,21 @@ class XBT_PRIVATE VisitedPair {
 public:
   int num;
   int other_num                      = 0;       /* Dot output for */
-  std::shared_ptr<State> graph_state = nullptr; /* System state included */
-  xbt_automaton_state_t automaton_state;
+  std::shared_ptr<State> app_state_  = nullptr; /* State of the application (including system state) */
+  xbt_automaton_state_t prop_state_;            /* State of the property automaton */
   std::shared_ptr<const std::vector<int>> atomic_propositions;
   std::size_t heap_bytes_used = 0;
-  int actors_count            = 0;
+  int actor_count_;
 
-  VisitedPair(int pair_num, xbt_automaton_state_t automaton_state,
-              std::shared_ptr<const std::vector<int>> atomic_propositions, std::shared_ptr<State> graph_state);
+  VisitedPair(int pair_num, xbt_automaton_state_t prop_state,
+              std::shared_ptr<const std::vector<int>> atomic_propositions, std::shared_ptr<State> app_state);
 };
 
 class XBT_PRIVATE LivenessChecker : public Exploration {
 public:
-  explicit LivenessChecker(Session* session);
+  explicit LivenessChecker(const std::vector<char*>& args);
+  ~LivenessChecker() override;
+
   void run() override;
   RecordTrace get_record_trace() override;
   std::vector<std::string> get_textual_trace() override;
@@ -76,6 +78,29 @@ private:
   unsigned long expanded_pairs_count_ = 0;
   int previous_pair_                  = 0;
   std::string previous_request_;
+
+  /* The property automaton must be a static because it's sometimes used before the explorer is even created.
+   *
+   * This can happen if some symbols are created during the application's initialization process, before the first
+   * decision point for the model-checker. Since the first snapshot is taken at the first decision point and since the
+   * explorer is created after the first snapshot, this may result in some symbols being registered even before the
+   * model-checker notices that this is a LivenessChecker to create.
+   *
+   * This situation is unfortunate, but I guess that it's the best I can achieve given the state of our initialization
+   * code.
+   */
+  static xbt_automaton_t property_automaton_;
+  bool evaluate_label(const xbt_automaton_exp_label* l, std::vector<int> const& values);
+
+public:
+  void automaton_load(const char* file) const;
+  std::vector<int> automaton_propositional_symbol_evaluate() const;
+  std::vector<xbt_automaton_state_t> get_automaton_state() const;
+  int compare_automaton_exp_label(const xbt_automaton_exp_label* l) const;
+  void set_property_automaton(xbt_automaton_state_t const& automaton_state) const;
+  xbt_automaton_exp_label_t get_automaton_transition_label(xbt_dynar_t const& dynar, int index) const;
+  xbt_automaton_state_t get_automaton_transition_dst(xbt_dynar_t const& dynar, int index) const;
+  static void automaton_register_symbol(RemoteProcess const& remote_process, const char* name, RemotePtr<int> addr);
 };
 
 } // namespace simgrid::mc
index 7f43c4e..edd6add 100644 (file)
@@ -10,7 +10,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_udpor, mc, "Logging specific to MC safety ver
 
 namespace simgrid::mc {
 
-UdporChecker::UdporChecker(Session* session) : Exploration(session) {}
+UdporChecker::UdporChecker(const std::vector<char*>& args) : Exploration(args) {}
 
 void UdporChecker::run() {}
 
@@ -26,11 +26,9 @@ std::vector<std::string> UdporChecker::get_textual_trace()
   return trace;
 }
 
-void UdporChecker::log_state() {}
-
-Exploration* create_udpor_checker(Session* session)
+Exploration* create_udpor_checker(const std::vector<char*>& args)
 {
-  return new UdporChecker(session);
+  return new UdporChecker(args);
 }
 
 } // namespace simgrid::mc
index 168a14a..828f43b 100644 (file)
@@ -14,11 +14,10 @@ namespace simgrid::mc {
 
 class XBT_PRIVATE UdporChecker : public Exploration {
 public:
-  explicit UdporChecker(Session* session);
+  explicit UdporChecker(const std::vector<char*>& args);
   void run() override;
   RecordTrace get_record_trace() override;
   std::vector<std::string> get_textual_trace() override;
-  void log_state() override;
 };
 
 } // namespace simgrid::mc
index afd997a..d540f2a 100644 (file)
@@ -4,7 +4,6 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/sg_config.hpp"
-#include "src/internal_config.h"
 #include "src/mc/explo/Exploration.hpp"
 #include "src/mc/mc_config.hpp"
 #include "src/mc/mc_exit.hpp"
@@ -13,9 +12,9 @@
 #include "smpi/smpi.h"
 #endif
 
-#include <cstring>
-#include <memory>
-#include <unistd.h>
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(mc);
+
+using namespace simgrid::mc;
 
 int main(int argc, char** argv)
 {
@@ -30,32 +29,29 @@ int main(int argc, char** argv)
 
   xbt_log_init(&argc, argv);
 #if HAVE_SMPI
-  smpi_init_options(); // only performed once
+  smpi_init_options(); // that's OK to call it twice, and we need it ASAP
 #endif
   sg_config_init(&argc, argv);
 
-  simgrid::mc::ExplorationAlgorithm algo;
+  std::unique_ptr<Exploration> explo;
+
   if (_sg_mc_comms_determinism || _sg_mc_send_determinism)
-    algo = simgrid::mc::ExplorationAlgorithm::CommDeterminism;
+    explo = std::unique_ptr<Exploration>(create_communication_determinism_checker(argv_copy, cfg_use_DPOR()));
   else if (_sg_mc_unfolding_checker)
-    algo = simgrid::mc::ExplorationAlgorithm::UDPOR;
+    explo = std::unique_ptr<Exploration>(create_udpor_checker(argv_copy));
   else if (_sg_mc_property_file.get().empty())
-    algo = simgrid::mc::ExplorationAlgorithm::Safety;
+    explo = std::unique_ptr<Exploration>(create_dfs_exploration(argv_copy, cfg_use_DPOR()));
   else
-    algo = simgrid::mc::ExplorationAlgorithm::Liveness;
+    explo = std::unique_ptr<Exploration>(create_liveness_checker(argv_copy));
 
-  int res      = SIMGRID_MC_EXIT_SUCCESS;
-  std::unique_ptr<simgrid::mc::Exploration> checker{simgrid::mc::Api::get().initialize(argv_copy.data(), algo)};
   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;
+    explo->run();
+  } catch (const DeadlockError&) {
+    return SIMGRID_MC_EXIT_DEADLOCK;
+  } catch (const TerminationError&) {
+    return SIMGRID_MC_EXIT_NON_TERMINATION;
+  } catch (const LivenessError&) {
+    return SIMGRID_MC_EXIT_LIVENESS;
   }
-  simgrid::mc::Api::get().s_close();
-  checker.release(); // FIXME: this line should not exist, but it segfaults in liveness
-  return res;
+  return SIMGRID_MC_EXIT_SUCCESS;
 }
index 12c79f0..f8608cd 100644 (file)
@@ -31,9 +31,7 @@ private:
 public:
   LocationListEntry() = default;
   LocationListEntry(DwarfExpression expression, range_type range) : expression_(std::move(expression)), range_(range) {}
-  explicit LocationListEntry(DwarfExpression expression) : expression_(std::move(expression)), range_({0, UINT64_MAX})
-  {
-  }
+  explicit LocationListEntry(DwarfExpression expression) : expression_(std::move(expression)) {}
 
   DwarfExpression& expression() { return expression_; }
   DwarfExpression const& expression() const { return expression_; }
index 553ec19..44ad73e 100644 (file)
@@ -516,7 +516,7 @@ static simgrid::mc::Type MC_dwarf_die_to_type(simgrid::mc::ObjectInformation* in
   // Global Offset
   type.id = dwarf_dieoffset(die);
 
-  const char* prefix = "";
+  const char* prefix;
   switch (type.type) {
     case DW_TAG_structure_type:
       prefix = "struct ";
index 4515ea6..671fccd 100644 (file)
@@ -1,3 +1,5 @@
+/** \file  Libunwind namespace implementation using process_vm_readv.       */
+
 /* Copyright (c) 2015-2022. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -13,9 +15,6 @@
 #include <libunwind-ptrace.h>
 #include <libunwind.h>
 
-/** \file
- *  Libunwind namespace implementation using process_vm_readv.
- */
 
 /** Partial structure of libunwind-ptrace context in order to get the PID
  *
@@ -28,21 +27,13 @@ struct _UPT_info {
   // Other things...
 };
 
-/** Get the PID of a `libunwind-ptrace` context
- */
-static inline pid_t _UPT_getpid(void* arg)
-{
-  const _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)
 {
   if (write)
     return -UNW_EINVAL;
-  pid_t pid   = _UPT_getpid(arg);
+  pid_t pid   = static_cast<_UPT_info*>(arg)->pid;
   size_t size = sizeof(unw_word_t);
 
 #if HAVE_PROCESS_VM_READV /* linux but not freebsd */
index fe612c9..91012ba 100644 (file)
@@ -16,7 +16,7 @@
 
 #if SIMGRID_HAVE_MC
 #include "src/mc/ModelChecker.hpp"
-#include "src/mc/Session.hpp"
+#include "src/mc/api/RemoteApp.hpp"
 #include "src/mc/remote/RemoteProcess.hpp"
 #endif
 
@@ -40,9 +40,7 @@ namespace simgrid::mc {
 void execute_actors()
 {
   auto* engine = kernel::EngineImpl::get_instance();
-#if SIMGRID_HAVE_MC
-  xbt_assert(mc_model_checker == nullptr, "This must be called from the client");
-#endif
+
   while (engine->has_actors_to_run()) {
     engine->run_all_actors();
     for (auto const& actor : engine->get_actors_that_ran()) {
@@ -51,15 +49,6 @@ void execute_actors()
         actor->simcall_handle(0);
     }
   }
-#if SIMGRID_HAVE_MC
-  engine->reset_actor_dynar();
-  for (auto const& [_, actor] : engine->get_actor_list()) {
-    // Only visible requests remain at this point, and they all have an observer
-    actor->simcall_.mc_max_consider_ = actor->simcall_.observer_->get_max_consider();
-
-    engine->add_actor_to_dynar(actor);
-  }
-#endif
 }
 
 /** @brief returns if there this transition can proceed in a finite amount of time
index 7d11040..e64019f 100644 (file)
@@ -5,7 +5,6 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #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"
@@ -31,23 +30,6 @@ void MC_assert(int prop)
   }
 }
 
-void MC_cut()
-{
-  xbt_assert(mc_model_checker == nullptr);
-  if (not MC_is_active())
-    return;
-  // FIXME, We want to do this in the model-checker:
-  xbt_die("MC_cut() not implemented");
-}
-
-void MC_ignore(void* addr, size_t size)
-{
-  xbt_assert(mc_model_checker == nullptr);
-  if (not MC_is_active())
-    return;
-  simgrid::mc::AppSide::get()->ignore_memory(addr, size);
-}
-
 void MC_automaton_new_propositional_symbol(const char* /*id*/, int (*/*fct*/)())
 {
   xbt_assert(mc_model_checker == nullptr);
@@ -65,46 +47,22 @@ void MC_automaton_new_propositional_symbol_pointer(const char *name, int* value)
   simgrid::mc::AppSide::get()->declare_symbol(name, value);
 }
 
-/** @brief Register a stack in the model checker
- *
- *  The stacks are allocated in the heap. The MC handle them specifically
- *  when we analyze/compare the content of the heap so it must be told where
- *  they are with this function.
- *
- *  @param stack Where the stack is
- *  @param actor Actor owning the stack
- *  @param context The context associated to that stack
- *  @param size    Size of the stack
- */
-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::AppSide::get()->declare_stack(stack, size, context);
-}
-
-void MC_ignore_global_variable(const char* /*name*/)
+void MC_ignore(void* addr, size_t size)
 {
   xbt_assert(mc_model_checker == nullptr);
   if (not MC_is_active())
     return;
-  // TODO, send a message to the model_checker
-  xbt_die("Unimplemented");
+  simgrid::mc::AppSide::get()->ignore_memory(addr, size);
 }
 
 void MC_ignore_heap(void *address, size_t size)
 {
   xbt_assert(mc_model_checker == nullptr);
-  if (not MC_is_active())
-    return;
   simgrid::mc::AppSide::get()->ignore_heap(address, size);
 }
 
 void MC_unignore_heap(void* address, size_t size)
 {
   xbt_assert(mc_model_checker == nullptr);
-  if (not MC_is_active())
-    return;
   simgrid::mc::AppSide::get()->unignore_heap(address, size);
 }
index f33a895..fb1b1a6 100644 (file)
@@ -8,25 +8,18 @@
 #include <simgrid/sg_config.hpp>
 
 #if SIMGRID_HAVE_MC
-#include "src/mc/mc_safety.hpp"
 #include <string_view>
-#endif
 
-#if SIMGRID_HAVE_MC
-namespace simgrid::mc {
-/* Configuration support */
-simgrid::mc::ReductionMode reduction_mode = simgrid::mc::ReductionMode::unset;
-} // namespace simgrid::mc
 #else
 #define _sg_do_model_check 0
 #endif
 
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_cfg);
+
 static void _mc_cfg_cb_check(const char* spec, bool more_check = true)
 {
   xbt_assert(_sg_cfg_init_status == 0 || _sg_do_model_check || not more_check,
-             "You are specifying a %s after the initialization (through MSG_config?), but the program was not run "
-             "under the model-checker (with simgrid-mc)). This won't work, sorry.",
-             spec);
+             "Specifying a %s is only allowed within the model-checker. Please use simgrid-mc.", spec);
 }
 
 /* Replay (this part is enabled even if MC it disabled) */
@@ -43,6 +36,13 @@ simgrid::config::Flag<bool> _sg_mc_timeout{
 int _sg_do_model_check = 0;
 int _sg_mc_max_visited_states = 0;
 
+static simgrid::config::Flag<std::string> cfg_mc_reduction{
+    "model-check/reduction", "Specify the kind of exploration reduction (either none or DPOR)", "dpor",
+    [](std::string_view value) {
+      if (value != "none" && value != "dpor")
+        xbt_die("configuration option 'model-check/reduction' can only take 'none' or 'dpor' as a value");
+    }};
+
 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 "
@@ -84,27 +84,17 @@ simgrid::config::Flag<std::string> _sg_mc_buffering{
      {"infty", "Infinite system buffering: MPI_Send returns immediately"}},
     [](std::string_view) { _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",
-    [](std::string_view value) {
-      _mc_cfg_cb_check("reduction strategy");
-
-      if (value == "none")
-        simgrid::mc::reduction_mode = simgrid::mc::ReductionMode::none;
-      else if (value == "dpor")
-        simgrid::mc::reduction_mode = simgrid::mc::ReductionMode::dpor;
-      else
-        xbt_die("configuration option model-check/reduction can only take 'none' or 'dpor' as a value");
-    }};
-
 simgrid::config::Flag<int> _sg_mc_max_depth{"model-check/max-depth",
                                             "Maximal exploration depth (default: 1000)",
                                             1000,
                                             [](int) { _mc_cfg_cb_check("max depth value"); }};
 
 static simgrid::config::Flag<int> _sg_mc_max_visited_states__{
-    "model-check/visited", "Specify the number of visited state stored for state comparison reduction. If value=5, the "
-                           "last 5 visited states are stored. If value=0 (the default), all states are stored.",
+    "model-check/visited",
+    "Specify the number of visited state stored for state comparison reduction: any branch leading to a state that is "
+    "already stored is cut.\n"
+    "If value=5, the last 5 visited states are stored. If value=0 (the default), no state is stored and this reduction "
+    "technique is disabled.",
     0, [](int value) {
       _mc_cfg_cb_check("number of stored visited states");
       _sg_mc_max_visited_states = value;
@@ -120,4 +110,13 @@ simgrid::config::Flag<bool> _sg_mc_termination{
     "model-check/termination", "Whether to enable non progressive cycle detection", false,
     [](bool) { _mc_cfg_cb_check("value to enable/disable the detection of non progressive cycles"); }};
 
+bool simgrid::mc::cfg_use_DPOR()
+{
+  if (cfg_mc_reduction.get() == "dpor" && _sg_mc_max_visited_states__ > 0) {
+    XBT_INFO("Disabling DPOR since state-equality reduction is activated with 'model-check/visited'");
+    return false;
+  }
+  return cfg_mc_reduction.get() == "dpor";
+}
+
 #endif
index e5232f7..39e07cd 100644 (file)
@@ -9,6 +9,10 @@
 #include <xbt/config.hpp>
 
 /********************************** Configuration of MC **************************************/
+namespace simgrid::mc {
+bool cfg_use_DPOR(); // "model-check/reduction" == "DPOR"
+};
+
 extern "C" XBT_PUBLIC int _sg_do_model_check;
 extern XBT_PUBLIC simgrid::config::Flag<std::string> _sg_mc_buffering;
 extern XBT_PRIVATE simgrid::config::Flag<int> _sg_mc_checkpoint;
index ef21204..a3b4a17 100644 (file)
@@ -7,12 +7,11 @@
 #include "src/kernel/actor/ActorImpl.hpp"
 
 #if SIMGRID_HAVE_MC
-#include "src/mc/Session.hpp"
+#include "src/mc/api/RemoteApp.hpp"
 #include "src/mc/explo/Exploration.hpp"
 #include "src/mc/inspect/mc_unw.hpp"
 #include "src/mc/mc_config.hpp"
 #include "src/mc/mc_private.hpp"
-#include "src/mc/mc_safety.hpp"
 #include "src/mc/remote/AppSide.hpp"
 #include "src/mc/sosp/Snapshot.hpp"
 
@@ -39,23 +38,8 @@ std::vector<double> processes_time;
 
 #if SIMGRID_HAVE_MC
 
-/* Dot output */
-FILE *dot_output = nullptr;
-
-void MC_init_dot_output()
-{
-  dot_output = fopen(_sg_mc_dot_output_file.get().c_str(), "w");
-  xbt_assert(dot_output != nullptr, "Error open dot output file: %s", strerror(errno));
-
-  fprintf(dot_output,
-          "digraph graphname{\n fixedsize=true; rankdir=TB; ranksep=.25; edge [fontsize=12]; node [fontsize=10, shape=circle,width=.5 ]; graph [resolution=20, fontsize=10];\n");
-}
-
 namespace simgrid::mc {
 
-/* Liveness */
-xbt_automaton_t property_automaton = nullptr;
-
 /*******************************  Core of MC *******************************/
 /**************************************************************************/
 void dumpStack(FILE* file, unw_cursor_t* cursor)
diff --git a/src/mc/mc_hash.cpp b/src/mc/mc_hash.cpp
deleted file mode 100644 (file)
index 8b667d0..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Copyright (c) 2014-2022. The SimGrid Team. All rights reserved.          */
-
-/* This program is 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 <cstdint>
-
-#include "xbt/log.h"
-
-#include "mc/datatypes.h"
-#include "src/mc/mc_hash.hpp"
-#include "src/mc/mc_private.hpp"
-#include "src/mc/sosp/Snapshot.hpp"
-#include <mc/mc.h>
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_hash, mc, "Logging specific to mc_hash");
-
-namespace simgrid::mc {
-
-namespace {
-
-class djb_hash {
-  hash_type state_ = 5381LL;
-
-public:
-  template<class T>
-  void update(T& x)
-  {
-    state_ = (state_ << 5) + state_ + x;
-  }
-  hash_type value() const { return state_; }
-};
-
-}
-
-hash_type hash(Snapshot const& snapshot)
-{
-  XBT_DEBUG("START hash %ld", snapshot.num_state_);
-  djb_hash hash;
-  // TODO:
-  // * nb_processes
-  // * heap_bytes_used
-  // * root variables
-  // * basic stack frame information
-  // * stack frame local variables
-  XBT_DEBUG("END hash %ld", snapshot.num_state_);
-  return hash.value();
-}
-
-} // namespace simgrid::mc
diff --git a/src/mc/mc_hash.hpp b/src/mc/mc_hash.hpp
deleted file mode 100644 (file)
index 03110a7..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved.          */
-
-/* This program 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_HASH_HPP
-#define SIMGRID_MC_HASH_HPP
-
-#include "xbt/base.h"
-#include "src/mc/mc_forward.hpp"
-
-namespace simgrid::mc {
-
-using hash_type = std::uint64_t;
-
-XBT_PRIVATE hash_type hash(simgrid::mc::Snapshot const& snapshot);
-
-} // namespace simgrid::mc
-
-#endif
diff --git a/src/mc/mc_ignore.hpp b/src/mc/mc_ignore.hpp
deleted file mode 100644 (file)
index 55e7254..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Copyright (c) 2015-2022. The SimGrid Team. All rights reserved.          */
-
-/* This program 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_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, ucontext_t* context, size_t size);
-
-#endif
-
-#endif
index fc37957..b3168d1 100644 (file)
 #include "src/mc/mc_forward.hpp"
 #include "src/xbt/memory_map.hpp"
 
-/********************************* MC Global **********************************/
-
-XBT_PRIVATE void MC_init_dot_output();
-
-XBT_PRIVATE extern FILE* dot_output;
-
 /********************************** Miscellaneous **********************************/
 namespace simgrid::mc {
 
@@ -27,8 +21,6 @@ XBT_PRIVATE void find_object_address(std::vector<simgrid::xbt::VmMap> const& map
 XBT_PRIVATE
 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;
 } // namespace simgrid::mc
 
 #endif
diff --git a/src/mc/mc_safety.hpp b/src/mc/mc_safety.hpp
deleted file mode 100644 (file)
index e16f12e..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef SIMGRID_MC_SAFETY_HPP
-#define SIMGRID_MC_SAFETY_HPP
-
-#include "xbt/base.h"
-
-namespace simgrid::mc {
-
-enum class ReductionMode {
-  unset,
-  none,
-  dpor,
-};
-
-extern XBT_PRIVATE simgrid::mc::ReductionMode reduction_mode;
-} // namespace simgrid::mc
-
-#endif
diff --git a/src/mc/mc_smx.cpp b/src/mc/mc_smx.cpp
deleted file mode 100644 (file)
index 7593fc2..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Copyright (c) 2015-2022. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "simgrid/s4u/Host.hpp"
-
-#include "src/mc/ModelChecker.hpp"
-#include "src/mc/remote/RemoteProcess.hpp"
-
-/** @file
- *  @brief (Cross-process, MCer/MCed) Access to SMX structures
- *
- *  We copy some C data structure from the MCed process in the MCer process.
- *  This is implemented by:
- *
- *   - `model_checker->process.smx_process_infos`
- *      (copy of `EngineImpl::actor_list_`);
- *
- *   - `model_checker->hostnames`.
- *
- * The process lists are currently refreshed each time MCed code is executed.
- * We don't try to give a persistent MCer address for a given MCed process.
- * For this reason, a MCer simgrid::mc::Process* is currently not reusable after
- * MCed code.
- */
-
-/** Load the remote list of processes into a vector
- *
- *  @param process      MCed process
- *  @param target       Local vector (to be filled with `simgrid::mc::ActorInformation`)
- *  @param remote_dynar Address of the process dynar in the remote list
- */
-static void MC_process_refresh_simix_actor_dynar(const simgrid::mc::RemoteProcess* process,
-                                                 std::vector<simgrid::mc::ActorInformation>& target,
-                                                 simgrid::mc::RemotePtr<s_xbt_dynar_t> remote_dynar)
-{
-  target.clear();
-
-  s_xbt_dynar_t dynar;
-  process->read_bytes(&dynar, sizeof(dynar), remote_dynar);
-
-  auto* data = static_cast<simgrid::kernel::actor::ActorImpl**>(::operator new(dynar.elmsize * dynar.used));
-  process->read_bytes(data, dynar.elmsize * dynar.used, simgrid::mc::RemotePtr<void>(dynar.data));
-
-  // Load each element of the vector from the MCed process:
-  for (unsigned int i = 0; i < dynar.used; ++i) {
-    simgrid::mc::ActorInformation info;
-
-    info.address  = simgrid::mc::RemotePtr<simgrid::kernel::actor::ActorImpl>(data[i]);
-    process->read_bytes(&info.copy, sizeof(info.copy), simgrid::mc::remote(data[i]));
-    target.push_back(std::move(info));
-  }
-  ::operator delete(data);
-}
-namespace simgrid::mc {
-
-void RemoteProcess::refresh_simix()
-{
-  if (this->cache_flags_ & RemoteProcess::cache_simix_processes)
-    return;
-
-  MC_process_refresh_simix_actor_dynar(this, this->smx_actors_infos, actors_addr_);
-
-  this->cache_flags_ |= RemoteProcess::cache_simix_processes;
-}
-
-} // namespace simgrid::mc
index 8d612f1..e74e4d4 100644 (file)
@@ -34,7 +34,7 @@ namespace simgrid::mc {
 
 std::unique_ptr<AppSide> AppSide::instance_;
 
-AppSide* AppSide::initialize(xbt_dynar_t actors_addr)
+AppSide* AppSide::initialize()
 {
   if (not std::getenv(MC_ENV_SOCKET_FD)) // We are not in MC mode: don't initialize the MC world
     return nullptr;
@@ -73,8 +73,8 @@ AppSide* AppSide::initialize(xbt_dynar_t actors_addr)
   xbt_assert(errno == 0 && raise(SIGSTOP) == 0, "Could not wait for the model-checker (errno = %d: %s)", errno,
              strerror(errno));
 
-  s_mc_message_initial_addresses_t message{MessageType::INITIAL_ADDRESSES, mmalloc_preinit(),
-                                           kernel::actor::ActorImpl::get_maxpid_addr(), actors_addr};
+  s_mc_message_initial_addresses_t message{MessageType::INITIAL_ADDRESSES, mmalloc_get_current_heap(),
+                                           kernel::actor::ActorImpl::get_maxpid_addr()};
   xbt_assert(instance_->channel_.send(message) == 0, "Could not send the initial message with addresses.");
 
   instance_->handle_messages();
@@ -122,13 +122,6 @@ void AppSide::handle_simcall_execute(const s_mc_message_simcall_execute_t* messa
   xbt_assert(channel_.send(answer) == 0, "Could not send response");
 }
 
-void AppSide::handle_actor_enabled(const s_mc_message_actor_enabled_t* msg) const
-{
-  bool res = mc::actor_is_enabled(kernel::EngineImpl::get_instance()->get_actor_by_pid(msg->aid));
-  s_mc_message_int_t answer{MessageType::ACTOR_ENABLED_REPLY, res};
-  xbt_assert(channel_.send(answer) == 0, "Could not send ACTOR_ENABLED_REPLY");
-}
-
 void AppSide::handle_finalize(const s_mc_message_int_t* msg) const
 {
   bool terminate_asap = msg->value;
@@ -137,18 +130,39 @@ void AppSide::handle_finalize(const s_mc_message_int_t* msg) const
     if (XBT_LOG_ISENABLED(mc_client, xbt_log_priority_debug))
       kernel::EngineImpl::get_instance()->display_all_actor_status();
 #if HAVE_SMPI
-    XBT_DEBUG("Smpi_enabled: %d", (int)smpi_enabled());
-    if (smpi_enabled())
+    XBT_DEBUG("Smpi_enabled: %d", SMPI_is_inited());
+    if (SMPI_is_inited())
       SMPI_finalize();
 #endif
   }
   coverage_checkpoint();
-  xbt_assert(channel_.send(MessageType::DEADLOCK_CHECK_REPLY) == 0, // DEADLOCK_CHECK_REPLY, really?
-             "Could not answer to FINALIZE");
+  xbt_assert(channel_.send(MessageType::FINALIZE_REPLY) == 0, "Could not answer to FINALIZE");
   std::fflush(stdout);
   if (terminate_asap)
     ::_Exit(0);
 }
+void AppSide::handle_actors_status() const
+{
+  auto const& actor_list = kernel::EngineImpl::get_instance()->get_actor_list();
+  int count              = actor_list.size();
+
+  struct s_mc_message_actors_status_answer_t answer {
+    MessageType::ACTORS_STATUS_REPLY, count
+  };
+  std::vector<s_mc_message_actors_status_one_t> status(count);
+  int i = 0;
+  for (auto const& [aid, actor] : actor_list) {
+    status[i].aid            = aid;
+    status[i].enabled        = mc::actor_is_enabled(actor);
+    status[i].max_considered = actor->simcall_.observer_->get_max_consider();
+    i++;
+  }
+  xbt_assert(channel_.send(answer) == 0, "Could not send ACTORS_STATUS_REPLY msg");
+  if (answer.count > 0) {
+    size_t size = status.size() * sizeof(s_mc_message_actors_status_one_t);
+    xbt_assert(channel_.send(status.data(), size) == 0, "Could not send ACTORS_STATUS_REPLY data");
+  }
+}
 
 #define assert_msg_size(_name_, _type_)                                                                                \
   xbt_assert(received_size == sizeof(_type_), "Unexpected size for " _name_ " (%zd != %zu)", received_size,            \
@@ -180,16 +194,16 @@ void AppSide::handle_messages() const
         handle_simcall_execute((s_mc_message_simcall_execute_t*)message_buffer.data());
         break;
 
-      case MessageType::ACTOR_ENABLED:
-        assert_msg_size("ACTOR_ENABLED", s_mc_message_actor_enabled_t);
-        handle_actor_enabled((s_mc_message_actor_enabled_t*)message_buffer.data());
-        break;
-
       case MessageType::FINALIZE:
         assert_msg_size("FINALIZE", s_mc_message_int_t);
         handle_finalize((s_mc_message_int_t*)message_buffer.data());
         break;
 
+      case MessageType::ACTORS_STATUS:
+        assert_msg_size("ACTORS_STATUS", s_mc_message_t);
+        handle_actors_status();
+        break;
+
       default:
         xbt_die("Received unexpected message %s (%i)", to_c_str(message->type), static_cast<int>(message->type));
         break;
@@ -219,6 +233,9 @@ void AppSide::report_assertion_failure() const
 
 void AppSide::ignore_memory(void* addr, std::size_t size) const
 {
+  if (not MC_is_active())
+    return;
+
   s_mc_message_ignore_memory_t message;
   message.type = MessageType::IGNORE_MEMORY;
   message.addr = (std::uintptr_t)addr;
@@ -228,6 +245,9 @@ void AppSide::ignore_memory(void* addr, std::size_t size) const
 
 void AppSide::ignore_heap(void* address, std::size_t size) const
 {
+  if (not MC_is_active())
+    return;
+
   const s_xbt_mheap_t* heap = mmalloc_get_current_heap();
 
   s_mc_message_ignore_heap_t message;
@@ -248,6 +268,9 @@ void AppSide::ignore_heap(void* address, std::size_t size) const
 
 void AppSide::unignore_heap(void* address, std::size_t size) const
 {
+  if (not MC_is_active())
+    return;
+
   s_mc_message_ignore_memory_t message;
   message.type = MessageType::UNIGNORE_HEAP;
   message.addr = (std::uintptr_t)address;
@@ -267,8 +290,17 @@ void AppSide::declare_symbol(const char* name, int* value) const
   xbt_assert(channel_.send(message) == 0, "Could send REGISTER_SYMBOL message to model-checker");
 }
 
+/** Register a stack in the model checker
+ *
+ *  The stacks are allocated in the heap. The MC handle them specifically
+ *  when we analyze/compare the content of the heap so it must be told where
+ *  they are with this function.
+ */
 void AppSide::declare_stack(void* stack, size_t size, ucontext_t* context) const
 {
+  if (not MC_is_active())
+    return;
+
   const s_xbt_mheap_t* heap = mmalloc_get_current_heap();
 
   s_stack_region_t region;
index 393f1ea..b63a836 100644 (file)
@@ -31,8 +31,8 @@ public:
 private:
   void handle_deadlock_check(const s_mc_message_t* msg) const;
   void handle_simcall_execute(const s_mc_message_simcall_execute_t* message) const;
-  void handle_actor_enabled(const s_mc_message_actor_enabled_t* msg) const;
   void handle_finalize(const s_mc_message_int_t* msg) const;
+  void handle_actors_status() const;
 
 public:
   Channel const& get_channel() const { return channel_; }
@@ -49,7 +49,7 @@ public:
 
   // Singleton :/
   // TODO, remove the singleton antipattern.
-  static AppSide* initialize(xbt_dynar_t actors_addr);
+  static AppSide* initialize();
   static AppSide* get() { return instance_.get(); }
 };
 } // namespace simgrid::mc
index 654717d..75a610d 100644 (file)
@@ -105,11 +105,10 @@ int open_vm(pid_t pid, int flags)
 
 RemoteProcess::RemoteProcess(pid_t pid) : AddressSpace(this), pid_(pid), running_(true) {}
 
-void RemoteProcess::init(xbt_mheap_t mmalloc_default_mdp, unsigned long* maxpid, xbt_dynar_t actors)
+void RemoteProcess::init(xbt_mheap_t mmalloc_default_mdp, unsigned long* maxpid)
 {
   this->heap_address      = remote(mmalloc_default_mdp);
   this->maxpid_addr_      = remote(maxpid);
-  this->actors_addr_      = remote(actors);
 
   this->memory_map_ = simgrid::xbt::get_memory_map(this->pid_);
   this->init_memory_map_info();
@@ -118,7 +117,6 @@ void RemoteProcess::init(xbt_mheap_t mmalloc_default_mdp, unsigned long* maxpid,
   xbt_assert(fd >= 0, "Could not open file for process virtual address space");
   this->memory_file = fd;
 
-  this->smx_actors_infos.clear();
   this->unw_addr_space            = simgrid::mc::UnwindContext::createUnwindAddressSpace();
   this->unw_underlying_addr_space = simgrid::unw::create_addr_space();
   this->unw_underlying_context    = simgrid::unw::create_context(this->unw_underlying_addr_space, this->pid_);
@@ -147,8 +145,6 @@ RemoteProcess::~RemoteProcess()
 void RemoteProcess::refresh_heap()
 {
   // Read/dereference/refresh the std_heap pointer:
-  if (not this->heap)
-    this->heap = std::make_unique<s_xbt_mheap_t>();
   this->read(this->heap.get(), this->heap_address);
   this->cache_flags_ |= RemoteProcess::cache_heap;
 }
@@ -169,6 +165,10 @@ void RemoteProcess::refresh_malloc_info()
   this->read_bytes(this->heap_info.data(), count * sizeof(malloc_info), remote(this->heap->heapinfo));
   this->cache_flags_ |= RemoteProcess::cache_malloc;
 }
+std::size_t RemoteProcess::get_remote_heap_bytes()
+{
+  return mmalloc_get_bytes_used_remote(get_heap()->heaplimit, get_malloc_info());
+}
 
 /** @brief Finds the range of the different memory segments and binary paths */
 void RemoteProcess::init_memory_map_info()
@@ -410,12 +410,6 @@ void RemoteProcess::ignore_local_variable(const char* var_name, const char* fram
     info->remove_local_variable(var_name, frame_name);
 }
 
-std::vector<simgrid::mc::ActorInformation>& RemoteProcess::actors()
-{
-  this->refresh_simix();
-  return smx_actors_infos;
-}
-
 void RemoteProcess::dump_stack() const
 {
   unw_addr_space_t as = unw_create_addr_space(&_UPT_accessors, BYTE_ORDER);
index 47f6151..4dc3dfd 100644 (file)
@@ -50,16 +50,12 @@ struct IgnoredHeapRegion {
   std::size_t size;
 };
 
-/** The Application's process memory, seen from the MCer perspective
- *
- *  This class is mixing a lot of different responsibilities and is tied
- *  to SIMIX. It should probably be split into different classes.
+/** The Application's process memory, seen from the Checker perspective
  *
  *  Responsibilities:
  *
  *  - reading from the process memory (`AddressSpace`);
  *  - accessing the system state of the process (heap, …);
- *  - storing the SIMIX state of the process;
  *  - privatization;
  *  - stack unwinding;
  *  - etc.
@@ -71,12 +67,11 @@ private:
   static constexpr int cache_none            = 0;
   static constexpr int cache_heap            = 1;
   static constexpr int cache_malloc          = 2;
-  static constexpr int cache_simix_processes = 4;
 
 public:
   explicit RemoteProcess(pid_t pid);
   ~RemoteProcess() override;
-  void init(xbt_mheap_t mmalloc_default_mdp, unsigned long* maxpid, xbt_dynar_t actors);
+  void init(xbt_mheap_t mmalloc_default_mdp, unsigned long* maxpid);
 
   RemoteProcess(RemoteProcess const&) = delete;
   RemoteProcess(RemoteProcess&&)      = delete;
@@ -130,6 +125,8 @@ public:
       this->refresh_malloc_info();
     return this->heap_info.data();
   }
+  /* Get the amount of memory mallocated in the remote process (requires mmalloc) */
+  std::size_t get_remote_heap_bytes();
 
   void clear_cache() { this->cache_flags_ = RemoteProcess::cache_none; }
 
@@ -168,11 +165,8 @@ public:
 private:
   // Cache the address of the variables we read directly in the memory of remote
   RemotePtr<unsigned long> maxpid_addr_;
-  RemotePtr<s_xbt_dynar_t> actors_addr_;
 
 public:
-  std::vector<ActorInformation>& actors();
-
   unsigned long get_maxpid() const { return this->read(maxpid_addr_); }
 
   void dump_stack() const;
@@ -181,7 +175,6 @@ private:
   void init_memory_map_info();
   void refresh_heap();
   void refresh_malloc_info();
-  void refresh_simix();
 
   pid_t pid_    = -1;
   bool running_ = false;
@@ -193,13 +186,6 @@ private:
   std::vector<s_stack_region_t> stack_areas_;
   std::vector<IgnoredHeapRegion> ignored_heap_;
 
-  // Copies of MCed SMX data structures
-  /** Copy of `EngineImpl::actor_list_`
-   *
-   *  See mc_smx.cpp.
-   */
-  std::vector<ActorInformation> smx_actors_infos;
-
   /** State of the cache (which variables are up to date) */
   int cache_flags_ = RemoteProcess::cache_none;
 
@@ -218,7 +204,7 @@ public:
    *  This is not used if the process is the current one:
    *  use `get_heap_info()` in order to use it.
    */
-  std::unique_ptr<s_xbt_mheap_t> heap;
+  std::unique_ptr<s_xbt_mheap_t> heap = std::make_unique<s_xbt_mheap_t>();
 
   /** Copy of the allocation info structure
    *
index e83a281..bf08566 100644 (file)
@@ -8,12 +8,6 @@
 
 // ***** Environment variables for passing context to the model-checked process
 
-/** Environment variable name used to pass the communication socket.
- *
- * It is set by `simgrid-mc` to enable MC support in the children processes
- */
-#define MC_ENV_SOCKET_FD "SIMGRID_MC_SOCKET_FD"
-
 #ifdef __cplusplus
 
 #include "src/kernel/actor/SimcallObserver.hpp"
@@ -31,8 +25,8 @@ namespace simgrid::mc {
 
 XBT_DECLARE_ENUM_CLASS(MessageType, NONE, INITIAL_ADDRESSES, CONTINUE, IGNORE_HEAP, UNIGNORE_HEAP, IGNORE_MEMORY,
                        STACK_REGION, REGISTER_SYMBOL, DEADLOCK_CHECK, DEADLOCK_CHECK_REPLY, WAITING, SIMCALL_EXECUTE,
-                       SIMCALL_EXECUTE_ANSWER, ASSERTION_FAILED, ACTOR_ENABLED, ACTOR_ENABLED_REPLY, FINALIZE);
-
+                       SIMCALL_EXECUTE_ANSWER, ASSERTION_FAILED, ACTORS_STATUS, ACTORS_STATUS_REPLY, FINALIZE,
+                       FINALIZE_REPLY);
 } // namespace simgrid::mc
 
 constexpr unsigned MC_MESSAGE_LENGTH = 512;
@@ -63,7 +57,6 @@ struct s_mc_message_initial_addresses_t {
   simgrid::mc::MessageType type;
   xbt_mheap_t mmalloc_default_mdp;
   unsigned long* maxpid;
-  xbt_dynar_t actors;
 };
 
 struct s_mc_message_ignore_heap_t {
@@ -108,9 +101,15 @@ struct s_mc_message_restore_t {
   int index;
 };
 
-struct s_mc_message_actor_enabled_t {
+struct s_mc_message_actors_status_answer_t {
   simgrid::mc::MessageType type;
-  aid_t aid; // actor ID
+  int count;
+};
+struct s_mc_message_actors_status_one_t { // an array of `s_mc_message_actors_status_one_t[count]` is sent right after
+                                          // after a s_mc_message_actors_status_answer_t
+  aid_t aid;
+  bool enabled;
+  int max_considered;
 };
 
 #endif // __cplusplus
index 6b07c1f..b36d8cd 100644 (file)
@@ -5,7 +5,6 @@
 
 #include "src/mc/sosp/Snapshot.hpp"
 #include "src/mc/mc_config.hpp"
-#include "src/mc/mc_hash.hpp"
 
 #include <cstddef> /* std::size_t */
 
@@ -173,40 +172,36 @@ void Snapshot::snapshot_stacks(RemoteProcess* process)
   }
 }
 
-static void snapshot_handle_ignore(Snapshot* snapshot)
+void Snapshot::handle_ignore()
 {
-  xbt_assert(snapshot->get_remote_process());
+  xbt_assert(get_remote_process());
 
   // Copy the memory:
-  for (auto const& region : snapshot->get_remote_process()->ignored_regions()) {
+  for (auto const& region : get_remote_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->get_remote_process()->read_bytes(ignored_data.data.data(), region.size, remote(region.addr));
-    snapshot->ignored_data_.push_back(std::move(ignored_data));
+    get_remote_process()->read_bytes(ignored_data.data.data(), region.size, remote(region.addr));
+    ignored_data_.push_back(std::move(ignored_data));
   }
 
   // Zero the memory:
-  for (auto const& region : snapshot->get_remote_process()->ignored_regions())
-    snapshot->get_remote_process()->clear_bytes(remote(region.addr), region.size);
+  for (auto const& region : get_remote_process()->ignored_regions())
+    get_remote_process()->clear_bytes(remote(region.addr), region.size);
 }
 
-static void snapshot_ignore_restore(const simgrid::mc::Snapshot* snapshot)
+void Snapshot::ignore_restore() const
 {
-  for (auto const& ignored_data : snapshot->ignored_data_)
-    snapshot->get_remote_process()->write_bytes(ignored_data.data.data(), ignored_data.data.size(),
-                                                remote(ignored_data.start));
+  for (auto const& ignored_data : ignored_data_)
+    get_remote_process()->write_bytes(ignored_data.data.data(), ignored_data.data.size(), remote(ignored_data.start));
 }
 
 Snapshot::Snapshot(long num_state, RemoteProcess* process) : AddressSpace(process), num_state_(num_state)
 {
   XBT_DEBUG("Taking snapshot %ld", num_state);
 
-  for (auto const& p : process->actors())
-    enabled_processes_.insert(p.copy.get_buffer()->get_pid());
-
-  snapshot_handle_ignore(this);
+  handle_ignore();
 
   /* Save the std heap and the writable mapped pages of libsimgrid and binary */
   snapshot_regions(process);
@@ -215,10 +210,10 @@ Snapshot::Snapshot(long num_state, RemoteProcess* process) : AddressSpace(proces
 
   if (_sg_mc_max_visited_states > 0 || not _sg_mc_property_file.get().empty()) {
     snapshot_stacks(process);
-    hash_ = simgrid::mc::hash(*this);
+    hash_ = this->do_hash();
   }
 
-  snapshot_ignore_restore(this);
+  ignore_restore();
 }
 
 void Snapshot::add_region(RegionType type, ObjectInformation* object_info, void* start_addr, std::size_t size)
@@ -284,8 +279,30 @@ void Snapshot::restore(RemoteProcess* process) const
       region.get()->restore();
   }
 
-  snapshot_ignore_restore(this);
+  ignore_restore();
   process->clear_cache();
 }
 
+/* ----------- Hashing logic -------------- */
+class djb_hash {
+  hash_type state_ = 5381LL;
+
+public:
+  template <class T> void update(T& x) { state_ = (state_ << 5) + state_ + x; }
+  hash_type value() const { return state_; }
+};
+hash_type Snapshot::do_hash() const
+{
+  XBT_DEBUG("START hash %ld", num_state_);
+  djb_hash hash;
+  // TODO:
+  // * nb_processes
+  // * heap_bytes_used
+  // * root variables
+  // * basic stack frame information
+  // * stack frame local variables
+  XBT_DEBUG("END hash %ld", num_state_);
+  return hash.value();
+}
+
 } // namespace simgrid::mc
index 412c7b9..90af292 100644 (file)
@@ -15,9 +15,8 @@
 
 /** Ignored data
  *
- *  Some parts of the snapshot are ignored by zeroing them out: the real
- *  values is stored here.
- * */
+ *  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;
@@ -56,6 +55,8 @@ using const_mc_snapshot_stack_t = const s_mc_snapshot_stack_t*;
 
 namespace simgrid::mc {
 
+using hash_type = std::uint64_t;
+
 class XBT_PRIVATE Snapshot final : public AddressSpace {
 public:
   /* Initialization */
@@ -74,11 +75,13 @@ public:
   Region* get_region(const void* addr, Region* hinted_region) const;
   void restore(RemoteProcess* process) const;
 
+  bool operator==(const Snapshot& other);
+  bool operator!=(const Snapshot& other) { return not(*this == other); }
+
   // To be private
   long num_state_;
   std::size_t heap_bytes_used_ = 0;
   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_;
@@ -89,6 +92,9 @@ private:
   void add_region(RegionType type, ObjectInformation* object_info, void* start_addr, std::size_t size);
   void snapshot_regions(RemoteProcess* process);
   void snapshot_stacks(RemoteProcess* process);
+  void handle_ignore();
+  void ignore_restore() const;
+  hash_type do_hash() const;
 };
 } // namespace simgrid::mc
 
index 3d9bb72..01081e3 100644 (file)
@@ -58,7 +58,7 @@ void snap_test_helper::Init()
   REQUIRE(1 << xbt_pagebits == xbt_pagesize);
 
   process = std::make_unique<simgrid::mc::RemoteProcess>(getpid());
-  process->init(nullptr, nullptr, nullptr);
+  process->init(nullptr, nullptr);
   mc_model_checker = new ::simgrid::mc::ModelChecker(std::move(process), -1);
 }
 
index d590c5f..9de469b 100644 (file)
@@ -8,7 +8,7 @@
 #include <simgrid/config.h>
 #if SIMGRID_HAVE_MC
 #include "src/mc/ModelChecker.hpp"
-#include "src/mc/Session.hpp"
+#include "src/mc/api/RemoteApp.hpp"
 #include "src/mc/api/State.hpp"
 #endif
 
index 916dd8b..0d48bcf 100644 (file)
@@ -8,7 +8,7 @@
 #include <simgrid/config.h>
 #if SIMGRID_HAVE_MC
 #include "src/mc/ModelChecker.hpp"
-#include "src/mc/Session.hpp"
+#include "src/mc/api/RemoteApp.hpp"
 #include "src/mc/api/State.hpp"
 #endif
 
index e5d0a7a..5a8a1e6 100644 (file)
@@ -9,6 +9,7 @@
 #include "src/kernel/actor/SimcallObserver.hpp"
 #include "src/mc/transition/Transition.hpp"
 
+#include <cstdint>
 #include <sstream>
 #include <string>
 
index 9f53a3a..6a4d51e 100644 (file)
@@ -8,6 +8,8 @@
 
 #include "src/mc/transition/Transition.hpp"
 
+#include <cstdint>
+
 namespace simgrid::mc {
 
 class BarrierTransition : public Transition {
index da2ee32..a2f21f9 100644 (file)
@@ -18,60 +18,60 @@ static simgrid::config::Flag<bool> cfg_tell{"cmonkey/tell", "Request the Chaos M
 static simgrid::config::Flag<double> cfg_time{"cmonkey/time", "When should the chaos monkey kill a resource", -1.};
 static simgrid::config::Flag<int> cfg_link{"cmonkey/link", "Which link should be killed (number)", -1};
 static simgrid::config::Flag<int> cfg_host{"cmonkey/host", "Which host should be killed (number)", -1};
-static void sg_chaos_monkey_plugin_init();
-// Makes sure that this plugin can be activated from the command line with ``--cfg=plugin:chaos_monkey``
-SIMGRID_REGISTER_PLUGIN(cmonkey, "Chaos monkey", &sg_chaos_monkey_plugin_init)
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(cmonkey, kernel, "Chaos Monkey plugin");
 
-static void sg_chaos_monkey_plugin_init()
+static void sg_chaos_monkey_plugin_run()
 {
-  XBT_INFO("Initializing the chaos monkey");
+  auto engine = sg4::Engine::get_instance();
+  auto hosts  = engine->get_all_hosts();
+  auto links  = engine->get_all_links();
 
-  // delay the initialization until after the parameter are parsed
-  sg4::Engine::on_simulation_start_cb([]() {
-    auto engine = sg4::Engine::get_instance();
-    auto hosts  = engine->get_all_hosts();
-    auto links  = engine->get_all_links();
+  sg4::Engine::on_deadlock_cb([]() { exit(2); });
 
-    sg4::Engine::on_deadlock_cb([]() { exit(2); });
+  if (cfg_tell) {
+    XBT_INFO("HOST_COUNT=%zu", hosts.size());
+    XBT_INFO("LINK_COUNT=%zu", links.size());
+    sg4::Engine::on_time_advance_cb([engine](double /* delta*/) { XBT_INFO("TIMESTAMP=%lf", engine->get_clock()); });
+  }
 
-    if (cfg_tell) {
-      XBT_INFO("HOST_COUNT=%zu", hosts.size());
-      XBT_INFO("LINK_COUNT=%zu", links.size());
-      sg4::Engine::on_time_advance_cb([engine](double /* delta*/) { XBT_INFO("TIMESTAMP=%lf", engine->get_clock()); });
+  if (cfg_time >= 0) {
+    int host = cfg_host;
+    int link = cfg_link;
+    xbt_assert(host >= 0 || link >= 0,
+               "If a kill time is given, you must also specify a resource to kill (either a link or an host)");
+    xbt_assert(host < 0 || link < 0, "Cannot specify both a link and an host to kill");
+    if (host >= 0) {
+      auto* h = hosts[host];
+      simgrid::kernel::timer::Timer::set(cfg_time, [h]() {
+        XBT_INFO("Kill host %s", h->get_cname());
+        h->turn_off();
+      });
+      simgrid::kernel::timer::Timer::set(cfg_time + 30, [h]() {
+        XBT_INFO("Restart host %s", h->get_cname());
+        h->turn_on();
+      });
     }
-
-    if (cfg_time >= 0) {
-      int host = cfg_host;
-      int link = cfg_link;
-      xbt_assert(host >= 0 || link >= 0,
-                 "If a kill time is given, you must also specify a resource to kill (either a link or an host)");
-      xbt_assert(host < 0 || link < 0, "Cannot specify both a link and an host to kill");
-      if (host >= 0) {
-        auto* h = hosts[host];
-        simgrid::kernel::timer::Timer::set(cfg_time, [h]() {
-          XBT_INFO("Kill host %s", h->get_cname());
-          h->turn_off();
-        });
-        simgrid::kernel::timer::Timer::set(cfg_time + 30, [h]() {
-          XBT_INFO("Restart host %s", h->get_cname());
-          h->turn_on();
-        });
-      }
-      if (link >= 0) {
-        auto* l = links[link];
-        simgrid::kernel::timer::Timer::set(cfg_time, [l]() {
-          XBT_INFO("Kill link %s", l->get_cname());
-          l->turn_off();
-        });
-        simgrid::kernel::timer::Timer::set(cfg_time + 30, [l]() {
-          XBT_INFO("Restart host %s", l->get_cname());
-          l->turn_on();
-        });
-      }
+    if (link >= 0) {
+      auto* l = links[link];
+      simgrid::kernel::timer::Timer::set(cfg_time, [l]() {
+        XBT_INFO("Kill link %s", l->get_cname());
+        l->turn_off();
+      });
+      simgrid::kernel::timer::Timer::set(cfg_time + 30, [l]() {
+        XBT_INFO("Restart host %s", l->get_cname());
+        l->turn_on();
+      });
     }
+  }
 
-    sg4::Engine::on_simulation_end_cb([]() { XBT_INFO("Chaos Monkey done!"); });
-  });
+  sg4::Engine::on_simulation_end_cb([]() { XBT_INFO("Chaos Monkey done!"); });
 }
+
+// Makes sure that this plugin can be activated from the command line with ``--cfg=plugin:chaos_monkey``
+SIMGRID_REGISTER_PLUGIN(cmonkey, "Chaos monkey", []() {
+  XBT_INFO("Initializing the chaos monkey");
+
+  // delay the initialization until after the parameter are parsed
+  sg4::Engine::on_simulation_start_cb(sg_chaos_monkey_plugin_run);
+})
index 20e5c27..1a7cccc 100644 (file)
@@ -86,7 +86,6 @@ File::File(const std::string& fullpath, const_sg_host_t host, void* userdata) :
     desc_id = ext->file_descriptor_table->back();
     ext->file_descriptor_table->pop_back();
 
-    XBT_DEBUG("\tOpen file '%s'", path_.c_str());
     std::map<std::string, sg_size_t, std::less<>>* content = nullptr;
     content = local_disk_->extension<FileSystemDiskExt>()->get_content();
 
@@ -95,6 +94,7 @@ File::File(const std::string& fullpath, const_sg_host_t host, void* userdata) :
       auto sz = content->find(path_);
       if (sz != content->end()) {
         size_ = sz->second;
+       XBT_DEBUG("\tOpen file '%s', size %llu", path_.c_str(), size_);
       } else {
         size_ = 0;
         content->insert({path_, size_});
@@ -186,25 +186,11 @@ sg_size_t File::write(sg_size_t size, bool write_inside)
   // If the disk is full before even starting to write
   if (sg_disk_get_size_used(local_disk_) >= sg_disk_get_size(local_disk_))
     return 0;
-  if (not write_inside) {
+  if (not write_inside)
     /* Subtract 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_;
-  }
-  kernel::actor::simcall_answered([this] {
-    std::map<std::string, sg_size_t, std::less<>>* content = local_disk_->extension<FileSystemDiskExt>()->get_content();
-
-    content->erase(path_);
-    content->insert({path_, size_});
-  });
+  write_size = local_disk_->write(size);
+  update_position(current_position_ + write_size);
 
   return write_size;
 }
@@ -223,19 +209,36 @@ void File::seek(sg_offset_t offset, int origin)
 {
   switch (origin) {
     case SEEK_SET:
-      current_position_ = offset;
-      break;
+      update_position(offset);
+     break;
     case SEEK_CUR:
-      current_position_ += offset;
+      update_position(current_position_ + offset);
       break;
     case SEEK_END:
-      current_position_ = size_ + offset;
+      update_position(size_ + offset);
       break;
     default:
       break;
   }
 }
 
+void File::update_position(sg_offset_t position)
+{
+  xbt_assert(position >= 0, "Error in seek, cannot seek before file %s", get_path());
+  current_position_ = position;
+  if(current_position_>size_){
+    XBT_DEBUG("Updating size of file %s from %llu to %lld", path_.c_str(), size_, position);
+    local_disk_->extension<FileSystemDiskExt>()->incr_used_size(current_position_-size_);
+    size_ = current_position_;
+
+    kernel::actor::simcall_answered([this] {
+    std::map<std::string, sg_size_t, std::less<>>* content = local_disk_->extension<FileSystemDiskExt>()->get_content();
+    content->erase(path_);
+    content->insert({path_, size_});
+  });
+  }
+}
+
 sg_size_t File::tell() const
 {
   return current_position_;
@@ -274,10 +277,9 @@ int File::unlink() const
     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(), name);
+    XBT_DEBUG("UNLINK %s of size %llu on disk '%s'", path_.c_str(), size_, name);
 
     local_disk_->extension<FileSystemDiskExt>()->decr_used_size(size_);
-
     // Remove the file from storage
     content->erase(path_);
 
@@ -416,28 +418,28 @@ 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");
-
-      const 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());
-    }
+    if (not remote_disk_str)
+      continue;
+    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");
+
+    const 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());
   }
 }
 
index 27c0cf2..56ebcbb 100644 (file)
@@ -66,7 +66,7 @@ public:
 
 xbt::Extension<s4u::Link, LinkLoad> LinkLoad::EXTENSION_ID;
 
-LinkLoad::LinkLoad(s4u::Link* ptr) : link_(ptr), is_tracked_(false)
+LinkLoad::LinkLoad(s4u::Link* ptr) : link_(ptr)
 {
   XBT_DEBUG("Instantiating a LinkLoad for link '%s'", link_->get_cname());
 }
index d1fe6f6..2ab9660 100644 (file)
@@ -81,8 +81,8 @@ void Comm::send(kernel::actor::ActorImpl* sender, const Mailbox* mbox, double ta
     comm = simgrid::kernel::actor::simcall_answered(
         [&send_observer] { return simgrid::kernel::activity::CommImpl::isend(&send_observer); }, &send_observer);
 
-    simgrid::kernel::actor::ActivityWaitSimcall wait_observer{sender, comm.get(), timeout};
-    if (simgrid::kernel::actor::simcall_blocking(
+    if (simgrid::kernel::actor::ActivityWaitSimcall wait_observer{sender, comm.get(), timeout};
+        simgrid::kernel::actor::simcall_blocking(
             [&wait_observer] {
               wait_observer.get_activity()->wait_for(wait_observer.get_issuer(), wait_observer.get_timeout());
             },
@@ -124,8 +124,8 @@ void Comm::recv(kernel::actor::ActorImpl* receiver, const Mailbox* mbox, void* d
     comm = simgrid::kernel::actor::simcall_answered(
         [&observer] { return simgrid::kernel::activity::CommImpl::irecv(&observer); }, &observer);
 
-    simgrid::kernel::actor::ActivityWaitSimcall wait_observer{receiver, comm.get(), timeout};
-    if (simgrid::kernel::actor::simcall_blocking(
+    if (simgrid::kernel::actor::ActivityWaitSimcall wait_observer{receiver, comm.get(), timeout};
+        simgrid::kernel::actor::simcall_blocking(
             [&wait_observer] {
               wait_observer.get_activity()->wait_for(wait_observer.get_issuer(), wait_observer.get_timeout());
             },
@@ -272,7 +272,7 @@ CommPtr Comm::set_dst_data(void** buff, size_t size)
 
 CommPtr Comm::set_payload_size(uint64_t bytes)
 {
-  Activity::set_remaining(bytes);
+  set_remaining(bytes);
   if (pimpl_) {
     boost::static_pointer_cast<kernel::activity::CommImpl>(pimpl_)->set_size(bytes);
   }
index b768ab4..8da467d 100644 (file)
@@ -9,9 +9,6 @@
 #include <simgrid/modelchecker.h>
 #include <simgrid/s4u/Engine.hpp>
 
-#define SIMIX_H_NO_DEPRECATED_WARNING // avoid deprecation warning on include (remove with XBT_ATTRIB_DEPRECATED_v333)
-#include <simgrid/simix.h>
-
 #include "mc/mc.h"
 #include "src/instr/instr_private.hpp"
 #include "src/kernel/EngineImpl.hpp"
@@ -504,7 +501,3 @@ void simgrid_set_maestro(void (*code)(void*), void* data)
 #endif
   maestro_code = std::bind(code, data);
 }
-void SIMIX_set_maestro(void (*code)(void*), void* data) // XBT_ATTRIB_DEPRECATED_v333
-{
-  simgrid_set_maestro(code, data);
-}
index 259ed33..286340f 100644 (file)
@@ -110,7 +110,7 @@ ExecPtr Exec::set_flops_amount(double flops_amount)
   kernel::actor::simcall_answered([this, flops_amount] {
     boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->set_flops_amount(flops_amount);
   });
-  Activity::set_remaining(flops_amount);
+  set_remaining(flops_amount);
   return this;
 }
 
@@ -158,6 +158,11 @@ unsigned int Exec::get_host_number() const
   return static_cast<kernel::activity::ExecImpl*>(pimpl_.get())->get_host_number();
 }
 
+int Exec::get_thread_count() const
+{
+  return static_cast<kernel::activity::ExecImpl*>(pimpl_.get())->get_thread_count();
+}
+
 /** @brief Change the host on which this activity takes place.
  *
  * The activity cannot be terminated already (but it may be started). */
index 742cd13..35357f8 100644 (file)
@@ -373,6 +373,12 @@ VirtualMachine* Host::create_vm(const std::string& name, int core_amount, size_t
       [this, &name, core_amount, ramsize] { return this->pimpl_->create_vm(name, core_amount, ramsize); });
 }
 
+VirtualMachine* Host::vm_by_name_or_null(const std::string& name)
+{
+  simgrid::kernel::resource::VirtualMachineImpl* vm = this->pimpl_->get_vm_by_name_or_null(name);
+  return vm ? vm->get_iface() : nullptr;
+}
+
 ExecPtr Host::exec_init(double flops) const
 {
   return this_actor::exec_init(flops);
@@ -442,6 +448,12 @@ sg_host_t sg_host_by_name(const char* name)
   return simgrid::s4u::Host::by_name_or_null(name);
 }
 
+/** @brief Retrieve a VM running on a given host from its name, or return NULL if no VM matches*/
+sg_vm_t sg_vm_by_name(sg_host_t host, const char* name)
+{
+  return host->vm_by_name_or_null(name);
+}
+
 // ========= Layering madness ==============*
 
 // ========== User data Layer ==========
index 7132643..906b0be 100644 (file)
@@ -75,7 +75,7 @@ IoPtr Io::set_size(sg_size_t size)
   xbt_assert(state_ == State::INITED || state_ == State::STARTING, "Cannot set size once the Io is started");
   kernel::actor::simcall_answered(
       [this, size] { boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->set_size(size); });
-  Activity::set_remaining(size);
+  set_remaining(size);
   return this;
 }
 
index 146c978..89781bd 100644 (file)
@@ -22,6 +22,7 @@ VmFailureException::~VmFailureException()           = default;
 CancelException::~CancelException()                 = default;
 TracingError::~TracingError()                       = default;
 ParseError::~ParseError()                           = default;
+AssertionError::~AssertionError()                   = default;
 ForcefulKillException::~ForcefulKillException()     = default;
 
 void ForcefulKillException::do_throw()
index e60efa3..415f267 100644 (file)
@@ -10,6 +10,7 @@
 #include <xbt/config.hpp>
 
 #include "simgrid/sg_config.hpp"
+#include "src/include/xbt/mmalloc.h"
 #include "src/instr/instr_private.hpp"
 #include "src/internal_config.h"
 #include "src/kernel/context/Context.hpp"
@@ -327,9 +328,17 @@ void sg_config_init(int *argc, char **argv)
   static simgrid::config::Flag<int> cfg_context_guard_size{
       "contexts/guard-size", "Guard size for contexts stacks in memory pages", default_guard_size,
       [](int value) { simgrid::kernel::context::guard_size = value * xbt_pagesize; }};
-  static simgrid::config::Flag<int> cfg_context_nthreads{"contexts/nthreads",
-                                                         "Number of parallel threads used to execute user contexts", 1,
-                                                         &simgrid::kernel::context::set_nthreads};
+
+  static simgrid::config::Flag<int> cfg_context_nthreads{
+      "contexts/nthreads", "Number of parallel threads used to execute user contexts", 1, [](int nthreads) {
+#if HAVE_MMALLOC
+        xbt_assert(
+            nthreads == 1 || not malloc_use_mmalloc(),
+            "Parallel simulation is forbidden in the verified program, as there is no protection against race "
+            "conditions in mmalloc itself. Please don't be so greedy and show some mercy for our implementation.");
+#endif
+        simgrid::kernel::context::set_nthreads(nthreads);
+      }};
 
   /* synchronization mode for parallel user contexts */
 #if HAVE_FUTEX_H
diff --git a/src/simix/smx_context.cpp b/src/simix/smx_context.cpp
deleted file mode 100644 (file)
index 86e1d7d..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/* a fast and simple context switching library                              */
-
-/* Copyright (c) 2009-2022. The SimGrid Team. All rights reserved.          */
-
-/* This program is 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/context/Context.hpp"
-
-#define SIMIX_H_NO_DEPRECATED_WARNING // avoid deprecation warning on include (remove with XBT_ATTRIB_DEPRECATED_v333)
-#include <simgrid/simix.h>
-
-int SIMIX_context_is_parallel() // XBT_ATTRIB_DEPRECATED_v333
-{
-  return simgrid::kernel::context::is_parallel();
-}
-
-int SIMIX_context_get_nthreads() // XBT_ATTRIB_DEPRECATED_v333
-{
-  return simgrid::kernel::context::get_nthreads();
-}
-
-void SIMIX_context_set_nthreads(int nb_threads) // XBT_ATTRIB_DEPRECATED_v333
-{
-  simgrid::kernel::context::set_nthreads(nb_threads);
-}
-
-e_xbt_parmap_mode_t SIMIX_context_get_parallel_mode() // XBT_ATTRIB_DEPRECATED_v333
-{
-  return simgrid::kernel::context::get_parallel_mode();
-}
-
-void SIMIX_context_set_parallel_mode(e_xbt_parmap_mode_t mode) // XBT_ATTRIB_DEPRECATED_v333
-{
-  simgrid::kernel::context::set_parallel_mode(mode);
-}
index 7a2578a..0cd9600 100644 (file)
@@ -568,10 +568,8 @@ void mpi_op_commutative_(int* op, int* commute, int* ierr)
 
 void mpi_group_free_(int* group, int* ierr)
 {
-  if (MPI_Group tmp = simgrid::smpi::Group::f2c(*group); tmp != MPI_COMM_WORLD->group() && tmp != MPI_GROUP_EMPTY) {
-    simgrid::smpi::Group::unref(tmp);
-  }
-  *ierr = MPI_SUCCESS;
+  MPI_Group tmp = simgrid::smpi::Group::f2c(*group);
+  *ierr         = MPI_Group_free(&tmp);
 }
 
 void mpi_group_size_(int* group, int* size, int* ierr)
index 0144bc6..5db772d 100644 (file)
@@ -395,6 +395,10 @@ WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_set_errhandler,( MPI_File fh, MP
 WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_get_errhandler,( MPI_File fh, MPI_Errhandler *errhandler), (fh, errhandler))
 WRAPPED_PMPI_CALL_ERRHANDLER_FILE(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))
 WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_get_view,(MPI_File fh, MPI_Offset *disp, MPI_Datatype *etype, MPI_Datatype *filetype, char *datarep), (fh, disp, etype, filetype, datarep))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_get_type_extent,(MPI_File fh, MPI_Datatype datatype, MPI_Aint *extent), (fh, datatype, extent))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_set_atomicity,(MPI_File fh, int flag), (fh, flag))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_get_atomicity,(MPI_File fh, int *flag), (fh, flag))
+WRAPPED_PMPI_CALL_ERRHANDLER_FILE(int, MPI_File_get_byte_offset,(MPI_File fh, MPI_Offset offset, MPI_Offset *disp), (fh, offset, disp))
 /*
   Unimplemented Calls - both PMPI and MPI calls are generated.
   When implementing, please move ahead, swap UNIMPLEMENTED_WRAPPED_PMPI_CALL for WRAPPED_PMPI_CALL,
@@ -433,7 +437,6 @@ UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_iread,(MPI_File fh, void *buf, int
 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, 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_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, 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))
@@ -448,9 +451,6 @@ UNIMPLEMENTED_WRAPPED_PMPI_CALL(int, MPI_File_read_ordered_begin,(MPI_File fh, v
 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, 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_Get_elements,(MPI_Status* status, MPI_Datatype datatype, int* elements) ,(status, datatype, elements))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Get_elements_x,(MPI_Status* status, MPI_Datatype datatype, MPI_Count* elements) ,(status, datatype, elements))
 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))
index e87680f..e8dfd51 100644 (file)
@@ -65,7 +65,7 @@ int PMPI_File_close(MPI_File *fh){
 int PMPI_File_seek(MPI_File fh, MPI_Offset offset, int whence){
   CHECK_FILE(1, fh)
   const SmpiBenchGuard suspend_bench;
-  int ret = fh->seek(offset,whence);
+  int ret = fh->seek(offset*fh->etype()->get_extent(),whence);
   return ret;
 }
 
@@ -73,7 +73,7 @@ int PMPI_File_seek_shared(MPI_File fh, MPI_Offset offset, int whence){
   CHECK_FILE(1, fh)
   CHECK_COLLECTIVE(fh->comm(), __func__)
   const SmpiBenchGuard suspend_bench;
-  int ret = fh->seek_shared(offset,whence);
+  int ret = fh->seek_shared(offset*fh->etype()->get_extent(),whence);
   return ret;
 }
 
@@ -200,9 +200,12 @@ int PMPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count,MPI_D
   const SmpiBenchGuard suspend_bench;
   aid_t rank_traced = simgrid::s4u::this_actor::get_pid();
   TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - read", count * datatype->size()));
+  MPI_Offset prev;
+  fh->get_position(&prev);
   int ret = fh->seek(offset,MPI_SEEK_SET);
   if (ret == MPI_SUCCESS)
     ret = simgrid::smpi::File::read(fh, buf, count, datatype, status);
+  fh->seek(prev,MPI_SEEK_SET);
   TRACE_smpi_comm_out(rank_traced);
   return ret;
 }
@@ -215,9 +218,12 @@ int PMPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count,M
   aid_t 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()));
+  MPI_Offset prev;
+  fh->get_position(&prev);
   int ret = fh->seek(offset,MPI_SEEK_SET);
   if (ret == MPI_SUCCESS)
     ret = fh->op_all<simgrid::smpi::File::read>(buf, count, datatype, status);
+  fh->seek(prev,MPI_SEEK_SET);
   TRACE_smpi_comm_out(rank_traced);
   return ret;
 }
@@ -229,9 +235,12 @@ int PMPI_File_write_at(MPI_File fh, MPI_Offset offset, const void *buf, int coun
   const SmpiBenchGuard suspend_bench;
   aid_t rank_traced = simgrid::s4u::this_actor::get_pid();
   TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("IO - write", count * datatype->size()));
+  MPI_Offset prev;
+  fh->get_position(&prev);
   int ret = fh->seek(offset,MPI_SEEK_SET);
   if (ret == MPI_SUCCESS)
     ret = simgrid::smpi::File::write(fh, const_cast<void*>(buf), count, datatype, status);
+  fh->seek(prev,MPI_SEEK_SET);
   TRACE_smpi_comm_out(rank_traced);
   return ret;
 }
@@ -244,16 +253,18 @@ int PMPI_File_write_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int
   aid_t 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()));
+  MPI_Offset prev;
+  fh->get_position(&prev);
   int ret = fh->seek(offset,MPI_SEEK_SET);
   if (ret == MPI_SUCCESS)
     ret = fh->op_all<simgrid::smpi::File::write>(const_cast<void*>(buf), count, datatype, status);
+  fh->seek(prev,MPI_SEEK_SET);
   TRACE_smpi_comm_out(rank_traced);
   return ret;
 }
 
 int PMPI_File_delete(const char *filename, MPI_Info info){
-  if (filename == nullptr)
-    return MPI_ERR_FILE;
+  CHECK_NULL(1, MPI_ERR_FILE, filename)
   const SmpiBenchGuard suspend_bench;
   int ret = simgrid::smpi::File::del(filename, info);
   return ret;
@@ -359,11 +370,37 @@ int PMPI_File_set_errhandler(MPI_File file, MPI_Errhandler errhandler){
 }
 
 int PMPI_File_call_errhandler(MPI_File file,int errorcode){
-  if (file == nullptr) {
-    return MPI_ERR_WIN;
-  }
+  CHECK_FILE(1, file)
   MPI_Errhandler err = file->errhandler();
   err->call(file, errorcode);
   simgrid::smpi::Errhandler::unref(err);
   return MPI_SUCCESS;
 }
+
+int PMPI_File_get_type_extent(MPI_File fh, MPI_Datatype
+    datatype, MPI_Aint *extent){
+  CHECK_FILE(1, fh)
+  CHECK_TYPE(2, datatype)
+  CHECK_NULL(3, MPI_ERR_OTHER, extent)
+  *extent = datatype->get_extent();
+  return MPI_SUCCESS;
+}
+
+int PMPI_File_set_atomicity(MPI_File fh, int a){
+  CHECK_FILE(1, fh)
+  fh->set_atomicity(a != 0);
+  return MPI_SUCCESS;
+}
+
+int PMPI_File_get_atomicity(MPI_File fh, int* a){
+  CHECK_FILE(1, fh)
+  *a = fh->get_atomicity();
+  return MPI_SUCCESS;
+}
+
+int PMPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, MPI_Offset *disp){
+  CHECK_FILE(1, fh)
+  CHECK_NULL(3, MPI_ERR_OTHER, disp)
+  *disp = offset * fh->etype()->get_extent();
+  return MPI_SUCCESS;
+}
index 96bb98b..51f955a 100644 (file)
@@ -437,7 +437,10 @@ int PMPI_Sendrecv_replace(void* buf, int count, MPI_Datatype datatype, int dst,
   CHECK_BUFFER(1, buf, count, datatype)
 
   int size = datatype->get_extent() * count;
-  xbt_assert(size > 0);
+  if (size == 0)
+    return MPI_SUCCESS;
+  else if (size <0)
+    return MPI_ERR_ARG;
   std::vector<char> recvbuf(size);
   retval =
       MPI_Sendrecv(buf, count, datatype, dst, sendtag, recvbuf.data(), count, datatype, src, recvtag, comm, status);
index cd03d88..cf83622 100644 (file)
@@ -107,7 +107,9 @@ int PMPI_Win_free( MPI_Win* win){
     return MPI_ERR_WIN;
   }
   const SmpiBenchGuard suspend_bench;
-  return simgrid::smpi::Win::del(*win);
+  simgrid::smpi::Win::del(*win);
+  *win = MPI_WIN_NULL;
+  return MPI_SUCCESS;
 }
 
 int PMPI_Win_set_name(MPI_Win  win, const char * name)
index 87cfe01..f92ea49 100644 (file)
@@ -95,7 +95,6 @@ XBT_PRIVATE void smpi_cleanup_op_cost_callback();
 XBT_PRIVATE void smpi_comm_null_copy_buffer_callback(simgrid::kernel::activity::CommImpl* comm, void* buff,
                                                      size_t buff_size);
 
-XBT_PRIVATE int smpi_enabled();
 XBT_PRIVATE double smpi_mpi_wtime();
 XBT_PRIVATE void smpi_mpi_init();
 
index b79164b..60ab2fd 100644 (file)
@@ -14,7 +14,7 @@
 #include "smpi_info.hpp"
 #include  <algorithm>
 
-XBT_LOG_EXTERNAL_CATEGORY(smpi_pmpi);
+XBT_LOG_EXTERNAL_CATEGORY(smpi_io);
 
 namespace simgrid::smpi {
 class File : public F2C{
@@ -30,6 +30,8 @@ class File : public F2C{
   MPI_Datatype etype_;
   MPI_Datatype filetype_;
   std::string datarep_;
+  MPI_Offset disp_;
+  bool atomicity_;
 
   public:
   File(MPI_Comm comm, const char *filename, int amode, MPI_Info info);
@@ -40,6 +42,7 @@ class File : public F2C{
   int get_position(MPI_Offset* offset) const;
   int get_position_shared(MPI_Offset* offset) const;
   int flags() const;
+  MPI_Datatype etype() const;
   MPI_Comm comm() const;
   std::string name() const override {return file_ ? std::string("MPI_File: ")+ std::string(file_->get_path()): std::string("MPI_File");}
 
@@ -63,6 +66,8 @@ class File : public F2C{
   static int del(const char* filename, const Info* info);
   MPI_Errhandler errhandler();
   void set_errhandler( MPI_Errhandler errhandler);
+  void set_atomicity(bool a);
+  bool get_atomicity() const;
   static File* f2c(int id);
 };
 
@@ -102,24 +107,27 @@ int File::op_all(void* buf, int count, const Datatype* datatype, MPI_Status* sta
       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,
+  XBT_CDEBUG(smpi_io, "my offsets to read : %lld:%lld, global min and max %lld:%lld", min_offset, max_offset, min,
              max);
   if (empty == 1) {
     if (status != MPI_STATUS_IGNORE)
       status->count = 0;
     return MPI_SUCCESS;
   }
-  if (max - min == tot && (datatype->flags() & DT_FLAG_CONTIGUOUS)) {
+  XBT_CDEBUG(smpi_io, "min:max : %lld:%lld, tot %lld contig %u", min, max, tot, (datatype->flags() & DT_FLAG_CONTIGUOUS));
+  if ( size==1 || (max - min == tot && (datatype->flags() & DT_FLAG_CONTIGUOUS))) {
     // contiguous. Just have each proc perform its read
     if (status != MPI_STATUS_IGNORE)
       status->count = count * datatype->size();
-    return T(this, buf, count, datatype, status);
+    int ret = T(this, buf, count, datatype, status);
+    seek(max_offset, MPI_SEEK_SET);
+    return ret;
   }
 
   // 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);
+  MPI_Offset my_chunk_start = min + (max - min + 1) / size * rank;
+  MPI_Offset my_chunk_end   = min + ((max - min + 1) / size * (rank + 1)) +1;
+  XBT_CDEBUG(smpi_io, "my chunks to read : %lld:%lld", my_chunk_start, my_chunk_end);
   std::vector<int> send_sizes(size);
   std::vector<int> recv_sizes(size);
   std::vector<int> send_disps(size);
@@ -130,11 +138,14 @@ int File::op_all(void* buf, int count, const Datatype* datatype, MPI_Status* sta
     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));
+      send_sizes[i] = (std::min(max_offsets[i], my_chunk_end) - std::max(min_offsets[i], my_chunk_start));
+      //we want to send only useful data, so let's pretend we pack it
+      send_sizes[i]=send_sizes[i]/datatype->get_extent()*datatype->size();
       // store min and max offset 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);
+      XBT_CDEBUG(smpi_io, "will have to send %d bytes to %d", send_sizes[i], i);
     }
   }
   min_offset = std::max(min_offset, my_chunk_start);
@@ -169,15 +180,16 @@ int File::op_all(void* buf, int count, const Datatype* datatype, MPI_Status* sta
     else if (chunk_start > my_chunk_end)
       continue;
     else
-      totreads += (std::min(chunk_end, my_chunk_end - 1) - std::max(chunk_start, my_chunk_start));
+      totreads += (std::min(chunk_end, my_chunk_end) - std::max(chunk_start, my_chunk_start));
   }
-  XBT_CDEBUG(smpi_pmpi, "will have to access %lld from my chunk", totreads);
+  XBT_CDEBUG(smpi_io, "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);
+    T(this, sendbuf, totreads / datatype->get_extent(), datatype, status);
+    seek(max_offset, MPI_SEEK_SET);
   }
   simgrid::smpi::colls::alltoall(send_sizes.data(), 1, MPI_INT, recv_sizes.data(), 1, MPI_INT, comm_);
   int total_recv = 0;
index 1f00a19..d831ae9 100644 (file)
@@ -58,11 +58,11 @@ public:
   void parse(xbt::ReplayAction& action, const std::string& name) override;
 };
 
-class SendRecvParser : public ActionArgParser {
+class SendOrRecvParser : public ActionArgParser {
 public:
   /* communication partner; if we send, this is the receiver and vice versa */
   int partner;
-  size_t size;
+  ssize_t size;
   int tag;
   MPI_Datatype datatype1;
 
@@ -103,6 +103,18 @@ public:
   MPI_Datatype datatype2;
 };
 
+class SendRecvParser : public ActionArgParser {
+public:
+  int dst;
+  int src;
+  int sendcount;
+  int recvcount;
+  MPI_Datatype datatype1;
+  MPI_Datatype datatype2;
+
+  void parse(xbt::ReplayAction& action, const std::string& name) override;
+};
+
 class BcastArgParser : public CollCommParser {
 public:
   void parse(xbt::ReplayAction& action, const std::string& name) override;
@@ -185,7 +197,7 @@ public:
 template <class T> class ReplayAction {
   const std::string name_;
   const aid_t my_proc_id_ = s4u::this_actor::get_pid();
-  T args_;
+  T args_{};
 
 protected:
   const std::string& get_name() const { return name_; }
@@ -219,7 +231,7 @@ public:
   void kernel(xbt::ReplayAction& action) override;
 };
 
-class SendAction : public ReplayAction<SendRecvParser> {
+class SendAction : public ReplayAction<SendOrRecvParser> {
   RequestStorage& req_storage;
 
 public:
@@ -227,7 +239,7 @@ public:
   void kernel(xbt::ReplayAction& action) override;
 };
 
-class RecvAction : public ReplayAction<SendRecvParser> {
+class RecvAction : public ReplayAction<SendOrRecvParser> {
   RequestStorage& req_storage;
 
 public:
@@ -282,6 +294,12 @@ public:
   void kernel(xbt::ReplayAction& action) override;
 };
 
+class SendRecvAction : public ReplayAction<SendRecvParser> {
+public:
+  explicit SendRecvAction() : ReplayAction("sendrecv") {}
+  void kernel(xbt::ReplayAction& action) override;
+};
+
 class BarrierAction : public ReplayAction<ActionArgParser> {
 public:
   explicit BarrierAction() : ReplayAction("barrier") {}
index f4687af..e398719 100644 (file)
@@ -483,3 +483,7 @@ int smpi_getopt (int argc,  char *const *argv,  const char *options)
     smpi_process()->set_optind(optind);
   return ret;
 }
+
+pid_t smpi_getpid(){
+  return static_cast<pid_t>(simgrid::s4u::this_actor::get_pid());
+}
index acd32c6..a0c13a9 100644 (file)
@@ -2,6 +2,25 @@
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#if defined(_GNU_SOURCE)
+  #define DEFINED_GNUSOURCE 1
+#else
+  #define _GNU_SOURCE
+#endif
+
+#if defined(__linux__)
+  #include <features.h>
+//inspired by https://stackoverflow.com/a/70211227
+  #if not defined(__USE_GNU)
+    #define __MUSL__
+  #endif
+#endif
+
+#ifndef DEFINED_GNUSOURCE
+  #undef _GNU_SOURCE
+#endif
+
 #include "smpi_config.hpp"
 #include "include/xbt/config.hpp"
 #include "mc/mc.h"
@@ -23,8 +42,9 @@
 # ifndef MAC_OS_X_VERSION_10_12
 #   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__) || defined(__sun) || defined(__HAIKU__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__sun) || defined(__HAIKU__) || defined(__MUSL__)
 constexpr bool HAVE_WORKING_MMAP = false;
 #else
 constexpr bool HAVE_WORKING_MMAP = true;
index 03048a0..8b3a184 100644 (file)
@@ -213,10 +213,6 @@ void smpi_comm_null_copy_buffer_callback(simgrid::kernel::activity::CommImpl*, v
   /* nothing done in this version */
 }
 
-int smpi_enabled() {
-  return MPI_COMM_WORLD != MPI_COMM_UNINITIALIZED;
-}
-
 static void smpi_init_papi()
 {
 #if HAVE_PAPI
@@ -583,6 +579,11 @@ int smpi_main(const char* executable, int argc, char* argv[])
   return smpi_exit_status;
 }
 
+int SMPI_is_inited()
+{
+  return MPI_COMM_WORLD != MPI_COMM_UNINITIALIZED;
+}
+
 // Called either directly from the user code, or from the code called by smpirun
 void SMPI_init(){
   smpi_init_options_internal(false);
index 218f14d..8c6a3a5 100644 (file)
@@ -162,12 +162,12 @@ void WaitTestParser::parse(simgrid::xbt::ReplayAction& action, const std::string
   tag = std::stoi(action[4]);
 }
 
-void SendRecvParser::parse(simgrid::xbt::ReplayAction& action, const std::string&)
+void SendOrRecvParser::parse(simgrid::xbt::ReplayAction& action, const std::string&)
 {
   CHECK_ACTION_PARAMS(action, 3, 1)
   partner = std::stoi(action[2]);
   tag     = std::stoi(action[3]);
-  size      = parse_integer<size_t>(action[4]);
+  size      = parse_integer<ssize_t>(action[4]);
   datatype1 = parse_datatype(action, 5);
 }
 
@@ -190,6 +190,17 @@ void LocationParser::parse(simgrid::xbt::ReplayAction& action, const std::string
   line = std::stoi(action[3]);
 }
 
+void SendRecvParser::parse(simgrid::xbt::ReplayAction& action, const std::string&)
+{
+  CHECK_ACTION_PARAMS(action, 6, 0)
+  sendcount = parse_integer<int>(action[2]);
+  dst = std::stoi(action[3]);
+  recvcount = parse_integer<int>(action[4]);
+  src = std::stoi(action[5]);
+  datatype1 = parse_datatype(action, 6);
+  datatype2 = parse_datatype(action, 7);
+}
+
 void BcastArgParser::parse(simgrid::xbt::ReplayAction& action, const std::string&)
 {
   CHECK_ACTION_PARAMS(action, 1, 2)
@@ -445,7 +456,7 @@ void WaitAction::kernel(simgrid::xbt::ReplayAction& action)
 
 void SendAction::kernel(simgrid::xbt::ReplayAction&)
 {
-  const SendRecvParser& args = get_args();
+  const SendOrRecvParser& args = get_args();
   aid_t dst_traced           = MPI_COMM_WORLD->group()->actor(args.partner);
 
   TRACE_smpi_comm_in(
@@ -468,15 +479,15 @@ void SendAction::kernel(simgrid::xbt::ReplayAction&)
 
 void RecvAction::kernel(simgrid::xbt::ReplayAction&)
 {
-  const SendRecvParser& args = get_args();
+  const SendOrRecvParser& args = get_args();
   TRACE_smpi_comm_in(
       get_pid(), __func__,
       new simgrid::instr::Pt2PtTIData(get_name(), args.partner, args.size, args.tag, Datatype::encode(args.datatype1)));
 
   MPI_Status status;
   // unknown size from the receiver point of view
-  size_t arg_size = args.size;
-  if (arg_size == 0) {
+  ssize_t arg_size = args.size;
+  if (arg_size < 0) {
     Request::probe(args.partner, args.tag, MPI_COMM_WORLD, &status);
     arg_size = status.count;
   }
@@ -499,6 +510,39 @@ void RecvAction::kernel(simgrid::xbt::ReplayAction&)
   }
 }
 
+void SendRecvAction::kernel(simgrid::xbt::ReplayAction&)
+{
+  XBT_DEBUG("Enters SendRecv");
+  const SendRecvParser& args = get_args();
+  aid_t my_proc_id = simgrid::s4u::this_actor::get_pid();
+  aid_t src_traced = MPI_COMM_WORLD->group()->actor(args.src);
+  aid_t dst_traced = MPI_COMM_WORLD->group()->actor(args.dst);
+
+  MPI_Status status;
+  int sendtag=0;
+  int recvtag=0;
+
+  // FIXME: Hack the way to trace this one
+  auto dst_hack = std::make_shared<std::vector<int>>();
+  auto src_hack = std::make_shared<std::vector<int>>();
+  dst_hack->push_back(dst_traced);
+  src_hack->push_back(src_traced);
+  TRACE_smpi_comm_in(my_proc_id, __func__,
+                       new simgrid::instr::VarCollTIData(
+                           "sendRecv", -1, args.sendcount,
+                        dst_hack, args.recvcount, src_hack,
+                           simgrid::smpi::Datatype::encode(args.datatype1), simgrid::smpi::Datatype::encode(args.datatype2)));
+
+  TRACE_smpi_send(my_proc_id, my_proc_id, dst_traced, sendtag, args.sendcount * args.datatype1->size());
+
+  simgrid::smpi::Request::sendrecv(nullptr, args.sendcount, args.datatype1, args.dst, sendtag, nullptr, args.recvcount, args.datatype2, args.src,
+                                     recvtag, MPI_COMM_WORLD, &status);
+
+  TRACE_smpi_recv(src_traced, my_proc_id, recvtag);
+  TRACE_smpi_comm_out(my_proc_id);
+  XBT_DEBUG("Exits SendRecv");
+}
+
 void ComputeAction::kernel(simgrid::xbt::ReplayAction&)
 {
   const ComputeParser& args = get_args();
@@ -824,6 +868,7 @@ void smpi_replay_init(const char* instance_id, int rank, double start_delay_flop
   xbt_replay_action_register("recv",  [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::RecvAction("recv", storage[simgrid::s4u::this_actor::get_pid()]).execute(action); });
   xbt_replay_action_register("irecv", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::RecvAction("irecv", storage[simgrid::s4u::this_actor::get_pid()]).execute(action); });
   xbt_replay_action_register("test",  [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::TestAction(storage[simgrid::s4u::this_actor::get_pid()]).execute(action); });
+  xbt_replay_action_register("sendRecv", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::SendRecvAction().execute(action); });
   xbt_replay_action_register("wait",  [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::WaitAction(storage[simgrid::s4u::this_actor::get_pid()]).execute(action); });
   xbt_replay_action_register("waitall", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::WaitAllAction(storage[simgrid::s4u::this_actor::get_pid()]).execute(action); });
   xbt_replay_action_register("barrier", [](simgrid::xbt::ReplayAction& action) { simgrid::smpi::replay::BarrierAction().execute(action); });
index b832510..2b77328 100644 (file)
@@ -49,9 +49,12 @@ File::File(MPI_Comm comm, const char* filename, int amode, MPI_Info info) : comm
       fullname.insert(0, mount);
     }
   }
-
+  XBT_DEBUG("Opening %s", fullname.c_str());
   file_ = simgrid::s4u::File::open(fullname, nullptr);
   list_ = nullptr;
+  disp_ = 0;
+  etype_ = MPI_BYTE;
+  atomicity_ = true;
   if (comm_->rank() == 0) {
     int size    = comm_->size() + FP_SIZE;
     list_       = new char[size];
@@ -108,14 +111,14 @@ int File::del(const char* filename, const Info*)
 
 int File::get_position(MPI_Offset* offset) const
 {
-  *offset = file_->tell();
+  *offset = file_->tell()/etype_->get_extent();
   return MPI_SUCCESS;
 }
 
 int File::get_position_shared(MPI_Offset* offset) const
 {
   shared_mutex_->lock();
-  *offset = *shared_file_pointer_;
+  *offset = *shared_file_pointer_/etype_->get_extent();
   shared_mutex_->unlock();
   return MPI_SUCCESS;
 }
@@ -156,9 +159,9 @@ int File::read(MPI_File fh, void* /*buf*/, int count, const Datatype* datatype,
   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());
+  XBT_DEBUG("Position before read in MPI_File %s : %llu, size %llu", fh->file_->get_path(), fh->file_->tell(), fh->file_->size());
   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,
+  XBT_VERB("Read in MPI_File %s, %lld bytes read, count %d, readsize %lld bytes, movesize %lld", fh->file_->get_path(), read, count,
            readsize, movesize);
   if (readsize != movesize) {
     fh->file_->seek(position + movesize, SEEK_SET);
@@ -186,6 +189,7 @@ int File::read_shared(MPI_File fh, void* buf, int count, const Datatype* datatyp
   read(fh, buf, count, datatype, status);
   *(fh->shared_file_pointer_) = fh->file_->tell();
   fh->shared_mutex_->unlock();
+  fh->seek(*(fh->shared_file_pointer_), MPI_SEEK_SET);
   return MPI_SUCCESS;
 }
 
@@ -201,6 +205,8 @@ int File::read_ordered(MPI_File fh, void* buf, int count, const Datatype* dataty
 
   MPI_Offset result;
   simgrid::smpi::colls::scan(&val, &result, 1, MPI_OFFSET, MPI_SUM, fh->comm_);
+  MPI_Offset prev;
+  fh->get_position(&prev);
   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) {
@@ -210,6 +216,7 @@ int File::read_ordered(MPI_File fh, void* buf, int count, const Datatype* dataty
   }
   char c;
   simgrid::smpi::colls::bcast(&c, 1, MPI_BYTE, fh->comm_->size() - 1, fh->comm_);
+  fh->seek(prev, MPI_SEEK_SET);
   return ret;
 }
 
@@ -219,10 +226,10 @@ int File::write(MPI_File fh, void* /*buf*/, int count, const Datatype* datatype,
   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());
+  XBT_DEBUG("Position before write in MPI_File %s : %llu, size %llu", fh->file_->get_path(), fh->file_->tell(), fh->file_->size());
   MPI_Offset write = fh->file_->write(writesize, true);
-  XBT_VERB("Write in MPI_File %s, %lld bytes written, readsize %lld bytes, movesize %lld", fh->file_->get_path(), write,
-           writesize, movesize);
+  XBT_VERB("Write in MPI_File %s, %lld bytes written, count %d, writesize %lld bytes, movesize %lld", fh->file_->get_path(), write,
+           count, writesize, movesize);
   if (writesize != movesize) {
     fh->file_->seek(position + movesize, SEEK_SET);
   }
@@ -240,6 +247,7 @@ int File::write_shared(MPI_File fh, const void* buf, int count, const Datatype*
   write(fh, const_cast<void*>(buf), count, datatype, status);
   *(fh->shared_file_pointer_) = fh->file_->tell();
   XBT_DEBUG("Write shared on %s - Shared ptr after : %lld", fh->file_->get_path(), *(fh->shared_file_pointer_));
+  fh->seek(*(fh->shared_file_pointer_), MPI_SEEK_SET);
   fh->shared_mutex_->unlock();
   return MPI_SUCCESS;
 }
@@ -255,6 +263,8 @@ int File::write_ordered(MPI_File fh, const void* buf, int count, const Datatype*
   }
   MPI_Offset result;
   simgrid::smpi::colls::scan(&val, &result, 1, MPI_OFFSET, MPI_SUM, fh->comm_);
+  MPI_Offset prev;
+  fh->get_position(&prev);
   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) {
@@ -264,20 +274,29 @@ int File::write_ordered(MPI_File fh, const void* buf, int count, const Datatype*
   }
   char c;
   simgrid::smpi::colls::bcast(&c, 1, MPI_BYTE, fh->comm_->size() - 1, fh->comm_);
+  fh->seek(prev, MPI_SEEK_SET);
   return ret;
 }
 
-int File::set_view(MPI_Offset /*disp*/, MPI_Datatype etype, MPI_Datatype filetype, const char* datarep, const Info*)
+int File::set_view(MPI_Offset disp, MPI_Datatype etype, MPI_Datatype filetype, const char* datarep, const Info*)
 {
   etype_    = etype;
   filetype_ = filetype;
   datarep_  = std::string(datarep);
-  seek_shared(0, MPI_SEEK_SET);
+  disp_     = disp;
+  if (comm_->rank() == 0){
+    if(disp != MPI_DISPLACEMENT_CURRENT)
+      seek_shared(disp, MPI_SEEK_SET);
+    else
+      seek_shared(0, MPI_SEEK_CUR);
+  }
+  sync();
   return MPI_SUCCESS;
 }
 
-int File::get_view(MPI_Offset* /*disp*/, MPI_Datatype* etype, MPI_Datatype* filetype, char* datarep) const
+int File::get_view(MPI_Offset* disp, MPI_Datatype* etype, MPI_Datatype* filetype, char* datarep) const
 {
+  *disp     = disp_;
   *etype    = etype_;
   *filetype = filetype_;
   snprintf(datarep, MPI_MAX_NAME_STRING + 1, "%s", datarep_.c_str());
@@ -299,6 +318,11 @@ int File::flags() const
   return flags_;
 }
 
+MPI_Datatype File::etype() const
+{
+  return etype_;
+}
+
 int File::sync()
 {
   // no idea
@@ -344,4 +368,14 @@ File* File::f2c(int id)
 {
   return static_cast<File*>(F2C::f2c(id));
 }
+
+void File::set_atomicity(bool a){
+  atomicity_ = a;
+}
+
+bool File::get_atomicity() const
+{
+  return atomicity_;
+}
+
 } // namespace simgrid::smpi
index 0ceb1a3..8a46eed 100644 (file)
@@ -118,7 +118,7 @@ bool Request::match_types(MPI_Datatype stype, MPI_Datatype rtype){
      (stype->duplicated_datatype()!=MPI_DATATYPE_NULL && match_types(stype->duplicated_datatype(), rtype)) ||
      (rtype->duplicated_datatype()!=MPI_DATATYPE_NULL && match_types(stype, rtype->duplicated_datatype())))
     match = true;
-  if (!match)
+  if (not match)
     XBT_WARN("Mismatched datatypes : sending %s and receiving %s", stype->name().c_str(), rtype->name().c_str());
   return match;
 }
@@ -150,8 +150,7 @@ bool Request::match_common(MPI_Request req, MPI_Request sender, MPI_Request rece
       receiver->truncated_ = true;
     }
     //0-sized datatypes/counts should not interfere and match
-    if ( sender->real_size_ != 0 && receiver->real_size_ != 0 &&
-         !match_types(sender->type_, receiver->type_))
+    if (sender->real_size_ != 0 && receiver->real_size_ != 0 && not match_types(sender->type_, receiver->type_))
       receiver->unmatched_types_ = true;
     if (sender->detached_)
       receiver->detached_sender_ = sender; // tie the sender to the receiver, as it is detached and has to be freed in
@@ -506,7 +505,7 @@ void Request::start()
         XBT_DEBUG("yes there was something for us in the small mailbox");
       }
     }
-    if(!is_probe)
+    if (not is_probe)
       flags_ &= ~MPI_REQ_PROBE;
     kernel::actor::CommIrecvSimcall observer{process->get_actor()->get_impl(),
                                              mailbox->get_impl(),
@@ -607,7 +606,7 @@ void Request::start()
       } else {
         XBT_DEBUG("Yes there was something for us in the large mailbox");
       }
-      if(!is_probe)
+      if (not is_probe)
         flags_ &= ~MPI_REQ_PROBE;
     } else {
       mailbox = process->mailbox();
@@ -1291,8 +1290,6 @@ void Request::free_f(int id)
 
 int Request::get_status(const Request* req, int* flag, MPI_Status* status)
 {
-  *flag=0;
-
   if(req != MPI_REQUEST_NULL && req->action_ != nullptr) {
     req->iprobe(req->comm_->group()->rank(req->src_), req->tag_, req->comm_, flag, status);
     if(*flag)
index c78dc3c..4540708 100644 (file)
@@ -90,7 +90,7 @@ int Win::del(Win* win){
 
   colls::barrier(win->comm_);
   Comm::unref(win->comm_);
-  if (!win->lockers_.empty() || win->opened_ < 0){
+  if (not win->lockers_.empty() || win->opened_ < 0) {
     XBT_WARN("Freeing a locked or opened window");
     return MPI_ERR_WIN;
   }
index 6463ec8..0c16eeb 100755 (executable)
@@ -29,7 +29,6 @@ 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 "-fPIC"
     if [ "x${SMPI_PRETEND_CC}" = "x" ]; then
        list_add CFLAGS "-include" "@includedir@/smpi/smpi_helpers.h"
        list_add LINKARGS "-shared"
@@ -40,7 +39,6 @@ elif [ "x@APPLE@" = "x1" ]; then
       list_add LINKARGS "-lsimgrid" "-lm" ${LINKER_UNDEFINED_ERROR:+"-Wl,-undefined,error"}
     fi
 else
-    list_add CFLAGS "-fPIC"
     if [ "x${SMPI_PRETEND_CC}" = "x" ]; then
        list_add CFLAGS "-include" "@includedir@/smpi/smpi_helpers.h"
        list_add LINKARGS "-shared"
@@ -78,7 +76,7 @@ while [ $# -gt 0 ]; do
             exit 0
             ;;
         '-trace-call-location')
-            list_add_not_empty CMDARGS "-DTRACE_CALL_LOCATION"
+            list_add CMDARGS "-DTRACE_CALL_LOCATION"
             ;;
         '-compiler-version' | '--compiler-version')
             ${CC} --version
@@ -93,6 +91,10 @@ while [ $# -gt 0 ]; do
     esac
 done
 
+if [ "x@WIN32@" != "x1" ]; then
+    list_add CMDARGS "-fPIC"
+fi
+
 list_set CMDLINE "${CC}"
 list_add_not_empty CMDLINE "${CFLAGS}"
 list_add_not_empty CMDLINE "${INCLUDEARGS}"
index 944870c..c88cae1 100755 (executable)
@@ -29,7 +29,6 @@ if [ "x@WIN32@" = "x1" ]; then
     list_add CXXFLAGS "-include" "@includedir@/smpi/smpi_main.h"
     list_add LINKARGS "@libdir@\libsimgrid.dll"
 elif [ "x@APPLE@" = "x1" ]; then
-    list_add CXXFLAGS "-fPIC"
     if [ "x${SMPI_PRETEND_CC}" = "x" ]; then
        list_add CXXFLAGS "-include" "@includedir@/smpi/smpi_helpers.h"
        list_add LINKARGS "-shared"
@@ -40,7 +39,6 @@ elif [ "x@APPLE@" = "x1" ]; then
       list_add LINKARGS "-lsimgrid" "-lm" ${LINKER_UNDEFINED_ERROR:+"-Wl,-undefined,error"}
     fi
 else
-    list_add CXXFLAGS "-fPIC"
     if [ "x${SMPI_PRETEND_CC}" = "x" ]; then
        list_add CXXFLAGS "-include" "@includedir@/smpi/smpi_helpers.h"
        list_add LINKARGS "-shared"
@@ -90,6 +88,10 @@ while [ $# -gt 0 ]; do
   esac
 done
 
+if [ "x@WIN32@" != "x1" ]; then
+    list_add CMDARGS "-fPIC"
+fi
+
 list_set CMDLINE "${CXX}"
 list_add_not_empty CMDLINE "${CXXFLAGS}"
 list_add_not_empty CMDLINE "${INCLUDEARGS}"
index a5e8ccf..805fe0f 100644 (file)
@@ -128,7 +128,7 @@ while [ $# -gt 0 ]; do
             TRACE_CALL_LOCATION=1
             # This should be list_add FFLAGS but it's not possible
             # anymore: FFLAGS was already moved into CMDLINE above.
-            list_add_not_empty CMDLINE "-ffixed-line-length-none" "-cpp"
+            list_add CMDLINE "-ffixed-line-length-none" "-cpp"
             ;;
         -o)
             list_add CMDLINE "-o$1"
diff --git a/src/sthread/sthread.c b/src/sthread/sthread.c
new file mode 100644 (file)
index 0000000..a52fec8
--- /dev/null
@@ -0,0 +1,286 @@
+/* SimGrid's pthread interposer. Redefinition of the pthread symbols (see the comment in sthread.h) */
+
+#define _GNU_SOURCE
+#include "src/sthread/sthread.h"
+#include "src/internal_config.h"
+#include <dlfcn.h>
+#include <pthread.h>
+#include <semaphore.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#if HAVE_VALGRIND_H
+#include <stdlib.h>
+#include <valgrind/valgrind.h>
+#endif
+
+/* We don't want to intercept pthread within simgrid. Instead we should provide the real implem to simgrid */
+static int (*raw_pthread_create)(pthread_t*, const pthread_attr_t*, void* (*)(void*), void*);
+static int (*raw_pthread_join)(pthread_t, void**);
+static int (*raw_mutex_init)(pthread_mutex_t*, const pthread_mutexattr_t*) = NULL;
+static int (*raw_mutex_lock)(pthread_mutex_t*)                             = NULL;
+static int (*raw_mutex_trylock)(pthread_mutex_t*)                          = NULL;
+static int (*raw_mutex_unlock)(pthread_mutex_t*)                           = NULL;
+static int (*raw_mutex_destroy)(pthread_mutex_t*)                          = NULL;
+
+static unsigned int (*raw_sleep)(unsigned int)         = NULL;
+static int (*raw_usleep)(useconds_t)                   = NULL;
+static int (*raw_gettimeofday)(struct timeval*, void*) = NULL;
+
+static sem_t* (*raw_sem_open)(const char*, int)                            = NULL;
+static int (*raw_sem_init)(sem_t*, int, unsigned int)                      = NULL;
+static int (*raw_sem_wait)(sem_t*)                                         = NULL;
+static int (*raw_sem_post)(sem_t*)                                         = NULL;
+
+static void intercepter_init()
+{
+  raw_pthread_create = (typeof(raw_pthread_create))dlsym(RTLD_NEXT, "pthread_create");
+  raw_pthread_join   = (typeof(raw_pthread_join))dlsym(RTLD_NEXT, "pthread_join");
+  raw_mutex_init    = (int (*)(pthread_mutex_t*, const pthread_mutexattr_t*))dlsym(RTLD_NEXT, "pthread_mutex_init");
+  raw_mutex_lock    = (int (*)(pthread_mutex_t*))dlsym(RTLD_NEXT, "pthread_mutex_lock");
+  raw_mutex_trylock = (int (*)(pthread_mutex_t*))dlsym(RTLD_NEXT, "pthread_mutex_trylock");
+  raw_mutex_unlock  = (int (*)(pthread_mutex_t*))dlsym(RTLD_NEXT, "pthread_mutex_unlock");
+  raw_mutex_destroy = (int (*)(pthread_mutex_t*))dlsym(RTLD_NEXT, "pthread_mutex_destroy");
+
+  raw_sleep        = (unsigned int (*)(unsigned int))dlsym(RTLD_NEXT, "sleep");
+  raw_usleep       = (int (*)(useconds_t usec))dlsym(RTLD_NEXT, "usleep");
+  raw_gettimeofday = (int (*)(struct timeval*, void*))dlsym(RTLD_NEXT, "gettimeofday");
+
+  raw_sem_open = (sem_t * (*)(const char*, int)) dlsym(RTLD_NEXT, "sem_open");
+  raw_sem_init = (int (*)(sem_t*, int, unsigned int))dlsym(RTLD_NEXT, "sem_init");
+  raw_sem_wait = (int (*)(sem_t*))dlsym(RTLD_NEXT, "sem_wait");
+  raw_sem_post = (int (*)(sem_t*))dlsym(RTLD_NEXT, "sem_post");
+}
+
+static int sthread_inside_simgrid = 1;
+void sthread_enable(void)
+{ // Start intercepting all pthread calls
+  sthread_inside_simgrid = 0;
+}
+void sthread_disable(void)
+{ // Stop intercepting all pthread calls
+  sthread_inside_simgrid = 1;
+}
+int pthread_create(pthread_t* thread, const pthread_attr_t* attr, void* (*start_routine)(void*), void* arg)
+{
+  if (raw_pthread_create == NULL)
+    intercepter_init();
+
+  if (sthread_inside_simgrid)
+    return raw_pthread_create(thread, attr, start_routine, arg);
+
+  sthread_inside_simgrid = 1;
+  int res                = sthread_create((sthread_t*)thread, attr, start_routine, arg);
+  sthread_inside_simgrid = 0;
+  return res;
+}
+int pthread_join(pthread_t thread, void** retval)
+{
+  if (raw_pthread_join == NULL)
+    intercepter_init();
+
+  if (sthread_inside_simgrid)
+    return raw_pthread_join(thread, retval);
+
+  sthread_inside_simgrid = 1;
+  int res                = sthread_join((sthread_t)thread, retval);
+  sthread_inside_simgrid = 0;
+  return res;
+}
+
+int pthread_mutex_init(pthread_mutex_t* mutex, const pthread_mutexattr_t* attr)
+{
+  if (raw_mutex_init == NULL)
+    intercepter_init();
+
+  if (sthread_inside_simgrid)
+    return raw_mutex_init(mutex, attr);
+
+  sthread_inside_simgrid = 1;
+  int res                = sthread_mutex_init((sthread_mutex_t*)mutex, attr);
+  sthread_inside_simgrid = 0;
+  return res;
+}
+
+int pthread_mutex_lock(pthread_mutex_t* mutex)
+{
+  if (raw_mutex_lock == NULL)
+    intercepter_init();
+
+  if (sthread_inside_simgrid)
+    return raw_mutex_lock(mutex);
+
+  sthread_inside_simgrid = 1;
+  int res                = sthread_mutex_lock((sthread_mutex_t*)mutex);
+  sthread_inside_simgrid = 0;
+  return res;
+}
+
+int pthread_mutex_trylock(pthread_mutex_t* mutex)
+{
+  if (raw_mutex_trylock == NULL)
+    intercepter_init();
+
+  if (sthread_inside_simgrid)
+    return raw_mutex_trylock(mutex);
+
+  sthread_inside_simgrid = 1;
+  int res                = sthread_mutex_trylock((sthread_mutex_t*)mutex);
+  sthread_inside_simgrid = 0;
+  return res;
+}
+
+int pthread_mutex_unlock(pthread_mutex_t* mutex)
+{
+  if (raw_mutex_unlock == NULL)
+    intercepter_init();
+
+  if (sthread_inside_simgrid)
+    return raw_mutex_unlock(mutex);
+
+  sthread_inside_simgrid = 1;
+  int res                = sthread_mutex_unlock((sthread_mutex_t*)mutex);
+  sthread_inside_simgrid = 0;
+  return res;
+}
+int pthread_mutex_destroy(pthread_mutex_t* mutex)
+{
+  if (raw_mutex_destroy == NULL)
+    intercepter_init();
+
+  if (sthread_inside_simgrid)
+    return raw_mutex_destroy(mutex);
+
+  sthread_inside_simgrid = 1;
+  int res                = sthread_mutex_destroy((sthread_mutex_t*)mutex);
+  sthread_inside_simgrid = 0;
+  return res;
+}
+
+/* Glibc < 2.31 uses type "struct timezone *" for the second parameter of gettimeofday.
+   Other implementations use "void *" instead. */
+#ifdef __GLIBC__
+#if !__GLIBC_PREREQ(2, 31)
+#define TIMEZONE_TYPE struct timezone
+#endif
+#endif
+#ifndef TIMEZONE_TYPE
+#define TIMEZONE_TYPE void
+#endif
+
+int gettimeofday(struct timeval* tv, XBT_ATTRIB_UNUSED TIMEZONE_TYPE* tz)
+{
+  if (raw_gettimeofday == NULL)
+    intercepter_init();
+
+  if (sthread_inside_simgrid)
+    return raw_gettimeofday(tv, tz);
+
+  sthread_inside_simgrid = 1;
+  int res                = sthread_gettimeofday(tv);
+  sthread_inside_simgrid = 0;
+  return res;
+}
+
+unsigned int sleep(unsigned int seconds)
+{
+  if (raw_sleep == NULL)
+    intercepter_init();
+
+  if (sthread_inside_simgrid)
+    return raw_sleep(seconds);
+
+  sthread_inside_simgrid = 1;
+  sthread_sleep(seconds);
+  sthread_inside_simgrid = 0;
+  return 0;
+}
+
+int usleep(useconds_t usec)
+{
+  if (raw_usleep == NULL)
+    intercepter_init();
+
+  if (sthread_inside_simgrid)
+    return raw_usleep(usec);
+
+  sthread_inside_simgrid = 1;
+  sthread_sleep(((double)usec) / 1000000.);
+  sthread_inside_simgrid = 0;
+  return 0;
+}
+
+#if 0
+int sem_init(sem_t *sem, int pshared, unsigned int value) {
+       int res;
+
+       res=raw_sem_init(sem,pshared,value);
+       return res;
+}
+
+int sem_wait(sem_t *sem) {
+       int res;
+
+       res = raw_sem_wait(sem);
+       return res;
+}
+
+int sem_post(sem_t *sem) {
+       return raw_sem_post(sem);
+}
+
+int pthread_cond_init(pthread_cond_t *cond, pthread_condattr_t *cond_attr) {
+    *cond = sg_cond_init();
+    return 0;
+}
+
+int pthread_cond_signal(pthread_cond_t *cond) {
+       sg_cond_notify_one(*cond);
+    return 0;
+}
+
+int pthread_cond_broadcast(pthread_cond_t *cond) {
+       sg_cond_notify_all(*cond);
+    return 0;
+}
+
+int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) {
+       sg_cond_wait(*cond, *mutex);
+    return 0;
+}
+
+int pthread_cond_destroy(pthread_cond_t *cond) {
+       sg_cond_destroy(*cond);
+    return 0;
+}
+#endif
+
+/* Trampoline for the real main() */
+static int (*raw_main)(int, char**, char**);
+
+/* Our fake main() that gets called by __libc_start_main() */
+static int main_hook(int argc, char** argv, char** envp)
+{
+  return sthread_main(argc, argv, envp, raw_main);
+}
+
+/* Wrapper for __libc_start_main() that replaces the real main function with our hooked version. */
+int __libc_start_main(int (*main)(int, char**, char**), int argc, char** argv, int (*init)(int, char**, char**),
+                      void (*fini)(void), void (*rtld_fini)(void), void* stack_end);
+
+int __libc_start_main(int (*main)(int, char**, char**), int argc, char** argv, int (*init)(int, char**, char**),
+                      void (*fini)(void), void (*rtld_fini)(void), void* stack_end)
+{
+  /* Save the real main function address */
+  raw_main = main;
+
+  /* Find the real __libc_start_main()... */
+  typeof(&__libc_start_main) orig = dlsym(RTLD_NEXT, "__libc_start_main");
+  /* ... and call it with our custom main function */
+#if HAVE_VALGRIND_H
+  /* ... unless valgrind is used, and this instance is not the target program (but the valgrind launcher) */
+  if (getenv("VALGRIND_LIB") && !RUNNING_ON_VALGRIND)
+    return orig(raw_main, argc, argv, init, fini, rtld_fini, stack_end);
+#endif
+  return orig(main_hook, argc, argv, init, fini, rtld_fini, stack_end);
+}
diff --git a/src/sthread/sthread.h b/src/sthread/sthread.h
new file mode 100644 (file)
index 0000000..e13357b
--- /dev/null
@@ -0,0 +1,50 @@
+/* SimGrid's pthread interposer. Intercepts most of the pthread and semaphore calls to model-check them.
+ *
+ * Intercepting on pthread is somewhat complicated by the fact that pthread is used everywhere in the system headers.
+ * To reduce definition conflicts, our redefinitions of the pthread symbols (in sthread.c) load as little headers as
+ * possible. Thus, the actual implementations are separated in another file (sthread_impl.cpp) and are used as black
+ * boxes by our redefinitions.
+ *
+ * The sthread_* symbols are those actual implementations, used in the pthread_* redefinitions. */
+
+#ifndef SIMGRID_STHREAD_H
+#define SIMGRID_STHREAD_H
+
+#include <sys/time.h>
+
+#if defined(__ELF__)
+#define XBT_PUBLIC __attribute__((visibility("default")))
+#else
+#define XBT_PUBLIC
+#endif
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+// Launch the simulation. The old main function (passed as a parameter) is launched as an actor
+int sthread_main(int argc, char** argv, char** envp, int (*raw_main)(int, char**, char**));
+XBT_PUBLIC void sthread_enable(void);  // Start intercepting all pthread calls
+XBT_PUBLIC void sthread_disable(void); // Stop intercepting all pthread calls
+
+typedef unsigned long int sthread_t;
+int sthread_create(sthread_t* thread, const /*pthread_attr_t*/ void* attr, void* (*start_routine)(void*), void* arg);
+int sthread_join(sthread_t thread, void** retval);
+
+typedef struct {
+  void* mutex;
+} sthread_mutex_t;
+int sthread_mutex_init(sthread_mutex_t* mutex, const /*pthread_mutexattr_t*/ void* attr);
+int sthread_mutex_lock(sthread_mutex_t* mutex);
+int sthread_mutex_trylock(sthread_mutex_t* mutex);
+int sthread_mutex_unlock(sthread_mutex_t* mutex);
+int sthread_mutex_destroy(sthread_mutex_t* mutex);
+
+int sthread_gettimeofday(struct timeval* tv);
+void sthread_sleep(double seconds);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif
diff --git a/src/sthread/sthread_impl.cpp b/src/sthread/sthread_impl.cpp
new file mode 100644 (file)
index 0000000..7721982
--- /dev/null
@@ -0,0 +1,193 @@
+/* SimGrid's pthread interposer. Actual implementation of the symbols (see the comment in sthread.h) */
+
+#include "smpi/smpi.h"
+#include <simgrid/actor.h>
+#include <simgrid/s4u/Actor.hpp>
+#include <simgrid/s4u/Engine.hpp>
+#include <simgrid/s4u/Mutex.hpp>
+#include <simgrid/s4u/NetZone.hpp>
+#include <xbt/base.h>
+#include <xbt/sysdep.h>
+
+#include "src/internal_config.h"
+#include "src/sthread/sthread.h"
+
+#include <cmath>
+#include <dlfcn.h>
+#include <pthread.h>
+#include <semaphore.h>
+#include <sstream>
+#include <stdio.h>
+#include <stdlib.h>
+#include <thread>
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(sthread, "pthread intercepter");
+namespace sg4 = simgrid::s4u;
+
+static sg4::Host* lilibeth = nullptr;
+
+int sthread_main(int argc, char** argv, char** envp, int (*raw_main)(int, char**, char**))
+{
+  /* Do not intercept the main when run from SMPI: it will initialize the simulation properly */
+  for (int i = 0; envp[i] != nullptr; i++)
+    if (strncmp(envp[i], "SMPI_GLOBAL_SIZE", strlen("SMPI_GLOBAL_SIZE")) == 0)
+      return raw_main(argc, argv, envp);
+
+  /* If not in SMPI, the old main becomes an actor in a newly created simulation */
+  std::ostringstream id;
+  id << std::this_thread::get_id();
+
+  XBT_DEBUG("sthread main() is starting in thread %s", id.str().c_str());
+
+  sg4::Engine e(&argc, argv);
+  auto* zone = sg4::create_full_zone("world");
+  lilibeth   = zone->create_host("Lilibeth", 1e15);
+  zone->seal();
+
+  /* Launch the user's main() on an actor */
+  sthread_enable();
+  sg4::ActorPtr main_actor = sg4::Actor::create("tid 0", lilibeth, raw_main, argc, argv, envp);
+
+  XBT_INFO("Starting the simulation.");
+  sg4::Engine::get_instance()->run();
+  sthread_disable();
+  XBT_INFO("All threads exited. Terminating the simulation.");
+
+  return 0;
+}
+
+struct sthread_mutex {
+  s4u_Mutex* mutex;
+};
+
+static void thread_create_wrapper(void* (*user_function)(void*), void* param)
+{
+#if HAVE_SMPI
+  if (SMPI_is_inited())
+    SMPI_thread_create();
+#endif
+  sthread_enable();
+  user_function(param);
+  sthread_disable();
+}
+
+int sthread_create(unsigned long int* thread, const void* /*pthread_attr_t* attr*/, void* (*start_routine)(void*),
+                   void* arg)
+{
+  static int TID = 0;
+  TID++;
+  XBT_VERB("Create thread %d", TID);
+  int rank = 0;
+#if HAVE_SMPI
+  if (SMPI_is_inited())
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+#endif
+  std::string name    = simgrid::xbt::string_printf("%d:%d", rank, TID);
+  sg4::ActorPtr actor = sg4::Actor::init(name.c_str(), lilibeth);
+  actor->start(thread_create_wrapper, start_routine, arg);
+
+  intrusive_ptr_add_ref(actor.get());
+  *thread = reinterpret_cast<unsigned long>(actor.get());
+  return 0;
+}
+int sthread_join(sthread_t thread, void** /*retval*/)
+{
+  sg4::ActorPtr actor(reinterpret_cast<sg4::Actor*>(thread));
+  actor->join();
+  intrusive_ptr_release(actor.get());
+
+  return 0;
+}
+
+int sthread_mutex_init(sthread_mutex_t* mutex, const void* /*pthread_mutexattr_t* attr*/)
+{
+  auto m = sg4::Mutex::create();
+  intrusive_ptr_add_ref(m.get());
+
+  mutex->mutex = m.get();
+  return 0;
+}
+
+int sthread_mutex_lock(sthread_mutex_t* mutex)
+{
+  static_cast<sg4::Mutex*>(mutex->mutex)->lock();
+  return 0;
+}
+
+int sthread_mutex_trylock(sthread_mutex_t* mutex)
+{
+  return static_cast<sg4::Mutex*>(mutex->mutex)->try_lock();
+}
+
+int sthread_mutex_unlock(sthread_mutex_t* mutex)
+{
+  static_cast<sg4::Mutex*>(mutex->mutex)->unlock();
+  return 0;
+}
+int sthread_mutex_destroy(sthread_mutex_t* mutex)
+{
+  intrusive_ptr_release(static_cast<sg4::Mutex*>(mutex->mutex));
+  return 0;
+}
+
+int sthread_gettimeofday(struct timeval* tv)
+{
+  if (tv) {
+    double now   = simgrid::s4u::Engine::get_clock();
+    double secs  = trunc(now);
+    double usecs = (now - secs) * 1e6;
+    tv->tv_sec   = static_cast<time_t>(secs);
+    tv->tv_usec  = static_cast<decltype(tv->tv_usec)>(usecs); // suseconds_t (or useconds_t on WIN32)
+  }
+  return 0;
+}
+
+void sthread_sleep(double seconds)
+{
+  simgrid::s4u::this_actor::sleep_for(seconds);
+}
+
+#if 0
+int sem_init(sem_t *sem, int pshared, unsigned int value) {
+       int res;
+
+       res=raw_sem_init(sem,pshared,value);
+       return res;
+}
+
+int sem_wait(sem_t *sem) {
+       int res;
+
+       res = raw_sem_wait(sem);
+       return res;
+}
+
+int sem_post(sem_t *sem) {
+       return raw_sem_post(sem);
+}
+
+int pthread_cond_init(pthread_cond_t *cond, pthread_condattr_t *cond_attr) {
+    *cond = sg_cond_init();
+    return 0;
+}
+
+int pthread_cond_signal(pthread_cond_t *cond) {
+       sg_cond_notify_one(*cond);
+    return 0;
+}
+
+int pthread_cond_broadcast(pthread_cond_t *cond) {
+       sg_cond_notify_all(*cond);
+    return 0;
+}
+
+int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) {
+       sg_cond_wait(*cond, *mutex);
+    return 0;
+}
+
+int pthread_cond_destroy(pthread_cond_t *cond) {
+       sg_cond_destroy(*cond);
+    return 0;
+}
+#endif
index ef5b9f6..d646288 100644 (file)
@@ -7,6 +7,7 @@
 #include <simgrid/s4u/Engine.hpp>
 #include <simgrid/s4u/Host.hpp>
 
+#include "xbt/asserts.hpp"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/resource/VirtualMachineImpl.hpp"
 
@@ -28,7 +29,7 @@ namespace simgrid::kernel::resource {
  ************/
 HostImpl::HostImpl(const std::string& name) : piface_(this), name_(name)
 {
-  xbt_assert(s4u::Host::by_name_or_null(name_) == nullptr, "Refusing to create a second host named '%s'.", get_cname());
+  xbt_enforce(s4u::Host::by_name_or_null(name_) == nullptr, "Refusing to create a second host named '%s'.", get_cname());
 }
 
 HostImpl::~HostImpl()
@@ -158,11 +159,12 @@ s4u::VirtualMachine* HostImpl::create_vm(const std::string& name, s4u::VirtualMa
   auto* cpu =
       englobing_zone_->get_cpu_vm_model()->create_cpu(vm, speeds)->set_core_count(vm->get_vm_impl()->get_core_amount());
 
-  if (get_iface()->get_pstate() != 0)
-    cpu->set_pstate(get_iface()->get_pstate());
-
   cpu->seal();
 
+  if (get_iface()->get_pstate() != 0) {
+    cpu->set_pstate(get_iface()->get_pstate());
+  }
+
   /* Currently, a VM uses the network resource of its physical host */
   vm->set_netpoint(get_iface()->get_netpoint());
 
index 8112b6a..62e8aef 100644 (file)
@@ -68,7 +68,7 @@ CpuCas01Model::CpuCas01Model(const std::string& name) : CpuModel(name)
     select = true;
   }
 
-  set_maxmin_system(lmm::System::build(cfg_cpu_solver, select));
+  set_maxmin_system(lmm::System::build(cfg_cpu_solver.get(), select));
 }
 
 CpuImpl* CpuCas01Model::create_cpu(s4u::Host* host, const std::vector<double>& speed_per_pstate)
index 049fb15..4ec1f66 100644 (file)
@@ -93,7 +93,7 @@ NetworkCm02Model::NetworkCm02Model(const std::string& name) : NetworkModel(name)
     select = true;
   }
 
-  set_maxmin_system(lmm::System::build(cfg_network_solver, select));
+  set_maxmin_system(lmm::System::build(cfg_network_solver.get(), select));
 
   loopback_.reset(create_link("__loopback__", {config::get_value<double>("network/loopback-bw")}));
   loopback_->set_sharing_policy(s4u::Link::SharingPolicy::FATPIPE, {});
index 209639d..60dddcd 100644 (file)
@@ -36,7 +36,7 @@ void surf_host_model_init_ptask_L07()
   XBT_CINFO(xbt_cfg, "Switching to the L07 model to handle parallel tasks.");
   xbt_assert(cfg_ptask_solver != "maxmin", "Invalid configuration. Cannot use maxmin solver with parallel tasks.");
 
-  auto* system    = simgrid::kernel::lmm::System::build(cfg_ptask_solver, true /* selective update */);
+  auto* system    = simgrid::kernel::lmm::System::build(cfg_ptask_solver.get(), true /* selective update */);
   auto host_model = std::make_shared<simgrid::kernel::resource::HostL07Model>("Host_Ptask", system);
   auto* engine    = simgrid::kernel::EngineImpl::get_instance();
   engine->add_model(host_model);
@@ -205,7 +205,7 @@ L07Action::L07Action(Model* model, const std::vector<s4u::Host*>& host_list, con
    * communication either */
   for (size_t i = 0; i < host_nb; i++) {
     model->get_maxmin_system()->expand(host_list[i]->get_cpu()->get_constraint(), get_variable(),
-                                       (flops_amount == nullptr ? 0.0 : flops_amount[i]));
+                                       (flops_amount == nullptr ? 0.0 : flops_amount[i]), true);
   }
 
   if (bytes_amount != nullptr) {
index 8e1598b..7d42393 100644 (file)
@@ -172,30 +172,33 @@ void ETag_surfxml_include()
 
 /* Stag and Etag parse functions */
 void STag_surfxml_platform() {
-  double version = surf_parse_get_double(A_surfxml_platform_version);
-
-  surf_parse_assert((version >= 1.0), "******* BIG FAT WARNING *********\n "
-      "You're using an ancient XML file.\n"
-      "Since SimGrid 3.1, units are Bytes, Flops, and seconds "
-      "instead of MBytes, MFlops and seconds.\n"
-
-      "Use simgrid_update_xml to update your file automatically. "
-      "This program is installed automatically with SimGrid, or "
-      "available in the tools/ directory of the source archive.\n"
-
-      "Please check also out the SURF section of the ChangeLog for "
-      "the 3.1 version for more information. \n"
-
-      "Last, do not forget to also update your values for "
-      "the calls to MSG_task_create (if any).");
-  surf_parse_assert((version >= 3.0), "******* BIG FAT WARNING *********\n "
-      "You're using an old XML file.\n"
-      "Use simgrid_update_xml to update your file automatically. "
-      "This program is installed automatically with SimGrid, or "
-      "available in the tools/ directory of the source archive.");
+  /* Use fixed point arithmetic to avoid rounding errors ("4.1" for example cannot be represented exactly as a floating
+   * point number) */
+  const long int version           = lround(100.0 * surf_parse_get_double(A_surfxml_platform_version));
+  const std::string version_string = std::to_string(version / 100) + "." + std::to_string(version % 100);
+
+  surf_parse_assert(version >= 100L, "******* BIG FAT WARNING *********\n "
+                                     "You're using an ancient XML file.\n"
+                                     "Since SimGrid 3.1, units are Bytes, Flops, and seconds "
+                                     "instead of MBytes, MFlops and seconds.\n"
+
+                                     "Use simgrid_update_xml to update your file automatically. "
+                                     "This program is installed automatically with SimGrid, or "
+                                     "available in the tools/ directory of the source archive.\n"
+
+                                     "Please check also out the SURF section of the ChangeLog for "
+                                     "the 3.1 version for more information. \n"
+
+                                     "Last, do not forget to also update your values for "
+                                     "the calls to MSG_task_create (if any).");
+  surf_parse_assert(version >= 300L, "******* BIG FAT WARNING *********\n "
+                                     "You're using an old XML file.\n"
+                                     "Use simgrid_update_xml to update your file automatically. "
+                                     "This program is installed automatically with SimGrid, or "
+                                     "available in the tools/ directory of the source archive.");
   surf_parse_assert(
-      (version >= 4.0),
-      std::string("******* THIS FILE IS TOO OLD (v:") + std::to_string(version) +
+      version >= 400L,
+      std::string("******* THIS FILE IS TOO OLD (v:") + version_string +
           ") *********\n "
           "Changes introduced in SimGrid 3.13:\n"
           "  - 'power' attribute of hosts (and others) got renamed to 'speed'.\n"
@@ -206,18 +209,18 @@ void STag_surfxml_platform() {
           "Use simgrid_update_xml to update your file automatically. "
           "This program is installed automatically with SimGrid, or "
           "available in the tools/ directory of the source archive.");
-  if (version < 4.1) {
-    XBT_INFO("You're using a v%.1f XML file (%s) while the current standard is v4.1 "
+  if (version < 410L) {
+    XBT_INFO("You're using a v%s XML file (%s) while the current standard is v4.1 "
              "That's fine, the new version is backward compatible. \n\n"
              "Use simgrid_update_xml to update your file automatically to get rid of this warning. "
              "This program is installed automatically with SimGrid, or "
              "available in the tools/ directory of the source archive.",
-             version, surf_parsed_filename.c_str());
+             version_string.c_str(), surf_parsed_filename.c_str());
   }
-  surf_parse_assert(version <= 4.1,
-             std::string("******* THIS FILE COMES FROM THE FUTURE (v:")+std::to_string(version)+") *********\n "
-             "The most recent formalism that this version of SimGrid understands is v4.1.\n"
-             "Please update your code, or use another, more adapted, file.");
+  surf_parse_assert(version <= 410L, std::string("******* THIS FILE COMES FROM THE FUTURE (v:") + version_string +
+                                         ") *********\n "
+                                         "The most recent formalism that this version of SimGrid understands is v4.1.\n"
+                                         "Please update your code, or use another, more adapted, file.");
 }
 void ETag_surfxml_platform(){
   simgrid::s4u::Engine::on_platform_created();
index 59f4865..6573bb8 100644 (file)
@@ -15,6 +15,7 @@
 #include "xbt/string.hpp"
 #include "xbt/xbt_modinter.h"
 
+#include <algorithm>
 #include <cstdio>
 #include <cstring>
 
@@ -89,8 +90,8 @@ static void xbt_dict_rehash(xbt_dict_t dict)
   const unsigned oldsize = dict->table_size + 1;
   unsigned newsize = oldsize * 2;
 
-  auto* newtable = static_cast<xbt_dictelm_t*>(xbt_realloc((char*)dict->table, newsize * sizeof(xbt_dictelm_t)));
-  memset(&newtable[oldsize], 0, oldsize * sizeof(xbt_dictelm_t)); /* zero second half */
+  auto* newtable = static_cast<xbt_dictelm_t*>(xbt_realloc(dict->table, newsize * sizeof(xbt_dictelm_t)));
+  std::fill(newtable + oldsize, newtable + newsize, nullptr); /* zero second half */
   newsize--;
   dict->table_size = newsize;
   dict->table      = newtable;
index 8592ad6..32d1d41 100644 (file)
@@ -93,21 +93,6 @@ static void search_not_found(const_xbt_dict_t head, const char* data)
   REQUIRE(xbt_dict_get_or_null(head, data) == nullptr);
 }
 
-static void count(const_xbt_dict_t dict, int length)
-{
-  INFO("Count elements (expecting " << length << ")");
-  REQUIRE(xbt_dict_length(dict) == length); // Announced length differs
-
-  xbt_dict_cursor_t cursor;
-  char* key;
-  void* data;
-  int effective = 0;
-  xbt_dict_foreach (dict, cursor, key, data)
-    effective++;
-
-  REQUIRE(effective == length); // Effective length differs
-}
-
 static int countelems(const_xbt_dict_t head)
 {
   xbt_dict_cursor_t cursor;
@@ -121,6 +106,13 @@ static int countelems(const_xbt_dict_t head)
   return res;
 }
 
+static void count(const_xbt_dict_t dict, int length)
+{
+  INFO("Count elements (expecting " << length << ")");
+  REQUIRE(xbt_dict_length(dict) == length); // Announced length differs
+  REQUIRE(countelems(dict) == length);      // Effective length differs
+}
+
 TEST_CASE("xbt::dict: dict data container", "dict")
 {
   SECTION("Basic usage: change, retrieve and traverse homogeneous dicts")
index 10c47ff..c6c5a84 100644 (file)
@@ -11,7 +11,6 @@
    Heavily modified Mar 1992 by Fred Fish.  (fnf@cygnus.com) */
 
 #include "mmprivate.h"
-#include "xbt/ex.h"
 #include "mc/mc.h"
 
 /* Return memory to the heap.
@@ -30,6 +29,11 @@ void mfree(struct mdesc *mdp, void *ptr)
   size_t block = BLOCK(ptr);
 
   if ((char *) ptr < (char *) mdp->heapbase || block > mdp->heapsize) {
+    if ((char*)ptr <= (char*)mmalloc_preinit_buffer + mmalloc_preinit_buffer_size &&
+        (char*)ptr >= (char*)mmalloc_preinit_buffer)
+      /* This points to the static buffer for fake mallocs done by dlsym before mmalloc initialization, ignore it */
+      return;
+
     fprintf(stderr,"Ouch, this pointer is not mine, I refuse to free it. Give me valid pointers, or give me death!!\n");
     abort();
   }
@@ -38,13 +42,13 @@ void mfree(struct mdesc *mdp, void *ptr)
 
   switch (type) {
   case MMALLOC_TYPE_HEAPINFO:
-    UNLOCK(mdp);
-    THROW("Asked to free a fragment in a heapinfo block. I'm confused.\n");
+    fprintf(stderr, "Asked to free a fragment in a heapinfo block. I'm confused.\n");
+    abort();
     break;
 
   case MMALLOC_TYPE_FREE: /* Already free */
-    UNLOCK(mdp);
-    THROW("Asked to free a fragment in a block that is already free. I'm puzzled.\n");
+    fprintf(stderr, "Asked to free a fragment in a block that is already free. I'm puzzled.\n");
+    abort();
     break;
 
   case MMALLOC_TYPE_UNFRAGMENTED:
@@ -166,8 +170,8 @@ void mfree(struct mdesc *mdp, void *ptr)
     frag_nb = RESIDUAL(ptr, BLOCKSIZE) >> type;
 
     if( mdp->heapinfo[block].busy_frag.frag_size[frag_nb] == -1){
-      UNLOCK(mdp);
-      THROW("Asked to free a fragment that is already free. I'm puzzled\n");
+      fprintf(stderr, "Asked to free a fragment that is already free. I'm puzzled\n");
+      abort();
     }
 
     if (MC_is_active() && mdp->heapinfo[block].busy_frag.ignore[frag_nb] > 0)
diff --git a/src/xbt/mmalloc/mm_interface.c b/src/xbt/mmalloc/mm_interface.c
new file mode 100644 (file)
index 0000000..5f03243
--- /dev/null
@@ -0,0 +1,53 @@
+/* External interface to a mmap'd malloc managed region. */
+
+/* Copyright (c) 2012-2022. The SimGrid Team. All rights reserved.          */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+/* Copyright 1992, 2000 Free Software Foundation, Inc.
+
+   Contributed by Fred Fish at Cygnus Support.   fnf@cygnus.com
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If
+   not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <fcntl.h> /* After sys/types.h, at least for dpx/2.  */
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include "mmprivate.h"
+
+// This is the underlying implementation of mmalloc_get_bytes_used_remote.
+// Is it used directly to evaluate the bytes used from a different process.
+size_t mmalloc_get_bytes_used_remote(size_t heaplimit, const malloc_info* heapinfo)
+{
+  int bytes = 0;
+  for (size_t i = 0; i < heaplimit; ++i) {
+    if (heapinfo[i].type == MMALLOC_TYPE_UNFRAGMENTED) {
+      if (heapinfo[i].busy_block.busy_size > 0)
+        bytes += heapinfo[i].busy_block.busy_size;
+    } else if (heapinfo[i].type > 0) {
+      for (size_t j = 0; j < (size_t)(BLOCKSIZE >> heapinfo[i].type); j++) {
+        if (heapinfo[i].busy_frag.frag_size[j] > 0)
+          bytes += heapinfo[i].busy_frag.frag_size[j];
+      }
+    }
+  }
+  return bytes;
+}
index 3228074..ee822fd 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2010-2022. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2010-2022. The SimGrid Team. All rights reserved.          */
 
 /* This program 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,19 +6,16 @@
 /* Redefine the classical malloc/free/realloc functions so that they fit well in the mmalloc framework */
 #define _GNU_SOURCE
 
-#include <stdlib.h>
+#include "mmprivate.h"
 
 #include <dlfcn.h>
-
-#include "mmprivate.h"
-#include "src/internal_config.h"
-#include "src/mc/remote/mc_protocol.h"
-#include "xbt/xbt_modinter.h"
 #include <math.h>
+#include <stdlib.h>
 
 /* ***** Whether to use `mmalloc` of the underlying malloc ***** */
 
 static int __malloc_use_mmalloc;
+int mmalloc_pagesize = 0;
 
 int malloc_use_mmalloc(void)
 {
@@ -43,20 +39,14 @@ xbt_mheap_t mmalloc_get_current_heap(void)
 }
 
 /* Override the malloc-like functions if MC is activated at compile time */
-#if SIMGRID_HAVE_MC
-
 /* ***** Temporary allocator
  *
  * This is used before we have found the real malloc implementation with dlsym.
  */
 
-#ifdef __FreeBSD__ /* FreeBSD require more memory, other might */
-# define BUFFER_SIZE 256
-#else /* Valid on: Linux */
-# define BUFFER_SIZE 32
-#endif
 static size_t fake_alloc_index;
-static uint64_t buffer[BUFFER_SIZE];
+static uint64_t buffer[mmalloc_preinit_buffer_size];
+uint64_t* mmalloc_preinit_buffer = buffer;
 
 /* Fake implementations, they are used to fool dlsym:
  * dlsym used calloc and falls back to some other mechanism
@@ -64,13 +54,18 @@ static uint64_t buffer[BUFFER_SIZE];
  */
 static void* mm_fake_malloc(size_t n)
 {
+  mmalloc_preinit_buffer = buffer;
+
   // How many uint64_t do w need?
   size_t count = n / sizeof(uint64_t);
   if (n % sizeof(uint64_t))
     count++;
   // Check that we have enough available memory:
-  if (fake_alloc_index + count >= BUFFER_SIZE)
+  if (fake_alloc_index + count >= mmalloc_preinit_buffer_size) {
+    puts("mmalloc is not initialized yet, but the static buffer used as malloc replacement is already exhausted. "
+         "Please increase `mmalloc_preinit_buffer_size` in mm_legacy.c\n");
     exit(127);
+  }
   // Allocate it:
   uint64_t* res = buffer + fake_alloc_index;
   fake_alloc_index += count;
@@ -132,6 +127,8 @@ XBT_ATTRIB_CONSTRUCTOR(101) static void mm_legacy_constructor()
     mm_real_calloc   = dlsym(RTLD_NEXT, "calloc");
 #endif
   }
+  mmalloc_pagesize = getpagesize();
+
   mm_initializing = 0;
   mm_initialized = 1;
 }
@@ -163,10 +160,7 @@ void *malloc(size_t n)
   if (!mdp)
     return NULL;
 
-  LOCK(mdp);
-  void *ret = mmalloc(mdp, n);
-  UNLOCK(mdp);
-  return ret;
+  return mmalloc(mdp, n);
 }
 
 void *calloc(size_t nmemb, size_t size)
@@ -185,9 +179,7 @@ void *calloc(size_t nmemb, size_t size)
   if (!mdp)
     return NULL;
 
-  LOCK(mdp);
   void *ret = mmalloc(mdp, nmemb*size);
-  UNLOCK(mdp);
   // This was already done in the callee:
   if(!(mdp->options & XBT_MHEAP_OPTION_MEMSET)) {
     memset(ret, 0, nmemb * size);
@@ -211,10 +203,7 @@ void *realloc(void *p, size_t s)
   if (!mdp)
     return NULL;
 
-  LOCK(mdp);
-  void* ret = mrealloc(mdp, p, s);
-  UNLOCK(mdp);
-  return ret;
+  return mrealloc(mdp, p, s);
 }
 
 void free(void *p)
@@ -234,8 +223,5 @@ void free(void *p)
     return;
 
   xbt_mheap_t mdp = GET_HEAP();
-  LOCK(mdp);
   mfree(mdp, p);
-  UNLOCK(mdp);
 }
-#endif /* SIMGRID_HAVE_MC */
index 8358d43..1eca509 100644 (file)
@@ -1,7 +1,6 @@
 /* Initialization for access to a mmap'd malloc managed region. */
 
-/* Copyright (c) 2012-2022. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2012-2022. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
    not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include "src/internal_config.h"
 #include <sys/types.h>
 #include <fcntl.h>              /* After sys/types.h, at least for dpx/2.  */
 #include <sys/stat.h>
 #include <string.h>
 #include "mmprivate.h"
-#include "xbt/ex.h"
-#include "xbt/xbt_modinter.h" /* declarations of mmalloc_preinit and friends that live here */
 
 /* Initialize access to a mmalloc managed region.
 
@@ -49,7 +45,7 @@
    so that users of the package don't have to worry about the actual
    implementation details.
 
-   On failure returns NULL. */
+   On failure, returns NULL. */
 
 xbt_mheap_t xbt_mheap_new(void* baseaddr, int options)
 {
@@ -71,7 +67,6 @@ xbt_mheap_t xbt_mheap_new(void* baseaddr, int options)
   mdp->next_mdesc = NULL;
   mdp->options = options;
 
-  pthread_mutex_init(&mdp->mutex, NULL);
   /* If we have not been passed a valid open file descriptor for the file
      to map to, then open /dev/zero and use that to map to. */
 
@@ -92,28 +87,12 @@ xbt_mheap_t xbt_mheap_new(void* baseaddr, int options)
     while(mdp->next_mdesc)
       mdp = mdp->next_mdesc;
 
-    LOCK(mdp);
     mdp->next_mdesc = (struct mdesc *)mbase;
-    UNLOCK(mdp);
   }
 
   return mbase;
 }
 
-
-
-/** Terminate access to a mmalloc managed region, but do not free its content.
- *
- * This is for example useful for the base region where ldl stores its data
- *   because it leaves the place after us.
- */
-void xbt_mheap_destroy_no_free(xbt_mheap_t md)
-{
-  struct mdesc *mdp = md;
-
-  pthread_mutex_destroy(&mdp->mutex);
-}
-
 /** Terminate access to a mmalloc managed region by unmapping all memory pages associated with the region, and closing
  *  the file descriptor if it is one that we opened.
 
@@ -135,7 +114,6 @@ void *xbt_mheap_destroy(xbt_mheap_t mdp)
 
     mdptemp->next_mdesc = mdp->next_mdesc;
 
-    xbt_mheap_destroy_no_free(mdp);
     struct mdesc mtemp = *mdp;
 
     /* Now unmap all the pages associated with this region by asking for a
@@ -156,81 +134,20 @@ void *xbt_mheap_destroy(xbt_mheap_t mdp)
  * Try to increase this first if you experience strange errors under valgrind. */
 #define HEAP_OFFSET   (128UL<<20)
 
-static void mmalloc_fork_prepare(void)
-{
-  xbt_mheap_t mdp = NULL;
-  if ((mdp =__mmalloc_default_mdp)){
-    while(mdp){
-      LOCK(mdp);
-      mdp = mdp->next_mdesc;
-    }
-  }
-}
-
-static void mmalloc_fork_parent(void)
-{
-  xbt_mheap_t mdp = NULL;
-  if ((mdp =__mmalloc_default_mdp)){
-    while(mdp){
-      UNLOCK(mdp);
-      mdp = mdp->next_mdesc;
-    }
-  }
-}
-
-static void mmalloc_fork_child(void)
-{
-  struct mdesc* mdp = NULL;
-  if ((mdp =__mmalloc_default_mdp)){
-    while(mdp){
-      UNLOCK(mdp);
-      mdp = mdp->next_mdesc;
-    }
-  }
-}
-
-/* Initialize the default malloc descriptor. */
+/* Initialize the default malloc descriptor.
+ *
+ * There is no malloc_postexit() destroying the default mdp, because it would break ldl trying to free its memory
+ */
 xbt_mheap_t mmalloc_preinit(void)
 {
   if (__mmalloc_default_mdp == NULL) {
-    if(!xbt_pagesize)
-      xbt_pagesize = getpagesize();
-    unsigned long mask = ~((unsigned long)xbt_pagesize - 1);
-    void *addr = (void*)(((unsigned long)sbrk(0) + HEAP_OFFSET) & mask);
+    if (!mmalloc_pagesize)
+      mmalloc_pagesize = getpagesize();
+    unsigned long mask    = ~((unsigned long)mmalloc_pagesize - 1);
+    void* addr            = (void*)(((unsigned long)sbrk(0) + HEAP_OFFSET) & mask);
     __mmalloc_default_mdp = xbt_mheap_new(addr, XBT_MHEAP_OPTION_MEMSET);
-
-    // atfork mandated at least on FreeBSD, or simgrid-mc will fail to fork the verified app
-    int res = pthread_atfork(mmalloc_fork_prepare, mmalloc_fork_parent, mmalloc_fork_child);
-    xbt_assert(res == 0, "pthread_atfork() failed: return value %d", res);
   }
-  xbt_assert(__mmalloc_default_mdp != NULL);
+  mmalloc_assert(__mmalloc_default_mdp != NULL, "__mmalloc_default_mdp cannot be NULL");
 
   return __mmalloc_default_mdp;
 }
-
-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)
-}
-
-// This is the underlying implementation of mmalloc_get_bytes_used_remote.
-// Is it used directly in order to evaluate the bytes used from a different
-// process.
-size_t mmalloc_get_bytes_used_remote(size_t heaplimit, const malloc_info* heapinfo)
-{
-  int bytes = 0;
-  for (size_t i=0; i < heaplimit; ++i){
-    if (heapinfo[i].type == MMALLOC_TYPE_UNFRAGMENTED){
-      if (heapinfo[i].busy_block.busy_size > 0)
-        bytes += heapinfo[i].busy_block.busy_size;
-    } else if (heapinfo[i].type > 0) {
-      for (size_t j=0; j < (size_t) (BLOCKSIZE >> heapinfo[i].type); j++){
-        if(heapinfo[i].busy_frag.frag_size[j] > 0)
-          bytes += heapinfo[i].busy_frag.frag_size[j];
-      }
-    }
-  }
-  return bytes;
-}
index 5b48368..be0070f 100644 (file)
 
 static void initialize(xbt_mheap_t mdp);
 static void *register_morecore(xbt_mheap_t mdp, size_t size);
-static void *align(xbt_mheap_t mdp, size_t size);
+static void* mmalloc_aligned(xbt_mheap_t mdp, size_t size);
 
 /* Allocation aligned on block boundary.
  *
  * It never returns NULL, but dies verbosely on error.
  */
-static void *align(struct mdesc *mdp, size_t size)
+static void* mmalloc_aligned(struct mdesc* mdp, size_t size)
 {
   void *result;
   unsigned long int adj;
@@ -47,13 +47,11 @@ static void *align(struct mdesc *mdp, size_t size)
   return result;
 }
 
-/** Initialize heapinfo about the heapinfo pages :)
- *
- */
+/** Initialize heapinfo about the heapinfo pages :) */
 static void initialize_heapinfo_heapinfo(const s_xbt_mheap_t* mdp)
 {
   // Update heapinfo about the heapinfo pages (!):
-  xbt_assert((uintptr_t) mdp->heapinfo % BLOCKSIZE == 0);
+  mmalloc_assert((uintptr_t)mdp->heapinfo % BLOCKSIZE == 0, "Failed assert in initialize_heapinfo_heapinfo()");
   size_t block   = BLOCK(mdp->heapinfo);
   size_t nblocks = mdp->heapsize * sizeof(malloc_info) / BLOCKSIZE;
   // Mark them as free:
@@ -67,13 +65,12 @@ static void initialize_heapinfo_heapinfo(const s_xbt_mheap_t* mdp)
 }
 
 /* Finish the initialization of the mheap. If we want to inline it
- * properly, we need to make the align function publicly visible, too  */
+ * properly, we need to make the mmalloc_aligned function publicly visible, too  */
 static void initialize(xbt_mheap_t mdp)
 {
   // Update mdp meta-data:
   mdp->heapsize = HEAP / BLOCKSIZE;
-  mdp->heapinfo = (malloc_info *)
-    align(mdp, mdp->heapsize * sizeof(malloc_info));
+  mdp->heapinfo = (malloc_info*)mmalloc_aligned(mdp, mdp->heapsize * sizeof(malloc_info));
   mdp->heapbase = (void *) mdp->heapinfo;
   mdp->flags |= MMALLOC_INITIALIZED;
 
@@ -102,7 +99,7 @@ static inline void update_hook(void **a, size_t offset)
  * into the heap info table as necessary. */
 static void *register_morecore(struct mdesc *mdp, size_t size)
 {
-  void* result = align(mdp, size); // Never returns NULL
+  void* result = mmalloc_aligned(mdp, size); // Never returns NULL
 
   /* Check if we need to grow the info table (in a multiplicative manner)  */
   if ((size_t) BLOCK((char *) result + size) > mdp->heapsize) {
@@ -112,7 +109,7 @@ static void *register_morecore(struct mdesc *mdp, size_t size)
 
     /* Copy old info into new location */
     malloc_info* oldinfo = mdp->heapinfo;
-    malloc_info* newinfo = (malloc_info*)align(mdp, newsize * sizeof(malloc_info));
+    malloc_info* newinfo = (malloc_info*)mmalloc_aligned(mdp, newsize * sizeof(malloc_info));
     memcpy(newinfo, oldinfo, mdp->heapsize * sizeof(malloc_info));
 
     /* Initialize the new blockinfo : */
@@ -217,8 +214,9 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size)
       for (candidate_frag=0;candidate_frag<(size_t) (BLOCKSIZE >> log);candidate_frag++)
         if (candidate_info->busy_frag.frag_size[candidate_frag] == -1)
           break;
-      xbt_assert(candidate_frag < (size_t) (BLOCKSIZE >> log),
-          "Block %zu was registered as containing free fragments of type %zu, but I can't find any",candidate_block,log);
+      mmalloc_assert(candidate_frag < (size_t)(BLOCKSIZE >> log),
+                     "Block %zu was registered as containing free fragments of type %zu, but I can't find any",
+                     candidate_block, log);
 
       result = (void*) (((char*)ADDRESS(candidate_block)) + (candidate_frag << log));
 
index 828e2f5..fcb2fa0 100644 (file)
@@ -10,7 +10,6 @@
 
    Contributed by Fred Fish at Cygnus Support.   fnf@cygnus.com */
 
-#include "src/internal_config.h"
 #include <stdio.h>
 #include <fcntl.h>
 #include <sys/mman.h>
@@ -23,8 +22,7 @@
 #define MAP_ANONYMOUS MAP_ANON
 #endif
 
-#define PAGE_ALIGN(addr) (void*) (((long)(addr) + xbt_pagesize - 1) &   \
-                                  ~((long)xbt_pagesize - 1))
+#define PAGE_ALIGN(addr) (void*)(((long)(addr) + mmalloc_pagesize - 1) & ~((long)mmalloc_pagesize - 1))
 
 /** @brief Add memory to this heap
  *
@@ -49,6 +47,10 @@ void *mmorecore(struct mdesc *mdp, ssize_t size)
     return mdp->breakval;
   }
 
+  if (mmalloc_pagesize == 0) { // Not initialized yet
+    mmalloc_pagesize = (int)sysconf(_SC_PAGESIZE);
+  }
+
   if (size < 0) {
     /* We are deallocating memory.  If the amount requested would cause us to try to deallocate back past the base of
      * the mmap'd region then die verbosely.  Otherwise, deallocate the memory and return the old break value. */
@@ -76,7 +78,8 @@ void *mmorecore(struct mdesc *mdp, ssize_t size)
 
     if (mapto == MAP_FAILED) {
       char buff[1024];
-      fprintf(stderr, "Internal error: mmap returned MAP_FAILED! error: %s\n", strerror(errno));
+      fprintf(stderr, "Internal error: mmap returned MAP_FAILED! pagesize:%d error: %s\n", mmalloc_pagesize,
+              strerror(errno));
       snprintf(buff, 1024, "cat /proc/%d/maps", getpid());
       int status = system(buff);
       if (status == -1 || !(WIFEXITED(status) && WEXITSTATUS(status) == 0))
index 648bd1f..5e380cc 100644 (file)
 #ifndef XBT_MMPRIVATE_H
 #define XBT_MMPRIVATE_H 1
 
-#include <xbt/base.h>
-#include <xbt/misc.h>
-
 #include "swag.h"
 #include "src/internal_config.h"
 #include "xbt/mmalloc.h"
-#include "xbt/ex.h"
-#include "xbt/dynar.h"
 
-#include <pthread.h>
+#include <limits.h>
 #include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
 
-#include <limits.h>
+// This macro is veery similar to xbt_assert, but with no dependency on XBT
+#define mmalloc_assert(cond, ...)                                                                                      \
+  do {                                                                                                                 \
+    if (!(cond)) {                                                                                                     \
+      fprintf(stderr, __VA_ARGS__);                                                                                    \
+      abort();                                                                                                         \
+    }                                                                                                                  \
+  } while (0)
+
+XBT_PUBLIC_DATA int mmalloc_pagesize;
+XBT_PRIVATE xbt_mheap_t mmalloc_preinit(void);
 
 #define MMALLOC_MAGIC    "mmalloc"       /* Mapped file magic number */
 #define MMALLOC_MAGIC_SIZE  8       /* Size of magic number buf */
  * information are kept in fixed length arrays. Here is the computation of
  * that size.
  *
- * Never make SMALLEST_POSSIBLE_MALLOC smaller than sizeof(list) because we
- * need to enlist the free fragments.
+ * Never make SMALLEST_POSSIBLE_MALLOC too small because we need to enlist
+ * the free fragments.
+ *
+ * FIXME: what's the correct size, actually? The used one is a guess.
  */
 
-#define SMALLEST_POSSIBLE_MALLOC (16*sizeof(struct list))
+#define SMALLEST_POSSIBLE_MALLOC (32 * sizeof(void*))
 #define MAX_FRAGMENT_PER_BLOCK (BLOCKSIZE / SMALLEST_POSSIBLE_MALLOC)
 
 /* The difference between two pointers is a signed int.  On machines where
 
 SG_BEGIN_DECL
 
-/* Doubly linked lists of free fragments.  */
-struct list {
-  struct list *next;
-  struct list *prev;
-};
-
 /* Statistics available to the user. */
 struct mstats
 {
@@ -170,9 +173,6 @@ typedef struct {
  * if such a file exists.
  * */
 struct mdesc {
-  /** @brief Mutex locking the access to the heap */
-  pthread_mutex_t mutex;
-
   /** @brief Chained lists of mdescs */
   struct mdesc *next_mdesc;
 
@@ -257,19 +257,18 @@ XBT_PUBLIC_DATA struct mdesc* __mmalloc_default_mdp;
 
 XBT_PUBLIC void* mmorecore(struct mdesc* mdp, ssize_t size);
 
-/** Thread-safety (if the mutex is already created)
- *
- * This is mandatory in the case where the user runs a parallel simulation
- * 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)
-
-XBT_PRIVATE int malloc_use_mmalloc(void);
-
 XBT_PRIVATE size_t mmalloc_get_bytes_used_remote(size_t heaplimit, const malloc_info* heapinfo);
 
+/* We call dlsym during mmalloc initialization, but dlsym uses malloc.
+ * So during mmalloc initialization, any call to malloc is diverted to a private static buffer.
+ */
+extern uint64_t* mmalloc_preinit_buffer;
+#ifdef __FreeBSD__ /* FreeBSD require more memory, other might */
+#define mmalloc_preinit_buffer_size 256
+#else /* Valid on: Linux */
+#define mmalloc_preinit_buffer_size 32
+#endif
+
 SG_END_DECL
 
 #endif
index a3cdcb9..550b89b 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (c) 2004-2022. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2004-2022. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -11,7 +10,7 @@
 /* This type should be added to a type that is to be used in such a swag */
 
 #include "swag.h"
-#include "xbt/asserts.h"
+#include "mmprivate.h" // mmalloc_assert
 
 typedef s_xbt_swag_hookup_t *xbt_swag_hookup_t;
 typedef struct xbt_swag* xbt_swag_t;
@@ -63,11 +62,12 @@ static inline void xbt_swag_init(xbt_swag_t swag, size_t offset)
  */
 static inline void xbt_swag_insert(void *obj, xbt_swag_t swag)
 {
-  xbt_assert(!xbt_swag_belongs(obj, swag) || swag->tail,
-             "This object belongs to an empty swag! Did you correctly initialize the object's hookup?");
+
+  mmalloc_assert(!xbt_swag_belongs(obj, swag) || swag->tail,
+                 "This object belongs to an empty swag! Did you correctly initialize the object's hookup?");
 
   if (!swag->head) {
-    xbt_assert(!(swag->tail), "Inconsistent swag.");
+    mmalloc_assert(!(swag->tail), "Inconsistent swag.");
     swag->head = obj;
     swag->tail = obj;
     swag->count++;
index c88a996..032c741 100644 (file)
@@ -9,8 +9,6 @@
 #ifndef XBT_SWAG_H
 #define XBT_SWAG_H
 
-#include "xbt/sysdep.h" /* size_t */
-
 /*
  * XBT_swag: a O(1) set based on linked lists
  *
index 065f79a..15a5959 100644 (file)
@@ -10,6 +10,7 @@
 #include "simgrid/config.h"
 #include "simgrid/sg_config.hpp"
 #include "src/internal_config.h"
+#include "src/sthread/sthread.h" // sthread_inside_simgrid
 #include "xbt/config.hpp"
 #include "xbt/coverage.h"
 #include "xbt/dynar.h"
@@ -40,6 +41,7 @@ std::string binary_name;          /* Name of the system process containing us (m
 std::vector<std::string> cmdline; /* all we got in argv */
 } // namespace simgrid::xbt
 
+
 int xbt_initialized = 0;
 simgrid::config::Flag<bool> cfg_dbg_clean_atexit{
     "debug/clean-atexit",
@@ -54,6 +56,12 @@ int xbt_pagebits = 0;
  */
 static void xbt_preinit() XBT_ATTRIB_CONSTRUCTOR(200);
 static void xbt_postexit();
+void sthread_enable()
+{ // These symbols are used from ContextSwapped in any case, but they are only useful
+}
+void sthread_disable()
+{ //  when libsthread is LD_PRELOADED. In this case, sthread's implem gets used instead.
+}
 
 #ifdef _WIN32
 #include <windows.h>
@@ -107,9 +115,6 @@ static void xbt_postexit()
   xbt_initialized--;
   xbt_dict_postexit();
   xbt_log_postexit();
-#if SIMGRID_HAVE_MC
-  mmalloc_postexit();
-#endif
 }
 
 /** @brief Initialize the xbt mechanisms. */
@@ -157,3 +162,10 @@ void xbt_abort()
 #endif
   abort();
 }
+
+#ifndef HAVE_SMPI
+int SMPI_is_inited()
+{
+  return false;
+}
+#endif
index 8ed3273..fee5b7b 100644 (file)
@@ -149,7 +149,7 @@ static void test_deref(simgrid::dwarf::ExpressionContext const& state)
 int main()
 {
   auto* process = new simgrid::mc::RemoteProcess(getpid());
-  process->init(nullptr, nullptr, nullptr);
+  process->init(nullptr, nullptr);
 
   simgrid::dwarf::ExpressionContext state;
   state.address_space = (simgrid::mc::AddressSpace*) process;
index 0a1e41e..352a73b 100644 (file)
@@ -123,7 +123,7 @@ int main(int argc, char** argv)
   simgrid::mc::Type* type;
 
   simgrid::mc::RemoteProcess process(getpid());
-  process.init(nullptr, nullptr, nullptr);
+  process.init(nullptr, nullptr);
 
   test_global_variable(process, process.binary_info.get(), "some_local_variable", &some_local_variable, sizeof(int));
 
index 623f4c5..e2dcf82 100644 (file)
@@ -1,8 +1,8 @@
 #!/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:%a@%h)%e%m%n" --log=xbt_cfg.thresh:warning
-> [  0.000000] (0:maestro@) Start a DFS exploration. Reduction is: dpor.
 > [  0.000000] (0:maestro@) Behavior: assert
+> [  0.000000] (0:maestro@) Start a DFS exploration. Reduction is: dpor.
 > [  0.000000] (0:maestro@) **************************
 > [  0.000000] (0:maestro@) *** PROPERTY NOT VALID ***
 > [  0.000000] (0:maestro@) **************************
@@ -13,7 +13,7 @@ $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug assert ${platfdir
 > [  0.000000] (0:maestro@) DFS exploration ended. 27 unique states visited; 22 backtracks (68 transition replays, 19 states visited overall)
 
 $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug printf ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n" --log=xbt_cfg.thresh:warning
-> [  0.000000] (0:maestro@) Start a DFS exploration. Reduction is: dpor.
 > [  0.000000] (0:maestro@) Behavior: printf
+> [  0.000000] (0:maestro@) Start a DFS exploration. Reduction is: dpor.
 > [  0.000000] (1:app@Fafard) Error reached
 > [  0.000000] (0:maestro@) DFS exploration ended. 43 unique states visited; 36 backtracks (108 transition replays, 30 states visited overall)
index f73d665..3b6ffa2 100644 (file)
@@ -1,8 +1,8 @@
 #!/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:%a@%h)%e%m%n" --log=xbt_cfg.thresh:warning
-> [  0.000000] (0:maestro@) Start a DFS exploration. Reduction is: dpor.
 > [  0.000000] (0:maestro@) Behavior: assert
+> [  0.000000] (0:maestro@) Start a DFS exploration. Reduction is: dpor.
 > [  0.000000] (0:maestro@) **************************
 > [  0.000000] (0:maestro@) *** PROPERTY NOT VALID ***
 > [  0.000000] (0:maestro@) **************************
@@ -15,8 +15,8 @@ $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug assert ${platfdir
 ! 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:%a@%h)%e%m%n" --log=xbt_cfg.thresh:warning --log=no_loc
-> [  0.000000] (0:maestro@) Start a DFS exploration. Reduction is: dpor.
 > [  0.000000] (0:maestro@) Behavior: abort
+> [  0.000000] (0:maestro@) Start a DFS exploration. Reduction is: dpor.
 > [  0.000000] (0:maestro@) **************************
 > [  0.000000] (0:maestro@) ** CRASH IN THE PROGRAM **
 > [  0.000000] (0:maestro@) **************************
@@ -29,16 +29,16 @@ $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug abort ${platfdir}
 > [  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:%a@%h)%e%m%n" --log=xbt_cfg.thresh:warning
-> [  0.000000] (0:maestro@) Start a DFS exploration. Reduction is: dpor.
 > [  0.000000] (0:maestro@) Behavior: printf
+> [  0.000000] (0:maestro@) Start a DFS exploration. Reduction is: dpor.
 > [  0.000000] (1:app@Fafard) Error reached
 > [  0.000000] (0:maestro@) DFS exploration ended. 43 unique states visited; 36 backtracks (108 transition replays, 30 states visited overall)
 
 ! expect return 6
 # because SIMGRID_MC_EXIT_PROGRAM_CRASH = 6
 $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug segv ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n" --log=xbt_cfg.thresh:warning --log=no_loc
-> [  0.000000] (0:maestro@) Start a DFS exploration. Reduction is: dpor.
 > [  0.000000] (0:maestro@) Behavior: segv
+> [  0.000000] (0:maestro@) Start a DFS exploration. Reduction is: dpor.
 > Segmentation fault.
 > [  0.000000] (0:maestro@) **************************
 > [  0.000000] (0:maestro@) ** CRASH IN THE PROGRAM **
index 451491b..a61e7c5 100644 (file)
@@ -47,8 +47,6 @@ static void create_environment(xbt_os_timer_t parse_time, const std::string& pla
 static void dump_hosts()
 {
   std::vector<sg4::Host*> hosts = sg4::Engine::get_instance()->get_all_hosts();
-  std::sort(hosts.begin(), hosts.end(),
-            [](const sg4::Host* a, const sg4::Host* b) { return a->get_name() < b->get_name(); });
 
   for (auto const* h : hosts) {
     std::printf("  <host id=\"%s\" speed=\"%.0f\"", h->get_cname(), h->get_speed());
@@ -108,8 +106,6 @@ static void dump_routers()
 static void dump_routes()
 {
   std::vector<sg4::Host*> hosts = sg4::Engine::get_instance()->get_all_hosts();
-  std::sort(hosts.begin(), hosts.end(),
-            [](const sg4::Host* a, const sg4::Host* b) { return a->get_name() < b->get_name(); });
   std::vector<simgrid::kernel::routing::NetPoint*> netpoints = sg4::Engine::get_instance()->get_all_netpoints();
   std::sort(netpoints.begin(), netpoints.end(),
             [](const simgrid::kernel::routing::NetPoint* a, const simgrid::kernel::routing::NetPoint* b) {
index 7c8deab..8b7373e 100644 (file)
@@ -1333,10 +1333,10 @@ $ ${bindir:=.}/flatifier ./cluster_fat_tree_noncontiguous_rad.xml "--log=root.fm
 >   <link_ctn id="bob_cluster_link_0_limiter"/><link_ctn id="link_from_0_7_0_UP"/><link_ctn id="link_from_1_7_1_DOWN"/><link_ctn id="bob_cluster_link_7_limiter"/><link_ctn id="bob_cluster_link_1_limiter"/>
 >   </route>
 >   <route src="node-100.simgrid.org" dst="node-119.simgrid.org">
->   <link_ctn id="bob_cluster_link_0_limiter"/><link_ctn id="link_from_0_7_0_UP"/><link_ctn id="bob_cluster_link_7_limiter"/><link_ctn id="link_from_7_5_4_UP"/><link_ctn id="link_from_6_5_8_DOWN"/><link_ctn id="bob_cluster_link_5_limiter"/><link_ctn id="link_from_2_6_2_DOWN"/><link_ctn id="bob_cluster_link_6_limiter"/><link_ctn id="bob_cluster_link_2_limiter"/>
+>   <link_ctn id="bob_cluster_link_0_limiter"/><link_ctn id="link_from_0_7_0_UP"/><link_ctn id="bob_cluster_link_7_limiter"/><link_ctn id="link_from_7_5_5_UP"/><link_ctn id="link_from_6_5_8_DOWN"/><link_ctn id="bob_cluster_link_5_limiter"/><link_ctn id="link_from_2_6_2_DOWN"/><link_ctn id="bob_cluster_link_6_limiter"/><link_ctn id="bob_cluster_link_2_limiter"/>
 >   </route>
 >   <route src="node-100.simgrid.org" dst="node-120.simgrid.org">
->   <link_ctn id="bob_cluster_link_0_limiter"/><link_ctn id="link_from_0_7_0_UP"/><link_ctn id="bob_cluster_link_7_limiter"/><link_ctn id="link_from_7_4_6_UP"/><link_ctn id="link_from_6_4_10_DOWN"/><link_ctn id="bob_cluster_link_4_limiter"/><link_ctn id="link_from_3_6_3_DOWN"/><link_ctn id="bob_cluster_link_6_limiter"/><link_ctn id="bob_cluster_link_3_limiter"/>
+>   <link_ctn id="bob_cluster_link_0_limiter"/><link_ctn id="link_from_0_7_0_UP"/><link_ctn id="bob_cluster_link_7_limiter"/><link_ctn id="link_from_7_4_7_UP"/><link_ctn id="link_from_6_4_10_DOWN"/><link_ctn id="bob_cluster_link_4_limiter"/><link_ctn id="link_from_3_6_3_DOWN"/><link_ctn id="bob_cluster_link_6_limiter"/><link_ctn id="bob_cluster_link_3_limiter"/>
 >   </route>
 >   <route src="node-101.simgrid.org" dst="node-100.simgrid.org">
 >   <link_ctn id="bob_cluster_link_1_limiter"/><link_ctn id="link_from_1_7_1_UP"/><link_ctn id="link_from_0_7_0_DOWN"/><link_ctn id="bob_cluster_link_7_limiter"/><link_ctn id="bob_cluster_link_0_limiter"/>
@@ -1345,10 +1345,10 @@ $ ${bindir:=.}/flatifier ./cluster_fat_tree_noncontiguous_rad.xml "--log=root.fm
 >   <link_ctn id="bob_cluster_link_101_loopback"/>
 >   </route>
 >   <route src="node-101.simgrid.org" dst="node-119.simgrid.org">
->   <link_ctn id="bob_cluster_link_1_limiter"/><link_ctn id="link_from_1_7_1_UP"/><link_ctn id="bob_cluster_link_7_limiter"/><link_ctn id="link_from_7_5_4_UP"/><link_ctn id="link_from_6_5_8_DOWN"/><link_ctn id="bob_cluster_link_5_limiter"/><link_ctn id="link_from_2_6_2_DOWN"/><link_ctn id="bob_cluster_link_6_limiter"/><link_ctn id="bob_cluster_link_2_limiter"/>
+>   <link_ctn id="bob_cluster_link_1_limiter"/><link_ctn id="link_from_1_7_1_UP"/><link_ctn id="bob_cluster_link_7_limiter"/><link_ctn id="link_from_7_5_5_UP"/><link_ctn id="link_from_6_5_9_DOWN"/><link_ctn id="bob_cluster_link_5_limiter"/><link_ctn id="link_from_2_6_2_DOWN"/><link_ctn id="bob_cluster_link_6_limiter"/><link_ctn id="bob_cluster_link_2_limiter"/>
 >   </route>
 >   <route src="node-101.simgrid.org" dst="node-120.simgrid.org">
->   <link_ctn id="bob_cluster_link_1_limiter"/><link_ctn id="link_from_1_7_1_UP"/><link_ctn id="bob_cluster_link_7_limiter"/><link_ctn id="link_from_7_4_6_UP"/><link_ctn id="link_from_6_4_10_DOWN"/><link_ctn id="bob_cluster_link_4_limiter"/><link_ctn id="link_from_3_6_3_DOWN"/><link_ctn id="bob_cluster_link_6_limiter"/><link_ctn id="bob_cluster_link_3_limiter"/>
+>   <link_ctn id="bob_cluster_link_1_limiter"/><link_ctn id="link_from_1_7_1_UP"/><link_ctn id="bob_cluster_link_7_limiter"/><link_ctn id="link_from_7_4_7_UP"/><link_ctn id="link_from_6_4_11_DOWN"/><link_ctn id="bob_cluster_link_4_limiter"/><link_ctn id="link_from_3_6_3_DOWN"/><link_ctn id="bob_cluster_link_6_limiter"/><link_ctn id="bob_cluster_link_3_limiter"/>
 >   </route>
 >   <route src="node-119.simgrid.org" dst="node-100.simgrid.org">
 >   <link_ctn id="bob_cluster_link_2_limiter"/><link_ctn id="link_from_2_6_2_UP"/><link_ctn id="bob_cluster_link_6_limiter"/><link_ctn id="link_from_6_5_8_UP"/><link_ctn id="link_from_7_5_4_DOWN"/><link_ctn id="bob_cluster_link_5_limiter"/><link_ctn id="link_from_0_7_0_DOWN"/><link_ctn id="bob_cluster_link_7_limiter"/><link_ctn id="bob_cluster_link_0_limiter"/>
@@ -1363,10 +1363,10 @@ $ ${bindir:=.}/flatifier ./cluster_fat_tree_noncontiguous_rad.xml "--log=root.fm
 >   <link_ctn id="bob_cluster_link_2_limiter"/><link_ctn id="link_from_2_6_2_UP"/><link_ctn id="link_from_3_6_3_DOWN"/><link_ctn id="bob_cluster_link_6_limiter"/><link_ctn id="bob_cluster_link_3_limiter"/>
 >   </route>
 >   <route src="node-120.simgrid.org" dst="node-100.simgrid.org">
->   <link_ctn id="bob_cluster_link_3_limiter"/><link_ctn id="link_from_3_6_3_UP"/><link_ctn id="bob_cluster_link_6_limiter"/><link_ctn id="link_from_6_5_8_UP"/><link_ctn id="link_from_7_5_4_DOWN"/><link_ctn id="bob_cluster_link_5_limiter"/><link_ctn id="link_from_0_7_0_DOWN"/><link_ctn id="bob_cluster_link_7_limiter"/><link_ctn id="bob_cluster_link_0_limiter"/>
+>   <link_ctn id="bob_cluster_link_3_limiter"/><link_ctn id="link_from_3_6_3_UP"/><link_ctn id="bob_cluster_link_6_limiter"/><link_ctn id="link_from_6_5_8_UP"/><link_ctn id="link_from_7_5_5_DOWN"/><link_ctn id="bob_cluster_link_5_limiter"/><link_ctn id="link_from_0_7_0_DOWN"/><link_ctn id="bob_cluster_link_7_limiter"/><link_ctn id="bob_cluster_link_0_limiter"/>
 >   </route>
 >   <route src="node-120.simgrid.org" dst="node-101.simgrid.org">
->   <link_ctn id="bob_cluster_link_3_limiter"/><link_ctn id="link_from_3_6_3_UP"/><link_ctn id="bob_cluster_link_6_limiter"/><link_ctn id="link_from_6_4_10_UP"/><link_ctn id="link_from_7_4_6_DOWN"/><link_ctn id="bob_cluster_link_4_limiter"/><link_ctn id="link_from_1_7_1_DOWN"/><link_ctn id="bob_cluster_link_7_limiter"/><link_ctn id="bob_cluster_link_1_limiter"/>
+>   <link_ctn id="bob_cluster_link_3_limiter"/><link_ctn id="link_from_3_6_3_UP"/><link_ctn id="bob_cluster_link_6_limiter"/><link_ctn id="link_from_6_4_10_UP"/><link_ctn id="link_from_7_4_7_DOWN"/><link_ctn id="bob_cluster_link_4_limiter"/><link_ctn id="link_from_1_7_1_DOWN"/><link_ctn id="bob_cluster_link_7_limiter"/><link_ctn id="bob_cluster_link_1_limiter"/>
 >   </route>
 >   <route src="node-120.simgrid.org" dst="node-119.simgrid.org">
 >   <link_ctn id="bob_cluster_link_3_limiter"/><link_ctn id="link_from_3_6_3_UP"/><link_ctn id="link_from_2_6_2_DOWN"/><link_ctn id="bob_cluster_link_6_limiter"/><link_ctn id="bob_cluster_link_2_limiter"/>
index 75b0c8b..6333844 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <simgrid/s4u.hpp>
 #include <vector>
+#include <iostream>
 
 static void runner()
 {
@@ -30,10 +31,14 @@ int main(int argc, char* argv[])
              argv[0], argv[0]);
 
   const char* platform_file = argv[1];
-  e.load_platform(platform_file);
 
-  simgrid::s4u::Actor::create("actor", e.host_by_name("c1_0"), runner);
+  try {
+    e.load_platform(platform_file);
+    simgrid::s4u::Actor::create("actor", e.host_by_name("c1_0"), runner);
+    e.run();
+  } catch (const simgrid::AssertionError& e) {
+    std::cout << e.what() << "\n";
+  }
 
-  e.run();
   return 0;
 }
index 18a7cca..356449e 100644 (file)
@@ -1,5 +1,4 @@
-! expect signal SIGIOT
 $ $VALGRIND_NO_LEAK_CHECK ${bindir:=.}/issue71 ${srcdir:=.}/platform_bad.xml "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n" --log=no_loc
 > [  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] (0:maestro@) Invalid NetzoneRoute from cluster1@router_c2 to cluster2@router_c1: gw_src router_c2 belongs to cluster2, not to cluster1.
+> Invalid NetzoneRoute from cluster1@router_c2 to cluster2@router_c1: gw_src router_c2 belongs to cluster2, not to cluster1.
index 0b5bab8..8edee11 100644 (file)
@@ -50,7 +50,6 @@ set(tesh_files    ${tesh_files}     ${CMAKE_CURRENT_SOURCE_DIR}/coll-allreduce/c
                                     ${CMAKE_CURRENT_SOURCE_DIR}/coll-allreduce/coll-allreduce-papi.tesh
                                     ${CMAKE_CURRENT_SOURCE_DIR}/coll-allreduce-with-leaks/mc-coll-allreduce-with-leaks.tesh
                                     ${CMAKE_CURRENT_SOURCE_DIR}/coll-alltoall/clusters.tesh
-                                    ${CMAKE_CURRENT_SOURCE_DIR}/coll-alltoall/griffon.tesh
                                     ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt-pingpong/broken_hostfiles.tesh
                                     ${CMAKE_CURRENT_SOURCE_DIR}/pt2pt-pingpong/TI_output.tesh
                                     ${CMAKE_CURRENT_SOURCE_DIR}/fort_args/fort_args.tesh  PARENT_SCOPE)
index 4ffce51..2010817 100644 (file)
@@ -2,11 +2,11 @@
 
 p Test allreduce
 $ $VALGRIND_NO_LEAK_CHECK ${bindir:=.}/../../../smpi_script/bin/smpirun -wrapper "${bindir:=.}/../../../bin/simgrid-mc" -map -hostfile ../hostfile_coll -platform  ${platfdir:=.}/small_platform.xml -np 4 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allreduce-with-leaks --log=smpi_config.thres:warning --cfg=smpi/display-allocs:yes --cfg=smpi/simulate-computation:no --log=smpi_coll.thres:error --log=smpi_mpi.thres:error --log=smpi_pmpi.thres:error --cfg=smpi/list-leaks:10 --log=no_loc
-> [0.000000] [mc_dfs/INFO] Start a DFS exploration. Reduction is: dpor.
 > [0.000000] [smpi/INFO] [rank 0] -> Tremblay
 > [0.000000] [smpi/INFO] [rank 1] -> Tremblay
 > [0.000000] [smpi/INFO] [rank 2] -> Tremblay
 > [0.000000] [smpi/INFO] [rank 3] -> Tremblay
+> [0.000000] [mc_dfs/INFO] Start a DFS exploration. Reduction is: dpor.
 > [0.000000] [smpi_utils/INFO] Probable memory leaks in your code: SMPI detected 8 unfreed MPI handles:
 > [0.000000] [smpi_utils/WARNING] To get more information (location of allocations), compile your code with -trace-call-location flag of smpicc/f90
 > [0.000000] [smpi_utils/INFO] 4 leaked handles of type MPI_Comm
index 940489f..fff9336 100644 (file)
@@ -2,7 +2,7 @@
 
 p Test allreduce
 ! output sort
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ${platfdir:=.}/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allreduce --log=smpi_config.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:%a@%h)%e%m%n" --log=smpi_mpi.thres:error --log=smpi_pmpi.thres:error
+$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_coll -platform ${platfdir:=.}/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allreduce --log=smpi_config.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:%a@%h)%e%m%n" --log=smpi_mpi.thres:error --log=smpi_pmpi.thres:error  --log=root.app:stdout
 > [  0.000000] (0:maestro@) [rank 0] -> Tremblay
 > [  0.000000] (0:maestro@) [rank 1] -> Tremblay
 > [  0.000000] (0:maestro@) [rank 2] -> Tremblay
diff --git a/teshsuite/smpi/coll-alltoall/griffon.tesh b/teshsuite/smpi/coll-alltoall/griffon.tesh
deleted file mode 100644 (file)
index 46aec20..0000000
+++ /dev/null
@@ -1,521 +0,0 @@
-# Smpi Alltoall on various cluster files, with several routings
-! 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_config.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error --log=smpi_pmpi.thres:error
-> [0.000000] [smpi/INFO] [rank 0] -> node-0.simgrid.org
-> [0.000000] [smpi/INFO] [rank 1] -> node-1.simgrid.org
-> [0.000000] [smpi/INFO] [rank 2] -> node-2.simgrid.org
-> [0.000000] [smpi/INFO] [rank 3] -> node-3.simgrid.org
-> [0.000000] [smpi/INFO] [rank 4] -> node-4.simgrid.org
-> [0.000000] [smpi/INFO] [rank 5] -> node-5.simgrid.org
-> [0.000000] [smpi/INFO] [rank 6] -> node-6.simgrid.org
-> [0.000000] [smpi/INFO] [rank 7] -> node-7.simgrid.org
-> [0.000000] [smpi/INFO] [rank 8] -> node-8.simgrid.org
-> [0.000000] [smpi/INFO] [rank 9] -> node-9.simgrid.org
-> [0.000000] [smpi/INFO] [rank 10] -> node-10.simgrid.org
-> [0.000000] [smpi/INFO] [rank 11] -> node-11.simgrid.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 ]
-> [3] sndbuf=[36 37 38 39 40 41 42 43 44 45 46 47 ]
-> [4] sndbuf=[48 49 50 51 52 53 54 55 56 57 58 59 ]
-> [5] sndbuf=[60 61 62 63 64 65 66 67 68 69 70 71 ]
-> [6] sndbuf=[72 73 74 75 76 77 78 79 80 81 82 83 ]
-> [7] sndbuf=[84 85 86 87 88 89 90 91 92 93 94 95 ]
-> [8] sndbuf=[96 97 98 99 100 101 102 103 104 105 106 107 ]
-> [9] sndbuf=[108 109 110 111 112 113 114 115 116 117 118 119 ]
-> [10] sndbuf=[120 121 122 123 124 125 126 127 128 129 130 131 ]
-> [11] sndbuf=[132 133 134 135 136 137 138 139 140 141 142 143 ]
-> [0] rcvbuf=[0 12 24 36 48 60 72 84 96 108 120 132 ]
-> [10] rcvbuf=[10 22 34 46 58 70 82 94 106 118 130 142 ]
-> [11] rcvbuf=[11 23 35 47 59 71 83 95 107 119 131 143 ]
-> [8] rcvbuf=[8 20 32 44 56 68 80 92 104 116 128 140 ]
-> [3] rcvbuf=[3 15 27 39 51 63 75 87 99 111 123 135 ]
-> [2] rcvbuf=[2 14 26 38 50 62 74 86 98 110 122 134 ]
-> [6] rcvbuf=[6 18 30 42 54 66 78 90 102 114 126 138 ]
-> [7] rcvbuf=[7 19 31 43 55 67 79 91 103 115 127 139 ]
-> [4] rcvbuf=[4 16 28 40 52 64 76 88 100 112 124 136 ]
-> [9] rcvbuf=[9 21 33 45 57 69 81 93 105 117 129 141 ]
-> [5] rcvbuf=[5 17 29 41 53 65 77 89 101 113 125 137 ]
-> [1] rcvbuf=[1 13 25 37 49 61 73 85 97 109 121 133 ]
-
-! output sort
-p Test separate clusters
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -platform ${platfdir:=.}/cluster_multi.xml -np 12 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_config.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error --log=smpi_pmpi.thres:error
-> [0.000000] [smpi/INFO] [rank 0] -> node-0.1core.org
-> [0.000000] [smpi/INFO] [rank 1] -> node-1.1core.org
-> [0.000000] [smpi/INFO] [rank 2] -> node-2.1core.org
-> [0.000000] [smpi/INFO] [rank 3] -> node-3.1core.org
-> [0.000000] [smpi/INFO] [rank 4] -> node-4.1core.org
-> [0.000000] [smpi/INFO] [rank 5] -> node-5.1core.org
-> [0.000000] [smpi/INFO] [rank 6] -> node-6.1core.org
-> [0.000000] [smpi/INFO] [rank 7] -> node-0.2cores.org
-> [0.000000] [smpi/INFO] [rank 8] -> node-1.2cores.org
-> [0.000000] [smpi/INFO] [rank 9] -> node-2.2cores.org
-> [0.000000] [smpi/INFO] [rank 10] -> node-3.2cores.org
-> [0.000000] [smpi/INFO] [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 ]
-> [3] sndbuf=[36 37 38 39 40 41 42 43 44 45 46 47 ]
-> [4] sndbuf=[48 49 50 51 52 53 54 55 56 57 58 59 ]
-> [5] sndbuf=[60 61 62 63 64 65 66 67 68 69 70 71 ]
-> [6] sndbuf=[72 73 74 75 76 77 78 79 80 81 82 83 ]
-> [7] sndbuf=[84 85 86 87 88 89 90 91 92 93 94 95 ]
-> [8] sndbuf=[96 97 98 99 100 101 102 103 104 105 106 107 ]
-> [9] sndbuf=[108 109 110 111 112 113 114 115 116 117 118 119 ]
-> [10] sndbuf=[120 121 122 123 124 125 126 127 128 129 130 131 ]
-> [11] sndbuf=[132 133 134 135 136 137 138 139 140 141 142 143 ]
-> [0] rcvbuf=[0 12 24 36 48 60 72 84 96 108 120 132 ]
-> [10] rcvbuf=[10 22 34 46 58 70 82 94 106 118 130 142 ]
-> [11] rcvbuf=[11 23 35 47 59 71 83 95 107 119 131 143 ]
-> [8] rcvbuf=[8 20 32 44 56 68 80 92 104 116 128 140 ]
-> [3] rcvbuf=[3 15 27 39 51 63 75 87 99 111 123 135 ]
-> [2] rcvbuf=[2 14 26 38 50 62 74 86 98 110 122 134 ]
-> [6] rcvbuf=[6 18 30 42 54 66 78 90 102 114 126 138 ]
-> [7] rcvbuf=[7 19 31 43 55 67 79 91 103 115 127 139 ]
-> [4] rcvbuf=[4 16 28 40 52 64 76 88 100 112 124 136 ]
-> [9] rcvbuf=[9 21 33 45 57 69 81 93 105 117 129 141 ]
-> [5] rcvbuf=[5 17 29 41 53 65 77 89 101 113 125 137 ]
-> [1] rcvbuf=[1 13 25 37 49 61 73 85 97 109 121 133 ]
-
-! output sort
-p Test torus
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_cluster -platform ${platfdir:=.}/cluster_torus.xml -np 12 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_config.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error --log=smpi_pmpi.thres:error
-> [0.000000] [smpi/INFO] [rank 0] -> node-0.simgrid.org
-> [0.000000] [smpi/INFO] [rank 1] -> node-1.simgrid.org
-> [0.000000] [smpi/INFO] [rank 2] -> node-2.simgrid.org
-> [0.000000] [smpi/INFO] [rank 3] -> node-3.simgrid.org
-> [0.000000] [smpi/INFO] [rank 4] -> node-4.simgrid.org
-> [0.000000] [smpi/INFO] [rank 5] -> node-5.simgrid.org
-> [0.000000] [smpi/INFO] [rank 6] -> node-6.simgrid.org
-> [0.000000] [smpi/INFO] [rank 7] -> node-7.simgrid.org
-> [0.000000] [smpi/INFO] [rank 8] -> node-8.simgrid.org
-> [0.000000] [smpi/INFO] [rank 9] -> node-9.simgrid.org
-> [0.000000] [smpi/INFO] [rank 10] -> node-10.simgrid.org
-> [0.000000] [smpi/INFO] [rank 11] -> node-11.simgrid.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 ]
-> [3] sndbuf=[36 37 38 39 40 41 42 43 44 45 46 47 ]
-> [4] sndbuf=[48 49 50 51 52 53 54 55 56 57 58 59 ]
-> [5] sndbuf=[60 61 62 63 64 65 66 67 68 69 70 71 ]
-> [6] sndbuf=[72 73 74 75 76 77 78 79 80 81 82 83 ]
-> [7] sndbuf=[84 85 86 87 88 89 90 91 92 93 94 95 ]
-> [8] sndbuf=[96 97 98 99 100 101 102 103 104 105 106 107 ]
-> [9] sndbuf=[108 109 110 111 112 113 114 115 116 117 118 119 ]
-> [10] sndbuf=[120 121 122 123 124 125 126 127 128 129 130 131 ]
-> [11] sndbuf=[132 133 134 135 136 137 138 139 140 141 142 143 ]
-> [0] rcvbuf=[0 12 24 36 48 60 72 84 96 108 120 132 ]
-> [10] rcvbuf=[10 22 34 46 58 70 82 94 106 118 130 142 ]
-> [11] rcvbuf=[11 23 35 47 59 71 83 95 107 119 131 143 ]
-> [8] rcvbuf=[8 20 32 44 56 68 80 92 104 116 128 140 ]
-> [3] rcvbuf=[3 15 27 39 51 63 75 87 99 111 123 135 ]
-> [2] rcvbuf=[2 14 26 38 50 62 74 86 98 110 122 134 ]
-> [6] rcvbuf=[6 18 30 42 54 66 78 90 102 114 126 138 ]
-> [7] rcvbuf=[7 19 31 43 55 67 79 91 103 115 127 139 ]
-> [4] rcvbuf=[4 16 28 40 52 64 76 88 100 112 124 136 ]
-> [9] rcvbuf=[9 21 33 45 57 69 81 93 105 117 129 141 ]
-> [5] rcvbuf=[5 17 29 41 53 65 77 89 101 113 125 137 ]
-> [1] rcvbuf=[1 13 25 37 49 61 73 85 97 109 121 133 ]
-
-! output sort
-p Test fat tree
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_cluster -platform ${platfdir:=.}/cluster_fat_tree.xml -np 12 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_config.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error --log=smpi_pmpi.thres:error
-> [0.000000] [smpi/INFO] [rank 0] -> node-0.simgrid.org
-> [0.000000] [smpi/INFO] [rank 1] -> node-1.simgrid.org
-> [0.000000] [smpi/INFO] [rank 2] -> node-2.simgrid.org
-> [0.000000] [smpi/INFO] [rank 3] -> node-3.simgrid.org
-> [0.000000] [smpi/INFO] [rank 4] -> node-4.simgrid.org
-> [0.000000] [smpi/INFO] [rank 5] -> node-5.simgrid.org
-> [0.000000] [smpi/INFO] [rank 6] -> node-6.simgrid.org
-> [0.000000] [smpi/INFO] [rank 7] -> node-7.simgrid.org
-> [0.000000] [smpi/INFO] [rank 8] -> node-8.simgrid.org
-> [0.000000] [smpi/INFO] [rank 9] -> node-9.simgrid.org
-> [0.000000] [smpi/INFO] [rank 10] -> node-10.simgrid.org
-> [0.000000] [smpi/INFO] [rank 11] -> node-11.simgrid.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 ]
-> [3] sndbuf=[36 37 38 39 40 41 42 43 44 45 46 47 ]
-> [4] sndbuf=[48 49 50 51 52 53 54 55 56 57 58 59 ]
-> [5] sndbuf=[60 61 62 63 64 65 66 67 68 69 70 71 ]
-> [6] sndbuf=[72 73 74 75 76 77 78 79 80 81 82 83 ]
-> [7] sndbuf=[84 85 86 87 88 89 90 91 92 93 94 95 ]
-> [8] sndbuf=[96 97 98 99 100 101 102 103 104 105 106 107 ]
-> [9] sndbuf=[108 109 110 111 112 113 114 115 116 117 118 119 ]
-> [10] sndbuf=[120 121 122 123 124 125 126 127 128 129 130 131 ]
-> [11] sndbuf=[132 133 134 135 136 137 138 139 140 141 142 143 ]
-> [0] rcvbuf=[0 12 24 36 48 60 72 84 96 108 120 132 ]
-> [10] rcvbuf=[10 22 34 46 58 70 82 94 106 118 130 142 ]
-> [11] rcvbuf=[11 23 35 47 59 71 83 95 107 119 131 143 ]
-> [8] rcvbuf=[8 20 32 44 56 68 80 92 104 116 128 140 ]
-> [3] rcvbuf=[3 15 27 39 51 63 75 87 99 111 123 135 ]
-> [2] rcvbuf=[2 14 26 38 50 62 74 86 98 110 122 134 ]
-> [6] rcvbuf=[6 18 30 42 54 66 78 90 102 114 126 138 ]
-> [7] rcvbuf=[7 19 31 43 55 67 79 91 103 115 127 139 ]
-> [4] rcvbuf=[4 16 28 40 52 64 76 88 100 112 124 136 ]
-> [9] rcvbuf=[9 21 33 45 57 69 81 93 105 117 129 141 ]
-> [5] rcvbuf=[5 17 29 41 53 65 77 89 101 113 125 137 ]
-> [1] rcvbuf=[1 13 25 37 49 61 73 85 97 109 121 133 ]
-
-! output sort
-p Test fat tree IB
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_cluster -platform ${platfdir:=.}/cluster_fat_tree.xml -np 12 --cfg=network/model:IB --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_config.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error --log=smpi_pmpi.thres:error
-> [0.000000] [smpi/INFO] [rank 0] -> node-0.simgrid.org
-> [0.000000] [smpi/INFO] [rank 1] -> node-1.simgrid.org
-> [0.000000] [smpi/INFO] [rank 2] -> node-2.simgrid.org
-> [0.000000] [smpi/INFO] [rank 3] -> node-3.simgrid.org
-> [0.000000] [smpi/INFO] [rank 4] -> node-4.simgrid.org
-> [0.000000] [smpi/INFO] [rank 5] -> node-5.simgrid.org
-> [0.000000] [smpi/INFO] [rank 6] -> node-6.simgrid.org
-> [0.000000] [smpi/INFO] [rank 7] -> node-7.simgrid.org
-> [0.000000] [smpi/INFO] [rank 8] -> node-8.simgrid.org
-> [0.000000] [smpi/INFO] [rank 9] -> node-9.simgrid.org
-> [0.000000] [smpi/INFO] [rank 10] -> node-10.simgrid.org
-> [0.000000] [smpi/INFO] [rank 11] -> node-11.simgrid.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 ]
-> [3] sndbuf=[36 37 38 39 40 41 42 43 44 45 46 47 ]
-> [4] sndbuf=[48 49 50 51 52 53 54 55 56 57 58 59 ]
-> [5] sndbuf=[60 61 62 63 64 65 66 67 68 69 70 71 ]
-> [6] sndbuf=[72 73 74 75 76 77 78 79 80 81 82 83 ]
-> [7] sndbuf=[84 85 86 87 88 89 90 91 92 93 94 95 ]
-> [8] sndbuf=[96 97 98 99 100 101 102 103 104 105 106 107 ]
-> [9] sndbuf=[108 109 110 111 112 113 114 115 116 117 118 119 ]
-> [10] sndbuf=[120 121 122 123 124 125 126 127 128 129 130 131 ]
-> [11] sndbuf=[132 133 134 135 136 137 138 139 140 141 142 143 ]
-> [0] rcvbuf=[0 12 24 36 48 60 72 84 96 108 120 132 ]
-> [10] rcvbuf=[10 22 34 46 58 70 82 94 106 118 130 142 ]
-> [11] rcvbuf=[11 23 35 47 59 71 83 95 107 119 131 143 ]
-> [8] rcvbuf=[8 20 32 44 56 68 80 92 104 116 128 140 ]
-> [3] rcvbuf=[3 15 27 39 51 63 75 87 99 111 123 135 ]
-> [2] rcvbuf=[2 14 26 38 50 62 74 86 98 110 122 134 ]
-> [6] rcvbuf=[6 18 30 42 54 66 78 90 102 114 126 138 ]
-> [7] rcvbuf=[7 19 31 43 55 67 79 91 103 115 127 139 ]
-> [4] rcvbuf=[4 16 28 40 52 64 76 88 100 112 124 136 ]
-> [9] rcvbuf=[9 21 33 45 57 69 81 93 105 117 129 141 ]
-> [5] rcvbuf=[5 17 29 41 53 65 77 89 101 113 125 137 ]
-> [1] rcvbuf=[1 13 25 37 49 61 73 85 97 109 121 133 ]
-
-! output sort
-p Test Dragonfly
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_cluster -platform ${platfdir:=.}/cluster_dragonfly.xml -np 12 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_config.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error --log=smpi_pmpi.thres:error
-> [0.000000] [smpi/INFO] [rank 0] -> node-0.simgrid.org
-> [0.000000] [smpi/INFO] [rank 1] -> node-1.simgrid.org
-> [0.000000] [smpi/INFO] [rank 2] -> node-2.simgrid.org
-> [0.000000] [smpi/INFO] [rank 3] -> node-3.simgrid.org
-> [0.000000] [smpi/INFO] [rank 4] -> node-4.simgrid.org
-> [0.000000] [smpi/INFO] [rank 5] -> node-5.simgrid.org
-> [0.000000] [smpi/INFO] [rank 6] -> node-6.simgrid.org
-> [0.000000] [smpi/INFO] [rank 7] -> node-7.simgrid.org
-> [0.000000] [smpi/INFO] [rank 8] -> node-8.simgrid.org
-> [0.000000] [smpi/INFO] [rank 9] -> node-9.simgrid.org
-> [0.000000] [smpi/INFO] [rank 10] -> node-10.simgrid.org
-> [0.000000] [smpi/INFO] [rank 11] -> node-11.simgrid.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 ]
-> [3] sndbuf=[36 37 38 39 40 41 42 43 44 45 46 47 ]
-> [4] sndbuf=[48 49 50 51 52 53 54 55 56 57 58 59 ]
-> [5] sndbuf=[60 61 62 63 64 65 66 67 68 69 70 71 ]
-> [6] sndbuf=[72 73 74 75 76 77 78 79 80 81 82 83 ]
-> [7] sndbuf=[84 85 86 87 88 89 90 91 92 93 94 95 ]
-> [8] sndbuf=[96 97 98 99 100 101 102 103 104 105 106 107 ]
-> [9] sndbuf=[108 109 110 111 112 113 114 115 116 117 118 119 ]
-> [10] sndbuf=[120 121 122 123 124 125 126 127 128 129 130 131 ]
-> [11] sndbuf=[132 133 134 135 136 137 138 139 140 141 142 143 ]
-> [0] rcvbuf=[0 12 24 36 48 60 72 84 96 108 120 132 ]
-> [10] rcvbuf=[10 22 34 46 58 70 82 94 106 118 130 142 ]
-> [11] rcvbuf=[11 23 35 47 59 71 83 95 107 119 131 143 ]
-> [8] rcvbuf=[8 20 32 44 56 68 80 92 104 116 128 140 ]
-> [3] rcvbuf=[3 15 27 39 51 63 75 87 99 111 123 135 ]
-> [2] rcvbuf=[2 14 26 38 50 62 74 86 98 110 122 134 ]
-> [6] rcvbuf=[6 18 30 42 54 66 78 90 102 114 126 138 ]
-> [7] rcvbuf=[7 19 31 43 55 67 79 91 103 115 127 139 ]
-> [4] rcvbuf=[4 16 28 40 52 64 76 88 100 112 124 136 ]
-> [9] rcvbuf=[9 21 33 45 57 69 81 93 105 117 129 141 ]
-> [5] rcvbuf=[5 17 29 41 53 65 77 89 101 113 125 137 ]
-> [1] rcvbuf=[1 13 25 37 49 61 73 85 97 109 121 133 ]
-
-! output sort
-p Test Griffon
-$ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_griffon -platform ${platfdir:=.}/griffon.xml -np 92 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-alltoall -q --log=smpi_config.thres:warning --log=smpi_coll.thres:error --log=smpi_mpi.thres:error --log=smpi_pmpi.thres:error
-> [0.000000] [smpi/INFO] [rank 0] -> griffon-1.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 1] -> griffon-2.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 2] -> griffon-3.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 3] -> griffon-4.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 4] -> griffon-5.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 5] -> griffon-6.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 6] -> griffon-7.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 7] -> griffon-8.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 8] -> griffon-9.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 9] -> griffon-10.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 10] -> griffon-11.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 11] -> griffon-12.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 12] -> griffon-13.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 13] -> griffon-14.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 14] -> griffon-15.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 15] -> griffon-16.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 16] -> griffon-17.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 17] -> griffon-18.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 18] -> griffon-19.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 19] -> griffon-20.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 20] -> griffon-21.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 21] -> griffon-22.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 22] -> griffon-23.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 23] -> griffon-24.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 24] -> griffon-25.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 25] -> griffon-26.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 26] -> griffon-27.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 27] -> griffon-28.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 28] -> griffon-29.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 29] -> griffon-30.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 30] -> griffon-31.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 31] -> griffon-32.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 32] -> griffon-33.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 33] -> griffon-34.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 34] -> griffon-35.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 35] -> griffon-36.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 36] -> griffon-37.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 37] -> griffon-38.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 38] -> griffon-39.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 39] -> griffon-40.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 40] -> griffon-41.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 41] -> griffon-42.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 42] -> griffon-43.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 43] -> griffon-44.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 44] -> griffon-45.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 45] -> griffon-46.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 46] -> griffon-47.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 47] -> griffon-48.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 48] -> griffon-49.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 49] -> griffon-50.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 50] -> griffon-51.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 51] -> griffon-52.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 52] -> griffon-53.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 53] -> griffon-54.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 54] -> griffon-55.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 55] -> griffon-56.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 56] -> griffon-57.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 57] -> griffon-58.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 58] -> griffon-59.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 59] -> griffon-60.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 60] -> griffon-61.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 61] -> griffon-62.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 62] -> griffon-63.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 63] -> griffon-64.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 64] -> griffon-65.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 65] -> griffon-66.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 66] -> griffon-67.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 67] -> griffon-68.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 68] -> griffon-69.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 69] -> griffon-70.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 70] -> griffon-71.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 71] -> griffon-72.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 72] -> griffon-73.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 73] -> griffon-74.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 74] -> griffon-75.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 75] -> griffon-76.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 76] -> griffon-77.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 77] -> griffon-78.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 78] -> griffon-79.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 79] -> griffon-80.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 80] -> griffon-81.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 81] -> griffon-82.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 82] -> griffon-83.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 83] -> griffon-84.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 84] -> griffon-85.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 85] -> griffon-86.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 86] -> griffon-87.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 87] -> griffon-88.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 88] -> griffon-89.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 89] -> griffon-90.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 90] -> griffon-91.nancy.grid5000.fr
-> [0.000000] [smpi/INFO] [rank 91] -> griffon-92.nancy.grid5000.fr
-> [0] sndbuf=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 ]
-> [1] sndbuf=[92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 ]
-> [2] sndbuf=[184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 ]
-> [3] sndbuf=[276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 ]
-> [4] sndbuf=[368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 ]
-> [5] sndbuf=[460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 ]
-> [6] sndbuf=[552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 ]
-> [7] sndbuf=[644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 ]
-> [8] sndbuf=[736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 ]
-> [9] sndbuf=[828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 ]
-> [10] sndbuf=[920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 ]
-> [11] sndbuf=[1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 ]
-> [12] sndbuf=[1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 ]
-> [13] sndbuf=[1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 ]
-> [14] sndbuf=[1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 ]
-> [15] sndbuf=[1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 ]
-> [16] sndbuf=[1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 ]
-> [17] sndbuf=[1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 ]
-> [18] sndbuf=[1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 ]
-> [19] sndbuf=[1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 ]
-> [20] sndbuf=[1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 ]
-> [21] sndbuf=[1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 ]
-> [22] sndbuf=[2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 ]
-> [23] sndbuf=[2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 ]
-> [24] sndbuf=[2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 ]
-> [25] sndbuf=[2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 ]
-> [26] sndbuf=[2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 ]
-> [27] sndbuf=[2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 ]
-> [28] sndbuf=[2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 ]
-> [29] sndbuf=[2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 ]
-> [30] sndbuf=[2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 ]
-> [31] sndbuf=[2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 ]
-> [32] sndbuf=[2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 ]
-> [33] sndbuf=[3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 ]
-> [34] sndbuf=[3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 ]
-> [35] sndbuf=[3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 ]
-> [36] sndbuf=[3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 ]
-> [37] sndbuf=[3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 ]
-> [38] sndbuf=[3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 ]
-> [39] sndbuf=[3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 ]
-> [40] sndbuf=[3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 ]
-> [41] sndbuf=[3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 ]
-> [42] sndbuf=[3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 ]
-> [43] sndbuf=[3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 ]
-> [44] sndbuf=[4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 ]
-> [45] sndbuf=[4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 ]
-> [46] sndbuf=[4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 ]
-> [47] sndbuf=[4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 ]
-> [48] sndbuf=[4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 ]
-> [49] sndbuf=[4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 ]
-> [50] sndbuf=[4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 ]
-> [51] sndbuf=[4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 ]
-> [52] sndbuf=[4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 ]
-> [53] sndbuf=[4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 ]
-> [54] sndbuf=[4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 ]
-> [55] sndbuf=[5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 ]
-> [56] sndbuf=[5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 ]
-> [57] sndbuf=[5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 ]
-> [58] sndbuf=[5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 ]
-> [59] sndbuf=[5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 ]
-> [60] sndbuf=[5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 ]
-> [61] sndbuf=[5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 ]
-> [62] sndbuf=[5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 ]
-> [63] sndbuf=[5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 ]
-> [64] sndbuf=[5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 ]
-> [65] sndbuf=[5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 ]
-> [66] sndbuf=[6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 ]
-> [67] sndbuf=[6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 ]
-> [68] sndbuf=[6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 ]
-> [69] sndbuf=[6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 ]
-> [70] sndbuf=[6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 ]
-> [71] sndbuf=[6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 ]
-> [72] sndbuf=[6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 ]
-> [73] sndbuf=[6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 ]
-> [74] sndbuf=[6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 ]
-> [75] sndbuf=[6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 ]
-> [76] sndbuf=[6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 ]
-> [77] sndbuf=[7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 ]
-> [78] sndbuf=[7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 ]
-> [79] sndbuf=[7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 ]
-> [80] sndbuf=[7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 ]
-> [81] sndbuf=[7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 ]
-> [82] sndbuf=[7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 ]
-> [83] sndbuf=[7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 ]
-> [84] sndbuf=[7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 ]
-> [85] sndbuf=[7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 ]
-> [86] sndbuf=[7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 ]
-> [87] sndbuf=[8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 ]
-> [88] sndbuf=[8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 ]
-> [89] sndbuf=[8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 ]
-> [90] sndbuf=[8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 ]
-> [91] sndbuf=[8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 ]
-> [19] rcvbuf=[19 111 203 295 387 479 571 663 755 847 939 1031 1123 1215 1307 1399 1491 1583 1675 1767 1859 1951 2043 2135 2227 2319 2411 2503 2595 2687 2779 2871 2963 3055 3147 3239 3331 3423 3515 3607 3699 3791 3883 3975 4067 4159 4251 4343 4435 4527 4619 4711 4803 4895 4987 5079 5171 5263 5355 5447 5539 5631 5723 5815 5907 5999 6091 6183 6275 6367 6459 6551 6643 6735 6827 6919 7011 7103 7195 7287 7379 7471 7563 7655 7747 7839 7931 8023 8115 8207 8299 8391 ]
-> [17] rcvbuf=[17 109 201 293 385 477 569 661 753 845 937 1029 1121 1213 1305 1397 1489 1581 1673 1765 1857 1949 2041 2133 2225 2317 2409 2501 2593 2685 2777 2869 2961 3053 3145 3237 3329 3421 3513 3605 3697 3789 3881 3973 4065 4157 4249 4341 4433 4525 4617 4709 4801 4893 4985 5077 5169 5261 5353 5445 5537 5629 5721 5813 5905 5997 6089 6181 6273 6365 6457 6549 6641 6733 6825 6917 7009 7101 7193 7285 7377 7469 7561 7653 7745 7837 7929 8021 8113 8205 8297 8389 ]
-> [3] rcvbuf=[3 95 187 279 371 463 555 647 739 831 923 1015 1107 1199 1291 1383 1475 1567 1659 1751 1843 1935 2027 2119 2211 2303 2395 2487 2579 2671 2763 2855 2947 3039 3131 3223 3315 3407 3499 3591 3683 3775 3867 3959 4051 4143 4235 4327 4419 4511 4603 4695 4787 4879 4971 5063 5155 5247 5339 5431 5523 5615 5707 5799 5891 5983 6075 6167 6259 6351 6443 6535 6627 6719 6811 6903 6995 7087 7179 7271 7363 7455 7547 7639 7731 7823 7915 8007 8099 8191 8283 8375 ]
-> [1] rcvbuf=[1 93 185 277 369 461 553 645 737 829 921 1013 1105 1197 1289 1381 1473 1565 1657 1749 1841 1933 2025 2117 2209 2301 2393 2485 2577 2669 2761 2853 2945 3037 3129 3221 3313 3405 3497 3589 3681 3773 3865 3957 4049 4141 4233 4325 4417 4509 4601 4693 4785 4877 4969 5061 5153 5245 5337 5429 5521 5613 5705 5797 5889 5981 6073 6165 6257 6349 6441 6533 6625 6717 6809 6901 6993 7085 7177 7269 7361 7453 7545 7637 7729 7821 7913 8005 8097 8189 8281 8373 ]
-> [27] rcvbuf=[27 119 211 303 395 487 579 671 763 855 947 1039 1131 1223 1315 1407 1499 1591 1683 1775 1867 1959 2051 2143 2235 2327 2419 2511 2603 2695 2787 2879 2971 3063 3155 3247 3339 3431 3523 3615 3707 3799 3891 3983 4075 4167 4259 4351 4443 4535 4627 4719 4811 4903 4995 5087 5179 5271 5363 5455 5547 5639 5731 5823 5915 6007 6099 6191 6283 6375 6467 6559 6651 6743 6835 6927 7019 7111 7203 7295 7387 7479 7571 7663 7755 7847 7939 8031 8123 8215 8307 8399 ]
-> [25] rcvbuf=[25 117 209 301 393 485 577 669 761 853 945 1037 1129 1221 1313 1405 1497 1589 1681 1773 1865 1957 2049 2141 2233 2325 2417 2509 2601 2693 2785 2877 2969 3061 3153 3245 3337 3429 3521 3613 3705 3797 3889 3981 4073 4165 4257 4349 4441 4533 4625 4717 4809 4901 4993 5085 5177 5269 5361 5453 5545 5637 5729 5821 5913 6005 6097 6189 6281 6373 6465 6557 6649 6741 6833 6925 7017 7109 7201 7293 7385 7477 7569 7661 7753 7845 7937 8029 8121 8213 8305 8397 ]
-> [26] rcvbuf=[26 118 210 302 394 486 578 670 762 854 946 1038 1130 1222 1314 1406 1498 1590 1682 1774 1866 1958 2050 2142 2234 2326 2418 2510 2602 2694 2786 2878 2970 3062 3154 3246 3338 3430 3522 3614 3706 3798 3890 3982 4074 4166 4258 4350 4442 4534 4626 4718 4810 4902 4994 5086 5178 5270 5362 5454 5546 5638 5730 5822 5914 6006 6098 6190 6282 6374 6466 6558 6650 6742 6834 6926 7018 7110 7202 7294 7386 7478 7570 7662 7754 7846 7938 8030 8122 8214 8306 8398 ]
-> [16] rcvbuf=[16 108 200 292 384 476 568 660 752 844 936 1028 1120 1212 1304 1396 1488 1580 1672 1764 1856 1948 2040 2132 2224 2316 2408 2500 2592 2684 2776 2868 2960 3052 3144 3236 3328 3420 3512 3604 3696 3788 3880 3972 4064 4156 4248 4340 4432 4524 4616 4708 4800 4892 4984 5076 5168 5260 5352 5444 5536 5628 5720 5812 5904 5996 6088 6180 6272 6364 6456 6548 6640 6732 6824 6916 7008 7100 7192 7284 7376 7468 7560 7652 7744 7836 7928 8020 8112 8204 8296 8388 ]
-> [24] rcvbuf=[24 116 208 300 392 484 576 668 760 852 944 1036 1128 1220 1312 1404 1496 1588 1680 1772 1864 1956 2048 2140 2232 2324 2416 2508 2600 2692 2784 2876 2968 3060 3152 3244 3336 3428 3520 3612 3704 3796 3888 3980 4072 4164 4256 4348 4440 4532 4624 4716 4808 4900 4992 5084 5176 5268 5360 5452 5544 5636 5728 5820 5912 6004 6096 6188 6280 6372 6464 6556 6648 6740 6832 6924 7016 7108 7200 7292 7384 7476 7568 7660 7752 7844 7936 8028 8120 8212 8304 8396 ]
-> [0] rcvbuf=[0 92 184 276 368 460 552 644 736 828 920 1012 1104 1196 1288 1380 1472 1564 1656 1748 1840 1932 2024 2116 2208 2300 2392 2484 2576 2668 2760 2852 2944 3036 3128 3220 3312 3404 3496 3588 3680 3772 3864 3956 4048 4140 4232 4324 4416 4508 4600 4692 4784 4876 4968 5060 5152 5244 5336 5428 5520 5612 5704 5796 5888 5980 6072 6164 6256 6348 6440 6532 6624 6716 6808 6900 6992 7084 7176 7268 7360 7452 7544 7636 7728 7820 7912 8004 8096 8188 8280 8372 ]
-> [8] rcvbuf=[8 100 192 284 376 468 560 652 744 836 928 1020 1112 1204 1296 1388 1480 1572 1664 1756 1848 1940 2032 2124 2216 2308 2400 2492 2584 2676 2768 2860 2952 3044 3136 3228 3320 3412 3504 3596 3688 3780 3872 3964 4056 4148 4240 4332 4424 4516 4608 4700 4792 4884 4976 5068 5160 5252 5344 5436 5528 5620 5712 5804 5896 5988 6080 6172 6264 6356 6448 6540 6632 6724 6816 6908 7000 7092 7184 7276 7368 7460 7552 7644 7736 7828 7920 8012 8104 8196 8288 8380 ]
-> [23] rcvbuf=[23 115 207 299 391 483 575 667 759 851 943 1035 1127 1219 1311 1403 1495 1587 1679 1771 1863 1955 2047 2139 2231 2323 2415 2507 2599 2691 2783 2875 2967 3059 3151 3243 3335 3427 3519 3611 3703 3795 3887 3979 4071 4163 4255 4347 4439 4531 4623 4715 4807 4899 4991 5083 5175 5267 5359 5451 5543 5635 5727 5819 5911 6003 6095 6187 6279 6371 6463 6555 6647 6739 6831 6923 7015 7107 7199 7291 7383 7475 7567 7659 7751 7843 7935 8027 8119 8211 8303 8395 ]
-> [21] rcvbuf=[21 113 205 297 389 481 573 665 757 849 941 1033 1125 1217 1309 1401 1493 1585 1677 1769 1861 1953 2045 2137 2229 2321 2413 2505 2597 2689 2781 2873 2965 3057 3149 3241 3333 3425 3517 3609 3701 3793 3885 3977 4069 4161 4253 4345 4437 4529 4621 4713 4805 4897 4989 5081 5173 5265 5357 5449 5541 5633 5725 5817 5909 6001 6093 6185 6277 6369 6461 6553 6645 6737 6829 6921 7013 7105 7197 7289 7381 7473 7565 7657 7749 7841 7933 8025 8117 8209 8301 8393 ]
-> [7] rcvbuf=[7 99 191 283 375 467 559 651 743 835 927 1019 1111 1203 1295 1387 1479 1571 1663 1755 1847 1939 2031 2123 2215 2307 2399 2491 2583 2675 2767 2859 2951 3043 3135 3227 3319 3411 3503 3595 3687 3779 3871 3963 4055 4147 4239 4331 4423 4515 4607 4699 4791 4883 4975 5067 5159 5251 5343 5435 5527 5619 5711 5803 5895 5987 6079 6171 6263 6355 6447 6539 6631 6723 6815 6907 6999 7091 7183 7275 7367 7459 7551 7643 7735 7827 7919 8011 8103 8195 8287 8379 ]
-> [5] rcvbuf=[5 97 189 281 373 465 557 649 741 833 925 1017 1109 1201 1293 1385 1477 1569 1661 1753 1845 1937 2029 2121 2213 2305 2397 2489 2581 2673 2765 2857 2949 3041 3133 3225 3317 3409 3501 3593 3685 3777 3869 3961 4053 4145 4237 4329 4421 4513 4605 4697 4789 4881 4973 5065 5157 5249 5341 5433 5525 5617 5709 5801 5893 5985 6077 6169 6261 6353 6445 6537 6629 6721 6813 6905 6997 7089 7181 7273 7365 7457 7549 7641 7733 7825 7917 8009 8101 8193 8285 8377 ]
-> [18] rcvbuf=[18 110 202 294 386 478 570 662 754 846 938 1030 1122 1214 1306 1398 1490 1582 1674 1766 1858 1950 2042 2134 2226 2318 2410 2502 2594 2686 2778 2870 2962 3054 3146 3238 3330 3422 3514 3606 3698 3790 3882 3974 4066 4158 4250 4342 4434 4526 4618 4710 4802 4894 4986 5078 5170 5262 5354 5446 5538 5630 5722 5814 5906 5998 6090 6182 6274 6366 6458 6550 6642 6734 6826 6918 7010 7102 7194 7286 7378 7470 7562 7654 7746 7838 7930 8022 8114 8206 8298 8390 ]
-> [2] rcvbuf=[2 94 186 278 370 462 554 646 738 830 922 1014 1106 1198 1290 1382 1474 1566 1658 1750 1842 1934 2026 2118 2210 2302 2394 2486 2578 2670 2762 2854 2946 3038 3130 3222 3314 3406 3498 3590 3682 3774 3866 3958 4050 4142 4234 4326 4418 4510 4602 4694 4786 4878 4970 5062 5154 5246 5338 5430 5522 5614 5706 5798 5890 5982 6074 6166 6258 6350 6442 6534 6626 6718 6810 6902 6994 7086 7178 7270 7362 7454 7546 7638 7730 7822 7914 8006 8098 8190 8282 8374 ]
-> [11] rcvbuf=[11 103 195 287 379 471 563 655 747 839 931 1023 1115 1207 1299 1391 1483 1575 1667 1759 1851 1943 2035 2127 2219 2311 2403 2495 2587 2679 2771 2863 2955 3047 3139 3231 3323 3415 3507 3599 3691 3783 3875 3967 4059 4151 4243 4335 4427 4519 4611 4703 4795 4887 4979 5071 5163 5255 5347 5439 5531 5623 5715 5807 5899 5991 6083 6175 6267 6359 6451 6543 6635 6727 6819 6911 7003 7095 7187 7279 7371 7463 7555 7647 7739 7831 7923 8015 8107 8199 8291 8383 ]
-> [9] rcvbuf=[9 101 193 285 377 469 561 653 745 837 929 1021 1113 1205 1297 1389 1481 1573 1665 1757 1849 1941 2033 2125 2217 2309 2401 2493 2585 2677 2769 2861 2953 3045 3137 3229 3321 3413 3505 3597 3689 3781 3873 3965 4057 4149 4241 4333 4425 4517 4609 4701 4793 4885 4977 5069 5161 5253 5345 5437 5529 5621 5713 5805 5897 5989 6081 6173 6265 6357 6449 6541 6633 6725 6817 6909 7001 7093 7185 7277 7369 7461 7553 7645 7737 7829 7921 8013 8105 8197 8289 8381 ]
-> [15] rcvbuf=[15 107 199 291 383 475 567 659 751 843 935 1027 1119 1211 1303 1395 1487 1579 1671 1763 1855 1947 2039 2131 2223 2315 2407 2499 2591 2683 2775 2867 2959 3051 3143 3235 3327 3419 3511 3603 3695 3787 3879 3971 4063 4155 4247 4339 4431 4523 4615 4707 4799 4891 4983 5075 5167 5259 5351 5443 5535 5627 5719 5811 5903 5995 6087 6179 6271 6363 6455 6547 6639 6731 6823 6915 7007 7099 7191 7283 7375 7467 7559 7651 7743 7835 7927 8019 8111 8203 8295 8387 ]
-> [13] rcvbuf=[13 105 197 289 381 473 565 657 749 841 933 1025 1117 1209 1301 1393 1485 1577 1669 1761 1853 1945 2037 2129 2221 2313 2405 2497 2589 2681 2773 2865 2957 3049 3141 3233 3325 3417 3509 3601 3693 3785 3877 3969 4061 4153 4245 4337 4429 4521 4613 4705 4797 4889 4981 5073 5165 5257 5349 5441 5533 5625 5717 5809 5901 5993 6085 6177 6269 6361 6453 6545 6637 6729 6821 6913 7005 7097 7189 7281 7373 7465 7557 7649 7741 7833 7925 8017 8109 8201 8293 8385 ]
-> [22] rcvbuf=[22 114 206 298 390 482 574 666 758 850 942 1034 1126 1218 1310 1402 1494 1586 1678 1770 1862 1954 2046 2138 2230 2322 2414 2506 2598 2690 2782 2874 2966 3058 3150 3242 3334 3426 3518 3610 3702 3794 3886 3978 4070 4162 4254 4346 4438 4530 4622 4714 4806 4898 4990 5082 5174 5266 5358 5450 5542 5634 5726 5818 5910 6002 6094 6186 6278 6370 6462 6554 6646 6738 6830 6922 7014 7106 7198 7290 7382 7474 7566 7658 7750 7842 7934 8026 8118 8210 8302 8394 ]
-> [20] rcvbuf=[20 112 204 296 388 480 572 664 756 848 940 1032 1124 1216 1308 1400 1492 1584 1676 1768 1860 1952 2044 2136 2228 2320 2412 2504 2596 2688 2780 2872 2964 3056 3148 3240 3332 3424 3516 3608 3700 3792 3884 3976 4068 4160 4252 4344 4436 4528 4620 4712 4804 4896 4988 5080 5172 5264 5356 5448 5540 5632 5724 5816 5908 6000 6092 6184 6276 6368 6460 6552 6644 6736 6828 6920 7012 7104 7196 7288 7380 7472 7564 7656 7748 7840 7932 8024 8116 8208 8300 8392 ]
-> [6] rcvbuf=[6 98 190 282 374 466 558 650 742 834 926 1018 1110 1202 1294 1386 1478 1570 1662 1754 1846 1938 2030 2122 2214 2306 2398 2490 2582 2674 2766 2858 2950 3042 3134 3226 3318 3410 3502 3594 3686 3778 3870 3962 4054 4146 4238 4330 4422 4514 4606 4698 4790 4882 4974 5066 5158 5250 5342 5434 5526 5618 5710 5802 5894 5986 6078 6170 6262 6354 6446 6538 6630 6722 6814 6906 6998 7090 7182 7274 7366 7458 7550 7642 7734 7826 7918 8010 8102 8194 8286 8378 ]
-> [4] rcvbuf=[4 96 188 280 372 464 556 648 740 832 924 1016 1108 1200 1292 1384 1476 1568 1660 1752 1844 1936 2028 2120 2212 2304 2396 2488 2580 2672 2764 2856 2948 3040 3132 3224 3316 3408 3500 3592 3684 3776 3868 3960 4052 4144 4236 4328 4420 4512 4604 4696 4788 4880 4972 5064 5156 5248 5340 5432 5524 5616 5708 5800 5892 5984 6076 6168 6260 6352 6444 6536 6628 6720 6812 6904 6996 7088 7180 7272 7364 7456 7548 7640 7732 7824 7916 8008 8100 8192 8284 8376 ]
-> [10] rcvbuf=[10 102 194 286 378 470 562 654 746 838 930 1022 1114 1206 1298 1390 1482 1574 1666 1758 1850 1942 2034 2126 2218 2310 2402 2494 2586 2678 2770 2862 2954 3046 3138 3230 3322 3414 3506 3598 3690 3782 3874 3966 4058 4150 4242 4334 4426 4518 4610 4702 4794 4886 4978 5070 5162 5254 5346 5438 5530 5622 5714 5806 5898 5990 6082 6174 6266 6358 6450 6542 6634 6726 6818 6910 7002 7094 7186 7278 7370 7462 7554 7646 7738 7830 7922 8014 8106 8198 8290 8382 ]
-> [14] rcvbuf=[14 106 198 290 382 474 566 658 750 842 934 1026 1118 1210 1302 1394 1486 1578 1670 1762 1854 1946 2038 2130 2222 2314 2406 2498 2590 2682 2774 2866 2958 3050 3142 3234 3326 3418 3510 3602 3694 3786 3878 3970 4062 4154 4246 4338 4430 4522 4614 4706 4798 4890 4982 5074 5166 5258 5350 5442 5534 5626 5718 5810 5902 5994 6086 6178 6270 6362 6454 6546 6638 6730 6822 6914 7006 7098 7190 7282 7374 7466 7558 7650 7742 7834 7926 8018 8110 8202 8294 8386 ]
-> [12] rcvbuf=[12 104 196 288 380 472 564 656 748 840 932 1024 1116 1208 1300 1392 1484 1576 1668 1760 1852 1944 2036 2128 2220 2312 2404 2496 2588 2680 2772 2864 2956 3048 3140 3232 3324 3416 3508 3600 3692 3784 3876 3968 4060 4152 4244 4336 4428 4520 4612 4704 4796 4888 4980 5072 5164 5256 5348 5440 5532 5624 5716 5808 5900 5992 6084 6176 6268 6360 6452 6544 6636 6728 6820 6912 7004 7096 7188 7280 7372 7464 7556 7648 7740 7832 7924 8016 8108 8200 8292 8384 ]
-> [83] rcvbuf=[83 175 267 359 451 543 635 727 819 911 1003 1095 1187 1279 1371 1463 1555 1647 1739 1831 1923 2015 2107 2199 2291 2383 2475 2567 2659 2751 2843 2935 3027 3119 3211 3303 3395 3487 3579 3671 3763 3855 3947 4039 4131 4223 4315 4407 4499 4591 4683 4775 4867 4959 5051 5143 5235 5327 5419 5511 5603 5695 5787 5879 5971 6063 6155 6247 6339 6431 6523 6615 6707 6799 6891 6983 7075 7167 7259 7351 7443 7535 7627 7719 7811 7903 7995 8087 8179 8271 8363 8455 ]
-> [81] rcvbuf=[81 173 265 357 449 541 633 725 817 909 1001 1093 1185 1277 1369 1461 1553 1645 1737 1829 1921 2013 2105 2197 2289 2381 2473 2565 2657 2749 2841 2933 3025 3117 3209 3301 3393 3485 3577 3669 3761 3853 3945 4037 4129 4221 4313 4405 4497 4589 4681 4773 4865 4957 5049 5141 5233 5325 5417 5509 5601 5693 5785 5877 5969 6061 6153 6245 6337 6429 6521 6613 6705 6797 6889 6981 7073 7165 7257 7349 7441 7533 7625 7717 7809 7901 7993 8085 8177 8269 8361 8453 ]
-> [67] rcvbuf=[67 159 251 343 435 527 619 711 803 895 987 1079 1171 1263 1355 1447 1539 1631 1723 1815 1907 1999 2091 2183 2275 2367 2459 2551 2643 2735 2827 2919 3011 3103 3195 3287 3379 3471 3563 3655 3747 3839 3931 4023 4115 4207 4299 4391 4483 4575 4667 4759 4851 4943 5035 5127 5219 5311 5403 5495 5587 5679 5771 5863 5955 6047 6139 6231 6323 6415 6507 6599 6691 6783 6875 6967 7059 7151 7243 7335 7427 7519 7611 7703 7795 7887 7979 8071 8163 8255 8347 8439 ]
-> [65] rcvbuf=[65 157 249 341 433 525 617 709 801 893 985 1077 1169 1261 1353 1445 1537 1629 1721 1813 1905 1997 2089 2181 2273 2365 2457 2549 2641 2733 2825 2917 3009 3101 3193 3285 3377 3469 3561 3653 3745 3837 3929 4021 4113 4205 4297 4389 4481 4573 4665 4757 4849 4941 5033 5125 5217 5309 5401 5493 5585 5677 5769 5861 5953 6045 6137 6229 6321 6413 6505 6597 6689 6781 6873 6965 7057 7149 7241 7333 7425 7517 7609 7701 7793 7885 7977 8069 8161 8253 8345 8437 ]
-> [57] rcvbuf=[57 149 241 333 425 517 609 701 793 885 977 1069 1161 1253 1345 1437 1529 1621 1713 1805 1897 1989 2081 2173 2265 2357 2449 2541 2633 2725 2817 2909 3001 3093 3185 3277 3369 3461 3553 3645 3737 3829 3921 4013 4105 4197 4289 4381 4473 4565 4657 4749 4841 4933 5025 5117 5209 5301 5393 5485 5577 5669 5761 5853 5945 6037 6129 6221 6313 6405 6497 6589 6681 6773 6865 6957 7049 7141 7233 7325 7417 7509 7601 7693 7785 7877 7969 8061 8153 8245 8337 8429 ]
-> [59] rcvbuf=[59 151 243 335 427 519 611 703 795 887 979 1071 1163 1255 1347 1439 1531 1623 1715 1807 1899 1991 2083 2175 2267 2359 2451 2543 2635 2727 2819 2911 3003 3095 3187 3279 3371 3463 3555 3647 3739 3831 3923 4015 4107 4199 4291 4383 4475 4567 4659 4751 4843 4935 5027 5119 5211 5303 5395 5487 5579 5671 5763 5855 5947 6039 6131 6223 6315 6407 6499 6591 6683 6775 6867 6959 7051 7143 7235 7327 7419 7511 7603 7695 7787 7879 7971 8063 8155 8247 8339 8431 ]
-> [33] rcvbuf=[33 125 217 309 401 493 585 677 769 861 953 1045 1137 1229 1321 1413 1505 1597 1689 1781 1873 1965 2057 2149 2241 2333 2425 2517 2609 2701 2793 2885 2977 3069 3161 3253 3345 3437 3529 3621 3713 3805 3897 3989 4081 4173 4265 4357 4449 4541 4633 4725 4817 4909 5001 5093 5185 5277 5369 5461 5553 5645 5737 5829 5921 6013 6105 6197 6289 6381 6473 6565 6657 6749 6841 6933 7025 7117 7209 7301 7393 7485 7577 7669 7761 7853 7945 8037 8129 8221 8313 8405 ]
-> [35] rcvbuf=[35 127 219 311 403 495 587 679 771 863 955 1047 1139 1231 1323 1415 1507 1599 1691 1783 1875 1967 2059 2151 2243 2335 2427 2519 2611 2703 2795 2887 2979 3071 3163 3255 3347 3439 3531 3623 3715 3807 3899 3991 4083 4175 4267 4359 4451 4543 4635 4727 4819 4911 5003 5095 5187 5279 5371 5463 5555 5647 5739 5831 5923 6015 6107 6199 6291 6383 6475 6567 6659 6751 6843 6935 7027 7119 7211 7303 7395 7487 7579 7671 7763 7855 7947 8039 8131 8223 8315 8407 ]
-> [49] rcvbuf=[49 141 233 325 417 509 601 693 785 877 969 1061 1153 1245 1337 1429 1521 1613 1705 1797 1889 1981 2073 2165 2257 2349 2441 2533 2625 2717 2809 2901 2993 3085 3177 3269 3361 3453 3545 3637 3729 3821 3913 4005 4097 4189 4281 4373 4465 4557 4649 4741 4833 4925 5017 5109 5201 5293 5385 5477 5569 5661 5753 5845 5937 6029 6121 6213 6305 6397 6489 6581 6673 6765 6857 6949 7041 7133 7225 7317 7409 7501 7593 7685 7777 7869 7961 8053 8145 8237 8329 8421 ]
-> [51] rcvbuf=[51 143 235 327 419 511 603 695 787 879 971 1063 1155 1247 1339 1431 1523 1615 1707 1799 1891 1983 2075 2167 2259 2351 2443 2535 2627 2719 2811 2903 2995 3087 3179 3271 3363 3455 3547 3639 3731 3823 3915 4007 4099 4191 4283 4375 4467 4559 4651 4743 4835 4927 5019 5111 5203 5295 5387 5479 5571 5663 5755 5847 5939 6031 6123 6215 6307 6399 6491 6583 6675 6767 6859 6951 7043 7135 7227 7319 7411 7503 7595 7687 7779 7871 7963 8055 8147 8239 8331 8423 ]
-> [58] rcvbuf=[58 150 242 334 426 518 610 702 794 886 978 1070 1162 1254 1346 1438 1530 1622 1714 1806 1898 1990 2082 2174 2266 2358 2450 2542 2634 2726 2818 2910 3002 3094 3186 3278 3370 3462 3554 3646 3738 3830 3922 4014 4106 4198 4290 4382 4474 4566 4658 4750 4842 4934 5026 5118 5210 5302 5394 5486 5578 5670 5762 5854 5946 6038 6130 6222 6314 6406 6498 6590 6682 6774 6866 6958 7050 7142 7234 7326 7418 7510 7602 7694 7786 7878 7970 8062 8154 8246 8338 8430 ]
-> [91] rcvbuf=[91 183 275 367 459 551 643 735 827 919 1011 1103 1195 1287 1379 1471 1563 1655 1747 1839 1931 2023 2115 2207 2299 2391 2483 2575 2667 2759 2851 2943 3035 3127 3219 3311 3403 3495 3587 3679 3771 3863 3955 4047 4139 4231 4323 4415 4507 4599 4691 4783 4875 4967 5059 5151 5243 5335 5427 5519 5611 5703 5795 5887 5979 6071 6163 6255 6347 6439 6531 6623 6715 6807 6899 6991 7083 7175 7267 7359 7451 7543 7635 7727 7819 7911 8003 8095 8187 8279 8371 8463 ]
-> [89] rcvbuf=[89 181 273 365 457 549 641 733 825 917 1009 1101 1193 1285 1377 1469 1561 1653 1745 1837 1929 2021 2113 2205 2297 2389 2481 2573 2665 2757 2849 2941 3033 3125 3217 3309 3401 3493 3585 3677 3769 3861 3953 4045 4137 4229 4321 4413 4505 4597 4689 4781 4873 4965 5057 5149 5241 5333 5425 5517 5609 5701 5793 5885 5977 6069 6161 6253 6345 6437 6529 6621 6713 6805 6897 6989 7081 7173 7265 7357 7449 7541 7633 7725 7817 7909 8001 8093 8185 8277 8369 8461 ]
-> [40] rcvbuf=[40 132 224 316 408 500 592 684 776 868 960 1052 1144 1236 1328 1420 1512 1604 1696 1788 1880 1972 2064 2156 2248 2340 2432 2524 2616 2708 2800 2892 2984 3076 3168 3260 3352 3444 3536 3628 3720 3812 3904 3996 4088 4180 4272 4364 4456 4548 4640 4732 4824 4916 5008 5100 5192 5284 5376 5468 5560 5652 5744 5836 5928 6020 6112 6204 6296 6388 6480 6572 6664 6756 6848 6940 7032 7124 7216 7308 7400 7492 7584 7676 7768 7860 7952 8044 8136 8228 8320 8412 ]
-> [32] rcvbuf=[32 124 216 308 400 492 584 676 768 860 952 1044 1136 1228 1320 1412 1504 1596 1688 1780 1872 1964 2056 2148 2240 2332 2424 2516 2608 2700 2792 2884 2976 3068 3160 3252 3344 3436 3528 3620 3712 3804 3896 3988 4080 4172 4264 4356 4448 4540 4632 4724 4816 4908 5000 5092 5184 5276 5368 5460 5552 5644 5736 5828 5920 6012 6104 6196 6288 6380 6472 6564 6656 6748 6840 6932 7024 7116 7208 7300 7392 7484 7576 7668 7760 7852 7944 8036 8128 8220 8312 8404 ]
-> [56] rcvbuf=[56 148 240 332 424 516 608 700 792 884 976 1068 1160 1252 1344 1436 1528 1620 1712 1804 1896 1988 2080 2172 2264 2356 2448 2540 2632 2724 2816 2908 3000 3092 3184 3276 3368 3460 3552 3644 3736 3828 3920 4012 4104 4196 4288 4380 4472 4564 4656 4748 4840 4932 5024 5116 5208 5300 5392 5484 5576 5668 5760 5852 5944 6036 6128 6220 6312 6404 6496 6588 6680 6772 6864 6956 7048 7140 7232 7324 7416 7508 7600 7692 7784 7876 7968 8060 8152 8244 8336 8428 ]
-> [48] rcvbuf=[48 140 232 324 416 508 600 692 784 876 968 1060 1152 1244 1336 1428 1520 1612 1704 1796 1888 1980 2072 2164 2256 2348 2440 2532 2624 2716 2808 2900 2992 3084 3176 3268 3360 3452 3544 3636 3728 3820 3912 4004 4096 4188 4280 4372 4464 4556 4648 4740 4832 4924 5016 5108 5200 5292 5384 5476 5568 5660 5752 5844 5936 6028 6120 6212 6304 6396 6488 6580 6672 6764 6856 6948 7040 7132 7224 7316 7408 7500 7592 7684 7776 7868 7960 8052 8144 8236 8328 8420 ]
-> [90] rcvbuf=[90 182 274 366 458 550 642 734 826 918 1010 1102 1194 1286 1378 1470 1562 1654 1746 1838 1930 2022 2114 2206 2298 2390 2482 2574 2666 2758 2850 2942 3034 3126 3218 3310 3402 3494 3586 3678 3770 3862 3954 4046 4138 4230 4322 4414 4506 4598 4690 4782 4874 4966 5058 5150 5242 5334 5426 5518 5610 5702 5794 5886 5978 6070 6162 6254 6346 6438 6530 6622 6714 6806 6898 6990 7082 7174 7266 7358 7450 7542 7634 7726 7818 7910 8002 8094 8186 8278 8370 8462 ]
-> [37] rcvbuf=[37 129 221 313 405 497 589 681 773 865 957 1049 1141 1233 1325 1417 1509 1601 1693 1785 1877 1969 2061 2153 2245 2337 2429 2521 2613 2705 2797 2889 2981 3073 3165 3257 3349 3441 3533 3625 3717 3809 3901 3993 4085 4177 4269 4361 4453 4545 4637 4729 4821 4913 5005 5097 5189 5281 5373 5465 5557 5649 5741 5833 5925 6017 6109 6201 6293 6385 6477 6569 6661 6753 6845 6937 7029 7121 7213 7305 7397 7489 7581 7673 7765 7857 7949 8041 8133 8225 8317 8409 ]
-> [39] rcvbuf=[39 131 223 315 407 499 591 683 775 867 959 1051 1143 1235 1327 1419 1511 1603 1695 1787 1879 1971 2063 2155 2247 2339 2431 2523 2615 2707 2799 2891 2983 3075 3167 3259 3351 3443 3535 3627 3719 3811 3903 3995 4087 4179 4271 4363 4455 4547 4639 4731 4823 4915 5007 5099 5191 5283 5375 5467 5559 5651 5743 5835 5927 6019 6111 6203 6295 6387 6479 6571 6663 6755 6847 6939 7031 7123 7215 7307 7399 7491 7583 7675 7767 7859 7951 8043 8135 8227 8319 8411 ]
-> [53] rcvbuf=[53 145 237 329 421 513 605 697 789 881 973 1065 1157 1249 1341 1433 1525 1617 1709 1801 1893 1985 2077 2169 2261 2353 2445 2537 2629 2721 2813 2905 2997 3089 3181 3273 3365 3457 3549 3641 3733 3825 3917 4009 4101 4193 4285 4377 4469 4561 4653 4745 4837 4929 5021 5113 5205 5297 5389 5481 5573 5665 5757 5849 5941 6033 6125 6217 6309 6401 6493 6585 6677 6769 6861 6953 7045 7137 7229 7321 7413 7505 7597 7689 7781 7873 7965 8057 8149 8241 8333 8425 ]
-> [55] rcvbuf=[55 147 239 331 423 515 607 699 791 883 975 1067 1159 1251 1343 1435 1527 1619 1711 1803 1895 1987 2079 2171 2263 2355 2447 2539 2631 2723 2815 2907 2999 3091 3183 3275 3367 3459 3551 3643 3735 3827 3919 4011 4103 4195 4287 4379 4471 4563 4655 4747 4839 4931 5023 5115 5207 5299 5391 5483 5575 5667 5759 5851 5943 6035 6127 6219 6311 6403 6495 6587 6679 6771 6863 6955 7047 7139 7231 7323 7415 7507 7599 7691 7783 7875 7967 8059 8151 8243 8335 8427 ]
-> [80] rcvbuf=[80 172 264 356 448 540 632 724 816 908 1000 1092 1184 1276 1368 1460 1552 1644 1736 1828 1920 2012 2104 2196 2288 2380 2472 2564 2656 2748 2840 2932 3024 3116 3208 3300 3392 3484 3576 3668 3760 3852 3944 4036 4128 4220 4312 4404 4496 4588 4680 4772 4864 4956 5048 5140 5232 5324 5416 5508 5600 5692 5784 5876 5968 6060 6152 6244 6336 6428 6520 6612 6704 6796 6888 6980 7072 7164 7256 7348 7440 7532 7624 7716 7808 7900 7992 8084 8176 8268 8360 8452 ]
-> [88] rcvbuf=[88 180 272 364 456 548 640 732 824 916 1008 1100 1192 1284 1376 1468 1560 1652 1744 1836 1928 2020 2112 2204 2296 2388 2480 2572 2664 2756 2848 2940 3032 3124 3216 3308 3400 3492 3584 3676 3768 3860 3952 4044 4136 4228 4320 4412 4504 4596 4688 4780 4872 4964 5056 5148 5240 5332 5424 5516 5608 5700 5792 5884 5976 6068 6160 6252 6344 6436 6528 6620 6712 6804 6896 6988 7080 7172 7264 7356 7448 7540 7632 7724 7816 7908 8000 8092 8184 8276 8368 8460 ]
-> [64] rcvbuf=[64 156 248 340 432 524 616 708 800 892 984 1076 1168 1260 1352 1444 1536 1628 1720 1812 1904 1996 2088 2180 2272 2364 2456 2548 2640 2732 2824 2916 3008 3100 3192 3284 3376 3468 3560 3652 3744 3836 3928 4020 4112 4204 4296 4388 4480 4572 4664 4756 4848 4940 5032 5124 5216 5308 5400 5492 5584 5676 5768 5860 5952 6044 6136 6228 6320 6412 6504 6596 6688 6780 6872 6964 7056 7148 7240 7332 7424 7516 7608 7700 7792 7884 7976 8068 8160 8252 8344 8436 ]
-> [72] rcvbuf=[72 164 256 348 440 532 624 716 808 900 992 1084 1176 1268 1360 1452 1544 1636 1728 1820 1912 2004 2096 2188 2280 2372 2464 2556 2648 2740 2832 2924 3016 3108 3200 3292 3384 3476 3568 3660 3752 3844 3936 4028 4120 4212 4304 4396 4488 4580 4672 4764 4856 4948 5040 5132 5224 5316 5408 5500 5592 5684 5776 5868 5960 6052 6144 6236 6328 6420 6512 6604 6696 6788 6880 6972 7064 7156 7248 7340 7432 7524 7616 7708 7800 7892 7984 8076 8168 8260 8352 8444 ]
-> [28] rcvbuf=[28 120 212 304 396 488 580 672 764 856 948 1040 1132 1224 1316 1408 1500 1592 1684 1776 1868 1960 2052 2144 2236 2328 2420 2512 2604 2696 2788 2880 2972 3064 3156 3248 3340 3432 3524 3616 3708 3800 3892 3984 4076 4168 4260 4352 4444 4536 4628 4720 4812 4904 4996 5088 5180 5272 5364 5456 5548 5640 5732 5824 5916 6008 6100 6192 6284 6376 6468 6560 6652 6744 6836 6928 7020 7112 7204 7296 7388 7480 7572 7664 7756 7848 7940 8032 8124 8216 8308 8400 ]
-> [87] rcvbuf=[87 179 271 363 455 547 639 731 823 915 1007 1099 1191 1283 1375 1467 1559 1651 1743 1835 1927 2019 2111 2203 2295 2387 2479 2571 2663 2755 2847 2939 3031 3123 3215 3307 3399 3491 3583 3675 3767 3859 3951 4043 4135 4227 4319 4411 4503 4595 4687 4779 4871 4963 5055 5147 5239 5331 5423 5515 5607 5699 5791 5883 5975 6067 6159 6251 6343 6435 6527 6619 6711 6803 6895 6987 7079 7171 7263 7355 7447 7539 7631 7723 7815 7907 7999 8091 8183 8275 8367 8459 ]
-> [85] rcvbuf=[85 177 269 361 453 545 637 729 821 913 1005 1097 1189 1281 1373 1465 1557 1649 1741 1833 1925 2017 2109 2201 2293 2385 2477 2569 2661 2753 2845 2937 3029 3121 3213 3305 3397 3489 3581 3673 3765 3857 3949 4041 4133 4225 4317 4409 4501 4593 4685 4777 4869 4961 5053 5145 5237 5329 5421 5513 5605 5697 5789 5881 5973 6065 6157 6249 6341 6433 6525 6617 6709 6801 6893 6985 7077 7169 7261 7353 7445 7537 7629 7721 7813 7905 7997 8089 8181 8273 8365 8457 ]
-> [71] rcvbuf=[71 163 255 347 439 531 623 715 807 899 991 1083 1175 1267 1359 1451 1543 1635 1727 1819 1911 2003 2095 2187 2279 2371 2463 2555 2647 2739 2831 2923 3015 3107 3199 3291 3383 3475 3567 3659 3751 3843 3935 4027 4119 4211 4303 4395 4487 4579 4671 4763 4855 4947 5039 5131 5223 5315 5407 5499 5591 5683 5775 5867 5959 6051 6143 6235 6327 6419 6511 6603 6695 6787 6879 6971 7063 7155 7247 7339 7431 7523 7615 7707 7799 7891 7983 8075 8167 8259 8351 8443 ]
-> [69] rcvbuf=[69 161 253 345 437 529 621 713 805 897 989 1081 1173 1265 1357 1449 1541 1633 1725 1817 1909 2001 2093 2185 2277 2369 2461 2553 2645 2737 2829 2921 3013 3105 3197 3289 3381 3473 3565 3657 3749 3841 3933 4025 4117 4209 4301 4393 4485 4577 4669 4761 4853 4945 5037 5129 5221 5313 5405 5497 5589 5681 5773 5865 5957 6049 6141 6233 6325 6417 6509 6601 6693 6785 6877 6969 7061 7153 7245 7337 7429 7521 7613 7705 7797 7889 7981 8073 8165 8257 8349 8441 ]
-> [82] rcvbuf=[82 174 266 358 450 542 634 726 818 910 1002 1094 1186 1278 1370 1462 1554 1646 1738 1830 1922 2014 2106 2198 2290 2382 2474 2566 2658 2750 2842 2934 3026 3118 3210 3302 3394 3486 3578 3670 3762 3854 3946 4038 4130 4222 4314 4406 4498 4590 4682 4774 4866 4958 5050 5142 5234 5326 5418 5510 5602 5694 5786 5878 5970 6062 6154 6246 6338 6430 6522 6614 6706 6798 6890 6982 7074 7166 7258 7350 7442 7534 7626 7718 7810 7902 7994 8086 8178 8270 8362 8454 ]
-> [66] rcvbuf=[66 158 250 342 434 526 618 710 802 894 986 1078 1170 1262 1354 1446 1538 1630 1722 1814 1906 1998 2090 2182 2274 2366 2458 2550 2642 2734 2826 2918 3010 3102 3194 3286 3378 3470 3562 3654 3746 3838 3930 4022 4114 4206 4298 4390 4482 4574 4666 4758 4850 4942 5034 5126 5218 5310 5402 5494 5586 5678 5770 5862 5954 6046 6138 6230 6322 6414 6506 6598 6690 6782 6874 6966 7058 7150 7242 7334 7426 7518 7610 7702 7794 7886 7978 8070 8162 8254 8346 8438 ]
-> [75] rcvbuf=[75 167 259 351 443 535 627 719 811 903 995 1087 1179 1271 1363 1455 1547 1639 1731 1823 1915 2007 2099 2191 2283 2375 2467 2559 2651 2743 2835 2927 3019 3111 3203 3295 3387 3479 3571 3663 3755 3847 3939 4031 4123 4215 4307 4399 4491 4583 4675 4767 4859 4951 5043 5135 5227 5319 5411 5503 5595 5687 5779 5871 5963 6055 6147 6239 6331 6423 6515 6607 6699 6791 6883 6975 7067 7159 7251 7343 7435 7527 7619 7711 7803 7895 7987 8079 8171 8263 8355 8447 ]
-> [73] rcvbuf=[73 165 257 349 441 533 625 717 809 901 993 1085 1177 1269 1361 1453 1545 1637 1729 1821 1913 2005 2097 2189 2281 2373 2465 2557 2649 2741 2833 2925 3017 3109 3201 3293 3385 3477 3569 3661 3753 3845 3937 4029 4121 4213 4305 4397 4489 4581 4673 4765 4857 4949 5041 5133 5225 5317 5409 5501 5593 5685 5777 5869 5961 6053 6145 6237 6329 6421 6513 6605 6697 6789 6881 6973 7065 7157 7249 7341 7433 7525 7617 7709 7801 7893 7985 8077 8169 8261 8353 8445 ]
-> [79] rcvbuf=[79 171 263 355 447 539 631 723 815 907 999 1091 1183 1275 1367 1459 1551 1643 1735 1827 1919 2011 2103 2195 2287 2379 2471 2563 2655 2747 2839 2931 3023 3115 3207 3299 3391 3483 3575 3667 3759 3851 3943 4035 4127 4219 4311 4403 4495 4587 4679 4771 4863 4955 5047 5139 5231 5323 5415 5507 5599 5691 5783 5875 5967 6059 6151 6243 6335 6427 6519 6611 6703 6795 6887 6979 7071 7163 7255 7347 7439 7531 7623 7715 7807 7899 7991 8083 8175 8267 8359 8451 ]
-> [77] rcvbuf=[77 169 261 353 445 537 629 721 813 905 997 1089 1181 1273 1365 1457 1549 1641 1733 1825 1917 2009 2101 2193 2285 2377 2469 2561 2653 2745 2837 2929 3021 3113 3205 3297 3389 3481 3573 3665 3757 3849 3941 4033 4125 4217 4309 4401 4493 4585 4677 4769 4861 4953 5045 5137 5229 5321 5413 5505 5597 5689 5781 5873 5965 6057 6149 6241 6333 6425 6517 6609 6701 6793 6885 6977 7069 7161 7253 7345 7437 7529 7621 7713 7805 7897 7989 8081 8173 8265 8357 8449 ]
-> [86] rcvbuf=[86 178 270 362 454 546 638 730 822 914 1006 1098 1190 1282 1374 1466 1558 1650 1742 1834 1926 2018 2110 2202 2294 2386 2478 2570 2662 2754 2846 2938 3030 3122 3214 3306 3398 3490 3582 3674 3766 3858 3950 4042 4134 4226 4318 4410 4502 4594 4686 4778 4870 4962 5054 5146 5238 5330 5422 5514 5606 5698 5790 5882 5974 6066 6158 6250 6342 6434 6526 6618 6710 6802 6894 6986 7078 7170 7262 7354 7446 7538 7630 7722 7814 7906 7998 8090 8182 8274 8366 8458 ]
-> [84] rcvbuf=[84 176 268 360 452 544 636 728 820 912 1004 1096 1188 1280 1372 1464 1556 1648 1740 1832 1924 2016 2108 2200 2292 2384 2476 2568 2660 2752 2844 2936 3028 3120 3212 3304 3396 3488 3580 3672 3764 3856 3948 4040 4132 4224 4316 4408 4500 4592 4684 4776 4868 4960 5052 5144 5236 5328 5420 5512 5604 5696 5788 5880 5972 6064 6156 6248 6340 6432 6524 6616 6708 6800 6892 6984 7076 7168 7260 7352 7444 7536 7628 7720 7812 7904 7996 8088 8180 8272 8364 8456 ]
-> [70] rcvbuf=[70 162 254 346 438 530 622 714 806 898 990 1082 1174 1266 1358 1450 1542 1634 1726 1818 1910 2002 2094 2186 2278 2370 2462 2554 2646 2738 2830 2922 3014 3106 3198 3290 3382 3474 3566 3658 3750 3842 3934 4026 4118 4210 4302 4394 4486 4578 4670 4762 4854 4946 5038 5130 5222 5314 5406 5498 5590 5682 5774 5866 5958 6050 6142 6234 6326 6418 6510 6602 6694 6786 6878 6970 7062 7154 7246 7338 7430 7522 7614 7706 7798 7890 7982 8074 8166 8258 8350 8442 ]
-> [68] rcvbuf=[68 160 252 344 436 528 620 712 804 896 988 1080 1172 1264 1356 1448 1540 1632 1724 1816 1908 2000 2092 2184 2276 2368 2460 2552 2644 2736 2828 2920 3012 3104 3196 3288 3380 3472 3564 3656 3748 3840 3932 4024 4116 4208 4300 4392 4484 4576 4668 4760 4852 4944 5036 5128 5220 5312 5404 5496 5588 5680 5772 5864 5956 6048 6140 6232 6324 6416 6508 6600 6692 6784 6876 6968 7060 7152 7244 7336 7428 7520 7612 7704 7796 7888 7980 8072 8164 8256 8348 8440 ]
-> [34] rcvbuf=[34 126 218 310 402 494 586 678 770 862 954 1046 1138 1230 1322 1414 1506 1598 1690 1782 1874 1966 2058 2150 2242 2334 2426 2518 2610 2702 2794 2886 2978 3070 3162 3254 3346 3438 3530 3622 3714 3806 3898 3990 4082 4174 4266 4358 4450 4542 4634 4726 4818 4910 5002 5094 5186 5278 5370 5462 5554 5646 5738 5830 5922 6014 6106 6198 6290 6382 6474 6566 6658 6750 6842 6934 7026 7118 7210 7302 7394 7486 7578 7670 7762 7854 7946 8038 8130 8222 8314 8406 ]
-> [50] rcvbuf=[50 142 234 326 418 510 602 694 786 878 970 1062 1154 1246 1338 1430 1522 1614 1706 1798 1890 1982 2074 2166 2258 2350 2442 2534 2626 2718 2810 2902 2994 3086 3178 3270 3362 3454 3546 3638 3730 3822 3914 4006 4098 4190 4282 4374 4466 4558 4650 4742 4834 4926 5018 5110 5202 5294 5386 5478 5570 5662 5754 5846 5938 6030 6122 6214 6306 6398 6490 6582 6674 6766 6858 6950 7042 7134 7226 7318 7410 7502 7594 7686 7778 7870 7962 8054 8146 8238 8330 8422 ]
-> [74] rcvbuf=[74 166 258 350 442 534 626 718 810 902 994 1086 1178 1270 1362 1454 1546 1638 1730 1822 1914 2006 2098 2190 2282 2374 2466 2558 2650 2742 2834 2926 3018 3110 3202 3294 3386 3478 3570 3662 3754 3846 3938 4030 4122 4214 4306 4398 4490 4582 4674 4766 4858 4950 5042 5134 5226 5318 5410 5502 5594 5686 5778 5870 5962 6054 6146 6238 6330 6422 6514 6606 6698 6790 6882 6974 7066 7158 7250 7342 7434 7526 7618 7710 7802 7894 7986 8078 8170 8262 8354 8446 ]
-> [76] rcvbuf=[76 168 260 352 444 536 628 720 812 904 996 1088 1180 1272 1364 1456 1548 1640 1732 1824 1916 2008 2100 2192 2284 2376 2468 2560 2652 2744 2836 2928 3020 3112 3204 3296 3388 3480 3572 3664 3756 3848 3940 4032 4124 4216 4308 4400 4492 4584 4676 4768 4860 4952 5044 5136 5228 5320 5412 5504 5596 5688 5780 5872 5964 6056 6148 6240 6332 6424 6516 6608 6700 6792 6884 6976 7068 7160 7252 7344 7436 7528 7620 7712 7804 7896 7988 8080 8172 8264 8356 8448 ]
-> [78] rcvbuf=[78 170 262 354 446 538 630 722 814 906 998 1090 1182 1274 1366 1458 1550 1642 1734 1826 1918 2010 2102 2194 2286 2378 2470 2562 2654 2746 2838 2930 3022 3114 3206 3298 3390 3482 3574 3666 3758 3850 3942 4034 4126 4218 4310 4402 4494 4586 4678 4770 4862 4954 5046 5138 5230 5322 5414 5506 5598 5690 5782 5874 5966 6058 6150 6242 6334 6426 6518 6610 6702 6794 6886 6978 7070 7162 7254 7346 7438 7530 7622 7714 7806 7898 7990 8082 8174 8266 8358 8450 ]
-> [41] rcvbuf=[41 133 225 317 409 501 593 685 777 869 961 1053 1145 1237 1329 1421 1513 1605 1697 1789 1881 1973 2065 2157 2249 2341 2433 2525 2617 2709 2801 2893 2985 3077 3169 3261 3353 3445 3537 3629 3721 3813 3905 3997 4089 4181 4273 4365 4457 4549 4641 4733 4825 4917 5009 5101 5193 5285 5377 5469 5561 5653 5745 5837 5929 6021 6113 6205 6297 6389 6481 6573 6665 6757 6849 6941 7033 7125 7217 7309 7401 7493 7585 7677 7769 7861 7953 8045 8137 8229 8321 8413 ]
-> [43] rcvbuf=[43 135 227 319 411 503 595 687 779 871 963 1055 1147 1239 1331 1423 1515 1607 1699 1791 1883 1975 2067 2159 2251 2343 2435 2527 2619 2711 2803 2895 2987 3079 3171 3263 3355 3447 3539 3631 3723 3815 3907 3999 4091 4183 4275 4367 4459 4551 4643 4735 4827 4919 5011 5103 5195 5287 5379 5471 5563 5655 5747 5839 5931 6023 6115 6207 6299 6391 6483 6575 6667 6759 6851 6943 7035 7127 7219 7311 7403 7495 7587 7679 7771 7863 7955 8047 8139 8231 8323 8415 ]
-> [36] rcvbuf=[36 128 220 312 404 496 588 680 772 864 956 1048 1140 1232 1324 1416 1508 1600 1692 1784 1876 1968 2060 2152 2244 2336 2428 2520 2612 2704 2796 2888 2980 3072 3164 3256 3348 3440 3532 3624 3716 3808 3900 3992 4084 4176 4268 4360 4452 4544 4636 4728 4820 4912 5004 5096 5188 5280 5372 5464 5556 5648 5740 5832 5924 6016 6108 6200 6292 6384 6476 6568 6660 6752 6844 6936 7028 7120 7212 7304 7396 7488 7580 7672 7764 7856 7948 8040 8132 8224 8316 8408 ]
-> [38] rcvbuf=[38 130 222 314 406 498 590 682 774 866 958 1050 1142 1234 1326 1418 1510 1602 1694 1786 1878 1970 2062 2154 2246 2338 2430 2522 2614 2706 2798 2890 2982 3074 3166 3258 3350 3442 3534 3626 3718 3810 3902 3994 4086 4178 4270 4362 4454 4546 4638 4730 4822 4914 5006 5098 5190 5282 5374 5466 5558 5650 5742 5834 5926 6018 6110 6202 6294 6386 6478 6570 6662 6754 6846 6938 7030 7122 7214 7306 7398 7490 7582 7674 7766 7858 7950 8042 8134 8226 8318 8410 ]
-> [52] rcvbuf=[52 144 236 328 420 512 604 696 788 880 972 1064 1156 1248 1340 1432 1524 1616 1708 1800 1892 1984 2076 2168 2260 2352 2444 2536 2628 2720 2812 2904 2996 3088 3180 3272 3364 3456 3548 3640 3732 3824 3916 4008 4100 4192 4284 4376 4468 4560 4652 4744 4836 4928 5020 5112 5204 5296 5388 5480 5572 5664 5756 5848 5940 6032 6124 6216 6308 6400 6492 6584 6676 6768 6860 6952 7044 7136 7228 7320 7412 7504 7596 7688 7780 7872 7964 8056 8148 8240 8332 8424 ]
-> [54] rcvbuf=[54 146 238 330 422 514 606 698 790 882 974 1066 1158 1250 1342 1434 1526 1618 1710 1802 1894 1986 2078 2170 2262 2354 2446 2538 2630 2722 2814 2906 2998 3090 3182 3274 3366 3458 3550 3642 3734 3826 3918 4010 4102 4194 4286 4378 4470 4562 4654 4746 4838 4930 5022 5114 5206 5298 5390 5482 5574 5666 5758 5850 5942 6034 6126 6218 6310 6402 6494 6586 6678 6770 6862 6954 7046 7138 7230 7322 7414 7506 7598 7690 7782 7874 7966 8058 8150 8242 8334 8426 ]
-> [29] rcvbuf=[29 121 213 305 397 489 581 673 765 857 949 1041 1133 1225 1317 1409 1501 1593 1685 1777 1869 1961 2053 2145 2237 2329 2421 2513 2605 2697 2789 2881 2973 3065 3157 3249 3341 3433 3525 3617 3709 3801 3893 3985 4077 4169 4261 4353 4445 4537 4629 4721 4813 4905 4997 5089 5181 5273 5365 5457 5549 5641 5733 5825 5917 6009 6101 6193 6285 6377 6469 6561 6653 6745 6837 6929 7021 7113 7205 7297 7389 7481 7573 7665 7757 7849 7941 8033 8125 8217 8309 8401 ]
-> [31] rcvbuf=[31 123 215 307 399 491 583 675 767 859 951 1043 1135 1227 1319 1411 1503 1595 1687 1779 1871 1963 2055 2147 2239 2331 2423 2515 2607 2699 2791 2883 2975 3067 3159 3251 3343 3435 3527 3619 3711 3803 3895 3987 4079 4171 4263 4355 4447 4539 4631 4723 4815 4907 4999 5091 5183 5275 5367 5459 5551 5643 5735 5827 5919 6011 6103 6195 6287 6379 6471 6563 6655 6747 6839 6931 7023 7115 7207 7299 7391 7483 7575 7667 7759 7851 7943 8035 8127 8219 8311 8403 ]
-> [45] rcvbuf=[45 137 229 321 413 505 597 689 781 873 965 1057 1149 1241 1333 1425 1517 1609 1701 1793 1885 1977 2069 2161 2253 2345 2437 2529 2621 2713 2805 2897 2989 3081 3173 3265 3357 3449 3541 3633 3725 3817 3909 4001 4093 4185 4277 4369 4461 4553 4645 4737 4829 4921 5013 5105 5197 5289 5381 5473 5565 5657 5749 5841 5933 6025 6117 6209 6301 6393 6485 6577 6669 6761 6853 6945 7037 7129 7221 7313 7405 7497 7589 7681 7773 7865 7957 8049 8141 8233 8325 8417 ]
-> [47] rcvbuf=[47 139 231 323 415 507 599 691 783 875 967 1059 1151 1243 1335 1427 1519 1611 1703 1795 1887 1979 2071 2163 2255 2347 2439 2531 2623 2715 2807 2899 2991 3083 3175 3267 3359 3451 3543 3635 3727 3819 3911 4003 4095 4187 4279 4371 4463 4555 4647 4739 4831 4923 5015 5107 5199 5291 5383 5475 5567 5659 5751 5843 5935 6027 6119 6211 6303 6395 6487 6579 6671 6763 6855 6947 7039 7131 7223 7315 7407 7499 7591 7683 7775 7867 7959 8051 8143 8235 8327 8419 ]
-> [42] rcvbuf=[42 134 226 318 410 502 594 686 778 870 962 1054 1146 1238 1330 1422 1514 1606 1698 1790 1882 1974 2066 2158 2250 2342 2434 2526 2618 2710 2802 2894 2986 3078 3170 3262 3354 3446 3538 3630 3722 3814 3906 3998 4090 4182 4274 4366 4458 4550 4642 4734 4826 4918 5010 5102 5194 5286 5378 5470 5562 5654 5746 5838 5930 6022 6114 6206 6298 6390 6482 6574 6666 6758 6850 6942 7034 7126 7218 7310 7402 7494 7586 7678 7770 7862 7954 8046 8138 8230 8322 8414 ]
-> [44] rcvbuf=[44 136 228 320 412 504 596 688 780 872 964 1056 1148 1240 1332 1424 1516 1608 1700 1792 1884 1976 2068 2160 2252 2344 2436 2528 2620 2712 2804 2896 2988 3080 3172 3264 3356 3448 3540 3632 3724 3816 3908 4000 4092 4184 4276 4368 4460 4552 4644 4736 4828 4920 5012 5104 5196 5288 5380 5472 5564 5656 5748 5840 5932 6024 6116 6208 6300 6392 6484 6576 6668 6760 6852 6944 7036 7128 7220 7312 7404 7496 7588 7680 7772 7864 7956 8048 8140 8232 8324 8416 ]
-> [30] rcvbuf=[30 122 214 306 398 490 582 674 766 858 950 1042 1134 1226 1318 1410 1502 1594 1686 1778 1870 1962 2054 2146 2238 2330 2422 2514 2606 2698 2790 2882 2974 3066 3158 3250 3342 3434 3526 3618 3710 3802 3894 3986 4078 4170 4262 4354 4446 4538 4630 4722 4814 4906 4998 5090 5182 5274 5366 5458 5550 5642 5734 5826 5918 6010 6102 6194 6286 6378 6470 6562 6654 6746 6838 6930 7022 7114 7206 7298 7390 7482 7574 7666 7758 7850 7942 8034 8126 8218 8310 8402 ]
-> [46] rcvbuf=[46 138 230 322 414 506 598 690 782 874 966 1058 1150 1242 1334 1426 1518 1610 1702 1794 1886 1978 2070 2162 2254 2346 2438 2530 2622 2714 2806 2898 2990 3082 3174 3266 3358 3450 3542 3634 3726 3818 3910 4002 4094 4186 4278 4370 4462 4554 4646 4738 4830 4922 5014 5106 5198 5290 5382 5474 5566 5658 5750 5842 5934 6026 6118 6210 6302 6394 6486 6578 6670 6762 6854 6946 7038 7130 7222 7314 7406 7498 7590 7682 7774 7866 7958 8050 8142 8234 8326 8418 ]
-> [63] rcvbuf=[63 155 247 339 431 523 615 707 799 891 983 1075 1167 1259 1351 1443 1535 1627 1719 1811 1903 1995 2087 2179 2271 2363 2455 2547 2639 2731 2823 2915 3007 3099 3191 3283 3375 3467 3559 3651 3743 3835 3927 4019 4111 4203 4295 4387 4479 4571 4663 4755 4847 4939 5031 5123 5215 5307 5399 5491 5583 5675 5767 5859 5951 6043 6135 6227 6319 6411 6503 6595 6687 6779 6871 6963 7055 7147 7239 7331 7423 7515 7607 7699 7791 7883 7975 8067 8159 8251 8343 8435 ]
-> [61] rcvbuf=[61 153 245 337 429 521 613 705 797 889 981 1073 1165 1257 1349 1441 1533 1625 1717 1809 1901 1993 2085 2177 2269 2361 2453 2545 2637 2729 2821 2913 3005 3097 3189 3281 3373 3465 3557 3649 3741 3833 3925 4017 4109 4201 4293 4385 4477 4569 4661 4753 4845 4937 5029 5121 5213 5305 5397 5489 5581 5673 5765 5857 5949 6041 6133 6225 6317 6409 6501 6593 6685 6777 6869 6961 7053 7145 7237 7329 7421 7513 7605 7697 7789 7881 7973 8065 8157 8249 8341 8433 ]
-> [60] rcvbuf=[60 152 244 336 428 520 612 704 796 888 980 1072 1164 1256 1348 1440 1532 1624 1716 1808 1900 1992 2084 2176 2268 2360 2452 2544 2636 2728 2820 2912 3004 3096 3188 3280 3372 3464 3556 3648 3740 3832 3924 4016 4108 4200 4292 4384 4476 4568 4660 4752 4844 4936 5028 5120 5212 5304 5396 5488 5580 5672 5764 5856 5948 6040 6132 6224 6316 6408 6500 6592 6684 6776 6868 6960 7052 7144 7236 7328 7420 7512 7604 7696 7788 7880 7972 8064 8156 8248 8340 8432 ]
-> [62] rcvbuf=[62 154 246 338 430 522 614 706 798 890 982 1074 1166 1258 1350 1442 1534 1626 1718 1810 1902 1994 2086 2178 2270 2362 2454 2546 2638 2730 2822 2914 3006 3098 3190 3282 3374 3466 3558 3650 3742 3834 3926 4018 4110 4202 4294 4386 4478 4570 4662 4754 4846 4938 5030 5122 5214 5306 5398 5490 5582 5674 5766 5858 5950 6042 6134 6226 6318 6410 6502 6594 6686 6778 6870 6962 7054 7146 7238 7330 7422 7514 7606 7698 7790 7882 7974 8066 8158 8250 8342 8434 ]
index 9e74d4b..09fa811 100644 (file)
@@ -134,7 +134,9 @@ int main(int argc, char **argv)
   print_buffer_int(sdispls, size, "sdisp:", rank);
   print_buffer_int(rdispls, size, "rdisp:", rank);
 
-  MPI_Alltoallv(sbuf, sendcounts, sdispls, MPI_INT, rbuf, recvcounts, rdispls, MPI_INT, comm);
+  status = MPI_Alltoallv(sbuf, sendcounts, sdispls, MPI_INT, rbuf, recvcounts, rdispls, MPI_INT, comm);
+  if (status != MPI_SUCCESS)
+    printf("MPI_Alltoallv did not return MPI_SUCCESS\n");
 
   print_buffer_int(rbuf, size2, "rbuf:", rank);
 
index a16c8b2..d29e4e0 100644 (file)
@@ -7,40 +7,60 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_io -p
 > (maestro@) [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
+> (0@bob) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 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 4
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 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 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
+> (1@carl) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 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 8
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 4
+> (3@carl) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 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 16
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 12
 > (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
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 39
 > (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) Write in MPI_File /scratch/testfile, 12 bytes written, count 3, writesize 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
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 40
+> (2@bob) Write in MPI_File /scratch/testfile, 12 bytes written, count 3, writesize 12 bytes, movesize 12
 > (2@bob) Position after write in MPI_File /scratch/testfile : 38
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 48
+> (1@carl) Write in MPI_File /scratch/testfile, 12 bytes written, count 3, writesize 12 bytes, movesize 12
+> (1@carl) Position after write in MPI_File /scratch/testfile : 25
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 44
+> (3@carl) Write in MPI_File /scratch/testfile, 12 bytes written, count 3, writesize 12 bytes, movesize 12
+> (3@carl) Position after write in MPI_File /scratch/testfile : 51
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 52
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 16
 > (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 12
 > (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 8
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 4
 > (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 16
 > (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 12
 > (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 4
 > (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 8
 > (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 16
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 12
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 4
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 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
@@ -49,11 +69,19 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_io -p
 > (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) Read in MPI_File /scratch/testfile, 12 bytes read, count 3, readsize 12 bytes, movesize 12
 > (0@bob) Position after read in MPI_File /scratch/testfile : 12
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 40
+> (2@bob) Read in MPI_File /scratch/testfile, 12 bytes read, count 3, readsize 12 bytes, movesize 12
+> (2@bob) Position after read in MPI_File /scratch/testfile : 38
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 48
+> (1@carl) Read in MPI_File /scratch/testfile, 12 bytes read, count 3, readsize 12 bytes, movesize 12
+> (1@carl) Position after read in MPI_File /scratch/testfile : 25
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 44
+> (3@carl) Read in MPI_File /scratch/testfile, 12 bytes read, count 3, readsize 12 bytes, movesize 12
+> (3@carl) Position after read in MPI_File /scratch/testfile : 51
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 52
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 16
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 12
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 8
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 4
index fe91aa9..36445e0 100644 (file)
@@ -7,32 +7,40 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_io -p
 > (maestro@) [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
+> (0@bob) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 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 4
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 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 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
+> (1@carl) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 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 8
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 4
+> (3@carl) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 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 16
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 12
 > (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
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 39
 > (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) Write in MPI_File /scratch/testfile, 12 bytes written, count 3, writesize 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
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 40
+> (2@bob) Write in MPI_File /scratch/testfile, 12 bytes written, count 3, writesize 12 bytes, movesize 12
 > (2@bob) Position after write in MPI_File /scratch/testfile : 38
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 48
+> (1@carl) Write in MPI_File /scratch/testfile, 12 bytes written, count 3, writesize 12 bytes, movesize 12
+> (1@carl) Position after write in MPI_File /scratch/testfile : 25
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 44
+> (3@carl) Write in MPI_File /scratch/testfile, 12 bytes written, count 3, writesize 12 bytes, movesize 12
+> (3@carl) Position after write in MPI_File /scratch/testfile : 51
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 52
 > (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
@@ -41,11 +49,15 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_io -p
 > (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) Read in MPI_File /scratch/testfile, 12 bytes read, count 3, readsize 12 bytes, movesize 12
 > (0@bob) Position after read in MPI_File /scratch/testfile : 12
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 40
+> (2@bob) Read in MPI_File /scratch/testfile, 12 bytes read, count 3, readsize 12 bytes, movesize 12
+> (2@bob) Position after read in MPI_File /scratch/testfile : 38
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 48
+> (1@carl) Read in MPI_File /scratch/testfile, 12 bytes read, count 3, readsize 12 bytes, movesize 12
+> (1@carl) Position after read in MPI_File /scratch/testfile : 25
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 44
+> (3@carl) Read in MPI_File /scratch/testfile, 12 bytes read, count 3, readsize 12 bytes, movesize 12
+> (3@carl) Position after read in MPI_File /scratch/testfile : 51
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 52
index de8aa49..d1f446b 100644 (file)
@@ -9,14 +9,22 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_io -p
 > (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) Write in MPI_File /scratch/testfile, 40 bytes written, count 10, writesize 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 40
+> (2@bob) Write in MPI_File /scratch/testfile, 40 bytes written, count 10, writesize 40 bytes, movesize 40
+> (2@bob) Position after write in MPI_File /scratch/testfile : 120
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 120
+> (1@carl) Write in MPI_File /scratch/testfile, 40 bytes written, count 10, writesize 40 bytes, movesize 40
+> (1@carl) Position after write in MPI_File /scratch/testfile : 80
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 80
+> (3@carl) Write in MPI_File /scratch/testfile, 40 bytes written, count 10, writesize 40 bytes, movesize 40
+> (3@carl) Position after write in MPI_File /scratch/testfile : 160
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 160
+> (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
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
 > (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
@@ -25,14 +33,22 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_io -p
 > (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) Read in MPI_File /scratch/testfile, 40 bytes read, count 10, 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 40
+> (2@bob) Read in MPI_File /scratch/testfile, 40 bytes read, count 10, readsize 40 bytes, movesize 40
+> (2@bob) Position after read in MPI_File /scratch/testfile : 120
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 120
+> (1@carl) Read in MPI_File /scratch/testfile, 40 bytes read, count 10, readsize 40 bytes, movesize 40
+> (1@carl) Position after read in MPI_File /scratch/testfile : 80
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 80
+> (3@carl) Read in MPI_File /scratch/testfile, 40 bytes read, count 10, readsize 40 bytes, movesize 40
+> (3@carl) Position after read in MPI_File /scratch/testfile : 160
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 160
+> (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
+> (2@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
index 15e8501..c8927d4 100644 (file)
@@ -7,34 +7,41 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_io -p
 > (maestro@) [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
+> (3@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) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 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 4
 > (2@bob) 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) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 4 bytes, movesize 4
 > (2@bob) Position after write in MPI_File /scratch/testfile : 8
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 8
 > (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 8
-> (3@carl) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (3@carl) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 4 bytes, movesize 4
 > (3@carl) 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 12
-> (1@carl) Write in MPI_File /scratch/testfile, 4 bytes written, readsize 4 bytes, movesize 4
+> (1@carl) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 4 bytes, movesize 4
 > (1@carl) Position after write in MPI_File /scratch/testfile : 16
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 16
 > (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) Read in MPI_File /scratch/testfile, 4 bytes read, readsize 4 bytes, movesize 4
+> (0@bob) Read in MPI_File /scratch/testfile, 4 bytes read, count 1, 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, 4 bytes read, readsize 4 bytes, movesize 4
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 4
+> (2@bob) Read in MPI_File /scratch/testfile, 4 bytes read, count 1, readsize 4 bytes, movesize 4
 > (2@bob) Position after read in MPI_File /scratch/testfile : 8
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 8
 > (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 8
-> (3@carl) Read in MPI_File /scratch/testfile, 4 bytes read, readsize 4 bytes, movesize 4
+> (3@carl) Read in MPI_File /scratch/testfile, 4 bytes read, count 1, readsize 4 bytes, movesize 4
 > (3@carl) Position after read in MPI_File /scratch/testfile : 12
 > (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 12
-> (1@carl) Read in MPI_File /scratch/testfile, 4 bytes read, readsize 4 bytes, movesize 4
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 12
+> (1@carl) Read in MPI_File /scratch/testfile, 4 bytes read, count 1, readsize 4 bytes, movesize 4
 > (1@carl) Position after read in MPI_File /scratch/testfile : 16
-
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 16
index 748e012..68ec494 100644 (file)
@@ -7,25 +7,33 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_io -p
 > (maestro@) [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) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 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
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 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
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
 > (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
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 12
+> (1@carl) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 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 0
+> (3@carl) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 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 0
 > (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
 > (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 8
+> (0@bob) Read in MPI_File /scratch/testfile, 4 bytes read, count 1, readsize 4 bytes, movesize 4
+> (0@bob) Position after read in MPI_File /scratch/testfile : 4
+> (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (2@bob) Read in MPI_File /scratch/testfile, 4 bytes read, count 1, readsize 4 bytes, movesize 4
+> (2@bob) Position after read in MPI_File /scratch/testfile : 12
+> (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
 > (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) Read in MPI_File /scratch/testfile, 4 bytes read, count 1, 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
+> (1@carl) Seeking in MPI_File /scratch/testfile, setting offset 0
+> (3@carl) Read in MPI_File /scratch/testfile, 4 bytes read, count 1, readsize 4 bytes, movesize 4
+> (3@carl) Position after read in MPI_File /scratch/testfile : 16
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 0
index 7620831..e6de2e0 100644 (file)
@@ -7,25 +7,25 @@ $ ${bindir:=.}/../../../smpi_script/bin/smpirun -map -hostfile ../hostfile_io -p
 > (maestro@) [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) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 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) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 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
+> (3@carl) Seeking in MPI_File /scratch/testfile, setting offset 12
+> (1@carl) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 4 bytes, movesize 4
 > (1@carl) Position after write in MPI_File /scratch/testfile : 8
+> (3@carl) Write in MPI_File /scratch/testfile, 4 bytes written, count 1, writesize 4 bytes, movesize 4
+> (3@carl) Position after write in MPI_File /scratch/testfile : 16
 > (0@bob) Seeking in MPI_File /scratch/testfile, setting offset 0
 > (2@bob) Seeking in MPI_File /scratch/testfile, setting offset 8
+> (0@bob) Read in MPI_File /scratch/testfile, 4 bytes read, count 1, 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, count 1, readsize 4 bytes, movesize 4
+> (2@bob) Position after read 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) 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) Read in MPI_File /scratch/testfile, 4 bytes read, count 1, 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
+> (3@carl) Read in MPI_File /scratch/testfile, 4 bytes read, count 1, readsize 4 bytes, movesize 4
+> (3@carl) Position after read in MPI_File /scratch/testfile : 16
index dea3a7a..088f9ab 100644 (file)
@@ -44,7 +44,7 @@ endif()
 if (enable_smpi_MPICH3_testsuite AND HAVE_RAW_CONTEXTS)
   ADD_TEST(test-smpi-mpich3-rma-raw       ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/rma ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests "-wrapper=${VALGRIND_WRAPPER}" -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/rma -tests=testlist -execarg=--cfg=contexts/factory:raw)
   SET_TESTS_PROPERTIES(test-smpi-mpich3-rma-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
-  if (enable_thread_sanitizer)
+  if (enable_thread_sanitizer OR enable_coverage)
     SET_TESTS_PROPERTIES(test-smpi-mpich3-rma-raw PROPERTIES TIMEOUT 1500)
   endif()
 endif()
index 1d9a841..fb10524 100644 (file)
@@ -21,7 +21,7 @@ endforeach()
 
 if(HAVE_MMALLOC)
   add_executable       (mmalloc_test EXCLUDE_FROM_ALL ${CMAKE_CURRENT_SOURCE_DIR}/mmalloc/mmalloc_test.cpp)
-  target_link_libraries(mmalloc_test simgrid)
+  target_link_libraries(mmalloc_test simgrid sgmalloc)
   set_target_properties(mmalloc_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mmalloc)
   set_property(TARGET mmalloc_test APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")
   add_dependencies(tests mmalloc_test)
index 06bc543..8bb9bac 100644 (file)
@@ -104,7 +104,6 @@ $ ${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 caught)
-> free again all blocks (to really check that double free are correctly caught)
+> free all blocks
 > Let's try different codepaths for mrealloc
 > Damnit, I cannot break mmalloc this time. That's SO disappointing.
index 17356ee..ec276c3 100644 (file)
@@ -104,7 +104,6 @@ $ ${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 caught)
-> free again all blocks (to really check that double free are correctly caught)
+> free all blocks
 > Let's try different codepaths for mrealloc
 > Damnit, I cannot break mmalloc this time. That's SO disappointing.
index 22ec933..6f798f0 100644 (file)
@@ -70,28 +70,9 @@ 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 caught)");
-  for (i = 0; i < TESTSIZE; i++) {
-    bool gotit = false;
+  XBT_INFO("free all blocks");
+  for (i = 0; i < TESTSIZE; i++)
     mfree(heapA, pointers[i]);
-    try {
-      mfree(heapA, pointers[i]);
-    } catch (const simgrid::Exception&) {
-      gotit = true;
-    }
-    xbt_assert(gotit, "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 caught)");
-  for (i = 0; i < TESTSIZE; i++) {
-    bool gotit = false;
-    try {
-      mfree(heapA, pointers[i]);
-    } catch (const simgrid::Exception&) {
-      gotit = true;
-    }
-    xbt_assert(gotit, "FAIL: A double-free went undetected (for size:%d)", size_of_block(i));
-  }
 
   XBT_INFO("Let's try different codepaths for mrealloc");
   for (i = 0; i < TESTSIZE; i++) {
index 995908e..e7ca165 100644 (file)
@@ -20,3 +20,8 @@ odr_violation:^__tag$
 
 # size=16 'stored_vtable' /usr/include/boost/function/function_template.hpp:933:32
 odr_violation:^stored_vtable$
+
+# size=40 'cfg_bmf_max_iteration' ../src/kernel/lmm/bmf.hpp:77:44
+odr_violation:^cfg_bmf_max_iteration$
+# size=40 'cfg_bmf_precision' ../src/kernel/lmm/bmf.hpp:80:47
+odr_violation:^cfg_bmf_precision$
index 155869e..2ade517 100644 (file)
@@ -248,6 +248,11 @@ set(SMPI_SRC
   src/surf/network_ib.cpp
   src/surf/network_smpi.cpp
   )
+set(STHREAD_SRC
+  src/sthread/sthread_impl.cpp
+  src/sthread/sthread.c
+  src/sthread/sthread.h
+)
 
 set(XBT_SRC
   src/xbt/OsSemaphore.hpp
@@ -283,7 +288,8 @@ set(XBT_SRC
   )
 
 if(HAVE_MMALLOC)
-  set(XBT_SRC ${XBT_SRC}  src/xbt/mmalloc/mm.c )
+  set(SGMALLOC_SRC src/xbt/mmalloc/mm.c)
+  set(XBT_SRC      ${XBT_SRC} src/xbt/mmalloc/mm.c)
 else()
   set(EXTRA_DIST ${EXTRA_DIST} src/xbt/mmalloc/mm.c)
 endif()
@@ -427,7 +433,6 @@ set(SIMIX_SRC
   src/kernel/context/ContextThread.cpp
   src/kernel/context/ContextThread.hpp
   src/simix/libsmx.cpp
-  src/simix/smx_context.cpp
   )
 
 # Boost context may not be available
@@ -570,6 +575,7 @@ set(MC_SRC
   src/mc/explo/CommunicationDeterminismChecker.cpp
   src/mc/explo/DFSExplorer.cpp
   src/mc/explo/DFSExplorer.hpp
+  src/mc/explo/Exploration.cpp
   src/mc/explo/Exploration.hpp
   src/mc/explo/LivenessChecker.cpp
   src/mc/explo/LivenessChecker.hpp
@@ -628,28 +634,23 @@ set(MC_SRC
   src/mc/AddressSpace.hpp
   src/mc/ModelChecker.cpp
   src/mc/ModelChecker.hpp
-  src/mc/Session.cpp
-  src/mc/Session.hpp
   src/mc/VisitedState.cpp
   src/mc/VisitedState.hpp
-  src/mc/api.cpp
-  src/mc/api.hpp
+  src/mc/api/ActorState.hpp
   src/mc/api/State.cpp
   src/mc/api/State.hpp
+  src/mc/api/RemoteApp.cpp
+  src/mc/api/RemoteApp.hpp
   src/mc/compare.cpp
   src/mc/mc_client_api.cpp
   src/mc/mc_exit.hpp
   src/mc/mc_forward.hpp
-  src/mc/mc_hash.cpp
-  src/mc/mc_hash.hpp
-  src/mc/mc_ignore.hpp
-  src/mc/mc_pattern.hpp
   src/mc/mc_private.hpp
   src/mc/mc_record.cpp
-  src/mc/mc_safety.hpp
-  src/mc/mc_smx.cpp
   src/mc/udpor_global.cpp
   src/mc/udpor_global.hpp
+
+  src/xbt/mmalloc/mm_interface.c
   )
 
 set(MC_SIMGRID_MC_SRC  src/mc/explo/simgrid_mc.cpp)
@@ -732,6 +733,7 @@ set(headers_to_install
   include/smpi/forward.hpp
   include/xbt.h
   include/xbt/asserts.h
+  include/xbt/asserts.hpp
   include/xbt/automaton.h
   include/xbt/automaton.hpp
   include/xbt/backtrace.hpp
@@ -1030,6 +1032,7 @@ set(CMAKEFILES_TXT
   examples/smpi/replay_multiple/CMakeLists.txt
   examples/smpi/replay_multiple_manual_deploy/CMakeLists.txt
   examples/smpi/smpi_s4u_masterworker/CMakeLists.txt
+  examples/sthread/CMakeLists.txt
 
   teshsuite/java/CMakeLists.txt
   teshsuite/kernel/CMakeLists.txt
index 47e8911..8d871e3 100644 (file)
@@ -111,6 +111,7 @@ set(source_to_pack
   ${TRACING_SRC}
   ${XBT_RL_SRC}
   ${XBT_SRC}
+  ${STHREAD_SRC}
   ${EXTRA_DIST}
   ${CMAKE_SOURCE_FILES}
   ${CMAKEFILES_TXT}
index 6fdaa31..ba2e37f 100644 (file)
@@ -44,6 +44,10 @@ if(enable_compile_warnings)
     # don't care about class that become struct, avoid issue of empty C structs
     # size (coming from libunwind.h)
     set(warnCXXFLAGS "${warnCXXFLAGS} -Wno-mismatched-tags -Wno-extern-c-compat")
+    # also ignore deprecated builtins (seen with clang 15 + boost 1.79)
+    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "15.0")
+      set(warnCXXFLAGS "${warnCXXFLAGS} -Wno-deprecated-builtins")
+    endif()
   endif()
 
   # the one specific to C but refused by C++
@@ -97,7 +101,7 @@ if(enable_compile_optimizations AND CMAKE_COMPILER_IS_GNUCC
 endif()
 
 # Do not leak the current directory into the binaries
-if(CMAKE_COMPILER_IS_GNUCC)
+if(CMAKE_COMPILER_IS_GNUCC AND NOT enable_coverage)
   execute_process(COMMAND realpath --relative-to=${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}
     RESULT_VARIABLE RESULT OUTPUT_VARIABLE RELATIVE_SOURCE_DIR ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
   if(RESULT EQUAL 0)
index 8729e1c..551c48e 100644 (file)
@@ -26,6 +26,21 @@ set_property(TARGET simgrid
 
 add_dependencies(simgrid maintainer_files)
 
+if("${CMAKE_SYSTEM}" MATCHES "Linux")
+  add_library(sthread SHARED ${STHREAD_SRC})
+  set_property(TARGET sthread
+                APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")
+  target_link_libraries(sthread simgrid)
+else()
+  set(EXTRA_DIST ${EXTRA_DIST} ${STHREAD_SRC})
+endif()
+
+if(HAVE_MMALLOC)
+  add_library(sgmalloc SHARED ${SGMALLOC_SRC})
+  set_property(TARGET sgmalloc
+                APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")
+endif()
+
 if(enable_model-checking)
   add_executable(simgrid-mc ${MC_SIMGRID_MC_SRC})
   target_link_libraries(simgrid-mc simgrid)
@@ -36,9 +51,11 @@ if(enable_model-checking)
   install(TARGETS simgrid-mc # install that binary without breaking the rpath on Mac
     RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/)
   add_dependencies(tests-mc simgrid-mc)
+  if("${CMAKE_SYSTEM}" MATCHES "Linux")
+    add_dependencies(tests-mc sthread)
+  endif()
 endif()
 
-
 # Compute the dependencies of SimGrid
 #####################################
 # search for dlopen
@@ -122,7 +139,7 @@ if(enable_smpi)
        if ("${CMAKE_SYSTEM_VERSION}" STRGREATER_EQUAL "12")
             set(SIMGRID_DEP "${SIMGRID_DEP} -lpgmath")
         endif()
-        if ("${CMAKE_SYSTEM_VERSION}" MATCHES "12\.1")
+        if ("${CMAKE_SYSTEM_VERSION}" MATCHES "12\\.1")
             set(SIMGRID_DEP "${SIMGRID_DEP} -lomp")
         endif()
       endif()
index 89b7798..1c47743 100644 (file)
 #  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.26 is hardcoded).
 #  - No proper find_package() integration
 
-## 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
-
 set(SIMGRID_HAVE_NS3 0)
-set(NS3_HINT ${ns3_path} CACHE PATH "Path to search for NS3 lib and include")
+find_package(PkgConfig)
 
-set(NS3_KNOWN_VERSIONS "3-dev" "3.22" "3.23" "3.24" "3.25" "3.26" "3.27" "3.28" "3.29" "3.30" "3.31" "3.32" "3.33" "3.34" "3.35" "3.36" "3.37" "3.38" "3.39" "3.40")
+pkg_check_modules(NS3 ns3-core>=3.28 ns3-csma ns3-point-to-point ns3-internet ns3-network ns3-applications ns3-wifi)
+if(NS3_FOUND) # Starting from 3.36, ns3 provides a working pkg-config file, making things much easier
+  set(SIMGRID_HAVE_NS3 1)
+  set(NS3_LIBRARY_PATH ${NS3_LIBRARY_DIRS})
+  set(NS3_INCLUDE_DIR ${NS3_INCLUDE_DIRS})  
+  set(NS3_LIBRARIES "")
+  foreach(elm ${NS3_LDFLAGS})
+    if (elm MATCHES "^-L" OR elm MATCHES "^-lns3")
+      if ((NOT NS3_LIBRARIES MATCHES " ${elm} ") AND (NOT NS3_LIBRARIES MATCHES " ${elm}$")) 
+        set(NS3_LIBRARIES "${NS3_LIBRARIES} ${elm}")
+      endif()
+    endif()
+  endforeach()
+
+  set(NS3_VERSION "${NS3_ns3-core_VERSION}")
+  string(REGEX REPLACE "3\\.([-.0-9a-z]+)" "\\1" NS3_MINOR_VERSION "${NS3_VERSION}")
+  if(NS3_MINOR_VERSION MATCHES "\\.")
+    string(REGEX REPLACE "^[0-9]*\\.([0-9]+$)" "\\1" NS3_PATCH_VERSION "${NS3_MINOR_VERSION}")
+    string(REGEX REPLACE "^([0-9]+)\\.[0-9]*$" "\\1" NS3_MINOR_VERSION "${NS3_MINOR_VERSION}")
+  else()
+    set(NS3_PATCH_VERSION "0")
+  endif()
 
-foreach (_ns3_ver ${NS3_KNOWN_VERSIONS})
-  list(APPEND _ns3_LIB_SEARCH_DIRS "ns${_ns3_ver}-core" "ns${_ns3_ver}-core-optimized" "ns${_ns3_ver}-core-debug" "ns${_ns3_ver}-core-default")
-  list(APPEND _ns3_INCLUDE_SEARCH_DIRS "include/ns${_ns3_ver}")
-endforeach()
+  
+  # No pkg-config found. Try to go the old path
+else()
+  set(NS3_HINT ${ns3_path} CACHE PATH "Path to search for NS3 lib and include")
 
-find_library(NS3_LIBRARIES
-  NAME ns3-core
-      ${_ns3_LIB_SEARCH_DIRS}
-  PATH_SUFFIXES lib64 lib ns3/lib
-  PATHS
-  ${NS3_HINT}
-  )
+  set(NS3_KNOWN_VERSIONS "3-dev" "3.28" "3.29" "3.30" "3.31" "3.32" "3.33" "3.34" "3.35")
 
-find_path(NS3_INCLUDE_DIR
-  NAME ns3/core-module.h
-  PATH_SUFFIXES include ns3/include
-                ${_ns3_INCLUDE_SEARCH_DIRS}
-  PATHS
-  ${NS3_HINT}
-  )
+  foreach (_ns3_ver ${NS3_KNOWN_VERSIONS})
+    list(APPEND _ns3_LIB_SEARCH_DIRS "ns${_ns3_ver}-core" "ns${_ns3_ver}-core-optimized" "ns${_ns3_ver}-core-debug" "ns${_ns3_ver}-core-default")
+    list(APPEND _ns3_INCLUDE_SEARCH_DIRS "include/ns${_ns3_ver}")
+  endforeach()
 
-if(NS3_INCLUDE_DIR)
-  message(STATUS "Looking for ns3/core-module.h - found")
-else()
-  message(STATUS "Looking for ns3/core-module.h - not found")
-endif()
-mark_as_advanced(NS3_INCLUDE_DIR)
+  find_library(NS3_LIBRARIES
+    NAME ns3-core
+        ${_ns3_LIB_SEARCH_DIRS}
+    PATH_SUFFIXES lib64 lib ns3/lib
+    PATHS
+    ${NS3_HINT}
+    )
 
-message(STATUS "Looking for lib ns3-core")
-if(NS3_LIBRARIES)
-  message(STATUS "Looking for lib ns3-core - found")
-else()
-  message(STATUS "Looking for lib ns3-core - not found")
-endif()
-mark_as_advanced(NS3_LIBRARIES)
+  find_path(NS3_INCLUDE_DIR
+    NAME ns3/core-module.h
+    PATH_SUFFIXES include ns3/include
+                  ${_ns3_INCLUDE_SEARCH_DIRS}
+    PATHS
+    ${NS3_HINT}
+    )
 
-if(NS3_INCLUDE_DIR)
+  if(NS3_INCLUDE_DIR)
+    message(STATUS "Looking for ns3/core-module.h - found")
+  else()
+    message(STATUS "Looking for ns3/core-module.h - not found")
+  endif()
+  mark_as_advanced(NS3_INCLUDE_DIR)
+
+  message(STATUS "Looking for lib ns3-core")
   if(NS3_LIBRARIES)
-    set(SIMGRID_HAVE_NS3 1)
-    if(NS3_LIBRARIES MATCHES "-optimized")
-      set (NS3_SUFFIX "-optimized")
-    elseif(NS3_LIBRARIES MATCHES "-debug")
-      set (NS3_SUFFIX "-debug")
-    elseif(NS3_LIBRARIES MATCHES "-default")
-      set (NS3_SUFFIX "-default")
-    else()
-      set (NS3_SUFFIX "")
-    endif()
-    message(STATUS "ns-3 found ${NS3_LIBRARIES}")
-    string(REGEX REPLACE ".*libns(.*)-core.*" "\\1" NS3_VERSION "${NS3_LIBRARIES}")
-    string(REGEX REPLACE "3.([.0-9\-a-z]+)" "\\1" NS3_MINOR_VERSION "${NS3_VERSION}")
-    if(NS3_MINOR_VERSION MATCHES "dev")
-      set(NS3_MINOR_VERSION "99")
-    endif()
-    get_filename_component(NS3_LIBRARY_PATH "${NS3_LIBRARIES}" PATH)
+    message(STATUS "Looking for lib ns3-core - found")
+  else()
+    message(STATUS "Looking for lib ns3-core - not found")
+  endif()
+  mark_as_advanced(NS3_LIBRARIES)
 
-    # Compute NS3_PATH
-    string(REGEX REPLACE "(.*)/lib" "\\1" NS3_PATH "${NS3_LIBRARY_PATH}")
+  if(NS3_INCLUDE_DIR)
+    if(NS3_LIBRARIES)
+      set(SIMGRID_HAVE_NS3 1)
+      if(NS3_LIBRARIES MATCHES "-optimized")
+        set (NS3_SUFFIX "-optimized")
+      elseif(NS3_LIBRARIES MATCHES "-debug")
+        set (NS3_SUFFIX "-debug")
+      elseif(NS3_LIBRARIES MATCHES "-default")
+        set (NS3_SUFFIX "-default")
+      else()
+        set (NS3_SUFFIX "")
+      endif()
+      message(STATUS "ns-3 found ${NS3_LIBRARIES}")
+      string(REGEX REPLACE ".*libns(.*)-core.*" "\\1" NS3_VERSION "${NS3_LIBRARIES}")
+      string(REGEX REPLACE "3\\.([-.0-9a-z]+)" "\\1" NS3_MINOR_VERSION "${NS3_VERSION}")
+      if(NS3_MINOR_VERSION MATCHES "dev")
+        set(NS3_MINOR_VERSION "99")
+      endif()
+      if(NS3_MINOR_VERSION MATCHES "\\.")
+        string(REGEX REPLACE "^[0-9]*\\.([0-9]+$)" "\\1" NS3_PATCH_VERSION "${NS3_MINOR_VERSION}")
+        string(REGEX REPLACE "^([0-9]+)\\.[0-9]*$" "\\1" NS3_MINOR_VERSION "${NS3_MINOR_VERSION}")
+      else()
+        set(NS3_PATCH_VERSION "0")
+      endif()
+      get_filename_component(NS3_LIBRARY_PATH "${NS3_LIBRARIES}" PATH)
 
-    message(STATUS "ns-3 found (v${NS3_VERSION}; incl:${NS3_INCLUDE_DIR}; lib: ${NS3_LIBRARY_PATH}).")
+      # Compute NS3_PATH
+      string(REGEX REPLACE "(.*)/lib" "\\1" NS3_PATH "${NS3_LIBRARY_PATH}")
 
-    if (NOT NS3_LIBRARY_PATH STREQUAL "/usr/lib")
-      string(REGEX MATCH "${NS3_LIBRARY_PATH}" MatchResult "$ENV{LD_LIBRARY_PATH}")
-      if(NOT MatchResult)
-        message(STATUS "Warning: NS3 not installed in system path, and not listed in LD_LIBRARY_PATH."
-                       "         You want to: export LD_LIBRARY_PATH=${NS3_LIBRARY_PATH}\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}")
+      if (NOT NS3_LIBRARY_PATH STREQUAL "/usr/lib")
+        string(REGEX MATCH "${NS3_LIBRARY_PATH}" MatchResult "$ENV{LD_LIBRARY_PATH}")
+        if(NOT MatchResult)
+          message(STATUS "Warning: NS3 not installed in system path, and not listed in LD_LIBRARY_PATH."
+                        "         You want to: export LD_LIBRARY_PATH=${NS3_LIBRARY_PATH}\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}")
+        endif()
       endif()
     endif()
   endif()
+  mark_as_advanced(NS3_LIBRARY_PATH)
+
+  set(NS3_LIBRARIES "")
+  foreach(lib core csma point-to-point internet network applications wifi)
+    set(NS3_LIBRARIES "${NS3_LIBRARIES} -lns${NS3_VERSION}-${lib}${NS3_SUFFIX}")
+  endforeach()
 endif()
-mark_as_advanced(NS3_LIBRARY_PATH)
 
 if(SIMGRID_HAVE_NS3)
+  message(STATUS "ns-3 found (v${NS3_VERSION}; minor:${NS3_MINOR_VERSION}; patch:${NS3_PATCH_VERSION}; libpath: ${NS3_LIBRARY_PATH}).")
   link_directories(${NS3_LIBRARY_PATH})
   include_directories(${NS3_INCLUDE_DIR})
 else()
index 91c8915..8566d0a 100755 (executable)
@@ -108,9 +108,10 @@ if [ -f Testing/TAG ] ; then
   /usr/bin/python3-coverage combine
   /usr/bin/python3-coverage xml -i -o ./python_coverage.xml
 
-  cd "$WORKSPACE"
   #convert all gcov reports to xml cobertura reports
-  gcovr -r . --xml-pretty -e teshsuite -e build/MBI -e examples/smpi/NAS -e examples/smpi/mc -u -o "$BUILDFOLDER"/xml_coverage.xml
+  gcovr -r "$WORKSPACE" --xml-pretty -e "$WORKSPACE"/teshsuite -e MBI -e "$WORKSPACE"/examples/smpi/NAS -e "$WORKSPACE"/examples/smpi/mc -u -o xml_coverage.xml --gcov-ignore-parse-errors
+
+  cd "$WORKSPACE"
   xsltproc "$WORKSPACE"/tools/jenkins/ctest2junit.xsl build/Testing/"$( head -n 1 < build/Testing/TAG )"/Test.xml > CTestResults_memcheck.xml
 
   #generate sloccount report
index 2c49b12..028e6e2 100755 (executable)
@@ -91,7 +91,9 @@ cmake -Denable_documentation=OFF -Denable_java=${buildjava} -Denable_msg=${build
       -Denable_mallocators=ON -Denable_debug=${builddebug} \
       -Denable_smpi=${buildsmpi} -Denable_smpi_MPICH3_testsuite=${buildsmpi} -Denable_model-checking=${buildmc} \
       -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_MBI_testsuite=OFF \
-      -Denable_ns3=$(onoff test "$buildmc" != "ON") -DNS3_HINT=/builds/ns-3-dev/build/ -Denable_coverage=OFF -DLTO_EXTRA_FLAG="auto" "$WORKSPACE"
+      -Denable_ns3=$(onoff test "$buildmc" != "ON") -DNS3_HINT=/builds/ns-3-dev/build/ \
+      -Denable_coverage=OFF -DLTO_EXTRA_FLAG="auto" -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
+      "$WORKSPACE"
 
 make -j$NUMPROC tests
 cd ..
index bcbe854..2b5d8ce 100755 (executable)
@@ -80,7 +80,8 @@ cmake -Denable_documentation=OFF -Denable_java=OFF \
       -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_model-checking=OFF \
       -Denable_ns3=ON \
       -Denable_memcheck=OFF -Denable_memcheck_xml=OFF -Denable_smpi_MBI_testsuite=OFF -Denable_coverage=OFF\
-      -Denable_fortran=OFF -Denable_python=OFF -DLTO_EXTRA_FLAG="auto" ${SANITIZER_OPTIONS} "$WORKSPACE"
+      -Denable_fortran=OFF -Denable_python=OFF -DLTO_EXTRA_FLAG="auto" -DCMAKE_CXX_COMPILER_LAUNCHER=ccache\
+      ${SANITIZER_OPTIONS} "$WORKSPACE"
 
 make -j$NUMPROC tests
 ctest --no-compress-output -D ExperimentalTest || true
index 6ad94b0..36c17be 100755 (executable)
@@ -22,12 +22,6 @@ echo "XXXX Let's go"
 
 set -e
 
-# Help older cmakes
-if [ -e /usr/lib/jvm/java-7-openjdk-amd64 ] ;
-then
-  export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
-fi
-
 # usage: die status message...
 die () {
   status=${1:-1}
@@ -231,6 +225,7 @@ cmake -G"$GENERATOR" ${INSTALL:+-DCMAKE_INSTALL_PREFIX=$INSTALL} \
   -Denable_java=$(onoff test "$build_mode" = "ModelChecker") \
   -Denable_msg=$(onoff test "$build_mode" = "ModelChecker") \
   -DLTO_EXTRA_FLAG="auto" \
+  -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
   "$SRCFOLDER"
 set +x
 
index eb77ba6..b002915 100755 (executable)
@@ -26,7 +26,7 @@ get_eigen3(){
 }
 
 get_ns3(){
-  grep -m 1 "ns-3 found (v3.[0-9dev]*; incl:" ./consoleText | sed "s/.*-- ns-3 found .v\(3.[0-9dev]*\); incl:.*/\1/g"
+  sed -n 's/.*-- ns-3 found (v\(3[-.0-9a-z]\+\); minor:.*/\1/p;T;q' ./consoleText
 }
 
 get_python(){