Skip to content

Commit

Permalink
Update hpx::execution links in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
msimberg committed Sep 4, 2020
1 parent 8d64154 commit 6fb1730
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 61 deletions.
32 changes: 16 additions & 16 deletions docs/sphinx/api/public_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -272,30 +272,30 @@ for more information about execution policies and executor parameters.

.. note::

These names are also available in the ``hpx::execution`` namespace, but not
in the top-level ``hpx`` namespace.
These names are only available in the ``hpx::execution`` namespace, not in
the top-level ``hpx`` namespace.

Constants
---------

- :cpp:var:`hpx::parallel::execution::seq`
- :cpp:var:`hpx::parallel::execution::par`
- :cpp:var:`hpx::parallel::execution::par_unseq`
- :cpp:var:`hpx::parallel::execution::task`
- :cpp:var:`hpx::execution::seq`
- :cpp:var:`hpx::execution::par`
- :cpp:var:`hpx::execution::par_unseq`
- :cpp:var:`hpx::execution::task`

Classes
-------

- :cpp:class:`hpx::parallel::execution::sequenced_policy`
- :cpp:class:`hpx::parallel::execution::parallel_policy`
- :cpp:class:`hpx::parallel::execution::parallel_unsequenced_policy`
- :cpp:class:`hpx::parallel::execution::sequenced_task_policy`
- :cpp:class:`hpx::parallel::execution::parallel_task_policy`
- :cpp:class:`hpx::parallel::execution::auto_chunk_size`
- :cpp:class:`hpx::parallel::execution::dynamic_chunk_size`
- :cpp:class:`hpx::parallel::execution::guided_chunk_size`
- :cpp:class:`hpx::parallel::execution::persistent_auto_chunk_size`
- :cpp:class:`hpx::parallel::execution::static_chunk_size`
- :cpp:class:`hpx::execution::sequenced_policy`
- :cpp:class:`hpx::execution::parallel_policy`
- :cpp:class:`hpx::execution::parallel_unsequenced_policy`
- :cpp:class:`hpx::execution::sequenced_task_policy`
- :cpp:class:`hpx::execution::parallel_task_policy`
- :cpp:class:`hpx::execution::auto_chunk_size`
- :cpp:class:`hpx::execution::dynamic_chunk_size`
- :cpp:class:`hpx::execution::guided_chunk_size`
- :cpp:class:`hpx::execution::persistent_auto_chunk_size`
- :cpp:class:`hpx::execution::static_chunk_size`

Header ``hpx/functional.hpp``
=============================
Expand Down
67 changes: 33 additions & 34 deletions docs/sphinx/manual/writing_single_node_hpx_applications.rst
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,11 @@ C++ Extensions for Parallelism), |cpp11_n4088|_ (Task Blocks), and
Using parallel algorithms
-------------------------

.. |sequenced_execution_policy| replace:: :cpp:class:`hpx::parallel::execution::sequenced_policy`
.. |sequenced_task_execution_policy| replace:: :cpp:class:`hpx::parallel::execution::sequenced_task_policy`
.. |parallel_execution_policy| replace:: :cpp:class:`hpx::parallel::execution::parallel_policy`
.. |parallel_unsequenced_execution_policy| replace:: :cpp:class:`hpx::parallel::execution::parallel_unsequenced_policy`
.. |parallel_task_execution_policy| replace:: :cpp:class:`hpx::parallel::execution::parallel_task_policy`
.. |sequenced_execution_policy| replace:: :cpp:class:`hpx::execution::sequenced_policy`
.. |sequenced_task_execution_policy| replace:: :cpp:class:`hpx::execution::sequenced_task_policy`
.. |parallel_execution_policy| replace:: :cpp:class:`hpx::execution::parallel_policy`
.. |parallel_unsequenced_execution_policy| replace:: :cpp:class:`hpx::execution::parallel_unsequenced_policy`
.. |parallel_task_execution_policy| replace:: :cpp:class:`hpx::execution::parallel_task_policy`
.. |execution_policy| replace:: :cpp:class:`hpx::parallel::v1::execution_policy`
.. |exception_list| replace:: :cpp:class:`hpx::exception_list`
.. |par_for_each| replace:: :cpp:class:`hpx::parallel::v1::for_each`
Expand Down Expand Up @@ -799,15 +799,14 @@ number of tasks to schedule is given by ``num_tasks``. The lambda function
exposes a means of test-probing the execution of a single iteration for
performance measurement purposes. The execution parameter type might dynamically
determine the execution time of one or more tasks in order to calculate the
chunk size; see :cpp:class:`hpx::parallel::execution::auto_chunk_size` for an
example of this executor parameter type.
chunk size; see :cpp:class:`hpx::execution::auto_chunk_size` for an example of
this executor parameter type.

Other functions in the interface exist to discover whether an executor parameter
type should be invoked once (i.e., it returns a static chunk size; see
:cpp:class:`hpx::parallel::execution::static_chunk_size`) or whether it should
be invoked for each scheduled chunk of work (i.e., it returns a variable chunk
size; for an example, see
:cpp:class:`hpx::parallel::execution::guided_chunk_size`).
:cpp:class:`hpx::execution::static_chunk_size`) or whether it should be invoked
for each scheduled chunk of work (i.e., it returns a variable chunk size; for an
example, see :cpp:class:`hpx::execution::guided_chunk_size`).

Although this interface appears to require executor parameter type authors to
implement all different basic operations, none are required. In
Expand All @@ -816,27 +815,27 @@ parameter types will naturally specialize all operations for maximum efficiency.

