Commit a559d671 authored by Backofen, Rainer's avatar Backofen, Rainer
Browse files

Added Test_Exit for readMetaFromArh, fixed some (self included) conflicts for...

Added Test_Exit for readMetaFromArh, fixed some (self included) conflicts for serial/parallel AMDiS (sorry)
parent 0ee43cb7
......@@ -843,8 +843,8 @@ namespace AMDiS {
tmp -= coords[*(dofs1[i])];
TEST_EXIT(norm(tmp) < 1e-13)
("DOFs %d and %d (i = %d) have different coords!\n",
*(dofs0[i]), *(dofs1[i]), i);
("DOFs %d and %d (i = %d) have different coords!\n",
*(dofs0[i]), *(dofs1[i]), i);
}
}
......@@ -863,9 +863,16 @@ namespace AMDiS {
for (unsigned int i = 0; i < dofs0.size(); i++) {
WorldVector<double> tmp = coords[*(dofs0[i])];
tmp -= coords[*(dofs1[i])];
TEST(norm(tmp) < 1e-13)("DOFs 0: %e : %e : %e \n DOFs 1: %e : %e : %e \n norm: %e \n",
coords[*(dofs0[i])][0], coords[*(dofs0[i])][1],
coords[*(dofs0[i])][2],
coords[*(dofs1[i])][0], coords[*(dofs1[i])][1],
coords[*(dofs1[i])][2], norm(tmp));
TEST_EXIT(norm(tmp) < 1e-13)
("DOFs %d and %d (i = %d) have different coords!\n",
("DOFs %d and %d (i = %d) have different coords!\n",
*(dofs0[i]), *(dofs1[i]), i);
}
......
......@@ -355,11 +355,25 @@ namespace AMDiS { namespace io {
std::map<int, int> &elInRank,
std::map<int, int> &elCodeSize){
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
int nProcs = MPI::COMM_WORLD.Get_size();
#else
int nProcs = -1;
#endif
std::vector<std::set<std::pair<int, int> > > data(nProcs);
// data format: (rank ; (elIndex; elCodeSize) )
// check for consistency
// That is, if there are no more or less files as nProcs
int i=0;
for (; i < nProcs+1; i++) {
string fn = filename + "-p" + boost::lexical_cast<string>(i) + "-.arh";
if(!boost::filesystem::exists(fn)) break;
}
TEST_EXIT(i == nProcs)
("Number of arh files doesn't match number of processors \n");
//collect data
for (int i = 0; i < nProcs; i++) {
string fn = filename + "-p" + boost::lexical_cast<string>(i) + "-.arh";
......@@ -369,7 +383,6 @@ namespace AMDiS { namespace io {
cout << "Cannot open file \"" << fn << "\"\n";
exit(0);
}
cout << MPI::COMM_WORLD.Get_rank() <<" Read file \"" << fn << "\"\n";
string typeId(4, ' ');
file.read(const_cast<char*>(typeId.data()), 4);
......@@ -503,7 +516,6 @@ namespace AMDiS { namespace io {
}
}
cout << MPI::COMM_WORLD.Get_rank() <<" Read ko " <<"\n";
}
......
......@@ -46,7 +46,7 @@ namespace AMDiS { namespace Parallel {
map<int, int> arhElCodeSize;
string partitioningFile = "";
cout <<"DDDD "<<initFileStr<<"\n";
Parameters::get(initFileStr + "->initial partitioning file",
partitioningFile);
if (partitioningFile != "") {
......
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