1. petsc
  2. PETSc
  3. petsc

Commits

BarryFSmith  committed 706d7a8

-history crashed because it uses PetscObjects before they had been initialized to print options to history file
also history caused printing to stdout of whitespace that should have gone to history

  • Participants
  • Parent commits cf22a14
  • Branches master

Comments (0)

Files changed (2)

File src/sys/classes/viewer/impls/ascii/filev.c

View file
  • Ignore whitespace
       va_start(Argp,format);
       tab = ascii->tab;
       while (tab--) {
-        ierr = PetscFPrintf(PETSC_COMM_SELF,fd,"  ");CHKERRQ(ierr);
+        ierr = PetscFPrintf(PETSC_COMM_SELF,petsc_history,"  ");CHKERRQ(ierr);
       }
       ierr = (*PetscVFPrintf)(petsc_history,format,Argp);CHKERRQ(ierr);
       err  = fflush(petsc_history);

File src/sys/objects/init.c

View file
  • Ignore whitespace
   if (!rank) {
     char        arch[10];
     int         err;
-    PetscViewer viewer;
 
     ierr = PetscGetArchType(arch,10);CHKERRQ(ierr);
     ierr = PetscGetDate(date,64);CHKERRQ(ierr);
     ierr = PetscFPrintf(PETSC_COMM_SELF,*fd,"%s %s\n",version,date);CHKERRQ(ierr);
     ierr = PetscGetProgramName(pname,PETSC_MAX_PATH_LEN);CHKERRQ(ierr);
     ierr = PetscFPrintf(PETSC_COMM_SELF,*fd,"%s on a %s, %d proc. with options:\n",pname,arch,size);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIOpenWithFILE(PETSC_COMM_WORLD,*fd,&viewer);CHKERRQ(ierr);
-    ierr = PetscOptionsView(viewer);CHKERRQ(ierr);
-    ierr = PetscViewerDestroy(&viewer);CHKERRQ(ierr);
     ierr = PetscFPrintf(PETSC_COMM_SELF,*fd,"---------------------------------------------------------\n");CHKERRQ(ierr);
 
     err = fflush(*fd);
     if (mname[0]) {
       ierr = PetscOpenHistoryFile(mname,&petsc_history);CHKERRQ(ierr);
     } else {
-      ierr = PetscOpenHistoryFile(0,&petsc_history);CHKERRQ(ierr);
+      ierr = PetscOpenHistoryFile(NULL,&petsc_history);CHKERRQ(ierr);
     }
   }
 #if defined(PETSC_HAVE_MPE)