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

Create semi-structured Hypre solver interface for multi-variate systems #632

Merged
merged 41 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
98056af
Initial template of implementation of a Semi-Structured Hypre interfa…
lebuller May 10, 2023
ef224c4
Fixes to the semi-structured solver hypre interface in Cajita
lebuller May 11, 2023
79c03c0
Merge branch 'ECP-copa:master' into hypre_sstruct
lebuller May 11, 2023
e57ab13
Merge branch 'ECP-copa:master' into hypre_sstruct
lebuller May 15, 2023
af43471
Merge branch 'ECP-copa:master' into hypre_sstruct
lebuller May 18, 2023
d15933c
Makes changes to the Hypre Semi-Structured solver and creates and ini…
lebuller May 22, 2023
d7c6388
Updates to the semi-structured hypre solver and the related unit test…
lebuller May 23, 2023
f61f2a9
Adds calls to HYPRE_Init and HYPRE_Finalize to the hypre structured s…
lebuller May 23, 2023
40aaaa8
Merge pull request #1 from lebuller/hypre_init
lebuller May 23, 2023
e9231d5
Adds calls to HYPRE_Init and HYPRE_Finalize, as well as commenting ou…
lebuller May 23, 2023
7bed193
Merge branch 'ECP-copa:master' into hypre_sstruct
lebuller May 25, 2023
9662aa7
Moves HYPRE_Init and HYPRE_Finalize calls to examples/tests from the …
lebuller May 25, 2023
4197ffa
Merge remote-tracking branch 'origin/hypre_sstruct' into hypre_sstruct
lebuller May 25, 2023
d76442d
Adds multi-variate unit test and example for hypre (currently incompl…
lebuller May 30, 2023
4c336f9
Fixes multivariate usage for semi-structured solver
lebuller May 31, 2023
0099647
Alters semi-structured solver to talk varied stencil structures
lebuller Jun 2, 2023
abb8b24
Changes to interface between hypre LHS/RHS vectors and caban LHS/RHS …
lebuller Jun 5, 2023
5d49195
Fixes view handling when passing vector values to and from Hypre in m…
lebuller Jun 7, 2023
49cdff0
Merge branch 'master' into hypre_sstruct
lebuller Jun 7, 2023
4d82fcc
Cleanup for HypreSemiStructuredSolver
lebuller Jun 8, 2023
1fff289
Pass variable output file prefix to hypre print functions in the stru…
lebuller Jun 8, 2023
3e45edc
Fix error in matrix print for Hypre structured solver
lebuller Jun 8, 2023
b3afcfc
format
streeve Jun 14, 2023
0f11b7a
Convert hypre copies to per-variable subviews
streeve Jun 14, 2023
18cbc3e
Nicer form of copying data to and from hypre vector using subview
lebuller Jun 14, 2023
34a5c09
doxygen formatting
lebuller Jun 14, 2023
43a5db9
format
streeve Jun 15, 2023
dd5bd1d
Fix Dependency issue in SemiStrucutred Jacobi Preconditioner
lebuller Jun 19, 2023
3088803
Doxygen formatting
lebuller Jun 19, 2023
9c90ce5
fixup: ignore hypre derived impl for doxygen
streeve Jun 22, 2023
1048811
Addressing PR comments
lebuller Jun 23, 2023
4ddf12c
removes single-variate example for semi-structured solver and address…
lebuller Jul 6, 2023
330fa36
format
lebuller Jul 6, 2023
ee74864
Adds comment to commented out PFMG semi-strucutred test
lebuller Jul 7, 2023
45909cb
Remove unsupported PFMG solver class and tests
lebuller Jul 20, 2023
f34766a
Remove Jacobi preconditioner option for semi-structured solver + cleanup
lebuller Aug 9, 2023
127e492
Remove jacobi preconditioner from semi-structured example
lebuller Aug 9, 2023
1416b10
Fix bug with setting matrix values in coupled multi-variate solve
lebuller Aug 9, 2023
5636289
Final fixup for Hypre semi-structured solver
lebuller Aug 23, 2023
7fc5476
format
streeve Aug 24, 2023
3f20e2b
Update comments
streeve Aug 24, 2023
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: 2 additions & 0 deletions cajita/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ set(HEADERS_PUBLIC

if(Cabana_ENABLE_HYPRE)
list(APPEND HEADERS_PUBLIC
Cajita_Hypre.hpp
Cajita_HypreStructuredSolver.hpp
Cajita_HypreSemiStructuredSolver.hpp
)
endif()

Expand Down
2 changes: 2 additions & 0 deletions cajita/src/Cajita.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
#include <Cajita_UniformDimPartitioner.hpp>

#ifdef Cabana_ENABLE_HYPRE
#include <Cajita_Hypre.hpp>
#include <Cajita_HypreSemiStructuredSolver.hpp>
streeve marked this conversation as resolved.
Show resolved Hide resolved
#include <Cajita_HypreStructuredSolver.hpp>
#endif

Expand Down
85 changes: 85 additions & 0 deletions cajita/src/Cajita_Hypre.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/****************************************************************************
* Copyright (c) 2018-2022 by the Cabana authors *
* All rights reserved. *
* *
* This file is part of the Cabana library. Cabana is distributed under a *
* BSD 3-clause license. For the licensing terms see the LICENSE file in *
* the top-level directory. *
* *
* SPDX-License-Identifier: BSD-3-Clause *
****************************************************************************/

/*!
\file Cajita_HypreStructuredSolver.hpp
streeve marked this conversation as resolved.
Show resolved Hide resolved
\brief HYPRE structured solver interface
*/
#ifndef CAJITA_HYPRE_HPP
#define CAJITA_HYPRE_HPP

#include <HYPRE_config.h>
#include <HYPRE_struct_ls.h>
#include <HYPRE_struct_mv.h>

#include <Kokkos_Core.hpp>

#include <memory>

namespace Cajita
{
//---------------------------------------------------------------------------//
// Hypre memory space selection. Don't compile if HYPRE wasn't configured to
// use the device.
// ---------------------------------------------------------------------------//

//! Hypre device compatibility check.
template <class MemorySpace>
struct HypreIsCompatibleWithMemorySpace : std::false_type
{
};

// FIXME: This is currently written in this structure because HYPRE only has
// compile-time switches for backends and hence only one can be used at a
// time. Once they have a run-time switch we can use that instead.
#ifdef HYPRE_USING_CUDA
#ifdef KOKKOS_ENABLE_CUDA
#ifdef HYPRE_USING_DEVICE_MEMORY
//! Hypre device compatibility check - CUDA memory.
template <>
struct HypreIsCompatibleWithMemorySpace<Kokkos::CudaSpace> : std::true_type
{
};
#endif // end HYPRE_USING_DEVICE_MEMORY

//! Hypre device compatibility check - CUDA UVM memory.
#ifdef HYPRE_USING_UNIFIED_MEMORY
template <>
struct HypreIsCompatibleWithMemorySpace<Kokkos::CudaUVMSpace> : std::true_type
{
};
#endif // end HYPRE_USING_UNIFIED_MEMORY
#endif // end KOKKOS_ENABLE_CUDA
#endif // end HYPRE_USING_CUDA

#ifdef HYPRE_USING_HIP
#ifdef KOKKOS_ENABLE_HIP
//! Hypre device compatibility check - HIP memory. FIXME - make this true when
//! the HYPRE CMake includes HIP
template <>
struct HypreIsCompatibleWithMemorySpace<Kokkos::ExperimentalHIPSpace>
streeve marked this conversation as resolved.
Show resolved Hide resolved
: std::false_type
{
};
#endif // end KOKKOS_ENABLE_HIP
#endif // end HYPRE_USING_HIP

#ifndef HYPRE_USING_GPU
//! Hypre device compatibility check - host memory.
template <>
struct HypreIsCompatibleWithMemorySpace<Kokkos::HostSpace> : std::true_type
{
};
#endif // end HYPRE_USING_GPU

} // namespace Cajita

#endif // end HYPRE_HPP
Loading