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

Open-MPI support for IVF

sang186
Beginner
1,061 Views
Hello,

I am trying to execute a "Hello World" Open-MPI project with IVF and this is my code :

PROGRAM test
INCLUDE 'mpif.h'
INTEGER ierr, myrank,size

CALL MPI_INIT(ierr)
CALL MPI_COMM_RANK(MPI_COMM_WORLD,myrank,ierr)
CALL MPI_COMM_SIZE(MPI_COMM_WORLD,size,ierr)
PRINT *, "Processor", myrank, "of", size, ": Hello World!"

CALL MPI_FINALIZE(ierr)
END PROGRAM

I have linked all the open-mpi library files with the project and the project compiles without any issues. I am running this code on a INTEL CORE 2-DUO PROCESSOR (6600 @ 2.4 GHz)


I would expect the above code to run on both processors and print both of them; assuming that the open-MPI interfacing has correctly been established (as I have no compile or run-time errors) .

However, the output of this code is

Processor 0 of 1 : Hello World!
Press any key to continue . . .


Could someone please suggest as to what could be the problem here ? Am I missing any Project Settings for enabling the parallel programming in the Processors ? I am fairly new to parallel processing and any help would be greatly appreciated.

Thanks in Advance.


Regards,
Sangeetha Chandrasekaran
University of Illinois.
0 Kudos
6 Replies
Steven_L_Intel1
Employee
1,061 Views
Sangeetha,

Intel Fortran does not have any direct support for MPI - that is, there are no project settings that are relevant. As far as the compiler is concerned, OpenMPI is just a library of routines you call. Typically with MPI you must tell it where you want the program to run and then use an "mpirun" or something similar to start the program. If you don't do that then you just get one copy.

You will need to read the OpenMPI documentation to see what it wants here. If you are open to other parallel processing options, Intel Fortran supports OpenMP, coarrays, DO CONCURRENT and automatic parallelism.
0 Kudos
sang186
Beginner
1,061 Views
Dear Steve,

Thank you very much for the suggestions. I will recheck my OpenMPI library inclusions to see what I am missing.

Thank you.

Regards,
Sangeetha
0 Kudos
Steven_L_Intel1
Employee
1,061 Views
It would not be in "library inclusions" but rather in something you have to do outside Visual Studio to run an MPI program in parallel. The details of this vary among MPI implementations.
0 Kudos
Arjen_Markus
Honored Contributor II
1,061 Views
How did you start the program?

With MPI it is usual to have a background process running that takes care of the finer
details of the communication and you ordinarily start a program with a command "mpirun".
This command is responsible for starting two or more copies of your program.

Regards,

Arjen
0 Kudos
sang186
Beginner
1,061 Views
Thank you for the reply, Steve. I have understood that this is different from an OpenMP implementation where an execution from IDE takes care of the parallelization based on the directives.
I have used mpirun/mpiexec command to execute my code and it works fine.
Thank you for the help.
Regards,
Sangeetha
0 Kudos
sang186
Beginner
1,061 Views
@arjenmarkus :
Originally, I had used the IDE to execute the program and I expected the mpi processes to automatically start the parallization (assuming a similar procedure as OpenMP) . But Now, I have understood that it has to be done separately in the command prompt by starting the parallelization engine using mpirun/mpiexec.

Thank you for the reply.
Regards,
Sangeetha
0 Kudos
Reply