changed MPI_Gatherv to MPI_Gather

git-svn-id: svn://anubis/gvsu@306 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
josh 2008-12-01 00:27:26 +00:00
parent 266af54f7b
commit 3adce996f0

View File

@ -108,9 +108,16 @@ int main(int argc, char * argv[])
/* after all processes have evaluated their trees, figure out
* which process discovered the lowest cost tree */
int processes_lowest_costs[world_size];
MPI_Gather(&lowest_cost, 1, MPI_INT,
&processes_lowest_costs[0], world_size, MPI_INT,
0, MPI_COMM_WORLD);
int recvcnts[world_size];
int displs[world_size];
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;
if (my_rank == 0)
{