Skip to content

Commit 0d96a91

Browse files
Don't use PetscFunctionReturn in ExaGOFinalize (#190)
1 parent 65db1bf commit 0d96a91

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ extern "C" PetscErrorCode ExaGOInitialize(MPI_Comm, int *argc, char ***argv,
217217
* @note this takes care of Petsc finalization, so don't this function in
218218
* conjunction with `PetscFinalize`.
219219
*/
220-
extern "C" PetscErrorCode ExaGOFinalize();
220+
extern "C" void ExaGOFinalize();
221221

222222
/** Returns 1 if files exists, else 0 */
223223
bool DoesFileExist(const char *);

src/utils/utils.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ static MPI_Comm ExaGOLogComm = MPI_COMM_SELF;
174174
PetscErrorCode ExaGOLogIsUsingLogFile(bool *flg) {
175175
#ifdef EXAGO_ENABLE_LOGGING
176176
*flg = ExaGOLogUseFile;
177+
#else
178+
*flg = false;
177179
#endif
178180
return 0;
179181
}
@@ -581,8 +583,7 @@ PetscErrorCode ExaGOInitialize(MPI_Comm comm, int *argc, char ***argv,
581583
return 0;
582584
}
583585

584-
PetscErrorCode ExaGOFinalize() {
585-
PetscFunctionBegin;
586+
void ExaGOFinalize() {
586587
ExaGOLog(EXAGO_LOG_INFO, "Finalizing {} application.", ExaGOCurrentAppName);
587588
MPI_Comm comm = MPI_COMM_WORLD;
588589
int my_rank;
@@ -602,7 +603,6 @@ PetscErrorCode ExaGOFinalize() {
602603
if (!initialized) {
603604
MPI_Finalize();
604605
}
605-
PetscFunctionReturn(0);
606606
}
607607

608608
#undef EXAGO_LOG_ENSURE_INITIALIZED

0 commit comments

Comments
 (0)