mojaie / chorus

(archived) A simple chemical structure graph modeling, drawing and analysis toolkit
MIT License
5 stars 4 forks source link

Fullerenes can hang up MCS-DR #3

Closed mojaie closed 6 years ago

mojaie commented 6 years ago

Large and uniformly structured molecules such as fullerenes can hang up MCS-DR calculation. Set timeout to interrupt the infinite calculation task.

from chorus import mcsdr
from chorus.demo import MOL
from chorus import v2000reader as reader

mol = reader.mol_from_text(MOL["Buckminsterfullerene"])
arr = mcsdr.comparison_array(mol)
res = mcsdr.from_array(arr, arr, timeout=2)
print(res.local_sim())
print(res.exec_time())
mojaie commented 6 years ago

Now MCS-DR has a timeout option and its memory consumption was improved by the changes in ed95627888d185fcc783c4a690cc43a3c1cc9bda so such a fatal deadlock would not occur.