通过 mpi 发送 mpz_t 数组
我使用 libgmp (GMP) 来处理非常长的整数,存储为 mpz_t : http://gmplib.org/manual/Integer-Internals.html#Integer-Internals
mpz_t
变量在动态分配和重新分配的空间中使用符号和大小表示整数。
所以我认为 mpz_t 就像指针。
如何通过 MPI 发送包含数据的 mpz_t
变量数组?
I use a libgmp (GMP) to work with very long integers, stored as mpz_t
: http://gmplib.org/manual/Integer-Internals.html#Integer-Internals
mpz_t
variables represent integers using sign and magnitude, in space dynamically allocated and reallocated.
So I think mpz_t
is like pointer.
How can I send an array of mpz_t
variables with data over MPI?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
mpz_import()
和mpz_export()
在mpz_t
和char
数组之间进行转换,然后您可以通过 MPI 发送/接收这些数组。请注意正确设置与字节顺序等相关的参数。Use
mpz_import()
andmpz_export()
to convert betweenmpz_t
and e.g.char
arrays, which you can then send/receive over MPI. Be careful with getting the parameters related to endianness etc. right.这是代码:
Here is the code: