Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
112 Views

Using MPI with ifort

I have inherited an application with a makefile that supports the use of MPI for parallelization.  Toward the end of the make procedure, the make fails due to the mpif90 command not being found.  I have installed openmpi-bin (I am using Ubuntu 16.04), but that might have been pointless.

Could someone provide me with a link to enabling MPI with ifort?  Or perhaps some common pitfalls that I should look for.

I searched for information on this forum, and a couple of the threads mention an openmpi zipped tarball that needs to be extracted and built, but I do not see one anywhere.

Thanks,
Jay

0 Kudos
20 Replies
Highlighted
Valued Contributor I
112 Views

Hi Jay,

Hi Jay,

first of all, Intel ships its own MPI implementation, so there is in principle no need to install OpenMPI or MPICH yourself. The MPI command for Fortran is usually mpifort, not mpif90. 

Cheers,

     JRR

 

 

 

0 Kudos
Highlighted
Beginner
112 Views

Thanks.  But mpifort is not

Thanks.  But mpifort is not recognized either.  Any ideas?

j

0 Kudos
Highlighted
Beginner
112 Views

@Jay

@Jay

When you say mpifort is not being recognized, are you sourcing you installation path?

And the command is mpiifort, with two "i".

0 Kudos
Highlighted
Valued Contributor I
112 Views

Actually, it should be

Actually, it should be mpiifort. But indeed, there are some pecularities. In the tarball for the 2019beta version that I downloaded there is besides the linux/intel64/bin also a directory with mpi binaries compilers_and_libraries_2019.0.046/linux/mpi/intel64/bin/mpiifort together with a script to set all the environments. In the prepackaged (official) versions there is also such a directory but only these files:

$ ls 
cpuinfo           hydra_persist  IMB-NBC  Llama              mpicleanup  mpiexec.hydra  mpitune      mpivars.sh  tune
hydra_nameserver  IMB-MPI1       IMB-RMA  llamaMPIClient.py  mpiexec     mpirun         mpivars.csh  pmi_proxy

This looks a little bit strange to me. I fear that someone from Intel has to answer whether the official tarballs don't contain the mpi-versions of the compiler. 

 

0 Kudos
Highlighted
Beginner
112 Views

For me

For me

source /opt/intel/bin/compilervars.sh intel64

sets both parallel and serial paths i.e.

/opt/intel/compilers_and_libraries_2018.2.199/linux/bin/intel64
/opt/intel/compilers_and_libraries_2018.2.199/linux/mpi/intel64/bin

I am using 2018 update 2.

0 Kudos
Highlighted
Black Belt
112 Views

I'm surprised no one

I'm surprised no one mentioned that only the high priced cluster studio version of released Intel parallel studio includes the full Intel MPI.  ifort by itself includes only the coarray support version of MPI.  For that reason it's common to build openmpi  or some other open source MPI against ifort.  I don't know of any MPI other than openmpi which names its wrapper mpifort, not any other than Intel MPI which has a separate ifort wrapper named mpiifort along with a gfortran wrapper named mpif90.

0 Kudos
Highlighted
Beginner
112 Views

Thank you, everyone, for

Thank you, everyone, for taking the time to respond.

I had tried mpiifort as well, but I think the later posts get to the heart of the matter.  I am using a no-longer-supported version of Intel version 16, and our original license was for the "lowest-end" compiler because the project did not expect to use parallelization.  I did find compilervars.sh and, on my Ubuntu 16.04 server with multiple CPUs, I entered:

./intel/bin/compilervars.sh -arch intel64 -platform linux

The mpiifort (heh, I tried both spellings) command is still not recognized.  Given the license that I am currently using, would further efforts be worthwhile?  The need at the moment is to improve performance by about a factor of 6, and we have a machine with several times that many CPUs at our disposal.

One more question:  I will offer the task manager the option of buying a license with full MPI support.  I know that the budget is limited, but perhaps an institutional purchase can be made.  She will ask the following reasonable question:  Would we be paying for something that gfortran already offers?  Based on what factors might she be making a "buy" decision rather than reverting to gfortran, which the prior developer was using?

Thanks,
Jay

0 Kudos
Highlighted
Beginner
112 Views

As Tim P. mentioned unless

As Tim P. mentioned unless you have a parallel studio license, you will not have full MPI support.

You can use openmpi-gfortran instead which will speedup your program compared to serial code.

