Repository navigation
Compiler flags identifying floating divide by zero runtime error #55
Description
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
-------------------------------------------------------------------------------
MASA Library: Version = 0.51.0 (5100)
Development Build
Build Date = 2019-10-09 14:05
Build Host = nia-login05.scinet.local
Build User = dcp
Build Arch = x86_64-pc-linux-gnu
Build Rev = 7351ff92
C++ Config = mpicxx -O0
F90 Config = mpifc-O0
Optional Features:
Python support enabled = no
-------------------------------------------------------------------------------
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:
mpif90 for the Intel(R) MPI Library 2018 Update 3 for Linux*
Copyright(C) 2003-2018, Intel Corporation. All rights reserved.
__INTEL_PRE_FFLAGS options: -gcc-name=core-gcc -gxx-name=core-g++
ifort version 18.0.3
When I use the following flags (among others) to compile my source code, specifically
-check all,noarg_temp_created -init=snan -init=zero -init=arrays
I obtain the following runtime error when running my executable:
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
For reference, Line 10911 in my Fortran90 source code is a call to masa_init:
!-- initialize the problem
call masa_init('test',trim(adjustl(desired_mms_function)))
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=arraysspecifies that we initialize all unitialized arrays and variables by the following;-init=naninitializes all unitialized REAL and COMPLEX variables/arrays to nans to get caught by the nantrapping-init=zeroinitializes all unitialized REAL, COMPLEX, INTEGER, and LOGICAL variables/arrays to zero
My 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?
Activity
[-]Compiler flags leading to floating divide by zero runtime error[/-][+]Compiler flags identifying floating divide by zero runtime error[/+]roystgnr commentedon Nov 10, 2021
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
but I don't see any uninitialized variable warnings from the compiler and I still pass
make check.davidcraigpenner commentedon Nov 11, 2021
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.,however when I look at the summary of the build, it seems like some of the specified flags are not being used:
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: