Skip to content

Commit d798f69

Browse files
committed
Add file cleanup
1 parent 45a9b5e commit d798f69

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/sccala/scmlib/sccala.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,13 @@ def bootstrap(
756756
print("[TIMELIMIT] Rank %d reached wallclock limit, exiting..." % rank)
757757
break
758758

759+
# If not using the default output_dir, clean up the temporary files to avoid
760+
# excessive disk usage
761+
if output_dir is not None:
762+
files = glob.glob(os.path.join(output_dir_rank, "*"))
763+
for f in files:
764+
os.remove(f)
765+
759766
if parallel:
760767
comm.Barrier()
761768
h0_vals = comm.gather(h0_vals, root=0)

0 commit comments

Comments
 (0)