Skip to content

Commit 4a86f1b

Browse files
authored
Merge pull request #1438 from LLNL/feature/whitlock/mir_update
Initial MIR component
2 parents 759e6c3 + 3dd40da commit 4a86f1b

File tree

159 files changed

+37493
-46
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+37493
-46
lines changed

.gitlab/build_ruby.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
# Template
2525
.src_build_on_ruby:
2626
variables:
27-
ALLOC_TIME: "30"
27+
ALLOC_TIME: "40"
2828
extends: [.src_build_script, .on_ruby, .src_workflow]
2929
needs: []
3030

3131
.full_build_on_ruby:
3232
variables:
33-
ALLOC_TIME: "60"
33+
ALLOC_TIME: "70"
3434
extends: [.full_build_script, .on_ruby, .full_workflow]
3535
needs: []
3636

RELEASE-NOTES.md

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/
2020
## [Unreleased] - Release date yyyy-mm-dd
2121

2222
### Added
23+
- Added a new "Mir" Axom component for accelerated Material Interface Reconstruction (MIR) algorithms.
24+
MIR algorithms take Blueprint meshes with a matset and they use the matset's material information
25+
to split any input zones that contain multiple materials into zones that contain a single material.
26+
The Mir component provides an implementation of the Equi-Z MIR algorithm, which is a visualization-
27+
oriented algorithm that produces smooth interfaces between zones and their neighbors.
2328
- Support in `quest::IntersectionShaper` for Blueprint mesh stored in a `conduit::Node`
2429
or `sidre::Group`.
2530
- Adds new CMake configuration options, `AXOM_ENABLE_ASAN` and `AXOM_ENABLE_UBSAN`, to enable/disable AddressSanitizer and UndefinedBehaviorSanitizer respectively in Axom. Default is OFF for both.

azure-pipelines.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ variables:
1717
jobs:
1818
- job: Build_and_Test
1919

20-
timeoutInMinutes: 90
20+
timeoutInMinutes: 120
2121

2222
strategy:
2323
matrix:
@@ -48,7 +48,7 @@ jobs:
4848
linux_clang14_noraja:
4949
VM_ImageName: 'ubuntu-22.04'
5050
Compiler_ImageName: '$(CLANG14_IMAGENAME)'
51-
CMAKE_EXTRA_FLAGS: '-DBUILD_SHARED_LIBS=ON -DAXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS:BOOL=ON -U RAJA_DIR'
51+
CMAKE_EXTRA_FLAGS: '-DBUILD_SHARED_LIBS=ON -DAXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS:BOOL=ON -DAXOM_ENABLE_MIR:BOOL=OFF -U RAJA_DIR'
5252
BUILD_TYPE: 'Debug'
5353
COMPILER: 'clang++'
5454
TEST_TARGET: 'linux_clang14'
@@ -64,7 +64,7 @@ jobs:
6464
linux_clang14_noraja_noumpire:
6565
VM_ImageName: 'ubuntu-22.04'
6666
Compiler_ImageName: '$(CLANG14_IMAGENAME)'
67-
CMAKE_EXTRA_FLAGS: '-DBUILD_SHARED_LIBS=ON -DAXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS:BOOL=ON -U RAJA_DIR -U UMPIRE_DIR'
67+
CMAKE_EXTRA_FLAGS: '-DBUILD_SHARED_LIBS=ON -DAXOM_QUEST_ENABLE_EXTRA_REGRESSION_TESTS:BOOL=ON -DAXOM_ENABLE_MIR:BOOL=OFF -U RAJA_DIR -U UMPIRE_DIR'
6868
BUILD_TYPE: 'Debug'
6969
COMPILER: 'clang++'
7070
TEST_TARGET: 'linux_clang14'
@@ -79,11 +79,11 @@ jobs:
7979
HOST_CONFIG: '[email protected]'
8080
osx_gcc:
8181
VM_ImageName: 'macos-13'
82-
CMAKE_EXTRA_FLAGS: '-DAXOM_ENABLE_SIDRE:BOOL=OFF -DAXOM_ENABLE_INLET:BOOL=OFF -DAXOM_ENABLE_KLEE:BOOL=OFF -DAXOM_ENABLE_SINA:BOOL=OFF'
82+
CMAKE_EXTRA_FLAGS: '-DAXOM_ENABLE_SIDRE:BOOL=OFF -DAXOM_ENABLE_INLET:BOOL=OFF -DAXOM_ENABLE_KLEE:BOOL=OFF -DAXOM_ENABLE_SINA:BOOL=OFF -DAXOM_ENABLE_MIR:BOOL=OFF'
8383
TEST_TARGET: 'osx_gcc'
8484
windows:
8585
VM_ImageName: 'windows-2019'
86-
CMAKE_EXTRA_FLAGS: '-DAXOM_ENABLE_SIDRE:BOOL=OFF -DAXOM_ENABLE_INLET:BOOL=OFF -DAXOM_ENABLE_KLEE:BOOL=OFF -DAXOM_ENABLE_SINA:BOOL=OFF'
86+
CMAKE_EXTRA_FLAGS: '-DAXOM_ENABLE_SIDRE:BOOL=OFF -DAXOM_ENABLE_INLET:BOOL=OFF -DAXOM_ENABLE_KLEE:BOOL=OFF -DAXOM_ENABLE_SINA:BOOL=OFF -DAXOM_ENABLE_MIR:BOOL=OFF'
8787
TEST_TARGET: 'win_vs'
8888

