Shared Arrays

Located in file: MEL.hpp

template <typename T>
Shared<T> MEL::SharedCreate(const int len, const int rank, const int size, const int root, const Comm &comm)

Create a MEL::Shared array across a comm world.

Parameters
  • len -

    The number of elements to allocate

  • rank -

    The rank of the calling process

  • size -

    The size of the comm world

  • root -

    The rank of the process who will own the shared array

  • comm -

    The comm world to share the array across

template <typename T>
Shared<T> MEL::SharedCreate(const int len, const int root, const Comm &comm)

Create a MEL::Shared array across a comm world.

Parameters
  • len -

    The number of elements to allocate

  • root -

    The rank of the process who will own the shared array

  • comm -

    The comm world to share the array across

template <typename T>
void MEL::SharedFree(Shared<T> &shared)

Free a MEL::Shared array.

Parameters
  • shared -

    The shared array to free

template <typename T>
bool MEL::SharedTest(const Shared<T> &shared)

Test if the shared array is currently locked.

Parameters
  • shared -

    The shared array to test

template <typename T>
void MEL::SharedLock_noget(Shared<T> &shared)

Get the lock on the shared array without synchronizing the data.

Useful for if you only intend to write to the array

Parameters
  • shared -

    The shared array to lock

template <typename T>
void MEL::SharedLock_noget(Shared<T> &shared, const int start, const int end)

Get the lock on the shared array without synchronizing the data.

Useful for if you only intend to write to the array

Parameters
  • shared -

    The shared array to lock

  • start -

    The start index to lock

  • end -

    The end index to lock

template <typename T>
void MEL::SharedLock(Shared<T> &shared)

Get the lock on the shared array and synchronize the data.

Parameters
  • shared -

    The shared array to lock

template <typename T>
void MEL::SharedLock(Shared<T> &shared, const int start, const int end)

Get the lock on the shared array and synchronize the data.

Parameters
  • shared -

    The shared array to lock

  • start -

    The start index to lock

  • end -

    The end index to lock

template <typename T>
void MEL::SharedUnlock_noput(Shared<T> &shared)

Release the lock on the shared array without synchronizing the data.

Useful for if you only read from the array

Parameters
  • shared -

    The shared array to unlock

template <typename T>
void MEL::SharedUnlock_noput(Shared<T> &shared, const int start, const int end)

Release the lock on the shared array without synchronizing the data.

Useful for if you only read from the array

Parameters
  • shared -

    The shared array to unlock

  • start -

    The start index to unlock

  • end -

    The end index to unlock

template <typename T>
void MEL::SharedUnlock(Shared<T> &shared)

Release the lock on the shared array and synchronize the data.

Parameters
  • shared -

    The shared array to unlock

template <typename T>
void MEL::SharedUnlock(Shared<T> &shared, const int start, const int end)

Release the lock on the shared array and synchronize the data.

Parameters
  • shared -

    The shared array to unlock

  • start -

    The start index to unlock

  • end -

    The end index to unlock