summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perform/pio_engine.c10
-rw-r--r--perform/pio_perf.c3
2 files changed, 13 insertions, 0 deletions
diff --git a/perform/pio_engine.c b/perform/pio_engine.c
index d1ea6d3..efcfa98 100644
--- a/perform/pio_engine.c
+++ b/perform/pio_engine.c
@@ -926,6 +926,16 @@ do_fopen(iotype iot, char *fname, file_descr *fd /*out*/, int flags)
else
fd->rawfd = RAWOPEN(fname, O_RDONLY);
+ /* The perils of raw I/O in a parallel environment. The problem is:
+ *
+ * - Process n opens a file with truncation and then starts
+ * writing to the file.
+ * - Process m also opens the file with truncation, but after
+ * process n has already started to write to the file. Thus,
+ * all of the stuff process n wrote is now lost.
+ */
+ MPI_Barrier(pio_comm_g);
+
if (fd->rawfd < 0 ) {
fprintf(stderr, "Raw File Open failed(%s)\n", fname);
GOTOERROR(FAIL);
diff --git a/perform/pio_perf.c b/perform/pio_perf.c
index 902817c..557f9bd 100644
--- a/perform/pio_perf.c
+++ b/perform/pio_perf.c
@@ -583,8 +583,11 @@ run_test(FILE *output, iotype iot, parameters parms)
output_report(output, "Average Throughput: %.2f MB/s\n",
total_mm.sum / total_mm.num);
+ /* clean up our mess */
free(write_mm_table);
free(read_mm_table);
+ free(write_gross_mm_table);
+ free(read_gross_mm_table);
pio_time_destroy(res.timers);
return ret_value;
}