Skip to content

Commit 94bc035

Browse files
authored
Merge pull request #287 from LLNL/feature/add_performance_testing
Performance Testing
2 parents c1100a3 + a249a09 commit 94bc035

Some content is hidden

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

41 files changed

+865
-170
lines changed

.gitlab/jobs-mpi.yml

-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ blueos_cuda_11_gcc_spectrum_build:
8080
blueos_cuda_11_gcc_spectrum_test:
8181
extends: [.blueos_resource2, .cuda_11_gcc_spectrum, .run_ats]
8282
needs: [blueos_cuda_11_gcc_spectrum_build]
83-
allow_failure: true
8483

8584
blueos_cuda_11_gcc_spectrum_cleanup:
8685
extends: [.blueos_resource2, .cuda_11_gcc_spectrum, .cleanup_dir]

.gitmodules

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
path = extern/chai
1717
url = https://github.com/llnl/chai
1818
branch = feature/ManagedSharedPtr
19+
ignore = all

RELEASE_NOTES.md

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ Notable changes include:
1515
* TPL builds have been split off into a separate Gitlab CI stage to help with timeouts on allocations.
1616
* Failed ATS runs are automatically retested once in the Gitlab CI.
1717
* Python execute command is centralized in scripts/spheralutils.py now.
18+
* Caliper updated v2.11.
19+
* Adiak added as TPL.
20+
* Created singleton wrapper for cali::ConfigManger and python wrapped Caliper timer and Adiak routines.
1821
1922
* Build changes / improvements:
2023
* Distributed source directory must always be built now.
@@ -23,6 +26,8 @@ Notable changes include:
2326
* The FSISPH package is now optional (SPHERAL\_ENABLE\_FSISPH).
2427
* The GSPH package is now optional (SPHERAL\_ENABLE\_GSPH).
2528
* The SVPH package is now optional (SPHERAL\_ENABLE\_SVPH).
29+
* Cleaner Spheral Spack package.
30+
* ENABLE\_DEV\_BUILD can now export targets properly.
2631
2732
* Bug Fixes / improvements:
2833
* Wrappers for MPI calls are simplified and improved.

cmake/InstallTPLs.cmake

+37-1
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,15 @@ endif()
6767
# Find pre-compiled TPLs
6868
#-----------------------------------------------------------------------------------
6969

70+
# Any targets that used find package must be added to these lists
71+
set(SPHERAL_FP_TPLS )
72+
set(SPHERAL_FP_DIRS )
73+
7074
# Use find_package to get axom (which brings in fmt) and patch fmt
7175
find_package(axom REQUIRED NO_DEFAULT_PATH PATHS ${axom_DIR}/lib/cmake)
7276
list(APPEND SPHERAL_BLT_DEPENDS axom )
77+
list(APPEND SPHERAL_FP_TPLS axom)
78+
list(APPEND SPHERAL_FP_DIRS ${axom_DIR}/lib/cmake)
7379

7480
# This is a hack to handle transitive issues that come
7581
# from using object libraries with newer version of axom
@@ -82,6 +88,31 @@ foreach(_comp ${AXOM_COMPONENTS_ENABLED})
8288
list(APPEND SPHERAL_BLT_DEPENDS ${axom_deps})
8389
endforeach()
8490

91+
message("-----------------------------------------------------------------------------")
92+
# Use find_package to get adiak
93+
find_package(adiak REQUIRED NO_DEFAULT_PATH PATHS ${adiak_DIR}/lib/cmake/adiak)
94+
if(adiak_FOUND)
95+
list(APPEND SPHERAL_BLT_DEPENDS adiak::adiak)
96+
list(APPEND SPHERAL_FP_TPLS adiak)
97+
list(APPEND SPHERAL_FP_DIRS ${adiak_DIR})
98+
message("Found Adiak External Package")
99+
endif()
100+
message("-----------------------------------------------------------------------------")
101+
# Use find_package to get caliper
102+
if (ENABLE_TIMER)
103+
# Save caliper_DIR because it gets overwritten by find_package
104+
if(NOT CONFIG_CALIPER_DIR)
105+
# Only save if it does not exists already
106+
set(CONFIG_CALIPER_DIR "${caliper_DIR}" CACHE PATH "Configuration Caliper directory")
107+
endif()
108+
find_package(caliper REQUIRED NO_DEFAULT_PATH PATHS ${caliper_DIR}/share/cmake/caliper)
109+
if(caliper_FOUND)
110+
list(APPEND SPHERAL_BLT_DEPENDS caliper)
111+
list(APPEND SPHERAL_FP_TPLS caliper)
112+
list(APPEND SPHERAL_FP_DIRS ${caliper_DIR})
113+
message("Found Caliper External Package")
114+
endif()
115+
endif()
85116
message("-----------------------------------------------------------------------------")
86117
find_package(RAJA REQUIRED NO_DEFAULT_PATH PATHS ${raja_DIR})
87118
if (RAJA_FOUND)
@@ -100,6 +131,8 @@ if(chai_DIR AND USE_EXTERNAL_CHAI)
100131
if (chai_FOUND)
101132
message("Found chai External Package.")
102133
endif()
134+
list(APPEND SPHERAL_FP_TPLS chai)
135+
list(APPEND SPHERAL_FP_DIRS ${chai_DIR})
103136
else()
104137
message("Using chai Submodule.")
105138
set(chai_DIR "${SPHERAL_ROOT_DIR}/extern/chai")
@@ -108,6 +141,10 @@ else()
108141
endif()
109142

