OpenMP-Validation-and-Verification / OpenMP_VV

OpenMP Offloading Validation & Verification Suite; Official repository. We have migrated from bitbucket!! For documentation, results, publication and presentations, please check out our website ->
https://crpl.cis.udel.edu/ompvvsollve/
Other
54 stars 19 forks source link

Fixing a possible Deadlock when run parallel on SPMD mod #801

Closed fel-cab closed 6 months ago

fel-cab commented 6 months ago

Instead of an else as in the original tests, a separated if was included for the while loop, Given that the code in the Device can be executed on SPMD, it is possible that the else can be executed first by all threads generating a deadlock on the while.

Furthermore, it also necessary to create an else, with a shared variable to prevent the optimizer to marge the if and to have the same problem than before.

Therefore a separated if is generated for the code and this way it is possible to guarantee that there is no deadlock on the while.