Skip to content

[Feature request] MPI sanity checking on directory creation #62

Description

@nenasedk

I'm running breads on a cluster, and a common issue I'm having is a race condition when creating the output directories for breads (e.g. stage1_utils etc). This would be solved by adding a checks:

try:
    from mpi4py import MPI
    comm = MPI.COMM_WORLD
    rank = comm.Get_rank()
except ImportError:
    MPI = None
    pass

if rank == 0:
    # Do something
if comm is not None:
    comm.barrier()

This check could be added throughout the reduction_utils.py file, anywhere that os.makedirs (which could also be updated to include the exist_ok=True argument). Note that this would also require adding mpi4py as a dependency, perhaps there's a similar solution using the multiprocess library which is already a dependency.

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