Loading...
Searching...
No Matches
UPstream::Window Class Reference

An opaque wrapper for MPI_Win with a vendor-independent representation and without any <mpi.h> header dependency. More...

#include <UPstreamWindow.H>

Public Types

typedef std::intptr_t value_type
 Storage for MPI_Win (as integer or pointer).

Public Member Functions

 Window (const Window &) noexcept=default
 Copy construct.
 Window (Window &&) noexcept=default
 Move construct.
Windowoperator= (const Window &) noexcept=default
 Copy assignment.
Windowoperator= (Window &&) noexcept=default
 Move assignment.
bool operator== (const Window &rhs) const noexcept
 Test for equality.
bool operator!= (const Window &rhs) const noexcept
 Test for inequality.
 Window () noexcept
 Default construct as MPI_WIN_NULL.
 Window (const void *p) noexcept
 Construct from MPI_Win (as pointer type).
 Window (value_type val) noexcept
 Construct from MPI_Win (as integer type).
value_type value () const noexcept
 Return raw value.
const void * pointer () const noexcept
 Return as pointer value.
bool good () const noexcept
 True if not equal to MPI_WIN_NULL.
void reset () noexcept
 Reset to default constructed value (MPI_WIN_NULL).
int size () const
 The number of ranks associated with the window group.
template<class Type>
UList< Type > allocate (std::streamsize count, UPstream::Communicator communicator, const bool shared=false)
 Allocate a local memory region and create window onto it.
template<class Type>
UList< Type > allocate (std::streamsize count, const int communicator, const bool shared=false)
 Allocate a local memory region and create window onto it.
template<class Type>
UList< Type > allocate_shared (std::streamsize count, UPstream::Communicator communicator)
 Allocate a shared memory region and create window onto it.
template<class Type>
UList< Type > allocate_shared (std::streamsize count, const int communicator)
 Create a window by allocating a new shared memory region.
template<class Type = void>
bool create (std::nullptr_t, UPstream::Communicator comm)
 A window exposing a zero-sized memory region.
template<class Type = void>
bool create (std::nullptr_t, const int comm)
 A window exposing a zero-sized memory region.
template<class Type>
bool create (const Type *buffer, std::streamsize count, UPstream::Communicator communicator)
 A window exposing an existing memory region.
template<class Type>
bool create (const Type *buffer, std::streamsize count, const int communicator)
 A window exposing an existing memory region.
template<class Type>
bool create (const UList< Type > &buffer, UPstream::Communicator comm)
 A window exposing the specified buffer contents.
template<class Type>
bool create (const UList< Type > &buffer, int communicator)
 A window exposing the specified buffer contents.
template<class Type>
bool create (SubList< Type > buffer, UPstream::Communicator communicator)
 A window exposing the specified buffer contents.
template<class Type>
bool create (SubList< Type > buffer, int communicator)
 A window exposing the specified buffer contents.
void lock (int rank, bool exclusive=false)
 MPI_Win_lock() for given target rank (no assertions), optionally as exclusive lock.
void unlock (int rank)
 MPI_Win_unlock() for given target rank.
void lock_all (bool exclusive=false)
 MPI_Win_lock_all(), optionally as exclusive lock.
void unlock_all ()
 MPI_Win_unlock_all().
void flush (int rank)
 MPI_Win_flush() for given target rank.
void flush_all ()
 MPI_Win_flush_all().
void flush_local (int rank)
 MPI_Win_flush_local().
void flush_local_all ()
 MPI_Win_flush_local_all().
void sync ()
 MPI_Win_sync() - ignored if the window is not active.
void close ()
 MPI_Win_free(). Closes the window view and frees any associated memory,.
bool is_shared (const bool failNonShared=false) const
 Test if the window is a shared memory window.
template<class Type>
UList< Type > view () const
 Return view of the currently exposed window content. No restriction on the type of memory associated with the window.
template<class Type>
UList< Type > view_shared (int target_rank) const
 Return view of shared memory window content.
template<class Type>
bool get (Type *buffer, std::streamsize count, int fromProcNo, int target_disp=0) const
 Get buffer contents from given rank. A no-op for an empty or null buffer, or if not running in parallel.
