Commit bf567029 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

One more MPI test.

parent 37e0d38c
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE 0004
#define BOOST_TEST_NO_MAIN
#include <boost/test/unit_test.hpp>
#include <AMDiS.h>
using namespace AMDiS;
using namespace std;
/*
-
*/
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();
vector<const FiniteElemSpace*> feSpaces;
feSpaces.push_back(feSpace);
Mesh* mesh = ellipt.getMesh();
mesh->dofCompress();
BOOST_REQUIRE(mesh->getNumberOfLeaves() == 4);
BOOST_REQUIRE(meshDist->getMeshLevelData().getLevelNumber() == 2);
BOOST_REQUIRE(feSpace->getAdmin()->getUsedSize() == 5);
MeshLevelData &levelData = meshDist->getMeshLevelData();
DofComm::LevelDataType &sendDofs = meshDist->getDofComm().getSendDofs();
DofComm::LevelDataType &recvDofs = meshDist->getDofComm().getRecvDofs();
ParallelDofMapping dofMap;
dofMap.init(levelData, feSpaces, feSpaces, true, true);
dofMap.setDofComm(meshDist->getDofComm());
dofMap.clear();
Spreadsheet sheet;
sheet.read("data/data0004a");
vector<vector<double> > &data = sheet.getData();
for (unsigned int i = 0; i < data.size(); i++) {
if (data[i][0] != MPI::COMM_WORLD.Get_rank())
continue;
int level = data[i][1];
int nSendDofs = data[i][2];
int nRecvDofs = data[i][3];
int compareSendDofs =
meshDist->getDofComm().getNumberDofs(sendDofs, level, feSpace);
int compareRecvDofs =
meshDist->getDofComm().getNumberDofs(recvDofs, level, feSpace);
TEST_EXIT(nSendDofs == compareSendDofs)
("Wrong number of SEND DOFs in level %d: %d %d\n",
level, nSendDofs, compareSendDofs);
TEST_EXIT(nRecvDofs == compareRecvDofs)
("Wrong number of RECV DOFs in level %d: %d %d\n",
level, nRecvDofs, compareRecvDofs);
}
}
int main(int argc, char **argv)
{
AMDiS::init(argc, argv, "./init/test0004.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