RMA One-Sided Communication

Located in file: MEL.hpp

ErrorHandler MEL::WinCreateErrorHandler(ErrorHandlerFunc func)

Create a window error handler.

See
MPI_Win_create_errhandler
Return
Returns a handle to an error handler
Parameters
  • func -

    The function to use

void MEL::WinSetErrorHandler(const Win &win, const ErrorHandler &errHndl)

Set the error handler for a window.

See
MPI_Win_set_errhandler
Parameters
  • win -

    The file to attach to

  • errHndl -

    The handler to use

void MEL::WinSetErrorHandler(const Win &win, ErrorHandlerFunc func)

Set the error handler for a window.

Parameters
  • win -

    The file to attach to

  • func -

    The function to use

ErrorHandler MEL::WinGetErrorHandler(const Win &win)

Get the error handler for a window.

See
MPI_Win_get_errhandler
Return
Returns a handle to the error handler
Parameters
  • win -

    The file to attach to

Win MEL::WinCreate(void *ptr, const Aint size, const int disp_unit, const Comm &comm)

Create a window on memory allocated with MPI/MEL alloc functions.

See
MPI_Win_create, MPI_Win_set_errhandler
Return
Returns a handle to the window
Parameters
  • ptr -

    Pointer to the memory to be mapped

  • size -

    The number of elements to be mapped

  • disp_unit -

    The size of each element in bytes

  • comm -

    The comm world to map the window within

template <typename T>
Win MEL::WinCreate(T *ptr, const Aint size, const Comm &comm)

Create a window on memory allocated with MPI/MEL alloc functions.

Element size determined from template parameter

Return
Returns a handle to the window
Parameters
  • ptr -

    Pointer to the memory to be mapped

  • size -

    The number of elements to be mapped

  • comm -

    The comm world to map the window within

void MEL::WinFence(const Win &win, const int assert_tag)

Synchronize the RMA access epoch for win across all processes attached to it.

See
MPI_Win_fence
Parameters
  • win -

    The window to synchronize

  • assert_tag -

    Program assertion

void MEL::WinFence(const Win &win)

Synchronize the RMA access epoch for win across all processes attached to it.

Parameters
  • win -

    The window to synchronize

void MEL::WinLock(const Win &win, const int rank, const int assert_tag, const LockType lock_type)

Get the lock on an RMA access epoch for a window.

See
MPI_Win_lock
Parameters
  • win -

    The window to lock

  • rank -

    The process rank to get the lock from

  • assert_tag -

    Program assertion

  • lock_type -

    The mode to get the lock in

void MEL::WinLock(const Win &win, const int rank, const LockType lock_type)

Get the lock on an RMA access epoch for a window.

Parameters
  • win -

    The window to lock

  • rank -

    The process rank to get the lock from

  • lock_type -

    The mode to get the lock in

void MEL::WinLockExclusive(const Win &win, const int rank, const int assert_tag)

Get an exclusive lock on an RMA access epoch for a window.

Parameters
  • win -

    The window to lock

  • rank -

    The process rank to get the lock from

  • assert_tag -

    Program assertion

void MEL::WinLockExclusive(const Win &win, const int rank)

Get an exclusive lock on an RMA access epoch for a window.

Parameters
  • win -

    The window to lock

  • rank -

    The process rank to get the lock from

void MEL::WinLockShared(const Win &win, const int rank, const int assert_tag)

Get a shared lock on an RMA access epoch for a window.

Parameters
  • win -

    The window to lock

  • rank -

    The process rank to get the lock from

  • assert_tag -

    Program assertion

void MEL::WinLockShared(const Win &win, const int rank)

Get a shared lock on an RMA access epoch for a window.

Parameters
  • win -

    The window to lock

  • rank -

    The process rank to get the lock from

void MEL::WinUnlock(const Win &win, const int rank)

Release the lock on an RMA access epoch for a window.

See
MPI_Win_unlock
Parameters
  • win -

    The window to lock

  • rank -

    The process rank to get the lock from

void MEL::Put(void *origin_ptr, int origin_num, const Datatype &origin_datatype, const Aint target_disp, const int target_num, const Datatype &target_datatype, const int target_rank, const Win &win)

Put data into the mapped window of another process.

See
MPI_Put
Parameters
  • origin_ptr -

    Pointer to the array to put

  • origin_num -

    The number of elements to put from the local array

  • origin_datatype -

    The derived datatype of the elements to be put

  • target_disp -

    Element displacement into the window to put data into

  • target_num -

    The number of elements to put into the window

  • target_datatype -

    The derived datatype of the elements to be put into the window

  • target_rank -

    Rank of the process to put into

  • win -

    The window to put into

void MEL::Accumulate(void *origin_ptr, int origin_num, const Datatype &origin_datatype, const Aint target_disp, const int target_num, const Datatype &target_datatype, const Op &op, const int target_rank, const Win &win)

Accumulate data into the mapped window of another process.

See
MPI_Accumulate
Parameters
  • origin_ptr -

    Pointer to the array to put

  • origin_num -

    The number of elements to put from the local array

  • origin_datatype -

    The derived datatype of the elements to be put

  • target_disp -

    Element displacement into the window to put data into

  • target_num -

    The number of elements to put into the window

  • target_datatype -

    The derived datatype of the elements to be put into the window

  • op -

    The MPI operation to use

  • target_rank -

    Rank of the process to put into

  • win -

    The window to put into

void MEL::Get(void *origin_ptr, int origin_num, const Datatype &origin_datatype, const Aint target_disp, const int target_num, const Datatype &target_datatype, const int target_rank, const Win &win)

Get data from the mapped window of another process.

See
MPI_Get
Parameters
  • origin_ptr -

    Pointer to the array to get

  • origin_num -

    The number of elements to get into the local array

  • origin_datatype -

    The derived datatype of the elements to be gotten

  • target_disp -

    Element displacement into the window to get data from

  • target_num -

    The number of elements to get from the window

  • target_datatype -

    The derived datatype of the elements to be gotten from the window

  • target_rank -

    Rank of the process to get from

  • win -

    The window to get from

void MEL::WinFree(Win &win)

Free an RMA window.

See
MPI_Win_free
Parameters
  • win -

    The window to free

void MEL::WinFree(std::vector<Win> &wins)

Free a std::vector of RMA window handles.

Parameters
  • wins -

    A std::vector of windows to free

template <typename T0, typename T1, typename... Args>
void MEL::WinFree(T0 &d0, T1 &d1, Args&&... args)

Free a varadic set of RMA windows.

Parameters
  • d0 -

    The first window to free

  • d1 -

    The second window to free

  • args -

    The remaining windows to free