From: Frederic Suter Date: Tue, 26 Apr 2016 09:21:42 +0000 (+0200) Subject: Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid X-Git-Tag: v3_13~34 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/48eccb2c1532e35819830ca56fad7cf89887359f?hp=2130e3d93afaec6d8b81b7efa96740e20b5784a3 Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 00ebaf2ef0..fa02471cee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -211,7 +211,6 @@ include(CheckSymbolExists) set(HAVE_GRAPHVIZ 0) include(FindGraphviz) -include(FindLibSigc++) set(HAVE_LUA 0) if(enable_lua) @@ -975,7 +974,6 @@ message(" Documentation................: ${enable_documentation}") message(" Model checking ..............: ${HAVE_MC}") message(" Jedule mode ................: ${HAVE_JEDULE}") message(" Graphviz mode ...............: ${HAVE_GRAPHVIZ}") -message(" Sigc++ mode .................: ${SIMGRID_HAVE_LIBSIG}") message(" Mallocators .................: ${enable_mallocators}") message("") message(" Simgrid dependencies ........: ${SIMGRID_DEP}") diff --git a/ChangeLog b/ChangeLog index 7eed1ffe53..af1d63e2db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,16 +2,19 @@ SimGrid (3.13) UNRELEASED; urgency=low The Easter Trim Release. - Backwards Compatibility breaks - - Some command line options were renamed for consistency sake: - - model-check/sparse-checkpoint -> model-check/sparse_checkpoint - - smpi/async_small_thres -> smpi/async_small_thresh - - smpi/send_is_detached_thres -> smpi/send_is_detached_thresh - + * Backwards Compatibility breaks - Removed Lua simulation bindings (switch to C or Java for that). Lua can still be used to describe platforms - Removed Java kernel plug-ins. Will be reintroduced after the ongoing major internals reorg. + - In MSG + - the following functions were removed. + They were too specific and should be reimplemented in a generic + way, with filter function. + - MSG_task_listen_from_host + - MSG_mailbox_get_count_host_waiting_tasks + - MSG_mailbox_put_with_timeout was removed. + Please use MSG_task_send_with_timeout instead. - In SimDag - the SD_application_reinit function was removed. It was a noop for a while. - The ACCESS_MODE of SD_workstation has been removed. This feature was not really usable and should soon be @@ -36,6 +39,9 @@ SimGrid (3.13) UNRELEASED; urgency=low MC_snapshot() and MC_compare_snapshot(); - keep the MC_cut() function as a stub (it was not really working in the previous release). + + Options: + * All options are consistently in kebab-case. Old names are kept as alias. XML platforms: * Switch to platform v4 format. diff --git a/appveyor.yml b/appveyor.yml index a8ba39978d..bf87208509 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,6 +31,8 @@ install: - rename "C:\Program Files\Git\usr\bin\sh.exe" "sh-ignored.exe" build_script: +- SET CFLAGS=-Wno-deprecated-declarations # ignore C:/Libraries/boost_1_59_0/boost/smart_ptr/shared_ptr.hpp:461:22: warning: 'template class std::auto_ptr' is deprecated [-Wdeprecated-declarations] +- SET CPPFLAGS=-Wno-deprecated-declarations # ignore issues within boost - cmake -G "MinGW Makefiles" -Denable_lua=OFF -Denable_java=ON -Denable_smpi=OFF -Denable_mallocators=OFF -Denable_lto=OFF . - C:\tools\mingw64\bin\mingw32-make.exe VERBOSE=1 - cd C:/projects/simgrid/examples/java && java -classpath ".;../../simgrid.jar" masterslave.Masterslave ../platforms/platform.xml masterslave/masterslaveDeployment.xml || true diff --git a/doc/doxygen/install.doc b/doc/doxygen/install.doc index 1e0ef4ec62..5a0f1631c0 100644 --- a/doc/doxygen/install.doc +++ b/doc/doxygen/install.doc @@ -382,4 +382,27 @@ computer. export LD_LIBRARY_PATH=/opt/simgrid/lib @endverbatim +@subsection install_src_32 Compiling a 32 bit version + +On a multiarch x86_64 Linux, it should be possible to compile a 32 bit +version of SimGrid with something like: + +@verbatim +CFLAGS=-m32 \ +CXXFLAGS=-m32 \ +PKG_CONFIG_LIBDIR=/usr/lib/i386-linux-gnu/pkgconfig/ \ +cmake . \ +-DCMAKE_SYSTEM_PROCESSOR=i386 \ +-DCMAKE_Fortran_COMPILER=/some/path/to/i686-linux-gnu-gfortran \ +-DGFORTRAN_EXE=/some/path/to/i686-linux-gnu-gfortran \ +-DCMAKE_Fortran_FLAGS=-m32 +@endverbatim + +where i686-linux-gnu-gfortran can be implemented as: + +@verbatim +#!/bin/sh +exec gfortran -m32 "$@" +@endverbatim + */ diff --git a/doc/doxygen/options.doc b/doc/doxygen/options.doc index 4488c39acf..86c24f8057 100644 --- a/doc/doxygen/options.doc +++ b/doc/doxygen/options.doc @@ -176,16 +176,16 @@ configurations. now). - \b Full: Full update of remaining and variables. Slow but may be useful when debugging. - - items \b network/maxmin_selective_update and - \b cpu/maxmin_selective_update: configure whether the underlying + - items \b network/maxmin-selective-update and + \b cpu/maxmin-selective-update: configure whether the underlying should be lazily updated or not. It should have no impact on the computed timings, but should speed up the computation. -It is still possible to disable the \c maxmin_selective_update feature +It is still possible to disable the \c maxmin-selective-update feature because it can reveal counter-productive in very specific scenarios where the interaction level is high. In particular, if all your communication share a given backbone link, you should disable it: -without \c maxmin_selective_update, every communications are updated +without \c maxmin-selective-update, every communications are updated at each step through a simple loop over them. With that feature enabled, every communications will still get updated in this case (because of the dependency induced by the backbone), but through a @@ -216,7 +216,7 @@ speedup or a slowdown because of the synchronization costs of threads. The analytical models need to know the maximal TCP window size to take the TCP congestion mechanism into account. This is set to 20000 by -default, but can be changed using the \b network/TCP_gamma item. +default, but can be changed using the \b network/TCP-gamma item. On linux, this value can be retrieved using the following commands. Both give a set of values, and you should use the last one, @@ -247,7 +247,7 @@ InfiniBand network behavior can be modeled through 3 parameters, as explained in These factors can be changed through the following option: \verbatim -smpi/IB_penalty_factors:"βe;βs;γs" +smpi/IB-penalty-factors:"βe;βs;γs" \endverbatim By default SMPI uses factors computed on the Stampede Supercomputer at TACC, with optimal @@ -284,7 +284,7 @@ initialization are done in the simulator. (this configuration item is experimental and may change or disapear) It is possible to specify a timing gap between consecutive emission on -the same network card through the \b network/sender_gap item. This +the same network card through the \b network/sender-gap item. This is still under investigation as of writting, and the default value is to wait 10 microseconds (1e-5 seconds) between emissions. @@ -295,7 +295,7 @@ to wait 10 microseconds (1e-5 seconds) between emissions. It is possible to specify that messages below a certain size will be sent as soon as the call to MPI_Send is issued, without waiting for the correspondant receive. This threshold can be configured through the -\b smpi/async_small_thresh item. The default value is 0. This behavior can also be +\b smpi/async-small-thresh item. The default value is 0. This behavior can also be manually set for MSG mailboxes, by setting the receiving mode of the mailbox with a call to \ref MSG_mailbox_set_async . For MSG, all messages sent to this mailbox will have this behavior, so consider using two mailboxes if needed. @@ -402,9 +402,9 @@ This only works in safety mode. This options is disabled by default. -\subsection options_modelchecking_dot_output model-check/dot_output, Dot output +\subsection options_modelchecking_dot_output model-check/dot-output, Dot output -If set, the \b model-check/dot_output configuration item is the name of a file +If set, the \b model-check/dot-output configuration item is the name of a file in which to write a dot file of the path leading the found property (safety or liveness violation) as well as the cycle for liveness properties. This dot file can then fed to the graphviz dot tool to generate an corresponding graphical @@ -412,7 +412,7 @@ representation. \subsection options_modelchecking_max_depth model-check/max_depth, Depth limit -The \b model-checker/max_depth can set the maximum depth of the exploration +The \b model-checker/max-depth can set the maximum depth of the exploration graph of the model-checker. If this limit is reached, a logging message is sent and the results might not be exact. @@ -426,8 +426,8 @@ set to \b yes, the model-checker will explore timeouts of `wait` operations. \subsection options_modelchecking_comm_determinism Communication determinism -The \b model-check/communications_determinism and -\b model-check/send_determinism items can be used to select the communication +The \b model-check/communications-determinism and +\b model-check/send-determinism items can be used to select the communication determinism mode of the model-checker which checks determinism properties of the communications of an application. @@ -439,7 +439,7 @@ reach GiB ou Tib of memory. However, for many workloads, the memory does not change much between different snapshots and taking a complete copy of each snapshot is a waste of memory. -The \b model-check/sparse_checkpoint option item can be set to \b yes in order +The \b model-check/sparse-checkpoint option item can be set to \b yes in order to avoid making a complete copy of each snapshot: instead, each snapshot will be decomposed in blocks which will be stored separately. If multiple snapshots share the same block (or if the same block @@ -465,7 +465,7 @@ really meaningful: you should expect the contribution of the memory consumption of the snapshots to be \f$ \mbox{number of processes} \times \mbox{stack size} \times \mbox{number of states} \f$. -The \b model-check/sparse_checkpoint can be used to reduce the memory +The \b model-check/sparse-checkpoint can be used to reduce the memory consumption by trying to share memory between the different snapshots. When compiled against the model checker, the stacks are not @@ -577,7 +577,7 @@ rather disturbing: this leads to stack overflow (overwriting other stacks), leading to segfaults with corrupted stack traces. If you want to push the scalability limits of your code, you might -want to reduce the \b contexts/stack_size item. Its default value +want to reduce the \b contexts/stack-size item. Its default value is 8192 (in KiB), while our Chord simulation works with stacks as small as 16 KiB, for example. For the thread factory, the default value is the one of the system, if it is too large/small, it has to be set @@ -612,7 +612,7 @@ the amount of cores auto-detected). Even if you asked several worker threads using the previous option, you can request to start the parallel execution (and pay the associated synchronization costs) only if the potential parallelism is -large enough. For that, set the \b contexts/parallel_threshold +large enough. For that, set the \b contexts/parallel-threshold item to the minimal amount of user contexts needed to start the parallel execution. In any given simulation round, if that amount is not reached, the contexts will be run sequentially directly by the @@ -683,7 +683,7 @@ reproduce an experiment. You have two ways to do that: - Add the contents of a textual file on top of the trace file as comment: \verbatim ---cfg=tracing/comment_file:my_file_with_additional_information.txt +--cfg=tracing/comment-file:my_file_with_additional_information.txt \endverbatim Please, use these two parameters (for comments) to make reproducible @@ -702,7 +702,7 @@ doing. This option shows a backtrace of the other process. Enable this option by adding \verbatim ---cfg=msg/debug_multiple_use:on +--cfg=msg/debug-multiple-use:on \endverbatim \section options_smpi Configuring SMPI @@ -720,21 +720,21 @@ say that if you have a large computation between a \c MPI_Recv() and a code, and create an execution task within the simulator to take this into account. For that, the actual duration is measured on the host machine and then scaled to the power of the corresponding simulated -machine. The variable \b smpi/running_power allows to specify the +machine. The variable \b smpi/running-power allows to specify the computational power of the host machine (in flop/s) to use when scaling the execution times. It defaults to 20000, but you really want to update it to get accurate simulation results. When the code is constituted of numerous consecutive MPI calls, the previous mechanism feeds the simulation kernel with numerous tiny -computations. The \b smpi/cpu_threshold item becomes handy when this +computations. The \b smpi/cpu-threshold item becomes handy when this impacts badly the simulation performance. It specifies a threshold (in seconds) below which the execution chunks are not reported to the simulation kernel (default value: 1e-6). \note - The option smpi/cpu_threshold ignores any computation time spent + The option smpi/cpu-threshold ignores any computation time spent below this threshold. SMPI does not consider the \a amount of these computations; there is no offset for this. Hence, by using a value that is too low, you may end up with unreliable simulation @@ -752,8 +752,8 @@ being replayed/simulated. At the moment, these computation events can be simulated using SMPI by calling internal smpi_execute*() functions. To disable the benchmarking/simulation of computation in the simulated -application, the variable \b smpi/simulate_computation should be set to no. -Equivalently, setting \b smpi/cpu_threshold to -1 also ignores all +application, the variable \b smpi/simulate-computation should be set to no. +Equivalently, setting \b smpi/cpu-threshold to -1 also ignores all computation. \note @@ -762,7 +762,7 @@ computation. you should check the SMPI_SAMPLE macros, documented in the chapter \ref SMPI_adapting_speed. -\subsection options_model_smpi_bw_factor smpi/bw_factor: Bandwidth factors +\subsection options_model_smpi_bw_factor smpi/bw-factor: Bandwidth factors The possible throughput of network links is often dependent on the message sizes, as protocols may adapt to different message sizes. With @@ -784,7 +784,7 @@ Here, MAX_BANDWIDTH denotes the bandwidth of the link. 1. http://simgrid.gforge.inria.fr/contrib/smpi-calibration-doc.html 2. http://simgrid.gforge.inria.fr/contrib/smpi-saturation-doc.html -\subsection options_smpi_timing smpi/display_timing: Reporting simulation time +\subsection options_smpi_timing smpi/display-timing: Reporting simulation time \b Default: 0 (false) @@ -792,17 +792,17 @@ Most of the time, you run MPI code with SMPI to compute the time it would take to run it on a platform. But since the code is run through the \c smpirun script, you don't have any control on the launcher code, making it difficult to report the simulated time -when the simulation ends. If you set the \b smpi/display_timing item +when the simulation ends. If you set the \b smpi/display-timing item to 1, \c smpirun will display this information when the simulation ends. \verbatim Simulation time: 1e3 seconds. \endverbatim -\subsection options_model_smpi_lat_factor smpi/lat_factor: Latency factors +\subsection options_model_smpi_lat_factor smpi/lat-factor: Latency factors The motivation and syntax for this option is identical to the motivation/syntax -of smpi/bw_factor, see \ref options_model_smpi_bw_factor for details. +of smpi/bw-factor, see \ref options_model_smpi_bw_factor for details. -There is an important difference, though: While smpi/bw_factor \a reduces the +There is an important difference, though: While smpi/bw-factor \a reduces the actual bandwidth (i.e., values between 0 and 1 are valid), latency factors increase the latency, i.e., values larger than or equal to 1 are valid here. @@ -818,7 +818,7 @@ This is the default value: 1. http://simgrid.gforge.inria.fr/contrib/smpi-calibration-doc.html 2. http://simgrid.gforge.inria.fr/contrib/smpi-saturation-doc.html -\subsection options_smpi_global smpi/privatize_global_variables: Automatic privatization of global variables +\subsection options_smpi_global smpi/privatize-global-variables: Automatic privatization of global variables MPI executables are meant to be executed in separated processes, but SMPI is executed in only one process. Global variables from executables will be placed @@ -844,7 +844,7 @@ To avoid this, several options are possible : linking is advised (but not with the simgrid library, to avoid replicating its own global variables). - To use this runtime automatic switching, the variable \b smpi/privatize_global_variables + To use this runtime automatic switching, the variable \b smpi/privatize-global-variables should be set to yes @@ -855,12 +855,12 @@ This threshold specifies the size in bytes under which the send will return immediately. This is different from the threshold detailed in \ref options_model_network_asyncsend because the message is not effectively sent when the send is posted. SMPI still waits for the correspondant receive to be posted to perform the communication operation. This threshold can be set -by changing the \b smpi/send_is_detached item. The default value is 65536. +by changing the \b smpi/send-is-detached item. The default value is 65536. \subsection options_model_smpi_collectives Simulating MPI collective algorithms SMPI implements more than 100 different algorithms for MPI collective communication, to accurately -simulate the behavior of most of the existing MPI libraries. The \b smpi/coll_selector item can be used +simulate the behavior of most of the existing MPI libraries. The \b smpi/coll-selector item can be used to use the decision logic of either OpenMPI or MPICH libraries (values: ompi or mpich, by default SMPI uses naive version of collective operations). Each collective operation can be manually selected with a \b smpi/collective_name:algo_name. Available algorithms are listed in \ref SMPI_collective_algorithms . @@ -955,7 +955,7 @@ Here is an example: to sleep increases linearly with the number of previously failed testk. -\subsection options_model_smpi_use_shared_malloc smpi/use_shared_malloc: Use shared memory +\subsection options_model_smpi_use_shared_malloc smpi/use-shared-malloc: Factorize malloc()s \b Default: 1 @@ -994,7 +994,7 @@ option to force a call to MPI_Wtime to advance the time as well. The C / C++ standard contains a function called \b [atexit](http://www.cplusplus.com/reference/cstdlib/atexit/). atexit registers callbacks, which are called just before the program terminates. -By setting the configuration option clean_atexit to 1 (true), a callback +By setting the configuration option clean-atexit to 1 (true), a callback is registered and will clean up some variables and terminate/cleanup the tracing. TODO: Add when this should be used. @@ -1043,9 +1043,9 @@ tasks. If it is not possible you might use ucontext instead. A stack guard page is usually used which prevents the stack from overflowing on other parts of the memory. However this might have a performance impact if a huge number of processes is created. The -option \b contexts:guard_size is the number of stack guard pages +option \b contexts:guard-size is the number of stack guard pages used. By setting it to 0, no guard pages will be used: in this case, -you should avoid using small stacks (\b stack_size) as the stack will +you should avoid using small stacks (\b stack-size) as the stack will silently overflow on other parts of the memory. \section options_index Index of all existing configuration options @@ -1059,16 +1059,16 @@ silently overflow on other parts of the memory. \b Please \b note: You can also pass the command-line option "--help" and "--help-cfg" to an executable that uses simgrid. -- \c clean_atexit: \ref options_generic_clean_atexit +- \c clean-atexit: \ref options_generic_clean_atexit - \c contexts/factory: \ref options_virt_factory -- \c contexts/guard_size: \ref options_virt_parallel +- \c contexts/guard-size: \ref options_virt_parallel - \c contexts/nthreads: \ref options_virt_parallel - \c contexts/parallel_threshold: \ref options_virt_parallel -- \c contexts/stack_size: \ref options_virt_stacksize +- \c contexts/stack-size: \ref options_virt_stacksize - \c contexts/synchro: \ref options_virt_parallel -- \c cpu/maxmin_selective_update: \ref options_model_optim +- \c cpu/maxmin-selective-update: \ref options_model_optim - \c cpu/model: \ref options_model_select - \c cpu/optim: \ref options_model_optim @@ -1078,35 +1078,34 @@ silently overflow on other parts of the memory. - \c maxmin/precision: \ref options_model_precision -- \c msg/debug_multiple_use: \ref options_msg_debug_multiple_use +- \c msg/debug-multiple-use: \ref options_msg_debug_multiple_use - \c model-check: \ref options_modelchecking - \c model-check/checkpoint: \ref options_modelchecking_steps -- \c model-check/communications_determinism: \ref options_modelchecking_comm_determinism -- \c model-check/send_determinism: \ref options_modelchecking_comm_determinism -- \c model-check/dot_output: \ref options_modelchecking_dot_output +- \c model-check/communications-determinism: \ref options_modelchecking_comm_determinism +- \c model-check/dot-output: \ref options_modelchecking_dot_output - \c model-check/hash: \ref options_modelchecking_hash - \c model-check/property: \ref options_modelchecking_liveness -- \c model-check/max_depth: \ref options_modelchecking_max_depth +- \c model-check/max-depth: \ref options_modelchecking_max_depth - \c model-check/record: \ref options_modelchecking_recordreplay - \c model-check/reduction: \ref options_modelchecking_reduction - \c model-check/replay: \ref options_modelchecking_recordreplay -- \c model-check/send_determinism: \ref options_modelchecking_sparse_checkpoint -- \c model-check/sparse_checkpoint: \ref options_modelchecking_sparse_checkpoint +- \c model-check/send-determinism: \ref options_modelchecking_comm_determinism +- \c model-check/sparse-checkpoint: \ref options_modelchecking_sparse_checkpoint - \c model-check/termination: \ref options_modelchecking_termination - \c model-check/timeout: \ref options_modelchecking_timeout - \c model-check/visited: \ref options_modelchecking_visited -- \c network/bandwidth_factor: \ref options_model_network_coefs +- \c network/bandwidth-factor: \ref options_model_network_coefs - \c network/coordinates: \ref options_model_network_coord - \c network/crosstraffic: \ref options_model_network_crosstraffic -- \c network/latency_factor: \ref options_model_network_coefs -- \c network/maxmin_selective_update: \ref options_model_optim +- \c network/latency-factor: \ref options_model_network_coefs +- \c network/maxmin-selective-update: \ref options_model_optim - \c network/model: \ref options_model_select - \c network/optim: \ref options_model_optim - \c network/sender_gap: \ref options_model_network_sendergap -- \c network/TCP_gamma: \ref options_model_network_gamma -- \c network/weight_S: \ref options_model_network_coefs +- \c network/TCP-gamma: \ref options_model_network_gamma +- \c network/weight-S: \ref options_model_network_coefs - \c ns3/TcpModel: \ref options_pls - \c path: \ref options_generic_path @@ -1116,23 +1115,23 @@ silently overflow on other parts of the memory. - \c surf/precision: \ref options_model_precision - \c For collective operations of SMPI, please refer to Section \ref options_index_smpi_coll -- \c smpi/async_small_thresh: \ref options_model_network_asyncsend -- \c smpi/bw_factor: \ref options_model_smpi_bw_factor -- \c smpi/coll_selector: \ref options_model_smpi_collectives -- \c smpi/cpu_threshold: \ref options_smpi_bench -- \c smpi/display_timing: \ref options_smpi_timing -- \c smpi/lat_factor: \ref options_model_smpi_lat_factor -- \c smpi/IB_penalty_factors: \ref options_model_network_coefs +- \c smpi/async-small-thresh: \ref options_model_network_asyncsend +- \c smpi/bw-factor: \ref options_model_smpi_bw_factor +- \c smpi/coll-selector: \ref options_model_smpi_collectives +- \c smpi/cpu-threshold: \ref options_smpi_bench +- \c smpi/display-timing: \ref options_smpi_timing +- \c smpi/lat-factor: \ref options_model_smpi_lat_factor +- \c smpi/IB-penalty-factors: \ref options_model_network_coefs - \c smpi/iprobe: \ref options_model_smpi_iprobe - \c smpi/ois: \ref options_model_smpi_ois - \c smpi/or: \ref options_model_smpi_or - \c smpi/os: \ref options_model_smpi_os -- \c smpi/privatize_global_variables: \ref options_smpi_global -- \c smpi/running_power: \ref options_smpi_bench -- \c smpi/send_is_detached_thresh: \ref options_model_smpi_detached -- \c smpi/simulate_computation: \ref options_smpi_bench +- \c smpi/privatize-global-variables: \ref options_smpi_global +- \c smpi/running-power: \ref options_smpi_bench +- \c smpi/send-is-detached-thresh: \ref options_model_smpi_detached +- \c smpi/simulate-computation: \ref options_smpi_bench - \c smpi/test: \ref options_model_smpi_test -- \c smpi/use_shared_malloc: \ref options_model_smpi_use_shared_malloc +- \c smpi/use-shared-malloc: \ref options_model_smpi_use_shared_malloc - \c smpi/wtime: \ref options_model_smpi_wtime - \c Tracing configuration options can be found in Section \ref tracing_tracing_options. diff --git a/doc/doxygen/platform.doc b/doc/doxygen/platform.doc index c49bcb4ad8..e29169cf72 100644 --- a/doc/doxygen/platform.doc +++ b/doc/doxygen/platform.doc @@ -1543,7 +1543,7 @@ Tag name | Description | Documentation - + diff --git a/doc/doxygen/tracing.doc b/doc/doxygen/tracing.doc index d5f2d01246..3b25b06c01 100644 --- a/doc/doxygen/tracing.doc +++ b/doc/doxygen/tracing.doc @@ -166,12 +166,12 @@ happening during a collective MPI call. \endverbatim \li \c -tracing/smpi/display_sizes +tracing/smpi/display-sizes : This option only has effect if this simulator is SMPI-based. Display the sizes of the messages exchanged in the trace, both in the links and on the states. For collective, size means the global size of data sent by the process in general. \verbatim ---cfg=tracing/smpi/display_sizes:yes +--cfg=tracing/smpi/display-sizes:yes \endverbatim \li \c @@ -191,7 +191,7 @@ TODO \endverbatim \li \c -tracing/smpi/format/ti_one_file +tracing/smpi/format/ti-one-file : TODO \verbatim @@ -230,7 +230,7 @@ tracing/buffer \endverbatim \li \c -tracing/onelink_only +tracing/onelink-only : This option changes the way SimGrid register its platform on the trace file. Normally, the tracing considers all routes (no matter their @@ -239,11 +239,11 @@ option is activated, only the routes with one link are used to register the topology within an AS. Routes among AS continue to be traced as usual. \verbatim ---cfg=tracing/onelink_only:yes +--cfg=tracing/onelink-only:yes \endverbatim \li \c -tracing/disable_link +tracing/disable-link : TODO \verbatim @@ -251,7 +251,7 @@ TODO \endverbatim \li \c -tracing/disable_power +tracing/disable-power : TODO \verbatim @@ -259,13 +259,13 @@ TODO \endverbatim \li \c -tracing/disable_destroy +tracing/disable-destroy : Disable the destruction of containers at the end of simulation. This can be used with simulators that have a different notion of time (different from the simulated time). \verbatim ---cfg=tracing/disable_destroy:yes +--cfg=tracing/disable-destroy:yes \endverbatim \li \c @@ -288,11 +288,11 @@ Use this to add a comment line to the top of the trace file. \endverbatim \li \c -tracing/comment_file +tracing/comment-file : Use this to add the contents of a file to the top of the trace file as comment. \verbatim ---cfg=tracing/comment_file:textual_file.txt +--cfg=tracing/comment-file:textual_file.txt \endverbatim \li \c diff --git a/examples/msg/app-masterworker/app-masterworker-vivaldi.tesh b/examples/msg/app-masterworker/app-masterworker-vivaldi.tesh index f051d982b0..3b0eca36bf 100644 --- a/examples/msg/app-masterworker/app-masterworker-vivaldi.tesh +++ b/examples/msg/app-masterworker/app-masterworker-vivaldi.tesh @@ -2,9 +2,9 @@ p Testing a simple master/worker example application -$ $SG_TEST_EXENV ./app-masterworker/app-masterworker ${srcdir:=.}/../platforms/vivaldi.xml ${srcdir:=.}/app-masterworker/app-masterworker-vivaldi_d.xml --cfg=network/latency_factor:1.0 --cfg=network/bandwidth_factor:1.0 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" -> [ 0.000000] (0:maestro@) Configuration change: Set 'network/latency_factor' to '1.0' -> [ 0.000000] (0:maestro@) Configuration change: Set 'network/bandwidth_factor' to '1.0' +$ $SG_TEST_EXENV ./app-masterworker/app-masterworker ${srcdir:=.}/../platforms/vivaldi.xml ${srcdir:=.}/app-masterworker/app-masterworker-vivaldi_d.xml --cfg=network/latency-factor:1.0 --cfg=network/bandwidth-factor:1.0 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +> [ 0.000000] (0:maestro@) Configuration change: Set 'network/latency-factor' to '1.0' +> [ 0.000000] (0:maestro@) Configuration change: Set 'network/bandwidth-factor' to '1.0' > [ 0.000000] (0:maestro@) Configuration change: Set 'network/coordinates' to 'yes' > [ 0.000000] (1:master@100030591) Got 15 workers and 10 tasks to process > [ 0.000000] (1:master@100030591) Sending "Task_0" (of 10) to mailbox "worker-0" diff --git a/examples/msg/dht-chord/dht-chord.c b/examples/msg/dht-chord/dht-chord.c index 976fa83397..420d50293e 100644 --- a/examples/msg/dht-chord/dht-chord.c +++ b/examples/msg/dht-chord/dht-chord.c @@ -34,8 +34,6 @@ static int periodic_lookup_delay = 10; static const double sleep_delay = 4.9999; -extern long int smx_total_comms; - /* Finger element. */ typedef struct s_finger { int id; @@ -1043,7 +1041,6 @@ int main(int argc, char *argv[]) MSG_launch_application(application_file); msg_error_t res = MSG_main(); - XBT_CRITICAL("Messages created: %ld", smx_total_comms); XBT_INFO("Simulated time: %g", MSG_get_clock()); chord_exit(); diff --git a/examples/msg/dht-chord/dht-chord.tesh b/examples/msg/dht-chord/dht-chord.tesh index 166a9a2a8d..d3a4cb89bd 100644 --- a/examples/msg/dht-chord/dht-chord.tesh +++ b/examples/msg/dht-chord/dht-chord.tesh @@ -184,7 +184,6 @@ $ $SG_TEST_EXENV ${bindir:=.}/dht-chord$EXEEXT -nb_bits=6 ${srcdir:=.}/cluster.x > [115.044536] (2:node@node-1.acme.org) 40 | 366680 > [115.044536] (2:node@node-1.acme.org) 56 | 366680 > [115.044536] (2:node@node-1.acme.org) Predecessor: 1319738 -> [1151.814423] (0:maestro@) Messages created: 2452 > [1151.814423] (0:maestro@) Simulated time: 1151.81 > [130.161328] (3:node@node-2.acme.org) My finger table: > [130.161328] (3:node@node-2.acme.org) Start | Succ @@ -3223,5 +3222,4 @@ $ $SG_TEST_EXENV ${bindir:=.}/dht-chord$EXEEXT ${srcdir:=.}/routing_none.xml ${s > [ 990.991700] (8:node@node-7.acme.org) 14199064 | 10004760 > [ 990.991700] (8:node@node-7.acme.org) 1616152 | 10004760 > [ 990.991700] (8:node@node-7.acme.org) Predecessor: 6518808 -> [1201.991400] (0:maestro@) Messages created: 2208 > [1201.991400] (0:maestro@) Simulated time: 1201.99 diff --git a/examples/msg/dht-kademlia/dht-kademlia.c b/examples/msg/dht-kademlia/dht-kademlia.c index 1177377716..186c620109 100644 --- a/examples/msg/dht-kademlia/dht-kademlia.c +++ b/examples/msg/dht-kademlia/dht-kademlia.c @@ -15,8 +15,6 @@ */ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_kademlia, "Messages specific for this msg example"); -extern long unsigned int smx_total_comms; - /* Main loop for the process */ static void main_loop(node_t node, double deadline) { @@ -441,7 +439,6 @@ int main(int argc, char *argv[]) msg_error_t res = MSG_main(); - XBT_CRITICAL("Messages created: %ld", smx_total_comms); XBT_INFO("Simulated time: %g", MSG_get_clock()); return res != MSG_OK; diff --git a/examples/msg/dht-kademlia/dht-kademlia.tesh b/examples/msg/dht-kademlia/dht-kademlia.tesh index 22ecfa195c..61f4fd8bf1 100644 --- a/examples/msg/dht-kademlia/dht-kademlia.tesh +++ b/examples/msg/dht-kademlia/dht-kademlia.tesh @@ -30,5 +30,4 @@ $ $SG_TEST_EXENV ${bindir:=.}/dht-kademlia ${srcdir:=.}/cluster.xml ${srcdir:=.} > [780.000000] (10:node@node-9.acme.org) 5/5 FIND_NODE have succeeded > [780.000000] (12:node@node-11.acme.org) 6/6 FIND_NODE have succeeded > [780.000000] ( 4:node@node-3.acme.org) 5/5 FIND_NODE have succeeded -> [780.000000] ( 0:maestro@) Messages created: 1179 > [780.000000] ( 0:maestro@) Simulated time: 780 diff --git a/examples/msg/dht-pastry/dht-pastry.c b/examples/msg/dht-pastry/dht-pastry.c index df375656c2..d0afa78f88 100644 --- a/examples/msg/dht-pastry/dht-pastry.c +++ b/examples/msg/dht-pastry/dht-pastry.c @@ -29,8 +29,6 @@ static int nb_bits = 16; static int timeout = 50; static int max_simulation_time = 1000; -extern long int smx_total_comms; - typedef struct s_node { int id; //128bits generated random(2^128 -1) int known_id; @@ -571,7 +569,6 @@ int main(int argc, char *argv[]) MSG_launch_application(options[1]); msg_error_t res = MSG_main(); - XBT_CRITICAL("Messages created: %ld", smx_total_comms); XBT_INFO("Simulated time: %g", MSG_get_clock()); return res != MSG_OK; diff --git a/examples/msg/dht-pastry/dht-pastry.tesh b/examples/msg/dht-pastry/dht-pastry.tesh index ee9138dd25..8a52ccb3cb 100644 --- a/examples/msg/dht-pastry/dht-pastry.tesh +++ b/examples/msg/dht-pastry/dht-pastry.tesh @@ -2,5 +2,4 @@ p Testing the Chord implementation with MSG -! output sort 19 $ $SG_TEST_EXENV ${bindir:=.}/dht-pastry$EXEEXT -nb_bits=6 ${srcdir:=.}/../../platforms/platform.xml ${srcdir:=.}/dht-pastry_d.xml --cfg=network/crosstraffic:0 --log=msg_pastry.thres:verbose "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" diff --git a/examples/msg/mc/bugged1_liveness.tesh b/examples/msg/mc/bugged1_liveness.tesh index 53442c9920..316ef1429e 100644 --- a/examples/msg/mc/bugged1_liveness.tesh +++ b/examples/msg/mc/bugged1_liveness.tesh @@ -2,7 +2,7 @@ ! expect return 2 ! timeout 20 -! ignore output +! output ignore $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/platform.xml ${srcdir:=.}/deploy_bugged1_liveness.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=contexts/stack_size:256 --cfg=model-check/property:promela_bugged1_liveness > [ 0.000000] (0:maestro@) Check the liveness property promela_bugged1_liveness > [ 0.000000] (2:client@Boivin) Ask the request diff --git a/examples/msg/mc/bugged1_liveness_sparse.tesh b/examples/msg/mc/bugged1_liveness_sparse.tesh index d91a7ce841..e7355864ae 100644 --- a/examples/msg/mc/bugged1_liveness_sparse.tesh +++ b/examples/msg/mc/bugged1_liveness_sparse.tesh @@ -2,8 +2,8 @@ ! expect return 2 ! timeout 20 -! ignore output -$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/platform.xml ${srcdir:=.}/deploy_bugged1_liveness.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=contexts/stack_size:256 --cfg=model-check/sparse_checkpoint:yes --cfg=model-check/property:promela_bugged1_liveness +! output ignore +$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/platform.xml ${srcdir:=.}/deploy_bugged1_liveness.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=contexts/stack_size:256 --cfg=model-check/sparse-checkpoint:yes --cfg=model-check/property:promela_bugged1_liveness > [ 0.000000] (0:maestro@) Check the liveness property promela_bugged1_liveness > [ 0.000000] (2:client@Boivin) Ask the request > [ 0.000000] (3:client@Fafard) Ask the request diff --git a/examples/msg/mc/bugged1_liveness_visited_sparse.tesh b/examples/msg/mc/bugged1_liveness_visited_sparse.tesh index ebea952d7f..a717b1ecec 100644 --- a/examples/msg/mc/bugged1_liveness_visited_sparse.tesh +++ b/examples/msg/mc/bugged1_liveness_visited_sparse.tesh @@ -3,7 +3,7 @@ ! expect return 2 ! timeout 20 ! output ignore -$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/platform.xml ${srcdir:=.}/deploy_bugged1_liveness_visited.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=model-check/visited:100 --cfg=contexts/stack_size:256 --cfg=model-check/sparse_checkpoint:yes --cfg=model-check/property:promela_bugged1_liveness +$ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/bugged1_liveness ${srcdir:=.}/../../platforms/platform.xml ${srcdir:=.}/deploy_bugged1_liveness_visited.xml --log=xbt_cfg.thresh:warning "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=contexts/factory:ucontext --cfg=model-check/visited:100 --cfg=contexts/stack_size:256 --cfg=model-check/sparse-checkpoint:yes --cfg=model-check/property:promela_bugged1_liveness > [ 0.000000] (0:maestro@) Check the liveness property promela_bugged1_liveness > [ 0.000000] (2:client@Boivin) Ask the request > [ 0.000000] (3:client@Fafard) Ask the request diff --git a/examples/platforms/config.xml b/examples/platforms/config.xml index 4dae60f6c8..547e796952 100644 --- a/examples/platforms/config.xml +++ b/examples/platforms/config.xml @@ -7,7 +7,7 @@ - + diff --git a/examples/simdag/throttling/sd_throttling.tesh b/examples/simdag/throttling/sd_throttling.tesh index a9de46fc3a..aeffa60916 100644 --- a/examples/simdag/throttling/sd_throttling.tesh +++ b/examples/simdag/throttling/sd_throttling.tesh @@ -1,8 +1,8 @@ #! ./tesh p Modify the rate of communication tasks even when they are auto-scheduled -$ $SG_TEST_EXENV ./throttling/sd_throttling --cfg=network/TCP_gamma:4194304 ${srcdir:=.}/../platforms/2clusters.xml -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +$ $SG_TEST_EXENV ./throttling/sd_throttling --cfg=network/TCP-gamma:4194304 ${srcdir:=.}/../platforms/2clusters.xml +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks. > [1.000000] [sd_comm_throttling/INFO] Simulation stopped after 1.0000 seconds > [1.000000] [sd_comm_throttling/INFO] Task 'Task A' start time: 0.000000, finish time: 1.000000 diff --git a/examples/simdag/typed_tasks/sd_typed_tasks.tesh b/examples/simdag/typed_tasks/sd_typed_tasks.tesh index 57f8c576b2..00ef0c314b 100644 --- a/examples/simdag/typed_tasks/sd_typed_tasks.tesh +++ b/examples/simdag/typed_tasks/sd_typed_tasks.tesh @@ -1,8 +1,8 @@ #! ./tesh p Usage test of simdag's typed tasks -$ $SG_TEST_EXENV ./typed_tasks/sd_typed_tasks --cfg=network/TCP_gamma:4194304 ${srcdir:=.}/../platforms/2clusters.xml -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +$ $SG_TEST_EXENV ./typed_tasks/sd_typed_tasks --cfg=network/TCP-gamma:4194304 ${srcdir:=.}/../platforms/2clusters.xml +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks. > [2.080300] [sd_typed_tasks_test/INFO] Task 'Seq. comp. 1' start time: 0.000000, finish time: 1.000000 > [2.080300] [sd_typed_tasks_test/INFO] Task 'Par. Comp. 1' start time: 0.000000, finish time: 0.080000 diff --git a/examples/smpi/energy/energy.tesh b/examples/smpi/energy/energy.tesh index b6987ace51..ff2406830b 100644 --- a/examples/smpi/energy/energy.tesh +++ b/examples/smpi/energy/energy.tesh @@ -1,9 +1,9 @@ p Test smpi bindings for dvfs functions (C example) -$ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../platforms/energy_platform.xml --cfg=smpi/cpu_threshold:-1 ${bindir:=.}/smpi_energy --cfg=plugin:Energy --log=smpi_kernel.thres:warning +$ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../platforms/energy_platform.xml --cfg=smpi/cpu-threshold:-1 ${bindir:=.}/smpi_energy --cfg=plugin:Energy --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu-threshold' to '-1' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'plugin' to 'Energy' > [0.000000] [rank 0] Pstates: 3; Powers: 100000000, 50000000, 20000000 > [0.000000] [rank 1] Pstates: 3; Powers: 100000000, 50000000, 20000000 diff --git a/examples/smpi/energy/f77/energy.tesh b/examples/smpi/energy/f77/energy.tesh index f83182c3ef..ee65341856 100644 --- a/examples/smpi/energy/f77/energy.tesh +++ b/examples/smpi/energy/f77/energy.tesh @@ -1,10 +1,10 @@ p Test smpi bindings for dvfs functions (Fortran 77 example) -$ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../platforms/energy_platform.xml --cfg=smpi/cpu_threshold:-1 ${bindir:=.}/f77/sef --cfg=plugin:Energy --log=smpi_kernel.thres:warning +$ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../platforms/energy_platform.xml --cfg=smpi/cpu-threshold:-1 ${bindir:=.}/f77/sef --cfg=plugin:Energy --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu-threshold' to '-1' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'plugin' to 'Energy' > [ 0.0000000000000000 ] [rank 0 ] 3 pstates available > [ 0.0000000000000000 ] [rank 1 ] 3 pstates available diff --git a/examples/smpi/energy/f90/energy.tesh b/examples/smpi/energy/f90/energy.tesh index 02394d7000..78c866405b 100644 --- a/examples/smpi/energy/f90/energy.tesh +++ b/examples/smpi/energy/f90/energy.tesh @@ -1,10 +1,10 @@ p Test smpi bindings for dvfs functions (Fortran 90 example) ! output sort 1 -$ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../platforms/energy_platform.xml --cfg=smpi/cpu_threshold:-1 ${bindir:=.}/f90/sef90 --cfg=plugin:Energy --log=smpi_kernel.thres:warning +$ ../../../smpi_script/bin/smpirun -np 2 -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../../platforms/energy_platform.xml --cfg=smpi/cpu-threshold:-1 ${bindir:=.}/f90/sef90 --cfg=plugin:Energy --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu-threshold' to '-1' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'plugin' to 'Energy' > [ 0.0000000000000000 ] [rank 0 ] 3 pstates available > [ 0.0000000000000000 ] [rank 1 ] 3 pstates available diff --git a/examples/smpi/mc/bugged1_liveness.c b/examples/smpi/mc/bugged1_liveness.c index fff1082c4f..213c888a4e 100644 --- a/examples/smpi/mc/bugged1_liveness.c +++ b/examples/smpi/mc/bugged1_liveness.c @@ -11,7 +11,7 @@ /******************************************************************************/ /* Run : - /usr/bin/time -f "clock:%e user:%U sys:%S swapped:%W exitval:%x max:%Mk" "$@" ../../../smpi_script/bin/smpirun -hostfile hostfile_bugged1_liveness -platform ../../platforms/cluster.xml --cfg=contexts/factory:ucontext --cfg=model-check/reduction:none --cfg=model-check/property:promela_bugged1_liveness --cfg=smpi/send_is_detached_thresh:0 --cfg=contexts/stack_size:128 --cfg=model-check/visited:100000 --cfg=model-check/max_depth:100000 ./bugged1_liveness */ + /usr/bin/time -f "clock:%e user:%U sys:%S swapped:%W exitval:%x max:%Mk" "$@" ../../../smpi_script/bin/smpirun -hostfile hostfile_bugged1_liveness -platform ../../platforms/cluster.xml --cfg=contexts/factory:ucontext --cfg=model-check/reduction:none --cfg=model-check/property:promela_bugged1_liveness --cfg=smpi/send-is-detached-thresh:0 --cfg=contexts/stack_size:128 --cfg=model-check/visited:100000 --cfg=model-check/max_depth:100000 ./bugged1_liveness */ #include #include diff --git a/examples/smpi/mc/non_deterministic.tesh b/examples/smpi/mc/non_deterministic.tesh index 04f1b359d9..e92676d6e6 100644 --- a/examples/smpi/mc/non_deterministic.tesh +++ b/examples/smpi/mc/non_deterministic.tesh @@ -1,7 +1,7 @@ #! ./tesh ! timeout 60 -$ ../../../smpi_script/bin/smpirun -wrapper ${bindir:=.}/../../../bin/simgrid-mc -hostfile ${srcdir:=.}/hostfile_non_deterministic -platform ${srcdir:=.}/../../platforms/cluster.xml --log=xbt_cfg.thresh:warning --cfg=model-check/communications_determinism:1 --cfg=smpi/send_is_detached_thresh:0 --cfg=smpi/running_power:1e9 ./smpi_non_deterministic +$ ../../../smpi_script/bin/smpirun -wrapper ${bindir:=.}/../../../bin/simgrid-mc -hostfile ${srcdir:=.}/hostfile_non_deterministic -platform ${srcdir:=.}/../../platforms/cluster.xml --log=xbt_cfg.thresh:warning --cfg=model-check/communications_determinism:1 --cfg=smpi/send-is-detached-thresh:0 --cfg=smpi/running-power:1e9 ./smpi_non_deterministic > [0.000000] [mc_global/INFO] Check communication determinism > [0.000000] [mc_comm_determinism/INFO] The communications pattern of the process 1 is different! (Different communication : 1) > [0.000000] [mc_comm_determinism/INFO] **************************************************** diff --git a/examples/smpi/mc/only_send_deterministic.c b/examples/smpi/mc/only_send_deterministic.c index ada5cd4551..ffc01310ee 100644 --- a/examples/smpi/mc/only_send_deterministic.c +++ b/examples/smpi/mc/only_send_deterministic.c @@ -1,4 +1,4 @@ -/* ../../../smpi_script/bin/smpirun -hostfile hostfile_send_deterministic -platform ../../platforms/cluster.xml -np 3 --cfg=smpi/send_is_detached_thresh:0 gdb\ --args\ ./send_deterministic */ +/* ../../../smpi_script/bin/smpirun -hostfile hostfile_send_deterministic -platform ../../platforms/cluster.xml -np 3 --cfg=smpi/send-is-detached-thresh:0 gdb\ --args\ ./send_deterministic */ /* Copyright (c) 2009-2015. The SimGrid Team. * All rights reserved. */ diff --git a/examples/smpi/mc/only_send_deterministic.tesh b/examples/smpi/mc/only_send_deterministic.tesh index 10cdd9a736..e8d4a6af00 100644 --- a/examples/smpi/mc/only_send_deterministic.tesh +++ b/examples/smpi/mc/only_send_deterministic.tesh @@ -1,7 +1,7 @@ #! ./tesh ! timeout 60 -$ ../../../smpi_script/bin/smpirun -wrapper "${bindir:=.}/../../../bin/simgrid-mc" --log=xbt_cfg.thresh:warning -hostfile ${srcdir:=.}/hostfile_only_send_deterministic -platform ${srcdir:=.}/../../platforms/cluster.xml --cfg=model-check/communications_determinism:1 --cfg=smpi/send_is_detached_thresh:0 --cfg=smpi/running_power:1e9 ./smpi_only_send_deterministic +$ ../../../smpi_script/bin/smpirun -wrapper "${bindir:=.}/../../../bin/simgrid-mc" --log=xbt_cfg.thresh:warning -hostfile ${srcdir:=.}/hostfile_only_send_deterministic -platform ${srcdir:=.}/../../platforms/cluster.xml --cfg=model-check/communications_determinism:1 --cfg=smpi/send-is-detached-thresh:0 --cfg=smpi/running-power:1e9 ./smpi_only_send_deterministic > [0.000000] [mc_comm_determinism/INFO] Check communication determinism > [0.000000] [mc_comm_determinism/INFO] ****************************************************** > [0.000000] [mc_comm_determinism/INFO] **** Only-send-deterministic communication pattern **** diff --git a/examples/smpi/replay/replay.tesh b/examples/smpi/replay/replay.tesh index 1b3b38846b..743814a132 100644 --- a/examples/smpi/replay/replay.tesh +++ b/examples/smpi/replay/replay.tesh @@ -8,11 +8,11 @@ p Test of trace replay with SMPI (one trace for all processes) $ mkfile replay/one_trace ! timeout 60 -$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:-1 -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning +$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu-threshold:-1 -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu-threshold' to '-1' > [Tremblay:0:(1) 0.000000] [smpi_replay/VERBOSE] 0 bcast 5e4 0.000000 > [Jupiter:1:(2) 0.015036] [smpi_replay/VERBOSE] 1 bcast 5e4 0.015036 > [Fafard:2:(3) 0.015676] [smpi_replay/VERBOSE] 2 bcast 5e4 0.015676 @@ -37,14 +37,14 @@ p The same with tracing activated < replay/actions_bcast.txt $ mkfile replay/one_trace -$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=no_loc --cfg=tracing:yes --cfg=tracing/smpi:yes --cfg=tracing/smpi/computing:yes --cfg=smpi/cpu_threshold:-1 -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning +$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=no_loc --cfg=tracing:yes --cfg=tracing/smpi:yes --cfg=tracing/smpi/computing:yes --cfg=smpi/cpu-threshold:-1 -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/computing' to 'yes' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu-threshold' to '-1' > [Fafard:2:(3) 19.691622] [smpi_replay/INFO] Simulation time 19.691622 $ rm -f replay/one_trace @@ -226,11 +226,11 @@ p Another test of trace replay with SMPI (one trace per process) < replay/actions1.txt $ mkfile ./split_traces_tesh -$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:-1 -np 2 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay ./split_traces_tesh --log=smpi_kernel.thres:warning +$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu-threshold:-1 -np 2 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay ./split_traces_tesh --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu-threshold' to '-1' > [Tremblay:0:(1) 0.164463] [smpi_replay/VERBOSE] 0 send 1 1e6 0.164463 > [Jupiter:1:(2) 0.164463] [smpi_replay/VERBOSE] 1 recv 0 1e6 0.164463 > [Jupiter:1:(2) 13.271310] [smpi_replay/VERBOSE] 1 compute 1e9 13.106847 @@ -248,11 +248,11 @@ p Test of barrier replay with SMPI (one trace for all processes) < replay/actions_barrier.txt $ mkfile replay/one_trace -$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:-1 -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning +$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu-threshold:-1 -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu-threshold' to '-1' > [Tremblay:0:(1) 1.491472] [smpi_replay/VERBOSE] 0 send 1 1e7 1.491472 > [Jupiter:1:(2) 1.491472] [smpi_replay/VERBOSE] 1 recv 0 1e7 1.491472 > [Tremblay:0:(1) 1.493448] [smpi_replay/VERBOSE] 0 barrier 0.001976 @@ -270,11 +270,11 @@ p Test of Isend replay with SMPI (one trace for all processes) < replay/actions_with_isend.txt $ mkfile replay/one_trace -$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:-1 -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning +$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu-threshold:-1 -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu-threshold' to '-1' > [Jupiter:1:(2) 0.000000] [smpi_replay/VERBOSE] 1 Irecv 0 1e6 0.000000 > [Jupiter:1:(2) 6.553424] [smpi_replay/VERBOSE] 1 compute 5e8 6.553424 > [Jupiter:1:(2) 6.553524] [smpi_replay/VERBOSE] 1 test 0.000100 @@ -301,11 +301,11 @@ p Test of Isend replay with SMPI (one trace for all processes) < replay/actions_allReduce.txt $ mkfile replay/one_trace -$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:-1 -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning +$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu-threshold:-1 -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu-threshold' to '-1' > [Tremblay:0:(1) 5.112775] [smpi_replay/VERBOSE] 0 allReduce 5e4 5e8 5.112775 > [Jupiter:1:(2) 6.584135] [smpi_replay/VERBOSE] 1 allReduce 5e4 5e8 6.584135 > [Fafard:2:(3) 6.584775] [smpi_replay/VERBOSE] 2 allReduce 5e4 5e8 6.584775 @@ -321,11 +321,11 @@ p Test of AllToAll replay with SMPI (one trace for all processes) < replay/actions_alltoall.txt $ mkfile replay/one_trace -$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:-1 -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning +$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu-threshold:-1 -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu-threshold' to '-1' > [Tremblay:0:(1) 0.004041] [smpi_replay/VERBOSE] 0 allToAll 500 500 0.004041 > [Fafard:2:(3) 0.006920] [smpi_replay/VERBOSE] 2 allToAll 500 500 0.006920 > [Jupiter:1:(2) 0.006920] [smpi_replay/VERBOSE] 1 allToAll 500 500 0.006920 @@ -338,11 +338,11 @@ p Test of AllToAllv replay with SMPI (one trace for all processes) < replay/actions_alltoallv.txt $ mkfile replay/one_trace -$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:-1 -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning +$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu-threshold:-1 -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu-threshold' to '-1' > [Tremblay:0:(1) 0.003999] [smpi_replay/VERBOSE] 0 allToAllV 100 1 40 30 1000 1 80 100 0.003999 > [Jupiter:1:(2) 0.006934] [smpi_replay/VERBOSE] 1 allToAllV 1000 80 1 40 1000 40 1 30 0.006934 > [Fafard:2:(3) 0.006936] [smpi_replay/VERBOSE] 2 allToAllV 1000 100 30 1 1000 30 40 1 0.006936 @@ -355,11 +355,11 @@ p Test of AllGatherv replay with SMPI (one trace for all processes) < replay/actions_allgatherv.txt $ mkfile replay/one_trace -$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:-1 -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning +$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu-threshold:-1 -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu-threshold' to '-1' > [Tremblay:0:(1) 0.882872] [smpi_replay/VERBOSE] 0 allGatherV 275427 275427 275427 275427 204020 0 0 0.882872 > [Fafard:2:(3) 1.300605] [smpi_replay/VERBOSE] 2 allGatherV 275427 275427 275427 275427 204020 0 0 1.300605 > [Jupiter:1:(2) 1.300605] [smpi_replay/VERBOSE] 1 allGatherV 275427 275427 275427 275427 204020 0 0 1.300605 @@ -373,11 +373,11 @@ p Test of waitall replay with SMPI (one trace for all processes) $ mkfile replay/one_trace ! output sort 19 -$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu_threshold:-1 -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning +$ ../../smpi_script/bin/smpirun -ext smpi_replay --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/cpu-threshold:-1 -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay replay/one_trace --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu-threshold' to '-1' > [Fafard:2:(3) 0.000000] [smpi_replay/VERBOSE] 2 Irecv 1 3000 0.000000 > [Fafard:2:(3) 0.000000] [smpi_replay/VERBOSE] 2 Isend 0 3000 0.000000 > [Jupiter:1:(2) 0.000000] [smpi_replay/VERBOSE] 1 Isend 0 2000 0.000000 diff --git a/examples/smpi/replay_multiple/replay_multiple.tesh b/examples/smpi/replay_multiple/replay_multiple.tesh index 0b4e7e0dd0..2925fa90c2 100644 --- a/examples/smpi/replay_multiple/replay_multiple.tesh +++ b/examples/smpi/replay_multiple/replay_multiple.tesh @@ -7,7 +7,7 @@ $ ${srcdir:=.}/generate_multiple_deployment.sh -platform ${srcdir:=.}/../../plat $ ./replay_multiple description_file ${srcdir:=.}/../../platforms/small_platform_with_routers.xml ${srcdir:=.}/deployment.xml --log=smpi.:info > [0.000000] [msg_test/INFO] Initializing instance 1 of size 32 > [0.000000] [msg_test/INFO] Initializing instance 2 of size 32 -> [0.000000] [smpi_kernel/INFO] You did not set the power of the host running the simulation. The timings will certainly not be accurate. Use the option "--cfg=smpi/running_power:" to set its value.Check http://simgrid.org/simgrid/latest/doc/options.html#options_smpi_bench for more information. +> [0.000000] [smpi_kernel/INFO] You did not set the power of the host running the simulation. The timings will certainly not be accurate. Use the option "--cfg=smpi/running-power:" to set its value.Check http://simgrid.org/simgrid/latest/doc/options.html#options_smpi_bench for more information. > [Jupiter:2:(52) 1140688.493796] [smpi_replay/INFO] Simulation time 1124371.141124 > [1140688.493796] [msg_test/INFO] Simulation time 1.14069e+06 diff --git a/examples/smpi/smpi_msg_masterslave/msg_smpi.tesh b/examples/smpi/smpi_msg_masterslave/msg_smpi.tesh index 7f906c0a37..104ea72e08 100644 --- a/examples/smpi/smpi_msg_masterslave/msg_smpi.tesh +++ b/examples/smpi/smpi_msg_masterslave/msg_smpi.tesh @@ -1,6 +1,6 @@ p Test the use of SMPI+MSG in the same file, as well as several different SMPI instances at the same time $ ./masterslave_mailbox_smpi ${srcdir:=.}/../../platforms/small_platform_with_routers.xml ${srcdir:=.}/deployment_masterslave_mailbox_smpi.xml --log=smpi.:info -> [0.000000] [smpi_kernel/INFO] You did not set the power of the host running the simulation. The timings will certainly not be accurate. Use the option "--cfg=smpi/running_power:" to set its value.Check http://simgrid.org/simgrid/latest/doc/options.html#options_smpi_bench for more information. +> [0.000000] [smpi_kernel/INFO] You did not set the power of the host running the simulation. The timings will certainly not be accurate. Use the option "--cfg=smpi/running-power:" to set its value.Check http://simgrid.org/simgrid/latest/doc/options.html#options_smpi_bench for more information. > [Tremblay:master:(1) 0.000000] [msg_test/INFO] Got 1 slaves and 20 tasks to process > [Tremblay:master:(1) 0.000000] [msg_test/INFO] Sending "Task_0" (of 20) to mailbox "slave-0" > [Ginette:master_mpi:(3) 0.000000] [msg_test/INFO] here for rank 0 diff --git a/examples/smpi/trace/trace.tesh b/examples/smpi/trace/trace.tesh index da15bdc6b8..63a90180ff 100644 --- a/examples/smpi/trace/trace.tesh +++ b/examples/smpi/trace/trace.tesh @@ -11,6 +11,6 @@ $ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-file smpi_trace.tr > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/uncategorized' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' $ rm -f smpi_trace.trace \ No newline at end of file diff --git a/examples/smpi/trace_simple/trace_simple.tesh b/examples/smpi/trace_simple/trace_simple.tesh index e2b24cbd16..251e7b1ac6 100644 --- a/examples/smpi/trace_simple/trace_simple.tesh +++ b/examples/smpi/trace_simple/trace_simple.tesh @@ -11,7 +11,7 @@ $ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-file smpi_trace.tr > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/uncategorized' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' p Another SMPI test, with only -trace $ ../../smpi_script/bin/smpirun -trace -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./trace_simple/smpi_trace_simple --log=smpi_kernel.thres:warning @@ -20,13 +20,13 @@ $ ../../smpi_script/bin/smpirun -trace -trace-file smpi_trace.trace -hostfile ${ > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' p Testing without trace parameters $ ../../smpi_script/bin/smpirun -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./trace_simple/smpi_trace_simple --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' p Testing grouped tracing $ ../../smpi_script/bin/smpirun -trace -trace-grouped -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./trace_simple/smpi_trace_simple --log=smpi_kernel.thres:warning @@ -36,10 +36,10 @@ $ ../../smpi_script/bin/smpirun -trace -trace-grouped -trace-file smpi_trace.tra > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/group' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' p Testing generation of viva configuration files -$ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-viva -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg --cfg=smpi/cpu_threshold:-1 -np 3 ./trace_simple/smpi_trace_simple --log=smpi_kernel.thres:warning +$ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-viva -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg --cfg=smpi/cpu-threshold:-1 -np 3 ./trace_simple/smpi_trace_simple --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'smpi_trace.trace' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi' to 'yes' @@ -49,14 +49,14 @@ $ ../../smpi_script/bin/smpirun -trace -trace-resource -trace-viva -trace-file s > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'viva/uncategorized' to 'smpi_uncat.plist' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu-threshold' to '-1' > [0.003952] [instr_config/INFO] No categories declared, ignoring generation of viva graph configuration p Testing with parameters but without activating them with the safe switch (-trace) $ ../../smpi_script/bin/smpirun -trace-resource -trace-viva -trace-file smpi_trace.trace -hostfile ${srcdir:=.}/hostfile -platform ${srcdir:=.}/../platforms/small_platform.xml --cfg=path:${srcdir:=.}/../msg -np 3 ./trace_simple/smpi_trace_simple --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' $ rm -f smpi_trace.trace smpi_uncat.plist smpi_cat.plist diff --git a/include/simgrid/forward.h b/include/simgrid/forward.h index b1eab3a6e3..549c031112 100644 --- a/include/simgrid/forward.h +++ b/include/simgrid/forward.h @@ -13,6 +13,7 @@ namespace simgrid { namespace s4u { class As; class Host; + class Mailbox; } namespace surf { class Resource; @@ -26,8 +27,9 @@ namespace simgrid { } } -typedef simgrid::s4u::Host simgrid_Host; typedef simgrid::s4u::As simgrid_As; +typedef simgrid::s4u::Host simgrid_Host; +typedef simgrid::s4u::Mailbox simgrid_Mailbox; typedef simgrid::surf::Cpu surf_Cpu; typedef simgrid::surf::NetCard surf_NetCard; typedef simgrid::surf::Link Link; @@ -36,8 +38,9 @@ typedef simgrid::trace_mgr::trace tmgr_Trace; #else -typedef struct simgrid_Host simgrid_Host; typedef struct simgrid_As simgrid_As; +typedef struct simgrid_Host simgrid_Host; +typedef struct simgrid_Mailbox simgrid_Mailbox; typedef struct surf_Cpu surf_Cpu; typedef struct surf_NetCard surf_NetCard; typedef struct surf_Resource surf_Resource; @@ -45,8 +48,9 @@ typedef struct Link Link; typedef struct Trace tmgr_Trace; #endif -typedef simgrid_Host* sg_host_t; typedef simgrid_As *AS_t; +typedef simgrid_Host* sg_host_t; +typedef simgrid_Mailbox* sg_mbox_t; typedef surf_Cpu *surf_cpu_t; typedef surf_NetCard *sg_netcard_t; diff --git a/include/simgrid/msg.h b/include/simgrid/msg.h index 0ea4c0ef63..ee53c52c49 100644 --- a/include/simgrid/msg.h +++ b/include/simgrid/msg.h @@ -26,7 +26,7 @@ SG_BEGIN_DECL() * #MSG_task_send and friends) hide this object behind a string * alias. That mean that you don't provide the mailbox on which you * want to send your task, but only the name of this mailbox. */ -typedef struct s_smx_rvpoint *msg_mailbox_t; +typedef struct s_smx_mailbox *msg_mailbox_t; /* ******************************** Environment ************************************ */ typedef simgrid_As *msg_as_t; @@ -440,7 +440,6 @@ XBT_PUBLIC(msg_task_t) MSG_comm_get_task(msg_comm_t comm); XBT_PUBLIC(msg_error_t) MSG_comm_get_status(msg_comm_t comm); XBT_PUBLIC(int) MSG_task_listen(const char *alias); -XBT_PUBLIC(int) MSG_task_listen_from_host(const char *alias, msg_host_t host); XBT_PUBLIC(msg_error_t) MSG_task_send_with_timeout(msg_task_t task, const char *alias, double timeout); XBT_PUBLIC(msg_error_t) MSG_task_send_with_timeout_bounded(msg_task_t task, const char *alias, double timeout, double maxrate); XBT_PUBLIC(msg_error_t) MSG_task_send(msg_task_t task, const char *alias); @@ -487,20 +486,10 @@ XBT_PUBLIC(void) MSG_mailbox_set_async(const char *alias); */ XBT_PUBLIC(msg_task_t) MSG_mailbox_get_head(msg_mailbox_t mailbox); -/* @brief MSG_mailbox_get_count_host_waiting_tasks - * Return the number of tasks waiting to be received in a mailbox and sent by a host. - * @param mailbox The mailbox concerned by the operation. - * @param host The host containing the processes that sended the tasks. - * @return The number of tasks in the mailbox specified by the parameter mailbox and sended by all the - * processes located on the host specified by the parameter host. - */ -XBT_PUBLIC(int) MSG_mailbox_get_count_host_waiting_tasks(msg_mailbox_t mailbox, msg_host_t host); XBT_PUBLIC(msg_error_t) MSG_mailbox_get_task_ext(msg_mailbox_t mailbox, msg_task_t * task, msg_host_t host, double timeout); XBT_PUBLIC(msg_error_t) MSG_mailbox_get_task_ext_bounded(msg_mailbox_t mailbox, msg_task_t *task, msg_host_t host, double timeout, double rate); -XBT_PUBLIC(msg_error_t) MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, msg_task_t task, double timeout); - /************************** Action handling **********************************/ XBT_PUBLIC(msg_error_t) MSG_action_trace_run(char *path); diff --git a/include/simgrid/s4u/mailbox.hpp b/include/simgrid/s4u/mailbox.hpp index b30bdfeb35..387f63b6d8 100644 --- a/include/simgrid/s4u/mailbox.hpp +++ b/include/simgrid/s4u/mailbox.hpp @@ -6,10 +6,12 @@ #ifndef SIMGRID_S4U_MAILBOX_HPP #define SIMGRID_S4U_MAILBOX_HPP -#include - #include #include + +#ifdef __cplusplus + +# include #include namespace simgrid { @@ -38,6 +40,8 @@ public: const char *getName(); /** Retrieve the mailbox associated to the given string */ static Mailbox *byName(const char *name); + /** Returns whether the mailbox contains queued communications */ + bool empty(); private: std::string name_; @@ -46,4 +50,9 @@ private: }; }} // namespace simgrid::s4u +#endif /* C++ */ + +XBT_PUBLIC(sg_mbox_t) sg_mbox_by_name(const char*name); +XBT_PUBLIC(int) sg_mbox_is_empty(sg_mbox_t mbox); + #endif /* SIMGRID_S4U_MAILBOX_HPP */ diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index ae24e72b22..4ac35a10f8 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -136,9 +136,9 @@ typedef smx_process_t (*smx_creation_func_t) ( /******************************* Networking ***********************************/ /** - * \ingroup simix_rdv_management + * \ingroup simix_mbox_management */ -typedef struct s_smx_rvpoint *smx_mailbox_t; +typedef struct s_smx_mailbox *smx_mailbox_t; XBT_PUBLIC(void*) SIMIX_comm_get_src_data(smx_synchro_t synchro); XBT_PUBLIC(void*) SIMIX_comm_get_dst_data(smx_synchro_t synchro); @@ -258,9 +258,9 @@ XBT_PUBLIC(void) SIMIX_comm_set_copy_data_callback(void (*callback) (smx_synchro XBT_PUBLIC(void) SIMIX_comm_copy_pointer_callback(smx_synchro_t comm, void* buff, size_t buff_size); XBT_PUBLIC(void) SIMIX_comm_copy_buffer_callback(smx_synchro_t comm, void* buff, size_t buff_size); -XBT_PUBLIC(smx_synchro_t) SIMIX_comm_get_send_match(smx_mailbox_t rdv, int (*match_fun)(void*, void*), void* data); -XBT_PUBLIC(int) SIMIX_comm_has_send_match(smx_mailbox_t rdv, int (*match_fun)(void*, void*), void* data); -XBT_PUBLIC(int) SIMIX_comm_has_recv_match(smx_mailbox_t rdv, int (*match_fun)(void*, void*), void* data); +XBT_PUBLIC(smx_synchro_t) SIMIX_comm_get_send_match(smx_mailbox_t mbox, int (*match_fun)(void*, void*), void* data); +XBT_PUBLIC(int) SIMIX_comm_has_send_match(smx_mailbox_t mbox, int (*match_fun)(void*, void*), void* data); +XBT_PUBLIC(int) SIMIX_comm_has_recv_match(smx_mailbox_t mbox, int (*match_fun)(void*, void*), void* data); XBT_PUBLIC(void) SIMIX_comm_finish(smx_synchro_t synchro); /******************************************************************************/ @@ -365,26 +365,22 @@ XBT_PUBLIC(e_smx_state_t) simcall_process_sleep(double duration); /************************** Comunication simcalls *****************************/ /***** Rendez-vous points *****/ -XBT_PUBLIC(smx_mailbox_t) simcall_rdv_create(const char *name); -XBT_PUBLIC(void) simcall_rdv_destroy(smx_mailbox_t rvp); -XBT_PUBLIC(smx_mailbox_t) simcall_rdv_get_by_name(const char *name); -XBT_PUBLIC(int) simcall_rdv_comm_count_by_host(smx_mailbox_t rdv, sg_host_t host); -XBT_PUBLIC(smx_synchro_t) simcall_rdv_get_head(smx_mailbox_t rdv); -XBT_PUBLIC(smx_process_t) simcall_rdv_get_receiver(smx_mailbox_t rdv); -XBT_PUBLIC(void) simcall_rdv_set_receiver(smx_mailbox_t rdv , smx_process_t process); - -XBT_PUBLIC(xbt_dict_t) SIMIX_get_rdv_points(void); +XBT_PUBLIC(smx_mailbox_t) simcall_mbox_create(const char *name); +XBT_PUBLIC(smx_mailbox_t) simcall_mbox_get_by_name(const char *name); +XBT_PUBLIC(smx_synchro_t) simcall_mbox_get_head(smx_mailbox_t mbox); +XBT_PUBLIC(smx_process_t) simcall_mbox_get_receiver(smx_mailbox_t mbox); +XBT_PUBLIC(void) simcall_mbox_set_receiver(smx_mailbox_t mbox , smx_process_t process); /***** Communication simcalls *****/ -XBT_PUBLIC(void) simcall_comm_send(smx_process_t sender, smx_mailbox_t rdv, double task_size, +XBT_PUBLIC(void) simcall_comm_send(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void *src_buff, size_t src_buff_size, int (*match_fun)(void *, void *, smx_synchro_t), void (*copy_data_fun)(smx_synchro_t, void*, size_t), void *data, double timeout); -XBT_PUBLIC(smx_synchro_t) simcall_comm_isend(smx_process_t sender, smx_mailbox_t rdv, +XBT_PUBLIC(smx_synchro_t) simcall_comm_isend(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void *src_buff, size_t src_buff_size, @@ -393,19 +389,19 @@ XBT_PUBLIC(smx_synchro_t) simcall_comm_isend(smx_process_t sender, smx_mailbox_t void (*copy_data_fun)(smx_synchro_t, void*, size_t), void *data, int detached); -XBT_PUBLIC(void) simcall_comm_recv(smx_process_t receiver, smx_mailbox_t rdv, void *dst_buff, +XBT_PUBLIC(void) simcall_comm_recv(smx_process_t receiver, smx_mailbox_t mbox, void *dst_buff, size_t * dst_buff_size, int (*match_fun)(void *, void *, smx_synchro_t), void (*copy_data_fun)(smx_synchro_t, void*, size_t), void *data, double timeout, double rate); -XBT_PUBLIC(smx_synchro_t) simcall_comm_irecv(smx_process_t receiver, smx_mailbox_t rdv, void *dst_buff, +XBT_PUBLIC(smx_synchro_t) simcall_comm_irecv(smx_process_t receiver, smx_mailbox_t mbox, void *dst_buff, size_t * dst_buff_size, int (*match_fun)(void *, void *, smx_synchro_t), void (*copy_data_fun)(smx_synchro_t, void*, size_t), void *data, double rate); -XBT_PUBLIC(smx_synchro_t) simcall_comm_iprobe(smx_mailbox_t rdv, int type, int src, int tag, +XBT_PUBLIC(smx_synchro_t) simcall_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, int (*match_fun)(void *, void *, smx_synchro_t), void *data); XBT_PUBLIC(void) simcall_comm_cancel(smx_synchro_t comm); diff --git a/include/simgrid_config.h.in b/include/simgrid_config.h.in index 1ff20fa033..d6808fc22b 100644 --- a/include/simgrid_config.h.in +++ b/include/simgrid_config.h.in @@ -24,6 +24,4 @@ #define HAVE_MC @HAVE_MC@ /* Was the model-checking compiled in? */ #define HAVE_NS3 @HAVE_NS3@ /* Was the NS3 support compiled in? */ -#define SIMGRID_HAVE_LIBSIG @SIMGRID_HAVE_LIBSIG@ /* Used in the public interface xbt/signal.hpp :( */ - #endif /* SIMGRID_PUBLIC_CONFIG_H */ diff --git a/include/xbt/fifo.h b/include/xbt/fifo.h index ec66ad1d5d..1f152d5392 100644 --- a/include/xbt/fifo.h +++ b/include/xbt/fifo.h @@ -79,8 +79,8 @@ XBT_PUBLIC(xbt_fifo_item_t) xbt_fifo_get_prev_item(xbt_fifo_item_t i); * asserts and stuff * \param f a list (#xbt_fifo_t) * \param i a bucket (#xbt_fifo_item_t) - * \param type a type * \param n an object of type \a type. + * \param type the type of objects contained in the fifo * @hideinitializer * * Iterates over the whole list. diff --git a/include/xbt/signal.hpp b/include/xbt/signal.hpp index 26bd2df57f..08fbff611a 100644 --- a/include/xbt/signal.hpp +++ b/include/xbt/signal.hpp @@ -6,53 +6,43 @@ #ifndef SIMGRID_XBT_SIGNAL_HPP #define SIMGRID_XBT_SIGNAL_HPP -#include "simgrid_config.h" -#if SIMGRID_HAVE_LIBSIG -#include -#else -#include -#endif +#include +#include namespace simgrid { namespace xbt { -#if SIMGRID_HAVE_LIBSIG + template class signal; - // Wraps sigc++ signals with the interface of boost::signals2: - template class signal; + /** A signal/slot mechanism + * + * S is expected to be the function signature of the signal. + * I'm not sure we need a return value (it is currently ignored). + * If we don't we might use `signal` instead. + */ template class signal { private: - sigc::signal sig_; + typedef std::function callback_type; + std::vector handlers_; public: template XBT_ALWAYS_INLINE - void connect(U&& slot) - { - sig_.connect(std::forward(slot)); - } - template XBT_ALWAYS_INLINE - void connect(Res(*slot)(Args...)) + void connect(U slot) { - sig_.connect(sigc::ptr_fun(slot)); + handlers_.push_back(std::move(slot)); } - template XBT_ALWAYS_INLINE - R operator()(Args&&... args) const + XBT_ALWAYS_INLINE + R operator()(P... args) const { - return sig_.emit(std::forward(args)...); + for (auto& handler : handlers_) + handler(args...); } void disconnect_all_slots() { - sig_.clear(); + handlers_.clear(); } }; -#else - - template - using signal = ::boost::signals2::signal; - -#endif - } } diff --git a/include/xbt/synchro_core.h b/include/xbt/synchro_core.h index 9f94e82b3c..50684edca2 100644 --- a/include/xbt/synchro_core.h +++ b/include/xbt/synchro_core.h @@ -31,7 +31,7 @@ SG_BEGIN_DECL() /** @brief Thread mutex data type (opaque object) * @hideinitializer */ -typedef struct s_xbt_mutex_ *xbt_mutex_t; +typedef struct s_smx_mutex_ *xbt_mutex_t; /** @brief Creates a new mutex variable */ XBT_PUBLIC(xbt_mutex_t) xbt_mutex_init(void); @@ -57,7 +57,7 @@ XBT_PUBLIC(void) xbt_mutex_destroy(xbt_mutex_t mutex); /** @brief Thread condition data type (opaque object) * @hideinitializer */ -typedef struct s_xbt_cond_ *xbt_cond_t; +typedef struct s_smx_cond_ *xbt_cond_t; /** @brief Creates a condition variable */ XBT_PUBLIC(xbt_cond_t) xbt_cond_init(void); diff --git a/src/bindings/java/jmsg_task.cpp b/src/bindings/java/jmsg_task.cpp index 5e83bf3a2b..b6b45eed90 100644 --- a/src/bindings/java/jmsg_task.cpp +++ b/src/bindings/java/jmsg_task.cpp @@ -359,13 +359,10 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_sendBounded(JNIEnv * env,jobjec JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receive(JNIEnv * env, jclass cls, jstring jalias, jdouble jtimeout, jobject jhost) { - msg_error_t rv; - msg_task_t *task = xbt_new(msg_task_t,1); - *task = NULL; + msg_task_t task = NULL; msg_host_t host = NULL; jobject jtask_global, jtask_local; - const char *alias; if (jhost) { host = jhost_get_native(env, jhost); @@ -376,25 +373,23 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_receive(JNIEnv * env, jclass } } - alias = env->GetStringUTFChars(jalias, 0); - rv = MSG_task_receive_ext(task, alias, (double) jtimeout, host); + const char *alias = env->GetStringUTFChars(jalias, 0); + msg_error_t rv = MSG_task_receive_ext(&task, alias, (double) jtimeout, host); if (env->ExceptionOccurred()) return NULL; if (rv != MSG_OK) { jmsg_throw_status(env,rv); return NULL; } - jtask_global = (jobject) MSG_task_get_data(*task); + jtask_global = (jobject) MSG_task_get_data(task); /* Convert the global ref into a local ref so that the JVM can free the stuff */ jtask_local = env->NewLocalRef(jtask_global); env->DeleteGlobalRef(jtask_global); - MSG_task_set_data(*task, NULL); + MSG_task_set_data(task, NULL); env->ReleaseStringUTFChars(jalias, alias); - xbt_free(task); - return (jobject) jtask_local; } @@ -657,24 +652,6 @@ JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Task_listen(JNIEnv * env, jclass return (jboolean) rv; } -JNIEXPORT jint JNICALL Java_org_simgrid_msg_Task_listenFromHost(JNIEnv * env, jclass cls, jstring jalias, jobject jhost) -{ - int rv; - const char *alias; - - msg_host_t host = jhost_get_native(env, jhost); - - if (!host) { - jxbt_throw_notbound(env, "host", jhost); - return -1; - } - alias = env->GetStringUTFChars(jalias, 0); - rv = MSG_task_listen_from_host(alias, host); - env->ReleaseStringUTFChars(jalias, alias); - - return (jint) rv; -} - JNIEXPORT jint JNICALL Java_org_simgrid_msg_Task_listenFrom(JNIEnv * env, jclass cls, jstring jalias) { int rv; diff --git a/src/bindings/java/org/simgrid/msg/Task.java b/src/bindings/java/org/simgrid/msg/Task.java index ac034b6c0a..5007cc4646 100644 --- a/src/bindings/java/org/simgrid/msg/Task.java +++ b/src/bindings/java/org/simgrid/msg/Task.java @@ -358,11 +358,6 @@ public class Task { */ public native static boolean listen(String mailbox); - /** - * Counts the number of tasks waiting to be received on the \a mailbox identified by the specified alia and sended by the specified \a host. - */ - public native static int listenFromHost(String alias, Host host); - /** * Class initializer, to initialize various JNI stuff */ diff --git a/src/bindings/lua/lua_platf.cpp b/src/bindings/lua/lua_platf.cpp index 9d52127c65..bc870a619f 100644 --- a/src/bindings/lua/lua_platf.cpp +++ b/src/bindings/lua/lua_platf.cpp @@ -541,7 +541,7 @@ void sglua_register_platf_functions(lua_State* L) { lua_getglobal(L, "simgrid"); /* simgrid */ luaL_newlib(L, platf_functions); /* simgrid simgrid.platf */ - lua_setfield(L, -2, "platf"); /* simgrid */ + lua_setfield(L, -2, "engine"); /* simgrid */ lua_pop(L, 1); /* -- */ } diff --git a/src/instr/instr_TI_trace.cpp b/src/instr/instr_TI_trace.cpp index 3d567cf88a..fa32d4c56a 100644 --- a/src/instr/instr_TI_trace.cpp +++ b/src/instr/instr_TI_trace.cpp @@ -69,7 +69,7 @@ void print_TICreateContainer(paje_event_t event) prefix = xbt_os_time(); } - if (!xbt_cfg_get_boolean("tracing/smpi/format/ti_one_file") || temp == NULL) { + if (!xbt_cfg_get_boolean("tracing/smpi/format/ti-one-file") || temp == NULL) { char *folder_name = bprintf("%s_files", TRACE_get_filename()); char *filename = bprintf("%s/%f_%s.txt", folder_name, prefix, ((createContainer_t) event->data)->container->name); #ifdef WIN32 @@ -90,7 +90,7 @@ void print_TICreateContainer(paje_event_t event) void print_TIDestroyContainer(paje_event_t event) { - if (!xbt_cfg_get_boolean("tracing/smpi/format/ti_one_file")|| xbt_dict_length(tracing_files) == 1) { + if (!xbt_cfg_get_boolean("tracing/smpi/format/ti-one-file")|| xbt_dict_length(tracing_files) == 1) { FILE* f = (FILE*)xbt_dict_get_or_null(tracing_files, ((destroyContainer_t) event->data)->container->name); fclose(f); } diff --git a/src/instr/instr_config.cpp b/src/instr/instr_config.cpp index 3d844afa36..0e2f3e2d95 100644 --- a/src/instr/instr_config.cpp +++ b/src/instr/instr_config.cpp @@ -14,18 +14,18 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_config, instr, "Configuration"); #define OPT_TRACING_BASIC "tracing/basic" #define OPT_TRACING_BUFFER "tracing/buffer" #define OPT_TRACING_CATEGORIZED "tracing/categorized" -#define OPT_TRACING_COMMENT_FILE "tracing/comment_file" +#define OPT_TRACING_COMMENT_FILE "tracing/comment-file" #define OPT_TRACING_COMMENT "tracing/comment" -#define OPT_TRACING_DISABLE_DESTROY "tracing/disable_destroy" -#define OPT_TRACING_DISABLE_LINK "tracing/disable_link" -#define OPT_TRACING_DISABLE_POWER "tracing/disable_power" -#define OPT_TRACING_DISPLAY_SIZES "tracing/smpi/display_sizes" +#define OPT_TRACING_DISABLE_DESTROY "tracing/disable-destroy" +#define OPT_TRACING_DISABLE_LINK "tracing/disable-link" +#define OPT_TRACING_DISABLE_POWER "tracing/disable-power" +#define OPT_TRACING_DISPLAY_SIZES "tracing/smpi/display-sizes" #define OPT_TRACING_FILENAME "tracing/filename" -#define OPT_TRACING_FORMAT_TI_ONEFILE "tracing/smpi/format/ti_one_file" +#define OPT_TRACING_FORMAT_TI_ONEFILE "tracing/smpi/format/ti-one-file" #define OPT_TRACING_FORMAT "tracing/smpi/format" #define OPT_TRACING_MSG_PROCESS "tracing/msg/process" #define OPT_TRACING_MSG_VM "tracing/msg/vm" -#define OPT_TRACING_ONELINK_ONLY "tracing/onelink_only" +#define OPT_TRACING_ONELINK_ONLY "tracing/onelink-only" #define OPT_TRACING_PLATFORM "tracing/platform" #define OPT_TRACING_PRECISION "tracing/precision" #define OPT_TRACING_SMPI_COMPUTING "tracing/smpi/computing" @@ -390,6 +390,14 @@ void TRACE_global_init(int *argc, char **argv) xbt_cfg_register_string(OPT_VIVA_UNCAT_CONF, "", NULL, "Viva Graph configuration file for uncategorized resource utilization traces."); xbt_cfg_register_string(OPT_VIVA_CAT_CONF, "", NULL, "Viva Graph configuration file for categorized resource utilization traces."); + xbt_cfg_register_alias(OPT_TRACING_COMMENT_FILE,"tracing/comment_file"); + xbt_cfg_register_alias(OPT_TRACING_DISABLE_DESTROY, "tracing/disable_destroy"); + xbt_cfg_register_alias(OPT_TRACING_DISABLE_LINK, "tracing/disable_link"); + xbt_cfg_register_alias(OPT_TRACING_DISABLE_POWER, "tracing/disable_power"); + xbt_cfg_register_alias(OPT_TRACING_DISPLAY_SIZES, "tracing/smpi/display_sizes"); + xbt_cfg_register_alias(OPT_TRACING_FORMAT_TI_ONEFILE, "tracing/smpi/format/ti_one_file"); + xbt_cfg_register_alias(OPT_TRACING_ONELINK_ONLY, "tracing/onelink_only"); + /* instrumentation can be considered configured now */ trace_configured = 1; } diff --git a/src/mc/CommunicationDeterminismChecker.cpp b/src/mc/CommunicationDeterminismChecker.cpp index e183c7d07c..9a44b84feb 100644 --- a/src/mc/CommunicationDeterminismChecker.cpp +++ b/src/mc/CommunicationDeterminismChecker.cpp @@ -192,7 +192,7 @@ void CommunicationDeterminismChecker::get_comm_pattern(xbt_dynar_t list, smx_sim (std::uint64_t) pattern->comm_addr); char* remote_name = mc_model_checker->process().read( - (std::uint64_t)(synchro.comm.rdv ? &synchro.comm.rdv->name : &synchro.comm.rdv_cpy->name)); + (std::uint64_t)(synchro.comm.mbox ? &synchro.comm.mbox->name : &synchro.comm.mbox_cpy->name)); pattern->rdv = mc_model_checker->process().read_string(remote_name); pattern->src_proc = mc_model_checker->process().resolveProcess( simgrid::mc::remote(synchro.comm.src_proc))->pid; @@ -239,7 +239,7 @@ void CommunicationDeterminismChecker::get_comm_pattern(xbt_dynar_t list, smx_sim char* remote_name; mc_model_checker->process().read(&remote_name, - remote(synchro.comm.rdv ? &synchro.comm.rdv->name : &synchro.comm.rdv_cpy->name)); + remote(synchro.comm.mbox ? &synchro.comm.mbox->name : &synchro.comm.mbox_cpy->name)); pattern->rdv = mc_model_checker->process().read_string(remote_name); pattern->dst_proc = mc_model_checker->process().resolveProcess( simgrid::mc::remote(synchro.comm.dst_proc))->pid; @@ -607,4 +607,4 @@ Checker* createCommunicationDeterminismChecker(Session& session) } } -} \ No newline at end of file +} diff --git a/src/mc/ModelChecker.cpp b/src/mc/ModelChecker.cpp index 956f5f13d1..ea14a19348 100644 --- a/src/mc/ModelChecker.cpp +++ b/src/mc/ModelChecker.cpp @@ -149,9 +149,6 @@ void ModelChecker::setup_ignore() /* Static variable used for tracing */ process.ignore_global_variable("counter"); - - /* SIMIX */ - process.ignore_global_variable("smx_total_comms"); } void ModelChecker::shutdown() diff --git a/src/mc/Process.cpp b/src/mc/Process.cpp index de390cd39c..597710f838 100644 --- a/src/mc/Process.cpp +++ b/src/mc/Process.cpp @@ -77,7 +77,6 @@ static const char *const filtered_libraries[] = { "libm", "libpthread", "librt", - "libsigc", "libstdc++", "libunwind", "libunwind-x86_64", diff --git a/src/mc/Session.cpp b/src/mc/Session.cpp index 095d4b05dc..ff6cef6481 100644 --- a/src/mc/Session.cpp +++ b/src/mc/Session.cpp @@ -86,7 +86,7 @@ Session::Session(pid_t pid, int socket) std::unique_ptr process(new simgrid::mc::Process(pid, socket)); // TODO, automatic detection of the config from the process process->privatized( - xbt_cfg_get_boolean("smpi/privatize_global_variables")); + xbt_cfg_get_boolean("smpi/privatize-global-variables")); modelChecker_ = std::unique_ptr( new simgrid::mc::ModelChecker(std::move(process))); xbt_assert(mc_model_checker == nullptr); diff --git a/src/mc/mc_request.cpp b/src/mc/mc_request.cpp index fe69f83243..f3aaa70b2b 100644 --- a/src/mc/mc_request.cpp +++ b/src/mc/mc_request.cpp @@ -40,13 +40,13 @@ smx_synchro_t MC_get_comm(smx_simcall_t r) } static inline -smx_mailbox_t MC_get_rdv(smx_simcall_t r) +smx_mailbox_t MC_get_mbox(smx_simcall_t r) { switch(r->call) { case SIMCALL_COMM_ISEND: - return simcall_comm_isend__get__rdv(r); + return simcall_comm_isend__get__mbox(r); case SIMCALL_COMM_IRECV: - return simcall_comm_irecv__get__rdv(r); + return simcall_comm_irecv__get__mbox(r); default: return nullptr; } @@ -73,9 +73,9 @@ bool request_depend_asymmetric(smx_simcall_t r1, smx_simcall_t r2) if ((r1->call == SIMCALL_COMM_ISEND || r1->call == SIMCALL_COMM_IRECV) && r2->call == SIMCALL_COMM_WAIT) { - smx_mailbox_t rdv = MC_get_rdv(r1); + smx_mailbox_t mbox = MC_get_mbox(r1); - if (rdv != synchro2->comm.rdv_cpy + if (mbox != synchro2->comm.mbox_cpy && simcall_comm_wait__get__timeout(r2) <= 0) return false; @@ -159,9 +159,9 @@ bool request_depend(smx_simcall_t r1, smx_simcall_t r2) switch(r1->call) { case SIMCALL_COMM_ISEND: - return simcall_comm_isend__get__rdv(r1) == simcall_comm_isend__get__rdv(r2); + return simcall_comm_isend__get__mbox(r1) == simcall_comm_isend__get__mbox(r2); case SIMCALL_COMM_IRECV: - return simcall_comm_irecv__get__rdv(r1) == simcall_comm_irecv__get__rdv(r2); + return simcall_comm_irecv__get__mbox(r1) == simcall_comm_irecv__get__mbox(r2); case SIMCALL_COMM_WAIT: if (synchro1->comm.src_buff == synchro2->comm.src_buff && synchro1->comm.dst_buff == synchro2->comm.dst_buff) diff --git a/src/msg/msg_global.cpp b/src/msg/msg_global.cpp index 19abf3dc2f..d882de4b27 100644 --- a/src/msg/msg_global.cpp +++ b/src/msg/msg_global.cpp @@ -45,7 +45,7 @@ void MSG_init_nocheck(int *argc, char **argv) { msg_global = xbt_new0(s_MSG_Global_t, 1); - xbt_cfg_register_boolean("msg/debug_multiple_use", "no", _sg_cfg_cb_msg_debug_multiple_use, + xbt_cfg_register_boolean("msg/debug-multiple-use", "no", _sg_cfg_cb_msg_debug_multiple_use, "Print backtraces of both processes when there is a conflict of multiple use of a task"); SIMIX_global_init(argc, argv); @@ -75,7 +75,7 @@ void MSG_init_nocheck(int *argc, char **argv) { XBT_DEBUG("ADD MSG LEVELS"); MSG_STORAGE_LEVEL = xbt_lib_add_level(storage_lib, (void_f_pvoid_t) __MSG_storage_destroy); MSG_FILE_LEVEL = xbt_lib_add_level(file_lib, (void_f_pvoid_t) __MSG_file_destroy); - if(xbt_cfg_get_boolean("clean_atexit")) atexit(MSG_exit); + if(xbt_cfg_get_boolean("clean-atexit")) atexit(MSG_exit); } /** \ingroup msg_simulation diff --git a/src/msg/msg_gos.cpp b/src/msg/msg_gos.cpp index 5329078ccb..7138e569b0 100644 --- a/src/msg/msg_gos.cpp +++ b/src/msg/msg_gos.cpp @@ -307,7 +307,7 @@ static inline msg_comm_t MSG_task_isend_internal(msg_task_t task, const char *al } else { xbt_assert(t_simdata->isused == 0, "This task is still being used somewhere else. You cannot send it now. Go fix your code!" - "(use --cfg=msg/debug_multiple_use:on to get the backtrace of the other process)"); + "(use --cfg=msg/debug-multiple-use:on to get the backtrace of the other process)"); } } @@ -794,7 +794,79 @@ msg_error_t MSG_task_send_bounded(msg_task_t task, const char *alias, double max */ msg_error_t MSG_task_send_with_timeout(msg_task_t task, const char *alias, double timeout) { - return MSG_mailbox_put_with_timeout(MSG_mailbox_get_by_alias(alias), task, timeout); + msg_error_t ret = MSG_OK; + simdata_task_t t_simdata = NULL; + msg_process_t process = MSG_process_self(); + simdata_process_t p_simdata = (simdata_process_t) SIMIX_process_self_get_data(); + msg_mailbox_t mailbox = MSG_mailbox_get_by_alias(alias); + + int call_end = TRACE_msg_task_put_start(task); //must be after CHECK_HOST() + + /* Prepare the task to send */ + t_simdata = task->simdata; + t_simdata->sender = process; + t_simdata->source = ((simdata_process_t) SIMIX_process_self_get_data())->m_host; + + if (t_simdata->isused != 0) { + if (msg_global->debug_multiple_use){ + XBT_ERROR("This task is already used in there:"); + xbt_backtrace_display((xbt_ex_t*) t_simdata->isused); + XBT_ERROR("And you try to reuse it from here:"); + xbt_backtrace_display_current(); + } else { + xbt_assert(t_simdata->isused == 0, + "This task is still being used somewhere else. You cannot send it now. Go fix your code!" + " (use --cfg=msg/debug-multiple-use:on to get the backtrace of the other process)"); + } + } + + if (msg_global->debug_multiple_use) + MSG_BT(t_simdata->isused, "Using Backtrace"); + else + t_simdata->isused = (void*)1; + t_simdata->comm = NULL; + msg_global->sent_msg++; + + p_simdata->waiting_task = task; + + xbt_ex_t e; + /* Try to send it by calling SIMIX network layer */ + TRY { + smx_synchro_t comm = NULL; /* MC needs the comm to be set to NULL during the simix call */ + comm = simcall_comm_isend(SIMIX_process_self(), mailbox,t_simdata->bytes_amount, + t_simdata->rate, task, sizeof(void *), NULL, NULL, NULL, task, 0); + if (TRACE_is_enabled()) + simcall_set_category(comm, task->category); + t_simdata->comm = comm; + simcall_comm_wait(comm, timeout); + } + + CATCH(e) { + switch (e.category) { + case cancel_error: + ret = MSG_HOST_FAILURE; + break; + case network_error: + ret = MSG_TRANSFER_FAILURE; + break; + case timeout_error: + ret = MSG_TIMEOUT; + break; + default: + RETHROW; + } + xbt_ex_free(e); + + /* If the send failed, it is not used anymore */ + if (msg_global->debug_multiple_use && t_simdata->isused!=0) + xbt_ex_free(*(xbt_ex_t*)t_simdata->isused); + t_simdata->isused = 0; + } + + p_simdata->waiting_task = NULL; + if (call_end) + TRACE_msg_task_put_end(); + MSG_RETURN(ret); } /** \ingroup msg_task_usage @@ -813,7 +885,7 @@ msg_error_t MSG_task_send_with_timeout(msg_task_t task, const char *alias, doubl msg_error_t MSG_task_send_with_timeout_bounded(msg_task_t task, const char *alias, double timeout, double maxrate) { task->simdata->rate = maxrate; - return MSG_mailbox_put_with_timeout(MSG_mailbox_get_by_alias(alias), task, timeout); + return MSG_task_send_with_timeout(task, alias, timeout); } /** \ingroup msg_task_usage @@ -825,22 +897,8 @@ msg_error_t MSG_task_send_with_timeout_bounded(msg_task_t task, const char *alia */ int MSG_task_listen(const char *alias) { - smx_mailbox_t rdv = MSG_mailbox_get_by_alias(alias); - return !MSG_mailbox_is_empty(rdv) || (rdv->permanent_receiver && xbt_fifo_size(rdv->done_comm_fifo)!=0); -} - -/** \ingroup msg_task_usage - * \brief Check the number of communication actions of a given host pending in a mailbox. - * - * \param alias the name of the mailbox to be considered - * \param host the host to check for communication - * - * \return Returns the number of pending communication actions of the host in the given mailbox, 0 if there is no - * pending communication actions. - */ -int MSG_task_listen_from_host(const char *alias, msg_host_t host) -{ - return MSG_mailbox_get_count_host_waiting_tasks(MSG_mailbox_get_by_alias(alias), host); + smx_mailbox_t mbox = MSG_mailbox_get_by_alias(alias); + return !MSG_mailbox_is_empty(mbox) || (mbox->permanent_receiver && !mbox->done_comm_queue->empty()); } /** \ingroup msg_task_usage diff --git a/src/msg/msg_mailbox.cpp b/src/msg/msg_mailbox.cpp index cb67a3fdbf..11ce7d86fc 100644 --- a/src/msg/msg_mailbox.cpp +++ b/src/msg/msg_mailbox.cpp @@ -13,22 +13,17 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_mailbox, msg, "Logging specific to MSG (mail msg_mailbox_t MSG_mailbox_new(const char *alias) { - return simcall_rdv_create(alias); -} - -void MSG_mailbox_free(void *mailbox) -{ - simcall_rdv_destroy((msg_mailbox_t)mailbox); + return simcall_mbox_create(alias); } int MSG_mailbox_is_empty(msg_mailbox_t mailbox) { - return (NULL == simcall_rdv_get_head(mailbox)); + return (NULL == simcall_mbox_get_head(mailbox)); } msg_task_t MSG_mailbox_get_head(msg_mailbox_t mailbox) { - smx_synchro_t comm = simcall_rdv_get_head(mailbox); + smx_synchro_t comm = simcall_mbox_get_head(mailbox); if (!comm) return NULL; @@ -36,14 +31,9 @@ msg_task_t MSG_mailbox_get_head(msg_mailbox_t mailbox) return (msg_task_t) simcall_comm_get_src_data(comm); } -int MSG_mailbox_get_count_host_waiting_tasks(msg_mailbox_t mailbox, msg_host_t host) -{ - return simcall_rdv_comm_count_by_host(mailbox, host); -} - msg_mailbox_t MSG_mailbox_get_by_alias(const char *alias) { - msg_mailbox_t mailbox = simcall_rdv_get_by_name(alias); + msg_mailbox_t mailbox = simcall_mbox_get_by_name(alias); if (!mailbox) mailbox = MSG_mailbox_new(alias); @@ -63,7 +53,7 @@ msg_mailbox_t MSG_mailbox_get_by_alias(const char *alias) void MSG_mailbox_set_async(const char *alias){ msg_mailbox_t mailbox = MSG_mailbox_get_by_alias(alias); - simcall_rdv_set_receiver(mailbox, SIMIX_process_self()); + simcall_mbox_set_receiver(mailbox, SIMIX_process_self()); XBT_VERB("%s mailbox set to receive eagerly for process %p\n",alias, SIMIX_process_self()); } @@ -148,79 +138,3 @@ msg_error_t MSG_mailbox_get_task_ext_bounded(msg_mailbox_t mailbox, msg_task_t * } MSG_RETURN(ret); } - -msg_error_t MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, msg_task_t task, double timeout) -{ - msg_error_t ret = MSG_OK; - simdata_task_t t_simdata = NULL; - msg_process_t process = MSG_process_self(); - simdata_process_t p_simdata = (simdata_process_t) SIMIX_process_self_get_data(); - - int call_end = TRACE_msg_task_put_start(task); //must be after CHECK_HOST() - - /* Prepare the task to send */ - t_simdata = task->simdata; - t_simdata->sender = process; - t_simdata->source = ((simdata_process_t) SIMIX_process_self_get_data())->m_host; - - if (t_simdata->isused != 0) { - if (msg_global->debug_multiple_use){ - XBT_ERROR("This task is already used in there:"); - xbt_backtrace_display((xbt_ex_t*) t_simdata->isused); - XBT_ERROR("And you try to reuse it from here:"); - xbt_backtrace_display_current(); - } else { - xbt_assert(t_simdata->isused == 0, - "This task is still being used somewhere else. You cannot send it now. Go fix your code!" - " (use --cfg=msg/debug_multiple_use:on to get the backtrace of the other process)"); - } - } - - if (msg_global->debug_multiple_use) - MSG_BT(t_simdata->isused, "Using Backtrace"); - else - t_simdata->isused = (void*)1; - t_simdata->comm = NULL; - msg_global->sent_msg++; - - p_simdata->waiting_task = task; - - xbt_ex_t e; - /* Try to send it by calling SIMIX network layer */ - TRY { - smx_synchro_t comm = NULL; /* MC needs the comm to be set to NULL during the simix call */ - comm = simcall_comm_isend(SIMIX_process_self(), mailbox,t_simdata->bytes_amount, - t_simdata->rate, task, sizeof(void *), NULL, NULL, NULL, task, 0); - if (TRACE_is_enabled()) - simcall_set_category(comm, task->category); - t_simdata->comm = comm; - simcall_comm_wait(comm, timeout); - } - - CATCH(e) { - switch (e.category) { - case cancel_error: - ret = MSG_HOST_FAILURE; - break; - case network_error: - ret = MSG_TRANSFER_FAILURE; - break; - case timeout_error: - ret = MSG_TIMEOUT; - break; - default: - RETHROW; - } - xbt_ex_free(e); - - /* If the send failed, it is not used anymore */ - if (msg_global->debug_multiple_use && t_simdata->isused!=0) - xbt_ex_free(*(xbt_ex_t*)t_simdata->isused); - t_simdata->isused = 0; - } - - p_simdata->waiting_task = NULL; - if (call_end) - TRACE_msg_task_put_end(); - MSG_RETURN(ret); -} diff --git a/src/msg/msg_private.h b/src/msg/msg_private.h index efe693ffb8..3edff2f8d9 100644 --- a/src/msg/msg_private.h +++ b/src/msg/msg_private.h @@ -148,11 +148,6 @@ XBT_PRIVATE void MSG_post_create_environment(void); XBT_PRIVATE void MSG_host_add_task(msg_host_t host, msg_task_t task); XBT_PRIVATE void MSG_host_del_task(msg_host_t host, msg_task_t task); -/* @brief MSG_mailbox_free - release a mailbox from the memory. - * Releases a mailbox from the memory but does not remove it from the dictionary. - * @param mailbox The mailbox to release. - */ -XBT_PRIVATE void MSG_mailbox_free(void *mailbox); /********** Tracing **********/ /* declaration of instrumentation functions from msg_task_instr.c */ diff --git a/src/s4u/s4u_mailbox.cpp b/src/s4u/s4u_mailbox.cpp index e393748c75..c057113f54 100644 --- a/src/s4u/s4u_mailbox.cpp +++ b/src/s4u/s4u_mailbox.cpp @@ -32,11 +32,22 @@ s4u::Mailbox *s4u::Mailbox::byName(const char*name) { res = mailboxes->at(name); } catch (std::out_of_range& e) { // FIXME: there is a potential race condition here where two actors run Mailbox::byName on a non-existent mailbox - // during the same scheduling round. Both will be interrupted in the simcall creating the underlying simix rdv. + // during the same scheduling round. Both will be interrupted in the simcall creating the underlying simix mbox. // Only one simix object will be created, but two S4U objects will be created. // Only one S4U object will be stored in the hashmap and used, and the other one will be leaked. - new Mailbox(name,simcall_rdv_create(name)); + new Mailbox(name,simcall_mbox_create(name)); res = mailboxes->at(name); // Use the stored one, even if it's not the one I created myself. } return res; } + +bool s4u::Mailbox::empty() { + return nullptr == simcall_mbox_get_head(inferior_); +} + +sg_mbox_t sg_mbox_by_name(const char*name){ + return s4u::Mailbox::byName(name); +} +int sg_mbox_is_empty(sg_mbox_t mbox) { + return mbox->empty(); +} diff --git a/src/simgrid/sg_config.cpp b/src/simgrid/sg_config.cpp index 98142d3d58..8062d06b13 100644 --- a/src/simgrid/sg_config.cpp +++ b/src/simgrid/sg_config.cpp @@ -468,8 +468,9 @@ void sg_config_init(int *argc, char **argv) describe_model(description, surf_vm_model_description, "model", "The model to use for the vm"); xbt_cfg_register_string("vm/model", "default", &_sg_cfg_cb__vm_model, description); - xbt_cfg_register_double("network/TCP_gamma", 4194304.0, _sg_cfg_cb__tcp_gamma, + xbt_cfg_register_double("network/TCP-gamma", 4194304.0, _sg_cfg_cb__tcp_gamma, "Size of the biggest TCP window (cat /proc/sys/net/ipv4/tcp_[rw]mem for recv/send window; Use the last given value, which is the max window size)"); + xbt_cfg_register_alias("network/TCP-gamma","network/TCP_gamma"); xbt_cfg_register_double("surf/precision", 0.00001, _sg_cfg_cb__surf_precision, "Numerical precision used when updating simulation times (in seconds)"); xbt_cfg_register_double("maxmin/precision", 0.00001, _sg_cfg_cb__maxmin_precision, @@ -477,21 +478,27 @@ void sg_config_init(int *argc, char **argv) /* The parameters of network models */ - xbt_cfg_register_double("network/sender_gap", NAN, _sg_cfg_cb__sender_gap, - "Minimum gap between two overlapping sends"); /* real default for "network/sender_gap" is set in network_smpi.cpp */ - xbt_cfg_register_double("network/latency_factor", 1.0, _sg_cfg_cb__latency_factor, + xbt_cfg_register_double("network/sender-gap", NAN, _sg_cfg_cb__sender_gap, + "Minimum gap between two overlapping sends"); /* real default for "network/sender-gap" is set in network_smpi.cpp */ + xbt_cfg_register_alias("network/sender-gap","network/sender_gap"); + xbt_cfg_register_double("network/latency-factor", 1.0, _sg_cfg_cb__latency_factor, "Correction factor to apply to the provided latency (default value set by network model)"); - xbt_cfg_register_double("network/bandwidth_factor", 1.0, _sg_cfg_cb__bandwidth_factor, "Correction factor to apply to the provided bandwidth (default value set by network model)"); - xbt_cfg_register_double("network/weight_S", NAN, _sg_cfg_cb__weight_S, /* real default for "network/weight_S" is set in network_*.cpp */ + xbt_cfg_register_alias("network/latency-factor","network/latency_factor"); + xbt_cfg_register_double("network/bandwidth-factor", 1.0, _sg_cfg_cb__bandwidth_factor, "Correction factor to apply to the provided bandwidth (default value set by network model)"); + xbt_cfg_register_alias("network/bandwidth-factor","network/bandwidth_factor"); + xbt_cfg_register_double("network/weight-S", NAN, _sg_cfg_cb__weight_S, /* real default for "network/weight-S" is set in network_*.cpp */ "Correction factor to apply to the weight of competing streams (default value set by network model)"); + xbt_cfg_register_alias("network/weight-S","network/weight_S"); /* Inclusion path */ xbt_cfg_register_string("path", "", _sg_cfg_cb__surf_path, "Lookup path for inclusions in platform and deployment XML files"); - xbt_cfg_register_boolean("cpu/maxmin_selective_update", "no", NULL, + xbt_cfg_register_boolean("cpu/maxmin-selective-update", "no", NULL, "Update the constraint set propagating recursively to others constraints (off by default when optim is set to lazy)"); - xbt_cfg_register_boolean("network/maxmin_selective_update", "no", NULL, + xbt_cfg_register_alias("cpu/maxmin-selective-update","cpu/maxmin_selective_update"); + xbt_cfg_register_boolean("network/maxmin-selective-update", "no", NULL, "Update the constraint set propagating recursively to others constraints (off by default when optim is set to lazy)"); + xbt_cfg_register_alias("network/maxmin-selective-update","network/maxmin_selective_update"); /* Replay (this part is enabled even if MC it disabled) */ xbt_cfg_register_string("model-check/replay", nullptr, _sg_cfg_cb_model_check_replay, "Model-check path to replay (as reported by SimGrid when a violation is reported)"); @@ -504,16 +511,18 @@ void sg_config_init(int *argc, char **argv) "Specify the amount of steps between checkpoints during stateful model-checking (default: 0 => stateless verification). " "If value=1, one checkpoint is saved for each step => faster verification, but huge memory consumption; higher values are good compromises between speed and memory consumption."); - xbt_cfg_register_boolean("model-check/sparse_checkpoint", "no", _mc_cfg_cb_sparse_checkpoint, "Use sparse per-page snapshots."); + xbt_cfg_register_boolean("model-check/sparse-checkpoint", "no", _mc_cfg_cb_sparse_checkpoint, "Use sparse per-page snapshots."); xbt_cfg_register_boolean("model-check/ksm", "no", _mc_cfg_cb_ksm, "Kernel same-page merging"); xbt_cfg_register_string("model-check/property","", _mc_cfg_cb_property, "Name of the file containing the property, as formated by the ltl2ba program."); - xbt_cfg_register_boolean("model-check/communications_determinism", "no", _mc_cfg_cb_comms_determinism, + xbt_cfg_register_boolean("model-check/communications-determinism", "no", _mc_cfg_cb_comms_determinism, "Whether to enable the detection of communication determinism"); + xbt_cfg_register_alias("model-check/communications-determinism","model-check/communications_determinism"); - xbt_cfg_register_boolean("model-check/send_determinism", "no", _mc_cfg_cb_send_determinism, + xbt_cfg_register_boolean("model-check/send-determinism", "no", _mc_cfg_cb_send_determinism, "Enable/disable the detection of send-determinism in the communications schemes"); + xbt_cfg_register_alias("model-check/send-determinism","model-check/send_determinism"); /* Specify the kind of model-checking reduction */ xbt_cfg_register_string("model-check/reduction", "dpor", _mc_cfg_cb_reduce, @@ -522,13 +531,16 @@ void sg_config_init(int *argc, char **argv) "Whether to enable timeouts for wait requests"); xbt_cfg_register_boolean("model-check/hash", "no", _mc_cfg_cb_hash, "Whether to enable state hash for state comparison (experimental)"); - xbt_cfg_register_boolean("model-check/snapshot_fds", "no", _mc_cfg_cb_snapshot_fds, + xbt_cfg_register_boolean("model-check/snapshot-fds", "no", _mc_cfg_cb_snapshot_fds, "Whether file descriptors must be snapshoted (currently unusable)"); - xbt_cfg_register_int("model-check/max_depth", 1000, _mc_cfg_cb_max_depth, "Maximal exploration depth (default: 1000)"); + xbt_cfg_register_alias("model-check/snapshot-fds","model-check/snapshot_fds"); + xbt_cfg_register_int("model-check/max-depth", 1000, _mc_cfg_cb_max_depth, "Maximal exploration depth (default: 1000)"); + xbt_cfg_register_alias("model-check/max-depth","model-check/max_depth"); xbt_cfg_register_int("model-check/visited", 0, _mc_cfg_cb_visited, "Specify the number of visited state stored for state comparison reduction. If value=5, the last 5 visited states are stored. If value=0 (the default), all states are stored."); - xbt_cfg_register_string("model-check/dot_output", "", _mc_cfg_cb_dot_output, "Name of dot output file corresponding to graph state"); + xbt_cfg_register_string("model-check/dot-output", "", _mc_cfg_cb_dot_output, "Name of dot output file corresponding to graph state"); + xbt_cfg_register_alias("model-check/dot-output","model-check/dot_output"); xbt_cfg_register_boolean("model-check/termination", "no", _mc_cfg_cb_termination, "Whether to enable non progressive cycle detection"); #endif @@ -551,12 +563,13 @@ void sg_config_init(int *argc, char **argv) } xbt_cfg_register_string("contexts/factory", dflt_ctx_fact, _sg_cfg_cb_context_factory, description); - xbt_cfg_register_int("contexts/stack_size", 8*1024, _sg_cfg_cb_context_stack_size, "Stack size of contexts in KiB"); + xbt_cfg_register_int("contexts/stack-size", 8*1024, _sg_cfg_cb_context_stack_size, "Stack size of contexts in KiB"); /* (FIXME: this is unpleasant) Reset this static variable that was altered when setting the default value. */ smx_context_stack_size_was_set = 0; + xbt_cfg_register_alias("contexts/stack-size","contexts/stack_size"); /* guard size for contexts stacks in memory pages */ - xbt_cfg_register_int("contexts/guard_size", + xbt_cfg_register_int("contexts/guard-size", #if defined(_WIN32) || (PTH_STACKGROWTH != -1) 0, #else @@ -565,11 +578,12 @@ void sg_config_init(int *argc, char **argv) _sg_cfg_cb_context_guard_size, "Guard size for contexts stacks in memory pages"); /* No, it was not set yet (the above setdefault() changed this to 1). */ smx_context_guard_size_was_set = 0; - + xbt_cfg_register_alias("contexts/guard-size","contexts/guard_size"); xbt_cfg_register_int("contexts/nthreads", 1, _sg_cfg_cb_contexts_nthreads, "Number of parallel threads used to execute user contexts"); - xbt_cfg_register_int("contexts/parallel_threshold", 2, _sg_cfg_cb_contexts_parallel_threshold, + xbt_cfg_register_int("contexts/parallel-threshold", 2, _sg_cfg_cb_contexts_parallel_threshold, "Minimal number of user contexts to be run in parallel (raw contexts only)"); + xbt_cfg_register_alias("contexts/parallel-threshold","contexts/parallel_threshold"); /* synchronization mode for parallel user contexts */ #if HAVE_FUTEX_H @@ -592,28 +606,48 @@ void sg_config_init(int *argc, char **argv) //For smpi/bw_factor and smpi/lat_factor // SMPI model can be used without enable_smpi, so keep this out of the ifdef. - xbt_cfg_register_string("smpi/bw_factor", + xbt_cfg_register_string("smpi/bw-factor", "65472:0.940694;15424:0.697866;9376:0.58729;5776:1.08739;3484:0.77493;1426:0.608902;732:0.341987;257:0.338112;0:0.812084", NULL, "Bandwidth factors for smpi. Format: 'threshold0:value0;threshold1:value1;...;thresholdN:valueN', meaning if(size >=thresholdN ) return valueN."); + xbt_cfg_register_alias("smpi/bw-factor","smpi/bw_factor"); - xbt_cfg_register_string("smpi/lat_factor", + xbt_cfg_register_string("smpi/lat-factor", "65472:11.6436;15424:3.48845;9376:2.59299;5776:2.18796;3484:1.88101;1426:1.61075;732:1.9503;257:1.95341;0:2.01467", NULL, "Latency factors for smpi."); + xbt_cfg_register_alias("smpi/lat-factor","smpi/lat_factor"); - xbt_cfg_register_string("smpi/IB_penalty_factors", "0.965;0.925;1.35", NULL, + xbt_cfg_register_string("smpi/IB-penalty-factors", "0.965;0.925;1.35", NULL, "Correction factor to communications using Infiniband model with contention (default value based on Stampede cluster profiling)"); + xbt_cfg_register_alias("smpi/IB-penalty-factors","smpi/IB_penalty_factors"); #if HAVE_SMPI - xbt_cfg_register_double("smpi/running_power", 20000.0, NULL, "Power of the host running the simulation (in flop/s). Used to bench the operations."); - xbt_cfg_register_boolean("smpi/display_timing", "no", NULL, "Whether we should display the timing after simulation."); - xbt_cfg_register_boolean("smpi/simulate_computation", "yes", NULL, "Whether the computational part of the simulated application should be simulated."); - xbt_cfg_register_boolean("smpi/use_shared_malloc", "yes", NULL, "Whether SMPI_SHARED_MALLOC is enabled. Disable it for debugging purposes."); - xbt_cfg_register_double("smpi/cpu_threshold", 1e-6, NULL, "Minimal computation time (in seconds) not discarded, or -1 for infinity."); - xbt_cfg_register_int("smpi/async_small_thresh", 0, NULL, + xbt_cfg_register_double("smpi/running-power", 20000.0, NULL, "Power of the host running the simulation (in flop/s). Used to bench the operations."); + xbt_cfg_register_alias("smpi/running-power","smpi/running_power"); + + xbt_cfg_register_boolean("smpi/display-timing", "no", NULL, "Whether we should display the timing after simulation."); + xbt_cfg_register_alias("smpi/display-timing", "smpi/display_timing"); + + xbt_cfg_register_boolean("smpi/simulate-computation", "yes", NULL, "Whether the computational part of the simulated application should be simulated."); + xbt_cfg_register_alias("smpi/simulate-computation","smpi/simulate_computation"); + + xbt_cfg_register_boolean("smpi/use-shared-malloc", "yes", NULL, "Whether SMPI_SHARED_MALLOC is enabled. Disable it for debugging purposes."); + xbt_cfg_register_alias("smpi/use-shared-malloc", "smpi/use_shared_malloc"); + + xbt_cfg_register_double("smpi/cpu-threshold", 1e-6, NULL, "Minimal computation time (in seconds) not discarded, or -1 for infinity."); + xbt_cfg_register_alias("smpi/cpu-threshold", "smpi/cpu_threshold"); + + xbt_cfg_register_int("smpi/async-small-thresh", 0, NULL, "Maximal size of messages that are to be sent asynchronously, without waiting for the receiver"); - xbt_cfg_register_int("smpi/send_is_detached_thresh", 65536, NULL, + xbt_cfg_register_alias("smpi/async-small-thresh","smpi/async_small_thresh"); + xbt_cfg_register_alias("smpi/async-small-thresh","smpi/async_small_thres"); + + xbt_cfg_register_int("smpi/send-is-detached-thresh", 65536, NULL, "Threshold of message size where MPI_Send stops behaving like MPI_Isend and becomes MPI_Ssend"); + xbt_cfg_register_alias("smpi/send-is-detached-thresh","smpi/send_is_detached_thresh"); + xbt_cfg_register_alias("smpi/send-is-detached-thresh","smpi/send_is_detached_thres"); + + xbt_cfg_register_boolean("smpi/privatize-global-variables", "no", NULL, "Whether we should privatize global variable at runtime."); + xbt_cfg_register_alias("smpi/privatize-global-variables", "smpi/privatize_global_variables"); - xbt_cfg_register_boolean("smpi/privatize_global_variables", "no", NULL, "Whether we should privatize global variable at runtime."); xbt_cfg_register_string("smpi/os", "1:0:0:0:0", NULL, "Small messages timings (MPI_Send minimum time for small messages)"); xbt_cfg_register_string("smpi/ois", "1:0:0:0:0", NULL, "Small messages timings (MPI_Isend minimum time for small messages)"); xbt_cfg_register_string("smpi/or", "1:0:0:0:0", NULL, "Small messages timings (MPI_Recv minimum time for small messages)"); @@ -621,11 +655,13 @@ void sg_config_init(int *argc, char **argv) xbt_cfg_register_double("smpi/test", 1e-4, _sg_cfg_cb__test_sleep, "Minimum time to inject inside a call to MPI_Test"); xbt_cfg_register_double("smpi/wtime", 0.0, _sg_cfg_cb__wtime_sleep, "Minimum time to inject inside a call to MPI_Wtime"); - xbt_cfg_register_string("smpi/coll_selector", "default", NULL, "Which collective selector to use"); + xbt_cfg_register_string("smpi/coll-selector", "default", NULL, "Which collective selector to use"); + xbt_cfg_register_alias("smpi/coll-selector","smpi/coll_selector"); xbt_cfg_register_string("smpi/gather", nullptr, &_check_coll_gather, "Which collective to use for gather"); xbt_cfg_register_string("smpi/allgather", nullptr, &_check_coll_allgather, "Which collective to use for allgather"); xbt_cfg_register_string("smpi/barrier", nullptr, &_check_coll_barrier, "Which collective to use for barrier"); - xbt_cfg_register_string("smpi/reduce_scatter",nullptr, &_check_coll_reduce_scatter, "Which collective to use for reduce_scatter"); + xbt_cfg_register_string("smpi/reduce-scatter",nullptr, &_check_coll_reduce_scatter, "Which collective to use for reduce_scatter"); + xbt_cfg_register_alias("smpi/reduce-scatter","smpi/reduce_scatter"); xbt_cfg_register_string("smpi/scatter", nullptr, &_check_coll_scatter, "Which collective to use for scatter"); xbt_cfg_register_string("smpi/allgatherv", nullptr, &_check_coll_allgatherv, "Which collective to use for allgatherv"); xbt_cfg_register_string("smpi/allreduce", nullptr, &_check_coll_allreduce, "Which collective to use for allreduce"); @@ -638,8 +674,9 @@ void sg_config_init(int *argc, char **argv) xbt_cfg_register_boolean("exception/cutpath", "no", NULL, "Whether to cut all path information from call traces, used e.g. in exceptions."); - xbt_cfg_register_boolean("clean_atexit", "yes", _sg_cfg_cb_clean_atexit, + xbt_cfg_register_boolean("clean-atexit", "yes", _sg_cfg_cb_clean_atexit, "Whether to cleanup SimGrid at exit. Disable it if your code segfaults after its end."); + xbt_cfg_register_alias("clean-atexit","clean_atexit"); if (!surf_path) { /* retrieves the current directory of the current process */ diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index 278ce88e7c..4d12952d8c 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -603,9 +603,11 @@ void simcall_process_set_data(smx_process_t process, void *data) simgrid::simix::kernel(std::bind(SIMIX_process_set_data, process, data)); } -static void kill_process(void* arg) +static void kill_process_from_timer(void* arg) { - simix_global->kill_process_function((smx_process_t) arg); + smx_process_t process = (smx_process_t) arg; + simix_global->kill_process_function(process); + process->kill_timer=NULL; } /** @@ -619,7 +621,7 @@ void simcall_process_set_kill_time(smx_process_t process, double kill_time) if (simix_global->kill_process_function) { XBT_DEBUG("Set kill time %f for process %s(%s)",kill_time, process->name, sg_host_get_name(process->host)); - process->kill_timer = SIMIX_timer_set(kill_time, kill_process, process); + process->kill_timer = SIMIX_timer_set(kill_time, kill_process_from_timer, process); } } } @@ -728,79 +730,54 @@ e_smx_state_t simcall_process_sleep(double duration) } /** - * \ingroup simix_rdv_management + * \ingroup simix_mbox_management * \brief Creates a new rendez-vous point * \param name The name of the rendez-vous point * \return The created rendez-vous point */ -smx_mailbox_t simcall_rdv_create(const char *name) +smx_mailbox_t simcall_mbox_create(const char *name) { - return simcall_BODY_rdv_create(name); + return simcall_BODY_mbox_create(name); } - -/** - * \ingroup simix_rdv_management - * \brief Destroy a rendez-vous point - * \param rdv The rendez-vous point to destroy - */ -void simcall_rdv_destroy(smx_mailbox_t rdv) -{ - simcall_BODY_rdv_destroy(rdv); -} /** - * \ingroup simix_rdv_management + * \ingroup simix_mbox_management * \brief Returns a rendez-vous point knowing its name */ -smx_mailbox_t simcall_rdv_get_by_name(const char *name) +smx_mailbox_t simcall_mbox_get_by_name(const char *name) { - xbt_assert(name != NULL, "Invalid parameter for simcall_rdv_get_by_name (name is NULL)"); - /* FIXME: this is a horrible loss of performance, so we hack it out by * skipping the simcall (for now). It works in parallel, it won't work on * distributed but probably we will change MSG for that. */ - return SIMIX_rdv_get_by_name(name); -} - -/** - * \ingroup simix_rdv_management - * \brief Counts the number of communication synchros of a given host pending - * on a rendez-vous point. - * \param rdv The rendez-vous point - * \param host The host to be counted - * \return The number of comm synchros pending in the rdv - */ -int simcall_rdv_comm_count_by_host(smx_mailbox_t rdv, sg_host_t host) -{ - return simcall_BODY_rdv_comm_count_by_host(rdv, host); + return SIMIX_mbox_get_by_name(name); } /** - * \ingroup simix_rdv_management + * \ingroup simix_mbox_management * \brief returns the communication at the head of the rendez-vous - * \param rdv The rendez-vous point + * \param mbox The rendez-vous point * \return The communication or NULL if empty */ -smx_synchro_t simcall_rdv_get_head(smx_mailbox_t rdv) +smx_synchro_t simcall_mbox_get_head(smx_mailbox_t mbox) { - return simcall_BODY_rdv_get_head(rdv); + return simcall_BODY_mbox_get_head(mbox); } -void simcall_rdv_set_receiver(smx_mailbox_t rdv, smx_process_t process) +void simcall_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t process) { - simcall_BODY_rdv_set_receiver(rdv, process); + simcall_BODY_mbox_set_receiver(mbox, process); } -smx_process_t simcall_rdv_get_receiver(smx_mailbox_t rdv) +smx_process_t simcall_mbox_get_receiver(smx_mailbox_t mbox) { - return simcall_BODY_rdv_get_receiver(rdv); + return simcall_BODY_mbox_get_receiver(mbox); } /** * \ingroup simix_comm_management */ -void simcall_comm_send(smx_process_t sender, smx_mailbox_t rdv, double task_size, double rate, +void simcall_comm_send(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void *src_buff, size_t src_buff_size, int (*match_fun)(void *, void *, smx_synchro_t), void (*copy_data_fun)(smx_synchro_t, void*, size_t), void *data, @@ -811,18 +788,18 @@ void simcall_comm_send(smx_process_t sender, smx_mailbox_t rdv, double task_size xbt_assert(std::isfinite(rate), "rate is not finite!"); xbt_assert(std::isfinite(timeout), "timeout is not finite!"); - xbt_assert(rdv, "No rendez-vous point defined for send"); + xbt_assert(mbox, "No rendez-vous point defined for send"); if (MC_is_active() || MC_record_replay_is_active()) { /* the model-checker wants two separate simcalls */ smx_synchro_t comm = NULL; /* MC needs the comm to be set to NULL during the simcall */ - comm = simcall_comm_isend(sender, rdv, task_size, rate, + comm = simcall_comm_isend(sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, NULL, copy_data_fun, data, 0); simcall_comm_wait(comm, timeout); comm = NULL; } else { - simcall_BODY_comm_send(sender, rdv, task_size, rate, src_buff, src_buff_size, + simcall_BODY_comm_send(sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout); } } @@ -830,7 +807,7 @@ void simcall_comm_send(smx_process_t sender, smx_mailbox_t rdv, double task_size /** * \ingroup simix_comm_management */ -smx_synchro_t simcall_comm_isend(smx_process_t sender, smx_mailbox_t rdv, double task_size, double rate, +smx_synchro_t simcall_comm_isend(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void *src_buff, size_t src_buff_size, int (*match_fun)(void *, void *, smx_synchro_t), void (*clean_fun)(void *), @@ -842,9 +819,9 @@ smx_synchro_t simcall_comm_isend(smx_process_t sender, smx_mailbox_t rdv, double xbt_assert(std::isfinite(task_size), "task_size is not finite!"); xbt_assert(std::isfinite(rate), "rate is not finite!"); - xbt_assert(rdv, "No rendez-vous point defined for isend"); + xbt_assert(mbox, "No rendez-vous point defined for isend"); - return simcall_BODY_comm_isend(sender, rdv, task_size, rate, src_buff, + return simcall_BODY_comm_isend(sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached); } @@ -852,50 +829,50 @@ smx_synchro_t simcall_comm_isend(smx_process_t sender, smx_mailbox_t rdv, double /** * \ingroup simix_comm_management */ -void simcall_comm_recv(smx_process_t receiver, smx_mailbox_t rdv, void *dst_buff, size_t * dst_buff_size, +void simcall_comm_recv(smx_process_t receiver, smx_mailbox_t mbox, void *dst_buff, size_t * dst_buff_size, int (*match_fun)(void *, void *, smx_synchro_t), void (*copy_data_fun)(smx_synchro_t, void*, size_t), void *data, double timeout, double rate) { xbt_assert(std::isfinite(timeout), "timeout is not finite!"); - xbt_assert(rdv, "No rendez-vous point defined for recv"); + xbt_assert(mbox, "No rendez-vous point defined for recv"); if (MC_is_active() || MC_record_replay_is_active()) { /* the model-checker wants two separate simcalls */ smx_synchro_t comm = NULL; /* MC needs the comm to be set to NULL during the simcall */ - comm = simcall_comm_irecv(receiver, rdv, dst_buff, dst_buff_size, + comm = simcall_comm_irecv(receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate); simcall_comm_wait(comm, timeout); comm = NULL; } else { - simcall_BODY_comm_recv(receiver, rdv, dst_buff, dst_buff_size, + simcall_BODY_comm_recv(receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate); } } /** * \ingroup simix_comm_management */ -smx_synchro_t simcall_comm_irecv(smx_process_t receiver, smx_mailbox_t rdv, void *dst_buff, size_t *dst_buff_size, +smx_synchro_t simcall_comm_irecv(smx_process_t receiver, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size, int (*match_fun)(void *, void *, smx_synchro_t), void (*copy_data_fun)(smx_synchro_t, void*, size_t), void *data, double rate) { - xbt_assert(rdv, "No rendez-vous point defined for irecv"); + xbt_assert(mbox, "No rendez-vous point defined for irecv"); - return simcall_BODY_comm_irecv(receiver, rdv, dst_buff, dst_buff_size, + return simcall_BODY_comm_irecv(receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate); } /** * \ingroup simix_comm_management */ -smx_synchro_t simcall_comm_iprobe(smx_mailbox_t rdv, int type, int src, int tag, +smx_synchro_t simcall_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, int (*match_fun)(void *, void *, smx_synchro_t), void *data) { - xbt_assert(rdv, "No rendez-vous point defined for iprobe"); + xbt_assert(mbox, "No rendez-vous point defined for iprobe"); - return simcall_BODY_comm_iprobe(rdv, type, src, tag, match_fun, data); + return simcall_BODY_comm_iprobe(mbox, type, src, tag, match_fun, data); } /** diff --git a/src/simix/popping_accessors.h b/src/simix/popping_accessors.h index b7aa14364b..fe2c29cf82 100644 --- a/src/simix/popping_accessors.h +++ b/src/simix/popping_accessors.h @@ -432,88 +432,62 @@ static inline void simcall_process_restart__set__result(smx_simcall_t simcall, v simcall->result.dp = result; } -static inline const char* simcall_rdv_create__get__name(smx_simcall_t simcall) { +static inline const char* simcall_mbox_create__get__name(smx_simcall_t simcall) { return simcall->args[0].cc; } -static inline void simcall_rdv_create__set__name(smx_simcall_t simcall, const char* arg) { +static inline void simcall_mbox_create__set__name(smx_simcall_t simcall, const char* arg) { simcall->args[0].cc = arg; } -static inline smx_mailbox_t simcall_rdv_create__get__result(smx_simcall_t simcall){ +static inline smx_mailbox_t simcall_mbox_create__get__result(smx_simcall_t simcall){ return (smx_mailbox_t) simcall->result.dp; } -static inline void simcall_rdv_create__set__result(smx_simcall_t simcall, void* result){ +static inline void simcall_mbox_create__set__result(smx_simcall_t simcall, void* result){ simcall->result.dp = result; } -static inline smx_mailbox_t simcall_rdv_destroy__get__rdv(smx_simcall_t simcall) { +static inline smx_mailbox_t simcall_mbox_get_head__get__mbox(smx_simcall_t simcall) { return (smx_mailbox_t) simcall->args[0].dp; } -static inline void simcall_rdv_destroy__set__rdv(smx_simcall_t simcall, void* arg) { +static inline void simcall_mbox_get_head__set__mbox(smx_simcall_t simcall, void* arg) { simcall->args[0].dp = arg; } - -static inline smx_mailbox_t simcall_rdv_comm_count_by_host__get__rdv(smx_simcall_t simcall) { - return (smx_mailbox_t) simcall->args[0].dp; -} -static inline void simcall_rdv_comm_count_by_host__set__rdv(smx_simcall_t simcall, void* arg) { - simcall->args[0].dp = arg; -} -static inline sg_host_t simcall_rdv_comm_count_by_host__get__host(smx_simcall_t simcall) { - return (sg_host_t) simcall->args[1].dp; -} -static inline void simcall_rdv_comm_count_by_host__set__host(smx_simcall_t simcall, void* arg) { - simcall->args[1].dp = arg; -} -static inline unsigned int simcall_rdv_comm_count_by_host__get__result(smx_simcall_t simcall){ - return simcall->result.ui; -} -static inline void simcall_rdv_comm_count_by_host__set__result(smx_simcall_t simcall, unsigned int result){ - simcall->result.ui = result; -} - -static inline smx_mailbox_t simcall_rdv_get_head__get__rdv(smx_simcall_t simcall) { - return (smx_mailbox_t) simcall->args[0].dp; -} -static inline void simcall_rdv_get_head__set__rdv(smx_simcall_t simcall, void* arg) { - simcall->args[0].dp = arg; -} -static inline smx_synchro_t simcall_rdv_get_head__get__result(smx_simcall_t simcall){ +static inline smx_synchro_t simcall_mbox_get_head__get__result(smx_simcall_t simcall){ return (smx_synchro_t) simcall->result.dp; } -static inline void simcall_rdv_get_head__set__result(smx_simcall_t simcall, void* result){ +static inline void simcall_mbox_get_head__set__result(smx_simcall_t simcall, void* result){ simcall->result.dp = result; } -static inline smx_mailbox_t simcall_rdv_set_receiver__get__rdv(smx_simcall_t simcall) { +static inline smx_mailbox_t simcall_mbox_set_receiver__get__mbox(smx_simcall_t simcall) { return (smx_mailbox_t) simcall->args[0].dp; } -static inline void simcall_rdv_set_receiver__set__rdv(smx_simcall_t simcall, void* arg) { +static inline void simcall_mbox_set_receiver__set__mbox(smx_simcall_t simcall, void* arg) { simcall->args[0].dp = arg; } -static inline smx_process_t simcall_rdv_set_receiver__get__receiver(smx_simcall_t simcall) { +static inline smx_process_t simcall_mbox_set_receiver__get__receiver(smx_simcall_t simcall) { return (smx_process_t) simcall->args[1].dp; } -static inline void simcall_rdv_set_receiver__set__receiver(smx_simcall_t simcall, void* arg) { +static inline void simcall_mbox_set_receiver__set__receiver(smx_simcall_t simcall, void* arg) { simcall->args[1].dp = arg; } -static inline smx_mailbox_t simcall_rdv_get_receiver__get__rdv(smx_simcall_t simcall) { +static inline smx_mailbox_t simcall_mbox_get_receiver__get__mbox(smx_simcall_t simcall) { return (smx_mailbox_t) simcall->args[0].dp; } -static inline void simcall_rdv_get_receiver__set__rdv(smx_simcall_t simcall, void* arg) { +static inline void simcall_mbox_get_receiver__set__mbox(smx_simcall_t simcall, void* arg) { simcall->args[0].dp = arg; } -static inline smx_process_t simcall_rdv_get_receiver__get__result(smx_simcall_t simcall){ +static inline smx_process_t simcall_mbox_get_receiver__get__result(smx_simcall_t simcall){ return (smx_process_t) simcall->result.dp; } -static inline void simcall_rdv_get_receiver__set__result(smx_simcall_t simcall, void* result){ +static inline void simcall_mbox_get_receiver__set__result(smx_simcall_t simcall, void* result){ simcall->result.dp = result; } -static inline smx_mailbox_t simcall_comm_iprobe__get__rdv(smx_simcall_t simcall) { +static inline smx_mailbox_t simcall_comm_iprobe__get__mbox(smx_simcall_t simcall) { return (smx_mailbox_t) simcall->args[0].dp; } -static inline void simcall_comm_iprobe__set__rdv(smx_simcall_t simcall, void* arg) { +static inline void simcall_comm_iprobe__set__mbox(smx_simcall_t simcall, void* arg) { simcall->args[0].dp = arg; } static inline int simcall_comm_iprobe__get__type(smx_simcall_t simcall) { @@ -559,10 +533,10 @@ static inline smx_process_t simcall_comm_send__get__sender(smx_simcall_t simcall static inline void simcall_comm_send__set__sender(smx_simcall_t simcall, void* arg) { simcall->args[0].dp = arg; } -static inline smx_mailbox_t simcall_comm_send__get__rdv(smx_simcall_t simcall) { +static inline smx_mailbox_t simcall_comm_send__get__mbox(smx_simcall_t simcall) { return (smx_mailbox_t) simcall->args[1].dp; } -static inline void simcall_comm_send__set__rdv(smx_simcall_t simcall, void* arg) { +static inline void simcall_comm_send__set__mbox(smx_simcall_t simcall, void* arg) { simcall->args[1].dp = arg; } static inline double simcall_comm_send__get__task_size(smx_simcall_t simcall) { @@ -620,10 +594,10 @@ static inline smx_process_t simcall_comm_isend__get__sender(smx_simcall_t simcal static inline void simcall_comm_isend__set__sender(smx_simcall_t simcall, void* arg) { simcall->args[0].dp = arg; } -static inline smx_mailbox_t simcall_comm_isend__get__rdv(smx_simcall_t simcall) { +static inline smx_mailbox_t simcall_comm_isend__get__mbox(smx_simcall_t simcall) { return (smx_mailbox_t) simcall->args[1].dp; } -static inline void simcall_comm_isend__set__rdv(smx_simcall_t simcall, void* arg) { +static inline void simcall_comm_isend__set__mbox(smx_simcall_t simcall, void* arg) { simcall->args[1].dp = arg; } static inline double simcall_comm_isend__get__task_size(smx_simcall_t simcall) { @@ -693,10 +667,10 @@ static inline smx_process_t simcall_comm_recv__get__receiver(smx_simcall_t simca static inline void simcall_comm_recv__set__receiver(smx_simcall_t simcall, void* arg) { simcall->args[0].dp = arg; } -static inline smx_mailbox_t simcall_comm_recv__get__rdv(smx_simcall_t simcall) { +static inline smx_mailbox_t simcall_comm_recv__get__mbox(smx_simcall_t simcall) { return (smx_mailbox_t) simcall->args[1].dp; } -static inline void simcall_comm_recv__set__rdv(smx_simcall_t simcall, void* arg) { +static inline void simcall_comm_recv__set__mbox(smx_simcall_t simcall, void* arg) { simcall->args[1].dp = arg; } static inline void* simcall_comm_recv__get__dst_buff(smx_simcall_t simcall) { @@ -748,10 +722,10 @@ static inline smx_process_t simcall_comm_irecv__get__receiver(smx_simcall_t simc static inline void simcall_comm_irecv__set__receiver(smx_simcall_t simcall, void* arg) { simcall->args[0].dp = arg; } -static inline smx_mailbox_t simcall_comm_irecv__get__rdv(smx_simcall_t simcall) { +static inline smx_mailbox_t simcall_comm_irecv__get__mbox(smx_simcall_t simcall) { return (smx_mailbox_t) simcall->args[1].dp; } -static inline void simcall_comm_irecv__set__rdv(smx_simcall_t simcall, void* arg) { +static inline void simcall_comm_irecv__set__mbox(smx_simcall_t simcall, void* arg) { simcall->args[1].dp = arg; } static inline void* simcall_comm_irecv__get__dst_buff(smx_simcall_t simcall) { @@ -1399,11 +1373,11 @@ XBT_PRIVATE void simcall_HANDLER_process_sleep(smx_simcall_t simcall, double dur XBT_PRIVATE smx_synchro_t simcall_HANDLER_execution_start(smx_simcall_t simcall, const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask); XBT_PRIVATE void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_synchro_t execution); XBT_PRIVATE smx_process_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_process_t process); -XBT_PRIVATE smx_synchro_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t rdv, int type, int src, int tag, simix_match_func_t match_fun, void* data); -XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_process_t sender, smx_mailbox_t rdv, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout); -XBT_PRIVATE smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t sender, smx_mailbox_t rdv, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached); -XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate); -XBT_PRIVATE smx_synchro_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate); +XBT_PRIVATE smx_synchro_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data); +XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout); +XBT_PRIVATE smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached); +XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate); +XBT_PRIVATE smx_synchro_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate); XBT_PRIVATE void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, xbt_dynar_t comms); XBT_PRIVATE void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_synchro_t comm, double timeout); XBT_PRIVATE void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_synchro_t comm); diff --git a/src/simix/popping_bodies.cpp b/src/simix/popping_bodies.cpp index f5035a21de..bfc0c86062 100644 --- a/src/simix/popping_bodies.cpp +++ b/src/simix/popping_bodies.cpp @@ -633,14 +633,14 @@ inline static smx_process_t simcall_BODY_process_restart(smx_process_t process) return (smx_process_t) self->simcall.result.dp; } -inline static smx_mailbox_t simcall_BODY_rdv_create(const char* name) { +inline static smx_mailbox_t simcall_BODY_mbox_create(const char* name) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_rdv_create(name); + if (0) SIMIX_mbox_create(name); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - self->simcall.call = SIMCALL_RDV_CREATE; + self->simcall.call = SIMCALL_MBOX_CREATE; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].cc = (const char*) name; @@ -654,60 +654,17 @@ inline static smx_mailbox_t simcall_BODY_rdv_create(const char* name) { return (smx_mailbox_t) self->simcall.result.dp; } -inline static void simcall_BODY_rdv_destroy(smx_mailbox_t rdv) { +inline static smx_synchro_t simcall_BODY_mbox_get_head(smx_mailbox_t mbox) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_rdv_destroy(rdv); + if (0) SIMIX_mbox_get_head(mbox); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - self->simcall.call = SIMCALL_RDV_DESTROY; + self->simcall.call = SIMCALL_MBOX_GET_HEAD; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) rdv; - if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, - SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); - SIMIX_process_yield(self); - } else { - SIMIX_simcall_handle(&self->simcall, 0); - } - - } - -inline static unsigned int simcall_BODY_rdv_comm_count_by_host(smx_mailbox_t rdv, sg_host_t host) { - smx_process_t self = SIMIX_process_self(); - - /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_rdv_comm_count_by_host(rdv, host); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_RDV_COMM_COUNT_BY_HOST; - memset(&self->simcall.result, 0, sizeof(self->simcall.result)); - memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) rdv; - self->simcall.args[1].dp = (void*) host; - if (self != simix_global->maestro_process) { - XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, - SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); - SIMIX_process_yield(self); - } else { - SIMIX_simcall_handle(&self->simcall, 0); - } - return (unsigned int) self->simcall.result.ui; - } - -inline static smx_synchro_t simcall_BODY_rdv_get_head(smx_mailbox_t rdv) { - smx_process_t self = SIMIX_process_self(); - - /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_rdv_get_head(rdv); - /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - - self->simcall.call = SIMCALL_RDV_GET_HEAD; - memset(&self->simcall.result, 0, sizeof(self->simcall.result)); - memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) rdv; + self->simcall.args[0].dp = (void*) mbox; if (self != simix_global->maestro_process) { XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); @@ -718,17 +675,17 @@ inline static smx_synchro_t simcall_BODY_rdv_get_head(smx_mailbox_t rdv) { return (smx_synchro_t) self->simcall.result.dp; } -inline static void simcall_BODY_rdv_set_receiver(smx_mailbox_t rdv, smx_process_t receiver) { +inline static void simcall_BODY_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t receiver) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_rdv_set_receiver(rdv, receiver); + if (0) SIMIX_mbox_set_receiver(mbox, receiver); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - self->simcall.call = SIMCALL_RDV_SET_RECEIVER; + self->simcall.call = SIMCALL_MBOX_SET_RECEIVER; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) rdv; + self->simcall.args[0].dp = (void*) mbox; self->simcall.args[1].dp = (void*) receiver; if (self != simix_global->maestro_process) { XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, @@ -740,17 +697,17 @@ inline static void simcall_BODY_rdv_set_receiver(smx_mailbox_t rdv, smx_process_ } -inline static smx_process_t simcall_BODY_rdv_get_receiver(smx_mailbox_t rdv) { +inline static smx_process_t simcall_BODY_mbox_get_receiver(smx_mailbox_t mbox) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) SIMIX_rdv_get_receiver(rdv); + if (0) SIMIX_mbox_get_receiver(mbox); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ - self->simcall.call = SIMCALL_RDV_GET_RECEIVER; + self->simcall.call = SIMCALL_MBOX_GET_RECEIVER; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) rdv; + self->simcall.args[0].dp = (void*) mbox; if (self != simix_global->maestro_process) { XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name, SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call); @@ -761,17 +718,17 @@ inline static smx_process_t simcall_BODY_rdv_get_receiver(smx_mailbox_t rdv) { return (smx_process_t) self->simcall.result.dp; } -inline static smx_synchro_t simcall_BODY_comm_iprobe(smx_mailbox_t rdv, int type, int src, int tag, simix_match_func_t match_fun, void* data) { +inline static smx_synchro_t simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) simcall_HANDLER_comm_iprobe(&self->simcall, rdv, type, src, tag, match_fun, data); + if (0) simcall_HANDLER_comm_iprobe(&self->simcall, mbox, type, src, tag, match_fun, data); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ self->simcall.call = SIMCALL_COMM_IPROBE; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); - self->simcall.args[0].dp = (void*) rdv; + self->simcall.args[0].dp = (void*) mbox; self->simcall.args[1].i = (int) type; self->simcall.args[2].i = (int) src; self->simcall.args[3].i = (int) tag; @@ -787,18 +744,18 @@ inline static smx_synchro_t simcall_BODY_comm_iprobe(smx_mailbox_t rdv, int type return (smx_synchro_t) self->simcall.result.dp; } -inline static void simcall_BODY_comm_send(smx_process_t sender, smx_mailbox_t rdv, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) { +inline static void simcall_BODY_comm_send(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) simcall_HANDLER_comm_send(&self->simcall, sender, rdv, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout); + if (0) simcall_HANDLER_comm_send(&self->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ self->simcall.call = SIMCALL_COMM_SEND; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) sender; - self->simcall.args[1].dp = (void*) rdv; + self->simcall.args[1].dp = (void*) mbox; self->simcall.args[2].d = (double) task_size; self->simcall.args[3].d = (double) rate; self->simcall.args[4].dp = (void*) src_buff; @@ -817,18 +774,18 @@ inline static void simcall_BODY_comm_send(smx_process_t sender, smx_mailbox_t rd } -inline static smx_synchro_t simcall_BODY_comm_isend(smx_process_t sender, smx_mailbox_t rdv, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached) { +inline static smx_synchro_t simcall_BODY_comm_isend(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) simcall_HANDLER_comm_isend(&self->simcall, sender, rdv, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached); + if (0) simcall_HANDLER_comm_isend(&self->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ self->simcall.call = SIMCALL_COMM_ISEND; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) sender; - self->simcall.args[1].dp = (void*) rdv; + self->simcall.args[1].dp = (void*) mbox; self->simcall.args[2].d = (double) task_size; self->simcall.args[3].d = (double) rate; self->simcall.args[4].dp = (void*) src_buff; @@ -848,18 +805,18 @@ inline static smx_synchro_t simcall_BODY_comm_isend(smx_process_t sender, smx_ma return (smx_synchro_t) self->simcall.result.dp; } -inline static void simcall_BODY_comm_recv(smx_process_t receiver, smx_mailbox_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) { +inline static void simcall_BODY_comm_recv(smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) simcall_HANDLER_comm_recv(&self->simcall, receiver, rdv, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate); + if (0) simcall_HANDLER_comm_recv(&self->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ self->simcall.call = SIMCALL_COMM_RECV; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) receiver; - self->simcall.args[1].dp = (void*) rdv; + self->simcall.args[1].dp = (void*) mbox; self->simcall.args[2].dp = (void*) dst_buff; self->simcall.args[3].dp = (void*) dst_buff_size; self->simcall.args[4].fp = (FPtr) match_fun; @@ -877,18 +834,18 @@ inline static void simcall_BODY_comm_recv(smx_process_t receiver, smx_mailbox_t } -inline static smx_synchro_t simcall_BODY_comm_irecv(smx_process_t receiver, smx_mailbox_t rdv, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate) { +inline static smx_synchro_t simcall_BODY_comm_irecv(smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate) { smx_process_t self = SIMIX_process_self(); /* Go to that function to follow the code flow through the simcall barrier */ - if (0) simcall_HANDLER_comm_irecv(&self->simcall, receiver, rdv, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate); + if (0) simcall_HANDLER_comm_irecv(&self->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate); /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */ self->simcall.call = SIMCALL_COMM_IRECV; memset(&self->simcall.result, 0, sizeof(self->simcall.result)); memset(self->simcall.args, 0, sizeof(self->simcall.args)); self->simcall.args[0].dp = (void*) receiver; - self->simcall.args[1].dp = (void*) rdv; + self->simcall.args[1].dp = (void*) mbox; self->simcall.args[2].dp = (void*) dst_buff; self->simcall.args[3].dp = (void*) dst_buff_size; self->simcall.args[4].fp = (FPtr) match_fun; diff --git a/src/simix/popping_enum.h b/src/simix/popping_enum.h index 877f0a3a11..f2af98f360 100644 --- a/src/simix/popping_enum.h +++ b/src/simix/popping_enum.h @@ -46,12 +46,10 @@ typedef enum { SIMCALL_PROCESS_ON_EXIT, SIMCALL_PROCESS_AUTO_RESTART_SET, SIMCALL_PROCESS_RESTART, - SIMCALL_RDV_CREATE, - SIMCALL_RDV_DESTROY, - SIMCALL_RDV_COMM_COUNT_BY_HOST, - SIMCALL_RDV_GET_HEAD, - SIMCALL_RDV_SET_RECEIVER, - SIMCALL_RDV_GET_RECEIVER, + SIMCALL_MBOX_CREATE, + SIMCALL_MBOX_GET_HEAD, + SIMCALL_MBOX_SET_RECEIVER, + SIMCALL_MBOX_GET_RECEIVER, SIMCALL_COMM_IPROBE, SIMCALL_COMM_SEND, SIMCALL_COMM_ISEND, diff --git a/src/simix/popping_generated.cpp b/src/simix/popping_generated.cpp index d7a8dc8a11..3498a660bd 100644 --- a/src/simix/popping_generated.cpp +++ b/src/simix/popping_generated.cpp @@ -51,12 +51,10 @@ const char* simcall_names[] = { "SIMCALL_PROCESS_ON_EXIT", "SIMCALL_PROCESS_AUTO_RESTART_SET", "SIMCALL_PROCESS_RESTART", - "SIMCALL_RDV_CREATE", - "SIMCALL_RDV_DESTROY", - "SIMCALL_RDV_COMM_COUNT_BY_HOST", - "SIMCALL_RDV_GET_HEAD", - "SIMCALL_RDV_SET_RECEIVER", - "SIMCALL_RDV_GET_RECEIVER", + "SIMCALL_MBOX_CREATE", + "SIMCALL_MBOX_GET_HEAD", + "SIMCALL_MBOX_SET_RECEIVER", + "SIMCALL_MBOX_GET_RECEIVER", "SIMCALL_COMM_IPROBE", "SIMCALL_COMM_SEND", "SIMCALL_COMM_ISEND", @@ -254,33 +252,23 @@ case SIMCALL_PROCESS_RESTART: SIMIX_simcall_answer(simcall); break; -case SIMCALL_RDV_CREATE: - simcall->result.dp = SIMIX_rdv_create( simcall->args[0].cc); +case SIMCALL_MBOX_CREATE: + simcall->result.dp = SIMIX_mbox_create( simcall->args[0].cc); SIMIX_simcall_answer(simcall); break; -case SIMCALL_RDV_DESTROY: - SIMIX_rdv_destroy((smx_mailbox_t) simcall->args[0].dp); +case SIMCALL_MBOX_GET_HEAD: + simcall->result.dp = SIMIX_mbox_get_head((smx_mailbox_t) simcall->args[0].dp); SIMIX_simcall_answer(simcall); break; -case SIMCALL_RDV_COMM_COUNT_BY_HOST: - simcall->result.ui = SIMIX_rdv_comm_count_by_host((smx_mailbox_t) simcall->args[0].dp,(sg_host_t) simcall->args[1].dp); +case SIMCALL_MBOX_SET_RECEIVER: + SIMIX_mbox_set_receiver((smx_mailbox_t) simcall->args[0].dp,(smx_process_t) simcall->args[1].dp); SIMIX_simcall_answer(simcall); break; -case SIMCALL_RDV_GET_HEAD: - simcall->result.dp = SIMIX_rdv_get_head((smx_mailbox_t) simcall->args[0].dp); - SIMIX_simcall_answer(simcall); - break; - -case SIMCALL_RDV_SET_RECEIVER: - SIMIX_rdv_set_receiver((smx_mailbox_t) simcall->args[0].dp,(smx_process_t) simcall->args[1].dp); - SIMIX_simcall_answer(simcall); - break; - -case SIMCALL_RDV_GET_RECEIVER: - simcall->result.dp = SIMIX_rdv_get_receiver((smx_mailbox_t) simcall->args[0].dp); +case SIMCALL_MBOX_GET_RECEIVER: + simcall->result.dp = SIMIX_mbox_get_receiver((smx_mailbox_t) simcall->args[0].dp); SIMIX_simcall_answer(simcall); break; diff --git a/src/simix/simcalls.in b/src/simix/simcalls.in index 904718dcc9..8a0b4b3a06 100644 --- a/src/simix/simcalls.in +++ b/src/simix/simcalls.in @@ -78,18 +78,16 @@ Proc - process_on_exit (void) (process, void*, smx_process_t) (fun, FPtr, int_f_ Proc - process_auto_restart_set (void) (process, void*, smx_process_t) (auto_restart, int) Func H process_restart (void*, smx_process_t) (process, void*, smx_process_t) -Func - rdv_create (void*, smx_mailbox_t) (name, const char*) -Proc - rdv_destroy (void) (rdv, void*, smx_mailbox_t) -Func - rdv_comm_count_by_host (unsigned int) (rdv, void*, smx_mailbox_t) (host, void*, sg_host_t) -Func - rdv_get_head (void*, smx_synchro_t) (rdv, void*, smx_mailbox_t) -Proc - rdv_set_receiver (void) (rdv, void*, smx_mailbox_t) (receiver, void*, smx_process_t) -Func - rdv_get_receiver (void*, smx_process_t) (rdv, void*, smx_mailbox_t) - -Func H comm_iprobe (void*, smx_synchro_t) (rdv, void*, smx_mailbox_t) (type, int) (src, int) (tag, int) (match_fun, FPtr, simix_match_func_t) (data, void*) -Blck H comm_send (void) (sender, void*, smx_process_t) (rdv, void*, smx_mailbox_t) (task_size, double) (rate, double) (src_buff, void*) (src_buff_size, size_t) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (timeout, double) -Func H comm_isend (void*, smx_synchro_t) (sender, void*, smx_process_t) (rdv, void*, smx_mailbox_t) (task_size, double) (rate, double) (src_buff, void*) (src_buff_size, size_t) (match_fun, FPtr, simix_match_func_t) (clean_fun, FPtr, simix_clean_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (detached, int) -Blck H comm_recv (void) (receiver, void*, smx_process_t) (rdv, void*, smx_mailbox_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (timeout, double) (rate, double) -Func H comm_irecv (void*, smx_synchro_t) (receiver, void*, smx_process_t) (rdv, void*, smx_mailbox_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (rate, double) +Func - mbox_create (void*, smx_mailbox_t) (name, const char*) +Func - mbox_get_head (void*, smx_synchro_t) (mbox, void*, smx_mailbox_t) +Proc - mbox_set_receiver (void) (mbox, void*, smx_mailbox_t) (receiver, void*, smx_process_t) +Func - mbox_get_receiver (void*, smx_process_t) (mbox, void*, smx_mailbox_t) + +Func H comm_iprobe (void*, smx_synchro_t) (mbox, void*, smx_mailbox_t) (type, int) (src, int) (tag, int) (match_fun, FPtr, simix_match_func_t) (data, void*) +Blck H comm_send (void) (sender, void*, smx_process_t) (mbox, void*, smx_mailbox_t) (task_size, double) (rate, double) (src_buff, void*) (src_buff_size, size_t) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (timeout, double) +Func H comm_isend (void*, smx_synchro_t) (sender, void*, smx_process_t) (mbox, void*, smx_mailbox_t) (task_size, double) (rate, double) (src_buff, void*) (src_buff_size, size_t) (match_fun, FPtr, simix_match_func_t) (clean_fun, FPtr, simix_clean_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (detached, int) +Blck H comm_recv (void) (receiver, void*, smx_process_t) (mbox, void*, smx_mailbox_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (timeout, double) (rate, double) +Func H comm_irecv (void*, smx_synchro_t) (receiver, void*, smx_process_t) (mbox, void*, smx_mailbox_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (rate, double) Proc - comm_cancel (void) (comm, void*, smx_synchro_t) Blck H comm_waitany (int) (comms, void*, xbt_dynar_t) Blck H comm_wait (void) (comm, void*, smx_synchro_t) (timeout, double) diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index d039e8cd1e..a8846a2404 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -92,10 +92,10 @@ static void segvhandler(int signum, siginfo_t *siginfo, void *context) if (smpi_enabled() && !smpi_privatize_global_variables) { #if HAVE_PRIVATIZATION fprintf(stderr, - "Try to enable SMPI variable privatization with --cfg=smpi/privatize_global_variables:yes.\n"); + "Try to enable SMPI variable privatization with --cfg=smpi/privatize-global-variables:yes.\n"); #else fprintf(stderr, - "Sadly, your system does not support --cfg=smpi/privatize_global_variables:yes (yet).\n"); + "Sadly, your system does not support --cfg=smpi/privatize-global-variables:yes (yet).\n"); #endif /* HAVE_PRIVATIZATION */ } #endif /* HAVE_SMPI */ @@ -230,8 +230,6 @@ void SIMIX_global_init(int *argc, char **argv) __xbt_running_ctx_fetch = SIMIX_process_get_running_context; __xbt_ex_terminate = SIMIX_process_exception_terminate; - SIMIX_network_init(); - /* Prepare to display some more info when dying on Ctrl-C pressing */ signal(SIGINT, inthandler); @@ -260,7 +258,7 @@ void SIMIX_global_init(int *argc, char **argv) simix_timers = xbt_heap_new(8, &free); } - if (xbt_cfg_get_boolean("clean_atexit")) + if (xbt_cfg_get_boolean("clean-atexit")) atexit(SIMIX_clean); #if HAVE_MC @@ -298,7 +296,7 @@ void SIMIX_clean(void) SIMIX_process_killall(simix_global->maestro_process, 1); /* Exit the SIMIX network module */ - SIMIX_network_exit(); + SIMIX_mailbox_exit(); xbt_heap_free(simix_timers); simix_timers = NULL; diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index 9b79a4f915..dcf2c73eb2 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -1,5 +1,4 @@ -/* Copyright (c) 2009-2015. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2009-2016. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -10,178 +9,147 @@ #include "mc/mc.h" #include "src/mc/mc_replay.h" #include "xbt/dict.h" +#include "simgrid/s4u/mailbox.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_network, simix, "SIMIX network-related synchronization"); -static xbt_dict_t rdv_points = NULL; -XBT_EXPORT_NO_IMPORT(unsigned long int) smx_total_comms = 0; +static void SIMIX_mbox_free(void *data); +static xbt_dict_t mailboxes = xbt_dict_new_homogeneous(SIMIX_mbox_free); static void SIMIX_waitany_remove_simcall_from_actions(smx_simcall_t simcall); static void SIMIX_comm_copy_data(smx_synchro_t comm); static smx_synchro_t SIMIX_comm_new(e_smx_comm_type_t type); -static inline void SIMIX_rdv_push(smx_mailbox_t rdv, smx_synchro_t comm); -static smx_synchro_t SIMIX_fifo_probe_comm(xbt_fifo_t fifo, e_smx_comm_type_t type, - int (*match_fun)(void *, void *,smx_synchro_t), - void *user_data, smx_synchro_t my_synchro); -static smx_synchro_t SIMIX_fifo_get_comm(xbt_fifo_t fifo, e_smx_comm_type_t type, - int (*match_fun)(void *, void *,smx_synchro_t), - void *user_data, smx_synchro_t my_synchro); -static void SIMIX_rdv_free(void *data); +static inline void SIMIX_mbox_push(smx_mailbox_t mbox, smx_synchro_t comm); +static smx_synchro_t _find_matching_comm(std::deque *deque, e_smx_comm_type_t type, + int (*match_fun)(void *, void *,smx_synchro_t), void *user_data, smx_synchro_t my_synchro, bool remove_matching); static void SIMIX_comm_start(smx_synchro_t synchro); -void SIMIX_network_init(void) +void SIMIX_mailbox_exit(void) { - rdv_points = xbt_dict_new_homogeneous(SIMIX_rdv_free); -} - -void SIMIX_network_exit(void) -{ - xbt_dict_free(&rdv_points); + xbt_dict_free(&mailboxes); } /******************************************************************************/ /* Rendez-Vous Points */ /******************************************************************************/ -smx_mailbox_t SIMIX_rdv_create(const char *name) +smx_mailbox_t SIMIX_mbox_create(const char *name) { - /* two processes may have pushed the same rdv_create simcall at the same time */ - smx_mailbox_t rdv = name ? (smx_mailbox_t) xbt_dict_get_or_null(rdv_points, name) : NULL; - - if (!rdv) { - rdv = xbt_new0(s_smx_rvpoint_t, 1); - rdv->name = name ? xbt_strdup(name) : NULL; - rdv->comm_fifo = xbt_fifo_new(); - rdv->done_comm_fifo = xbt_fifo_new(); - rdv->permanent_receiver=NULL; + xbt_assert(name, "Mailboxes must have a name"); + /* two processes may have pushed the same mbox_create simcall at the same time */ + smx_mailbox_t mbox = (smx_mailbox_t) xbt_dict_get_or_null(mailboxes, name); - XBT_DEBUG("Creating a mailbox at %p with name %s", rdv, name); + if (!mbox) { + mbox = xbt_new0(s_smx_mailbox_t, 1); + mbox->name = xbt_strdup(name); + mbox->comm_queue = new std::deque(); + mbox->done_comm_queue = nullptr; // Allocated on need only + mbox->permanent_receiver=NULL; - if (rdv->name) - xbt_dict_set(rdv_points, rdv->name, rdv, NULL); + XBT_DEBUG("Creating a mailbox at %p with name %s", mbox, name); + xbt_dict_set(mailboxes, mbox->name, mbox, NULL); } - return rdv; -} - -void SIMIX_rdv_destroy(smx_mailbox_t rdv) -{ - if (rdv->name) - xbt_dict_remove(rdv_points, rdv->name); + return mbox; } -void SIMIX_rdv_free(void *data) +void SIMIX_mbox_free(void *data) { - XBT_DEBUG("rdv free %p", data); - smx_mailbox_t rdv = (smx_mailbox_t) data; - xbt_free(rdv->name); - xbt_fifo_free(rdv->comm_fifo); - xbt_fifo_free(rdv->done_comm_fifo); + XBT_DEBUG("mbox free %p", data); + smx_mailbox_t mbox = (smx_mailbox_t) data; + xbt_free(mbox->name); + delete mbox->comm_queue; + delete mbox->done_comm_queue; - xbt_free(rdv); + xbt_free(mbox); } -xbt_dict_t SIMIX_get_rdv_points() +smx_mailbox_t SIMIX_mbox_get_by_name(const char *name) { - return rdv_points; -} - -smx_mailbox_t SIMIX_rdv_get_by_name(const char *name) -{ - return (smx_mailbox_t) xbt_dict_get_or_null(rdv_points, name); -} - -int SIMIX_rdv_comm_count_by_host(smx_mailbox_t rdv, sg_host_t host) -{ - smx_synchro_t comm = NULL; - xbt_fifo_item_t item = NULL; - int count = 0; - - xbt_fifo_foreach(rdv->comm_fifo, item, comm, smx_synchro_t) { - if (comm->comm.src_proc->host == host) - count++; - } - - return count; + return (smx_mailbox_t) xbt_dict_get_or_null(mailboxes, name); } -smx_synchro_t SIMIX_rdv_get_head(smx_mailbox_t rdv) +smx_synchro_t SIMIX_mbox_get_head(smx_mailbox_t mbox) { - return (smx_synchro_t) xbt_fifo_get_item_content( - xbt_fifo_get_first_item(rdv->comm_fifo)); + return mbox->comm_queue->empty()? nullptr:mbox->comm_queue->front(); } /** * \brief get the receiver (process associated to the mailbox) - * \param rdv The rendez-vous point + * \param mbox The rendez-vous point * \return process The receiving process (NULL if not set) */ -smx_process_t SIMIX_rdv_get_receiver(smx_mailbox_t rdv) +smx_process_t SIMIX_mbox_get_receiver(smx_mailbox_t mbox) { - return rdv->permanent_receiver; + return mbox->permanent_receiver; } /** * \brief set the receiver of the rendez vous point to allow eager sends - * \param rdv The rendez-vous point + * \param mbox The rendez-vous point * \param process The receiving process */ -void SIMIX_rdv_set_receiver(smx_mailbox_t rdv, smx_process_t process) +void SIMIX_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t process) { - rdv->permanent_receiver=process; + mbox->permanent_receiver=process; + if (mbox->done_comm_queue == nullptr) + mbox->done_comm_queue = new std::deque(); } /** * \brief Pushes a communication synchro into a rendez-vous point - * \param rdv The rendez-vous point + * \param mbox The mailbox * \param comm The communication synchro */ -static inline void SIMIX_rdv_push(smx_mailbox_t rdv, smx_synchro_t comm) +static inline void SIMIX_mbox_push(smx_mailbox_t mbox, smx_synchro_t comm) { - xbt_fifo_push(rdv->comm_fifo, comm); - comm->comm.rdv = rdv; + mbox->comm_queue->push_back(comm); + comm->comm.mbox = mbox; } /** * \brief Removes a communication synchro from a rendez-vous point - * \param rdv The rendez-vous point + * \param mbox The rendez-vous point * \param comm The communication synchro */ -void SIMIX_rdv_remove(smx_mailbox_t rdv, smx_synchro_t comm) +void SIMIX_mbox_remove(smx_mailbox_t mbox, smx_synchro_t comm) { - xbt_fifo_remove(rdv->comm_fifo, comm); - comm->comm.rdv = NULL; + comm->comm.mbox = NULL; + for (auto it = mbox->comm_queue->begin(); it != mbox->comm_queue->end(); it++) + if (*it == comm) { + mbox->comm_queue->erase(it); + return; + } + xbt_die("Cannot remove this comm that is not part of the mailbox"); } /** - * \brief Checks if there is a communication synchro queued in a fifo matching our needs + * \brief Checks if there is a communication synchro queued in a deque matching our needs * \param type The type of communication we are looking for (comm_send, comm_recv) * \return The communication synchro if found, NULL otherwise */ -smx_synchro_t SIMIX_fifo_get_comm(xbt_fifo_t fifo, e_smx_comm_type_t type, - int (*match_fun)(void *, void *,smx_synchro_t), - void *this_user_data, smx_synchro_t my_synchro) +static smx_synchro_t _find_matching_comm(std::deque *deque, e_smx_comm_type_t type, + int (*match_fun)(void *, void *,smx_synchro_t), void *this_user_data, smx_synchro_t my_synchro, bool remove_matching) { - smx_synchro_t synchro; - xbt_fifo_item_t item; void* other_user_data = NULL; - xbt_fifo_foreach(fifo, item, synchro, smx_synchro_t) { + for(auto it = deque->begin(); it != deque->end(); it++){ + smx_synchro_t synchro = *it; if (synchro->comm.type == SIMIX_COMM_SEND) { other_user_data = synchro->comm.src_data; } else if (synchro->comm.type == SIMIX_COMM_RECEIVE) { other_user_data = synchro->comm.dst_data; } if (synchro->comm.type == type && - (!match_fun || match_fun(this_user_data, other_user_data, synchro)) && + (!match_fun || match_fun(this_user_data, other_user_data, synchro)) && (!synchro->comm.match_fun || synchro->comm.match_fun(other_user_data, this_user_data, my_synchro))) { XBT_DEBUG("Found a matching communication synchro %p", synchro); - xbt_fifo_remove_item(fifo, item); - xbt_fifo_free_item(item); + if (remove_matching) + deque->erase(it); synchro->comm.refcount++; #if HAVE_MC - synchro->comm.rdv_cpy = synchro->comm.rdv; + synchro->comm.mbox_cpy = synchro->comm.mbox; #endif - synchro->comm.rdv = NULL; + synchro->comm.mbox = NULL; return synchro; } XBT_DEBUG("Sorry, communication synchro %p does not match our needs:" @@ -192,41 +160,6 @@ smx_synchro_t SIMIX_fifo_get_comm(xbt_fifo_t fifo, e_smx_comm_type_t type, return NULL; } - -/** - * \brief Checks if there is a communication synchro queued in a fifo matching our needs, but leave it there - * \param type The type of communication we are looking for (comm_send, comm_recv) - * \return The communication synchro if found, NULL otherwise - */ -smx_synchro_t SIMIX_fifo_probe_comm(xbt_fifo_t fifo, e_smx_comm_type_t type, - int (*match_fun)(void *, void *,smx_synchro_t), - void *this_user_data, smx_synchro_t my_synchro) -{ - smx_synchro_t synchro; - xbt_fifo_item_t item; - void* other_user_data = NULL; - - xbt_fifo_foreach(fifo, item, synchro, smx_synchro_t) { - if (synchro->comm.type == SIMIX_COMM_SEND) { - other_user_data = synchro->comm.src_data; - } else if (synchro->comm.type == SIMIX_COMM_RECEIVE) { - other_user_data = synchro->comm.dst_data; - } - if (synchro->comm.type == type && - (!match_fun || match_fun(this_user_data, other_user_data, synchro)) && - (!synchro->comm.match_fun || synchro->comm.match_fun(other_user_data, this_user_data, my_synchro))) { - XBT_DEBUG("Found a matching communication synchro %p", synchro); - synchro->comm.refcount++; - - return synchro; - } - XBT_DEBUG("Sorry, communication synchro %p does not match our needs:" - " its type is %d but we are looking for a comm of type %d (or maybe the filtering didn't match)", - synchro, (int)synchro->comm.type, (int)type); - } - XBT_DEBUG("No matching communication synchro found"); - return NULL; -} /******************************************************************************/ /* Communication synchros */ /******************************************************************************/ @@ -255,7 +188,6 @@ smx_synchro_t SIMIX_comm_new(e_smx_comm_type_t type) synchro->category = NULL; XBT_DEBUG("Create communicate synchro %p", synchro); - ++smx_total_comms; return synchro; } @@ -292,8 +224,8 @@ void SIMIX_comm_destroy(smx_synchro_t synchro) synchro->comm.src_buff = NULL; } - if(synchro->comm.rdv) - SIMIX_rdv_remove(synchro->comm.rdv, synchro); + if(synchro->comm.mbox) + SIMIX_mbox_remove(synchro->comm.mbox, synchro); xbt_mallocator_release(simix_global->synchro_mallocator, synchro); } @@ -316,19 +248,19 @@ void SIMIX_comm_destroy_internal_actions(smx_synchro_t synchro) } } -void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_process_t src, smx_mailbox_t rdv, +void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_process_t src, smx_mailbox_t mbox, double task_size, double rate, void *src_buff, size_t src_buff_size, int (*match_fun)(void *, void *,smx_synchro_t), void (*copy_data_fun)(smx_synchro_t, void*, size_t), void *data, double timeout){ - smx_synchro_t comm = simcall_HANDLER_comm_isend(simcall, src, rdv, task_size, rate, + smx_synchro_t comm = simcall_HANDLER_comm_isend(simcall, src, mbox, task_size, rate, src_buff, src_buff_size, match_fun, NULL, copy_data_fun, data, 0); SIMCALL_SET_MC_VALUE(simcall, 0); simcall_HANDLER_comm_wait(simcall, comm, timeout); } -smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t src_proc, smx_mailbox_t rdv, +smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t src_proc, smx_mailbox_t mbox, double task_size, double rate, void *src_buff, size_t src_buff_size, int (*match_fun)(void *, void *,smx_synchro_t), @@ -336,7 +268,7 @@ smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t sr void (*copy_data_fun)(smx_synchro_t, void*, size_t),// used to copy data if not default one void *data, int detached) { - XBT_DEBUG("send from %p", rdv); + XBT_DEBUG("send from %p", mbox); /* Prepare a synchro describing us, so that it gets passed to the user-provided filter of other side */ smx_synchro_t this_synchro = SIMIX_comm_new(SIMIX_COMM_SEND); @@ -345,28 +277,28 @@ smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t sr * ourself so that the other side also gets a chance of choosing if it wants to match with us. * * If it is not found then push our communication into the rendez-vous point */ - smx_synchro_t other_synchro = SIMIX_fifo_get_comm(rdv->comm_fifo, SIMIX_COMM_RECEIVE, match_fun, data, this_synchro); + smx_synchro_t other_synchro = + _find_matching_comm(mbox->comm_queue, SIMIX_COMM_RECEIVE, match_fun, data, this_synchro, /*remove_matching*/true); if (!other_synchro) { other_synchro = this_synchro; - if (rdv->permanent_receiver!=NULL){ + if (mbox->permanent_receiver!=NULL){ //this mailbox is for small messages, which have to be sent right now other_synchro->state = SIMIX_READY; - other_synchro->comm.dst_proc=rdv->permanent_receiver; + other_synchro->comm.dst_proc=mbox->permanent_receiver; other_synchro->comm.refcount++; - xbt_fifo_push(rdv->done_comm_fifo,other_synchro); - other_synchro->comm.rdv=rdv; - XBT_DEBUG("pushing a message into the permanent receive fifo %p, comm %p", rdv, &(other_synchro->comm)); + mbox->done_comm_queue->push_back(other_synchro); + other_synchro->comm.mbox=mbox; + XBT_DEBUG("pushing a message into the permanent receive fifo %p, comm %p", mbox, &(other_synchro->comm)); }else{ - SIMIX_rdv_push(rdv, this_synchro); + SIMIX_mbox_push(mbox, this_synchro); } } else { XBT_DEBUG("Receive already pushed"); SIMIX_comm_destroy(this_synchro); - --smx_total_comms; // this creation was a pure waste other_synchro->state = SIMIX_READY; other_synchro->comm.type = SIMIX_COMM_READY; @@ -405,57 +337,56 @@ smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t sr return (detached ? NULL : other_synchro); } -void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t rdv, +void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size, int (*match_fun)(void *, void *, smx_synchro_t), void (*copy_data_fun)(smx_synchro_t, void*, size_t), void *data, double timeout, double rate) { - smx_synchro_t comm = SIMIX_comm_irecv(receiver, rdv, dst_buff, + smx_synchro_t comm = SIMIX_comm_irecv(receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate); SIMCALL_SET_MC_VALUE(simcall, 0); simcall_HANDLER_comm_wait(simcall, comm, timeout); } -smx_synchro_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t rdv, +smx_synchro_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size, int (*match_fun)(void *, void *, smx_synchro_t), void (*copy_data_fun)(smx_synchro_t, void*, size_t), void *data, double rate) { - return SIMIX_comm_irecv(receiver, rdv, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate); + return SIMIX_comm_irecv(receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate); } -smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t rdv, void *dst_buff, size_t *dst_buff_size, +smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size, int (*match_fun)(void *, void *, smx_synchro_t), void (*copy_data_fun)(smx_synchro_t, void*, size_t), // used to copy data if not default one void *data, double rate) { - XBT_DEBUG("recv from %p %p", rdv, rdv->comm_fifo); + XBT_DEBUG("recv from %p %p", mbox, mbox->comm_queue); smx_synchro_t this_synchro = SIMIX_comm_new(SIMIX_COMM_RECEIVE); smx_synchro_t other_synchro; //communication already done, get it inside the fifo of completed comms - if (rdv->permanent_receiver && xbt_fifo_size(rdv->done_comm_fifo)!=0) { + if (mbox->permanent_receiver && ! mbox->done_comm_queue->empty()) { XBT_DEBUG("We have a comm that has probably already been received, trying to match it, to skip the communication"); //find a match in the already received fifo - other_synchro = SIMIX_fifo_get_comm(rdv->done_comm_fifo, SIMIX_COMM_SEND, match_fun, data, this_synchro); + other_synchro = _find_matching_comm(mbox->done_comm_queue, SIMIX_COMM_SEND, match_fun, data, this_synchro,/*remove_matching*/true); //if not found, assume the receiver came first, register it to the mailbox in the classical way if (!other_synchro) { XBT_DEBUG("We have messages in the permanent receive list, but not the one we are looking for, pushing request into fifo"); other_synchro = this_synchro; - SIMIX_rdv_push(rdv, this_synchro); + SIMIX_mbox_push(mbox, this_synchro); } else { if(other_synchro->comm.surf_comm && SIMIX_comm_get_remains(other_synchro)==0.0) { XBT_DEBUG("comm %p has been already sent, and is finished, destroy it",&(other_synchro->comm)); other_synchro->state = SIMIX_DONE; other_synchro->comm.type = SIMIX_COMM_DONE; - other_synchro->comm.rdv = NULL; + other_synchro->comm.mbox = NULL; } other_synchro->comm.refcount--; SIMIX_comm_destroy(this_synchro); - --smx_total_comms; // this creation was a pure waste } } else { /* Prepare a synchro describing us, so that it gets passed to the user-provided filter of other side */ @@ -464,15 +395,14 @@ smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t rdv, void * * ourself so that the other side also gets a chance of choosing if it wants to match with us. * * If it is not found then push our communication into the rendez-vous point */ - other_synchro = SIMIX_fifo_get_comm(rdv->comm_fifo, SIMIX_COMM_SEND, match_fun, data, this_synchro); + other_synchro = _find_matching_comm(mbox->comm_queue, SIMIX_COMM_SEND, match_fun, data, this_synchro,/*remove_matching*/true); if (!other_synchro) { - XBT_DEBUG("Receive pushed first %d", xbt_fifo_size(rdv->comm_fifo)); + XBT_DEBUG("Receive pushed first %zu", mbox->comm_queue->size()); other_synchro = this_synchro; - SIMIX_rdv_push(rdv, this_synchro); + SIMIX_mbox_push(mbox, this_synchro); } else { SIMIX_comm_destroy(this_synchro); - --smx_total_comms; // this creation was a pure waste other_synchro->state = SIMIX_READY; other_synchro->comm.type = SIMIX_COMM_READY; //other_synchro->comm.refcount--; @@ -501,17 +431,17 @@ smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t rdv, void * return other_synchro; } -smx_synchro_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t rdv, +smx_synchro_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox, int type, int src, int tag, int (*match_fun)(void *, void *, smx_synchro_t), void *data){ - return SIMIX_comm_iprobe(simcall->issuer, rdv, type, src, tag, match_fun, data); + return SIMIX_comm_iprobe(simcall->issuer, mbox, type, src, tag, match_fun, data); } -smx_synchro_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_mailbox_t rdv, int type, int src, +smx_synchro_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_mailbox_t mbox, int type, int src, int tag, int (*match_fun)(void *, void *, smx_synchro_t), void *data) { - XBT_DEBUG("iprobe from %p %p", rdv, rdv->comm_fifo); + XBT_DEBUG("iprobe from %p %p", mbox, mbox->comm_queue); smx_synchro_t this_synchro; int smx_type; if(type == 1){ @@ -522,26 +452,20 @@ smx_synchro_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_mailbox_t rdv, int t smx_type = SIMIX_COMM_SEND; } smx_synchro_t other_synchro=NULL; - if(rdv->permanent_receiver && xbt_fifo_size(rdv->done_comm_fifo)!=0){ - //find a match in the already received fifo - XBT_DEBUG("first try in the perm recv mailbox"); - - other_synchro = SIMIX_fifo_probe_comm( - rdv->done_comm_fifo, (e_smx_comm_type_t) smx_type, - match_fun, data, this_synchro); + if(mbox->permanent_receiver && ! mbox->done_comm_queue->empty()){ + XBT_DEBUG("first check in the permanent recv mailbox, to see if we already got something"); + other_synchro = + _find_matching_comm(mbox->done_comm_queue, (e_smx_comm_type_t) smx_type, match_fun, data, this_synchro,/*remove_matching*/false); } - // }else{ - if(!other_synchro){ - XBT_DEBUG("try in the normal mailbox"); - other_synchro = SIMIX_fifo_probe_comm( - rdv->comm_fifo, (e_smx_comm_type_t) smx_type, - match_fun, data, this_synchro); - } -// } - if(other_synchro)other_synchro->comm.refcount--; + if (!other_synchro){ + XBT_DEBUG("check if we have more luck in the normal mailbox"); + other_synchro = + _find_matching_comm(mbox->comm_queue, (e_smx_comm_type_t) smx_type, match_fun, data, this_synchro,/*remove_matching*/false); + } + if(other_synchro) + other_synchro->comm.refcount--; SIMIX_comm_destroy(this_synchro); - --smx_total_comms; return other_synchro; } @@ -758,8 +682,8 @@ void SIMIX_comm_finish(smx_synchro_t synchro) } /* If the synchro is still in a rendez-vous point then remove from it */ - if (synchro->comm.rdv) - SIMIX_rdv_remove(synchro->comm.rdv, synchro); + if (synchro->comm.mbox) + SIMIX_mbox_remove(synchro->comm.mbox, synchro); XBT_DEBUG("SIMIX_comm_finish: synchro state = %d", (int)synchro->state); @@ -907,10 +831,10 @@ void SIMIX_post_comm(smx_synchro_t synchro) void SIMIX_comm_cancel(smx_synchro_t synchro) { - /* if the synchro is a waiting state means that it is still in a rdv */ + /* if the synchro is a waiting state means that it is still in a mbox */ /* so remove from it and delete it */ if (synchro->state == SIMIX_WAITING) { - SIMIX_rdv_remove(synchro->comm.rdv, synchro); + SIMIX_mbox_remove(synchro->comm.mbox, synchro); synchro->state = SIMIX_CANCELED; } else if (!MC_is_active() /* when running the MC there are no surf actions */ @@ -946,12 +870,10 @@ void SIMIX_comm_resume(smx_synchro_t synchro) */ double SIMIX_comm_get_remains(smx_synchro_t synchro) { - double remains; - - if(!synchro){ + if(!synchro) return 0; - } + double remains; switch (synchro->state) { case SIMIX_RUNNING: @@ -1019,8 +941,7 @@ SIMIX_comm_set_copy_data_callback(void (*callback) (smx_synchro_t, void*, size_t void SIMIX_comm_copy_pointer_callback(smx_synchro_t comm, void* buff, size_t buff_size) { - xbt_assert((buff_size == sizeof(void *)), - "Cannot copy %zu bytes: must be sizeof(void*)", buff_size); + xbt_assert((buff_size == sizeof(void *)), "Cannot copy %zu bytes: must be sizeof(void*)", buff_size); *(void **) (comm->comm.dst_buff) = buff; } diff --git a/src/simix/smx_network_private.h b/src/simix/smx_network_private.h index a1039d6551..cc6e381ec2 100644 --- a/src/simix/smx_network_private.h +++ b/src/simix/smx_network_private.h @@ -7,39 +7,37 @@ #ifndef _SIMIX_NETWORK_PRIVATE_H #define _SIMIX_NETWORK_PRIVATE_H +#include #include #include "simgrid/simix.h" #include "popping_private.h" /** @brief Rendez-vous point datatype */ -typedef struct s_smx_rvpoint { +typedef struct s_smx_mailbox { char *name; - xbt_fifo_t comm_fifo; + std::deque *comm_queue; void *data; smx_process_t permanent_receiver; //process which the mailbox is attached to - xbt_fifo_t done_comm_fifo;//messages already received in the permanent receive mode -} s_smx_rvpoint_t; - -XBT_PRIVATE void SIMIX_network_init(void); -XBT_PRIVATE void SIMIX_network_exit(void); - -XBT_PRIVATE smx_mailbox_t SIMIX_rdv_create(const char *name); -XBT_PRIVATE void SIMIX_rdv_destroy(smx_mailbox_t rdv); -XBT_PRIVATE smx_mailbox_t SIMIX_rdv_get_by_name(const char *name); -XBT_PRIVATE void SIMIX_rdv_remove(smx_mailbox_t rdv, smx_synchro_t comm); -XBT_PRIVATE int SIMIX_rdv_comm_count_by_host(smx_mailbox_t rdv, sg_host_t host); -XBT_PRIVATE smx_synchro_t SIMIX_rdv_get_head(smx_mailbox_t rdv); -XBT_PRIVATE void SIMIX_rdv_set_receiver(smx_mailbox_t rdv, smx_process_t proc); -XBT_PRIVATE smx_process_t SIMIX_rdv_get_receiver(smx_mailbox_t rdv); -XBT_PRIVATE smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t rdv, + std::deque *done_comm_queue;//messages already received in the permanent receive mode +} s_smx_mailbox_t; + +XBT_PRIVATE void SIMIX_mailbox_exit(void); + +XBT_PRIVATE smx_mailbox_t SIMIX_mbox_create(const char *name); +XBT_PRIVATE smx_mailbox_t SIMIX_mbox_get_by_name(const char *name); +XBT_PRIVATE void SIMIX_mbox_remove(smx_mailbox_t mbox, smx_synchro_t comm); +XBT_PRIVATE smx_synchro_t SIMIX_mbox_get_head(smx_mailbox_t mbox); +XBT_PRIVATE void SIMIX_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t proc); +XBT_PRIVATE smx_process_t SIMIX_mbox_get_receiver(smx_mailbox_t mbox); +XBT_PRIVATE smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size, int (*)(void *, void *, smx_synchro_t), void (*copy_data_fun)(smx_synchro_t, void*, size_t), void *data, double rate); XBT_PRIVATE void SIMIX_comm_destroy(smx_synchro_t synchro); XBT_PRIVATE void SIMIX_comm_destroy_internal_actions(smx_synchro_t synchro); -XBT_PRIVATE smx_synchro_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_mailbox_t rdv, int type, int src, +XBT_PRIVATE smx_synchro_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_mailbox_t mbox, int type, int src, int tag, int (*match_fun)(void *, void *, smx_synchro_t), void *data); XBT_PRIVATE void SIMIX_post_comm(smx_synchro_t synchro); XBT_PRIVATE void SIMIX_comm_cancel(smx_synchro_t synchro); diff --git a/src/simix/smx_private.h b/src/simix/smx_private.h index caca310451..fa5ffdd232 100644 --- a/src/simix/smx_private.h +++ b/src/simix/smx_private.h @@ -155,11 +155,11 @@ typedef struct s_smx_synchro { struct { e_smx_comm_type_t type; /* Type of the communication (SIMIX_COMM_SEND or SIMIX_COMM_RECEIVE) */ - smx_mailbox_t rdv; /* Rendez-vous where the comm is queued */ + smx_mailbox_t mbox; /* Rendez-vous where the comm is queued */ #if HAVE_MC - smx_mailbox_t rdv_cpy; /* Copy of the rendez-vous where the comm is queued, MC needs it for DPOR - (comm.rdv set to NULL when the communication is removed from the mailbox + smx_mailbox_t mbox_cpy; /* Copy of the rendez-vous where the comm is queued, MC needs it for DPOR + (comm.mbox set to NULL when the communication is removed from the mailbox (used as garbage collector)) */ #endif int refcount; /* Number of processes involved in the cond */ diff --git a/src/smpi/colls/reduce-mvapich-knomial.c b/src/smpi/colls/reduce-mvapich-knomial.c index cbed125111..7ec5c64797 100644 --- a/src/smpi/colls/reduce-mvapich-knomial.c +++ b/src/smpi/colls/reduce-mvapich-knomial.c @@ -215,6 +215,8 @@ int smpi_coll_tuned_reduce_mvapich2_knomial ( COLL_TAG_REDUCE,comm); smpi_mpi_waitall(1, &send_request, &status); + + smpi_free_tmp_buffer((void *)((char*)recvbuf + true_lb)); } /* --END ERROR HANDLING-- */ diff --git a/src/smpi/colls/reduce-mvapich-two-level.c b/src/smpi/colls/reduce-mvapich-two-level.c index 306bec9a9c..be67ddd958 100644 --- a/src/smpi/colls/reduce-mvapich-two-level.c +++ b/src/smpi/colls/reduce-mvapich-two-level.c @@ -233,6 +233,7 @@ int smpi_coll_tuned_reduce_mvapich2_two_level( void *sendbuf, intra_node_root, shmem_comm); } } else { + smpi_free_tmp_buffer((void *) ((char *) tmp_buf + true_lb)); tmp_buf = in_buf; } @@ -286,15 +287,23 @@ int smpi_coll_tuned_reduce_mvapich2_two_level( void *sendbuf, smpi_mpi_send(tmp_buf, count, datatype, root, COLL_TAG_REDUCE+1, comm); } - if ((local_rank != 0) && (root == my_rank)) { smpi_mpi_recv(recvbuf, count, datatype, leader_of_root, COLL_TAG_REDUCE+1, comm, MPI_STATUS_IGNORE); } + smpi_free_tmp_buffer((void *) ((char *) tmp_buf + true_lb)); + + if (leader_comm_rank == leader_root) { + if (my_rank != root || (my_rank == root && tmp_buf == recvbuf)) { + smpi_free_tmp_buffer(in_buf); + } + } } + + fn_exit: return mpi_errno; } diff --git a/src/smpi/colls/reduce-scatter-gather.c b/src/smpi/colls/reduce-scatter-gather.c index 57161ff817..98f2a097fa 100644 --- a/src/smpi/colls/reduce-scatter-gather.c +++ b/src/smpi/colls/reduce-scatter-gather.c @@ -21,7 +21,7 @@ int smpi_coll_tuned_reduce_scatter_gather(void *sendbuf, void *recvbuf, int recv_idx, last_idx = 0, newdst; int dst, send_cnt, recv_cnt, newroot, newdst_tree_root; int newroot_tree_root, new_count; - int tag = COLL_TAG_REDUCE; + int tag = COLL_TAG_REDUCE,temporary_buffer=0; void *send_ptr, *recv_ptr, *tmp_buf; cnts = NULL; @@ -40,6 +40,7 @@ int smpi_coll_tuned_reduce_scatter_gather(void *sendbuf, void *recvbuf, /* If I'm not the root, then my recvbuf may not be valid, therefore I have to allocate a temporary one */ if (rank != root && !recvbuf) { + temporary_buffer=1; recvbuf = (void *)smpi_get_tmp_recvbuffer(count * extent); } /* find nearest power-of-two less than or equal to comm_size */ @@ -401,6 +402,7 @@ int smpi_coll_tuned_reduce_scatter_gather(void *sendbuf, void *recvbuf, } if (tmp_buf) smpi_free_tmp_buffer(tmp_buf); + if(temporary_buffer==1) smpi_free_tmp_buffer(recvbuf); if (cnts) free(cnts); if (disps) diff --git a/src/smpi/colls/smpi_automatic_selector.c b/src/smpi/colls/smpi_automatic_selector.c index 63b3b6028e..0108d4cd7c 100644 --- a/src/smpi/colls/smpi_automatic_selector.c +++ b/src/smpi/colls/smpi_automatic_selector.c @@ -5,9 +5,6 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "colls_private.h" -#if HAVE_MC -#include "src/mc/mc_private.h" -#endif #include //attempt to do a quick autotuning version of the collective, diff --git a/src/smpi/private.h b/src/smpi/private.h index b5f27432ad..746abc8fa2 100644 --- a/src/smpi/private.h +++ b/src/smpi/private.h @@ -262,6 +262,8 @@ XBT_PRIVATE MPI_Comm smpi_comm_split(MPI_Comm comm, int color, int key); XBT_PRIVATE int smpi_comm_dup(MPI_Comm comm, MPI_Comm* newcomm); XBT_PRIVATE void smpi_comm_use(MPI_Comm comm); XBT_PRIVATE void smpi_comm_unuse(MPI_Comm comm); +XBT_PRIVATE void smpi_comm_cleanup_attributes(MPI_Comm comm); +XBT_PRIVATE void smpi_comm_cleanup_smp(MPI_Comm comm); XBT_PRIVATE void smpi_comm_set_leaders_comm(MPI_Comm comm, MPI_Comm leaders); XBT_PRIVATE void smpi_comm_set_intra_comm(MPI_Comm comm, MPI_Comm leaders); XBT_PRIVATE int* smpi_comm_get_non_uniform_map(MPI_Comm comm); diff --git a/src/smpi/smpi_base.cpp b/src/smpi/smpi_base.cpp index cd003cd10a..62699a1bc0 100644 --- a/src/smpi/smpi_base.cpp +++ b/src/smpi/smpi_base.cpp @@ -252,10 +252,12 @@ static MPI_Request build_request(void *buf, int count, MPI_Datatype datatype, in request->old_type = datatype; request->size = smpi_datatype_size(datatype) * count; + smpi_datatype_use(datatype); request->src = src; request->dst = dst; request->tag = tag; request->comm = comm; + smpi_comm_use(request->comm); request->action = NULL; request->flags = flags; request->detached = 0; @@ -272,7 +274,6 @@ static MPI_Request build_request(void *buf, int count, MPI_Datatype datatype, in request->op = MPI_REPLACE; request->send = 0; request->recv = 0; - // if (flags & SEND) smpi_datatype_unuse(datatype); return request; } @@ -334,7 +335,7 @@ void smpi_mpi_start(MPI_Request request) if (request->flags & RECV) { print_request("New recv", request); - int async_small_thresh = xbt_cfg_get_int("smpi/async_small_thresh"); + int async_small_thresh = xbt_cfg_get_int("smpi/async-small-thresh"); xbt_mutex_t mut = smpi_process_mailboxes_mutex(); if (async_small_thresh != 0 ||request->flags & RMA) @@ -382,8 +383,6 @@ void smpi_mpi_start(MPI_Request request) // we make a copy here, as the size is modified by simix, and we may reuse the request in another receive later request->real_size=request->size; - smpi_datatype_use(request->old_type); - smpi_comm_use(request->comm); request->action = simcall_comm_irecv(SIMIX_process_self(), mailbox, request->buf, &request->real_size, &match_recv, !smpi_process_get_replaying()? &smpi_comm_copy_buffer_callback : &smpi_comm_null_copy_buffer_callback, request, -1.0); @@ -412,7 +411,7 @@ void smpi_mpi_start(MPI_Request request) XBT_DEBUG("sending size of %zu : sleep %f ", request->size, smpi_os(request->size)); } - int async_small_thresh = xbt_cfg_get_int("smpi/async_small_thresh"); + int async_small_thresh = xbt_cfg_get_int("smpi/async-small-thresh"); xbt_mutex_t mut=smpi_process_remote_mailboxes_mutex(receiver); @@ -449,7 +448,7 @@ void smpi_mpi_start(MPI_Request request) void* buf = request->buf; if ( (! (request->flags & SSEND)) && ((request->flags & RMA) || - (static_cast(request->size) < xbt_cfg_get_int("smpi/send_is_detached_thresh")))) { + (static_cast(request->size) < xbt_cfg_get_int("smpi/send-is-detached-thresh")))) { void *oldbuf = NULL; request->detached = 1; XBT_DEBUG("Send request %p is detached", request); @@ -472,8 +471,6 @@ void smpi_mpi_start(MPI_Request request) // we make a copy here, as the size is modified by simix, and we may reuse the request in another receive later request->real_size=request->size; - smpi_datatype_use(request->old_type); - smpi_comm_use(request->comm); request->action = simcall_comm_isend(SIMIX_process_from_PID(request->src+1), mailbox, request->size, -1.0, buf, request->real_size, &match_send, &xbt_free_f, // how to free the userdata if a detached send fails @@ -508,6 +505,8 @@ void smpi_mpi_request_free(MPI_Request * request) if((*request)->refcount<0) xbt_die("wrong refcount"); if((*request)->refcount==0){ + smpi_datatype_unuse((*request)->old_type); + smpi_comm_unuse((*request)->comm); print_request("Destroying", (*request)); xbt_free(*request); *request = MPI_REQUEST_NULL; @@ -530,6 +529,7 @@ MPI_Request smpi_rma_send_init(void *buf, int count, MPI_Datatype datatype, int request = build_request(buf==MPI_BOTTOM ? (void*)0 : buf, count, datatype, src, dst, tag, comm, RMA | NON_PERSISTENT | ISEND | SEND | PREPARED | ACCUMULATE); request->op = op; +// smpi_datatype_use(datatype); } return request; } @@ -545,6 +545,7 @@ MPI_Request smpi_rma_recv_init(void *buf, int count, MPI_Datatype datatype, int request = build_request(buf==MPI_BOTTOM ? (void*)0 : buf, count, datatype, src, dst, tag, comm, RMA | NON_PERSISTENT | RECV | PREPARED | ACCUMULATE); request->op = op; +// smpi_datatype_use(datatype); } return request; } @@ -692,10 +693,8 @@ static void finish_wait(MPI_Request * request, MPI_Status * status) smpi_op_apply(req->op, req->buf, req->old_buf, &n, &datatype); } } - smpi_comm_unuse(req->comm); } - smpi_datatype_unuse(req->old_type); if (TRACE_smpi_view_internals()) { if(req->flags & RECV){ int rank = smpi_process_index(); @@ -836,7 +835,7 @@ void smpi_mpi_iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* print_request("New iprobe", request); // We have to test both mailboxes as we don't know if we will receive one one or another - if (xbt_cfg_get_int("smpi/async_small_thresh")>0){ + if (xbt_cfg_get_int("smpi/async-small-thresh")>0){ mailbox = smpi_process_mailbox_small(); XBT_DEBUG("trying to probe the perm recv mailbox"); request->action = simcall_comm_iprobe(mailbox, 0, request->src, request->tag, &match_recv, (void*)request); diff --git a/src/smpi/smpi_bench.cpp b/src/smpi/smpi_bench.cpp index 21abd6161e..b5ae065518 100644 --- a/src/smpi/smpi_bench.cpp +++ b/src/smpi/smpi_bench.cpp @@ -261,9 +261,8 @@ void smpi_bench_end(void) xbt_die("Aborting."); } // Simulate the benchmarked computation unless disabled via command-line argument - if (xbt_cfg_get_boolean("smpi/simulate_computation")) { + if (xbt_cfg_get_boolean("smpi/simulate-computation")) smpi_execute(xbt_os_timer_elapsed(timer)); - } smpi_total_benched_time += xbt_os_timer_elapsed(timer); } @@ -481,7 +480,7 @@ void smpi_sample_3(int global, const char *file, int line) void *smpi_shared_malloc(size_t size, const char *file, int line) { void* mem; - if (xbt_cfg_get_boolean("smpi/use_shared_malloc")){ + if (xbt_cfg_get_boolean("smpi/use-shared-malloc")){ int fd; smpi_source_location loc(file, line); auto res = allocs.insert(std::make_pair(loc, shared_data_t())); @@ -524,7 +523,7 @@ void smpi_shared_free(void *ptr) { char loc[PTR_STRLEN]; - if (xbt_cfg_get_boolean("smpi/use_shared_malloc")){ + if (xbt_cfg_get_boolean("smpi/use-shared-malloc")){ snprintf(loc, PTR_STRLEN, "%p", ptr); auto meta = allocs_metadata.find(ptr); if (meta == allocs_metadata.end()) { diff --git a/src/smpi/smpi_coll.cpp b/src/smpi/smpi_coll.cpp index 4a8806fb72..9f6d9bf8a2 100644 --- a/src/smpi/smpi_coll.cpp +++ b/src/smpi/smpi_coll.cpp @@ -125,7 +125,7 @@ int find_coll_description(s_mpi_coll_description_t * table, char *name_list = NULL; int selector_on=0; if(name==NULL){//no argument provided, use active selector's algorithm - name=(char*)xbt_cfg_get_string("smpi/coll_selector"); + name=(char*)xbt_cfg_get_string("smpi/coll-selector"); selector_on=1; } for (int i = 0; table[i].name; i++) diff --git a/src/smpi/smpi_comm.cpp b/src/smpi/smpi_comm.cpp index 3143742772..e5370df89d 100644 --- a/src/smpi/smpi_comm.cpp +++ b/src/smpi/smpi_comm.cpp @@ -288,6 +288,9 @@ MPI_Comm smpi_comm_split(MPI_Comm comm, int color, int key) reqs++; } } + if(i != 0) { + smpi_group_destroy(group_out); + } smpi_mpi_startall(reqs, requests); smpi_mpi_waitall(reqs, requests, MPI_STATUS_IGNORE); xbt_free(requests); @@ -311,12 +314,22 @@ void smpi_comm_use(MPI_Comm comm){ comm->refcount++; } -void smpi_comm_unuse(MPI_Comm comm){ - if (comm == MPI_COMM_UNINITIALIZED) - comm = smpi_process_comm_world(); - comm->refcount--; - smpi_group_unuse(comm->group); - if(comm->refcount==0){ +void smpi_comm_cleanup_attributes(MPI_Comm comm){ + if(comm->attributes !=NULL){ + xbt_dict_cursor_t cursor = NULL; + int* key; + void * value; + int flag; + xbt_dict_foreach(comm->attributes, cursor, key, value){ + smpi_comm_key_elem elem = + static_cast(xbt_dict_get_or_null(smpi_comm_keyvals, (const char*)key)); + if(elem && elem->delete_fn) + elem->delete_fn(comm, *key, value, &flag); + } + } +} + +void smpi_comm_cleanup_smp(MPI_Comm comm){ if(comm->intra_comm != MPI_COMM_NULL) smpi_comm_unuse(comm->intra_comm); if(comm->leaders_comm != MPI_COMM_NULL) @@ -325,18 +338,17 @@ void smpi_comm_unuse(MPI_Comm comm){ xbt_free(comm->non_uniform_map); if(comm->leaders_map !=NULL) xbt_free(comm->leaders_map); - if(comm->attributes !=NULL){ - xbt_dict_cursor_t cursor = NULL; - int* key; - void * value; - int flag; - xbt_dict_foreach(comm->attributes, cursor, key, value){ - smpi_comm_key_elem elem = - static_cast(xbt_dict_get_or_null(smpi_comm_keyvals, (const char*)key)); - if(elem && elem->delete_fn) - elem->delete_fn(comm, *key, value, &flag); - } - } +} + +void smpi_comm_unuse(MPI_Comm comm){ + if (comm == MPI_COMM_UNINITIALIZED) + comm = smpi_process_comm_world(); + comm->refcount--; + smpi_group_unuse(comm->group); + + if(comm->refcount==0){ + smpi_comm_cleanup_smp(comm); + smpi_comm_cleanup_attributes(comm); xbt_free(comm); } } @@ -464,9 +476,13 @@ void smpi_comm_init_smp(MPI_Comm comm){ for (i=0; i< leader_group_size;i++) smpi_group_set_mapping(leaders_group, leader_list[i], i); - leader_comm = smpi_comm_new(leaders_group, NULL); - if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL) + if(smpi_comm_get_leaders_comm(comm)==MPI_COMM_NULL){ + leader_comm = smpi_comm_new(leaders_group, NULL); smpi_comm_set_leaders_comm(comm, leader_comm); + }else{ + leader_comm=smpi_comm_get_leaders_comm(comm); + smpi_group_unuse(leaders_group); + } smpi_process_set_comm_intra(comm_intra); } diff --git a/src/smpi/smpi_global.cpp b/src/smpi/smpi_global.cpp index c2f843f0f9..9a8f5d2d1d 100644 --- a/src/smpi/smpi_global.cpp +++ b/src/smpi/smpi_global.cpp @@ -40,6 +40,7 @@ typedef struct s_smpi_process_data { char* instance_id; int replaying; /* is the process replaying a trace */ xbt_bar_t finalization_barrier; + int return_value; } s_smpi_process_data_t; static smpi_process_data_t *process_data = NULL; @@ -117,7 +118,7 @@ void smpi_process_init(int *argc, char ***argv) data->argc = argc; data->argv = argv; // set the process attached to the mailbox - simcall_rdv_set_receiver(data->mailbox_small, proc); + simcall_mbox_set_receiver(data->mailbox_small, proc); XBT_DEBUG("<%d> New process in the game: %p", index, proc); } xbt_assert(smpi_process_data(), @@ -376,12 +377,12 @@ void smpi_comm_null_copy_buffer_callback(smx_synchro_t comm, void *buff, size_t static void smpi_check_options(){ //check correctness of MPI parameters - xbt_assert(xbt_cfg_get_int("smpi/async_small_thresh") <= xbt_cfg_get_int("smpi/send_is_detached_thresh")); + xbt_assert(xbt_cfg_get_int("smpi/async-small-thresh") <= xbt_cfg_get_int("smpi/send-is-detached-thresh")); - if (xbt_cfg_is_default_value("smpi/running_power")) { + if (xbt_cfg_is_default_value("smpi/running-power")) { XBT_INFO("You did not set the power of the host running the simulation. " "The timings will certainly not be accurate. " - "Use the option \"--cfg=smpi/running_power:\" to set its value." + "Use the option \"--cfg=smpi/running-power:\" to set its value." "Check http://simgrid.org/simgrid/latest/doc/options.html#options_smpi_bench for more information."); } } @@ -412,8 +413,8 @@ void smpi_global_init(void) //process_data[i]->index = i; process_data[i]->argc = NULL; process_data[i]->argv = NULL; - process_data[i]->mailbox = simcall_rdv_create(get_mailbox_name(name, i)); - process_data[i]->mailbox_small = simcall_rdv_create(get_mailbox_name_small(name, i)); + process_data[i]->mailbox = simcall_mbox_create(get_mailbox_name(name, i)); + process_data[i]->mailbox_small = simcall_mbox_create(get_mailbox_name_small(name, i)); process_data[i]->mailboxes_mutex = xbt_mutex_init(); process_data[i]->timer = xbt_os_timer_new(); if (MC_is_active()) @@ -424,6 +425,7 @@ void smpi_global_init(void) process_data[i]->state = SMPI_UNINITIALIZED; process_data[i]->sampling = 0; process_data[i]->finalization_barrier = NULL; + process_data[i]->return_value = 0; } //if the process was launched through smpirun script we generate a global mpi_comm_world //if not, we let MPI_COMM_NULL, and the comm world will be private to each mpi instance @@ -460,16 +462,18 @@ void smpi_global_destroy(void) smpi_comm_destroy(process_data[i]->comm_intra); } xbt_os_timer_free(process_data[i]->timer); - simcall_rdv_destroy(process_data[i]->mailbox); - simcall_rdv_destroy(process_data[i]->mailbox_small); xbt_mutex_destroy(process_data[i]->mailboxes_mutex); xbt_free(process_data[i]); } xbt_free(process_data); process_data = NULL; - if (MPI_COMM_WORLD != MPI_COMM_UNINITIALIZED) + if (MPI_COMM_WORLD != MPI_COMM_UNINITIALIZED){ + smpi_comm_cleanup_smp(MPI_COMM_WORLD); + smpi_comm_cleanup_attributes(MPI_COMM_WORLD); xbt_free(MPI_COMM_WORLD); + } + MPI_COMM_WORLD = MPI_COMM_NULL; xbt_free(index_to_process_data); @@ -479,6 +483,7 @@ void smpi_global_destroy(void) } #ifndef WIN32 + void __attribute__ ((weak)) user_main_() { xbt_die("Should not be in this smpi_simulated_main"); @@ -492,9 +497,18 @@ int __attribute__ ((weak)) smpi_simulated_main_(int argc, char **argv) return 0; } +inline static int smpi_main_wrapper(int argc, char **argv){ + int ret = smpi_simulated_main_(argc,argv); + if(ret !=0){ + XBT_WARN("SMPI process did not return 0. Return value : %d", ret); + smpi_process_data()->return_value=ret; + } + return 0; +} + int __attribute__ ((weak)) main(int argc, char **argv) { - return smpi_main(smpi_simulated_main_, argc, argv); + return smpi_main(smpi_main_wrapper, argc, argv); } #endif @@ -563,7 +577,7 @@ static void smpi_init_options(){ int reduce_scatter_id = find_coll_description(mpi_coll_reduce_scatter_description, - xbt_cfg_get_string("smpi/reduce_scatter"),"reduce_scatter"); + xbt_cfg_get_string("smpi/reduce-scatter"),"reduce_scatter"); mpi_coll_reduce_scatter_fun = (int (*)(void *sbuf, void *rbuf, int *rcounts,MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)) mpi_coll_reduce_scatter_description[reduce_scatter_id].coll; @@ -575,9 +589,9 @@ static void smpi_init_options(){ int barrier_id = find_coll_description(mpi_coll_barrier_description, xbt_cfg_get_string("smpi/barrier"),"barrier"); mpi_coll_barrier_fun = (int (*)(MPI_Comm comm)) mpi_coll_barrier_description[barrier_id].coll; - smpi_cpu_threshold = xbt_cfg_get_double("smpi/cpu_threshold"); - smpi_running_power = xbt_cfg_get_double("smpi/running_power"); - smpi_privatize_global_variables = xbt_cfg_get_boolean("smpi/privatize_global_variables"); + smpi_cpu_threshold = xbt_cfg_get_double("smpi/cpu-threshold"); + smpi_running_power = xbt_cfg_get_double("smpi/running-power"); + smpi_privatize_global_variables = xbt_cfg_get_boolean("smpi/privatize-global-variables"); if (smpi_cpu_threshold < 0) smpi_cpu_threshold = DBL_MAX; } @@ -628,7 +642,7 @@ int smpi_main(int (*realmain) (int argc, char *argv[]), int argc, char *argv[]) SIMIX_run(); xbt_os_walltimer_stop(global_timer); - if (xbt_cfg_get_boolean("smpi/display_timing")){ + if (xbt_cfg_get_boolean("smpi/display-timing")){ double global_time = xbt_os_timer_elapsed(global_timer); XBT_INFO("Simulated time: %g seconds. \n\n" "The simulation took %g seconds (after parsing and platform setup)\n" @@ -640,11 +654,19 @@ int smpi_main(int (*realmain) (int argc, char *argv[]), int argc, char *argv[]) "You may want to use sampling functions or trace replay to reduce this."); } } + int count = smpi_process_count(); + int i, ret=0; + for (i = 0; i < count; i++) { + if(process_data[i]->return_value!=0){ + ret=process_data[i]->return_value;//return first non 0 value + break; + } + } smpi_global_destroy(); TRACE_end(); - return 0; + return ret; } // This function can be called from extern file, to initialize logs, options, and processes of smpi diff --git a/src/smpi/smpi_mpi_dt.cpp b/src/smpi/smpi_mpi_dt.cpp index ed34374b4c..3463eb8a44 100644 --- a/src/smpi/smpi_mpi_dt.cpp +++ b/src/smpi/smpi_mpi_dt.cpp @@ -178,6 +178,7 @@ int smpi_datatype_dup(MPI_Datatype datatype, MPI_Datatype* new_t) int ret=MPI_SUCCESS; *new_t= xbt_new(s_smpi_mpi_datatype_t,1); memcpy(*new_t, datatype, sizeof(s_smpi_mpi_datatype_t)); + (*new_t)->in_use=1; if (datatype->sizeof_substruct){ (*new_t)->substruct=xbt_malloc(datatype->sizeof_substruct); memcpy((*new_t)->substruct, datatype->substruct, datatype->sizeof_substruct); @@ -197,6 +198,7 @@ int smpi_datatype_dup(MPI_Datatype datatype, MPI_Datatype* new_t) if(elem && elem->copy_fn!=MPI_NULL_COPY_FN){ ret = elem->copy_fn(datatype, *key, NULL, value_in, &value_out, &flag ); if(ret!=MPI_SUCCESS){ + smpi_datatype_unuse(*new_t); *new_t=MPI_DATATYPE_NULL; return ret; } @@ -776,7 +778,6 @@ s_smpi_mpi_indexed_t* smpi_datatype_indexed_create( int* block_lengths, int* blo new_t->base.unserialize = &unserialize_indexed; new_t->base.subtype_free = &free_indexed; new_t->base.subtype_use = &use_indexed; - //TODO : add a custom function for each time to clean these new_t->block_lengths= xbt_new(int, block_count); new_t->block_indices= xbt_new(int, block_count); int i; @@ -927,7 +928,6 @@ s_smpi_mpi_hindexed_t* smpi_datatype_hindexed_create( int* block_lengths, MPI_Ai new_t->base.unserialize = &unserialize_hindexed; new_t->base.subtype_free = &free_hindexed; new_t->base.subtype_use = &use_hindexed; - //TODO : add a custom function for each time to clean these new_t->block_lengths= xbt_new(int, block_count); new_t->block_indices= xbt_new(MPI_Aint, block_count); int i; @@ -1084,7 +1084,6 @@ s_smpi_mpi_struct_t* smpi_datatype_struct_create( int* block_lengths, MPI_Aint* new_t->base.unserialize = &unserialize_struct; new_t->base.subtype_free = &free_struct; new_t->base.subtype_use = &use_struct; - //TODO : add a custom function for each time to clean these new_t->block_lengths= xbt_new(int, block_count); new_t->block_indices= xbt_new(MPI_Aint, block_count); new_t->old_types= xbt_new(MPI_Datatype, block_count); @@ -1095,10 +1094,7 @@ s_smpi_mpi_struct_t* smpi_datatype_struct_create( int* block_lengths, MPI_Aint* new_t->old_types[i]=old_types[i]; smpi_datatype_use(new_t->old_types[i]); } - //new_t->block_lengths = block_lengths; - //new_t->block_indices = block_indices; new_t->block_count = block_count; - //new_t->old_types = old_types; return new_t; } diff --git a/src/smpi/smpi_pmpi.cpp b/src/smpi/smpi_pmpi.cpp index 00e2fce12a..5a3cd2adcc 100644 --- a/src/smpi/smpi_pmpi.cpp +++ b/src/smpi/smpi_pmpi.cpp @@ -757,8 +757,6 @@ int PMPI_Comm_dup(MPI_Comm comm, MPI_Comm * newcomm) retval = MPI_ERR_ARG; } else { retval = smpi_comm_dup(comm, newcomm); - if(retval==MPI_SUCCESS) - smpi_group_use(smpi_comm_group(*newcomm)); } return retval; } diff --git a/src/smpi/smpi_rma.cpp b/src/smpi/smpi_rma.cpp index a5464743a9..98d3ae5aef 100644 --- a/src/smpi/smpi_rma.cpp +++ b/src/smpi/smpi_rma.cpp @@ -142,8 +142,6 @@ int smpi_mpi_put( void *origin_addr, int origin_count, MPI_Datatype origin_datat MPI_Win recv_win = win->connected_wins[target_rank]; void* recv_addr = (void*) ( ((char*)recv_win->base) + target_disp * recv_win->disp_unit); - smpi_datatype_use(origin_datatype); - smpi_datatype_use(target_datatype); XBT_DEBUG("Entering MPI_Put to %d", target_rank); if(target_rank != smpi_comm_rank(win->comm)){ @@ -179,8 +177,6 @@ int smpi_mpi_get( void *origin_addr, int origin_count, MPI_Datatype origin_datat MPI_Win send_win = win->connected_wins[target_rank]; void* send_addr = (void*)( ((char*)send_win->base) + target_disp * send_win->disp_unit); - smpi_datatype_use(origin_datatype); - smpi_datatype_use(target_datatype); XBT_DEBUG("Entering MPI_Get from %d", target_rank); if(target_rank != smpi_comm_rank(win->comm)){ @@ -225,9 +221,6 @@ int smpi_mpi_accumulate( void *origin_addr, int origin_count, MPI_Datatype origi void* recv_addr = (void*)( ((char*)recv_win->base) + target_disp * recv_win->disp_unit); XBT_DEBUG("Entering MPI_Accumulate to %d", target_rank); - smpi_datatype_use(origin_datatype); - smpi_datatype_use(target_datatype); - //prepare send_request MPI_Request sreq = smpi_rma_send_init(origin_addr, origin_count, origin_datatype, smpi_process_index(), smpi_group_index(smpi_comm_group(win->comm),target_rank), RMA_TAG+3, win->comm, op); diff --git a/src/smpi/smpirun.in b/src/smpi/smpirun.in index 6c78ae60c3..8e07eaf1f9 100755 --- a/src/smpi/smpirun.in +++ b/src/smpi/smpirun.in @@ -24,7 +24,7 @@ NETWORK_BANDWIDTH="${DEFAULT_NETWORK_BANDWIDTH}" NETWORK_LATENCY="${DEFAULT_NETWORK_LATENCY}" SPEED="${DEFAULT_SPEED}" -SIMOPTS="--cfg=surf/precision:1e-9 --cfg=network/model:SMPI --cfg=network/TCP_gamma:4194304" +SIMOPTS="--cfg=surf/precision:1e-9 --cfg=network/model:SMPI --cfg=network/TCP-gamma:4194304" #usage to print the way this script should be called usage () { @@ -457,7 +457,7 @@ if [ -n "${TRACE_ACTIVE}" ]; then fi if [ -n "${TRACE_COMMENT_FILE}" ]; then - TRACEOPTIONS="${TRACEOPTIONS} --cfg=tracing/comment_file:${TRACE_COMMENT_FILE}" + TRACEOPTIONS="${TRACEOPTIONS} --cfg=tracing/comment-file:${TRACE_COMMENT_FILE}" fi if [ -n "${TRACE_GROUPED}" ]; then diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index 9c1caf42b7..24189a472e 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -38,7 +38,7 @@ namespace surf { CpuCas01Model::CpuCas01Model() : simgrid::surf::CpuModel() { char *optim = xbt_cfg_get_string("cpu/optim"); - int select = xbt_cfg_get_boolean("cpu/maxmin_selective_update"); + int select = xbt_cfg_get_boolean("cpu/maxmin-selective-update"); if (!strcmp(optim, "Full")) { updateMechanism_ = UM_FULL; @@ -47,7 +47,7 @@ CpuCas01Model::CpuCas01Model() : simgrid::surf::CpuModel() updateMechanism_ = UM_LAZY; selectiveUpdate_ = 1; xbt_assert((select == 1) - || (xbt_cfg_is_default_value("cpu/maxmin_selective_update")), + || (xbt_cfg_is_default_value("cpu/maxmin-selective-update")), "Disabling selective update while using the lazy update mechanism is dumb!"); } else { xbt_die("Unsupported optimization (%s) for this model", optim); diff --git a/src/surf/cpu_interface.hpp b/src/surf/cpu_interface.hpp index 82763d40d3..bd42a47027 100644 --- a/src/surf/cpu_interface.hpp +++ b/src/surf/cpu_interface.hpp @@ -4,8 +4,19 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ +#include + +#include +#include +#include + +#include +#include + +#include "surf/datatypes.h" #include "surf_interface.hpp" #include "maxmin_private.hpp" +#include "trace_mgr.hpp" #ifndef SURF_CPU_INTERFACE_HPP_ #define SURF_CPU_INTERFACE_HPP_ diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index 5a3ae15866..4c1cf0846a 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -43,9 +43,9 @@ void surf_network_model_init_LegrandVelho(void) surf_network_model = new simgrid::surf::NetworkCm02Model(); xbt_dynar_push(all_existing_models, &surf_network_model); - xbt_cfg_setdefault_double("network/latency_factor", 13.01); - xbt_cfg_setdefault_double("network/bandwidth_factor", 0.97); - xbt_cfg_setdefault_double("network/weight_S", 20537); + xbt_cfg_setdefault_double("network/latency-factor", 13.01); + xbt_cfg_setdefault_double("network/bandwidth-factor", 0.97); + xbt_cfg_setdefault_double("network/weight-S", 20537); } /***************************************************************************/ @@ -68,9 +68,9 @@ void surf_network_model_init_CM02(void) surf_network_model = new simgrid::surf::NetworkCm02Model(); xbt_dynar_push(all_existing_models, &surf_network_model); - xbt_cfg_setdefault_double("network/latency_factor", 1.0); - xbt_cfg_setdefault_double("network/bandwidth_factor", 1.0); - xbt_cfg_setdefault_double("network/weight_S", 0.0); + xbt_cfg_setdefault_double("network/latency-factor", 1.0); + xbt_cfg_setdefault_double("network/bandwidth-factor", 1.0); + xbt_cfg_setdefault_double("network/weight-S", 0.0); } /***************************************************************************/ @@ -94,9 +94,9 @@ void surf_network_model_init_Reno(void) lmm_set_default_protocol_function(func_reno_f, func_reno_fp, func_reno_fpi); surf_network_model->f_networkSolve = lagrange_solve; - xbt_cfg_setdefault_double("network/latency_factor", 10.4); - xbt_cfg_setdefault_double("network/bandwidth_factor", 0.92); - xbt_cfg_setdefault_double("network/weight_S", 8775); + xbt_cfg_setdefault_double("network/latency-factor", 10.4); + xbt_cfg_setdefault_double("network/bandwidth-factor", 0.92); + xbt_cfg_setdefault_double("network/weight-S", 8775); } @@ -111,9 +111,9 @@ void surf_network_model_init_Reno2(void) lmm_set_default_protocol_function(func_reno2_f, func_reno2_fp, func_reno2_fpi); surf_network_model->f_networkSolve = lagrange_solve; - xbt_cfg_setdefault_double("network/latency_factor", 10.4); - xbt_cfg_setdefault_double("network/bandwidth_factor", 0.92); - xbt_cfg_setdefault_double("network/weight_S", 8775); + xbt_cfg_setdefault_double("network/latency-factor", 10.4); + xbt_cfg_setdefault_double("network/bandwidth-factor", 0.92); + xbt_cfg_setdefault_double("network/weight-S", 8775); } void surf_network_model_init_Vegas(void) @@ -127,9 +127,9 @@ void surf_network_model_init_Vegas(void) lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp, func_vegas_fpi); surf_network_model->f_networkSolve = lagrange_solve; - xbt_cfg_setdefault_double("network/latency_factor", 10.4); - xbt_cfg_setdefault_double("network/bandwidth_factor", 0.92); - xbt_cfg_setdefault_double("network/weight_S", 8775); + xbt_cfg_setdefault_double("network/latency-factor", 10.4); + xbt_cfg_setdefault_double("network/bandwidth-factor", 0.92); + xbt_cfg_setdefault_double("network/weight-S", 8775); } namespace simgrid { @@ -139,7 +139,7 @@ NetworkCm02Model::NetworkCm02Model() :NetworkModel() { char *optim = xbt_cfg_get_string("network/optim"); - int select = xbt_cfg_get_boolean("network/maxmin_selective_update"); + int select = xbt_cfg_get_boolean("network/maxmin-selective-update"); if (!strcmp(optim, "Full")) { updateMechanism_ = UM_FULL; @@ -147,7 +147,7 @@ NetworkCm02Model::NetworkCm02Model() } else if (!strcmp(optim, "Lazy")) { updateMechanism_ = UM_LAZY; selectiveUpdate_ = 1; - xbt_assert((select == 1) || (xbt_cfg_is_default_value("network/maxmin_selective_update")), + xbt_assert((select == 1) || (xbt_cfg_is_default_value("network/maxmin-selective-update")), "Disabling selective update while using the lazy update mechanism is dumb!"); } else { xbt_die("Unsupported optimization (%s) for this model", optim); diff --git a/src/surf/network_ib.cpp b/src/surf/network_ib.cpp index ebc4483ba9..ff2211bcd6 100644 --- a/src/surf/network_ib.cpp +++ b/src/surf/network_ib.cpp @@ -90,7 +90,7 @@ void surf_network_model_init_IB(void) networkActionStateChangedCallbacks.connect(IB_action_state_changed_callback); Link::onCommunicate.connect(IB_action_init_callback); simgrid::s4u::Host::onCreation.connect(IB_create_host_callback); - xbt_cfg_setdefault_double("network/weight_S", 8775); + xbt_cfg_setdefault_double("network/weight-S", 8775); } @@ -104,15 +104,15 @@ namespace simgrid { haveGap_=false; active_nodes=NULL; - const char* IB_factors_string=xbt_cfg_get_string("smpi/IB_penalty_factors"); + const char* IB_factors_string=xbt_cfg_get_string("smpi/IB-penalty-factors"); xbt_dynar_t radical_elements = xbt_str_split(IB_factors_string, ";"); surf_parse_assert(xbt_dynar_length(radical_elements)==3, - "smpi/IB_penalty_factors should be provided and contain 3 elements, semi-colon separated : for example 0.965;0.925;1.35"); + "smpi/IB-penalty-factors should be provided and contain 3 elements, semi-colon separated. Example: 0.965;0.925;1.35"); - Be = xbt_str_parse_double(xbt_dynar_get_as(radical_elements, 0, char *), "First part of smpi/IB_penalty_factors is not numerical: %s"); - Bs = xbt_str_parse_double(xbt_dynar_get_as(radical_elements, 1, char *), "Second part of smpi/IB_penalty_factors is not numerical: %s"); - ys = xbt_str_parse_double(xbt_dynar_get_as(radical_elements, 2, char *), "Third part of smpi/IB_penalty_factors is not numerical: %s"); + Be = xbt_str_parse_double(xbt_dynar_get_as(radical_elements, 0, char *), "First part of smpi/IB-penalty-factors is not numerical: %s"); + Bs = xbt_str_parse_double(xbt_dynar_get_as(radical_elements, 1, char *), "Second part of smpi/IB-penalty-factors is not numerical: %s"); + ys = xbt_str_parse_double(xbt_dynar_get_as(radical_elements, 2, char *), "Third part of smpi/IB-penalty-factors is not numerical: %s"); xbt_dynar_free(&radical_elements); } diff --git a/src/surf/network_smpi.cpp b/src/surf/network_smpi.cpp index ed9ece9f7d..8fcb6d452c 100644 --- a/src/surf/network_smpi.cpp +++ b/src/surf/network_smpi.cpp @@ -91,8 +91,8 @@ void surf_network_model_init_SMPI(void) surf_network_model = new simgrid::surf::NetworkSmpiModel(); xbt_dynar_push(all_existing_models, &surf_network_model); - xbt_cfg_setdefault_double("network/sender_gap", 10e-6); - xbt_cfg_setdefault_double("network/weight_S", 8775); + xbt_cfg_setdefault_double("network/sender-gap", 10e-6); + xbt_cfg_setdefault_double("network/weight-S", 8775); } namespace simgrid { @@ -172,7 +172,7 @@ namespace simgrid { double NetworkSmpiModel::bandwidthFactor(double size) { if (!smpi_bw_factor) - smpi_bw_factor = parse_factor(xbt_cfg_get_string("smpi/bw_factor")); + smpi_bw_factor = parse_factor(xbt_cfg_get_string("smpi/bw-factor")); unsigned int iter = 0; s_smpi_factor_t fact; @@ -192,7 +192,7 @@ namespace simgrid { double NetworkSmpiModel::latencyFactor(double size) { if (!smpi_lat_factor) - smpi_lat_factor = parse_factor(xbt_cfg_get_string("smpi/lat_factor")); + smpi_lat_factor = parse_factor(xbt_cfg_get_string("smpi/lat-factor")); unsigned int iter = 0; s_smpi_factor_t fact; diff --git a/src/surf/ptask_L07.cpp b/src/surf/ptask_L07.cpp index 8d21b65520..9a7179fee8 100644 --- a/src/surf/ptask_L07.cpp +++ b/src/surf/ptask_L07.cpp @@ -152,8 +152,7 @@ void HostL07Model::updateActionsState(double /*now*/, double delta) { while ((cnst = lmm_get_cnst_from_var(maxminSystem_, action->getVariable(), i++))) { void *constraint_id = lmm_constraint_id(cnst); - - if (static_cast(constraint_id)->isOff()) { + if (static_cast(constraint_id)->isOff()) { XBT_DEBUG("Action (%p) Failed!!", action); action->finish(); action->setState(Action::State::failed); diff --git a/src/xbt/config.cpp b/src/xbt/config.cpp index 7578fbdfa5..20b6a5ea2c 100644 --- a/src/xbt/config.cpp +++ b/src/xbt/config.cpp @@ -255,7 +255,7 @@ void xbt_cfg_register_alias(const char *newname, const char *oldname) res = new s_xbt_cfgelm_t(); XBT_DEBUG("Register cfg alias %s -> %s)",oldname,newname); - res->desc = bprintf("Deprecated alias for %s",newname); + res->desc = std::string("Deprecated alias for ")+std::string(newname); res->type = xbt_cfgelm_alias; res->content = (xbt_dynar_t)newname; diff --git a/src/xbt/xbt_os_synchro.c b/src/xbt/xbt_os_synchro.c index 5ece743e10..52b1762a1c 100644 --- a/src/xbt/xbt_os_synchro.c +++ b/src/xbt/xbt_os_synchro.c @@ -13,15 +13,10 @@ #include "xbt/synchro_core.h" #include "simgrid/simix.h" /* used implementation */ -#include "../simix/smx_private.h" /* FIXME */ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_sync, xbt, "Synchronization mechanism"); /****** mutex related functions ******/ -struct s_xbt_mutex_ { - s_smx_mutex_t mutex; -}; - xbt_mutex_t xbt_mutex_init(void) { return (xbt_mutex_t) simcall_mutex_init(); @@ -48,10 +43,6 @@ void xbt_mutex_destroy(xbt_mutex_t mutex) } /***** condition related functions *****/ -struct s_xbt_cond_ { - s_smx_cond_t cond; -}; - xbt_cond_t xbt_cond_init(void) { return (xbt_cond_t) simcall_cond_init(); diff --git a/teshsuite/lua/lua_platforms.tesh b/teshsuite/lua/lua_platforms.tesh index 172aa2c30a..03dd4cd1fa 100644 --- a/teshsuite/lua/lua_platforms.tesh +++ b/teshsuite/lua/lua_platforms.tesh @@ -1,34 +1,34 @@ -$ ${bindir:=.}/../../examples/msg/app-masterworker/app-masterworker ${srcdir:=.}/../../examples/platforms/small_platform.lua ${srcdir:=.}/../../examples/msg/masterslave/deployment_masterslave_mailbox.xml -> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Got 5 slaves and 20 tasks to process -> [Tremblay:master:(1) 0.000000] [msg_test/INFO] Sending "Task_0" (of 20) to mailbox "slave-0" -> [Tremblay:master:(1) 0.002265] [msg_test/INFO] Sending "Task_1" (of 20) to mailbox "slave-1" -> [Tremblay:master:(1) 0.171420] [msg_test/INFO] Sending "Task_2" (of 20) to mailbox "slave-2" -> [Tremblay:master:(1) 0.329817] [msg_test/INFO] Sending "Task_3" (of 20) to mailbox "slave-3" -> [Tremblay:master:(1) 0.453549] [msg_test/INFO] Sending "Task_4" (of 20) to mailbox "slave-4" -> [Tremblay:master:(1) 0.586168] [msg_test/INFO] Sending "Task_5" (of 20) to mailbox "slave-0" -> [Tremblay:master:(1) 0.588433] [msg_test/INFO] Sending "Task_6" (of 20) to mailbox "slave-1" -> [Tremblay:master:(1) 0.995917] [msg_test/INFO] Sending "Task_7" (of 20) to mailbox "slave-2" -> [Tremblay:master:(1) 1.154314] [msg_test/INFO] Sending "Task_8" (of 20) to mailbox "slave-3" -> [Tremblay:master:(1) 1.608379] [msg_test/INFO] Sending "Task_9" (of 20) to mailbox "slave-4" -> [Tremblay:master:(1) 1.749885] [msg_test/INFO] Sending "Task_10" (of 20) to mailbox "slave-0" -> [Tremblay:master:(1) 1.752150] [msg_test/INFO] Sending "Task_11" (of 20) to mailbox "slave-1" -> [Tremblay:master:(1) 1.921304] [msg_test/INFO] Sending "Task_12" (of 20) to mailbox "slave-2" -> [Tremblay:master:(1) 2.079701] [msg_test/INFO] Sending "Task_13" (of 20) to mailbox "slave-3" -> [Tremblay:master:(1) 2.763209] [msg_test/INFO] Sending "Task_14" (of 20) to mailbox "slave-4" -> [Tremblay:master:(1) 2.913601] [msg_test/INFO] Sending "Task_15" (of 20) to mailbox "slave-0" -> [Tremblay:master:(1) 2.915867] [msg_test/INFO] Sending "Task_16" (of 20) to mailbox "slave-1" -> [Tremblay:master:(1) 3.085021] [msg_test/INFO] Sending "Task_17" (of 20) to mailbox "slave-2" -> [Tremblay:master:(1) 3.243418] [msg_test/INFO] Sending "Task_18" (of 20) to mailbox "slave-3" -> [Tremblay:master:(1) 3.918038] [msg_test/INFO] Sending "Task_19" (of 20) to mailbox "slave-4" -> [Tremblay:master:(1) 4.077318] [msg_test/INFO] All tasks have been dispatched. Let's tell everybody the computation is over. -> [Tremblay:slave:(2) 4.077513] [msg_test/INFO] I'm done. See you! -> [Jupiter:slave:(3) 4.096528] [msg_test/INFO] I'm done. See you! -> [Fafard:slave:(4) 4.122236] [msg_test/INFO] I'm done. See you! -> [Ginette:slave:(5) 4.965689] [msg_test/INFO] I'm done. See you! -> [Bourassa:slave:(6) 5.133855] [msg_test/INFO] I'm done. See you! -> [5.133855] [msg_test/INFO] Simulation time 5.13386 +$ ${bindir:=.}/../../examples/msg/app-masterworker/app-masterworker ${srcdir:=.}/../../examples/platforms/small_platform.lua ${srcdir:=.}/../../examples/msg/app-masterworker/app-masterworker_d.xml +> [Tremblay:master:(1) 0.000000] [msg_app_masterworker/INFO] Got 5 workers and 20 tasks to process +> [Tremblay:master:(1) 0.000000] [msg_app_masterworker/INFO] Sending "Task_0" (of 20) to mailbox "worker-0" +> [Tremblay:master:(1) 0.002265] [msg_app_masterworker/INFO] Sending "Task_1" (of 20) to mailbox "worker-1" +> [Tremblay:master:(1) 0.171420] [msg_app_masterworker/INFO] Sending "Task_2" (of 20) to mailbox "worker-2" +> [Tremblay:master:(1) 0.329817] [msg_app_masterworker/INFO] Sending "Task_3" (of 20) to mailbox "worker-3" +> [Tremblay:master:(1) 0.453549] [msg_app_masterworker/INFO] Sending "Task_4" (of 20) to mailbox "worker-4" +> [Tremblay:master:(1) 0.586168] [msg_app_masterworker/INFO] Sending "Task_5" (of 20) to mailbox "worker-0" +> [Tremblay:master:(1) 0.588433] [msg_app_masterworker/INFO] Sending "Task_6" (of 20) to mailbox "worker-1" +> [Tremblay:master:(1) 0.995917] [msg_app_masterworker/INFO] Sending "Task_7" (of 20) to mailbox "worker-2" +> [Tremblay:master:(1) 1.154314] [msg_app_masterworker/INFO] Sending "Task_8" (of 20) to mailbox "worker-3" +> [Tremblay:master:(1) 1.608379] [msg_app_masterworker/INFO] Sending "Task_9" (of 20) to mailbox "worker-4" +> [Tremblay:master:(1) 1.749885] [msg_app_masterworker/INFO] Sending "Task_10" (of 20) to mailbox "worker-0" +> [Tremblay:master:(1) 1.752150] [msg_app_masterworker/INFO] Sending "Task_11" (of 20) to mailbox "worker-1" +> [Tremblay:master:(1) 1.921304] [msg_app_masterworker/INFO] Sending "Task_12" (of 20) to mailbox "worker-2" +> [Tremblay:master:(1) 2.079701] [msg_app_masterworker/INFO] Sending "Task_13" (of 20) to mailbox "worker-3" +> [Tremblay:master:(1) 2.763209] [msg_app_masterworker/INFO] Sending "Task_14" (of 20) to mailbox "worker-4" +> [Tremblay:master:(1) 2.913601] [msg_app_masterworker/INFO] Sending "Task_15" (of 20) to mailbox "worker-0" +> [Tremblay:master:(1) 2.915867] [msg_app_masterworker/INFO] Sending "Task_16" (of 20) to mailbox "worker-1" +> [Tremblay:master:(1) 3.085021] [msg_app_masterworker/INFO] Sending "Task_17" (of 20) to mailbox "worker-2" +> [Tremblay:master:(1) 3.243418] [msg_app_masterworker/INFO] Sending "Task_18" (of 20) to mailbox "worker-3" +> [Tremblay:master:(1) 3.918038] [msg_app_masterworker/INFO] Sending "Task_19" (of 20) to mailbox "worker-4" +> [Tremblay:master:(1) 4.077318] [msg_app_masterworker/INFO] All tasks have been dispatched. Let's tell everybody the computation is over. +> [Tremblay:worker:(2) 4.077513] [msg_app_masterworker/INFO] I'm done. See you! +> [Jupiter:worker:(3) 4.096528] [msg_app_masterworker/INFO] I'm done. See you! +> [Fafard:worker:(4) 4.122236] [msg_app_masterworker/INFO] I'm done. See you! +> [Ginette:worker:(5) 4.965689] [msg_app_masterworker/INFO] I'm done. See you! +> [Bourassa:worker:(6) 5.133855] [msg_app_masterworker/INFO] I'm done. See you! +> [5.133855] [msg_app_masterworker/INFO] Simulation time 5.13386 -$ $SG_TEST_EXENV ${bindir:=.}/../../examples/msg/token_ring/token_ring ${srcdir:=.}/../../examples/platforms/routing_cluster.lua "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ $SG_TEST_EXENV ${bindir:=.}/../../examples/msg/app-token-ring/app-token-ring ${srcdir:=.}/../../examples/platforms/routing_cluster.lua "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [ 0.000000] (0:maestro@) Number of host '6' > [ 0.000000] (1:0@host1) Host "0" send 'Token' to Host "1" > [ 0.017354] (2:1@host2) Host "1" received "Token" diff --git a/teshsuite/simdag/availability/availability.tesh b/teshsuite/simdag/availability/availability.tesh index a9aed3a83a..df3f8ca676 100644 --- a/teshsuite/simdag/availability/availability.tesh +++ b/teshsuite/simdag/availability/availability.tesh @@ -1,5 +1,5 @@ -$ ${bindir:=.}/availability ../../../examples/platforms/simulacrum_7_hosts.xml ../../../examples/simdag/scheduling/Montage_25.xml --cfg=network/TCP_gamma:4194304 --log=sd_daxparse.thresh:critical -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +$ ${bindir:=.}/availability ../../../examples/platforms/simulacrum_7_hosts.xml ../../../examples/simdag/scheduling/Montage_25.xml --cfg=network/TCP-gamma:4194304 --log=sd_daxparse.thresh:critical +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' > [0.000000] [xbt_cfg/INFO] Switching to the L07 model to handle parallel tasks. > [0.000000] [test/INFO] Scheduling DAX... > [0.000000] [test/INFO] Scheduling root to node: Host 26 diff --git a/teshsuite/simix/stack_overflow/stack_overflow.tesh b/teshsuite/simix/stack_overflow/stack_overflow.tesh index fc18efa7a9..83f666201d 100644 --- a/teshsuite/simix/stack_overflow/stack_overflow.tesh +++ b/teshsuite/simix/stack_overflow/stack_overflow.tesh @@ -1,5 +1,5 @@ ! expect signal SIGSEGV -$ ${bindir:=.}/stack_overflow --cfg=contexts/stack_size:96 ${srcdir:=.}/examples/platforms/small_platform.xml +$ ${bindir:=.}/stack_overflow --cfg=contexts/stack-size:96 ${srcdir:=.}/examples/platforms/small_platform.xml > [Tremblay:master:(0) 0.000000] [test/INFO] Launching our nice bugged recursive function... > Access violation detected. > This can result from a programming error in your code or, although less likely, diff --git a/teshsuite/smpi/bug-17132/bug-17132.tesh b/teshsuite/smpi/bug-17132/bug-17132.tesh index 2545b6bcb3..7778ebcf2c 100644 --- a/teshsuite/smpi/bug-17132/bug-17132.tesh +++ b/teshsuite/smpi/bug-17132/bug-17132.tesh @@ -1,7 +1,7 @@ -$ ${bindir:=.}/../../../bin/smpirun -np 16 -platform ../../../examples/platforms/small_platform.xml -hostfile ../hostfile ${bindir:=.}/bug-17132 --cfg=smpi/cpu_threshold:-1 --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -np 16 -platform ../../../examples/platforms/small_platform.xml -hostfile ../hostfile ${bindir:=.}/bug-17132 --cfg=smpi/cpu-threshold:-1 --log=smpi_kernel.thres:warning > You requested to use 16 processes, but there is only 5 processes in your hostfile... > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu-threshold' to '-1' > Walltime = 0.468274 \ No newline at end of file diff --git a/teshsuite/smpi/coll-allreduce/coll-allreduce-automatic.tesh b/teshsuite/smpi/coll-allreduce/coll-allreduce-automatic.tesh index 9631147e7c..e34494842c 100644 --- a/teshsuite/smpi/coll-allreduce/coll-allreduce-automatic.tesh +++ b/teshsuite/smpi/coll-allreduce/coll-allreduce-automatic.tesh @@ -2,7 +2,7 @@ ! setenv LD_LIBRARY_PATH=../../lib p Test allreduce -$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allreduce --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --cfg=smpi/allreduce:automatic --cfg=smpi/async_small_thresh:65536 --cfg=smpi/send_is_detached_thresh:128000 --cfg=smpi/cpu_threshold:-1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" +$ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile_coll -platform ../../../examples/platforms/small_platform.xml -np 16 --log=xbt_cfg.thres:critical ${bindir:=.}/coll-allreduce --log=smpi_kernel.thres:warning --log=smpi_coll.thres:error --cfg=smpi/allreduce:automatic --cfg=smpi/async-small-thresh:65536 --cfg=smpi/send-is-detached-thresh:128000 --cfg=smpi/cpu-threshold:-1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" > [rank 0] -> Tremblay > [rank 1] -> Tremblay > [rank 2] -> Tremblay diff --git a/teshsuite/smpi/isp/umpire/CMakeLists.txt b/teshsuite/smpi/isp/umpire/CMakeLists.txt index f75cdaa053..2173c46bca 100644 --- a/teshsuite/smpi/isp/umpire/CMakeLists.txt +++ b/teshsuite/smpi/isp/umpire/CMakeLists.txt @@ -218,14 +218,14 @@ if(enable_smpi AND enable_model-checking AND enable_smpi_ISP_testsuite) foreach (test ${umpire_tests_passing}) write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "! timeout 30") write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "! output display" APPEND) - write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "\$ \${bindir:=.}/../../../../bin/smpirun -wrapper \"\${bindir:=.}/../../../../bin/simgrid-mc\" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich \${bindir:=.}/${test} --log=smpi_coll.thresh:error" APPEND) + write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "\$ \${bindir:=.}/../../../../bin/smpirun -wrapper \"\${bindir:=.}/../../../../bin/simgrid-mc\" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=smpi/running-power:1e9 --cfg=smpi/coll_selector:mpich \${bindir:=.}/${test} --log=smpi_coll.thresh:error" APPEND) endforeach() foreach (test ${umpire_tests_deadlock} ${umpire_tests_problematic} ) write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "! timeout 30" ) write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "! expect return 3" APPEND) write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "! output display" APPEND) - write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "\$ \${bindir:=.}/../../../../bin/smpirun -wrapper \"\${bindir:=.}/../../../../bin/simgrid-mc\" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=smpi/running_power:1e9 --cfg=smpi/coll_selector:mpich \${bindir:=.}/${test} --log=smpi_coll.thresh:error" APPEND) + write_file(${CMAKE_CURRENT_BINARY_DIR}/${test}.tesh "\$ \${bindir:=.}/../../../../bin/smpirun -wrapper \"\${bindir:=.}/../../../../bin/simgrid-mc\" -hostfile ../../hostfile -platform ../../../../examples/platforms/small_platform.xml --log=xbt_cfg.thresh:warning -np 3 --cfg=smpi/running-power:1e9 --cfg=smpi/coll_selector:mpich \${bindir:=.}/${test} --log=smpi_coll.thresh:error" APPEND) endforeach() endif() diff --git a/teshsuite/smpi/macro-shared/macro-shared.tesh b/teshsuite/smpi/macro-shared/macro-shared.tesh index 169af5d6e4..7c45ae9bbb 100644 --- a/teshsuite/smpi/macro-shared/macro-shared.tesh +++ b/teshsuite/smpi/macro-shared/macro-shared.tesh @@ -5,7 +5,7 @@ p Test compute $ ${bindir:=.}/../../../bin/smpirun -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/macro-shared --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' > [0] After change, the value in the shared buffer is: 16053117601147974045 > [0] The value in the shared buffer is: 4 > [1] After change, the value in the shared buffer is: 16053117601147974045 diff --git a/teshsuite/smpi/mpich3-test/coll/CMakeLists.txt b/teshsuite/smpi/mpich3-test/coll/CMakeLists.txt index 81a1e682ee..c96d505161 100644 --- a/teshsuite/smpi/mpich3-test/coll/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/coll/CMakeLists.txt @@ -198,18 +198,18 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite) set_target_properties(allred PROPERTIES COMPILE_FLAGS "-O0" LINK_FLAGS "-O0") if(HAVE_THREAD_CONTEXTS) - ADD_TEST(test-smpi-mpich3-coll-thread ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/privatize_global_variables:${HAVE_PRIVATIZATION}) + ADD_TEST(test-smpi-mpich3-coll-thread ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/privatize-global-variables:${HAVE_PRIVATIZATION}) SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-thread PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") endif() if(HAVE_UCONTEXT_CONTEXTS) - ADD_TEST(test-smpi-mpich3-coll-ompi-ucontext ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:ucontext -execarg=--cfg=smpi/coll_selector:ompi -execarg=--cfg=smpi/privatize_global_variables:${HAVE_PRIVATIZATION} -execarg=--cfg=smpi/bcast:binomial_tree) + ADD_TEST(test-smpi-mpich3-coll-ompi-ucontext ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:ucontext -execarg=--cfg=smpi/coll_selector:ompi -execarg=--cfg=smpi/privatize-global-variables:${HAVE_PRIVATIZATION} -execarg=--cfg=smpi/bcast:binomial_tree) SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-ompi-ucontext PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") endif() if(HAVE_RAW_CONTEXTS) - ADD_TEST(test-smpi-mpich3-coll-mpich-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:mpich -execarg=--cfg=smpi/privatize_global_variables:${HAVE_PRIVATIZATION}) - ADD_TEST(test-smpi-mpich3-coll-ompi-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:ompi -execarg=--cfg=smpi/privatize_global_variables:${HAVE_PRIVATIZATION} -execarg=--cfg=smpi/bcast:binomial_tree) - ADD_TEST(test-smpi-mpich3-coll-mvapich2-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:mvapich2 -execarg=--cfg=smpi/privatize_global_variables:${HAVE_PRIVATIZATION}) - ADD_TEST(test-smpi-mpich3-coll-impi-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:impi -execarg=--cfg=smpi/privatize_global_variables:${HAVE_PRIVATIZATION}) + ADD_TEST(test-smpi-mpich3-coll-mpich-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:mpich -execarg=--cfg=smpi/privatize-global-variables:${HAVE_PRIVATIZATION}) + ADD_TEST(test-smpi-mpich3-coll-ompi-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:ompi -execarg=--cfg=smpi/privatize-global-variables:${HAVE_PRIVATIZATION} -execarg=--cfg=smpi/bcast:binomial_tree) + ADD_TEST(test-smpi-mpich3-coll-mvapich2-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:mvapich2 -execarg=--cfg=smpi/privatize-global-variables:${HAVE_PRIVATIZATION}) + ADD_TEST(test-smpi-mpich3-coll-impi-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:impi -execarg=--cfg=smpi/privatize-global-variables:${HAVE_PRIVATIZATION}) SET_TESTS_PROPERTIES(test-smpi-mpich3-coll-mpich-raw test-smpi-mpich3-coll-ompi-raw test-smpi-mpich3-coll-mpich-raw test-smpi-mpich3-coll-mvapich2-raw test-smpi-mpich3-coll-impi-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") endif() endif() diff --git a/teshsuite/smpi/mpich3-test/datatype/CMakeLists.txt b/teshsuite/smpi/mpich3-test/datatype/CMakeLists.txt index 3e2ef6e13d..600a2fb0ca 100644 --- a/teshsuite/smpi/mpich3-test/datatype/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/datatype/CMakeLists.txt @@ -30,7 +30,7 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite) endif() if (enable_smpi_MPICH3_testsuite AND HAVE_RAW_CONTEXTS) - ADD_TEST(test-smpi-mpich3-datatype-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/datatype ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/datatype -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/privatize_global_variables:${HAVE_PRIVATIZATION}) + ADD_TEST(test-smpi-mpich3-datatype-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/datatype ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/datatype -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/privatize-global-variables:${HAVE_PRIVATIZATION}) SET_TESTS_PROPERTIES(test-smpi-mpich3-datatype-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") endif() diff --git a/teshsuite/smpi/mpich3-test/info/CMakeLists.txt b/teshsuite/smpi/mpich3-test/info/CMakeLists.txt index 36d489f941..6d29723eda 100644 --- a/teshsuite/smpi/mpich3-test/info/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/info/CMakeLists.txt @@ -16,7 +16,7 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite) endif() if (enable_smpi_MPICH3_testsuite AND HAVE_RAW_CONTEXTS) - ADD_TEST(test-smpi-mpich3-info-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/info ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/info -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/privatize_global_variables:${HAVE_PRIVATIZATION}) + ADD_TEST(test-smpi-mpich3-info-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/info ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/info -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/privatize-global-variables:${HAVE_PRIVATIZATION}) SET_TESTS_PROPERTIES(test-smpi-mpich3-info-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") endif() diff --git a/teshsuite/smpi/mpich3-test/init/exitst1.c b/teshsuite/smpi/mpich3-test/init/exitst1.c index 3ea4e46d85..f01c6f9200 100644 --- a/teshsuite/smpi/mpich3-test/init/exitst1.c +++ b/teshsuite/smpi/mpich3-test/init/exitst1.c @@ -11,7 +11,7 @@ */ int main( int argc, char *argv[] ) { - MPI_Init( 0, 0 ); + MPI_Init( &argc, &argv ); MPI_Finalize( ); return 1; } diff --git a/teshsuite/smpi/mpich3-test/init/exitst2.c b/teshsuite/smpi/mpich3-test/init/exitst2.c index 7a9b19c4e6..d1b878a7bf 100644 --- a/teshsuite/smpi/mpich3-test/init/exitst2.c +++ b/teshsuite/smpi/mpich3-test/init/exitst2.c @@ -13,7 +13,7 @@ int main( int argc, char *argv[] ) { int rank; - MPI_Init( 0, 0 ); + MPI_Init( &argc, &argv ); MPI_Comm_rank( MPI_COMM_WORLD, &rank ); MPI_Finalize( ); return rank; diff --git a/teshsuite/smpi/mpich3-test/init/exitst3.c b/teshsuite/smpi/mpich3-test/init/exitst3.c index 9943e3b02b..3accbe4e78 100644 --- a/teshsuite/smpi/mpich3-test/init/exitst3.c +++ b/teshsuite/smpi/mpich3-test/init/exitst3.c @@ -12,7 +12,7 @@ int main( int argc, char *argv[] ) { int rank, size; - MPI_Init( 0, 0 ); + MPI_Init( &argc, &argv ); MPI_Comm_rank( MPI_COMM_WORLD, &rank ); MPI_Comm_size( MPI_COMM_WORLD, &size ); MPI_Barrier( MPI_COMM_WORLD ); diff --git a/teshsuite/smpi/mpich3-test/perf/CMakeLists.txt b/teshsuite/smpi/mpich3-test/perf/CMakeLists.txt index 793c04b52e..afeca4ccd5 100644 --- a/teshsuite/smpi/mpich3-test/perf/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/perf/CMakeLists.txt @@ -17,7 +17,7 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite) endif() if (enable_smpi_MPICH3_testsuite AND HAVE_RAW_CONTEXTS) - ADD_TEST(test-smpi-mpich3-perf-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/perf ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/perf -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/running_power:-1) + ADD_TEST(test-smpi-mpich3-perf-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/perf ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/perf -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/running-power:-1) endif() foreach(file allredtrace commcreatep non_zero_root sendrecvl timer transp-datatype twovec dtpack indexperf manyrma diff --git a/teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt b/teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt index 598ecc672e..aa3479c9c8 100644 --- a/teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt @@ -19,7 +19,7 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite) endif() if (enable_smpi_MPICH3_testsuite AND HAVE_RAW_CONTEXTS) - ADD_TEST(test-smpi-mpich3-pt2pt-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/pt2pt ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/pt2pt -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/privatize_global_variables:${HAVE_PRIVATIZATION}) + ADD_TEST(test-smpi-mpich3-pt2pt-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/pt2pt ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/pt2pt -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/privatize-global-variables:${HAVE_PRIVATIZATION}) SET_TESTS_PROPERTIES(test-smpi-mpich3-pt2pt-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") endif() diff --git a/teshsuite/smpi/mpich3-test/rma/CMakeLists.txt b/teshsuite/smpi/mpich3-test/rma/CMakeLists.txt index 4ffca29fcb..adf5e2ff95 100644 --- a/teshsuite/smpi/mpich3-test/rma/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/rma/CMakeLists.txt @@ -30,7 +30,7 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite) endif() if (enable_smpi_MPICH3_testsuite AND HAVE_RAW_CONTEXTS) - ADD_TEST(test-smpi-mpich3-rma-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/rma ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/rma -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/privatize_global_variables:${HAVE_PRIVATIZATION}) + ADD_TEST(test-smpi-mpich3-rma-raw ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/rma ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/rma -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/privatize-global-variables:${HAVE_PRIVATIZATION}) SET_TESTS_PROPERTIES(test-smpi-mpich3-rma-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") endif() diff --git a/teshsuite/smpi/mpich3-test/runtests b/teshsuite/smpi/mpich3-test/runtests index 6c9f46b837..1e35c24254 100755 --- a/teshsuite/smpi/mpich3-test/runtests +++ b/teshsuite/smpi/mpich3-test/runtests @@ -155,7 +155,7 @@ foreach $_ (@ARGV) { elsif (/--?maxnp=(.*)/) { $np_max = $1; } elsif (/--?tests=(.*)/) { $listfiles = $1; } elsif (/--?srcdir=(.*)/) { $srcdir = $1; - $mpiexec="$mpiexec -platform ${srcdir}/../../../../examples/platforms/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile_coll --log=root.thr:critical --cfg=smpi/running_power:1e9 --cfg=smpi/async_small_thresh:65536"; } + $mpiexec="$mpiexec -platform ${srcdir}/../../../../examples/platforms/small_platform_with_routers.xml -hostfile ${srcdir}/../../hostfile_coll --log=root.thr:critical --cfg=smpi/running-power:1e9 --cfg=smpi/async-small-thresh:65536"; } elsif (/--?verbose/) { $verbose = 1; } elsif (/--?showprogress/) { $showProgress = 1; } elsif (/--?debug/) { $debug = 1; } @@ -163,9 +163,6 @@ foreach $_ (@ARGV) { elsif (/--?batchdir=(.*)/) { $batrundir = $1; } elsif (/--?timeoutarg=(.*)/) { $timeoutArgPattern = $1; } elsif (/--?execarg=(.*)/) { $execarg = "$execarg $1"; } - elsif (/--?setenv/) { } - elsif (/--?enable-coverage/) { } - elsif (/--?timeout/) { } elsif (/VALGRIND_COMMAND=(.*)/) { $valgrind = $1; } elsif (/VALGRIND_OPTIONS=(.*)/) { @@ -215,14 +212,6 @@ foreach $_ (@ARGV) { # we do not know at this point how many tests will be run, so do # not print a test plan line like "1..450" until the very end } - else { - print STDERR "Unrecognized argument $_\n"; - print STDERR "runtests [-tests=testfile] [-np=nprocesses] \ - [-maxnp=max-nprocesses] [-srcdir=location-of-tests] \ - [-xmlfile=filename ] [-noxmlclose] \ - [-verbose] [-showprogress] [-debug] [-batch]\n"; - exit(1); - } } # Perform any post argument processing diff --git a/teshsuite/smpi/mpich3-test/util/mtest.c b/teshsuite/smpi/mpich3-test/util/mtest.c index 6f4d1439a3..a13d88c840 100644 --- a/teshsuite/smpi/mpich3-test/util/mtest.c +++ b/teshsuite/smpi/mpich3-test/util/mtest.c @@ -546,14 +546,13 @@ static void *MTestTypeIndexedInitRecv( MTestDatatype *mtype ) static void *MTestTypeIndexedFree( MTestDatatype *mtype ) { - if (mtype->buf) { - free( mtype->buf ); + if (mtype->buf) + free( mtype->buf ); free( mtype->displs ); free( mtype->index ); mtype->buf = 0; mtype->displs = 0; mtype->index = 0; - } return 0; } diff --git a/teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.tesh b/teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.tesh index dc6d06e02c..32f88d6cb3 100644 --- a/teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.tesh +++ b/teshsuite/smpi/pt2pt-dsend/pt2pt-dsend.tesh @@ -4,7 +4,7 @@ p Test dsend $ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 2 ${bindir:=.}/pt2pt-dsend -q --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' > [Jupiter:1:(2) 0.000000] [dsend/INFO] rank 1: data exchanged > [Tremblay:0:(1) 0.002945] [dsend/INFO] rank 0: data exchanged > [rank 0] -> Tremblay diff --git a/teshsuite/smpi/pt2pt-pingpong/TI_output.tesh b/teshsuite/smpi/pt2pt-pingpong/TI_output.tesh index 2ed5c71e10..b4d98eeb51 100644 --- a/teshsuite/smpi/pt2pt-pingpong/TI_output.tesh +++ b/teshsuite/smpi/pt2pt-pingpong/TI_output.tesh @@ -5,7 +5,7 @@ p Test output of time independent tracing p generate a trace with pingpong, and replay itself, then check that output trace of the second run is the same as in the first (once sorted) ! setenv LD_LIBRARY_PATH=../../lib ! output sort -$ ${bindir:=.}/../../../bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt --cfg=smpi/cpu_threshold:-1 -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt --cfg=smpi/cpu-threshold:-1 -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -q --log=smpi_kernel.thres:warning > *** Ping-pong test (MPI_Send/MPI_Recv) *** > == pivot=0 : pingpong [0] <--> [1] > == pivot=1 : pingpong [1] <--> [2] @@ -17,9 +17,9 @@ $ ${bindir:=.}/../../../bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.t > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/computing' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'out_in_ti.txt' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu-threshold' to '-1' > [0] About to send 1st message '99' to process [1] > [0] Received reply message '100' from process [1] > [1] About to send 1st message '100' to process [2] @@ -40,7 +40,7 @@ $ ${bindir:=.}/../../../bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.t > [rank 2] -> Fafard > [rank 3] -> Ginette -$ ${bindir:=.}/../../../bin/smpirun -ext smpi_replay --log=replay.:critical -trace-ti --cfg=tracing/filename:out_ti.txt --cfg=smpi/cpu_threshold:-1 -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/../../../examples/smpi/replay/smpi_replay ./out_in_ti.txt --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -ext smpi_replay --log=replay.:critical -trace-ti --cfg=tracing/filename:out_ti.txt --cfg=smpi/cpu-threshold:-1 -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/../../../examples/smpi/replay/smpi_replay ./out_in_ti.txt --log=smpi_kernel.thres:warning > [rank 0] -> Tremblay > [rank 1] -> Jupiter > [rank 2] -> Fafard @@ -52,9 +52,9 @@ $ ${bindir:=.}/../../../bin/smpirun -ext smpi_replay --log=replay.:critical -tra > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/computing' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'out_ti.txt' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu_threshold' to '-1' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'smpi/cpu-threshold' to '-1' > [Jupiter:1:(2) 0.016798] [smpi_replay/INFO] Simulation time 0.016798 ! output sort @@ -111,7 +111,7 @@ $ rm out_in_ti.txt p Same test, but only using one output file for all processes p generate a trace with pingpong, and replay itself, then check that output trace of the second run is the same as in the first (once sorted) ! output sort -$ ${bindir:=.}/../../../bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt --cfg=tracing/smpi/format/ti_one_file:yes -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -q --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.txt --cfg=tracing/smpi/format/ti-one-file:yes -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/pt2pt-pingpong -q --log=smpi_kernel.thres:warning > *** Ping-pong test (MPI_Send/MPI_Recv) *** > == pivot=0 : pingpong [0] <--> [1] > == pivot=1 : pingpong [1] <--> [2] @@ -123,9 +123,9 @@ $ ${bindir:=.}/../../../bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.t > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/computing' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'out_in_ti.txt' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/format/ti_one_file' to 'yes' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/format/ti-one-file' to 'yes' > [0] About to send 1st message '99' to process [1] > [0] Received reply message '100' from process [1] > [1] About to send 1st message '100' to process [2] @@ -146,7 +146,7 @@ $ ${bindir:=.}/../../../bin/smpirun -trace-ti --cfg=tracing/filename:out_in_ti.t > [rank 2] -> Fafard > [rank 3] -> Ginette -$ ${bindir:=.}/../../../bin/smpirun -ext smpi_replay --log=replay.:critical -trace-ti --cfg=tracing/filename:out_ti.txt --cfg=tracing/smpi/format/ti_one_file:yes -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/../../../examples/smpi/replay/smpi_replay ./out_in_ti.txt --log=smpi_kernel.thres:warning +$ ${bindir:=.}/../../../bin/smpirun -ext smpi_replay --log=replay.:critical -trace-ti --cfg=tracing/filename:out_ti.txt --cfg=tracing/smpi/format/ti-one-file:yes -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 4 ${bindir:=.}/../../../examples/smpi/replay/smpi_replay ./out_in_ti.txt --log=smpi_kernel.thres:warning > [rank 0] -> Tremblay > [rank 1] -> Jupiter > [rank 2] -> Fafard @@ -158,9 +158,9 @@ $ ${bindir:=.}/../../../bin/smpirun -ext smpi_replay --log=replay.:critical -tra > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/computing' to 'yes' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/filename' to 'out_ti.txt' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/format/ti_one_file' to 'yes' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'tracing/smpi/format/ti-one-file' to 'yes' > [Jupiter:1:(2) 0.016798] [smpi_replay/INFO] Simulation time 0.016798 $ rm -rf ./out_ti.txt_files diff --git a/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.tesh b/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.tesh index 58d1ff26be..82a59faeb3 100644 --- a/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.tesh +++ b/teshsuite/smpi/pt2pt-pingpong/pt2pt-pingpong.tesh @@ -8,7 +8,7 @@ $ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../. > == pivot=2 : pingpong [2] <--> [3] > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' > [0] About to send 1st message '99' to process [1] > [0] Received reply message '100' from process [1] > [1] About to send 1st message '100' to process [2] diff --git a/teshsuite/smpi/type-hvector/type-hvector.tesh b/teshsuite/smpi/type-hvector/type-hvector.tesh index 4ac0fecd58..138ed781d9 100644 --- a/teshsuite/smpi/type-hvector/type-hvector.tesh +++ b/teshsuite/smpi/type-hvector/type-hvector.tesh @@ -4,7 +4,7 @@ p Test hvector $ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 2 ${bindir:=.}/type-hvector -q --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' > [rank 0] -> Tremblay > [rank 1] -> Jupiter > rank= 0, a[0][0]=0.000000 diff --git a/teshsuite/smpi/type-indexed/type-indexed.tesh b/teshsuite/smpi/type-indexed/type-indexed.tesh index 7ee71b54d7..a125182131 100644 --- a/teshsuite/smpi/type-indexed/type-indexed.tesh +++ b/teshsuite/smpi/type-indexed/type-indexed.tesh @@ -4,7 +4,7 @@ p Test indexed $ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../../examples/platforms/small_platform.xml -np 2 ${bindir:=.}/type-indexed -q --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' > [rank 0] -> Tremblay > [rank 1] -> Jupiter > buffer[0] = 0 diff --git a/teshsuite/smpi/type-struct/type-struct.tesh b/teshsuite/smpi/type-struct/type-struct.tesh index 942ebc09b2..afeb485ab2 100644 --- a/teshsuite/smpi/type-struct/type-struct.tesh +++ b/teshsuite/smpi/type-struct/type-struct.tesh @@ -6,6 +6,6 @@ $ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ../../. > [rank 1] -> Jupiter > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' > Process 0 got -2 (-2?) and 8.000000 (8.0?), tab (should be all 0): 0 0 0 0 0 0 > Process 1 got -2 (-2?) and 8.000000 (8.0?), tab (should be all 0): 0 0 0 0 0 0 diff --git a/teshsuite/smpi/type-vector/type-vector.tesh b/teshsuite/smpi/type-vector/type-vector.tesh index 27eb654e74..1be8935c20 100644 --- a/teshsuite/smpi/type-vector/type-vector.tesh +++ b/teshsuite/smpi/type-vector/type-vector.tesh @@ -4,7 +4,7 @@ p Test vector $ ${bindir:=.}/../../../bin/smpirun -map -hostfile ../hostfile -platform ${srcdir:=.}/../../../examples/platforms/small_platform.xml -np 2 ${bindir:=.}/type-vector -q --log=smpi_kernel.thres:warning > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'surf/precision' to '1e-9' > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'SMPI' -> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP_gamma' to '4194304' +> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/TCP-gamma' to '4194304' > [rank 0] -> Tremblay > [rank 1] -> Jupiter > rank= 0, a[0][0]=0.000000 diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index c9aa053e14..683a623f27 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -986,7 +986,6 @@ set(CMAKE_SOURCE_FILES tools/cmake/MakeLibWin.cmake tools/cmake/Modules/FindGFortran.cmake tools/cmake/Modules/FindGraphviz.cmake - tools/cmake/Modules/FindLibSigc++.cmake tools/cmake/Modules/FindLibdw.cmake tools/cmake/Modules/FindLibunwind.cmake tools/cmake/Modules/FindLuaSimgrid.cmake diff --git a/tools/cmake/MakeLib.cmake b/tools/cmake/MakeLib.cmake index 4115a97a2d..6b825b2a37 100644 --- a/tools/cmake/MakeLib.cmake +++ b/tools/cmake/MakeLib.cmake @@ -66,11 +66,6 @@ if(HAVE_GRAPHVIZ) endif() endif() -if(SIMGRID_HAVE_LIBSIG) - SET(SIMGRID_DEP "${SIMGRID_DEP} -lsigc-2.0") - add_definitions(-DLIBSIGC) -endif() - if(HAVE_MC) # The availability of libunwind was checked in CompleteInFiles.cmake # (that includes FindLibunwind.cmake), so simply load it now. diff --git a/tools/cmake/Modules/FindLibSigc++.cmake b/tools/cmake/Modules/FindLibSigc++.cmake deleted file mode 100644 index e052359863..0000000000 --- a/tools/cmake/Modules/FindLibSigc++.cmake +++ /dev/null @@ -1,71 +0,0 @@ -find_path(PATH_LIBSIGC++_H "sigc++/sigc++.h" - HINTS - $ENV{LD_LIBRARY_PATH} - PATH_SUFFIXES include/sigc++-2.0/ include/ - PATHS - /opt - /opt/local - /opt/csw - /sw - /usr) - -find_path(PATH_LIBSIGC++CONFIG_H "sigc++config.h" - HINTS - $ENV{LD_LIBRARY_PATH} - PATH_SUFFIXES lib/x86_64-linux-gnu/sigc++-2.0/include/ include/ - PATHS - /opt - /opt/local - /opt/csw - /sw - /usr) - -find_library(PATH_LIBSIGC++_LIB - NAMES sigc-2.0 - HINTS - $ENV{LD_LIBRARY_PATH} - PATH_SUFFIXES lib/x86_64-linux-gnu/ lib/sigc++/ lib/ - PATHS - /opt - /opt/local - /opt/csw - /sw - /usr) - -message(STATUS "Looking for sigc++/sigc++.h") -if(PATH_LIBSIGC++_H) - message(STATUS "Looking for sigc++/sigc++.h - found") -else() - message(STATUS "Looking for sigc++/sigc++.h - not found") -endif() - -message(STATUS "Looking for sigc++config.h") -if(PATH_LIBSIGC++CONFIG_H) - message(STATUS "Looking for sigc++config.h - found") -else() - message(STATUS "Looking for sigc++config.h - not found") -endif() - -message(STATUS "Looking for libsigc++") -if(PATH_LIBSIGC++_LIB) - message(STATUS "Looking for libsigc++ - found") -else() - message(STATUS "Looking for libsigc++ - not found") -endif() - -if(PATH_LIBSIGC++_LIB AND PATH_LIBSIGC++_H AND PATH_LIBSIGC++CONFIG_H) - string(REGEX REPLACE "/sigc\\+\\+/sigc\\+\\+.h" "" PATH_LIBSIGC++_H "${PATH_LIBSIGC++_H}") - string(REGEX REPLACE "/sigc\\+\\+config.h" "" PATH_LIBSIGC++CONFIG_H "${PATH_LIBSIGC++CONFIG_H}") - string(REGEX REPLACE "/libsig.*" "" PATH_LIBSIGC++_LIB "${PATH_LIBSIGC++_LIB}") - - include_directories(${PATH_LIBSIGC++_H}) - include_directories(${PATH_LIBSIGC++CONFIG_H}) - link_directories(${PATH_LIBSIGC++_LIB}) - set(SIMGRID_HAVE_LIBSIG "1") -else() - set(SIMGRID_HAVE_LIBSIG "0") -endif() - -mark_as_advanced(PATH_LIBSIGC++_H) -mark_as_advanced(PATH_LIBSIGC++CONFIG_H) -mark_as_advanced(PATH_LIBSIGC++_LIB) diff --git a/tools/cmake/Tests.cmake b/tools/cmake/Tests.cmake index ab1d7f61d0..fae88f1e73 100644 --- a/tools/cmake/Tests.cmake +++ b/tools/cmake/Tests.cmake @@ -66,9 +66,9 @@ ENDMACRO() ### SMPI ### IF(enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN AND HAVE_THREAD_CONTEXTS) - ADD_TEST(test-smpi-mpich3-thread-f77 ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f77/ ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ -tests=testlist -execarg=--cfg=contexts/stack_size:8000 -execarg=--cfg=smpi/privatize_global_variables:${HAVE_PRIVATIZATION}) + ADD_TEST(test-smpi-mpich3-thread-f77 ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f77/ ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ -tests=testlist -execarg=--cfg=contexts/stack_size:8000 -execarg=--cfg=smpi/privatize-global-variables:${HAVE_PRIVATIZATION}) SET_TESTS_PROPERTIES(test-smpi-mpich3-thread-f77 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") - ADD_TEST(test-smpi-mpich3-thread-f90 ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f90/ ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/ -tests=testlist -execarg=--cfg=smpi/privatize_global_variables:${HAVE_PRIVATIZATION}) + ADD_TEST(test-smpi-mpich3-thread-f90 ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f90/ ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/ -tests=testlist -execarg=--cfg=smpi/privatize-global-variables:${HAVE_PRIVATIZATION}) SET_TESTS_PROPERTIES(test-smpi-mpich3-thread-f90 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!") ENDIF() diff --git a/tools/simgrid.supp b/tools/simgrid.supp index 1876d3dc8d..bcd088074d 100644 --- a/tools/simgrid.supp +++ b/tools/simgrid.supp @@ -43,7 +43,7 @@ #There seems to be an issue with libc using an uninitialized value somewhere in dlopen { - Invalid read in backtrace, called after makecontext + Invalid read in dl_start Memcheck:Cond fun:index fun:expand_dynamic_string_token @@ -51,6 +51,17 @@ fun:_dl_start } +# 72704 bytes leak from GCC >5.1 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64535 +{ + Memory leak in dl_init + Memcheck:Leak + match-leak-kinds:reachable + fun:malloc + obj:/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 + fun:call_init.part.0 + fun:_dl_init +} + # Memory leaks appearing to be in libcgraph. They can be seen with the # following simple program: # ,---- diff --git a/tools/tesh/bg-set-signal.tesh b/tools/tesh/bg-set-signal.tesh index 2179eaa973..d6e9796326 100644 --- a/tools/tesh/bg-set-signal.tesh +++ b/tools/tesh/bg-set-signal.tesh @@ -10,7 +10,7 @@ $ cd temp_testdir-bg-set-signal $ mkfile segfault.pl ! expect signal SIGSEGV -& perl segfault.pl +$ perl segfault.pl $ cd .. $ cmake -E remove_directory temp_testdir-bg-set-signal