Commit 9ce6621f authored by Spencer Sherwin's avatar Spencer Sherwin
Browse files

Updated check for existing file so that it only checks for rank=0 in --nprocs...

Updated check for existing file so that it only checks for rank=0 in --nprocs option instead of every file output
parent 3f1cecc5
......@@ -277,7 +277,7 @@ bool OutputFileBase::WriteFile(std::string &filename, po::variables_map &vm)
{
writeFile = 0; // set to zero for reduce all to be correct.
if (comm->TreatAsRankZero())
if (comm->GetRank() == 0)
{
string answer;
cout << "Did you wish to overwrite " << outFile << " (y/n)? ";
......@@ -292,6 +292,10 @@ bool OutputFileBase::WriteFile(std::string &filename, po::variables_map &vm)
<< " because it already exists" << endl;
}
}
else if (comm->TreatAsRankZero())
{
writeFile = 1;
}
comm->AllReduce(writeFile, LibUtilities::ReduceSum);
}
......
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