Thrill  0.1
Dispatcher::MpiAsync Class Reference

Detailed Description

This is the big answer to what happens when an MPI async request is signaled as complete: it unifies all possible async requests, including the reference counts they hold on the appropriate buffers, and dispatches the correct callbacks when done.

Definition at line 254 of file dispatcher.hpp.

+ Collaboration diagram for Dispatcher::MpiAsync:

Public Types

enum  Type {
  NONE, REQUEST, WRITE_BUFFER, READ_BUFFER,
  WRITE_BLOCK, READ_BYTE_BLOCK
}
 

Public Member Functions

 MpiAsync ()
 default constructor for resize More...
 
 MpiAsync (const AsyncRequestCallback &callback)
 construct generic MPI async request More...
 
 MpiAsync (net::Connection &conn, uint32_t seq, Buffer &&buffer, const AsyncWriteCallback &callback)
 Construct AsyncWrite with Buffer. More...
 
 MpiAsync (net::Connection &conn, uint32_t seq, size_t buffer_size, const AsyncReadBufferCallback &callback)
 Construct AsyncRead with Buffer. More...
 
 MpiAsync (net::Connection &conn, uint32_t seq, data::PinnedBlock &&block, const AsyncWriteCallback &callback)
 Construct AsyncWrite with Block. More...
 
 MpiAsync (net::Connection &conn, uint32_t seq, size_t size, data::PinnedByteBlockPtr &&block, const AsyncReadByteBlockCallback &callback)
 Construct AsyncRead with ByteBuffer. More...
 
 MpiAsync (const MpiAsync &ma)=default
 
 MpiAsync (MpiAsync &&ma)
 move-constructor: move item More...
 
 ~MpiAsync ()
 
Connectionconnection ()
 Return mpi Connection pointer. More...
 
void DoCallback (MPI_Status &s)
 Dispatch done message to correct callback. More...
 
MpiAsyncoperator= (MpiAsync &&ma) noexcept
 move-assignment More...
 

Private Member Functions

void Acquire (MpiAsync &&ma) noexcept
 assign myself the other object's content More...
 

Private Attributes

union {
   AsyncRequest   arequest_
 
   AsyncReadBuffer   read_buffer_
 
   AsyncReadByteBlock   read_byte_block_
 
   AsyncWriteBlock   write_block_
 
   AsyncWriteBuffer   write_buffer_
 
}; 
 
uint32_t seq_
 sequence id More...
 
Type type_
 type of this async More...
 

Member Enumeration Documentation

◆ Type

enum Type
Enumerator
NONE 
REQUEST 
WRITE_BUFFER 
READ_BUFFER 
WRITE_BLOCK 
READ_BYTE_BLOCK 

Definition at line 257 of file dispatcher.hpp.

Constructor & Destructor Documentation

◆ MpiAsync() [1/8]

MpiAsync ( )
inline

default constructor for resize

Definition at line 265 of file dispatcher.hpp.

◆ MpiAsync() [2/8]

MpiAsync ( const AsyncRequestCallback callback)
inline

construct generic MPI async request

Definition at line 268 of file dispatcher.hpp.

◆ MpiAsync() [3/8]

MpiAsync ( net::Connection conn,
uint32_t  seq,
Buffer &&  buffer,
const AsyncWriteCallback callback 
)
inline

Construct AsyncWrite with Buffer.

Definition at line 273 of file dispatcher.hpp.

◆ MpiAsync() [4/8]

MpiAsync ( net::Connection conn,
uint32_t  seq,
size_t  buffer_size,
const AsyncReadBufferCallback callback 
)
inline

Construct AsyncRead with Buffer.

Definition at line 280 of file dispatcher.hpp.

◆ MpiAsync() [5/8]

MpiAsync ( net::Connection conn,
uint32_t  seq,
data::PinnedBlock &&  block,
const AsyncWriteCallback callback 
)
inline

Construct AsyncWrite with Block.

Definition at line 286 of file dispatcher.hpp.

◆ MpiAsync() [6/8]

MpiAsync ( net::Connection conn,
uint32_t  seq,
size_t  size,
data::PinnedByteBlockPtr &&  block,
const AsyncReadByteBlockCallback callback 
)
inline

Construct AsyncRead with ByteBuffer.

Definition at line 293 of file dispatcher.hpp.

◆ MpiAsync() [7/8]

MpiAsync ( const MpiAsync ma)
default

copy-constructor: default (work as long as union members are default copyable)

◆ MpiAsync() [8/8]

MpiAsync ( MpiAsync &&  ma)
inline

move-constructor: move item

Definition at line 305 of file dispatcher.hpp.

References Dispatcher::MpiAsync::type_.

◆ ~MpiAsync()

~MpiAsync ( )
inline

Definition at line 326 of file dispatcher.hpp.

Member Function Documentation

◆ Acquire()

◆ connection()

Connection* connection ( )
inline

Return mpi Connection pointer.

Definition at line 361 of file dispatcher.hpp.

References die.

Referenced by Dispatcher::DispatchOne().

◆ DoCallback()

void DoCallback ( MPI_Status &  s)
inline

Dispatch done message to correct callback.

Definition at line 341 of file dispatcher.hpp.

◆ operator=()

MpiAsync& operator= ( MpiAsync &&  ma)
inlinenoexcept

move-assignment

Definition at line 312 of file dispatcher.hpp.

References Dispatcher::MpiAsync::type_.

Member Data Documentation

◆ @11

union { ... }

the big unification of async receivers. these also hold reference counts on the Buffer or Block objects.

◆ arequest_

AsyncRequest arequest_

Definition at line 385 of file dispatcher.hpp.

Referenced by Dispatcher::MpiAsync::Acquire().

◆ read_buffer_

AsyncReadBuffer read_buffer_

Definition at line 387 of file dispatcher.hpp.

Referenced by Dispatcher::MpiAsync::Acquire().

◆ read_byte_block_

AsyncReadByteBlock read_byte_block_

Definition at line 389 of file dispatcher.hpp.

Referenced by Dispatcher::MpiAsync::Acquire().

◆ seq_

uint32_t seq_
private

sequence id

Definition at line 380 of file dispatcher.hpp.

Referenced by Dispatcher::MpiAsync::Acquire().

◆ type_

◆ write_block_

AsyncWriteBlock write_block_

Definition at line 388 of file dispatcher.hpp.

Referenced by Dispatcher::MpiAsync::Acquire().

◆ write_buffer_

AsyncWriteBuffer write_buffer_

Definition at line 386 of file dispatcher.hpp.

Referenced by Dispatcher::MpiAsync::Acquire().


The documentation for this class was generated from the following file: