David Mathog wrote:
For the receive I do not see how to use a collective. Each worker sends back a data structure, and the structures are of of varying size. This is almost always the case in Bioinformatics, where what is usually coming back from each worker is a count M of the number of significant results, M x (fixed size data per result: scores and the like), and M x sequences or sequence alignments. M runs from 0 to Z, where in pathological cases, Z is a very large number, and the size of the sequences or alignments returned also varies.
A collective call might not make sense in this case.
Arguably, each process could first send a size message (how much stuff is coming) and then the actual data. In this case, you could do an MPI_Gather, master could allocate space, and then you do an MPI_Gatherv.
But it may make more sense for you to stick to your point-to-point implementation. It may allow the master to operate with a smaller footprint and it may allow first finishers to send their results back earlier without everyone waiting for laggards.