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

Help with MPI

Alexandre_M_1
Beginner
881 Views

I am stuck with basic stuff and have no idea where to go.

I have and old F77 code with a include 'mpi.h' line. The Fortran version I used at the time did not support MPI so I installed MPICH and was able to include the path somewhere.

However, things are too powerful now and I feel that I am trying to kill a mosquito with an atomic bomb: I have MS Visual Studio Enterprise 2015 (MSDNAA) and Intel Parallel Studio XE 2016 Update 3 - which includes Intel MPI Library 5.1. (I would possibly get away with the 1999 Compaq Visual Fortran so it is really too much...)

So it seems that I have all I need installed but the knowledge to make things work. Could anyone please easy my pain and tell me where and how I include the mpi library in the path?? I also did not find any mpi.h header so possibly things evolved and I am still in the jurassic age?

Thank you very much for any support.

0 Kudos
7 Replies
Alexandre_M_1
Beginner
881 Views

Back to the MPI topic, it is there...

 

Also, the correct line I have in my jurassic code is include 'mpif.h'...  I am sorry for the mistake

0 Kudos
Kevin_D_Intel
Employee
881 Views

From the Intel® MPI Library Developer Guide for Windows* OS, please review the details in the topic, Configuring a Visual Studio* Project, https://software.intel.com/en-us/node/610381

You should be able to use mpif.h or the Fortran specific pre-compiled mpi module (i.e. USE mpi). If you have the full Intel® MPI installed both the .h and .mod are available under a path named like: C:\Program Files (x86)\IntelSWTools\mpi\5.1.3.207\intel64\include

If you are missing the "include" sub-folder then you may not have installed the complete Intel® MPI component which is only included with the Parallel Studio XE Cluster Edition. There is a smaller run-time environment only that will install when using a Fortran Composer Edition license subscription.

You have license subscriptions for both Composer and Cluster Editions so when you install make certain you use the serial number for the Cluster Edition and then watch/double-check during the installation to ensure that you install the complete Intel® MPI component.

Hope this helps.

0 Kudos
TimP
Honored Contributor III
881 Views

Kevin pointed out the instructions for VS projects with MPI.  If compiling from command line, the compiler wrapper mpiifort is used in place of ifort as the compile command after opening the compiler cmd prompt window.  MPICH would use the mpif90 wrapper.  These wrappers take care of the MPI include and library/dll paths.

In the documentation folder of your parallel studio there is a full set of Intel MPI documents, if you have installed MPI.

0 Kudos
Alexandre_M_1
Beginner
881 Views

Many thanks for the comments.

I do everything from within VS - just easier, I suppose.

The folders are there - I think I am stuck with the project "options" / parameters rather than anything else...  and yes, MPI + include is there. I will try with USE mpi instead of include mpif.h. These things are confusing...

0 Kudos
Alexandre_M_1
Beginner
881 Views

Not even the example that comes with Intel Fortran I am able to build...  any help please?...

0 Kudos
Alexandre_M_1
Beginner
881 Views

I also tried what is described in the link below, but all the steps and/or options mentioned there do not exist in my case!!!! Or even worse: how do I do these things???

https://software.intel.com/en-us/node/610381

Configuring a Visual Studio* Project

To configure a Visual Studio* project with Intel® MPI Library, do the following:

  1. In Microsoft* Visual Studio*, create a console application project, or open an existing one.

  2. Open the project properties and go to Configuration Properties > Debugging. Set the following parameters:

    Command: $(I_MPI_ROOT)\intel64\bin\mpiexec.exe
    Command arguments: -n <processes_number> "$(TargetPath)"

  3. In Configuration Properties > C/C++ or Fortran, as appropriate, set the following parameter:

    Additional Include Directories: $(I_MPI_ROOT)\intel64\include

  4. In Configuration Properties > Linker, set the following parameter:

    Additional Library Directories: $(I_MPI_ROOT)\intel64\lib\<configuration>

    You can set the following values for <configuration>:

    • debug: single-threaded debug library
    • release: single-threaded optimized library
    • debug_mt: multi-threaded debug library
    • release_mt: multi-threaded optimized library
  5. In Configuration Properties > Linker > Input, set the following parameter:

    Additional Dependencies: impi.lib

After completing these steps, you can build the solution and run the application. To run the application from Visual Studio*, you can use the Ctrl + F5 key combination (Start Without Debugging). For other options of running MPI applications, see Running Applications.

 

 

0 Kudos
Kevin_D_Intel
Employee
881 Views

You appear to be building for Win32 which is not supported. Only Intel® 64 is supported per the MPI Library 5.1 RNs, https://software.intel.com/sites/default/files/managed/f1/f9/intelmpi-5.1-update3-releasenotes-windows.pdf

I expect if you create an x64 configuration from what you described currently having done under your Visual Studio solution/project, then it should work. I confirmed the settings you cited from the earlier UG reference work using the attached example.

0 Kudos
Reply