<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I should also point out that if you don't access the data (by not printing the list of grids as I do in my example), then you do not get a crash.<div><br></div><div>John</div><div><br><div><div>On Jul 5, 2011, at 8:06 PM, Sam Skillman wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi John,<div><br></div><div>So I think the issue might be that the default mode of h5py.File is read/write if it exists, and create if it doesn't.  In this case, I'm guessing that it is trying to open it in read/write, then when it tries to access it again it freaks out.  If you want to try changing line 73 of yt/frontends/flash/data_structures.py <br>

<div>from:</div><div>        self._handle = h5py.File(self.hierarchy_filename)<br>to:</div><div>        self._handle = h5py.File(self.hierarchy_filename, 'r')</div><div><br></div><div>it.....might work.  No promises. Let us know if that works.  If not, then seeing a pastebin of your script would be helpful.</div>

<div><br></div><div>Best,</div><div>Sam</div><div><br><div class="gmail_quote">On Tue, Jul 5, 2011 at 6:03 PM, Cameron Hummels <span dir="ltr"><<a href="mailto:chummels@astro.columbia.edu">chummels@astro.columbia.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Are you actively trying to create hdf5 files?  I know hdf5 won't<br>
overwrite an existing file by default, so perhaps if you've already<br>
created files in your loop, then try to run it again with those files<br>
still present, it will bail like this.<br>
<br>
If that isn't the case, I'm not sure.  If you could send your script, or<br>
pastebin it, that might provide more insight.<br>
<br>
Cameron<br>
<div><div></div><div class="h5"><br>
On 07/05/2011 05:34 PM, John ZuHone wrote:<br>
> Hi all,<br>
><br>
> I  have a loop that goes over a list of filenames I've generated, loads parameter files for them, passes each pf object to a procedure which grabs data from the file, and then loops back over. After the first iteration, I get this crash:<br>


><br>
> Traceback (most recent call last):<br>
>   File "/local/data/duce2/zuhone/src/ctools/filter_particle_velocities.py", line 91, in <module><br>
>     main()<br>
>   File "/local/data/duce2/zuhone/src/ctools/filter_particle_velocities.py", line 68, in main<br>
>     compute_turb_vels(pf, numVelCells, xp, yp, zp, vxp, vyp, vzp)<br>
>   File "/local/data/duce2/zuhone/src/ctools/compute_turb_vels.py", line 15, in compute_turb_vels<br>
>     leaf_grids = [g for g in pf.h.grids if len(g.Children) == 0]<br>
>   File "/local/data/duce2/zuhone/opt/yt-x86_64/src/yt-hg/yt/data_objects/static_output.py", line 163, in hierarchy<br>
>     self, data_style=self.data_style)<br>
>   File "/local/data/duce2/zuhone/opt/yt-x86_64/src/yt-hg/yt/frontends/flash/data_structures.py", line 73, in __init__<br>
>     self._handle = h5py.File(self.hierarchy_filename)<br>
>   File "/local/data/duce2/zuhone/opt/yt-x86_64/lib/python2.7/site-packages/h5py-1.3.1-py2.7-linux-x86_64.egg/h5py/highlevel.py", line 797, in __init__<br>
>     self.fid = self._generate_fid(name, mode, plist)<br>
>   File "/local/data/duce2/zuhone/opt/yt-x86_64/lib/python2.7/site-packages/h5py-1.3.1-py2.7-linux-x86_64.egg/h5py/highlevel.py", line 842, in _generate_fid<br>
>     fid = h5f.create(name, h5f.ACC_EXCL, fapl=plist)<br>
>   File "h5f.pyx", line 87, in h5py.h5f.create (h5py/h5f.c:1378)<br>
> h5py._stub.IOError: File exists (File accessability: Unable to open file)<br>
><br>
> It does not matter where in the list of files I start, so it's not due to a single bad file. It's like it doesn't detect the file it's trying to read somehow, so it tries to create it, but then it finds out it already exists, and then aborts. Very odd.<br>


><br>
> Best,<br>
><br>
> John ZuHone<br>
> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
<br>
</div></div><font color="#888888">--<br>
Cameron Hummels<br>
PhD Candidate, Astronomy Department of Columbia University<br>
Public Outreach Director, Astronomy Department of Columbia University<br>
NASA IYA New York State Student Ambassador<br>
<a href="http://outreach.astro.columbia.edu/" target="_blank">http://outreach.astro.columbia.edu</a><br>
PGP: 0x06F886E3<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</div></div></blockquote></div><br></div></div>
_______________________________________________<br>yt-users mailing list<br><a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org<br></blockquote></div><br></div></body></html>