[yt-svn] commit/yt: 2 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri Jan 10 06:35:43 PST 2014


2 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/419311255bf1/
Changeset:   419311255bf1
Branch:      yt
User:        MatthewTurk
Date:        2014-01-08 15:14:46
Summary:     Catch when too many processors are being applied.

When the number of processors exceeds the number of grids searched, we can end
up in a case where the domain cannot be decomposed.  This addresses that by
extending the number of grids being searched.  Additionally, if it simply is
that there are too many processors, throw an error indicating that.
Affected #:  2 files

diff -r 980bb22a8436a2dc0640fce06128075e6d0ed688 -r 419311255bf11ea18dd37c997b252148ba3e992f yt/data_objects/object_finding_mixin.py
--- a/yt/data_objects/object_finding_mixin.py
+++ b/yt/data_objects/object_finding_mixin.py
@@ -15,6 +15,7 @@
 
 import numpy as np
 
+from yt.config import ytcfg
 from yt.funcs import *
 from yt.utilities.lib import \
     get_box_grids_level, \
@@ -54,7 +55,19 @@
 
     def find_max_cell_location(self, field, finest_levels = 3):
         if finest_levels is not False:
-            gi = (self.grid_levels >= self.max_level - finest_levels).ravel()
+            # This prevents bad values for the case that the number of grids to
+            # search is smaller than the number of processors being applied to
+            # the task, by 
+            nproc = ytcfg.getint("yt", "__topcomm_parallel_size")
+            while 1:
+                gi = (self.grid_levels >= self.max_level - finest_levels).ravel()
+                if gi.sum() >= nproc:
+                    break
+                elif finest_levels == self.max_level:
+                    raise YTTooParallel
+                else:
+                    finest_levels += 1
+                
             source = self.grid_collection([0.0]*3, self.grids[gi])
         else:
             source = self.all_data()

diff -r 980bb22a8436a2dc0640fce06128075e6d0ed688 -r 419311255bf11ea18dd37c997b252148ba3e992f yt/utilities/exceptions.py
--- a/yt/utilities/exceptions.py
+++ b/yt/utilities/exceptions.py
@@ -210,6 +210,10 @@
 class YTEmptyProfileData(Exception):
     pass
 
+class YTTooParallel(YTException):
+    def __str__(self):
+        return "You've used too many processors for this dataset."
+
 class YTDuplicateFieldInProfile(Exception):
     def __init__(self, field, new_spec, old_spec):
         self.field = field


https://bitbucket.org/yt_analysis/yt/commits/9cd93d05bd3c/
Changeset:   9cd93d05bd3c
Branch:      yt
User:        MatthewTurk
Date:        2014-01-08 16:32:13
Summary:     Ensuring finest_levels is sanitized.  Thanks, Kacper!
Affected #:  1 file

diff -r 419311255bf11ea18dd37c997b252148ba3e992f -r 9cd93d05bd3cedfadcc3c3132e52e311de7c816f yt/data_objects/object_finding_mixin.py
--- a/yt/data_objects/object_finding_mixin.py
+++ b/yt/data_objects/object_finding_mixin.py
@@ -63,7 +63,7 @@
                 gi = (self.grid_levels >= self.max_level - finest_levels).ravel()
                 if gi.sum() >= nproc:
                     break
-                elif finest_levels == self.max_level:
+                elif finest_levels >= self.max_level:
                     raise YTTooParallel
                 else:
                     finest_levels += 1

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list