Scott Bucholtz linuxman at
Sat Dec 12 15:53:09 CET 2009

It requires a little more work then just sending the Lib-GMP variables 
directly over MPI.  You have to:
 	1) determine the length of the Lib-GMP variable in the desired 
base (e.g., mpz_sizeinbase); plus 1
 	2) send #1 as an MPI_UNSIGNED_LONG
 	3) convert the Lib-GMP variable in its base to a string (e.g., 
 	4) allocate a new string of that size on the other side (realloc)
 	5) send the string from #3 as an MPI_CHAR
 	6) convert the string at the other end to a Lib-GMP variable 
(e.g., mpz_set_str)
 	7) clean up (i.e., free string memory)

Hope this helps.

Scott Bucholtz

On Fri, 11 Dec 2009, selcukkeskin at wrote:

> i'm sorry. i didn't write library. i'm using gmp primitives embedded in it
> best wishes
> --------------------------------------------------
> From: "Allan Menezes" <amenezes007 at>
> Sent: Friday, December 11, 2009 10:53 PM
> To: <selcukkeskin at>
> Cc: <gmp-discuss at>
> Subject: Re: MPI and GMP
>> selcukkeskin at wrote:
>>> Hi,
>>> I'm working on MPI with GMP. It works perfectly but i can't send gmp 
>>> variables like mpz_t, mpf_t
>>> -------------------------------------------------------
>>> Selçuk Keskin
>>> Ege University
>>> The feasibility of Mathematics in Computer
>>> _______________________________________________
>>> gmp-discuss mailing list
>>> gmp-discuss at
>> Hi Selcuk,
>>   Are you emedding MPI in GMP functions at a higher level to create a new 
>> gmp library with mpi?or just writing an mpi program in C/C++ with gmp 
>> primitives embedded in it and compiled like this
>> mpicc -o foo -m64 -lgmp -lm foo.c? If you are writing a library are you 
>> going to LGPL it and submit it to the gmplib website?
>> Thank you very much for your response,
>> Best wishes,
>> Allan MeneZes
> _______________________________________________
> gmp-discuss mailing list
> gmp-discuss at

More information about the gmp-discuss mailing list