110143
list(APPEND SPHERAL_BLT_DEPENDS chai camp RAJA umpire)
144+
list(APPEND SPHERAL_FP_TPLS RAJA umpire)
145+
list(APPEND SPHERAL_FP_DIRS ${raja_DIR} ${umpire_DIR})
146+
set_property(GLOBAL PROPERTY SPHERAL_FP_TPLS ${SPHERAL_FP_TPLS})
147+
set_property(GLOBAL PROPERTY SPHERAL_FP_DIRS ${SPHERAL_FP_DIRS})
111148

112149
message("-----------------------------------------------------------------------------")
113150

@@ -116,7 +153,6 @@ list(APPEND SPHERAL_EXTERN_LIBS boost eigen qhull silo hdf5 polytope)
116153

117154
blt_list_append( TO SPHERAL_EXTERN_LIBS ELEMENTS aneos IF ENABLE_ANEOS)
118155
blt_list_append( TO SPHERAL_EXTERN_LIBS ELEMENTS opensubdiv IF ENABLE_OPENSUBDIV)
119-
blt_list_append( TO SPHERAL_EXTERN_LIBS ELEMENTS caliper IF ENABLE_TIMER)
120156

121157
# Create and install target library for each external library
122158
foreach(lib ${SPHERAL_EXTERN_LIBS})

cmake/SetupSpheral.cmake

+2-4
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ endif()
153153
# Build C++ tests and install tests to install directory
154154
#-------------------------------------------------------------------------------
155155
if (ENABLE_TESTS)
156-
add_subdirectory(${SPHERAL_ROOT_DIR}/tests/unit/CXXTests)
156+
add_subdirectory(${SPHERAL_ROOT_DIR}/tests/unit)
157157

158158
# A macro to preserve directory structure when installing files
159159
macro(install_with_directory)
@@ -189,6 +189,4 @@ if (ENABLE_TESTS)
189189
DESTINATION ${SPHERAL_TEST_INSTALL_PREFIX})
190190
endif()
191191

192-
if(NOT ENABLE_DEV_BUILD)
193-
include(${SPHERAL_ROOT_DIR}/cmake/SpheralConfig.cmake)
194-
endif()
192+
include(${SPHERAL_ROOT_DIR}/cmake/SpheralConfig.cmake)

cmake/spheral/SpheralAddLibs.cmake

+14-21
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ function(spheral_add_obj_library package_name obj_list_name)
4646
# Install the headers
4747
install(FILES ${${package_name}_headers}
4848
DESTINATION include/${package_name})
49-
50-
if(ENABLE_DEV_BUILD)
51-
install(TARGETS Spheral_${package_name}
52-
DESTINATION lib)
53-
endif()
5449
# Append Spheral_${package_name} to the global object list
5550
# For example, SPHERAL_OBJ_LIBS or LLNLSPHERAL_OBJ_LIBS
5651
set_property(GLOBAL APPEND PROPERTY ${obj_list_name} Spheral_${package_name})
@@ -71,7 +66,7 @@ endfunction()
7166
# ----------------------
7267
# INPUT-OUTPUT VARIABLES
7368
# ----------------------
74-
# package_name : REQUIRED : Desired package name
69+
# package_name : REQUIRED : Desired package name (either CXX or LLNLCXX)
7570
# _cxx_obj_list : REQUIRED : List of internal targets to include
7671
# -----------------------
7772
# OUTPUT VARIABLES TO USE - Made available implicitly after function call
@@ -85,28 +80,29 @@ function(spheral_add_cxx_library package_name _cxx_obj_list)
8580
get_property(SPHERAL_CXX_DEPENDS GLOBAL PROPERTY SPHERAL_CXX_DEPENDS)
8681
# For including files in submodules, currently unused
8782
get_property(SPHERAL_SUBMOD_INCLUDES GLOBAL PROPERTY SPHERAL_SUBMOD_INCLUDES)
83+
# Convert package name to lower-case for export target name
84+
string(TOLOWER ${package_name} lower_case_package)
85+
set(export_target_name spheral_${lower_case_package}-targets)
8886

