Introduce a new array MPGrav_travel(i) which will travel through the array picking up the symmetrically generated terms
|
First in each processor, initialize both MPGrav(i) and MPGrav_travel(i) to zero
|
Now we as before have a an outer loop over j which in practice will be blocked into J items for message size issues
-
This time communicate in block Xuse(j) M(j) and MPGrav_travel(j)
|
Now loop over each i in each processor and have some flag to decide whether or not Fi,j is to be calculated in Home of i or Home of j
|
if( Fi,j is to be computed in home of i) Then
|
find Fi,j and use it to increment MPGrav(i) with Fi,j and
|
Increment MPGrav_travel(j) with Fj,i = - Fi,j
|