template<class Type>
bool put (const Type *buffer, std::streamsize count, int toProcNo, int target_disp=0) const
 Put buffer contents to given rank.
template<class Type>
bool put (const UPstream::opCodes opCodeId, const Type *buffer, std::streamsize count, int toProcNo, int target_disp=0) const
 Put accumulate buffer contents to given rank.
template<class Type>
bool get_value (Type &value, int fromProcNo, int target_disp=0) const
 Get a single value from given rank.
template<class Type>
bool put_value (const Type &value, int toProcNo, int target_disp=0) const
 Put a single value to given rank.
template<class Type>
bool put_value (const UPstream::opCodes opCodeId, const Type &value, int toProcNo, int target_disp=0) const
 Put and accumulate a single value to given rank.
template<class Type>
bool get (UList< Type > &buffer, int fromProcNo, int target_disp=0) const
 Get into List storage (contiguous data only) from window location on given processor. A no-op for an empty or null buffer, or if not running in parallel.
template<class Type>
bool put (const UList< Type > &buffer, int toProcNo, int target_disp=0) const
 Put from List storage (contiguous data only) to window location on given processor.
template<class Type>
bool put (const UPstream::opCodes opCodeId, const UList< Type > &buffer, int toProcNo, int target_disp=0) const
 Put and accumulate from List storage (contiguous data only) to window location on given processor. A no-op for an empty or null buffer, or if not running in parallel.
template<class Type>
bool get (SubList< Type > buffer, int fromProcNo, int target_disp=0) const
 Get into SubList storage (contiguous data only) from window location on given processor. A no-op for an empty or null buffer, or if not running in parallel.
template<class Type>
bool fetch_and_op (const UPstream::opCodes opCodeId, const Type &origin, Type &result, int target_rank, int target_disp=0) const
 Combine the value of origin into the target and return the resulting value (MPI_Fetch_and_op).
template<class Type>
bool put (const SubList< Type > buffer, int toProcNo, int target_disp=0) const
 Put from SubList storage (contiguous data only) to window location on given processor. A no-op for an empty or null buffer, or if not running in parallel.
template<class Type>
bool put (const UPstream::opCodes opCodeId, const SubList< Type > buffer, int toProcNo, int target_disp=0) const
 Put and accumulate from SubList storage (contiguous data only) to window location on given processor. A no-op for an empty or null buffer, or if not running in parallel.

Protected Member Functions

std::pair< void *, int64_t > mpi_win_allocate (std::streamsize num_elements, int disp_unit, UPstream::Communicator communicator, const bool shared=false)
 Allocate a local or shared memory window. Uses MPI_Win_allocate() or MPI_Win_allocate_shared(), respectively.
std::pair< void *, int64_t > mpi_win_allocate (std::streamsize num_elements, int disp_unit, int communicator, const bool shared=false)
 Allocate a local or shared memory window. Uses MPI_Win_allocate() or MPI_Win_allocate_shared(), respectively.
bool mpi_win_create (void *baseptr, std::streamsize num_elements, int disp_unit, UPstream::Communicator communicator)
 Create window onto existing memory with MPI_Win_create().
bool mpi_win_create (void *baseptr, std::streamsize num_elements, int disp_unit, int communicator)
 Create window onto existing memory with MPI_Win_create().
bool get_data (void *origin, std::streamsize count, const UPstream::dataTypes dataTypeId, int target_rank, int target_disp=0) const
 Get buffer contents from given rank.
bool put_data (const void *origin, std::streamsize count, const UPstream::dataTypes dataTypeId, int target_rank, int target_disp=0) const
 Put buffer contents to given rank.
bool put_data (const UPstream::opCodes opCodeId, const void *origin, std::streamsize count, const UPstream::dataTypes dataTypeId, int target_rank, int target_disp=0) const
 Put accumulate buffer contents to given rank.
bool mpi_fetch_and_op (const UPstream::opCodes opCodeId, const void *origin, void *result, const UPstream::dataTypes dataTypeId, int target_rank, int target_disp=0) const
 Retrieve the remote content (a single value) and then combine in new content.
