[Yt-svn] commit/yt: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Wed Apr 20 10:36:32 PDT 2011
2 new changesets in yt:
http://bitbucket.org/yt_analysis/yt/changeset/d241a1cca52d/
changeset: r4149:d241a1cca52d
branch: yt
user: sskory
date: 2011-04-20 16:22:02
summary: Setting "end_collect" to True in the halo profiler which means
that cells inside the innner-most bin are included in the inner-most bin.
affected #: 1 file (98 bytes)
--- a/yt/analysis_modules/halo_profiler/multi_halo_profiler.py Fri Apr 15 17:27:28 2011 -0600
+++ b/yt/analysis_modules/halo_profiler/multi_halo_profiler.py Wed Apr 20 08:22:02 2011 -0600
@@ -396,7 +396,7 @@
if self.velocity_center[1] == 'halo':
sphere.set_field_parameter('bulk_velocity', halo['velocity'])
elif self.velocity_center[1] == 'sphere':
- sphere.set_field_parameter('bulk_velocity', sphere.quantities['BulkVelocity']())
+ sphere.set_field_parameter('bulk_velocity', sphere.quantities['BulkVelocity'](lazy_reader=False, preload=False))
else:
mylog.error("Invalid parameter: VelocityCenter.")
elif self.velocity_center[0] == 'max':
@@ -409,7 +409,8 @@
try:
profile = BinnedProfile1D(sphere, self.n_profile_bins, "RadiusMpc",
r_min, halo['r_max'],
- log_space=True, lazy_reader=False)
+ log_space=True, lazy_reader=False,
+ end_collect=True)
except EmptyProfileData:
mylog.error("Caught EmptyProfileData exception, returning None for this halo.")
return None
http://bitbucket.org/yt_analysis/yt/changeset/1f5a117d7016/
changeset: r4150:1f5a117d7016
branch: yt
user: sskory
date: 2011-04-20 18:03:00
summary: Fixing parallel issues with halo changes in the halo profiler.
affected #: 1 file (672 bytes)
--- a/yt/analysis_modules/halo_profiler/multi_halo_profiler.py Wed Apr 20 08:22:02 2011 -0600
+++ b/yt/analysis_modules/halo_profiler/multi_halo_profiler.py Wed Apr 20 10:03:00 2011 -0600
@@ -295,8 +295,8 @@
self.__check_directory(my_output_dir)
# Profile all halos.
+ updated_halos = []
for halo in self._get_objs('all_halos', round_robin=True):
-
# Apply prefilters to avoid profiling unwanted halos.
filter_result = True
haloQuantities = {}
@@ -331,6 +331,17 @@
self.filtered_halos.append(haloQuantities)
+ # If we've gotten this far down, this halo is good and we want
+ # to keep it. But we need to communicate the recentering changes
+ # to all processors (the root one in particular) without having
+ # one task clobber the other.
+ updated_halos.append(halo)
+
+ # And here is where we bring it all together.
+ updated_halos = self._mpi_catlist(updated_halos)
+ updated_halos.sort(key = lambda a:a['id'])
+ self.all_halos = updated_halos
+
self.filtered_halos = self._mpi_catlist(self.filtered_halos)
self.filtered_halos.sort(key = lambda a:a['id'])
@@ -372,14 +383,15 @@
if new_x < self.pf.domain_left_edge[0] or \
new_y < self.pf.domain_left_edge[1] or \
new_z < self.pf.domain_left_edge[2]:
- mylog.info("Recentering moves too far, skipping halo %d" % \
+ mylog.info("Recentering rejected, skipping halo %d" % \
halo['id'])
return None
halo['center'] = [new_x, new_y, new_z]
- d = periodic_dist(old, halo['center'],
- self.pf.domain_right_edge - self.pf.domain_left_edge) * \
- self.pf['kpc']
- mylog.info("Recentered %1.3e kpc away." % d)
+ d = self.pf['kpc'] * periodic_dist(old, halo['center'],
+ self.pf.domain_right_edge - self.pf.domain_left_edge)
+ mylog.info("Recentered halo %d %1.3e kpc away." % (halo['id'], d))
+ # Expand the halo to account for recentering.
+ halo['r_max'] += d / 1000 # d is in kpc -> want mpc
new_sphere = True
if new_sphere:
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