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

Update to v0.5.0 #78

Merged
merged 77 commits into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
3db86b6
Update OCCA
noelchalmers Mar 12, 2022
fe568e5
Remove gslib
noelchalmers Mar 12, 2022
d41f047
Upgrade to newest ogs
noelchalmers Mar 12, 2022
72983ba
Add new comm_t object
noelchalmers Mar 12, 2022
4515afb
Add new memory objects
noelchalmers Mar 12, 2022
5898ed1
Add new timers
noelchalmers Mar 12, 2022
28fd90b
Move matrix routines into linAlg
noelchalmers Mar 12, 2022
71e61e5
Rename file
noelchalmers Mar 13, 2022
d7847f2
[Core] Update core lib
noelchalmers Mar 14, 2022
dd776b7
[LinAlg] Update linAlg lib
noelchalmers Mar 14, 2022
67a604c
[LinAlg] Rename some source files
noelchalmers Mar 14, 2022
4c45c96
[Core] Remove ambiguous scan overload
noelchalmers Mar 14, 2022
3297faa
[OCCA] Update to latest OCCA
noelchalmers Apr 26, 2022
228a47e
[Mesh] Move some mesh files
noelchalmers Apr 26, 2022
4c01601
[ParAdogs] Add parAdogs mesh partitioner
noelchalmers Apr 26, 2022
e655d09
[Mesh] Update mesh library
noelchalmers Apr 26, 2022
20c0cb3
[Core] Updates to core library
noelchalmers Apr 26, 2022
e8909c6
[LinAlg] Update linear algebra library
noelchalmers Apr 26, 2022
5c5f1e9
[TimeStepper] Update timeStepper library
noelchalmers Apr 26, 2022
7ffad49
[LinearSolver] Update linearSolver library
noelchalmers Apr 26, 2022
d7bc53a
[ParAlmond] Update parAlmond library
noelchalmers Apr 26, 2022
1941aa8
[Make] Makefile updates
noelchalmers Apr 26, 2022
543b116
[Advection] Update advection solver
noelchalmers Apr 26, 2022
037fdc4
[Acoustics] Update acoustics solver
noelchalmers Apr 26, 2022
cc5564c
[Gradient] Update gradient solver
noelchalmers Apr 26, 2022
08055cf
[Elliptic] Update elliptic solver
noelchalmers Apr 26, 2022
5d2c98b
[CNS] Update compressible navier stokes solver
noelchalmers Apr 26, 2022
8329841
[Test] Some test tweaks
noelchalmers Apr 26, 2022
715ea71
[LBS] Update DG Lattice Boltzmann solver
noelchalmers Apr 27, 2022
dfe568f
[LBS] Makefile tweak
noelchalmers Apr 27, 2022
231ba66
[BNS] Update Galerkin Boltzmann Navier-Stokes solver
noelchalmers Apr 27, 2022
76930d6
[FPE] Update Fokker-Planck solver
noelchalmers Apr 27, 2022
ebc1f2f
[INS] Update incompressible Navier-Stokes solver
noelchalmers Apr 28, 2022
326487c
[LinAlg] LinAlg fixes
noelchalmers Apr 28, 2022
cc2c959
[InitialGuess] FIxes in initial guess strategies
noelchalmers Apr 28, 2022
6e5234f
[Mesh] Initialize mapB to -1
noelchalmers Apr 28, 2022
1f9320b
[Mesh] mapB in mesh_t class
noelchalmers Apr 28, 2022
1f4147b
[Mesh] Bug fix in cubature setup
noelchalmers Apr 28, 2022
85b9a36
[Mesh] Bugifx in multirate setup
noelchalmers Apr 28, 2022
60a0b9f
[ParAlmond] Switch to shared_ptr to address mem leak
noelchalmers Apr 28, 2022
c072c59
[Test] Tweak one golden norm
noelchalmers Apr 28, 2022
3977517
[Test] Add ParAdogs tests
noelchalmers Apr 28, 2022
0415c68
[Solvers] Switch to strings for filenames and kernelname to avoid mem…
noelchalmers Apr 28, 2022
afdbb28
Version bump
noelchalmers Apr 28, 2022
e65f784
Merge branch 'master' of github.com:paranumal/libparanumal into staging
noelchalmers Apr 28, 2022
0c882da
Happy New Year
noelchalmers Apr 29, 2022
9139524
Need some manual barriers
noelchalmers Apr 29, 2022
2c21ada
[Solvers] Trigger ogs kernel builds during setups
noelchalmers Apr 29, 2022
6658636
[Git] Ignore rc files made by tests
noelchalmers May 1, 2022
1e1a4d3
[Make] Fix default openblas-serial lib path
noelchalmers May 1, 2022
3e15c25
[Git] Use openblas-serial in git workflow
noelchalmers May 1, 2022
febc58b
[Comm] Move some things out of the comm_t class, and into a namespace
noelchalmers May 1, 2022
8b4b759
[Mesh] Make the element type an enum
noelchalmers May 1, 2022
1502f87
[Make] Missing code coverage flags
noelchalmers May 1, 2022
d077084
[OGS] Add some more explicit instantiations to workaround issue in ol…
noelchalmers May 1, 2022
078a21c
[Timer] Can't use a the plaform's comm at the end of ogsSetup. Adding…
noelchalmers May 2, 2022
f9f3915
Update README.md
noelchalmers May 3, 2022
ef8555e
Add code diagram
noelchalmers May 5, 2022
341fd70
Merge branch 'staging' of github.com:paranumal/libparanumal into staging
noelchalmers May 5, 2022
86f0318
Update README.md
noelchalmers May 5, 2022
2be74fb
[LinearSolver] Bugfix for uninitialized memory
noelchalmers May 14, 2022
e0b3174
[Libs][Solvers] Small fixes for building in FP32 mode
noelchalmers May 14, 2022
7464423
[Core] Remove repeated compiler flags
noelchalmers May 14, 2022
8f36675
[Core] Workaround for occa dtypes being empty for user-types
noelchalmers May 14, 2022
8dbf988
Merge branch 'staging' of github.com:paranumal/libparanumal into staging
noelchalmers May 14, 2022
5152215
[ParAdogs] Reduce a termination tolerance when in FP32 mode
noelchalmers May 18, 2022
e4b42f0
[ParAdogs] Typo
noelchalmers May 18, 2022
c5b7b14
[OCCA] Switch to OCCA dev branch
noelchalmers May 20, 2022
10ec480
[Core] Add a check to not exceed the max thread count OpenMP reports
noelchalmers May 20, 2022
2f995eb
[OGS] Add some restricts to pointers for host operators
noelchalmers May 20, 2022
abaee13
[OCCA] Fix properties syntax
noelchalmers May 20, 2022
c5a56b8
[OGS] Add special code paths for scalar ogs ops
noelchalmers May 26, 2022
facc0f5
Add some notes on CPU binding to the README
noelchalmers May 26, 2022
672b275
[Acoustics] Hide more comm time with the surface kernel
noelchalmers May 26, 2022
ea5adeb
[OGS] Fix final row block entry being too large
noelchalmers May 31, 2022
f72e8de
Merge branch 'staging' of github.com:paranumal/libparanumal into staging
noelchalmers May 31, 2022
9068ad0
[OCCA] Update to OCCA v1.3
noelchalmers Jun 2, 2022
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
[Elliptic] Update elliptic solver
  • Loading branch information
