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

Crash when running multiple instances of BFF on a multi-threaded environment #48

Open
calvariomind opened this issue Sep 4, 2019 · 4 comments

Comments

@calvariomind
Copy link

Hi there,
What a great piece of software!
I've been using other flattening algorithms on my applications and this one really makes a big difference in speed, stability and quality on the result flattening.

Unfortunately, it doesn't apear to support a multithreaded environment. I'm trying to flatten multiple meshes concurrently on multiple threads, and I always get a crash during the flattening. The crash doesn't happen if I run the flattenings sequentially.
Looking at the call stack, it appears that the crash is somewhere inside a choldmod library function.

Does anyone run into this problem and knows hot to solve it?
Is there any known limitation regarding BFF and multithreading?

Thanks in advance,
José Calvário

@rohan-sawhney
Copy link
Collaborator

rohan-sawhney commented Sep 4, 2019

Thanks @calvariomind! Unfortunately, the current version is not thread safe because of how it is linked with Cholmod. However, it is possible to make the Cholmod dependency thread safe. I've listed this issue as an enhancement :)

@calvariomind
Copy link
Author

Thanks for the quick reply rohan :)
If I understand correctly, the limitation is on cholmod library, not on BFF. Can I do something on my side to resolve the problem without changing BFF code? Maybe linking with a different version of cholmod?
Thanks

@rohan-sawhney
Copy link
Collaborator

rohan-sawhney commented Sep 4, 2019

I should correct myself - some of the BFF linear algebra code will have to be modified, starting with not declaring a global cholmod Common object but rather cholmod Common objects local to each thread. I'll have to put some more thought on how exactly to architect this within the BFF codebase. If you don't want to dig into cholmod, another option might be to replace the implementation of the BFF linear algebra wrappers (such as DenseMatrix, SparseMatrix, Cholesky) with another library such as Eigen.

@calvariomind
Copy link
Author

Thanks again for your answers. I will continue using BFF as is, without multi-threading. It is fast enough for my current purposes. I will be watching for new versions, and reactivate the multi-threading in case you decide to make those changes.
Congratulations for a great library :)

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

No branches or pull requests

2 participants