3

What is the best way (fast and relatively simple to implement) to send gmp of type mpf_t using MPI (in c)? a simple code will be helpful.

thank you

Karthick Kumar
  • 2,349
  • 1
  • 17
  • 30
user8476
  • 33
  • 2
  • possible duplicate of [send array of mpz\_t over mpi](http://stackoverflow.com/questions/5280359/send-array-of-mpz-t-over-mpi) – Hristo Iliev Apr 17 '14 at 12:41
  • @HristoIliev, this is about `mpf_t` (floating) and my question/answer was about `mpz_t` (integer), so no duplicate. Only `mpz_t` type havs export and import. – osgx Apr 17 '14 at 12:44
  • Yes, just saw that GMP does not support exporting and importing floating-point numbers and retracted the vote. – Hristo Iliev Apr 17 '14 at 12:45

1 Answers1

1

mpf_t uses several pointers, so you should serialize mpf_t (and other GMP types) before sending via MPI.

There were some letters about MPI in GMP mailing list: https://gmplib.org/list-archives/gmp-discuss/2008-March/003091.html

There is article about MPI wrapper library for GMP (MPIGMP + MPIBNCpack): http://na-inet.jp/na/bnc/brief_intro_mpibncpack.pdf

Also there were solution of mpf_t serialization into file, you can reuse it to serialize into byte array and send it over MPI: How to serialize the GMP mpf type? (explained in https://gmplib.org/list-archives/gmp-discuss/2007-November/002981.html)

Community
  • 1
  • 1
osgx
  • 90,338
  • 53
  • 357
  • 513