[petsc-dev] petscversion.h unchanged but API changed for MatGetSubMatrix and others

Satish Balay balay at mcs.anl.gov
Fri Mar 10 13:50:45 CST 2017


As Jed stated - you should treat petsc master as +Inf

So PETSC_VERSION_MAJOR PETSC_VERSION_MINOR PETSC_VERSION_SUBMINOR has
no significance within petsc master [when PETSC_VERSION_RELEASE=0]

So you can't have a macro check for different petsc-master
snapshots. If you are supporting petsc-master - you should support the
latest [i.e keep updating with the API changes as they come by.

Satish

  On Fri, 10 Mar 2017, Eric Chamberland wrote:

> Hi,
> 
> thanks for these infos.
> 
> Isn't there a bug into the macros?
> 
> Let's say I retreived a copy of petsc-master 3.7.2 then I have:
> 
> #define PETSC_VERSION_RELEASE    0
> #define PETSC_VERSION_MAJOR      3
> #define PETSC_VERSION_MINOR      7
> #define PETSC_VERSION_SUBMINOR   2
> 
> Now an API changed in officiel release 3.7.4 and over, in my in-house code, if
> I use:
> 
> #if PETSC_VERSION_LT(3,7,4)
> 
> for my "old" petsc-master 3.7.2, it first checks:
> 
> (PETSC_VERSION_RELEASE == 1 && ..
> 
> which is erroneously false.... no?
> 
> Eric
> 
> 
> 
> 
> 
> On 10/03/17 02:10 PM, Jed Brown wrote:
> > Barry Smith <bsmith at mcs.anl.gov> writes:
> >
> > >    Eric,
> > >
> > >       The model we have followed is that master retains the version number
> > >       of the latest patched release and then at the time of a release the
> > >       version number is increased.  For releases  PETSC_VERSION_RELEASE
> > >       is defined to be 1 while for master PETSC_VERSION_RELEASE  is
> > >       defined to be 0. Thus if you want to switch between master and
> > >       release you need to also include a check on the
> > >       PETSC_VERSION_RELEASE value.
> >
> > PETSC_VERSION_LT and related comparison macros handle non-RELEASE as
> > +Inf for the purpose of comparison.  I recommend using those macros.
> >
> 
> 




More information about the petsc-dev mailing list