[yt-svn] commit/yt: brittonsmith: Adding parallel support to ProfileND objects, which are used by ProfilePlot and PhasePlot.
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Mon Mar 31 09:30:44 PDT 2014
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/2df25eea0995/
Changeset: 2df25eea0995
Branch: yt
User: brittonsmith
Date: 2014-03-31 16:55:35
Summary: Adding parallel support to ProfileND objects, which are used by ProfilePlot and PhasePlot.
Affected #: 1 file
diff -r 49c6f69305bab0d56667884fa5146d984a0ed6a3 -r 2df25eea09954523959a4eecea2858bee6442d62 yt/data_objects/profiles.py
--- a/yt/data_objects/profiles.py
+++ b/yt/data_objects/profiles.py
@@ -811,6 +811,7 @@
self.pf = data_source.pf
self.field_data = YTFieldData()
self.weight_field = weight_field
+ ParallelAnalysisInterface.__init__(self, comm=data_source.comm)
def add_fields(self, fields):
fields = ensure_list(fields)
@@ -822,7 +823,9 @@
def _finalize_storage(self, fields, temp_storage):
# We use our main comm here
# This also will fill _field_data
- # FIXME: Add parallelism and combining std stuff
+ temp_storage.values = self.comm.mpi_allreduce(temp_storage.values, op="sum", dtype="float64")
+ temp_storage.weight_values = self.comm.mpi_allreduce(temp_storage.weight_values, op="sum", dtype="float64")
+ temp_storage.used = self.comm.mpi_allreduce(temp_storage.used, op="sum", dtype="bool")
if self.weight_field is not None:
temp_storage.values /= temp_storage.weight_values[...,None]
blank = ~temp_storage.used
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