Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential crash for the OpenMP multi-thread running #1667

Closed
lcheng9 opened this issue Jun 15, 2022 · 2 comments
Closed

Potential crash for the OpenMP multi-thread running #1667

lcheng9 opened this issue Jun 15, 2022 · 2 comments
Labels

Comments

@lcheng9
Copy link
Contributor

lcheng9 commented Jun 15, 2022

A crash may occur when the number of threads is larger than the number of points in OpenMP mode. For example, a boundary condition marker has a few edge elements, and the model runs on a 10-core CPU (20 threads).

One of the crash places is at
InverseDiagonalBlock_ILUMatrix(end-1, &invM[(end-1)*nVar*nVar]);
The value end-1 could be a random value due to the skipped value assignment in vector omp_partitions.

It seems that the logic for setting and using omp_partitions needs to be revised. The reproducing script is provided.

Win11 + VS2022
SU2 7.3.1

omp_crash_su2.cfg.txt
mesh.su2.txt

@lcheng9 lcheng9 added the bug label Jun 15, 2022
@lcheng9
Copy link
Contributor Author

lcheng9 commented Jun 15, 2022

My local fix is to initialize all elements in vector omp_partitions with value nPointDomain. Then 'continue' the for loop if omp_partitions[thread] == omp_partitions[thread+1] at several places.

@pcarruscag
Copy link
Member

Sounds like a sensible fix. Please open a PR.
We should also warn or throw an error if that condition happens because the performance is not going to be good with very few nodes per thread.

lcheng9 pushed a commit to lcheng9/SU2 that referenced this issue Jun 21, 2022
Initialize the omp_partitions vector with the number of points, skip the for loop if the last partition has been calculated. A light-weight checker is added to verify the validation of the partition vector.
pcarruscag added a commit that referenced this issue Jul 22, 2022
Fix #1667 Potential crash for the OpenMP multi-thread running.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants