mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Merge pull request #951 from paulromano/runtime-sched
Allow OMP_SCHEDULE to control schedule of main parallel do loop
This commit is contained in:
commit
b9286c0322
2 changed files with 12 additions and 1 deletions
|
|
@ -45,6 +45,9 @@ contains
|
|||
integer, intent(in), optional :: intracomm ! MPI intracommunicator
|
||||
|
||||
integer :: err
|
||||
#ifdef _OPENMP
|
||||
character(MAX_WORD_LEN) :: envvar
|
||||
#endif
|
||||
|
||||
! Copy the communicator to a new variable. This is done to avoid changing
|
||||
! the signature of this subroutine. If MPI is being used but no communicator
|
||||
|
|
@ -76,6 +79,14 @@ contains
|
|||
call initialize_mpi(comm)
|
||||
#endif
|
||||
|
||||
#ifdef _OPENMP
|
||||
! Change schedule of main parallel-do loop if OMP_SCHEDULE is set
|
||||
call get_environment_variable("OMP_SCHEDULE", envvar)
|
||||
if (len_trim(envvar) == 0) then
|
||||
call omp_set_schedule(omp_sched_static, 0)
|
||||
end if
|
||||
#endif
|
||||
|
||||
! Initialize HDF5 interface
|
||||
call hdf5_initialize()
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ contains
|
|||
|
||||
! ====================================================================
|
||||
! LOOP OVER PARTICLES
|
||||
!$omp parallel do schedule(static) firstprivate(p) copyin(tally_derivs)
|
||||
!$omp parallel do schedule(runtime) firstprivate(p) copyin(tally_derivs)
|
||||
PARTICLE_LOOP: do i_work = 1, work
|
||||
current_work = i_work
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue