PetscFinalize should be the last call before exiting

This commit is contained in:
Pratheek Shanthraj 2015-03-26 13:43:18 +00:00
parent a9cf8e8051
commit 86283359f1
4 changed files with 3 additions and 4 deletions

View File

@ -360,7 +360,7 @@ program DAMASK_spectral_Driver
close(resUnit) ! end of header
endif
endif
allocate(outputSize(worldsize), source = 0_pInt); outputSize(worldrank+1) = sizeof(materialpoint_results)
allocate(outputSize(worldsize), source = 0_pInt); outputSize(worldrank+1) = size(materialpoint_results)*8
call MPI_Allreduce(MPI_IN_PLACE,outputSize,worldsize,MPI_INT,MPI_SUM,PETSC_COMM_WORLD,ierr)
call MPI_File_open(PETSC_COMM_WORLD, &
trim(getSolverWorkingDirectoryName())//trim(getSolverJobName())//'.spectralOut', &
@ -590,6 +590,8 @@ program DAMASK_spectral_Driver
call Polarisation_destroy()
end select
call PetscFinalize(ierr); CHKERRQ(ierr)
if (notConvergedCounter > 0_pInt) call quit(3_pInt) ! error if some are not converged
call quit(0_pInt) ! no complains ;)

View File

@ -727,7 +727,6 @@ subroutine AL_destroy()
call VecDestroy(solution_vec,ierr); CHKERRQ(ierr)
call SNESDestroy(snes,ierr); CHKERRQ(ierr)
call DMDestroy(da,ierr); CHKERRQ(ierr)
call PetscFinalize(ierr); CHKERRQ(ierr)
call Utilities_destroy()
end subroutine AL_destroy

View File

@ -578,7 +578,6 @@ subroutine BasicPETSc_destroy()
call VecDestroy(solution_vec,ierr); CHKERRQ(ierr)
call SNESDestroy(snes,ierr); CHKERRQ(ierr)
call DMDestroy(da,ierr); CHKERRQ(ierr)
call PetscFinalize(ierr); CHKERRQ(ierr)
call Utilities_destroy()
end subroutine BasicPETSc_destroy

View File

@ -727,7 +727,6 @@ subroutine Polarisation_destroy()
call VecDestroy(solution_vec,ierr); CHKERRQ(ierr)
call SNESDestroy(snes,ierr); CHKERRQ(ierr)
call DMDestroy(da,ierr); CHKERRQ(ierr)
call PetscFinalize(ierr); CHKERRQ(ierr)
call Utilities_destroy()
end subroutine Polarisation_destroy