Skip to content
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

Merged
merged 13 commits into from
Apr 8, 2021

Conversation

CyprienBosserelle
Copy link
Owner

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.

@CyprienBosserelle CyprienBosserelle self-assigned this Apr 6, 2021
@@ -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);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

@@ -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]);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debugging stuff remove

@@ -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]);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm


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]);
Copy link
Owner Author

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]);
Copy link
Owner Author

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]);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm

Copy link
Owner Author

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!

@@ -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);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm

@@ -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);
Copy link
Owner Author

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];
Copy link
Owner Author

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?

Copy link
Owner Author

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);
Copy link
Owner Author

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!

@CyprienBosserelle CyprienBosserelle merged commit be0b913 into master Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant