From 2edba113fba3347251a5daefbab720c149cab0c6 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sun, 4 Oct 2009 20:18:48 +0000
Subject: [PATCH] petscfinalize + client progress

---
 Common/GmshMessage.cpp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/Common/GmshMessage.cpp b/Common/GmshMessage.cpp
index 19ab3ea7e4..147cb99ae7 100644
--- a/Common/GmshMessage.cpp
+++ b/Common/GmshMessage.cpp
@@ -99,7 +99,7 @@ void Msg::Exit(int level)
 #endif
     exit(level);
   }
-  
+
 #if defined(HAVE_FLTK)
   // if we exit cleanly (level==0) and we are in full GUI mode, save
   // the persistent info to disk
@@ -113,6 +113,9 @@ void Msg::Exit(int level)
   }
 #endif
 
+#if defined(HAVE_PETSC)
+  PetscFinalize();
+#endif
 #if defined(HAVE_MPI)
   MPI_Finalize();
 #endif
@@ -373,12 +376,15 @@ void Msg::ProgressMeter(int n, int N, const char *fmt, ...)
     sprintf(str2, "(%d %%)", _progressMeterCurrent);
     strcat(str, str2);
 
+    if(_client) _client->Progress(str);
+
 #if defined(HAVE_FLTK)
     if(FlGui::available()){
       if(_verbosity > 3) FlGui::instance()->setStatus(str, 1);
       FlGui::instance()->check();
     }
 #endif
+
     if(CTX::instance()->terminal){
       fprintf(stdout, "%s                     \r", str);
       fflush(stdout);
@@ -389,11 +395,14 @@ void Msg::ProgressMeter(int n, int N, const char *fmt, ...)
   }
 
   if(n > N - 1){
+    if(_client) _client->Progress("Done!");
+
 #if defined(HAVE_FLTK)
     if(FlGui::available()){
       if(_verbosity > 3) FlGui::instance()->setStatus("", 1);
     }
 #endif
+
     if(CTX::instance()->terminal){
       fprintf(stdout, "Done!                                              \r");
       fflush(stdout);
-- 
GitLab