Create a directory from root process.
(path, comm=MPI.COMM_WORLD)
| 70 | |
| 71 | |
| 72 | def parallel_mkdir(path, comm=MPI.COMM_WORLD): |
| 73 | """Create a directory from root process.""" |
| 74 | path = pathlib.Path(path) |
| 75 | with Sync(comm=comm, enter=False, exit=True) as sync: |
| 76 | if sync.comm.rank == 0: |
| 77 | if not path.exists(): |
| 78 | path.mkdir() |
| 79 |