1. petsc
  2. PETSc
  3. petsc

Commits

Jed Brown  committed eea2bde

Sys: destroy threadcomm after processing -options_table and -options_left

Creation of a PetscObject (like a viewer) implies threadcomm setup, so
we must ensure that the threadcomm is destroyed after the last
PetscObject.

  • Participants
  • Parent commits 8178e8b
  • Branches master

Comments (0)

Files changed (1)

File src/sys/objects/pinit.c

View file
   */
   ierr = PetscObjectRegisterDestroyAll();CHKERRQ(ierr);
 
-  {
-    PetscThreadComm tcomm_world;
-    ierr = PetscGetThreadCommWorld(&tcomm_world);CHKERRQ(ierr);
-    /* Free global thread communicator */
-    ierr = PetscThreadCommDestroy(&tcomm_world);CHKERRQ(ierr);
-  }
-
-#if defined(PETSC_USE_DEBUG)
   ierr = PetscStackDestroy();CHKERRQ(ierr);
-#endif
 
   flg1 = PETSC_FALSE;
   ierr = PetscOptionsGetBool(NULL,"-no_signal_handler",&flg1,NULL);CHKERRQ(ierr);
     }
   }
 
+  {
+    PetscThreadComm tcomm_world;
+    ierr = PetscGetThreadCommWorld(&tcomm_world);CHKERRQ(ierr);
+    /* Free global thread communicator */
+    ierr = PetscThreadCommDestroy(&tcomm_world);CHKERRQ(ierr);
+  }
+
   /*
        List all objects the user may have forgot to free
   */