diff --git a/ThirdParty/AllClean.stage2 b/ThirdParty/AllClean.stage2 index 39dcacc0a..bdcb37a31 100755 --- a/ThirdParty/AllClean.stage2 +++ b/ThirdParty/AllClean.stage2 @@ -54,6 +54,7 @@ uninstallPackage openmpi-1.4.1 uninstallPackage openmpi-1.4.3 uninstallPackage openmpi-1.5 uninstallPackage openmpi-1.6.3 +uninstallPackage openmpi-1.6.5 echo echo ======================================== diff --git a/ThirdParty/rpmBuild/SPECS/metis-5.1.0.spec b/ThirdParty/rpmBuild/SPECS/metis-5.1.0.spec index e3028680a..ad1fd8308 100644 --- a/ThirdParty/rpmBuild/SPECS/metis-5.1.0.spec +++ b/ThirdParty/rpmBuild/SPECS/metis-5.1.0.spec @@ -98,6 +98,8 @@ Patch0: metis-5.0pre2_patch_darwin [ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS" [ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS" + [ -n "$WM_CXX" ] && export OMPI_CXX="$WM_CXX" + [ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1 %ifos darwin diff --git a/ThirdParty/rpmBuild/SPECS/openmpi-1.6.5.spec b/ThirdParty/rpmBuild/SPECS/openmpi-1.6.5.spec index 61979d56c..a18be89a7 100644 --- a/ThirdParty/rpmBuild/SPECS/openmpi-1.6.5.spec +++ b/ThirdParty/rpmBuild/SPECS/openmpi-1.6.5.spec @@ -67,13 +67,13 @@ %define buildroot %{_topdir}/BUILD/%{name}-%{version}-root -BuildRoot: %{buildroot} +BuildRoot: %{buildroot} Summary: openmpi License: Unkown Name: %{name} Version: %{version} Release: %{release} -URL: http://www.open-mpi.org/software/ompi/v1.6/downloads +URL: http://www.open-mpi.org/software/ompi/v1.6/downloads Source: %url/%{name}-%{version}.tar.gz Prefix: %{_prefix} Group: Development/Tools diff --git a/ThirdParty/rpmBuild/SPECS/ParMetis-4.0.3.spec b/ThirdParty/rpmBuild/SPECS/parmetis-4.0.3.spec similarity index 97% rename from ThirdParty/rpmBuild/SPECS/ParMetis-4.0.3.spec rename to ThirdParty/rpmBuild/SPECS/parmetis-4.0.3.spec index e80904226..a5a6d84cf 100644 --- a/ThirdParty/rpmBuild/SPECS/ParMetis-4.0.3.spec +++ b/ThirdParty/rpmBuild/SPECS/parmetis-4.0.3.spec @@ -101,6 +101,8 @@ Patch1: ParMetis-3.1.1.patch [ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS" [ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS" + [ -n "$WM_CXX" ] && export OMPI_CXX="$WM_CXX" + [ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1 make config make -j $WM_NCOMPPROCS @@ -108,11 +110,11 @@ Patch1: ParMetis-3.1.1.patch %install # Manual installation - mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/include/ParMETISLib + mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/include mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/lib + cp metis/include/*.h $RPM_BUILD_ROOT/%{_installPrefix}/include cp include/*.h $RPM_BUILD_ROOT/%{_installPrefix}/include - cp metis/libmetis/*.h $RPM_BUILD_ROOT/%{_installPrefix}/include/ParMETISLib cp build/*/libparmetis/lib* $RPM_BUILD_ROOT/%{_installPrefix}/lib cp build/*/libmetis/lib* $RPM_BUILD_ROOT/%{_installPrefix}/lib diff --git a/etc/settings.csh b/etc/settings.csh index 3ed696821..5fc314127 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -414,14 +414,14 @@ endif # Metis library if available # ~~~~~~~~~~~~~~~~~~~~~~~~~~ -if ( $?METIS_SYSTEM == 0 && -e $WM_THIRD_PARTY_DIR/packages/metis-5.0pre2/platforms/$WM_OPTIONS ) then - _foamSource $WM_THIRD_PARTY_DIR/packages/metis-5.0pre2/platforms/$WM_OPTIONS/etc/metis-5.0pre2.csh +if ( $?METIS_SYSTEM == 0 && -e $WM_THIRD_PARTY_DIR/packages/metis-5.1.0/platforms/$WM_OPTIONS ) then + _foamSource $WM_THIRD_PARTY_DIR/packages/metis-5.1.0/platforms/$WM_OPTIONS/etc/metis-5.1.0.csh endif # ParMetis library if available # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -if ( $?PARMETIS_SYSTEM == 0 && -e $WM_THIRD_PARTY_DIR/packages/ParMetis-3.1.1/platforms/$WM_OPTIONS ) then - _foamSource $WM_THIRD_PARTY_DIR/packages/ParMetis-3.1.1/platforms/$WM_OPTIONS/etc/ParMetis-3.1.1.csh +if ( $?PARMETIS_SYSTEM == 0 && -e $WM_THIRD_PARTY_DIR/packages/parmetis-4.0.3/platforms/$WM_OPTIONS ) then + _foamSource $WM_THIRD_PARTY_DIR/packages/parmetis-4.0.3/platforms/$WM_OPTIONS/etc/parmetis-4.0.3.csh endif # ParMGridGen library if available @@ -439,8 +439,8 @@ endif # Scotch library if available # ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -if ( $?SCOTCH_SYSTEM == 0 && -e $WM_THIRD_PARTY_DIR/packages/scotch-5.1.10b/platforms/$WM_OPTIONS ) then - _foamSource $WM_THIRD_PARTY_DIR/packages/scotch-5.1.10b/platforms/$WM_OPTIONS/etc/scotch-5.1.10b.csh +if ( $?SCOTCH_SYSTEM == 0 && -e $WM_THIRD_PARTY_DIR/packages/scotch-6.0.0/platforms/$WM_OPTIONS ) then + _foamSource $WM_THIRD_PARTY_DIR/packages/scotch-6.0.0/platforms/$WM_OPTIONS/etc/scotch-6.0.0.csh endif # Switch on the hoard memory allocator if available diff --git a/etc/settings.sh b/etc/settings.sh index c1e177fba..8b0518697 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -484,16 +484,16 @@ export MPI_BUFFER_SIZE # Load Metis library # ~~~~~~~~~~~~~~~~~~ -[ -z "$METIS_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/metis-5.0pre2/platforms/$WM_OPTIONS ] && { - _foamSource $WM_THIRD_PARTY_DIR/packages/metis-5.0pre2/platforms/$WM_OPTIONS/etc/metis-5.0pre2.sh +[ -z "$METIS_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/metis-5.1.0/platforms/$WM_OPTIONS ] && { + _foamSource $WM_THIRD_PARTY_DIR/packages/metis-5.1.0/platforms/$WM_OPTIONS/etc/metis-5.1.0.sh } [ "$FOAM_VERBOSE" -a "$PS1" ] && echo " METIS_DIR is initialized to: $METIS_DIR" # Load ParMetis library # ~~~~~~~~~~~~~~~~~~~~~ -[ -z "$PARMETIS_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/ParMetis-3.1.1/platforms/$WM_OPTIONS ] && { - _foamSource $WM_THIRD_PARTY_DIR/packages/ParMetis-3.1.1/platforms/$WM_OPTIONS/etc/ParMetis-3.1.1.sh +[ -z "$PARMETIS_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/parmetis-4.0.3/platforms/$WM_OPTIONS ] && { + _foamSource $WM_THIRD_PARTY_DIR/packages/parmetis-4.0.3/platforms/$WM_OPTIONS/etc/parmetis-4.0.3.sh } [ "$FOAM_VERBOSE" -a "$PS1" ] && echo " PARMETIS_DIR is initialized to: $PARMETIS_DIR" @@ -503,7 +503,7 @@ export MPI_BUFFER_SIZE [ -z "$PARMGRIDGEN_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/ParMGridGen-1.0/platforms/$WM_OPTIONS ] && { _foamSource $WM_THIRD_PARTY_DIR/packages/ParMGridGen-1.0/platforms/$WM_OPTIONS/etc/ParMGridGen-1.0.sh } -[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " PARMGRIDGEN_DIR is initialized to: $PARMGRIDGEN_DIR" +[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " PARMGR IDGEN_DIR is initialized to: $PARMGRIDGEN_DIR" # Load Libccmio library @@ -516,8 +516,8 @@ export MPI_BUFFER_SIZE # Load Scotch library # ~~~~~~~~~~~~~~~~~~~ -[ -z "$SCOTCH_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/scotch-5.1.10b/platforms/$WM_OPTIONS ] && { - _foamSource $WM_THIRD_PARTY_DIR/packages/scotch-5.1.10b/platforms/$WM_OPTIONS/etc/scotch-5.1.10b.sh +[ -z "$SCOTCH_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/scotch-6.0.0/platforms/$WM_OPTIONS ] && { + _foamSource $WM_THIRD_PARTY_DIR/packages/scotch-6.0.0/platforms/$WM_OPTIONS/etc/scotch-6.0.0.sh } [ "$FOAM_VERBOSE" -a "$PS1" ] && echo " SCOTCH_DIR is initialized to: $SCOTCH_DIR" diff --git a/src/decompositionMethods/decompositionMethods/Make/options b/src/decompositionMethods/decompositionMethods/Make/options index 6dcbd797f..fa9e1b727 100644 --- a/src/decompositionMethods/decompositionMethods/Make/options +++ b/src/decompositionMethods/decompositionMethods/Make/options @@ -3,6 +3,4 @@ EXE_INC = LIB_LIBS = \ -L$(FOAM_LIBBIN)/dummy \ -L$(FOAM_MPI_LIBBIN) \ - -lscotchDecomp \ - -lmetisDecomp \ - -lparMetisDecomp + -lscotchDecomp diff --git a/src/decompositionMethods/metisDecomp/Make/options b/src/decompositionMethods/metisDecomp/Make/options index 1cf9a25eb..f2ba1008a 100644 --- a/src/decompositionMethods/metisDecomp/Make/options +++ b/src/decompositionMethods/metisDecomp/Make/options @@ -5,6 +5,4 @@ EXE_INC = \ LIB_LIBS = \ -L$(FOAM_LIBBIN)/dummy \ - -L$(METIS_LIB_DIR) -lmetis \ - -L$(METIS_LIB_DIR) -lGKlib - + -L$(METIS_LIB_DIR) -lmetis diff --git a/src/decompositionMethods/metisDecomp/metisDecomp.C b/src/decompositionMethods/metisDecomp/metisDecomp.C index 9e545ebe1..724638ae1 100644 --- a/src/decompositionMethods/metisDecomp/metisDecomp.C +++ b/src/decompositionMethods/metisDecomp/metisDecomp.C @@ -62,9 +62,6 @@ Foam::label Foam::metisDecomp::decompose List& finalDecomp ) { - // C style numbering - int numFlag = 0; - // Method of decomposition // recursive: multi-level recursive bisection (default) // k-way: multi-level k-way @@ -207,96 +204,57 @@ Foam::label Foam::metisDecomp::decompose int edgeCut = 0; // Vertex weight info - int wgtFlag = 0; int* vwgtPtr = NULL; int* adjwgtPtr = NULL; if (cellWeights.size()) { vwgtPtr = cellWeights.begin(); - wgtFlag += 2; // Weights on vertices } if (faceWeights.size()) { adjwgtPtr = faceWeights.begin(); - wgtFlag += 1; // Weights on edges } + int one = 1; + if (method == "recursive") { - if (processorWeights.size()) - { - METIS_WPartGraphRecursive - ( - &numCells, // num vertices in graph - const_cast&>(xadj).begin(), // indexing into adjncy - const_cast&>(adjncy).begin(), // neighbour info - vwgtPtr, // vertexweights - adjwgtPtr, // no edgeweights - &wgtFlag, - &numFlag, - &nProcs, - processorWeights.begin(), - options.begin(), - &edgeCut, - finalDecomp.begin() - ); - } - else - { - METIS_PartGraphRecursive - ( - &numCells, // num vertices in graph - const_cast&>(xadj).begin(), // indexing into adjncy - const_cast&>(adjncy).begin(), // neighbour info - vwgtPtr, // vertexweights - adjwgtPtr, // no edgeweights - &wgtFlag, - &numFlag, - &nProcs, - options.begin(), - &edgeCut, - finalDecomp.begin() - ); - } + METIS_PartGraphRecursive + ( + &numCells, // num vertices in graph + &one, + const_cast&>(xadj).begin(), // indexing into adjncy + const_cast&>(adjncy).begin(), // neighbour info + vwgtPtr, // vertexweights + NULL, + adjwgtPtr, // no edgeweights + &nProcs, + processorWeights.begin(), + NULL, + options.begin(), + &edgeCut, + finalDecomp.begin() + ); } else { - if (processorWeights.size()) - { - METIS_WPartGraphKway - ( - &numCells, // num vertices in graph - const_cast&>(xadj).begin(), // indexing into adjncy - const_cast&>(adjncy).begin(), // neighbour info - vwgtPtr, // vertexweights - adjwgtPtr, // no edgeweights - &wgtFlag, - &numFlag, - &nProcs, - processorWeights.begin(), - options.begin(), - &edgeCut, - finalDecomp.begin() - ); - } - else - { - METIS_PartGraphKway - ( - &numCells, // num vertices in graph - const_cast&>(xadj).begin(), // indexing into adjncy - const_cast&>(adjncy).begin(), // neighbour info - vwgtPtr, // vertexweights - adjwgtPtr, // no edgeweights - &wgtFlag, - &numFlag, - &nProcs, - options.begin(), - &edgeCut, - finalDecomp.begin() - ); - } + METIS_PartGraphKway + ( + &numCells, // num vertices in graph + &one, + const_cast&>(xadj).begin(), // indexing into adjncy + const_cast&>(adjncy).begin(), // neighbour info + vwgtPtr, // vertexweights + NULL, + adjwgtPtr, // no edgeweights + &nProcs, + processorWeights.begin(), + NULL, + options.begin(), + &edgeCut, + finalDecomp.begin() + ); } return edgeCut; diff --git a/src/decompositionMethods/parMetisDecomp/Make/options b/src/decompositionMethods/parMetisDecomp/Make/options index de0e5e368..92d249eb9 100644 --- a/src/decompositionMethods/parMetisDecomp/Make/options +++ b/src/decompositionMethods/parMetisDecomp/Make/options @@ -2,7 +2,6 @@ include $(RULES)/mplib$(WM_MPLIB) EXE_INC = \ $(PFLAGS) $(PINC) \ - -I$(PARMETIS_INCLUDE_DIR)/ParMETISLib \ -I$(PARMETIS_INCLUDE_DIR) \ -I../decompositionMethods/lnInclude \ -I../metisDecomp/lnInclude \ @@ -10,5 +9,4 @@ EXE_INC = \ LIB_LIBS = \ -L$(FOAM_MPI_LIBBIN) \ - -L$(PARMETIS_LIB_DIR) -lmetis-parmetis \ -L$(PARMETIS_LIB_DIR) -lparmetis