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

slower result when using omp #140

Open
zzycarrot opened this issue Apr 19, 2024 · 7 comments
Open

slower result when using omp #140

zzycarrot opened this issue Apr 19, 2024 · 7 comments

Comments

@zzycarrot
Copy link

when writting the Triangle() function ,i get a much slower result when i used omp parallel,(2 times slower infact),
fd653ba9ace43bf3f707a4f73c0e103

@zzycarrot
Copy link
Author

is it because the variable "image" was locked when it was been written that other threads can't use it ,which resulted in a slower speed than serial computing?

@ssloy
Copy link
Owner

ssloy commented Apr 19, 2024

Is the behavior same with a simple #pragma omp parallel for ?
(i mean without collapse/scheduling)

@zzycarrot
Copy link
Author

Is the behavior same with a simple #pragma omp parallel for ? (i mean without collapse/scheduling)

yes it is, i've tried a simple #pragma omp parallel for but with the same result

@ssloy
Copy link
Owner

ssloy commented Apr 19, 2024

I am curious. Can you try the code from master branch in my repository with and without this #pragma ?

#pragma omp parallel for

@zzycarrot
Copy link
Author

I am curious. Can you try the code from master branch in my repository with and without this #pragma ?

#pragma omp parallel for

i've tried yours now and it's performing as it should be (faster with omp) , maybe i've written my code wrongly ,

@ssloy
Copy link
Owner

ssloy commented Apr 19, 2024

i see nothing wrong with your code, if you find the problem please share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@ssloy @zzycarrot and others