Skip to content

Commit 338c609

Browse files
authored
Merge pull request #643 from mjberger/bouss_periodic
Bouss periodic and matrix reentrant corner and wall fixes. Also using new version of PETSc so changes to options and Makefile for example.
2 parents ec6b3db + 1cd6f30 commit 338c609

14 files changed

+730
-197
lines changed

examples/bouss/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ OpenMP along with MPI. Some flags have to be set as environment variables
1616
or directly in the application Makefile, e.g. see the lines commented out in
1717
radial_flat/Makefile.
1818

19+
**Update:** Clawpack 5.12.0 now requires PETSc Version 3.23 (or later).
20+
1921
The file setenv.sh illustrates how you might set some environment
2022
variables for the bash shell.
2123

examples/bouss/petscMPIoptions

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,32 @@
1010
# https://petsc.org/release/manualpages/PC/PCSetFromOptions/
1111

1212
# set min numbers of matrix rows per MPI rank (default is 10000)
13-
-pc_mpi_minimum_count_per_rank 5000
13+
-mpi_linear_solver_server_minimum_count_per_rank 5000
14+
-mpi_linear_solver_server
15+
-mpi_linear_solver_server_view
16+
-mpi_linear_solver_server_use_shared_memory false
1417

15-
# convergence criterion for linear solver (larger than PETSc default):
16-
-mpi_ksp_rtol 1.e-9
18+
# Krylov linear solver:
19+
-ksp_type gmres
20+
-ksp_max_it 200
21+
-ksp_reuse_preconditioner
1722

18-
# linear solver:
19-
-mpi_linear_solver_server
20-
-ksp_type preonly
21-
-mpi_ksp_type gmres
22-
-mpi_ksp_max_it 200
23-
-mpi_ksp_reuse_preconditioner
23+
# convergence criterion for linear solver (larger than PETSc default):
24+
-ksp_rtol 1.e-9
2425

2526
# preconditioner:
26-
-pc_type mpi
27-
-mpi_pc_type gamg
28-
-mpi_pc_gamg_symmetrize_graph true
29-
-mpi_pc_gamg_sym_graph true
30-
-mpi_linear_solver_server_view
27+
-pc_type gamg
28+
#-pc_type hypre
29+
3130

3231
# debug options:
3332
#-fp_trap off
3433
#-log_view
3534
#-start_in_debugger -debugger_rank 0
36-
#-mpi_ksp_view_mat binary
37-
#-mpi_ksp_view_rhs binary
38-
#-mpi_ksp_monitor_true_residual
39-
#-mpi_ksp_monitor
35+
#-ksp_monitor
36+
#-ksp_view
4037
#-info
4138

4239
# test if any options are not used:
4340
#-options_left
41+
-options_view

examples/bouss/radial_flat/Makefile

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,36 @@ ifndef PETSC_DIR
3636
$(error PETSC_DIR not set)
3737
endif
3838

39-
ifndef PETSC_ARCH
40-
$(error PETSC_ARCH not set)
41-
endif
42-
4339
ifndef PETSC_OPTIONS
4440
PETSC_OPTIONS=MISSING
4541
$(error PETSC_OPTIONS must be declared as environment variable)
4642
endif
4743

44+
ifndef CLAW_MPIEXEC
45+
CLAW_MPIEXEC=MISSING
46+
$(error CLAW_MPIEXEC must be declared as environment variable)
47+
endif
48+
49+
ifndef CLAW_MPIFC
50+
CLAW_MPIFC=MISSING
51+
$(error Fortran compiler CLAW_MPIFC must be declared as environment variable)
52+
endif
53+
54+
# Environment variable FC should be set to fortran compiler, e.g. gfortran
55+
FC = ${CLAW_MPIFC}
56+
4857
# How many MPI processes to use:
4958
BOUSS_MPI_PROCS ?= 6
5059

5160
EXE = $(PWD)/xgeoclaw
52-
RUNEXE="${PETSC_DIR}/${PETSC_ARCH}/bin/mpiexec -n ${BOUSS_MPI_PROCS}"
61+
#RUNEXE="${PETSC_DIR}/${PETSC_ARCH}/bin/mpiexec -n ${BOUSS_MPI_PROCS}"
62+
RUNEXE="${CLAW_MPIEXEC} -n ${BOUSS_MPI_PROCS}"
5363
SETRUN_FILE = setrun.py # File containing function to make data
5464
OUTDIR = _output # Directory for output
5565
SETPLOT_FILE = setplot.py # File containing function to set plots
5666
PLOTDIR = _plots # Directory for plots
5767

5868

59-
# Environment variable FC should be set to fortran compiler, e.g. gfortran
60-
61-
FC = gfortran
62-
6369
# Some compiler flags below are needed for PETSc
6470
PETSC_INCLUDE = $(PETSC_DIR)/include $(PETSC_DIR)/$(PETSC_ARCH)/include
6571
INCLUDE += $(PETSC_INCLUDE)
@@ -121,6 +127,13 @@ check:
121127
@env | grep PETSC_OPTIONS
122128
@echo PETSC_DIR = $(PETSC_DIR)
123129
@echo PETSC_ARCH = $(PETSC_ARCH)
130+
@echo CLAW_MPIEXEC = $(CLAW_MPIEXEC)
124131
@echo RUNEXE = $(RUNEXE)
132+
@echo EXE = $(EXE)
133+
@echo CLAW_MPIFC = $(CLAW_MPIFC)
134+
@echo FC = $(FC)
125135
@echo FFLAGS = $(FFLAGS)
136+
@echo LFLAGS = $(LFLAGS)
137+
@echo OUTDIR = $(OUTDIR)
138+
@echo PLOTDIR = $(PLOTDIR)
126139
@echo ===================

src/2d/bouss/Makefile.bouss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ COMMON_SOURCES += \
162162
$(BOUSSLIB)/buildSparseMatrixMScoo.f90 \
163163
$(BOUSSLIB)/compressOut.f \
164164
$(BOUSSLIB)/matvec.f90 \
165+
$(BOUSSLIB)/testSoln.f90 \
165166
$(BOUSSLIB)/petsc_driver.f90 \
166167
$(BOUSSLIB)/lookAtGrid.f90 \
167168
$(BOUSSLIB)/resetBoussStuff.f \

src/2d/bouss/bouss_module.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ subroutine set_bouss(rest,time,naux)
166166
crs = .true.
167167
endif
168168

169-
! crs = .false. ! uncomment this line to force CRS with SGN for testing
169+
! crs = .false. ! uncomment this line to force COO with SGN for testing
170170

171171
!------------------------------------------
172172
if (rest) then
@@ -264,8 +264,8 @@ subroutine set_bouss(rest,time,naux)
264264
! Boundary conditions to impose in computing Boussinesq update:
265265
if ((mthbc(1)==2) .or. (mthbc(2)==2) &
266266
.or. (mthbc(3)==2) .or. (mthbc(4)==2)) then
267-
write(6,*) '*** Periodic BCs not supported in bouss_module'
268-
stop
267+
write(6,*) '*** Periodic BCs newly added to bouss_module'
268+
!!stop
269269
endif
270270

271271
if ((mthbc(1)==4) .or. (mthbc(2)==4) &

0 commit comments

Comments
 (0)