From 6c250768acfcc5c5fdd039aa0762709113c86e2c Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sat, 22 Nov 2003 01:59:02 +0000
Subject: [PATCH] main() should return zero after a successful run

---
 Box/Main.cpp                        |   8 +-
 Fltk/GUI.cpp                        |   6 +-
 Fltk/GUI.h                          |   2 +-
 Fltk/Main.cpp                       |   8 +-
 Parallel/ParUtil.cpp                |   4 +-
 benchmarks/misc/levelset/solver.par | 140 ++++++++++++++++++++++++++++
 6 files changed, 154 insertions(+), 14 deletions(-)
 create mode 100644 benchmarks/misc/levelset/solver.par

diff --git a/Box/Main.cpp b/Box/Main.cpp
index eddadc9c61..32360e971b 100644
--- a/Box/Main.cpp
+++ b/Box/Main.cpp
@@ -1,4 +1,4 @@
-// $Id: Main.cpp,v 1.31 2003-11-21 07:56:28 geuzaine Exp $
+// $Id: Main.cpp,v 1.32 2003-11-22 01:59:02 geuzaine Exp $
 //
 // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
 //
@@ -128,9 +128,10 @@ int main(int argc, char *argv[])
       if(List_Nbr(CTX.post.list))
         BGMWithView((Post_View *)
                     List_Pointer(CTX.post.list, List_Nbr(CTX.post.list) - 1));
-      else
+      else{
         fprintf(stderr, ERROR_STR "Invalid background mesh (no view)\n");
-      exit(1);
+	exit(1);
+      }
     }
     if(CTX.batch > 0) {
       mai3d(THEM, CTX.batch);
@@ -244,7 +245,6 @@ void Msg(int level, char *fmt, ...)
 
   if(abort)
     exit(1);
-
 }
 
 // CPU time computation
diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp
index ba168a4597..88fccfd452 100644
--- a/Fltk/GUI.cpp
+++ b/Fltk/GUI.cpp
@@ -1,4 +1,4 @@
-// $Id: GUI.cpp,v 1.252 2003-11-21 07:56:29 geuzaine Exp $
+// $Id: GUI.cpp,v 1.253 2003-11-22 01:59:02 geuzaine Exp $
 //
 // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
 //
@@ -737,9 +737,9 @@ GUI::GUI(int argc, char **argv)
 
 // Run the GUI until no window is left
 
-void GUI::run()
+int GUI::run()
 {
-  Fl::run();
+  return Fl::run();
 }
 
 // Check (now) if any pending events and run them
diff --git a/Fltk/GUI.h b/Fltk/GUI.h
index acec7100a8..0e3486c18a 100644
--- a/Fltk/GUI.h
+++ b/Fltk/GUI.h
@@ -254,7 +254,7 @@ public:
   void create_solver_window(int num);
 
   // general purpose interaction
-  void run();
+  int run();
   void check();
   void wait();
   void make_opengl_current();
diff --git a/Fltk/Main.cpp b/Fltk/Main.cpp
index 9f0af72ca5..2c097bd72e 100644
--- a/Fltk/Main.cpp
+++ b/Fltk/Main.cpp
@@ -1,4 +1,4 @@
-// $Id: Main.cpp,v 1.50 2003-11-21 07:56:29 geuzaine Exp $
+// $Id: Main.cpp,v 1.51 2003-11-22 01:59:02 geuzaine Exp $
 //
 // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
 //
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
   
   if(argc == 2 && !strcmp(argv[1], "-doc")){
     Print_OptionsDoc();
-    exit(1);
+    exit(0);
   }
 
   // Configuration files and command line options
@@ -152,7 +152,7 @@ int main(int argc, char *argv[])
         Mesh_Quality(THEM);
         Print_Histogram(THEM->Histogram[0]);
       }
-      exit(1);
+      exit(0);
     }
   }
 
@@ -250,5 +250,5 @@ int main(int argc, char *argv[])
   CTX.expose = 1;
 
   // loop
-  WID->run();
+  return WID->run();
 }
diff --git a/Parallel/ParUtil.cpp b/Parallel/ParUtil.cpp
index 700b04cfa1..1a1f7f7e27 100644
--- a/Parallel/ParUtil.cpp
+++ b/Parallel/ParUtil.cpp
@@ -1,4 +1,4 @@
-// $Id: ParUtil.cpp,v 1.7 2003-03-21 00:52:42 geuzaine Exp $
+// $Id: ParUtil.cpp,v 1.8 2003-11-22 01:59:02 geuzaine Exp $
 //
 // Copyright (C) 1997-2003 C. Geuzaine, J.-F. Remacle
 //
@@ -105,7 +105,7 @@ void ParUtil::Exit()
 #ifdef PARALLEL
   MPI_Finalize();
 #else
-  exit(1);
+  exit(0);
 #endif
 }
 
