From 82c8d224d6367d53220b716bb3b0a38b85d9ef3c Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Wed, 11 Jul 2007 17:15:28 +0000 Subject: [PATCH] add interface for getting an ompi_proc_t from a group, similar to the ompi_comm_peer_lookup function for communicators This commit was SVN r15365. --- ompi/group/group.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 *