[petsc-dev] SETERRQ in fortran

Smith, Barry F. bsmith at mcs.anl.gov
Wed Jan 31 15:20:28 CST 2018



> On Jan 31, 2018, at 3:17 PM, Jed Brown <jed at jedbrown.org> wrote:
> 
> "Smith, Barry F." <bsmith at mcs.anl.gov> writes:
> 
>>> On Jan 31, 2018, at 3:12 PM, Jed Brown <jed at jedbrown.org> wrote:
>>> 
>>> I think his point is that Fortran has a one-line if statement (no then
>>> and no endif), which simplifies the macro and usage.
>>> 
>>> if (cond) SETERRQ(...)
>> 
>>   That doesn't work because the SETERRQ() has both the call to the error handler followed by a return which is two lines in Fortran.
> 
> Ah, right.  Would it make sense for PetscError to call MPI_Abort when
> called in this context?

  I don't think so. We want the traceback stack from Fortran as well as C, hence we want to return and not just abort.

   Your proposed change (of pulling out the endif) is fine with me, I don't think there are viable alternatives.

  Barry




More information about the petsc-dev mailing list