-openmp & -parallel

-openmp & -parallel

Hi all, I'm quite new to Fortran and I've just installed Intel 64 Fortran compiler (10.1) on Ubuntu 8.10 64 bit (Q6600 quad core).
I'm compiling some sources I wrote for a 32 bit machine (celeron single core) and everything works fine, but I just noticed two strange things.

1)In the compiler options manual I read that by default both -parallel and -openmp option are disabled, but if I compile with "ifort mysource.f", compiler begins to vectorize a lot of loops it finds in the source. Why?

2)Sometime happens that if I simply compile with "ifort mysource.f", I got a run time error (opening a file). The same if I compile with "ifort -parallel mysource.f"; but if I compile with "ifort -openmp mysource.f" everything works good. Any suggestion?

I'll really appreciate if someone could tell me the difference between the -openmp and -parallel options or could indicate a valid document for a beginner.

Best regards

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

Vectorization is not related to parallel - it is enabling the use of the processor's "single-instruction-multiple-data" instructions to operate on two or four array elements (usually) in a single instruction. For example, if you have a DO loop where you multiply each array element by the corresponding element in another array, that can be done with vector instructions. Vectorization is the default on x64 (and will also be on IA-32 in the upcoming 11.0 release.)

-parallel asks the compiler to find loops where different iterations of the loop could be done safely in parallel. This can be done in conjunction with vectorization to better effect.

However, automatic parallelization is conservative and does not always yield the best results. That's where "directed parallelism" comes in with OpenMP. Here you tell the compiler which loops to parallelize and also provide information about variables to be shared or not shared, etc. You can start simply with OpenMP and get more aggressive as you learn more.

The Intel documentation has a major section on optimization with parallel processing - I suggest a read.

Retired 12/31/2016

Quoting - Steve Lionel (Intel)

Vectorization is not related to parallel - it is enabling the use of the processor's "single-instruction-multiple-data" instructions to operate on two or four array elements (usually) in a single instruction. For example, if you have a DO loop where you multiply each array element by the corresponding element in another array, that can be done with vector instructions. Vectorization is the default on x64 (and will also be on IA-32 in the upcoming 11.0 release.)

-parallel asks the compiler to find loops where different iterations of the loop could be done safely in parallel. This can be done in conjunction with vectorization to better effect.

However, automatic parallelization is conservative and does not always yield the best results. That's where "directed parallelism" comes in with OpenMP. Here you tell the compiler which loops to parallelize and also provide information about variables to be shared or not shared, etc. You can start simply with OpenMP and get more aggressive as you learn more.

The Intel documentation has a major section on optimization with parallel processing - I suggest a read.

Thank you, usefull answer.

Leave a Comment

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