diff --git a/benchmarks/misc/levelset/solver.par b/benchmarks/misc/levelset/solver.par
new file mode 100644
index 0000000000..0c560e0ad1
--- /dev/null
+++ b/benchmarks/misc/levelset/solver.par
@@ -0,0 +1,140 @@
+/*
+
+Matrix_Format (Integer): 
+    - 1  Sparse 
+    - 2  Full 
+    - default : 1
+
+Matrix_Printing (Integer): Disk write ('fort.*') 
+    - 1  matrix (csr) 
+    - 2  preconditioner (msr) 
+    - 3  both 
+    - default : 0
+
+Matrix_Storage (Integer): Disk Write or Read in internal format 
+    - 0  none 
+    - 1  write matrix (sparse) 
+    - 2  read matrix (sparse) 
+    - default : 0
+
+Scaling (Integer): Scale system 
+    - 0  no 
+    - 1  on basis of diagonal elements  (no loss of possible symmetry) 
+    - 2  on basis of inf. norm  of first rows and then columns  (asymmetric) 
+    - 3  on basis of norm 1     of first rows and then columns  (asymmetric) 
+    - 4  on basis of norm 2     of first rows and then columns  (asymmetric) 
+    - default : 0
+
+Renumbering_Technique (Integer): 
+    - 0  No renumbering 
+    - 1  Reverse Cuthill-Mc Kee 
+    - default : 1 
+
+Preconditioner (Integer): 
+    - 0  NONE     No Factorization
+    - 1  ILUT     Incomplete LU factorization with dual truncation strategy 
+    - 2  ILUTP    ILUT with column  pivoting                                
+    - 3  ILUD     ILU with single dropping + diagonal compensation (~MILUT) 
+    - 4  ILUDP    ILUD with column pivoting                                 
+    - 5  ILUK     level-k ILU                                               
+    - 6  ILU0     simple ILU(0) preconditioning                             
+    - 7  MILU0    MILU(0) preconditioning                                   
+    - 8  DIAGONAL                                                           
+    - default : 2 
+
+Preconditioner_Position (Integer): 
+    - 0  No Preconditioner 
+    - 1  Left Preconditioner 
+    - 2  Right Preconditioner 
+    - 3  Both Left and Right Preconditioner 
+    - default : 2 
+
+Nb_Fill (Integer): 
+    - ILUT/ILUTP : maximum number of elements per line 
+      of L and U (except diagonal element) 
+    - ILUK : each element whose fill-in level is greater than NB_FILL 
+      is dropped. 
+    - default : 20
+
+Permutation_Tolerance (Real): Tolerance for column permutation in ILUTP/ILUDP. 
+    At stage i, columns i and j are permuted if 
+    abs(a(i,j))*PERMUTATION_TOLERANCE > abs(a(i,i)). 
+    - 0  no permutations 
+    - 0.001 -> 0.1  classical 
+    - default : 0.05
+
+Dropping_Tolerance (Real): 
+    - ILUT/ILUTP/ILUK: a(i,j) is dropped if 
+      abs(a(i,j)) < DROPPING_TOLERANCE * abs(diagonal element in U). 
+    - ILUD/ILUDP : a(i,j) is dropped if 
+      abs(a(i,j)) < DROPPING_TOLERANCE * [weighted norm of line i]. 
+      Weighted norm = 1-norm / number of nonzero elements on the line. 
+    - default : 0
+
+Diagonal_Compensation (Real): ILUD/ILUDP: the term 'DIAGONAL_COMPENSATION * (sum 
+    of all dropped elements of the line)' is added to the diagonal element in U 
+    - 0  ~ ILU with threshold 
+      1  ~ MILU with threshold. 
+    - default : 0
+
+Re_Use_ILU (Integer): Reuse ILU decomposition (and renumbering if any)
+    - 0  no 
+    - 1  yes 
+    - default : 0
+
+Algorithm (Integer): 
+    - 1  CG       Conjugate Gradient                    
+    - 2  CGNR     CG (Normal Residual equation)         
+    - 3  BCG      Bi-Conjugate Gradient                 
+    - 4  DBCG     BCG with partial pivoting             
+    - 5  BCGSTAB  BCG stabilized                        
+    - 6  TFQMR    Transpose-Free Quasi-Minimum Residual 
+    - 7  FOM      Full Orthogonalization Method         
+    - 8  GMRES    Generalized Minimum RESidual          
+    - 9  FGMRES   Flexible version of GMRES             
+    - 10 DQGMRES  Direct versions of GMRES              
+    - 11 LU       LU Factorization                      
+    - 12 PGMRES   Alternative version of GMRES          
+    - default : 8
+
+Krylov_Size (Integer): Krylov subspace size 
+    - default : 40
+
+IC_Acceleration (Real): IC accelerator
+    - default : 1 
+
+Re_Use_LU (Integer): Reuse LU decomposition
+    - 0  no 
+    - 1  yes 
+    - default : 0
+
+Iterative_Improvement (Integer): Iterative improvement of the solution obtained by a LU 
+    - default : 0
+
+Nb_Iter_Max (Integer): Maximum number of iterations 
+    - default : 1000 
+
+Stopping_Test (Real): Target relative residual 
+    - default : 1e-10 
+
+*/
+
+            Matrix_Format            1
+          Matrix_Printing            0
+           Matrix_Storage            0
+                  Scaling            0
+    Renumbering_Technique            1
+           Preconditioner            2
+  Preconditioner_Position            2
+                  Nb_Fill           20
+    Permutation_Tolerance         0.05
+       Dropping_Tolerance            0
+    Diagonal_Compensation            0
+               Re_Use_ILU            0
+                Algorithm            8
+              Krylov_Size           40
+          IC_Acceleration            1
+                Re_Use_LU            0
+    Iterative_Improvement            0
+              Nb_Iter_Max         1000
+            Stopping_Test        1e-10
-- 
GitLab