#include <ParallelRayStudy.h>
Public Types | |
typedef MooseUtils::Buffer< std::shared_ptr< Ray > >::iterator | work_iterator |
typedef MooseUtils::Buffer< std::shared_ptr< Ray > >::iterator | parallel_data_iterator |
Public Member Functions | |
ParallelRayStudy (RayTracingStudy &study, const std::vector< std::shared_ptr< TraceRay >> &threaded_trace_ray) | |
void | preExecute () |
Pre-execute method that MUST be called before execute() and before adding work. More... | |
void | execute () |
Execute method. More... | |
MooseUtils::SharedPool< Ray >::PtrType | acquireParallelData (const THREAD_ID tid, Args &&... args) |
Acquire a parallel data object from the pool. More... | |
void | moveParallelDataToBuffer (std::shared_ptr< Ray > &data, const processor_id_type dest_pid) |
Moves parallel data objects to the send buffer to be communicated to processor dest_pid . More... | |
const ReceiveBuffer< Ray, ParallelStudy< std::shared_ptr< Ray >, Ray > > & | receiveBuffer () const |
Gets the receive buffer. More... | |
const MooseUtils::Buffer< std::shared_ptr< Ray > > & | workBuffer () const |
Gets the work buffer. More... | |
unsigned long long int | sendBufferPoolCreated () const |
Gets the total number of send buffer pools created. More... | |
unsigned long long int | parallelDataSent () const |
Gets the total number of parallel data objects sent from this processor. More... | |
unsigned long long int | buffersSent () const |
Gets the total number of buffers sent from this processor. More... | |
unsigned long long int | poolParallelDataCreated () const |
Gets the total number of parallel data created in all of the threaded pools. More... | |
unsigned long long int | localWorkStarted () const |
Gets the total amount of work started from this processor. More... | |
unsigned long long int | localWorkExecuted () const |
Gets the total amount of work executed on this processor. More... | |
unsigned long long int | totalWorkCompleted () const |
Gets the total amount of work completeed across all processors. More... | |
unsigned long long int | localChunksExecuted () const |
Gets the total number of chunks of work executed on this processor. More... | |
bool | currentlyExecuting () const |
Whether or not this object is currently in execute(). More... | |
bool | currentlyPreExecuting () const |
Whether or not this object is between preExecute() and execute(). More... | |
unsigned int | maxBufferSize () const |
Gets the max buffer size. More... | |
unsigned int | chunkSize () const |
Gets the chunk size. More... | |
unsigned int | clicksPerCommunication () const |
Gets the number of iterations to wait before communicating. More... | |
unsigned int | clicksPerRootCommunication () const |
Gets the number of iterations to wait before communicating with root. More... | |
unsigned int | clicksPerReceive () const |
Gets the number of iterations to wait before checking for new parallel data. More... | |
ParallelStudyMethod | method () const |
Gets the method. More... | |
void | reserveBuffer (const std::size_t size) |
Reserve size entries in the work buffer. More... | |
const Parallel::Communicator & | comm () const |
processor_id_type | n_processors () const |
processor_id_type | processor_id () const |
RayTracingStudy & | rayTracingStudy () |
Get the RayTracingStudy associated with this ParallelRayStudy. More... | |
const RayTracingStudy & | rayTracingStudy () const |
void | moveWorkToBuffer (std::shared_ptr< Ray > &work, const THREAD_ID tid) |
Adds work to the buffer to be executed. More... | |
void | moveWorkToBuffer (const work_iterator begin, const work_iterator end, const THREAD_ID tid) |
void | moveWorkToBuffer (std::vector< std::shared_ptr< Ray > > &work, const THREAD_ID tid) |
Static Public Member Functions | |
static InputParameters | validParams () |
Protected Types | |
enum | MoveWorkError |
Enum for providing useful errors during work addition in moveWorkError(). More... | |
Protected Member Functions | |
void | executeWork (const std::shared_ptr< Ray > &ray, const THREAD_ID tid) override |
Pure virtual to be overridden that executes a single object of work on a given thread. More... | |
void | moveWorkError (const MoveWorkError error, const std::shared_ptr< Ray > *ray) const override |
void | postReceiveParallelData (const parallel_data_iterator begin, const parallel_data_iterator end) override |
bool | workIsComplete (const std::shared_ptr< Ray > &ray) override |
Can be overridden to denote if a piece of work is not complete yet. More... | |
void | postExecuteChunk (const work_iterator begin, const work_iterator end) override |
virtual std::unique_ptr< MooseUtils::Buffer< std::shared_ptr< Ray > > > | createWorkBuffer () |
Creates the work buffer. More... | |
virtual void | moveWorkError (const MoveWorkError error, const std::shared_ptr< Ray > *work=nullptr) const |
Virtual that allows for the customization of error text for moving work into the buffer. More... | |
virtual bool | alternateSmartEndingCriteriaMet () |
Insertion point for derived classes to provide an alternate ending criteria for SMART execution. More... | |
virtual void | postExecuteChunk (const work_iterator, const work_iterator) |
Insertion point for acting on work that was just executed. More... | |
virtual void | preReceiveAndExecute () |
Insertion point called just after trying to receive work and just before beginning work on the work buffer. More... | |
virtual void | postReceiveParallelData (const parallel_data_iterator begin, const parallel_data_iterator end)=0 |
Pure virtual for acting on parallel data that has JUST been received and filled into the buffer. More... | |
bool | buffersAreEmpty () const |
Whether or not ALL of the buffers are empty: Working buffer, threaded buffers, receive buffer, and send buffers. More... | |
void | moveContinuingWorkToBuffer (std::shared_ptr< Ray > &Work) |
Moves work that is considered continuing for the purposes of the execution algorithm into the buffer. More... | |
void | moveContinuingWorkToBuffer (const work_iterator begin, const work_iterator end) |
Protected Attributes | |
RayTracingStudy & | _ray_tracing_study |
The RayTracingStudy. More... | |
const std::vector< std::shared_ptr< TraceRay > > & | _threaded_trace_ray |
The TraceRay objects that do the tracing for each thread. More... | |
const processor_id_type | _pid |
This rank. More... | |
const std::string | _name |
Name for this object for use in error handling. More... | |
const InputParameters & | _params |
The InputParameters. More... | |
const ParallelStudyMethod | _method |
The study method. More... | |
bool | _has_alternate_ending_criteria |
Whether or not this object has alternate ending criteria. More... | |
const Parallel::Communicator & | _communicator |
Definition at line 21 of file ParallelRayStudy.h.
|
inherited |
Definition at line 34 of file ParallelStudy.h.
|
inherited |
Definition at line 32 of file ParallelStudy.h.
|
protectedinherited |
Enum for providing useful errors during work addition in moveWorkError().
Definition at line 182 of file ParallelStudy.h.
ParallelRayStudy::ParallelRayStudy | ( | RayTracingStudy & | study, |
const std::vector< std::shared_ptr< TraceRay >> & | threaded_trace_ray | ||
) |
Definition at line 16 of file ParallelRayStudy.C.
|
inlineinherited |
Acquire a parallel data object from the pool.
Definition at line 73 of file ParallelStudy.h.
|
protectedvirtualinherited |
Insertion point for derived classes to provide an alternate ending criteria for SMART execution.
Only called when _has_alternate_ending_criteria == true.
Definition at line 1202 of file ParallelStudy.h.
|
protectedinherited |
Whether or not ALL of the buffers are empty: Working buffer, threaded buffers, receive buffer, and send buffers.
Definition at line 1209 of file ParallelStudy.h.
|
inherited |
Gets the total number of buffers sent from this processor.
Definition at line 1178 of file ParallelStudy.h.
|
inlineinherited |
Gets the chunk size.
Definition at line 148 of file ParallelStudy.h.
|
inlineinherited |
Gets the number of iterations to wait before communicating.
Definition at line 153 of file ParallelStudy.h.
|
inlineinherited |
Gets the number of iterations to wait before checking for new parallel data.
Definition at line 161 of file ParallelStudy.h.
|
inlineinherited |
Gets the number of iterations to wait before communicating with root.
Definition at line 157 of file ParallelStudy.h.
|
protectedvirtualinherited |
Creates the work buffer.
This is virtual so that derived classes can use their own specialized buffers
Definition at line 419 of file ParallelStudy.h.
|
inlineinherited |
Whether or not this object is currently in execute().
Definition at line 135 of file ParallelStudy.h.
|
inlineinherited |
Whether or not this object is between preExecute() and execute().
Definition at line 139 of file ParallelStudy.h.
|
inherited |
Execute method.
Definition at line 988 of file ParallelStudy.h.
|
overrideprotectedvirtual |
Pure virtual to be overridden that executes a single object of work on a given thread.
Implements ParallelStudy< std::shared_ptr< Ray >, Ray >.
Definition at line 64 of file ParallelRayStudy.C.
|
inlineinherited |
Gets the total number of chunks of work executed on this processor.
Definition at line 130 of file ParallelStudy.h.
|
inlineinherited |
Gets the total amount of work executed on this processor.
Definition at line 122 of file ParallelStudy.h.
|
inlineinherited |
Gets the total amount of work started from this processor.
Definition at line 118 of file ParallelStudy.h.
|
inlineinherited |
Gets the max buffer size.
Definition at line 144 of file ParallelStudy.h.
|
inlineinherited |
Gets the method.
Definition at line 166 of file ParallelStudy.h.
|
protectedinherited |
Moves work that is considered continuing for the purposes of the execution algorithm into the buffer.
Definition at line 1128 of file ParallelStudy.h.
Referenced by postReceiveParallelData().
|
protectedinherited |
Definition at line 1138 of file ParallelStudy.h.
|
inherited |
Moves parallel data objects to the send buffer to be communicated to processor dest_pid
.
Definition at line 576 of file ParallelStudy.h.
Referenced by postExecuteChunk().
|
overrideprotected |
Definition at line 74 of file ParallelRayStudy.C.
|
protectedvirtualinherited |
Virtual that allows for the customization of error text for moving work into the buffer.
Definition at line 1022 of file ParallelStudy.h.
|
inherited |
Adds work to the buffer to be executed.
This will move the work into the buffer (with std::move), therefore the passed in work will be invalid after this call. For the purposes of the completion algorithm, this added work is considered NEW work.
During pre-execution (between preExecute() and execute()), this method can ONLY be called on thread 0.
During execute(), this method is thread safe and can be used to add work during execution.
Definition at line 1070 of file ParallelStudy.h.
|
inherited |
Definition at line 1089 of file ParallelStudy.h.
|
inherited |
Definition at line 1120 of file ParallelStudy.h.
|
inherited |
Gets the total number of parallel data objects sent from this processor.
Definition at line 1166 of file ParallelStudy.h.
|
inherited |
Gets the total number of parallel data created in all of the threaded pools.
Definition at line 1190 of file ParallelStudy.h.
|
overrideprotected |
Definition at line 27 of file ParallelRayStudy.C.
|
inlineprotectedvirtualinherited |
Insertion point for acting on work that was just executed.
This is not called in threads.
Definition at line 219 of file ParallelStudy.h.
|
overrideprotected |
Definition at line 55 of file ParallelRayStudy.C.
|
protectedpure virtualinherited |
Pure virtual for acting on parallel data that has JUST been received and filled into the buffer.
The parallel data in the range passed here will have its use count reduced by one if it still exists after this call.
|
inherited |
Pre-execute method that MUST be called before execute() and before adding work.
Definition at line 964 of file ParallelStudy.h.
|
inlineprotectedvirtualinherited |
Insertion point called just after trying to receive work and just before beginning work on the work buffer.
Definition at line 225 of file ParallelStudy.h.
|
inline |
Get the RayTracingStudy associated with this ParallelRayStudy.
Definition at line 31 of file ParallelRayStudy.h.
|
inline |
Definition at line 32 of file ParallelRayStudy.h.
|
inlineinherited |
Gets the receive buffer.
Definition at line 88 of file ParallelStudy.h.
|
inherited |
Reserve size
entries in the work buffer.
This can only be used during the pre-execution phase (between preExecute() and execute()).
This is particularly useful when one wants to move many work objects into the buffer using moveWorkToBuffer() and wants to allocate the space ahead of time.
Definition at line 618 of file ParallelStudy.h.
|
inherited |
Gets the total number of send buffer pools created.
Definition at line 1154 of file ParallelStudy.h.
|
inlineinherited |
Gets the total amount of work completeed across all processors.
Definition at line 126 of file ParallelStudy.h.
|
staticinherited |
Definition at line 436 of file ParallelStudy.h.
Referenced by RayTracingStudy::validParams().
|
inlineinherited |
Gets the work buffer.
Definition at line 96 of file ParallelStudy.h.
|
overrideprotectedvirtual |
Can be overridden to denote if a piece of work is not complete yet.
The complete terminology is used within the execution algorithms to determine if the study is complete.
Reimplemented from ParallelStudy< std::shared_ptr< Ray >, Ray >.
Definition at line 48 of file ParallelRayStudy.C.
|
protectedinherited |
Whether or not this object has alternate ending criteria.
Definition at line 269 of file ParallelStudy.h.
|
protectedinherited |
The study method.
Definition at line 267 of file ParallelStudy.h.
|
protectedinherited |
Name for this object for use in error handling.
Definition at line 263 of file ParallelStudy.h.
|
protectedinherited |
The InputParameters.
Definition at line 265 of file ParallelStudy.h.
|
protectedinherited |
This rank.
Definition at line 261 of file ParallelStudy.h.
Referenced by executeWork(), and postExecuteChunk().
|
protected |
The RayTracingStudy.
Definition at line 44 of file ParallelRayStudy.h.
Referenced by moveWorkError(), postExecuteChunk(), and rayTracingStudy().
|
protected |
The TraceRay objects that do the tracing for each thread.
Definition at line 46 of file ParallelRayStudy.h.
Referenced by executeWork().