diff --git a/.gitignore b/.gitignore index eb59cf7..5a61c7f 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ src/Makefile.in src/config.h src/config.h.in src/stamp-h1 +*[-.]mod *~ NOTES.txt autom4te.cache diff --git a/configure.ac b/configure.ac index 134fc2e..09c85e7 100755 --- a/configure.ac +++ b/configure.ac @@ -83,7 +83,7 @@ AC_ARG_WITH([lustre], [AS_HELP_STRING([--with-lustre], [support configurable Lustre striping values @<:@default=check@:>@])], [], [with_lustre=check]) -AS_IF([test "x$with_lustre" != xno], [ +AS_IF([test "x$with_lustre" = xyes ], [ AC_CHECK_HEADERS([linux/lustre/lustre_user.h lustre/lustre_user.h], break, [ if test "x$with_lustre" != xcheck -a \ "x$ac_cv_header_linux_lustre_lustre_user_h" = "xno" -a \ @@ -91,6 +91,18 @@ AS_IF([test "x$with_lustre" != xno], [ AC_MSG_FAILURE([--with-lustre was given, not found]) fi ]) + AC_CHECK_HEADERS([linux/lustre/lustreapi.h lustre/lustreapi.h], + [AC_DEFINE([HAVE_LUSTRE_LUSTREAPI], [], [Lustre user API available in some shape or form])], [ + if test "x$with_lustre" != xcheck -a \ + "x$ac_cv_header_linux_lustre_lustreapi_h" = "xno" -a \ + "x$ac_cv_header_lustre_lustreapi_h" = "xno" ; then + AC_MSG_FAILURE([--with-lustre was given, not found]) + fi + ]) +]) +AM_CONDITIONAL([WITH_LUSTRE], [test x$with_lustre = xyes]) +AM_COND_IF([WITH_LUSTRE],[ + AC_DEFINE([WITH_LUSTRE], [], [Build wth LUSTRE backend]) ]) # IME (DDN's Infinite Memory Engine) support @@ -203,23 +215,22 @@ AM_COND_IF([USE_RADOS_AIORI],[ AC_ARG_WITH([cart], [AS_HELP_STRING([--with-cart], [support IO with DAOS backends @<:@default=no@:>@])], - [], - [with_daos=no]) + [], [with_daos=no]) -AS_IF([test "x$with_cart" != xno], +AS_IF([test "x$with_cart" != xno], [ CART="yes" LDFLAGS="$LDFLAGS -L$with_cart/lib" CPPFLAGS="$CPPFLAGS -I$with_cart/include/" AC_CHECK_HEADERS(gurt/common.h,, [unset CART]) - AC_CHECK_LIB([gurt], [d_hash_murmur64],, [unset CART])) + AC_CHECK_LIB([gurt], [d_hash_murmur64],, [unset CART]) +]) AC_ARG_WITH([daos], [AS_HELP_STRING([--with-daos], [support IO with DAOS backends @<:@default=no@:>@])], - [], - [with_daos=no]) + [], [with_daos=no]) -AS_IF([test "x$with_daos" != xno], +AS_IF([test "x$with_daos" != xno], [ DAOS="yes" LDFLAGS="$LDFLAGS -L$with_daos/lib" CPPFLAGS="$CPPFLAGS -I$with_daos/include" @@ -227,7 +238,8 @@ AS_IF([test "x$with_daos" != xno], AC_CHECK_LIB([uuid], [uuid_generate],, [unset DAOS]) AC_CHECK_LIB([daos_common], [daos_sgl_init],, [unset DAOS]) AC_CHECK_LIB([daos], [daos_init],, [unset DAOS]) - AC_CHECK_LIB([dfs], [dfs_mkdir],, [unset DAOS])) + AC_CHECK_LIB([dfs], [dfs_mkdir],, [unset DAOS]) +]) AM_CONDITIONAL([USE_DAOS_AIORI], [test x$DAOS = xyes]) AM_COND_IF([USE_DAOS_AIORI],[ diff --git a/doc/mdtest.1 b/doc/mdtest.1 index ba82d88..3cfc082 100644 --- a/doc/mdtest.1 +++ b/doc/mdtest.1 @@ -47,6 +47,9 @@ The first number of tasks on which the test will run .I "-F" Perform test on files only (no directories). .TP +.I "-g" +Use global default directory layout for test subdirectories (deletes inherited striping layout - Lustre only). +.TP .I "-h" Display help message. .TP diff --git a/src/Makefile.am b/src/Makefile.am index c4cd099..11aaeab 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -96,6 +96,10 @@ extraLDADD += -laws4c extraLDADD += -laws4c_extra endif +if WITH_LUSTRE +extraLDADD += -llustreapi +endif + ior_SOURCES += $(extraSOURCES) ior_LDFLAGS += $(extraLDFLAGS) ior_LDADD += $(extraLDADD) diff --git a/src/aiori-DFS.c b/src/aiori-DFS.c index eb15b2a..6b2f28c 100755 --- a/src/aiori-DFS.c +++ b/src/aiori-DFS.c @@ -601,14 +601,14 @@ DFS_Xfer(int access, void *file, IOR_size_t *buffer, IOR_offset_t length, /* write/read file */ if (access == WRITE) { - rc = dfs_write(dfs, obj, sgl, param->offset); + rc = dfs_write(dfs, obj, &sgl, param->offset, NULL); if (rc) { fprintf(stderr, "dfs_write() failed (%d)", rc); return -1; } ret = remaining; } else { - rc = dfs_read(dfs, obj, sgl, param->offset, &ret); + rc = dfs_read(dfs, obj, &sgl, param->offset, &ret, NULL); if (rc || ret == 0) fprintf(stderr, "dfs_read() failed(%d)", rc); } diff --git a/src/mdtest.c b/src/mdtest.c index eb7ee0f..fe9c153 100644 --- a/src/mdtest.c +++ b/src/mdtest.c @@ -76,6 +76,10 @@ #include +#ifdef HAVE_LUSTRE_LUSTREAPI +#include +#endif /* HAVE_LUSTRE_LUSTREAPI */ + #define FILEMODE S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH #define DIRMODE S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IXOTH #define RELEASE_VERS META_VERSION @@ -152,6 +156,9 @@ static int call_sync; static int path_count; static int nstride; /* neighbor stride */ static int make_node = 0; +#ifdef HAVE_LUSTRE_LUSTREAPI +static int global_dir_layout; +#endif /* HAVE_LUSTRE_LUSTREAPI */ static mdtest_results_t * summary_table; static pid_t pid; @@ -1575,6 +1582,15 @@ void create_remove_directory_tree(int create, if (-1 == backend->mkdir (dir, DIRMODE, ¶m)) { fprintf(out_logfile, "error could not create directory '%s'\n", dir); } +#ifdef HAVE_LUSTRE_LUSTREAPI + /* internal node for branching, can be non-striped for children */ + if (global_dir_layout && \ + llapi_dir_set_default_lmv_stripe(dir, -1, 0, + LMV_HASH_TYPE_FNV_1A_64, + NULL) == -1) { + FAIL("Unable to reset to global default directory layout"); + } +#endif /* HAVE_LUSTRE_LUSTREAPI */ } create_remove_directory_tree(create, ++currDepth, dir, ++dirNum, progress); @@ -1641,6 +1657,12 @@ static void mdtest_iteration(int i, int j, MPI_Group testgroup, mdtest_results_t if (backend->mkdir(testdir, DIRMODE, ¶m) != 0) { FAIL("Unable to create test directory %s", testdir); } +#ifdef HAVE_LUSTRE_LUSTREAPI + /* internal node for branching, can be non-striped for children */ + if (global_dir_layout && unique_dir_per_task && llapi_dir_set_default_lmv_stripe(testdir, -1, 0, LMV_HASH_TYPE_FNV_1A_64, NULL) == -1) { + FAIL("Unable to reset to global default directory layout"); + } +#endif /* HAVE_LUSTRE_LUSTREAPI */ } } @@ -1859,6 +1881,9 @@ void mdtest_init_args(){ path_count = 0; nstride = 0; make_node = 0; +#ifdef HAVE_LUSTRE_LUSTREAPI + global_dir_layout = 0; +#endif /* HAVE_LUSTRE_LUSTREAPI */ } mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE * world_out) { @@ -1906,6 +1931,9 @@ mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE * {'e', NULL, "bytes to read from each file", OPTION_OPTIONAL_ARGUMENT, 'l', & read_bytes}, {'f', NULL, "first number of tasks on which the test will run", OPTION_OPTIONAL_ARGUMENT, 'd', & first}, {'F', NULL, "perform test on files only (no directories)", OPTION_FLAG, 'd', & files_only}, +#ifdef HAVE_LUSTRE_LUSTREAPI + {'g', NULL, "global default directory layout for test subdirectories (deletes inherited striping layout)", OPTION_FLAG, 'd', & global_dir_layout}, +#endif /* HAVE_LUSTRE_LUSTREAPI */ {'i', NULL, "number of iterations the test will run", OPTION_OPTIONAL_ARGUMENT, 'd', & iterations}, {'I', NULL, "number of items per directory in tree", OPTION_OPTIONAL_ARGUMENT, 'l', & items_per_dir}, {'k', NULL, "use mknod to create file", OPTION_FLAG, 'd', & make_node}, @@ -1999,6 +2027,9 @@ mdtest_results_t * mdtest_run(int argc, char **argv, MPI_Comm world_com, FILE * VERBOSE(1,-1, "read_only : %s", ( read_only ? "True" : "False" )); VERBOSE(1,-1, "first : %d", first ); VERBOSE(1,-1, "files_only : %s", ( files_only ? "True" : "False" )); +#ifdef HAVE_LUSTRE_LUSTREAPI + VERBOSE(1,-1, "global_dir_layout : %s", ( global_dir_layout ? "True" : "False" )); +#endif /* HAVE_LUSTRE_LUSTREAPI */ VERBOSE(1,-1, "iterations : %d", iterations ); VERBOSE(1,-1, "items_per_dir : "LLU"", items_per_dir ); VERBOSE(1,-1, "last : %d", last );