[petsc-dev] Fortran equivalent + separate output with output_file

Smith, Barry F. bsmith at mcs.anl.gov
Fri Jan 17 15:29:28 CST 2020


  Better to send more details. What function are you calling, what is the full  error stack. Much quicker for us to help you then repeated email (you can never send too much information about a crash).

  PETSC_NULL_FUNCTION is the thing to use, but it is completely manual to for us to put them in the Fortran stubs, we have missed this case but we need to know what it is so we can fix it.

   Barry


> On Jan 17, 2020, at 3:18 PM, Pierre Jolivet <pierre.jolivet at enseeiht.fr> wrote:
> 
> 
> 
>> On 13 Jan 2020, at 4:38 PM, Smith, Barry F. <bsmith at mcs.anl.gov> wrote:
>> 
>> 
>> 
>>> On Jan 13, 2020, at 9:32 AM, Pierre Jolivet <pierre.jolivet at enseeiht.fr> wrote:
>>> 
>>> Hello,
>>> This is actually two separate questions, sorry.
>>> 1) I’m looking for the Fortran equivalent of the following, but I couldn’t get any help looking at the sources.
>>> ierr = PetscOptionsBegin(PETSC_COMM_WORLD,"","","");CHKERRQ(ierr);
>>> ierr = PetscOptionsFList("-mat_type","Matrix type","MatSetType",MatList,deft,type,256,&flg);CHKERRQ(ierr);
>>> ierr = PetscOptionsEnd();CHKERRQ(ierr);
>> 
>>   These are based on C macros and have some funny arguments so would require all custom Fortran stubs and interfaces. Sorry no one has written them.
> 
> OK. No big deal.
> Another question about Fortran: what’s the equivalent of a NULL PetscErrorCode (*setup)(Mat, PetscReal, Vec, Vec, PetscReal, IS, void*)?
> I’m passing a PETSC_NULL_FUNCTION but it doesn’t seem to do the job as I’m getting segmentation faults in C (for some architectures), the code goes in the if(setup) branch.
> 
> I want to convert this: https://gitlab.com/petsc/petsc/blob/fbda2a43629902c7e64367d3e3c13db2ceb5b740/src/ksp/ksp/examples/tutorials/ex76.c#L68
> Into (hopefully something similar to) this: https://gitlab.com/petsc/petsc/commit/fbda2a43629902c7e64367d3e3c13db2ceb5b740#42254f97b9989f77d6aa51f62644a282fc31f3fd_0_93
> 
> Thanks in advance for bearing with me,
> Pierre



More information about the petsc-dev mailing list