1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-12-20 04:34:29 +00:00

MPI3 working with a bounce through shared memory on my laptop.

Longer term plan: make the "u_comm_buf" in Stencil point to the shared region and avoid the
send between ranks on same node.
This commit is contained in:
paboyle
2016-10-21 09:03:26 +01:00
parent 5b5925b8e5
commit a762b1fb71
8 changed files with 208 additions and 116 deletions

View File

@@ -31,6 +31,7 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
#ifdef _OPENMP
#define GRID_OMP
#warning "OpenMP"
#endif
#define UNROLL _Pragma("unroll")
@@ -127,6 +128,22 @@ class GridThread {
ThreadBarrier();
};
static void bcopy(const void *src, void *dst, size_t len) {
#ifdef GRID_OMP
#pragma omp parallel
{
const char *c_src =(char *) src;
char *c_dest=(char *) dst;
int me,mywork,myoff;
GridThread::GetWorkBarrier(len,me, mywork,myoff);
bcopy(&c_src[myoff],&c_dest[myoff],mywork);
}
#else
bcopy(src,dst,len);
#endif
}
};
}