Whamcloud - gitweb
b=15266,16809
authorgrev <grev>
Thu, 25 Sep 2008 21:15:28 +0000 (21:15 +0000)
committergrev <grev>
Thu, 25 Sep 2008 21:15:28 +0000 (21:15 +0000)
i=Adilger
integrate mdsrate to acc-sm; make mpi tests; build mpitests only if
--disable-mpitests is not set

lustre/autoconf/lustre-core.m4
lustre/liblustre/tests/Makefile.am
lustre/tests/Makefile.am
lustre/tests/createmany-mpi.c
lustre/tests/lp_utils.c
lustre/tests/parallel_grouplock.c

index 512cd40..8ddecff 100644 (file)
@@ -1654,13 +1654,51 @@ if test x$enable_liblustre_acl = xyes ; then
   AC_DEFINE(LIBLUSTRE_POSIX_ACL, 1, Liblustre Support ACL-enabled MDS)
 fi
 
-AC_MSG_CHECKING([whether to build mpitests])
-AC_ARG_ENABLE([mpitests],
-       AC_HELP_STRING([--enable-mpitests],
-                       [build liblustre mpi tests]),
-       [],[enable_mpitests=no])
+#
+# --enable-mpitest
+#
+AC_ARG_ENABLE(mpitests,
+       AC_HELP_STRING([--enable-mpitest=yes|no|mpich directory],
+                           [include mpi tests]),
+       [
+        enable_mpitests=yes
+         case $enableval in
+         yes)
+               MPI_ROOT=/opt/mpich
+               LDFLAGS="$LDFLAGS -L$MPI_ROOT/ch-p4/lib -L$MPI_ROOT/ch-p4/lib64"
+               CFLAGS="$CFLAGS -I$MPI_ROOT/include"
+               ;;
+         no)
+               enable_mpitests=no
+               ;;
+        [[\\/$]]* | ?:[[\\/]]* )
+               MPI_ROOT=$enableval
+               LDFLAGS="$LDFLAGS -L$with_mpi/lib"
+               CFLAGS="$CFLAGS -I$MPI_ROOT/include"
+                ;;
+         *)
+                 AC_MSG_ERROR([expected absolute directory name for --enable-mpitests or yes or no])
+                 ;;
+        esac
+       ],
+       [
+       MPI_ROOT=/opt/mpich
+        LDFLAGS="$LDFLAGS -L$MPI_ROOT/ch-p4/lib -L$MPI_ROOT/ch-p4/lib64"
+        CFLAGS="$CFLAGS -I$MPI_ROOT/include"
+       enable_mpitests=yes
+       ]
+)
+AC_SUBST(MPI_ROOT)
+
+if test x$enable_mpitests != xno; then
+       AC_MSG_CHECKING([whether to mpitests can be built])
+        AC_CHECK_FILE([$MPI_ROOT/include/mpi.h],
+                      [AC_CHECK_LIB([mpich],[MPI_Start],[enable_mpitests=yes],[enable_mpitests=no])],
+                      [enable_mpitests=no])
+fi
 AC_MSG_RESULT([$enable_mpitests])
 
+
 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
 
index 08bd86b..bbc30e8 100644 (file)
@@ -52,7 +52,8 @@ replay_ost_single_DEPENDENCIES = $(top_builddir)/lustre/liblustre/liblustre.a li
 if MPITESTS
 test_lock_cancel_SOURCES = test_lock_cancel.c
 test_lock_cancel_CFLAGS = $(LL_CFLAGS) -I/opt/lam/include
-test_lock_cancel_LDADD :=  $(LLIB_EXEC)  -L/opt/lam/lib -lmpi -llam
+#test_lock_cancel_LDADD :=  $(LLIB_EXEC)  -L/opt/lam/lib -lmpi -llam
+test_lock_cancel_LDADD :=  $(LLIB_EXEC)  -lmpich
 endif
 
 
index 701847a..e9ebe9f 100644 (file)
@@ -40,8 +40,7 @@ noinst_PROGRAMS += openfilleddirunlink rename_many memhog iopentest1 iopentest2
 noinst_PROGRAMS += mmap_sanity flock_test writemany reads flocks_test
 noinst_PROGRAMS += ll_getstripe_info write_time_limit
 if MPITESTS
-noinst_PROGRAMS += parallel_grouplock write_append_truncate createmany_mpi
-noinst_PROGRAMS += iam_ut
+noinst_PROGRAMS += parallel_grouplock write_append_truncate createmany_mpi mdsrate
 endif
 # noinst_PROGRAMS += ldaptest copy_attr mkdirdeep 
 bin_PROGRAMS = mcreate munlink
@@ -66,13 +65,16 @@ flocks_test_SOURCES=flocks_test.c
 flocks_test_LDADD=-lpthread
 
 if MPITESTS
-LAM_LD_FLAGS=-L/opt/lam/lib -lmpi -llam -lpthread
+#LAM_LD_FLAGS=-L/opt/lam/lib -lmpi -llam -lpthread
+LAM_LD_FLAGS=-lmpich -lpthread
 write_append_truncate_SOURCES=write_append_truncate.c
 write_append_truncate_LDADD=$(LAM_LD_FLAGS)
 createmany_mpi_SOURCES=createmany-mpi.c
 createmany_mpi_LDADD=$(LAM_LD_FLAGS)
-parallel_grouplock_SOURCES=parallel_grouplock.c lp_utils.c
+parallel_grouplock_SOURCES=parallel_grouplock.c lp_utils.c lp_utils.h
 parallel_grouplock_LDADD=$(LAM_LD_FLAGS)
+mdsrate_SOURCES=mdsrate.c
+mdsrate_LDADD=$(LAM_LD_FLAGS) -L$(top_builddir)/lustre/utils -llustreapi
 endif
 
 #copy_attr_LDADD= -lattr
index 99b3493..d203fa6 100644 (file)
@@ -72,7 +72,7 @@ int rprintf(int rank, int loop, const char *fmt, ...)
 int main(int argc, char ** argv)
 {
         int i, rc = 0, do_open = 0, do_link = 0, rank;
-        char format[4096], *fmt, *tgt;
+        char format[4096], *fmt, *tgt = NULL;
         char filename[4096];
         long start, last, end;
         long begin = 0, count;
@@ -87,8 +87,8 @@ int main(int argc, char ** argv)
         }
 
         if (strcmp(argv[1], "-o") == 0) {
-                tgt = NULL;
                 do_open = 1;
+                tgt = NULL;
         } else if (strncmp(argv[1], "-l", 2) == 0 && argv[1][2]) {
                 tgt = argv[1] + 2;
                 do_link = 1;
index 4f0e43d..4a47ca2 100644 (file)
@@ -49,8 +49,9 @@
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <errno.h>
+#include <liblustre.h>
 #include "lustre/lustre_user.h"
-#include "lp_utils.h"
+#include "lustre/tests/lp_utils.h"
 
 #define MAX_PROCESSES 8
 
index 44f99d9..4331354 100644 (file)
@@ -49,8 +49,9 @@
 #include <unistd.h>
 #include <time.h>
 #include <errno.h>
+#include <liblustre.h>
 #include <lustre/lustre_user.h>
-#include "lp_utils.h"
+#include <lustre/tests/lp_utils.h>
 
 #define LPGL_FILEN 700000
 #define LPGL_TEST_ITEMS 7