problem with openmp directives in gedit/emacs

problem with openmp directives in gedit/emacs

Hello everyone,

I am facing an awkward situation. I am trying to run a f90 program in Linux with ifort and since it has openmp directives I compile it with the -openmp-report1 option to see that whether the blocks have been successfully parallelized.

The problem  is that gedit doesn't recognize the openmp directive:

!$omp parallel do etc.

it treats it as a comment. Anyone has an idea about it? I also tried

C$omp parallel do etc...

but in that case it produces a compile-time error. Do I have to enable an option in gedit in order to recognize the openmp directives?

I faced the same problem in emacs.

I note that I run successfully the SAME program with Intel Visual Fortran. In Visual Studio openmp directives are properly recognized.

Thank you,


5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I'm sorry, clearly I'm missing something.   Is gedit more than an editor?    Whether it recognizes OpenMP directives or not shouldn't affect what happens when you compile the program, unless gedit initiates the compilation?   And, if it is true that you can compile from within gedit, there must be a way to add more command line options to your compilation command, otherwise, it's really boring.

Yes, OpenMP directives look like comments so that they *can* be ignored at compile-time.   What will cause them to be recognized by the compiler is the -openmp command line switch.

                Does this help?



Lori you are right. I was thinking of the same thing, gedit is just an editor.

So, the real problem is as follows:

I compile my program as:

ifort -O3 -warn all -xSSE4.2 -parallel -par-report1 -openmp-report1 -o run.out test.f90 

and I expect compiler comments regarding the openmp directives, e.g

OpenMP DEFINED LOOP WAS PARALLELIZED (as I get in Windows with Intel Visual Fortran) 

but I don't get comments regarding the openmp loops and the program doesn't run parallel. Any idea why?

My guess is that since I don't get a compilation report for the openmp parallel loops the compiler ignores the openmp directives. Do I have to add another compiler option besides  -openmp in order to activate openmp directives? or am I missing something else?





Best Reply

You need to enable OpenMP - you didn't do that. Add -openmp to the command line. -parallel does auto-parallel.

Retired 12/31/2016

Steve when I previewed  the comment it came to me....

I forgot to write

-openmp -openmp-report1

you are right

Leave a Comment

Please sign in to add a comment. Not a member? Join today