Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] MPI_Group_compare is broken
From: Edgar Gabriel (gabriel_at_[hidden])
Date: 2009-05-07 18:38:21


you are right. At first I thought that the loop above that should catch
that condition but it doesn't. I will apply your patch and file a CMR
for the 1.3 branch...

Thanks for the bug report and the fix right away...
Edgar

Geoffrey Irving wrote:
> Hello,
>
> MPI_Group_compare is broken in both 1.3.2 and svn. Here is a patch
> which fixes the problem:
>
> diff --git a/ompi/mpi/c/group_compare.c b/ompi/mpi/c/group_compare.c
> index 0d199c1..89c83f9 100644
> --- a/ompi/mpi/c/group_compare.c
> +++ b/ompi/mpi/c/group_compare.c
> @@ -106,6 +106,7 @@ int MPI_Group_compare(MPI_Group group1, MPI_Group
> group2, int *result) {
> } /* end proc2 loop */
> if( match== -1 ) {
> similar=false;
> + identical=false;
> break;
> }
> } /* end proc1 loop */
>
> and a C test program which illustrates it:
>
> #include <mpi.h>
> #include <stdio.h>
>
> int main(int argc,char* argv[])
> {
> MPI_Init(&argc,&argv);
>
> MPI_Group group;
> MPI_Comm_group(MPI_COMM_WORLD, &group);
>
> int r1[2] = {0, 1};
> int r2[2] = {1, 2};
> MPI_Group g1, g2;
> MPI_Group_incl(group, 2, r1, &g1);
> MPI_Group_incl(group, 2, r2, &g2);
>
> int cmp;
> MPI_Group_compare(g1, g2, &cmp);
> printf("compare %d, ident %d\n", cmp, MPI_IDENT);
> assert(cmp != MPI_IDENT);
>
> MPI_Finalize();
> return 0;
> }
>
> A quick glance through the history (thanks git log -pM --follow) seems
> to indicate that MPI_Group_compare hasn't ever worked in OpenMPI, so
> apparently I'm the only user of this function. :)
>
> Geoffrey
> _______________________________________________
> devel mailing list
> devel_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/devel

-- 
Edgar Gabriel
Assistant Professor
Parallel Software Technologies Lab      http://pstl.cs.uh.edu
Department of Computer Science          University of Houston
Philip G. Hoffman Hall, Room 524        Houston, TX-77204, USA
Tel: +1 (713) 743-3857                  Fax: +1 (713) 743-3335