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

compile MPI/OpenMP hybrid code

jasonzhong
Beginner
964 Views
Hi,
I want to compile my MPI/OpenMP hybrid code. But Intel Fortran compiler 10.0 can support it. I can only use "ifort a.f -openmp" to compile OpenMP's code, and use "mpif77 b.f" to compile MPI's code.

But how can I compile MPI/OpenMP hybrid code? thanks!

jason
0 Kudos
2 Replies
TimP
Honored Contributor III
964 Views
Do you mean that your mpif77 refers to a compiler which doesn't support OpenMP? mpif77 usually is a script which invokes a compiler. If that compiler supports OpenMP, mpif77 then supports the same OpenMP options.
Intel MPI makes a somewhat unusual distinction, where mpif77 refers to gfortran, while mpiifort refers to ifort. You can still use mpif77 -fopenmp, if your gfortran is up to date, such as the gfortran 4.2.1 which came with my current linux. The libiomp which comes with ifort 10.1 is compatible with gcc OpenMP. You can mix 'mpicc -fopenmp' with 'mpiifort -openmp -openmp-lib compat', if you take care to link with the libiomp implied by this ifort option.
If you are using an open source MPI, reconfigure so that mpif77 does use an OpenMP compiler (preferably ifort). You would want to use the same Fortran throughout, to avoid run-time library conflicts.
0 Kudos
jasonzhong
Beginner
964 Views
I installed MPICH2 with ifort. Let me try.
thanks a lot. :D
0 Kudos
Reply