Commit 87484a0a authored by Siqi Ling's avatar Siqi Ling
Browse files

Arh3 change parh to 2.0, reading parh directly load seq arh

parent 056ba66e
...@@ -132,9 +132,9 @@ namespace AMDiS { namespace io { ...@@ -132,9 +132,9 @@ namespace AMDiS { namespace io {
{ {
using boost::lexical_cast; using boost::lexical_cast;
int sPos = filename.find(".arh"); int sPos = filename.find(".arh");
TEST_EXIT(sPos >= 0)("Failed to find file postfix!\n"); TEST_EXIT(sPos >= 0)("Failed to find file postfix: \"arh \"!\n");
string name = filename.substr(0, sPos);
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS #ifdef HAVE_PARALLEL_DOMAIN_AMDIS
string name = filename.substr(0, sPos);
filename = name + "-p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + "-.arh"; filename = name + "-p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + "-.arh";
#endif #endif
} }
...@@ -164,9 +164,9 @@ namespace AMDiS { namespace io { ...@@ -164,9 +164,9 @@ namespace AMDiS { namespace io {
{ {
using boost::lexical_cast; using boost::lexical_cast;
int sPos = filename.find(".arh"); int sPos = filename.find(".arh");
TEST_EXIT(sPos >= 0)("Failed to find file postfix!\n"); TEST_EXIT(sPos >= 0)("Failed to find file postfix: \"arh \"!\n");
string name = filename.substr(0, sPos);
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS #ifdef HAVE_PARALLEL_DOMAIN_AMDIS
string name = filename.substr(0, sPos);
filename = name + "-p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + "-.arh"; filename = name + "-p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + "-.arh";
#endif #endif
} }
...@@ -193,10 +193,14 @@ namespace AMDiS { namespace io { ...@@ -193,10 +193,14 @@ namespace AMDiS { namespace io {
{ {
using boost::lexical_cast; using boost::lexical_cast;
int sPos = filename.find(".arh"); int sPos = filename.find(".arh");
TEST_EXIT(sPos >= 0)("Failed to find file postfix!\n"); TEST_EXIT(sPos >= 0)("Failed to find file postfix: \"arh \"!\n");
string name = filename.substr(0, sPos);
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS #ifdef HAVE_PARALLEL_DOMAIN_AMDIS
string filename_ = filename;
string name = filename.substr(0, sPos);
filename = name + "-p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + "-.arh"; filename = name + "-p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + "-.arh";
if(!boost::filesystem::exists(filename))
filename = name + "_p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + ".arh";
TEST_EXIT(boost::filesystem::exists(filename))("Arh data file not found in: %s\n", filename.c_str());
#endif #endif
} }
......
...@@ -124,18 +124,37 @@ namespace AMDiS { namespace io { ...@@ -124,18 +124,37 @@ namespace AMDiS { namespace io {
int readNumOfValueVectors(string filename, bool writeParallel) int readNumOfValueVectors(string filename, bool writeParallel)
{ {
FUNCNAME("Arh3Reader::readNumOfValueVectors"); FUNCNAME("Arh3Reader::readNumOfValueVectors()");
ifstream file; ifstream file;
if(writeParallel) if (writeParallel) {
{
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
using boost::lexical_cast; using boost::lexical_cast;
using boost::filesystem::path;
path file_name = filename;
path file_onlyname = file_name.filename();
path file_path = file_name.remove_filename();
int sPos = filename.find(".arh"); int sPos = filename.find(".arh");
TEST_EXIT(sPos >= 0)("Failed to find file postfix!\n"); string filenameWithoutExt = filename.substr(0, sPos);
string name = filename.substr(0, sPos); string parh = filenameWithoutExt + ".parh";
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
filename = name + "-p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + "-.arh"; sPos = file_onlyname.string().find(".arh");
string onlynameWithoutExt = file_onlyname.string().substr(0, sPos);
bool parhExists = boost::filesystem::exists(parh);
string basedir = parhExists ? detail::readParallelFile(parh) : ".";
filenameWithoutExt = file_path.string() + '/' + basedir + '/' + onlynameWithoutExt;
filename = filenameWithoutExt + "_p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + ".arh";
if(!boost::filesystem::exists(filename))
filename = filenameWithoutExt + "-p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + "-.arh";
TEST_EXIT(boost::filesystem::exists(filename))("Arh data file not found in: %s\n", filename.c_str());
#endif #endif
} }
...@@ -156,18 +175,37 @@ namespace AMDiS { namespace io { ...@@ -156,18 +175,37 @@ namespace AMDiS { namespace io {
int readHeaderSize(string filename, bool writeParallel) int readHeaderSize(string filename, bool writeParallel)
{ {
FUNCNAME("Arh3Reader::readHeaderSize"); FUNCNAME("Arh3Reader::readHeaderSize()");
ifstream file; ifstream file;
if (writeParallel) if (writeParallel) {
{
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
using boost::lexical_cast; using boost::lexical_cast;
using boost::filesystem::path;
path file_name = filename;
path file_onlyname = file_name.filename();
path file_path = file_name.remove_filename();
int sPos = filename.find(".arh"); int sPos = filename.find(".arh");
TEST_EXIT(sPos >= 0)("Failed to find file postfix!\n"); string filenameWithoutExt = filename.substr(0, sPos);
string name = filename.substr(0, sPos); string parh = filenameWithoutExt + ".parh";
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
filename = name + "-p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + "-.arh"; sPos = file_onlyname.string().find(".arh");
string onlynameWithoutExt = file_onlyname.string().substr(0, sPos);
bool parhExists = boost::filesystem::exists(parh);
string basedir = parhExists ? detail::readParallelFile(parh) : ".";
filenameWithoutExt = file_path.string() + '/' + basedir + '/' + onlynameWithoutExt;
filename = filenameWithoutExt + "_p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + ".arh";
if(!boost::filesystem::exists(filename))
filename = filenameWithoutExt + "-p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + "-.arh";
TEST_EXIT(boost::filesystem::exists(filename))("Arh data file not found in: %s\n", filename.c_str());
#endif #endif
} }
...@@ -185,18 +223,37 @@ namespace AMDiS { namespace io { ...@@ -185,18 +223,37 @@ namespace AMDiS { namespace io {
bool isReadable(string filename, bool writeParallel) bool isReadable(string filename, bool writeParallel)
{ {
FUNCNAME("Arh3Reader::isReadable"); FUNCNAME("Arh3Reader::isReadable()");
ifstream file; ifstream file;
if(writeParallel) if (writeParallel) {
{
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
using boost::lexical_cast; using boost::lexical_cast;
using boost::filesystem::path;
path file_name = filename;
path file_onlyname = file_name.filename();
path file_path = file_name.remove_filename();
int sPos = filename.find(".arh"); int sPos = filename.find(".arh");
TEST_EXIT(sPos >= 0)("Failed to find file postfix!\n"); string filenameWithoutExt = filename.substr(0, sPos);
string name = filename.substr(0, sPos); string parh = filenameWithoutExt + ".parh";
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
filename = name + "-p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + "-.arh"; sPos = file_onlyname.string().find(".arh");
string onlynameWithoutExt = file_onlyname.string().substr(0, sPos);
bool parhExists = boost::filesystem::exists(parh);
string basedir = parhExists ? detail::readParallelFile(parh) : ".";
filenameWithoutExt = file_path.string() + '/' + basedir + '/' + onlynameWithoutExt;
filename = filenameWithoutExt + "_p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + ".arh";
if(!boost::filesystem::exists(filename))
filename = filenameWithoutExt + "-p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + "-.arh";
TEST_EXIT(boost::filesystem::exists(filename))("Arh data file not found in: %s\n", filename.c_str());
#endif #endif
} }
......
...@@ -25,7 +25,7 @@ namespace AMDiS { namespace io { ...@@ -25,7 +25,7 @@ namespace AMDiS { namespace io {
{ {
const uint8_t MAJOR = 3; const uint8_t MAJOR = 3;
const uint8_t MINOR = 1; const uint8_t MINOR = 1;
const uint8_t PARH_MAJOR = 1; const uint8_t PARH_MAJOR = 2;
const uint8_t PARH_MINOR = 0; const uint8_t PARH_MINOR = 0;
const uint8_t TARH_MAJOR = 1; const uint8_t TARH_MAJOR = 1;
const uint8_t TARH_MINOR = 0; const uint8_t TARH_MINOR = 0;
......
...@@ -121,15 +121,15 @@ namespace AMDiS ...@@ -121,15 +121,15 @@ namespace AMDiS
writeElement); writeElement);
} }
std::string fn, fn_; std::string fn, fn2, fn_;
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS #ifdef HAVE_PARALLEL_DOMAIN_AMDIS
std::string paraFilename, postfix; std::string paraFilename, postfix;
super::getFilename(adaptInfo, fn, paraFilename, postfix); super::getFilename(adaptInfo, fn, fn2, paraFilename, postfix);
postfix += paraviewFileExt; postfix += paraviewFileExt;
fn_ = paraFilename; fn_ = paraFilename;
#else #else
super::getFilename(adaptInfo, fn); super::getFilename(adaptInfo, fn);
fn_ = fn; fn_ = fn2 = fn;
#endif #endif
...@@ -231,7 +231,7 @@ namespace AMDiS ...@@ -231,7 +231,7 @@ namespace AMDiS
createSubDir > 0); createSubDir > 0);
} }
#endif #endif
Arh3Writer::writeFile(solutionVecs, fn + ".arh", false); Arh3Writer::writeFile(solutionVecs, fn2 + ".arh", false);
} }
......
...@@ -222,10 +222,10 @@ namespace AMDiS ...@@ -222,10 +222,10 @@ namespace AMDiS
writeElement); writeElement);
} }
std::string fn; std::string fn, fn2;
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS #ifdef HAVE_PARALLEL_DOMAIN_AMDIS
std::string paraFilename, postfix; std::string paraFilename, postfix;
super::getFilename(adaptInfo, fn, paraFilename, postfix); super::getFilename(adaptInfo, fn, fn2, paraFilename, postfix);
postfix += paraviewFileExt; postfix += paraviewFileExt;
#else #else
super::getFilename(adaptInfo, fn); super::getFilename(adaptInfo, fn);
......
...@@ -63,7 +63,7 @@ namespace AMDiS { ...@@ -63,7 +63,7 @@ namespace AMDiS {
} }
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS #ifdef HAVE_PARALLEL_DOMAIN_AMDIS
void FileWriterInterface::getFilename(AdaptInfo* adaptInfo, std::string& fn, std::string& paraFilename, std::string& postfix) void FileWriterInterface::getFilename(AdaptInfo* adaptInfo, std::string& fn, std::string& fn2, std::string& paraFilename, std::string& postfix)
#else #else
void FileWriterInterface::getFilename(AdaptInfo* adaptInfo, std::string& fn) void FileWriterInterface::getFilename(AdaptInfo* adaptInfo, std::string& fn)
#endif #endif
...@@ -85,6 +85,7 @@ namespace AMDiS { ...@@ -85,6 +85,7 @@ namespace AMDiS {
#if HAVE_PARALLEL_DOMAIN_AMDIS #if HAVE_PARALLEL_DOMAIN_AMDIS
paraFilename = filename; paraFilename = filename;
fn2 = fn + "_p" + boost::lexical_cast<std::string>(MPI::COMM_WORLD.Get_rank());
fn += "-p" + boost::lexical_cast<std::string>(MPI::COMM_WORLD.Get_rank()) + "-"; fn += "-p" + boost::lexical_cast<std::string>(MPI::COMM_WORLD.Get_rank()) + "-";
postfix = ""; postfix = "";
#endif #endif
......
...@@ -99,7 +99,7 @@ namespace AMDiS { ...@@ -99,7 +99,7 @@ namespace AMDiS {
/// create a filename that includes the timestep and possibly a processor ID in parallel mode /// create a filename that includes the timestep and possibly a processor ID in parallel mode
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS #ifdef HAVE_PARALLEL_DOMAIN_AMDIS
void getFilename(AdaptInfo* adaptInfo, std::string& fn, std::string& paraFilename, std::string& postfix); void getFilename(AdaptInfo* adaptInfo, std::string& fn, std::string& fn2, std::string& paraFilename, std::string& postfix);
#else #else
void getFilename(AdaptInfo* adaptInfo, std::string& fn); void getFilename(AdaptInfo* adaptInfo, std::string& fn);
#endif #endif
......
...@@ -463,7 +463,7 @@ namespace AMDiS { namespace io { ...@@ -463,7 +463,7 @@ namespace AMDiS { namespace io {
if (writeParallel) { if (writeParallel) {
using boost::lexical_cast; using boost::lexical_cast;
int sPos = filename.find(".arh"); int sPos = filename.find(".arh");
TEST_EXIT(sPos >= 0)("Failed to find file postfix!\n"); TEST_EXIT(sPos >= 0)("Failed to find file postfix: \"arh \"!\n");
string name = filename.substr(0, sPos); string name = filename.substr(0, sPos);
if (nProcs == -1) { if (nProcs == -1) {
...@@ -639,7 +639,7 @@ namespace AMDiS { namespace io { ...@@ -639,7 +639,7 @@ namespace AMDiS { namespace io {
using boost::lexical_cast; using boost::lexical_cast;
int sPos = filename.find(".arh"); int sPos = filename.find(".arh");
TEST_EXIT(sPos >= 0)("Failed to find file postfix!\n"); TEST_EXIT(sPos >= 0)("Failed to find file postfix: \"arh \"!\n");
if (nProc >= 0) { if (nProc >= 0) {
string name = filename.substr(0, sPos); string name = filename.substr(0, sPos);
......
...@@ -333,7 +333,7 @@ namespace AMDiS { namespace io { ...@@ -333,7 +333,7 @@ namespace AMDiS { namespace io {
TEST_EXIT_DBG(headerLen_ <= headerLen) TEST_EXIT_DBG(headerLen_ <= headerLen)
("Header length (without macro file name) is already larger than the header specified in the file.\n"); ("Header length (without macro file name) is already larger than the header specified in the file.\n");
// Read macroFile_nl //TODO // TODO read macro from arh
if (headerLen_ < headerLen) { if (headerLen_ < headerLen) {
uint32_t macroFile_nl = 0; uint32_t macroFile_nl = 0;
file.read(reinterpret_cast<char*>(&macroFile_nl), 4); file.read(reinterpret_cast<char*>(&macroFile_nl), 4);
...@@ -575,51 +575,84 @@ namespace AMDiS { namespace io { ...@@ -575,51 +575,84 @@ namespace AMDiS { namespace io {
} }
if (writeParallel) { if (writeParallel) {
using boost::lexical_cast; using boost::lexical_cast;
using namespace boost::filesystem; using boost::filesystem::path;
path file_name = filename; path file_name = filename;
path file_onlyname = file_name.filename(); path file_onlyname = file_name.filename();
path file_path = file_name.remove_filename();
int sPos = filename.find(".arh"); int sPos = filename.find(".arh");
string filenameWithoutExt = filename.substr(0, sPos); string filenameWithoutExt = filename.substr(0, sPos);
string parh = filenameWithoutExt + ".parh";
sPos = file_onlyname.string().find(".arh"); sPos = file_onlyname.string().find(".arh");
string onlynameWithoutExt = file_onlyname.string().substr(0, sPos); string onlynameWithoutExt = file_onlyname.string().substr(0, sPos);
string parh = filenameWithoutExt + ".parh";
string basedir = "./";
path file_path = file_name.remove_filename();
int nProcs_ = 0, nMacros_ = 0, nMacros = 0; int nProcs_ = 0, nMacros_ = 0, nMacros = 0;
vector<int> partition; vector<int> partition;
bool parhExists = exists(parh);
if (parhExists) bool parhExists = boost::filesystem::exists(parh);
basedir = readParallelFile(parh, partition, nProcs_, nMacros_); bool newFilename = parhExists;
string basedir = parhExists ? readParallelFile(parh, partition, nProcs_, nMacros_) : ".";
filenameWithoutExt = file_path.string() + '/' + basedir + onlynameWithoutExt; filenameWithoutExt = file_path.string() + '/' + basedir + '/' + onlynameWithoutExt;
if (nProcs == -1) { if (nProcs == -1) {
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS #ifdef HAVE_PARALLEL_DOMAIN_AMDIS
string procFilename = filenameWithoutExt + "-p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + "-.arh"; string procFilename = filenameWithoutExt + "_p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + ".arh";
if (!boost::filesystem::exists(procFilename))
procFilename = filenameWithoutExt + "-p" + lexical_cast<string>(MPI::COMM_WORLD.Get_rank()) + "-.arh";
TEST_EXIT(boost::filesystem::exists(procFilename))("Arh data file not found in: %s\n", procFilename.c_str());
read(procFilename, mesh, vecs, byName); read(procFilename, mesh, vecs, byName);
MSG("ARH file read from: %s\n", procFilename.c_str());
#else #else
ERROR_EXIT("Reading parallel ARH files in sequential computations requires to specify the number of nodes on which the ARH file was created!\n"); ERROR_EXIT("Reading parallel ARH files in sequential computations requires to specify the number of nodes on which the ARH file was created!\n");
#endif #endif
} else { } else {
int nProc_f = 0;
if (!parhExists) { if (!parhExists) {
for (; nProcs_ < nProcs + 1; nProcs_++) { for (; nProc_f < nProcs + 1; nProc_f++) {
string fn = filenameWithoutExt + "-p" + boost::lexical_cast<string>(nProcs_) + "-.arh"; string fn = filenameWithoutExt + "-p" + boost::lexical_cast<string>(nProc_f) + "-.arh";
if(!boost::filesystem::exists(fn)) break; if(!boost::filesystem::exists(fn)) break;
} }
if (nProc_f != nProcs) {
newFilename = true;
for (nProc_f = 0; nProc_f < nProcs + 1; nProc_f++) {
string fn = filenameWithoutExt + "_p" + boost::lexical_cast<string>(nProc_f) + ".arh";
if(!boost::filesystem::exists(fn)) break;
}
}
} else {
for (nProc_f; nProc_f < nProcs + 1; nProc_f++) {
string fn = filenameWithoutExt + "_p" + boost::lexical_cast<string>(nProc_f) + ".arh";
if(!boost::filesystem::exists(fn)) break;
}
if (nProc_f != nProcs) {
newFilename = false;
for (nProc_f = 0; nProc_f < nProcs + 1; nProc_f++) {
string fn = filenameWithoutExt + "-p" + boost::lexical_cast<string>(nProc_f) + "-.arh";
if(!boost::filesystem::exists(fn)) break;
} }
TEST_EXIT(nProcs_ == nProcs) }
("Number of arh files doesn't match number of processors: %d vs %d\n", nProcs_, nProcs); }
TEST_EXIT(nProc_f == nProcs)
("Number of arh files doesn't match number of processors: %d vs %d\n", nProc_f, nProcs);
if (parhExists)
TEST_EXIT(nProc_f == nProcs_)
("Number of arh files doesn't match the label in parh file: %d vs %d", nProc_f, nProcs_);
if (!parhExists) { if (!parhExists) {
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS #ifdef HAVE_PARALLEL_DOMAIN_AMDIS
if (MPI::COMM_WORLD.Get_rank() == 0) if (MPI::COMM_WORLD.Get_rank() == 0)
#endif #endif
for(int i = 0; i < nProcs; i++) for(int i = 0; i < nProcs; i++)
nMacros_ += readNumOfMacrosFromSgArh(filename, i); nMacros_ += readNumOfMacrosFromSgArh(filename, i, newFilename);
} }
nMacros = mesh->getNumberOfMacros(); nMacros = mesh->getNumberOfMacros();
...@@ -634,10 +667,18 @@ namespace AMDiS { namespace io { ...@@ -634,10 +667,18 @@ namespace AMDiS { namespace io {
} }
if (!parhExists) { if (!parhExists) {
if (newFilename) {
for (int i = 0; i < nProcs; i++) {
string procFilename = filenameWithoutExt + "_p" + lexical_cast<string>(i) + ".arh";
read(procFilename, mesh, vecs, byName);
}
} else
{
for (int i = 0; i < nProcs; i++) { for (int i = 0; i < nProcs; i++) {
string procFilename = filenameWithoutExt + "-p" + lexical_cast<string>(i) + "-.arh"; string procFilename = filenameWithoutExt + "-p" + lexical_cast<string>(i) + "-.arh";
read(procFilename, mesh, vecs, byName); read(procFilename, mesh, vecs, byName);
} }
}
} else { } else {
std::set<int> needFiles; std::set<int> needFiles;
deque<MacroElement*>::iterator it = mesh->firstMacroElement(); deque<MacroElement*>::iterator it = mesh->firstMacroElement();
...@@ -645,12 +686,19 @@ namespace AMDiS { namespace io { ...@@ -645,12 +686,19 @@ namespace AMDiS { namespace io {
needFiles.insert(partition[(*it)->getIndex()]); needFiles.insert(partition[(*it)->getIndex()]);
std::set<int>::iterator it2 = needFiles.begin(); std::set<int>::iterator it2 = needFiles.begin();
if (newFilename) {
for (;it2 != needFiles.end(); it2++) {
string procFilename = filenameWithoutExt + "_p" + lexical_cast<string>(*it2) + ".arh";
read(procFilename, mesh, vecs, byName);
}
} else {
for (;it2 != needFiles.end(); it2++) { for (;it2 != needFiles.end(); it2++) {
string procFilename = filenameWithoutExt + "-p" + lexical_cast<string>(*it2) + "-.arh"; string procFilename = filenameWithoutExt + "-p" + lexical_cast<string>(*it2) + "-.arh";
read(procFilename, mesh, vecs, byName); read(procFilename, mesh, vecs, byName);
} }
} }
} }
}
} else { } else {
read(filename, mesh, vecs, byName); read(filename, mesh, vecs, byName);
} }
...@@ -818,16 +866,19 @@ namespace AMDiS { namespace io { ...@@ -818,16 +866,19 @@ namespace AMDiS { namespace io {
} // end readMetaFromSgArh } // end readMetaFromSgArh
int readNumOfMacrosFromSgArh(std::string filename, int nProc) int readNumOfMacrosFromSgArh(std::string filename, int nProc, bool newFilename)
{ {
FUNCNAME("Arh3Reader::readHeaderSize"); FUNCNAME("Arh3Reader::readHeaderSize");
using boost::lexical_cast; using boost::lexical_cast;
int sPos = filename.find(".arh"); int sPos = filename.find(".arh");
TEST_EXIT(sPos >= 0)("Failed to find file postfix!\n"); TEST_EXIT(sPos >= 0)("Failed to find file postfix: \"arh \"!\n");
if (nProc >= 0) { if (nProc >= 0) {
string name = filename.substr(0, sPos); string name = filename.substr(0, sPos);
if (newFilename)
filename = name + "_p" + lexical_cast<string>(nProc) + ".arh";
else
filename = name + "-p" + lexical_cast<string>(nProc) + "-.arh"; filename = name + "-p" + lexical_cast<string>(nProc) + "-.arh";
} }
...@@ -846,8 +897,62 @@ namespace AMDiS { namespace io { ...@@ -846,8 +897,62 @@ namespace AMDiS { namespace io {
return nMacroElements