Actual source code: init.c

  1: #define PETSC_DLL

  3: /*

  5:    This file defines part of the initialization of PETSc

  7:   This file uses regular malloc and free because it cannot know 
  8:   what malloc is being used until it has already processed the input.
  9: */

 11:  #include petscsys.h
 12: #if defined(PETSC_HAVE_STDLIB_H)
 13: #include <stdlib.h>
 14: #endif
 15: #if defined(PETSC_HAVE_MALLOC_H)
 16: #include <malloc.h>
 17: #endif
 18: /* ------------------------Nasty global variables -------------------------------*/
 19: /*
 20:      Indicates if PETSc started up MPI, or it was 
 21:    already started before PETSc was initialized.
 22: */
 23: PetscTruth   PetscBeganMPI         = PETSC_FALSE;
 24: PetscTruth   PetscInitializeCalled = PETSC_FALSE;
 25: PetscTruth   PetscFinalizeCalled   = PETSC_FALSE;
 26: PetscMPIInt  PetscGlobalRank = -1;
 27: PetscMPIInt  PetscGlobalSize = -1;

 29: #if defined(PETSC_USE_COMPLEX)
 30: #if defined(PETSC_COMPLEX_INSTANTIATE)
 31: template <> class std::complex<double>; /* instantiate complex template class */
 32: #endif
 33: #if !defined(PETSC_HAVE_MPI_C_DOUBLE_COMPLEX)
 34: MPI_Datatype   MPI_C_DOUBLE_COMPLEX;
 35: MPI_Datatype   MPI_C_COMPLEX;
 36: #endif
 37: PetscScalar    PETSC_i;
 38: #else
 39: PetscScalar    PETSC_i = 0.0;
 40: #endif
 41: MPI_Datatype   MPIU_2SCALAR = 0;
 42: MPI_Datatype   MPIU_2INT = 0;

 44: #if defined(PETSC_USE_SCALAR_QD_DD)
 45: MPI_Datatype   MPIU_QD_DD;
 46: #endif
 47: /*
 48:      These are needed by petscbt.h
 49: */
 50:  #include petscbt.h
 51: char      _BT_mask = ' ';
 52: char      _BT_c = ' ';
 53: PetscInt  _BT_idx  = 0;

 55: /*
 56:        Function that is called to display all error messages
 57: */
 58: PetscErrorCode  (*PetscErrorPrintf)(const char [],...)          = PetscErrorPrintfDefault;
 59: PetscErrorCode  (*PetscHelpPrintf)(MPI_Comm,const char [],...)  = PetscHelpPrintfDefault;
 60: PetscErrorCode  (*PetscVFPrintf)(FILE*,const char[],va_list)    = PetscVFPrintfDefault;

 62: /* ------------------------------------------------------------------------------*/
 63: /* 
 64:    Optional file where all PETSc output from various prints is saved
 65: */
 66: FILE *petsc_history = PETSC_NULL;

 70: PetscErrorCode  PetscLogOpenHistoryFile(const char filename[],FILE **fd)
 71: {
 73:   PetscMPIInt    rank,size;
 74:   char           pfile[PETSC_MAX_PATH_LEN],pname[PETSC_MAX_PATH_LEN],fname[PETSC_MAX_PATH_LEN],date[64];
 75:   char           version[256];

 78:   MPI_Comm_rank(PETSC_COMM_WORLD,&rank);
 79:   if (!rank) {
 80:     char arch[10];
 81:     int  err;

 83:     PetscGetArchType(arch,10);
 84:     PetscGetDate(date,64);
 85:     PetscGetVersion(version,256);
 86:     MPI_Comm_size(PETSC_COMM_WORLD,&size);
 87:     if (filename) {
 88:       PetscFixFilename(filename,fname);
 89:     } else {
 90:       PetscGetHomeDirectory(pfile,240);
 91:       PetscStrcat(pfile,"/.petschistory");
 92:       PetscFixFilename(pfile,fname);
 93:     }

 95:     *fd = fopen(fname,"a"); if (!fd) SETERRQ1(PETSC_ERR_FILE_OPEN,"Cannot open file: %s",fname);
 96:     PetscFPrintf(PETSC_COMM_SELF,*fd,"---------------------------------------------------------\n");
 97:     PetscFPrintf(PETSC_COMM_SELF,*fd,"%s %s\n",version,date);
 98:     PetscGetProgramName(pname,PETSC_MAX_PATH_LEN);
 99:     PetscFPrintf(PETSC_COMM_SELF,*fd,"%s on a %s, %d proc. with options:\n",pname,arch,size);
100:     PetscOptionsPrint(*fd);
101:     PetscFPrintf(PETSC_COMM_SELF,*fd,"---------------------------------------------------------\n");
102:     err = fflush(*fd);
103:     if (err) SETERRQ(PETSC_ERR_SYS,"fflush() failed on file");
104:   }
105:   return(0);
106: }

