Wiki

Clone wiki

pflotran / Depreciated / Installation / ParMETIS

Building PFLOTRAN with ParMETIS , on a Windows machine

Author: Chen Shapira

Background

ParMETIS is a parallel , MPI-based library that handles the partitioning of unstructured grids/meshes/graphs.

I assume you already built PFLOTRAN once in Visual Studio, and that you have the knowledge of how to configure and build petsv-dev.

Instructions

Part 1 : Building ParMETIS

(skip to Part 2 if you already did that and have parmetis.lib and metis.lib)

  1. Download the latest ParMETIS source from:
http://glaros.dtc.umn.edu/gkhome/metis/parmetis/download
  1. extract the .tar file .
Note : The following instructions are for building the Release version of ParMETIS.
  1. Obtain and Install the latest CMake Win32 Installer from: http://www.cmake.org/cmake/resources/software.html
We will use CMake to build a Visual Studio Solution of ParMETIS .
  1. Open CMake GUI, browse to the location of the ParMETIS source with the “Browse Source” button, afterwards set the build directory in the next line.
Click “Generate” and select the correct Visual Studio version, and build the project.
  1. Open the output directory (where you built parmetis), and launch ParMETIS.sln in Visual Studio. Set the configuration to “Release”.
  2. In Visual Studio, do the following changes for the projects “Metis” and “Parmetis”:
go to Project-> Properties-> C/C++ -> Code Generation -> Runtime Library -> change it to /MT.
  1. Build the 2 projects “Metis” and “Parmetis”.
  2. In windows, search for all the *.h files in Parmetis folder, create a new folder inside Parmetis directory and put them inside. Same for Metis. Find metis.lib and parmetis.lib in the Parmetis folder, create a new folder for the libs inside Parmetis directory and put them inside.

Part 2 : Configuring PETSc to use ParMETIS

  1. Launch Cygwin and configure PETSC to use ParMETIS by adding the following lines to PETSC’s configure command (set the correct directories for the lib and include files):
--with-metis=1 --with-metis-include=/home/parmetis/include_all
--with-metis-lib=\[/home/parmetis_built/libs/metis.lib\]
--with-parmetis=1 --with-parmetis-include=/home/parmetis/include_all
--with-parmetis-lib=\[/home/parmetis_built/libs/parmetis.lib\]

Run the configure command, And then run “make all” to build petsc .

  1. go to <petsc-dev>arch-mswin-c-debuglib, and delete metis.lib and parmetis.lib

Part 3 : Configuring PFLOTRAN to use ParMETIS

  1. Open the PFLOTRAN Visual Studio Solution file you used in the past,

And modify the following (Again, change the directories as necessary):

Project-> Properties-> Fortran-> Additional Include Directories-> Add the following directory : C:cygwinhomeparmetisinclude_all

Project-> Properties -> Linker-> Additional Library Directories-> Add the following directory : C:cygwinhomeparmetis_builtlibs .

Project-> Properties -> Linker-> Input-> Additional Dependencies->

Add to the list , before libpetsc.lib, the following libs: metis.lib parmetis.lib

Project-> Properties-> Fortran-> General-> Preprocessor Definitions:

Add to the list: PETSC_HAVE_PARMETIS

  1. Clean and Rebuild the PFLOTRAN project.

If after building pflotran you get an error related to LIBCMT, do the following:

Project-> Properties -> Linker -> Input -> Ignore Specific Library ->msvcrt.lib

Updated