Liebe Gitlab-Nutzer, lieber Gitlab-Nutzer, es ist nun möglich sich mittels des ZIH-Logins/LDAP an unserem Dienst anzumelden. Ein Anmelden über dieses erzeugt ein neues Konto. Das alte Konto ist über den Reiter "Standard" erreichbar. Die Administratoren

Dear Gitlab user, it is now possible to log in to our service using the ZIH login/LDAP. Logging in via this will create a new account. The old account can be accessed via the "Standard" tab. The administrators

Commit 6f8a7433 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Add test for multilevel interior boundaries and dof communicators.

parent 08a7ce8f
......@@ -44,7 +44,12 @@ namespace AMDiS {
void DofComm::create(InteriorBoundary &boundary)
{
FUNCNAME("DofComm::create()");
MSG("---> senddofs\n");
createContainer(boundary.getOwn(), sendDofs);
MSG("---> recvdofs\n");
createContainer(boundary.getOther(), recvDofs);
}
......
......@@ -72,7 +72,6 @@ namespace AMDiS {
continue;
int owner = elObjDb.getIterateOwner(level);
MSG("OWNER IN LEVEL %d IS %d\n",level, owner);
ElementObjectData& rankBoundEl = objData[globalMpiRank];
AtomicBoundary bound;
......
......@@ -1535,12 +1535,11 @@ namespace AMDiS {
dofComm.init(0, levelData, feSpaces);
dofComm.create(intBoundary);
#if 0
if (levelData.getLevelNumber() > 1) {
dofCommSd.init(1, levelData, feSpaces);
dofCommSd.create(intBoundary);
MSG("START CREATE DOF-COMM-SD\n");
dofCommSd.init(0, levelData, feSpaces);
dofCommSd.create(intBoundarySd);
}
#endif
// === If requested, create more information on communication DOFs. ===
......
......@@ -162,11 +162,21 @@ namespace AMDiS {
return dofComm;
}
DofComm& getDofCommSd()
{
return dofCommSd;
}
InteriorBoundary& getIntBoundary()
{
return intBoundary;
}
InteriorBoundary& getIntBoundarySd()
{
return intBoundarySd;
}
inline long getLastMeshChangeIndex()
{
return lastMeshChangeIndex;
......
# rank_id n_own_dofs n_other_dofs
0 0 5
1 2 3
2 0 5
3 2 3
4 2 3
5 5 0
6 2 3
7 5 0
8 0 5
9 2 3
10 0 5
11 2 3
12 2 3
13 5 0
14 2 3
15 5 0
dimension of world: 2
elliptMesh->macro file name: ./macro/macro.stand.p16.2d
elliptMesh->global refinements: 3
ellipt->mesh: elliptMesh
ellipt->dim: 2
ellipt->components: 1
ellipt->polynomial degree[0]: 1
ellipt->solver: cg
ellipt->solver->max iteration: 10
ellipt->solver->tolerance: 1.e-8
ellipt->solver->info: 10
ellipt->solver->left precon: diag
ellipt->solver->right precon: no
ellipt->estimator[0]: 0
ellipt->marker[0]->strategy: 0
parallel->log main rank: 0
parallel->pre refine: 0
parallel->partitioner: checker
parallel->multi level test: 1
parallel->solver: petsc-feti
......@@ -9,7 +9,8 @@ using namespace AMDiS;
using namespace std;
/*
-
- Simple FETI-DP test on the number of local and global primal, dual and
interior nodes.
*/
BOOST_AUTO_TEST_CASE(amdis_mpi_feti)
......
......@@ -11,7 +11,7 @@ using namespace std;
using boost::lexical_cast;
/*
-
- Test 2-level FETI-DP on the number of global primal and dual nodes.
*/
BOOST_AUTO_TEST_CASE(amdis_mpi_feti_multilevel)
......
......@@ -9,7 +9,7 @@ using namespace AMDiS;
using namespace std;
/*
-
- Test DOF communicator on 2-level decomposition of a 4x4 rank domain.
*/
BOOST_AUTO_TEST_CASE(amdis_mpi_feti_multilevel)
......
......@@ -9,7 +9,8 @@ using namespace AMDiS;
using namespace std;
/*
-
- Test for interior boundaries on a 2-level 4x4 rank decomposition.
- Compaires the interior boundary object with a serialization file.
*/
......
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE 0005
#define BOOST_TEST_NO_MAIN
#include <boost/test/unit_test.hpp>
#include <AMDiS.h>
using namespace AMDiS;
using namespace std;
/*
- Test for interior boundaries of the subdomains on a 2-level
4x4 rank decomposition.
- Compaires the interior boundary object with a serialization file.
- Test for DOF communicators on the subdomains.
*/
void boundaryTest(RankToBoundMap &map0, RankToBoundMap &map1)
{
BOOST_CHECK_MESSAGE(map0.size() == map1.size(),
"Boundaries have different size!\n");
for (RankToBoundMap::iterator it = map0.begin(); it != map0.end(); ++it) {
if (map1.count(it->first) == 0) {
MSG("Boundary with rank %d missing!\n", it->first);
BOOST_ERROR("");
}
BOOST_CHECK_MESSAGE(it->second.size() == map1[it->first].size(),
"Wrong boundary size!\n");
for (unsigned int i = 0; i < it->second.size(); i++)
BOOST_CHECK_MESSAGE(it->second[i] == map1[it->first][i],
"Boundary is not equal!\n");
}
}
BOOST_AUTO_TEST_CASE(amdis_mpi_feti_multilevel)
{
BOOST_REQUIRE(MPI::COMM_WORLD.Get_size() == 16);
ProblemStat ellipt("ellipt");
ellipt.initialize(INIT_ALL);
MeshDistributor *meshDist = MeshDistributor::globalMeshDistributor;
meshDist->initParallelization();
const FiniteElemSpace *feSpace = ellipt.getFeSpace();
InteriorBoundary testBoundary;
string filename = "data/data0006/interior_boundary_p" +
lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + ".ser";
ifstream myfile(filename.c_str());
testBoundary.deserialize(myfile, ellipt.getMesh());
myfile.close();
boundaryTest(testBoundary.getOwn(), meshDist->getIntBoundarySd().getOwn());
boundaryTest(testBoundary.getOther(), meshDist->getIntBoundarySd().getOther());
boundaryTest(testBoundary.getPeriodic(), meshDist->getIntBoundarySd().getPeriodic());
Spreadsheet sheet;
sheet.read("data/data0006/dofcomm_level_1.dat");
vector<vector<double> > &data = sheet.getData();
DofComm &dofCommSd = meshDist->getDofCommSd();
DofComm::LevelDataType &sendDofsSd = dofCommSd.getSendDofs();
DofComm::LevelDataType &recvDofsSd = dofCommSd.getRecvDofs();
int nSendDofs = dofCommSd.getNumberDofs(sendDofsSd, 0, feSpace);
int nRecvDofs = dofCommSd.getNumberDofs(recvDofsSd, 0, feSpace);
int rank = MPI::COMM_WORLD.Get_rank();
BOOST_CHECK(data[rank][0] == rank);
BOOST_CHECK(data[rank][1] == nSendDofs);
BOOST_CHECK(data[rank][2] == nRecvDofs);
}
int main(int argc, char **argv)
{
AMDiS::init(argc, argv, "./init/test0006.dat.2d");
boost::unit_test::unit_test_main(&init_unit_test, argc, argv);
AMDiS::finalize();
}
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