Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29282 Discussions

Unknown Software Exception, OpenMP Intel compiler vs gfortran

diomedes
Beginner
645 Views
Hello,

I'm rather new to Fortran and I've found myself in the middle of a problem I just can't figure out. I inherited a code base and was tasked with changing some of the loops to run in parrallel. I spent some time reading about OpenMP directives and understanding them. The machine I'm supposed to run this code on is using the Intel Fortran compiler in MS Visual Studio, however the machine I was developing on just has the free gfortran compiler. Anyhow, the code comiles and runs fine on both before I add any OpenMP directives. After I add some, the program compiled and ran fine in gfortran, however when I took my code over to the Intel Fortran compiler machine, at run time I got an "Unknown Software Exception". I'm rather at a loss, I don't understand that error message, nor can I fathom why it would be compiler specific. I tried a very simple "Hello World" program using OpenMP directives to parallize a section and got it to run just fine on the Intel Compiler. Does anyone have an idea of where I should be looking or what the error I'm recieving means in this context?

Thank you for your time.
0 Kudos
2 Replies
TimP
Honored Contributor III
645 Views
The importance of tools such as past Intel products like Thread Checker and Parallel Studio is underscored by the effort which is going into improving Fortran support. OpenMP code bugs can go undetected for quite a while as long as only a single compiler is used without such tools. I've even seen the case where my faulty OpenMP code worked seemingly OK with ifort and gfortran but failed with gcc. The only idea I can give you is that almost any error in OpenMP could produce the effects you report. The existing Thread Checker may report a problem without sufficient details to understand what was done wrong, or may miss it entirely, but it can be an excellent start.
0 Kudos
jimdempseyatthecove
Honored Contributor III
645 Views
Probably the first step is to enable all of the runtime checks, in particular uninitialized variable checks.
Also, enable the compile time checks for gen-interfaces and warn:interfaces.

If the above does not yield sufficient diagnostic information to aid in solving the problem, the next step would be to isolate where the problem might reside.

First, enable OpenMP on main (file with PROGRAM), but disable it on all others. You might want to add to main/PROGRAM

!$OMP PARALLEL
!$OMP MASTER
write(*,*) 'OpenMP with ',omp_get_num_threads(),' threads'
!$OMP END MASTER
!$OMP END PARALLEL

Next, if that runs OK, then start enabling OpenMP on remaining files util failure is found.

Once you have isolated a file that exhibits failure, examine the code closely with an eye to

assumptions relating to initial values of variables
are there any shared variable issues

See how you progress following the above hints. If no resolution then we may need additional information.

Jim Dempsey
0 Kudos
Reply