-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bringing back the new gradient calculation to the master branch #35
Conversation
There are still some naughty comments in there and a problem of how to restore zb in the halo!
src/ConserveElevation.cu
Outdated
@@ -852,6 +868,8 @@ template <class T> void conserveElevationLeft(Param XParam,int ib, int ibLB, int | |||
// Restriction | |||
ihalo = -1; | |||
ip = XParam.blkwidth - 2; | |||
|
|||
int ii = memloc(XParam, -1, 6, 46); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
src/ConserveElevation.cu
Outdated
@@ -863,6 +881,8 @@ template <class T> void conserveElevationLeft(Param XParam,int ib, int ibLB, int | |||
} | |||
|
|||
} | |||
if (ib == 46) | |||
printf("Restriction1: hii=%f, \n", XEv.h[ii]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debugging stuff remove
src/ConserveElevation.cu
Outdated
@@ -874,7 +894,8 @@ template <class T> void conserveElevationLeft(Param XParam,int ib, int ibLB, int | |||
} | |||
|
|||
} | |||
|
|||
if (ib == 46) | |||
printf("Restriction2: hii=%f, \n", XEv.h[ii]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm
src/ConserveElevation.cu
Outdated
|
||
ProlongationElevation(XParam.halowidth, XParam.blkmemwidth, T(XParam.eps), ib, ibn, ihalo, jhalo, il, jl, ip, jp, XEv.h, XEv.zs, zb); | ||
} | ||
|
||
} | ||
if (ib == 46) | ||
printf("Prolongation: hii=%f, \n", XEv.h[ii]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm
src/Halo.cu
Outdated
@@ -115,6 +115,8 @@ template void fillHaloTopRightGPU<float>(Param XParam, BlockP<float> XBlock, cud | |||
template <class T> void fillHalo(Param XParam, BlockP<T> XBlock, EvolvingP<T> Xev, T*zb) | |||
{ | |||
|
|||
int ii = memloc(XParam, -1, 6, 46); | |||
printf("prehalo: h[ii]=%f, zb[ii]=%f\n", Xev.h[ii], zb[ii]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm
|
||
printf("h[i]=%f; h[ileft]=%f dhdx[i]=%f, dhdx[ileft]=%f, zs[i]=%f, zs[ileft]=%f, dzsdx[i]=%f, dzsdx[ileft]=%f\n", XModel.evolv.h[i], XModel.evolv.h[ileft], XModel.grad.dhdx[i], XModel.grad.dhdx[ileft], XModel.evolv.zs[i], XModel.evolv.zs[ileft], XModel.grad.dzsdx[i], XModel.grad.dzsdx[ileft]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No this serves a debbug purpose in the test!
src/ConserveElevation.cu
Outdated
@@ -7,10 +7,18 @@ template <class T> void conserveElevation(Param XParam, BlockP<T> XBlock, Evolvi | |||
for (int ibl = 0; ibl < XParam.nblk; ibl++) | |||
{ | |||
ib = XBlock.active[ibl]; | |||
|
|||
int ii = memloc(XParam, -1, 5, 46); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm
src/ConserveElevation.cu
Outdated
@@ -852,6 +887,8 @@ template <class T> void conserveElevationLeft(Param XParam,int ib, int ibLB, int | |||
// Restriction | |||
ihalo = -1; | |||
ip = XParam.blkwidth - 2; | |||
|
|||
int ii = memloc(XParam, -1, 5, 46); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm
top = memloc(XParam.halowidth, XParam.blkmemwidth, n, XParam.blkwidth, ib); | ||
bot = memloc(XParam.halowidth, XParam.blkmemwidth, n, -1, ib); | ||
|
||
Xev.zs[left] = zb[left] + Xev.h[left]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this doing anything ifferent than the GPU? Is this function called by anyone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is reason think that the recalculate zs should only apply in teh halo. I will remove to be consistent with GPOU side but this needs to be double checked to reduce computational demand.
|
||
RecalculateZs(XParam, XBlock, Xev, zb); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will lead to different results as the GPU version!
WTF is going on with the Recalculatezs functions where the CPU and GPU version seem to be doing very different things. Is that a debugging left-over mess? Needs double checking before merging.