Skip to content

import from mpi4py is causing python to crash on login nodes  #216

@gppezzi

Description

@gppezzi

The following mpi4py import on fancylogger is causing python to crash on login nodes (where we don't have a working MPI subsystem):

from mpi4py import MPI

The author of mpi4py suggested a couple of workarounds, the first being to precede the import with:

import mpi4py.rc
mpi4py.rc.initialize = False

This would fix the crash on the login nodes, but I suppose the following call to MPI.COMM_WORLD.Get_rank() would stop working on the compute nodes.

For keeping track of the discussion, I'm also pasting here another proposed solution by the author of mpi4py:

However, you could write your code this way:

from mpi4py import MPI
if MPI.Is_initialized():
rank_id = MPI.COMM_WORLD.Get_rank()
else:
rank_id = 0 # or None, and special case None values elsewhere in the logger code

Here we have some clues on how to fix the problem, however it is not clear to me how we can fix that in a way that it works on both compute and login nodes.

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions