Syntax of passing an array by reference to an mpi function

Viewed 21

What is the difference between

MPI_Reduce(&local_array, &global_array, data_size_count, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);

and

MPI_Reduce(&local_array[0], &global_array[0], data_size_count, MPI_DOUBLE, MPI_SUM, 0, MPI_COMM_WORLD);

? What is this syntax of &array[0] instead of &array and what does something like &array[10] mean ?

I am asking this because the first code gives me a segmentation fault but the other one does not.

0 Answers
Related