Skip to content

Commit 8461d67

Browse files
committed
fix(api): try remove bug finalize with MPI
1 parent ecb0df5 commit 8461d67

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

apps/api/src/api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ namespace Api
150150
{
151151
_data = Core::CaseData(); // Explicity delete everything before
152152
udf_handle.reset();
153+
// Api::finalise();
153154
}
154155

155156
std::optional<std::unique_ptr<SimulationInstance>>
@@ -175,7 +176,6 @@ namespace Api
175176
{
176177
try
177178
{
178-
179179
if (logger)
180180
{
181181
logger->print(

apps/core/src/case_data.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,13 @@ namespace Core
178178
}
179179
}
180180

181+
if constexpr (AutoGenerated::FlagCompileTime::use_mpi)
182+
{
183+
#ifndef NO_MPI
184+
std::atexit(WrapMPI::finalize);
185+
#endif
186+
}
187+
181188
info.current_rank = static_cast<size_t>(rank);
182189
info.n_rank = static_cast<size_t>(size);
183190

0 commit comments

Comments
 (0)