Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value-View Interface #289

Open
wants to merge 45 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
0907d56
Bringing over Value/View Interface headers and tests from research br…
mdavis36 Jul 23, 2024
8451ecf
Deleting ManagedSmartPtr and MVSmartRef classes and tests. They will …
mdavis36 Jul 23, 2024
d12c687
Adding testTRTField python test used during constexpr PYB11 developm…
mdavis36 Jul 23, 2024
01598a9
Deleting SphArrayInline/Inst. We are not using the old iterator class…
mdavis36 Jul 23, 2024
ee4a68c
Changing header includes SphArray -> ManagedVector.hh
mdavis36 Jul 23, 2024
c800c08
Re-organizing test locations, many tests are basic integration/exampl…
mdavis36 Jul 23, 2024
5990faa
Move QInt example class into test file.
mdavis36 Jul 23, 2024
5c04efe
Re-naming value-view tests to identify the design pattern used.
mdavis36 Jul 23, 2024
a8ddc5f
Adding a basic value-view interface example using metaclass macros.
mdavis36 Jul 23, 2024
29ee8fa
Merge branch 'develop' into feature/value-view-interface
mdavis36 Jul 30, 2024
df6c88f
Adding SCIP macros.
mdavis36 Jul 30, 2024
708cc2a
Moving Value View Interface under vvi namespace; Naming convention an…
mdavis36 Aug 22, 2024
2b5d3e7
SCIP -> VVI; Organizing VVI pattern into header file and impl file, t…
mdavis36 Aug 23, 2024
1e33c49
namespace changes to match documentation; VVI_VIEW_DEFAULT explicitly…
mdavis36 Aug 28, 2024
55f5174
Macros for wimplifying deepCopy and compare methods in Impl classes; …
mdavis36 Aug 30, 2024
383fed8
Empty DEEPCOPY & COMPARE member case; adding DECL_DEFAULT example in …
mdavis36 Aug 30, 2024
c09dacb
Using shorthand class defs in examples; Removing unnecessary macros f…
mdavis36 Aug 30, 2024
f3f5d36
Implmenting VVI for QuadraticInterpolator; Resolving Pedantic for war…
mdavis36 Sep 6, 2024
df81f95
Dealing w/ multi line comment warnings.
mdavis36 Sep 7, 2024
43cd543
SPHERAL_ENABLE_VVI for cuda build.
mdavis36 Sep 7, 2024
4a43482
Deleting unused tests/ directory.
mdavis36 Sep 7, 2024
dd82347
rm Kernel dir.
mdavis36 Sep 7, 2024
d850f67
QI tests for VVI on/off
mdavis36 Sep 9, 2024
9f48781
Adding --test option to hcb.py to run make test during CI.
mdavis36 Sep 9, 2024
ad518f0
Removing comment from MV impl.
mdavis36 Sep 9, 2024
74201bb
Turn off blt target printing.
mdavis36 Sep 9, 2024
3747afa
Cleaning up field tests.
mdavis36 Sep 9, 2024
9f29207
Hopefully fixing segfault blt_mpi_smoke test on ruby; Silencing warni…
mdavis36 Sep 10, 2024
78cbad2
Adding documentation for using the Value-View Interface.
mdavis36 Sep 10, 2024
6b5c8bd
Fixing title levels.
mdavis36 Sep 11, 2024
db42935
Merge branch 'develop' into feature/value-view-interface
mdavis36 Sep 11, 2024
bc65da2
put config header in the correct directory when spheral is a submodule.
mdavis36 Sep 11, 2024
b57181b
Do not clear INTERFACE_LINK_LIBRARIES
mdavis36 Sep 12, 2024
d4cada3
Updating Relaese notes for VVI PR.
mdavis36 Sep 13, 2024
3566f3d
Removing unnecessary comment and configuration of config.in
mdavis36 Sep 16, 2024
d1dc378
Formatting vvi docs.
mdavis36 Sep 17, 2024
988adcc
Merge branch 'develop' into feature/value-view-interface
mdavis36 Sep 27, 2024
0bbe7d6
Fixing CMake tests merge issue.
mdavis36 Sep 30, 2024
06b0492
Merge branch 'develop' into feature/value-view-interface
mdavis36 Oct 14, 2024
64afaa3
Merge branch 'develop' into feature/value-view-interface
mdavis36 Oct 14, 2024
c9c6e61
Fixed typo
jmikeowen Oct 14, 2024
c4eb45b
Merge branch 'develop' into feature/value-view-interface
jmikeowen Oct 15, 2024
59d37d5
Moving ENABLE_DEV_BUILD CI test to clang on toss4
jmikeowen Oct 16, 2024
0139307
Change gcc version on ansel to 10.2.1
ldowen Oct 21, 2024
3ec887d
Bring blueos gcc version back to 8.3.1
ldowen Oct 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitlab/machines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
variables:
HOSTNAME: 'ruby'
PARTITION: pdebug
BUILD_ALLOC: srun -N 1 -c 36 -p pdebug -t 60
BUILD_ALLOC: salloc -N 1 -p pdebug -t 60 --exclusive
TEST_ALLOC: ''
CLEAN_ALLOC: srun -n 20
extends: [.on_toss_4_x86]
Expand Down
6 changes: 1 addition & 5 deletions .gitlab/scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@
script:
- CI_BUILD_DIR=$(cat ci-dir.txt)
- cd $CI_BUILD_DIR && cat job-name.txt
- $BUILD_ALLOC ./$SCRIPT_DIR/devtools/host-config-build.py --host-config gitlab.cmake --build $EXTRA_CMAKE_ARGS
artifacts:
paths:
- ci-dir.txt
- job-name.txt
- $BUILD_ALLOC ./$SCRIPT_DIR/devtools/host-config-build.py --host-config gitlab.cmake --build --test $EXTRA_CMAKE_ARGS

