Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finalize MPI in petsc_com.jl #91

Closed
bhk37 opened this issue Aug 24, 2017 · 4 comments
Closed

Finalize MPI in petsc_com.jl #91

bhk37 opened this issue Aug 24, 2017 · 4 comments

Comments

@bhk37
Copy link

bhk37 commented Aug 24, 2017

Running PETSc.jl with mpirun gives the following MPI communication error:

mpirun has exited due to process rank 0 with PID 82427 on
node n0000.scs00 exiting improperly. There are two reasons this could occur:

  1. this process did not call "init" before exiting, but others in
    the job did. This can cause a job to hang indefinitely while it waits
    for all processes to call "init". By rule, if one process calls "init",
    then ALL processes must call "init" prior to termination.

  2. this process called "init", but exited without calling "finalize".
    By rule, all processes that call "init" MUST call "finalize" prior to
    exiting or it will be considered an "abnormal termination"

This may have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).

I found this occurs because MPI is not properly finalized in PETSc.init(). A simple fix is to add MPI.Finalize() after line 34 in petsc_com.jl. Could this be changed in the master branch?

@stevengj
Copy link
Contributor

I think that should be fine. Can you submit a pull request?

@stevengj
Copy link
Contributor

(Probably we only want to do this if Petsc initialized MPI itself, so we can set a flag to save whether we called MPI.Init().)

@bhk37
Copy link
Author

bhk37 commented Aug 24, 2017

Good point. Pull request submitted.

@simonbyrne
Copy link
Member

Should no longer be necessary with #99.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants