Problems with PetscLogView
Due to some chaos in initialization/finalization of PETSc/MPI, usage of -log_view
fails many times. MWE:
#include <dolfin.h>
using namespace dolfin;
int main()
{
PETScOptions().set("log_view");
return 0;
}
Error message:
*** The MPI_Attr_get() function was called after MPI_FINALIZE was invoked.
*** This is disallowed by the MPI standard.
*** Your MPI job will now abort.
Comments (10)
-
-
@nate-sime Can you comment on this from your experience?
-
reporter If I rember correctly, in Python it worked for me the following
import petsc4py petsc4py.init('python', '-log_view')
The trick is that the option must be passed before PETSc initialization I think.
-
Yes,
petsc4py.init('-log_view')
seems to work fine. -
I've been using
#include <dolfin.h> using namespace dolfin; int main(int argc, char** args) { PetscInitialize(&argc, &args, (char*)0, (char*)0); return 0; }
with the argument
-log_view
with no problems. I also get the above MPI error if I use the code Jan posted. -
reporter Use before you import anything.
-
- changed status to resolved
Should be resolved in f521cfd. Some issues may persists due to careless use of MPI on logging, and calls to logging functions before MPI is initialised.
-
reporter @garth, 9c56a97 is some fiddling with PETScDM. Could you link to an actual change fixing this?
-
Changed to f521cfd.
log_view
passed on command line now works. -
reporter That's great!
- Log in to comment
Just want to add that if you do the same in Python you get the following error message: