diff --git a/ompi/group/group.h b/ompi/group/group.h index 411ed2539c..c2c00a38dd 100644 --- a/ompi/group/group.h +++ b/ompi/group/group.h @@ -135,6 +135,19 @@ static inline int ompi_group_rank(ompi_group_t *group) } +static inline struct ompi_proc_t* ompi_group_peer_lookup(ompi_group_t *group, int peer_id) +{ +#if OMPI_ENABLE_DEBUG + if (peer_id >= group->grp_proc_count) { + opal_output(0, "ompi_group_lookup_peer: invalid peer index (%d)", peer_id); + return (struct ompi_proc_t *) NULL; + } +#endif + return group->grp_proc_pointers[peer_id]; +} + + + /** * Set group rank in the input group structure *