Implemented acIntegrateStepWithOffset

This commit is contained in:
jpekkila
2019-07-04 16:31:16 +03:00
parent a53e0a170d
commit 5049dadc1c

View File

@@ -266,14 +266,19 @@ acIntegrateStep(const int& isubstep, const AcReal& dt)
AcResult AcResult
acIntegrateStepWithOffset(const int& isubstep, const AcReal& dt, const int3& start, const int3& end) acIntegrateStepWithOffset(const int& isubstep, const AcReal& dt, const int3& start, const int3& end)
{ {
/* WARNING("acIntegrateStepWithOffset called. This function has not been tested for correctness!");
// A skeleton function for computing integrations with arbitrary subblocks for (int i = 0; i < num_devices; ++i) {
// Uncommenting the following should work with a single GPU. // DECOMPOSITION OFFSET HERE
const int3 start = (int3){NGHOST, NGHOST, NGHOST}; const int3 d0 = (int3){NGHOST, NGHOST, NGHOST + i * subgrid.n.z};
const int3 end = (int3){NGHOST + subgrid.n.x, NGHOST + subgrid.n.y, const int3 d1 = d0 + (int3){subgrid.n.x, subgrid.n.y, subgrid.n.z};
NGHOST + subgrid.n.z};
*/ const int3 da = max(start, d0);
rkStep(devices[0], STREAM_PRIMARY, isubstep, start, end, dt); const int3 db = min(end, d1);
if (db.z >= da.z) {
rkStep(devices[i], STREAM_PRIMARY, isubstep, da, db, dt);
}
}
return AC_SUCCESS; return AC_SUCCESS;
} }