[petsc-users] PETSc backward compatibility

Mark Adams mfadams at lbl.gov
Sat Mar 7 11:06:35 CST 2020


It is a fact of life that some projects just don't have the resources,
minimal though they may be, to move everyone to a new PETSc and not
maintain "backward compatibility" with older PETSc versions.

These MACROs work well and are a fine way to go.

Note, there were some big changes, bigger than anything before and I would
hope bigger than ever again, in Fortran from 3.7: paths for includes
changed to deal with package managers and NULL was replaced by typed NULLS
(eg, PETSC_NULL_INTEGER, PETSC_NULL_SCALAR...) to get type checking in
Fortran. This touches a lot of code and makes a mess of Macros, but it is
doable (I've done it). Either way it is a lot more work than is
usually required to maintain PETSc interfaces.

On Sat, Mar 7, 2020 at 7:25 AM Patrick Sanan <patrick.sanan at gmail.com>
wrote:

> I agree that it's better to upgrade whenever possible, but if for reasons
> out of your control you find yourself needing to support multiple versions
> of PETSc,
> which span API changes, you can use macros that PETSc provides for you, as
> described here:
>
> https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PETSC_VERSION.html
>
> I found this handy in a similar situation to yours. There was one
> lingering production cluster that had an old version of PETSc in a
> very-convenient-for-users module, even though everywhere else we could use
> the latest.
>
> #if PETSC_VERSION_GE(3,9,0)
> call PCFactorSetUpMatSolverType(pc,ierr);CHKERRQ(ierr);
> #else
> call PCFactorSetUpMatSolverPackage(pc,ierr);CHKERRQ(ierr); ! PETSc 3.8 and
> earlier
> #endif
>
>
> Am Fr., 6. März 2020 um 19:15 Uhr schrieb Matthew Knepley <
> knepley at gmail.com>:
>
>> On Fri, Mar 6, 2020 at 12:16 PM baikadi pranay <pranayreddy865 at gmail.com>
>> wrote:
>>
>>> Hello PETSc users,
>>>
>>> We have a FORTRAN code which uses eigenvalue solver routines. The
>>> version of PETSc/SLEPc used is 3.11.1.We would be deploying the code on a
>>> cluster which has PETSc/SLEPc version 3.6.4. We were wondering if we need
>>> to change any functions or if there is backwards compatibility.
>>>
>>> Please let me know if you need any further information.
>>>
>>
>> 3.6 is 5 years old. It would be easier to just install the new version on
>> the cluster. That would take 20min max.
>>
>> However, if you would really like to make it compatible, you can look at
>> the list of changes here:
>> https://www.mcs.anl.gov/petsc/documentation/changes/index.html
>>
>>   Thanks,
>>
>>      Matt
>>
>>
>>> Thank you,
>>> Pranay.
>>>
>>
>>
>> --
>> What most experimenters take for granted before they begin their
>> experiments is infinitely more interesting than any results to which their
>> experiments lead.
>> -- Norbert Wiener
>>
>> https://www.cse.buffalo.edu/~knepley/
>> <http://www.cse.buffalo.edu/~knepley/>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200307/f9604212/attachment.html>


More information about the petsc-users mailing list