omp_lib.h is rather gruesome

omp_lib.h is rather gruesome

I teach portable programming, and I both use and recommend all diagnostic options, including ones like -stand=f03.  Unfortunately, omp_lib.h is highly non-standard and (this is the point) that is not shielded from the user.  With this program:

    INCLUDE "omp_lib.h"

and command ifort -stand=f03, I get a stream of diagnostics that will confuse the kiddies.  That's not good.

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

Tell the kids to USE OMP_LIB instead. It's better for them.

Yes, include files that declare non-standard routines may use extensions. Looking through omp_lib.h, I think that many of the directives could be replaced with C interoperability features, but use of include files here are still likely to be an issue if you turn on standards warnings.

Steve - Intel Developer Support

Er, yes - stupid of me :-(

I copied the examples from one that I had written before the module was available in most compilers, and had completely forgotten about the module when I produced this report.  I will do a systematic update and check my lectures.  Thanks for that!

This sort of thing (older language features used in examples, header and include files, and described in documentation) is probably unavoidable. There was a thread in the MKL forum recently where an example code with Cray pointers was discussed, and some of the responders had never heard of Cray pointers. One person jokingly asked if the Cray pointer was a kind of Cajun dog.

Eventually, the examples and include files may get updated to use ISO C-Interoperability, but it will take time and effort.

I certainly wish that people would forget about Cray pointers :- a zillion incompatible specifications, all with nightmarish consequences for software engineering and optimisation!

In this case, the module is the right solution, and it is only because I am one of the earlier users of OpenMP that I had code with the Fortran header in - had - I don't any longer :-)  I agree that improving the header is clearly significant effort and a low-priority task.

And Nick, as you know, even Cray doesn't like the term!

Steve - Intel Developer Support

Leave a Comment

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