Skip to content

Commit

Permalink
Merge pull request #227 from breuner/fix-mdtest-directio
Browse files Browse the repository at this point in the history
mdtest: allocate aligned buffers to support DirectIO
  • Loading branch information
glennklockwood committed Jun 2, 2020
2 parents a369d94 + 3eb4889 commit 9f07265
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mdtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,8 @@ void mdtest_read(int random, int dirs, const long dir_iter, char *path) {

/* allocate read buffer */
if (read_bytes > 0) {
read_buffer = (char *)malloc(read_bytes);
if (read_buffer == NULL) {
int alloc_res = posix_memalign((void**)&read_buffer, sysconf(_SC_PAGESIZE), write_bytes);
if (alloc_res) {
FAIL("out of memory");
}

Expand Down Expand Up @@ -2125,8 +2125,8 @@ mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE *

/* allocate and initialize write buffer with # */
if (write_bytes > 0) {
write_buffer = (char *)malloc(write_bytes);
if (write_buffer == NULL) {
int alloc_res = posix_memalign((void**)&write_buffer, sysconf(_SC_PAGESIZE), write_bytes);
if (alloc_res) {
FAIL("out of memory");
}
generate_memory_pattern(write_buffer, write_bytes);
Expand Down

0 comments on commit 9f07265

Please sign in to comment.