[petsc-users] Bound exceed when running code with PETSc

TAY Wee Beng zonexo at gmail.com
Mon Feb 5 03:29:35 CST 2024


Hi,

I have a code which uses PETSc and it was working fine. However, I 
haven't used the code for a while and now we've migrated to a new cray 
cluster so the compilers have been updated. I'm using gnu fortran.

When running the code now, I got the error:

Error termination. Backtrace:
At line 294 of file 
/home/users/nus/tsltaywb/myprojects/ibm2d_high_Re_staggered_coef/PETSc_solvers.F90
Fortran runtime error: Index '-17591876251192' of dimension 1 of array 
'ppv' below lower bound of 1

I have attached my makefile. Wonder what I should change to prevent the 
above error.

Compiler should be v11.2

-- 
Thank you very much.

Yours sincerely,

================================================
TAY Wee-Beng 郑伟明 (Zheng Weiming)
================================================

-------------- next part --------------
ALL: a.out

%.o: %.mod

# PETSC_DIR and PETSC_ARCH should be set either in env or in this makeifle
#PETSC_DIR=/home/users/nus/tsltaywb/woodstock/lib/petsc-3.15.0_gnu10_debug
PETSC_DIR=/home/project/11001487/lib/petsc-3.20.4_gnu_2023_debug
MPI_DIR=/opt/cray/pe/pals/1.1.6/

CFLAGS	         =
FFLAGS           =  -O0 -fimplicit-none  -Wall -Wno-tabs -Wno-unused-label -Wline-truncation  -Wcharacter-truncation  -Wsurprising  -Waliasing  -Wno-implicit-interface  -Wno-unused-parameter  -fwhole-file  -fcheck=all  -fbacktrace -ffree-line-length-none -fallow-argument-mismatch
CPPFLAGS         =
FPPFLAGS         =
CLEANFILES       = a.out

include ${PETSC_DIR}/lib/petsc/conf/variables
include ${PETSC_DIR}/lib/petsc/conf/rules

opt =  -c -O0 -fimplicit-none  -Wall  -Wtabs -Wline-truncation  -Wcharacter-truncation  -Wsurprising  -Waliasing  -Wno-implicit-interface  -Wno-unused-parameter  -fwhole-file  -fbacktrace -ffree-line-length-none -I$(PETSC_DIR)/include -I$(MPI_DIR)/include
opt2 = -c -fdefault-real-8 -fno-signed-zeros -O0 -fimplicit-none  -Wall  -Wtabs -Wline-truncation  -Wcharacter-truncation  -Wsurprising  -Waliasing  -Wno-implicit-interface  -Wno-unused-parameter  -fwhole-file  -fbacktrace -ffree-line-length-none -I$(PETSC_DIR)/include -ffree-line-length-none -I$(PETSC_DIR)/include -I$(MPI_DIR)/include 
opt3 = -c -fno-signed-zeros -O0 -fimplicit-none  -Wall  -Wtabs -Wline-truncation  -Wcharacter-truncation  -Wsurprising  -Waliasing  -Wno-implicit-interface  -Wno-unused-parameter  -fwhole-file  -fbacktrace -ffree-line-length-none -I$(PETSC_DIR)/include -ffree-line-length-none -I$(PETSC_DIR)/include -I$(MPI_DIR)/include 
#-fcheck=all

#libs =/home/users/nus/tsltaywb/lib/libteciompi_2021R1_0521_gcc10.3.0_cmake_b168.a
libs =/home/project/11001487/lib//libteciompi_gnu_env.a

OBJS = global.o flux_fns.o math_routine.o body.o boundary.o grid.o mpi_subroutines.o cell_data.o misc.o ibm.o set_matrix.o inter_step.o PETSc_solvers.o hypre.o fractional_initial.o ibm2d_high_Re.o


a.out : $(OBJS)
	$(FLINKER) $(opt3) -o a.out $(OBJS) $(libs) $(PETSC_LIB)

#compiled these sources with default petsc targets
global.o : global.F90 nrtype.o
misc.o : misc.F90 global.o
math_routine.o : math_routine.F90 misc.o
flux_fns.o : flux_fns.F90 mpi_subroutines.o
boundary.o : boundary.F90 flux_fns.o
mpi_subroutines.o : mpi_subroutines.F90 math_routine.o
body.o : body.F90 math_routine.o
grid.o : grid.F90 global.o
set_matrix.o : set_matrix.F90 boundary.o
PETSc_solvers.o : PETSc_solvers.F90 ibm.o
ibm.o : ibm.F90 boundary.o
cell_data.o : cell_data.F90 flux_fns.o
inter_step.o : inter_step.F90 cell_data.o
#hypre.o : hypre.F90 PETSc_solvers.o
fractional_initial.o : fractional_initial.F90 hypre.o inter_step.o body.o ibm.o misc.o PETSc_solvers.o

ibm2d_high_Re.o : ibm2d_high_Re.F90 grid.o fractional_initial.o boundary.o

# sources compiled separately - as they need different opt/opt3 compiler flags.

nrtype.o : nrtype.f90

	$(FC) $(opt) nrtype.f90

nrutil.o : nrutil.f90 nrtype.o

	$(FC) $(opt) nrutil.f90

#math_routine.o : math_routine.f90 misc.o

#	$(FC) $(opt) math_routine.f90

#cell_data.o : cell_data.F90 flux_fns.o

#	$(FC) $(opt) cell_data.F90

#body.o : body.f90 math_routine.o

#	$(FC) $(opt) body.f90

#grid.o : grid.f90 global.o

#	$(FC) $(opt) grid.f90

#misc.o : misc.f90 global.o

#	$(FC) $(opt) misc.f90

#ibm.o : ibm.f90 boundary.o

#	$(FC) $(opt) ibm.f90

#inter_step.o : inter_step.f90 cell_data.o

#	$(FC) $(opt) inter_step.f90

hypre.o : hypre.F90 PETSc_solvers.o
	$(FC) $(opt2) hypre.F90

#fractional_initial.o : fractional_initial.f90 hypre.o inter_step.o body.o ibm.o misc.o PETSc_solvers.o

#	$(FC) $(opt) fractional_initial.f90


More information about the petsc-users mailing list