<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><br></div>   Vectors created from a DMDA have multi-dimensional information attached to them. When the vector is saved with an HDF5 viewer, this multi-dimensional information is saved in the HDF5 file.  When a vector created with a DMDA loads the HDF5 file, the multi-dimensional information is used for a successful load.<div><br></div><div>When a plain vector (obtained with VecCreate) loads from the HDF5 file, it does not have the concept of multidimensional information and thus, for some reason, works incorrectly. I would consider the current error output to be a bug; it should provide a more useful error message.</div><div><br></div><div>Note that for DMDA in parallel, the DMDA vector data is transformed to be stored in the natural multidimensional ordering on the disk. When it is read back in with a DMDA vector, the transformation is reversed to get the data back into PETSc's parallel ordering. So, in parallel, it would never make sense to store a DMDA vector with hdf5 and then read it back in with a "plain" vector since the plain vector does not know how to transform the data. </div><div><br></div><div>Barry</div><div><br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Aug 9, 2024, at 1:11 AM, 王惊梦 <pentaerythrotol@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr">Dear Barry,<div><br></div><div>Thank you for your quick reply, the problem has been solved.</div><div><br></div><div>I'm just still curious why when I use PETSC_COMM_SELF in PETSCVIEWER to load a 50*50*50 vector, and the error happens that "Global size of array in file is 2500(50*50), not 125000(50*50*50) as expected".</div><div><br></div><div>Best regards,</div><div>Yingjie ZHOU</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>> 于2024年8月9日周五 02:28写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><br></div>  Try reading the vector back in with a vector created from the DM.<div><br></div><div><br id="m_-611847373546313036lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Aug 8, 2024, at 10:46 AM, 王惊梦 <<a href="mailto:pentaerythrotol@gmail.com" target="_blank">pentaerythrotol@gmail.com</a>> wrote:</div><br><div><div dir="ltr" id="m_-611847373546313036pfptBanneralrce01" style="writing-mode:revert;color:revert;font-family:revert;font-feature-settings:revert;font-kerning:revert;font-size:revert;font-size-adjust:revert;font-stretch:revert;font-variant-alternates:revert;font-variant-caps:revert;font-variant-east-asian:revert;font-variant-ligatures:revert;font-variant-numeric:revert;font-weight:revert;text-orientation:revert;zoom:revert;letter-spacing:revert;background-blend-mode:revert;background-image:revert;background-position:revert;background-repeat:revert;background-size:revert;border-collapse:revert;box-sizing:revert;break-after:revert;break-before:revert;break-inside:revert;caption-side:revert;clear:revert;columns:revert;column-fill:revert;column-gap:revert;column-rule:revert;column-span:revert;empty-cells:revert;float:revert;image-orientation:revert;isolation:revert;line-break:revert;line-height:revert;list-style:revert;mix-blend-mode:revert;object-fit:revert;object-position:revert;outline:revert;overflow:revert;quotes:revert;table-layout:revert;text-align:left;text-align-last:revert;text-decoration:revert;text-emphasis:revert;text-indent:revert;text-overflow:revert;text-transform:revert;text-underline-position:revert;vertical-align:revert;white-space:revert;word-break:revert;border-spacing:revert;word-spacing:revert;background-clip:revert;background-origin:revert;text-combine-upright:revert;display:block;opacity:revert;background-color:rgb(208,216,220);border-bottom:revert;border-left:revert;border-right:revert;height:revert;max-height:revert;max-width:revert;min-height:revert;width:revert;margin:16px 0px;padding:8px 16px;border-radius:4px;min-width:200px;border-top:4px solid rgb(144,164,174)"><div id="m_-611847373546313036pfptBanneralrce01" style="writing-mode:unset;color:unset;font-family:unset;font-feature-settings:unset;font-kerning:unset;font-size:unset;font-size-adjust:unset;font-stretch:unset;font-variant-alternates:unset;font-variant-caps:unset;font-variant-east-asian:unset;font-variant-ligatures:unset;font-variant-numeric:unset;font-weight:unset;text-orientation:unset;zoom:unset;letter-spacing:unset;background:unset;background-blend-mode:unset;border-collapse:unset;border:unset;box-sizing:unset;break-after:unset;break-before:unset;break-inside:unset;caption-side:unset;clear:unset;columns:unset;column-fill:unset;column-gap:unset;column-rule:unset;column-span:unset;empty-cells:unset;float:left;image-orientation:unset;isolation:unset;line-break:unset;line-height:unset;list-style:unset;mix-blend-mode:unset;object-fit:unset;object-position:unset;outline:unset;overflow:unset;quotes:unset;table-layout:unset;text-align:unset;text-align-last:unset;text-decoration:unset;text-emphasis:unset;text-indent:unset;text-overflow:unset;text-transform:unset;text-underline-position:unset;vertical-align:unset;white-space:unset;word-break:unset;border-spacing:unset;word-spacing:unset;text-combine-upright:unset;display:block;opacity:unset;border-radius:unset;height:unset;max-height:unset;min-height:unset;min-width:unset;padding:unset;width:unset;margin:0px 0px 1px;max-width:600px"><div id="m_-611847373546313036pfptBanneralrce01" style="writing-mode:unset;font-family:Arial,sans-serif;font-feature-settings:unset;font-kerning:unset;font-size:14px;font-size-adjust:unset;font-stretch:unset;font-variant-alternates:unset;font-variant-caps:unset;font-variant-east-asian:unset;font-variant-ligatures:unset;font-variant-numeric:unset;font-weight:bold;text-orientation:unset;zoom:unset;letter-spacing:unset;background-blend-mode:unset;background-image:unset;background-position:unset;background-repeat:unset;background-size:unset;border-collapse:unset;border:unset;box-sizing:unset;break-after:unset;break-before:unset;break-inside:unset;caption-side:unset;clear:unset;columns:unset;column-fill:unset;column-gap:unset;column-rule:unset;column-span:unset;empty-cells:unset;float:unset;image-orientation:unset;isolation:unset;line-break:unset;line-height:18px;list-style:unset;mix-blend-mode:unset;object-fit:unset;object-position:unset;outline:unset;overflow:unset;quotes:unset;table-layout:unset;text-align:unset;text-align-last:unset;text-decoration:unset;text-emphasis:unset;text-indent:unset;text-overflow:unset;text-transform:unset;text-underline-position:unset;vertical-align:unset;white-space:unset;word-break:unset;border-spacing:unset;word-spacing:unset;background-clip:unset;background-origin:unset;text-combine-upright:unset;display:block;opacity:unset;background-color:rgb(208,216,220);border-radius:unset;height:unset;margin:unset;max-height:unset;max-width:unset;min-height:unset;min-width:unset;padding:unset;width:unset">This Message Is From an External Sender</div><div id="m_-611847373546313036pfptBanneralrce01" style="writing-mode:unset;font-family:Arial,sans-serif;font-feature-settings:unset;font-kerning:unset;font-size:12px;font-size-adjust:unset;font-stretch:unset;font-variant-alternates:unset;font-variant-caps:unset;font-variant-east-asian:unset;font-variant-ligatures:unset;font-variant-numeric:unset;font-weight:unset;text-orientation:unset;zoom:unset;letter-spacing:unset;background-blend-mode:unset;background-image:unset;background-position:unset;background-repeat:unset;background-size:unset;border-collapse:unset;border:unset;box-sizing:unset;break-after:unset;break-before:unset;break-inside:unset;caption-side:unset;clear:unset;columns:unset;column-fill:unset;column-gap:unset;column-rule:unset;column-span:unset;empty-cells:unset;float:unset;image-orientation:unset;isolation:unset;line-break:unset;line-height:18px;list-style:unset;mix-blend-mode:unset;object-fit:unset;object-position:unset;outline:unset;overflow:unset;quotes:unset;table-layout:unset;text-align:unset;text-align-last:unset;text-decoration:unset;text-emphasis:unset;text-indent:unset;text-overflow:unset;text-transform:unset;text-underline-position:unset;vertical-align:unset;white-space:unset;word-break:unset;border-spacing:unset;word-spacing:unset;background-clip:unset;background-origin:unset;text-combine-upright:unset;display:block;opacity:unset;background-color:rgb(208,216,220);border-radius:unset;height:unset;margin-bottom:unset;margin-left:unset;margin-right:unset;max-height:unset;max-width:unset;min-height:unset;min-width:unset;padding:unset;width:unset;margin-top:2px">This message came from outside your organization.</div></div><div style="height:0px;clear:both;display:block;line-height:0;font-size:0.01px"></div></div><div dir="ltr" style="font-family:Helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">Dear Sir or Madam,<div><br></div><div>I met a problem about loading data from hdf5 file. Attached is a simple test program.</div><div><br></div><div>A introduction of the program is as follows:</div><div>I create a 3d DMDA object(50*50*50), and create 2 global vectors x and y by DMDA, then I write the vector x into file test.h5.</div><div>When I try to load the vector y from test.h5, the error occurs that "Global size of array in file is 2500, not 125000 as expected", but the size of the array should be 125000 which I've checked in python.</div><div><br></div><div>Thank you for your help!</div><div><br></div><div>Best regards</div><div>ZHOU Yingjie</div></div><span id="m_-611847373546313036cid:f_lzlco9od0"><test.c></span></div></blockquote></div><br></div></div></blockquote></div>
</div></blockquote></div><br></div></body></html>