Using Intel ifc with MPI

Using Intel ifc with MPI


I have been trying to find out about how to configure MPI to work with Intel Fortran Compiler 7.0 for Linux i386.

I found a note within the mpif90 scriptfile stating that one would need to create a specific list of files containing the module names and directories for ifc.

I wish to find out how this list could be created and where this list should be placed in order to allow mpif90 to recognize ifc as the compiler for f90/95 programs.

At the same time, what other configurations would have to be performed within the mpif90 scriptfile in order to compile the parallelized program correctly?


Tian Jan

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

I don't recognize the instructions you refer to from the mpi implementations I've used. Both mpich and lam are popular and have been used successfully many times with ifc, as have several others, including some with full professional support.
My usual expectation is that the mpif90 and mpif77 scripts or executables are set up by following a configure and build script. ifc must be installed and its environment variables (set by ifcvars script) active when mpi is configured and built. You specify ifc as the compiler to be used for both fc or f77 and f90, and you may need to specify that -Vaxlib option is to be passed to ifc.
The mpif scripts, include files, and libraries normally go automatically into the paths used by gcc/g77, no matter whether you specified that one of those should be used. You would normally be able to build mpi with either gcc or icc along with ifc, but you can't mix g77 with ifc, nor can you use an mpi built on g77 with ifc. Your ifc environment must be active to compile; the error message you get when you fail to do so is not helpful, as the mpif90 will be found, but it will fail to find some component of ifc.

Like what you have mentioned, the problem is that mpich-1.2.3 was installed before ifc-7.0. However my task is unfortunately to try to enable the use of ifc with mpi without having to re-install mpi.

I found this set of instructions as comments within the mpif90 script, hence I thought this might be a possible solution.

g77 and ifc have different calling conventions and runtime libraries, and hence in general are not binary compatible, as Tim indicates above.
However, I have heard reports from users who been able to workaround this for the specific case of MPI. The most obvious difference between g77 and ifc objects is that g77 decorates symbols with two trailing underscores, whereas Intel uses only one (with an option for zero).
The symbol names generated by the Intel compiler can be renamed by attributes directives, e.g.:
!DEC$ATTRIBUTES ALIAS:'mpi_init__'::mpi_init
etc. (see the language reference). An include file containing these can be included in any routine with an MPI call. You might need to link the MPI libraries with other needed GNU libraries, in such a way that they don't interfere with the Intel Fortran runtime for Intel-compiled code.

Note that this is not a supported procedure, and could encounter other problems. The recommendation is to use an MPI library built with at least the Intel Fortran compiler. But it might allow you to get a quick start.


Here's config.status from when I last built mpich 1.2.3

# ./configure --enable-f90modules -fc=/opt/intel/compiler60/ia32/bin/ifc -cc=/op
t/intel/compiler60/ia32/bin/icc -c++=/opt/intel/compiler60/ia32/bin/icc -f90=/op
t/intel/compiler60/ia32/bin/ifc -rsh=/usr/bin/ssh

We have built mpich 1.2.[35] with ifc/icc 7.0 and 7.1 under RH8.

It may be very difficult to do what you are trying to do.

It seems you want to compile Fortran 90 programs (mpif90). If mpich-1.2.3 was installed before ifc then it is likely the Fortran 90 components of mpich were not compiled. That's because they need a Fortran 90 compiler to compile them. Moreover, in the default mpich configuration for 1.2.3 the Fortran 90 modules of mpich are not built - you need to specify --enable-f90modules. The Fortran 77 components are built, using g77.

The Fortran 90 modules run special scripts in the Fortran 90 directory. It took some extra hand massaging to get them to work for me. They generate overloaded mpich function and subroutine bindings which Fortran 90 allows (nice), However they didnt generate enough permutations to cover the bindings I needed which is why they needed to be massaged (and I have this vague recollection they didnt quite work anyhow). The bindings means that your arguments to mpich functions get checked (nice) - this saved me from what would have been several major debug sessions.

I suspect the Fortran 90 support has improved in mpich 1.2.5, which is what we are now switching to ...

Leave a Comment

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