From 08272317ec286a809630dc6cc550d7dc1f5cc4a6 Mon Sep 17 00:00:00 2001 From: Tzanio Date: Fri, 27 Mar 2020 17:30:55 -0700 Subject: [PATCH] Small edits and adjustments --- .travis.yml | 1 - CHANGELOG | 25 +++++++++++++++++-------- README.md | 13 +++++++++++-- laghos.cpp | 15 +++++++-------- serial/laghos.cpp | 13 ++++++------- 5 files changed, 41 insertions(+), 26 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5123abf4..f4d5f200 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 - diff --git a/CHANGELOG b/CHANGELOG index 41aa8350..e386b7e8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/README.md b/README.md index 8dd6271e..756891fa 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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`. @@ -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 @@ -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` diff --git a/laghos.cpp b/laghos.cpp index cd48b5b9..7fc86c54 100644 --- a/laghos.cpp +++ b/laghos.cpp @@ -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) { @@ -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 ess_tdofs; { Array ess_bdr(pmesh->bdr_attributes.Max()), tdofs1d; @@ -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 @@ -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); diff --git a/serial/laghos.cpp b/serial/laghos.cpp index 346fb985..fdb672ff 100644 --- a/serial/laghos.cpp +++ b/serial/laghos.cpp @@ -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) { @@ -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 ess_tdofs; { Array ess_bdr(mesh->bdr_attributes.Max()), tdofs1d; @@ -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 @@ -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);