void mpi_win_flushing (int rank, bool local=false)
 Entry point to MPI_Win_flush(), MPI_Win_flush_all(), MPI_Win_flush_local(), MPI_Win_flush_local_all().
void mpi_win_locking (int rank, bool exclusive=false)
 Entry point to MPI_Win_lock(), MPI_Win_lock_all(), optionally as exclusive lock.
void mpi_win_unlocking (int rank)
 Entry point to MPI_Win_unlock(), MPI_Win_unlock_all().

Static Protected Member Functions

template<class Type>
static constexpr auto element_width () noexcept
 Sizing helper for disp_unit.
static std::pair< void *, int64_t > mpi_win_query (UPstream::Window window, const int expected_disp_unit)
 Retrieve window sizing information as address/count tuple. The expected sizeof(Type) is supplied as an assertion parameter.
static std::pair< void *, int64_t > mpi_win_query_shared (UPstream::Window window, int target_rank, const int expected_disp_unit)
 Retrieve shared window information as address/count tuple. The expected sizeof(Type) is supplied as an assertion parameter.

Detailed Description

An opaque wrapper for MPI_Win with a vendor-independent representation and without any <mpi.h> header dependency.

The handling for window declaration is very generous - it does not distinguish between readonly and read/write windows. This may become more restrictive in the future.

Note
The MPI standard states that MPI_Win is always an opaque object. Generally it is either an integer (eg, mpich) or a pointer (eg, openmpi).
Source files

Definition at line 55 of file UPstreamWindow.H.

Member Typedef Documentation

◆ value_type

typedef std::intptr_t value_type

Storage for MPI_Win (as integer or pointer).

Definition at line 64 of file UPstreamWindow.H.

Constructor & Destructor Documentation

◆ Window() [1/5]

Window ( const Window & )
defaultnoexcept

Copy construct.

References Window().

Referenced by operator!=(), operator=(), operator=(), operator==(), Window(), Window(), Window(), and Window().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Window() [2/5]

Window ( Window && )
defaultnoexcept

Move construct.

References Foam::noexcept, and Window().

Here is the call graph for this function:

◆ Window() [3/5]

Window ( )
noexcept

Default construct as MPI_WIN_NULL.

Definition at line 25 of file UPstreamWindow.C.

References Foam::noexcept, UPstream::UPstream(), and Window().

Here is the call graph for this function:

◆ Window() [4/5]

Window ( const void * p)
inlineexplicitnoexcept

Construct from MPI_Win (as pointer type).

Definition at line 358 of file UPstreamWindow.H.

References Foam::noexcept, p, and Window().

Here is the call graph for this function:

◆ Window() [5/5]

Window ( value_type val)
inlineexplicitnoexcept

Construct from MPI_Win (as integer type).

Definition at line 366 of file UPstreamWindow.H.

References Foam::noexcept.

Member Function Documentation

◆ element_width()

template<class Type>
constexpr auto element_width ( )
inlinestaticconstexprprotectednoexcept

Sizing helper for disp_unit.

Definition at line 85 of file UPstreamWindow.H.

References Foam::noexcept.

Referenced by create(), and create().

Here is the caller graph for this function:

◆ mpi_win_allocate() [1/2]

std::pair< void *, int64_t > mpi_win_allocate ( std::streamsize num_elements,
int disp_unit,
UPstream::Communicator communicator,
const bool shared = false )
protected

Allocate a local or shared memory window. Uses MPI_Win_allocate() or MPI_Win_allocate_shared(), respectively.

A no-op if not running in parallel. This is a collective call.

Returns
(address, size) tuple
Parameters
num_elementsNumber of elements in the window (non-negative integer)
disp_unitLocal unit size for displacements (positive integer) == sizeof(Type)
communicatorCommunicator (wrapped)
sharedCreate shared memory

Definition at line 52 of file UPstreamWindow.C.

References NotImplemented.

◆ mpi_win_allocate() [2/2]

std::pair< void *, int64_t > mpi_win_allocate ( std::streamsize num_elements,
int disp_unit,
int communicator,
const bool shared = false )
protected

Allocate a local or shared memory window. Uses MPI_Win_allocate() or MPI_Win_allocate_shared(), respectively.

