- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am trying to use mpi to split computations on n process on a array.
So say process have computed the values for their ranges for eg:
process 1: Array[1 to a1]
process 2: Array[a1+1 to a2]
process 3: Array[a2+1 to a3]
process 4: Array[a3+1 to a4]
What is the best way to send and receive data when it comes to arrays?
Also can the same be applied it the processing of data is in contiguous memory locations? for eg:
process1: Array[1,5,9,13 ...]
process2: Array[2,6,10,14 ...]
process3: Array[3,7,11,15 ...]
process4: Array[4,8,12,16...]
Thanks
Ajay
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The goal being to recieve the all the data computed by each process in the same array by the master contiguously
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ajay,
With the data layouts you have here, if you can keep the data for each rank contiguous, I would recommend using MPI_Scatter and MPI_Gather. If you need the data to remain strided, the use MPI_Scatterv and MPI_Gatherv instead.
Sincerely,
James Tullos
Technical Consulting Engineer
Intel® Cluster Tools

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page