- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I wrote a simple fortran 90 project with some modules involved. What supprising me is that building with -openmp option, program generates totally wrong results while there weren't any !$OMP directives in this project. Could anybody tell me what the option '-openmp' of ifort does when any codes haven't been embraced with !$OMP directives? Thanks.
Regards,
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I took another look at this issue. One of my original suggestions turned out to be correct - the problem is an uninitialized variable.
The user code initializes the diagonal elements of the unit matrix I0, but not the off-diagonal elements, which are assumed to be zero. Whether this causes incorrect results depends on the optimization level, where variables are stored in memory, etc. A fix is to insert "I0=0" before the forall statement at line 77 in calc_expMat.
The problem is much easier to detect using a new feature of the version 16 compiler:
$ ifort -O1 -auto -init=snan,array -traceback mat_tools.f90 global_mod.f90; ./a.out
0.0000 0.00000E+00
forrtl: error (182): floating invalid - possible uninitialized real/complex variable.
Image PC Routine Line Source
a.out 0000000000475075 Unknown Unknown Unknown
a.out 0000000000472C97 Unknown Unknown Unknown
a.out 000000000042DD94 Unknown Unknown Unknown
a.out 000000000042DBA6 Unknown Unknown Unknown
a.out 0000000000407A66 Unknown Unknown Unknown
a.out 000000000040B327 Unknown Unknown Unknown
libpthread.so.0 00007FBDBFDB3340 Unknown Unknown Unknown
a.out 00000000004039C9 global_mod_mp_cal 79 global_mod.f90
a.out 0000000000403062 MAIN__ 125 global_mod.f90
a.out 00000000004025AE Unknown Unknown Unknown
libc.so.6 00007FBDBF7FBEC5 Unknown Unknown Unknown
a.out 00000000004024A9 Unknown Unknown Unknown
Aborted (core dumped)
Intel(R) Inspector should also be able to detect this, though I haven't tried.
The internal defect will be closed. Sorry it took so long to figure this out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »