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

Python: "Cannot call MPI_INIT or MPI_INIT_THREAD more than once" #1351

Open
njzjz opened this issue Nov 17, 2023 · 3 comments
Open

Python: "Cannot call MPI_INIT or MPI_INIT_THREAD more than once" #1351

njzjz opened this issue Nov 17, 2023 · 3 comments
Labels

Comments

@njzjz
Copy link

njzjz commented Nov 17, 2023

Describe the bug

Got Cannot call MPI_INIT or MPI_INIT_THREAD more than once error when calling dftbplus.DftbPlus() twice. The first one has been closed by cdftb.close().

In my situation, I need to adjust the input file, so I must initialize DFTB+ twice.

To Reproduce

import dftbplus
cdftb = dftbplus.DftbPlus()
cdftb.close()
cdftb = dftbplus.DftbPlus()

Expected behaviour

No error.

Additional context

The DFTB+ is installed from conda-forge.

@njzjz
Copy link
Author

njzjz commented Nov 17, 2023

The nompi version from conda-forge doesn't have this problem.

@aradi
Copy link
Member

aradi commented Nov 20, 2023

@njzjz Thanks for reporting. The Python API should only use the serial binary as there is currently no way to pass MPI-handlers through the Python bindings. (But even in that case, you would have to run python within an MPI-framework already...). So, please use the serial library, you can still profit from the OpenMP threading within it.

Copy link

stale bot commented May 19, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants