Skip to content

Does sisl fork on import? Warning with mpi4py #275

@jonaslb

Description

@jonaslb

So I occasionally write scripts that are simple to parallelize with mpi4py.
What I have discovered is that I occasionally get MPI warnings when importing sisl like so:

from mpi4py import MPI
import sisl

Which gives the following MPI warning:

--------------------------------------------------------------------------
A process has executed an operation involving a call to the
"fork()" system call to create a child process.  Open MPI is currently
operating in a condition that could result in memory corruption or
other system errors; your job may hang, crash, or produce silent
data corruption.  The use of fork() (or system() or other calls that
create child processes) is strongly discouraged.

The process that invoked fork was:

  Local host:          [[22936,1],0] (PID 24519)

If you are *absolutely sure* that your application will successfully
and correctly survive a call to fork(), you may disable this warning
by setting the mpi_warn_on_fork MCA parameter to 0.
--------------------------------------------------------------------------

However, the following two versions don't result in the warning:

import mpi4py
import sisl
import sisl
from mpi4py import MPI

Also importing other libraries doesn't seem to trigger the warning, only sisl.

I can't really figure out why it occurs. It doesn't stop the script from executing, but I still think it would be nice if it could be avoided regardless of import order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions