Commit 2eeaa8b6 authored by Thomas Witkowski's avatar Thomas Witkowski

Added simple partitioner.

parent 173ee421
......@@ -44,7 +44,7 @@ available_tags=" CXX F77"
# ### BEGIN LIBTOOL CONFIG
# Libtool was configured on host p1q024:
# Libtool was configured on host deimos103:
# 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 p1q024:
# Libtool was configured on host deimos103:
# 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 p1q024:
# Libtool was configured on host deimos103:
# Shell to use when invoking shell scripts.
SHELL="/bin/sh"
......
......@@ -26,6 +26,7 @@
#include "parallel/MeshPartitioner.h"
#include "parallel/ParMetisPartitioner.h"
#include "parallel/ZoltanPartitioner.h"
#include "parallel/SimplePartitioner.h"
#include "parallel/MpiHelper.h"
#include "io/ElementFileWriter.h"
#include "io/MacroInfo.h"
......@@ -105,6 +106,9 @@ namespace AMDiS {
if (partStr == "zoltan")
partitioner = new ZoltanPartitioner(&mpiComm);
if (partStr == "simple")
partitioner = new SimplePartitioner(&mpiComm);
tmp = 0;
GET_PARAMETER(0, name + "->box partitioning", "%d", &tmp);
partitioner->setBoxPartitioning(static_cast<bool>(tmp));
......
......@@ -41,7 +41,12 @@ namespace AMDiS {
};
/**
* Abstract class for mesh partitioning. This class provides only a function
* for a random initial partitioning. A concrete partition must override the
* functions \ref MeshPartitioner::partition and
* \ref MeshPartitioner::createPartitionMap.
*/
class MeshPartitioner
{
public:
......
// ============================================================================
// == ==
// == AMDiS - Adaptive multidimensional simulations ==
// == ==
// == http://www.amdis-fem.org ==
// == ==
// ============================================================================
//
// Software License for AMDiS
//
// Copyright (c) 2010 Dresden University of Technology
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.
/** \file SimplePartitioner.h */
#ifndef AMDIS_SIMPLE_PARTITIONER_H
#define AMDIS_SIMPLE_PARTITIONER_H
#include "AMDiS_fwd.h"
#include "Global.h"
#include "parallel/MeshPartitioner.h"
namespace AMDiS {
/**
* The "Simple partitioner" does not change the initial partitioning which is more
* or less a random assignment of elements to ranks. This partitioner may be useful
* for either debugging purposes or if the number of macro elements is equal to the
* number of processes. In this case, neither ParMetis nor Zoltan will be able to
* compute a valid partition. But a random one-to-one partition is the best possible
* in this case.
*/
class SimplePartitioner : public MeshPartitioner
{
public:
SimplePartitioner(MPI::Intracomm *comm)
: MeshPartitioner(comm)
{}
~SimplePartitioner() {}
/// \ref MeshPartitioner::partition
bool partition(map<int, double> &elemWeights, PartitionMode mode = INITIAL)
{
return true;
}
void createPartitionMap(map<int, int>& pMap)
{
pMap = partitionMap;
}
};
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment