From 2c0342a7d69ed9ed6467b4fbb16300852eaa4ed9 Mon Sep 17 00:00:00 2001
From: John Helly <j.c.helly@durham.ac.uk>
Date: Tue, 26 Mar 2019 09:14:16 +0000
Subject: [PATCH] Added missing MPI_Finalize in main_fof.c

---
 examples/main_fof.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/examples/main_fof.c b/examples/main_fof.c
index cee267df9e..e1e2d73e14 100644
--- a/examples/main_fof.c
+++ b/examples/main_fof.c
@@ -1077,6 +1077,11 @@ int main(int argc, char *argv[]) {
   engine_print_stats(&e);
   engine_dump_snapshot(&e);
 
+#ifdef WITH_MPI
+  if ((res = MPI_Finalize()) != MPI_SUCCESS)
+    error("call to MPI_Finalize failed with error %i.", res);
+#endif
+
   /* Clean everything */
   if (with_verbose_timers) timers_close_file();
   if (with_cosmology) cosmology_clean(&cosmo);
-- 
GitLab