From: brian Date: Tue, 12 May 2009 15:34:57 +0000 (+0000) Subject: b=17605 X-Git-Tag: v1_8_0_110~18 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=210652c71586ddc0cebd4d74434587bd0e85fc37;p=fs%2Flustre-release.git b=17605 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. --- diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index bff3962..172cf6f 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -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 + ]],[[ + 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 diff --git a/lustre/liblustre/tests/Makefile.am b/lustre/liblustre/tests/Makefile.am index bbc30e8..07726dd 100644 --- a/lustre/liblustre/tests/Makefile.am +++ b/lustre/liblustre/tests/Makefile.am @@ -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 index 0000000..c9fb909 --- /dev/null +++ b/lustre/liblustre/tests/mpi/Makefile.am @@ -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) diff --git a/lustre/liblustre/tests/test_lock_cancel.c b/lustre/liblustre/tests/mpi/test_lock_cancel.c similarity index 99% rename from lustre/liblustre/tests/test_lock_cancel.c rename to lustre/liblustre/tests/mpi/test_lock_cancel.c index 8d0c4a3..338b5e3 100644 --- a/lustre/liblustre/tests/test_lock_cancel.c +++ b/lustre/liblustre/tests/mpi/test_lock_cancel.c @@ -54,7 +54,7 @@ #include #include -#include +#include <../test_common.h> #include diff --git a/lustre/tests/Makefile.am b/lustre/tests/Makefile.am index 3f59d5f..b0815c3 100644 --- a/lustre/tests/Makefile.am +++ b/lustre/tests/Makefile.am @@ -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 index 0000000..805cdd3 --- /dev/null +++ b/lustre/tests/mpi/Makefile.am @@ -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 diff --git a/lustre/tests/createmany-mpi.c b/lustre/tests/mpi/createmany-mpi.c similarity index 100% rename from lustre/tests/createmany-mpi.c rename to lustre/tests/mpi/createmany-mpi.c diff --git a/lustre/tests/lp_utils.c b/lustre/tests/mpi/lp_utils.c similarity index 100% rename from lustre/tests/lp_utils.c rename to lustre/tests/mpi/lp_utils.c diff --git a/lustre/tests/lp_utils.h b/lustre/tests/mpi/lp_utils.h similarity index 100% rename from lustre/tests/lp_utils.h rename to lustre/tests/mpi/lp_utils.h diff --git a/lustre/tests/mdsrate.c b/lustre/tests/mpi/mdsrate.c similarity index 100% rename from lustre/tests/mdsrate.c rename to lustre/tests/mpi/mdsrate.c diff --git a/lustre/tests/parallel_grouplock.c b/lustre/tests/mpi/parallel_grouplock.c similarity index 100% rename from lustre/tests/parallel_grouplock.c rename to lustre/tests/mpi/parallel_grouplock.c diff --git a/lustre/tests/write_append_truncate.c b/lustre/tests/mpi/write_append_truncate.c similarity index 100% rename from lustre/tests/write_append_truncate.c rename to lustre/tests/mpi/write_append_truncate.c diff --git a/lustre/tests/write_disjoint.c b/lustre/tests/mpi/write_disjoint.c similarity index 100% rename from lustre/tests/write_disjoint.c rename to lustre/tests/mpi/write_disjoint.c diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index e5d8a5a..8190428 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -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)