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.
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_utilsetc). This would be solved by adding a checks:This check could be added throughout the
reduction_utils.pyfile, anywhere thatos.makedirs(which could also be updated to include theexist_ok=Trueargument). Note that this would also require addingmpi4pyas a dependency, perhaps there's a similar solution using themultiprocesslibrary which is already a dependency.