Skip to content

Commit a6697cf

Browse files
author
Patrick Miles
committed
volumegen: every rank ensures needed dirs exist
1 parent 1a1d337 commit a6697cf

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

ScaFFold/datagen/volumegen.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,16 @@ def main(config: Dict):
276276
if setup_err:
277277
raise RuntimeError(setup_err)
278278

279+
# Rank 0 creates shared metadata above; wait before local writer setup.
280+
comm.Barrier()
281+
282+
for subdir in ["training", "validation"]:
283+
os.makedirs(os.path.join(vol_path, subdir), exist_ok=True)
284+
os.makedirs(os.path.join(mask_path, subdir), exist_ok=True)
285+
286+
# Wait until every rank has ensured the writer directories exist.
287+
comm.Barrier()
288+
279289
# Determine train/val split globally so all ranks know where to save
280290
num_volumes = len(volumes_contents)
281291
random.seed(config.seed)

0 commit comments

Comments
 (0)