Skip to content

Commit

Permalink
Merge pull request #1191 from CEED/jrwrigh/fix_petsc_build
Browse files Browse the repository at this point in the history
fix: Update DMGetRegionDS calls in examples/petsc
  • Loading branch information
jrwrigh authored Apr 7, 2023
2 parents a86a87b + db3e7f9 commit f724464
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 43 deletions.
6 changes: 6 additions & 0 deletions doc/sphinx/source/releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ For example, `CeedOperatorContextGetFieldLabel` was renamed to `CeedOperatorGetC
- Update `/cpu/self/memcheck/*` backends to help verify `CeedVector` array access assumptions and `CeedQFunction` user output assumptions.
- Update {c:func}`CeedOperatorLinearAssembleDiagonal` to provide default implementation that supports `CeedOperator` with multiple active bases.

### Examples

#### {ref}`example-petsc-bps`

- Requires PETSc version 3.19 or later

(v0-11)=

## v0.11 (Dec 24, 2022)
Expand Down
4 changes: 2 additions & 2 deletions examples/fluids/navierstokes.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
// -----------------------------------------------------------------------------
// PETSc Version
// -----------------------------------------------------------------------------
#if PETSC_VERSION_LT(3, 17, 0)
#error "PETSc v3.17 or later is required"
#if PETSC_VERSION_LT(3, 19, 0)
#error "PETSc v3.19 or later is required"
#endif

// -----------------------------------------------------------------------------
Expand Down
7 changes: 0 additions & 7 deletions examples/petsc/area.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@ static const char help[] = "Compute surface area of a cube or a cubed-sphere usi
#include "include/petscversion.h"
#include "include/structs.h"

#if PETSC_VERSION_LT(3, 12, 0)
#ifdef PETSC_HAVE_CUDA
#include <petsccuda.h>
// 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'.
#endif
#endif

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
Expand Down
7 changes: 0 additions & 7 deletions examples/petsc/bps.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ const char help[] = "Solve CEED BPs using PETSc with DMPlex\n";
#include "include/petscversion.h"
#include "include/structs.h"

#if PETSC_VERSION_LT(3, 12, 0)
#ifdef PETSC_HAVE_CUDA
#include <petsccuda.h>
// 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'.
#endif
#endif

// -----------------------------------------------------------------------------
// Main body of program, called in a loop for performance benchmarking purposes
// -----------------------------------------------------------------------------
Expand Down
7 changes: 0 additions & 7 deletions examples/petsc/bpsraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ const char help[] = "Solve CEED BPs using PETSc\n";
#include "qfunctions/bps/bp4.h"
#include "qfunctions/bps/common.h"

#if PETSC_VERSION_LT(3, 12, 0)
#ifdef PETSC_HAVE_CUDA
#include <petsccuda.h>
// 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'.
#endif
#endif

static CeedMemType MemTypeP2C(PetscMemType mem_type) { return PetscMemTypeDevice(mem_type) ? CEED_MEM_DEVICE : CEED_MEM_HOST; }

static void Split3(PetscInt size, PetscInt m[3], bool reverse) {
Expand Down
7 changes: 0 additions & 7 deletions examples/petsc/bpssphere.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ static const char help[] = "Solve CEED BPs on a sphere using DMPlex in PETSc\n";
#include "include/petscversion.h"
#include "include/sphereproblemdata.h"

#if PETSC_VERSION_LT(3, 12, 0)
#ifdef PETSC_HAVE_CUDA
#include <petsccuda.h>
// 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'.
#endif
#endif

int main(int argc, char **argv) {
MPI_Comm comm;
char ceed_resource[PETSC_MAX_PATH_LEN] = "/cpu/self", filename[PETSC_MAX_PATH_LEN];
Expand Down
4 changes: 2 additions & 2 deletions examples/petsc/include/petscversion.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef libceed_petsc_examples_version_h
#define libceed_petsc_examples_version_h

#if PETSC_VERSION_LT(3, 17, 0)
#error "PETSc v3.17 or later is required"
#if PETSC_VERSION_LT(3, 19, 0)
#error "PETSc v3.19 or later is required"
#endif

#endif
7 changes: 0 additions & 7 deletions examples/petsc/multigrid.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ const char help[] = "Solve CEED BPs using p-multigrid with PETSc and DMPlex\n";
#include "include/petscversion.h"
#include "include/structs.h"

#if PETSC_VERSION_LT(3, 12, 0)
#ifdef PETSC_HAVE_CUDA
#include <petsccuda.h>
// 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'.
#endif
#endif

int main(int argc, char **argv) {
MPI_Comm comm;
char filename[PETSC_MAX_PATH_LEN], ceed_resource[PETSC_MAX_PATH_LEN] = "/cpu/self";
Expand Down
4 changes: 2 additions & 2 deletions examples/petsc/src/petscutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ PetscErrorCode DMFieldToDSField(DM dm, DMLabel domain_label, PetscInt dm_field,
PetscFunctionBeginUser;

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

// Get element information
PetscCall(DMGetRegionDS(dm, domain_label, NULL, &ds));
PetscCall(DMGetRegionDS(dm, domain_label, NULL, &ds, NULL));
PetscCall(DMFieldToDSField(dm, domain_label, dm_field, &ds_field));
PetscCall(PetscDSGetDiscretization(ds, ds_field, (PetscObject *)&fe));
PetscCall(PetscFEGetHeightSubspace(fe, height, &fe));
Expand Down
4 changes: 2 additions & 2 deletions examples/solids/elasticity.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#include "include/utils.h"
#include "problems/problems.h"

#if PETSC_VERSION_LT(3, 17, 0)
#error "PETSc v3.17 or later is required"
#if PETSC_VERSION_LT(3, 19, 0)
#error "PETSc v3.19 or later is required"
#endif

#endif // libceed_solids_examples_setup_h

0 comments on commit f724464

Please sign in to comment.