Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
6e26cece
Commit
6e26cece
authored
May 13, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better explanation of OpenMP schedules
parent
50f24198
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
31 deletions
+45
-31
docs/src/userguide/parallelism.rst
docs/src/userguide/parallelism.rst
+45
-31
No files found.
docs/src/userguide/parallelism.rst
View file @
6e26cece
...
@@ -39,37 +39,51 @@ __ nogil_
...
@@ -39,37 +39,51 @@ __ nogil_
The ``schedule`` is passed to OpenMP and can be one of the following:
The ``schedule`` is passed to OpenMP and can be one of the following:
+-----------------+------------------------------------------------------+
static:
| Schedule | Description |
If a chunksize is provided, iterations are distributed to all
+=================+======================================================+
threads ahead of time in blocks of the given chunksize. If no
|static | The iteration space is divided into chunks that are |
chunksize is given, the iteration space is divided into chunks that
| | approximately equal in size, and at most one chunk |
are approximately equal in size, and at most one chunk is assigned
| | is distributed to each thread, if ``chunksize`` is |
to each thread in advance.
| | not given. If ``chunksize`` is specified, iterations |
| | are distributed cyclically in a static manner with a |
This is most appropriate when the scheduling overhead matters and
| | blocksize of ``chunksize``. |
the problem can be cut down into equally sized chunks that are
+-----------------+------------------------------------------------------+
known to have approximately the same runtime.
|dynamic | The iterations are distributed to threads in the team|
| | as the threads request them, with a default chunk |
dynamic:
| | size of 1. |
The iterations are distributed to threads as they request them,
+-----------------+------------------------------------------------------+
with a default chunk size of 1.
|guided | The iterations are distributed to threads in the team|
| | as the threads request them. The size of each chunk |
This is suitable when the runtime of each chunk differs and is not
| | is proportional to the number of unassigned |
known in advance and therefore a larger number of smaller chunks
| | iterations divided by the number of threads in the |
is used in order to keep all threads busy.
| | team, decreasing to 1 (or ``chunksize`` if given). |
+-----------------+------------------------------------------------------+
guided:
|runtime | The schedule and chunk size are taken from the |
As with dynamic scheduling, the iterations are distributed to
| | runtime-scheduling-variable, which can be set through|
threads as they request them, but with decreasing chunk size. The
| | the ``omp_set_schedule`` function call, or the |
size of each chunk is proportional to the number of unassigned
| | ``OMP_SCHEDULE`` environment variable. |
iterations divided by the number of participating threads,
+-----------------+------------------------------------------------------+
decreasing to 1 (or the chunksize if provided).
.. |auto | The decision regarding scheduling is delegated to the|
This has an advantage over pure dynamic scheduling when it turns
.. | | compiler and/or runtime system. The programmer gives |
out that the last chunks take more time than expected or are
.. | | the implementation the freedom to choose any possible|
otherwise being badly scheduled, so that most threads start running
.. | | mapping of iterations to threads in the team. |
idle while the last chunks are being worked on by only a smaller
.. +-----------------+------------------------------------------------------+
number of threads.
runtime:
The schedule and chunk size are taken from the runtime scheduling
variable, which can be set through the ``openmp.omp_set_schedule()``
function call, or the OMP_SCHEDULE environment variable. Note that
this essentially disables any static compile time optimisations of
the scheduling code itself and may therefore show a slightly worse
performance than when the same scheduling policy is statically
configured at compile time.
.. auto The decision regarding scheduling is delegated to the
.. compiler and/or runtime system. The programmer gives
.. the implementation the freedom to choose any possible
.. mapping of iterations to threads in the team.
The default schedule is implementation defined. For more information consult
The default schedule is implementation defined. For more information consult
the OpenMP specification [#]_.
the OpenMP specification [#]_.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment