diff --git a/src/aiori-POSIX.c b/src/aiori-POSIX.c index 7ec7662..4c4d7d3 100644 --- a/src/aiori-POSIX.c +++ b/src/aiori-POSIX.c @@ -100,23 +100,8 @@ IOR_Create_POSIX(char * testFileName, fd_oflag |= O_DIRECT; } -#ifndef HAVE_LUSTRE_LUSTRE_USER_H - /* If the lustre striping parameters are not the defaults */ - if (param->lustre_stripe_count != 0 - || param->lustre_stripe_size != 0 - || param->lustre_start_ost != -1 - || param->lustre_ignore_locks) { - ERR("This IOR was not compiled with Lustre support!"); - } - fd_oflag |= O_CREAT | O_RDWR; - *fd = open64(testFileName, fd_oflag, 0664); - if (*fd < 0) ERR("cannot open file"); -#else /* HAVE_LUSTRE_LUSTRE_USER_H */ - /* If the lustre striping parameters are not the defaults */ - if (param->lustre_stripe_count != 0 - || param->lustre_stripe_size != 0 - || param->lustre_start_ost != -1) { - +#ifdef HAVE_LUSTRE_LUSTRE_USER_H + 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 open the file */ @@ -154,9 +139,11 @@ IOR_Create_POSIX(char * testFileName, MPI_CHECK(MPI_Barrier(testComm), "barrier error"); } } else { +#endif /* HAVE_LUSTRE_LUSTRE_USER_H */ fd_oflag |= O_CREAT | O_RDWR; *fd = open64(testFileName, fd_oflag, 0664); if (*fd < 0) ERR("cannot open file"); +#ifdef HAVE_LUSTRE_LUSTRE_USER_H } if (param->lustre_ignore_locks) { @@ -164,7 +151,7 @@ IOR_Create_POSIX(char * testFileName, if (ioctl(*fd, LL_IOC_SETFLAGS, &lustre_ioctl_flags) == -1) ERR("cannot set ioctl"); } -#endif /* not HAVE_LUSTRE_LUSTRE_USER_H */ +#endif /* HAVE_LUSTRE_LUSTRE_USER_H */ return((void *)fd); } /* IOR_Create_POSIX() */ diff --git a/src/aiori.h b/src/aiori.h index 6d5b9ae..1737787 100644 --- a/src/aiori.h +++ b/src/aiori.h @@ -147,6 +147,7 @@ typedef struct int lustre_stripe_count; int lustre_stripe_size; int lustre_start_ost; + int lustre_set_striping; /* flag that we need to set lustre striping */ int lustre_ignore_locks; #if USE_UNDOC_OPT diff --git a/src/defaults.h b/src/defaults.h index c7d6cc0..2596b25 100644 --- a/src/defaults.h +++ b/src/defaults.h @@ -113,6 +113,7 @@ IOR_param_t defaultParameters = { 0, /* lustre_stripe_count */ 0, /* lustre_stripe_size */ -1, /* lustre_start_ost */ + 0, /* lustre_set_striping */ 0, /* lustre_ignore_locks */ #if USE_UNDOC_OPT diff --git a/src/parse_options.c b/src/parse_options.c index d63908c..e7fbdf1 100644 --- a/src/parse_options.c +++ b/src/parse_options.c @@ -160,12 +160,27 @@ void DecodeDirective(char *line, IOR_param_t *test) } else if (strcasecmp(option, "randomoffset") == 0) { test->randomOffset = atoi(value); } else if (strcasecmp(option, "lustrestripecount") == 0) { +#ifndef HAVE_LUSTRE_LUSTRE_USER_H + ERR("ior was not compiled with Lustre support"); +#endif test->lustre_stripe_count = atoi(value); + test->lustre_set_striping = 1; } else if (strcasecmp(option, "lustrestripesize") == 0) { +#ifndef HAVE_LUSTRE_LUSTRE_USER_H + ERR("ior was not compiled with Lustre support"); +#endif test->lustre_stripe_size = StringToBytes(value); + test->lustre_set_striping = 1; } else if (strcasecmp(option, "lustrestartost") == 0) { +#ifndef HAVE_LUSTRE_LUSTRE_USER_H + ERR("ior was not compiled with Lustre support"); +#endif test->lustre_start_ost = atoi(value); + test->lustre_set_striping = 1; } else if (strcasecmp(option, "lustreignorelocks") == 0) { +#ifndef HAVE_LUSTRE_LUSTRE_USER_H + ERR("ior was not compiled with Lustre support"); +#endif test->lustre_ignore_locks = atoi(value); #if USE_UNDOC_OPT } else if (strcasecmp(option, "corruptFile") == 0) {