mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Fix OpenMP fails
This commit is contained in:
parent
5d98438544
commit
7764b842a0
2 changed files with 11 additions and 2 deletions
|
|
@ -2349,6 +2349,11 @@ contains
|
|||
filename = trim(path_input) // "tallies.xml"
|
||||
inquire(FILE=filename, EXIST=file_exists)
|
||||
if (.not. file_exists) then
|
||||
! We need each thread to allocate tally_derivs to avoid segfaults
|
||||
!$omp parallel
|
||||
allocate(tally_derivs(0))
|
||||
!$omp end parallel
|
||||
|
||||
! Since a tallies.xml file is optional, no error is issued here
|
||||
return
|
||||
end if
|
||||
|
|
@ -2533,8 +2538,12 @@ contains
|
|||
! Get pointer list to XML <derivative>.
|
||||
call get_node_list(doc, "derivative", node_deriv_list)
|
||||
|
||||
! Allocate TallyDerivative array.
|
||||
! Allocate TallyDerivative array on each thread. The attributes of the
|
||||
! TallyDerivatives will be set on the master thread and then 'copyin'ed
|
||||
! in simulate.F90
|
||||
!$omp parallel
|
||||
allocate(tally_derivs(get_list_size(node_deriv_list)))
|
||||
!$omp end parallel
|
||||
|
||||
! Read derivative attributes.
|
||||
do i = 1, get_list_size(node_deriv_list)
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ contains
|
|||
call close_group(meshes_group)
|
||||
|
||||
! Write information for derivatives.
|
||||
if (allocated(tally_derivs) .and. size(tally_derivs) > 0) then
|
||||
if (size(tally_derivs) > 0) then
|
||||
derivs_group = create_group(tallies_group, "derivatives")
|
||||
do i = 1, size(tally_derivs)
|
||||
associate(deriv => tally_derivs(i))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue