Use autoconf to check for lustre
parent
29457fac9f
commit
3b250633cc
13
configure.ac
13
configure.ac
|
@ -33,6 +33,19 @@ AC_SEARCH_LIBS([sqrt], [m], [],
|
||||||
# Check for system capabilities
|
# Check for system capabilities
|
||||||
AC_SYS_LARGEFILE
|
AC_SYS_LARGEFILE
|
||||||
|
|
||||||
|
# Check for lustre availability
|
||||||
|
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], [
|
||||||
|
AC_CHECK_HEADERS([lustre/lustre_user.h], [], [
|
||||||
|
if test "x$with_lustre" != xcheck; then
|
||||||
|
AC_MSG_FAILURE([--with-lustre was given, <lustre/lustre_user.h> not found])
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
# POSIX IO support
|
# POSIX IO support
|
||||||
AC_ARG_WITH([posix],
|
AC_ARG_WITH([posix],
|
||||||
[AS_HELP_STRING([--with-posix],
|
[AS_HELP_STRING([--with-posix],
|
||||||
|
|
|
@ -21,9 +21,9 @@
|
||||||
#include <stdio.h> /* only for fprintf() */
|
#include <stdio.h> /* only for fprintf() */
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#ifdef _MANUALLY_SET_LUSTRE_STRIPING
|
#ifdef HAVE_LUSTRE_LUSTRE_USER_H
|
||||||
# include <lustre/lustre_user.h>
|
# include <lustre/lustre_user.h>
|
||||||
#endif /* _MANUALLY_SET_LUSTRE_STRIPING */
|
#endif /* HAVE_LUSTRE_LUSTRE_USER_H */
|
||||||
|
|
||||||
#ifndef open64 /* necessary for TRU64 -- */
|
#ifndef open64 /* necessary for TRU64 -- */
|
||||||
# define open64 open /* unlikely, but may pose */
|
# define open64 open /* unlikely, but may pose */
|
||||||
|
@ -100,7 +100,7 @@ IOR_Create_POSIX(char * testFileName,
|
||||||
fd_oflag |= O_DIRECT;
|
fd_oflag |= O_DIRECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _MANUALLY_SET_LUSTRE_STRIPING
|
#ifndef HAVE_LUSTRE_LUSTRE_USER_H
|
||||||
/* If the lustre striping parameters are not the defaults */
|
/* If the lustre striping parameters are not the defaults */
|
||||||
if (param->lustre_stripe_count != 0
|
if (param->lustre_stripe_count != 0
|
||||||
|| param->lustre_stripe_size != 0
|
|| param->lustre_stripe_size != 0
|
||||||
|
@ -111,7 +111,7 @@ IOR_Create_POSIX(char * testFileName,
|
||||||
fd_oflag |= O_CREAT | O_RDWR;
|
fd_oflag |= O_CREAT | O_RDWR;
|
||||||
*fd = open64(testFileName, fd_oflag, 0664);
|
*fd = open64(testFileName, fd_oflag, 0664);
|
||||||
if (*fd < 0) ERR("cannot open file");
|
if (*fd < 0) ERR("cannot open file");
|
||||||
#else /* _MANUALLY_SET_LUSTRE_STRIPING */
|
#else /* HAVE_LUSTRE_LUSTRE_USER_H */
|
||||||
/* If the lustre striping parameters are not the defaults */
|
/* If the lustre striping parameters are not the defaults */
|
||||||
if (param->lustre_stripe_count != 0
|
if (param->lustre_stripe_count != 0
|
||||||
|| param->lustre_stripe_size != 0
|
|| param->lustre_stripe_size != 0
|
||||||
|
@ -164,7 +164,7 @@ IOR_Create_POSIX(char * testFileName,
|
||||||
if (ioctl(*fd, LL_IOC_SETFLAGS, &lustre_ioctl_flags) == -1)
|
if (ioctl(*fd, LL_IOC_SETFLAGS, &lustre_ioctl_flags) == -1)
|
||||||
ERR("cannot set ioctl");
|
ERR("cannot set ioctl");
|
||||||
}
|
}
|
||||||
#endif /* not _MANUALLY_SET_LUSTRE_STRIPING */
|
#endif /* not HAVE_LUSTRE_LUSTRE_USER_H */
|
||||||
|
|
||||||
return((void *)fd);
|
return((void *)fd);
|
||||||
} /* IOR_Create_POSIX() */
|
} /* IOR_Create_POSIX() */
|
||||||
|
@ -203,7 +203,7 @@ IOR_Open_POSIX(char * testFileName,
|
||||||
*fd = open64(testFileName, fd_oflag);
|
*fd = open64(testFileName, fd_oflag);
|
||||||
if (*fd < 0) ERR("cannot open file");
|
if (*fd < 0) ERR("cannot open file");
|
||||||
|
|
||||||
#ifdef _MANUALLY_SET_LUSTRE_STRIPING
|
#ifdef HAVE_LUSTRE_LUSTRE_USER_H
|
||||||
if (param->lustre_ignore_locks) {
|
if (param->lustre_ignore_locks) {
|
||||||
int lustre_ioctl_flags = LL_FILE_IGNORE_LOCK;
|
int lustre_ioctl_flags = LL_FILE_IGNORE_LOCK;
|
||||||
if (verbose >= VERBOSE_1) {
|
if (verbose >= VERBOSE_1) {
|
||||||
|
@ -212,7 +212,7 @@ IOR_Open_POSIX(char * testFileName,
|
||||||
if (ioctl(*fd, LL_IOC_SETFLAGS, &lustre_ioctl_flags) == -1)
|
if (ioctl(*fd, LL_IOC_SETFLAGS, &lustre_ioctl_flags) == -1)
|
||||||
ERR("cannot set ioctl");
|
ERR("cannot set ioctl");
|
||||||
}
|
}
|
||||||
#endif /* _MANUALLY_SET_LUSTRE_STRIPING */
|
#endif /* HAVE_LUSTRE_LUSTRE_USER_H */
|
||||||
|
|
||||||
return((void *)fd);
|
return((void *)fd);
|
||||||
} /* IOR_Open_POSIX() */
|
} /* IOR_Open_POSIX() */
|
||||||
|
|
|
@ -1534,7 +1534,7 @@ ShowSetup(IOR_param_t * test)
|
||||||
HumanReadable(test->blockSize, BASE_TWO));
|
HumanReadable(test->blockSize, BASE_TWO));
|
||||||
fprintf(stdout, "\taggregate filesize = %s\n",
|
fprintf(stdout, "\taggregate filesize = %s\n",
|
||||||
HumanReadable(aggFileSizeForBW, BASE_TWO));
|
HumanReadable(aggFileSizeForBW, BASE_TWO));
|
||||||
#ifdef _MANUALLY_SET_LUSTRE_STRIPING
|
#ifdef HAVE_LUSTRE_LUSTRE_USER_H
|
||||||
fprintf(stdout, "\tLustre stripe size = %s\n",
|
fprintf(stdout, "\tLustre stripe size = %s\n",
|
||||||
((test->lustre_stripe_size == 0) ? "Use default" :
|
((test->lustre_stripe_size == 0) ? "Use default" :
|
||||||
HumanReadable(test->lustre_stripe_size, BASE_TWO)));
|
HumanReadable(test->lustre_stripe_size, BASE_TWO)));
|
||||||
|
@ -1544,7 +1544,7 @@ ShowSetup(IOR_param_t * test)
|
||||||
fprintf(stdout, "\t stripe count = %d\n",
|
fprintf(stdout, "\t stripe count = %d\n",
|
||||||
test->lustre_stripe_count);
|
test->lustre_stripe_count);
|
||||||
}
|
}
|
||||||
#endif /* _MANUALLY_SET_LUSTRE_STRIPING */
|
#endif /* HAVE_LUSTRE_LUSTRE_USER_H */
|
||||||
if (test->deadlineForStonewalling > 0) {
|
if (test->deadlineForStonewalling > 0) {
|
||||||
fprintf(stdout, "\tUsing stonewalling = %d second(s)\n",
|
fprintf(stdout, "\tUsing stonewalling = %d second(s)\n",
|
||||||
test->deadlineForStonewalling);
|
test->deadlineForStonewalling);
|
||||||
|
|
Loading…
Reference in New Issue