.build_and_test:
extends: [.build]
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
.cuda_11_gcc_spectrum:
variables:
SPEC: 'gcc@$GCC_VERSION+cuda cuda_arch=70'
EXTRA_CMAKE_ARGS: '-DENABLE_TIMER=On'
EXTRA_CMAKE_ARGS: '-DENABLE_TIMER=On -DSPHERAL_ENABLE_VVI=On'

.oneapi_2022_1_mvapich2:
variables:
Expand Down
9 changes: 9 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ Version vYYYY.MM.p -- Release date YYYY-MM-DD
Notable changes include:

* New features / API changes:
* Value-View Interface for wrapping comlex classes in a GPU compatible Interface.
* Enabled w/ `SPHERAL_ENABLE_VVI=On`.
* Example executables demonstrating :
* Basic class w/ ManagedVector member.
* CRTP pattern.
* `Spheral::Field` like structure w/ an abstract inferface base class.
* VVI Implmenetation of `Spheral::QuadraticInterpolator`.
* CTest unit tests for `QuadraticInterpolator` and `Field`.
* CTest runs during GitlabCI build stage.
* MPI variables are now wrapped as
```
SPHERAL_OP_SUM, SPHERAL_OP_MAX, SPHERAL_OP_MIN
Expand Down
9 changes: 9 additions & 0 deletions cmake/CMakeDefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ else()
add_definitions("-DDEBUG=0")
endif()

if (SPHERAL_ENABLE_VVI)
message("-- Value-View Interface Pattern (VVI) : Enabled")
message("------ WARNING ------")
message("-- VVI is an experimental implementation necessary for the GPU port. Use with caution!")
message("---------------------")
else()
message("-- Semantic Class Interface Pattern (VVI) : Disabled")
endif()

# The DBC flag
if (DBC_MODE STREQUAL "All")
message("-- DBC (design by contract) set to All")
Expand Down
2 changes: 2 additions & 0 deletions cmake/InstallTPLs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ message("-----------------------------------------------------------------------
find_package(RAJA REQUIRED NO_DEFAULT_PATH PATHS ${raja_DIR})
if (RAJA_FOUND)
message("Found RAJA External Package.")
blt_convert_to_system_includes(TARGET RAJA)
endif()
message("-----------------------------------------------------------------------------")
find_package(umpire REQUIRED NO_DEFAULT_PATH PATHS ${umpire_DIR})
if (umpire_FOUND)
message("Found umpire External Package.")
blt_convert_to_system_includes(TARGET umpire)
Copy link
Collaborator

@ptsuji ptsuji Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this blt_convert_to_system_includes() stuff also be in the block under "Found chai External Package" (and any other packages which could be found externally)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I`ll add it to CHAI. We already do this for all other external packages on line 127.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't do it for the packages we use find_package on. We only do it on packages we manually bring in. Was this necessary for your stuff?

