Dummy implementation of the Grid interface

This commit is contained in:
jpekkila
2019-08-01 18:37:36 +03:00
parent 328b809efe
commit 2b6bf10ae6
6 changed files with 216 additions and 40 deletions

View File

@@ -22,18 +22,6 @@
#include "errchk.h"
#include "math_utils.h" // sum for reductions
#define AC_GEN_STR(X) #X
const char* intparam_names[] = {AC_FOR_BUILTIN_INT_PARAM_TYPES(AC_GEN_STR) //
AC_FOR_USER_INT_PARAM_TYPES(AC_GEN_STR)};
const char* int3param_names[] = {AC_FOR_BUILTIN_INT3_PARAM_TYPES(AC_GEN_STR) //
AC_FOR_USER_INT3_PARAM_TYPES(AC_GEN_STR)};
const char* realparam_names[] = {AC_FOR_BUILTIN_REAL_PARAM_TYPES(AC_GEN_STR) //
AC_FOR_USER_REAL_PARAM_TYPES(AC_GEN_STR)};
const char* real3param_names[] = {AC_FOR_BUILTIN_REAL3_PARAM_TYPES(AC_GEN_STR) //
AC_FOR_USER_REAL3_PARAM_TYPES(AC_GEN_STR)};
const char* vtxbuf_names[] = {AC_FOR_VTXBUF_HANDLES(AC_GEN_STR)};
#undef AC_GEN_STR
static const int MAX_NUM_DEVICES = 32;
static Node node = NULL;
@@ -482,10 +470,7 @@ acNodeIntegrate(const Node node, const AcReal dt)
static AcResult
local_boundcondstep(const Node node, const StreamType stream, const VertexBufferHandle vtxbuf)
{
if (num_devices == 1) {
acDeviceBoundcondStep(devices[0], stream, vtxbuf, (int3){0, 0, 0}, subgrid.m);
}
else {
if (num_devices > 1) {
// Local boundary conditions
for (int i = 0; i < num_devices; ++i) {
const int3 d0 = (int3){0, 0, NGHOST}; // DECOMPOSITION OFFSET HERE
@@ -493,6 +478,9 @@ local_boundcondstep(const Node node, const StreamType stream, const VertexBuffer
acDeviceBoundcondStep(devices[i], stream, vtxbuf, d0, d1);
}
}
else {
acDeviceBoundcondStep(devices[0], stream, vtxbuf, (int3){0, 0, 0}, subgrid.m);
}
return AC_SUCCESS;
}
@@ -532,9 +520,12 @@ acNodePeriodicBoundcondStep(const Node node, const Stream stream,
const VertexBufferHandle vtxbuf_handle)
{
local_boundcondstep(node, stream, vtxbuf_handle);
global_boundcondstep(node, stream, vtxbuf_handle);
acNodeSynchronizeVertexBuffer(node, stream, vtxbuf_handle);
// TODO NOTE GLOBAL BOUNDCONDS NOT DONE HERE IF MORE THAN 1 NODE
global_boundcondstep(node, stream, vtxbuf_handle);
WARNING("Global boundconds should not be done here with multinode");
return AC_SUCCESS;
}