From 1ee2c37ef060efab4772cdd3c793f1049ec18f5f Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Fri, 14 Dec 2018 16:26:16 -0700 Subject: [PATCH 1/6] lustre: fix checks for lustre_user.h header Fix the configure check if --with-lustre is specified, but the linux/lustre/lustre_user.h header is not present. Only one of the headers needs to be included if both are found. In some cases, FASYNC is not defined, but forms part of the O_LOV_DELAY_CREATE value, add a #define in that case. Fixes #115. Fixes: cb88c4c19a831d94b864c49a162e2635730540e5 Signed-off-by: Andreas Dilger --- configure.ac | 6 ++++-- src/aiori-POSIX.c | 14 ++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index a3c41b0..a372d84 100755 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ AM_MAINTAINER_MODE # We can't do anything without a working MPI AX_PROG_CC_MPI(,,[ - AC_MSG_FAILURE([MPI compiler requested, but couldn't use MPI.]) + AC_MSG_FAILURE([MPI compiler requested, but could not use MPI.]) ]) AC_PROG_RANLIB @@ -72,7 +72,9 @@ AC_ARG_WITH([lustre], [], [with_lustre=check]) AS_IF([test "x$with_lustre" != xno], [ AC_CHECK_HEADERS([linux/lustre/lustre_user.h lustre/lustre_user.h], break, [ - if test "x$with_lustre" != xcheck; then + if test "x$with_lustre" != xcheck -a \ + "x$ac_cv_header_linux_lustre_lustre_user_h" = "xno" -a \ + "x$ac_cv_header_lustre_lustre_user_h" = "xno" ; then AC_MSG_FAILURE([--with-lustre was given, not found]) fi ]) diff --git a/src/aiori-POSIX.c b/src/aiori-POSIX.c index 0dd712e..4a5a7f3 100755 --- a/src/aiori-POSIX.c +++ b/src/aiori-POSIX.c @@ -32,11 +32,10 @@ #include -#ifdef HAVE_LUSTRE_LUSTRE_USER_H -# include -#endif #ifdef HAVE_LINUX_LUSTRE_LUSTRE_USER_H # include +#elif defined(HAVE_LUSTRE_LUSTRE_USER_H) +# include #endif #ifdef HAVE_GPFS_H # include @@ -278,6 +277,12 @@ void *POSIX_Create(char *testFileName, IOR_param_t * param) set_o_direct_flag(&fd_oflag); #ifdef HAVE_LUSTRE_LUSTRE_USER_H +/* Add a #define for FASYNC if not available, as it forms part of + * the Lustre O_LOV_DELAY_CREATE definition. */ +#ifndef FASYNC +#define FASYNC 00020000 /* fcntl, for BSD compatibility */ +#endif + if (param->lustre_set_striping) { /* In the single-shared-file case, task 0 has to creat the file with the Lustre striping options before any other processes @@ -298,7 +303,8 @@ void *POSIX_Create(char *testFileName, IOR_param_t * param) opts.lmm_stripe_count = param->lustre_stripe_count; /* File needs to be opened O_EXCL because we cannot set - Lustre striping information on a pre-existing file. */ + * Lustre striping information on a pre-existing file.*/ + fd_oflag |= O_CREAT | O_EXCL | O_RDWR | O_LOV_DELAY_CREATE; *fd = open64(testFileName, fd_oflag, 0664); From aafdf897ff422b3afc3ddfe31b8162ae3e01687e Mon Sep 17 00:00:00 2001 From: "Julian M. Kunkel" Date: Wed, 19 Dec 2018 20:29:47 +0000 Subject: [PATCH 2/6] Bugfix for stonewall computation. --- src/mdtest.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/mdtest.c b/src/mdtest.c index e83121c..3998017 100644 --- a/src/mdtest.c +++ b/src/mdtest.c @@ -320,7 +320,7 @@ static void create_file (const char *path, uint64_t itemNum) { //create files sprintf(curr_item, "%s/file.%s"LLU"", path, mk_name, itemNum); - if (rank == 0 && verbose >= 3) { + if ((rank == 0 && verbose >= 3) || verbose >= 5) { fprintf(out_logfile, "V-3: create_remove_items_helper (non-dirs create): curr_item is \"%s\"\n", curr_item); fflush(out_logfile); } @@ -401,6 +401,10 @@ void create_remove_items_helper(const int dirs, const int create, const char *pa create_remove_dirs (path, create, itemNum + i); } if(CHECK_STONE_WALL(progress)){ + if(progress->items_done != 0){ + printf("Error, this is an invalid configuration with stonewall!\n"); + exit(1); + } progress->items_done = i + 1; return; } @@ -1056,13 +1060,13 @@ int updateStoneWallIterations(int iteration, rank_progress_t * progress, double long long sum_accessed = 0; MPI_Reduce(& progress->items_done, & sum_accessed, 1, MPI_LONG_LONG_INT, MPI_SUM, 0, testComm); - if(items != (sum_accessed / size) && rank == 0){ + if(items != (sum_accessed / size)){ summary_table[iteration].stonewall_item_sum[MDTEST_FILE_CREATE_NUM] = sum_accessed; summary_table[iteration].stonewall_item_min[MDTEST_FILE_CREATE_NUM] = min_accessed * size; - fprintf( out_logfile, "Continue stonewall hit min: %lld max: %lld avg: %.1f \n", min_accessed, max_iter, ((double) sum_accessed) / size); - fflush( out_logfile ); - } - if( done != max_iter ){ + if (rank == 0){ + fprintf( out_logfile, "Continue stonewall hit min: %lld max: %lld avg: %.1f \n", min_accessed, max_iter, ((double) sum_accessed) / size); + fflush( out_logfile ); + } hit = 1; } progress->items_start = done; @@ -1119,10 +1123,13 @@ void file_test(const int iteration, const int ntasks, const char *path, rank_pro if (hit){ progress->stone_wall_timer_seconds = 0; - printf("stonewall rank %d: %lld of %lld \n", rank, (long long) progress->items_start, (long long) progress->items_per_dir); + if (verbose > 1){ + printf("stonewall rank %d: %lld of %lld \n", rank, (long long) progress->items_start, (long long) progress->items_per_dir); + } create_remove_items(0, 0, 1, 0, temp_path, 0, progress); // now reset the values progress->stone_wall_timer_seconds = stone_wall_timer_seconds; + items = progress->items_done; } if (stoneWallingStatusFile){ StoreStoneWallingIterations(stoneWallingStatusFile, progress->items_done); From cb40c99e1baca256b2a445c48fd8bbec8da27586 Mon Sep 17 00:00:00 2001 From: "Julian M. Kunkel" Date: Wed, 19 Dec 2018 21:37:37 +0000 Subject: [PATCH 3/6] Reset stonewall timer to make it work again with running all phases in one execution; i.e. not using multiple runs specifying: -C, -r --- src/mdtest.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/mdtest.c b/src/mdtest.c index 3998017..37032f1 100644 --- a/src/mdtest.c +++ b/src/mdtest.c @@ -300,7 +300,6 @@ static void remove_file (const char *path, uint64_t itemNum) { fprintf(out_logfile, "V-3: create_remove_items_helper (non-dirs remove): curr_item is \"%s\"\n", curr_item); fflush(out_logfile); } - if (!(shared_file && rank != 0)) { backend->delete (curr_item, ¶m); } @@ -401,11 +400,9 @@ void create_remove_items_helper(const int dirs, const int create, const char *pa create_remove_dirs (path, create, itemNum + i); } if(CHECK_STONE_WALL(progress)){ - if(progress->items_done != 0){ - printf("Error, this is an invalid configuration with stonewall!\n"); - exit(1); + if(progress->items_done == 0){ + progress->items_done = i + 1; } - progress->items_done = i + 1; return; } } @@ -1124,7 +1121,7 @@ void file_test(const int iteration, const int ntasks, const char *path, rank_pro if (hit){ progress->stone_wall_timer_seconds = 0; if (verbose > 1){ - printf("stonewall rank %d: %lld of %lld \n", rank, (long long) progress->items_start, (long long) progress->items_per_dir); + printf("stonewall rank %d: %lld of %lld \n", rank, (long long) progress->items_start, (long long) progress->items_per_dir); } create_remove_items(0, 0, 1, 0, temp_path, 0, progress); // now reset the values @@ -1134,6 +1131,8 @@ void file_test(const int iteration, const int ntasks, const char *path, rank_pro if (stoneWallingStatusFile){ StoreStoneWallingIterations(stoneWallingStatusFile, progress->items_done); } + // reset stone wall timer to allow proper cleanup + progress->stone_wall_timer_seconds = 0; } } }else{ @@ -1221,6 +1220,8 @@ void file_test(const int iteration, const int ntasks, const char *path, rank_pro t[3] = MPI_Wtime(); if (remove_only) { + progress->items_start = 0; + for (int dir_iter = 0; dir_iter < directory_loops; dir_iter ++){ prep_testdir(iteration, dir_iter); if (unique_dir_per_task) { @@ -2032,6 +2033,7 @@ static void mdtest_iteration(int i, int j, MPI_Group testgroup, mdtest_results_t MPI_Barrier(testComm); if (remove_only) { + progress->items_start = 0; startCreate = MPI_Wtime(); for (int dir_iter = 0; dir_iter < directory_loops; dir_iter ++){ prep_testdir(j, dir_iter); From b561f60702179cded0cc3787f3687f83d40d51a5 Mon Sep 17 00:00:00 2001 From: "Julian M. Kunkel" Date: Sat, 19 Jan 2019 17:00:49 +0000 Subject: [PATCH 4/6] Potential fix for #127 => Segmentation fault due to memory protection. --- src/mdtest.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mdtest.c b/src/mdtest.c index 37032f1..cf58050 100644 --- a/src/mdtest.c +++ b/src/mdtest.c @@ -211,6 +211,8 @@ void parse_dirpath(char *dirpath_arg) { FAIL("out of memory"); } + // prevent changes to the original dirpath_arg + dirpath_arg = strdup(dirpath_arg); token = strtok(dirpath_arg, delimiter_string); while (token != NULL) { filenames[i] = token; From 8996f5494f3d2417c3d1cfb6d3cb5a32e3603d0a Mon Sep 17 00:00:00 2001 From: "Glenn K. Lockwood" Date: Wed, 23 Jan 2019 16:02:58 -0800 Subject: [PATCH 5/6] add malloc check to fix --- src/mdtest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mdtest.c b/src/mdtest.c index cf58050..20593d9 100644 --- a/src/mdtest.c +++ b/src/mdtest.c @@ -206,13 +206,13 @@ void parse_dirpath(char *dirpath_arg) { } tmp++; } + // prevent changes to the original dirpath_arg + dirpath_arg = strdup(dirpath_arg); filenames = (char **)malloc(path_count * sizeof(char **)); - if (filenames == NULL) { + if (filenames == NULL || dirpath_arg == NULL) { FAIL("out of memory"); } - // prevent changes to the original dirpath_arg - dirpath_arg = strdup(dirpath_arg); token = strtok(dirpath_arg, delimiter_string); while (token != NULL) { filenames[i] = token; From 5271198eb368c850f07470a6a5141085c1303b7b Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Fri, 2 Aug 2019 19:30:29 -0500 Subject: [PATCH 6/6] Travis CI: Fix HDF5 Build Fix the CI. --- .travis.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 29e091c..7d8202d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ install: # Install MPI - sudo apt-get install -y openmpi-bin libopenmpi-dev # Install HDF5 - - sudo apt-get install -y hdf5-tools libhdf5-mpi-dev + - sudo apt-get install -y hdf5-tools libhdf5-openmpi-dev # Install Lustre # TODO: As far as a i can see it needs to be compiled form source with kernel # module as there is no package. @@ -22,10 +22,13 @@ install: # Install HDFS # TODO: Not sure with which c libray hdfs should be used and if it is in # the ubuntu repos - # Probably hadoop needs to be installed an provides nativ api. + # Probably hadoop needs to be installed an provides native API. # Install Amazon S3 # TODO: The needed library needs to be installed. Follow the instructions in # aiori-S3.c to achive this. # GPFS # NOTE: Think GPFS need a license and is therefore not testable with travis. -script: ./travis-build.sh && CONFIGURE_OPTS="--with-hdf5" ./travis-test.sh +script: + - ./travis-build.sh + - export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/hdf5/openmpi:${LD_LIBRARY_PATH} + - CONFIGURE_OPTS="--with-hdf5" CFLAGS="-I/usr/include/hdf5/openmpi -L/usr/lib/x86_64-linux-gnu/hdf5/openmpi" ./travis-test.sh