You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has been implemented using concurrent.futures
run_ss method now contains the map call. SuperstarResult class has been changed so that the temp working dir is the same for all superstar runs avoiding confusion on where the superstar results are held.
def _run_ss(self, centroid=None):
"""
initiates a SuperStar run for a given protein and probe
:param prot: a :class:`ccdc.protein.Protein` instance
:param out_dir: str, output directory
:param centroid: tup, coordinates of cavity origin
:param charged_probes: bool, if True 'positive' and 'negative' probes will be used
:return: a :class:`SuperstarResult` instance
"""
if self.charged_probes:
self.probe_dict = dict(
apolar='AROMATIC CH CARBON',
donor='UNCHARGED NH NITROGEN',
acceptor='CARBONYL OXYGEN',
positive='CHARGED NH NITROGEN',
negative='CHLORIDE ANION'
)
else:
self.probe_dict = dict(
apolar='AROMATIC CH CARBON',
donor='UNCHARGED NH NITROGEN',
acceptor='CARBONYL OXYGEN')
wrk_dir = _test_output_dir()
args = [(k, self.probe_dict[k], centroid, self.prot, self.out_dir, wrk_dir) for k in self.probe_dict.keys()]
print(args)
ex = futures.ThreadPoolExecutor(max_workers=5)
results = ex.map(self._superstar_job, args)
return list(results)
This should speed up the calculation time significantly!
Superstar calculations are the slowest part of the process, so we should give the option to use a pool of processes to run in parallel
The text was updated successfully, but these errors were encountered: