Communicators & Groups

Located in file: MEL.hpp

ErrorHandler MEL::CommCreateErrorHandler(ErrorHandlerFunc func)

Create a Comm error handler by directly passing the function to use.

See
MPI_Comm_create_errhandler
Return
Returns an object that MPI can use to reference the error handler
Parameters
  • func -

    The function to use as an error handler

void MEL::CommSetErrorHandler(const Comm &comm, const ErrorHandler &errHndl)

Set a Comm error handler by passing the a error handler reference.

See
MPI_Comm_set_errhandler
Parameters
  • comm -

    The comm world to attach the error handler to

  • errHndl -

    The reference to a bound error handler

void MEL::CommSetErrorHandler(const Comm &comm, ErrorHandlerFunc func)

Set a Comm error handler by directly passing the function to use.

Parameters
  • comm -

    The comm world to attach the error handler to

  • func -

    The function to use as an error handler

ErrorHandler MEL::CommGetErrorHandler(const Comm &comm)

Get the Comm error handler attached to a comm world.

See
MPI_Comm_get_errhandler
Return
Returns a reference to a bound error handler
Parameters
  • comm -

    The comm world to get the error handler of

int MEL::CommRank(const Comm &comm)

Get the Comm rank of the process.

See
MPI_Comm_rank
Return
Returns the rank or the process within comm
Parameters
  • comm -

    The comm world to get the rank in

int MEL::CommSize(const Comm &comm)

Get the Comm world size.

See
MPI_Comm_size
Return
Returns the size of the comm world
Parameters
  • comm -

    The comm world to get the size of

int MEL::CommRemoteSize(const Comm &comm)

Get the Comm world remote size.

See
MPI_Comm_remote_size
Return
Returns the remote size of the comm world
Parameters
  • comm -

    The comm world to get the remote size of

Comm MEL::CommSplit(const Comm &comm, int colour)

Split a comm world into seperate comms.

Processes with the same colour will end up in the same comm world

See
MPI_Comm_split
Return
Returns a new comm world
Parameters
  • comm -

    The comm world to split

  • colour -

    The group that this process will end up in in the new comm world

Comm MEL::CommDuplicate(const Comm &comm)

Duplicate a comm world so that it can be handled independently.

See
MPI_Comm_dup
Return
Returns a new comm world
Parameters
  • comm -

    The comm world to duplicate

Group MEL::CommGetGroup(const Comm &comm)

Get the group of a comm world.

See
MPI_Comm_group
Return
Returns a Group object representing the processes in comm
Parameters
  • comm -

    The comm world to get the group of

Comm MEL::CommCreateFromGroup(const Comm &comm, const Group &group)

Create a comm object from an existing comm object and a group object.

See
MPI_Comm_create
Return
Returns a new comm object
Parameters
  • comm -

    The comm world to build off of

  • group -

    The group to use to build the new comm object

void MEL::CommFree(Comm &comm)

Free a comm world.

See
MPI_Comm_disconnect
Parameters
  • comm -

    The comm world to free

void MEL::CommFree(std::vector<Comm> &comms)

Free a vector comm world.

Parameters
  • comms -

    A std::vector of comm world

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

Free the varadic set of comm worlds provided.

Parameters
  • d0 -

    The first comm world to free

  • d1 -

    The second comm world to free

  • args -

    The varadic set of remaining comm worlds to free

bool MEL::CommIsNULL(const Comm &comm)

Test if a comm world is the null comm world.

Return
Returns true if comm is the null comm world
Parameters
  • comm -

    The comm world to test

Group MEL::GroupUnion(const Group &lhs, const Group &rhs)

Perform a set union of two comm groups.

See
MPI_Group_union
Return
Returns the union of the two groups
Parameters
  • lhs -

    The first operand of the union

  • rhs -

    The second operand of the union

Group MEL::GroupDifference(const Group &lhs, const Group &rhs)

Perform a set difference of two comm groups.

