Skip to content

Commit

Permalink
Do sanity check, actually
Browse files Browse the repository at this point in the history
  • Loading branch information
lkotipal committed Apr 23, 2024
1 parent 1fc4e4f commit ffc00d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vlasiator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,10 @@ int main(int argn,char* args[]) {
if (myRank == MASTER_RANK) {
if(!restartSuccess) {
// If restart write fails, remove the malformed file and hope a human clears space soon
std::remove(restartFilename.c_str());
// Sanity check, this should be set before writeRestart returns
if (restartFilename != "restart") {
std::remove(restartFilename.c_str());
}
logFile << "(IO): ERROR Failed to write restart!" << endl << writeVerbose;
cerr << "FAILED TO WRITE RESTART" << endl;
} else {
Expand Down

0 comments on commit ffc00d2

Please sign in to comment.