PETSc

Aron Ahmadia aja2111 at columbia.edu
Sat Jan 27 18:43:18 CST 2007


Brian,

Work vectors should never be created/deleted every time an application
is run, they should be generated at the beginning and then accessed.

In this case calling get/restore should be fine.

~A

On 1/27/07, Matthew Knepley <knepley at gmail.com> wrote:
> On 1/27/07, Aron Ahmadia <aja2111 at columbia.edu> wrote:
> > Sounds like a documentation bug to me, are you referring to this?
> >
> http://www-unix.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-current/docs/manualpages/DA/DARestoreGlobalVector.html#DARestoreGlobalVector
> >
> > Perhaps I'm misunderstanding how Get/Restore are being used.  I'll let
> > one of the developers chime in on this when they've got a moment.
>
> This is a cut&paste error from GetLocalVector().
>
>   Matt
>
> > ~A
> >
> > On 1/27/07, Brian Grierson < bag2107 at columbia.edu> wrote:
> > > Another quick question.  PETSc online help says
> DAGetGlobal/DARestoreGlobal
> > > is a Seq vector operation, while
> > > DACreateGlobal/VecDesroy is parallel.
> > >
> > > I don't understand how you could create a global vector in a Seq manner
> on a
> > > DA???
> > >
> > >
> > >
> > > Brian A. Grierson
> > >
> > >
> > >
> > >
> > > Department of Applied Physics
> > >
> > > Columbia University
> > >
> > > Mobile: 646.259.1038
> > >
> > > Work:    212-854-4839
> > >
> > > bag2107 at columbia.edu
> > >
> > > bgrierson21 at gmail.com
> > >
> > >
> http://www.columbia.edu/~bag2107/http://www.apam.columbia.edu/ctx/ctx.html
> > >
> > >
> > > On Jan 27, 2007, at 6:41 PM, Aron Ahmadia wrote:
> > >
> > > Hi Brian,
> > >
> > > I took a quick peek at the source for DAGetGlobalVector in the current
> > > release:
> > >
> > > "
> > >  for (i=0; i<DA_MAX_WORK_VECTORS; i++) {
> > >    if (da->globalin[i]) {
> > >      *g             = da->globalin[i];
> > >      da->globalin[i] = PETSC_NULL;
> > >      goto alldone;
> > >    }
> > >  }
> > >  ierr = DACreateGlobalVector(da,g);CHKERRQ(ierr);
> > >
> > >  alldone:
> > >  for (i=0; i<DA_MAX_WORK_VECTORS; i++) {
> > >    if (!da->globalout[i]) {
> > >      da->globalout[i] = *g;
> > >      break;
> > >    }
> > > "
> > >
> > > The two appear to be very similar, with this exception.  Get/Restore
> > > work with one copy of the DA's global vector, but will make a copy if
> > > one has already been checked out or none exist.
> > >
> > > DACreateGlobalVector will always make a copy of the global vector,
> > > regardless of the circumstances.   I think you're better off using Get
> > > and Restore (less data copying) unless you'd like to work with
> > > multiple copies for some reason.
> > >
> > > ~A
> > >
> > > On 1/27/07, Brian Grierson < bag2107 at columbia.edu> wrote:
> > >
> > > Could you please tell me the difference between
> > >
> > > DACreateGlobalVector / VecDestroy
> > > and
> > > DAGetGlobalVector / DARestoreGlobalVector
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > Brian A. Grierson
> > >
> > >
> > >
> > >
> > > Department of Applied Physics
> > >
> > > Columbia University
> > >
> > > Mobile: 646.259.1038
> > >
> > > Work:    212-854-4839
> > >
> > > bag2107 at columbia.edu
> > >
> > > bgrierson21 at gmail.com
> > >
> > >
> http://www.columbia.edu/~bag2107/http://www.apam.columbia.edu/ctx/ctx.html
> > >
> > >
> > >
> > >
> >
> >
>
>
>
> --
> One trouble is that despite this system, anyone who reads journals widely
> and critically is forced to realize that there are scarcely any bars to
> eventual
> publication. There seems to be no study too fragmented, no hypothesis too
> trivial, no literature citation too biased or too egotistical, no design too
> warped, no methodology too bungled, no presentation of results too
> inaccurate, too obscure, and too contradictory, no analysis too
> self-serving,
> no argument too circular, no conclusions too trifling or too unjustified,
> and
> no grammar and syntax too offensive for a paper to end up in print. --
> Drummond Rennie




More information about the petsc-users mailing list