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

Feature/pfloat working #88

Merged
merged 29 commits into from
Feb 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
57e9994
WIP: starting to build a pfloat version. This first step involves tem…
tcew Jan 11, 2023
9e64c96
WIP: added a pfloat linAlg_t to platform
tcew Jan 11, 2023
b9daa67
WIP: moving templating of linAlg_t to individual operations per NC su…
tcew Jan 11, 2023
b596a54
WIP: getting closer to mixed precision preconditioning
tcew Jan 11, 2023
43f9011
WIP: getting closer. Matched pfloat and dfloat are ok. Different pflo…
tcew Jan 11, 2023
e2fe01d
WIP: pfloat = float with dfloat=double runs for elliptic tri with ran…
tcew Jan 12, 2023
cd1a9b1
WIP: working version for quads, tris, tets, hex
tcew Jan 12, 2023
85adf9f
WIP: fix SEMFEM anterp and interp operators for pfloat
tcew Jan 12, 2023
d1b50fa
WIP: fixed IPDG issue with pfloat
tcew Jan 12, 2023
4d2a9e4
WIP: fixed up precon type conversion for all linearSolvers
tcew Jan 12, 2023
c2d55bf
WIP: found constant issue. Defaults to pfloat=float and dfloat=double.
tcew Jan 12, 2023
b45cade
Simple templating of some derived initialGuess objects fail
tcew Jan 13, 2023
8a2dfe0
WIP: running with templated initialGuess.
tcew Jan 13, 2023
64326ed
WIP: initially promising templated linearSolver and derived classes
tcew Jan 13, 2023
daf9eab
WIP: adding template parameters for ins
tcew Jan 13, 2023
aa63522
WIP: fix fpe instantiation of templated solvers
tcew Jan 13, 2023
e8420dd
WIP: tidy up
tcew Jan 14, 2023
b7db8c4
Clean up some formatting
noelchalmers Jan 20, 2023
ddb470e
[LinAlg] Reduce some code duplication in reductions
noelchalmers Feb 18, 2023
9020f24
Fix a type warning
noelchalmers Feb 18, 2023
06f6237
Extern instantiate the linear solver templates and clean up some memp…
noelchalmers Feb 19, 2023
045c932
Extern instantiate the initialGuessers
noelchalmers Feb 19, 2023
8a12ca7
Remove a comment
noelchalmers Feb 19, 2023
a7ee249
Remove a print statement
noelchalmers Feb 19, 2023
fa97ff8
Avoid checking some defined size for dfloat and pfloat. Still a bit h…
noelchalmers Feb 19, 2023
b4b2da6
Remove print statement
noelchalmers Feb 19, 2023
29169e5
Remove some comments
noelchalmers Feb 19, 2023
0ae820b
Remove a comment
noelchalmers Feb 19, 2023
4120ce9
Fix a missing pfloat buffer
noelchalmers Feb 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP: fix SEMFEM anterp and interp operators for pfloat
  • Loading branch information
tcew committed Jan 12, 2023
commit 85adf9f4fa5a3cfad2c60f1484f4f288da25f1bf
5 changes: 3 additions & 2 deletions include/mesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,9 @@ class mesh_t {
memory<int> FEMEToV;
memory<dfloat> rFEM, sFEM, tFEM;
memory<dfloat> SEMFEMInterp;
deviceMemory<dfloat> o_SEMFEMInterp;
deviceMemory<dfloat> o_SEMFEMAnterp;
memory<dfloat> SEMFEMAnterp;
deviceMemory<pfloat> o_pfloat_SEMFEMInterp;
deviceMemory<pfloat> o_pfloat_SEMFEMAnterp;

kernel_t MassMatrixKernel;

Expand Down
16 changes: 10 additions & 6 deletions solvers/elliptic/src/ellipticPreconSEMFEM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void SEMFEMPrecon::Operator(deviceMemory<pfloat>& o_r, deviceMemory<pfloat>& o_M
elliptic.gHalo.Exchange(o_Mr, 1);
SEMFEMInterpKernel(mesh.Nelements,
elliptic.o_GlobalToLocal,
mesh.o_SEMFEMAnterp,
mesh.o_pfloat_SEMFEMAnterp,
o_Mr, o_rFEM);
FEMogs.Gather(o_GrFEM, o_rFEM, 1, ogs::Add, ogs::Trans);
o_rFEM.free();
Expand All @@ -56,7 +56,7 @@ void SEMFEMPrecon::Operator(deviceMemory<pfloat>& o_r, deviceMemory<pfloat>& o_M
FEMgHalo.Exchange(o_GzFEM, 1);
SEMFEMAnterpKernel(mesh.Nelements,
o_FEMGlobalToLocal,
mesh.o_SEMFEMAnterp,
mesh.o_pfloat_SEMFEMAnterp,
o_GzFEM, o_MrL);
elliptic.ogsMasked.Gather(o_Mr, o_MrL, 1, ogs::Add, ogs::Trans);
o_MrL.free();
Expand Down Expand Up @@ -231,15 +231,17 @@ SEMFEMPrecon::SEMFEMPrecon(elliptic_t& _elliptic):

if (mesh.elementType==Mesh::TRIANGLES) {
// build interp and anterp
memory<pfloat> SEMFEMAnterp(mesh.NpFEM*mesh.Np);
memory<pfloat> pfloat_SEMFEMAnterp(mesh.NpFEM*mesh.Np);
memory<pfloat> pfloat_SEMFEMInterp(mesh.NpFEM*mesh.Np);
for(int n=0;n<mesh.NpFEM;++n){
for(int m=0;m<mesh.Np;++m){
SEMFEMAnterp[n+m*mesh.NpFEM] = mesh.SEMFEMInterp[n*mesh.Np+m];
pfloat_SEMFEMAnterp[n+m*mesh.NpFEM] = mesh.SEMFEMInterp[n*mesh.Np+m];
pfloat_SEMFEMInterp[n+m*mesh.NpFEM] = mesh.SEMFEMInterp[n+m*mesh.NpFEM];
}
}

mesh.o_SEMFEMInterp = elliptic.platform.malloc<pfloat>(mesh.SEMFEMInterp);
mesh.o_SEMFEMAnterp = elliptic.platform.malloc<pfloat>(SEMFEMAnterp);
mesh.o_pfloat_SEMFEMInterp = elliptic.platform.malloc<pfloat>(pfloat_SEMFEMInterp);
mesh.o_pfloat_SEMFEMAnterp = elliptic.platform.malloc<pfloat>(pfloat_SEMFEMAnterp);

//build kernels
properties_t kernelInfo = mesh.props;
Expand All @@ -250,6 +252,8 @@ SEMFEMPrecon::SEMFEMPrecon(elliptic_t& _elliptic):
int NblockV = std::max(256/mesh.NpFEM, 1);
kernelInfo["defines/" "p_NblockV"]= NblockV;

kernelInfo["defines/" "dfloat"]= pfloatString;

SEMFEMInterpKernel = elliptic.platform.buildKernel(DELLIPTIC "/okl/ellipticSEMFEMInterp.okl",
"ellipticSEMFEMInterp", kernelInfo);

Expand Down