[cig-commits] [commit] rajesh-petsc, rajesh-petsc-schur: added some missing USE_PETSC guards (5faeb98)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Nov 5 19:03:12 PST 2014


Repository : https://github.com/geodynamics/citcoms

On branches: rajesh-petsc,rajesh-petsc-schur
Link       : https://github.com/geodynamics/citcoms/compare/464e1b32299b15819f93efd98d969cddb84dfe51...f97ae655a50bdbd6dac1923a3471ee4dae178fbd

>---------------------------------------------------------------

commit 5faeb9888ed9e765bc49a492f29df4127a4f6de7
Author: Rajesh Kommu <rajesh.kommu at gmail.com>
Date:   Thu Aug 21 13:43:18 2014 -0700

    added some missing USE_PETSC guards


>---------------------------------------------------------------

5faeb9888ed9e765bc49a492f29df4127a4f6de7
 lib/Parallel_util.c | 13 ++++++++++---
 lib/global_defs.h   |  2 ++
 lib/prototypes.h    |  2 +-
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/lib/Parallel_util.c b/lib/Parallel_util.c
index 182ad4b..c83bc99 100644
--- a/lib/Parallel_util.c
+++ b/lib/Parallel_util.c
@@ -34,9 +34,13 @@
 /* ============================================ */
 /* ============================================ */
 
-PetscErrorCode parallel_process_finalize()
+void parallel_process_finalize()
 {
-  return PetscFinalize();
+#ifdef USE_PETSC
+  PetscFinalize();
+#else
+  MPI_Finalize();
+#endif
 }
 
 /* ============================================ */
@@ -44,8 +48,11 @@ PetscErrorCode parallel_process_finalize()
 
 void parallel_process_termination()
 {
-
+#ifdef USE_PETSC
   PetscFinalize();
+#else
+  MPI_Finalize();
+#endif
   exit(8);
 }
 
diff --git a/lib/global_defs.h b/lib/global_defs.h
index 1b2abae..f2814f3 100644
--- a/lib/global_defs.h
+++ b/lib/global_defs.h
@@ -715,6 +715,7 @@ struct CITCOM_GNOMONIC {
 #endif
 #include "tracer_defs.h"
 
+#ifdef USE_PETSC
 /* PETSc MultiGrid Shell preconditioner */  
 struct MultiGrid_PC
 {
@@ -747,6 +748,7 @@ struct MatMultShell
   double *iData[NCS];
   double *oData[NCS];
 };
+#endif /* USE_PETSC */
 
 struct All_variables {
 
diff --git a/lib/prototypes.h b/lib/prototypes.h
index a2006ea..6ad3948 100644
--- a/lib/prototypes.h
+++ b/lib/prototypes.h
@@ -360,7 +360,7 @@ void remove_trace_3x3(double [3][3]);
 void get_9vec_from_3x3(double *, double [3][3]);
 void get_3x3_from_9vec(double [3][3], double *);
 /* Parallel_util.c */
-PetscErrorCode parallel_process_finalize(void);
+void parallel_process_finalize(void);
 void parallel_process_termination(void);
 void parallel_process_sync(struct All_variables *);
 double CPU_time0(void);



More information about the CIG-COMMITS mailing list