Copy link
Collaborator Author

@mdavis36 mdavis36 Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was, pedantic warnings from RAJA and umpire were causing our WARNINGS_AS_ERRORS builds to fail.

endif()
message("-----------------------------------------------------------------------------")

Expand Down
13 changes: 13 additions & 0 deletions cmake/SetupSpheral.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ if (NOT SPHERAL_CMAKE_MODULE_PATH)
endif()
list(APPEND CMAKE_MODULE_PATH "${SPHERAL_CMAKE_MODULE_PATH}")

#-------------------------------------------------------------------------------
# Add Spheral CMake Macros for tests and executables
#-------------------------------------------------------------------------------
include(SpheralMacros)

#-------------------------------------------------------------------------------
# Set Compiler Flags / Options
#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -85,7 +90,10 @@ if(ENABLE_CUDA)
#set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -arch=${CUDA_ARCH} --expt-relaxed-constexpr --extended-lambda -Xcudafe --display_error_number")
set(CMAKE_CUDA_STANDARD 17)
list(APPEND SPHERAL_CXX_DEPENDS cuda)
set(SPHERAL_ENABLE_CUDA On)
set(SPHERAL_ENABLE_VVI On)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the Value-View interface be enabled for CPU builds as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be used for CPU builds but it is required for any GPU builds where we will be executing on the device. This just ensures it's enabled if you are building spheral w/ cuda.

endif()
message("Enable Value-View Interface Pattern (VVI) : ${SPHERAL_ENABLE_VVI}")

#-------------------------------------------------------------------------------#
# Set a default build type if none was specified
Expand Down Expand Up @@ -140,6 +148,10 @@ set_property(GLOBAL PROPERTY SPHERAL_CXX_DEPENDS "${SPHERAL_CXX_DEPENDS}")
#-------------------------------------------------------------------------------
# Prepare to build the src
#-------------------------------------------------------------------------------
configure_file(${SPHERAL_ROOT_DIR}/src/config.hh.in
mdavis36 marked this conversation as resolved.
Show resolved Hide resolved
${PROJECT_BINARY_DIR}/src/config.hh)
include_directories(${PROJECT_BINARY_DIR}/src)

add_subdirectory(${SPHERAL_ROOT_DIR}/src)

#-------------------------------------------------------------------------------
Expand All @@ -153,6 +165,7 @@ endif()
# Build C++ tests and install tests to install directory
#-------------------------------------------------------------------------------
if (ENABLE_TESTS)
add_subdirectory(${SPHERAL_ROOT_DIR}/tests)
add_subdirectory(${SPHERAL_ROOT_DIR}/tests/unit/CXXTests)

# A macro to preserve directory structure when installing files
mdavis36 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
87 changes: 87 additions & 0 deletions cmake/SpheralMacros.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
macro(spheral_add_executable)
set(options )
set(singleValueArgs NAME TEST REPRODUCER BENCHMARK)
set(multiValueArgs SOURCES DEPENDS_ON)