A no-op if not running in parallel. This is a collective call.

Returns
(address, size) tuple
Parameters
num_elementsNumber of elements in the window (non-negative integer)
disp_unitLocal unit size for displacements (positive integer) == sizeof(Type)
communicatorCommunicator (internally indexed)
sharedCreate shared memory

Definition at line 66 of file UPstreamWindow.C.

References NotImplemented.

◆ mpi_win_create() [1/2]

bool mpi_win_create ( void * baseptr,
std::streamsize num_elements,
int disp_unit,
UPstream::Communicator communicator )
protected

Create window onto existing memory with MPI_Win_create().

A no-op if not running in parallel. This is a collective call.

Parameters
baseptrAddress of window
num_elementsNumber of elements in the window (non-negative integer)
disp_unitLocal unit size for displacements (positive integer) == sizeof(Type)
communicatorCommunicator (wrapped)

Definition at line 79 of file UPstreamWindow.C.

References NotImplemented.

Referenced by create(), and create().

Here is the caller graph for this function:

◆ mpi_win_create() [2/2]

bool mpi_win_create ( void * baseptr,
std::streamsize num_elements,
int disp_unit,
int communicator )
protected

Create window onto existing memory with MPI_Win_create().

A no-op if not running in parallel. This is a collective call.

Parameters
baseptrAddress of window
num_elementsNumber of elements in the window (non-negative integer)
disp_unitLocal unit size for displacements (positive integer) == sizeof(Type)
communicatorCommunicator (internally indexed)

Definition at line 92 of file UPstreamWindow.C.

References NotImplemented.

◆ mpi_win_query()

std::pair< void *, int64_t > mpi_win_query ( UPstream::Window window,
const int expected_disp_unit )
staticprotected

Retrieve window sizing information as address/count tuple. The expected sizeof(Type) is supplied as an assertion parameter.

Returns
(nullptr, 0) if not running in parallel or if either the address or count are zero
Parameters
expected_disp_unitExpected element size (fatal for mismatch with queried value)

Definition at line 198 of file UPstreamWindow.C.

References NotImplemented.

◆ mpi_win_query_shared()

std::pair< void *, int64_t > mpi_win_query_shared ( UPstream::Window window,
int target_rank,
const int expected_disp_unit )
staticprotected

Retrieve shared window information as address/count tuple. The expected sizeof(Type) is supplied as an assertion parameter.

Returns
(nullptr, 0) if not running in parallel or if either the address or count are zero
Parameters
target_rankThe rank to query
expected_disp_unitExpected element size (fatal for mismatch with queried value)

Definition at line 211 of file UPstreamWindow.C.

References NotImplemented.

◆ get_data()

bool get_data ( void * origin,
std::streamsize count,
const UPstream::dataTypes dataTypeId,
int target_rank,
int target_disp = 0 ) const
protected

Get buffer contents from given rank.

A no-op if not running in parallel and for empty or null buffer.

Note
The method uses a void pointer and the required data type (as per MPI). This means it should almost never be called directly but always via a compile-time checked caller.
Returns
True on success
Parameters
originDestination buffer
countThe data count - number of elements. Identical on both sides.
target_dispWindow displacement on target

Definition at line 131 of file UPstreamWindow.C.

References NotImplemented.

◆ put_data() [1/2]

bool put_data ( const void * origin,
std::streamsize count,
const UPstream::dataTypes dataTypeId,
int target_rank,
int target_disp = 0 ) const
protected

Put buffer contents to given rank.

A no-op if not running in parallel and for empty or null buffer.

Parameters
originSource buffer
countThe data count - number of elements. Identical on both sides.
target_dispWindow displacement on target

Definition at line 145 of file UPstreamWindow.C.

References NotImplemented.

◆ put_data() [2/2]

bool put_data ( const UPstream::opCodes opCodeId,
const void * origin,
std::streamsize count,
const UPstream::dataTypes dataTypeId,
int target_rank,
int target_disp = 0 ) const
protected

Put accumulate buffer contents to given rank.

A no-op if not running in parallel and for empty or null buffer.

