Compiling Mohid with MPI
From MohidWiki
Compile with Compaq Visual Fortran on Windows
To compile Mohid with Compaq Visual Fortran 6.6c using MPI (MPICH2) in Windows please follow this steps:
- Setup a Mohid Project to compile with Compaq Visual Fortran (CVF6.6c). See more on Compiling with CVF.
- Make sure that in the same folder where the HDF5 libraries are placed you have the fmpich2s.lib file. If not, get it from SourceSafe.
- Create new configuration by going to "Build...Configurations".
- Click "Add".
- Name your new configuration e.g. "MPI".
- Select "Release" configuration from the "Copy settings from" dropdown box
- Press "OK", and then "Close".
- Go to "Project...Settings"
- Select the "Fortran" tab and "Preprocessor" in the "Category" dropdown box
- Include the _USE_MPI keyword in the "Predefined Preprocessor Symbols" text box
- Select the "Link" tab
- Select "General" in the "Category" dropdown box
- Add fmpich2s.lib at the "Object/library modules" text box
Compile with Intel Fortran Compiler on Windows
To compile Mohid with Intel Fortran Compiler 9.x (IFC) using MPI in Windows please follow this steps:
- You must have installed MPICH2 in your PC (and in the ones you which to use). It can be downloaded from [Here].
- Setup a Mohid Project to compile with IFC. See more on Compiling with IFC.
- Make sure that in the same folder where the HDF5 libraries are placed you have the fmpich2.lib file. If not, get it from SourceSafe.
- Create new configuration by going to "Build...Configurations".
- Select "<New...>" from the "Active Solution Configuration" dropdown box
- Name your new configuration in the "Solution Configuration Name" text box (e.g. "MPI")
- Select "Release" configuration from the "Copy settings from" dropdown box
- Press "OK", and then "Close".
- Go to "Project...Properties"
- Select "Fortran" and then "Preprocessor" in the "Configuration Properties" tree view menu
- Include the _USE_MPI keyword in the "Preprocessor Definition" text box of MOHIDBase1, MOHIDBase2 and MOHIDWater
- Include the MPI external libs (i.e. ..\..\..\..\ExternalLibs\MPI_x64\IntelFortran11\Include for 64 bits) in Preprocessor > Include Adittional directories of MOHIDBase1, MOHIDBase2 and MOHIDWater
- Include the MPI external libraries (i.e. ..\..\..\..\ExternalLibs\MPI_x64\IntelFortran11\Lib for 64 bits) in Preprocessor > Include Adittional directories of MOHIDWater
- Press the "Apply" button and then "OK"
- Check the links for MohidBase1 in MohidBase2 in Properties > Fortran > General
- Check the links for MohidBase1 and MohidBase2 in MOHIDWater in Properties > Fortran > General
- Check the links for MohidBase1 and MohidBase2 in MOHIDWater in Linker > General
- Select the "Linker" then "Input" and Add fmpich2.lib in the "Additional Dependencies" text box in MOHIDWater
- Rebuild
Compile with IFC on Linux
- Build the mpich libraries:
>./configure --enable-f90 --enable-romio >make >make testing >make install
- Build the hdf5 libs with MPI:
CC=mpicc F9X=mpif90 ./configure --enable-fortran --disable-shared --prefix=/home/guillaume/Projects/hdf5/hdf5-1.6.5/hdf5_mpi make make install
- Build MohidWater with MPI
make nix_mpi
Basically nix_mpi uses mpif90 instead of ifort and appends the argument -D_USE_MPI in the CCFLAGS environment variable.