Whamcloud - gitweb
b=17605
authorbrian <brian>
Mon, 11 May 2009 20:04:59 +0000 (20:04 +0000)
committerbrian <brian>
Mon, 11 May 2009 20:04:59 +0000 (20:04 +0000)
i=rread
i=grev

Use the mpicc wrapper for building MPI programs rather than trying to
discover all the bits and pieces of the installed MPI library.

Due to the way the autotools work, this requires putting the sources
into their own subdir, so that the CC command can be overridden.

Fix the pointers to in-tree MPI programs in test-framework.sh.

14 files changed:
lustre/autoconf/lustre-core.m4
lustre/liblustre/tests/Makefile.am
lustre/liblustre/tests/mpi/Makefile.am [new file with mode: 0644]
lustre/liblustre/tests/mpi/test_lock_cancel.c [moved from lustre/liblustre/tests/test_lock_cancel.c with 100% similarity]
lustre/tests/Makefile.am
lustre/tests/mpi/Makefile.am [new file with mode: 0644]
lustre/tests/mpi/createmany-mpi.c [moved from lustre/tests/createmany-mpi.c with 100% similarity]
lustre/tests/mpi/lp_utils.c [moved from lustre/tests/lp_utils.c with 100% similarity]
lustre/tests/mpi/lp_utils.h [moved from lustre/tests/lp_utils.h with 100% similarity]
lustre/tests/mpi/mdsrate.c [moved from lustre/tests/mdsrate.c with 100% similarity]
lustre/tests/mpi/parallel_grouplock.c [moved from lustre/tests/parallel_grouplock.c with 100% similarity]
lustre/tests/mpi/write_append_truncate.c [moved from lustre/tests/write_append_truncate.c with 100% similarity]
lustre/tests/mpi/write_disjoint.c [moved from lustre/tests/write_disjoint.c with 100% similarity]
lustre/tests/test-framework.sh

index bff3962..172cf6f 100644 (file)
@@ -1796,46 +1796,48 @@ fi
 # --enable-mpitest
 #
 AC_ARG_ENABLE(mpitests,
-       AC_HELP_STRING([--enable-mpitest=yes|no|mpich directory],
+       AC_HELP_STRING([--enable-mpitests=yes|no|mpicc wrapper],
                            [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"
+               MPICC_WRAPPER=mpicc
                ;;
          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])
+               MPICC_WRAPPER=$enableval
                  ;;
         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"
+       MPICC_WRAPPER=mpicc
        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])
+       AC_MSG_CHECKING([whether mpitests can be built])
+       oldcc=$CC
+       CC=$MPICC_WRAPPER
+       AC_LINK_IFELSE(
+           [AC_LANG_PROGRAM([[
+                   #include <mpi.h>
+               ]],[[
+                   int flag;
+                   MPI_Initialized(&flag);
+               ]])],
+           [
+                   AC_MSG_RESULT([yes])
+           ],[
+                   AC_MSG_RESULT([no])
+                   enable_mpitests=no
+       ])
+       CC=$oldcc
 fi
-AC_MSG_RESULT([$enable_mpitests])
-
+AC_SUBST(MPICC_WRAPPER)
 
 AC_MSG_NOTICE([Enabling Lustre configure options for libsysio])
 ac_configure_args="$ac_configure_args --with-lustre-hack --with-sockets"
@@ -2175,6 +2177,7 @@ lustre/kernel_patches/targets/sles-2.4.target
 lustre/ldlm/Makefile
 lustre/liblustre/Makefile
 lustre/liblustre/tests/Makefile
+lustre/liblustre/tests/mpi/Makefile
 lustre/llite/Makefile
 lustre/llite/autoMakefile
 lustre/lov/Makefile
@@ -2207,6 +2210,7 @@ lustre/quota/autoMakefile
 lustre/scripts/Makefile
 lustre/scripts/version_tag.pl
 lustre/tests/Makefile
+lustre/tests/mpi/Makefile
 lustre/utils/Makefile
 ])
 case $lb_target_os in
index bbc30e8..07726dd 100644 (file)
@@ -10,16 +10,16 @@ if LIBLUSTRE
 noinst_LIBRARIES = libtestcommon.a
 
 if LIBLUSTRE_TESTS
+if MPITESTS
+SUBDIRS = mpi
+endif # MPITESTS
+
 noinst_PROGRAMS = sanity
 
 if !CRAY_XT3
 noinst_PROGRAMS += recovery_small replay_single replay_ost_single
 endif # !CRAY_XT3
 
-if MPITESTS
-noinst_PROGRAMS += test_lock_cancel
-endif # MPITESTS
-
 liblustre_testdir=$(libdir)/lustre/liblustre/tests
 liblustre_test_PROGRAMS = $(noinst_PROGRAMS)
 liblustre_test_LIBRARIES = $(noinst_LIBRARIES)
@@ -27,6 +27,8 @@ liblustre_test_LIBRARIES = $(noinst_LIBRARIES)
 endif # LIBLUSTRE_TESTS
 endif # LIBLUSTRE
 
+DIST_SUBDIRS := mpi
+
 libtestcommon_a_SOURCES = test_common.c test_common.h
 
 sanity_SOURCES = sanity.c
@@ -48,12 +50,3 @@ replay_ost_single_SOURCES = replay_ost_single.c
 replay_ost_single_CFLAGS = $(LL_CFLAGS)
 replay_ost_single_LDADD := libtestcommon.a $(LLIB_EXEC)
 replay_ost_single_DEPENDENCIES = $(top_builddir)/lustre/liblustre/liblustre.a libtestcommon.a
