[cig-commits] r4078 - in long/3D/Gale/trunk/src/Underworld: . libUnderworld/src

walter at geodynamics.org walter at geodynamics.org
Thu Jul 20 20:10:59 PDT 2006


Author: walter
Date: 2006-07-20 20:10:58 -0700 (Thu, 20 Jul 2006)
New Revision: 4078

Modified:
   long/3D/Gale/trunk/src/Underworld/
   long/3D/Gale/trunk/src/Underworld/libUnderworld/src/Init.c
Log:
 r374 at earth:  boo | 2006-07-20 20:05:19 -0700
  r359 at earth (orig r261):  AlanLo | 2006-07-17 17:28:18 -0700
  
  Underworld is compatibile with PETSC's -no_signal_handler flag to *not* insert signal handling.
  
  This means that if you have 'ulimit -c unlimited' on, Underworld apps can produce a core dump for gdb.
  (if you have u/w's or petsc's signal handler you can't get those files)
  
  
 



Property changes on: long/3D/Gale/trunk/src/Underworld
___________________________________________________________________
Name: svk:merge
   - 9570c393-cf10-0410-b476-9a651db1e55a:/cig:373
c24a034b-ab11-0410-afe6-cfe714e2959e:/trunk:260
   + 9570c393-cf10-0410-b476-9a651db1e55a:/cig:374
c24a034b-ab11-0410-afe6-cfe714e2959e:/trunk:261

Modified: long/3D/Gale/trunk/src/Underworld/libUnderworld/src/Init.c
===================================================================
--- long/3D/Gale/trunk/src/Underworld/libUnderworld/src/Init.c	2006-07-21 03:10:58 UTC (rev 4077)
+++ long/3D/Gale/trunk/src/Underworld/libUnderworld/src/Init.c	2006-07-21 03:10:58 UTC (rev 4078)
@@ -64,11 +64,24 @@
 Stream* Underworld_Error = NULL;
 
 Bool Underworld_Init( int* argc, char** argv[] ) {
+	char* argString;
+	int arg_I;
 	int tmp;
+	Bool useSignalHandler = True;
 
-	signal( SIGSEGV, Underworld_SignalHandler );
-	signal( SIGTERM, Underworld_SignalHandler );
+	for ( arg_I = 0; arg_I < *argc; arg_I++ ) {
+		argString = (*argv)[arg_I];
+		/* Leverage from PETSC's no signal flag */
+		if ( strcmp( argString, "-no_signal_handler" ) == 0 ) {
+			useSignalHandler = False;
+		}
+	}
 
+	if ( useSignalHandler ) {
+		signal( SIGSEGV, Underworld_SignalHandler );
+		signal( SIGTERM, Underworld_SignalHandler );
+	}
+
 	Underworld_Rheology_Init( argc, argv );
 	Underworld_Utils_Init( argc, argv );
 	



More information about the cig-commits mailing list