|
Orrery
A GPU-accelerated N-body gravitational simulator
|
Divides the range into equal shares once and does not revisit the decision. More...
#include <orrery/backend/static_executor.hpp>
Public Member Functions | |
| StaticExecutor (unsigned worker_count=0, ThreadPool::Affinity affinity=ThreadPool::Affinity::kUnpinned) | |
| One worker per logical processor unless told otherwise. | |
| void | run (core::Index count, RangeTask task) override |
| Call task over pieces that together cover [0, count) exactly once each, and return when all of them have finished. | |
| std::string_view | name () const noexcept override |
| The scheme's name, for benchmark tables and reports. | |
| unsigned | worker_count () const noexcept override |
| How many workers this executor divides work between. | |
| CoreClass | worker_core_class (unsigned worker) const noexcept override |
| What kind of core a worker runs on, where that is known. | |
| ExecutorStatistics | statistics () const override |
| The record of what the workers have done since the last reset. | |
| void | reset_statistics () noexcept override |
| Set every counter back to zero. | |
Additional Inherited Members | |
| Protected Member Functions inherited from orrery::backend::Executor | |
| Executor (const Executor &)=default | |
| Executor (Executor &&)=default | |
| Executor & | operator= (const Executor &)=default |
| Executor & | operator= (Executor &&)=default |
Divides the range into equal shares once and does not revisit the decision.
|
explicit |
One worker per logical processor unless told otherwise.
affinity is a measurement instrument rather than a tuning knob; see ThreadPool::Affinity.
|
overridevirtual |
Call task over pieces that together cover [0, count) exactly once each, and return when all of them have finished.
The division is the implementation's to choose, and so is the number of threads it uses and the order the pieces run in. A caller may rely on each index being covered exactly once and on all the work being complete on return, and on nothing else.
A count of zero runs nothing. An empty configuration is a configuration, and it reaches the solvers by the same path as any other.
Implements orrery::backend::Executor.
|
inlinenodiscardoverridevirtualnoexcept |
The scheme's name, for benchmark tables and reports.
Implements orrery::backend::Executor.
|
inlinenodiscardoverridevirtualnoexcept |
How many workers this executor divides work between.
Implements orrery::backend::Executor.
|
inlinenodiscardoverridevirtualnoexcept |
What kind of core a worker runs on, where that is known.
kUnknown unless the executor pinned its workers, because without pinning the operating system is free to move a thread between a performance and an efficiency core mid-region, and an answer that described where the thread started would be a guess about where it spent its time. Phase 6's per-core-class figures come from pinned runs for exactly this reason.
Implements orrery::backend::Executor.
|
nodiscardoverridevirtual |
The record of what the workers have done since the last reset.
Safe to call only when no region is running, which for a single submitting thread means any time run is not on the stack. It copies the per-worker records rather than returning a view of them, because a caller comparing two schemes needs the first scheme's numbers to survive the second scheme running.
Implements orrery::backend::Executor.
|
overridevirtualnoexcept |
Set every counter back to zero.
A benchmark measures the region it timed rather than the warm-up before it, and once the two have been added together they cannot be separated.
Implements orrery::backend::Executor.