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

Bring A100 fix to the new boundary to better test on HPC. this should be descarde if it fails but may be pulled to Dev branch if successfull. #109

Merged
merged 10 commits into from
Jun 17, 2024
9 changes: 9 additions & 0 deletions src/Arrays.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ struct AdvanceP
};


struct outP
{
float* z;
short* z_s;
int level;
double xmin, xmax, ymin, ymax;
};


struct maskinfo
{

Expand Down
3 changes: 3 additions & 0 deletions src/Param.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ class Param {
std::string reftime = ""; // Reference time string as yyyy-mm-ddTHH:MM:SS
std::string crs_ref = "no_crs"; //"PROJCS[\"NZGD2000 / New Zealand Transverse Mercator 2000\",GEOGCS[\"NZGD2000\",DATUM[\"New_Zealand_Geodetic_Datum_2000\",SPHEROID[\"GRS 1980\",6378137,298.257222101]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4167\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",0],PARAMETER[\"central_meridian\",173],PARAMETER[\"scale_factor\",0.9996],PARAMETER[\"false_easting\",1600000],PARAMETER[\"false_northing\",10000000],UNIT[\"metre\",1],AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST],AUTHORITY[\"EPSG\",\"2193\"]]";


bool savebyblk=true;

};


Expand Down
2 changes: 1 addition & 1 deletion src/Poly.cu
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ Polygon CounterCWPoly(Polygon Poly)
if (sum > 0.0)
{
log(" Reversing Polygon handedness");
for (int i = Poly.vertices.size(); i > 0; i--)
for (int i = Poly.vertices.size()-1; i > 0; i--)
{
//

Expand Down
7 changes: 7 additions & 0 deletions src/ReadInput.cu
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,13 @@ Param readparamstr(std::string line, Param param)
param.crs_ref = parametervalue;
}

paramvec = { "savebyblk", "writebyblk","saveperblk", "writeperblk","savebyblock", "writebyblock","saveperblock", "writeperblock" };
parametervalue = findparameter(paramvec, line);
if (!parametervalue.empty())
{
param.savebyblk = readparambool(parametervalue, param.savebyblk);
}

return param;
}

Expand Down
18 changes: 10 additions & 8 deletions src/Updateforcing.cu
Original file line number Diff line number Diff line change
Expand Up @@ -746,11 +746,11 @@ template <class T> void deformstep(Param XParam, Loop<T> XLoop, std::vector<defo

if (XParam.GPUDEVICE < 0)
{
AddDeformCPU(XParam, XModel.blocks, deform[nd], scale, XModel.evolv.zs, XModel.zb);
AddDeformCPU(XParam, XModel.blocks, deform[nd], XModel.evolv, scale, XModel.zb);
}
else
{
AddDeformGPU <<<gridDim, blockDim, 0 >>> (XParam, XModel.blocks, deform[nd], scale, XModel.evolv.zs, XModel.zb);
AddDeformGPU <<<gridDim, blockDim, 0 >>> (XParam, XModel.blocks, deform[nd], XModel.evolv, scale, XModel.zb);
CUDA_CHECK(cudaDeviceSynchronize());
}

Expand Down Expand Up @@ -779,7 +779,7 @@ template <class T> void deformstep(Param XParam, Loop<T> XLoop, std::vector<defo
}


template <class T> __global__ void AddDeformGPU(Param XParam, BlockP<T> XBlock, deformmap<float> defmap, T scale, T* zs, T* zb)
template <class T> __global__ void AddDeformGPU(Param XParam, BlockP<T> XBlock, deformmap<float> defmap, EvolvingP<T> XEv, T scale, T* zb)
{
unsigned int ix = threadIdx.x;
unsigned int iy = threadIdx.y;
Expand All @@ -801,7 +801,7 @@ template <class T> __global__ void AddDeformGPU(Param XParam, BlockP<T> XBlock,
// printf("x=%f, y=%f, def=%f\n ", x, y, def);
//}

zss = zs[i] + def * scale;
zss = XEv.zs[i] + def * scale;
if (defmap.iscavity == true)
{
zbb = min(zss, zb[i]);
Expand All @@ -811,7 +811,8 @@ template <class T> __global__ void AddDeformGPU(Param XParam, BlockP<T> XBlock,
zbb = zb[i] + def * scale;
}

zs[i] = zss;
XEv.h[i] = zss - zbb;
XEv.zs[i] = zss;
zb[i] = zbb;

//zs[i] = zs[i] + def * scale;
Expand All @@ -821,7 +822,7 @@ template <class T> __global__ void AddDeformGPU(Param XParam, BlockP<T> XBlock,

}

template <class T> __host__ void AddDeformCPU(Param XParam, BlockP<T> XBlock, deformmap<float> defmap, T scale, T* zs, T* zb)
template <class T> __host__ void AddDeformCPU(Param XParam, BlockP<T> XBlock, deformmap<float> defmap, EvolvingP<T> XEv, T scale, T* zb)
{
int ib;

Expand All @@ -846,7 +847,7 @@ template <class T> __host__ void AddDeformCPU(Param XParam, BlockP<T> XBlock, de

def = interp2BUQ(x, y, defmap);

zss = zs[i] + def * scale;
zss = XEv.zs[i] + def * scale;
if (defmap.iscavity == true)
{
zbb = min(zss, zb[i]);
Expand All @@ -856,7 +857,8 @@ template <class T> __host__ void AddDeformCPU(Param XParam, BlockP<T> XBlock, de
zbb = zb[i] + def * scale;
}

zs[i] = zss;
XEv.zs[i] = zss;
XEv.h[i] = zss - zbb;
zb[i] = zbb;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Updateforcing.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ template <class T> __host__ void AddRiverForcing(Param XParam, Loop<T> XLoop, st
template <class T> void deformstep(Param XParam, Loop<T> XLoop, std::vector<deformmap<float>> deform, Model<T> XModel, Model<T> XModel_g);

template <class T> __global__ void InjectRiverGPU(Param XParam, River XRiver, T qnow, int* Riverblks, BlockP<T> XBlock, AdvanceP<T> XAdv);
template <class T> __global__ void AddDeformGPU(Param XParam, BlockP<T> XBlock, deformmap<float> defmap, T scale, T* zs, T* zb);
template <class T> __global__ void AddDeformGPU(Param XParam, BlockP<T> XBlock, deformmap<float> defmap, EvolvingP<T> XEv, T scale, T* zb);


#endif
Loading
Loading