8989
pool:

config-build.py

+7
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ def parse_arguments():
8484
help="Create an eclipse project file.",
8585
)
8686

87+
parser.add_argument(
88+
"-n", "--ninja", action="store_true", help="Create a Ninja project."
89+
)
90+
8791
parser.add_argument(
8892
"-x", "--xcode", action="store_true", help="Create an xcode project."
8993
)
@@ -270,6 +274,9 @@ def create_cmake_command_line(
270274
if args.eclipse:
271275
cmakeline += ' -G "Eclipse CDT4 - Unix Makefiles"'
272276

277+
if args.ninja:
278+
cmakeline += ' -G "Ninja"'
279+
273280
if args.xcode:
274281
cmakeline += ' -G "Xcode"'
275282

scripts/azure-pipelines/linux-build_and_test.sh

+6-3
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,21 @@ export BUILD_TYPE=${BUILD_TYPE:-Debug}
2828

2929

3030
if [[ "$DO_BUILD" == "yes" ]] ; then
31+
echo "~~~~~~ FIND NUMPROCS ~~~~~~~~"
32+
NUMPROCS=`python3 -c "import os; print(f'{os.cpu_count()}')"`
33+
NUM_BUILD_PROCS=`python3 -c "import os; print(f'{max(2, os.cpu_count() * 8 // 10)}')"`
3134
echo "~~~~~~ RUNNING CMAKE ~~~~~~~~"
3235
or_die python3 ./config-build.py -hc /home/axom/axom/host-configs/docker/${HOST_CONFIG}.cmake -bt ${BUILD_TYPE} -DENABLE_GTEST_DEATH_TESTS=ON ${CMAKE_EXTRA_FLAGS}
3336
or_die cd build-$HOST_CONFIG-${BUILD_TYPE,,}
3437
echo "~~~~~~ BUILDING ~~~~~~~~"
3538
if [[ ${CMAKE_EXTRA_FLAGS} == *COVERAGE* ]] ; then
36-
or_die make -j 8
39+
or_die make -j $NUM_BUILD_PROCS
3740
else
38-
or_die make -j 8 VERBOSE=1
41+
or_die make -j $NUM_BUILD_PROCS VERBOSE=1
3942
fi
4043
if [[ "${DO_TEST}" == "yes" ]] ; then
4144
echo "~~~~~~ RUNNING TESTS ~~~~~~~~"
42-
make CTEST_OUTPUT_ON_FAILURE=1 test ARGS='-T Test -VV -j8'
45+
make CTEST_OUTPUT_ON_FAILURE=1 test ARGS='-T Test -VV -j$NUM_BUILD_PROCS'
4346
fi
4447
if [[ "${DO_BENCHMARKS}" == "yes" ]] ; then
4548
echo "~~~~~~ RUNNING BENCHMARKS ~~~~~~~~"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import os, sys
2+
3+
runs = {
4+
"[email protected]_cuda-release" : ["seq", "omp", "cuda"],
5+
"[email protected]" : ["seq", "omp"],
6+
"[email protected]" : ["seq", "omp"],
7+
"[email protected]" : ["seq", "omp"],
8+
"[email protected]_hip-release" : ["seq", "hip"],
9+
"[email protected]_hip-release" :["seq", "hip"]
10+
}
11+
12+
sizes = (50, 100, 200, 500, 1000, 1500, 2000, 4000, 8000)
13+
14+
def generate():
15+
for r in runs:
16+
filename = os.path.join(r, "run_concentric_circles.bash")
17+
f = open(filename, "wt")
18+
f.write("#!/bin/bash\n\n")
19+
f.write("CONCENTRIC_CIRCLES=./examples/mir_concentric_circles\n\n")
20+
21+
for s in sizes:
22+
f.write(f"# Size {s}\n")
23+
for policy in runs[r]:
24+
f.write(f'echo "Running --gridsize {s} --numcircles 5 --policy {policy}"\n')
25+
f.write(f'$CONCENTRIC_CIRCLES --gridsize {s} --numcircles 5 --policy {policy} > result_{policy}_{s}.txt\n\n')
26+
27+
f.close()
28+
os.chmod(filename, 0o700)
29+
print(f"Wrote {filename}")
30+
31+
def read_timings(filename):
32+
retval = "" # no data
33+
try:
34+
lines = open(filename, "rt").readlines()
35+
for line in lines:
36+
pos = line.find("runMIR")
37+
if pos != -1:
38+
toks = [x for x in line.split() if x != '']
39+
retval = float(toks[2]) # timings (I)
40+
break
41+
except:
42+
pass
43+
return retval
44+
45+
def make_csv(outputfile):
46+
columns = []
47+
# Add sizes column
48+
sc = ["Sizes"]
49+
for s in sizes:
50+
sc.append(s)
51+
columns.append(sc)
52+
53+
# Gather data.
54+
for r in sorted(runs.keys()):
55+
for policy in runs[r]:
56+
buildname = r[6:-8]
57+
name = f"{buildname} {policy.upper()}"
58+
data = [name]
59+
for s in sizes:
60+
filename = os.path.join(r, f"result_{policy}_{s}.txt")
61+
value = read_timings(filename)
62+
data.append(value)
63+
columns.append(data)
64+
65+
# Write data
66+
f = open(outputfile, "wt")
67+
nrows = len(columns[0])
68+
for i in range(nrows):
69+
rowdata = [str(c[i]) for c in columns]
70+
line = ",".join(rowdata)
71+
f.write(f"{line}\n")
72+
f.close()
73+
74+
def main():
75+
if "--generate" in sys.argv:
76+
generate()
77+
else:
78+
make_csv("concentric_circle_timings.csv")
79+
80+
main()

scripts/copyrightPrepender.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def reject(line):
3434

3535
# Skip some autogenerated bindings, example code, and thirdparty code that
3636
# should not get a header.
37-
for suppression in ("c_fortran", "lulesh2", "thirdparty"):
37+
for suppression in ("c_fortran", "lulesh2", "thirdparty", "src/cmake", "clipping/ClipCases"):
3838
if filename.find(suppression) != -1:
3939
print(" Processing file:", filename, end=' ')
4040
print(skipMsg)

scripts/spack/packages/axom/package.py

+2
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,8 @@ def cmake_args(self):
602602
options.append(self.define_from_variant("BUILD_SHARED_LIBS", "shared"))
603603
options.append(self.define_from_variant("AXOM_ENABLE_EXAMPLES", "examples"))
604604
options.append(self.define_from_variant("AXOM_ENABLE_TOOLS", "tools"))
605+
if "+raja" not in spec or "+umpire" not in spec:
606+
options.append("-DAXOM_ENABLE_MIR:BOOL=OFF")
605607

606608
return options
607609

src/axom/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ axom_add_component(COMPONENT_NAME sina DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONE
3232
axom_add_component(COMPONENT_NAME slam DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS})
3333
axom_add_component(COMPONENT_NAME primal DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS})
3434
axom_add_component(COMPONENT_NAME sidre DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS})
35+
axom_add_component(COMPONENT_NAME mir DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS})
3536
axom_add_component(COMPONENT_NAME mint DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS})
3637
axom_add_component(COMPONENT_NAME spin DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS})
3738
axom_add_component(COMPONENT_NAME inlet DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS})

