# Reenable with
# cmake -Denable_ns3
# apt-get libns3-dev ns3
-
-
+#
+#
language: cpp
compiler:
- gcc
# - clang # boost 1.48 raises an error on clang:
- # /usr/include/boost/signals2/detail/auto_buffer.hpp:565:57: error:
- # reference to non-static member function must be called
- # std::uninitialized_fill( buffer_, buffer_ + size, init_value );
- # ^~~~
+# /usr/include/boost/signals2/detail/auto_buffer.hpp:565:57: error:
+# reference to non-static member function must be called
+# std::uninitialized_fill( buffer_, buffer_ + size, init_value );
+# ^~~~
addons:
apt: # Get recent versions of the compiler, even on Ubuntu Precise
sources:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g")
-## We need a decent support of the c++11 standard
-include(CheckCXXCompilerFlag)
-CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
-if(COMPILER_SUPPORTS_CXX11)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-else()
- message(FATAL_ERROR
- "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. "
- "Please use a decent C++ compiler.")
-endif()
if (CMAKE_COMPILER_IS_GNUCC)
if (COMPILER_CXX_VERSION_MAJOR_MINOR STRLESS "4.7")
message(FATAL_ERROR
- "SimGrid needs g++ version 4.7 to compile "
+ "SimGrid needs at least g++ version 4.7 to compile "
"(c++11 support of previous versions is too limited).")
endif()
endif()
+## We need a decent support of the c++11 standard
+include(CheckCXXCompilerFlag)
+CHECK_CXX_COMPILER_FLAG("-std=gnu++11" COMPILER_SUPPORTS_CXX11)
+if(COMPILER_SUPPORTS_CXX11)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
+else()
+ message(FATAL_ERROR
+ "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. "
+ "Please use a decent C++ compiler.")
+endif()
+
### And we need C11 standard, too
include(CheckCCompilerFlag)
CHECK_C_COMPILER_FLAG("-std=gnu11" COMPILER_SUPPORTS_C11)
else()
message(FATAL_ERROR
"The compiler ${CMAKE_C_COMPILER} has no C11 support. "
- "Please use a decent C compiler "
- "(note that c++11 support of ${CMAKE_CXX_COMPILER} seems ok).")
+ "Please use a decent C compiler "
+ "(note that c++11 support of ${CMAKE_CXX_COMPILER} seems ok).")
endif()
-
### SMPI vs. Fortran
if ((NOT DEFINED enable_smpi OR enable_smpi) AND NOT APPLE) # smpi is enabled by default
# Call enable_language(Fortran) in order to load the build rules for
string(REGEX MATCH "cl.exe" VBC "${CMAKE_C_COMPILER}")
if(VBC)
- message(FATAL_ERROR "VB is not yet supported by Simgrid.")
+ message("VB is not yet supported by Simgrid. Proceed with extrem caution")
endif()
### Find programs and paths
# set(__GNUC_MINOR__ ${COMPILER_C_MINOR_VERSION})
endif()
else()
- message(FATAL_ERROR "Please use MinGW to compile SimGrid!")
+ message("You REALLY should use MinGW to compile SimGrid on Windows!")
endif()
if(ARCH_32_BITS) ### Arch 32bits
* Require g++ v4.7 at least to not speak prehistorical C++.
* Require Boost 1.48 (for signal2 component).
* Tracing is now always enabled (no way to turn it out)
+ * Remove GTNetS. It was not working anyway.
* Move headers around to sort them out on installed systems:
- instr/instr.h -> simgrid/instr.h
- instr/jedule/* -> simgrid/jedule
If you want to compile smpi, you should install a fortran compiler to use
Fortran code. Only gfortran has been tested for now.
-If you want to compile the GTNetS backend, you have to have a patched version of
-GTNetS installed. The patch lives in the contrib section of the Git.
+If you want to compile the NS3 backend, you naturally need to install
+NS3, both libs and development headers.
--- /dev/null
+# This file is intended to automatize the testing of SimGrid on
+# Windows using the appveyor.com continuous integration service
+
+os: MinGW
+version: "{build}"
+clone_depth: 1
+
+platform:
+ - Win32 # This is Windows 32bits (don't activate since we dont compile properly anyway)
+# - x64 #Â This is Windows 64bits
+
+environment:
+ BOOST_ROOT: c:\Libraries\boost
+ BOOST_LIBRARYDIR: c:\Libraries\boost\stage\lib
+
+build_script:
+- '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd"'
+- C:\MinGW\msys\1.0\bin\bash -lc "echo \"C:/MinGW /mingw\" > /etc/fstab"
+- C:\MinGW\msys\1.0\bin\bash -lc "printenv"
+- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/projects/simgrid && cmake -G \"MSYS Makefiles\" -DBOOST_ROOT=\"%BOOST_ROOT%\" -DBOOST_LIBRARYDIR=\"%BOOST_LIBRARYDIR%\" -DBoost_USE_STATIC_LIBS=ON -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF -Denable_tracing=ON -Denable_java=OFF -Denable_model-checking=OFF ."
+- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/projects/simgrid; echo XXX simgrid_config.h; cat include/simgrid_config.h"
+- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/projects/simgrid; echo XXX src/internal_config.h; cat src/internal_config.h"
+#- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/projects/simgrid; echo XXX Internal builtins; gcc -dM -E - < /dev/null"
+- C:\MinGW\msys\1.0\bin\bash -lc "cd /c/projects/simgrid && make VERBOSE=1"
+
+test_script:
+ cmd: ctest -VV
+
+# notifications:
+# - irc: "irc.debian.org#simgrid" # Not implemented by AppVeyor yet :(
+# Some source of inspiration:
+# https://github.com/dartsim/dart/blob/master/appveyor.yml
+# https://github.com/osmcode/libosmium/blob/master/appveyor.yml
+# https://github.com/polysquare/cmake-unit/blob/master/appveyor.yml
+# https://github.com/openvswitch/ovs/blob/master/appveyor.yml
SET(BUILDNAME "FULL_FLAGS" CACHE INTERNAL "Buildname" FORCE)
endif()
-if(HAVE_GTNETS)
- SET(BUILDNAME "GTNETS" CACHE INTERNAL "Buildname" FORCE)
-endif()
-
if(HAVE_MC)
SET(BUILDNAME "MODEL-CHECKING" CACHE INTERNAL "Buildname" FORCE)
endif()
include(FindLua51Simgrid)
endif()
-set(HAVE_GTNETS 0)
-if(enable_gtnets)
- include(FindGTnets)
- if (NOT HAVE_GTNETS)
- message(FATAL_ERROR "Cannot find GTNetS. Please install it, or disable that cmake option")
- endif()
-endif()
set(HAVE_NS3 0)
if(enable_ns3)
include(FindNS3)
# Checks for header libraries functions.
CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_DLOPEN_IN_LIBDL)
CHECK_LIBRARY_EXISTS(execinfo backtrace "" HAVE_BACKTRACE_IN_LIBEXECINFO)
-CHECK_LIBRARY_EXISTS(pthread pthread_create "" pthread)
+CHECK_LIBRARY_EXISTS(pthread pthread_create "" HAVE_PTHREAD)
CHECK_LIBRARY_EXISTS(pthread sem_init "" HAVE_SEM_INIT_LIB)
CHECK_LIBRARY_EXISTS(pthread sem_open "" HAVE_SEM_OPEN_LIB)
CHECK_LIBRARY_EXISTS(pthread sem_timedwait "" HAVE_SEM_TIMEDWAIT_LIB)
if(enable_latency_bound_tracking)
SET(HAVE_LATENCY_BOUND_TRACKING 1)
else()
- if(enable_gtnets)
- message(STATUS "Warning : Turning latency_bound_tracking to ON because GTNeTs is ON")
- SET(enable_latency_bound_tracking ON)
- SET(HAVE_LATENCY_BOUND_TRACKING 1)
- else()
- SET(HAVE_LATENCY_BOUND_TRACKING 0)
- endif()
+ SET(HAVE_LATENCY_BOUND_TRACKING 0)
endif()
if(enable_mallocators)
#--------------------------------------------------------------------------------------------------
### Initialize of CONTEXT THREADS
-if(pthread)
+if(HAVE_PTHREAD)
set(pthread 1)
elseif(pthread)
set(pthread 0)
endif()
-if(pthread)
+if(HAVE_PTHREAD)
### Test that we have a way to create semaphores
if(HAVE_SEM_OPEN_LIB)
message("-- Support for ucontext factory")
endif()
-if(pthread)
+if(HAVE_PTHREAD)
set(CONTEXT_THREADS 1)
message("-- Support for thread context factory")
endif()
set(includedir "${CMAKE_INSTALL_PREFIX}/include")
set(libdir ${exec_prefix}/lib)
set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=\"${CMAKE_INSTALL_PREFIX}/lib")
-if(GTNETS_LIB_PATH)
- set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${GTNETS_LIB_PATH}")
-endif()
if(NS3_LIBRARY_PATH)
set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${NS3_LIBRARY_PATH}")
endif()
set(includedir "${CMAKE_HOME_DIRECTORY}/include")
set(exec_prefix "${CMAKE_BINARY_DIR}/smpi_script/")
set(CMAKE_SMPI_COMMAND "export LD_LIBRARY_PATH=\"${CMAKE_BINARY_DIR}/lib")
-if(GTNETS_LIB_PATH)
- set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${GTNETS_LIB_PATH}")
-endif()
if(NS3_LIBRARY_PATH)
set(CMAKE_SMPI_COMMAND "${CMAKE_SMPI_COMMAND}:${NS3_LIBRARY_PATH}")
endif()
src/surf/cpu_cas01.hpp
src/surf/cpu_interface.hpp
src/surf/cpu_ti.hpp
- src/surf/gtnets/gtnets_interface.h
- src/surf/gtnets/gtnets_simulator.h
- src/surf/gtnets/gtnets_topology.h
src/surf/maxmin_private.hpp
src/surf/network_cm02.hpp
src/surf/network_constant.hpp
- src/surf/network_gtnets.hpp
src/surf/network_interface.hpp
src/surf/network_ns3.hpp
src/surf/network_smpi.hpp
)
endif()
-set(GTNETS_SRC
- src/surf/gtnets/gtnets_interface.cc
- src/surf/gtnets/gtnets_simulator.cc
- src/surf/gtnets/gtnets_topology.cc
- src/surf/network_gtnets.cpp
- )
-
set(NS3_SRC
src/surf/network_ns3.cpp
src/surf/ns3/my-point-to-point-helper.cc
set(MC_SRC
src/mc/AddressSpace.hpp
src/mc/AddressSpace.cpp
+ src/mc/Frame.hpp
+ src/mc/ModelChecker.hpp
+ src/mc/ModelChecker.cpp
+ src/mc/ObjectInformation.hpp
+ src/mc/ObjectInformation.cpp
+ src/mc/PageStore.hpp
+ src/mc/PageStore.cpp
+ src/mc/RegionSnapshot.cpp
+ src/mc/RegionSnapshot.hpp
+ src/mc/Type.hpp
+ src/mc/Variable.cpp
+ src/mc/Variable.hpp
+
src/mc/mc_forward.h
src/mc/mc_forward.hpp
src/mc/mc_process.h
src/mc/mc_unw.cpp
src/mc/mc_unw_vmread.cpp
src/mc/mc_mmalloc.h
- src/mc/ModelChecker.hpp
- src/mc/ModelChecker.cpp
src/mc/mc_object_info.h
- src/mc/mc_object_info.cpp
src/mc/mc_checkpoint.cpp
src/mc/mc_snapshot.h
src/mc/mc_snapshot.cpp
- src/mc/RegionSnapshot.cpp
- src/mc/RegionSnapshot.hpp
- src/mc/PageStore.hpp
- src/mc/PageStore.cpp
src/mc/mc_page_snapshot.cpp
src/mc/mc_comm_pattern.h
src/mc/mc_comm_pattern.cpp
)
endif()
-# -->HAVE_GTNETS
-if(HAVE_GTNETS)
- set(GTNETS_USED
- ${GTNETS_SRC}
- )
-else()
- set(GTNETS_USED "")
- set(EXTRA_DIST
- ${EXTRA_DIST}
- ${GTNETS_SRC}
- )
-endif()
-
### Simgrid Lib sources
set(simgrid_sources
${BINDINGS_SRC}
- ${GTNETS_USED}
${S4U_SRC}
${MSG_SRC}
${SIMDAG_SRC}
examples/msg/energy/pstate/CMakeLists.txt
examples/msg/exception/CMakeLists.txt
examples/msg/gpu/CMakeLists.txt
- examples/msg/gtnets/CMakeLists.txt
+ examples/msg/gtnets/CMakeLists.txt
examples/msg/icomms/CMakeLists.txt
examples/msg/io/CMakeLists.txt
examples/msg/kademlia/CMakeLists.txt
buildtools/Cmake/MakeLib.cmake
buildtools/Cmake/MakeLibWin.cmake
buildtools/Cmake/Modules/FindGFortran.cmake
- buildtools/Cmake/Modules/FindGTnets.cmake
buildtools/Cmake/Modules/FindGraphviz.cmake
buildtools/Cmake/Modules/FindLibSigc++.cmake
buildtools/Cmake/Modules/FindLibdw.cmake
buildtools/Cmake/src/simgrid.nsi.in
buildtools/Cmake/test_prog/prog_AC_CHECK_MCSC.c
buildtools/Cmake/test_prog/prog_gnu_dynlinker.c
- buildtools/Cmake/test_prog/prog_gtnets.cpp
buildtools/Cmake/test_prog/prog_mutex_timedlock.c
buildtools/Cmake/test_prog/prog_sem_init.c
buildtools/Cmake/test_prog/prog_sem_open.c
examples/platforms/cluster_and_one_host.xml
examples/platforms/cluster_no_backbone.xml
examples/platforms/clusters_routing_full.xml
+ examples/platforms/crosstraffic.xml
examples/platforms/conf/gridpp_grid_2004.conf
examples/platforms/conf/gridpp_grid_2004.xml
examples/platforms/conf/lcg_sept2004_grid.conf
${headers_to_install}
${source_of_generated_headers}
${BINDINGS_SRC}
- ${GTNETS_SRC}
${JEDULE_SRC}
${JMSG_C_SRC}
${JMSG_JAVA_SRC}
if(CMAKE_COMPILER_IS_GNUCC AND (NOT enable_model-checking))
set(optCFLAGS "${optCFLAGS} -finline-functions ")
if(WIN32)
- if (COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.7")
+ if (COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.8")
# On windows, we need 4.8 or higher to enable lto because of http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50293
- set(optCFLAGS "${optCFLAGS} -flto ")
+ #
+ # We are experiencing assertion failures even with 4.8 on MinGW.
+ # Push the support forward: will see if 4.9 works when we test it.
+ set(optCFLAGS "${optCFLAGS} -flto ")
endif()
else()
# On non-windows, 4.6 is enough for that
OUTPUT_VARIABLE IS_32_BITS_JVM)
STRING( FIND ${IS_32_BITS_JVM} "Error" POSITION )
if(${POSITION} GREATER -1)
- message(FATAL_ERROR "Java JVM needs to be 32 bits to be able to run with Simgrid on Windows for now")
+ message("POTENTIAL ERROR: Java JVM needs to be 32 bits to be able to run with Simgrid on Windows for now")
endif()
set_target_properties(simgrid-java PROPERTIES
set(SIMGRID_DEP "${SIMGRID_DEP} -lstdc++")
endif()
-if(pthread AND ${CONTEXT_THREADS} AND NOT APPLE)
+if(HAVE_PTHREAD AND ${CONTEXT_THREADS} AND NOT APPLE)
# Clang on recent Mac OS X is not happy about -pthread.
SET(SIMGRID_DEP "${SIMGRID_DEP} -pthread")
endif()
SET(SIMGRID_DEP "${SIMGRID_DEP} -lsigc-2.0")
endif()
-if(HAVE_GTNETS)
- SET(SIMGRID_DEP "${SIMGRID_DEP} -lgtnets")
-endif()
-
if(HAVE_MC)
# The availability of libunwind was checked in CompleteInFiles.cmake
# (that includes FindLibunwind.cmake), so simply load it now.
set_target_properties(simgrid PROPERTIES COMPILE_FLAGS "-D_XBT_DLL_EXPORT -DDLL_EXPORT" LINK_FLAGS "-shared" VERSION ${libsimgrid_version} PREFIX "lib" SUFFIX ".dll" IMPORT_PREFIX "lib" IMPORT_SUFFIX ".dll")
-set(SIMGRID_DEP "-lws2_32 -lpthread -lm")
+set(SIMGRID_DEP "-lws2_32 -lm")
+
+if (HAVE_PTHREAD)
+ set(SIMGRID_DEP "${SIMGRID_DEP} -lpthread")
+endif()
if(ARCH_32_BITS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -march=i486 -D_I_X86_")
+++ /dev/null
-find_library(HAVE_GTNETS_LIB
- NAME gtsim
- PATHS ${gtnets_path} ${gtnets_path}/lib
- )
-
-if (HAVE_GTNETS_LIB)
- message(STATUS "Looking for GTNetS library - found")
-else()
- message(STATUS "Looking for GTNetS library - no found (search path: ${gtnets_path})")
- message(STATUS " library file name must be libgtsim.so (not gtnets.so, not libgtsim-opt.so)")
-endif()
-
-find_path(HAVE_SIMULATOR_H
- NAME simulator.h
- PATH_SUFFIXES include include/gtnets
- PATHS
- ${gtnets_path}
- )
-if (HAVE_GTNETS_LIB)
- message(STATUS "Looking for GTNetS header simulator.h - found")
-else()
- message(STATUS "Looking for GTNetS header simulator.h - no found")
-endif()
-
-string(REPLACE "/libgtnets.${LIB_EXE}" "" GTNETS_LIB_PATH "${HAVE_GTNETS_LIB}")
-
-if(HAVE_GTNETS_LIB AND HAVE_SIMULATOR_H)
-
- execute_process(COMMAND ${CMAKE_CXX_COMPILER} -I${HAVE_SIMULATOR_H} -lgtsim -L${GTNETS_LIB_PATH} ${CMAKE_HOME_DIRECTORY}/buildtools/Cmake/test_prog/prog_gtnets.cpp
- OUTPUT_VARIABLE COMPILE_GTNETS_VAR)
- if(COMPILE_GTNETS_VAR)
- SET(HAVE_GTNETS 0)
- else()
- SET(HAVE_GTNETS 1)
-
- string(REGEX MATCH "-L${GTNETS_LIB_PATH} " operation "${CMAKE_C_FLAGS}")
- if(NOT operation)
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-L${GTNETS_LIB_PATH} ")
- endif()
-
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}-I${HAVE_SIMULATOR_H} -L${GTNETS_LIB_PATH} ")
-
- string(REGEX MATCH "${GTNETS_LIB_PATH}" operation "$ENV{LD_LIBRARY_PATH}")
- if(NOT operation)
- message(FATAL_ERROR "\nGTNetS library found but unusable. Did you set LD_LIBRARY_PATH?\n\texport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${GTNETS_LIB_PATH}\n\n")
- endif()
-
- endif()
-
-else()
- if(NOT HAVE_GTNETS_LIB)
- message(STATUS "Gtnets is enabled but can't find it.")
- endif()
- if(NOT HAVE_SIMULATOR_H)
- message(STATUS "Gtnets needs simulator.h")
- endif()
-endif()
-
-message(STATUS "Looking for lib gtnets patch")
-if(HAVE_GTNETS)
- message(STATUS "Looking for lib gtnets patch - found")
-else()
- message(STATUS "Looking for lib gtnets patch - not found")
-endif()
-
-mark_as_advanced(HAVE_GTNETS_LIB)
-mark_as_advanced(HAVE_SIMULATOR_H)
\ No newline at end of file
### ARGs use -D[var]=[ON/OFF] or [1/0] or [true/false](see below)
-### ex: cmake -Denable_java=ON -Denable_gtnets=ON ./
+### ex: cmake -Denable_java=ON -Denable_ns3=ON ./
set(BIBTEX2HTML ${BIBTEX2HTML} CACHE PATH "Path to bibtex2html")
-set(gtnets_path ${gtnets_path} CACHE PATH "Path to gtnets lib and include")
if(NOT CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local/simgrid/" CACHE PATH "Path where this project should be installed")
option(release "Whether Release Mode is activated (disable tests on experimental parts)" on)
option(enable_compile_optimizations "Whether to produce efficient code for the SimGrid library" on)
option(enable_documentation "Whether to produce documentation" on)
-option(enable_gtnets "Whether gtnets model is activated." off)
option(enable_ns3 "Whether ns3 model is activated." off)
option(enable_java "Whether the Java bindings are activated." off)
option(enable_scala "Whether the Scala bindings are activated." off)
message(" LDFlags .....................: ${CMAKE_C_LINK_FLAGS}")
message("")
-if (HAVE_GTNETS)
- message(" Compile Gtnets ..............: yes (path: ${gtnets_path})")
-else()
- message(" Compile Gtnets ..............: NO (path: ${gtnets_path})")
-endif()
if (HAVE_NS3)
message(" Compile NS-3 ................: yes (path: ${NS3_PATH})")
else()
/* Define to 1 if you have the `clock_gettime' function. */
#cmakedefine HAVE_POSIX_GETTIME @HAVE_POSIX_GETTIME@
-/* Indicates that we have GTNETS support */
-#cmakedefine HAVE_GTNETS @HAVE_GTNETS@
-
/* Indicates that we have SMPI support */
#cmakedefine HAVE_SMPI @HAVE_SMPI@
+++ /dev/null
-/* Copyright (c) 2010, 2014. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include <simulator.h>
-
-int main(){
- Simulator s;
- s.RunUntilNextCompletion();
-}
-
set -e
-build_mode="$1"
-
-echo "Build mode $build_mode on $(uname -np)" >&2
-
# usage: die status message...
die () {
local status=${1:-1}
fi
}
-ulimit -c 0
-
-if [ -d $WORKSPACE/build ]
-then
- rm -rf $WORKSPACE/build
-fi
-mkdir $WORKSPACE/build
-cd $WORKSPACE/build
-
-cmake -Denable_documentation=OFF $WORKSPACE
-make dist
-tar xzf `cat VERSION`.tar.gz
-cd `cat VERSION`
-
+build_mode="$1"
+echo "Build mode $build_mode on $(uname -np)" >&2
case "$build_mode" in
"Debug")
;;
;;
*)
- die 1 "Unknown build_mode $build_mode"
+ die 1 "Unknown build_mode $build_mode"
;;
esac
-cmake -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF \
+if test "$(uname -o)" = "Msys"; then
+ if [ -z "$NUMBER_OF_PROCESSORS" ]; then
+ NUMBER_OF_PROCESSORS=1
+ fi
+ GENERATOR="MSYS Makefiles"
+else
+ NUMBER_OF_PROCESSORS="$(nproc)" || NUMBER_OF_PROCESSORS=1
+ GENERATOR="Unix Makefiles"
+fi
+
+ulimit -c 0 || true
+
+if test "$(uname -o)" != "Msys"; then
+ echo "XX"
+ echo "XX Get out of the tree"
+ echo "XX"
+ if [ -d $WORKSPACE/build ]
+ then
+ rm -rf $WORKSPACE/build
+ fi
+ mkdir $WORKSPACE/build
+ cd $WORKSPACE/build
+
+ echo "XX"
+ echo "XX Build the archive out of the tree"
+ echo "XX pwd: `pwd`"
+ echo "XX"
+
+ cmake -G"$GENERATOR" -Denable_documentation=OFF $WORKSPACE
+ make dist -j$NUMBER_OF_PROCESSORS
+
+ echo "XX"
+ echo "XX Open the resulting archive"
+ echo "XX"
+ tar xzf `cat VERSION`.tar.gz
+ cd `cat VERSION`
+fi
+
+echo "XX"
+echo "XX Configure and build SimGrid"
+echo "XX pwd: `pwd`"
+echo "XX"
+cmake -G"$GENERATOR"\
+ -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF \
-Denable_model-checking=$(onoff test "$build_mode" = "ModelChecker") \
- -Denable_compile_optimization=$(onoff test "$build_mode" = "Debug") \
+ -Denable_smpi_ISP_testsuite=$(onoff test "$build_mode" = "ModelChecker") \
+ -Denable_compile_optimizations=$(onoff test "$build_mode" = "Debug") \
-Denable_smpi_MPICH3_testsuite=$(onoff test "$build_mode" != "DynamicAnalysis") \
-Denable_lua=$(onoff test "$build_mode" != "DynamicAnalysis") \
-Denable_mallocators=$(onoff test "$build_mode" != "DynamicAnalysis") \
-Denable_memcheck=$(onoff test "$build_mode" = "DynamicAnalysis") \
-Denable_compile_warnings=ON -Denable_smpi=ON -Denable_lib_static=OFF \
- -Denable_latency_bound_tracking=OFF -Denable_gtnets=OFF -Denable_jedule=OFF \
+ -Denable_latency_bound_tracking=OFF -Denable_jedule=OFF \
-Denable_tracing=ON -Denable_java=ON
-make
+make -j$NUMBER_OF_PROCESSORS VERBOSE=1
-cd $WORKSPACE/build
-cd `cat VERSION`
+if test "$(uname -o)" != "Msys"; then
+ cd $WORKSPACE/build
+ cd `cat VERSION`
+fi
TRES=0
+echo "XX"
+echo "XX Run the tests"
+echo "XX pwd: `pwd`"
+echo "XX"
+
ctest -T test --output-on-failure --no-compress-output || true
if [ -f Testing/TAG ] ; then
xsltproc $WORKSPACE/buildtools/jenkins/ctest2junit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > CTestResults.xml
mv CTestResults.xml $WORKSPACE
fi
+echo "XX"
+echo "XX Done. Return the results to cmake"
+echo "XX"
+
if [ "$build_mode" = "DynamicAnalysis" ]
then
ctest -D ContinuousStart
--- /dev/null
+#!/bin/sh
+
+if [ -d $WORKSPACE/build ]
+then
+ rm -rf $WORKSPACE/build
+fi
+if [ -d $WORKSPACE/install ]
+then
+ rm -rf $WORKSPACE/install
+fi
+mkdir $WORKSPACE/build
+mkdir $WORKSPACE/install
+cd $WORKSPACE/build
+
+cmake $WORKSPACE
+make
+make dist
+make distcheck
+tar xzf `cat VERSION`.tar.gz
+cd `cat VERSION`
+
+if [ "$build_mode" = "Debug" ]
+then
+cmake -Denable_coverage=ON -Denable_model-checking=OFF -Denable_lua=ON -Denable_compile_optimizations=OFF .
+fi
+
+if [ "$build_mode" = "ModelChecker" ]
+then
+cmake -Denable_coverage=ON -Denable_model-checking=ON -Denable_lua=ON -Denable_compile_optimizations=OFF .
+fi
+
+if [ "$build_mode" = "DynamicAnalysis" ]
+then
+cmake -Denable_lua=OFF -Denable_tracing=ON -Denable_smpi=ON -Denable_compile_optimizations=OFF -Denable_compile_warnings=ON -Denable_lib_static=OFF -Denable_model-checking=OFF -Denable_latency_bound_tracking=OFF -Denable_gtnets=OFF -Denable_jedule=OFF -Denable_mallocators=OFF -Denable_memcheck=ON .
+fi
+make
\ No newline at end of file
/** Process Controller **/
PSGPlatform.control();
- new PSGProcessController(PSGPlatform.hostList[0],
- PSGPlatform.hostList[0].getName(), null).start();
+ if (!PSGPlatform.controlStepMap.isEmpty())
+ new PSGProcessController(PSGPlatform.hostList[0],
+ PSGPlatform.hostList[0].getName(), null).start();
/** Load and execute the initializers classes in the configuration file **/
PSGPlatform.init();
@top_srcdir@/examples/msg/tracing/link_user_variables.c \
@top_srcdir@/examples/msg/tracing/link_srcdst_user_variables.c \
@top_srcdir@/examples/msg/ns3 \
- @top_srcdir@/examples/msg/gtnets \
@top_srcdir@/examples/msg/io \
@top_srcdir@/examples/msg/gpu \
@top_srcdir@/examples/msg/actions \
and developer header files.
- @li <b>enable_gtnets</b> (ON/OFF): whether you want to use gtnets.
- See section @ref pls_simgrid_configuration_gtnets.
- @li <b>gtnets_path</b> (path): GTNetS installation directory
- (eg /usr or /opt).
@li <b>enable_ns3</b> (ON/OFF): whether you want to use ns3.
See section @ref pls_simgrid_configuration_ns3.
@li <b>NS3_HINT</b> (path): Where to search for NS3 (eg /usr or /opt).
simulators as network models (see \ref pls). In that case, you have
two extra models, described below, and some \ref options_pls "specific
additional configuration flags".
- - \b GTNets: Network pseudo-model using the GTNets simulator instead
- of an analytic model
- \b NS3: Network pseudo-model using the NS3 tcp model instead of an
analytic model
\subsubsection options_model_network_crosstraffic Simulating cross-traffic
-%As of SimGrid v3.7, cross-traffic effects can be taken into account in
+As of SimGrid v3.7, cross-traffic effects can be taken into account in
analytical simulations. It means that ongoing and incoming
communication flows are treated independently. In addition, the LV08
model adds 0.05 of usage on the opposite direction for each new
For that to work, your platform must have two links for each
pair of interconnected hosts. An example of usable platform is
-available in <tt>examples/msg/gtnets/crosstraffic-p.xml</tt>.
+available in <tt>examples/platforms/crosstraffic.xml</tt>.
This is activated through the \b network/crosstraffic item, that
can be set to 0 (disable this feature) or 1 (enable it).
in NS3. The only valid values (enforced on the SimGrid side) are
'NewReno' or 'Reno' or 'Tahoe'.
-When using GTNeTS, two items exist:
- - \b gtnets/jitter, that is a double value to oscillate
- the link latency, uniformly in random interval
- [-latency*gtnets_jitter,latency*gtnets_jitter). It defaults to 0.
- - \b gtnets/jitter_seed, the positive seed used to reproduce jitted
- results. Its value must be in [1,1e8] and defaults to 10.
-
\section options_modelchecking Configuring the Model-Checking
To enable the experimental SimGrid model-checking support the program should
- \c exception/cutpath: \ref options_exception_cutpath
-- \c gtnets/jitter: \ref options_pls
-- \c gtnets/jitter_seed: \ref options_pls
-
- \c host/model: \ref options_model_select
- \c maxmin/precision: \ref options_model_precision
\subsubsection pf_raf The router affair
Expressing routers becomes mandatory when using shortest-path based
-models or when using ns-3 or the bindings to the GTNetS packet-level
+models or when using the bindings to the ns-3 packet-level
simulator instead of the native analytical network model implemented
in SimGrid.
because both algorithms need a graph, and so we need to have source
and destination for each edge.
-Routers are naturally an important concept in GTNetS or ns-3 since the
+Routers are naturally an important concept in ns-3 since the
way they run the packet routing algorithms is actually simulated.
Instead, the SimGrid’s analytical models aggregate the routing time
with the transfer time. Rebuilding a graph representation only from
Actually we did not include switch tag, ok. But when you're trying to
simulate a switch, the only major impact it has when you're using
-fluid model (and SimGrid uses fluid model unless you activate GTNetS,
-ns-3, or constant network mode) is the impact of the upper limit of
+fluid model (and SimGrid uses fluid model unless you activate
+ns-3 or constant network mode) is the impact of the upper limit of
the switch motherboard speed that will eventually be reached if you're
using intensively your switch. So, the switch impact is similar to a
link one. That's why we are used to describe a switch using a link tag
It is possible to use a packet-level network simulator
instead of the default flow-based simulation. You may want to use such
an approach if you have doubts about the validity of the default model
-or if you want to perform some validation experiments. At the moment,
-we support the NS3 and GTNetS simulators.
+or if you want to perform some validation experiments.
-
-\section pls_simgrid_configuration_gtnets GTNetS as a SimGrid model
-
-\subsection pls_simgrid_configuration_gtnets_compile Compiling a patched version of GTNetS
-
-GTNetS needs to be patched to work with SimGrid, so the easiest
-solution is to run the following commands:
-
-\verbatim
-# Get the files that we prepared for you
-svn checkout svn://scm.gforge.inria.fr/svn/simgrid/contrib/trunk/GTNetS/
-cd GTNetS
-
-# Unpack and patch the sources
-unzip gtnets-current.zip
-tar zxvf gtnets-current-patch.tgz
-cd gtnets-current
-cat ../*.patch | patch -p1
-
-# Compile GTNetS
-ln -sf Makefile.linux Makefile
-sed -i 's/-fPIC/-fPIC -fpermissive/g' Makefile
-make depend
-make opt # compile an optimized version (required)
-make debug # compile a debug version (optional)
-
-# Install under /opt
-mkdir -p /opt/gtnets/include /opt/gtnets/lib
-cp -fr SRC/*.h /opt/gtnets/include
-cp libgtsim-opt.so /opt/gtnets/lib/libgtsim.so
-\endverbatim
-
-Some remarks:
-
-<ul>
-
- <li>The patch
- AMD64-FATAL-Removed-DUL_SIZE_DIFF-Added-fPIC-compillin.patch is
- only useful if you want to compile on Itanium 64bits (but should be
- harmless on other architectures). Note that we only provide support
- for Linux so far. Your patches are welcome to improve this ;)</li>
-
- <li>The compilation spits a lot of warnings, but the application
- should compile by the end. If the makefile insists in compiling
- some QT libraries please try a make clean before asking for help.</li>
-
- <li>If you need to use another version of GTNetS, then you will
- probably need to modify the patch. Please drop us a line: we will
- gratefully integrate your work. For the record, the version that we
- provide were downloaded from <a href="http://www.ece.gatech.edu/research/labs/MANIACS/GTNetS/software/gtnets-current.zip">here</a>
- on June 12th, 2008.</li>
-
- <li>Of course you can install GTNets wherever you want on your hard
- disk. We provide the commands for /opt just to help you.</li>
-</ul>
-
-Add the following to your .bashrc so that it gets defined each time:
-
-\verbatim
-export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}/opt/gtnets/lib/
-\endverbatim
-
-\subsection pls_simgrid_configuration_gtnets_config Enabling SimGrid's support for GTNetS
-
-You just have to enable GTNetS in ccmake or cmake as follows, and
-recompile SimGrid.
-
-\verbatim
-cmake . -Denable_gtnets=ON -Dgtnets_path=/opt/gtnets
-\endverbatim
-
-By the end of the configuration, cmake reports whether GTNetS was found.
-You can also double-check by executing the tests after the compilation.
-
-\verbatim
-$ ctest -R gtnets
-(several tests should be run)
-\endverbatim
-
-\subsection pls_simgrid_configuration_gtnets_use Using GTNetS from SimGrid
-
-A working example can be found in the folder examples/msg/gtnets.
-
-\verbatim
-gtnets/gtnets gtnets/onelink-p.xml gtnets/onelink-d.xml --cfg=network/model:GTNets
-\endverbatim
-
-For more information, please refer to the <a
-href="http://www.ece.gatech.edu/research/labs/MANIACS/GTNetS/index.html">GTNetS
-Website</a> or to this
-<a href="http://gforge.inria.fr/docman/view.php/12/6283/GTNetS
-HowTo.html">possibly outdated longer HowTo</a>
+At the moment, we only support the NS3 simulator. Previous versions of
+SimGrid did support the GTNetS simulator and that support could
+possibly be revived by someone who would need it.
\section pls_simgrid_configuration_ns3 NS3 as a SimGrid model
set(xml_files
${xml_files}
${CMAKE_CURRENT_SOURCE_DIR}/crosstraffic-d.xml
- ${CMAKE_CURRENT_SOURCE_DIR}/crosstraffic-p.xml
${CMAKE_CURRENT_SOURCE_DIR}/dogbone-d.xml
${CMAKE_CURRENT_SOURCE_DIR}/dogbone-p.xml
${CMAKE_CURRENT_SOURCE_DIR}/onelink-d.xml
p Testing crosstraffic TCP option DISABLED
-$ gtnets/gtnets ${srcdir:=.}/gtnets/crosstraffic-p.xml ${srcdir:=.}/gtnets/crosstraffic-d.xml --cfg=network/crosstraffic:0
+$ gtnets/gtnets ${srcdir:=.}/../platforms/crosstraffic.xml ${srcdir:=.}/gtnets/crosstraffic-d.xml --cfg=network/crosstraffic:0
> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/crosstraffic' to '0'
> [S1:slave:(8) 103.222884] [msg_test/INFO] ===> Estimated Bw of FLOW[1] : 3229.258106 ; message from S1 to C1 with remaining : 666666.666667
> [S1:slave:(8) 103.222884] [msg_test/INFO] ===> Estimated Bw of FLOW[2] : 3229.258106 ; message from S1 to C1 with remaining : 666666.666667
p Testing crosstraffic TCP option ENABLED
-$ gtnets/gtnets ${srcdir:=.}/gtnets/crosstraffic-p.xml ${srcdir:=.}/gtnets/crosstraffic-d.xml --cfg=network/crosstraffic:1
+$ gtnets/gtnets ${srcdir:=.}/../platforms/crosstraffic.xml ${srcdir:=.}/gtnets/crosstraffic-d.xml --cfg=network/crosstraffic:1
> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/crosstraffic' to '1'
> [C1:slave:(4) 314.563090] [msg_test/INFO] ===> Estimated Bw of FLOW[1] : 3179.012519 ; message from S1 to C1 with remaining : 0.000000
> [C1:slave:(4) 314.563090] [msg_test/INFO] ===> Estimated Bw of FLOW[2] : 3179.012519 ; message from S1 to C1 with remaining : 0.000000
XBT_PUBLIC(void) sg_version(int *major,int *minor,int *patch);
/** Helps ensuring that the header version (SIMGRID_VERSION_MAJOR and friends) and the dynamic library version do match. */
-void sg_version_check(int lib_version_major,int lib_version_minor,int lib_version_patch);
+XBT_PUBLIC(void) sg_version_check(int lib_version_major,int lib_version_minor,int lib_version_patch);
/** Contains all the parameters we got from the command line */
XBT_PUBLIC_DATA(xbt_dynar_t) sg_cmdline;
#include "simgrid_config.h"
+SG_BEGIN_DECL()
+
#include <string.h>
#include <stdlib.h>
#include <stdarg.h> /* va_list */
-SG_BEGIN_DECL()
-
/* They live in asserts.h, but need to be declared before this module.
double declaration to cut dependency cycle */
/**
/** \brief Thread data type (opaque structure) */
typedef struct xbt_os_thread_ *xbt_os_thread_t;
-#include <pthread.h>
#ifdef _XBT_WIN32 /* defined if this is a windows system, 32bits or 64bits) */
#include <windef.h>
typedef DWORD xbt_os_thread_key_t;
#else /* assume that every non-windows system is POSIX-compatible */
+
+#include <pthread.h>
typedef pthread_key_t xbt_os_thread_key_t;
#endif
extern double sg_bandwidth_factor;
extern double sg_weight_S_parameter;
extern int sg_network_crosstraffic;
-#ifdef HAVE_GTNETS
-extern double sg_gtnets_jitter;
-extern int sg_gtnets_jitter_seed;
-#endif
extern xbt_dynar_t surf_path;
typedef enum {
*/
XBT_PUBLIC(void) surf_network_model_init_CM02(void);
-#ifdef HAVE_GTNETS
-/** \ingroup SURF_models
- * \brief Initializes the platform with the network model GTNETS
- *
- * This function is called by surf_host_model_init_GTNETS
- * or by yourself only if you plan using surf_host_model_init_compound
- *
- * \see surf_host_model_init_GTNETS()
- */
-XBT_PUBLIC(void) surf_network_model_init_GTNETS(void);
-#endif
-
#ifdef HAVE_NS3
/** \ingroup SURF_models
* \brief Initializes the platform with the network model NS3
XBT_PUBLIC(void) new_pajeEndLink (double timestamp, container_t container, type_t type, container_t destContainer, const char *value, const char *key);
XBT_PUBLIC(void) new_pajeNewEvent (double timestamp, container_t container, type_t type, val_t value);
-//for tracing gtnets
-void TRACE_surf_gtnets_communicate(void *action, void *src, void *dst);
-
/* from instr_config.c */
int TRACE_needs_platform (void);
int TRACE_is_enabled(void);
--- /dev/null
+/* Copyright (c) 2007-2015. The SimGrid Team.
+ * All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef SIMGRID_MC_FRAME_HPP
+#define SIMGRID_MC_FRAME_HPP
+
+#include <string>
+
+#include "mc_forward.h"
+#include "mc_location.h"
+#include "mc/Variable.hpp"
+#include "mc/Frame.hpp"
+
+namespace simgrid {
+namespace mc {
+
+class Frame {
+public:
+ Frame();
+
+ int tag;
+ std::string name;
+ void *low_pc;
+ void *high_pc;
+ simgrid::mc::LocationList frame_base;
+ std::vector<Variable> variables;
+ unsigned long int id; /* DWARF offset of the subprogram */
+ std::vector<Frame> scopes;
+ unsigned long int abstract_origin_id;
+ simgrid::mc::ObjectInformation* object_info;
+};
+
+inline
+Frame::Frame()
+{
+ this->tag = 0;
+ this->low_pc = nullptr;
+ this->high_pc = nullptr;
+ this->id = 0;
+ this->abstract_origin_id = 0;
+ this->object_info = nullptr;
+}
+
+}
+}
+
+#endif
-/* Copyright (c) 2014-2015. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include <stddef.h>
-
-#include <xbt/dynar.h>
-
-#include "mc_object_info.h"
-#include "mc_private.h"
+#include "mc/Frame.hpp"
+#include "mc/ObjectInformation.hpp"
+#include "mc/Variable.hpp"
namespace simgrid {
namespace mc {
-// Free functions
-
-static void mc_frame_free(void* frame)
-{
- delete (simgrid::mc::Frame*)frame;
-}
-
-static void mc_type_free(void* t)
-{
- delete (simgrid::mc::Type*)t;
-}
-
-// Type
-
-Type::Type()
-{
- this->type = 0;
- this->id = 0;
- this->byte_size = 0;
- this->element_count = 0;
- this->is_pointer_type = 0;
- this->type_id = 0;
- this->subtype = nullptr;
- this->full_type = nullptr;
-}
-
-// Type
-
-Variable::Variable()
-{
- this->dwarf_offset = 0;
- this->global = 0;
- this->type = nullptr;
- this->type_id = 0;
- this->address = nullptr;
- this->start_scope = 0;
- this->object_info = nullptr;
-}
-
-// Frame
-
-Frame::Frame()
-{
- this->tag = 0;
- this->low_pc = nullptr;
- this->high_pc = nullptr;
- this->id = 0;
- this->abstract_origin_id = 0;
- this->object_info = nullptr;
-}
-
-// ObjectInformations
-
ObjectInformation::ObjectInformation()
{
this->flags = 0;
--- /dev/null
+/* Copyright (c) 2007-2015. The SimGrid Team.
+ * All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef SIMGRID_MC_OBJECT_INFORMATION_HPP
+#define SIMGRID_MC_OBJECT_INFORMATION_HPP
+
+#include <string>
+#include <unordered_map>
+#include <vector>
+
+#include "mc/mc_forward.h"
+#include "mc/Type.hpp"
+#include "mc/Frame.hpp"
+
+#include "smpi/private.h"
+
+namespace simgrid {
+namespace mc {
+
+/** An entry in the functions index
+ *
+ * See the code of ObjectInformation::find_function.
+ */
+struct FunctionIndexEntry {
+ void* low_pc;
+ simgrid::mc::Frame* function;
+};
+
+/** Information about an (ELF) executable/sharedobject
+ *
+ * This contain sall the information we have at runtime about an
+ * executable/shared object in the target (modelchecked) process:
+ * - where it is located in the virtual address space;
+ * - where are located it's different memory mapping in the the
+ * virtual address space ;
+ * - all the debugging (DWARF) information,
+ * - location of the functions,
+ * - types
+ * - etc.
+ *
+ * It is not copyable because we are taking pointers to Types/Frames.
+ * We'd have to update/rebuild some data structures in order to copy
+ * successfully.
+ */
+
+class ObjectInformation {
+public:
+ ObjectInformation();
+
+ // Not copyable:
+ ObjectInformation(ObjectInformation const&) = delete;
+ ObjectInformation& operator=(ObjectInformation const&) = delete;
+
+ // Flag:
+ static const int Executable = 1;
+
+ /** Bitfield of flags */
+ int flags;
+ std::string file_name;
+ const void* start;
+ const void *end;
+ char *start_exec;
+ char *end_exec; // Executable segment
+ char *start_rw;
+ char *end_rw; // Read-write segment
+ char *start_ro;
+ char *end_ro; // read-only segment
+ std::unordered_map<std::uint64_t, simgrid::mc::Frame> subprograms;
+ // TODO, remove the mutable (to remove it we'll have to add a lot of const everywhere)
+ mutable std::vector<simgrid::mc::Variable> global_variables;
+ std::unordered_map<std::uint64_t, simgrid::mc::Type> types;
+ std::unordered_map<std::string, simgrid::mc::Type*> full_types_by_name;
+
+ /** Index of functions by IP
+ *
+ * The entries are sorted by low_pc and a binary search can be used to look
+ * them up. Should we used a binary tree instead?
+ */
+ std::vector<FunctionIndexEntry> functions_index;
+
+ bool executable() const
+ {
+ return this->flags & simgrid::mc::ObjectInformation::Executable;
+ }
+
+ bool privatized() const
+ {
+ return this->executable() && smpi_privatize_global_variables;
+ }
+
+ void* base_address() const;
+
+ simgrid::mc::Frame* find_function(const void *ip) const;
+ simgrid::mc::Variable* find_variable(const char* name) const;
+
+};
+
+}
+}
+
+#endif
--- /dev/null
+/* Copyright (c) 2007-2015. The SimGrid Team.
+ * All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef SIMGRID_MC_TYPE_HPP
+#define SIMGRID_MC_TYPE_HPP
+
+#include <vector>
+#include <string>
+
+#include "mc_forward.h"
+#include "mc_location.h"
+
+namespace simgrid {
+namespace mc {
+
+/** Represents a type in the program
+ *
+ * It is currently used to represent members of structs and unions as well.
+ */
+class Type {
+public:
+ Type();
+ Type(Type const& type) = default;
+ Type& operator=(Type const&) = default;
+ Type(Type&& type) = default;
+ Type& operator=(Type&&) = default;
+
+ /** The DWARF TAG of the type (e.g. DW_TAG_array_type) */
+ int type;
+ unsigned id; /* Offset in the section (in hexadecimal form) */
+ std::string name; /* Name of the type */
+ int byte_size; /* Size in bytes */
+ int element_count; /* Number of elements for array type */
+ unsigned type_id; /* DW_AT_type id */
+ std::vector<Type> members; /* if DW_TAG_structure_type, DW_TAG_class_type, DW_TAG_union_type*/
+ int is_pointer_type;
+
+ // Location (for members) is either of:
+ simgrid::mc::DwarfExpression location_expression;
+
+ simgrid::mc::Type* subtype; // DW_AT_type
+ simgrid::mc::Type* full_type; // The same (but more complete) type
+
+ bool has_offset_location() const
+ {
+ return location_expression.size() == 1 &&
+ location_expression[0].atom == DW_OP_plus_uconst;
+ }
+
+ // TODO, check if this shortcut is really necessary
+ int offset() const
+ {
+ xbt_assert(this->has_offset_location());
+ return this->location_expression[0].number;
+ }
+
+ void offset(int new_offset)
+ {
+ Dwarf_Op op;
+ op.atom = DW_OP_plus_uconst;
+ op.number = new_offset;
+ this->location_expression = { op };
+ }
+};
+
+inline
+Type::Type()
+{
+ this->type = 0;
+ this->id = 0;
+ this->byte_size = 0;
+ this->element_count = 0;
+ this->is_pointer_type = 0;
+ this->type_id = 0;
+ this->subtype = nullptr;
+ this->full_type = nullptr;
+}
+
+}
+}
+
+#endif
--- /dev/null
+/* Copyright (c) 2007-2014. The SimGrid Team.
+ * All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef SIMGRID_MC_VARIABLE_HPP
+#define SIMGRID_MC_VARIABLE_HPP
+
+#include <string>
+
+#include "mc_forward.h"
+#include "mc_location.h"
+
+namespace simgrid {
+namespace mc {
+
+class Variable {
+public:
+ Variable();
+
+ unsigned dwarf_offset; /* Global offset of the field. */
+ int global;
+ std::string name;
+ unsigned type_id;
+ simgrid::mc::Type* type;
+
+ // Use either of:
+ simgrid::mc::LocationList location_list;
+ void* address;
+
+ size_t start_scope;
+ simgrid::mc::ObjectInformation* object_info;
+};
+
+inline
+Variable::Variable()
+{
+ this->dwarf_offset = 0;
+ this->global = 0;
+ this->type = nullptr;
+ this->type_id = 0;
+ this->address = nullptr;
+ this->start_scope = 0;
+ this->object_info = nullptr;
+}
+
+}
+}
+
+#endif
#include "mc_smx.h"
#include "mc_hash.hpp"
+#include "mc/ObjectInformation.hpp"
+#include "mc/Frame.hpp"
+#include "mc/Variable.hpp"
+
using simgrid::mc::remote;
extern "C" {
#include "mc_private.h"
#include "mc_smx.h"
+#include "mc/Frame.hpp"
+#include "mc/ObjectInformation.hpp"
+#include "mc/Variable.hpp"
+
#ifdef HAVE_SMPI
#include "smpi/private.h"
#endif
#include "mc/datatypes.h"
#include "mc/mc_private.h"
#include "mc/mc_snapshot.h"
+#include "mc/Type.hpp"
using simgrid::mc::remote;
#include "mc_object_info.h"
#include "mc_private.h"
+#include "mc_process.h"
+
+#include "mc/ObjectInformation.hpp"
+#include "mc/Variable.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_dwarf, mc, "DWARF processing");
// Sort the array by low_pc:
std::sort(info->functions_index.begin(), info->functions_index.end(),
- [](simgrid::mc::FunctionIndexEntry& a,
- simgrid::mc::FunctionIndexEntry& b)
+ [](simgrid::mc::FunctionIndexEntry const& a,
+ simgrid::mc::FunctionIndexEntry const& b)
{
return a.low_pc < b.low_pc;
});
#include "mc_object_info.h"
#include "mc_private.h"
+#include "mc_location.h"
+#include "mc/AddressSpace.hpp"
+#include "mc/Frame.hpp"
+#include "mc/ObjectInformation.hpp"
using simgrid::mc::remote;
/* Warning: autogenerated, do not edit! */
#include <dwarf.h>
+#include <elfutils/libdw.h>
#include <xbt/base.h>
#include "mc_object_info.h"
#ifndef SIMGRID_MC_FORWARD_HPP
#define SIMGRID_MC_FORWARD_HPP
-#ifndef __has_feature
- #define MC_OVERRIDE
-#else
- #if __has_feature(cxx_override_control)
- #define MC_OVERRIDE override
- #else
- #define MC_OVERRIDE
- #endif
-#endif
-
namespace simgrid {
namespace mc {
#include "mc_object_info.h"
#include "mc_private.h"
+#include "mc/Type.hpp"
/** Resolve snapshot in the process address space
*
/* This program 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
- * Debug information for the MC.
- */
-
#ifndef SIMGRID_MC_OBJECT_INFO_H
#define SIMGRID_MC_OBJECT_INFO_H
-#include <cstdint>
-
-#include <string>
#include <vector>
-#include <unordered_map>
-
-#include <simgrid_config.h>
-#include <xbt/dict.h>
-#include <xbt/dynar.h>
+#include <memory>
-#include <elfutils/libdw.h>
+#include <xbt/base.h>
#include "mc_forward.hpp"
-#include "mc_location.h"
-#include "mc_process.h"
-#include "../smpi/private.h"
-
-// ***** Type
-
-namespace simgrid {
-namespace mc {
-
-/** Represents a type in the program
- *
- * It is currently used to represent members of structs and unions as well.
- */
-class Type {
-public:
- Type();
- Type(Type const& type) = default;
- Type& operator=(Type const&) = default;
- Type(Type&& type) = default;
- Type& operator=(Type&&) = default;
-
- /** The DWARF TAG of the type (e.g. DW_TAG_array_type) */
- int type;
- Dwarf_Off id; /* Offset in the section (in hexadecimal form) */
- std::string name; /* Name of the type */
- int byte_size; /* Size in bytes */
- int element_count; /* Number of elements for array type */
- std::uint64_t type_id; /* DW_AT_type id */
- std::vector<Type> members; /* if DW_TAG_structure_type, DW_TAG_class_type, DW_TAG_union_type*/
- int is_pointer_type;
-
- // Location (for members) is either of:
- simgrid::mc::DwarfExpression location_expression;
-
- simgrid::mc::Type* subtype; // DW_AT_type
- simgrid::mc::Type* full_type; // The same (but more complete) type
-
- bool has_offset_location() const
- {
- return location_expression.size() == 1 &&
- location_expression[0].atom == DW_OP_plus_uconst;
- }
-
- // TODO, check if this shortcut is really necessary
- int offset() const
- {
- xbt_assert(this->has_offset_location());
- return this->location_expression[0].number;
- }
-
- void offset(int new_offset)
- {
- Dwarf_Op op;
- op.atom = DW_OP_plus_uconst;
- op.number = new_offset;
- this->location_expression = { op };
- }
-};
-
-}
-}
-
-// ***** Object info
-
-namespace simgrid {
-namespace mc {
-
-class Variable {
-public:
- Variable();
-
- Dwarf_Off dwarf_offset; /* Global offset of the field. */
- int global;
- std::string name;
- std::uint64_t type_id;
- simgrid::mc::Type* type;
-
- // Use either of:
- simgrid::mc::LocationList location_list;
- void* address;
-
- size_t start_scope;
- simgrid::mc::ObjectInformation* object_info;
-};
-
-class Frame {
-public:
- Frame();
-
- int tag;
- std::string name;
- void *low_pc;
- void *high_pc;
- simgrid::mc::LocationList frame_base;
- std::vector<Variable> variables;
- unsigned long int id; /* DWARF offset of the subprogram */
- std::vector<Frame> scopes;
- Dwarf_Off abstract_origin_id;
- simgrid::mc::ObjectInformation* object_info;
-};
-
-/** An entry in the functions index
- *
- * See the code of ObjectInformation::find_function.
- */
-struct FunctionIndexEntry {
- void* low_pc;
- simgrid::mc::Frame* function;
-};
-
-/** Information about an (ELF) executable/sharedobject
- *
- * This contain sall the information we have at runtime about an
- * executable/shared object in the target (modelchecked) process:
- * - where it is located in the virtual address space;
- * - where are located it's different memory mapping in the the
- * virtual address space ;
- * - all the debugging (DWARF) information,
- * - location of the functions,
- * - types
- * - etc.
- *
- * It is not copyable because we are taking pointers to Types/Frames.
- * We'd have to update/rebuild some data structures in order to copy
- * successfully.
- */
-
-class ObjectInformation {
-public:
- ObjectInformation();
-
- // Not copyable:
- ObjectInformation(ObjectInformation const&) = delete;
- ObjectInformation& operator=(ObjectInformation const&) = delete;
-
- // Flag:
- static const int Executable = 1;
-
- /** Bitfield of flags */
- int flags;
- std::string file_name;
- const void* start;
- const void *end;
- char *start_exec;
- char *end_exec; // Executable segment
- char *start_rw;
- char *end_rw; // Read-write segment
- char *start_ro;
- char *end_ro; // read-only segment
- std::unordered_map<std::uint64_t, simgrid::mc::Frame> subprograms;
- // TODO, remove the mutable (to remove it we'll have to add a lot of const everywhere)
- mutable std::vector<simgrid::mc::Variable> global_variables;
- std::unordered_map<std::uint64_t, simgrid::mc::Type> types;
- std::unordered_map<std::string, simgrid::mc::Type*> full_types_by_name;
-
- /** Index of functions by IP
- *
- * The entries are sorted by low_pc and a binary search can be used to look
- * them up. Should we used a binary tree instead?
- */
- std::vector<FunctionIndexEntry> functions_index;
-
- bool executable() const
- {
- return this->flags & simgrid::mc::ObjectInformation::Executable;
- }
-
- bool privatized() const
- {
- return this->executable() && smpi_privatize_global_variables;
- }
-
- void* base_address() const;
-
- simgrid::mc::Frame* find_function(const void *ip) const;
- simgrid::mc::Variable* find_variable(const char* name) const;
-
-};
-
-}
-}
-
+#include "mc_memory_map.h"
XBT_INTERNAL std::shared_ptr<simgrid::mc::ObjectInformation> MC_find_object_info(
std::vector<simgrid::mc::VmMap> const& maps, const char* name, int executable);
XBT_INTERNAL void MC_dwarf_get_variables(simgrid::mc::ObjectInformation* info);
XBT_INTERNAL void MC_dwarf_get_variables_libdw(simgrid::mc::ObjectInformation* info);
+
XBT_INTERNAL const char* MC_dwarf_attrname(int attr);
XBT_INTERNAL const char* MC_dwarf_tagname(int tag);
#include "mc_process.h"
#include "mc_object_info.h"
-#include "AddressSpace.hpp"
#include "mc_unw.h"
#include "mc_snapshot.h"
#include "mc_ignore.h"
#include "mc_smx.h"
#include "mc_server.h"
+#include "mc/AddressSpace.hpp"
+#include "mc/ObjectInformation.hpp"
+#include "mc/Variable.hpp"
+
using simgrid::mc::remote;
extern "C" {
// Read memory:
const void* read_bytes(void* buffer, std::size_t size,
remote_ptr<void> address, int process_index = ProcessIndexAny,
- ReadMode mode = Normal) const MC_OVERRIDE;
+ ReadMode mode = Normal) const override;
void read_variable(const char* name, void* target, size_t size) const;
template<class T>
T read_variable(const char *name) const
~Snapshot();
const void* read_bytes(void* buffer, std::size_t size,
remote_ptr<void> address, int process_index = ProcessIndexAny,
- ReadMode mode = Normal) const MC_OVERRIDE;
+ ReadMode mode = Normal) const override;
public: // To be private
simgrid::mc::Process* process;
int num_state;
#include "mc_object_info.h"
#include "mc_process.h"
#include "mc_unw.h"
+#include "mc/Frame.hpp"
using simgrid::mc::remote;
#include "mc/mc_protocol.h"
#include "mc/mc_client.h"
+#include "mc/Frame.hpp"
+#include "mc/Variable.hpp"
+#include "mc/ObjectInformation.hpp"
+
extern "C" {
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mcer_ignore, mc,
sg_network_crosstraffic = xbt_cfg_get_boolean(_sg_cfg_set, name);
}
-#ifdef HAVE_GTNETS
-static void _sg_cfg_cb__gtnets_jitter(const char *name, int pos)
-{
- sg_gtnets_jitter = xbt_cfg_get_double(_sg_cfg_set, name);
-}
-
-static void _sg_cfg_cb__gtnets_jitter_seed(const char *name, int pos)
-{
- sg_gtnets_jitter_seed = xbt_cfg_get_int(_sg_cfg_set, name);
-}
-#endif
-
/* build description line with possible values */
static void describe_model(char *result,
const s_surf_model_description_t model_description[],
xbt_cfgelm_boolean, 1, 1, _sg_cfg_cb__surf_network_crosstraffic, NULL);
xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/crosstraffic", "no");
-#ifdef HAVE_GTNETS
- xbt_cfg_register(&_sg_cfg_set, "gtnets/jitter",
- "Double value to oscillate the link latency, uniformly in random interval [-latency*gtnets_jitter,latency*gtnets_jitter)",
- xbt_cfgelm_double, 1, 1, _sg_cfg_cb__gtnets_jitter, NULL);
- xbt_cfg_setdefault_double(_sg_cfg_set, "gtnets/jitter", 0.0);
-
- xbt_cfg_register(&_sg_cfg_set, "gtnets/jitter_seed",
- "Use a positive seed to reproduce jitted results, value must be in [1,1e8], default is 10",
- xbt_cfgelm_int, 0, 1, _sg_cfg_cb__gtnets_jitter_seed, NULL);
- xbt_cfg_setdefault_int(_sg_cfg_set, "gtnets/jitter_seed", 10);
-#endif
#ifdef HAVE_NS3
xbt_cfg_register(&_sg_cfg_set, "ns3/TcpModel",
"The ns3 tcp model can be : NewReno or Reno or Tahoe",
#ifndef _XBT_WIN32
if (mprotect(stack, smx_context_guard_size, PROT_NONE) == -1) {
- XBT_WARN("Failed to protect stack: %s", strerror(errno));
- /* That's not fatal, pursue anyway. */
+ xbt_die("Failed to protect stack: %s", strerror(errno));
+ /* This is fatal. We are going to fail at some point when
+ we tryi reusing this. */
}
#endif
stack = (char *)stack + smx_context_guard_size;
if (smx_context_guard_size > 0 && !MC_is_active()) {
stack = (char *)stack - smx_context_guard_size;
if (mprotect(stack, smx_context_guard_size,
- PROT_READ | PROT_WRITE | PROT_EXEC) == -1) {
+ PROT_READ | PROT_WRITE) == -1) {
XBT_WARN("Failed to remove page protection: %s", strerror(errno));
/* try to pursue anyway */
}
double SIMIX_host_get_speed(sg_host_t host);
double SIMIX_host_get_available_speed(sg_host_t host);
int SIMIX_host_get_state(sg_host_t host);
-void SIMIX_host_on(sg_host_t host);
-void SIMIX_host_off(sg_host_t host, smx_process_t issuer);
double SIMIX_host_get_current_power_peak(sg_host_t host);
double SIMIX_host_get_power_peak_at(sg_host_t host, int pstate_index);
int SIMIX_host_get_nb_pstates(sg_host_t host);
void SIMIX_process_execution_set_priority(smx_synchro_t synchro, double priority);
void SIMIX_process_execution_set_bound(smx_synchro_t synchro, double bound);
void SIMIX_process_execution_set_affinity(smx_synchro_t synchro, sg_host_t host, unsigned long mask);
-xbt_dict_t SIMIX_host_get_mounted_storage_list(sg_host_t host);
xbt_dynar_t SIMIX_host_get_attached_storage_list(sg_host_t host);
void SIMIX_host_execution_suspend(smx_synchro_t synchro);
xbt_dict_t SIMIX_storage_get_properties(smx_storage_t storage);
-xbt_dict_t SIMIX_storage_get_content(smx_storage_t storage);
-
void SIMIX_post_io(smx_synchro_t synchro);
void SIMIX_io_destroy(smx_synchro_t synchro);
void SIMIX_io_finish(smx_synchro_t synchro);
XBT_PUBLIC_DATA(smx_global_t) simix_global;
extern unsigned long simix_process_maxpid;
-extern xbt_dict_t watched_hosts_lib;
-
XBT_PUBLIC(void) SIMIX_clean(void);
/******************************** Exceptions *********************************/
+++ /dev/null
-/* Copyright (c) 2007-2011, 2014. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "gtnets_simulator.h"
-#include "gtnets_interface.h"
-#ifdef XBT_DEBUG
- #undef XBT_DEBUG
-#endif
-#include "xbt/log.h"
-#include "xbt/asserts.h"
-
-static GTSim* gtnets_sim = 0;
-
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network_gtnets_interface, surf_network_gtnets,
- "Logging specific to the SURF network GTNetS interface");
-
-
-
-// initialize the GTNetS interface and environment
-int gtnets_initialize(int wsize){
- XBT_DEBUG("Using logging.");
- xbt_assert(!gtnets_sim, "gtnets already initialized");
-
- if(wsize > 0){
- XBT_INFO("TCP window maximum size : %d", wsize);
- gtnets_sim = new GTSim(wsize);
- }else{
- gtnets_sim = new GTSim(wsize);
- }
-
- return 0;
-}
-
-// add a link (argument link is just an index starting at 0...
-// add link 0, add link 1, etc.)
-int gtnets_add_link(int id, double bandwidth, double latency){
- return gtnets_sim->add_link(id, bandwidth, latency);
-}
-
-// add a route between a source and a destination as an array of link indices
-// (note that there is no gtnets_add_network_card(), as we discover them
-// on the fly via calls to gtnets_add_route()
-int gtnets_add_route(int src, int dst, int* links, int nlink){
- return gtnets_sim->add_route(src, dst, links, nlink);
-}
-
-// add a router
-int gtnets_add_router(int id){
- return gtnets_sim->add_router(id);
-}
-
-// add a route between a source and a destination as an array of link indices
-// (note that there is no gtnets_add_network_card(), as we discover them
-// on the fly via calls to gtnets_add_route()
-int gtnets_add_onehop_route(int src, int dst, int link){
- return gtnets_sim->add_onehop_route(src, dst, link);
-}
-
-// create a new flow on a route
-// one can attach arbitrary metadata to a flow
-int gtnets_create_flow(int src, int dst, long datasize, void* metadata){
- return gtnets_sim->create_flow(src, dst, datasize, metadata);
-}
-
-// get the time (double) until a flow completes (the first such flow)
-// if no flows exist, return -1.0
-double gtnets_get_time_to_next_flow_completion(){
- ofstream file;
- streambuf* sbuf;
- double value;
-
- if (!XBT_LOG_ISENABLED(surf_network_gtnets_interface, xbt_log_priority_debug)) {
- file.open ("/dev/null");
- sbuf = cout.rdbuf();
- cout.rdbuf(file.rdbuf());
- XBT_DEBUG("Enable GTNetS library quite mode");
- }else {
- XBT_DEBUG("Disable GTNetS library quite mode");
- }
-
- value = gtnets_sim->get_time_to_next_flow_completion();
-
- if (!XBT_LOG_ISENABLED(surf_network_gtnets_interface, xbt_log_priority_debug)) {
- cout.rdbuf(sbuf);
- file.close();
- }
- return value;
-}
-
-// run until a flow completes (returns that flow's metadata)
-double gtnets_run_until_next_flow_completion(void ***metadata, int *number_of_flows){
- ofstream file;
- streambuf* sbuf;
- double value;
-
- if (!XBT_LOG_ISENABLED(surf_network_gtnets_interface, xbt_log_priority_debug)) {
- file.open ("/dev/null");
- sbuf = cout.rdbuf();
- cout.rdbuf(file.rdbuf());
- XBT_DEBUG("Enable GTNetS library quite mode");
- }else {
- XBT_DEBUG("Disable GTNetS library quite mode");
- }
-
- value = gtnets_sim->run_until_next_flow_completion(metadata, number_of_flows);
-
- if (!XBT_LOG_ISENABLED(surf_network_gtnets_interface, xbt_log_priority_debug)) {
- cout.rdbuf(sbuf);
- file.close();
- }
- return (double) value;
-}
-
-// get the total received in bytes using the TCPServer object totRx field
-double gtnets_get_flow_rx(void *metadata){
- return gtnets_sim->gtnets_get_flow_rx(metadata);
-}
-
-
-// run for a given time (double)
-int gtnets_run(Time_t deltat){
- ofstream file;
- streambuf* sbuf;
- double value;
-
- if (!XBT_LOG_ISENABLED(surf_network_gtnets_interface, xbt_log_priority_debug)) {
- file.open ("/dev/null");
- sbuf = cout.rdbuf();
- cout.rdbuf(file.rdbuf());
- XBT_DEBUG("Enable GTNetS library quite mode");
- }else {
- XBT_DEBUG("Disable GTNetS library quite mode");
- }
-
- gtnets_sim->run(deltat);
-
-
- if (!XBT_LOG_ISENABLED(surf_network_gtnets_interface, xbt_log_priority_debug)) {
- cout.rdbuf(sbuf);
- file.close();
- }
- return 0;
-}
-
-// clean up
-int gtnets_finalize(){
- if (!gtnets_sim) return -1;
- delete gtnets_sim;
- gtnets_sim = 0;
- return 0;
-}
-
-// print topology
-void gtnets_print_topology(void){
- gtnets_sim->print_topology();
-}
-
-// set jitter
-void gtnets_set_jitter(double d){
- gtnets_sim->set_jitter(d);
-}
-
-// set jitter seed
-void gtnets_set_jitter_seed(int seed){
- gtnets_sim->set_jitter_seed(seed);
-}
-
-
+++ /dev/null
-/* Copyright (c) 2007-2010, 2013-2014. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-// Interface for GTNetS.
-#ifndef _GTNETS_INTERFACE_H
-#define _GTNETS_INTERFACE_H
-
-#include "xbt/misc.h" /* SG_{BEGIN,END}_DECL() */
-
-SG_BEGIN_DECL()
-
-int gtnets_initialize(int wsize);
-int gtnets_add_link(int id, double bandwidth, double latency);
-int gtnets_add_route(int src, int dst, int *links, int nlink);
-int gtnets_add_router(int id);
-int gtnets_add_onehop_route(int src, int dst, int link);
-int gtnets_create_flow(int src, int dst, long datasize, void *metadata);
-double gtnets_get_time_to_next_flow_completion();
-double gtnets_run_until_next_flow_completion(void ***metadata,
- int *number_of_flows);
-double gtnets_get_flow_rx(void *metadata);
-
-void gtnets_print_topology(void);
-
-int gtnets_run(double delta);
-int gtnets_finalize();
-void gtnets_set_jitter(double);
-void gtnets_set_jitter_seed(int);
-
-SG_END_DECL()
-
-#endif
+++ /dev/null
-/* Copyright (c) 2007-2011, 2014. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "gtnets_simulator.h"
-#include "gtnets_topology.h"
-#include <map>
-#include <vector>
-#ifdef XBT_DEBUG
- #undef XBT_DEBUG
-#endif
-#include "xbt/log.h"
-#include "xbt/asserts.h"
-#include "RngStream.h"
-#include <unistd.h> /* pipe */
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network_gtnets_simulator, surf_network_gtnets,
- "Logging specific to the SURF network GTNetS simulator");
-
-
-using namespace std;
-
-static vector<void*> meta_flows;
-static int* meta_nflow;
-static int meta_flg = 0;
-
-
-void static tcp_sent_callback(void* action, double completion_time);
-
-
-// Constructor.
-// TODO: check the default values.
-GTSim::GTSim(int WindowSize){
- int wsize = WindowSize;
- is_topology_ = 0;
- nflow_ = 0;
- jitter_ = 0;
- jitter_seed_ = 10;
-
- // EXTRACTED FROM GTNETS SOURCE CODE COMMENTS
- // REDQueue::REDQueue(
- // DCount_t in_w_q, Count_t in_min_th, Count_t in_max_th,
- // Count_t in_limit, DCount_t in_max_p, Count_t in_mean_pktsize) : iface(nil)
- // Set default values.
- //Doc:Desc This constructor the critical RED parameters and builds a
- //Doc:Desc correspoding RED queue
- //Doc:Arg1 weight of the queue
- //Doc:Arg2 minimum threshold
- //Doc:Arg3 maximum threshold
- //Doc:Arg4 Limit/max size for the queue
- //Doc:Arg5 maximum value for mark/drop probability
- //Doc:Arg6 Average packet size
-
- //Default Parameters
- //REDQueue *default_red_queue_ = new REDQueue(0.002, 2500, 7500, 30000, 0.10, 500);
- //Same as above
- //REDQueue *default_red_queue_ = new REDQueue();
-
- //See for details of how those values are calucated below
- //[1] Sally Floyd and Van Jacobson, "Random Early Detection Gateways with Congestion Avoidance",
- // IEEE/ACM Transactions on Networking, vol. 1, n. 4, august 1993.
- //
- //[2] Kostas Pentikousis, "Active Queue Management", ACM Crossroads, vol. 7, n. 5,
- // mid-summer 2001
- //
- //[3] Stefann De Cnodder, Omar Ecoumi, Kenny Paulwels, "RED behavior with different packet sizes",
- // 5th IEEE Symposium on Computers and Communication, (ISCC 2000)
- //
- //[4] http://www.opalsoft.net/qos/DS-26.htm
- //
- //short explanation:
- // q_weight = fixed to 0.002 in most literature
- // min_bytes = max / 3 = 16,666,666
- // max_bytes = mean_bw * max_tolerable_latency, set to 1e8 * 0.5 = 50,000,000
- // limit_bytes = 8 * max = 400,000,000
- // prob = follow most literature 0.02
- // avgpkt = fixed to the same TCP segment size, 1000 Bytes
- //
- // burst = (2*(min+max))/(3*avgpkt) ***DON'T USED BY GTNetS***
- REDQueue *default_red_queue_ = new REDQueue(0.002, 16666666, 50000000, 400000000, 0.02, 1000);
-
- Queue::Default(*default_red_queue_);
- delete default_red_queue_;
-
- TCP::DefaultAdvWin(wsize);
- TCP::DefaultSegSize(1000);
- TCP::DefaultTxBuffer(128000);
- TCP::DefaultRxBuffer(128000);
-
- sim_ = new Simulator();
- sim_->verbose=false;
- topo_ = new GTNETS_Topology();
-
- // Manual routing
- rm_ = new RoutingManual();
- Routing::SetRouting(rm_);
-}
-
-// Constructor.
-// TODO: check the default values.
-GTSim::GTSim(){
- int wsize = 20000;
- is_topology_ = 0;
- nflow_ = 0;
- jitter_ = 0;
- jitter_seed_ = 10;
-
- // EXTRACTED FROM GTNETS SOURCE CODE COMMENTS
- // REDQueue::REDQueue(
- // DCount_t in_w_q, Count_t in_min_th, Count_t in_max_th,
- // Count_t in_limit, DCount_t in_max_p, Count_t in_mean_pktsize) : iface(nil)
- // Set default values.
- //Doc:Desc This constructor the critical RED parameters and builds a
- //Doc:Desc correspoding RED queue
- //Doc:Arg1 weight of the queue
- //Doc:Arg2 minimum threshold
- //Doc:Arg3 maximum threshold
- //Doc:Arg4 Limit/max size for the queue
- //Doc:Arg5 maximum value for mark/drop probability
- //Doc:Arg6 Average packet size
-
- //Default Parameters
- //REDQueue *default_red_queue_ = new REDQueue(0.002, 2500, 7500, 30000, 0.10, 500);
- //Same as above
- //REDQueue *default_red_queue_ = new REDQueue();
-
- //See for details of how those values are calucated below
- //[1] Sally Floyd and Van Jacobson, "Random Early Detection Gateways with Congestion Avoidance",
- // IEEE/ACM Transactions on Networking, vol. 1, n. 4, august 1993.
- //
- //[2] Kostas Pentikousis, "Active Queue Management", ACM Crossroads, vol. 7, n. 5,
- // mid-summer 2001
- //
- //[3] Stefann De Cnodder, Omar Ecoumi, Kenny Paulwels, "RED behavior with different packet sizes",
- // 5th IEEE Symposium on Computers and Communication, (ISCC 2000)
- //
- //[4] http://www.opalsoft.net/qos/DS-26.htm
- //
- //short explanation:
- // q_weight = fixed to 0.002 in most literature
- // min_bytes = max / 3 = 16,666,666
- // max_bytes = mean_bw * max_tolerable_latency, set to 1e8 * 0.5 = 50,000,000
- // limit_bytes = 8 * max = 400,000,000
- // prob = follow most literature 0.02
- // avgpkt = fixed to the same TCP segment size, 1000 Bytes
- //
- // burst = (2*(min+max))/(3*avgpkt) ***DON'T USED BY GTNetS***
- REDQueue *default_red_queue_ = new REDQueue(0.002, 16666666, 50000000, 400000000, 0.02, 1000);
-
- Queue::Default(*default_red_queue_);
- delete default_red_queue_;
-
- TCP::DefaultAdvWin(wsize);
- TCP::DefaultSegSize(1000);
- TCP::DefaultTxBuffer(128000);
- TCP::DefaultRxBuffer(128000);
-
- sim_ = new Simulator();
- sim_->verbose=false;
- topo_ = new GTNETS_Topology();
-
- // Manual routing
- rm_ = new RoutingManual();
- Routing::SetRouting(rm_);
-}
-
-GTSim::~GTSim(){
-
- map<int, Linkp2p*>::iterator it;
- for (it = gtnets_links_.begin(); it != gtnets_links_.end(); it++){
- delete it->second;
- }
- while (!gtnets_links_.empty())
- gtnets_links_.erase(gtnets_links_.begin());
-
- map<int, Uniform*>::iterator it2;
- for (it2 = uniform_jitter_generator_.begin(); it2 != uniform_jitter_generator_.end(); it2++){
- delete it2->second;
- }
- while (!uniform_jitter_generator_.empty())
- uniform_jitter_generator_.erase(uniform_jitter_generator_.begin());
-
- map<int, Node*>::iterator it3;
- for (it3 = gtnets_nodes_.begin(); it3 != gtnets_nodes_.end(); it3++){
- delete it3->second;
- }
- while (!gtnets_nodes_.empty())
- gtnets_nodes_.erase(gtnets_nodes_.begin());
-
- map<int, TCPServer*>::iterator it4;
- for (it4 = gtnets_servers_.begin(); it4 != gtnets_servers_.end(); it4++){
- delete it4->second;
- }
- while (!gtnets_servers_.empty())
- gtnets_servers_.erase(gtnets_servers_.begin());
-
- map<int, TCPSend*>::iterator it5;
- for (it5 = gtnets_clients_.begin(); it5 != gtnets_clients_.end(); it5++){
- delete it5->second;
- }
- while (!gtnets_clients_.empty())
- gtnets_clients_.erase(gtnets_clients_.begin());
-
- is_topology_ = 0;
- delete sim_;
- delete topo_;
- delete rm_;
- sim_ = 0;
- topo_ = 0;
- rm_ = 0;
-}
-
-int GTSim::add_router(int id){
- xbt_assert(!(topo_->add_router(id) < 0), "can't add router %d. already exists", id);
-}
-
-//bandwidth: in bytes.
-//latency: in seconds.
-int GTSim::add_link(int id, double bandwidth, double latency){
- double bw = bandwidth * 8; //Bandwidth in bits (used in GTNETS).
- xbt_assert(!(topo_->add_link(id) < 0),"Can't add link %d. already exists", id);
- XBT_DEBUG("Creating a new P2P, linkid %d, bandwidth %gl, latency %gl", id, bandwidth, latency);
- gtnets_links_[id] = new Linkp2p(bw, latency);
- if(jitter_ > 0){
- XBT_DEBUG("Using jitter %f, and seed %u", jitter_, jitter_seed_);
- double min = -1*jitter_*latency;
- double max = jitter_*latency;
- uniform_jitter_generator_[id] = new Uniform(min,max);
- gtnets_links_[id]->Jitter((const Random &) *(uniform_jitter_generator_[id]));
- }
- return 0;
-}
-
-// if gtnets_nodes_ includes id, return true, otherwise return false.
-bool GTSim::node_include(int id){
- if (gtnets_nodes_.find(id) != gtnets_nodes_.end()) return true;
- else return false;
-}
-
-// if gtnets_link_ includes id, return true, otherwise return false.
-bool GTSim::link_include(int id){
- if (gtnets_links_.find(id) != gtnets_links_.end()) return true;
- else return false;
-}
-
-int GTSim::add_onehop_route(int src, int dst, int link){
- xbt_assert(!(topo_->add_onehop_route(src, dst, link) < 0), "Cannot add a route, src: %d, dst: %d, link: %d", src, dst, link);
- return 0;
-}
-
-// Generate the gtnets nodes according to topo_.
-void GTSim::add_nodes(){
- static unsigned int address = IPAddr("192.168.0.1");
- IPAddr helper = IPAddr();
- vector<GTNETS_Node*> nodes = topo_->nodes();
- vector<GTNETS_Node*>::iterator it;
- int id;
- for (it = nodes.begin(); it != nodes.end(); it++){
- id = (*it)->id();
- gtnets_nodes_[id] = new Node();
- gtnets_nodes_[id]->SetIPAddr(address++);
- XBT_DEBUG("In GTSim, add_node: %d, with IPAddr %s", id, helper.ToDotted(address-1));
-
- }
-}
-
-void GTSim::node_connect(){
-
- map<int, GTNETS_Link*> links = topo_->links();
- map<int, GTNETS_Link*>::iterator it;
- int linkid, srcid, dstid;
- for (it = links.begin(); it != links.end(); it++){
- linkid = it->second->id();
- //if link is used in a route, connect the two nodes.
- if (it->second->src_node() && it->second->dst_node()){
-
- srcid = it->second->src_node()->id();
- dstid = it->second->dst_node()->id();
-
- gtnets_nodes_[srcid]->
- AddDuplexLink(gtnets_nodes_[dstid], *(gtnets_links_[linkid]));
- XBT_DEBUG("Setting DuplexLink, src %d, dst %d, linkid %d", srcid, dstid, linkid);
- }
- }
-}
-
-// Create nodes and routes from the temporary topology, GTNETS_Topolgy.
-void GTSim::create_gtnets_topology(){
- add_nodes();
- node_connect();
-}
-
-void GTSim::print_topology(){
- topo_->print_topology();
-}
-
-// Add a route that includes more than one hop. All one hop
-// routes must have been added. When this function is called
-// for the first time, all gtnets nodes are generated.
-int GTSim::add_route(int src, int dst, int* links, int nlink){
- if (is_topology_ == 0){
- create_gtnets_topology();
- is_topology_ = 1;
- }
-
- IPAddr_t mymask = IPAddr("255.255.255.255");
-
- int src_node = topo_->nodeid_from_hostid(src);
- int dst_node = topo_->nodeid_from_hostid(dst);
-
- xbt_assert(!(gtnets_nodes_.find(src_node) == gtnets_nodes_.end()), "Node %d not found", src_node);
- xbt_assert(!(gtnets_nodes_.find(dst_node) == gtnets_nodes_.end()), "Node %d not found", dst_node);
-
- Node* tmpsrc = gtnets_nodes_[src_node];
- Node* tmpdst = gtnets_nodes_[dst_node];
-
- int next_node, cur_node;
-
- cur_node = src_node;
- for (int i = 0; i < nlink; i++){
- xbt_assert(!(gtnets_nodes_.find(cur_node) == gtnets_nodes_.end()), "Node %d not found", cur_node);
- next_node = topo_->peer_node_id(links[i], cur_node);
- xbt_assert(!(next_node < 0), "Peer node not found");
- xbt_assert(!(gtnets_nodes_.find(next_node) == gtnets_nodes_.end()), "Node %d not found", next_node);
-
- //add route
- Node* tmpcur = gtnets_nodes_[cur_node];
- Node* tmpnext = gtnets_nodes_[next_node];
-
- tmpcur->AddRoute(tmpdst->GetIPAddr(),
- mymask,
- tmpcur->GetIfByNode(tmpnext),
- tmpnext->GetIPAddr());
-
- tmpnext->AddRoute(tmpsrc->GetIPAddr(),
- mymask,
- tmpnext->GetIfByNode(tmpcur),
- tmpcur->GetIPAddr());
-
- cur_node = next_node;
- }
-
- xbt_assert(!(cur_node != dst_node), "Route inconsistency, last: %d, dst: %d",cur_node, dst_node);
-
- return 0;
-}
-
-
-
-int GTSim::create_flow(int src, int dst, long datasize, void* metadata){
- //if no route with more than one links, topology has not been generated.
- //generate it here.
- if (is_topology_ == 0){
- create_gtnets_topology();
- is_topology_ = 1;
- }
-
- int src_node = topo_->nodeid_from_hostid(src);
- xbt_assert(!(src_node < 0), "Src %d not found", src_node);
-
- int dst_node = topo_->nodeid_from_hostid(dst);
- xbt_assert(!(dst_node < 0), "Dst %d not found", dst_node);
-
- gtnets_servers_[nflow_] = (TCPServer*) gtnets_nodes_[dst_node]->
- AddApplication(TCPServer(TCPReno()));
- gtnets_servers_[nflow_]->BindAndListen(1000+nflow_);
-
- gtnets_clients_[nflow_] = (TCPSend*)gtnets_nodes_[src_node]->
- AddApplication(TCPSend(metadata, gtnets_nodes_[dst_node]->GetIPAddr(),
- 1000+nflow_, Constant(datasize), TCPReno()));
- gtnets_clients_[nflow_]->SetSendCallBack(tcp_sent_callback);
- gtnets_clients_[nflow_]->Start(0);
-
- gtnets_action_to_flow_[metadata] = nflow_;
- nflow_++;
-
- return 0;
-}
-
-Time_t GTSim::get_time_to_next_flow_completion(){
- int status;
- Time_t t1;
- int pfds[2];
- int soon_pid=-1;
- meta_flg=0;
-
- //remain needs to be updated in the future
- Count_t remain;
-
- pipe(pfds);
-
- t1 = 0;
- fflush (NULL);
- if( (soon_pid=fork()) != 0){
- read(pfds[0], &t1, sizeof(Time_t));
- waitpid(soon_pid, &status, 0);
- }else{
- Time_t t;
- t = sim_->RunUntilNextCompletion();
- write(pfds[1], (const void*)&t, sizeof(Time_t));
- exit(0);
- }
-
- return t1;
-}
-
-double GTSim::gtnets_get_flow_rx(void *metadata){
- int flow_id = gtnets_action_to_flow_[metadata];
- return gtnets_servers_[flow_id]->GetTotRx();
-}
-
-
-int GTSim::run_until_next_flow_completion(void ***metadata, int *number_of_flows){
-
- meta_flows.clear();
- meta_nflow = number_of_flows;
- meta_flg = 1;
-
- Time_t t1 = sim_->RunUntilNextCompletion();
-
- *metadata = (meta_flows.empty() ? NULL : &meta_flows[0]);
- return 0;
-}
-
-int GTSim::run(double delta){
- meta_flg=0;
- sim_->Run(delta);
- return 0;
-}
-
-void GTSim::set_jitter(double d){
- xbt_assert(((0 <= d)&&(d <= 1)), "The jitter value must be within interval [0.0;1.0), got %f", d);
- jitter_ = d;
-}
-
-void GTSim::set_jitter_seed(int s){
- jitter_seed_ = s;
-
- if(jitter_seed_ > 0.0){
- XBT_INFO("Setting the jitter_seed with %d", jitter_seed_ );
- Random::GlobalSeed(jitter_seed_ , jitter_seed_ , jitter_seed_ ,jitter_seed_ ,jitter_seed_ ,jitter_seed_);
- }
-}
-
-void static tcp_sent_callback(void* action, double completion_time){
- // Schedule the flow complete event.
- SimulatorEvent* e =
- new SimulatorEvent(SimulatorEvent::FLOW_COMPLETE);
- Simulator::instance->Schedule(e, 0, Simulator::instance);
-
- if (meta_flg){
- meta_flows.push_back(action);
- (*meta_nflow)++;
- }
-}
-
-
+++ /dev/null
-/* Copyright (c) 2007-2010, 2013-2014. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef _GTNETS_SIM_H
-#define _GTNETS_SIM_H
-
-#ifdef __cplusplus
-#include "gtnets_topology.h"
-
-#include <iostream>
-#include <sys/wait.h>
-#include <map>
-
-//GTNetS include files
-#include "simulator.h" // Definitions for the Simulator Object
-#include "node.h" // Definitions for the Node Object
-#include "linkp2p.h" // Definitions for point-to-point link objects
-#include "ratetimeparse.h" // Definitions for Rate and Time objects
-#include "application-tcpserver.h" // Definitions for TCPServer application
-#include "application-tcpsend.h" // Definitions for TCP Sending application
-#include "tcp-tahoe.h" // Definitions for TCP Tahoe
-#include "tcp-reno.h"
-#include "tcp-newreno.h"
-#include "event.h"
-#include "routing-manual.h"
-#include "red.h"
-
-using namespace std;
-
-//Simulator s;
-class GTSim {
-
-public:
- GTSim();
- GTSim(int WindowSize);
- ~GTSim();
-public:
- int add_link(int id, double bandwidth, double latency);
- int add_onehop_route(int src, int dst, int link);
- int add_route(int src, int dst, int *links, int nlink);
- int add_router(int id);
- int create_flow(int src, int dst, long datasize, void *metadata);
- double get_time_to_next_flow_completion();
- int run_until_next_flow_completion(void ***metadata,
- int *number_of_flows);
- int run(double deltat);
- // returns the total received by the TCPServer peer of the given action
- double gtnets_get_flow_rx(void *metadata);
- void create_gtnets_topology();
- void print_topology();
- void set_jitter(double);
- void set_jitter_seed(int);
-private:
- void add_nodes();
- void node_connect();
-
- bool node_include(int);
- bool link_include(int);
- Simulator *sim_;
- GTNETS_Topology *topo_;
- RoutingManual *rm_;
- REDQueue *red_queue_;
- int nnode_;
- int is_topology_;
- int nflow_;
- double jitter_;
- int jitter_seed_;
- map < int, Uniform * >uniform_jitter_generator_;
-
- map < int, TCPServer * >gtnets_servers_;
- map < int, TCPSend * >gtnets_clients_;
- map < int, Linkp2p * >gtnets_links_;
- map < int, Node * >gtnets_nodes_;
- map < void *, int >gtnets_action_to_flow_;
-
- map < int, void *>gtnets_metadata_;
-};
-
-#endif /* __cplusplus */
-
-#endif
+++ /dev/null
-/* Copyright (c) 2007-2011, 2014. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-//GTNETS_Link, GTNETS_Node, GTNETS_Topology:
-//Temporary classes for generating GTNetS topology
-
-#include "gtnets_topology.h"
-#ifdef XBT_DEBUG
- #undef XBT_DEBUG
-#endif
-#include "xbt/log.h"
-#include "xbt/asserts.h"
-#include <stdio.h> //for fflush in print_topology
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network_gtnets_topology, surf_network_gtnets,
- "Logging specific to the SURF network GTNetS simulator");
-
-//
-// GTNETS_Node
-//
-
-// Constructor
-GTNETS_Node::GTNETS_Node(int id):ID_(id),is_router_(false){}
-// Copy constructor
-GTNETS_Node::GTNETS_Node(const GTNETS_Node& node){
- ID_ = node.ID_;
- is_router_ = node.is_router_;
- hosts_ = node.hosts_;
-}
-
-GTNETS_Node::~GTNETS_Node(){
-
-}
-
-// hostid = network_card_id
-int GTNETS_Node::add_host(int hostid){
- xbt_assert(!(is_router_), "Cannot add a host to a router node");
- hosts_.insert(hostid);
- return 0;
-}
-
-// Add a router. If this node already has a router/host,
-// return -1.
-int GTNETS_Node::add_router(int routerid){
- xbt_assert(!(hosts_.size() > 1), "Router node should have only one router");
- if (hosts_.size() == 1){
- xbt_assert((hosts_.find(routerid) != hosts_.end()), "Node %d is a different router", routerid);
- return 0;
- }
- is_router_ = true;
- hosts_.insert(routerid);
- return 0;
-}
-
-bool GTNETS_Node::is_router(){
- return is_router_;
-}
-
-bool GTNETS_Node::include(int hostid){
- if (hosts_.find(hostid) == hosts_.end()) return false;
- else return true;
-}
-
-void GTNETS_Node::print_hosts(){
- set<int>::iterator it;
- for (it = hosts_.begin(); it != hosts_.end(); it++){
- XBT_DEBUG("host id %d", *it);
- }
-}
-
-//
-// GTNETS_Link
-//
-
-// Constructor
-GTNETS_Link::GTNETS_Link(){
- ID_=-1;
- src_node_ = 0;
- dst_node_ = 0;
-}
-GTNETS_Link::GTNETS_Link(int id):ID_(id), src_node_(0), dst_node_(0){}
-
-// Copy constructor
-GTNETS_Link::GTNETS_Link(const GTNETS_Link& link){
- ID_ = link.ID_;
- src_node_ = link.src_node_;
- dst_node_ = link.dst_node_;
-}
-
-GTNETS_Link::~GTNETS_Link(){
-
-}
-
-void GTNETS_Link::print_link_status(){
- XBT_DEBUG("****** link id: %d", ID_);
- if (src_node_){
- XBT_DEBUG("[src] id: %d, is it router?: %d",src_node_->id(), src_node_->is_router());
- }
-
- if (dst_node_){
- XBT_DEBUG("[dst] id: %d, is it router?: %d",dst_node_->id(), dst_node_->is_router());
- }
-}
-
-GTNETS_Node* GTNETS_Link::src_node(){
- return src_node_;
-}
-
-GTNETS_Node* GTNETS_Link::dst_node(){
- return dst_node_;
-}
-
-bool GTNETS_Link::route_exists(){
- if (src_node_ && dst_node_) return true;
- else return false;
-}
-
-// return the peer node id
-int GTNETS_Link::peer_node(int cur_id){
- xbt_assert(((cur_id == src_node_->id())||(cur_id == dst_node_->id())), "Node not found");
-
- if (cur_id == src_node_->id()) return dst_node_->id();
- else if (cur_id == dst_node_->id()) return src_node_->id();
-}
-
-int GTNETS_Link::add_src(GTNETS_Node* src){
- src_node_ = src;
-}
-
-int GTNETS_Link::add_dst(GTNETS_Node* dst){
- dst_node_ = dst;
-}
-
-
-//
-// GTNETS_Topology
-//
-
-// Constructor
-GTNETS_Topology::GTNETS_Topology(){
- nodeID_ = 0;
-}
-
-// Destructor
-GTNETS_Topology::~GTNETS_Topology(){
- map<int, GTNETS_Link*>::iterator it1;
- for (it1 = links_.begin(); it1 != links_.end(); it1++){
- delete it1->second;
- }
- vector<GTNETS_Node*>::iterator it2;
- for (it2 = nodes_.begin(); it2 != nodes_.end(); it2++){
- delete *it2;
- }
-}
-
-
-int GTNETS_Topology::link_size(){
- return links_.size();
-}
-
-int GTNETS_Topology::node_size(){
- return nodes_.size();
-}
-
-int GTNETS_Topology::add_link(int id){
- map<int,GTNETS_Link*>::iterator iter = links_.find(id);
- xbt_assert((iter == links_.end()), "Link %d already exists", id);
-
- if(iter == links_.end()) {
- GTNETS_Link* link= new GTNETS_Link(id);
- links_[id] = link;
- }
- return 0;
-}
-
-int GTNETS_Topology::add_router(int id){
- set<int>::iterator iter = routers_.find(id);
- if(iter == routers_.end()){
- routers_.insert(id);
- }else{
- XBT_DEBUG("Router (#%d) already exists", id);
- }
- return 0;
-}
-
-bool GTNETS_Topology::is_router(int id){
- set<int>::iterator iter = routers_.find(id);
- if(iter == routers_.end()) return false;
- else return true;
-}
-
-//return the node id of the peer of cur_id by linkid.
-int GTNETS_Topology::peer_node_id(int linkid, int cur_id){
- GTNETS_Link* link = links_[linkid];
- xbt_assert((link), "Link %d not found", linkid);
- xbt_assert(!((cur_id < 0) || (cur_id > nodes_.size()-1)), "Node %d not found", cur_id);
-
- int peer = link->peer_node(nodes_[cur_id]->id());
- xbt_assert(!(peer < 0), "Peer not found");
-
- return peer;
-}
-
-int GTNETS_Topology::add_onehop_route(int src, int dst, int linkid){
- GTNETS_Link* link;
-
- map<int, GTNETS_Link*>::iterator iter = links_.find(linkid);
-
- xbt_assert(!(iter == links_.end()), "Link %d not found", linkid);
- link = iter->second;
-
- XBT_DEBUG("Add onehop route, src (#%d), dst (#%d), linkid %d:(#%d)",src, dst, linkid, link->id());
-
- GTNETS_Node *src_node, *dst_node;
- src_node = link->src_node();
- dst_node = link->dst_node();
-
- // If not exists a route, add one.
- if (!link->route_exists()){
- //check whether there exists a node for the src.
- int s_node_id = nodeid_from_hostid(src);
- int node_id;
-
- if (s_node_id < 0){//not exist, create one.
- s_node_id = nodeID_;
- GTNETS_Node* node1 = new GTNETS_Node(s_node_id);
- nodes_.push_back(node1);
- hosts_[src] = nodes_[s_node_id]->id();
-
- nodeID_++;
- }
-
- if (is_router(src))
- nodes_[s_node_id]->add_router(src);
- else
- nodes_[s_node_id]->add_host(src);
-
- link->add_src(nodes_[s_node_id]);
-
- //check whether there exists a node for the dst host/router.
- int d_node_id = nodeid_from_hostid(dst);
- if (d_node_id < 0){//not exist, create one.
- d_node_id = nodeID_;
- GTNETS_Node* node2 = new GTNETS_Node(d_node_id);
- nodes_.push_back(node2);
- hosts_[dst] = nodes_[d_node_id]->id();
- nodeID_++;
- }
-
- if (is_router(dst))
- nodes_[d_node_id]->add_router(dst);
- else
- nodes_[d_node_id]->add_host(dst);
-
- link->add_dst(nodes_[d_node_id]);
- }else if (!(src_node && dst_node)){
- xbt_assert((src_node && dst_node), "Either src or dst is null");
- }
-
- // case 1: link has two routers
- else if (src_node->is_router() && dst_node->is_router()){
- int tmpsrc1 = src_node->id();
- int tmpsrc2 = nodeid_from_hostid(src);
- int tmpdst1 = dst_node->id();
- int tmpdst2 = nodeid_from_hostid(dst);
- xbt_assert( (((tmpsrc1 == tmpsrc2) && (tmpdst1 == tmpdst2)) ||
- ((tmpsrc1 == tmpdst2) && (tmpdst1 == tmpsrc2))), "Different one hop route defined");
- }
-
- // case 2: link has one router and one host
- else if (src_node->is_router() && !dst_node->is_router()){
- int newsrc, newdst;
- xbt_assert( ((is_router(src))||(is_router(dst))), "One of nodes should be a router");
-
- if (is_router(src)){
- newsrc = src;
- newdst = dst;
- }else if (is_router(dst)){
- newsrc = dst;
- newdst = src;
- }
-
- xbt_assert(!(src_node->id() != nodeid_from_hostid(newsrc)), "The router should be identical");
-
- //now, to add dst to dst_node, dst should be a host.
- xbt_assert(!(is_router(newdst)), "Dst %d is not an endpoint. cannot add it to dst_node", newdst);
-
- if (!dst_node->include(newdst)){
- dst_node->add_host(newdst);
- hosts_[newdst] = dst_node->id();
- }
- }
- else if (!src_node->is_router() && dst_node->is_router()){
- int newsrc, newdst;
- xbt_assert(((is_router(src))||(is_router(dst))), "One of nodes should be a router");
-
- if (is_router(src)){
- newsrc = dst;
- newdst = src;
- }else if (is_router(dst)){
- newsrc = src;
- newdst = dst;
- }
-
- xbt_assert(!(dst_node->id() != hosts_[newdst]), "The router should be identical");
- //now, to add dst to src_node, dst should be a host.
- xbt_assert(!(is_router(newsrc)), "Src %d is not an endpoint. cannot add it to src_node", newsrc);
-
- if (!src_node->include(newsrc)){
- src_node->add_host(newsrc);
- hosts_[newsrc] = src_node->id();
- }
- }
-
- // case 3: link has two hosts
- else if (!src_node->is_router() && !dst_node->is_router()){
- xbt_assert(!(is_router(src) || is_router(dst)), "Cannot add a router to host-host link");
-
- //if both are hosts, the order doesn't matter.
- if (src_node->include(src)){
- if (dst_node->include(dst)){
- //nothing
- }else{
- dst_node->add_host(dst);
- hosts_[dst] = dst_node->id();
- }
- }else if (src_node->include(dst)){
- if (dst_node->include(src)){
- //nothing
- }else{
- dst_node->add_host(src);
- hosts_[src] = dst_node->id();
- }
- }else if (dst_node->include(src)){
- if (src_node->include(dst)){
- //nothing
- }else{
- src_node->add_host(dst);
- hosts_[dst] = src_node->id();
- }
- }else if (dst_node->include(dst)){
- if (src_node->include(src)){
- //nothing
- }else{
- src_node->add_host(src);
- hosts_[src] = src_node->id();
- }
- }else{
- src_node->add_host(src);
- dst_node->add_host(dst);
- hosts_[src] = src_node->id();
- hosts_[dst] = dst_node->id();
- }
-
- }
- else{
- xbt_die("Shouldn't be here");
- }
-
- return 0;
-}
-
-int GTNETS_Topology::nodeid_from_hostid(int hostid){
- map<int,int>::iterator it = hosts_.find(hostid);
- if (it == hosts_.end())
- return -1;
- else return it->second;
-}
-
-void GTNETS_Topology::print_topology(){
- XBT_DEBUG("<<<<<================================>>>>>");
- XBT_DEBUG("Dumping GTNETS topollogy information");
- map<int, GTNETS_Link*>::iterator it;
- for (it = links_.begin(); it != links_.end(); it++){
- it->second->print_link_status();
- }
- XBT_DEBUG(">>>>>================================<<<<<");
- fflush(NULL);
-}
-
-const vector<GTNETS_Node*>& GTNETS_Topology::nodes(){
- return nodes_;
-}
-
-const map<int, GTNETS_Link*>& GTNETS_Topology::links(){
- return links_;
-}
-
+++ /dev/null
-/* Copyright (c) 2007, 2009-2011, 2013-2014. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef _GTNETS_TOPOLOGY_H
-#define _GTNETS_TOPOLOGY_H
-
-#include <map>
-#include <vector>
-#include <set>
-#include <iostream>
-
-using namespace std;
-
-class GTNETS_Link;
-
-class GTNETS_Node {
-
-public:
- GTNETS_Node(int);
- GTNETS_Node(const GTNETS_Node & node);
- ~GTNETS_Node();
-
- int add_host(int);
- int add_router(int);
- int id() {
- return ID_;
- };
- bool is_router();
- bool include(int);
- void print_hosts();
-
-private:
- int ID_;
- int is_router_;
- set < int >hosts_; //simgrid hosts
-};
-
-class GTNETS_Link {
-
-public:
- GTNETS_Link();
- GTNETS_Link(int id);
- GTNETS_Link(const GTNETS_Link &);
- ~GTNETS_Link();
-
- GTNETS_Node *src_node();
- GTNETS_Node *dst_node();
- int peer_node(int);
- int id() {
- return ID_;
- };
- void print_link_status();
- int add_src(GTNETS_Node *);
- int add_dst(GTNETS_Node *);
- bool route_exists();
-
-private:
- int ID_;
- GTNETS_Node *src_node_;
- GTNETS_Node *dst_node_;
-
-};
-
-// To create a topology:
-// 1. add links
-// 2. add routers
-// 3. add onehop links
-class GTNETS_Topology {
-public:
- GTNETS_Topology();
- ~GTNETS_Topology();
-
- bool is_router(int id);
- int peer_node_id(int linkid, int cur_id);
- int add_link(int id);
- int add_router(int id);
- int add_onehop_route(int src, int dst, int link);
-
- int nodeid_from_hostid(int);
- int link_size();
- int node_size();
- void print_topology();
- const vector < GTNETS_Node * >&nodes();
- const map < int, GTNETS_Link * >&links();
-
-private:
-
- int nodeID_;
- map < int, GTNETS_Link * >links_;
- vector < GTNETS_Node * >nodes_;
-
- map < int, int >hosts_; //hostid->nodeid
-
- set < int >routers_;
-};
-
-#endif
}
}
-/* to trace gtnets */
-void TRACE_surf_gtnets_communicate(void *action, void *src, void *dst)
-{
- /*FIXME:surf_action_network_GTNETS_t gtnets_action = (surf_action_network_GTNETS_t)action;
- gtnets_action->src = src;
- gtnets_action->dst = dst;*/
-}
-
void TRACE_surf_action(surf_action_t surf_action, const char *category)
{
if (!TRACE_is_enabled())
+++ /dev/null
-/* Copyright (c) 2013-2014. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "network_gtnets.hpp"
-
-static double time_to_next_flow_completion = -1;
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network_gtnets, surf,
- "Logging specific to the SURF network GTNetS module");
-
-extern routing_platf_t routing_platf;
-
-double sg_gtnets_jitter = 0.0;
-int sg_gtnets_jitter_seed = 10;
-
-/*********
- * Model *
- *********/
-
-void newRoute(int src_id, int dst_id,
- xbt_dynar_t links, int nb_link)
-{
- void *_link;
- NetworkGTNetsLink *link;
- unsigned int cursor;
- int i = 0;
- int *gtnets_links;
-
- XBT_IN("(src_id=%d, dst_id=%d, links=%p, nb_link=%d)",
- src_id, dst_id, links, nb_link);
-
- /* Build the list of gtnets link IDs */
- gtnets_links = xbt_new0(int, nb_link);
- i = 0;
- xbt_dynar_foreach(links, cursor, _link) {
- link = (NetworkGTNetsLink*) _link;
- gtnets_links[i++] = link->m_id;
- }
-
- if (gtnets_add_route(src_id, dst_id, gtnets_links, nb_link)) {
- xbt_die("Cannot create GTNetS route");
- }
- XBT_OUT();
-}
-
-void newRouteOnehop(int src_id, int dst_id,
- NetworkGTNetsLink *link)
-{
- if (gtnets_add_onehop_route(src_id, dst_id, link->m_id)) {
- xbt_die("Cannot create GTNetS route");
- }
-}
-
-int NetworkGTNetsModel::addLink(ind id, double bandwidth, double latency)
-{
- double bw = bandwidth * 8; //Bandwidth in bits (used in GTNETS).
-
- map<int,GTNETS_Link*>::iterator iter = p_links.find(id);
- xbt_assert((iter == p_links.end()), "Link %d already exists", id);
-
- if(iter == p_links.end()) {
- GTNETS_Link* link= new GTNETS_Link(id);
- p_links[id] = link;
- }
-
- XBT_DEBUG("Creating a new P2P, linkid %d, bandwidth %gl, latency %gl", id, bandwidth, latency);
- p_gtnetsLinks_[id] = new Linkp2p(bw, latency);
- if(jitter_ > 0){
- XBT_DEBUG("Using jitter %f, and seed %u", jitter_, jitter_seed_);
- double min = -1*jitter_*latency;
- double max = jitter_*latency;
- uniform_jitter_generator_[id] = new Uniform(min,max);
- gtnets_links_[id]->Jitter((const Random &) *(uniform_jitter_generator_[id]));
- }
-
- return 0;
-}
-
-/************
- * Resource *
- ************/
-NetworkGTNetsLink::NetworkGTNetsLink(NetworkGTNetsModelPtr model, const char* name, double bw, double lat, xbt_dict_t properties)
- :NetworkCm02Link(model, name, properties), m_bwCurrent(bw), m_latCurrent(lat)
-{
-
- static int link_count = -1;
-
- if (xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL)) {
- return;
- }
-
- XBT_DEBUG("Scanning link name %s", name);
-
- link_count++;
-
- XBT_DEBUG("Adding new link, linkid %d, name %s, latency %g, bandwidth %g",
- link_count, name, lat, bw);
-
-
-
- if (gtnets_add_link(link_count, bw, lat)) {
- xbt_die("Cannot create GTNetS link");
- }
- m_id = link_count;
-
- xbt_lib_set(link_lib, name, SURF_LINK_LEVEL, this);
-}
-
-/**********
- * Action *
- **********/
+++ /dev/null
-/* Copyright (c) 2013-2014. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "network_cm02.hpp"
-
-#ifndef NETWORK_GTNETS_HPP_
-#define NETWORK_GTNETS_HPP_
-
-#include "simulator.h" // Definitions for the Simulator Object
-#include "node.h" // Definitions for the Node Object
-#include "linkp2p.h" // Definitions for point-to-point link objects
-#include "ratetimeparse.h" // Definitions for Rate and Time objects
-#include "application-tcpserver.h" // Definitions for TCPServer application
-#include "application-tcpsend.h" // Definitions for TCP Sending application
-#include "tcp-tahoe.h" // Definitions for TCP Tahoe
-#include "tcp-reno.h"
-#include "tcp-newreno.h"
-#include "event.h"
-#include "routing-manual.h"
-#include "red.h"
-#include "surf/gtnets/gtnets_topology.h"
-
-xbt_dict_t network_card_ids;
-
-/***********
- * Classes *
- ***********/
-class NetworkGTNetsModel;
-typedef NetworkGTNetsModel *NetworkGTNetsModelPtr;
-
-class NetworkGTNetsAction;
-typedef NetworkGTNetsAction *NetworkGTNetsActionPtr;
-
-class NetworkGTNetsActionLmm;
-typedef NetworkGTNetsActionLmm *NetworkGTNetsActionLmmPtr;
-
-/*********
- * Model *
- *********/
-class NetworkGTNetsModel : public NetworkCm02Model {
-public:
- NetworkGTNetsModel() : NetworkCm02Model("constant time network") {};
- int addLink(int id, double bandwidth, double latency);
- int addOnehop_route(int src, int dst, int link);
- int addRoute(int src, int dst, int *links, int nlink);
- int addRouter(int id);
- int createFlow(int src, int dst, long datasize, void *metadata);
- double getTimeToNextFlowCompletion();
- int runUntilNextFlowCompletion(void ***metadata,
- int *number_of_flows);
- int run(double deltat);
- // returns the total received by the TCPServer peer of the given action
- double gtNetsGetFlowRx(void *metadata);
- void createGTNetsTopology();
- void printTopology();
- void setJitter(double);
- void setJitterSeed(int);
-private:
- void addNodes();
- void nodeConnect();
-
- bool nodeInclude(int);
- bool linkInclude(int);
- Simulator *p_sim;
- GTNETS_Topology *p_topo;
- RoutingManual *p_rm;
- REDQueue *p_redQueue;
- int m_nnode;
- int m_isTopology;
- int m_nflow;
- double m_jitter;
- int m_jitterSeed;
- map<int, Uniform*> p_uniformJitterGenerator;
-
- map<int, TCPServer*> p_gtnetsServers;
- map<int, TCPSend*> p_gtnetsClients;
- map<int, GTLinkp2p*> p_gtnetsLinks_;
- map<int, Node*> p_gtnetsNodes;
- map<void*, int> p_gtnetsActionToFlow;
-
- map <int, void*> p_gtnetsMetadata;
-
- // From Topology
- int m_nodeID;
- map<int, GTNETS_Link*> p_links;
- vector<GTNETS_Node*> p_nodes;
- map<int, int> p_hosts; //hostid->nodeid
- set<int > p_routers;
-};
-
-/************
- * Resource *
- ************/
-class NetworkGTNetsLink : public NetworkCm02Link {
-public:
- NetworkGTNetsLink(NetworkGTNetsModelPtr model, const char* name, double bw, double lat, xbt_dict_t properties);
- /* Using this object with the public part of
- model does not make sense */
- double m_bwCurrent;
- double m_latCurrent;
- int m_id;
-};
-
-/**********
- * Action *
- **********/
-class NetworkGTNetsAction : public NetworkCm02Action {
-public:
- NetworkGTNetsAction(NetworkGTNetsModelPtr model, double latency){};
-
- double m_latency;
- double m_latCurrent;
- int m_lastRemains;
- lmm_variable_t p_variable;
- double m_rate;
- int m_suspended;
- RoutingEdgePtr src;
- RoutingEdgePtr dst;
-};
-
-#endif /* NETWORK_GTNETS_HPP_ */
{"CM02",
"Legacy network analytic model (Very similar to LV08, but without corrective factors. The timings of small messages are thus poorly modeled).",
surf_network_model_init_CM02},
-#ifdef HAVE_GTNETS
- {"GTNets",
- "Network pseudo-model using the GTNets simulator instead of an analytic model",
- surf_network_model_init_GTNETS},
-#endif
#ifdef HAVE_NS3
{"NS3",
"Network pseudo-model using the NS3 tcp model instead of an analytic model",
extern double sg_bandwidth_factor;
extern double sg_weight_S_parameter;
extern int sg_network_crosstraffic;
-#ifdef HAVE_GTNETS
-extern double sg_gtnets_jitter;
-extern int sg_gtnets_jitter_seed;
-#endif
extern xbt_dynar_t surf_path;
extern "C" {
};
/** @ingroup SURF_routing_interface
- * @brief Link of lenght 1, alongside with its source and destination. This is mainly usefull in the bindings to gtnets and ns3
+ * @brief Link of lenght 1, alongside with its source and destination. This is mainly usefull in the ns3 bindings
*/
class Onelink {
public:
XBT_LOG_CONNECT(surf_lagrange_dichotomy);
XBT_LOG_CONNECT(surf_maxmin);
XBT_LOG_CONNECT(surf_network);
-#ifdef HAVE_GTNETS
- XBT_LOG_CONNECT(surf_network_gtnets);
- XBT_LOG_CONNECT(surf_network_gtnets_interface);
- XBT_LOG_CONNECT(surf_network_gtnets_simulator);
- XBT_LOG_CONNECT(surf_network_gtnets_topology);
-#endif
#ifdef HAVE_NS3
XBT_LOG_CONNECT(ns3);
#endif
}
/* Set the instruction and the stack pointer */
- #if defined(_I_X86_) || defined(__i383) || defined(__i383__)
+ #if defined(_I_X86_) || defined(__i386) || defined(__i386__)
ucp->uc_mcontext.Eip = (DWORD) func;
ucp->uc_mcontext.Esp = (DWORD) sp - sizeof(void*);
#elif defined(_IA64_) || defined(__ia64) || defined(__ia64__)
ucp->uc_mcontext.Rip = (DWORD64) func;
ucp->uc_mcontext.Rsp = (DWORD64) sp - sizeof(void*);
#else
- #error "No architecture defined for Windows build.
+ #error "No architecture defined for Windows build."
#endif
/* Save/Restore the full machine context */
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
add_executable(bug-17132 ${CMAKE_HOME_DIRECTORY}/teshsuite/bug-17132/bug-17132.c)
target_link_libraries(bug-17132 simgrid)
+endif(enable_smpi)
- set(tesh_files
- ${tesh_files}
- ${CMAKE_CURRENT_SOURCE_DIR}/bug-17132.tesh
- ${CMAKE_CURRENT_SOURCE_DIR}/bug-17132-surf-debug.tesh
- PARENT_SCOPE)
- set(xml_files
- ${xml_files}
- PARENT_SCOPE)
- set(teshsuite_src
- ${teshsuite_src}
- ${CMAKE_CURRENT_SOURCE_DIR}/bug-17132.c
- PARENT_SCOPE)
- set(bin_files
- ${bin_files}
- PARENT_SCOPE)
- set(txt_files
- ${txt_files}
- ${CMAKE_CURRENT_SOURCE_DIR}/hostfile.txt
- ${CMAKE_CURRENT_SOURCE_DIR}/README
- PARENT_SCOPE)
+set(tesh_files
+ ${tesh_files}
+ ${CMAKE_CURRENT_SOURCE_DIR}/bug-17132.tesh
+ ${CMAKE_CURRENT_SOURCE_DIR}/bug-17132-surf-debug.tesh
+ PARENT_SCOPE)
+set(xml_files
+ ${xml_files}
+ PARENT_SCOPE)
+set(teshsuite_src
+ ${teshsuite_src}
+ ${CMAKE_CURRENT_SOURCE_DIR}/bug-17132.c
+ PARENT_SCOPE)
+set(bin_files
+ ${bin_files}
+ PARENT_SCOPE)
+set(txt_files
+ ${txt_files}
+ ${CMAKE_CURRENT_SOURCE_DIR}/hostfile.txt
+ ${CMAKE_CURRENT_SOURCE_DIR}/README
+ PARENT_SCOPE)
-endif(enable_smpi)
#include <xbt.h>
#include <mc/mc.h>
-#include "../../src/include/mc/datatypes.h"
-#include "../../src/mc/mc_object_info.h"
-#include "../../src/mc/mc_private.h"
+#include "mc/datatypes.h"
+#include "mc/mc_object_info.h"
+#include "mc/mc_private.h"
+#include "mc/mc_process.h"
+
+#include "mc/Type.hpp"
+#include "mc/ObjectInformation.hpp"
+#include "mc/Variable.hpp"
int test_some_array[4][5][6];
struct some_struct { int first; int second[4][5]; } test_some_struct;
#include <assert.h>
#include <stdlib.h>
-#include "../src/mc/mc_private.h"
-#include "../src/mc/mc_object_info.h"
+#include "mc/mc_process.h"
+#include "mc/mc_private.h"
+#include "mc/mc_object_info.h"
+
+#include "mc/Type.hpp"
+#include "mc/ObjectInformation.hpp"
+#include "mc/Variable.hpp"
static simgrid::mc::Process* process;
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml -np 3 --log=xbt_cfg.thresh:warning --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/any_src-can-deadlock10 --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml -np 3 --log=xbt_cfg.thresh:warning --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/any_src-can-deadlock4 --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --log=xbt_cfg.thresh:warning --cfg=smpi/coll_selector:mpich ${bindir:=.}/any_src-can-deadlock5 --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/any_src-can-deadlock6 --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/any_src-wait-deadlock --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/any_src-waitall-deadlock2 --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/any_src-waitall-deadlock3 --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/any_src-waitany-deadlock --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/any_src-waitany-deadlock2 --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" --log=xbt_cfg.thresh:warning -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/basic-deadlock-comm_create --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/basic-deadlock-comm_dup --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/basic-deadlock-comm_split --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/basic-deadlock --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/bcast-deadlock --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/collective-misorder-allreduce --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/collective-misorder --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/complex-deadlock --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/deadlock-config --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> WARNING: This test depends on the MPI's eager limit. Set it appropriately.
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/finalize-deadlock --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! expect return 3
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/irecv-deadlock --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! timeout 5
+! expect return 0
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/no-error --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! timeout 5
+! expect return 0
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/no-error2 --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! timeout 5
+! expect return 0
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/no-error3-any_src --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
#! ./tesh
-! expect return 134
+! timeout 5
+! expect return 0
+! output display
$ ${bindir:=.}/../../../../bin/smpirun -wrapper "${bindir:=.}/../../../../bin/simgrid-mc" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=model-check:1 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich ${bindir:=.}/no-error3 --log=smpi_coll.thresh:error
> [0.000000] [mc_safety/INFO] Check a safety property
> (0) is alive on Tremblay
/* Warning: autogenerated, do not edit! */
#include <dwarf.h>
+#include <elfutils/libdw.h>
#include <xbt/base.h>
#include "mc_object_info.h"
+ \.gitignore
+ \.project
+ \.travis.yml
++ appveyor.yml
+ COPYRIGHT.template
+ README\.(coding|git)
+ mk_win-dist.sh
if($size != 0) {
# This is a crude hack to disable the stack cleaning on the main
- # stack. It rellies on the fact that the main stack is high in
- # the address space and the other stacks are in the hap (lower).
+ # stack. It relies on the fact that the main stack is high in
+ # the address space and the other stacks are in the heap (lower).
print("\tmovq \$0x7fff00000000, %r11\n");
print("\tcmpq %r11, %rsp\n");
print("\tjae .Lstack_cleaner_done$id\n");