noelchalmers committed Apr 26, 2022
commit 08055cfc8238a6d6cd4a888f24e9f49b63ab4c27
112 changes: 58 additions & 54 deletions solvers/elliptic/elliptic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,23 @@ SOFTWARE.

#define DELLIPTIC LIBP_DIR"/solvers/elliptic/"

using namespace libp;

class ellipticSettings_t: public settings_t {
public:
ellipticSettings_t(const MPI_Comm& _comm);
ellipticSettings_t(const comm_t& _comm);
void report();
void parseFromFile(platformSettings_t& platformSettings,
meshSettings_t& meshSettings,
const string filename);
const std::string filename);
};
void ellipticAddRunSettings(settings_t& settings);
void ellipticAddSettings(settings_t& settings,
const string prefix="");
const std::string prefix="");

class elliptic_t: public solver_t {
public:
mesh_t &mesh;
linAlg_t &linAlg;
mesh_t mesh;

dlong Ndofs, Nhalo;
int Nfields;
Expand All @@ -63,66 +64,69 @@ class elliptic_t: public solver_t {

int disc_ipdg, disc_c0;

occa::memory o_AqL;
deviceMemory<dfloat> o_AqL;

halo_t* traceHalo;
ogs::halo_t traceHalo;

precon_t* precon;
precon_t precon;

dfloat *grad;
occa::memory o_grad;
memory<dfloat> grad;
deviceMemory<dfloat> o_grad;

dfloat *weight, *weightG;
occa::memory o_weight, o_weightG;
memory<dfloat> weight, weightG;
deviceMemory<dfloat> o_weight, o_weightG;

//C0-FEM mask data
ogs_t *ogsMasked;
int *mapB; // boundary flag of face nodes
ogs::ogs_t ogsMasked;
ogs::halo_t gHalo;
memory<int> mapB; // boundary flag of face nodes
deviceMemory<int> o_mapB;

dlong Nmasked;
dlong *maskIds;
hlong *maskedGlobalIds;
hlong *maskedGlobalNumbering;
memory<dlong> maskIds;
memory<hlong> maskedGlobalIds;
memory<hlong> maskedGlobalNumbering;
memory<dlong> GlobalToLocal;

occa::memory o_maskIds;
occa::memory o_mapB;
deviceMemory<dlong> o_maskIds;
deviceMemory<dlong> o_GlobalToLocal;

int *BCType;
int *EToB;
occa::memory o_EToB;
int NBCTypes;
memory<int> BCType;
memory<int> EToB;
deviceMemory<int> o_EToB;

int allNeumann;
dfloat allNeumannPenalty;
dfloat allNeumannScale;

occa::kernel maskKernel;
occa::kernel partialAxKernel;
occa::kernel partialGradientKernel;
occa::kernel partialIpdgKernel;
kernel_t maskKernel;
kernel_t partialAxKernel;
kernel_t partialGradientKernel;
kernel_t partialIpdgKernel;

elliptic_t() = delete;
elliptic_t() = default;
elliptic_t(platform_t &_platform, mesh_t &_mesh,
settings_t& _settings, dfloat _lambda):
solver_t(_platform, _settings), mesh(_mesh),
linAlg(_platform.linAlg), lambda(_lambda) {}

~elliptic_t();
settings_t& _settings, dfloat _lambda,
const int _NBCTypes, const memory<int> _BCType) {
Setup(_platform, _mesh, _settings, _lambda, _NBCTypes, _BCType);
}

//setup
static elliptic_t& Setup(platform_t& platform, mesh_t& mesh,
ellipticSettings_t& settings, dfloat lambda,
const int NBCTypes, const int *BCType);
void Setup(platform_t& _platform, mesh_t& _mesh,
settings_t& _settings, dfloat _lambda,
const int _NBCTypes, const memory<int> _BCType);

void BoundarySetup();

void Run();

int Solve(linearSolver_t& linearSolver, occa::memory &o_x, occa::memory &o_r,
int Solve(linearSolver_t& linearSolver, deviceMemory<dfloat> &o_x, deviceMemory<dfloat> &o_r,
const dfloat tol, const int MAXIT, const int verbose);

void PlotFields(dfloat* Q, char *fileName);
void PlotFields(memory<dfloat>& Q, std::string fileName);

void Operator(occa::memory& o_q, occa::memory& o_Aq);
void Operator(deviceMemory<dfloat>& o_q, deviceMemory<dfloat>& o_Aq);

void BuildOperatorMatrixIpdg(parAlmond::parCOO& A);
void BuildOperatorMatrixContinuous(parAlmond::parCOO& A);
Expand All @@ -141,27 +145,27 @@ class elliptic_t: public solver_t {
void BuildOperatorMatrixIpdgTet3D(parAlmond::parCOO& A);
void BuildOperatorMatrixIpdgHex3D(parAlmond::parCOO& A);

void BuildOperatorDiagonal(dfloat *diagA);
void BuildOperatorDiagonal(memory<dfloat>& diagA);

void BuildOperatorDiagonalContinuousTri2D(dfloat *diagA);
void BuildOperatorDiagonalContinuousTri3D(dfloat *diagA);
void BuildOperatorDiagonalContinuousQuad2D(dfloat *diagA);
void BuildOperatorDiagonalContinuousQuad3D(dfloat *diagA);
void BuildOperatorDiagonalContinuousTet3D(dfloat *diagA);
void BuildOperatorDiagonalContinuousHex3D(dfloat *diagA);
void BuildOperatorDiagonalContinuousTri2D(memory<dfloat>& diagA);
void BuildOperatorDiagonalContinuousTri3D(memory<dfloat>& diagA);
void BuildOperatorDiagonalContinuousQuad2D(memory<dfloat>& diagA);
void BuildOperatorDiagonalContinuousQuad3D(memory<dfloat>& diagA);
void BuildOperatorDiagonalContinuousTet3D(memory<dfloat>& diagA);
void BuildOperatorDiagonalContinuousHex3D(memory<dfloat>& diagA);

void BuildOperatorDiagonalIpdgTri2D(dfloat *diagA);
void BuildOperatorDiagonalIpdgTri3D(dfloat *diagA);
void BuildOperatorDiagonalIpdgQuad2D(dfloat *diagA);
void BuildOperatorDiagonalIpdgQuad3D(dfloat *diagA);
void BuildOperatorDiagonalIpdgTet3D(dfloat *diagA);
void BuildOperatorDiagonalIpdgHex3D(dfloat *diagA);
void BuildOperatorDiagonalIpdgTri2D(memory<dfloat>& diagA);
void BuildOperatorDiagonalIpdgTri3D(memory<dfloat>& diagA);
void BuildOperatorDiagonalIpdgQuad2D(memory<dfloat>& diagA);
void BuildOperatorDiagonalIpdgQuad3D(memory<dfloat>& diagA);
void BuildOperatorDiagonalIpdgTet3D(memory<dfloat>& diagA);
void BuildOperatorDiagonalIpdgHex3D(memory<dfloat>& diagA);

elliptic_t& SetupNewDegree(mesh_t& meshF);
elliptic_t SetupNewDegree(mesh_t& meshF);

elliptic_t* SetupRingPatch(mesh_t& meshPatch);
elliptic_t SetupRingPatch(mesh_t& meshPatch);

void ZeroMean(occa::memory &o_q);
void ZeroMean(deviceMemory<dfloat> &o_q);
};


Expand Down
64 changes: 34 additions & 30 deletions solvers/elliptic/ellipticMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,48 +29,52 @@ SOFTWARE.
int main(int argc, char **argv){

// start up MPI
MPI_Init(&argc, &argv);
comm_t::Init(argc, argv);

MPI_Comm comm = MPI_COMM_WORLD;
LIBP_ABORT("Usage: ./ellipticMain setupfile", argc!=2);

if(argc!=2)
LIBP_ABORT(string("Usage: ./ellipticMain setupfile"));
{ /*Scope so everything is destructed before MPI_Finalize */
comm_t comm(comm_t::world().Dup());

//create default settings
platformSettings_t platformSettings(comm);
meshSettings_t meshSettings(comm);
ellipticSettings_t ellipticSettings(comm);
ellipticAddRunSettings(ellipticSettings);
//create default settings
platformSettings_t platformSettings(comm);
meshSettings_t meshSettings(comm);
ellipticSettings_t ellipticSettings(comm);
ellipticAddRunSettings(ellipticSettings);

//load settings from file
ellipticSettings.parseFromFile(platformSettings, meshSettings,
argv[1]);
//load settings from file
ellipticSettings.parseFromFile(platformSettings, meshSettings,
argv[1]);

// set up platform
platform_t platform(platformSettings);
// set up platform
platform_t platform(platformSettings);

platformSettings.report();
meshSettings.report();
ellipticSettings.report();
platformSettings.report();
meshSettings.report();
ellipticSettings.report();

// set up mesh
mesh_t& mesh = mesh_t::Setup(platform, meshSettings, comm);
// set up mesh
mesh_t mesh(platform, meshSettings, comm);

dfloat lambda = 0.0;
ellipticSettings.getSetting("LAMBDA", lambda);
dfloat lambda = 0.0;
ellipticSettings.getSetting("LAMBDA", lambda);

// Boundary Type translation. Just defaults.
int NBCTypes = 3;
int BCType[NBCTypes] = {0,1,2};
// Boundary Type translation. Just defaults.
int NBCTypes = 3;
memory<int> BCType(3);
BCType[0] = 0;
BCType[1] = 1;
BCType[2] = 2;

// set up elliptic solver
elliptic_t& elliptic = elliptic_t::Setup(platform, mesh, ellipticSettings,
lambda, NBCTypes, BCType);
// set up elliptic solver
elliptic_t elliptic(platform, mesh, ellipticSettings,
lambda, NBCTypes, BCType);

// run
elliptic.Run();
// run
elliptic.Run();
}

// close down MPI
MPI_Finalize();
comm_t::Finalize();
return LIBP_SUCCESS;
}
Loading