GNU GMP and MPI
juneco at quartz.ocn.ne.jp
Fri Mar 21 12:58:58 CET 2008
On 2008/03/20, at 22:33, Mitesh Gupta wrote:
> Kindly help me in how can i send mpf_t over MPI Send and also how
> to receive it.
The struct of GMP''s mpf_t is constructed to be separated mantissa
and other parts (exponent, sign and precision). So, it is necessary
to pack them before you'll use mpi_send.
I wish that such "packing" functions are officially supported in GMP
There are two ways I've already known.
1. convert mpf_t's bits to text string by using mpf_get_str function.
2. use memcpy to pack like "pack_mpf" function in my BNCpack ->
Sample source is http://na-inet.jp/tutorial/03/mpi-sr-gmp.c. If you
want to use pure gmp without mpfr, you delete lines of "#define
USE_MPFR" and "#include "mpfr.h" and then compile it.
I hope you'll success to mpi_send with gmp.
More information about the gmp-discuss