Parameters
opCodeIdThe op-code for accumulate
originSource buffer
countThe data count - number of elements. Identical on both sides.
target_dispWindow displacement on target

Definition at line 159 of file UPstreamWindow.C.

References NotImplemented.

◆ mpi_fetch_and_op()

bool mpi_fetch_and_op ( const UPstream::opCodes opCodeId,
const void * origin,
void * result,
const UPstream::dataTypes dataTypeId,
int target_rank,
int target_disp = 0 ) const
protected

Retrieve the remote content (a single value) and then combine in new content.

A no-op if not running in parallel and for empty or null buffer.

Parameters
opCodeIdThe op-code for accumulate
[in]originthe content to combine with target
[out]resulttarget content before the operation
target_dispWindow displacement on target

Definition at line 174 of file UPstreamWindow.C.

References NotImplemented.

◆ mpi_win_flushing()

void mpi_win_flushing ( int rank,
bool local = false )
protected

Entry point to MPI_Win_flush(), MPI_Win_flush_all(), MPI_Win_flush_local(), MPI_Win_flush_local_all().

Uses rank == -1 to signal 'all'

Definition at line 113 of file UPstreamWindow.C.

References local.

Referenced by flush(), flush_all(), flush_local(), and flush_local_all().

Here is the caller graph for this function:

◆ mpi_win_locking()

void mpi_win_locking ( int rank,
bool exclusive = false )
protected

Entry point to MPI_Win_lock(), MPI_Win_lock_all(), optionally as exclusive lock.

Uses rank == -1 to signal 'all'

Definition at line 121 of file UPstreamWindow.C.

Referenced by lock(), and lock_all().

Here is the caller graph for this function:

◆ mpi_win_unlocking()

void mpi_win_unlocking ( int rank)
protected

Entry point to MPI_Win_unlock(), MPI_Win_unlock_all().

Uses rank == -1 to signal 'all'

Definition at line 125 of file UPstreamWindow.C.

Referenced by unlock(), and unlock_all().

Here is the caller graph for this function:

◆ operator=() [1/2]

Window & operator= ( const Window & )
defaultnoexcept

Copy assignment.

References Foam::noexcept, and Window().

Here is the call graph for this function:

◆ operator=() [2/2]

Window & operator= ( Window && )
defaultnoexcept

Move assignment.

References Foam::noexcept, and Window().

Here is the call graph for this function:

◆ operator==()

bool operator== ( const Window & rhs) const
inlinenoexcept

Test for equality.

Definition at line 334 of file UPstreamWindow.H.

References Foam::noexcept, Foam::rhs(), and Window().

Here is the call graph for this function:

◆ operator!=()

bool operator!= ( const Window & rhs) const
inlinenoexcept

Test for inequality.

Definition at line 342 of file UPstreamWindow.H.

References Foam::rhs(), and Window().

Here is the call graph for this function:

◆ value()

value_type value ( ) const
inlinenoexcept

Return raw value.

Definition at line 379 of file UPstreamWindow.H.

References Foam::noexcept.

Referenced by get_value(), put_value(), and put_value().

Here is the caller graph for this function:

◆ pointer()

const void * pointer ( ) const
inlinenoexcept

Return as pointer value.

Definition at line 384 of file UPstreamWindow.H.

References Foam::noexcept.

◆ good()

bool good ( ) const
noexcept

True if not equal to MPI_WIN_NULL.

Definition at line 33 of file UPstreamWindow.C.

References Foam::noexcept.

◆ reset()

void reset ( )
noexcept

Reset to default constructed value (MPI_WIN_NULL).

Definition at line 39 of file UPstreamWindow.C.

References Foam::noexcept.

◆ size()

int size ( ) const

The number of ranks associated with the window group.

The same as querying the original communicator, assuming the communicator is available within the current code scope.

Definition at line 43 of file UPstreamWindow.C.

◆ allocate() [1/2]

template<class Type>
UList< Type > allocate ( std::streamsize count,
UPstream::Communicator communicator,
const bool shared = false )
inline

Allocate a local memory region and create window onto it.

A no-op if not running in parallel. This is a collective call.