110: PetscErrorCode  PetscLogCloseHistoryFile(FILE **fd)
111: {
113:   PetscMPIInt    rank;
114:   char           date[64];
115:   int            err;

118:   MPI_Comm_rank(PETSC_COMM_WORLD,&rank);
119:   if (!rank) {
120:     PetscGetDate(date,64);
121:     PetscFPrintf(PETSC_COMM_SELF,*fd,"---------------------------------------------------------\n");
122:     PetscFPrintf(PETSC_COMM_SELF,*fd,"Finished at %s\n",date);
123:     PetscFPrintf(PETSC_COMM_SELF,*fd,"---------------------------------------------------------\n");
124:     err = fflush(*fd);
125:     if (err) SETERRQ(PETSC_ERR_SYS,"fflush() failed on file");
126:     err = fclose(*fd);
127:     if (err) SETERRQ(PETSC_ERR_SYS,"fclose() failed on file");
128:   }
129:   return(0);
130: }

132: /* ------------------------------------------------------------------------------*/

134: /* 
135:    This is ugly and probably belongs somewhere else, but I want to 
136:   be able to put a true MPI abort error handler with command line args.

138:     This is so MPI errors in the debugger will leave all the stack 
139:   frames. The default abort cleans up and exits.
140: */

144: void Petsc_MPI_AbortOnError(MPI_Comm *comm,PetscMPIInt *flag)
145: {
147:   (*PetscErrorPrintf)("MPI error %d\n",(int)*flag);
148:   abort();
149: }

153: void Petsc_MPI_DebuggerOnError(MPI_Comm *comm,PetscMPIInt *flag)
154: {

158:   (*PetscErrorPrintf)("MPI error %d\n",(int)*flag);
159:   PetscAttachDebugger();
160:   if (ierr) { /* hopeless so get out */
161:     MPI_Finalize();
162:     exit(*flag);
163:   }
164: }

168: /*@C 
169:    PetscEnd - Calls PetscFinalize() and then ends the program. This is useful if one 
170:      wishes a clean exit somewhere deep in the program.

172:    Collective on PETSC_COMM_WORLD

174:    Options Database Keys are the same as for PetscFinalize()

176:    Level: advanced

178:    Note:
179:    See PetscInitialize() for more general runtime options.

181: .seealso: PetscInitialize(), PetscOptionsPrint(), PetscMallocDump(), PetscMPIDump(), PetscFinalize()
182: @*/
183: PetscErrorCode  PetscEnd(void)
184: {
186:   PetscFinalize();
187:   exit(0);
188:   return 0;
189: }

191: PetscTruth   PetscOptionsPublish = PETSC_FALSE;
192: EXTERN PetscErrorCode        PetscSetUseTrMalloc_Private(void);
194: static char       emacsmachinename[256];

196: PetscErrorCode (*PetscExternalVersionFunction)(MPI_Comm) = 0;
197: PetscErrorCode (*PetscExternalHelpFunction)(MPI_Comm)    = 0;