89-
if(ENABLE_SHARED)
90-
# Build shared spheral C++ library
91-
blt_add_library(NAME Spheral_${package_name}
92-
HEADERS ${${package_name}_headers}
93-
SOURCES ${${package_name}_sources}
94-
DEPENDS_ON ${_cxx_obj_list} ${SPHERAL_CXX_DEPENDS} ${SPHERAL_BLT_DEPENDS}
95-
SHARED TRUE)
87+
if(ENABLE_DEV_BUILD)
88+
install(TARGETS ${_cxx_obj_list}
89+
EXPORT ${export_target_name}
90+
DESTINATION lib)
91+
add_library(Spheral_${package_name} INTERFACE)
92+
target_link_libraries(Spheral_${package_name} INTERFACE ${_cxx_obj_list})
9693
else()
97-
# Build static spheral C++ library
94+
# Build static or shared spheral C++ library
9895
blt_add_library(NAME Spheral_${package_name}
9996
HEADERS ${${package_name}_headers}
10097
SOURCES ${${package_name}_sources}
10198
DEPENDS_ON ${_cxx_obj_list} ${SPHERAL_CXX_DEPENDS} ${SPHERAL_BLT_DEPENDS}
102-
SHARED FALSE)
99+
SHARED ${ENABLE_SHARED})
103100
endif()
104101
target_include_directories(Spheral_${package_name} SYSTEM PRIVATE ${SPHERAL_SUBMOD_INCLUDES})
105102
if(ENABLE_CUDA)
106103
set_target_properties(Spheral_${package_name} PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
107104
endif()
108105

109-
110106
## This cleans up library targets created with object libs. It is turned off as it triggers
111107
## a failure on Werror and pedantic builds.
112108
#set(_properties COMPILE_DEFINITIONS LINK_LIBRARIES LINK_OPTIONS INTERFACE_LINK_OPTIONS COMPILE_OPTIONS INTERFACE_COMPILE_OPTIONS)
@@ -118,15 +114,12 @@ function(spheral_add_cxx_library package_name _cxx_obj_list)
118114

119115
#set_target_properties(Spheral_${package_name} PROPERTIES INTERFACE_LINK_LIBRARIES "")
120116

121-
# Convert package name to lower-case for export target name
122-
string(TOLOWER ${package_name} lower_case_package)
123-
124117
# Install Spheral C++ target and set it as an exportable CMake target
125118
install(TARGETS Spheral_${package_name}
126119
DESTINATION lib
127-
EXPORT spheral_${lower_case_package}-targets)
120+
EXPORT ${export_target_name})
128121
# Export Spheral target
129-
install(EXPORT spheral_${lower_case_package}-targets DESTINATION lib/cmake)
122+
install(EXPORT ${export_target_name} DESTINATION lib/cmake)
130123

131124
# Set the r-path of the C++ lib such that it is independent of the build dir when installed
132125
set_target_properties(Spheral_${package_name} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")

cmake/spheral/SpheralInstallPythonFiles.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function(spheral_install_python_files)
1414
install(FILES ${ARGV}
1515
DESTINATION ${SPHERAL_SITE_PACKAGES_PATH}/Spheral)
1616
install(CODE "execute_process( \
17-
COMMAND ${PYTHON_EXE} -m compileall DESTINATION ${SPHERAL_SITE_PACKAGES_PATH}/Spheral \
17+
COMMAND ${PYTHON_EXE} -m compileall ${SPHERAL_SITE_PACKAGES_PATH}/Spheral \
1818
WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX})")
1919
endif()
2020

cmake/spheral_cxx-config.cmake.in

