From c8a155463f858f878ecae14070f86f4cdf091800 Mon Sep 17 00:00:00 2001 From: Thomas Witkowski <thomas.witkowski@gmx.de> Date: Wed, 6 Apr 2011 12:25:18 +0000 Subject: [PATCH] ParMetis support improved. --- AMDiS/libtool | 6 +-- AMDiS/src/parallel/MeshDistributor.cc | 2 +- AMDiS/src/parallel/ParMetisPartitioner.cc | 49 +---------------------- AMDiS/src/parallel/ParallelDebug.cc | 4 +- 4 files changed, 7 insertions(+), 54 deletions(-) diff --git a/AMDiS/libtool b/AMDiS/libtool index 21443861..6817f526 100755 --- a/AMDiS/libtool +++ b/AMDiS/libtool @@ -44,7 +44,7 @@ available_tags=" CXX F77" # ### BEGIN LIBTOOL CONFIG -# Libtool was configured on host deimos101: +# Libtool was configured on host deimos104: # Shell to use when invoking shell scripts. SHELL="/bin/sh" @@ -6760,7 +6760,7 @@ build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` # End: # ### BEGIN LIBTOOL TAG CONFIG: CXX -# Libtool was configured on host deimos101: +# Libtool was configured on host deimos104: # Shell to use when invoking shell scripts. SHELL="/bin/sh" @@ -7065,7 +7065,7 @@ include_expsyms="" # ### BEGIN LIBTOOL TAG CONFIG: F77 -# Libtool was configured on host deimos101: +# Libtool was configured on host deimos104: # Shell to use when invoking shell scripts. SHELL="/bin/sh" diff --git a/AMDiS/src/parallel/MeshDistributor.cc b/AMDiS/src/parallel/MeshDistributor.cc index 22557f1b..eb1ca3d7 100644 --- a/AMDiS/src/parallel/MeshDistributor.cc +++ b/AMDiS/src/parallel/MeshDistributor.cc @@ -2011,7 +2011,7 @@ namespace AMDiS { FUNCNAME("MeshDistributor::serialize()"); checkMeshChange(false); - + partitioner->serialize(out); SerUtil::serialize(out, elemWeights); diff --git a/AMDiS/src/parallel/ParMetisPartitioner.cc b/AMDiS/src/parallel/ParMetisPartitioner.cc index ee45e72c..2116c755 100644 --- a/AMDiS/src/parallel/ParMetisPartitioner.cc +++ b/AMDiS/src/parallel/ParMetisPartitioner.cc @@ -298,55 +298,8 @@ namespace AMDiS { tpwgts[i] = 1.0 / nparts; float scale = 10000.0 / maxWgt; - - - // === Scale element weights. === - - int smin = 9999999; - int smax = 0; - int ssum = 0; - - for (int i = 0; i < nElements; i++) { - wgts[i] = static_cast<int>(floatWgts[i] * scale); - smin = std::min(smin, wgts[i]); - smax = std::max(smax, wgts[i]); - ssum += wgts[i]; - } - - mpi::globalMin(smin); - mpi::globalMax(smax); - mpi::globalAdd(ssum); - - MSG("DATA SMIN = %d SMAX = %d SSUM = %d\n", smin, smax, ssum); - - int kpart = ssum / mpiSize; - int kpartMax = 0; for (int i = 0; i < nElements; i++) - if (wgts[i] < kpart) - kpartMax = std::max(kpartMax, wgts[i]); - - mpi::globalMax(kpartMax); - - MSG("KPART MAX: %d\n", kpartMax); - - smin = 9999999; - smax = 0; - ssum = 0; - - for (int i = 0; i < nElements; i++) { - wgts[i] = std::min(wgts[i], kpartMax); - wgts[i] = std::max(wgts[i], 1); - - smin = std::min(smin, wgts[i]); - smax = std::max(smax, wgts[i]); - ssum += wgts[i]; - } - - mpi::globalMin(smin); - mpi::globalMax(smax); - mpi::globalAdd(ssum); - - MSG("DATA SMIN = %d SMAX = %d SSUM = %d\n", smin, smax, ssum); + wgts[i] = static_cast<int>(floatWgts[i] * scale); // === Start ParMETIS. === diff --git a/AMDiS/src/parallel/ParallelDebug.cc b/AMDiS/src/parallel/ParallelDebug.cc index d7b5e06a..a98db4c0 100644 --- a/AMDiS/src/parallel/ParallelDebug.cc +++ b/AMDiS/src/parallel/ParallelDebug.cc @@ -730,9 +730,9 @@ namespace AMDiS { { FUNCNAME("ParallelDebug::printBoundaryInfo()"); - int tmp = 1; + int tmp = 0; GET_PARAMETER(0, "parallel->debug->print boundary info", "%d", &tmp); - if (tmp <= 0) + if (tmp <= 1) return; for (InteriorBoundary::iterator it(pdb.myIntBoundary); !it.end(); ++it) { -- GitLab