See
MPI_Group_difference
Return
Returns the difference of the two groups
Parameters
  • lhs -

    The first operand of the difference

  • rhs -

    The second operand of the difference

Group MEL::GroupIntersection(const Group &lhs, const Group &rhs)

Perform a set intersection of two comm groups.

See
MPI_Group_intersection
Return
Returns the intersection of the two groups
Parameters
  • lhs -

    The first operand of the intersection

  • rhs -

    The second operand of the intersection

Group MEL::GroupInclude(const Group &group, const int *ranks, const int num)

Create a comm group including just the ranks from an exisitng group given in an array.

See
MPI_Group_incl
Return
Returns the new groups
Parameters
  • group -

    The original group to build off of

  • ranks -

    Pointer to the array of ranks

  • num -

    The length of the array

Group MEL::GroupInclude(const Group &group, const std::vector<int> &ranks)

Create a comm group including just the ranks from an exisitng group given in an array.

Return
Returns the new groups
Parameters
  • group -

    The original group to build off of

  • ranks -

    A std::vector of ranks

Group MEL::GroupExclude(const Group &group, const int *ranks, const int num)

Create a comm group excluding just the ranks from an exisitng group given in an array.

See
MPI_Group_excl
Return
Returns the new groups
Parameters
  • group -

    The original group to build off of

  • ranks -

    Pointer to the array of ranks

  • num -

    The length of the array

Group MEL::GroupExclude(const Group &group, const std::vector<int> &ranks)

Create a comm group excluding just the ranks from an exisitng group given in an array.

Return
Returns the new groups
Parameters
  • group -

    The original group to build off of

  • ranks -

    A std::vector of ranks

int MEL::GroupCompare(const Group &lhs, const Group &rhs)

Compare two comm groups.

See
MPI_Group_compare
Return
Returns the comparison of two groups
Parameters
  • lhs -

    The first operand of the compare

  • rhs -

    The second operand of the compare

bool MEL::GroupIsSimilar(const Group &lhs, const Group &rhs)

Compare if two comm groups are similar.

Return
Returns true if the groups are similar
Parameters
  • lhs -

    The first operand of the compare

  • rhs -

    The second operand of the compare

bool MEL::GroupIsIdentical(const Group &lhs, const Group &rhs)

Compare if two comm groups are identical.

Return
Returns true if the groups are identical
Parameters
  • lhs -

    The first operand of the compare

  • rhs -

    The second operand of the compare

bool MEL::GroupIsCongruent(const Group &lhs, const Group &rhs)

Compare if two comm groups are congruent.

Return
Returns true if the groups are congruent
Parameters
  • lhs -

    The first operand of the compare

  • rhs -

    The second operand of the compare

bool MEL::GroupIsUnequal(const Group &lhs, const Group &rhs)

Compare if two comm groups are unequal.

Return
Returns true if the groups are unequal
Parameters
  • lhs -

    The first operand of the compare

  • rhs -

    The second operand of the compare

bool MEL::GroupIsNULL(const Group &group)

Compare if a comm group is the null comm group.

Return
Returns true if the group is the null group
Parameters
  • group -

    The group to test

int MEL::GroupRank(const Group &group)

Gets the rank of the process within the given comm group.

See
MPI_Group_rank
Return
Returns the rank within the given group
Parameters
  • group -

    The group to use

int MEL::GroupSize(const Group &group)

Gets the size of the given comm group.

See
MPI_Group_size
Return
Returns the size of the given group
Parameters
  • group -

    The group to use

void MEL::GroupFree(Group &group)

Frees a comm group.

See
MPI_Group_free
Parameters
  • group -

    The group to free

void MEL::GroupFree(std::vector<Group> &groups)

Free a vector comm group.

Parameters
  • groups -

    A std::vector of comm group

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

Free the varadic set of comm groups provided.

Parameters
  • d0 -

    The first comm groups to free

  • d1 -

    The second comm groups to free

  • args -

    The varadic set of remaining comm groups to free