Skip to content

hasSubstuctMatch kernel crash with disconnected SMARTS #203

@vfscalfani

Description

@vfscalfani

Hi,

When trying the following minimal example:

smarts = "C.C"
smiles = ['CC', 'CCC', 'CCCC']

mols = [Chem.MolFromSmiles(smi) for smi in smiles]
pattern = Chem.MolFromSmarts(smarts)

config = SubstructSearchConfig(
    batchSize=1024,
    workerThreads=-1,
    preprocessingThreads=1,
    maxMatches=1,
    uniquify=False,
)

result_test = hasSubstructMatch(
    targets=mols,
    queries=[pattern],
    config=config,
)

print(f"GPU count: {result_test[:, 0].sum()}")

I get a helpful and expected output:

RuntimeError: Fragment queries (disconnected SMARTS patterns) are not supported. Query has 2 disconnected components: C.C

However, if I change the preprocessingThreads to >1 or -1, I get a kernel crash (using Jupyter Notebook), instead of the RunTimeError message.

Thanks,

Vin

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions