Skip to content

Commit 438d7a3

Browse files
committed
Added sleeping and fsync
1 parent bc91d1d commit 438d7a3

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

contrib/slurm/arrayexecutor.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ def execute_benchmark(benchmark, output_handler):
118118
else:
119119
output_handler.output_after_run_set(runSet)
120120

121+
time.sleep(5)
122+
121123
output_handler.output_after_benchmark(STOPPED_BY_INTERRUPT)
122124

123125

@@ -409,6 +411,8 @@ def execute_batch(
409411
logging.debug(f"Canceling sbatch job #{jobid}")
410412
subprocess.run(["scancel", str(jobid)])
411413

414+
time.sleep(5)
415+
412416
missing_runs = []
413417
for bin in bins:
414418
for i, run in bins[bin]:
@@ -616,6 +620,11 @@ def get_run_result(tempdir, run, result_files_patterns):
616620

617621
shutil.copy(tmp_log, run.log_file)
618622

623+
# 1. fsync the file itself
624+
fd = os.open(run.log_file, os.O_RDONLY)
625+
os.fsync(fd) # ensure data+metadata on dst are committed from client
626+
os.close(fd)
627+
619628
if os.path.exists(tempdir):
620629
os.makedirs(run.result_files_folder, exist_ok=True)
621630
for result_files_pattern in result_files_patterns:

0 commit comments

Comments
 (0)