mdolab / mdolab/adflow

Complex instance will not run when a real instance exists

Open
#210 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Fortran
Stars
332
Forks
124
PR merge metrics
No merged PRs in 30d

Description

Description

Complex ADflow will not run properly when a real instance exists at the same time.

Steps to reproduce issue

Here is a MWE:

from baseclasses import AeroProblem
from adflow import ADFLOW, ADFLOW_C

aeroOptions = {
    "gridfile": "../../input_files/naca0012_rans-L2.cgns",
    "MGCycle": "sg",
}
ap = AeroProblem(
    name="mdo_tutorial",
    alpha=1.8,
    mach=0.80,
    P=20000.0,
    T=220.0,
    areaRef=45.5,
    chordRef=3.25,
    beta=0.0,
    R=287.87,
    xRef=0.0,
    yRef=0.0,
    zRef=0.0,
)

# Create solvers
CFDSolver_real = ADFLOW(options=aeroOptions)
CFDSolver_complex = ADFLOW_C(options=aeroOptions)

# Try to use run the complex solver
CFDSolver_complex(ap)
Current behavior

Running the example above will result in errors like the following:

[0]PETSC ERROR: PetscTrFreeDefault() called from VecDestroy_MPI() line 21 in packages/petsc-3.15.1/src/vec/vec/impls/mpi/pdvec.c
[0]PETSC ERROR: Block [id=1190(92160)] at address 0x5636dfd7cf30 is corrupted (probably write past end of array)
[0]PETSC ERROR: Block allocated in VecCreate_MPI_Private() line 515 in packages/petsc-3.15.1/src/vec/vec/impls/mpi/pbvec.c
[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
[0]PETSC ERROR: Memory corruption: https://www.mcs.anl.gov/petsc/documentation/installation.html#valgrind
[0]PETSC ERROR: Corrupted memory
[0]PETSC ERROR: See https://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.15.1, Jun 17, 2021 
Expected behavior

The solver should run properly.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied MWE with both ADFLOW and ADFLOW_C instances and capture the PETSc memory-corruption output. Trace the ADFLOW and ADFLOW_C entry points and their interaction when a real solver already exists; done means the complex solver runs successfully in that situation without PETSc errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
fortran, python
Domain
hpc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.