Skip to content

Commit 7b5a9b1

Browse files
authored
Merge pull request #17 from qiskit-community/revise1
Call MPI_Abort on unhandled exception
2 parents 4611fbb + d68ba88 commit 7b5a9b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,11 @@ int main(int argc, char *argv[])
454454
return 0;
455455
} catch (const std::exception &e) {
456456
std::cerr << "Unhandled exception in main: " << e.what() << std::endl;
457-
MPI_Finalize();
457+
MPI_Abort(MPI_COMM_WORLD, 1);
458458
return 1;
459459
} catch (...) {
460460
std::cerr << "Unknown exception in main" << std::endl;
461-
MPI_Finalize();
461+
MPI_Abort(MPI_COMM_WORLD, 1);
462462
return 1;
463463
}
464464
}

0 commit comments

Comments
 (0)