Skip to content

Commit 44927c9

Browse files
committed
Merge branch 'master' into amr
2 parents 916c114 + e6bb418 commit 44927c9

21 files changed

Lines changed: 2455 additions & 391 deletions

.github/workflows/build-and-test.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616

1717
jobs:
1818
build-and-test:
19-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-22.04
2020

2121
steps:
2222
# Checkout Remhos in "remhos" subdirectory. Final path: /home/runner/work/remhos/remhos/remhos
@@ -35,14 +35,14 @@ jobs:
3535
# Install will only run on cache miss.
3636
- name: cache hypre
3737
id: hypre-cache
38-
uses: actions/cache@v2
38+
uses: actions/cache@v4
3939
with:
4040
path: ${{ env.HYPRE_TOP_DIR }}
4141
key: ${{ runner.os }}-build-${{ env.HYPRE_TOP_DIR }}-v2
4242

4343
- name: build Hypre
4444
if: steps.hypre-cache.outputs.cache-hit != 'true'
45-
uses: mfem/github-actions/build-hypre@master
45+
uses: mfem/github-actions/build-hypre@v2.5
4646
with:
4747
archive: ${{ env.HYPRE_ARCHIVE }}
4848
dir: ${{ env.HYPRE_TOP_DIR }}
@@ -51,14 +51,14 @@ jobs:
5151
# Install will only run on cache miss.
5252
- name: cache metis
5353
id: metis-cache
54-
uses: actions/cache@v2
54+
uses: actions/cache@v4
5555
with:
5656
path: ${{ env.METIS_TOP_DIR }}
5757
key: ${{ runner.os }}-build-${{ env.METIS_TOP_DIR }}-v2
5858

5959
- name: build metis
6060
if: steps.metis-cache.outputs.cache-hit != 'true'
61-
uses: mfem/github-actions/build-metis@master
61+
uses: mfem/github-actions/build-metis@v2.5
6262
with:
6363
archive: ${{ env.METIS_ARCHIVE }}
6464
dir: ${{ env.METIS_TOP_DIR }}
@@ -80,20 +80,21 @@ jobs:
8080
# Install will only run on cache miss.
8181
- name: cache mfem
8282
id: mfem-cache
83-
uses: actions/cache@v2
83+
uses: actions/cache@v4
8484
with:
8585
path: ${{ env.MFEM_TOP_DIR }}
8686
key: ${{ runner.os }}-build-${{ env.MFEM_TOP_DIR }}-${{ env.MFEM_COMMIT }}-v3
8787

8888
- name: build mfem
8989
if: steps.mfem-cache.outputs.cache-hit != 'true'
90-
uses: mfem/github-actions/build-mfem@master
90+
uses: mfem/github-actions/build-mfem@v2.5
9191
with:
9292
os: ${{ runner.os }}
9393
hypre-dir: ${{ env.HYPRE_TOP_DIR }}
9494
metis-dir: ${{ env.METIS_TOP_DIR }}
9595
mfem-dir: ${{ env.MFEM_TOP_DIR }}
9696
mfem-branch: ${{ env.MFEM_BRANCH }}
97+
library-only: 'true'
9798

9899
- name: build Remhos
99100
run: |
@@ -115,7 +116,7 @@ jobs:
115116
116117
- name: Archive test results patch
117118
if: always()
118-
uses: actions/upload-artifact@v2
119+
uses: actions/upload-artifact@v4
119120
with:
120121
name: baseline-patch
121122
path: remhos/baseline.patch

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
remhos
2+
*.dat
3+
*.mesh
4+
*.o
5+
*.gf
6+
*.svg
7+
.DS_Store
8+
/build/
9+
/.cache/
10+
/.vscode/