+8-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,14 @@ if(NOT SPHERAL_FOUND)
2323
find_package(Python3 COMPONENTS Interpreter Development)
2424
set(PYTHON_EXE ${Python3_EXECUTABLE})
2525
endif()
26-
27-
if(NOT TARGET axom)
28-
find_package(axom REQUIRED QUIET NO_DEFAULT_PATH PATHS ${axom_DIR} ${axom_DIR}/lib ${axom_DIR}/lib/cmake)
29-
endif()
26+
# Loop over TPLs that use find_package
27+
set(SPHERAL_FP_TPLS "@SPHERAL_FP_TPLS@")
28+
set(SPHERAL_FP_DIRS "@SPHERAL_FP_DIRS@")
29+
foreach(tpl dir IN ZIP_LISTS SPHERAL_FP_TPLS SPHERAL_FP_DIRS)
30+
if(NOT TARGET ${tpl})
31+
find_package(${tpl} REQUIRED QUIET NO_DEFAULT_PATH PATHS ${dir})
32+
endif()
33+
endforeach()
3034
if(NOT TARGET chai)
3135
if (@USE_EXTERNAL_CHAI@)
3236
set(SPHERAL_CHAI_DIR "@chai_DIR@/lib/cmake/chai")
@@ -47,7 +51,6 @@ if(NOT SPHERAL_FOUND)
4751
endif()
4852
endif()
4953
include("${SPHERAL_CXX_INSTALL_PREFIX}/lib/cmake/spheral_cxx-targets.cmake")
50-
5154
set_property(TARGET Spheral_CXX
5255
APPEND PROPERTY
5356
INTERFACE_INCLUDE_DIRECTORIES ${SPHERAL_CXX_INCLUDE_DIRS})

cmake/tpl/caliper.cmake

-1
This file was deleted.

docs/build_guide/include/appendecies/cmake_config.rst.inc

+24-22
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ For just the C++ compiled Spheral a number of TPLs are required:
2828
- Polyclipper
2929
- Conduit
3030
- Axom
31+
- Adiak
32+
- Caliper
3133

3234
There are also a number of libraries / python packages that are required for compiling the python bindings and executing Spheral at runtime:
3335

@@ -66,58 +68,58 @@ OpenMP and MPI support is handled through BLT. Use the option flags ``-DENABLE_
6668
CMake variables
6769
--------------------
6870

69-
In this section we list the CMake variables that can be tweaked for a Spheral build. Where appropriate the options are listed, with the default value in *italics*.
71+
In this section we list the CMake variables that can be tweaked for a Spheral build. Where appropriate the options are listed, with the default value in **bold**.
7072

71-
``CMAKE_BUILD_TYPE`` (Debug, *Release*, RelWithDebInfo, MinSizeRel)
73+
``CMAKE_BUILD_TYPE`` (Debug, **Release**, RelWithDebInfo, MinSizeRel)
7274
Choose the type of build -- for more information see the `CMake documentation <https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html>`_.
7375

7476
``CMAKE_INSTALL_PREFIX``
7577
The top-level path for installing Spheral include files, libraries, and any Python modules or documentation.
7678

77-
``ENABLE_CXXONLY`` (On, *Off*)
79+
``ENABLE_CXXONLY`` (On, **Off**)
7880
Do not build python wrappers for Spheral.
7981

80-
``ENABLE_STATIC_CXXONLY`` (On, *Off*)
82+
``ENABLE_STATIC_CXXONLY`` (On, **Off**)
8183
Do not build python wrappers for Spheral. Build and export static library files for Spheral.
8284

83-
``ENABLE_SHARED`` (*On*, Off)
85+
``ENABLE_SHARED`` (**On**, Off)
8486
Build Spheral C++ libraries as shared libraries.
8587

86-
``ENABLE_DEV_BUILD`` (On, *Off*)
88+
``ENABLE_DEV_BUILD`` (On, **Off**)
8789
Builds separate internal C++ libraries for faster code development.
8890

8991
``<TPL-Name-Here>_DIR``
9092
Directory of previously built TPL.
9193

92-
``ENABLE_STATIC_TPL`` (On, *Off*)
94+
``ENABLE_STATIC_TPL`` (On, **Off**)
9395
Link static libraries instead of shared for HDF5 and Conduit.
9496

95-
``ENABLE_OPENMP`` (*On*, Off)
97+
``ENABLE_OPENMP`` (**On**, Off)
9698
Support for OpenMP.
9799

98-
``ENABLE_MPI`` (*On*, Off)
100+
``ENABLE_MPI`` (**On**, Off)
99101
Support for MPI.
100102

