Very confused about bug...

Very confused about bug...

by Charley Xu -
Number of replies: 1





Hello,

My solution for A9 is to split the domain over the rows of rho: (i.e if I have two processes, process 1 runs the for loop from 1 to 1023, and process 2 runs the for loop from 1024 to 2047)

I am also using MPI_REDUCE at the end to sum up all the partial sums.

However, when debugging, I notice that splitting the for loop like this doesn't work. In the for loop above, a+b != t. Why? Sorry if I'm missing something super obvious sad

In reply to Charley Xu

Re: Very confused about bug...

by Ramses van Zon -
If you look carefully, the first loop covers cases i=1 up to and including i=1022, and the second loop starts at i=1024 up to and including i=2046. So you are missing i=1023.