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

Compile WRF (dm+sm) error

Sas_González__Borja
1,375 Views

Hi all.

I am a user of the WRF weather model. After reading an Intel article on improving the performance of WRF, I compiled WRF with (dm+sm). I used the Intel compiler in its 2018 version.

The compilation ends correctly, but with errors of this type:

COMPILING init_modules_em.F WITHOUT OMP

I asked in the WRF forum, but they do not know how to give me an answer. I understand that it can be a problem with some compiler flags. If someone could help me I would be very grateful.

I attach the configuration file and the output file.

0 Kudos
11 Replies
Juergen_R_R
Valued Contributor I
1,375 Views

To me it looks like that the configure grep the different Fortran files whether it contains OMP directives or not, and if not, it prints COMPILING WITHOUT OMP. What I cannot see (without having the code) is whether OMP directives have possibly been emitted during the configure setup, but it doesn't look like that.

0 Kudos
Sas_González__Borja
1,375 Views

Then it is possible that some of the modules have to be compiled without OMP, and therefore print that message.

I do not know if there would be any way to see the code and verify if it is really that.

0 Kudos
Sas_González__Borja
1,375 Views

All the code can be obtained from the GitHub repository. I do not know if it can help.

git clone https://github.com/wrf-model/WRF

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,375 Views

If OpenMP is used within the application, then all procedures should be compiled with -openmp.

This should not be based on if a procedure contains (or not) OMP directives as the procedure may be called from within a parallel region.

Jim Dempsey

0 Kudos
Juergen_R_R
Valued Contributor I
1,375 Views

jimdempseyatthecove (Blackbelt) wrote:

If OpenMP is used within the application, then all procedures should be compiled with -openmp.

This should not be based on if a procedure contains (or not) OMP directives as the procedure may be called from within a parallel region.

Jim Dempsey

 

That's true, but this is then a flaw of the configure (and make) setup. One question, Jim: where would you need this flag for modules that do not contain OMP directives? To allow for OMP-specific inter-module optimization etc.?

0 Kudos
jimdempseyatthecove
Honored Contributor III
1,375 Views

It is not the optimization (inter-module or inter-other) to worry about, it is whether or not procedure is reentrant or not. IOW all locally declared data not declared as SAVE are located on stack (or allocated on heap). It is not that they contain the directives, but rather that they are called from a parallel region (regardless as to if the thread was instantiate with OpenMP or other threading method). Whatever was use to scan the source file for OMP directives will not necessarily know if the calling context is from a parallel region or not..  One of the newer compiler standards changed the default for local arrays, but it won't hurt for you to explicitly use -openmp or -recursive or -auto (Fortran does not have a -reentrant).

The only caveat is the local array, assuming it is required to be private to thread, will fit on the stack. If they won't, then consider using -heap-arrays or -heap-arrays:nn where nn is size threshold in KB as to if placed on heap.

This said, if a procedure came from old code (pre-multithreaded), and IF the procedure required implicit SAVE on local arrays (e.g. that are once only initialized), then these will have to add SAVE, and possibly a critical section, to assure once-only initialization.

Jim Dempsey

0 Kudos
Sas_González__Borja
1,375 Views

Sorry for the ignorance, but the topic has already gone up a lot. After reading your comments, it is not clear to me if I have the possibility to fix the compilation including the flag -openmp, or finally there is nothing to do since there is a code error behind.

0 Kudos
Juergen_R_R
Valued Contributor I
1,375 Views

Sas González, Borja wrote:

Sorry for the ignorance, but the topic has already gone up a lot. After reading your comments, it is not clear to me if I have the possibility to fix the compilation including the flag -openmp, or finally there is nothing to do since there is a code error behind.

This is just a message during compilation that you are observing. Is there actually any error, or problem? Does the code have a test suite, and how does it behave? This is more a question for the developers of that code than for the Intel forum (unless someone very familiar with that code reads and comments here).

0 Kudos
Sas_González__Borja
1,375 Views

It is a message that is printed throughout the compilation several times, but in the end the compilation ends correctly. I asked the developers, but they could not give me an answer, surprising as it may seem. They have specialized in compiling without the use of OpenMP, but for me it is necessary to use it. I asked in this forum as a last resort, in case the message was due to a badly placed flag.

0 Kudos
Juergen_R_R
Valued Contributor I
1,375 Views

Somebody most have written der build system. You could just uncomment the correspoding parts in the make routines which are not using the flags.

0 Kudos
Steve_Lionel
Honored Contributor III
1,375 Views

The message is coming from the build script, not the compiler. You have the build script - look at it.

0 Kudos
Reply