#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. | |
| void | execute () |
| Execute method. | |
| MooseUtils::SharedPool< Ray >::PtrType | acquireParallelData (const THREAD_ID tid, Args &&... args) |
| Acquire a parallel data object from the pool. | |
| 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. | |
| const ReceiveBuffer< Ray, ParallelStudy< std::shared_ptr< Ray >, Ray > > & | receiveBuffer () const |
| Gets the receive buffer. | |
| const MooseUtils::Buffer< std::shared_ptr< Ray > > & | workBuffer () const |
| Gets the work buffer. | |
| unsigned long long int | sendBufferPoolCreated () const |
| Gets the total number of send buffer pools created. | |
| unsigned long long int | parallelDataSent () const |
| Gets the total number of parallel data objects sent from this processor. | |
| unsigned long long int | buffersSent () const |
| Gets the total number of buffers sent from this processor. | |
| unsigned long long int | poolParallelDataCreated () const |
| Gets the total number of parallel data created in all of the threaded pools. | |
| unsigned long long int | localWorkStarted () const |
| Gets the total amount of work started from this processor. | |
| unsigned long long int | localWorkExecuted () const |
| Gets the total amount of work executed on this processor. | |
| unsigned long long int | totalWorkCompleted () const |
| Gets the total amount of work completeed across all processors. | |
| unsigned long long int | localChunksExecuted () const |
| Gets the total number of chunks of work executed on this processor. | |
| bool | currentlyExecuting () const |
| Whether or not this object is currently in execute(). | |
| bool | currentlyPreExecuting () const |
| Whether or not this object is between preExecute() and execute(). | |
| unsigned int | maxBufferSize () const |
| Gets the max buffer size. | |
| unsigned int | chunkSize () const |
| Gets the chunk size. | |
| unsigned int | clicksPerCommunication () const |
| Gets the number of iterations to wait before communicating. | |
| unsigned int | clicksPerRootCommunication () const |
| Gets the number of iterations to wait before communicating with root. | |
| unsigned int | clicksPerReceive () const |
| Gets the number of iterations to wait before checking for new parallel data. | |
| ParallelStudyMethod | method () const |
| Gets the method. | |
| void | reserveBuffer (const std::size_t size) |
Reserve size entries in the work buffer. | |
| 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. | |
| const RayTracingStudy & | rayTracingStudy () const |
| void | moveWorkToBuffer (std::shared_ptr< Ray > &work, const THREAD_ID tid) |
| Adds work to the buffer to be executed. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| virtual bool | alternateSmartEndingCriteriaMet () |
| Insertion point for derived classes to provide an alternate ending criteria for SMART execution. | |
| virtual void | postExecuteChunk (const work_iterator, const work_iterator) |
| Insertion point for acting on work that was just executed. | |
| virtual void | preReceiveAndExecute () |
| Insertion point called just after trying to receive work and just before beginning work on the work buffer. | |
| 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. | |
| bool | buffersAreEmpty () const |
| Whether or not ALL of the buffers are empty: Working buffer, threaded buffers, receive buffer, and send buffers. | |
| void | moveContinuingWorkToBuffer (std::shared_ptr< Ray > &Work) |
| Moves work that is considered continuing for the purposes of the execution algorithm into the buffer. | |
| void | moveContinuingWorkToBuffer (const work_iterator begin, const work_iterator end) |
Protected Attributes | |
| RayTracingStudy & | _ray_tracing_study |
| The RayTracingStudy. | |
| const std::vector< std::shared_ptr< TraceRay > > & | _threaded_trace_ray |
| The TraceRay objects that do the tracing for each thread. | |
| const processor_id_type | _pid |
| This rank. | |
| const std::string | _name |
| Name for this object for use in error handling. | |
| const InputParameters & | _params |
| The InputParameters. | |
| const ParallelStudyMethod | _method |
| The study method. | |
| bool | _has_alternate_ending_criteria |
| Whether or not this object has alternate ending criteria. | |
| const Parallel::Communicator & | _communicator |
Private Member Functions | |
| void | flushSendBuffers () |
| Flushes all parallel data out of the send buffers. | |
| void | smartExecute () |
| Execute work using SMART. | |
| void | harmExecute () |
| Execute work using HARM. | |
| void | bsExecute () |
| Execute work using BS. | |
| bool | receiveAndExecute () |
| Receive packets of parallel data from other processors and executes work. | |
| void | executeAndBuffer (const std::size_t chunk_size) |
| Execute a chunk of work and buffer. | |
| void | canMoveWorkCheck (const THREAD_ID tid) |
| Internal check for if it is allowed to currently add work in moveWorkToBuffer(). | |
| void | postReceiveParallelDataInternal () |
| Internal method for acting on the parallel data that has just been received into the parallel buffer. | |
Private Attributes | |
| const unsigned int | _min_buffer_size |
| Minimum size of a SendBuffer. | |
| const unsigned int | _max_buffer_size |
| Number of objects to buffer before communication. | |
| const Real | _buffer_growth_multiplier |
| Multiplier for the buffer size for growing the buffer. | |
| const Real | _buffer_shrink_multiplier |
| Multiplier for the buffer size for shrinking the buffer. | |
| const unsigned int | _chunk_size |
| Number of objects to execute at once during communication. | |
| const bool | _allow_new_work_during_execution |
| Whether or not to allow the addition of new work to the buffer during execution. | |
| const unsigned int | _clicks_per_communication |
| Iterations to wait before communicating. | |
| const unsigned int | _clicks_per_root_communication |
| Iterations to wait before communicating with root. | |
| const unsigned int | _clicks_per_receive |
| Iterations to wait before checking for new objects. | |
| Parallel::MessageTag | _parallel_data_buffer_tag |
| MessageTag for sending parallel data. | |
| std::vector< MooseUtils::SharedPool< Ray > > | _parallel_data_pools |
| Pools for re-using destructed parallel data objects (one for each thread) | |
| std::vector< std::vector< std::shared_ptr< Ray > > > | _temp_threaded_work |
| Threaded temprorary storage for work added while we're using the _work_buffer (one for each thread) | |
| const std::unique_ptr< MooseUtils::Buffer< std::shared_ptr< Ray > > > | _work_buffer |
| Buffer for executing work. | |
| const std::unique_ptr< ReceiveBuffer< Ray, ParallelStudy< std::shared_ptr< Ray >, Ray > > > | _receive_buffer |
| The receive buffer. | |
| std::unordered_map< processor_id_type, std::unique_ptr< SendBuffer< Ray, ParallelStudy< std::shared_ptr< Ray >, Ray > > > > | _send_buffers |
| Send buffers for each processor. | |
| unsigned long long int | _local_chunks_executed |
| Number of chunks of work executed on this processor. | |
| unsigned long long int | _local_work_completed |
| Amount of work completed on this processor. | |
| unsigned long long int | _local_work_started |
| Amount of work started on this processor. | |
| unsigned long long int | _local_work_executed |
| Amount of work executed on this processor. | |
| unsigned long long int | _total_work_started |
| Amount of work started on all processors. | |
| unsigned long long int | _total_work_completed |
| Amount of work completed on all processors. | |
| bool | _currently_executing |
| Whether we are within execute() | |
| bool | _currently_pre_executing |
| Whether we are between preExecute() and execute() | |
| bool | _currently_executing_work |
| Whether or not we are currently within executeAndBuffer() | |
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 212 of file ParallelStudy.h.
|
privateinherited |
Execute work using BS.
Definition at line 288 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 258 of file ParallelStudy.h.
|
inherited |
Gets the total number of buffers sent from this processor.
Definition at line 109 of file ParallelStudy.h.
|
privateinherited |
Internal check for if it is allowed to currently add work in moveWorkToBuffer().
Definition at line 303 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 196 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 49 of file ParallelStudy.h.
|
privateinherited |
Execute a chunk of work and buffer.
Definition at line 298 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.
|
privateinherited |
Flushes all parallel data out of the send buffers.
Definition at line 275 of file ParallelStudy.h.
|
privateinherited |
Execute work using HARM.
Definition at line 284 of file ParallelStudy.h.
|
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 |
|
protectedinherited |
Definition at line 251 of file ParallelStudy.h.
|
protectedinherited |
Moves work that is considered continuing for the purposes of the execution algorithm into the buffer.
Definition at line 250 of file ParallelStudy.h.
|
inherited |
Moves parallel data objects to the send buffer to be communicated to processor dest_pid.
Definition at line 81 of file ParallelStudy.h.
|
overrideprotected |
Definition at line 74 of file ParallelRayStudy.C.
Referenced by moveWorkError().
|
protectedvirtualinherited |
Virtual that allows for the customization of error text for moving work into the buffer.
Definition at line 206 of file ParallelStudy.h.
|
inherited |
Definition at line 64 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 63 of file ParallelStudy.h.
|
inherited |
Definition at line 65 of file ParallelStudy.h.
|
inherited |
Gets the total number of parallel data objects sent from this processor.
Definition at line 105 of file ParallelStudy.h.
|
inherited |
Gets the total number of parallel data created in all of the threaded pools.
Definition at line 113 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.
|
privateinherited |
Internal method for acting on the parallel data that has just been received into the parallel buffer.
Definition at line 309 of file ParallelStudy.h.
|
inherited |
Pre-execute method that MUST be called before execute() and before adding work.
Definition at line 45 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.
|
privateinherited |
Receive packets of parallel data from other processors and executes work.
Definition at line 293 of file ParallelStudy.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 176 of file ParallelStudy.h.
|
inherited |
Gets the total number of send buffer pools created.
Definition at line 101 of file ParallelStudy.h.
|
privateinherited |
Execute work using SMART.
Definition at line 280 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 36 of file ParallelStudy.h.
|
inlineinherited |
|
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.
|
privateinherited |
Whether or not to allow the addition of new work to the buffer during execution.
Definition at line 322 of file ParallelStudy.h.
|
privateinherited |
Multiplier for the buffer size for growing the buffer.
Definition at line 316 of file ParallelStudy.h.
|
privateinherited |
Multiplier for the buffer size for shrinking the buffer.
Definition at line 318 of file ParallelStudy.h.
|
privateinherited |
Number of objects to execute at once during communication.
Definition at line 320 of file ParallelStudy.h.
|
privateinherited |
Iterations to wait before communicating.
Definition at line 325 of file ParallelStudy.h.
|
privateinherited |
Iterations to wait before checking for new objects.
Definition at line 329 of file ParallelStudy.h.
|
privateinherited |
Iterations to wait before communicating with root.
Definition at line 327 of file ParallelStudy.h.
|
privateinherited |
Whether we are within execute()
Definition at line 362 of file ParallelStudy.h.
|
privateinherited |
Whether or not we are currently within executeAndBuffer()
Definition at line 366 of file ParallelStudy.h.
|
privateinherited |
Whether we are between preExecute() and execute()
Definition at line 364 of file ParallelStudy.h.
|
protectedinherited |
Whether or not this object has alternate ending criteria.
Definition at line 269 of file ParallelStudy.h.
|
privateinherited |
Number of chunks of work executed on this processor.
Definition at line 349 of file ParallelStudy.h.
|
privateinherited |
Amount of work completed on this processor.
Definition at line 351 of file ParallelStudy.h.
|
privateinherited |
Amount of work executed on this processor.
Definition at line 355 of file ParallelStudy.h.
|
privateinherited |
Amount of work started on this processor.
Definition at line 353 of file ParallelStudy.h.
|
privateinherited |
Number of objects to buffer before communication.
Definition at line 314 of file ParallelStudy.h.
|
protectedinherited |
The study method.
Definition at line 267 of file ParallelStudy.h.
|
privateinherited |
Minimum size of a SendBuffer.
Definition at line 312 of file ParallelStudy.h.
|
protectedinherited |
Name for this object for use in error handling.
Definition at line 263 of file ParallelStudy.h.
|
privateinherited |
MessageTag for sending parallel data.
Definition at line 332 of file ParallelStudy.h.
|
privateinherited |
Pools for re-using destructed parallel data objects (one for each thread)
Definition at line 334 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.
|
protected |
The RayTracingStudy.
Definition at line 44 of file ParallelRayStudy.h.
Referenced by moveWorkError(), postExecuteChunk(), rayTracingStudy(), and rayTracingStudy().
|
privateinherited |
The receive buffer.
Definition at line 341 of file ParallelStudy.h.
|
privateinherited |
Send buffers for each processor.
Definition at line 346 of file ParallelStudy.h.
|
privateinherited |
Threaded temprorary storage for work added while we're using the _work_buffer (one for each thread)
Definition at line 336 of file ParallelStudy.h.
|
protected |
The TraceRay objects that do the tracing for each thread.
Definition at line 46 of file ParallelRayStudy.h.
Referenced by executeWork().
|
privateinherited |
Amount of work completed on all processors.
Definition at line 359 of file ParallelStudy.h.
|
privateinherited |
Amount of work started on all processors.
Definition at line 357 of file ParallelStudy.h.
|
privateinherited |
Buffer for executing work.
Definition at line 338 of file ParallelStudy.h.