201: /*@C 
202:    PetscSetHelpVersionFunctions - Sets functions that print help and version information
203:    before the PETSc help and version information is printed. Must call BEFORE PetscInitialize().
204:    This routine enables a "higher-level" package that uses PETSc to print its messages first.

206:    Input Parameter:
207: +  help - the help function (may be PETSC_NULL)
208: -  version - the version function (may be PETSC_NULL)

210:    Level: developer

212:    Concepts: package help message

214: @*/
215: PetscErrorCode  PetscSetHelpVersionFunctions(PetscErrorCode (*help)(MPI_Comm),PetscErrorCode (*version)(MPI_Comm))
216: {
218:   PetscExternalHelpFunction    = help;
219:   PetscExternalVersionFunction = version;
220:   return(0);
221: }

225: PetscErrorCode  PetscOptionsCheckInitial_Private(void)
226: {
227:   char           string[64],mname[PETSC_MAX_PATH_LEN],*f;
228:   MPI_Comm       comm = PETSC_COMM_WORLD;
229:   PetscTruth     flg1 = PETSC_FALSE,flg2 = PETSC_FALSE,flg3 = PETSC_FALSE,flag,flgz,flgzout;
231:   PetscReal      si;
232:   int            i;
233:   PetscMPIInt    rank;
234:   char           version[256];

237:   MPI_Comm_rank(PETSC_COMM_WORLD,&rank);

239:   /*
240:       Setup the memory management; support for tracing malloc() usage 
241:   */
242:   PetscOptionsGetTruth(PETSC_NULL,"-malloc_log",&flg3,PETSC_NULL);
243: #if defined(PETSC_USE_DEBUG)
244:   PetscOptionsGetTruth(PETSC_NULL,"-malloc",&flg1,&flg2);
245:   if ((!flg2 || flg1) && !petscsetmallocvisited) {
246:     PetscSetUseTrMalloc_Private();
247:   }
248: #else
249:   PetscOptionsGetTruth(PETSC_NULL,"-malloc_dump",&flg1,PETSC_NULL);
250:   PetscOptionsGetTruth(PETSC_NULL,"-malloc",&flg2,PETSC_NULL);
251:   if (flg1 || flg2 || flg3) {PetscSetUseTrMalloc_Private();}
252: #endif
253:   if (flg3) {
254:     PetscMallocSetDumpLog();
255:   }
256:   flg1 = PETSC_FALSE;
257:   PetscOptionsGetTruth(PETSC_NULL,"-malloc_debug",&flg1,PETSC_NULL);
258:   if (flg1) {
259:     PetscSetUseTrMalloc_Private();
260:     PetscMallocDebug(PETSC_TRUE);
261:   }

263:   flg1 = PETSC_FALSE;
264:   PetscOptionsGetTruth(PETSC_NULL,"-malloc_info",&flg1,PETSC_NULL);
265:   if (!flg1) {
266:     flg1 = PETSC_FALSE;
267:     PetscOptionsGetTruth(PETSC_NULL,"-memory_info",&flg1,PETSC_NULL);
268:   }
269:   if (flg1) {
270:     PetscMemorySetGetMaximumUsage();
271:   }

273:   /*
274:       Set the display variable for graphics
275:   */
276:   PetscSetDisplay();

278:   /*
279:       Print the PETSc version information
280:   */
281:   PetscOptionsHasName(PETSC_NULL,"-v",&flg1);
282:   PetscOptionsHasName(PETSC_NULL,"-version",&flg2);
283:   PetscOptionsHasName(PETSC_NULL,"-help",&flg3);
284:   if (flg1 || flg2 || flg3){

286:     /*
287:        Print "higher-level" package version message 
288:     */
289:     if (PetscExternalVersionFunction) {
290:       (*PetscExternalVersionFunction)(comm);
291:     }

293:     PetscGetVersion(version,256);
294:     (*PetscHelpPrintf)(comm,"--------------------------------------------\
295: ------------------------------\n");
296:     (*PetscHelpPrintf)(comm,"%s\n",version);
297:     (*PetscHelpPrintf)(comm,"%s",PETSC_AUTHOR_INFO);
298:     (*PetscHelpPrintf)(comm,"See docs/copyright.html for copyright information\n");
299:     (*PetscHelpPrintf)(comm,"See docs/changes/index.html for recent updates.\n");
300:     (*PetscHelpPrintf)(comm,"See docs/troubleshooting.html for problems.\n");
301:     (*PetscHelpPrintf)(comm,"See docs/manualpages/index.html for help. \n");
302:     (*PetscHelpPrintf)(comm,"Libraries linked from %s\n",PETSC_LIB_DIR);
303:     (*PetscHelpPrintf)(comm,"--------------------------------------------\
304: ------------------------------\n");
305:   }

307:   /*
308:        Print "higher-level" package help message 
309:   */
310:   if (flg3){
311:     if (PetscExternalHelpFunction) {
312:       (*PetscExternalHelpFunction)(comm);
313:     }
314:   }

316:   /*
317:       Setup the error handling
318:   */
319:   flg1 = PETSC_FALSE;
320:   PetscOptionsGetTruth(PETSC_NULL,"-fp_trap",&flg1,PETSC_NULL);
321:   if (flg1) { PetscSetFPTrap(PETSC_FP_TRAP_ON); }
322:   flg1 = PETSC_FALSE;
323:   PetscOptionsGetTruth(PETSC_NULL,"-on_error_abort",&flg1,PETSC_NULL);
324:   if (flg1) { PetscPushErrorHandler(PetscAbortErrorHandler,0);CHKERRQ(ierr)}
325:   flg1 = PETSC_FALSE;
326:   PetscOptionsGetTruth(PETSC_NULL,"-on_error_mpiabort",&flg1,PETSC_NULL);
327:   if (flg1) { PetscPushErrorHandler(PetscMPIAbortErrorHandler,0);CHKERRQ(ierr)}
328:   flg1 = PETSC_FALSE;
329:   PetscOptionsGetTruth(PETSC_NULL,"-mpi_return_on_error",&flg1,PETSC_NULL);
330:   if (flg1) {
331:     MPI_Errhandler_set(comm,MPI_ERRORS_RETURN);
332:   }
333:   flg1 = PETSC_FALSE;
334:   PetscOptionsGetTruth(PETSC_NULL,"-no_signal_handler",&flg1,PETSC_NULL);
335:   if (!flg1) { PetscPushSignalHandler(PetscDefaultSignalHandler,(void*)0);CHKERRQ(ierr) }

337:   /*
338:       Setup debugger information
339:   */
340:   PetscSetDefaultDebugger();
341:   PetscOptionsGetString(PETSC_NULL,"-on_error_attach_debugger",string,64,&flg1);
342:   if (flg1) {
343:     MPI_Errhandler err_handler;

345:     PetscSetDebuggerFromString(string);
346:     MPI_Errhandler_create((MPI_Handler_function*)Petsc_MPI_DebuggerOnError,&err_handler);
347:     MPI_Errhandler_set(comm,err_handler);
348:     PetscPushErrorHandler(PetscAttachDebuggerErrorHandler,0);
349:   }
350:   PetscOptionsGetString(PETSC_NULL,"-debug_terminal",string,64,&flg1);
351:   if (flg1) { PetscSetDebugTerminal(string); }
352:   PetscOptionsGetString(PETSC_NULL,"-start_in_debugger",string,64,&flg1);
353:   PetscOptionsGetString(PETSC_NULL,"-stop_for_debugger",string,64,&flg2);
354:   if (flg1 || flg2) {
355:     PetscMPIInt    size;
356:     PetscInt       lsize,*nodes;
357:     MPI_Errhandler err_handler;
358:     /*
359:        we have to make sure that all processors have opened 
360:        connections to all other processors, otherwise once the 
361:        debugger has stated it is likely to receive a SIGUSR1
362:        and kill the program. 
363:     */
364:     MPI_Comm_size(PETSC_COMM_WORLD,&size);
365:     if (size > 2) {
366:       PetscMPIInt dummy = 0;
367:       MPI_Status  status;
368:       for (i=0; i<size; i++) {
369:         if (rank != i) {
370:           MPI_Send(&dummy,1,MPI_INT,i,109,PETSC_COMM_WORLD);
371:         }
372:       }
373:       for (i=0; i<size; i++) {
374:         if (rank != i) {
375:           MPI_Recv(&dummy,1,MPI_INT,i,109,PETSC_COMM_WORLD,&status);
376:         }
377:       }
378:     }
379:     /* check if this processor node should be in debugger */
380:     PetscMalloc(size*sizeof(PetscInt),&nodes);
381:     lsize = size;
382:     PetscOptionsGetIntArray(PETSC_NULL,"-debugger_nodes",nodes,&lsize,&flag);
383:     if (flag) {
384:       for (i=0; i<lsize; i++) {
385:         if (nodes[i] == rank) { flag = PETSC_FALSE; break; }
386:       }
387:     }
388:     if (!flag) {
389:       PetscSetDebuggerFromString(string);
390:       PetscPushErrorHandler(PetscAbortErrorHandler,0);
391:       if (flg1) {
392:         PetscAttachDebugger();
393:       } else {
394:         PetscStopForDebugger();
395:       }
396:       MPI_Errhandler_create((MPI_Handler_function*)Petsc_MPI_AbortOnError,&err_handler);
397:       MPI_Errhandler_set(comm,err_handler);
398:     }
399:     PetscFree(nodes);
400:   }

402:   PetscOptionsGetString(PETSC_NULL,"-on_error_emacs",emacsmachinename,128,&flg1);
403:   if (flg1 && !rank) {PetscPushErrorHandler(PetscEmacsClientErrorHandler,emacsmachinename);CHKERRQ(ierr)}

405: #if defined(PETSC_USE_SOCKET_VIEWER)
406:   /*
407:     Activates new sockets for zope if needed
408:   */
409:   ierr=PetscOptionsHasName(PETSC_NULL,"-zope", &flgz);
410:   ierr=PetscOptionsHasName(PETSC_NULL,"-nostdout", &flgzout);
411:   if(flgz){
413:     int sockfd;
414:     char hostname[256];
415:     char username[256];
416:     int remoteport = 9999;
417:     ierr=PetscOptionsGetString(PETSC_NULL, "-zope", hostname, 256, &flgz);
418:     if(!hostname[0]){
419:       ierr=PetscGetHostName(hostname,256);}
420:     ierr=PetscOpenSocket(hostname, remoteport, &sockfd);
421:     PetscGetUserName(username, 256);
422:     PETSC_ZOPEFD = fdopen(sockfd, "w");
423:     if(flgzout){
424:       PETSC_STDOUT = PETSC_ZOPEFD;
425:       fprintf(PETSC_STDOUT, "<<<user>>> %s\n",username);
426:       fprintf(PETSC_STDOUT, "<<<start>>>");
427:     }
428:     else{
429:       fprintf(PETSC_ZOPEFD, "<<<user>>> %s\n",username);
430:       fprintf(PETSC_ZOPEFD, "<<<start>>>");
431:     }}
432: #endif

434:   /*
435:         Setup profiling and logging
436:   */
437: #if defined (PETSC_USE_INFO)
438:   flg1 = PETSC_FALSE;
439:   PetscOptionsGetTruth(PETSC_NULL,"-info",&flg1,PETSC_NULL);
440:   if (flg1) {
441:     char logname[PETSC_MAX_PATH_LEN]; logname[0] = 0;
442:     PetscOptionsGetString(PETSC_NULL,"-info",logname,250,&flg1);
443:     if (logname[0]) {
444:       PetscInfoAllow(PETSC_TRUE,logname);
445:     } else {
446:       PetscInfoAllow(PETSC_TRUE,PETSC_NULL);
447:     }
448:   }
449: #endif
450: #if defined(PETSC_USE_LOG)
451:   mname[0] = 0;
452:   PetscOptionsGetString(PETSC_NULL,"-log_history",mname,PETSC_MAX_PATH_LEN,&flg1);
453:   if (flg1) {
454:     if (mname[0]) {
455:       PetscLogOpenHistoryFile(mname,&petsc_history);
456:     } else {
457:       PetscLogOpenHistoryFile(0,&petsc_history);
458:     }
459:   }
460: #if defined(PETSC_HAVE_MPE)
461:   flg1 = PETSC_FALSE;
462:   PetscOptionsGetTruth(PETSC_NULL,"-log_mpe",&flg1,PETSC_NULL);
463:   if (flg1) PetscLogMPEBegin();
464: #endif
465:   flg1 = PETSC_FALSE;
466:   flg2 = PETSC_FALSE;
467:   flg3 = PETSC_FALSE;
468:   PetscOptionsGetTruth(PETSC_NULL,"-log_all",&flg1,PETSC_NULL);
469:   PetscOptionsGetTruth(PETSC_NULL,"-log",&flg2,PETSC_NULL);
470:   PetscOptionsHasName(PETSC_NULL,"-log_summary",&flg3);
471:   if (flg1)              {  PetscLogAllBegin(); }
472:   else if (flg2 || flg3) {  PetscLogBegin();}
473: 
474:   PetscOptionsGetString(PETSC_NULL,"-log_trace",mname,250,&flg1);
475:   if (flg1) {
476:     char name[PETSC_MAX_PATH_LEN],fname[PETSC_MAX_PATH_LEN];
477:     FILE *file;
478:     if (mname[0]) {
479:       sprintf(name,"%s.%d",mname,rank);
480:       PetscFixFilename(name,fname);
481:       file = fopen(fname,"w");
482:       if (!file) {
483:         SETERRQ1(PETSC_ERR_FILE_OPEN,"Unable to open trace file: %s",fname);
484:       }
485:     } else {
486:       file = PETSC_STDOUT;
487:     }
488:     PetscLogTraceBegin(file);
489:   }
490: #endif

492:   /*
493:       Setup building of stack frames for all function calls
494:   */
495: #if defined(PETSC_USE_DEBUG)
496:   PetscStackCreate();
497: #endif

499:   PetscOptionsGetTruth(PETSC_NULL,"-options_gui",&PetscOptionsPublish,PETSC_NULL);

501:   /*
502:        Print basic help message
503:   */
504:   PetscOptionsHasName(PETSC_NULL,"-help",&flg1);
505:   if (flg1) {
506:     (*PetscHelpPrintf)(comm,"Options for all PETSc programs:\n");
507:     (*PetscHelpPrintf)(comm," -help: prints help method for each option");
508:     (*PetscHelpPrintf)(comm," -on_error_abort: cause an abort when an error is");
509:     (*PetscHelpPrintf)(comm," detected. Useful \n       only when run in the debugger\n");
510:     (*PetscHelpPrintf)(comm," -on_error_attach_debugger [gdb,dbx,xxgdb,ups,noxterm]\n");
511:     (*PetscHelpPrintf)(comm,"       start the debugger in new xterm\n");
512:     (*PetscHelpPrintf)(comm,"       unless noxterm is given\n");
513:     (*PetscHelpPrintf)(comm," -start_in_debugger [gdb,dbx,xxgdb,ups,noxterm]\n");
514:     (*PetscHelpPrintf)(comm,"       start all processes in the debugger\n");
515:     (*PetscHelpPrintf)(comm," -on_error_emacs <machinename>\n");
516:     (*PetscHelpPrintf)(comm,"    emacs jumps to error file\n");
517:     (*PetscHelpPrintf)(comm," -debugger_nodes [n1,n2,..] Nodes to start in debugger\n");
518:     (*PetscHelpPrintf)(comm," -debugger_pause [m] : delay (in seconds) to attach debugger\n");
519:     (*PetscHelpPrintf)(comm," -stop_for_debugger : prints message on how to attach debugger manually\n");
520:     (*PetscHelpPrintf)(comm,"                      waits the delay for you to attach\n");
521:     (*PetscHelpPrintf)(comm," -display display: Location where graphics and debuggers are displayed\n");
522:     (*PetscHelpPrintf)(comm," -no_signal_handler: do not trap error signals\n");
523:     (*PetscHelpPrintf)(comm," -mpi_return_on_error: MPI returns error code, rather than abort on internal error\n");
524:     (*PetscHelpPrintf)(comm," -fp_trap: stop on floating point exceptions\n");
525:     (*PetscHelpPrintf)(comm,"           note on IBM RS6000 this slows run greatly\n");
526:     (*PetscHelpPrintf)(comm," -malloc_dump <optional filename>: dump list of unfreed memory at conclusion\n");
527:     (*PetscHelpPrintf)(comm," -malloc: use our error checking malloc\n");
528:     (*PetscHelpPrintf)(comm," -malloc no: don't use error checking malloc\n");
529:     (*PetscHelpPrintf)(comm," -malloc_info: prints total memory usage\n");
530:     (*PetscHelpPrintf)(comm," -malloc_log: keeps log of all memory allocations\n");
531:     (*PetscHelpPrintf)(comm," -malloc_debug: enables extended checking for memory corruption\n");
532:     (*PetscHelpPrintf)(comm," -options_table: dump list of options inputted\n");
533:     (*PetscHelpPrintf)(comm," -options_left: dump list of unused options\n");
534:     (*PetscHelpPrintf)(comm," -options_left no: don't dump list of unused options\n");
535:     (*PetscHelpPrintf)(comm," -tmp tmpdir: alternative /tmp directory\n");
536:     (*PetscHelpPrintf)(comm," -shared_tmp: tmp directory is shared by all processors\n");
537:     (*PetscHelpPrintf)(comm," -not_shared_tmp: each processor has separate tmp directory\n");
538:     (*PetscHelpPrintf)(comm," -memory_info: print memory usage at end of run\n");
539: #if defined(PETSC_USE_LOG)
540:     (*PetscHelpPrintf)(comm," -get_total_flops: total flops over all processors\n");
541:     (*PetscHelpPrintf)(comm," -log[_all _summary]: logging objects and events\n");
542:     (*PetscHelpPrintf)(comm," -log_trace [filename]: prints trace of all PETSc calls\n");
543: #if defined(PETSC_HAVE_MPE)
544:     (*PetscHelpPrintf)(comm," -log_mpe: Also create logfile viewable through upshot\n");
545: #endif
546:     (*PetscHelpPrintf)(comm," -info <optional filename>: print informative messages about the calculations\n");
547: #endif
548:     (*PetscHelpPrintf)(comm," -v: prints PETSc version number and release date\n");
549:     (*PetscHelpPrintf)(comm," -options_file <file>: reads options from file\n");
550:     (*PetscHelpPrintf)(comm," -petsc_sleep n: sleeps n seconds before running program\n");
551:     (*PetscHelpPrintf)(comm,"-----------------------------------------------\n");
552:   }

554:   PetscOptionsGetReal(PETSC_NULL,"-petsc_sleep",&si,&flg1);
555:   if (flg1) {
556:     PetscSleep(si);
557:   }

559:   PetscOptionsGetString(PETSC_NULL,"-info_exclude",mname,PETSC_MAX_PATH_LEN,&flg1);
560:   PetscStrstr(mname,"null",&f);
561:   if (f) {
562:     PetscInfoDeactivateClass(PETSC_NULL);
563:   }


566:   return(0);
567: }