[yt-users] Segmentation Fault Analyzing Gasoline (TIPSY) data with yt-3.0

Samantha Benincasa benincsm at mcmaster.ca
Fri Nov 29 06:39:22 PST 2013


Hi Matt and Nathan,

Thank you for all your help.  That works perfectly!

-Samantha


On Wed, Nov 27, 2013 at 2:06 PM, Matthew Turk <matthewturk at gmail.com> wrote:

> Hi Samantha and everyone,
>
> Sorry for the long delay in replying.  I've figured out the problem,
> and how to fix it.
>
> The endianness of Tipsy data often has to be guessed, and we don't do
> a good job of that.  I was able to load the data by supplying the
> argument:
>
> endian = '<'
>
> to the TipsyStaticOutput command.  I've pushed a change that notes
> this if it doesn't get a consistent output, but here's my full script:
>
> from yt.mods import *
> domain_left_edge = np.zeros(3, dtype="float64") - 600
> domain_right_edge = np.zeros(3, dtype="float64") + 600
> ds = TipsyStaticOutput('test.00169',parameter_file='test.param', endian =
> '<',
>     domain_left_edge = domain_left_edge,
>     domain_right_edge = domain_right_edge,
>     n_ref = 8,
> )
> for v in ds._header_spec: print v, ds.parameters[v[0]]
> p = ProjectionPlot(ds, "x", ("deposit", "all_density"))
> p.save()
>
> -Matt
>
> On Fri, Nov 15, 2013 at 3:36 PM, Nathan Goldbaum <nathan12343 at gmail.com>
> wrote:
> > Unfortunately I don't have time to look into this too deeply.  For what
> it's
> > worth, I get the traceback pasted below when I try to load Samantha's
> > dataset.  It looks like there's some corruption happening when yt tries
> to
> > infer the particle counts.
> >
> > In [1]: ds = TipsyStaticOutput('test.00169', parameter_file='test.param',
> > domain_left_edge=[-57]*3, domain_right_edge=[57]*3)
> >
> > In [2]: ds.h
> > Exception IndexError: 'Out of bounds on buffer access (axis 0)' in
> > 'yt.geometry.particle_oct_container.ParticleRegions._mask_positions'
> ignored
> >
> ---------------------------------------------------------------------------
> > ValueError                                Traceback (most recent call
> last)
> > /Users/goldbaum/Documents/yt-3.0/scripts/iyt in <module>()
> > ----> 1 ds.h
> >
> > /Users/goldbaum/Documents/yt-3.0/yt/data_objects/static_output.pyc in
> > hierarchy(self)
> >     220                 raise RuntimeError("You should not instantiate
> > StaticOutput.")
> >     221             self._instantiated_hierarchy = self._hierarchy_class(
> > --> 222                 self, data_style=self.data_style)
> >     223             # Now we do things that we need an instantiated
> > hierarchy for
> >     224             if "all" not in self.particle_types:
> >
> >
> /Users/goldbaum/Documents/yt-3.0/yt/geometry/particle_geometry_handler.pyc
> > in __init__(self, pf, data_style)
> >      48         self.directory = os.path.dirname(self.hierarchy_filename)
> >      49         self.float_type = np.float64
> > ---> 50         super(ParticleGeometryHandler, self).__init__(pf,
> > data_style)
> >      51
> >      52     def _setup_geometry(self):
> >
> > /Users/goldbaum/Documents/yt-3.0/yt/geometry/geometry_handler.pyc in
> > __init__(self, pf, data_style)
> >      64
> >      65         mylog.debug("Setting up domain geometry.")
> > ---> 66         self._setup_geometry()
> >      67
> >      68         mylog.debug("Initializing data grid data IO")
> >
> >
> /Users/goldbaum/Documents/yt-3.0/yt/geometry/particle_geometry_handler.pyc
> > in _setup_geometry(self)
> >      52     def _setup_geometry(self):
> >      53         mylog.debug("Initializing Particle Geometry Handler.")
> > ---> 54         self._initialize_particle_handler()
> >      55
> >      56
> >
> >
> /Users/goldbaum/Documents/yt-3.0/yt/geometry/particle_geometry_handler.pyc
> > in _initialize_particle_handler(self)
> >      87                 pf.domain_left_edge, pf.domain_right_edge,
> >      88                 [N, N, N], len(self.data_files))
> > ---> 89         self._initialize_indices()
> >      90         self.oct_handler.finalize()
> >      91         self.max_level = self.oct_handler.max_level
> >
> >
> /Users/goldbaum/Documents/yt-3.0/yt/geometry/particle_geometry_handler.pyc
> > in _initialize_indices(self)
> >     109             npart = sum(data_file.total_particles.values())
> >     110             morton[ind:ind + npart] = \
> > --> 111                 self.io._initialize_index(data_file,
> self.regions)
> >     112             ind += npart
> >     113         morton.sort()
> >
> > /Users/goldbaum/Documents/yt-3.0/yt/frontends/sph/io.py in
> > _initialize_index(self, data_file, regions)
> >     486                     morton[ind:ind+c] = compute_morton(
> >     487                         pos[:,0], pos[:,1], pos[:,2],
> > --> 488                         DLE, DRE)
> >     489                     ind += c
> >     490         mylog.info("Adding %0.3e particles", morton.size)
> >
> > ValueError: could not broadcast input array from shape (301190) into
> shape
> > (10000000)
> >
> >
> >
> > On Fri, Nov 15, 2013 at 11:39 AM, Samantha Benincasa <
> benincsm at mcmaster.ca>
> > wrote:
> >>
> >> Hi Nathan,
> >>
> >> I've put a sample tipsy file and the corresponding param file up, they
> can
> >> be downloaded at these links:
> >>
> >> tipsy file:
> >> http://www.physics.mcmaster.ca/~benincsm/test.00169
> >>
> >> parameter file:
> >> http://www.physics.mcmaster.ca/~benincsm/test.param
> >>
> >> Samantha
> >>
> >>
> >> On Fri, Nov 15, 2013 at 2:24 PM, Nathan Goldbaum <nathan12343 at gmail.com
> >
> >> wrote:
> >>>
> >>> Hi Samantha,
> >>>
> >>> Do you have a sample dataset you can share?  Uploading to a personal
> >>> website works well, but you can also share a link from dropbox, google
> >>> drive, or some other similar service.
> >>>
> >>> -Nathan
> >>>
> >>>
> >>> On Fri, Nov 15, 2013 at 10:57 AM, Samantha Benincasa
> >>> <benincsm at mcmaster.ca> wrote:
> >>>>
> >>>> Hello,
> >>>>
> >>>> I have been trying to analyze a TIPSY dataset using the new features
> in
> >>>> yt-3.0.  I am unable to do any analysis without getting a segmentation
> >>>> fault.
> >>>>
> >>>> Following the python notebook example for Gasoline, I read in the data
> >>>> using the command:
> >>>>
> >>>> ds = TipsyStaticOutput('test.00001',parameter_file='test.param')
> >>>>
> >>>> When I try to construct a plot collection, I am given the following
> >>>> error:
> >>>>
> >>>> YTDomainOverflow: Particle bounds [  1.25443703e-02  -5.12246704e+02
> >>>> -5.46726685e+02] and [  1.25443703e-02   5.65781677e+02
> 4.61335541e+02]
> >>>> exceed domain bounds [-0.5 -0.5 -0.5] and [ 0.5  0.5  0.5]
> >>>>
> >>>> If I instead try to manually set the domain bounds in the
> >>>> TipsyStaticOutput command,
> >>>>
> >>>> ds =
> >>>>
> TipsyStaticOutput('test.00001',parameter_file='test.param',domain_left_edge=[-57,-57,-57],domain_right_edge=[57,57,57])
> >>>>
> >>>> This gets rid of the domain boundary errors but I still receive a
> >>>> segmentation fault when I try to create the PlotCollection.  I am just
> >>>> trying to read the data in so I can make slices/projections in
> temperature
> >>>> and density.
> >>>>
> >>>> Thank you in advance for the help,
> >>>> Samantha
> >>>>
> >>>> _______________________________________________
> >>>> yt-users mailing list
> >>>> yt-users at lists.spacepope.org
> >>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> >>>>
> >>>
> >>>
> >>> _______________________________________________
> >>> yt-users mailing list
> >>> yt-users at lists.spacepope.org
> >>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> >>>
> >>
> >>
> >> _______________________________________________
> >> yt-users mailing list
> >> yt-users at lists.spacepope.org
> >> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> >>
> >
> >
> > _______________________________________________
> > yt-users mailing list
> > yt-users at lists.spacepope.org
> > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> >
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20131129/d7d072c9/attachment.html>


More information about the yt-users mailing list