Skip to content

Testing is Sensitive to Optimization Flags #307

@mandli

Description

@mandli

@rjleveque noticed that tests were not passing for him due to assertion failures. I did a quick cross-section of different optimization flags to see how wide-spread the problem was (see table below).

Optimization flags up to -O1 are fine. The compiler gcc defaults to -O0, which confusingly does not turn off all optimizations (see here for more info). OpenMP does not seem to have anything to do with the tests not passing thankfully. There is an interesting thing I did notice with the recursive rpn problem we have seen before. This comes up and a make new fixes things, but this seemed to occur when changing optimization levels. May be a clue here as to why that occurs, although it is an easy fix.

I propose that we explicitly list the compiler flags in the testing so that what is being tested is clear. We can also have a matrix of testing so that we can test out different flag combinations or compilers if we really wanted to.

Working Flags Failed Tests Notes
None (default) FFLAGS=-O0 we think
Debug = -O0 -W -Wall -fbounds-check -fcheck=all -pedantic-errors -Wunderflow -fbacktrace -ffpe-trap=invalid,zero,overflow -g test_acoustics_2d_adjoint_forward, test_acoustics_2d_adjoint This is due to a bug #304, with it incorporated everything passes
OpenMP = -fopenmp, OMP_NUM_THREADS=8 test_advection_2d_annulus, test_advection_2d_inflow, test_advection_2d_square Recursive problem, fixed by recompile
hybrid = -fopenmp -O, OMP_NUM_THREADS=8 test_advection_2d_annulus, test_advection_2d_inflow, test_advection_2d_square Recursive problem, fixed by recompile
hybrid = -fopenmp -O, OMP_NUM_THREADS=1
FFLAGS = -O1 -fopenmp, OMP_NUM_THREADS=10 Had to fix the recursive problem again, maybe something to do with optimization flags?
FFLAGS= -O2 -fopenmp, OMP_NUM_THREADS=1 test_acoustics_2d_adjoint_forward, test_acoustics_2d_radial Adjoint problem is off by comparison and radial has two more times recorded
FFLAGS = -O3 -funroll-loops -finline-functions -march=native, OMP_NUM_THREADS=10 test_acoustics_2d_adjoint_forward, test_acoustics_2d_radial Adjoint problem is off by comparison and radial has two more times recorded

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions