[yt-svn] commit/yt-3.0: MatthewTurk: The previous "fix" for parallel_objects did not work for non-len'd iterators.

Bitbucket commits-noreply at bitbucket.org
Tue Nov 27 10:38:38 PST 2012


1 new commit in yt-3.0:


https://bitbucket.org/yt_analysis/yt-3.0/changeset/b739b6a59d3d/
changeset:   b739b6a59d3d
branch:      yt-3.0
user:        MatthewTurk
date:        2012-11-27 19:38:32
summary:     The previous "fix" for parallel_objects did not work for non-len'd iterators.
This does.
affected #:  1 file

diff -r a8d6d5c5866a575d0b86b8f15df0fade3bcd3fe2 -r b739b6a59d3db78d816cc6b8769b3708aa525912 yt/utilities/parallel_tools/parallel_analysis_interface.py
--- a/yt/utilities/parallel_tools/parallel_analysis_interface.py
+++ b/yt/utilities/parallel_tools/parallel_analysis_interface.py
@@ -432,14 +432,12 @@
             break
     if parallel_capable:
         communication_system.push_with_ids(all_new_comms[my_new_id].tolist())
-    obj_ids = np.arange(len(objects))
-
     to_share = {}
     # If our objects object is slice-aware, like time series data objects are,
     # this will prevent intermediate objects from being created.
-    oiter = itertools.izip(obj_ids[my_new_id::njobs],
-                           objects[my_new_id::njobs])
-    for result_id, obj in oiter:
+    oiter = itertools.islice(enumerate(objects), my_new_id, None, njobs)
+    for obj_id, obj in oiter:
+        result_id = obj_id * njobs + my_new_id
         if storage is not None:
             rstore = ResultsStorage()
             rstore.result_id = result_id

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

--

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