Re: [petsc-dev] SETERRQ in fortran

2018-02-02 Thread Jed Brown
https://bitbucket.org/petsc/petsc/pull-requests/852/change-fortran-seterra-and-seterrq-to-be/diff "Smith, Barry F." writes: >> On Jan 31, 2018, at 3:17 PM, Jed Brown wrote: >> >> "Smith, Barry F." writes: >> On Jan 31, 2018, at

Re: [petsc-dev] SETERRQ in fortran

2018-01-31 Thread Smith, Barry F.
> On Jan 31, 2018, at 3:17 PM, Jed Brown wrote: > > "Smith, Barry F." writes: > >>> On Jan 31, 2018, at 3:12 PM, Jed Brown wrote: >>> >>> I think his point is that Fortran has a one-line if statement (no then >>> and no endif),

Re: [petsc-dev] SETERRQ in fortran

2018-01-31 Thread Jed Brown
"Smith, Barry F." writes: >> On Jan 31, 2018, at 3:12 PM, Jed Brown 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

Re: [petsc-dev] SETERRQ in fortran

2018-01-31 Thread Smith, Barry F.
> On Jan 31, 2018, at 3:12 PM, Jed Brown 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

Re: [petsc-dev] SETERRQ in fortran

2018-01-31 Thread Jed Brown
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(...) "Smith, Barry F." writes: > No, that is CHKERRQ() > > >> On Jan 31, 2018, at 2:02 PM, Lisandro Dalcin

Re: [petsc-dev] SETERRQ in fortran

2018-01-31 Thread Smith, Barry F.
No, that is CHKERRQ() > On Jan 31, 2018, at 2:02 PM, Lisandro Dalcin wrote: > > Maybe I'm missing something, but maybe this define is all what you need? > > #define SETERRQ(ierr) if (ierr/=0) call PetscError(comm,ierr,0,"message") > > program main > integer ierr,comm >

Re: [petsc-dev] SETERRQ in fortran

2018-01-31 Thread Lisandro Dalcin
Maybe I'm missing something, but maybe this define is all what you need? #define SETERRQ(ierr) if (ierr/=0) call PetscError(comm,ierr,0,"message") program main integer ierr,comm call something(ierr); SETERRQ(ierr) end program main On 6 January 2018 at 02:33, Smith, Barry F.

Re: [petsc-dev] SETERRQ in fortran

2018-01-31 Thread Smith, Barry F.
Ok, thanks for figuring it out. > On Jan 31, 2018, at 1:04 PM, Balay, Satish wrote: > > > The current code needs the following fix for --with-errorchecking=0. > But since this code is likely to be changed - I won't push this.. > > Satish > > --- > > diff --git

Re: [petsc-dev] SETERRQ in fortran

2018-01-31 Thread Satish Balay
The current code needs the following fix for --with-errorchecking=0. But since this code is likely to be changed - I won't push this.. Satish --- diff --git a/include/petsc/finclude/petscsys.h b/include/petsc/finclude/petscsys.h index e5d5cb5f09..ce0170b0c4 100644 ---

Re: [petsc-dev] SETERRQ in fortran

2018-01-31 Thread Smith, Barry F.
> On Jan 31, 2018, at 7:21 AM, Jed Brown wrote: > > "Smith, Barry F." writes: > >>> On Jan 5, 2018, at 5:00 PM, Jed Brown wrote: >>> >>> "Smith, Barry F." writes: >>> > On Jan 5, 2018, at 4:18 PM, Jed Brown

Re: [petsc-dev] SETERRQ in fortran

2018-01-31 Thread Jed Brown
"Smith, Barry F." writes: >> On Jan 5, 2018, at 5:00 PM, Jed Brown wrote: >> >> "Smith, Barry F." writes: >> On Jan 5, 2018, at 4:18 PM, Jed Brown wrote: "Smith, Barry F."

Re: [petsc-dev] SETERRQ in fortran

