Commit 76590ab6 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Fixed some very small problems.

parent 8e238e78
......@@ -30,15 +30,28 @@ namespace AMDiS {
// === Check for reading ARH meta file to create initial partitioning. ===
map<int, int> arhElInRank;
map<int, int> mapElInRank;
map<int, int> arhElCodeSize;
string arhMetaFile = "";
Parameters::get("parallel->partitioner->read meta arh", arhMetaFile);
bool partitioningArhBased = (arhMetaFile != "");
if (partitioningArhBased) {
int nProc = ArhReader::readMetaData(arhMetaFile, arhElInRank, arhElCodeSize);
if (nProc != mpiSize)
partitioningArhBased = false;
string partitioningFile = "";
Parameters::get("parallel->initial partitioning file", partitioningFile);
if (partitioningFile != "") {
ifstream file;
file.open(partitioningFile.c_str());
int nElements = 0;
file >> nElements;
for (int i = 0; i < nElements; i++)
file >> mapElInRank[i];
file.close();
} else {
string arhMetaFile = "";
Parameters::get("parallel->partitioner->read meta arh", arhMetaFile);
bool partitioningArhBased = (arhMetaFile != "");
if (partitioningArhBased) {
int nProc = ArhReader::readMetaData(arhMetaFile, mapElInRank, arhElCodeSize);
if (nProc != mpiSize)
partitioningArhBased = false;
}
}
......@@ -70,11 +83,11 @@ namespace AMDiS {
// In standard mode assign to each macro element an arbitrary but unique
// rank number.
int elInRank = 0;
if (!partitioningArhBased)
int elInRank = 0;
if (mapElInRank.empty())
elInRank = std::min(elIndex / elPerRank, mpiSize - 1);
else
elInRank = arhElInRank[elIndex];
elInRank = mapElInRank[elIndex];
elementInRank[elIndex] = (elInRank == mpiRank);
partitionMap[elIndex] = elInRank;
......
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