Unless you are using intel specific libraries, the code should compile without any problems. About buying a MPI-supported license, it all boils down to money-vs-time. Sure intel-mpi might give you speed up over openmpi-gfortran, but by what factor! All these you have to consider. I would love to hear what others have to say.

0 Kudos
Highlighted
Beginner
112 Views

If anyone from Intel would

If anyone from Intel would like to send me a quote for a single-user license with full MPI support, I'm "all eyes".  I think my email address is in my profile.

In the meantime, I have begun looking at gfortran MPI.

Thanks,

Jay

0 Kudos
Highlighted
Black Belt
112 Views

I don't think gfortran

I don't think gfortran includes MPI, but there are a couple of open-source MPI implementations you can use. You can also use these with Intel Fortran, such as OpenMPI or mpich2.

As Tim says, only the "Cluster Edition" of Intel Parallel Studio XE includes Intel MPI development support. I never understood why Intel MPI was an extra-cost option, but it is. You can buy it separately if you want.

I don't think anyone here can "send you a quote". If your organization has an Intel sales rep assigned, ping her or him. Alternatively you can see prices at https://softwarestore.intel.com/ProductSelector/Parallel%20Studio/Cluster and clicking through.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Beginner
112 Views

I installed the updated beta

I installed the updated beta release of ifort 19, which has MPI support among other features.  Not surprised, but 'mpiifort' is not recognized "out of the box".  What's a good resource on activating MPI support, e.g., a link?

Thanks,
Jay

0 Kudos
Highlighted
Black Belt
112 Views

I think you're mistaken that

I think you're mistaken that ifort 19 "includes MPI support". It includes the MPI run-time library to support coarrays, but not what you need to put MPI calls into your program (or use mpifort).

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Beginner
112 Views

The application has MPI calls

The application has MPI calls already, though by default MPI is not used.  So any links to information about Intel's MPI run-time library, as well as program and compilation requirements would be most appreciated. 

j

0 Kudos
Highlighted
Black Belt
112 Views

Unless it has changed

Unless it has changed recently, Intel MPI requires both the compilervars and the mpivars scripts to be sourced before using MPI.  Likewise, if you build an open source MPI correctly, it will not be present on default paths.  If you set up MPI so that it doesn't require its own path settings, you will not be able to install another MPI in case you require a choice of mpi implementations or compilers.  For example, the MPI which comes with linux should not be installed unless you will use that one with gfortran exclusively (and it may be outdated). Intel MPI gives you a choice between gfortran (mpif90) and ifort (mpiifort), priovided that you have installed both compilers. 

I thought the offering of Intel MPI separately from combined Intel Fortran and C++ had gone away long ago.  

A possible problem with open source MPI: you would not likely be able (AFAIK) to use ifort coarrays while a non-Intel MPI is set up on path.  Explicit support of combined MPI and coarrays was a selling point of some proprietary coarray implementations and might be possible with gfortran when it is built for the specific MPI you use.

0 Kudos
Highlighted
Black Belt
112 Views

Only the shared library

Only the shared library support for Intel MPI is provided, and none of the include or module files. You would need the full Intel MPI install, which is part of the Cluster Edition of Parallel Studio XE, to be able to build MPI applications using Intel MPI.

Coarrays can be used with some non-Intel MPI implementations, though it is not a supported combination. I am not going into the details at this time as I don't think it's relevant.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos
Highlighted
Beginner
112 Views

Would you or anyone here know

Would you or anyone here know if the version 19 beta encompasses the Cluster Edition?  Alternatively, how I can determine that, e.g., the presence or absence of a specific file or directory?

0 Kudos
Highlighted
Valued Contributor I
112 Views

Yes, the beta version

Yes, the beta version contains the cluster edition and also vtune etc. Search for compilers_and_libraries_2019.0.070/linux/mpi. This directory should contain binaries mpif90, mpiifort, mpiicc etc. If they are not there, but only mpirun, mpiexec, then you don't have the cluster edition. 

0 Kudos
Highlighted
Beginner
112 Views

(looking for a thumbs-up

(looking for a thumbs-up emoticon)

So, all I need is a link or two or more to get me started.

Thank you, all who responded.

0 Kudos
Highlighted
Black Belt
112 Views

Just keep in mind that once

Just keep in mind that once the beta ends, your license to use those components ends as well.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran
0 Kudos