Parameters
countNumber of elements to allocate
sharedCreate shared memory region

References allocate(), and UPstream::UPstream().

Referenced by allocate(), and allocate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ allocate() [2/2]

template<class Type>
UList< Type > allocate ( std::streamsize count,
const int communicator,
const bool shared = false )
inline

Allocate a local memory region and create window onto it.

A no-op if not running in parallel. This is a collective call.

Parameters
countNumber of elements to allocate
sharedCreate shared memory region

References allocate().

Here is the call graph for this function:

◆ allocate_shared() [1/2]

template<class Type>
UList< Type > allocate_shared ( std::streamsize count,
UPstream::Communicator communicator )
inline

Allocate a shared memory region and create window onto it.

A no-op if not running in parallel. This is a collective call.

Parameters
countNumber of elements to allocate

References allocate_shared(), and UPstream::UPstream().

Referenced by allocate_shared(), and allocate_shared().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ allocate_shared() [2/2]

template<class Type>
UList< Type > allocate_shared ( std::streamsize count,
const int communicator )
inline

Create a window by allocating a new shared memory region.

A no-op if not running in parallel. This is a collective call.

Parameters
countNumber of elements to allocate

References allocate_shared().

Here is the call graph for this function:

◆ create() [1/8]

template<class Type = void>
bool create ( std::nullptr_t ,
UPstream::Communicator comm )
inline

A window exposing a zero-sized memory region.

A no-op if not running in parallel. This is a collective call.

Definition at line 480 of file UPstreamWindow.H.

References create(), element_width(), mpi_win_create(), and UPstream::UPstream().

Referenced by create(), create(), create(), create(), and create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create() [2/8]

template<class Type = void>
bool create ( std::nullptr_t ,
const int comm )
inline

A window exposing a zero-sized memory region.

A no-op if not running in parallel. This is a collective call.

Definition at line 492 of file UPstreamWindow.H.

References element_width(), and mpi_win_create().

Here is the call graph for this function:

◆ create() [3/8]

template<class Type>
bool create ( const Type * buffer,
std::streamsize count,
UPstream::Communicator communicator )
inline

A window exposing an existing memory region.

A no-op if not running in parallel. This is a collective call.

Note
Ignores constness since we can't specify a priori if this should be a read/write or read only buffer.
Parameters
countNumber of elements in the window

◆ create() [4/8]

template<class Type>
bool create ( const Type * buffer,
std::streamsize count,
const int communicator )
inline

A window exposing an existing memory region.

A no-op if not running in parallel. This is a collective call.

Parameters
countNumber of elements in the window

◆ create() [5/8]

template<class Type>
bool create ( const UList< Type > & buffer,
UPstream::Communicator comm )
inline

A window exposing the specified buffer contents.

A no-op if not running in parallel. This is a collective call.

Definition at line 536 of file UPstreamWindow.H.

References UList< T >::cdata(), create(), and UList< T >::size().

Here is the call graph for this function:

◆ create() [6/8]

template<class Type>
bool create ( const UList< Type > & buffer,
int communicator )
inline

A window exposing the specified buffer contents.

A no-op if not running in parallel. This is a collective call.

Definition at line 548 of file UPstreamWindow.H.

References UList< T >::cdata(), create(), and UList< T >::size().

Here is the call graph for this function:

◆ create() [7/8]

template<class Type>
bool create ( SubList< Type > buffer,
UPstream::Communicator communicator )
inline

A window exposing the specified buffer contents.

A no-op if not running in parallel. This is a collective call.

Definition at line 560 of file UPstreamWindow.H.

References UList< T >::cdata(), create(), and UList< T >::size().

Here is the call graph for this function:

◆ create() [8/8]

template<class Type>
bool create ( SubList< Type > buffer,
int communicator )
inline

A window exposing the specified buffer contents.

A no-op if not running in parallel. This is a collective call.

Definition at line 572 of file UPstreamWindow.H.

References UList< T >::cdata(), create(), and UList< T >::size().

Here is the call graph for this function:

◆ lock()

void lock ( int rank,
bool exclusive = false )
inline

MPI_Win_lock() for given target rank (no assertions), optionally as exclusive lock.