101-
``ENABLE_1D`` (*On*, Off)
103+
``ENABLE_1D`` (**On**, Off)
102104
Build Spheral with 1D support.
103105

104-
``ENABLE_2D`` (*On*, Off)
106+
``ENABLE_2D`` (**On**, Off)
105107
Build Spheral with 2D support.
106108

107-
``ENABLE_3D`` (*On*, Off)
109+
``ENABLE_3D`` (**On**, Off)
108110
Build Spheral with 3D support.
109111

110-
``ENABLE_ANEOS`` (*On*, Off)
112+
``ENABLE_ANEOS`` (**On**, Off)
111113
Install the ANEOS (Analytics Equation of State) package along with the Spheral interface to it. This is a legacy equation of state frequently used for geophysical materials. See descriptions in the `iSALE <https://github.com/isale-code/M-ANEOS>`_ documentation.
112114

113-
``ENABLE_HELMHOLTZ`` (*On*, Off)
115+
``ENABLE_HELMHOLTZ`` (**On**, Off)
114116
Compile the included Helmholtz equation of state, typically used in astrophysical calculations. See a discussion `here <http://cococubed.asu.edu/code_pages/eos.shtml>`_.
115117

116-
``ENABLE_OPENSUBDIV`` (*On*, Off)
118+
``ENABLE_OPENSUBDIV`` (**On**, Off)
117119
Install the Opensubdiv library along with the Spheral interface to it. Opensubdiv is a `Pixar provided library <https://github.com/PixarAnimationStudios/OpenSubdiv>`_, which Spheral uses to implement refinement of polyhedra for some specialized problem generation capabilities.
118120

119-
``ENABLE_TIMER`` (*On*, Off)
120-
Enable timer information from Spheral.
121+
``ENABLE_TIMER`` (On, **Off**)
122+
Enable Caliper timer information for Spheral.
121123

122124
``DBC_MODE`` (None, All, Pre)
123125
Set the compile time design by contract (DBC) mode for Spheral. Design by contract statements are very useful developer tools, whereby the developer can insert tests in the code as they write it. These statements are both useful for tracking down bugs with fine-grained testing throughout the code, as well as useful documentation in the code about what sort of conditions are expected to hold.
@@ -138,23 +140,23 @@ In this section we list the CMake variables that can be tweaked for a Spheral bu
138140

139141
It is worth noting ``DBC_MODE=All`` is quite expensive at run time (of order 4x more), so this is not intended to be active for a release/production compilation of Spheral.
140142

141-
``ENABLE_WARNINGS`` (On, *Off*)
143+
``ENABLE_WARNINGS`` (On, **Off**)
142144
Enable compiler warnings.
143145

144-
``ENABLE_BOUNDCHECKING`` (On, *Off*)
146+
``ENABLE_BOUNDCHECKING`` (On, **Off**)
145147
If building with the Gnu compilers enable STL bound checking by passing -D_GLIBCXX_DEBUG=1 to the compiler.
146148
Note, this is a very expensive option at runtime!
147149

148-
``ENABLE_NAN_EXCEPTIONS`` (On, *Off*)
150+
``ENABLE_NAN_EXCEPTIONS`` (On, **Off**)
149151
Raise exceptions in the C++ code when floating-point exceptions occur. Gnu compilers only.
150152

151-
``ENABLE_DOCS`` (On, *Off*)
153+
``ENABLE_DOCS`` (On, **Off**)
152154
Choose whether or not to build this documentation.
153155

154156
``SPHINX_EXECUTABLE``
155157
Specify where the Sphinx executable is that should be used to build documentation. If not given, assumes the Spheral built Sphinx will be used.
156158

157-
``SPHINX_THEME`` (*sphinx_rtd_theme*)
159+
``SPHINX_THEME`` (**sphinx_rtd_theme**)
158160
Give the Sphinx theme to use when generating documentation. Default based on read the docs theme.
159161

160162
``SPHINX_THEME_DIR``

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# -- Project information -----------------------------------------------------
2323

2424
project = 'Spheral'
25-
copyright = '2012, LLNS'
25+
copyright = '2024, LLNS'
2626
author = 'J. Michael Owen'
2727

2828
# The short X.Y version

docs/conf.py.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import sphinx_rtd_theme
2222
# -- Project information -----------------------------------------------------
2323

2424
project = 'Spheral'
25-
copyright = '2012, LLNS'
25+
copyright = '2024, LLNS'
2626
author = 'J. Michael Owen'
2727

2828
# The short X.Y version

0 commit comments

Comments
 (0)