Skip to content

Commit

Permalink
Small edits and adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
tzanio committed Mar 28, 2020
1 parent 3392821 commit 0827231
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 26 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,3 @@ cache:
- $TRAVIS_BUILD_DIR/../hypre-2.11.2/src/hypre/lib
- $TRAVIS_BUILD_DIR/../hypre-2.11.2/src/hypre/include
- $TRAVIS_BUILD_DIR/../metis-4.0

25 changes: 17 additions & 8 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,29 @@

High-order Lagrangian Hydrodynamics Miniapp

Version 3.0, released on Mar 30, 2020

Version 3.0, released on Mar 27, 2020
=====================================

- Replaced all CUDA, RAJA, OCCA sub-directories with MFEM GPU kernels.
- Replaced the Laghos-2.0 custom implementations in the cuda/, raja/, occa/ and
hip/ directories with direct general device support in the main Laghos sources
based on MFEM-4.1

- With the above change different device backends can be selected at runtime,
including cuda, raja, occa, hip, omp and more. See the -d command-line option.

- Added 'setup' makefile target to download and build TPLs: HYPRE (2.11.2),
Metis (4.0.3) & MFEM (master branch).
- Added 'setup' makefile target to download and build the Laghos dependencies:
HYPRE (2.11.2), METIS (4.0.3) and MFEM (master branch).

- Added 'tests' and 'checks' makefile targets to launch non-regression tests.

- Added default dimension options that generates internally the mesh:
- 1D (-dim 1): data/segment01.mesh
- 2D (-dim 2): data/square01_quad.mesh
- 3D (-dim 3): data/cube01_hex.mesh
- Added default dimension options that generate internally the mesh:
* 1D (-dim 1): data/segment01.mesh
* 2D (-dim 2): data/square01_quad.mesh
* 3D (-dim 3): data/cube01_hex.mesh

- The timing/ directory was deprecated. Use the scripts in the CEED benchmarks
instead, https://github.com/CEED/benchmarks.


Version 2.0, released on Nov 19, 2018
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ necessary operations. As the local action is defined by utilizing the tensor
structure of the finite element spaces, the amount of data storage, memory
transfers, and FLOPs are lower (especially for higher orders).

