Open davidcraigpenner opened 2 years ago
Do you get any runtime errors from make check
?
I tried running all our test applications with valgrind, but no reported errors there. (Which doesn't mean no uninitialized values, IIRC, because valgrind only catches those when they affect a branch condition)
I also tried a build with
../configure --enable-fortran-interfaces CXXFLAGS='-Wuninitialized -Wmaybe-uninitialized -Werror -O0 -fno-unsafe-math-optimizations -Dgnu_compiler -Wno-literal-suffix' ac_test_CXXFLAGS=set CFLAGS='-Wuninitialized -Wmaybe-uninitialized -Werror -O0 -fno-unsafe-math-optimizations -Dgnu_compiler -Wno-builtin-declaration-mismatch -Wno-implicit-function-declaration' ac_test_CFLAGS=set FCFLAGS='-Wuninitialized -Wmaybe-uninitialized -Werror -O0'
but I don't see any uninitialized variable warnings from the compiler and I still pass make check
.
I do not get any runtime errors with make check
. Thanks for running those tests. I tried a build with the additional flags you mention, i.e.,
./configure --prefix=$PREFIX --enable-fortran-interfaces CXXFLAGS='-Wuninitialized -Wmaybe-uninitialized -Werror -O0 -fno-unsafe-math-optimizations -Dgnu_compiler -Wno-literal-suffix' ac_test_CXXFLAGS=set CFLAGS='-Wuninitialized -Wmaybe-uninitialized -Werror -O0 -fno-unsafe-math-optimizations -Dgnu_compiler -Wno-builtin-declaration-mismatch -Wno-implicit-function-declaration' ac_test_CFLAGS=set FCFLAGS='-Wuninitialized -Wmaybe-uninitialized -Werror -O0'
however when I look at the summary of the build, it seems like some of the specified flags are not being used:
----------------------------------- SUMMARY -----------------------------------
Package version................. : masa-0.51.0
C++ compiler.................... : mpicxx
C++ compiler flags.............. : -O0
C compiler...................... : mpicc
C compiler flags................ : -O0 -fp-model precise -Dintel_compiler
Install dir..................... : /home/z/zingg/dcp/jetstream/masa
Build user...................... : dcp
Build host...................... : nia-login05.scinet.local
Configure date.................. : 2021-11-11 09:24
Build architecture.............. : x86_64-pc-linux-gnu
Source control revision......... : 48d2494bf
Optional Features:
Enable gcov code coverage.... : no
MetaPhysicL.................. : no
Enable absolute error tests.. : no
Enable all warnings.......... : no
Enable python interfaces..... : no
Enable fortran interfaces.... : yes
Fortran compiler................ : mpifc
Fortran compiler flags.......... : -O0
-------------------------------------------------------------------------------
Perhaps some of the flags are skipped because I am using MPI compilers? Or am I interpreting the summary incorrectly?
Also, are there some flags I could build MASA with that would provide more detailed error information? For example, the current error message I get when I run my executable does not indicate any Line or Source information for MASA, however having this additional information would be helpful for identifying the problem:
forrtl: error (73): floating divide by zero
Image PC Routine Line Source
jetstream_x86_64 000000000043E8CE Unknown Unknown Unknown
libpthread-2.17.s 00002B34AD110630 Unknown Unknown Unknown
jetstream_x86_64 00000000004FEEA1 Unknown Unknown Unknown
libfmasa-0.51.so 00002B34AB54832D _ZN4MASA27fans_sa Unknown Unknown
libfmasa-0.51.so 00002B34AB547F7B _ZN4MASA27fans_sa Unknown Unknown
libfmasa-0.51.so 00002B34AB546D84 _ZN4MASA27fans_sa Unknown Unknown
libfmasa-0.51.so 00002B34AB482130 Unknown Unknown Unknown
libfmasa-0.51.so 00002B34AB480A9A Unknown Unknown Unknown
libfmasa-0.51.so 00002B34AB48C254 _ZN4MASA9masa_ini Unknown Unknown
libfmasa-0.51.so 00002B34AB5147C0 masa_init Unknown Unknown
libfmasa-0.51.so 00002B34AB4804DB masa_mp_masa_init Unknown Unknown
libdiablo.so 00002B34A05933CE verify_mod_mp_gen 10911 Verify_Mod.f90
The version number of the MASA library (versioning information can be obtained by running the masa_version binary located in the bin/ directory of a local MASA installation) the hardware and operating system
A description of the bug behavior I am using MASA via the Fortran90 interface and compiling my source code with the following Intel Fortran compiler:
When I use the following flags (among others) to compile my source code, specifically
I obtain the following runtime error when running my executable:
For reference, Line 10911 in my Fortran90 source code is a call to
masa_init
:where
desired_mms_function = 'euler_2d'
. Note that when I compile without the aforementioned flags (i.e., without-check all,noarg_temp_created -init=snan -init=zero -init=arrays
), MASA runs correctly. For reference, the functions of the flags of interest are as follows (more info here):-init=arrays
specifies that we initialize all unitialized arrays and variables by the following;-init=nan
initializes all unitialized REAL and COMPLEX variables/arrays to nans to get caught by the nantrapping-init=zero
initializes all unitialized REAL, COMPLEX, INTEGER, and LOGICAL variables/arrays to zeroMy guess is that there are some unintialized variables in MASA, potentially in
fans_sa.cpp
(based on the above error message that I am getting), that are being caught by these flags, however I have been unable to identify specifically what part of the code is leading to the runtime error. Does anyone know how to address this issue?