simple MPI example

48 views
Skip to first unread message

ca...@usc.edu

unread,
Oct 6, 2020, 10:52:46 PM10/6/20
to flint-devel
Hi flint-devel,

I would like to pass arblib types such as arb_t, acb_t, arb_mat_t, and acb_mat_t to other nodes in a cluster by openMPI. I am new to MPI and thus far have just learned sending and receiving the pre-defined basic data types in c++. However, I've read that MPI allows for the passing of user-defined types and so I believe I should be able to pass arblib types by knowing their struct definitions and using the MPI user-defined type commands to commit their types. Is this right? If so, where could I find the struct definitions for the arb types?

For the acb, arb_mat, and acb_mat, I expect these are structs of structs. Is it a straightforward business to deals with such nested structs and, if not, is there a way around this? I did find one example on the web, in which this one fellow converted the arb values to character arrays, but this doesn't seem very efficient memory wise since essentially and extra copy of data is created locally to do this.

Does anyone have experience with passing arb types directly with MPI and could share a simple example from which I could learn from or some helpful guiding tips?


Best,
Carlos

Fredrik Johansson

unread,
Oct 7, 2020, 4:05:17 AM10/7/20
to flint-devel
Hi Carlos,

Passing Arb types directly isn't going to work since they contain pointers.

The most robust way to do this is to serialize and deserialize numbers with arb_dump_str and arb_load_str. As you say, this is not very efficient memory wise, but it should get the job done.

Fredrik

--

---
You received this message because you are subscribed to the Google Groups "flint-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flint-devel...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/flint-devel/2d13408a-7f66-4577-8023-6e93ec6cd7f0n%40googlegroups.com.

Carlos Alas

unread,
Oct 7, 2020, 4:57:03 PM10/7/20
to flint...@googlegroups.com
Hi Fredrik,

Ah, I see. Since they have pointers, passing them would be useless because the different nodes do not share the same memory space and so the pointers would become meaningless on the foreign nodes. Okay, I'll just have to serialize/deserialize and be careful to use enough nodes to reduce the local memory on any one node.

Thank you,
Carlos

Reply all
Reply to author
Forward
0 new messages