Skip to content

Commit

Permalink
Conforms OMP Jacobian output to serial
Browse files Browse the repository at this point in the history
  • Loading branch information
holm10 committed Jan 14, 2025
1 parent 24866e3 commit 901d07f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
1 change: 0 additions & 1 deletion bbb/oderhs.m
Original file line number Diff line number Diff line change
Expand Up @@ -12322,7 +12322,6 @@ integer ia(neq+1) # pointers to beginning of each row in jac,ja

Use(ParallelEval) # ParallelJac

write(*,*) "jc_interf, ParallelJac = ", ParallelJac
c!omp if (ParallelJac.eq.1) then
c!omp call jac_calc_parallel (neq, t, yl, yldot00, ml, mu, wk,
c!omp. nnzmx, jac, ja, ia)
Expand Down
17 changes: 13 additions & 4 deletions ppp/omp_parallel.F90
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ subroutine InitOMPJac()
nnzmxperchunk=ceiling(real(nnzmx)/real(NchunksJac))*omplenpfac !nnzmx=neq*lenfac
endif

write(*,*) OMPJacStamp,' Nthreads:', Nthreads, 'NchunksJac:',NchunksJac, 'nnzmxperchunk:',nnzmxperchunk,'neq:',neq
if (OMPJacVerbose.gt.0) &
write(*,"(a,a,i4,a,i6,a,i5,a,i6)") TRIM(OMPJacStamp),' Nthreads:', Nthreads, ' NchunksJac:', &
NchunksJac, ' nnzmxperchunk:',nnzmxperchunk,' neq:',neq
call gchange('OMPJac',0)
! if (OMPParallelPandf1.gt.0) then
! OMPPandf1FlagVerbose=1
Expand Down Expand Up @@ -168,6 +170,7 @@ subroutine jac_calc_omp (neq, t, yl, yldot00, ml, mu, wk,nnzmx, jac, ja, ia)
use OMPJacSettings,only:OMPJacVerbose,OMPCheckNaN,&
OMPLoadBalance,OMPAutoBalance,OMPJacStamp,OMPBalanceStrength
use ParallelDebug,only: WriteJacobian,OMPJacDebug
use Flags, only: iprint

use OMPJac,only:iJacCol,rJacElem,iJacRow,OMPivmin,OMPivmax,nnz,nnzcum,OMPLoadWeight,OMPTimeLocalJac
use UEpar, only: svrpkg
Expand Down Expand Up @@ -239,8 +242,10 @@ subroutine jac_calc_omp (neq, t, yl, yldot00, ml, mu, wk,nnzmx, jac, ja, ia)
! Count Jacobian evaluations, both for total and for this case
ijactot = ijactot + 1
ijac(ig) = ijac(ig) + 1
if (svrpkg.eq.'nksol') write(*,*) ' Updating Jacobian, npe = ',ijac(ig)

! if (svrpkg.eq.'nksol') write(*,*) ' Updating Jacobian, npe = ',ijac(ig)
if ((svrpkg.eq.'nksol') .and. (iprint .ne. 0)) &
write(*,'(a,i4,a,i6,a,i9)') ' Updating OMP Jacobian [',Nthreads,'|',NchunksJac, &
']: npe = ', ijac(ig)
! Set up diagnostic arrays for debugging
do iv = 1, neq
yldot_unpt(iv) = yldot00(iv) ! for diagnostic only
Expand Down Expand Up @@ -312,7 +317,11 @@ subroutine jac_calc_omp (neq, t, yl, yldot00, ml, mu, wk,nnzmx, jac, ja, ia)

if (istimingon .eq. 1) ttjstor = ttjstor + gettime(sec4) - tsjstor

write(*,'(a,1pe9.2,a,I4,aI6,a)') 'Time in omp jac_calc:',tock(OMPTimeJacCalc),' [',Nthreads,'|',NchunksJac,']'
! write(*,'(a,i4,a,i6,a,1pe9.2,a)') ' [Nthreads | NchunkcsJac | OMP time] = [', &
! Nthreads,'|',NchunksJac, '|', tock(OMPTimeJacCalc), ']'
if ((OMPJacVerbose.gt.0) .and. (iprint .ne. 0)) &
write(*,'(a,1pe9.2,a)') ' OMP Jac timing:', tock(OMPTimeJacCalc), 's'

return
end subroutine jac_calc_omp
!-------------------------------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion ppp/parallel.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ subroutine InitParallel
ParallelJac=0
endif
else
write(*,'(a)') '*OMPJac* Jacobian calculation: OMP not enabled'
ParallelJac=0

endif
Expand Down

0 comments on commit 901d07f

Please sign in to comment.