CMakeLists.txt

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
cmake_minimum_required(VERSION 3.18)
2+
3+
set(project remhos)
4+
project(${project} LANGUAGES CXX)
5+
set(CMAKE_CXX_STANDARD 17)
6+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
7+
set(CMAKE_CXX_COMPILER_LAUNCHER ccache)
8+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
9+
10+
# CXX flags *******************************************************************
11+
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
12+
add_compile_options(-fsanitize=address -O0)
13+
add_link_options(-fsanitize=address)
14+
endif()
15+
16+
# remove -DNDEBUG from default RelWithDebInfo flags
17+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2" CACHE STRING "" FORCE)
18+
19+
# Verbosity options ***********************************************************
20+
set(CMAKE_VERBOSE_MAKEFILE OFF CACHE BOOL "" FORCE)
21+
# set(CUDA_VERBOSE_BUILD OFF CACHE BOOL "" FORCE)
22+
23+
# Include paths ***************************************************************
24+
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
25+
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../mfem)
26+
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
27+
include_directories(/usr/include/hypre /usr/include)
28+
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
29+
include_directories(/opt/homebrew/opt/fmt/include
30+
/opt/homebrew/opt/openmpi/include
31+
/opt/homebrew/opt/metis/include
32+
/opt/homebrew/opt/hypre/include)
33+
add_compile_definitions(MFEM_USE_CMAKE_TESTS)
34+
else()
35+
message(FATAL_ERROR "Unsupported system")
36+
endif()
37+
38+
# Copy mesh files *************************************************************
39+
file(GLOB SRC_MESH_FILES LIST_DIRECTORIES false data/*.mesh)
40+
set(BUILD_DATA_DIR ${CMAKE_CURRENT_BINARY_DIR}/data)
41+
add_custom_command(OUTPUT data_is_copied
42+
COMMAND ${CMAKE_COMMAND} -E make_directory ${BUILD_DATA_DIR}
43+
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SRC_MESH_FILES} ${BUILD_DATA_DIR}
44+
COMMAND ${CMAKE_COMMAND} -E touch data_is_copied
45+
COMMENT "Copying mesh files ...")
46+
add_custom_target(copy_mesh_files DEPENDS data_is_copied)
47+
48+
# Library source files ********************************************************
49+
add_library(Remhos STATIC remhos.cpp remhos_fct.cpp
50+
remhos_ho.cpp remhos_lo.cpp
51+
remhos_mono.cpp remhos_sync.cpp
52+
remhos_tools.cpp)
53+
54+
# Testing options *************************************************************
55+
enable_testing()
56+
function(add_remhos_test name)
57+
set(file ${name}.cpp)
58+
set(target ${name})
59+
list(LENGTH ARGN ARGN_COUNT)
60+
if(ARGN_COUNT GREATER 0)
61+
list(GET ARGN 0 extra)
62+
string(APPEND name "_" ${extra})
63+
string(APPEND target "_" ${extra})
64+
endif()
65+
message(STATUS "Adding target: ${target}")
66+
add_executable(${target} ${file})
67+
add_dependencies(${target} copy_mesh_files)
68+
target_link_libraries(${target} Remhos -lmpi -lmfem -lhypre -lmetis -lfmt)
69+
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
70+
target_link_directories(${target} PUBLIC /usr/lib/x86_64-linux-gnu)
71+
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
72+
target_link_directories(${target} PUBLIC /opt/homebrew/opt/openmpi/lib
73+
/opt/homebrew/opt/metis/lib
74+
/opt/homebrew/opt/hypre/lib
75+
/opt/homebrew/opt/fmt/lib)
76+
endif()
77+
target_link_directories(${target} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../mfem)
78+
message(STATUS "Adding test: ${target}_n1")
79+
add_test(NAME ${target}_n1 COMMAND mpirun -n 1 ${target} ${extra})
80+
message(STATUS "Adding test: ${target}_n3")
81+
add_test(NAME ${target}_n3 COMMAND mpirun -n 3 ${target})
82+
endfunction()
83+
84+
add_remhos_test(remhos_main)
85+
add_remhos_test(remhos_tests)

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ Alternatively, verify the final mass (`mass`) and maximum value (`max`) for the
233233
7. `mpirun -np 8 remhos -m ./data/periodic-cube.mesh -p 0 -rs 1 -o 2 -dt 0.014 -tf 8 -ho 1 -lo 4 -fct 2`
234234
8. `mpirun -np 8 remhos -m ../mfem/data/ball-nurbs.mesh -p 1 -rs 1 -dt 0.02 -tf 3 -ho 1 -lo 4 -fct 2`
235235
9. `mpirun -np 8 remhos -m ./data/inline-quad.mesh -p 14 -rs 1 -dt 0.001 -tf 0.75 -ho 1 -lo 4 -fct 2`
236-
10. `mpirun -np 8 remhos -m ./data/inline-quad.mesh -p 14 -rs 2 -dt 0.005 -tf 0.75 -ho 3 -lo 1 -fct 1 -ps`
236+
10. `mpirun -np 8 remhos -m ./data/inline-quad.mesh -p 14 -rs 3 -dt 0.005 -tf 0.75 -ho 1 -lo 5 -fct 4 -ps -s 13`
237237
11. `mpirun -np 8 remhos -m ./data/cube01_hex.mesh -p 10 -rs 1 -o 2 -dt 0.02 -tf 0.8 -ho 1 -lo 4 -fct 2`
238238
12. `mpirun -np 8 remhos -m ./data/inline-quad.mesh -p 7 -rs 3 -o 1 -dt 0.01 -tf 20 -mono 1 -si 2`
239239
13. `mpirun -np 8 remhos -m ./data/inline-quad.mesh -p 6 -rs 2 -o 1 -dt 0.01 -tf 20 -mono 1 -si 1`
@@ -250,7 +250,7 @@ Alternatively, verify the final mass (`mass`) and maximum value (`max`) for the
250250
| 7. | 0.9607429525 | 0.7678305756 |
251251
| 8. | 0.8087104604 | 0.9999889315 |
252252
| 9. | 0.08479546709| 0.8156091428 |
253-
| 10. | 0.08980397023| 0.9886734209 |
253+
| 10. | 0.09317738757| 0.9994170644 |
254254
| 11. | 0.1197294512 | 0.9990312449 |
255255
| 12. | 0.1570667907 | 0.9987771164 |
256256
| 13. | 0.3182739921 | 1 |
@@ -260,7 +260,19 @@ round-off distance from the above reference values.
260260

261261
## Performance Timing and FOM
262262

263-
To appear soon.
263+
Performance is tracked only for the configuration `-ho 3 -lo 5 -fct 2`.
264+
This configuration supports partial assembly and GPU execution.
265+
Remhos reports several FOMs in the terminal, based on the distinct phases of an
266+
advection-based remap calculation. All FOMs are reported in
267+
`(megaDOFs x time steps) per second`, reflecting the throughput of the calculation.
268+
269+
- FOM RHS: construction of the right-hand side of the system.
270+
- FOM INV: inverting the high-order operator, which is used to obtain a
271+
high-order unbounded (HO) solution.
272+
- FOM LO: computation of the low-order bounded (LO) approximation of the solution.
273+
- FOM FCT: computation of the FCT solution, combining the LO and HO solutions to
274+
obtain a bounded high-order solution.
275+
- **FOM**: performance metric combining all the above phases.
264276

265277
## Versions
266278

@@ -276,7 +288,7 @@ comment in the [issue tracker](https://github.com/CEED/Remhos/issues).
276288
The following copyright applies to each file in the CEED software suite,
277289
unless otherwise stated in the file:
278290

279-
> Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at the
291+
> Copyright (c) 2026, Lawrence Livermore National Security, LLC. Produced at the
280292
> Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights reserved.
281293
282294
See files LICENSE and NOTICE for details.

0 commit comments

Comments
 (0)