more OpenMP WORKSHARE sections in GRHydro Reconstruct

Issue #319 closed
Roland Haas created an issue

the attached patch compiles and should at least do no harm.

It adds some new OMP WORKSHARE sections around array operations and adds PARALLEL to some existing ones.

Keyword:

Comments (4)

  1. Erik Schnetter
    • removed comment

    For best OpenMP performance, there should probably be as few parallel regions as possible. In general, a single parallel region per routine would be best (unless the routine has a complex structure).

    Some of your patch reads as if the current code had workshare constructs outside of a parallel region. This would be senseless and looks like a bug to me.

    I think that if statements inside a workshare construct are fine (I'm not completely sure about this). In this case, code such as

    if (shift_state .ne. 0) then 120 !$OMP WORKSHARE 115 121 lbetax = betax 116 122 lbetay = betay 117 123 lbetaz = betaz 124 !$OMP END WORKSHARE NOWAIT 118 125 else 126 !$OMP WORKSHARE 119 127 lbetax = 0.d0 120 128 lbetay = 0.d0 121 129 lbetaz = 0.d0 130 !$OMP END WORKSHARE NOWAIT 122 131 end if

    could be simplified to have only a single, enclosing workshare construct.

  2. Log in to comment