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

Porting code from Unix cluster to PC

r_seeley
Beginner
613 Views
I have been provided with a fortran code to run an analysis on for a class I'm taking. The code was written for use on a unix cluster and uses the standard MPI interface. The code I'm trying to compile is the LESlie3d code used in the SPEC 2006 benchmark suite if that is useful. I would like to know how to modify the code to compile under MS visual studio 2008 using the intel fortran complier.Any help would be appreciated.

Thanks,

Robert
0 Kudos
4 Replies
TimP
Honored Contributor III
613 Views
If you're looking for a free MPI implementation, without high-speed multi-node communication, Argonne MPICH probably will do. Most people are using the one for 64-bit Windows, along with the Intel64 compiler.
The Intel MPI is currently available also as a beta test, in addition to the possibility of purchasing with support.
0 Kudos
r_seeley
Beginner
613 Views
Quoting - tim18
If you're looking for a free MPI implementation, without high-speed multi-node communication, Argonne MPICH probably will do. Most people are using the one for 64-bit Windows, along with the Intel64 compiler.
The Intel MPI is currently available also as a beta test, in addition to the possibility of purchasing with support.

Tim, thanks for the reply. I see my question was too general to help you understand my issue.

I've downloaded the MS HPC 2008 SKD which contains MS's MPI implementation based on Argonne NL's MPICH2 and installed it. However, when I try to compile the code I'm gifted with 832 errors. The first one tells me that the code is unable to find the mpif.h file. This is the first time I've had to try and port something over from a cluster computer, so I'm at something of a loss on how to proceed.

It is clear to me that I need to substitue the correct calls into the main program, but I have no idea what those calls should be. The documentation gives a detailed example of how to change the code provided by the portland group and is obviously geared towards their compiler. They also suggest running from the command line editor and using a makefile rather than the GUI that VS defaults to. There seems to be nothing regarding how to implement these changes with the intel compiler.

It is my suspicion that the function calls point to routines that the code isn't configured to run on my machine. What I need help with is the configuration of the code to use the MPI implementation that I have. I can post copies of the code, compiler settings or anything else that is helpful. However, I would like to know what would be helpful before I just dump a bunch of rubbish to the board.

Thanks,

Robert
0 Kudos
TimP
Honored Contributor III
613 Views
The point of configuring for a given Fortran compiler and MPI is that the mpif90 wrapper and VS MPI include and library paths will work the same, regardless of compiler. Intel MPI comes with an ifort wrapper already set up (mpiifort). In the Makefile, you should need to change only the compiler specific options. If you use ifort.cfg to specify your standard options, such as /Qprec-div /Qprec-sqrt /assume:protect_parens,minus0,byterecl,buffered_io, you won't even need to put them in the Makefile.
If your code base was working on a generic linux compiler, it won't have any PGI-specific function calls. If it came with a posix Makefile, you should be able to use that if you install a standard (gnu) make. You would adjust the Makefile to either rename .o files to .obj or substitute .obj for .o in the rules, substitute "lib /machine:..." for ar, and to adjust to the .exe executable convention. All of those are the same whether you use pgf90 or ifort. Assuming that the MSMPI docs suggest using nmake, there should be an example of the syntax for that. It's your choice whether you convert from standard Makefile to nmake Makefile, or use gnu make or VS GUI.
Watch out for any linux usage of .F90 vs .f90 or .F vs .f, distinctions which aren't preserved on Windows. If .F90 or .F are used to imply pre-processing, you need /fpp compiler flag for ifort Windows.
0 Kudos
r_seeley
Beginner
613 Views
Quoting - tim18
The point of configuring for a given Fortran compiler and MPI is that the mpif90 wrapper and VS MPI include and library paths will work the same, regardless of compiler. Intel MPI comes with an ifort wrapper already set up (mpiifort). In the Makefile, you should need to change only the compiler specific options. If you use ifort.cfg to specify your standard options, such as /Qprec-div /Qprec-sqrt /assume:protect_parens,minus0,byterecl,buffered_io, you won't even need to put them in the Makefile.
If your code base was working on a generic linux compiler, it won't have any PGI-specific function calls. If it came with a posix Makefile, you should be able to use that if you install a standard (gnu) make. You would adjust the Makefile to either rename .o files to .obj or substitute .obj for .o in the rules, substitute "lib /machine:..." for ar, and to adjust to the .exe executable convention. All of those are the same whether you use pgf90 or ifort. Assuming that the MSMPI docs suggest using nmake, there should be an example of the syntax for that. It's your choice whether you convert from standard Makefile to nmake Makefile, or use gnu make or VS GUI.
Watch out for any linux usage of .F90 vs .f90 or .F vs .f, distinctions which aren't preserved on Windows. If .F90 or .F are used to imply pre-processing, you need /fpp compiler flag for ifort Windows.
Tim, Thanks for the help. Your answer combined with a couple of tid-bits from the internet got it up and running.

Robert
0 Kudos
Reply