I made s simple test, if i assign S[j][i]=temp[2][1][1] for all j, i; it is no problem.
while, when assign S[j][i]=temp[2][3][3] for all j, i, it gives me error. Your last statement means that i should use temp[j][i][k] if i want to sum over k? On Sat, August 27, 2011 4:28 pm, Jed Brown wrote: > On Sat, Aug 27, 2011 at 15:24, Likun Tan <likunt at andrew.cmu.edu> wrote: > > >> g(temp) could be sum of temp[num][j][i] where num from 1 to N, so the >> index k is specified. >> > > It could be, but you still didn't explain how the indices i and j were > made available to g() or what that code looks like. That is almost > certainly your problem. You might want to try running with valgrind. > > Also, this is totally the wrong memory layout for performance (you want > to sum over the last index, unfortunately this requires changing your > interpretation of the x,y,z directions). >
