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

ALL: allow to change number of threads used for kdtree #353

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Marcello-Sega
Copy link
Owner

No description provided.

@@ -66,6 +66,8 @@ class GITIM(Interface):
:param bool warnings: Print warnings
:param bool autoassign: If true (default) detect the interface
every time a new frame is selected.
:param int workers: Passes the workers option to scipy.spatial.cKDTree.query_ball
If -1 is given all CPU threads are used (default: -1)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (89 > 79 characters)

@@ -66,6 +66,8 @@ class GITIM(Interface):
:param bool warnings: Print warnings
:param bool autoassign: If true (default) detect the interface
every time a new frame is selected.
:param int workers: Passes the workers option to scipy.spatial.cKDTree.query_ball

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (97 > 79 characters)

>>> print(repr(inter.atoms))
<AtomGroup with 855 atoms>

>>> inter = pytim.SASA( g, alpha=2.5, max_layers=2, cluster_cut=3.5, biggest_cluster_only=True, molecular=True,workers=1)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (129 > 79 characters)

@@ -519,7 +524,11 @@ def _():
<AtomGroup with 2025 atoms>


>>> inter = pytim.SASA( g, alpha=2.5, max_layers=2, cluster_cut=3.5, biggest_cluster_only=True, molecular=True)
>>> inter = pytim.SASA( g, alpha=2.5, max_layers=2, cluster_cut=3.5, biggest_cluster_only=True, molecular=True,workers=-1)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (130 > 79 characters)

@@ -171,7 +176,7 @@ def _define_cluster_group(self):
# the smaller clusters of the other phase
labels, counts, neighbors = utilities.do_cluster_analysis_dbscan(
self.cluster_group, cluster_cut,
self.cluster_threshold_density, self.molecular)
self.cluster_threshold_density, self.molecular,workers=self.workers)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (84 > 79 characters)
missing whitespace after ','

@@ -60,6 +60,8 @@ class SASA(GITIM):
:param bool warnings: Print warnings
:param bool autoassign: If true (default) detect the interface
every time a new frame is selected.
:param int workers: Passes the workers option to scipy.spatial.cKDTree.query_ball

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (97 > 79 characters)

@@ -56,7 +59,7 @@ def do_cluster_analysis_dbscan(group,

neighborhoods = np.array([
np.array(neighbors)
for neighbors in tree.query_ball_point(points, cluster_cut, n_jobs=-1)
for neighbors in tree.query_ball_point(points, cluster_cut, workers=workers)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (84 > 79 characters)

@@ -46,6 +46,9 @@ def do_cluster_analysis_dbscan(group,
clusters. This is on average O(N log N) thanks to the O(log N)
scaling of the kdtree.

To avoid problems in environments with limited resources,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace

@@ -31,7 +31,7 @@ def determine_samples(threshold_density, cluster_cut, n_neighbors):
def do_cluster_analysis_dbscan(group,
cluster_cut,
threshold_density=None,
molecular=True):
molecular=True,workers=1):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace after ','

:param bool autoassign: If true (default) detect the interface
every time a new frame is selected.
:param int workers: Passes the workers option to scipy.spatial.cKDTree.query_ball
If -1 is given all CPU threads are used (default: -1)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (87 > 79 characters)

@Marcello-Sega Marcello-Sega linked an issue Dec 6, 2021 that may be closed by this pull request
@Marcello-Sega
Copy link
Owner Author

fixes #352

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

Successfully merging this pull request may close these issues.

multiple kdtree threads might create issues on clusters
2 participants