Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29274 Discussions

problem with openmp directives in gedit/emacs

Marios_G_
Beginner
1,955 Views

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,

Marios

0 Kudos
1 Solution
Steven_L_Intel1
Employee
1,955 Views

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

View solution in original post

0 Kudos
4 Replies
Lorri_M_Intel
Employee
1,955 Views

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?

                                  --Lorri

     

0 Kudos
Marios_G_
Beginner
1,955 Views

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?

 

Thanks,

 

Marios

0 Kudos
Steven_L_Intel1
Employee
1,956 Views

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

0 Kudos
Marios_G_
Beginner
1,955 Views

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

I forgot to write

-openmp -openmp-report1

you are right

0 Kudos
Reply