How does MPI_Reduce with MPI_MIN work?
<p>if I have this code:</p>

<pre><code>int main(void) {
    int result=0;
    int num[6] = {1, 2, 4, 3, 7, 1};
    if (my_rank != 0) {
        MPI_Reduce(num, &amp;result, 6, MPI_INT, MPI_MIN, 0, MPI_COMM_WORLD);
    } else {
        MPI_Reduce(num, &amp;result, 6, MPI_INT, MPI_MIN, 0, MPI_COMM_WORLD)
        printf("result = %d\n", result);
    }
}
</code></pre>

<p>the result print is 1 ;</p>

<p>But if the <code>num[0]=9</code>; then the result is <code>9</code></p>

<p>I read to solve this problem I must to define the variable <code>num</code> as array. 
I can't understand how the function <code>MPI_Reduce</code> works with <code>MPI_MIN</code>. Why, if the <code>num[0]</code> is not equal to the smallest number, then I must to define the variable <code>num</code> as array?</p>