- cmd: git clone --depth=1 https://github.com/pybind/pybind11.git
build_script:
-- cmake -G "MinGW Makefiles" -Denable_lua=OFF -Denable_documentation=OFF -Denable_java=ON -Denable_smpi=OFF -Denable_mallocators=OFF -Denable_lto=OFF .
+- cmake -G "MinGW Makefiles" -Denable_lua=OFF -Denable_documentation=OFF -Denable_java=ON -Denable_MSG=ON -Denable_smpi=OFF -Denable_mallocators=OFF -Denable_lto=OFF .
- mingw32-make.exe VERBOSE=1 java-all python-bindings # Only the Java and Python parts
- ctest --output-on-failure -R java
- ctest --output-on-failure -R python
name: Configure, build and test da stuff
command: |
mkdir _build && cd _build
- cmake -Denable_documentation=OFF -Denable_coverage=ON -Denable_java=ON -Denable_model-checking=OFF -Denable_lua=OFF -Denable_compile_optimizations=OFF -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_compile_warnings=ON ..
+ cmake -Denable_documentation=OFF -Denable_coverage=ON -Denable_java=ON -Denable_MSG=ON -Denable_model-checking=OFF -Denable_lua=OFF -Denable_compile_optimizations=OFF -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_compile_warnings=ON ..
make -j4 tests && ctest -j4 --output-on-failure
except:
- stable
script:
- - cmake -Denable_model-checking=OFF -Denable_documentation=OFF -Denable_coverage=OFF -Denable_java=ON -Denable_lua=OFF -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_compile_warnings=ON .
+ - cmake -Denable_model-checking=OFF -Denable_documentation=OFF -Denable_coverage=OFF -Denable_lua=OFF -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_compile_warnings=ON .
- make VERBOSE=1 all tests && ctest --output-on-failure
pip:
script:
- apt-get --allow-releaseinfo-change update && apt install -y binutils-x86-64-linux-gnu wget unzip zip
# Build the linux version of the jarfile without the boost dependency
- - cmake -Denable_documentation=OFF -Denable_java=ON -Denable_lib_in_jar=ON -Dminimal-bindings=ON -Denable_compile_optimizations=ON -Denable_smpi=OFF .
+ - cmake -Denable_documentation=OFF -Denable_java=ON -Denable_MSG=ON -Denable_lib_in_jar=ON -Dminimal-bindings=ON -Denable_compile_optimizations=ON -Denable_smpi=OFF .
- make VERBOSE=1 dist simgrid simgrid-java_jar
# Get the foreign architectures
- wget https://ci.appveyor.com/api/projects/mquinson/simgrid/artifacts/simgrid.jar -O simgrid-windows.jar
script:
- sudo apt-get update -qq
- sudo apt-get install cmake valgrind gfortran libboost-dev libboost-all-dev libdw-dev libevent-dev libunwind8-dev pybind11-dev
- - (cmake -Denable_model-checking=ON -Denable_documentation=OFF -Denable_coverage=ON -Denable_java=ON -Denable_lua=OFF -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_compile_warnings=ON . || (echo XXX CMakeOutput.log; cat /home/travis/build/simgrid/simgrid/CMakeFiles/CMakeOutput.log; echo XXX CMakeError.log;cat /home/travis/build/simgrid/simgrid/CMakeFiles/CMakeError.log; exit 1))
+ - (cmake -Denable_model-checking=ON -Denable_documentation=OFF -Denable_coverage=ON -Denable_lua=OFF -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=ON -Denable_compile_warnings=ON . || (echo XXX CMakeOutput.log; cat /home/travis/build/simgrid/simgrid/CMakeFiles/CMakeOutput.log; echo XXX CMakeError.log;cat /home/travis/build/simgrid/simgrid/CMakeFiles/CMakeError.log; exit 1))
- make -j2 VERBOSE=1 all && make -j2 tests && ctest -j2 --output-on-failure
- os: windows
script:
- export JAVA_HOME='C:/Program Files/Java/jdk1.8.0_211'
# We need pybind11. SimGrid will pick it automatically if the subdir is here
# - git clone --depth=1 https://github.com/pybind/pybind11.git
- - cmake -G "MinGW Makefiles" -Denable_lua=OFF -Denable_documentation=OFF -Denable_java=ON -Denable_smpi=OFF -Denable_mallocators=OFF -Denable_lto=OFF .
+ - cmake -G "MinGW Makefiles" -Denable_lua=OFF -Denable_documentation=OFF -Denable_smpi=OFF -Denable_mallocators=OFF -Denable_lto=OFF .
- df -h
- du -hs /tmp || true
- mingw32-make.exe VERBOSE=1 java-all && ctest --output-on-failure -R java
osx_image: xcode11
script:
- export LIBRARY_PATH=/usr/local/lib/gcc/9
- - cmake -Denable_model-checking=OFF -Denable_documentation=OFF -Denable_coverage=ON -Denable_java=ON -Denable_lua=OFF -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_compile_warnings=ON .
+ - cmake -Denable_model-checking=OFF -Denable_documentation=OFF -Denable_coverage=ON -Denable_lua=OFF -Denable_compile_optimizations=ON -Denable_smpi=ON -Denable_smpi_MPICH3_testsuite=OFF -Denable_compile_warnings=ON .
- make -j2 VERBOSE=1 all && make -j2 tests && ctest -j2 --output-on-failure
notifications:
recipients:
endif()
endif()
+set(SIMGRID_HAVE_MSG 0)
+if(enable_MSG)
+ set(SIMGRID_HAVE_MSG 1)
+endif()
+
if(WIN32)
set(Boost_USE_STATIC_LIBS 1)
endif()
mark_as_advanced(PATH_LIBDW_H)
mark_as_advanced(PATH_LIBDW_LIB)
+if(enable_java AND NOT enable_MSG)
+ message(FATAL_ERROR "Cannot activate the Java bindings without the MSG module. Either add -Denable_MSG=ON or -Denable_java=OFF")
+endif()
+
if (enable_model-checking AND enable_ns3)
message(FATAL_ERROR "Cannot activate both model-checking and ns-3 bindings: ns-3 pulls too much dependencies for the MC to work")
endif()
message(" with LTO ....................: ${enable_lto}")
message("")
+if (SIMGRID_HAVE_MSG)
+ message(" Compile MSG .................: ON")
+else()
+ message(" Compile MSG .................: OFF")
+endif()
+
if (SIMGRID_HAVE_NS3)
- message(" Compile ns-3 ................: yes (path: ${NS3_PATH})")
+ message(" Compile ns-3 ................: ON (path: ${NS3_PATH})")
else()
- message(" Compile ns-3 ................: NO (hint: ${NS3_HINT})")
+ message(" Compile ns-3 ................: OFF (hint: ${NS3_HINT})")
endif()
if (${Java_FOUND})
- message(" Compile Java ................: yes")
+ message(" Compile Java ................: ON")
message(" Native lib in jar .........: ${enable_lib_in_jar}")
else()
- message(" Compile Java ................: NO")
+ message(" Compile Java ................: OFF")
endif()
if(pybind11_FOUND)
message(" Compile Python bindings .....: ${enable_python}")
message(" module ....................: ${PYTHON_MODULE_PREFIX}simgrid${PYTHON_MODULE_EXTENSION}")
else()
- message(" Compile Python bindings .....: NO (disabled, or pybind11 not found)")
+ message(" Compile Python bindings .....: OFF (disabled, or pybind11 not found)")
endif()
message(" Compile Lua .................: ${SIMGRID_HAVE_LUA}")
message(" Compile Smpi ................: ${HAVE_SMPI}")
SimGrid (3.24.1) NOT RELEASED YET (v3.25 expected December 22. 2029, 04:19 UTC)
Important user-visible changes:
-- Great improvement of the Python binding's stability.
+- Improve the Python usability (stability and documentation).
- A nasty synchronization bug was ironed out, see also below.
-- Reorganization of the C & Python bindings' documentation.
- - Python was organized as a separate tree, C was not part of the doc
+ - Python's doc was organized as a separate tree, now integrated with C++.
+ - C bindings of S4U were not part of the doc.
- The C++ doc was also improved as methods are now split by theme.
+- Further deprecate MSG: you now have to pass -Denable-MSG=ON to cmake.
+ - The plan is to completely remove MSG by the end of 2020.
- SimDAG++: Automatic dependencies on S4U activities (experimental)
- Some features are already implemented but not all of them
- Cannot block an activity until it's scheduled on a resource
include examples/smpi/replay_multiple_manual_deploy/workload_compute_simple
include examples/smpi/replay_multiple_manual_deploy/workload_mixed2_same_time
include examples/smpi/replay_multiple_manual_deploy/workload_mixed2_same_time_and_resources
-include examples/smpi/smpi_msg_masterslave/deployment_masterslave_mailbox_smpi.xml
-include examples/smpi/smpi_msg_masterslave/masterslave_mailbox_smpi.c
-include examples/smpi/smpi_msg_masterslave/msg_smpi.tesh
+include examples/smpi/smpi_s4u_masterslave/deployment_masterslave_mailbox_smpi.xml
+include examples/smpi/smpi_s4u_masterslave/masterslave_mailbox_smpi.c
+include examples/smpi/smpi_s4u_masterslave/msg_smpi.tesh
include examples/smpi/trace/trace.c
include examples/smpi/trace/trace.tesh
include examples/smpi/trace_call_location/adjust
include teshsuite/mc/dwarf-expression/dwarf-expression.tesh
include teshsuite/mc/dwarf/dwarf.cpp
include teshsuite/mc/dwarf/dwarf.tesh
-include teshsuite/mc/mutex-handling/mutex-handling.c
+include teshsuite/mc/mutex-handling/mutex-handling.cpp
include teshsuite/mc/mutex-handling/mutex-handling.tesh
-include teshsuite/mc/mutex-handling/mutex-handling_d.xml
include teshsuite/mc/mutex-handling/without-mutex-handling.tesh
include teshsuite/mc/random-bug/random-bug-nocrash.tesh
include teshsuite/mc/random-bug/random-bug-replay.tesh
include docs/source/tuto_smpi/img/lu.S.4.png
include docs/source/tuto_smpi/roundtrip.c
include examples/README.rst
-include examples/deprecated/java/.classpath
-include examples/deprecated/java/.project
include examples/deprecated/java/CMakeLists.txt
include examples/deprecated/msg/CMakeLists.txt
include examples/deprecated/msg/mc/CMakeLists.txt
include examples/s4u/CMakeLists.txt
include examples/smpi/CMakeLists.txt
include examples/smpi/NAS/CMakeLists.txt
-include examples/smpi/mc/non_deterministic.tesh
-include examples/smpi/mc/only_send_deterministic.tesh
include examples/smpi/replay_multiple/CMakeLists.txt
include examples/smpi/replay_multiple_manual_deploy/CMakeLists.txt
-include examples/smpi/smpi_msg_masterslave/CMakeLists.txt
+include examples/smpi/smpi_s4u_masterslave/CMakeLists.txt
include include/simgrid/Exception.hpp
include include/simgrid/actor.h
include include/simgrid/barrier.h
include setup.py
include src/bindings/java/JavaContext.cpp
include src/bindings/java/JavaContext.hpp
-include src/bindings/java/MANIFEST.in
include src/bindings/java/jmsg.cpp
include src/bindings/java/jmsg.hpp
include src/bindings/java/jmsg_as.cpp
include src/bindings/lua/lua_utils.hpp
include src/bindings/lua/simgrid_lua.cpp
include src/bindings/lua/simgrid_lua.hpp
-include src/bindings/python/simgrid_python.cpp
-include src/include/catch.hpp
-include src/include/mc/datatypes.h
-include src/include/mc/mc.h
-include src/include/simgrid/sg_config.hpp
-include src/include/surf/surf.hpp
-include src/include/xbt/coverage.h
-include src/include/xbt/mmalloc.h
-include src/include/xbt/parmap.hpp
-include src/include/xxhash.hpp
include src/instr/instr_config.cpp
include src/instr/instr_interface.cpp
include src/instr/instr_paje_containers.cpp
include src/mc/mc_hash.hpp
include src/mc/mc_ignore.hpp
include src/mc/mc_memory.cpp
-include src/mc/mc_mmu.hpp
include src/mc/mc_private.hpp
include src/mc/mc_record.cpp
include src/mc/mc_record.hpp
include src/msg/msg_comm.cpp
include src/msg/msg_global.cpp
include src/msg/msg_legacy.cpp
-include src/msg/msg_private.hpp
include src/msg/msg_process.cpp
include src/msg/msg_task.cpp
include src/plugins/dirty_page_tracking.cpp
include src/s4u/s4u_Netzone.cpp
include src/s4u/s4u_Semaphore.cpp
include src/s4u/s4u_Storage.cpp
-include src/simdag/dax.dtd
-include src/simdag/dax_dtd.c
-include src/simdag/dax_dtd.h
include src/simdag/sd_daxloader.cpp
include src/simdag/sd_dotloader.cpp
include src/simdag/sd_global.cpp
include src/simdag/sd_task.cpp
-include src/simdag/simdag_private.hpp
include src/simgrid/Exception.cpp
include src/simgrid/sg_config.cpp
include src/simgrid/sg_version.cpp
include src/simgrid/util.hpp
include src/simix/libsmx.cpp
include src/simix/popping.cpp
-include src/simix/popping_accessors.hpp
-include src/simix/popping_bodies.cpp
-include src/simix/popping_enum.h
include src/simix/popping_generated.cpp
-include src/simix/popping_private.hpp
-include src/simix/simcalls.in
-include src/simix/simcalls.py
include src/simix/smx_context.cpp
include src/simix/smx_deployment.cpp
include src/simix/smx_global.cpp
-include src/simix/smx_private.hpp
include src/smpi/bindings/smpi_f77.cpp
include src/smpi/bindings/smpi_f77_coll.cpp
include src/smpi/bindings/smpi_f77_comm.cpp
include src/smpi/colls/bcast/bcast-scatter-LR-allgather.cpp
include src/smpi/colls/bcast/bcast-scatter-rdb-allgather.cpp
include src/smpi/colls/coll_tuned_topo.cpp
-include src/smpi/colls/coll_tuned_topo.hpp
include src/smpi/colls/colls_global.cpp
-include src/smpi/colls/colls_private.hpp
include src/smpi/colls/gather/gather-mvapich.cpp
include src/smpi/colls/gather/gather-ompi.cpp
include src/smpi/colls/reduce/reduce-NTSL.cpp
include src/smpi/colls/smpi_intel_mpi_selector.cpp
include src/smpi/colls/smpi_mpich_selector.cpp
include src/smpi/colls/smpi_mvapich2_selector.cpp
-include src/smpi/colls/smpi_mvapich2_selector_stampede.hpp
include src/smpi/colls/smpi_nbc_impl.cpp
include src/smpi/colls/smpi_openmpi_selector.cpp
-include src/smpi/include/private.hpp
include src/smpi/include/smpi_actor.hpp
include src/smpi/include/smpi_coll.hpp
include src/smpi/include/smpi_comm.hpp
include src/smpi/include/smpi_request.hpp
include src/smpi/include/smpi_status.hpp
include src/smpi/include/smpi_topo.hpp
-include src/smpi/include/smpi_utils.hpp
include src/smpi/include/smpi_win.hpp
include src/smpi/internals/instr_smpi.cpp
include src/smpi/internals/smpi_actor.cpp
include src/smpi/plugins/load_balancer/LoadBalancer.cpp
include src/smpi/plugins/load_balancer/load_balancer.hpp
include src/smpi/plugins/sampi_loadbalancer.cpp
-include src/smpi/smpi_main.c
-include src/smpi/smpi_replay_main.cpp
include src/smpi/smpicc.in
include src/smpi/smpicxx.in
include src/smpi/smpif90.in
include src/smpi/smpirun.in
include src/smpi/smpitools.sh
include src/surf/HostImpl.cpp
-include src/surf/HostImpl.hpp
include src/surf/StorageImpl.cpp
-include src/surf/StorageImpl.hpp
include src/surf/cpu_cas01.cpp
-include src/surf/cpu_cas01.hpp
include src/surf/cpu_interface.cpp
-include src/surf/cpu_interface.hpp
include src/surf/cpu_ti.cpp
-include src/surf/cpu_ti.hpp
include src/surf/disk_s19.cpp
-include src/surf/disk_s19.hpp
include src/surf/host_clm03.cpp
-include src/surf/host_clm03.hpp
include src/surf/network_cm02.cpp
-include src/surf/network_cm02.hpp
include src/surf/network_constant.cpp
-include src/surf/network_constant.hpp
include src/surf/network_ib.cpp
-include src/surf/network_ib.hpp
include src/surf/network_interface.cpp
-include src/surf/network_interface.hpp
include src/surf/network_ns3.cpp
-include src/surf/network_ns3.hpp
include src/surf/network_smpi.cpp
-include src/surf/network_smpi.hpp
include src/surf/network_wifi.cpp
-include src/surf/network_wifi.hpp
include src/surf/ns3/ns3_simulator.cpp
-include src/surf/ns3/ns3_simulator.hpp
include src/surf/ptask_L07.cpp
-include src/surf/ptask_L07.hpp
include src/surf/sg_platf.cpp
include src/surf/storage_n11.cpp
-include src/surf/storage_n11.hpp
include src/surf/surf_c_bindings.cpp
include src/surf/surf_interface.cpp
-include src/surf/surf_interface.hpp
-include src/surf/surf_private.hpp
include src/surf/xml/platf.hpp
include src/surf/xml/platf_private.hpp
-include src/surf/xml/simgrid.dtd
-include src/surf/xml/simgrid_dtd.c
-include src/surf/xml/simgrid_dtd.h
include src/surf/xml/surfxml_parseplatf.cpp
include src/surf/xml/surfxml_sax_cb.cpp
include src/xbt/OsSemaphore.hpp
include src/xbt/PropertyHolder.cpp
include src/xbt/automaton/automaton.c
-include src/xbt/automaton/automaton_lexer.yy.c
include src/xbt/automaton/automatonparse_promela.c
-include src/xbt/automaton/parserPromela.lex
-include src/xbt/automaton/parserPromela.tab.cacc
-include src/xbt/automaton/parserPromela.tab.hacc
-include src/xbt/automaton/parserPromela.yacc
include src/xbt/backtrace.cpp
include src/xbt/config.cpp
include src/xbt/config_test.cpp
include src/xbt/dict.cpp
include src/xbt/dict_cursor.c
include src/xbt/dict_elm.c
-include src/xbt/dict_private.h
include src/xbt/dict_test.cpp
include src/xbt/dynar.cpp
include src/xbt/dynar_test.cpp
include src/xbt/exception.cpp
include src/xbt/graph.c
include src/xbt/log.cpp
-include src/xbt/log_private.hpp
include src/xbt/mallocator.c
-include src/xbt/mallocator_private.h
include src/xbt/memory_map.cpp
include src/xbt/memory_map.hpp
-include src/xbt/mmalloc/mfree.c
-include src/xbt/mmalloc/mm.c
-include src/xbt/mmalloc/mm_legacy.c
-include src/xbt/mmalloc/mm_module.c
-include src/xbt/mmalloc/mmalloc.c
-include src/xbt/mmalloc/mmalloc.info
-include src/xbt/mmalloc/mmalloc.texi
-include src/xbt/mmalloc/mmorecore.c
-include src/xbt/mmalloc/mmprivate.h
-include src/xbt/mmalloc/mrealloc.c
-include src/xbt/mmalloc/swag.c
-include src/xbt/mmalloc/swag.h
include src/xbt/parmap.cpp
include src/xbt/random.cpp
include src/xbt/random_test.cpp
include src/xbt_modinter.h
include teshsuite/java/CMakeLists.txt
include teshsuite/lua/CMakeLists.txt
-include teshsuite/lua/lua_platforms.tesh
include teshsuite/mc/CMakeLists.txt
include teshsuite/msg/CMakeLists.txt
include teshsuite/python/CMakeLists.txt
include tools/doxygen/list_routing_models_examples.sh
include tools/doxygen/xbt_log_extract_hierarchy.pl
include tools/graphicator/CMakeLists.txt
-include tools/lualib.patch
include tools/smpi/generate_smpi_defines.pl
include tools/stack-cleaner/README
include tools/stack-cleaner/as
include tools/stack-cleaner/compiler-wrapper
include tools/stack-cleaner/fortran
include tools/tesh/CMakeLists.txt
-include tools/tesh/generate_tesh
The Dependstable Snake Release.
- * Great improvement of the Python binding's stability.
- * Reorganization of the C & Python bindings' documentation.
- * SimDAG++: Automatic dependencies on S4U activities (experimental)
+ * Improve the Python usability (stability and documentation).
+ * Further deprecate MSG: you now have to pass -Denable-MSG=ON to cmake.
+ * SimDAG++: Automatic dependencies on S4U activities (experimental).
* (+ many bug fixes and internal refactoring)
_ _____ ____ _ _
__ _____ _ __ ___(_) ___ _ __ |___ / |___ \| || |
synchro-semaphore trace-categories
trace-route-user-variables trace-link-user-variables trace-masterworker
trace-process-migration trace-host-user-variables)
- add_executable (${x} EXCLUDE_FROM_ALL ${x}/${x}.c)
- target_link_libraries(${x} simgrid)
- set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
- add_dependencies(tests ${x})
+ if(enable_MSG)
+ add_executable (${x} EXCLUDE_FROM_ALL ${x}/${x}.c)
+ target_link_libraries(${x} simgrid)
+ set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
+ add_dependencies(tests ${x})
+ endif()
set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c)
set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
endforeach()
-if(SIMGRID_HAVE_NS3)
+if(SIMGRID_HAVE_NS3 AND enable_MSG)
add_executable (network-ns3 EXCLUDE_FROM_ALL network-ns3/network-ns3.c)
target_link_libraries(network-ns3 simgrid)
set_target_properties(network-ns3 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/network-ns3)
add_dependencies(tests network-ns3)
endif()
-add_executable (dht-kademlia EXCLUDE_FROM_ALL dht-kademlia/dht-kademlia.c dht-kademlia/node.c dht-kademlia/routing_table.c dht-kademlia/task.c dht-kademlia/answer.c)
-target_link_libraries(dht-kademlia simgrid)
-set_target_properties(dht-kademlia PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dht-kademlia)
-add_dependencies(tests dht-kademlia)
+if(enable_MSG)
+ add_executable (dht-kademlia EXCLUDE_FROM_ALL dht-kademlia/dht-kademlia.c dht-kademlia/node.c dht-kademlia/routing_table.c dht-kademlia/task.c dht-kademlia/answer.c)
+ target_link_libraries(dht-kademlia simgrid)
+ set_target_properties(dht-kademlia PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dht-kademlia)
+ add_dependencies(tests dht-kademlia)
+endif()
foreach (file answer dht-kademlia node routing_table task)
set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/${file}.c ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/${file}.h)
endforeach()
${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/onelink_d.xml
${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/one_cluster_d.xml PARENT_SCOPE)
-foreach(x app-masterworker cloud-masterworker
- dht-pastry dht-kademlia platform-failures
- energy-vm
- process-create
- synchro-semaphore)
- ADD_TESH_FACTORIES(msg-${x} "thread;ucontext;raw;boost"
- --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/${x}
- --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/${x}
- --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
- ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/${x}/${x}.tesh)
-endforeach()
+if(enable_MSG)
+ foreach(x app-masterworker cloud-masterworker
+ dht-pastry dht-kademlia platform-failures
+ energy-vm
+ process-create
+ synchro-semaphore)
+ ADD_TESH_FACTORIES(msg-${x} "thread;ucontext;raw;boost"
+ --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/${x}
+ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/${x}
+ --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
+ ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/${x}/${x}.tesh)
+ endforeach()
-foreach (x trace-categories trace-route-user-variables trace-link-user-variables trace-masterworker trace-process-migration trace-host-user-variables)
- ADD_TESH(msg-${x} --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/${x}
- --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/${x}
- --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
- --cd ${CMAKE_BINARY_DIR}/examples/deprecated/msg/${x}
- ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/${x}/${x}.tesh)
-endforeach()
+ foreach (x trace-categories trace-route-user-variables trace-link-user-variables trace-masterworker trace-process-migration trace-host-user-variables)
+ ADD_TESH(msg-${x} --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/${x}
+ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/${x}
+ --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
+ --cd ${CMAKE_BINARY_DIR}/examples/deprecated/msg/${x}
+ ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/${x}/${x}.tesh)
+ endforeach()
-if(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "i386" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
- # Thread-local storage (TLS) is needed for parallel execution, but it doesn't
- # play well with Ucontexts on 64bit SunOS (at least on x86_64).
- set(parallel-factories "thread;raw;boost")
-else()
- set(parallel-factories "thread;ucontext;raw;boost")
-endif()
-ADD_TESH_FACTORIES(msg-dht-kademlia-parallel "${parallel-factories}" --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO}
- --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/dht-kademlia
- --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/dht-kademlia
- --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
- ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/dht-kademlia/dht-kademlia.tesh)
+ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "i386" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
+ # Thread-local storage (TLS) is needed for parallel execution, but it doesn't
+ # play well with Ucontexts on 64bit SunOS (at least on x86_64).
+ set(parallel-factories "thread;raw;boost")
+ else()
+ set(parallel-factories "thread;ucontext;raw;boost")
+ endif()
+ ADD_TESH_FACTORIES(msg-dht-kademlia-parallel "${parallel-factories}" --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO}
+ --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/dht-kademlia
+ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/dht-kademlia
+ --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
+ ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/dht-kademlia/dht-kademlia.tesh)
-ADD_TESH_FACTORIES(app-masterworker-multicore "thread;ucontext;raw;boost"
- --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/app-masterworker
- --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/app-masterworker
- --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
- ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/app-masterworker/app-masterworker-multicore.tesh)
-ADD_TESH_FACTORIES(app-masterworker-vivaldi "thread;ucontext;raw;boost"
- --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/app-masterworker
- --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/app-masterworker
- --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
- ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/app-masterworker/app-masterworker-vivaldi.tesh)
+ ADD_TESH_FACTORIES(app-masterworker-multicore "thread;ucontext;raw;boost"
+ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/app-masterworker
+ --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/app-masterworker
+ --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
+ ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/app-masterworker/app-masterworker-multicore.tesh)
+ ADD_TESH_FACTORIES(app-masterworker-vivaldi "thread;ucontext;raw;boost"
+ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/app-masterworker
+ --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg/app-masterworker
+ --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
+ ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/app-masterworker/app-masterworker-vivaldi.tesh)
-if(SIMGRID_HAVE_NS3)
- ADD_TESH_FACTORIES(msg-network-ns3 "thread;ucontext;raw;boost"
- --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg
- --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg
- --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
- ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/network-ns3/network-ns3.tesh)
-endif()
+ if(SIMGRID_HAVE_NS3)
+ ADD_TESH_FACTORIES(msg-network-ns3 "thread;ucontext;raw;boost"
+ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg
+ --setenv bindir=${CMAKE_BINARY_DIR}/examples/deprecated/msg
+ --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
+ ${CMAKE_HOME_DIRECTORY}/examples/deprecated/msg/network-ns3/network-ns3.tesh)
+ endif()
+endif(enable_MSG)
\ No newline at end of file
foreach (x bugged1 bugged2 bugged3 centralized_mutex electric_fence bugged1_liveness bugged2_liveness)
- if(SIMGRID_HAVE_MC)
+ if(SIMGRID_HAVE_MC AND SIMGRID_HAVE_MSG)
add_executable (${x} EXCLUDE_FROM_ALL ${x}.c)
target_link_libraries(${x} simgrid)
add_dependencies(tests ${x})
set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/deploy_${x}.xml)
endforeach()
-if(SIMGRID_HAVE_MC)
+if(SIMGRID_HAVE_MC AND SIMGRID_HAVE_MSG)
if(HAVE_C_STACK_CLEANER)
add_executable (bugged1_liveness_cleaner_on EXCLUDE_FROM_ALL bugged1_liveness.c)
target_link_libraries(bugged1_liveness_cleaner_on simgrid)
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "simgrid/msg.h"
#include "mpi.h"
+#include "simgrid/engine.h"
+#include "xbt/str.h"
#include <stdio.h>
#include <string.h>
}
int main(int argc, char *argv[]){
- msg_error_t res;
-
- MSG_init(&argc, argv);
+ simgrid_init(&argc, argv);
SMPI_init();
xbt_assert(argc > 3, "Usage: %s description_file platform_file deployment_file\n"
"\tExample: %s smpi_multiple_apps msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
/* Simulation setting */
- MSG_create_environment(argv[2]);
+ simgrid_load_platform(argv[2]);
/* Application deployment: read the description file in order to identify instances to launch */
FILE* fp = fopen(argv[1], "r");
fclose(fp);
- MSG_launch_application(argv[3]);
-
- res = MSG_main();
+ simgrid_load_deployment(argv[3]);
+ simgrid_run();
- XBT_INFO("Simulation time %g", MSG_get_clock());
+ XBT_INFO("Simulation time %g", simgrid_get_clock());
SMPI_finalize();
- return res != MSG_OK;
+ return 0;
}
+++ /dev/null
-/* Copyright (c) 2010-2020. The SimGrid Team. All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "simgrid/msg.h"
-#include "mpi.h"
-
-#include <stdio.h> /* snprintf */
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
-
-static int master(int argc, char *argv[])
-{
- xbt_assert(argc == 5);
- long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
- double task_comp_size = xbt_str_parse_double(argv[2], "Invalid computational size: %s");
- double task_comm_size = xbt_str_parse_double(argv[3], "Invalid communication size: %s");
- long slaves_count = xbt_str_parse_int(argv[4], "Invalid amount of slaves: %s");
-
- XBT_INFO("Got %ld slaves and %ld tasks to process", slaves_count, number_of_tasks);
-
- for (int i = 0; i < number_of_tasks; i++) {
- char mailbox[256];
- char sprintf_buffer[256];
-
- snprintf(mailbox,256, "slave-%ld", i % slaves_count);
- snprintf(sprintf_buffer,256, "Task_%d", i);
- msg_task_t task = MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size, NULL);
- if (number_of_tasks < 10000 || i % 10000 == 0)
- XBT_INFO("Sending \"%s\" (of %ld) to mailbox \"%s\"", MSG_task_get_name(task), number_of_tasks, mailbox);
-
- MSG_task_send(task, mailbox);
- }
-
- XBT_INFO("All tasks have been dispatched. Let's tell everybody the computation is over.");
- for (int i = 0; i < slaves_count; i++) {
- char mailbox[80];
-
- snprintf(mailbox,80, "slave-%ld", i % slaves_count);
- msg_task_t finalize = MSG_task_create("finalize", 0, 0, 0);
- MSG_task_send(finalize, mailbox);
- }
-
- return 0;
-}
-
-static int master_mpi(int argc, char *argv[])
-{
- MPI_Init(&argc, &argv);
-
- int rank;
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- XBT_INFO("here for rank %d", rank);
- int test[1000]={rank};
- if(rank==0)
- MPI_Send(&test, 1000, MPI_INT, 1, 1, MPI_COMM_WORLD);
- else
- MPI_Recv(&test, 1000, MPI_INT, 0, 1, MPI_COMM_WORLD, MPI_STATUSES_IGNORE);
-
- XBT_INFO("After comm %d", rank);
- MPI_Finalize();
-
- XBT_INFO("After finalize %d %d", rank, test[0]);
- return 0;
-}
-
-static int alltoall_mpi(int argc, char *argv[])
-{
- MPI_Init(&argc, &argv);
-
- int rank;
- int size;
- MPI_Comm_rank(MPI_COMM_WORLD, &rank);
- MPI_Comm_size(MPI_COMM_WORLD, &size);
- XBT_INFO("alltoall for rank %d", rank);
- int* out=malloc(1000*size*sizeof(int));
- int* in=malloc(1000*size*sizeof(int));
- MPI_Alltoall(out, 1000, MPI_INT,in, 1000, MPI_INT, MPI_COMM_WORLD);
-
- XBT_INFO("after alltoall %d", rank);
- free(out);
- free(in);
- MPI_Finalize();
- return 0;
-}
-
-static int slave(int argc, char *argv[])
-{
- xbt_assert(argc == 2);
- msg_task_t task = NULL;
- XBT_ATTRIB_UNUSED int res;
- int id = -1;
- char mailbox[80];
- XBT_ATTRIB_UNUSED int read;
-
- read = sscanf(argv[1], "%d", &id);
- xbt_assert(read, "Invalid argument %s\n", argv[1]);
-
- snprintf(mailbox,80, "slave-%d", id);
-
- while (1) {
- res = MSG_task_receive(&(task), mailbox);
- xbt_assert(res == MSG_OK, "MSG_task_get failed");
-
- if (strcmp(MSG_task_get_name(task), "finalize")==0) {
- MSG_task_destroy(task);
- break;
- }
- MSG_task_execute(task);
- MSG_task_destroy(task);
- task = NULL;
- }
- XBT_INFO("I'm done. See you!");
-
- return 0;
-}
-
-int main(int argc, char *argv[])
-{
- msg_error_t res;
-
- MSG_init(&argc, argv);
- SMPI_init();
-
- xbt_assert(argc > 2,"Usage: %s platform_file deployment_file\n"
- "\nexample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
-
- MSG_create_environment(argv[1]);
-
- MSG_function_register("master", master);
- MSG_function_register("slave", slave);
- // launch two MPI applications as well, one using master_mpi function as main on 2 nodes
- SMPI_app_instance_register("master_mpi", master_mpi,2);
- // the second performing an alltoall on 4 nodes
- SMPI_app_instance_register("alltoall_mpi", alltoall_mpi,4);
- MSG_launch_application(argv[2]);
-
- res = MSG_main();
-
- XBT_INFO("Simulation time %g", MSG_get_clock());
-
- SMPI_finalize();
- return res != MSG_OK;
-}
+++ /dev/null
-p Test the use of SMPI+MSG in the same file, as well as several different SMPI instances at the same time
-$ ./masterslave_mailbox_smpi ${srcdir:=.}/../../platforms/small_platform_with_routers.xml ${srcdir:=.}/deployment_masterslave_mailbox_smpi.xml --log=smpi.:info --cfg=smpi/simulate-computation:no
-> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/simulate-computation' to 'no'
-> [0.000000] [smpi_config/INFO] You did not set the power of the host running the simulation. The timings will certainly not be accurate. Use the option "--cfg=smpi/host-speed:<flops>" to set its value. Check https://simgrid.org/doc/latest/Configuring_SimGrid.html#automatic-benchmarking-of-smpi-code for more information.
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Got 1 slaves and 20 tasks to process
-> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Sending "Task_0" (of 20) to mailbox "slave-0"
-> [Ginette:master_mpi:(3) 0.000000] [msg_test/INFO] here for rank 0
-> [Bourassa:master_mpi:(4) 0.000000] [msg_test/INFO] here for rank 1
-> [Ginette:alltoall_mpi:(5) 0.000000] [msg_test/INFO] alltoall for rank 0
-> [Bourassa:alltoall_mpi:(6) 0.000000] [msg_test/INFO] alltoall for rank 1
-> [Jupiter:alltoall_mpi:(7) 0.000000] [msg_test/INFO] alltoall for rank 2
-> [Fafard:alltoall_mpi:(8) 0.000000] [msg_test/INFO] alltoall for rank 3
-> [Ginette:master_mpi:(3) 0.000000] [msg_test/INFO] After comm 0
-> [Ginette:master_mpi:(3) 0.000000] [msg_test/INFO] After finalize 0 0
-> [Tremblay:master:(1) 0.002265] [msg_test/INFO] Sending "Task_1" (of 20) to mailbox "slave-0"
-> [Bourassa:master_mpi:(4) 0.016868] [msg_test/INFO] After comm 1
-> [Bourassa:master_mpi:(4) 0.016868] [msg_test/INFO] After finalize 1 0
-> [Ginette:alltoall_mpi:(5) 0.098642] [msg_test/INFO] after alltoall 0
-> [Fafard:alltoall_mpi:(8) 0.099069] [msg_test/INFO] after alltoall 3
-> [Bourassa:alltoall_mpi:(6) 0.127526] [msg_test/INFO] after alltoall 1
-> [Jupiter:alltoall_mpi:(7) 0.127802] [msg_test/INFO] after alltoall 2
-> [Tremblay:master:(1) 0.514241] [msg_test/INFO] Sending "Task_2" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 1.026216] [msg_test/INFO] Sending "Task_3" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 1.538191] [msg_test/INFO] Sending "Task_4" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 2.050166] [msg_test/INFO] Sending "Task_5" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 2.562142] [msg_test/INFO] Sending "Task_6" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 3.074117] [msg_test/INFO] Sending "Task_7" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 3.586092] [msg_test/INFO] Sending "Task_8" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 4.098067] [msg_test/INFO] Sending "Task_9" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 4.610043] [msg_test/INFO] Sending "Task_10" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 5.122018] [msg_test/INFO] Sending "Task_11" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 5.633993] [msg_test/INFO] Sending "Task_12" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 6.145968] [msg_test/INFO] Sending "Task_13" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 6.657944] [msg_test/INFO] Sending "Task_14" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 7.169919] [msg_test/INFO] Sending "Task_15" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 7.681894] [msg_test/INFO] Sending "Task_16" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 8.193869] [msg_test/INFO] Sending "Task_17" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 8.705845] [msg_test/INFO] Sending "Task_18" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 9.217820] [msg_test/INFO] Sending "Task_19" (of 20) to mailbox "slave-0"
-> [Tremblay:master:(1) 9.729795] [msg_test/INFO] All tasks have been dispatched. Let's tell everybody the computation is over.
-> [Tremblay:slave:(2) 10.239700] [msg_test/INFO] I'm done. See you!
-> [10.239700] [msg_test/INFO] Simulation time 10.2397
-
if(enable_smpi)
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
- add_executable (masterslave_mailbox_smpi EXCLUDE_FROM_ALL masterslave_mailbox_smpi.c)
+ add_executable (masterslave_mailbox_smpi EXCLUDE_FROM_ALL masterslave_mailbox_smpi.cpp)
target_link_libraries(masterslave_mailbox_smpi simgrid)
- ADD_TESH_FACTORIES(smpi-msg-masterslave "thread;ucontext;raw;boost" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/smpi_msg_masterslave --cd ${CMAKE_BINARY_DIR}/examples/smpi/smpi_msg_masterslave ${CMAKE_HOME_DIRECTORY}/examples/smpi/smpi_msg_masterslave/msg_smpi.tesh)
+ ADD_TESH_FACTORIES(smpi-s4u-masterslave "thread;ucontext;raw;boost" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/smpi/smpi_s4u_masterslave --cd ${CMAKE_BINARY_DIR}/examples/smpi/smpi_s4u_masterslave ${CMAKE_HOME_DIRECTORY}/examples/smpi/smpi_s4u_masterslave/s4u_smpi.tesh)
add_dependencies(tests masterslave_mailbox_smpi)
endif()
-set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/msg_smpi.tesh PARENT_SCOPE)
+set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/s4u_smpi.tesh PARENT_SCOPE)
set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/deployment_masterslave_mailbox_smpi.xml PARENT_SCOPE)
-set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/masterslave_mailbox_smpi.c PARENT_SCOPE)
+set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/masterslave_mailbox_smpi.cpp PARENT_SCOPE)
<argument value="20"/> <!-- Number of tasks -->
<argument value="50000000"/> <!-- Computation size of tasks -->
<argument value="1000000"/> <!-- Communication size of tasks -->
- <argument value="1"/> <!-- Number of slaves -->
- </actor>
- <!-- The slave processes (with mailbox to listen on as argument) -->
- <actor host="Tremblay" function="slave">
- <argument value="0"/>
+ <argument value="Ginette"/> <!-- Hostname of the first worker -->
+ <argument value="Jupiter"/> <!-- Hostname of the second worker -->
</actor>
+ <!-- The worker processes (with mailbox to listen on as argument) -->
+ <actor host="Ginette" function="worker"/>
+ <actor host="Jupiter" function="worker"/>
+
<actor host="Ginette" function="master_mpi">
<prop id="instance_id" value="master_mpi"/>
<prop id="rank" value="0"/>
--- /dev/null
+/* Copyright (c) 2010-2020. The SimGrid Team. All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "mpi.h"
+#include "simgrid/s4u.hpp"
+
+#include <stdio.h> /* snprintf */
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
+
+static void master(std::vector<std::string> args)
+{
+ xbt_assert(args.size() > 4, "The master function expects at least 3 arguments");
+
+ long tasks_count = std::stol(args[1]);
+ double compute_cost = std::stod(args[2]);
+ double communication_cost = std::stod(args[3]);
+ std::vector<simgrid::s4u::Mailbox*> workers;
+ for (unsigned int i = 4; i < args.size(); i++)
+ workers.push_back(simgrid::s4u::Mailbox::by_name(args[i]));
+
+ XBT_INFO("Got %zu workers and %ld tasks to process", workers.size(), tasks_count);
+
+ for (int i = 0; i < tasks_count; i++) { /* For each task to be executed: */
+ /* - Select a worker in a round-robin way */
+ simgrid::s4u::Mailbox* mailbox = workers[i % workers.size()];
+
+ /* - Send the computation cost to that worker */
+ XBT_INFO("Sending task %d of %ld to mailbox '%s'", i, tasks_count, mailbox->get_cname());
+ mailbox->put(new double(compute_cost), communication_cost);
+ }
+
+ XBT_INFO("All tasks have been dispatched. Request all workers to stop.");
+ for (unsigned int i = 0; i < workers.size(); i++) {
+ /* The workers stop when receiving a negative compute_cost */
+ simgrid::s4u::Mailbox* mailbox = workers[i % workers.size()];
+
+ mailbox->put(new double(-1.0), 0);
+ }
+}
+
+static void worker(std::vector<std::string> args)
+{
+ xbt_assert(args.size() == 1, "The worker expects no argument");
+
+ const simgrid::s4u::Host* my_host = simgrid::s4u::this_actor::get_host();
+ simgrid::s4u::Mailbox* mailbox = simgrid::s4u::Mailbox::by_name(my_host->get_name());
+
+ double compute_cost;
+ do {
+ const double* msg = static_cast<double*>(mailbox->get());
+ compute_cost = *msg;
+ delete msg;
+
+ if (compute_cost > 0) /* If compute_cost is valid, execute a computation of that cost */
+ simgrid::s4u::this_actor::execute(compute_cost);
+
+ } while (compute_cost > 0); /* Stop when receiving an invalid compute_cost */
+
+ XBT_INFO("Exiting now.");
+}
+
+static int master_mpi(int argc, char* argv[])
+{
+ MPI_Init(&argc, &argv);
+
+ int rank;
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ XBT_INFO("here for rank %d", rank);
+ int test[1000] = {rank};
+ if (rank == 0)
+ MPI_Send(&test, 1000, MPI_INT, 1, 1, MPI_COMM_WORLD);
+ else
+ MPI_Recv(&test, 1000, MPI_INT, 0, 1, MPI_COMM_WORLD, MPI_STATUSES_IGNORE);
+
+ XBT_INFO("After comm %d", rank);
+ MPI_Finalize();
+
+ XBT_INFO("After finalize %d %d", rank, test[0]);
+ return 0;
+}
+
+static int alltoall_mpi(int argc, char* argv[])
+{
+ MPI_Init(&argc, &argv);
+
+ int rank;
+ int size;
+ MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &size);
+ XBT_INFO("alltoall for rank %d", rank);
+ int* out = new int[1000 * size];
+ int* in = new int[1000 * size];
+ MPI_Alltoall(out, 1000, MPI_INT, in, 1000, MPI_INT, MPI_COMM_WORLD);
+
+ XBT_INFO("after alltoall %d", rank);
+ delete[] out;
+ delete[] in;
+ MPI_Finalize();
+ return 0;
+}
+
+int main(int argc, char* argv[])
+{
+ simgrid::s4u::Engine e(&argc, argv);
+
+ SMPI_init();
+
+ xbt_assert(argc > 2,
+ "Usage: %s platform_file deployment_file\n"
+ "\nexample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
+
+ e.load_platform(argv[1]);
+
+ e.register_function("master", master);
+ e.register_function("worker", worker);
+ // launch two MPI applications as well, one using master_mpi function as main on 2 nodes
+ SMPI_app_instance_register("master_mpi", master_mpi, 2);
+ // the second performing an alltoall on 4 nodes
+ SMPI_app_instance_register("alltoall_mpi", alltoall_mpi, 4);
+ e.load_deployment(argv[2]);
+
+ e.run();
+
+ XBT_INFO("Simulation time %g", e.get_clock());
+
+ SMPI_finalize();
+ return 0;
+}
--- /dev/null
+p Test the use of SMPI+MSG in the same file, as well as several different SMPI instances at the same time
+$ ./masterslave_mailbox_smpi ${srcdir:=.}/../../platforms/small_platform_with_routers.xml ${srcdir:=.}/deployment_masterslave_mailbox_smpi.xml --log=smpi.:info --cfg=smpi/simulate-computation:no
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/simulate-computation' to 'no'
+> [0.000000] [smpi_config/INFO] You did not set the power of the host running the simulation. The timings will certainly not be accurate. Use the option "--cfg=smpi/host-speed:<flops>" to set its value. Check https://simgrid.org/doc/latest/Configuring_SimGrid.html#automatic-benchmarking-of-smpi-code for more information.
+> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Got 2 workers and 20 tasks to process
+> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Sending task 0 of 20 to mailbox 'Ginette'
+> [Ginette:master_mpi:(4) 0.000000] [msg_test/INFO] here for rank 0
+> [Bourassa:master_mpi:(5) 0.000000] [msg_test/INFO] here for rank 1
+> [Ginette:alltoall_mpi:(6) 0.000000] [msg_test/INFO] alltoall for rank 0
+> [Bourassa:alltoall_mpi:(7) 0.000000] [msg_test/INFO] alltoall for rank 1
+> [Jupiter:alltoall_mpi:(8) 0.000000] [msg_test/INFO] alltoall for rank 2
+> [Fafard:alltoall_mpi:(9) 0.000000] [msg_test/INFO] alltoall for rank 3
+> [Ginette:master_mpi:(4) 0.000000] [msg_test/INFO] After comm 0
+> [Ginette:master_mpi:(4) 0.000000] [msg_test/INFO] After finalize 0 0
+> [Bourassa:master_mpi:(5) 0.016868] [msg_test/INFO] After comm 1
+> [Bourassa:master_mpi:(5) 0.016868] [msg_test/INFO] After finalize 1 0
+> [Ginette:alltoall_mpi:(6) 0.100219] [msg_test/INFO] after alltoall 0
+> [Fafard:alltoall_mpi:(9) 0.100625] [msg_test/INFO] after alltoall 3
+> [Tremblay:master:(1) 0.125464] [msg_test/INFO] Sending task 1 of 20 to mailbox 'Jupiter'
+> [Bourassa:alltoall_mpi:(7) 0.129082] [msg_test/INFO] after alltoall 1
+> [Jupiter:alltoall_mpi:(8) 0.129358] [msg_test/INFO] after alltoall 2
+> [Tremblay:master:(1) 0.294619] [msg_test/INFO] Sending task 2 of 20 to mailbox 'Ginette'
+> [Tremblay:master:(1) 1.280294] [msg_test/INFO] Sending task 3 of 20 to mailbox 'Jupiter'
+> [Tremblay:master:(1) 1.449449] [msg_test/INFO] Sending task 4 of 20 to mailbox 'Ginette'
+> [Tremblay:master:(1) 2.435124] [msg_test/INFO] Sending task 5 of 20 to mailbox 'Jupiter'
+> [Tremblay:master:(1) 2.604279] [msg_test/INFO] Sending task 6 of 20 to mailbox 'Ginette'
+> [Tremblay:master:(1) 3.589954] [msg_test/INFO] Sending task 7 of 20 to mailbox 'Jupiter'
+> [Tremblay:master:(1) 3.759109] [msg_test/INFO] Sending task 8 of 20 to mailbox 'Ginette'
+> [Tremblay:master:(1) 4.744784] [msg_test/INFO] Sending task 9 of 20 to mailbox 'Jupiter'
+> [Tremblay:master:(1) 4.913938] [msg_test/INFO] Sending task 10 of 20 to mailbox 'Ginette'
+> [Tremblay:master:(1) 5.899614] [msg_test/INFO] Sending task 11 of 20 to mailbox 'Jupiter'
+> [Tremblay:master:(1) 6.068768] [msg_test/INFO] Sending task 12 of 20 to mailbox 'Ginette'
+> [Tremblay:master:(1) 7.054444] [msg_test/INFO] Sending task 13 of 20 to mailbox 'Jupiter'
+> [Tremblay:master:(1) 7.223598] [msg_test/INFO] Sending task 14 of 20 to mailbox 'Ginette'
+> [Tremblay:master:(1) 8.209273] [msg_test/INFO] Sending task 15 of 20 to mailbox 'Jupiter'
+> [Tremblay:master:(1) 8.378428] [msg_test/INFO] Sending task 16 of 20 to mailbox 'Ginette'
+> [Tremblay:master:(1) 9.364103] [msg_test/INFO] Sending task 17 of 20 to mailbox 'Jupiter'
+> [Tremblay:master:(1) 9.533258] [msg_test/INFO] Sending task 18 of 20 to mailbox 'Ginette'
+> [Tremblay:master:(1) 10.518933] [msg_test/INFO] Sending task 19 of 20 to mailbox 'Jupiter'
+> [Tremblay:master:(1) 10.688088] [msg_test/INFO] All tasks have been dispatched. Request all workers to stop.
+> [Ginette:worker:(2) 11.566584] [msg_test/INFO] Exiting now.
+> [Jupiter:worker:(3) 11.585598] [msg_test/INFO] Exiting now.
+> [11.585598] [msg_test/INFO] Simulation time 11.5856
#define SIMGRID_PUBLIC_CONFIG_H
#include <xbt/base.h>
+/* Was MSG compiled in? */
+#cmakedefine01 SIMGRID_HAVE_MSG
/* Was Jedule compiled in? */
#cmakedefine01 SIMGRID_HAVE_JEDULE
/* Was the Lua support compiled in? */
simgrid::xbt::string_printf("mark_type with name (%s) is not declared", mark_type));
} else {
XBT_DEBUG("MARK %s %s", mark_type, mark_value);
- new simgrid::instr::NewEvent(MSG_get_clock(), simgrid::instr::Container::get_root(), type,
+ new simgrid::instr::NewEvent(simgrid_get_clock(), simgrid::instr::Container::get_root(), type,
type->get_entity_value(mark_value));
}
}
*/
void TRACE_vm_variable_set (const char *vm, const char *variable, double value)
{
- TRACE_vm_variable_set_with_time (MSG_get_clock(), vm, variable, value);
+ TRACE_vm_variable_set_with_time(simgrid_get_clock(), vm, variable, value);
}
/** @ingroup TRACE_user_variables
*/
void TRACE_vm_variable_add (const char *vm, const char *variable, double value)
{
- TRACE_vm_variable_add_with_time (MSG_get_clock(), vm, variable, value);
+ TRACE_vm_variable_add_with_time(simgrid_get_clock(), vm, variable, value);
}
/** @ingroup TRACE_user_variables
*/
void TRACE_vm_variable_sub (const char *vm, const char *variable, double value)
{
- TRACE_vm_variable_sub_with_time (MSG_get_clock(), vm, variable, value);
+ TRACE_vm_variable_sub_with_time(simgrid_get_clock(), vm, variable, value);
}
/** @ingroup TRACE_user_variables
*/
void TRACE_host_variable_set (const char *host, const char *variable, double value)
{
- TRACE_host_variable_set_with_time (MSG_get_clock(), host, variable, value);
+ TRACE_host_variable_set_with_time(simgrid_get_clock(), host, variable, value);
}
/** @ingroup TRACE_user_variables
*/
void TRACE_host_variable_add (const char *host, const char *variable, double value)
{
- TRACE_host_variable_add_with_time (MSG_get_clock(), host, variable, value);
+ TRACE_host_variable_add_with_time(simgrid_get_clock(), host, variable, value);
}
/** @ingroup TRACE_user_variables
*/
void TRACE_host_variable_sub (const char *host, const char *variable, double value)
{
- TRACE_host_variable_sub_with_time (MSG_get_clock(), host, variable, value);
+ TRACE_host_variable_sub_with_time(simgrid_get_clock(), host, variable, value);
}
/** @ingroup TRACE_user_variables
*/
void TRACE_link_variable_set (const char *link, const char *variable, double value)
{
- TRACE_link_variable_set_with_time (MSG_get_clock(), link, variable, value);
+ TRACE_link_variable_set_with_time(simgrid_get_clock(), link, variable, value);
}
/** @ingroup TRACE_user_variables
*/
void TRACE_link_variable_add (const char *link, const char *variable, double value)
{
- TRACE_link_variable_add_with_time (MSG_get_clock(), link, variable, value);
+ TRACE_link_variable_add_with_time(simgrid_get_clock(), link, variable, value);
}
/** @ingroup TRACE_user_variables
*/
void TRACE_link_variable_sub (const char *link, const char *variable, double value)
{
- TRACE_link_variable_sub_with_time (MSG_get_clock(), link, variable, value);
+ TRACE_link_variable_sub_with_time(simgrid_get_clock(), link, variable, value);
}
/** @ingroup TRACE_user_variables
*/
void TRACE_link_srcdst_variable_set (const char *src, const char *dst, const char *variable, double value)
{
- TRACE_link_srcdst_variable_set_with_time (MSG_get_clock(), src, dst, variable, value);
+ TRACE_link_srcdst_variable_set_with_time(simgrid_get_clock(), src, dst, variable, value);
}
/** @ingroup TRACE_user_variables
*/
void TRACE_link_srcdst_variable_add (const char *src, const char *dst, const char *variable, double value)
{
- TRACE_link_srcdst_variable_add_with_time (MSG_get_clock(), src, dst, variable, value);
+ TRACE_link_srcdst_variable_add_with_time(simgrid_get_clock(), src, dst, variable, value);
}
/** @ingroup TRACE_user_variables
*/
void TRACE_link_srcdst_variable_sub (const char *src, const char *dst, const char *variable, double value)
{
- TRACE_link_srcdst_variable_sub_with_time (MSG_get_clock(), src, dst, variable, value);
+ TRACE_link_srcdst_variable_sub_with_time(simgrid_get_clock(), src, dst, variable, value);
}
/** @ingroup TRACE_user_variables
static std::vector<simgrid::instr::NetZoneContainer*> currentContainer; /* push and pop, used only in creation */
+std::string instr_pid(simgrid::s4u::Actor const& proc)
+{
+ return std::string(proc.get_name()) + "-" + std::to_string(proc.get_pid());
+}
+
static const char* instr_node_name(const s_xbt_node_t* node)
{
return static_cast<char*>(xbt_graph_node_get_data(node));
#include "msg_private.hpp"
#include "simgrid/Exception.hpp"
#include "simgrid/s4u/Host.hpp"
-#include "src/instr/instr_private.hpp"
#include "src/simix/smx_private.hpp"
-std::string instr_pid(simgrid::s4u::Actor const& proc)
-{
- return std::string(proc.get_name()) + "-" + std::to_string(proc.get_pid());
-}
-
/******************************** Process ************************************/
/** @brief Creates and runs a new #msg_process_t.
*
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "simgrid/engine.h" /* simgrid_get_clock */
#include "simgrid/host.h"
-#include "simgrid/msg.h" /* MSG_get_clock */
#include "src/xbt/log_private.hpp"
#include "xbt/sysdep.h"
#include <algorithm>
show_string(ev->functionName);
break;
case 'd': /* date; LOG4J compliant */
- show_double(MSG_get_clock());
+ show_double(simgrid_get_clock());
break;
case 'r': /* application age; LOG4J compliant */
- show_double(MSG_get_clock());
+ show_double(simgrid_get_clock());
break;
case 'm': { /* user-provided message; LOG4J compliant */
int sz;
#include "xbt/sysdep.h"
#include "src/xbt/log_private.hpp"
-#include "simgrid/host.h" /* sg_host_self_get_name */
-#include "simgrid/msg.h" /* MSG_get_clock */
+#include "simgrid/engine.h" /* simgrid_get_clock */
+#include "simgrid/host.h" /* sg_host_self_get_name */
#include <cstdio>
extern const char *xbt_log_priority_names[8];
}
/* Display the date */
- len = snprintf(p, rem_size, "%f] ", MSG_get_clock());
+ len = snprintf(p, rem_size, "%f] ", simgrid_get_clock());
check_overflow(len);
/* Display file position if not INFO */
endforeach()
# MC-independent C++ binaries
-foreach(x random-bug)
+foreach(x random-bug mutex-handling)
add_executable (${x} EXCLUDE_FROM_ALL ${x}/${x}.cpp)
target_link_libraries(${x} simgrid)
set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.cpp)
endforeach()
-add_executable (without-mutex-handling EXCLUDE_FROM_ALL mutex-handling/mutex-handling.c)
+add_executable (without-mutex-handling EXCLUDE_FROM_ALL mutex-handling/mutex-handling.cpp)
target_link_libraries(without-mutex-handling simgrid)
set_target_properties(without-mutex-handling PROPERTIES COMPILE_FLAGS -DDISABLE_THE_MUTEX=1)
set_target_properties(without-mutex-handling PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mutex-handling)
add_dependencies(tests without-mutex-handling)
-foreach(x mutex-handling)
- add_executable (${x} EXCLUDE_FROM_ALL ${x}/${x}.c)
- target_link_libraries(${x} simgrid)
- set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
- add_dependencies(tests ${x})
-
- set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
- set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c)
-endforeach()
-
set(teshsuite_src ${teshsuite_src} PARENT_SCOPE)
set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/random-bug/random-bug-nocrash.tesh
${CMAKE_CURRENT_SOURCE_DIR}/random-bug/random-bug-replay.tesh
${CMAKE_CURRENT_SOURCE_DIR}/mutex-handling/without-mutex-handling.tesh PARENT_SCOPE)
-set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/mutex-handling/mutex-handling_d.xml PARENT_SCOPE)
IF(SIMGRID_HAVE_MC)
ADD_TESH(tesh-mc-dwarf --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/dwarf --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/dwarf dwarf.tesh)
+++ /dev/null
-/* Copyright (c) 2015-2020. The SimGrid Team. All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-/* In this test, we have two senders sending one message to a common receiver.
- * The receiver should be able to see any ordering between the two messages.
- * If we model-check the application with assertions on a specific order of
- * the messages (see the assertions in the receiver code), it should fail
- * because both ordering are possible.
- *
- * If the senders sends the message directly, the current version of the MC
- * finds that the ordering may differ and the MC find a counter-example.
- *
- * However, if the senders send the message in a mutex, the MC always let
- * the first process take the mutex because it thinks that the effect of
- * a mutex is purely local: the ordering of the messages is always the same
- * and the MC does not find the counter-example.
- */
-
-#include "simgrid/modelchecker.h"
-#include "simgrid/msg.h"
-#include <xbt/synchro.h>
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
-
-#define BOX_NAME "box"
-
-#ifndef DISABLE_THE_MUTEX
-static sg_mutex_t mutex = NULL;
-#endif
-
-static int receiver(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
-{
- msg_task_t task = NULL;
-
- MSG_task_receive(&task, BOX_NAME);
- MC_assert(strcmp(MSG_task_get_name(task), "X") == 0);
- MSG_task_destroy(task);
-
- MSG_task_receive(&task, BOX_NAME);
- MC_assert(strcmp(MSG_task_get_name(task), "Y") == 0);
- MSG_task_destroy(task);
-
- return 0;
-}
-
-static int sender(int argc, char *argv[])
-{
- xbt_assert(argc == 2);
- const char* message_name = argv[1];
-#ifndef DISABLE_THE_MUTEX
- sg_mutex_lock(mutex);
-#endif
- MSG_task_send(MSG_task_create(message_name, 0.0, 0.0, NULL), BOX_NAME);
-#ifndef DISABLE_THE_MUTEX
- sg_mutex_unlock(mutex);
-#endif
- return 0;
-}
-
-int main(int argc, char *argv[])
-{
- MSG_init(&argc, argv);
- xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
- "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
-
- MSG_create_environment(argv[1]);
- MSG_function_register("receiver", receiver);
- MSG_function_register("sender", sender);
-
- MSG_launch_application(argv[2]);
-#ifndef DISABLE_THE_MUTEX
- mutex = sg_mutex_init();
-#endif
- msg_error_t res = MSG_main();
-#ifndef DISABLE_THE_MUTEX
- sg_mutex_destroy(mutex);
- mutex = NULL;
-#endif
- XBT_INFO("Simulation time %g", MSG_get_clock());
-
- return res != MSG_OK;
-}
--- /dev/null
+/* Copyright (c) 2015-2020. The SimGrid Team. All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+/* In this test, we have two senders sending one message to a common receiver.
+ * The receiver should be able to see any ordering between the two messages.
+ * If we model-check the application with assertions on a specific order of
+ * the messages (see the assertions in the receiver code), it should fail
+ * because both ordering are possible.
+ *
+ * If the senders sends the message directly, the current version of the MC
+ * finds that the ordering may differ and the MC find a counter-example.
+ *
+ * However, if the senders send the message in a mutex, the MC always let
+ * the first process take the mutex because it thinks that the effect of
+ * a mutex is purely local: the ordering of the messages is always the same
+ * and the MC does not find the counter-example.
+ */
+
+#include "simgrid/modelchecker.h"
+#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Host.hpp"
+#include "simgrid/s4u/Mailbox.hpp"
+#include "simgrid/s4u/Mutex.hpp"
+#include <xbt/synchro.h>
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
+
+static int receiver(const char* box_name)
+{
+ int* payload;
+ auto mb = simgrid::s4u::Mailbox::by_name(box_name);
+
+ payload = static_cast<int*>(mb->get());
+ MC_assert(*payload == 0);
+ free(payload);
+
+ payload = static_cast<int*>(mb->get());
+ MC_assert(*payload == 1);
+ free(payload);
+
+ return 0;
+}
+
+static int sender(const char* box_name, simgrid::s4u::MutexPtr mutex, int value)
+{
+ int* payload = new int(value);
+ auto mb = simgrid::s4u::Mailbox::by_name(box_name);
+
+#ifndef DISABLE_THE_MUTEX
+ mutex->lock();
+#endif
+
+ mb->put(static_cast<void*>(payload), 8);
+
+#ifndef DISABLE_THE_MUTEX
+ mutex->unlock();
+#endif
+ return 0;
+}
+
+int main(int argc, char* argv[])
+{
+ XBT_ATTRIB_UNUSED simgrid::s4u::MutexPtr mutex;
+#ifndef DISABLE_THE_MUTEX
+ mutex = simgrid::s4u::Mutex::create();
+#endif
+
+ simgrid::s4u::Engine e(&argc, argv);
+ xbt_assert(argc > 2,
+ "Usage: %s platform_file deployment_file\n"
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
+
+ e.load_platform(argv[1]);
+ simgrid::s4u::Actor::create("sender", simgrid::s4u::Host::by_name("Tremblay"), sender, "box", mutex, 1);
+ simgrid::s4u::Actor::create("sender", simgrid::s4u::Host::by_name("Tremblay"), sender, "box", mutex, 2);
+ simgrid::s4u::Actor::create("receiver", simgrid::s4u::Host::by_name("Jupiter"), receiver, "box");
+
+#ifndef DISABLE_THE_MUTEX
+ mutex = simgrid::s4u::Mutex::create();
+#endif
+
+ e.run();
+ XBT_INFO("Simulation time %g", e.get_clock());
+
+ return 0;
+}
+++ /dev/null
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
-<platform version="4.1">
- <actor host="Tremblay" function="receiver"/>
- <actor host="Boivin" function="sender">
- <argument value="X"/>
- </actor>
- <actor host="Fafard" function="sender">
- <argument value="Y"/>
- </actor>
-</platform>
task-priority
plugin-hostload
trace_integration)
- add_executable (${x} EXCLUDE_FROM_ALL ${x}/${x}.c)
- target_link_libraries(${x} simgrid)
- set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
- add_dependencies(tests ${x})
+ if(enable_MSG)
+ add_executable (${x} EXCLUDE_FROM_ALL ${x}/${x}.c)
+ target_link_libraries(${x} simgrid)
+ set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
+ add_dependencies(tests ${x})
+ endif()
set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c)
# CPP examples
foreach(x task_destroy_cancel task_listen_from task_progress host_on_off_processes)
- add_executable (${x} EXCLUDE_FROM_ALL ${x}/${x}.cpp)
- target_link_libraries(${x} simgrid)
- set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
- add_dependencies(tests ${x})
+ if(enable_MSG)
+ add_executable (${x} EXCLUDE_FROM_ALL ${x}/${x}.cpp)
+ target_link_libraries(${x} simgrid)
+ set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
+ add_dependencies(tests ${x})
+ endif()
set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.cpp)
endforeach()
-add_executable (bittorrent EXCLUDE_FROM_ALL app-bittorrent/bittorrent.c app-bittorrent/bittorrent-messages.c app-bittorrent/bittorrent-peer.c app-bittorrent/tracker.c app-bittorrent/connection.c)
-target_link_libraries(bittorrent simgrid)
-set_target_properties(bittorrent PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/app-bittorrent)
-add_dependencies(tests bittorrent)
+if(enable_MSG)
+ add_executable (bittorrent EXCLUDE_FROM_ALL app-bittorrent/bittorrent.c app-bittorrent/bittorrent-messages.c app-bittorrent/bittorrent-peer.c app-bittorrent/tracker.c app-bittorrent/connection.c)
+ target_link_libraries(bittorrent simgrid)
+ set_target_properties(bittorrent PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/app-bittorrent)
+ add_dependencies(tests bittorrent)
+endif()
foreach (file bittorrent connection bittorrent-messages bittorrent-peer tracker)
set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/${file}.c ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/${file}.h)
endforeach()
-add_executable (chainsend EXCLUDE_FROM_ALL app-chainsend/chainsend.c app-chainsend/iterator.c app-chainsend/common.c app-chainsend/messages.c app-chainsend/broadcaster.c app-chainsend/peer.c)
-target_link_libraries(chainsend simgrid)
-set_target_properties(chainsend PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/app-chainsend)
-add_dependencies(tests chainsend)
+if(enable_MSG)
+ add_executable (chainsend EXCLUDE_FROM_ALL app-chainsend/chainsend.c app-chainsend/iterator.c app-chainsend/common.c app-chainsend/messages.c app-chainsend/broadcaster.c app-chainsend/peer.c)
+ target_link_libraries(chainsend simgrid)
+ set_target_properties(chainsend PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/app-chainsend)
+ add_dependencies(tests chainsend)
+endif()
foreach (file common iterator messages broadcaster peer)
set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/app-chainsend/${file}.c ${CMAKE_CURRENT_SOURCE_DIR}/app-chainsend/${file}.h)
endforeach()
${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp1-c1s1-c3s2.xml
${CMAKE_CURRENT_SOURCE_DIR}/trace_integration/test-hbp2.5-hbp1.5.xml PARENT_SCOPE)
-foreach(x
+if(enable_MSG)
+ foreach(x
async-wait async-waitall async-waitany
app-bittorrent app-chainsend app-pingpong app-token-ring
cloud-capping cloud-migration cloud-two-tasks cloud-simple
task-priority
plugin-hostload
trace_integration)
- ADD_TESH_FACTORIES(tesh-msg-${x} "raw"
- --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
- --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg/${x}
- --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x}
- ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x}/${x}.tesh)
-endforeach()
+
+ ADD_TESH_FACTORIES(tesh-msg-${x} "raw"
+ --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
+ --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg/${x}
+ --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x}
+ ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x}/${x}.tesh)
+ endforeach()
-ADD_TESH_FACTORIES(tesh-app-bittorrent-parallel "raw" --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg/app-bittorrent --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/app-bittorrent app-bittorrent.tesh)
+ ADD_TESH_FACTORIES(tesh-app-bittorrent-parallel "raw" --cfg contexts/nthreads:4 ${CONTEXTS_SYNCHRO} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg/app-bittorrent --setenv srcdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/app-bittorrent app-bittorrent.tesh)
+endif()
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "simgrid/msg.h"
+#include "simgrid/s4u/Engine.hpp"
#include "src/kernel/lmm/maxmin.hpp"
#include "src/surf/surf_interface.hpp"
#include "xbt/log.h"
int main(int argc, char** argv)
{
- MSG_init(&argc, argv);
+ simgrid::s4u::Engine e(&argc, argv);
XBT_INFO("***** Test 1");
test1();
/* This program is 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/Engine.hpp"
#include "src/kernel/lmm/maxmin.hpp"
-#include "simgrid/msg.h"
#include "xbt/module.h"
#include "xbt/sysdep.h" /* time manipulation for benchmarking */
#include "xbt/xbt_os_time.h"
int main(int argc, char **argv)
{
- MSG_init(&argc, argv);
+ simgrid::s4u::Engine e(&argc, argv);
float rate_no_limit=0.2;
float acc_date=0;
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "xbt.h"
-#include <simgrid/msg.h>
+#include <simgrid/engine.h>
+#include <xbt.h>
XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logs of this example");
int main(int argc, char *argv[])
{
- MSG_init(&argc, argv);
+ simgrid_init(&argc, argv);
char *tmp = bprintf("\n%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s",
1, ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
2, ".........1.........2.........3.........4.........5.........6.........7.........8.........9.........0\n",
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include <simgrid/msg.h>
+#include <simgrid/engine.h>
#include <xbt.h>
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(test, top, "Logging specific to this test");
int main(int argc, char **argv)
{
- MSG_init(&argc, argv);
+ simgrid_init(&argc, argv);
dolog("");
dolog(" ");
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "simgrid/msg.h"
+#include "simgrid/s4u/Engine.hpp"
#include <thread>
XBT_LOG_NEW_DEFAULT_CATEGORY(synchro_crashtest, "Logs of this example");
int main(int argc, char* argv[])
{
- MSG_init(&argc, argv);
+ simgrid::s4u::Engine e(&argc, argv);
std::thread crashers[crasher_amount];
#include "src/internal_config.h" // HAVE_FUTEX_H
#include "xbt/parmap.hpp"
-#include <simgrid/msg.h>
+#include <simgrid/s4u/Engine.hpp>
#include <xbt.h>
#include <cstdlib>
unsigned modes = MODES_DEFAULT;
xbt_log_control_set("parmap_bench.fmt:[%c/%p]%e%m%n");
- MSG_init(&argc, argv);
+ simgrid::s4u::Engine e(&argc, argv);
if (argc != 3 && argc != 4) {
XBT_INFO("Usage: %s nthreads timeout [modes]", argv[0]);
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/internal_config.h" // HAVE_FUTEX_H
-#include <simgrid/msg.h>
+#include <simgrid/s4u/Engine.hpp>
#include <xbt.h>
#include <xbt/parmap.hpp>
{
int status = 0;
xbt_log_control_set("parmap_test.fmt:[%c/%p]%e%m%n");
- MSG_init(&argc, argv);
+ simgrid::s4u::Engine e(&argc, argv);
SIMIX_context_set_nthreads(16); // dummy value > 1
XBT_INFO("Basic testing posix");
${XBT_SRC}
${PLUGINS_SRC}
${BINDINGS_SRC}
- ${MSG_SRC}
${SIMDAG_SRC}
)
+if(${enable_MSG})
+ set(simgrid_sources ${simgrid_sources} ${MSG_SRC})
+else()
+ set(EXTRA_DIST ${EXTRA_DIST} ${MSG_SRC})
+endif()
+
if(${SIMGRID_HAVE_JEDULE})
set(simgrid_sources ${simgrid_sources} ${JEDULE_SRC})
else()
examples/s4u/CMakeLists.txt
examples/smpi/CMakeLists.txt
examples/smpi/NAS/CMakeLists.txt
- examples/smpi/smpi_msg_masterslave/CMakeLists.txt
+ examples/smpi/smpi_s4u_masterslave/CMakeLists.txt
examples/smpi/replay_multiple/CMakeLists.txt
examples/smpi/replay_multiple_manual_deploy/CMakeLists.txt
examples/python/CMakeLists.txt
option(enable_ns3 "Whether ns-3 model is activated." off)
option(enable_java "Whether the Java bindings are activated." off)
+option(enable_MSG "Whether the MSG module is activated." off)
option(enable_lib_in_jar "Whether the native libraries are bundled in a Java jar file" on)
option(minimal-bindings "Whether to compile the bindings libraries (Java/Python) with the minimal dependency set" off)
mark_as_advanced(minimal-bindings)
-add_executable (graphicator graphicator.c)
-add_dependencies (tests graphicator)
-target_link_libraries(graphicator simgrid)
-set_target_properties(graphicator PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-ADD_TESH(graphicator --setenv srcdir=${CMAKE_HOME_DIRECTORY} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/graphicator.tesh)
+if(enable_MSG)
+ add_executable (graphicator graphicator.c)
+ add_dependencies (tests graphicator)
+ target_link_libraries(graphicator simgrid)
+ set_target_properties(graphicator PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+ ADD_TESH(graphicator --setenv srcdir=${CMAKE_HOME_DIRECTORY} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/graphicator.tesh)
-install(TARGETS graphicator DESTINATION bin/)
+ install(TARGETS graphicator DESTINATION bin/)
-## Clean generated files
-get_directory_property(extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
-set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${extra_clean_files};${CMAKE_CURRENT_BINARY_DIR}/simgrid.trace;")
+ ## Clean generated files
+ get_directory_property(extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
+ set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${extra_clean_files};${CMAKE_CURRENT_BINARY_DIR}/simgrid.trace;")
+endif()
set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/graphicator.tesh PARENT_SCOPE)
set(tools_src ${tools_src} ${CMAKE_CURRENT_SOURCE_DIR}/graphicator.c PARENT_SCOPE)
set -e
+echo "Starting Flags.sh $@"
+
die() {
echo "$@"
exit 1
fi
}
-[ $# -eq 4 ] || die "Needs 4 arguments : JAVA MC SMPI DEBUG"
+[ $# -eq 5 ] || die "Needs 5 arguments : JAVA MC SMPI DEBUG MSG"
### Cleanup previous runs
builddebug="OFF"
fi
+if [ $5 = "MSG" ]
+then
+ buildmsg="ON"
+else
+ buildmsg="OFF"
+fi
+
+if [ $buildmsg = "OFF" -a $buildjava = "ON" ]
+then
+ echo "Don't even try to build Java without MSG"
+ exit 0
+fi
-echo "Step ${STEP}/${NSTEPS} - Building with java=${buildjava}, debug=${builddebug}, SMPI=${buildsmpi}, MC=${buildmc}"
-cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=${buildjava} \
+echo "Step ${STEP}/${NSTEPS} - Building with java=${buildjava}, debug=${builddebug}, SMPI=${buildsmpi}, MC=${buildmc}, MSG=${buildmsg}"
+cmake -Denable_documentation=OFF -Denable_lua=ON -Denable_java=${buildjava} -Denable_MSG=${buildmsg} \
-Denable_compile_optimizations=OFF -Denable_compile_warnings=ON \
-Denable_jedule=ON -Denable_mallocators=ON -Denable_debug=${builddebug} \
-Denable_smpi=${buildsmpi} -Denable_smpi_MPICH3_testsuite=${buildsmpi} -Denable_model-checking=${buildmc} \
-Denable_memcheck=$(onoff test "$build_mode" = "DynamicAnalysis") \
-Denable_compile_warnings=$(onoff test "$GENERATOR" != "MSYS Makefiles") -Denable_smpi=ON \
-Denable_ns3=$(onoff test "$have_NS3" = "yes" -a "$build_mode" = "Debug") \
- -Denable_jedule=OFF -Denable_java=ON -Denable_lua=OFF ${MAY_DISABLE_SOURCE_CHANGE} ${MAY_DISABLE_LTO} \
+ -Denable_jedule=OFF -Denable_lua=OFF ${MAY_DISABLE_SOURCE_CHANGE} ${MAY_DISABLE_LTO} \
+ -Denable_java=$(onoff test "$build_mode" = "ModelChecker") \
+ -Denable_MSG=$(onoff test "$build_mode" = "ModelChecker") \
$SRCFOLDER
# -Denable_lua=$(onoff test "$build_mode" != "DynamicAnalysis") \
set +x