Definition at line 584 of file UPstreamWindow.H.

References mpi_win_locking().

Here is the call graph for this function:

◆ unlock()

void unlock ( int rank)
inline

MPI_Win_unlock() for given target rank.

Definition at line 592 of file UPstreamWindow.H.

References mpi_win_unlocking().

Here is the call graph for this function:

◆ lock_all()

void lock_all ( bool exclusive = false)
inline

MPI_Win_lock_all(), optionally as exclusive lock.

Definition at line 597 of file UPstreamWindow.H.

References mpi_win_locking().

Here is the call graph for this function:

◆ unlock_all()

void unlock_all ( )
inline

MPI_Win_unlock_all().

Definition at line 602 of file UPstreamWindow.H.

References mpi_win_unlocking().

Here is the call graph for this function:

◆ flush()

void flush ( int rank)
inline

MPI_Win_flush() for given target rank.

Complete all outstanding RMA operations initiated by the calling process to the target rank.

Definition at line 610 of file UPstreamWindow.H.

References mpi_win_flushing().

Here is the call graph for this function:

◆ flush_all()

void flush_all ( )
inline

MPI_Win_flush_all().

Complete all outstanding RMA operations at both the origin and the target

Definition at line 618 of file UPstreamWindow.H.

References mpi_win_flushing().

Here is the call graph for this function:

◆ flush_local()

void flush_local ( int rank)
inline

MPI_Win_flush_local().

Locally complete at the origin all outstanding RMA operations initiated by the calling process to the target process specified by rank.

Definition at line 627 of file UPstreamWindow.H.

References mpi_win_flushing().

Here is the call graph for this function:

◆ flush_local_all()

void flush_local_all ( )
inline

MPI_Win_flush_local_all().

Locally complete at the origin all outstanding RMA operations to all targets.

Definition at line 635 of file UPstreamWindow.H.

References mpi_win_flushing().

Here is the call graph for this function:

◆ sync()

void sync ( )

MPI_Win_sync() - ignored if the window is not active.

Definition at line 117 of file UPstreamWindow.C.

◆ close()

void close ( )

MPI_Win_free(). Closes the window view and frees any associated memory,.

eg, from allocate() or allocate_shared(). Ignored if the window is not active. This is a collective call.

Definition at line 107 of file UPstreamWindow.C.

◆ is_shared()

bool is_shared ( const bool failNonShared = false) const

Test if the window is a shared memory window.

Definition at line 191 of file UPstreamWindow.C.

◆ view()

template<class Type>
UList< Type > view ( ) const
inline

Return view of the currently exposed window content. No restriction on the type of memory associated with the window.

A no-op (empty list) if not running in parallel or the window is not active.

◆ view_shared()

template<class Type>
UList< Type > view_shared ( int target_rank) const
inline

Return view of shared memory window content.

A no-op (empty list) if not running in parallel. Undefined behaviour (likely Fatal) if a shared memory window has not been allocated.

◆ get() [1/3]

template<class Type>
bool get ( Type * buffer,
std::streamsize count,
int fromProcNo,
int target_disp = 0 ) const
inline

Get buffer contents from given rank. A no-op for an empty or null buffer, or if not running in parallel.

Parameters
bufferDestination buffer
countThe data count - number of elements. Identical on both sides.
target_dispWindow displacement on target

Referenced by get_value().

Here is the caller graph for this function:

◆ put() [1/6]

template<class Type>
bool put ( const Type * buffer,
std::streamsize count,
int toProcNo,
int target_disp = 0 ) const
inline

Put buffer contents to given rank.

A no-op for an empty/null buffer, or if not running in parallel.

Parameters
bufferSource buffer
countThe data count - number of elements. Identical on both sides.
target_dispWindow displacement on target

Referenced by put_value(), and put_value().

Here is the caller graph for this function:

◆ put() [2/6]

template<class Type>
bool put ( const UPstream::opCodes opCodeId,
const Type * buffer,
std::streamsize count,
int toProcNo,
int target_disp = 0 ) const
inline

Put accumulate buffer contents to given rank.

A no-op for an empty/null buffer, or if not running in parallel.

