<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div>
<div>Thanks Jed, the PETSC_VERSION_GE macro will do the trick. I understand not wanting to be eternally backwards compatible; see Excel's wrong handling of leap years due to backwards compatibility with DOS-era Lotus Notes.</div>
<div><br>
</div>
<div>Regards,</div>
<div>Åsmund</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div style="font-size:75%; color:#575757">Sent from my VT-102</div>
</div>
<br>
Jed Brown <jedbrown@mcs.anl.gov> skrev:<br>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Åsmund Ervik <asmund.ervik@ntnu.no> writes:<br>
> Ok, so PETSC_DEFAULT_REAL works fine with master but not with 3.4.<br>
> What are my options if I want to keep this simple? I can pretty much<br>
> guarantee that my colleagues and the test server won't all switch to<br>
> 3.5 simultaneously. Is there a better fix than hardcoding in the<br>
> default values? KSPSetTolerances is the only place where we use these.<br>
<br>
Historically, we have made a handful of interface changes in each PETSc<br>
release.  It's expensive to maintain complete source compatibility (in<br>
general; not in this case) due to internal refactoring of interfaces,<br>
the fact that people never update their code if not forced to, and user<br>
confusion attempting to mix old and new ways of doing things.<br>
<br>
In C with supported compilers, I have been using deprecated "attributes"<br>
to mark deprecated functions that are relatively easy to preserve.<br>
(More major change, such as splitting SNESLineSearch into its own<br>
object, can't easily be handled this way.)  Most users only have to<br>
change a few lines to upgrade to a new version.<br>
<br>
In this case, we could leave PETSC_DEFAULT_DOUBLE_PRECISION as an alias,<br>
though the misleading name may cause some confusion and since I don't<br>
know a general way to mark it deprecated in Fortran, people will<br>
continue to use it indefinitely.  The general approach you can always<br>
use is<br>
<br>
#if PETSC_VERSION_GE(3,5,0)<br>
  ... PETSC_DEFAULT_REAL<br>
#else<br>
  ... PETSC_DEFAULT_DOUBLE_PRECISION<br>
#endif<br>
<br>
Unreleased versions of PETSc are +Infinity in the version comparison<br>
macros, so this works now and once petsc-3.5 is released.<br>
</div>
</span></font>
</body>
</html>