1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-17 15:27:06 +01:00

PeekLocal needs a view to keep thread safe.

ALLOCATION_CACHEE reenable
This commit is contained in:
Peter Boyle
2020-06-19 17:13:27 -04:00
parent 11bc1aeadc
commit b949cf6b12
11 changed files with 125 additions and 96 deletions

View File

@ -230,14 +230,15 @@ public:
result = source;
int pc = processor_coor[dim];
for(int p=0;p<processors[dim];p++) {
autoView(r_v,result,CpuRead);
autoView(p_v,pgbuf,CpuWrite);
thread_for(idx, sgrid->lSites(),{
Coordinate cbuf(Nd);
sobj s;
sgrid->LocalIndexToLocalCoor(idx,cbuf);
peekLocalSite(s,result,cbuf);
cbuf[dim]+=((pc+p) % processors[dim])*L;
// cbuf[dim]+=p*L;
pokeLocalSite(s,pgbuf,cbuf);
peekLocalSite(s,r_v,cbuf);
acbuf[dim]+=((pc+p) % processors[dim])*L;
pokeLocalSite(s,p_v,cbuf);
});
if (p != processors[dim] - 1) {
result = Cshift(result,dim,L);