Note
Must correspond to basic data types!
Parameters
bufferSource buffer
countThe data count - number of elements. Identical on both sides.
target_dispWindow displacement on target

◆ get_value()

template<class Type>
bool get_value ( Type & value,
int fromProcNo,
int target_disp = 0 ) const
inline

Get a single value from given rank.

Note
Use persistent data (not temporary) for value
Parameters
target_dispWindow displacement on target

Definition at line 738 of file UPstreamWindow.H.

References get(), and value().

Here is the call graph for this function:

◆ put_value() [1/2]

template<class Type>
bool put_value ( const Type & value,
int toProcNo,
int target_disp = 0 ) const
inline

Put a single value to given rank.

Note
Use persistent data (not temporary) for value
Parameters
target_dispWindow displacement on target

Definition at line 754 of file UPstreamWindow.H.

References put(), and value().

Here is the call graph for this function:

◆ put_value() [2/2]

template<class Type>
bool put_value ( const UPstream::opCodes opCodeId,
const Type & value,
int toProcNo,
int target_disp = 0 ) const
inline

Put and accumulate a single value to given rank.

Note
Use persistent data (not temporary) for value
Parameters
target_dispWindow displacement on target

Definition at line 770 of file UPstreamWindow.H.

References put(), and value().

Here is the call graph for this function:

◆ get() [2/3]

template<class Type>
bool get ( UList< Type > & buffer,
int fromProcNo,
int target_disp = 0 ) const
inline

Get into List storage (contiguous data only) from window location on given processor. A no-op for an empty or null buffer, or if not running in parallel.

Note
Only valid for contiguous data types.
Parameters
fromProcNoOffset number of elements on the toProcNo rank
target_dispWindow displacement on target

◆ put() [3/6]

template<class Type>
bool put ( const UList< Type > & buffer,
int toProcNo,
int target_disp = 0 ) const
inline

Put from List storage (contiguous data only) to window location on given processor.

Note
Only valid for contiguous data types.
Parameters
target_dispWindow displacement on target

◆ put() [4/6]

template<class Type>
bool put ( const UPstream::opCodes opCodeId,
const UList< Type > & buffer,
int toProcNo,
int target_disp = 0 ) const
inline

Put and accumulate from List storage (contiguous data only) to window location on given processor. A no-op for an empty or null buffer, or if not running in parallel.

Note
Only valid for contiguous data types.
Parameters
target_dispWindow displacement on target

◆ get() [3/3]

template<class Type>
bool get ( SubList< Type > buffer,
int fromProcNo,
int target_disp = 0 ) const
inline

Get into SubList storage (contiguous data only) from window location on given processor. A no-op for an empty or null buffer, or if not running in parallel.

Note
Only valid for contiguous data types.
Parameters
target_dispWindow displacement on target

◆ fetch_and_op()

template<class Type>
bool fetch_and_op ( const UPstream::opCodes opCodeId,
const Type & origin,
Type & result,
int target_rank,
int target_disp = 0 ) const
inline

Combine the value of origin into the target and return the resulting value (MPI_Fetch_and_op).

Note
Use persistent data (not temporary) for origin and result, which must also be disjoint locations. Only valid for single element (no aggregates).
Returns
the old target value (before the operation)
Parameters
originthe content to combine with target
[out]resultthe old target value before the operation
target_rankThe target rank
target_dispWindow displacement on target

◆ put() [5/6]

template<class Type>
bool put ( const SubList< Type > buffer,
int toProcNo,
int target_disp = 0 ) const
inline

Put from SubList storage (contiguous data only) to window location on given processor. A no-op for an empty or null buffer, or if not running in parallel.

Note
Only valid for contiguous data types.
Parameters
target_dispWindow displacement on target

◆ put() [6/6]

template<class Type>
bool put ( const UPstream::opCodes opCodeId,
const SubList< Type > buffer,
int toProcNo,
int target_disp = 0 ) const
inline

Put and accumulate from SubList storage (contiguous data only) to window location on given processor. A no-op for an empty or null buffer, or if not running in parallel.

Note
Only valid for contiguous data types.
Parameters
target_dispWindow displacement on target

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