ImperialCollegeLondon / ImperialCollegeLondon/ReCoDE_Diffusion_Code

Solution 2a aborts when compiled with PETSc

Open
#31 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Fortran
Stars
9
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Solution 2a when built with PETSc sigaborts.
Backtrace is

```log
At line 83 of file inoutproc/Problem.f90 (unit = 101, file = 'input.in')
Fortran runtime error: Bad real number in item 1 of list input

Error termination. Backtrace:
#0 0x7f5115990533 in read_real
at ../../../../gcc-12.1.0/libgfortran/io/list_read.c:2025
#1 0x7f51159918dd in list_formatted_read_scalar
at ../../../../gcc-12.1.0/libgfortran/io/list_read.c:2179
#2 0x407035 in ???
#3 0x40dd15 in ???
#4 0x40e157 in ???
#5 0x7f511536b082 in __libc_start_main
at ../csu/libc-start.c:308
#6 0x40248d in ???
#7 0xffffffffffffffff in ???
```

## Compilation instructions

On the main branch
```sh
cd solutions/2a
make -C src petsc
```

The current `makefile` however is not entirely correct on how to include/link to PETSc you have to replace the section of the `makefile`
with the following to compile and set `PETSC_DIR` and `PETSC_ARCH` as well as your `LD_LIBRARY_PATH`

```sh
export PETSC_DIR=~/Programs/petsc-tmp && export PETSC_ARCH=recode && export LD_LIBRARY_PATH=${PETSC_DIR}/${PETSC_ARCH}:${LD_LIBRARY_PATH}
```

```makefile
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# PETSc
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PETSC_INC_PATH = -I$(PETSC_DIR)/include -I$(PETSC_DIR)/$(PETSC_ARCH)/include
PETSC_LINK_PATH = -L$(PETSC_DIR)/lib -L$(PETSC_DIR)/$(PETSC_ARCH)/lib
PETSC_LOAD_PATH = -Wl,-rpath=$(PETSC_DIR)/$(PETSC_ARCH)/lib
PETSC_LIBS = -lpetsc
```

**There is no need to fix the makefile in main since it will be replaced with CMake.** I have already written the CMake file I am just ironing out some compilation bugs with CMake + PETSc and examples `1b` and `2b`

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue from solutions/2a using make -C src petsc and the PETSc environment described in the report. Inspect inoutproc/Problem.f90 around line 83 and the in-progress CMake configuration; done means Solution 2a builds and runs with PETSc without the reported input parsing abort.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, fortran
Domain
build-system, hpc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.