LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Carlos Lopez Nataren (natorro_at_[hidden])
Date: 2003-08-18 21:06:35


Hello, I am trying to do a very simple task but I've tried everything and I can't
seem to find the answer, can anyone please help me???

I have a program which has in every slave process an array like

int points [10];

and at some point I just fill the elements in the array points, I have
a max_value variable:

int max_value;

and then I try to make a Reduce operation like:

MPI_Reduce(&points, &max_value, 10, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD);

and then I ask the process 0 to print the value of max_value like this:

if (rank == 0)
        printf ("maximum value is: %d ", max_value);

and it does nothing, I don't really know why.

Any help will be greatly appreciated
Thanks a lot in advance.

-- 
Carlos Lopez Nataren <natorro_at_[hidden]>
Instituto de Fisica, UNAM