src/axom/config.hpp.in

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
#cmakedefine AXOM_USE_KLEE
101101
#cmakedefine AXOM_USE_LUMBERJACK
102102
#cmakedefine AXOM_USE_MINT
103+
#cmakedefine AXOM_USE_MIR
103104
#cmakedefine AXOM_USE_PRIMAL
104105
#cmakedefine AXOM_USE_QUEST
105106
#cmakedefine AXOM_USE_SIDRE

src/axom/core/ArrayView.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class ArrayView : public ArrayBase<T, DIM, ArrayView<T, DIM, SPACE>>
7373
typename... Args,
7474
typename Enable = typename std::enable_if<
7575
sizeof...(Args) == DIM && detail::all_types_are_integral<Args...>::value>::type>
76-
ArrayView(T* data, Args... args);
76+
AXOM_HOST_DEVICE ArrayView(T* data, Args... args);
7777

7878
/*!
7979
* \brief Generic constructor for an ArrayView of arbitrary dimension with external data
@@ -232,7 +232,7 @@ using MCArrayView = ArrayView<T, 2>;
232232
//------------------------------------------------------------------------------
233233
template <typename T, int DIM, MemorySpace SPACE>
234234
template <typename... Args, typename Enable>
235-
ArrayView<T, DIM, SPACE>::ArrayView(T* data, Args... args)
235+
AXOM_HOST_DEVICE ArrayView<T, DIM, SPACE>::ArrayView(T* data, Args... args)
236236
: ArrayView(data,
237237
StackArray<IndexType, DIM> {{static_cast<IndexType>(args)...}})
238238
{

src/axom/core/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ set(core_headers
2727
utilities/CommandLineUtilities.hpp
2828
utilities/FileUtilities.hpp
2929
utilities/RAII.hpp
30+
utilities/Sorting.hpp
3031
utilities/StringUtilities.hpp
3132
utilities/System.hpp
3233
utilities/Timer.hpp
@@ -78,6 +79,7 @@ set(core_headers
7879
execution/for_all.hpp
7980
execution/nested_for_exec.hpp
8081
execution/runtime_policy.hpp
82+
execution/scans.hpp
8183
execution/synchronize.hpp
8284

8385
execution/internal/seq_exec.hpp

src/axom/core/StackArray.hpp

+35
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include "axom/core/Macros.hpp" // for axom macros
1111
#include "axom/core/Types.hpp" // for axom types
1212

13+
#include <iostream>
14+
1315
namespace axom
1416
{
1517
/*!
@@ -27,6 +29,14 @@ namespace axom
2729
template <typename T, int N>
2830
struct StackArray
2931
{
32+
using value_type = T;
33+
34+
/*!
35+
* \brief Return size of the array.
36+
*/
37+
AXOM_HOST_DEVICE
38+
constexpr static int size() { return N; }
39+
3040
/*!
3141
* \brief Accessor, returns a reference to the value at the given index.
3242
*
@@ -55,6 +65,9 @@ struct StackArray
5565
AXOM_HOST_DEVICE
5666
constexpr operator const T*() const noexcept { return &m_data[0]; }
5767

68+
AXOM_HOST_DEVICE T* data() noexcept { return &m_data[0]; }
69+
AXOM_HOST_DEVICE const T* data() const noexcept { return &m_data[0]; }
70+
5871
/// @}
5972

6073
/*!
@@ -135,6 +148,28 @@ AXOM_HOST_DEVICE bool operator<(const StackArray<T, N>& lhs,
135148
return false;
136149
}
137150

151+
/**
152+
* \brief Print the StackArray to a stream.
153+
* \param os The stream to use.
154+
* \param obj The StackArray to print.
155+
* \return The input stream.
156+
*/
157+
template <typename T, int N>
158+
std::ostream& operator<<(std::ostream& os, const StackArray<T, N>& obj)
159+
{
160+
os << "(";
161+
for(int i = 0; i < N; i++)
162+
{
163+
if(i > 0)
164+
{
165+
os << ", ";
166+
}
167+
os << obj.m_data[i];
168+
}
169+
os << ")";
170+
return os;
171+
}
172+
138173
} /* namespace axom */
139174

140175
#endif /* AXOM_STACKARRAY_HPP_ */

0 commit comments

Comments
 (0)