<div dir="ltr">On Thu, Apr 18, 2013 at 8:08 AM, Alexei Matveev <span dir="ltr"><<a href="mailto:alexei.matveev+petsc@gmail.com" target="_blank">alexei.matveev+petsc@gmail.com</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><div class="gmail_quote">Hi, All,<br><br>Thanks for your comments.<br><br>On 17 April 2013 23:35, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
It is our intention that PETSc be easy enough for anyone to install that rather than making your application work with different versions one simply install the PETSc version one needs. In addition we recommend updating applications to work with the latest release within a couple of months after each release.<br>
</blockquote></div><br>I understand that. With rapid development it is unavoidable to break<br>API occasionally.<br><br>I managed to compile and run the code with the quick hack below and somewhat<br>more. Thanks, Kirk! Need yet to find out why the tests fail.<br>
<br>Do I understand it correctly that there is no way currently to load a distributed<br>Vec from the file without knowing and setting its dimensions first?<br></blockquote><div><br></div><div style>I am not sure what you mean here. The point is that prescribing the layout of a Vec</div>
<div style>in a file is clearly wrong. We would like to be able to save from one parallel configuration</div><div style>and load on another (maybe serial). Thus, the loader prescribes the layout.</div><div style><br></div>
<div style> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Like I was doing here:<br><br>+# if PETSC_VERSION < 30200<br>
VecLoad (viewer, VECMPI, &vec); /* creates it */<br>+#else<br>+ /* FIXME: how to make it distributed? */<br>+ VecCreate (PETSC_COMM_WORLD, &vec);<br>+ VecLoad (vec, viewer);<br>+#endif<br><br>BTW, I found myself calling (DM)DAGetInfo() on the array descriptor DM/DA<br>
quite often to get the shape of the 3d grid. I noticed that now that the signature<br>of the *GetInfo() changed. Is there an official way to get that shape info by enquiring<br>the Vec itself?<br><br>Alexei<br><br>-#include "petscda.h" /* Vec, Mat, DA, ... */<br>
+#include "petscdmda.h" /* Vec, Mat, DA, ... */<br> #include "petscdmmg.h" /* KSP, ... */<br><br>+#define PETSC_VERSION (PETSC_VERSION_MAJOR * 10000 + PETSC_VERSION_MINOR * 100)<br>+<br>
+/* FIXME: PETSC 3.2 */<br>+#if PETSC_VERSION >= 30200<br>+typedef DM DA;<br>+typedef PetscBool PetscTruth;<br>+# define VecDestroy(x) (VecDestroy)(&(x))<br>+# define VecScatterDestroy(x) (VecScatterDestroy)(&(x))<br>
+# define MatDestroy(x) (MatDestroy)(&(x))<br>+# define ISDestroy(x) (ISDestroy)(&(x))<br>+# define KSPDestroy(x) (KSPDestroy)(&(x))<br>+# define SNESDestroy(x) (SNESDestroy)(&(x))<br>
+# define PetscViewerDestroy(x) (PetscViewerDestroy)(&(x))<br>+# define PCDestroy(x) (PCDestroy)(&(x))<br>+# define DADestroy(x) (DMDestroy)(&(x))<br>+# define DAGetCorners DMDAGetCorners<br>
+# define DACreate3d DMDACreate3d<br>+# define DACreateGlobalVector DMCreateGlobalVector<br>+# define DAGetGlobalVector DMGetGlobalVector<br>+# define DAGetInfo DMDAGetInfo<br>+# define DAGetMatrix DMGetMatrix<br>
+# define DARestoreGlobalVector DMRestoreGlobalVector<br>+# define DAVecGetArray DMDAVecGetArray<br>+# define DAVecRestoreArray DMDAVecRestoreArray<br>+# define VecLoadIntoVector(viewer, vec) VecLoad (vec, viewer)<br>
+# define DA_STENCIL_STAR DMDA_STENCIL_STAR<br>+# define DA_XYZPERIODIC DMDA_XYZPERIODIC<br>+#endif<br>
</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
</div></div>