Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] calling a customized MPI_Allreduce with MPI_PACKED datatype
From: Massimo Cafaro (massimo.cafaro_at_[hidden])
Date: 2011-02-06 19:15:23


Jody,

I have finally solved the problem.
I was incorrectly passing 1 as the count argument for MPI_Allreduce, reasoning that I was passing to the reduction one buffer of type MPI_PACKED.
Instead, I need to pass the actual size of the buffer for the reduction to work correctly.

Thank you anyway for your suggestion that, ultimately, led me to discover the bug.
With kind regards,

Massimo
On Feb 7, 2011, at 12:28 AM, Massimo Cafaro wrote:

> hi Jody,
>
> yes, the buffer sizes are actually quite huge with regard to the actual data to be packed.unpacked.
>
> Massimo
>
> On Feb 6, 2011, at 10:44 PM, jody wrote:
>
>> Hi Massimo
>>
>> Just to make sure: usually the MPI_ERR_TUNCATE error is caused by
>> buffer sizes that are too small.
>> Can you verify that the buffers you are using are large enough to
>> hold the data they should receive?
>>
>> Jody
>>
>>
>> On Sat, Feb 5, 2011 at 6:37 PM, Massimo Cafaro
>> <massimo.cafaro_at_[hidden]> wrote:
>>> Dear all,
>>>
>>> in one of my C codes developed using Open MPI v1.4.3 I need to call MPI_Allreduce() passing as sendbuf and recvbuf arguments two MPI_PACKED arrays. The reduction requires my own MPI_User_function that needs to MPI_Unpack() its first and second argument, process them and finally MPI_Pack() the result in the second argument.
>>>
>>> I need to use MPI_Pack/MPI_Unpack because I am not able to create a derived datatype, since many data I need to send are dynamically allocated.
>>> However, the code fails at runtime with the following message:
>>>
>>> An error occurred in MPI_Unpack
>>> on communicator MPI_COMM_WORLD
>>> MPI_ERR_TRUNCATE: message truncated
>>> MPI_ERRORS_ARE_FATAL (your MPI job will now abort)
>>>
>>> I have verified that, after unpacking the data in my own reduction function, all of the data are wrong.
>>> Is this possible in MPI? I did not find anything on the "MPI reference Volume 1" and "Using MPI" that prevents this. This should just require using as datatype MPI_PACKED in MPI_Allreduce() . However, searching on the web I did not find any examples.
>>>
>>> Thank you in advance for any clue/suggestions/source code examples.
>>> This is driving me crazy now ;-(
>>>
>>> Massimo Cafaro
>>>
>>>
>>> -
>>>
>>> *******************************************************************************************************
>>>
>>> Massimo Cafaro, Ph.D. Additional affiliations:
>>> Assistant Professor Euro-Mediterranean Centre for Climate Change
>>> Dept. of Engineering for Innovation SPACI Consortium
>>> University of Salento, Lecce, Italy E-mail massimo.cafaro_at_[hidden]
>>> Via per Monteroni massimo.cafaro_at_[hidden]
>>> 73100 Lecce, Italy cafaro_at_[hidden]
>>> Voice/Fax +39 0832 297371 cafaro_at_[hidden]
>>> Web http://sara.unisalento.it/~cafaro
>>>
>>>
>>> *******************************************************************************************************
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> users mailing list
>>> users_at_[hidden]
>>> http://www.open-mpi.org/mailman/listinfo.cgi/users
>>>
>>
>> _______________________________________________
>> users mailing list
>> users_at_[hidden]
>> http://www.open-mpi.org/mailman/listinfo.cgi/users
>
> -
>
> *******************************************************************************************************
>
> Massimo Cafaro, Ph.D. Additional affiliations:
> Assistant Professor Euro-Mediterranean Centre for Climate Change
> Dept. of Engineering for Innovation SPACI Consortium
> University of Salento, Lecce, Italy E-mail massimo.cafaro_at_[hidden]
> Via per Monteroni massimo.cafaro_at_[hidden]
> 73100 Lecce, Italy cafaro_at_[hidden]
> Voice/Fax +39 0832 297371 cafaro_at_[hidden]
> Web http://sara.unisalento.it/~cafaro
>
>
> *******************************************************************************************************
>
>
>
>
>
> _______________________________________________
> users mailing list
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users

-

*******************************************************************************************************

 Massimo Cafaro, Ph.D. Additional affiliations:
 Assistant Professor Euro-Mediterranean Centre for Climate Change
 Dept. of Engineering for Innovation SPACI Consortium
 University of Salento, Lecce, Italy E-mail massimo.cafaro_at_[hidden]
 Via per Monteroni massimo.cafaro_at_[hidden]
 73100 Lecce, Italy cafaro_at_[hidden]
 Voice/Fax +39 0832 297371 cafaro_at_[hidden]
 Web http://sara.unisalento.it/~cafaro
       

*******************************************************************************************************



  • application/pkcs7-signature attachment: smime.p7s