- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page