Skip to content

Conversation

andrew-platt
Copy link
Collaborator

@andrew-platt andrew-platt commented Oct 2, 2025

Needs some review and testing.

Feature or improvement description
TurbSim has been single-threaded forever. This PR adds parallelization through OpenMP and should in theory run faster as a result.

If OpenMP is enabled at compile time, parallelization for MKL will be automatically turned off. We saw this the MKL parallelization is an issue in #3018 when the MKL would try to parallelize some tiny matrix manipulation incurring massive overhead costs.

Still need to extend to the following routines:

  • CalcFourierCoeffs_API
  • CalcFourierCoeffs_General
  • CalcFourierCoeffs_None

Related issue, if one exists
#3018

Impacted areas of the software
TurbSim only

Additional supporting information

  • A PRIVATE(<allocatable_array>) in a !$OMP PARALLEL DO pragma doesn't always allocate the copy of that array. This leads to segfaults. I have messy workarounds for this. There may be a better way to do it, but I have no idea if the ROCM Flang compiler will be able to handle anything more advanced.

Test results, if applicable
No test results should change.

The TRH_in in the SHARED was causing memory issues.  Removing that makes things identical now.
No need for the inner loop.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant