Skip to content

Commit ba9c382

Browse files
committed
Reapply cuDSS support after merging origin/main into PR #717 branch
1 parent 5dd4bc4 commit ba9c382

20 files changed

Lines changed: 2690 additions & 53 deletions

File tree

.github/license-check/c.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
21
// SPDX-License-Identifier: Apache-2.0

CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ set(PALACE_WITH_GSLIB ON CACHE BOOL "Build with GSLIB library for high-order fie
4141
set(PALACE_WITH_STRUMPACK_BUTTERFLYPACK OFF CACHE BOOL "Build with ButterflyPACK support for STRUMPACK solver")
4242
set(PALACE_WITH_STRUMPACK_ZFP OFF CACHE BOOL "Build with ZFP support for STRUMPACK solver")
4343

44+
set(CUDSS_DIR "" CACHE STRING
45+
"Path to cuDSS installation directory (not required if already on CMAKE_PREFIX_PATH)"
46+
)
47+
4448
set(PALACE_WITH_SUNDIALS ON CACHE BOOL "Build with SUNDIALS differential/algebraic equations solver")
4549

4650
set(ANALYZE_SOURCES_CLANG_TIDY OFF CACHE BOOL "Run static analysis checks using clang-tidy")
@@ -58,6 +62,9 @@ endif()
5862
if(PALACE_WITH_CUDA AND PALACE_WITH_HIP)
5963
message(FATAL_ERROR "PALACE_WITH_CUDA is not compatible with PALACE_WITH_HIP")
6064
endif()
65+
if(PALACE_WITH_CUDSS AND NOT PALACE_WITH_CUDA)
66+
message(FATAL_ERROR "PALACE_WITH_CUDSS requires PALACE_WITH_CUDA")
67+
endif()
6168
if(PALACE_WITH_CUDA)
6269
# Note: The new behavior of CMake policy CMP0104 will initialize CMAKE_CUDA_ARCHITECTURES
6370
# to an (old) compatible value even when not set by the user.
@@ -151,11 +158,6 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Intel" OR CMAKE_CXX_COMPILER_ID STREQUAL "Intel
151158
have been replaced by the newer Clang-based icx/icpx from Intel oneAPI")
152159
endif()
153160

154-
# cuDSS is only for CUDA builds
155-
if(PALACE_WITH_CUDSS AND NOT PALACE_WITH_CUDA)
156-
message(FATAL_ERROR "PALACE_WITH_CUDSS requires PALACE_WITH_CUDA")
157-
endif()
158-
159161
# MAGMA is only for GPU builds
160162
if(PALACE_WITH_MAGMA AND NOT (PALACE_WITH_CUDA OR PALACE_WITH_HIP))
161163
message(STATUS "Disabling MAGMA due to lack of CUDA or HIP support")

cmake/ExternalGitTags.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ set(EXTERN_METIS_GIT_TAG
125125

126126
# MFEM
127127
set(EXTERN_MFEM_URL
128-
"https://github.com/yuyangdai/mfem.git" CACHE STRING
128+
"https://github.com/mfem/mfem.git" CACHE STRING
129129
"URL for external MFEM build"
130130
)
131131
set(EXTERN_MFEM_GIT_BRANCH
132-
"cudss-dev" CACHE STRING
132+
"master" CACHE STRING
133133
"Git branch for external MFEM build"
134134
)
135135
set(EXTERN_MFEM_GIT_TAG
136-
"e217864f168acb1d7bdb3fd7c5aa73ef81951237" CACHE STRING
136+
"d9d6526cc1749980a2ba1da16e2c1ca1e07d82ec" CACHE STRING
137137
"Git tag for external MFEM build"
138138
)
139139

cmake/ExternalMFEM.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ if(PALACE_WITH_CUDA)
123123
"-DCMAKE_CUDA_FLAGS=${MFEM_CUDA_FLAGS}"
124124
"-DMFEM_USE_CUDSS=${PALACE_WITH_CUDSS}"
125125
)
126-
if(PALACE_WITH_CUDSS)
126+
if(PALACE_WITH_CUDSS AND NOT "${CUDSS_DIR}" STREQUAL "")
127127
list(APPEND MFEM_OPTIONS
128128
"-DCUDSS_DIR=${CUDSS_DIR}"
129129
)
@@ -407,6 +407,7 @@ set(MFEM_PATCH_FILES
407407
"${CMAKE_SOURCE_DIR}/extern/patch/mfem/patch_gmsh_parser_performance.diff"
408408
"${CMAKE_SOURCE_DIR}/extern/patch/mfem/mfem_pr5246.diff"
409409
"${CMAKE_SOURCE_DIR}/extern/patch/mfem/mfem_pr5353.diff"
410+
"${CMAKE_SOURCE_DIR}/extern/patch/mfem/mfem_pr5124_cudss.diff"
410411
)
411412

412413
include(ExternalProject)

cmake/ExternalPalace.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ if(NOT "${MUMPS_DIR}" STREQUAL "")
4545
elseif(PALACE_BUILD_EXTERNAL_DEPS AND PALACE_WITH_MUMPS)
4646
list(APPEND PALACE_OPTIONS "-DMUMPS_DIR=${CMAKE_INSTALL_PREFIX}")
4747
endif()
48+
if(PALACE_WITH_CUDSS AND NOT "${CUDSS_DIR}" STREQUAL "")
49+
list(APPEND PALACE_OPTIONS "-DCUDSS_DIR=${CUDSS_DIR}")
50+
endif()
4851
if(NOT "${STRUMPACK_DIR}" STREQUAL "")
4952
list(APPEND PALACE_OPTIONS "-DSTRUMPACK_DIR=${STRUMPACK_DIR}")
5053
elseif(PALACE_BUILD_EXTERNAL_DEPS AND PALACE_WITH_STRUMPACK)
@@ -55,9 +58,6 @@ if(NOT "${SUPERLU_DIST_DIR}" STREQUAL "")
5558
elseif(PALACE_BUILD_EXTERNAL_DEPS AND PALACE_WITH_SUPERLU)
5659
list(APPEND PALACE_OPTIONS "-DSUPERLU_DIST_DIR=${CMAKE_INSTALL_PREFIX}")
5760
endif()
58-
if(PALACE_WITH_CUDSS AND NOT "${CUDSS_DIR}" STREQUAL "")
59-
list(APPEND PALACE_OPTIONS "-DCUDSS_DIR=${CUDSS_DIR}")
60-
endif()
6161
if(NOT "${METIS_DIR}" STREQUAL "")
6262
list(APPEND PALACE_OPTIONS "-DMETIS_DIR=${METIS_DIR}")
6363
elseif(PALACE_BUILD_EXTERNAL_DEPS)

docs/src/config/solver.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,9 @@ equations to be solved for each simulation type. The available options are:
512512
uses a real approximation to the true complex linear system matrix. This option is only
513513
available when *Palace* has been
514514
[built with MUMPS support](../install.md#Configuration-options).
515+
- `"cuDSS"` : The [NVIDIA cuDSS](https://developer.nvidia.com/cudss) GPU sparse
516+
direct solver is used to factorize the system matrix. This option is only available
517+
when *Palace* has been built with CUDA and cuDSS support.
515518
- `"AMS"` : Hypre's
516519
[Auxiliary-space Maxwell Solver (AMS)](https://hypre.readthedocs.io/en/latest/solvers-ams.html),
517520
an algebraic multigrid (AMG)-based preconditioner.

docs/src/install.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ Additional build options are (with default values in brackets):
192192
- `PALACE_WITH_SUPERLU [ON]` : Build with SuperLU_DIST sparse direct solver
193193
- `PALACE_WITH_STRUMPACK [OFF]` : Build with STRUMPACK sparse direct solver
194194
- `PALACE_WITH_MUMPS [OFF]` : Build with MUMPS sparse direct solver
195+
- `PALACE_WITH_CUDSS [OFF]` : Build with cuDSS sparse direct solver (requires
196+
`PALACE_WITH_CUDA=ON` and a cuDSS installation, optionally specified with `CUDSS_DIR`)
195197
- `PALACE_WITH_SLEPC [ON]` : Build with SLEPc eigenvalue solver
196198
- `PALACE_WITH_ARPACK [OFF]` : Build with ARPACK eigenvalue solver
197199
- `PALACE_WITH_LIBXSMM [ON]` : Build with LIBXSMM backend for libCEED
@@ -255,7 +257,8 @@ installation of [libCEED](https://github.com/CEED/libCEED), and
255257

256258
As part of the [Build from source](#Build-from-source), the CMake build will automatically
257259
build and install a small number of third-party dependencies before building *Palace*. The
258-
source code for these dependencies is downloaded during the build process:
260+
source code for these dependencies is downloaded during the build process (except for
261+
binary/user-provided packages such as cuDSS):
259262

260263
- [METIS](http://glaros.dtc.umn.edu/gkhome/metis/metis/overview) and
261264
[ParMETIS](http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview)
@@ -267,6 +270,7 @@ source code for these dependencies is downloaded during the build process:
267270
[ButterflyPACK](https://github.com/liuyangzhuan/ButterflyPACK) and
268271
[zfp](https://github.com/LLNL/zfp) support
269272
- [MUMPS](http://mumps.enseeiht.fr/) (optional, when `PALACE_WITH_MUMPS=ON`)
273+
- [cuDSS](https://developer.nvidia.com/cudss) (optional, when `PALACE_WITH_CUDSS=ON`)
270274
- [SLEPc](https://slepc.upv.es/) (optional, when `PALACE_WITH_SLEPC=ON`), including
271275
[PETSc](https://petsc.org/release/)
272276
- [ARPACK-NG](https://github.com/opencollab/arpack-ng) (optional, when
@@ -280,8 +284,8 @@ source code for these dependencies is downloaded during the build process:
280284
- [Eigen](https://eigen.tuxfamily.org)
281285

282286
For solving eigenvalue problems, at least one of SLEPc or ARPACK-NG must be specified.
283-
Typically only one of the SuperLU_DIST, STRUMPACK, and MUMPS dependencies is required but
284-
all can be built so the user can decide at runtime which solver to use.
287+
Typically only one of the SuperLU_DIST, STRUMPACK, MUMPS, and cuDSS dependencies is
288+
required but all can be built so the user can decide at runtime which solver to use.
285289

286290
For unit testing, *Palace* relies on the [Catch2
287291
library](https://github.com/catchorg/Catch2), which is automatically downloaded

0 commit comments

Comments
 (0)