Skip to content

Commit f724464

Browse files
authored
Merge pull request #1191 from CEED/jrwrigh/fix_petsc_build
fix: Update DMGetRegionDS calls in examples/petsc
2 parents a86a87b + db3e7f9 commit f724464

File tree

10 files changed

+14
-43
lines changed

10 files changed

+14
-43
lines changed

doc/sphinx/source/releasenotes.md

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ For example, `CeedOperatorContextGetFieldLabel` was renamed to `CeedOperatorGetC
1717
- Update `/cpu/self/memcheck/*` backends to help verify `CeedVector` array access assumptions and `CeedQFunction` user output assumptions.
1818
- Update {c:func}`CeedOperatorLinearAssembleDiagonal` to provide default implementation that supports `CeedOperator` with multiple active bases.
1919

20+
### Examples
21+
22+
#### {ref}`example-petsc-bps`
23+
24+
- Requires PETSc version 3.19 or later
25+
2026
(v0-11)=
2127

2228
## v0.11 (Dec 24, 2022)

examples/fluids/navierstokes.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
// -----------------------------------------------------------------------------
2020
// PETSc Version
2121
// -----------------------------------------------------------------------------
22-
#if PETSC_VERSION_LT(3, 17, 0)
23-
#error "PETSc v3.17 or later is required"
22+
#if PETSC_VERSION_LT(3, 19, 0)
23+
#error "PETSc v3.19 or later is required"
2424
#endif
2525

2626
// -----------------------------------------------------------------------------

examples/petsc/area.c

-7
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,6 @@ static const char help[] = "Compute surface area of a cube or a cubed-sphere usi
5151
#include "include/petscversion.h"
5252
#include "include/structs.h"
5353

54-
#if PETSC_VERSION_LT(3, 12, 0)
55-
#ifdef PETSC_HAVE_CUDA
56-
#include <petsccuda.h>
57-
// Note: With PETSc prior to version 3.12.0, providing the source path to include 'cublas_v2.h' will be needed to use 'petsccuda.h'.
58-
#endif
59-
#endif
60-
6154
#ifndef M_PI
6255
#define M_PI 3.14159265358979323846
6356
#endif

examples/petsc/bps.c

-7
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@ const char help[] = "Solve CEED BPs using PETSc with DMPlex\n";
4747
#include "include/petscversion.h"
4848
#include "include/structs.h"
4949

50-
#if PETSC_VERSION_LT(3, 12, 0)
51-
#ifdef PETSC_HAVE_CUDA
52-
#include <petsccuda.h>
53-
// Note: With PETSc prior to version 3.12.0, providing the source path to include 'cublas_v2.h' will be needed to use 'petsccuda.h'.
54-
#endif
55-
#endif
56-
5750
// -----------------------------------------------------------------------------
5851
// Main body of program, called in a loop for performance benchmarking purposes
5952
// -----------------------------------------------------------------------------

examples/petsc/bpsraw.c

-7
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ const char help[] = "Solve CEED BPs using PETSc\n";
4343
#include "qfunctions/bps/bp4.h"
4444
#include "qfunctions/bps/common.h"
4545

46-
#if PETSC_VERSION_LT(3, 12, 0)
47-
#ifdef PETSC_HAVE_CUDA
48-
#include <petsccuda.h>
49-
// Note: With PETSc prior to version 3.12.0, providing the source path to include 'cublas_v2.h' will be needed to use 'petsccuda.h'.
50-
#endif
51-
#endif
52-
5346
static CeedMemType MemTypeP2C(PetscMemType mem_type) { return PetscMemTypeDevice(mem_type) ? CEED_MEM_DEVICE : CEED_MEM_HOST; }
5447

5548
static void Split3(PetscInt size, PetscInt m[3], bool reverse) {

examples/petsc/bpssphere.c

-7
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@ static const char help[] = "Solve CEED BPs on a sphere using DMPlex in PETSc\n";
4646
#include "include/petscversion.h"
4747
#include "include/sphereproblemdata.h"
4848

49-
#if PETSC_VERSION_LT(3, 12, 0)
50-
#ifdef PETSC_HAVE_CUDA
51-
#include <petsccuda.h>
52-
// Note: With PETSc prior to version 3.12.0, providing the source path to include 'cublas_v2.h' will be needed to use 'petsccuda.h'.
53-
#endif
54-
#endif
55-
5649
int main(int argc, char **argv) {
5750
MPI_Comm comm;
5851
char ceed_resource[PETSC_MAX_PATH_LEN] = "/cpu/self", filename[PETSC_MAX_PATH_LEN];

examples/petsc/include/petscversion.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#ifndef libceed_petsc_examples_version_h
22
#define libceed_petsc_examples_version_h
33

4-
#if PETSC_VERSION_LT(3, 17, 0)
5-
#error "PETSc v3.17 or later is required"
4+
#if PETSC_VERSION_LT(3, 19, 0)
5+
#error "PETSc v3.19 or later is required"
66
#endif
77

88
#endif

examples/petsc/multigrid.c

-7
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@ const char help[] = "Solve CEED BPs using p-multigrid with PETSc and DMPlex\n";
4545
#include "include/petscversion.h"
4646
#include "include/structs.h"
4747

48-
#if PETSC_VERSION_LT(3, 12, 0)
49-
#ifdef PETSC_HAVE_CUDA
50-
#include <petsccuda.h>
51-
// Note: With PETSc prior to version 3.12.0, providing the source path to include 'cublas_v2.h' will be needed to use 'petsccuda.h'.
52-
#endif
53-
#endif
54-
5548
int main(int argc, char **argv) {
5649
MPI_Comm comm;
5750
char filename[PETSC_MAX_PATH_LEN], ceed_resource[PETSC_MAX_PATH_LEN] = "/cpu/self";

examples/petsc/src/petscutils.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ PetscErrorCode DMFieldToDSField(DM dm, DMLabel domain_label, PetscInt dm_field,
189189
PetscFunctionBeginUser;
190190

191191
// Translate dm_field to ds_field
192-
PetscCall(DMGetRegionDS(dm, domain_label, &field_is, &ds));
192+
PetscCall(DMGetRegionDS(dm, domain_label, &field_is, &ds, NULL));
193193
PetscCall(ISGetIndices(field_is, &fields));
194194
PetscCall(ISGetSize(field_is, &num_fields));
195195
for (PetscInt i = 0; i < num_fields; i++) {
@@ -316,7 +316,7 @@ PetscErrorCode CreateBasisFromPlex(Ceed ceed, DM dm, DMLabel domain_label, CeedI
316316
PetscFunctionBeginUser;
317317

318318
// Get element information
319-
PetscCall(DMGetRegionDS(dm, domain_label, NULL, &ds));
319+
PetscCall(DMGetRegionDS(dm, domain_label, NULL, &ds, NULL));
320320
PetscCall(DMFieldToDSField(dm, domain_label, dm_field, &ds_field));
321321
PetscCall(PetscDSGetDiscretization(ds, ds_field, (PetscObject *)&fe));
322322
PetscCall(PetscFEGetHeightSubspace(fe, height, &fe));

examples/solids/elasticity.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#include "include/utils.h"
2424
#include "problems/problems.h"
2525

26-
#if PETSC_VERSION_LT(3, 17, 0)
27-
#error "PETSc v3.17 or later is required"
26+
#if PETSC_VERSION_LT(3, 19, 0)
27+
#error "PETSc v3.19 or later is required"
2828
#endif
2929

3030
#endif // libceed_solids_examples_setup_h

0 commit comments

Comments
 (0)