[Yt-svn] yt-commit r1362 - in trunk/yt: extensions extensions/lightcone lagos
britton at wrangler.dreamhost.com
britton at wrangler.dreamhost.com
Sun Jul 5 12:27:57 PDT 2009
Author: britton
Date: Sun Jul 5 12:27:56 2009
New Revision: 1362
URL: http://yt.spacepope.org/changeset/1362
Log:
Added the keyword, 'serialize' (boolean, default True), to projections allowing
one to manually disable serialization or projections. Serialization still
only occurs if _okay_to_serialize is True as well, so setting serialize=True
will not serialize projections that weren't being serialized before.
This was added to simplify the solution to the problem of the HaloProfiler
getting stuck at an mpi barrier in parallel mode. In reality, we do not want
halo profiler projections to be saved anyway, since they are very small and
can be extremely numerous. Additionally, getting halo profiler projections
to serialize is not so doable as it requires all processors to have write
access to the .yt file which is just asking for trouble.
Finally, committing an unrelated fix to a small bug in writing out hdf5 data
in light cones. Did this a while ago, forgot to commit it.
Modified:
trunk/yt/extensions/HaloProfiler.py
trunk/yt/extensions/lightcone/LightCone.py
trunk/yt/lagos/BaseDataTypes.py
Modified: trunk/yt/extensions/HaloProfiler.py
==============================================================================
--- trunk/yt/extensions/HaloProfiler.py (original)
+++ trunk/yt/extensions/HaloProfiler.py Sun Jul 5 12:27:56 2009
@@ -196,7 +196,6 @@
def makeProjections(self,save_images=True,save_cube=True,**kwargs):
"Make projections of all halos using specified fields."
# Get virial quantities.
- self.pf.hierarchy._reset_save_data(round_robin=True)
self._LoadVirialData()
# Set resolution for fixed resolution output.
@@ -252,7 +251,8 @@
y_axis = coords[1]
for field in self.projectionFields.keys():
- pc.add_projection(field,w,weight_field=self.projectionFields[field],source=region,lazy_reader=False,**kwargs)
+ pc.add_projection(field,w,weight_field=self.projectionFields[field],source=region,lazy_reader=False,
+ serialize=False,**kwargs)
# Set x and y limits, shift image if it overlaps domain boundary.
if need_per:
@@ -290,7 +290,6 @@
pc.clear_plots()
del region
del pc
- self.pf.hierarchy._reset_save_data(round_robin=False)
@lagos.parallel_root_only
def _WriteVirialQuantities(self):
Modified: trunk/yt/extensions/lightcone/LightCone.py
==============================================================================
--- trunk/yt/extensions/lightcone/LightCone.py (original)
+++ trunk/yt/extensions/lightcone/LightCone.py Sun Jul 5 12:27:56 2009
@@ -334,7 +334,7 @@
self.lightConeSolution[-1]['object'].parameters['DomainRightEdge'][w])
for w in range(self.lightConeSolution[-1]['object'].parameters['TopGridRank'])]
pc = raven.PlotCollection(self.lightConeSolution[-1]['object'],center=center)
- pc.add_fixed_resolution_plot(frb,field)
+ pc.add_fixed_resolution_plot(frb,field,**kwargs)
pc.save(filename)
# Return the plot collection so the user can remake the plot if they want.
@@ -686,6 +686,7 @@
if node_exists:
if over_write:
mylog.info("Dataset, %s, already exists, overwriting." % field_node)
+ write_data = True
del output[field_node]
else:
mylog.info("Dataset, %s, already exists in %s, not saving." % (field_node,filename))
Modified: trunk/yt/lagos/BaseDataTypes.py
==============================================================================
--- trunk/yt/lagos/BaseDataTypes.py (original)
+++ trunk/yt/lagos/BaseDataTypes.py Sun Jul 5 12:27:56 2009
@@ -908,7 +908,8 @@
_con_args = ('axis', 'field', 'weight_field')
def __init__(self, axis, field, weight_field = None,
max_level = None, center = None, pf = None,
- source=None, node_name = None, field_cuts = None, **kwargs):
+ source=None, node_name = None, field_cuts = None,
+ serialize=True,**kwargs):
"""
AMRProj is a projection of a *field* along an *axis*. The field
can have an associated *weight_field*, in which case the values are
@@ -917,6 +918,7 @@
"""
AMR2DData.__init__(self, axis, field, pf, node_name = None, **kwargs)
self._field_cuts = field_cuts
+ self.serialize = serialize
self.center = center
if center is not None: self.set_field_parameter('center',center)
self._node_name = node_name
@@ -936,7 +938,7 @@
self._temp = {}
self._deserialize(node_name)
self._refresh_data()
- if self._okay_to_serialize: self._serialize(node_name=self._node_name)
+ if self._okay_to_serialize and self.serialize: self._serialize(node_name=self._node_name)
def _convert_field_name(self, field):
if field == "weight_field": return "weight_field_%s" % self._weight
@@ -1150,7 +1152,7 @@
field_data = na.vsplit(data.pop('fields'), len(fields))
for fi, field in enumerate(fields):
self[field] = field_data[fi].ravel()
- self._store_fields(field, self._node_name)
+ if self.serialize: self._store_fields(field, self._node_name)
for i in data.keys(): self[i] = data.pop(i)
def add_fields(self, fields, weight = "CellMassMsun"):
More information about the yt-svn
mailing list