0
votes

I'm stuck with the approach on dividing multiple files to multiple nodes using MPI.

Approach1
Let say, I've 5 files and 5 nodes and all the files are present on one node. Now, is there any way that I'll guide the node to read the file I want without even sending or receiving any data?
For Instance,
File1 -> read by node1(this node has all the data)
File2-> read by node2
File3-> read by node3
File4-> read by node4
File5-> read by node5
(Node2, 3, 4,5 reading data from node1)

Approach2
My alternate approach is to read all the files on node1 and then start sending data to node2, 3, 4, and 5.

Please let me know if there are any other good approaches that I should follow.
Thanks in advance.

1

1 Answers

1
votes

both are possible and it depends on what you need. Without knowing to much information on what your trying to do, the question you need to ask yourself is will all the files fit in memory on one node? if yes it might make sense to use approach 2, if you can't fit all the data in memory on a single node then use approach 1.

Approach 1 would look something like

if(rank == 1){
//load file1 
}