Re: [petsc-dev] behavior of PetscDefined(PETSC_HAVE_CUDA)

2020-10-16 Thread Jed Brown
Patrick Sanan writes: > The man page for this seems to need fixing: > > "Either way evaluates true if PETSC_USE_DEBUG is defined (merely defined > or defined to 1) or undefined. This macro should not be used if its argument > may be defined to a non-empty value other than 1." > > Is a 0 val

Re: [petsc-dev] behavior of PetscDefined(PETSC_HAVE_CUDA)

2020-10-16 Thread Patrick Sanan
The man page for this seems to need fixing: "Either way evaluates true if PETSC_USE_DEBUG is defined (merely defined or defined to 1) or undefined. This macro should not be used if its argument may be defined to a non-empty value other than 1." Is a 0 value allowed? If so, does it also eval

Re: [petsc-dev] behavior of PetscDefined(PETSC_HAVE_CUDA)

2020-10-16 Thread Mark Adams
On Fri, Oct 16, 2020 at 1:05 AM Jed Brown wrote: > Barry Smith writes: > > > Could it error if the input starts with PETS_ to prevent inadvertent > mistakes hanging around for years? > > Source checks could warn, but cpp macros can't do substring matching. > You would want to check this befor

Re: [petsc-dev] behavior of PetscDefined(PETSC_HAVE_CUDA)

2020-10-16 Thread Mark Adams
Ah, thanks. On Thu, Oct 15, 2020 at 11:39 PM Jed Brown wrote: > Mark Adams writes: > > > I have: > > > > #if defined(PETSC_HAVE_CUDA) > > ierr = PetscInfo3(pc,"PETSC_HAVE_CUDA -Test: > > factor=%D. cuda=%D > > level=%D\n",pc_gamg->level_reduction_factors[pc_gamg->current_l

Re: [petsc-dev] behavior of PetscDefined(PETSC_HAVE_CUDA)

2020-10-15 Thread Jed Brown
Barry Smith writes: > Could it error if the input starts with PETS_ to prevent inadvertent > mistakes hanging around for years? Source checks could warn, but cpp macros can't do substring matching.

Re: [petsc-dev] behavior of PetscDefined(PETSC_HAVE_CUDA)

2020-10-15 Thread Barry Smith
Could it error if the input starts with PETS_ to prevent inadvertent mistakes hanging around for years? > On Oct 15, 2020, at 10:39 PM, Jed Brown wrote: > > Mark Adams writes: > >> I have: >> >> #if defined(PETSC_HAVE_CUDA) >> ierr = PetscInfo3(pc,"PETSC_HAVE_CUDA -

Re: [petsc-dev] behavior of PetscDefined(PETSC_HAVE_CUDA)

2020-10-15 Thread Jed Brown
Mark Adams writes: > I have: > > #if defined(PETSC_HAVE_CUDA) > ierr = PetscInfo3(pc,"PETSC_HAVE_CUDA -Test: > factor=%D. cuda=%D > level=%D\n",pc_gamg->level_reduction_factors[pc_gamg->current_level], > *PetscDefined(PETSC_HAVE_CUDA)*,pc_gamg->current_level);CHKERRQ(ierr);

[petsc-dev] behavior of PetscDefined(PETSC_HAVE_CUDA)

2020-10-15 Thread Mark Adams
I have: #if defined(PETSC_HAVE_CUDA) ierr = PetscInfo3(pc,"PETSC_HAVE_CUDA -Test: factor=%D. cuda=%D level=%D\n",pc_gamg->level_reduction_factors[pc_gamg->current_level], *PetscDefined(PETSC_HAVE_CUDA)*,pc_gamg->current_level);CHKERRQ(ierr); #endif and see: [0] PCGAMGCreate