1 | Case when i compared to i is not needed as particles dont interact with themselves |
2 | At step k, interact particle i with particle j= 1 + mod((i+k-1),N) |
3 | Accumulate force on i due to j in fixed Ai |
4 | Accumulate negative of this as force on j due to i in circulating Acj |
5 | At the end of the algorithm, add Ai and Aci |
6 | In parallel version, Note that Ai will be calculated in "home processor for particle i but Aci will travel around the machine being accumulated in processor holding particle j |
7 | Thus this violates the owner computes rule and so this parallel algorithm must be implemented by hand -- the compiler will not find it automatically |