Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |  

This web mail archive is frozen.

This page is part of a frozen web archive of this mailing list.

You can still navigate around this archive, but know that no new mails have been added to it since July of 2016.

Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.

Subject: Re: [OMPI devel] Bug report: single processor MPI_Allgatherv
From: George Bosilca (bosilca_at_[hidden])
Date: 2008-01-19 00:31:45


Daniel,

Thanks for the fix. It is indeed the right solution. I'll make sure it
gets into the trunk asap.

   Thanks,
     george.

On Jan 18, 2008, at 4:57 PM, Daniel G. Hyams wrote:

> Sorry to reply to my own mail, but the bug only affects
> MPI_Allgatherv.
> In this changeset:
>
> https://svn.open-mpi.org/trac/ompi/changeset/16360
>
>
> In coll_self_allgatherv.c, the "extent" variable is never used. So
> the
> fix is just to multiply
> "extent" by disps[0], on line 50. I've verified that this fixes the
> problem.
>
>
>
> Daniel G. Hyams wrote:
>> I don't think that the displacements (disps) are being handled
>> correctly
>> in MPI_Allgatherv, for a single process case.
>> The disps are being handled as byte offsets, instead of 'item'
>> offsets...they need to be multiplied by the size, in bytes,
>> of the MPI_Datatype being sent.
>>
>> This bug seems to be closely related this:
>> https://svn.open-mpi.org/trac/ompi/changeset/16360
>> and probably is present in all of the routines listed there.
>>
>> The following code demonstrates the problem; make sure you run it
>> as one
>> process only. The input and output should
>> be the same, but that is not the case.
>>
>> ==================================================
>>
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <mpi.h>
>>
>> void tcalloc(int **p,int n)
>> {
>> *p = (int*)calloc(n,sizeof(int));
>> }
>>
>>
>> int main(int argc, char * argv[])
>> {
>> int i;
>> int nto_global = 0;
>> int np = 1;
>> int *propto_global = NULL;
>> int *propto = NULL;
>> int nto = 10;
>> int counts[1];
>> int displs[1];
>>
>> MPI_Init(&argc,&argv);
>>
>> tcalloc(&propto,nto+1);
>>
>> for (i = 1; i <= nto; i++) propto[i] = i;
>>
>> counts[0] = nto;
>> displs[0] = 1;
>>
>> // BUG: if I set displs[0] above to 4, things work as expected.
>> But,
>> the displacements
>> // are supposed to be the number of items, not bytes.
>>
>> for (i = 0; i < np; i++)
>> {
>> nto_global += counts[i];
>> }
>>
>>
>> tcalloc(&propto_global, nto_global+1);
>>
>> for (i = 1; i <= nto; i++) printf("INPUT %d --> %d\n",i,propto[i]);
>>
>> MPI_Allgatherv(propto+1,
>> nto,
>> MPI_INT,
>> propto_global,
>> counts,
>> displs,
>> MPI_INT,
>> MPI_COMM_WORLD);
>>
>> for (i = 1; i <= nto_global; i++) printf("OUTPUT %d -->
>> %d\n",i,propto_global[i]);
>>
>> free(propto_global);
>> free(propto);
>>
>> return(0);
>> }
>>
>>
>>
>>
>
>
> --
> =========================================================
> Daniel G. Hyams
> Associate Research Professor
> UT SimCenter at Chattanooga
> Email: Daniel-Hyams_at_[hidden]
> Phone: 423-425-5491
> Fax: 423-425-5517
> =========================================================
>
> _______________________________________________
> devel mailing list
> devel_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/devel



  • application/pkcs7-signature attachment: smime.p7s