On Fri, Jan 20, 2012 at 3:47 PM, Mohamad M. Nasr-Azadani <span dir="ltr">&lt;<a href="mailto:mmnasr@gmail.com">mmnasr@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I know, it is getting very confusing. But this sounds very simple but got this complicated so far. <div>I think you have seen my emails yesterday. </div><div>I want to write a vector (3D DMDA, structured) at each time to an hdf5 file. </div>


<div>But, I want to also add the coodinates to the same *.h5 file as well. </div><div>The grid is structured, so I only need 3 1-D arrays representing the coordinates (and not 1D*1D*1D coordinates cell coordinates). </div>


<div>How would you go about it? </div><div><br></div><div>I thought about creating a &quot;parallel&quot; vector which has the size of 0 on all processors and N on processor zero and then dump the coordinates into that vector and into the same hdf5 file. No luck, since hdf5 writer does not like zero-sized local vectors (if I could have done this, then I could use the same hdf5 viewer and not close the file). But now, I am stuck. </div>


<div>I think about closing the hdf5 viewer after I dumped the field data, create a vector using PETSC_COMM_SELF including the coordinates on all processor and then add that vector to the end of same hdf5 file (that&#39;s why I need to open it and use append mode). Of course, I would do the writing only on processor zero. </div>
</blockquote><div><br></div><div>There is no need for append mode. HDF5 does not work that way. Just open it up and write.</div><div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>I hope I did not confuse you. </div><div>Thanks, </div><div>Mohamad</div><div><br></div><div><br></div><div><br></div><div><br><br><div class="gmail_quote">On Fri, Jan 20, 2012 at 1:37 PM, Jed Brown <span dir="ltr">&lt;<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="gmail_quote">On Fri, Jan 20, 2012 at 15:33, Mohamad M. Nasr-Azadani <span dir="ltr">&lt;<a href="mailto:mmnasr@gmail.com" target="_blank">mmnasr@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>At this point, I can&#39;t since the first time the viewer is created via  PETSC_COMM_WORLD and the second time, PETSC_COMM_SELF. <div>(I am not even 100% sure if that could cause any troubles with the hdf5 file?)</div>



</div></blockquote></div><br></div><div>Well this sounds pretty confusing. What are you actually trying to do?</div>
</blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>