cmake_parse_arguments(arg
"${options}" "${singleValueArgs}" "${multiValueArgs}" ${ARGN})

if (ENABLE_OPENMP)
list (APPEND arg_DEPENDS_ON openmp)
endif ()

if (ENABLE_CUDA)
list (APPEND arg_DEPENDS_ON cuda)
endif ()

if (ENABLE_HIP)
list (APPEND arg_DEPENDS_ON blt::hip)
list (APPEND arg_DEPENDS_ON blt::hip_runtime)
endif ()

if (${arg_TEST})
set (_output_dir ${CMAKE_BINARY_DIR}/test)
elseif (${arg_REPRODUCER})
set (_output_dir ${CMAKE_BINARY_DIR}/reproducers)
elseif (${arg_BENCHMARK})
set (_output_dir ${CMAKE_BINARY_DIR}/benchmark)
else ()
set (_output_dir ${CMAKE_BINARY_DIR}/bin)
endif()

blt_add_executable(
NAME ${arg_NAME}
SOURCES ${arg_SOURCES}
DEPENDS_ON ${arg_DEPENDS_ON}
OUTPUT_DIR ${_output_dir}
)

target_include_directories(${arg_NAME} SYSTEM PRIVATE ${SPHERAL_EXTERN_INCLUDES})
target_include_directories(${arg_NAME} SYSTEM PRIVATE ${SPHERAL_ROOT_DIR}/src)
target_include_directories(${arg_NAME} SYSTEM PRIVATE ${PROJECT_BINARY_DIR}/src)

endmacro(spheral_add_executable)

macro(spheral_add_test)
set(options DEBUG_LINKER)
set(singleValueArgs NAME)
set(multiValueArgs SOURCES DEPENDS_ON)

cmake_parse_arguments(arg
"${options}" "${singleValueArgs}" "${multiValueArgs}" ${ARGN})

set(original_test_name ${arg_NAME})
set(original_src ${arg_SOURCES})
set(original_deps ${arg_DEPENDS_ON})

get_property(SPHERAL_BLT_DEPENDS GLOBAL PROPERTY SPHERAL_BLT_DEPENDS)

blt_add_library(
NAME ${original_test_name}_lib
SOURCES ${TEST_LIB_SOURCE}
SOURCES ${SPHERAL_ROOT_DIR}/src/spheralCXX.cc
DEPENDS_ON ${SPHERAL_BLT_DEPENDS} ${original_deps}
SHARED False
)

target_link_options(${original_test_name}_lib PRIVATE "-Wl,--unresolved-symbols=ignore-in-object-files")

spheral_add_executable(
NAME ${original_test_name}.exe
SOURCES ${original_src}
DEPENDS_ON gtest ${CMAKE_THREAD_LIBS_INIT} ${original_test_name}_lib
TEST On)

blt_add_test(
NAME ${original_test_name}
COMMAND ${TEST_DRIVER} ${original_test_name}.exe)

target_include_directories(${original_test_name}.exe SYSTEM PRIVATE ${SPHERAL_ROOT_DIR}/tests/cpp/include)

if (${arg_DEBUG_LINKER})
target_link_options(${original_test_name}.exe PUBLIC "-Wl,--warn-unresolved-symbols")
else()
target_link_options(${original_test_name}.exe PUBLIC "-Wl,--unresolved-symbols=ignore-all")
endif()

endmacro(spheral_add_test)
3 changes: 3 additions & 0 deletions docs/build_guide/include/appendecies/cmake_config.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ In this section we list the CMake variables that can be tweaked for a Spheral bu
``ENABLE_DEV_BUILD`` (On, *Off*)
Builds separate internal C++ libraries for faster code development.

``SPHERAL_ENABLE_VVI`` (On, *Off*)
Builds Spheral with the experimental Value-View Interface for GPU porting capabilities.

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

Expand Down
Loading
Loading