-
-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)  -lmpich
-endif
-
-
diff --git a/lustre/liblustre/tests/mpi/Makefile.am b/lustre/liblustre/tests/mpi/Makefile.am
new file mode 100644 (file)
index 0000000..c9fb909
--- /dev/null
@@ -0,0 +1,17 @@
+## Liblustre MPI tests Makefile
+
+AM_CPPFLAGS = -I$(SYSIO)/include $(LLCPPFLAGS) -I$(top_srcdir)/lnet/ulnds
+AM_CFLAGS = $(LLCFLAGS)
+
+LLIB_EXEC = $(top_builddir)/lustre/utils/liblustreapi.a $(top_builddir)/lustre/liblustre/liblustre.a $(CAP_LIBS) $(PTHREAD_LIBS) $(ZLIB)
+
+CC = @MPICC_WRAPPER@
+
+if LIBLUSTRE
+if LIBLUSTRE_TESTS
+noinst_PROGRAMS = test_lock_cancel
+endif # LIBLUSTRE_TESTS
+endif # LIBLUSTRE
+
+test_lock_cancel_SOURCES = test_lock_cancel.c
+test_lock_cancel_LDADD :=  $(LLIB_EXEC)
index 3f59d5f..b0815c3 100644 (file)
@@ -4,6 +4,8 @@ AM_CFLAGS = $(LLCFLAGS)
 # LDADD = -lldap
 # LDADD := -lreadline -ltermcap # -lefence
 
+DIST_SUBDIRS := mpi
+
 noinst_DATA = disk1_4.zip
 noinst_SCRIPTS = leak_finder.pl llmount.sh llmountcleanup.sh functions.sh
 noinst_SCRIPTS += test-framework.sh runvmstat runiozone runtests
@@ -31,6 +33,9 @@ EXTRA_DIST = $(noinst_SCRIPTS) $(noinst_DATA) \
              $(nobase_noinst_SCRIPTS) $(nobase_noinst_DATA)
 
 if TESTS
+if MPITESTS
+SUBDIRS = mpi
+endif
 noinst_PROGRAMS = openunlink truncate directio writeme mlink utime it_test
 noinst_PROGRAMS += tchmod fsx test_brw 
 noinst_PROGRAMS += createmany chownmany statmany multifstat createtest
@@ -41,9 +46,6 @@ noinst_PROGRAMS += ll_sparseness_write mrename ll_dirstripe_verify mkdirmany
 noinst_PROGRAMS += openfilleddirunlink rename_many memhog iopentest1 iopentest2
 noinst_PROGRAMS += mmap_sanity flock_test writemany reads flocks_test
 noinst_PROGRAMS += ll_getstripe_info
-if MPITESTS
-noinst_PROGRAMS += parallel_grouplock write_append_truncate createmany_mpi mdsrate
-endif
 # noinst_PROGRAMS += copy_attr mkdirdeep 
 bin_PROGRAMS = mcreate munlink
 testdir = $(libdir)/lustre/tests
@@ -66,17 +68,4 @@ ll_dirstripe_verify_LDADD= -L$(top_builddir)/lustre/utils -llustreapi
 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=-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 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
diff --git a/lustre/tests/mpi/Makefile.am b/lustre/tests/mpi/Makefile.am
new file mode 100644 (file)
index 0000000..805cdd3
--- /dev/null
@@ -0,0 +1,15 @@
+# Lustre MPI test Makefile
+AM_CPPFLAGS = $(LLCPPFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DLUSTRE_UTILS
+AM_CFLAGS = $(LLCFLAGS)
+
+CC = @MPICC_WRAPPER@
+
+noinst_PROGRAMS = parallel_grouplock write_append_truncate createmany_mpi mdsrate
+testdir = $(libdir)/lustre/tests
+test_SCRIPTS = $(noinst_PROGRAMS)
+
+write_append_truncate_SOURCES=write_append_truncate.c
+createmany_mpi_SOURCES=createmany-mpi.c
+parallel_grouplock_SOURCES=parallel_grouplock.c lp_utils.c lp_utils.h
+mdsrate_SOURCES=mdsrate.c
+mdsrate_LDADD=-L$(top_builddir)/lustre/utils -llustreapi
index e5d8a5a..8190428 100644 (file)
@@ -90,11 +90,14 @@ init_test_env() {
     if ! echo $PATH | grep -q $LUSTRE/test; then
        export PATH=$PATH:$LUSTRE/tests
     fi
-    export MDSRATE=${MDSRATE:-"$LUSTRE/tests/mdsrate"}
+    export MDSRATE=${MDSRATE:-"$LUSTRE/tests/mpi/mdsrate"}
     [ ! -f "$MDSRATE" ] && export MDSRATE=$(which mdsrate 2> /dev/null)
     if ! echo $PATH | grep -q $LUSTRE/tests/racer; then
         export PATH=$PATH:$LUSTRE/tests/racer
     fi
+    if ! echo $PATH | grep -q $LUSTRE/tests/mpi; then
+        export PATH=$PATH:$LUSTRE/tests/mpi
+    fi
     export LCTL=${LCTL:-"$LUSTRE/utils/lctl"}
     export LFS=${LFS:-"$LUSTRE/utils/lfs"}
     [ ! -f "$LCTL" ] && export LCTL=$(which lctl)