From 64f6840433fa4209157e83c56506ea385cfaed8e Mon Sep 17 00:00:00 2001 From: gerber Date: Thu, 25 Sep 2008 13:32:22 +0000 Subject: [PATCH] Adapted for use on cluster (using MPI/OMP) parallelised gpiv_rr from gpivtools) --- ChangeLog | 6 +- Makefile.in | 15 ++- aclocal.m4 | 56 ++-------- configure | 277 +++++++++++++++++++++++++++++++++++++++------- configure.in | 29 +++++ doc/C/Makefile.in | 1 + doc/C/figures/Makefile.in | 1 + doc/Makefile.in | 1 + man/Makefile.in | 1 + po/Makefile.in.in | 5 +- src/Makefile.am | 2 + src/Makefile.in | 4 +- src/gpiv_gui.h | 9 +- src/piveval_interrogate.c | 139 +++++++++++++++++++++-- 14 files changed, 435 insertions(+), 111 deletions(-) diff --git a/ChangeLog b/ChangeLog index b0b878a..3c52b01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ +2008-25-9 Gerber Van der Graaf + * Adapted for use on cluster using (MPI/OMP) parallelised gpiv_rr + from gpivtools. + 2008-6-5 Gerber Van der Graaf - .h5 and .H5 extension for hdf files (previously .gpi) + * .h5 and .H5 extension for hdf files (previously .gpi) 2008-7-4 Gerber Van der Graaf * Adapted to changes in __GpivPivPar and Interrogate tabulator of console diff --git a/Makefile.in b/Makefile.in index 6def08f..be99dbf 100644 --- a/Makefile.in +++ b/Makefile.in @@ -35,10 +35,10 @@ PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(top_srcdir)/configure ABOUT-NLS \ - AUTHORS COPYING ChangeLog INSTALL NEWS acconfig.h config.guess \ - config.rpath config.sub depcomp install-sh missing \ - mkinstalldirs + $(srcdir)/Makefile.in $(top_srcdir)/configure \ + $(top_srcdir)/pixmaps/Makefile.in ABOUT-NLS AUTHORS COPYING \ + ChangeLog INSTALL NEWS acconfig.h config.sub depcomp \ + install-sh missing mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -46,7 +46,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = pixmaps/Makefile SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -98,6 +98,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CAM = @ENABLE_CAM@ ENABLE_DAC = @ENABLE_DAC@ +ENABLE_MPI = @ENABLE_MPI@ ENABLE_TRIG = @ENABLE_TRIG@ EXEEXT = @EXEEXT@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ @@ -259,6 +260,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +pixmaps/Makefile: $(top_builddir)/config.status $(top_srcdir)/pixmaps/Makefile.in + cd $(top_builddir) && $(SHELL) ./config.status $@ uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd @@ -396,7 +399,7 @@ distclean-tags: distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) - $(mkdir_p) $(distdir)/po + $(mkdir_p) $(distdir)/pixmaps $(distdir)/po @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ diff --git a/aclocal.m4 b/aclocal.m4 index ff164b0..88388f1 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -446,7 +446,7 @@ fi]) dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml]) -# serial 36 IT_PROG_INTLTOOL +# serial 40 IT_PROG_INTLTOOL AC_DEFUN([IT_PROG_INTLTOOL], [AC_PREREQ([2.50])dnl @@ -462,14 +462,21 @@ if test -n "$1"; then AC_MSG_CHECKING([for intltool >= $1]) INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` - INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { print $ 2; }' ${ac_aux_dir}/intltool-update.in` - [INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split($ 2, VERSION, "."); print VERSION[1] * 1000 + VERSION[2] * 100 + VERSION[3];}' ${ac_aux_dir}/intltool-update.in` + INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` + [INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` ] AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found]) test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" || AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.]) fi +AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update]) +AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge]) +AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract]) +if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then + AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.]) +fi + INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@' @@ -524,12 +531,7 @@ if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then AC_MSG_ERROR([GNU gettext tools not found; required for intltool]) fi -# Use the tools built into the package, not the ones that are installed. -AC_SUBST(INTLTOOL_EXTRACT, '$(top_builddir)/intltool-extract') -AC_SUBST(INTLTOOL_MERGE, '$(top_builddir)/intltool-merge') -AC_SUBST(INTLTOOL_UPDATE, '$(top_builddir)/intltool-update') - -AC_PATH_PROG(INTLTOOL_PERL, perl) +AC_PATH_PROG(INTLTOOL_PERL, [perl]) if test -z "$INTLTOOL_PERL"; then AC_MSG_ERROR([perl not found; required for intltool]) fi @@ -575,42 +577,6 @@ AC_SUBST(DATADIRNAME) IT_PO_SUBDIR([po]) -dnl The following is very similar to -dnl -dnl AC_CONFIG_FILES([intltool-extract intltool-merge intltool-update]) -dnl -dnl with the following slight differences: -dnl - the *.in files are in ac_aux_dir, -dnl - if the file haven't changed upon reconfigure, it's not touched, -dnl - the evaluation of the third parameter enables a hack which computes -dnl the actual value of $libdir, -dnl - the user sees "executing intltool commands", instead of -dnl "creating intltool-extract" and such. -dnl -dnl Nothing crucial here, and we could use AC_CONFIG_FILES, if there were -dnl a reason for it. - -AC_CONFIG_COMMANDS([intltool], [ - -for file in intltool-extract intltool-merge intltool-update; do - sed -e "s|@INTLTOOL_EXTRACT@|`pwd`/intltool-extract|g" \ - -e "s|@INTLTOOL_LIBDIR@|${INTLTOOL_LIBDIR}|g" \ - -e "s|@INTLTOOL_PERL@|${INTLTOOL_PERL}|g" \ - < ${ac_aux_dir}/${file}.in > ${file}.out - if cmp -s ${file} ${file}.out 2>/dev/null; then - rm -f ${file}.out - else - mv -f ${file}.out ${file} - fi - chmod ugo+x ${file} - chmod u+w ${file} -done - -], -[INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir='${ac_aux_dir}' -prefix="$prefix" exec_prefix="$exec_prefix" INTLTOOL_LIBDIR="$libdir" -INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}']) - ]) diff --git a/configure b/configure index 839683a..12e1fa5 100755 --- a/configure +++ b/configure @@ -718,6 +718,9 @@ PO_IN_DATADIR_FALSE POFILES POSUB MKINSTALLDIRS +INTLTOOL_UPDATE +INTLTOOL_MERGE +INTLTOOL_EXTRACT INTLTOOL_DESKTOP_RULE INTLTOOL_DIRECTORY_RULE INTLTOOL_KEYS_RULE @@ -738,9 +741,6 @@ INTLTOOL_THEME_RULE INTLTOOL_SERVICE_RULE INTLTOOL_POLICY_RULE MSGMERGE -INTLTOOL_EXTRACT -INTLTOOL_MERGE -INTLTOOL_UPDATE INTLTOOL_PERL ALL_LINGUAS ENABLE_CAM @@ -755,6 +755,7 @@ OVERRIDE_IMAGE_WIDTH_MAX OVERRIDE_IMAGE_HEIGHT_MAX CANVAS_AA DEBUG +ENABLE_MPI LIBOBJS LTLIBOBJS' ac_subst_files='' @@ -1365,6 +1366,7 @@ Optional Features: --enable-canvas-aa Use Anti Aliased canvas for viewer; slower but better displaying of image and resulting data --enable-debug debug version (more verbose) + --enable-mpi enable Message Protocol Interface (MPI) Some influential environment variables: CC C compiler command @@ -7695,8 +7697,8 @@ if test -n ""; then echo $ECHO_N "checking for intltool >= ... $ECHO_C" >&6; } INTLTOOL_REQUIRED_VERSION_AS_INT=`echo | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` - INTLTOOL_APPLIED_VERSION=`awk -F\" '/\\$VERSION / { print $ 2; }' ${ac_aux_dir}/intltool-update.in` - INTLTOOL_APPLIED_VERSION_AS_INT=`awk -F\" '/\\$VERSION / { split($ 2, VERSION, "."); print VERSION[1] * 1000 + VERSION[2] * 100 + VERSION[3];}' ${ac_aux_dir}/intltool-update.in` + INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3` + INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'` { echo "$as_me:$LINENO: result: $INTLTOOL_APPLIED_VERSION found" >&5 echo "${ECHO_T}$INTLTOOL_APPLIED_VERSION found" >&6; } @@ -7706,6 +7708,132 @@ echo "$as_me: error: Your intltool is too old. You need intltool or later." >& { (exit 1); exit 1; }; } fi +# Extract the first word of "intltool-update", so it can be a program name with args. +set dummy intltool-update; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_INTLTOOL_UPDATE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $INTLTOOL_UPDATE in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_UPDATE="$INTLTOOL_UPDATE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_INTLTOOL_UPDATE="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +INTLTOOL_UPDATE=$ac_cv_path_INTLTOOL_UPDATE +if test -n "$INTLTOOL_UPDATE"; then + { echo "$as_me:$LINENO: result: $INTLTOOL_UPDATE" >&5 +echo "${ECHO_T}$INTLTOOL_UPDATE" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +# Extract the first word of "intltool-merge", so it can be a program name with args. +set dummy intltool-merge; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_INTLTOOL_MERGE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $INTLTOOL_MERGE in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_MERGE="$INTLTOOL_MERGE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_INTLTOOL_MERGE="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +INTLTOOL_MERGE=$ac_cv_path_INTLTOOL_MERGE +if test -n "$INTLTOOL_MERGE"; then + { echo "$as_me:$LINENO: result: $INTLTOOL_MERGE" >&5 +echo "${ECHO_T}$INTLTOOL_MERGE" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +# Extract the first word of "intltool-extract", so it can be a program name with args. +set dummy intltool-extract; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_INTLTOOL_EXTRACT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $INTLTOOL_EXTRACT in + [\\/]* | ?:[\\/]*) + ac_cv_path_INTLTOOL_EXTRACT="$INTLTOOL_EXTRACT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_INTLTOOL_EXTRACT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +INTLTOOL_EXTRACT=$ac_cv_path_INTLTOOL_EXTRACT +if test -n "$INTLTOOL_EXTRACT"; then + { echo "$as_me:$LINENO: result: $INTLTOOL_EXTRACT" >&5 +echo "${ECHO_T}$INTLTOOL_EXTRACT" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then + { { echo "$as_me:$LINENO: error: The intltool scripts were not found. Please install intltool." >&5 +echo "$as_me: error: The intltool scripts were not found. Please install intltool." >&2;} + { (exit 1); exit 1; }; } +fi + INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@' @@ -7881,14 +8009,6 @@ echo "$as_me: error: GNU gettext tools not found; required for intltool" >&2;} { (exit 1); exit 1; }; } fi -# Use the tools built into the package, not the ones that are installed. -INTLTOOL_EXTRACT='$(top_builddir)/intltool-extract' - -INTLTOOL_MERGE='$(top_builddir)/intltool-merge' - -INTLTOOL_UPDATE='$(top_builddir)/intltool-update' - - # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -8101,10 +8221,6 @@ fi -ac_config_commands="$ac_config_commands intltool" - - - @@ -9429,6 +9545,97 @@ fi +# Check whether --enable-mpi was given. +if test "${enable_mpi+set}" = set; then + enableval=$enable_mpi; ENABLE_MPI="-DENABLE_MPI" + +fi + + + +if test "${ENABLE_MPI}" == '-DENABLE_MPI'; then + + +{ echo "$as_me:$LINENO: checking for gpiv_piv_mpi_bcast_pivpar in -lgpiv" >&5 +echo $ECHO_N "checking for gpiv_piv_mpi_bcast_pivpar in -lgpiv... $ECHO_C" >&6; } +if test "${ac_cv_lib_gpiv_gpiv_piv_mpi_bcast_pivpar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgpiv $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gpiv_piv_mpi_bcast_pivpar (); +int +main () +{ +return gpiv_piv_mpi_bcast_pivpar (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_gpiv_gpiv_piv_mpi_bcast_pivpar=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_gpiv_gpiv_piv_mpi_bcast_pivpar=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gpiv_gpiv_piv_mpi_bcast_pivpar" >&5 +echo "${ECHO_T}$ac_cv_lib_gpiv_gpiv_piv_mpi_bcast_pivpar" >&6; } +if test $ac_cv_lib_gpiv_gpiv_piv_mpi_bcast_pivpar = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBGPIV 1 +_ACEOF + + LIBS="-lgpiv $LIBS" + +else + { { echo "$as_me:$LINENO: error: \"gpiv_piv_mpi_bcast_pivpar is not working in libgpiv. \ +Enable MPI in libgpiv or disable it here by leaving out --enable-mpi during ./configure\"" >&5 +echo "$as_me: error: \"gpiv_piv_mpi_bcast_pivpar is not working in libgpiv. \ +Enable MPI in libgpiv or disable it here by leaving out --enable-mpi during ./configure\"" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + + + ac_config_files="$ac_config_files Makefile doc/Makefile doc/C/Makefile doc/C/figures/Makefile src/Makefile po/Makefile.in man/Makefile pixmaps/Makefile" @@ -10048,9 +10255,6 @@ cat >>$CONFIG_STATUS <<_ACEOF # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" -INTLTOOL_PERL='${INTLTOOL_PERL}' ac_aux_dir='${ac_aux_dir}' -prefix="$prefix" exec_prefix="$exec_prefix" INTLTOOL_LIBDIR="$libdir" -INTLTOOL_EXTRACT='${INTLTOOL_EXTRACT}' _ACEOF @@ -10062,7 +10266,6 @@ do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; - "intltool") CONFIG_COMMANDS="$CONFIG_COMMANDS intltool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/C/Makefile") CONFIG_FILES="$CONFIG_FILES doc/C/Makefile" ;; @@ -10278,6 +10481,9 @@ PO_IN_DATADIR_FALSE!$PO_IN_DATADIR_FALSE$ac_delim POFILES!$POFILES$ac_delim POSUB!$POSUB$ac_delim MKINSTALLDIRS!$MKINSTALLDIRS$ac_delim +INTLTOOL_UPDATE!$INTLTOOL_UPDATE$ac_delim +INTLTOOL_MERGE!$INTLTOOL_MERGE$ac_delim +INTLTOOL_EXTRACT!$INTLTOOL_EXTRACT$ac_delim INTLTOOL_DESKTOP_RULE!$INTLTOOL_DESKTOP_RULE$ac_delim INTLTOOL_DIRECTORY_RULE!$INTLTOOL_DIRECTORY_RULE$ac_delim INTLTOOL_KEYS_RULE!$INTLTOOL_KEYS_RULE$ac_delim @@ -10298,9 +10504,6 @@ INTLTOOL_THEME_RULE!$INTLTOOL_THEME_RULE$ac_delim INTLTOOL_SERVICE_RULE!$INTLTOOL_SERVICE_RULE$ac_delim INTLTOOL_POLICY_RULE!$INTLTOOL_POLICY_RULE$ac_delim MSGMERGE!$MSGMERGE$ac_delim -INTLTOOL_EXTRACT!$INTLTOOL_EXTRACT$ac_delim -INTLTOOL_MERGE!$INTLTOOL_MERGE$ac_delim -INTLTOOL_UPDATE!$INTLTOOL_UPDATE$ac_delim INTLTOOL_PERL!$INTLTOOL_PERL$ac_delim ALL_LINGUAS!$ALL_LINGUAS$ac_delim ENABLE_CAM!$ENABLE_CAM$ac_delim @@ -10315,11 +10518,12 @@ OVERRIDE_IMAGE_WIDTH_MAX!$OVERRIDE_IMAGE_WIDTH_MAX$ac_delim OVERRIDE_IMAGE_HEIGHT_MAX!$OVERRIDE_IMAGE_HEIGHT_MAX$ac_delim CANVAS_AA!$CANVAS_AA$ac_delim DEBUG!$DEBUG$ac_delim +ENABLE_MPI!$ENABLE_MPI$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 46; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 47; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -10751,23 +10955,6 @@ done "default-1":C) case "$CONFIG_FILES" in *po/Makefile.in*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile esac ;; - "intltool":C) - -for file in intltool-extract intltool-merge intltool-update; do - sed -e "s|@INTLTOOL_EXTRACT@|`pwd`/intltool-extract|g" \ - -e "s|@INTLTOOL_LIBDIR@|${INTLTOOL_LIBDIR}|g" \ - -e "s|@INTLTOOL_PERL@|${INTLTOOL_PERL}|g" \ - < ${ac_aux_dir}/${file}.in > ${file}.out - if cmp -s ${file} ${file}.out 2>/dev/null; then - rm -f ${file}.out - else - mv -f ${file}.out ${file} - fi - chmod ugo+x ${file} - chmod u+w ${file} -done - - ;; "po/stamp-it":C) rm -f "po/stamp-it" "po/stamp-it.tmp" "po/POTFILES" "po/Makefile.tmp" >"po/stamp-it.tmp" @@ -10847,5 +11034,11 @@ echo "Configuration succesfully finished" echo "" fi fi + + if test $ENABLE_MPI; then + echo "Using Message Passing Interface (MPI)" + echo "for processing on distributed memory systems" + fi + echo "Type 'make' and 'make install' to build and install gpiv" echo "====================================================================" diff --git a/configure.in b/configure.in index 8d3775f..6a0227a 100644 --- a/configure.in +++ b/configure.in @@ -191,6 +191,29 @@ AC_SUBST(DEBUG) +dnl +dnl Enabling Message Passing Interface (MPI) for parallel computing +dnl +AC_ARG_ENABLE(mpi, + [ --enable-mpi enable Message Protocol Interface (MPI)], + [ENABLE_MPI="-DENABLE_MPI"] + ) +AC_SUBST(ENABLE_MPI) + +if test "${ENABLE_MPI}" == '-DENABLE_MPI'; then +dnl ACX_MPI(AC_MSG_WARN("libmpi HAS BEEN installed"), +dnl AC_MSG_ERROR("libmpi IS NOT installed")) + + AC_CHECK_PROG(MPIRUN, mpirun, true, + AC_MSG_ERROR("missing mpirun") + + AC_CHECK_LIB(gpiv, gpiv_piv_mpi_bcast_pivpar, , + AC_MSG_ERROR("gpiv_piv_mpi_bcast_pivpar is not working in libgpiv. \ +Enable MPI in libgpiv or disable it here by leaving out --enable-mpi during ./configure")) +fi + + + dnl GNOME_DISABLE_DEPRECATED="-DGNOME_DISABLE_DEPRECATED" dnl AC_SUBST(GNOME_DISABLE_DEPRECATED) @@ -229,5 +252,11 @@ echo "Configuration succesfully finished" echo "" fi fi + + if test $ENABLE_MPI; then + echo "Using Message Passing Interface (MPI)" + echo "for processing on distributed memory systems" + fi + echo "Type 'make' and 'make install' to build and install gpiv" echo "====================================================================" diff --git a/doc/C/Makefile.in b/doc/C/Makefile.in index 7587202..a440b63 100644 --- a/doc/C/Makefile.in +++ b/doc/C/Makefile.in @@ -92,6 +92,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CAM = @ENABLE_CAM@ ENABLE_DAC = @ENABLE_DAC@ +ENABLE_MPI = @ENABLE_MPI@ ENABLE_TRIG = @ENABLE_TRIG@ EXEEXT = @EXEEXT@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ diff --git a/doc/C/figures/Makefile.in b/doc/C/figures/Makefile.in index 4b3690c..8c8d49b 100644 --- a/doc/C/figures/Makefile.in +++ b/doc/C/figures/Makefile.in @@ -83,6 +83,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CAM = @ENABLE_CAM@ ENABLE_DAC = @ENABLE_DAC@ +ENABLE_MPI = @ENABLE_MPI@ ENABLE_TRIG = @ENABLE_TRIG@ EXEEXT = @EXEEXT@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ diff --git a/doc/Makefile.in b/doc/Makefile.in index 2f09800..6863d18 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -82,6 +82,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CAM = @ENABLE_CAM@ ENABLE_DAC = @ENABLE_DAC@ +ENABLE_MPI = @ENABLE_MPI@ ENABLE_TRIG = @ENABLE_TRIG@ EXEEXT = @EXEEXT@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ diff --git a/man/Makefile.in b/man/Makefile.in index 9f28431..de4b6df 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -77,6 +77,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CAM = @ENABLE_CAM@ ENABLE_DAC = @ENABLE_DAC@ +ENABLE_MPI = @ENABLE_MPI@ ENABLE_TRIG = @ENABLE_TRIG@ EXEEXT = @EXEEXT@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ diff --git a/po/Makefile.in.in b/po/Makefile.in.in index 6891e8f..e0a2203 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -56,9 +56,9 @@ ALL_LINGUAS = @ALL_LINGUAS@ PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi) -USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi) +USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep ^$$lang$$`"; then printf "$$lang "; fi; done; fi) -USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) +USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done) POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done) @@ -101,7 +101,6 @@ install: install-data install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all - $(mkdir_p) $(DESTDIR)$(itlocaledir) linguas="$(USE_LINGUAS)"; \ for lang in $$linguas; do \ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \ diff --git a/src/Makefile.am b/src/Makefile.am index 6888d56..47d75ad 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,6 +5,7 @@ pixmapsdir = $(datadir)/pixmaps/ ENABLE_CAM = @ENABLE_CAM@ ENABLE_TRIG = @ENABLE_TRIG@ ENABLE_DAC = @ENABLE_DAC@ +ENABLE_MPI = @ENABLE_MPI@ CANVAS_AA = @CANVAS_AA@ RTA_TOPDIR = @RTA_TOPDIR@ K_TOPDIR = @K_TOPDIR@ @@ -67,6 +68,7 @@ AM_CFLAGS = @OVERRIDE_IMAGE_WIDTH_MAX@ \ @ENABLE_CAM@ \ @ENABLE_TRIG@ \ @ENABLE_DAC@ \ +@ENABLE_MPI@ \ @CANVAS_AA@ ## @GNOME_DISABLE_DEPRECATED@ \ diff --git a/src/Makefile.in b/src/Makefile.in index 2f1730e..4764746 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -36,7 +36,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : bin_PROGRAMS = gpiv$(EXEEXT) subdir = src -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -106,6 +106,7 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ENABLE_CAM = @ENABLE_CAM@ ENABLE_DAC = @ENABLE_DAC@ +ENABLE_MPI = @ENABLE_MPI@ ENABLE_TRIG = @ENABLE_TRIG@ EXEEXT = @EXEEXT@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ @@ -277,6 +278,7 @@ AM_CFLAGS = @OVERRIDE_IMAGE_WIDTH_MAX@ \ @ENABLE_CAM@ \ @ENABLE_TRIG@ \ @ENABLE_DAC@ \ +@ENABLE_MPI@ \ @CANVAS_AA@ gpiv_LDADD = $(GPIV_LIBS) diff --git a/src/gpiv_gui.h b/src/gpiv_gui.h index 0486c88..25af54e 100644 --- a/src/gpiv_gui.h +++ b/src/gpiv_gui.h @@ -28,6 +28,9 @@ /* * Graphical User Interface for gpiv * $Log: gpiv_gui.h,v $ + * Revision 1.5 2008-09-25 13:32:22 gerber + * Adapted for use on cluster (using MPI/OMP) parallelised gpiv_rr from gpivtools) + * * Revision 1.4 2008-09-16 10:13:56 gerber * 2nd update because of cvs conflict * @@ -102,7 +105,7 @@ /* Revision Control System (RCS) version */ -#define RCSID "$Id: gpiv_gui.h,v 1.4 2008-09-16 10:13:56 gerber Exp $" +#define RCSID "$Id: gpiv_gui.h,v 1.5 2008-09-25 13:32:22 gerber Exp $" #define ERR_IVAL = 99 /* Some arbitrary integer error value */ #define ADJ_MIN -50.0 /* minimum value for adjustment */ #define ADJ_MAX 50.0 /* maximum value for adjustment */ @@ -113,6 +116,10 @@ #define MAX_LIST 5 +#ifdef ENABLE_MPI +#define MPIRUN_CMD "mpirun -np 6" +#endif + /* * SVGA: 1280 x 1024 * Sony PCR-100 video camera: 1152 x 864 diff --git a/src/piveval_interrogate.c b/src/piveval_interrogate.c index 5098c47..f131a44 100644 --- a/src/piveval_interrogate.c +++ b/src/piveval_interrogate.c @@ -25,6 +25,9 @@ ----------------------------------------------------------------------*/ /* $Log: piveval_interrogate.c,v $ +/* Revision 1.2 2008-09-25 13:32:22 gerber +/* Adapted for use on cluster (using MPI/OMP) parallelised gpiv_rr from gpivtools) +/* /* Revision 1.1 2008-09-16 10:17:36 gerber /* added piveval_interrogate routines /* @@ -75,6 +78,12 @@ update_pivdata_imgdeform_zoff (const GpivImage *image, gboolean verbose ); +static GpivPivData * +exec_piv_mpi (GpivImage *image, + GpivPivPar *piv_par, + GpivValidPar *valid_par + ); + /* * Program-wide public piv interrogation functions */ @@ -179,28 +188,39 @@ This will be reset automatically."), } gpiv_valid_print_parameters (stdout, display_act->pida->valid_par); +#ifdef USE_LIBGPIV_INTERR +#undef USE_LIBGPIV_INTERR +#endif + if ((display_act->pida->piv_data = -#define USE_MY_INTERR -#ifdef USE_MY_INTERR -/* Gpiv's own function for image interrogation */ - interrogate_img (display_act->img->image, - display_act->pida->piv_par, - display_act->pida->valid_par, - gpiv) -#else -/* Library function */ +#ifdef ENABLE_MPI +/* Calling extern tool gpiv_rr from gpivtools with MPI enabled */ + exec_piv_mpi(display_act->img->image, + display_act->pida->piv_par, + display_act->pida->valid_par) + +#elif USE_LIBGPIV_INTERR +/* Libgpiv's function for image interrogation */ gpiv_piv_interrogate_img (display_act->img->image, display_act->pida->piv_par, display_act->pida->valid_par, TRUE) -#endif -#ifdef USE_MY_INTERR -#undef USE_MY_INTERR +#else +/* Gpiv's function for image interrogation */ + interrogate_img (display_act->img->image, + display_act->pida->piv_par, + display_act->pida->valid_par, + gpiv) #endif ) == NULL) { warning_gpiv ("exec_piv: failing interrogate_img"); return; } + +#ifdef USE_LIBGPIV_INTERR +#undef USE_LIBGPIV_INTERR +#endif + display_act->pida->exist_piv = TRUE; /* @@ -875,3 +895,98 @@ update_pivdata_imgdeform_zoff (const GpivImage *image, } + +static GpivPivData * +exec_piv_mpi (GpivImage *image, + GpivPivPar *piv_par, + GpivValidPar *valid_par + ) +/*----------------------------------------------------------------------------- + * Interrogates an image on a distributed memory (Beowulf) cluster + * using gpiv_rr from the gpivtools package + */ +{ + GpivPivData *pd = NULL; + FILE *fp = NULL; + gchar *command = NULL; + const gchar *tmp_dir = g_get_tmp_dir (); + const gchar *user_name = g_get_user_name (); + const gchar *basename = "gpiv_mpi"; + + /* + * Save image at tmp/ + */ + gchar *image_name = + g_strdup_printf ("%s/%s/%s.png" ,tmp_dir, + user_name, basename); + gchar *pivdata_name = + g_strdup_printf ("%s/%s/%s.piv" ,tmp_dir, + user_name, basename); + gchar *par_name = + g_strdup_printf ("%s/%s/%s.par" ,tmp_dir, + user_name, basename); + + g_message ("exec_piv_mpi: image name = %s, piv name = %s", + image_name, pivdata_name); + + if ((fp = fopen (image_name, "w")) == NULL) { + warning_gpiv ("OPEN_PIV: failing fopen %s", image_name); + } + gpiv_write_png_image (fp, image, FALSE); + fclose (fp); + + /* + * Run parallellised gpiv_rr + */ + command = + g_strdup_printf ("%s gpiv_rr -p \ +--cf %d --cl %d --cp %d \ +--rf %d --rl %d --rp %d \ +--ia_size_i %d --ia_size_f %d \ +--ia_shift %d --ischeme %d \ +--ifit %d --peak %d \ +--val_r %d --val_s %d --val_t %f", + MPIRUN_CMD, + piv_par->col_start, piv_par->col_end, piv_par->pre_shift_col, + piv_par->row_start, piv_par->row_end, piv_par->pre_shift_row, + piv_par->int_size_i, piv_par->int_size_f, + piv_par->int_shift, piv_par->int_scheme, + piv_par->ifit, piv_par->peak, + valid_par->residu_type, valid_par->subst_type, valid_par->residu_max); + + g_message ("exec_piv_mpi: 0"); + if (piv_par->spof_filter) { + command = g_strconcat (command, " --spof ", image_name, NULL); + } else { + command = g_strconcat (command, " ", image_name, NULL); + } + + g_message ("exec_piv_mpi: command = %s", command); + + + if (system (command) != 0) { + error_gpiv ("exec_piv: could not exec shell command:\n %s", command); + } + g_free (command); + g_message ("exec_piv_mpi: 1"); + + /* + * Obtain PIV-data from tmp/ + */ + pd = gpiv_fread_pivdata(pivdata_name); + + /* + * Cleanup image and data from tmp/ + */ + command = g_strdup_printf ("rm %s %s %s", image_name, pivdata_name, par_name); + if (system (command) != 0) { + error_gpiv ("exec_piv: could not exec shell command:\n %s", command); + } + + + g_free (command); + g_free (image_name); + g_free (pivdata_name); + return pd; +} + -- 2.11.4.GIT