Question

Currently, I have a nice c++ graph algorithm written with custom struct definitions of linked-lists or arrays of linked-lists (I should turn this into a template definition, but it currently is not). This algorithm can easily be distributed, and I would like to test this. However, I do not have much OpenMPI experience other than understanding of some basic MPI examples.

  1. How do I use linked-lists in OpenMPI?
  2. What is the common practise for using linked-lists in MPI? For example, I could transform my linked-lists into arrays when I pass them to other processes and then just convert them back.
  3. Would I need to separately handle each of my linked-list classes? Currently, I have 4 separate linked-list classes. If this is the case I might be better off making a template class definition.

Thanks for the guidance and all the help!

Was it helpful?

Solution

The bare interface basically provides a way to send a contiguous region of memory to other nodes in various ways, but will not traverse your linked list for you in order to do it.

Thus, you need to decide how you want to transmit and receive data based on what makes sense for your algorithm in order to optimize performance. For example, you could send one message per element, or collect many of them and scatter.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top