<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Thanks. That worked.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
--</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
jeremy</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Jacob Faibussowitsch <jacob.fai@gmail.com><br>
<b>Sent:</b> Tuesday, June 13, 2023 11:25 AM<br>
<b>To:</b> Jeremy Theler (External) <jeremy.theler-ext@ansys.com><br>
<b>Cc:</b> petsc-users <petsc-users@mcs.anl.gov><br>
<b>Subject:</b> Re: [petsc-users] Start logging with -info after PetscInitialize()</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">[External Sender]<br>
<br>
Call PetscInfoDestroy() first.<br>
<br>
<a href="https://petsc.org/main/manualpages/Profiling/PetscInfoDestroy/">https://petsc.org/main/manualpages/Profiling/PetscInfoDestroy/</a><br>
<br>
Best regards,<br>
<br>
Jacob Faibussowitsch<br>
(Jacob Fai - booss - oh - vitch)<br>
<br>
> On Jun 13, 2023, at 10:16, Jeremy Theler (External) via petsc-users <petsc-users@mcs.anl.gov> wrote:<br>
><br>
> Hello all.<br>
><br>
> I've asked this question to Satish personally last week at the conference, but I'm stuck so any help would be appreciated.<br>
> For some reason not worth explaining, I need to activate -info after PetscInitialize() has been already called.<br>
> I'm trying something like this:<br>
><br>
> PetscOptionsSetValue(NULL, "-info", NULL);<br>
> PetscInfoSetFromOptions(NULL);<br>
><br>
> The second call fails with<br>
><br>
> [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>
> [0]PETSC ERROR: Object is in wrong state<br>
> [0]PETSC ERROR: PetscInfoSetClasses() cannot be called after PetscInfoGetClass() or PetscInfoProcessClass()<br>
> [0]PETSC ERROR: See <a href="https://petsc.org/release/faq/">https://petsc.org/release/faq/</a> for trouble shooting.<br>
> [0]PETSC ERROR: Petsc Release Version 3.19.2, Jun 01, 2023<br>
> [0]PETSC ERROR: reflexCLI on a double-int32-release named LIN54Z7SQ3 by jtheler Tue Jun 13 11:08:29 2023<br>
> [0]PETSC ERROR: Configure options --download-eigen --download-hdf5 --download-hypre --download-metis --download-mumps --download-parmetis --download-pragmatic --download-scalapack --download-slepc --with-64-bit-indices=no --with-debugging=no --with-precision=double
--with-scalar-type=real COPTFLAGS=-O3 CXXOPTFLAGS=-O3 FOPTFLAGS=-O3 --download-egads --download-opencascade --download-tetgen<br>
> [0]PETSC ERROR: #1 PetscInfoSetClasses() at /home/jtheler/libs/petsc-3.19.2/src/sys/info/verboseinfo.c:182<br>
> [0]PETSC ERROR: #2 PetscInfoSetFromOptions() at /home/jtheler/libs/petsc-3.19.2/src/sys/info/verboseinfo.c:407<br>
><br>
> But if I ignore the non-zero return value and I allow my program to continue, the required logging is enabled.<br>
> I also tried using a local PetscOptions object but the result is the same.<br>
><br>
> Any ideas to avoid that wrong state error?<br>
><br>
> Thanks<br>
> --<br>
> jeremy<br>
<br>
<br>
</div>
</span></font></div>
</body>
</html>