- Many MSG tests were converted to the new S4U's interface in C, that
was extended for that.
+Simix:
+ - Remove obsolete option --cfg=contexts/parallel-threshold.
+
Fixed bugs (FG#.. -> FramaGit bugs; FG!.. -> FG merge requests)
(FG: issues on Framagit; GF: issues on GForge; GH: issues on GitHub)
- FG#41: Add sg_actor_create C interface
- Rename Energy plugin into host_energy
- Rename Load plugin into host_load
-simix:
+Simix:
- Add parameter --cfg=simix/breakpoint to raise a SIGTRAP at given time.
- kill simix::onDeadlock() that was somewhat dupplicating s4u::on_deadlock()
- Improve performance when handling timeouts of simix synchros.
- **contexts/factory:** :ref:`cfg=contexts/factory`
- **contexts/guard-size:** :ref:`cfg=contexts/guard-size`
- **contexts/nthreads:** :ref:`cfg=contexts/nthreads`
-- **contexts/parallel-threshold:** :ref:`cfg=contexts/parallel-threshold`
- **contexts/stack-size:** :ref:`cfg=contexts/stack-size`
- **contexts/synchro:** :ref:`cfg=contexts/synchro`
application.
.. _cfg=contexts/nthreads:
-.. _cfg=contexts/parallel-threshold:
.. _cfg=contexts/synchro:
Running User Code in Parallel
of cores that you have in your computer (or lower than 1 to have the
amount of cores auto-detected).
-Even if you asked several worker threads using the previous option,
-you can request to start the parallel execution (and pay the
-associated synchronization costs) only if the potential parallelism is
-large enough. For that, set the ``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
-main thread (thus saving the synchronization costs). Note that this
-option is mainly useful when the grain of the user code is very fine,
-because our synchronization is now very efficient.
-
When parallel execution is activated, you can choose the
synchronization schema used with the ``contexts/synchro`` item,
which value is either:
XBT_PUBLIC int SIMIX_context_is_parallel();
XBT_PUBLIC int SIMIX_context_get_nthreads();
XBT_PUBLIC void SIMIX_context_set_nthreads(int nb_threads);
-XBT_PUBLIC int SIMIX_context_get_parallel_threshold();
-XBT_PUBLIC void SIMIX_context_set_parallel_threshold(int threshold);
XBT_PUBLIC e_xbt_parmap_mode_t SIMIX_context_get_parallel_mode();
XBT_PUBLIC void SIMIX_context_set_parallel_mode(e_xbt_parmap_mode_t mode);
XBT_PUBLIC int SIMIX_is_maestro();
simgrid::config::declare_flag<int>("contexts/nthreads", "Number of parallel threads used to execute user contexts", 1,
&SIMIX_context_set_nthreads);
- simgrid::config::declare_flag<int>("contexts/parallel-threshold",
- "Minimal number of user contexts to be run in parallel (raw contexts only)", 2,
- &SIMIX_context_set_parallel_threshold);
- simgrid::config::alias("contexts/parallel-threshold", {"contexts/parallel_threshold"});
-
/* synchronization mode for parallel user contexts */
#if HAVE_FUTEX_H
std::string default_synchro_mode = "futex";
unsigned smx_context_stack_size;
unsigned smx_context_guard_size;
static int smx_parallel_contexts = 1;
-static int smx_parallel_threshold = 2;
static e_xbt_parmap_mode_t smx_parallel_synchronization_mode = XBT_PARMAP_DEFAULT;
/**
smx_parallel_contexts = nb_threads;
}
-/**
- * @brief Returns the threshold above which user processes are run in parallel.
- *
- * If the number of threads is set to 1, there is no parallelism and this
- * threshold has no effect.
- *
- * @return when the number of user processes ready to run is above
- * this threshold, they are run in parallel
- */
-int SIMIX_context_get_parallel_threshold() {
- return smx_parallel_threshold;
-}
-
-/**
- * @brief Sets the threshold above which user processes are run in parallel.
- *
- * If the number of threads is set to 1, there is no parallelism and this
- * threshold has no effect.
- *
- * @param threshold when the number of user processes ready to run is above
- * this threshold, they are run in parallel
- */
-void SIMIX_context_set_parallel_threshold(int threshold) {
- smx_parallel_threshold = threshold;
-}
-
/**
* @brief Returns the synchronization mode used when processes are run in
* parallel.