The Laghos implementation includes support for hardware devices, such
as GPUs, and programming models, such as CUDA, OCCA, RAJA and OpenMP,
based on [MFEM](http://mfem.org), version 4.1 or later. These device
backends are selectable at runtime, see the `-d/--device` command-line
option.

Other computational motives in Laghos include the following:

- Support for unstructured meshes, in 2D and 3D, with quadrilateral and
Expand Down Expand Up @@ -93,7 +99,7 @@ Other computational motives in Laghos include the following:
## Code Structure

- The file `laghos.cpp` contains the main driver with the time integration loop
starting around line 488.
starting around line 609.
- In each time step, the ODE system of interest is constructed and solved by
the class `LagrangianHydroOperator`, defined around line 544 of `laghos.cpp`
and implemented in files `laghos_solver.hpp` and `laghos_solver.cpp`.
Expand Down Expand Up @@ -188,6 +194,9 @@ Build Laghos
This can be followed by `make test` and `make install` to check and install the
build respectively. See `make help` for additional options.

See also the `make setup` target that can be used to automated the
download and building of hypre, METIS and MFEM.

## Running

#### Sedov blast
Expand Down Expand Up @@ -266,7 +275,7 @@ To make sure the results are correct, we tabulate reference final iterations
| 7. | 528 | 0.000180 | 5.6505348812e+01 |
| 8. | 776 | 0.000045 | 4.0982431726e+02 |

Similar CUDA runs can be launched with these commands:
Similar GPU runs using the MFEM CUDA *device* can be run as follows:

1. `./laghos -p 0 -dim 2 -rs 3 -tf 0.75 -pa -d cuda`
2. `./laghos -p 0 -dim 3 -rs 1 -tf 0.75 -pa -d cuda`
Expand Down
15 changes: 7 additions & 8 deletions laghos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ int main(int argc, char *argv[])
if (mpi.Root()) { backend.Print(); }
backend.SetGPUAwareMPI(gpu_aware_mpi);

// On all processors, use the default builtin 1D/2D/3D mesh or
// read the serial one given on the command line.
// On all processors, use the default builtin 1D/2D/3D mesh or read the
// serial one given on the command line.
Mesh *mesh;
if (strncmp(mesh_file, "default", 7) != 0)
{
Expand Down Expand Up @@ -410,8 +410,8 @@ int main(int argc, char *argv[])
ParFiniteElementSpace L2FESpace(pmesh, &L2FEC);
ParFiniteElementSpace H1FESpace(pmesh, &H1FEC, pmesh->Dimension());

// Boundary conditions: all tests use v.n = 0 on the boundary,
// and we assume that the boundaries are straight.
// Boundary conditions: all tests use v.n = 0 on the boundary, and we assume
// that the boundaries are straight.
Array<int> ess_tdofs;
{
Array<int> ess_bdr(pmesh->bdr_attributes.Max()), tdofs1d;
Expand Down Expand Up @@ -489,7 +489,7 @@ int main(int argc, char *argv[])
v_gf.SyncAliasMemory(S);

// Initialize density and specific internal energy values. We interpolate in
// a non-positive basis to get the correct values at the dofs. Then we do an
// a non-positive basis to get the correct values at the dofs. Then we do an
// L2 projection to the positive basis in which we actually compute. The goal
// is to get a high-order representation of the initial condition. Note that
// this density is a temporary function and it will not be updated during the
Expand Down Expand Up @@ -517,9 +517,8 @@ int main(int argc, char *argv[])
// Sync the data location of e_gf with its base, S
e_gf.SyncAliasMemory(S);

// Piecewise constant ideal gas coefficient over the Lagrangian mesh.
// The gamma values are projected on a function that stays constant
// on the moving mesh.
// Piecewise constant ideal gas coefficient over the Lagrangian mesh. The
// gamma values are projected on function that's constant on the moving mesh.
L2_FECollection mat_fec(0, pmesh->Dimension());
ParFiniteElementSpace mat_fes(pmesh, &mat_fec);
ParGridFunction mat_gf(&mat_fes);
Expand Down
13 changes: 6 additions & 7 deletions serial/laghos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ int main(int argc, char *argv[])
backend.Configure(device, dev);
backend.Print();

// On all processors, use the default builtin 1D/2D/3D mesh or
// read the serial one given on the command line.
// On all processors, use the default builtin 1D/2D/3D mesh or read the
// serial one given on the command line.
Mesh *mesh;
if (strncmp(mesh_file, "default", 7) != 0)
{
Expand Down Expand Up @@ -230,8 +230,8 @@ int main(int argc, char *argv[])
FiniteElementSpace L2FESpace(mesh, &L2FEC);
FiniteElementSpace H1FESpace(mesh, &H1FEC, mesh->Dimension());

// Boundary conditions: all tests use v.n = 0 on the boundary,
// and we assume that the boundaries are straight.
// Boundary conditions: all tests use v.n = 0 on the boundary, and we assume
// that the boundaries are straight.
Array<int> ess_tdofs;
{
Array<int> ess_bdr(mesh->bdr_attributes.Max()), tdofs1d;
Expand Down Expand Up @@ -300,7 +300,7 @@ int main(int argc, char *argv[])
v_gf.SyncAliasMemory(S);

// Initialize density and specific internal energy values. We interpolate in
// a non-positive basis to get the correct values at the dofs. Then we do an
// a non-positive basis to get the correct values at the dofs. Then we do an
// L2 projection to the positive basis in which we actually compute. The goal
// is to get a high-order representation of the initial condition. Note that
// this density is a temporary function and it will not be updated during the
Expand Down Expand Up @@ -329,8 +329,7 @@ int main(int argc, char *argv[])
e_gf.SyncAliasMemory(S);

// Piecewise constant ideal gas coefficient over the Lagrangian mesh.
// The gamma values are projected on a function that stays constant
// on the moving mesh.
// gamma values are projected on function that's constant on the moving mesh.
L2_FECollection mat_fec(0, mesh->Dimension());
FiniteElementSpace mat_fes(mesh, &mat_fec);
GridFunction mat_gf(&mat_fes);
Expand Down

0 comments on commit 0827231

Please sign in to comment.