2018-01-05 Thread Smith, Barry F.
> On Jan 5, 2018, at 5:00 PM, Jed Brown wrote: > > "Smith, Barry F." writes: > >>> On Jan 5, 2018, at 4:18 PM, Jed Brown wrote: >>> >>> "Smith, Barry F." writes: >>> > On Jan 5, 2018, at 12:45 PM, Jed Brown

Re: [petsc-dev] SETERRQ in fortran

2018-01-05 Thread Jed Brown
"Smith, Barry F." writes: >> On Jan 5, 2018, at 4:18 PM, Jed Brown wrote: >> >> "Smith, Barry F." writes: >> On Jan 5, 2018, at 12:45 PM, Jed Brown wrote: "Smith, Barry F."

Re: [petsc-dev] SETERRQ in fortran

2018-01-05 Thread Smith, Barry F.
> On Jan 5, 2018, at 4:18 PM, Jed Brown wrote: > > "Smith, Barry F." writes: > >>> On Jan 5, 2018, at 12:45 PM, Jed Brown wrote: >>> >>> "Smith, Barry F." writes: >>> > On Jan 4, 2018, at 5:10 PM, Blaise A

Re: [petsc-dev] SETERRQ in fortran

2018-01-05 Thread Jed Brown
"Smith, Barry F." writes: >> On Jan 5, 2018, at 12:45 PM, Jed Brown wrote: >> >> "Smith, Barry F." writes: >> On Jan 4, 2018, at 5:10 PM, Blaise A Bourdin wrote: > On Jan 4, 2018, at 3:16

Re: [petsc-dev] SETERRQ in fortran

2018-01-05 Thread Smith, Barry F.
> On Jan 5, 2018, at 12:45 PM, Jed Brown wrote: > > "Smith, Barry F." writes: > >>> On Jan 4, 2018, at 5:10 PM, Blaise A Bourdin wrote: >>> >>> >>> On Jan 4, 2018, at 3:16 PM, Smith, Barry F. wrote:

Re: [petsc-dev] SETERRQ in fortran

2018-01-05 Thread Jed Brown
"Smith, Barry F." writes: >> On Jan 4, 2018, at 5:10 PM, Blaise A Bourdin wrote: >> >> >> >>> On Jan 4, 2018, at 3:16 PM, Smith, Barry F. wrote: >>> >>> >>> It's changed a bit. It is better but you need to understand how the new

Re: [petsc-dev] SETERRQ in fortran

2018-01-04 Thread Smith, Barry F.
> On Jan 4, 2018, at 5:10 PM, Blaise A Bourdin wrote: > > > >> On Jan 4, 2018, at 3:16 PM, Smith, Barry F. wrote: >> >> >> It's changed a bit. It is better but you need to understand how the new one >> works, so take a few minutes to see how it works

Re: [petsc-dev] SETERRQ in fortran

2018-01-04 Thread Blaise A Bourdin
> On Jan 4, 2018, at 3:16 PM, Smith, Barry F. wrote: > > > It's changed a bit. It is better but you need to understand how the new one > works, so take a few minutes to see how it works before converting. Got it. An example or a link to the fortran macro definition from

Re: [petsc-dev] SETERRQ in fortran

2018-01-04 Thread Smith, Barry F.
It's changed a bit. It is better but you need to understand how the new one works, so take a few minutes to see how it works before converting. Use CHKERRA() for main Fortran problem and CHKERRQ() for subroutines. Also look at their definitions to see how the if () business is handled.

Re: [petsc-dev] SETERRQ in fortran

2018-01-04 Thread Matthew Knepley
On Thu, Jan 4, 2018 at 2:42 PM, Blaise A Bourdin wrote: > Hi, > > Is SETERRQ still available in fortran? I notice that it is not used in any > of the example, but the man page still mentions fortran. Using it in a > fortran code leads to compiler errors. > Am I doing something