-
Notifications
You must be signed in to change notification settings - Fork 9
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
v1.07 no longer seems to work in multiple threads #39
Comments
@greglandrum, thanks for the issue. Which InChI version was used to run those tests before / that didn't fail the multithreading? Looking at https://github.com/rdkit/rdkit/blob/3d972a9e2f9ef097a36c4cf09334e898c69f16c1/External/INCHI-API/download-inchi.sh#L55 it seems that |
@JanCBrammer Yes, we use v1.05 now. |
Any chance you could try with v1.06? I.e., we could start by bisecting versions before bisecting the commits from v1.06 to v1.07. |
Sorry I mis-spoke: we are actually using v1.06, not v1.05 |
Nice, then we'll bisect the commits between v1.06 and v1.07 using https://github.com/rdkit/rdkit/blob/3d972a9e2f9ef097a36c4cf09334e898c69f16c1/External/INCHI-API/test.cpp#L65. Keeping you in the loop. |
@greglandrum, I could replicate the issue as follows.
or
When running the tests with v1.06 (
Therefore, we know that the last known "good" commit Following this rationale, using git bisect, I identified
@djb-rwth, could you verify this? |
@JanCBrammer thanks for tracking the commit down. |
Hi @greglandrum, @JanCBrammer's findings might be a good starting point in resolving this issue; however many parts of the code which belong to these past commits have been deleted and/or altered in the meantime. When I first read this post, I thought that Your assumption regarding the compromised thread safety related to use global variables makes sense, but I would still need to set an environment which can compile This is essential for rewriting some parts of the Implementing parallel programming into |
@djb-rwth, see https://www.rdkit.org/docs/Install.html regarding RDKit compilation. |
Actually, this version is a bit more compact and, I think, up to date: |
To clarify my perspective: The RDKit just needs to be able to call into the InChI code multiple times from different threads; this used to be possible. I don't need the InChI library to provide this and definitely have no interest in adding a dependency on Intel's TBB
My two cents: I don't see much value in having a parallel version of the InChI code itself. I think the highest value the InChI team can provide is improvements to the efficiency and robustness of the existing library |
Hi @greglandrum, Two notes:
|
Hi @djb-rwth First setup and activate a conda environment with the pre-requisites you need. I run these commands in a git bash shell:
Do the following in that same shell:
I just tried this on my laptop and it worked... hopefully it will also work for you. |
Thanks so much for this @greglandrum. I will try to do this ASAP. |
I believe that would be |
I was not able to make that work. |
You are right, I just realized the Visual Studio generator is a multi-config one so --target can't work there. |
I can reproduce the issue with test code that I have setup to make the Reaction InChI C API thread-safe. InChI 1.0.6.0 works, while 1.0.7.0 fails. In some cases the InChI library starts returning |
Hi @greglandrum,
Please let me know if I should add this as an entry in |
Hi @janholstjensen, |
Hi @djb-rwth I don't use ctest that way, so I'm not really sure what the answer is to that part. |
Hi @greglandrum, After replacing the source code in
Will get back to you shortly with more information. Please disregard all my queries from previous versions of this comment -- I have already found everything I need to resolve this issue. |
We now reproduce the multithreading failure on CI, i.e., CI fails due to the segfault(s) in the InChI library. See 746a927. |
|
Hi @greglandrum, |
Hi @greglandrum, |
@djb-rwth I just did an RDKit build using the Running the rest of my tests turns up a new problem with, I think, |
Hi @greglandrum, |
I just tried to get v1.07 working within the RDKit and immediately ran into the problem that our tests which attempt to use the InChI code from multiple threads simultaneously now fail.
The failure mode is that I start getting bad values (empty InChIs) or a seg fault at some point during execution. This does not happen if I run the same test with the number of threads set to 1, and it still happens even if I call the RDKit's "MolBlockToInChI" function, which is a thin wrapper around MakeINCHIFromMolfileText(), so this doesn't seem to be something in the way we're using the InChI library. But, then again, it's multi-threaded stuff, so who knows?
Is there something extra that now needs to be done from client code in order to safely use the code from mulitple threads or is this a regression in the InChI code itself?
In case you're curious, the specific test that's failing is this one:
https://github.com/rdkit/rdkit/blob/master/External/INCHI-API/test.cpp#L65
The text was updated successfully, but these errors were encountered: