Skip to content

Commit

Permalink
Fix SEGFAULT on missing mesh (#196)
Browse files Browse the repository at this point in the history
* Fix SEGFAULT on missing mesh

* Add changelog
  • Loading branch information
fsimonis authored Aug 8, 2024
1 parent fe77af0 commit d38af71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog-entries/196.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixed SEGFAULT in `precice-aste-run` if no mesh is found for the given name.
5 changes: 5 additions & 0 deletions src/modes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ void aste::runMapperMode(const aste::ExecutionContext &context, const OptionMap
}

auto asteInterface = asteConfiguration.asteInterfaces.front();
if (asteInterface.meshes.empty()) {
ASTE_ERROR << "ERROR: Could not find meshes for name: " << meshname;
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);
}

ASTE_INFO << "Loading mesh from " << asteInterface.meshes.front().filename();
const bool requireConnectivity = preciceInterface.requiresMeshConnectivityFor(asteInterface.meshName);
const int dim = preciceInterface.getMeshDimensions(asteInterface.meshName);
Expand Down

0 comments on commit d38af71

Please sign in to comment.