|hpx| implements the following executor parameter types:

* :cpp:class:`hpx::parallel::execution::auto_chunk_size`: Loop iterations are
divided into pieces and then assigned to threads. The number of loop
iterations combined is determined based on measurements of how long the
execution of 1% of the overall number of iterations takes. This executor
parameter type makes sure that as many loop iterations are combined as
necessary to run for the amount of time specified.
* :cpp:class:`hpx::parallel::execution::static_chunk_size`: Loop iterations are
divided into pieces of a given size and then assigned to threads. If the size
is not specified, the iterations are, if possible, evenly divided contiguously
among the threads. This executor parameters type is equivalent to OpenMP's
STATIC scheduling directive.
* :cpp:class:`hpx::parallel::execution::dynamic_chunk_size`: Loop iterations are
divided into pieces of a given size and then dynamically scheduled among the
cores; when a core finishes one chunk, it is dynamically assigned another. If
the size is not specified, the default chunk size is 1. This executor
parameter type is equivalent to OpenMP's DYNAMIC scheduling directive.
* :cpp:class:`hpx::parallel::execution::guided_chunk_size`: Iterations are
dynamically assigned to cores in blocks as cores request them until no blocks
remain to be assigned. This is similar to ``dynamic_chunk_size`` except that the block
size decreases each time a number of loop iterations is given to a thread. The
size of the initial block is proportional to ``number_of_iterations /
* :cpp:class:`hpx::execution::auto_chunk_size`: Loop iterations are divided into
pieces and then assigned to threads. The number of loop iterations combined is
determined based on measurements of how long the execution of 1% of the
overall number of iterations takes. This executor parameter type makes sure
that as many loop iterations are combined as necessary to run for the amount
of time specified.
* :cpp:class:`hpx::execution::static_chunk_size`: Loop iterations are divided
into pieces of a given size and then assigned to threads. If the size is not
specified, the iterations are, if possible, evenly divided contiguously among
the threads. This executor parameters type is equivalent to OpenMP's STATIC
scheduling directive.
* :cpp:class:`hpx::execution::dynamic_chunk_size`: Loop iterations are divided
into pieces of a given size and then dynamically scheduled among the cores;
when a core finishes one chunk, it is dynamically assigned another. If the
size is not specified, the default chunk size is 1. This executor parameter
type is equivalent to OpenMP's DYNAMIC scheduling directive.
* :cpp:class:`hpx::execution::guided_chunk_size`: Iterations are dynamically
assigned to cores in blocks as cores request them until no blocks remain to be
assigned. This is similar to ``dynamic_chunk_size`` except that the block size
decreases each time a number of loop iterations is given to a thread. The size
of the initial block is proportional to ``number_of_iterations /
number_of_cores``. Subsequent blocks are proportional to
``number_of_iterations_remaining / number_of_cores``. The optional chunk size
parameter defines the minimum block size. The default minimal chunk size is 1.
Expand Down Expand Up @@ -961,11 +960,11 @@ created ``task_block``. In the following example the use of an explicit
This also causes the :cpp:class:`hpx::parallel::v2::task_block` object to be a
template in our implementation. The template argument is the type of the
execution policy used to create the task block. The template argument defaults
to :cpp:class:`hpx::parallel::execution::parallel_policy`.
to :cpp:class:`hpx::execution::parallel_policy`.

|hpx| still supports calling :cpp:func:`hpx::parallel::v2::define_task_block`
without an explicit execution policy. In this case the task block will run using
the :cpp:class:`hpx::parallel::execution::parallel_policy`.
the :cpp:class:`hpx::execution::parallel_policy`.

|hpx| also adds the ability to access the execution policy that was used to
create a given ``task_block``.
Expand Down
22 changes: 11 additions & 11 deletions libs/executors/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ executors
The executors module exposes executors and execution policies. Most importantly,
it exposes the following classes and constants:

* :cpp:class:`hpx::parallel::execution::sequenced_executor`
* :cpp:class:`hpx::parallel::execution::parallel_executor`
* :cpp:class:`hpx::parallel::execution::sequenced_policy`
* :cpp:class:`hpx::parallel::execution::parallel_policy`
* :cpp:class:`hpx::parallel::execution::parallel_unsequenced_policy`
* :cpp:class:`hpx::parallel::execution::sequenced_task_policy`
* :cpp:class:`hpx::parallel::execution::parallel_task_policy`
* :c:var:`hpx::parallel::execution::seq`
* :c:var:`hpx::parallel::execution::par`
* :c:var:`hpx::parallel::execution::par_unseq`
* :c:var:`hpx::parallel::execution::task`
* :cpp:class:`hpx::execution::sequenced_executor`
* :cpp:class:`hpx::execution::parallel_executor`
* :cpp:class:`hpx::execution::sequenced_policy`
* :cpp:class:`hpx::execution::parallel_policy`
* :cpp:class:`hpx::execution::parallel_unsequenced_policy`
* :cpp:class:`hpx::execution::sequenced_task_policy`
* :cpp:class:`hpx::execution::parallel_task_policy`
* :cpp:var:`hpx::execution::seq`
* :cpp:var:`hpx::execution::par`
* :cpp:var:`hpx::execution::par_unseq`
* :cpp:var:`hpx::execution::task`

See the :ref:`API reference <libs_executors_api>` of this module for more
details.
Expand Down

0 comments on commit 6fb1730

Please sign in to comment.