changed MPI_Gatherv to MPI_Gather
git-svn-id: svn://anubis/gvsu@306 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
parent
266af54f7b
commit
3adce996f0
@ -108,9 +108,16 @@ int main(int argc, char * argv[])
|
|||||||
/* after all processes have evaluated their trees, figure out
|
/* after all processes have evaluated their trees, figure out
|
||||||
* which process discovered the lowest cost tree */
|
* which process discovered the lowest cost tree */
|
||||||
int processes_lowest_costs[world_size];
|
int processes_lowest_costs[world_size];
|
||||||
MPI_Gather(&lowest_cost, 1, MPI_INT,
|
int recvcnts[world_size];
|
||||||
&processes_lowest_costs[0], world_size, MPI_INT,
|
int displs[world_size];
|
||||||
0, MPI_COMM_WORLD);
|
for (int i = 0; i < world_size; i++)
|
||||||
|
{
|
||||||
|
recvcnts[i] = 1;
|
||||||
|
displs[i] = i;
|
||||||
|
}
|
||||||
|
MPI_Gatherv(&lowest_cost, 1, MPI_INT,
|
||||||
|
&processes_lowest_costs[0], &recvcnts[0], &displs[0],
|
||||||
|
MPI_INT, 0, MPI_COMM_WORLD);
|
||||||
int min_process = 0;
|
int min_process = 0;
|
||||||
if (my_rank == 0)
|
if (my_rank == 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user